Anonymous avatar Anonymous committed ad5943f Merge

rebase m73

Comments (0)

Files changed (27)

offapi/com/sun/star/drawing/Shape.idl

 	//-------------------------------------------------------------------------
 
 	/** If this is <FALSE/>, the <type>Shape</type> is not visible
+		on screen outputs.
+	 */
+	[optional, property] boolean Visible; 
+
+	//-------------------------------------------------------------------------
+
+	/** If this is <FALSE/>, the <type>Shape</type> is not visible
 		on printer outputs.
 	 */
 	[optional, property] boolean Printable;

svx/inc/svdstr.hrc

 #define	SIP_SA_CIRCRESERVE1					(SIP_Begin + 177)
 #define	SIP_SA_CIRCRESERVE2					(SIP_Begin + 178)
 #define	SIP_SA_CIRCRESERVE3					(SIP_Begin + 179)
-//BFS01#define	SIP_SDRATTRSET_CIRC					(SIP_Begin + 180)
+#define	SIP_SA_OBJVISIBLE					(SIP_Begin + 180)
 #define	SIP_SA_OBJMOVEPROTECT				(SIP_Begin + 181)
 #define	SIP_SA_OBJSIZEPROTECT				(SIP_Begin + 182)
 #define	SIP_SA_OBJPRINTABLE					(SIP_Begin + 183)

svx/inc/svx/svddef.hxx

 #define SDRATTR_TRANSFORMREF2X      (SDRATTR_NOTPERSIST_FIRST+32)  /*   1212  long,   def=0     */
 #define SDRATTR_TRANSFORMREF2Y      (SDRATTR_NOTPERSIST_FIRST+33)  /*   1213  long,   def=0     */
 #define SDRATTR_TEXTDIRECTION		(SDRATTR_NOTPERSIST_FIRST+34)  /*   1214 V4+++  long,   def=0     */
-#define SDRATTR_NOTPERSIST_LAST     (SDRATTR_TEXTDIRECTION)  /*	1228 V4+++*/ /*	1213*/	/*	1085 */ /*	1040 */ /*	1123 */ /* Pool V1: 1065 */
+#define SDRATTR_OBJVISIBLE			(SDRATTR_NOTPERSIST_FIRST+35)
+#define SDRATTR_NOTPERSIST_LAST     (SDRATTR_OBJVISIBLE)		   /*	1228 V4+++*/ /*	1213*/	/*	1085 */ /*	1040 */ /*	1123 */ /* Pool V1: 1065 */
 // kein SetItem hierfuer
 
 #define SDRATTR_GRAF_FIRST			(SDRATTR_NOTPERSIST_LAST+1)		/*	1229 V4+++*/

svx/inc/svx/svdobj.hxx

 	BOOL						bSizProt;
 	BOOL						bNoPrint;
 	BOOL						bClosedObj;
+	bool						mbVisible;
 	SdrLayerID					mnLayerID;
 
 public:
 	unsigned					bGrouped : 1;   // Member eines GroupObjektes?
 
 	// Die folgende Flags werden gestreamt
-	unsigned					bMovProt : 1; // Position geschuetzt
-	unsigned					bSizProt : 1; // Groesse geschuetzt
-	unsigned					bNoPrint : 1; // Nicht drucken
-
+	unsigned					bMovProt : 1; // If true, the position is protected
+	unsigned					bSizProt : 1; // If true, the size is protected
+	unsigned					bNoPrint : 1; // If true, the object is not printed.
+	unsigned					mbVisible : 1; // If false, the object is not visible on screen (but maybe on printer, depending on bNoprint
 	// Wenn bEmptyPresObj TRUE ist, handelt es sich um ein
 	// Praesentationsobjekt, dem noch kein Inhalt zugewiesen
 	// wurde. Default ist das Flag auf FALSE. Die Verwaltung
 	sal_Bool IsResizeProtect() const { return bSizProt; }
 	void SetPrintable(sal_Bool bPrn);
 	sal_Bool IsPrintable() const { return !bNoPrint; }
+	void SetVisible(sal_Bool bVisible);
+	sal_Bool IsVisible() const { return mbVisible; }
 	void SetEmptyPresObj(sal_Bool bEpt) { bEmptyPresObj=bEpt; }
 	sal_Bool IsEmptyPresObj() const { return bEmptyPresObj; }
 	void SetNotVisibleAsMaster(sal_Bool bFlg) { bNotVisibleAsMaster=bFlg; }

svx/inc/svx/sxopitm.hxx

 	SdrObjPrintableItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJPRINTABLE,rIn) {}
 };
 
+class SdrObjVisibleItem: public SdrYesNoItem {
+public:
+	SdrObjVisibleItem(bool bOn=true): SdrYesNoItem(SDRATTR_OBJVISIBLE,bOn) {}
+	SdrObjVisibleItem(SvStream& rIn): SdrYesNoItem(SDRATTR_OBJVISIBLE,rIn) {}
+};
+
 #endif

svx/inc/svx/unoshprp.hxx

 	{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_MOVEPROTECT),	SDRATTR_OBJMOVEPROTECT			, &::getBooleanCppuType(),						0,	0}, \
 	{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_NAME),			SDRATTR_OBJECTNAME				, &::getCppuType((const ::rtl::OUString*)0),	0,	0}, \
 	{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_PRINTABLE),	SDRATTR_OBJPRINTABLE			, &::getBooleanCppuType(),						0,	0}, \
+	{ MAP_CHAR_LEN("Visible"),						SDRATTR_OBJVISIBLE				, &::getBooleanCppuType(),						0,	0}, \
 	{ MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_SIZEPROTECT),	SDRATTR_OBJSIZEPROTECT			, &::getBooleanCppuType(),						0,	0},\
 	{ MAP_CHAR_LEN("UINameSingular"),				OWN_ATTR_UINAME_SINGULAR		, &::getCppuType((const ::rtl::OUString*)0),	::com::sun::star::beans::PropertyAttribute::READONLY,	0}, \
 	{ MAP_CHAR_LEN("UINamePlural"),					OWN_ATTR_UINAME_PLURAL			, &::getCppuType((const ::rtl::OUString*)0),	::com::sun::star::beans::PropertyAttribute::READONLY,	0},	\

svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx

 				return false;
 			}
 
-			// Test if print output but not printable
-			if(GetObjectContact().isOutputToPrinter() && !rObject.IsPrintable())
+			if(GetObjectContact().isOutputToPrinter() )
 			{
-				return false;
+				// Test if print output but not printable
+				if( !rObject.IsPrintable())
+					return false;
+			}
+			else
+			{
+				// test is object is not visible on screen
+				if( !rObject.IsVisible() )
+					return false;
 			}
 
 			// Test for hidden object on MasterPage

svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx

         {
             // the layer of our object
             SdrLayerID nObjectLayer = _rUnoObject.GetLayer();
-            // is the layer we're residing in visible in this view?
-            bool bIsObjectLayerVisible = _rPageView.isLayerVisible( nObjectLayer );
+            // is the object we're residing in visible in this view?
+            bool bIsObjectVisible = _rUnoObject.IsVisible() && _rPageView.isLayerVisible( nObjectLayer );
 
-            if ( _bForce || ( bIsObjectLayerVisible != _bIsCurrentlyVisible ) )
+            if ( _bForce || ( bIsObjectVisible != _bIsCurrentlyVisible ) )
             {
-                _rControl.setVisible( bIsObjectLayerVisible );
+                _rControl.setVisible( bIsObjectVisible );
             }
         }
     }
 
             if(pSdrPageView)
             {
-                const bool bIsLayerVisible(pSdrPageView->GetVisibleLayers().IsSet(getSdrObject().GetLayer()));
+				const SdrObject& rObject = getSdrObject();
+                const bool bIsLayerVisible( rObject.IsVisible() && pSdrPageView->GetVisibleLayers().IsSet(rObject.GetLayer()));
 
                 if(rControl.isVisible() != bIsLayerVisible)
                 {

svx/source/svdraw/sdrhittesthelper.cxx

     }
 	else
 	{
-		if(!pVisiLayer || pVisiLayer->IsSet(rObject.GetLayer()))
+		if( rObject.IsVisible() && (!pVisiLayer || pVisiLayer->IsSet(rObject.GetLayer())))
 		{
 			// single object, 3d object, empty scene or empty group. Check if 
             // it's a single 3D object

svx/source/svdraw/svdattr.cxx

 	mppLocalPoolDefaults[SDRATTR_OBJMOVEPROTECT -SDRATTR_START]=new SdrObjMoveProtectItem;
 	mppLocalPoolDefaults[SDRATTR_OBJSIZEPROTECT -SDRATTR_START]=new SdrObjSizeProtectItem;
 	mppLocalPoolDefaults[SDRATTR_OBJPRINTABLE   -SDRATTR_START]=new SdrObjPrintableItem;
+	mppLocalPoolDefaults[SDRATTR_OBJVISIBLE		-SDRATTR_START]=new SdrObjVisibleItem;
 	mppLocalPoolDefaults[SDRATTR_LAYERID        -SDRATTR_START]=new SdrLayerIdItem;
 	mppLocalPoolDefaults[SDRATTR_LAYERNAME      -SDRATTR_START]=new SdrLayerNameItem;
 	mppLocalPoolDefaults[SDRATTR_OBJECTNAME     -SDRATTR_START]=new SdrObjectNameItem;
 		case SDRATTR_OBJMOVEPROTECT : nResId = SIP_SA_OBJMOVEPROTECT;break;
 		case SDRATTR_OBJSIZEPROTECT : nResId = SIP_SA_OBJSIZEPROTECT;break;
 		case SDRATTR_OBJPRINTABLE   : nResId = SIP_SA_OBJPRINTABLE;break;
+		case SDRATTR_OBJVISIBLE		: nResId = SIP_SA_OBJVISIBLE;break;
 		case SDRATTR_LAYERID        : nResId = SIP_SA_LAYERID;break;
 		case SDRATTR_LAYERNAME      : nResId = SIP_SA_LAYERNAME;break;
 		case SDRATTR_OBJECTNAME     : nResId = SIP_SA_OBJECTNAME;break;

svx/source/svdraw/svdedtv1.cxx

 	BOOL bMovProtect=FALSE,bMovProtectDC=FALSE;
 	BOOL bSizProtect=FALSE,bSizProtectDC=FALSE;
 	BOOL bPrintable =TRUE ,bPrintableDC=FALSE;
+	BOOL bVisible = TRUE, bVisibleDC=FALSE;
 	SdrLayerID nLayerId=0; BOOL bLayerDC=FALSE;
 	XubString aObjName;     BOOL bObjNameDC=FALSE,bObjNameSet=FALSE;
 	long nSnapPosX=0;      BOOL bSnapPosXDC=FALSE;
 			bMovProtect=pObj->IsMoveProtect();
 			bSizProtect=pObj->IsResizeProtect();
 			bPrintable =pObj->IsPrintable();
+			bVisible = pObj->IsVisible();
 			Rectangle aSnapRect2(pObj->GetSnapRect());
 			Rectangle aLogicRect2(pObj->GetLogicRect());
 			nSnapPosX=aSnapRect2.Left();
 			if (!bMovProtectDC && bMovProtect!=pObj->IsMoveProtect())   bMovProtectDC=TRUE;
 			if (!bSizProtectDC && bSizProtect!=pObj->IsResizeProtect()) bSizProtectDC=TRUE;
 			if (!bPrintableDC  && bPrintable !=pObj->IsPrintable())     bPrintableDC=TRUE;
+			if (!bVisibleDC	   && bVisible !=pObj->IsVisible())         bVisibleDC=TRUE;
 			if (!bRotAngleDC   && nRotAngle  !=pObj->GetRotateAngle())  bRotAngleDC=TRUE;
 			if (!bShrAngleDC   && nShrAngle  !=pObj->GetShearAngle())   bShrAngleDC=TRUE;
 			if (!bSnapWdtDC || !bSnapHgtDC || !bSnapPosXDC || !bSnapPosYDC || !bLogicWdtDiff || !bLogicHgtDiff) {
 	rAttr.Put(SdrRotateOneItem());
 	rAttr.Put(SdrHorzShearOneItem());
 	rAttr.Put(SdrVertShearOneItem());
+
 	if (nMarkAnz>1) {
 		rAttr.Put(SdrResizeXAllItem());
 		rAttr.Put(SdrResizeYAllItem());

svx/source/svdraw/svdmrkv.cxx

 		}
 		bRaus=bRaus || pPV->GetLockedLayers().IsSet(nLay) ||  // Layer gesperrt?
 					   !pPV->GetVisibleLayers().IsSet(nLay);  // Layer nicht sichtbar?
+
+		if( !bRaus )
+			bRaus = !pObj->IsVisible(); // not visible objects can not be marked
+
 		if (!bRaus) {
 			// Joe am 9.3.1997: Gruppierte Objekten koennen nun auch
 			// markiert werden. Nach EnterGroup muessen aber die Objekte
 #define SDRSEARCH_IMPISMASTER 0x80000000 /* MasterPage wird gerade durchsucht */
 SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, USHORT nTol, SdrObject* pObj, SdrPageView* pPV, ULONG nOptions, const SetOfByte* pMVisLay) const
 {
-	if((nOptions & SDRSEARCH_IMPISMASTER) && pObj->IsNotVisibleAsMaster()) 
+	if(((nOptions & SDRSEARCH_IMPISMASTER) && pObj->IsNotVisibleAsMaster()) || (!pObj->IsVisible()))
     {
 		return NULL;
 	}

svx/source/svdraw/svdobj.cxx

 	bSizProt(FALSE),
 	bNoPrint(FALSE),
 	bClosedObj(FALSE),
+	mbVisible(true),
 	mnLayerID(0)
 {
 	DBG_CTOR(SdrObjGeoData,NULL);
 	bEmptyPresObj    =FALSE;
 	bNotVisibleAsMaster=FALSE;
 	bClosedObj       =FALSE;
+	mbVisible		 = true;
 
 	// #i25616#
 	mbLineIsOutsideGeometry = sal_False;
 	bSizProt=rObj.bSizProt;
 	bMovProt=rObj.bMovProt;
 	bNoPrint=rObj.bNoPrint;
+	mbVisible=rObj.mbVisible;
 	bMarkProt=rObj.bMarkProt;
 	//EmptyPresObj wird nicht kopiert: nun doch! (25-07-1995, Joe)
 	bEmptyPresObj =rObj.bEmptyPresObj;
 	rGeo.bMovProt      =bMovProt      ;
 	rGeo.bSizProt      =bSizProt      ;
 	rGeo.bNoPrint      =bNoPrint      ;
+	rGeo.mbVisible	   =mbVisible     ;
 	rGeo.bClosedObj    =bClosedObj    ;
 	rGeo.mnLayerID = mnLayerID;
 
 	bMovProt      =rGeo.bMovProt      ;
 	bSizProt      =rGeo.bSizProt      ;
 	bNoPrint      =rGeo.bNoPrint      ;
+	mbVisible     =rGeo.mbVisible     ;
 	bClosedObj    =rGeo.bClosedObj    ;
 	mnLayerID = rGeo.mnLayerID;
 
 		SetPrintable(b);
 	}
 
+	if (rAttr.GetItemState(SDRATTR_OBJVISIBLE,TRUE,&pPoolItem)==SFX_ITEM_SET) {
+		bool b=((const SdrObjVisibleItem*)pPoolItem)->GetValue();
+		SetVisible(b);
+	}
+
 	SdrLayerID nLayer=SDRLAYER_NOTFOUND;
 	if (rAttr.GetItemState(SDRATTR_LAYERID,TRUE,&pPoolItem)==SFX_ITEM_SET) {
 		nLayer=((const SdrLayerIdItem*)pPoolItem)->GetValue();
 	lcl_SetItem(rAttr,bMerge,SdrObjMoveProtectItem(IsMoveProtect()));
 	lcl_SetItem(rAttr,bMerge,SdrObjSizeProtectItem(IsResizeProtect()));
 	lcl_SetItem(rAttr,bMerge,SdrObjPrintableItem(IsPrintable()));
+	lcl_SetItem(rAttr,bMerge,SdrObjVisibleItem(IsVisible()));
 	lcl_SetItem(rAttr,bMerge,SdrRotateAngleItem(GetRotateAngle()));
 	lcl_SetItem(rAttr,bMerge,SdrShearAngleItem(GetShearAngle()));
 	lcl_SetItem(rAttr,bMerge,SdrOneSizeWidthItem(rSnap.GetWidth()-1));
 
 void SdrObject::SetPrintable(sal_Bool bPrn)
 {
-	bNoPrint=!bPrn;
-	SetChanged();
-	if (IsInserted() && pModel!=NULL) {
-		SdrHint aHint(*this);
-		pModel->Broadcast(aHint);
+	if( bPrn != bNoPrint )
+	{
+		bNoPrint=!bPrn;
+		SetChanged();
+		if (IsInserted() && pModel!=NULL)
+		{
+			SdrHint aHint(*this);
+			pModel->Broadcast(aHint);
+		}
+	}
+}
+
+void SdrObject::SetVisible(sal_Bool bVisible)
+{
+	if( bVisible != mbVisible )
+	{
+		mbVisible = bVisible;
+		SetChanged();
+		if (IsInserted() && pModel!=NULL)
+		{
+			SdrHint aHint(*this);
+			pModel->Broadcast(aHint);
+		}
 	}
 }
 

svx/source/svdraw/svdoedge.cxx

 		// Problem: Gruppenobjekt mit verschiedenen Layern liefert LayerID 0 !!!!
 		no--;
 		SdrObject* pObj=pOL->GetObj(no);
-		if (rVisLayer.IsSet(pObj->GetLayer()) &&       // nur sichtbare Objekte
+		if (rVisLayer.IsSet(pObj->GetLayer()) && pObj->IsVisible() &&      // only visible objects
 			(pThis==NULL || pObj!=(SdrObject*)pThis) && // nicht an mich selbst connecten
 			pObj->IsNode())
 		{

svx/source/svdraw/svdpagv.cxx

 			return sal_False;
 		}
 
+		// only visible are markable
+		if( !pObj->IsVisible() )
+		{
+			return sal_False;
+		}
+
 		// #112440#
 		if(pObj->ISA(SdrObjGroup))
 		{

svx/source/svdraw/svdstr.src

 	Text [ en-US ] = "Object, printable";
 };
 
+String SIP_SA_OBJVISIBLE
+{
+	Text [ en-US ] = "Object, visible";
+};
+
 String SIP_SA_LAYERID
 {
 	Text [ en-US ] = "Level ID";

svx/source/unodraw/unoshape.cxx

 		}
 		break;
 	}
+	case SDRATTR_OBJVISIBLE:
+	{
+		sal_Bool bVisible = sal_Bool();
+		if( rValue >>= bVisible )
+		{
+			mpObj->SetVisible(bVisible);
+			return true;
+		}
+		break;
+	}
 	case SDRATTR_OBJSIZEPROTECT:
 	{
 		sal_Bool bResizeProtect = sal_Bool();
 	}
 
 	case SDRATTR_OBJPRINTABLE:
-		rValue = uno::makeAny( (sal_Bool) mpObj->IsPrintable() );
+		rValue <<= static_cast<sal_Bool>( mpObj->IsPrintable() );
 		break;
 
+	case SDRATTR_OBJVISIBLE:
+		rValue <<= static_cast<sal_Bool>( mpObj->IsVisible() );
+		break;
+
 	case SDRATTR_OBJSIZEPROTECT:
-		rValue = uno::makeAny( (sal_Bool)mpObj->IsResizeProtect() );
+		rValue <<= static_cast<sal_Bool>( mpObj->IsResizeProtect() );
 		break;
 
 	case OWN_ATTR_PAGE_NUMBER:

xmloff/inc/xmlnmspe.hxx

 
 XML_NAMESPACE_EXT( OFFICE,      37U )
 XML_NAMESPACE_EXT( TABLE,       38U )
+XML_NAMESPACE_EXT( DRAW,		39U )
 
-#define _XML_OLD_NAMESPACE_BASE 39U
+#define _XML_OLD_NAMESPACE_BASE 40U
 
 // namespaces used in the technical preview (SO 5.2)
 XML_OLD_NAMESPACE( FO,		0U )

xmloff/inc/xmloff/shapeexport.hxx

 	SAL_DLLPRIVATE UniReference< SvXMLExportPropertyMapper > GetPropertySetMapper() const { return mxPropertySetMapper;	}
 
 	const rtl::OUString							msZIndex;
+	const rtl::OUString							msPrintable;
+	const rtl::OUString							msVisible;
+
 	const rtl::OUString							msEmptyPres;
 	const rtl::OUString							msModel;
 	const rtl::OUString							msStartShape;

xmloff/inc/xmloff/xmltoken.hxx

 
         XML_NP_TABLE_EXT,
         XML_N_TABLE_EXT,
-        
+
+        XML_NP_DRAW_EXT,
+        XML_N_DRAW_EXT,
+
         // units
         XML_UNIT_MM,
         XML_UNIT_M,
         XML_DIMENSION,
         XML_VALIDATION_NAME,
 
+		XML_SCREEN,
+		XML_PRINTER,
+
         // XForms tokens
         // already defined: XML_ACTION, XML_VERSION, XML_ENCODING,
         //                  XML_REPLACE, XML_SEPARATOR, XML_TYPE, XML_ID

xmloff/source/core/xmlexp.cxx

 		mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOC),  GetXMLToken(XML_N_OOOC),    XML_NAMESPACE_OOOC );
 		mpNamespaceMap->Add( GetXMLToken(XML_NP_OF),    GetXMLToken(XML_N_OF),      XML_NAMESPACE_OF );
 
-        if (getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST)
+        if (getDefaultVersion() > SvtSaveOptions::ODFVER_012)
         {
             mpNamespaceMap->Add(
                 GetXMLToken(XML_NP_TABLE_EXT), GetXMLToken(XML_N_TABLE_EXT), XML_NAMESPACE_TABLE_EXT);

xmloff/source/core/xmlimp.cxx

 sal_Char __READONLY_DATA sXML_np__table[] = "_table";
 sal_Char __READONLY_DATA sXML_np__table_ext[] = "_table_ooo";
 sal_Char __READONLY_DATA sXML_np__draw[] = "_draw";
+sal_Char __READONLY_DATA sXML_np__draw_ext[] = "_draw_ooo";
 sal_Char __READONLY_DATA sXML_np__dr3d[] = "_dr3d";
 sal_Char __READONLY_DATA sXML_np__fo[] = "_fo";
 sal_Char __READONLY_DATA sXML_np__xlink[] = "_xlink";
 		mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__draw ) ),
 							GetXMLToken(XML_N_DRAW),
 							XML_NAMESPACE_DRAW );
+		mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__draw_ext ) ),
+							GetXMLToken(XML_N_DRAW_EXT),
+							XML_NAMESPACE_DRAW_EXT );
 		mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM (sXML_np__dr3d ) ),
 							GetXMLToken(XML_N_DR3D),
 							XML_NAMESPACE_DR3D );

xmloff/source/core/xmltoken.cxx

         TOKEN( "tableooo", XML_NP_TABLE_EXT ),
         TOKEN( "http://openoffice.org/2009/table", XML_N_TABLE_EXT ),
 
+        TOKEN( "drawooo", XML_NP_DRAW_EXT ),
+        TOKEN( "http://openoffice.org/2010/draw", XML_N_DRAW_EXT ),
+
         // units
         TOKEN( "mm",                              XML_UNIT_MM ),
         TOKEN( "m",                               XML_UNIT_M ),
         TOKEN( "dimension",                    XML_DIMENSION ),
         TOKEN( "validation-name",				XML_VALIDATION_NAME ),
 
+		TOKEN( "screen",					   XML_SCREEN ),
+		TOKEN( "printer",					   XML_PRINTER ),
+
         // XForms token
         TOKEN( "model",                            XML_MODEL ),
         TOKEN( "schema",                           XML_SCHEMA ),

xmloff/source/draw/sdxmlexp.cxx

         GetXMLToken(XML_N_ANIMATION), 
 		XML_NAMESPACE_ANIMATION);
 
-    if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST )
+    if( getDefaultVersion() > SvtSaveOptions::ODFVER_12 )
     {
 	    _GetNamespaceMap().Add(
 		    GetXMLToken(XML_NP_OFFICE_EXT),
             GetXMLToken(XML_N_OFFICE_EXT), 
 		    XML_NAMESPACE_OFFICE_EXT);
-    }
+
+	    _GetNamespaceMap().Add(
+		    GetXMLToken(XML_NP_DRAW_EXT),
+            GetXMLToken(XML_N_DRAW_EXT), 
+		    XML_NAMESPACE_DRAW_EXT);
+	}
 
 	GetShapeExport()->enableLayerExport();
 
 void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage )
 {
     // do not export in ODF 1.2 or older
-    if( getDefaultVersion() != SvtSaveOptions::ODFVER_LATEST )
+    if( getDefaultVersion() <= SvtSaveOptions::ODFVER_012 )
         return;
         
     Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );

xmloff/source/draw/shapeexport.cxx

 	// #88546# init to FALSE
 	mbHandleProgressBar( sal_False ),
 	msZIndex( RTL_CONSTASCII_USTRINGPARAM("ZOrder") ),
+	msPrintable( RTL_CONSTASCII_USTRINGPARAM("Pintable") ),
+	msVisible( RTL_CONSTASCII_USTRINGPARAM("Visible") ),
 	msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ),
 	msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ),
 	msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
 		}
 	}
 
+	// export draw:display (do not export in ODF 1.2 or older)
+	if( xSet.is() && ( mrExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) )
+	{
+		try
+		{
+			sal_Bool bVisible = sal_True;
+			sal_Bool bPrintable = sal_True;
+
+			xSet->getPropertyValue(msVisible) >>= bVisible;
+			xSet->getPropertyValue(msPrintable) >>= bPrintable;
+
+			XMLTokenEnum eDisplayToken = XML_TOKEN_INVALID;
+			switch( (bVisible << 1) | bPrintable )
+			{
+			case 0: eDisplayToken = XML_NONE; break;
+			case 1: eDisplayToken = XML_PRINTER; break;
+			case 2: eDisplayToken = XML_SCREEN; break;
+			// case 3: eDisplayToken = XML_ALWAYS break; this is the default
+			}
+
+			if( eDisplayToken != XML_TOKEN_INVALID )
+				mrExport.AddAttribute(XML_NAMESPACE_DRAW_EXT, XML_DISPLAY, eDisplayToken );
+		}
+		catch( uno::Exception& )
+		{
+			DBG_ERROR( "XMLShapeExport::exportShape(), exception caught!" );
+		}
+	}
+
 	// #82003# test export count
 	// #91587# ALWAYS increment since now ALL to be exported shapes are counted.
 	if(mrExport.GetShapeExport()->IsHandleProgressBarEnabled())

xmloff/source/draw/ximpshap.cxx

 ,	mnZOrder(-1)
 ,	maSize(1, 1)
 ,	maPosition(0, 0)
+,	mbVisible(true)
+,	mbPrintable(true)
 {
 }
 
 			    xMultiPropertyStates->setAllPropertiesToDefault();
 		}
 
+		if( !mbVisible || !mbPrintable ) try
+		{
+			uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY_THROW );
+			if( !mbVisible )
+				xSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ), uno::Any( sal_False ) );
+
+			if( !mbPrintable )
+				xSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) ), uno::Any( sal_False ) );
+		}
+		catch( Exception& )
+		{
+			DBG_ERROR( "SdXMLShapeContext::AddShape(), exception caught!" );
+		}
+
 		// #107848#
 		if(!mbTemporaryShape && (!GetImport().HasTextImport()
 			|| !GetImport().GetTextImport()->IsInsideDeleteContext()))
 // this is called from the parent group for each unparsed attribute in the attribute list
 void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue )
 {
-	if( XML_NAMESPACE_DRAW == nPrefix )
+	if( (XML_NAMESPACE_DRAW == nPrefix) || (XML_NAMESPACE_DRAW_EXT == nPrefix) )
 	{
 		if( IsXMLToken( rLocalName, XML_ZINDEX ) )
 		{
 		{
 			mnTransform.SetString(rValue, GetImport().GetMM100UnitConverter());
 		}
+		else if( IsXMLToken( rLocalName, XML_DISPLAY ) )
+		{
+			mbVisible = IsXMLToken( rValue, XML_ALWAYS ) || IsXMLToken( rValue, XML_SCREEN );
+			mbPrintable = IsXMLToken( rValue, XML_ALWAYS ) || IsXMLToken( rValue, XML_PRINTER );
+		}
 	}
 	else if( XML_NAMESPACE_PRESENTATION == nPrefix )
 	{

xmloff/source/draw/ximpshap.hxx

 	com::sun::star::awt::Size	maSize;
 	com::sun::star::awt::Point	maPosition;
 
+	bool						mbVisible;
+	bool						mbPrintable;
+
 	/** if bSupportsStyle is false, auto styles will be set but not	a style */
 	void SetStyle( bool bSupportsStyle = true );
 	void SetLayer();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.