summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx4
-rw-r--r--svx/source/accessibility/AccessibleTextHelper.cxx4
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx13
-rw-r--r--svx/source/dialog/dlgctl3d.cxx21
-rw-r--r--svx/source/dialog/docrecovery.src4
-rw-r--r--svx/source/dialog/hyprlink.cxx4
-rw-r--r--svx/source/dialog/rubydialog.cxx2
-rw-r--r--svx/source/dialog/srchdlg.src8
-rw-r--r--svx/source/engine3d/dragmt3d.cxx27
-rw-r--r--svx/source/engine3d/makefile.mk8
-rw-r--r--svx/source/engine3d/scene3d.cxx6
-rw-r--r--svx/source/engine3d/view3d.cxx6
-rw-r--r--svx/source/engine3d/viewpt3d.cxx32
-rw-r--r--svx/source/engine3d/volume3d.cxx32
-rw-r--r--svx/source/form/datanavi.cxx2
-rw-r--r--svx/source/form/fmPropBrw.cxx2
-rw-r--r--svx/source/form/fmobj.cxx15
-rw-r--r--svx/source/form/fmshell.cxx11
-rw-r--r--svx/source/form/fmshimp.cxx581
-rw-r--r--svx/source/form/fmstring.src4
-rw-r--r--svx/source/form/formcontroller.cxx2
-rw-r--r--svx/source/inc/fmresids.hrc2
-rw-r--r--svx/source/inc/fmservs.hxx1
-rw-r--r--svx/source/inc/fmshimp.hxx175
-rw-r--r--svx/source/intro/iso.src16
-rw-r--r--svx/source/intro/ooo.src18
-rw-r--r--svx/source/items/svxitems.src4
-rw-r--r--svx/source/sdr/attribute/makefile.mk5
-rw-r--r--svx/source/sdr/attribute/sdrallattribute.cxx408
-rw-r--r--svx/source/sdr/attribute/sdrfilltextattribute.cxx92
-rw-r--r--svx/source/sdr/attribute/sdrformtextattribute.cxx339
-rw-r--r--svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx143
-rw-r--r--svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx95
-rw-r--r--svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx93
-rw-r--r--svx/source/sdr/attribute/sdrshadowtextattribute.cxx85
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx467
-rw-r--r--svx/source/sdr/contact/viewcontact.cxx3
-rw-r--r--svx/source/sdr/contact/viewcontactofe3d.cxx30
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dcube.cxx19
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dextrude.cxx22
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dlathe.cxx24
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dpolygon.cxx18
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dscene.cxx117
-rw-r--r--svx/source/sdr/contact/viewcontactofe3dsphere.cxx20
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx236
-rw-r--r--svx/source/sdr/contact/viewcontactofgroup.cxx26
-rw-r--r--svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx65
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx194
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrcircobj.cxx93
-rw-r--r--svx/source/sdr/contact/viewcontactofsdredgeobj.cxx43
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx149
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx13
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx191
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrole2obj.cxx93
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpage.cxx68
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpathobj.cxx163
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrrectobj.cxx97
-rw-r--r--svx/source/sdr/contact/viewcontactofunocontrol.cxx45
-rw-r--r--svx/source/sdr/contact/viewcontactofvirtobj.cxx41
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofe3d.cxx1
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx11
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgroup.cxx14
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx8
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofpageobj.cxx25
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx4
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx3
-rw-r--r--svx/source/sdr/overlay/overlayobjectcell.cxx8
-rw-r--r--svx/source/sdr/overlay/overlayselection.cxx10
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx417
-rw-r--r--svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx67
-rw-r--r--svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx44
-rw-r--r--svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx27
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx58
-rw-r--r--svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx116
-rw-r--r--svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx66
-rw-r--r--svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx130
-rw-r--r--svx/source/sdr/primitive2d/sdrole2primitive2d.cxx74
-rw-r--r--svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx2
-rw-r--r--svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx67
-rw-r--r--svx/source/sdr/primitive2d/sdrprimitivetools.cxx17
-rw-r--r--svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx59
-rw-r--r--svx/source/sdr/primitive3d/sdrattributecreator3d.cxx5
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx30
-rw-r--r--svx/source/sdr/properties/makefile.mk1
-rw-r--r--svx/source/sdr/properties/oleproperties.cxx80
-rw-r--r--svx/source/svdraw/makefile.mk2
-rw-r--r--svx/source/svdraw/sdrmasterpagedescriptor.cxx47
-rw-r--r--svx/source/svdraw/svdcrtmt.hxx32
-rw-r--r--svx/source/svdraw/svddrgmt.cxx57
-rw-r--r--svx/source/svdraw/svdedtv.cxx97
-rw-r--r--svx/source/svdraw/svdhdl.cxx4
-rw-r--r--svx/source/svdraw/svdobj.cxx72
-rw-r--r--svx/source/svdraw/svdocapt.cxx2
-rw-r--r--svx/source/svdraw/svdogrp.cxx8
-rw-r--r--svx/source/svdraw/svdoimp.cxx33
-rw-r--r--svx/source/svdraw/svdoole2.cxx9
-rw-r--r--svx/source/svdraw/svdopath.cxx12
-rw-r--r--svx/source/svdraw/svdorect.cxx79
-rw-r--r--svx/source/svdraw/svdotext.cxx1
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx78
-rw-r--r--svx/source/svdraw/svdpage.cxx215
-rwxr-xr-x[-rw-r--r--]svx/source/svdraw/svdpntv.cxx20
-rw-r--r--svx/source/svdraw/svdscrol.cxx33
-rw-r--r--svx/source/svdraw/svdscrol.hxx31
-rw-r--r--svx/source/table/tablehandles.cxx7
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx125
-rw-r--r--svx/source/tbxctrls/tbxcolor.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/export.map8
-rw-r--r--svx/source/unodialogs/textconversiondlgs/makefile.mk2
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx74
-rw-r--r--svx/source/xml/xmlexport.cxx84
111 files changed, 3362 insertions, 3617 deletions
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index 89f3e20f54..42c1b5a114 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -122,7 +122,7 @@ namespace accessibility
USHORT GetItemState( const ESelection& /*rSel*/, USHORT /*nWhich*/ ) const { return 0; }
USHORT GetItemState( USHORT /*nPara*/, USHORT /*nWhich*/ ) const { return 0; }
-
+
SfxItemPool* GetPool() const { return NULL; }
void QuickInsertText( const String& /*rText*/, const ESelection& /*rSel*/ ) {}
@@ -142,6 +142,8 @@ namespace accessibility
{
return XubString();
}
+ void FieldClicked( const SvxFieldItem&, USHORT, xub_StrLen ) {;}
+
BOOL IsValid() const { return sal_True; }
void SetNotifyHdl( const Link& ) {}
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index d723b0cc51..b9d82c6eac 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -49,10 +49,6 @@
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
-#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#include <com/sun/star/accessibility/AccessibleTextType.hpp>
-#include <com/sun/star/accessibility/XAccessibleText.hpp>
-#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <comphelper/accessibleeventnotifier.hxx>
#include <unotools/accessiblestatesethelper.hxx>
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 3644b2b3a2..410f792fd1 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -1706,19 +1706,6 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
if(aNewB2DPolyPolygon.count())
{
- if( !bLineGeometryNeededOnly )
- {
- // hack aNewB2DPolyPolygon to fill logic rect - this is
- // needed to produce gradient fills that look like mso
- aNewB2DPolygon.clear();
- aNewB2DPolygon.append(basegfx::B2DPoint(0,0));
- aNewB2DPolyPolygon.append(aNewB2DPolygon);
-
- aNewB2DPolygon.clear();
- aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(),
- aLogicRect.GetHeight()));
- aNewB2DPolyPolygon.append(aNewB2DPolygon);
- }
// #i37011#
bool bForceCreateTwoObjects(false);
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 8923ca6776..9d6644f5fb 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -511,8 +511,17 @@ void Svx3DLightControl::TrySelection(Point aPosPixel)
if(aResult.size())
{
- // take the frontmost one
- const E3dCompoundObject* pResult = aResult[0];
+ // exclude expansion object which will be part of
+ // the hits. It's invisible, but for HitTest, it's included
+ const E3dCompoundObject* pResult = 0;
+
+ for(sal_uInt32 b(0); !pResult && b < aResult.size(); b++)
+ {
+ if(aResult[b] && aResult[b] != mpExpansionObject)
+ {
+ pResult = aResult[b];
+ }
+ }
if(pResult == mp3DObj)
{
@@ -777,8 +786,8 @@ void Svx3DLightControl::GetPosition(double& rHor, double& rVer)
}
if(IsGeometrySelected())
{
- rHor = mfRotateY;
- rVer = mfRotateX;
+ rHor = mfRotateY / F_PI180; // 0..360.0
+ rVer = mfRotateX / F_PI180; // -90.0..90.0
}
}
@@ -821,8 +830,8 @@ void Svx3DLightControl::SetPosition(double fHor, double fVer)
{
if(mfRotateX != fVer || mfRotateY != fHor)
{
- mfRotateX = fVer;
- mfRotateY = fHor;
+ mfRotateX = fVer * F_PI180;
+ mfRotateY = fHor * F_PI180;
if(mp3DObj)
{
diff --git a/svx/source/dialog/docrecovery.src b/svx/source/dialog/docrecovery.src
index 67df927ee8..32c3560031 100644
--- a/svx/source/dialog/docrecovery.src
+++ b/svx/source/dialog/docrecovery.src
@@ -370,7 +370,7 @@ TabPage RID_SVXPAGE_ERR_REP_WELCOME
Pos = MAP_APPFONT( RECOV_COL1, RECOV_ROW2 );
Size = MAP_APPFONT( RECOV_CONTROLWIDTH, (RECOV_ROW7-RECOV_ROW2-RSC_SP_CTRL_Y) );
WordBreak = TRUE;
- Text[ en-US ] = "This error report tool gathers information about how %PRODUCTNAME is working and sends it to Sun Microsystems to help improve future versions.\n\nIt's easy - just send the report without any further effort on your part by clicking 'Send' in the next dialog, or you can briefly describe how the error occurred and then click 'Send'. If you want to see the report, click the 'Show Report' button. No data will be sent if you click 'Do Not Send'.\n\nCustomer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME %PRODUCTVERSION when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME and will not be shared with third parties.\nFor more information on Sun Microsystems' privacy policy, visit\nhttp://www.sun.com/privacy/";
+ Text[ en-US ] = "This error report tool gathers information about how %PRODUCTNAME is working and sends it to Oracle to help improve future versions.\n\nIt's easy - just send the report without any further effort on your part by clicking 'Send' in the next dialog, or you can briefly describe how the error occurred and then click 'Send'. If you want to see the report, click the 'Show Report' button. No data will be sent if you click 'Do Not Send'.\n\nCustomer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME %PRODUCTVERSION when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME and will not be shared with third parties.\nFor more information on Oracle's privacy policy, visit\nwww.oracle.com/html/services-privacy-policy.html";
};
FixedLine FL_RECOV_BOTTOM
{
@@ -472,7 +472,7 @@ TabPage RID_SVXPAGE_ERR_REP_SEND
Pos = MAP_APPFONT( ERRSEND_COL0, ERRSEND_ROW12 );
Size = MAP_APPFONT( ERRSEND_CONTROLWIDTH2, RSC_CD_CHECKBOX_HEIGHT );
Check = FALSE;
- Text[ en-US ] = "~I allow Sun Microsystems to contact me regarding this report.";
+ Text[ en-US ] = "~I allow Oracle to contact me regarding this report.";
};
FixedText FT_ERRSEND_EMAILADDR
{
diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx
index 082c4a9651..985e2e4b9b 100644
--- a/svx/source/dialog/hyprlink.cxx
+++ b/svx/source/dialog/hyprlink.cxx
@@ -482,7 +482,7 @@ void SvxHyperlinkDlg::TargetMenu(const String& rSelEntry, BOOL bExecute)
if (pVwFrm) // Alle moeglichen Target Frames zusammensammeln und anzeigen
{
TargetList aList;
- pVwFrm->GetTopFrame()->GetTargetList(aList);
+ pVwFrm->GetTopFrame().GetTargetList(aList);
USHORT nCount = (USHORT)aList.Count();
if( nCount )
@@ -960,7 +960,7 @@ void SvxHyperlinkDlg::OpenDoc( const String& rURL, SfxViewFrame* pViewFrame )
if ( pViewFrame )
{
- SfxFrameItem aView( SID_DOCFRAME, pViewFrame ? pViewFrame->GetFrame() : NULL );
+ SfxFrameItem aView( SID_DOCFRAME, pViewFrame ? &pViewFrame->GetFrame() : NULL );
if ( pDisp )
pDisp->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
&aName, &aView, &aNewView, &aSilent, &aReadOnly, &aReferer, &aExternal, 0L );
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index ebe71cf370..e152afc2b9 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -321,7 +321,7 @@ void SvxRubyDialog::Activate()
aStylistPB.Enable(bEnable);
//get selection from current view frame
SfxViewFrame* pCurFrm = SfxViewFrame::Current();
- Reference< XController > xCtrl = pCurFrm->GetFrame()->GetController();
+ Reference< XController > xCtrl = pCurFrm->GetFrame().GetController();
pImpl->SetController(xCtrl);
if(pImpl->HasSelectionChanged())
{
diff --git a/svx/source/dialog/srchdlg.src b/svx/source/dialog/srchdlg.src
index feba788b1c..f00a6c8093 100644
--- a/svx/source/dialog/srchdlg.src
+++ b/svx/source/dialog/srchdlg.src
@@ -237,7 +237,7 @@ ModelessDialog RID_SVXDLG_SEARCH
{
Pos = MAP_APPFONT ( 12 , 163 ) ;
Size = MAP_APPFONT ( 126 , 10 ) ;
- Text [ en-US ] = "Current selection ~only" ;
+ Text [ en-US ] = "C~urrent selection only" ;
TabStop = TRUE ;
Hide = TRUE ;
};
@@ -346,7 +346,7 @@ ModelessDialog RID_SVXDLG_SEARCH
{
Pos = MAP_APPFONT ( 12 , 285 ) ;
Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "~Search in" ;
+ Text [ en-US ] = "Search i~n" ;
Hide = TRUE ;
};
ListBox LB_CALC_SEARCHIN
@@ -368,7 +368,7 @@ ModelessDialog RID_SVXDLG_SEARCH
{
Pos = MAP_APPFONT ( 12 , 300 ) ;
Size = MAP_APPFONT ( 60 , 8 ) ;
- Text [ en-US ] = "~Search direction" ;
+ Text [ en-US ] = "Search ~direction" ;
Hide = TRUE ;
};
RadioButton RB_CALC_ROWS
@@ -382,7 +382,7 @@ ModelessDialog RID_SVXDLG_SEARCH
{
Pos = MAP_APPFONT ( 75 , 313 ) ;
Size = MAP_APPFONT ( 63 , 10 ) ;
- Text [ en-US ] = "Col~umns" ;
+ Text [ en-US ] = "Colu~mns" ;
Hide = TRUE ;
};
CheckBox CB_ALL_SHEETS
diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx
index 22ad196dab..61f17c167e 100644
--- a/svx/source/engine3d/dragmt3d.cxx
+++ b/svx/source/engine3d/dragmt3d.cxx
@@ -67,8 +67,33 @@ E3dDragMethod::E3dDragMethod (
// eine Unit anlegen
const long nCnt(rMark.GetMarkCount());
static bool bDoInvalidate(false);
+ long nObjs(0);
- for(long nObjs = 0;nObjs < nCnt;nObjs++)
+ if(mbMoveFull)
+ {
+ // for non-visible 3D objects fallback to wireframe interaction
+ bool bInvisibleObjects(false);
+
+ for(nObjs = 0;!bInvisibleObjects && nObjs < nCnt;nObjs++)
+ {
+ E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj());
+
+ if(pE3dObj)
+ {
+ if(!pE3dObj->HasFillStyle() && !pE3dObj->HasLineStyle())
+ {
+ bInvisibleObjects = true;
+ }
+ }
+ }
+
+ if(bInvisibleObjects)
+ {
+ mbMoveFull = false;
+ }
+ }
+
+ for(nObjs = 0;nObjs < nCnt;nObjs++)
{
E3dObject* pE3dObj = dynamic_cast< E3dObject* >(rMark.GetMark(nObjs)->GetMarkedSdrObj());
diff --git a/svx/source/engine3d/makefile.mk b/svx/source/engine3d/makefile.mk
index 6e6e3f97c5..71916df4a8 100644
--- a/svx/source/engine3d/makefile.mk
+++ b/svx/source/engine3d/makefile.mk
@@ -64,18 +64,10 @@ LIB1OBJFILES= \
LIB2TARGET= $(SLB)$/$(TARGET).lib
LIB2OBJFILES= \
- $(SLO)$/volume3d.obj \
- $(SLO)$/viewpt3d.obj \
$(SLO)$/float3d.obj
SLOFILES = $(LIB1OBJFILES) $(LIB2OBJFILES)
-#disable optimizer for MSCompiler and ICC
-.IF "$(COM)"=="ICC" || "$(COM)"=="MSC"
-NOOPTFILES=\
- $(SLO)$/viewpt3d.obj
-.ENDIF
-
SRS1NAME=engine3d
SRC1FILES=\
string3d.src \
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 94a3668f2c..01ddb1f308 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -334,6 +334,12 @@ UINT16 E3dScene::GetObjIdentifier() const
return E3D_SCENE_ID;
}
+void E3dScene::SetBoundRectDirty()
+{
+ // avoid resetting aOutRect which in case of this object is model data,
+ // not re-creatable view data
+}
+
/*************************************************************************
|*
|* SetSnapRect
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 6b5ef8235b..0487ef0530 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -71,7 +71,7 @@
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -205,8 +205,8 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
// if we have full overlay from selected objects, embed with 50% transparence, the
// transformation is added to the OverlayPrimitive2DSequenceObject
- drawinglayer::primitive2d::Primitive2DReference aUnifiedAlphaPrimitive2D(new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aContent, 0.5));
- aContent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlphaPrimitive2D, 1);
+ drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aContent, 0.5));
+ aContent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparencePrimitive2D, 1);
sdr::overlay::OverlayPrimitive2DSequenceObject* pNew = new sdr::overlay::OverlayPrimitive2DSequenceObject(aContent);
diff --git a/svx/source/engine3d/viewpt3d.cxx b/svx/source/engine3d/viewpt3d.cxx
deleted file mode 100644
index 61357e19cd..0000000000
--- a/svx/source/engine3d/viewpt3d.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/viewpt3d.hxx>
-
-// eof
diff --git a/svx/source/engine3d/volume3d.cxx b/svx/source/engine3d/volume3d.cxx
deleted file mode 100644
index c0d6db9d7c..0000000000
--- a/svx/source/engine3d/volume3d.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svx/volume3d.hxx>
-
-// eof
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index ead28a0978..6070adb015 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1608,7 +1608,7 @@ namespace svxform
DBG_ASSERT( pBindings != NULL,
"DataNavigatorWindow::LoadModels(): no SfxBindings; can't get frame" );
m_xFrame = Reference<XFrame>(
- pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(),
+ pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(),
UNO_QUERY );
DBG_ASSERT( m_xFrame.is(), "DataNavigatorWindow::LoadModels(): no frame" );
// add frameaction listener
diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx
index b190f888e7..7ab661c758 100644
--- a/svx/source/form/fmPropBrw.cxx
+++ b/svx/source/form/fmPropBrw.cxx
@@ -245,7 +245,7 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding
if ( _pBindings->GetDispatcher() )
{
::com::sun::star::uno::Reference < ::com::sun::star::frame::XFramesSupplier >
- xSupp ( _pBindings->GetDispatcher()->GetFrame()->GetFrame()->GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY );
+ xSupp ( _pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface(), ::com::sun::star::uno::UNO_QUERY );
// if ( xSupp.is() )
// xSupp->getFrames()->append( m_xMeAsFrame );
// Don't append frame to frame hierachy to prevent UI_DEACTIVATE messages
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index 9fee3a83a6..eb747e0bf5 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -516,7 +516,7 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface >
while (nCurrentSourceIndex <= nIndex)
{
sal_Bool bEqualDSS = sal_False;
- while (!bEqualDSS) // (we don't have to check nCurrentSourceIndex here : it's bounded by nIndex)
+ while (!bEqualDSS) // (we don't have to check nCurrentSourceIndex here : it's bound by nIndex)
{
xSourceContainer->getByIndex(nCurrentSourceIndex) >>= xCurrentSourceForm;
DBG_ASSERT(xCurrentSourceForm.is(), "FmFormObj::ensureModelEnv : invalid form ancestor (2) !");
@@ -578,12 +578,11 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface >
// correct this ...
try
{
- Reference< XPersistObject > xSourcePersist(xCurrentSourceForm, UNO_QUERY);
- DBG_ASSERT(xSourcePersist.is(), "FmFormObj::ensureModelEnv : invalid form (no persist object) !");
-
- // create and insert (into the destination) a clone of the form
- Reference< XCloneable > xCloneable( xSourcePersist, UNO_QUERY_THROW );
- xCurrentDestForm.set( xCloneable->createClone(), UNO_QUERY_THROW );
+ // create and insert (into the destination) a copy of the form
+ xCurrentDestForm.set(
+ ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.form.component.DataForm" ) ),
+ UNO_QUERY_THROW );
+ ::comphelper::copyProperties( xCurrentSourceForm, xCurrentDestForm );
DBG_ASSERT(nCurrentDestIndex == xDestContainer->getCount(), "FmFormObj::ensureModelEnv : something went wrong with the numbers !");
xDestContainer->insertByIndex(nCurrentDestIndex, makeAny(xCurrentDestForm));
@@ -601,7 +600,7 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface >
}
}
- // now xCurrentDestForm is a form aequivalent to xSourceForm (which means they have the same DSS and the same number
+ // now xCurrentDestForm is a form equivalent to xSourceForm (which means they have the same DSS and the same number
// of left siblings with the same DSS, which counts for all their ancestors, too)
// go down
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index 7826a3b6e3..c40841f221 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -298,9 +298,6 @@ sal_uInt16 FmFormShell::PrepareClose(sal_Bool bUI, sal_Bool bForBrowsing)
m_pFormView && m_pFormView->GetActualOutDev() &&
m_pFormView->GetActualOutDev()->GetOutDevType() == OUTDEV_WINDOW)
{
- if (GetImpl()->HasAnyPendingCursorAction())
- GetImpl()->CancelAnyPendingCursorAction();
-
SdrPageView* pCurPageView = m_pFormView->GetSdrPageView();
// sal_uInt16 nPos = pCurPageView ? pCurPageView->GetWinList().Find((OutputDevice*)m_pFormView->GetActualOutDev()) : SDRPAGEVIEWWIN_NOTFOUND;
@@ -1128,9 +1125,6 @@ void FmFormShell::GetFormState(SfxItemSet &rSet, sal_uInt16 nWhich)
|| m_bDesignMode
|| !GetImpl()->getActiveForm().is()
|| GetImpl()->isInFilterMode()
- || ( GetImpl()->HasPendingCursorAction(GetImpl()->getNavController())
- && (SID_FM_RECORD_TOTAL != nWhich)
- )
)
rSet.DisableItem(nWhich);
else
@@ -1417,11 +1411,6 @@ void FmFormShell::SetDesignMode( sal_Bool _bDesignMode )
if ( _bDesignMode == m_bDesignMode )
return;
- // if we are moving our data source cursor currently ....
- if ( GetImpl()->HasAnyPendingCursorAction() )
- // ... cancel this
- GetImpl()->CancelAnyPendingCursorAction();
-
FmFormModel* pModel = GetFormModel();
if (pModel)
// fuer die Zeit des Uebergangs das Undo-Environment ausschalten, das sichert, dass man dort auch nicht-transiente
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index b414a93dfd..29beb4d637 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -570,11 +570,6 @@ sal_Bool FmXBoundFormFieldIterator::ShouldHandleElement(const Reference< XInterf
return aVal.hasValue();
}
-//==============================================================================
-
-DECL_CURSOR_ACTION_THREAD(FmMoveToLastThread)
-IMPL_CURSOR_ACTION_THREAD(FmMoveToLastThread, SVX_RES(RID_STR_MOVING_CURSOR), last());
-
//------------------------------------------------------------------------------
sal_Bool isControlList(const SdrMarkList& rMarkList)
{
@@ -684,9 +679,8 @@ FmXFormShell::FmXFormShell( FmFormShell& _rShell, SfxViewFrame* _pViewFrame )
m_aMarkTimer.SetTimeout(100);
m_aMarkTimer.SetTimeoutHdl(LINK(this,FmXFormShell,OnTimeOut));
- SfxFrame* pFrame = _pViewFrame ? _pViewFrame->GetFrame() : NULL;
- if ( pFrame )
- m_xAttachedFrame = pFrame->GetFrameInterface();
+ if ( _pViewFrame )
+ m_xAttachedFrame = _pViewFrame->GetFrame().GetFrameInterface();
// to prevent deletion of this we acquire our refcounter once
::comphelper::increment(FmXFormShell_BASE::m_refCount);
@@ -988,8 +982,6 @@ void FmXFormShell::disposing()
{
::osl::ClearableMutexGuard aGuard(m_aAsyncSafety);
- if (HasAnyPendingCursorAction())
- CancelAnyPendingCursorAction();
aGuard.clear();
DBG_ASSERT(!m_nInvalidationEvent, "FmXFormShell::~FmXFormShell : still have an invalidation event !");
@@ -1587,22 +1579,25 @@ void FmXFormShell::ExecuteSearch()
return;
// filter out the forms which do not contain valid controls at all
- FmFormArray::reverse_iterator form = m_aSearchForms.rbegin();
- ::std::vector< String >::reverse_iterator contextName = aContextNames.rbegin();
- sal_Int32 i = m_aSearchForms.size();
- for ( ;
- form != m_aSearchForms.rend();
- ++form, ++contextName, --i
- )
{
- FmSearchContext aTestContext;
- aTestContext.nContext = static_cast< sal_Int16 >( i-1 );
- sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext );
- if ( nValidControls == 0 )
+ FmFormArray aValidForms;
+ ::std::vector< String > aValidContexts;
+ FmFormArray::const_iterator form = m_aSearchForms.begin();
+ ::std::vector< String >::const_iterator contextName = aContextNames.begin();
+ for ( ; form != m_aSearchForms.end(); ++form, ++contextName )
{
- m_aSearchForms.erase( form.base() - 1 );
- aContextNames.erase( contextName.base() - 1 );
+ FmSearchContext aTestContext;
+ aTestContext.nContext = static_cast< sal_Int16 >( form - m_aSearchForms.begin() );
+ sal_uInt32 nValidControls = OnSearchContextRequest( &aTestContext );
+ if ( nValidControls > 0 )
+ {
+ aValidForms.push_back( *form );
+ aValidContexts.push_back( *contextName );
+ }
}
+
+ m_aSearchForms.swap( aValidForms );
+ aContextNames.swap( aValidContexts );
}
if (m_aSearchForms.size() == 0)
@@ -1614,7 +1609,7 @@ void FmXFormShell::ExecuteSearch()
// jetzt brauche ich noch einen 'initial context'
sal_Int16 nInitialContext = 0;
Reference< XForm> xActiveForm( getActiveForm());
- for (i=0; i<(sal_Int32)m_aSearchForms.size(); ++i)
+ for ( size_t i=0; i<m_aSearchForms.size(); ++i )
{
if (m_aSearchForms.at(i) == xActiveForm)
{
@@ -1982,10 +1977,6 @@ void FmXFormShell::setActiveController( const Reference< runtime::XFormControlle
if (xController != m_xActiveController)
{
- // if there is a async cursor action running we have to restore the locking state of the controls of the old controller
- if (HasPendingCursorAction(Reference< XResultSet>(m_xActiveForm, UNO_QUERY)))
- restoreControlLocks();
-
::osl::ClearableMutexGuard aGuard(m_aAsyncSafety);
// switch all nav dispatchers belonging to the form of the current nav controller to 'non active'
Reference< XResultSet> xNavigationForm;
@@ -2065,10 +2056,6 @@ void FmXFormShell::setActiveController( const Reference< runtime::XFormControlle
if (m_xNavigationController.is())
xNavigationForm = Reference< XResultSet>(m_xNavigationController->getModel(), UNO_QUERY);
- // if there is a async cursor action running we have to lock the controls of the new controller
- if (HasPendingCursorAction(Reference< XResultSet>(m_xActiveForm, UNO_QUERY)))
- setControlLocks();
-
m_bInActivate = sal_False;
m_pShell->UIFeatureChanged();
@@ -2389,6 +2376,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
FmFormObj* pFormObject = FmFormObj::GetFormObject( pObject );
Reference< XControlModel > xControlModel( pFormObject ? pFormObject->GetUnoControlModel() : Reference< XControlModel >() );
DBG_ASSERT( xControlModel.is(), "FmXFormShell::OnFoundData: invalid control!" );
+ if ( !xControlModel.is() )
+ return 0;
// disable the permanent cursor for the last grid we found a record
if (m_xLastGridFound.is() && (m_xLastGridFound != xControlModel))
@@ -2406,7 +2395,7 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
sal_Int32 nGridColumn = m_arrRelativeGridColumn.GetObject(pfriWhere->nFieldPos);
if (nGridColumn != -1)
{ // dummer weise muss ich mir das Control erst wieder besorgen
- Reference< XControl> xControl( GetControlFromModel(xControlModel));
+ Reference< XControl> xControl( impl_getControl( xControlModel, *pFormObject ) );
Reference< XGrid> xGrid(xControl, UNO_QUERY);
DBG_ASSERT(xGrid.is(), "FmXFormShell::OnFoundData : ungueltiges Control !");
// wenn eine der Asserts anschlaegt, habe ich beim Aufbauen von m_arrSearchedControls wohl was falsch gemacht
@@ -2418,7 +2407,8 @@ IMPL_LINK(FmXFormShell, OnFoundData, FmFoundRecordInformation*, pfriWhere)
xModelSet->setPropertyValue( FM_PROP_CURSORCOLOR, makeAny( sal_Int32( COL_LIGHTRED ) ) );
m_xLastGridFound = xControlModel;
- xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn);
+ if ( xGrid.is() )
+ xGrid->setCurrentColumnPosition((sal_Int16)nGridColumn);
}
// als der Cursor neu positioniert wurde, habe ich (in positioned) meine Formularleisten-Slots invalidiert, aber das greift
@@ -2526,7 +2516,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
// ... nach der ControlSource-Eigenschaft fragen
SearchableControlIterator iter( xCurrentFormComponent );
- Reference< XControl> xControlBehindModel;
+ Reference< XControl> xControl;
// das Control, das als Model xControlModel hat
// (das folgende while kann mehrmals durchlaufen werden, ohne dass das Control sich aendert, dann muss
// ich nicht jedesmal neu suchen)
@@ -2538,10 +2528,12 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
if ( sControlSource.getLength() == 0 )
{ // das aktuelle Element hat keine ControlSource, also ist es ein GridControl (das ist das einzige, was
// der SearchableControlIterator noch zulaesst)
- xControlBehindModel = GetControlFromModel(xControlModel);
- DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
+ xControl = impl_getControl( xControlModel, *pFormObject );
+ DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
- Reference< XGridPeer> xGridPeer(xControlBehindModel->getPeer(), UNO_QUERY);
+ Reference< XGridPeer> xGridPeer;
+ if ( xControl.is() )
+ xGridPeer.set( xControl->getPeer(), UNO_QUERY );
do
{
if (!xGridPeer.is())
@@ -2595,13 +2587,13 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
if (sControlSource.getLength() && xValidFormFields->hasByName(sControlSource))
{
// jetzt brauche ich das Control zum SdrObject
- if (!xControlBehindModel.is())
+ if (!xControl.is())
{
- xControlBehindModel = GetControlFromModel(xControlModel);
- DBG_ASSERT(xControlBehindModel.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
+ xControl = impl_getControl( xControlModel, *pFormObject );
+ DBG_ASSERT(xControl.is(), "FmXFormShell::OnSearchContextRequest : didn't ::std::find a control with requested model !");
}
- if (IsSearchableControl(xControlBehindModel))
+ if (IsSearchableControl(xControl))
{ // alle Tests ueberstanden -> in die Liste mit aufnehmen
strFieldList += sControlSource.getStr();
strFieldList += ';';
@@ -2617,7 +2609,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn
m_arrRelativeGridColumn.Insert(-1, m_arrRelativeGridColumn.Count());
// und fuer die formatierte Suche ...
- pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControlBehindModel, UNO_QUERY));
+ pfmscContextInfo->arrFields.push_back(Reference< XInterface>(xControl, UNO_QUERY));
}
}
}
@@ -2991,24 +2983,48 @@ void FmXFormShell::SetDesignMode(sal_Bool bDesign)
}
//------------------------------------------------------------------------------
-Reference< XControl> FmXFormShell::GetControlFromModel(const Reference< XControlModel>& xModel)
+Reference< XControl> FmXFormShell::impl_getControl( const Reference< XControlModel >& i_rxModel, const FmFormObj& i_rKnownFormObj )
{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::GetControlFromModel" );
if ( impl_checkDisposed() )
return NULL;
- Reference< XControlContainer> xControlContainer( getControlContainerForView() );
+ Reference< XControl > xControl;
+ try
+ {
+ Reference< XControlContainer> xControlContainer( getControlContainerForView(), UNO_SET_THROW );
+
+ Sequence< Reference< XControl > > seqControls( xControlContainer->getControls() );
+ const Reference< XControl >* pControls = seqControls.getArray();
+ // ... die ich dann durchsuchen kann
+ for (sal_Int32 i=0; i<seqControls.getLength(); ++i)
+ {
+ xControl.set( pControls[i], UNO_SET_THROW );
+ Reference< XControlModel > xCurrentModel( xControl->getModel() );
+ if ( xCurrentModel == i_rxModel )
+ break;
+ xControl.clear();
+ }
+
+ if ( !xControl.is() )
+ {
+ // fallabck (some controls might not have been created, yet, since they were never visible so far)
+ Reference< XControl > xContainerControl( xControlContainer, UNO_QUERY_THROW );
+ const Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerControl->getPeer() );
+ ENSURE_OR_THROW( pContainerWindow, "unexpected control container implementation" );
+
+ const SdrView* pSdrView = m_pShell ? m_pShell->GetFormView() : NULL;
+ ENSURE_OR_THROW( pSdrView, "no current view" );
- Sequence< Reference< XControl> > seqControls( xControlContainer->getControls() );
- Reference< XControl>* pControls = seqControls.getArray();
- // ... die ich dann durchsuchen kann
- for (int i=0; i<seqControls.getLength(); ++i)
+ xControl.set( i_rKnownFormObj.GetUnoControl( *pSdrView, *pContainerWindow ), UNO_QUERY_THROW );
+ }
+ }
+ catch( const Exception& )
{
- Reference< XControlModel> xSearchLoopModel( pControls[i]->getModel());
- if ((XControlModel*)xSearchLoopModel.get() == (XControlModel*)xModel.get())
- return pControls[i];
+ DBG_UNHANDLED_EXCEPTION();
}
- return Reference< XControl>(NULL);
+
+ OSL_ENSURE( xControl.is(), "FmXFormShell::impl_getControl: no control found!" );
+ return xControl;
}
//------------------------------------------------------------------------------
@@ -3313,312 +3329,6 @@ void FmXFormShell::clearFilter()
}
//------------------------------------------------------------------------------
-void FmXFormShell::setControlLocks()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::setControlLocks" );
- if ( impl_checkDisposed() )
- return;
-
- Reference< XTabController> xCtrler(getActiveController(), UNO_QUERY);
- if (!xCtrler.is())
- return;
-
- Reference< XControlContainer> xControls(xCtrler->getContainer(), UNO_QUERY);
- if (!xControls.is())
- return;
-
- DBG_ASSERT( m_aControlLocks.empty(), "FmXFormShell::setControlLocks: locking state array isn't empty (called me twice ?)!" );
-
- Sequence< Reference< XControl> > aControls = xControls->getControls();
- const Reference< XControl>* pControls = aControls.getConstArray();
-
- // iterate through all bound controls, remember the old locking state, set the lock
- for (sal_Int32 i=0; i<aControls.getLength(); ++i)
- {
- Reference< XBoundControl> xCtrl(pControls[i], UNO_QUERY);
- if (!xCtrl.is())
- {
- // it may be a container of controls
- Reference< XIndexAccess> xContainer(pControls[i], UNO_QUERY);
- if (xContainer.is())
- { // no recursion. we only know top level control containers (e.g. grid controls)
- for (sal_Int16 j=0; j<xContainer->getCount(); ++j)
- {
- xContainer->getByIndex(j) >>= xCtrl;
- if (!xCtrl.is())
- continue;
-
- m_aControlLocks.push_back( xCtrl->getLock() );
- xCtrl->setLock(sal_True);
- }
- }
- continue;
- }
-
- m_aControlLocks.push_back( xCtrl->getLock() );
- xCtrl->setLock(sal_True);
- }
-}
-
-//------------------------------------------------------------------------------
-void FmXFormShell::restoreControlLocks()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::restoreControlLocks" );
- if ( impl_checkDisposed() )
- return;
-
- Reference< XTabController> xCtrler(getActiveController(), UNO_QUERY);
- if (!xCtrler.is())
- return;
-
- Reference< XControlContainer> xControls(xCtrler->getContainer(), UNO_QUERY);
- if (!xControls.is())
- return;
-
- Sequence< Reference< XControl> > aControls(xControls->getControls());
- const Reference< XControl>* pControls = aControls.getConstArray();
-
- // iterate through all bound controls, restore the old locking state
- size_t nBoundControl = 0;
- for (sal_Int32 i=0; i<aControls.getLength(); ++i)
- {
- Reference< XBoundControl> xCtrl(pControls[i], UNO_QUERY);
- if (!xCtrl.is())
- {
- // it may be a container of controls
- Reference< XIndexAccess> xContainer(pControls[i], UNO_QUERY);
- if (xContainer.is())
- { // no recursion. we only know top level control containers (e.g. grid controls)
- for (sal_Int16 j=0; j<xContainer->getCount(); ++j)
- {
- xContainer->getByIndex(j) >>= xCtrl;
- if (!xCtrl.is())
- continue;
-
- DBG_ASSERT( nBoundControl < m_aControlLocks.size(), "FmXFormShell::restoreControlLocks: m_aControlLocks is invalid!" );
- xCtrl->setLock( m_aControlLocks[ nBoundControl ] );
- ++nBoundControl;
- }
- }
- continue;
- }
-
- DBG_ASSERT( nBoundControl < m_aControlLocks.size(), "FmXFormShell::restoreControlLocks: m_aControlLocks is invalid!" );
- // a violation of this condition would mean a) setControlLocks hasn't been called or b) the ControlContainer
- // has changed since the last call to setControlLocks.
- // a) clearly is a fault of the programmer and b) shouldn't be possible (as we are in alive mode)
- xCtrl->setLock( m_aControlLocks[ nBoundControl ] );
- ++nBoundControl;
- }
- ::std::vector< sal_Bool > aEmpty;
- m_aControlLocks.swap( aEmpty );
-}
-
-//------------------------------------------------------------------------------
-void FmXFormShell::DoAsyncCursorAction(const Reference< runtime::XFormController >& _xController, CURSOR_ACTION _eWhat)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::DoAsyncCursorAction" );
- if ( impl_checkDisposed() )
- return;
-
- DBG_ASSERT(_xController.is(), "FmXFormShell::DoAsyncCursorAction : invalid argument !");
- DoAsyncCursorAction(Reference< XResultSet>(_xController->getModel(), UNO_QUERY), _eWhat);
-}
-
-//------------------------------------------------------------------------------
-void FmXFormShell::DoAsyncCursorAction(const Reference< XResultSet>& _xForm, CURSOR_ACTION _eWhat)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::DoAsyncCursorAction" );
- if ( impl_checkDisposed() )
- return;
-
- ::osl::MutexGuard aGuard(m_aAsyncSafety);
- DBG_ASSERT(_xForm.is(), "FmXFormShell::DoAsyncCursorAction : invalid argument !");
-
- // build the access path for the form
- if (HasPendingCursorAction(_xForm))
- {
- DBG_ERROR("FmXFormShell::DoAsyncCursorAction : invalid call !");
- return;
- }
-
- CursorActionDescription& rDesc = m_aCursorActions[ _xForm ];
- // [] will create a new one if non-existent
- DBG_ASSERT(rDesc.pThread == NULL, "FmXFormShell::DoAsyncCursorAction : the cursor action thread for this form is still alive !");
-
- Reference< XResultSet > xCursor( getInternalForm( _xForm ), UNO_QUERY );
- switch (_eWhat)
- {
- case CA_MOVE_TO_LAST :
- rDesc.pThread = new FmMoveToLastThread( xCursor );
- break;
- case CA_MOVE_ABSOLUTE:
- DBG_ERROR("FmXFormShell::DoAsyncCursorAction : CA_MOVE_ABSOLUTE not supported yet !");
- return;
- }
- rDesc.pThread->SetTerminationHdl(LINK(this, FmXFormShell, OnCursorActionDone));
- rDesc.pThread->EnableSelfDelete(sal_False);
-
- rDesc.bCanceling = sal_False;
-
- // set the control locks before starting the thread
- DBG_ASSERT(getInternalForm(m_xActiveForm) == m_xActiveForm, "FmXFormShell::DoAsyncCursorAction : the active form should always be a internal one !");
- if (getInternalForm(_xForm) == m_xActiveForm)
- setControlLocks();
-
- // go ...
- rDesc.pThread->create();
-
- // set a priority slightly below normal
- rDesc.pThread->setPriority(::vos::OThread::TPriority_BelowNormal);
-}
-
-//------------------------------------------------------------------------------
-sal_Bool FmXFormShell::HasPendingCursorAction(const Reference< XResultSet>& _xForm) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::HasPendingCursorAction" );
- if ( impl_checkDisposed() )
- return sal_False;
-
- if (!_xForm.is())
- return sal_False;
-
- // TODO: if we ever re-implement the asynchronous cursor actions, then this will happen
- // in the controller, and not in the form. In such a case, we here probably need to check
- // whether the controller for the form has this "pending cursor action"
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-sal_Bool FmXFormShell::HasPendingCursorAction(const Reference< runtime::XFormController >& xController) const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::HasPendingCursorAction" );
- if ( impl_checkDisposed() )
- return sal_False;
-
- if (!xController.is())
- return sal_False;
-
- return HasPendingCursorAction(Reference< XResultSet>(xController->getModel(), UNO_QUERY));
-}
-
-//------------------------------------------------------------------------------
-sal_Bool FmXFormShell::HasAnyPendingCursorAction() const
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::HasAnyPendingCursorAction" );
- ::osl::MutexGuard aGuard( const_cast< FmXFormShell* >( this )->m_aAsyncSafety );
-
- for ( CursorActions::const_iterator aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter )
- {
- if (((*aIter).second.pThread != NULL) || ((*aIter).second.nFinishedEvent != 0))
- return sal_True;
- }
- return sal_False;
-}
-
-//------------------------------------------------------------------------------
-void FmXFormShell::CancelAnyPendingCursorAction()
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::CancelAnyPendingCursorAction" );
- if ( impl_checkDisposed() )
- return;
-
- ::osl::ResettableMutexGuard aGuard( m_aAsyncSafety );
-
- CursorActions::iterator aIter;
- for (aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter)
- {
- if (!(*aIter).second.nFinishedEvent && (*aIter).second.pThread)
- { // the thread is really running
- (*aIter).second.bCanceling = sal_True;
-
- aGuard.clear();
- (*aIter).second.pThread->StopItWait();
- // StopItWait returns after the termination handler (our OnCursorActionDone) has been called
- aGuard.reset();
- }
- }
-
- // all threads are finished (means canceled), now do the cleanup
- for (aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter)
- {
- if ((*aIter).second.pThread)
- {
- LINK(this, FmXFormShell, OnCursorActionDoneMainThread).Call((*aIter).second.pThread);
- DBG_ASSERT((*aIter).second.pThread == NULL, "FmXFormShell::CancelAnyPendingCursorAction : strange behaviour of OnCursorActionDoneMainThread !");
- }
- }
-}
-
-//------------------------------------------------------------------------------
-IMPL_LINK(FmXFormShell, OnCursorActionDone, FmCursorActionThread*, pThread)
-{
- if ( impl_checkDisposed() )
- return 0L;
-
- ::osl::MutexGuard aGuard(m_aAsyncSafety);
-
- // search the pos of the thread within m_aCursorActions
- CursorActions::iterator aIter;
- for (aIter = m_aCursorActions.begin(); aIter != m_aCursorActions.end(); ++aIter)
- {
- if ((*aIter).second.pThread == pThread)
- break;
- }
-
- DBG_ASSERT(aIter != m_aCursorActions.end(), "FmXFormShell::OnCursorActionDone : could not ::std::find the thread !");
- DBG_ASSERT((*aIter).second.nFinishedEvent == 0, "FmXFormShell::OnCursorActionDone : another 'ActionDone' for this thread is pending !");
- // as we allow only one async action at a time (per form) this shouldn't happen
-
- if (!(*aIter).second.bCanceling)
- (*aIter).second.nFinishedEvent = Application::PostUserEvent(LINK(this, FmXFormShell, OnCursorActionDoneMainThread), pThread);
- // if bCanceling is sal_True an other thread's execution is in CancelAnyPendingCursorAction
- return 0L;
-}
-
-//------------------------------------------------------------------------------
-IMPL_LINK(FmXFormShell, OnCursorActionDoneMainThread, FmCursorActionThread*, pThread)
-{
- if ( impl_checkDisposed() )
- return 0L;
-
- ::osl::MutexGuard aGuard(m_aAsyncSafety);
-
- // search the pos of the thread within m_aCursorActions
- CursorActions::iterator aIter = m_aCursorActions.find( pThread->getDataSource() );
- DBG_ASSERT(aIter != m_aCursorActions.end(), "FmXFormShell::OnCursorActionDoneMainThread : could not ::std::find the thread data !");
- DBG_ASSERT((*aIter).second.pThread == pThread, "FmXFormShell::OnCursorActionDoneMainThread : invalid thread data !");
-
- // remember some thread parameters
- Reference< XResultSet> xForm(pThread->getDataSource(), UNO_QUERY);
-
- // throw away the thread
- delete (*aIter).second.pThread;
- (*aIter).second.pThread = NULL;
- (*aIter).second.nFinishedEvent = 0;
- (*aIter).second.bCanceling = sal_False;
- // as we allow exactly one thread per form we may remove this ones data from m_aCursorActions
- m_aCursorActions.erase(aIter);
-
- DBG_ASSERT(getInternalForm(m_xActiveForm) == m_xActiveForm, "FmXFormShell::DoAsyncCursorAction : the active form should always be a internal one !");
- DBG_ASSERT(getInternalForm(xForm) == xForm, "FmXFormShell::DoAsyncCursorAction : the thread's form should always be a internal one !");
- // if one of the two asserts above fails the upcoming comparison is senseless
- if (xForm == m_xActiveForm)
- {
- // the active controller belongs to the form where the action is finished
- // -> re-enable the controls if they are not locked because of another running thread
- if (!HasPendingCursorAction(xForm))
- restoreControlLocks();
- }
-
- m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(DatabaseSlotMap);
- // it may not be neccessary but me thinks it's faster without the check if we really have to do this
-
- return 0L;
-}
-
-//------------------------------------------------------------------------------
void FmXFormShell::CreateExternalView()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmXFormShell::CreateExternalView" );
@@ -4604,155 +4314,4 @@ void ControlConversionMenuController::StateChanged(sal_uInt16 nSID, SfxItemState
}
}
-//==================================================================
-
-FmCursorActionThread::FmCursorActionThread(const Reference< XResultSet>& _xDataSource, const UniString& _rStopperCaption)
- :m_xDataSource(_xDataSource)
- ,m_sStopperCaption(_rStopperCaption)
- ,m_bCanceled(sal_False)
- ,m_bDeleteMyself(sal_False)
- ,m_bDisposeCursor(sal_False)
- ,m_bTerminated(sal_False)
- ,m_bRunFailed(sal_False)
-{
- RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmCursorActionThread::FmCursorActionThread" );
- DBG_ASSERT(m_xDataSource.is() && Reference< XCancellable>(m_xDataSource, UNO_QUERY).is(),
- "FmCursorActionThread::FmCursorActionThread : invalid cursor !");
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::run()
-{
- // On instantiation of a SfxCancellable the application is notified and 'switches on' the red stop button.
- // Unfortunally this is conditioned with the acquirement of the solar mutex, and the application tries
- // only once and ignores the notification if it fails.
- // To prevent that we get the solar mutex and _block_ 'til we got it.
- // As we are in the 'top level execution' of this thread (with a rather small stack and no other mutexes locked)
- // we shouldn't experience problems with deadlocks ...
- ::vos::OClearableGuard aSolarGuard(Application::GetSolarMutex());
- ThreadStopper* pStopper = new ThreadStopper(this, m_sStopperCaption);
- aSolarGuard.clear();
-
- // we're not canceled yet
- ::osl::ClearableMutexGuard aInitGuard(m_aAccessSafety);
- m_bCanceled = sal_False;
- m_bRunFailed = sal_False;
- aInitGuard.clear();
-
- // start it
- try
- {
- RunImpl();
- }
- catch(SQLException e)
- {
- ::osl::MutexGuard aErrorGuard(m_aAccessSafety);
- m_bRunFailed = sal_True;
- m_aRunException = e;
- }
- catch(Exception&)
- {
- DBG_ERROR("FmCursorActionThread::run : catched a non-database exception !");
- }
-
-
- sal_Bool bReallyCanceled;
- ::osl::ClearableMutexGuard aEvalGuard(m_aAccessSafety);
- bReallyCanceled = m_bCanceled;
- aEvalGuard.clear();
-
- pStopper->OwnerTerminated();
- // this will cause the stopper to delete itself (in the main thread) so we don't have to care of the
- // solar mutex
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::onTerminated()
-{
- ::osl::ClearableMutexGuard aResetGuard(m_aAccessSafety);
- if (m_aTerminationHandler.IsSet())
- m_aTerminationHandler.Call(this);
-
- if (IsCursorDisposeEnabled())
- {
- Reference< ::com::sun::star::lang::XComponent> xDataSourceComponent(m_xDataSource, UNO_QUERY);
- if (xDataSourceComponent.is())
- xDataSourceComponent->dispose();
- }
-
- aResetGuard.clear();
- // with this StopItWait has a chance to do it's Terminated()
-
- ::osl::MutexGuard aGuard(m_aFinalExitControl);
- // Terminated() in StopItWait still returns sal_False
- m_bTerminated = sal_True;
- // Terminated() now returns sal_True, but StopItWait can't exit until this method exits (because of the guarded m_aFinalExitControl)
-
- if (IsSelfDeleteEnabled())
- delete this;
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::StopIt()
-{
- ::osl::MutexGuard aGuard(m_aAccessSafety);
- m_bCanceled = sal_True;
-
- Reference< XCancellable> xCancel(m_xDataSource, UNO_QUERY);
- DBG_ASSERT(xCancel.is(), "FmCursorActionThread::StopIt : invalid cursor !");
- xCancel->cancel();
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::StopItWait()
-{
- StopIt();
-
- while (!Terminated())
- ;
-
- // OnTerminated has been called, but we can't simply exit : Suppose the caller want's to delete the thread object
- // immediately after returning from StopItWait. With the following guard we ensure that we exit this method
- // only after onTerminated has exited.
- ::osl::ClearableMutexGuard aGuard(m_aFinalExitControl);
-
- // now onTerminated has exited, so we can leave, too
-}
-
-//------------------------------------------------------------------------------
-FmCursorActionThread::ThreadStopper::ThreadStopper(FmCursorActionThread* pOwner, const UniString& rTitle)
- :SfxCancellable(SFX_APP()->GetCancelManager(), rTitle)
- ,m_pOwner(pOwner)
-{
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::ThreadStopper::Cancel()
-{
- if (!m_pOwner) // the owner is already terminated and we're waiting for the OnDeleteInMainThread event
- return;
-
- ::osl::MutexGuard aGuard(m_pOwner->m_aAccessSafety);
- if (IsCancelled())
- // we already did pass this to our owner
- return;
-
- SfxCancellable::Cancel();
- m_pOwner->StopIt();
-}
-
-//------------------------------------------------------------------------------
-void FmCursorActionThread::ThreadStopper::OwnerTerminated()
-{
- m_pOwner = NULL;
- Application::PostUserEvent(LINK(this, FmCursorActionThread::ThreadStopper, OnDeleteInMainThread), this);
-}
-
-//------------------------------------------------------------------------------
-IMPL_LINK(FmCursorActionThread::ThreadStopper, OnDeleteInMainThread, FmCursorActionThread::ThreadStopper*, pThis)
-{
- delete pThis;
- return 0L;
-}
-
//==============================================================================
diff --git a/svx/source/form/fmstring.src b/svx/source/form/fmstring.src
index 0b281ca766..89771f126b 100644
--- a/svx/source/form/fmstring.src
+++ b/svx/source/form/fmstring.src
@@ -214,10 +214,6 @@ String RID_STR_PROPTITLE_FORMATTED
{
Text [ en-US ] = "Formatted Field";
};
-String RID_STR_MOVING_CURSOR
-{
- Text [ en-US ] = "align data source";
-};
String RID_STR_PROPTITLE_LISTBOX
{
Text [ en-US ] = "List Box";
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index e8a549a898..3ab380dc15 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -4254,7 +4254,7 @@ bool FormController::ensureInteractionHandler()
return false;
m_bAttemptedHandlerCreation = true;
- m_xInteractionHandler.set( m_aContext.createComponent( (::rtl::OUString)SRV_SDB_INTERACTION_HANDLER ), UNO_QUERY );
+ m_xInteractionHandler.set( m_aContext.createComponent( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler" ) ) ), UNO_QUERY );
OSL_ENSURE( m_xInteractionHandler.is(), "FormController::ensureInteractionHandler: could not create an interaction handler!" );
return m_xInteractionHandler.is();
}
diff --git a/svx/source/inc/fmresids.hrc b/svx/source/inc/fmresids.hrc
index fae54cd90f..08982d8444 100644
--- a/svx/source/inc/fmresids.hrc
+++ b/svx/source/inc/fmresids.hrc
@@ -183,7 +183,7 @@
#define RID_STR_FILTER_FILTER_OR (RID_FORMS_START + 80)
#define RID_STR_PROPTITLE_FORMATTED (RID_FORMS_START + 81)
#define RID_STR_SYNTAXERROR (RID_FORMS_START + 82)
-#define RID_STR_MOVING_CURSOR (RID_FORMS_START + 83)
+ // FREE
#define RID_STR_NOCONTROLS_FOR_EXTERNALDISPLAY (RID_FORMS_START + 84)
#define RID_STR_AUTOFIELD (RID_FORMS_START + 89)
#define RID_STR_SVT_SQL_SYNTAX_ERROR (RID_FORMS_START + 90)
diff --git a/svx/source/inc/fmservs.hxx b/svx/source/inc/fmservs.hxx
index 863be0dfae..6c1136a405 100644
--- a/svx/source/inc/fmservs.hxx
+++ b/svx/source/inc/fmservs.hxx
@@ -56,7 +56,6 @@
#define FM_CONTROL_GRIDCONTROL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "stardiv.one.form.control.GridControl" ) )
#define FM_FORM_CONTROLLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.runtime.FormController" ) )
#define SRV_SDB_CONNECTION rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.Connection" ) )
-#define SRV_SDB_INTERACTION_HANDLER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.InteractionHandler" ) )
#define FM_SUN_COMPONENT_FORM rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.Form" ) )
#define FM_SUN_COMPONENT_TEXTFIELD rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.TextField" ) )
#define FM_SUN_COMPONENT_LISTBOX rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.form.component.ListBox" ) )
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index a02d91d9a3..ef38edc7e8 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -68,7 +68,6 @@
#include "fmsrccfg.hxx"
#include <osl/mutex.hxx>
#include <vos/thread.hxx>
-#include <svl/cancel.hxx>
#include <tools/debug.hxx>
#include <cppuhelper/component.hxx>
#include <comphelper/stl_types.hxx>
@@ -119,21 +118,6 @@ protected:
virtual sal_Bool ShouldStepInto(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _rContainer) const;
};
-//========================================================================
-// I would prefer this to be a struct local to FmXFormShell but unfortunately local structs/classes
-// are somewhat difficult with some of our compilers
-class FmCursorActionThread;
-struct SAL_DLLPRIVATE CursorActionDescription
-{
- FmCursorActionThread* pThread;
- ULONG nFinishedEvent;
- // we want to do the cleanup of the thread in the main thread so we post an event to ourself
- sal_Bool bCanceling;
- // this thread is being canceled
-
- CursorActionDescription() : pThread(NULL), nFinishedEvent(0), bCanceling(sal_False) { }
-};
-
class FmFormPage;
//========================================================================
struct SAL_DLLPRIVATE FmLoadAction
@@ -179,6 +163,7 @@ typedef ::utl::ConfigItem FmXFormShell_CFGBASE;
struct SdrViewEvent;
class FmFormShell;
class FmFormView;
+class FmFormObj;
class SAL_DLLPRIVATE FmXFormShell :public FmXFormShell_BASE
,public FmXFormShell_CFGBASE
,public ::svxform::OStaticDataAccessTools
@@ -202,18 +187,6 @@ class SAL_DLLPRIVATE FmXFormShell :public FmXFormShell_BASE
// we explicitly switch off the propbrw before leaving the design mode
// this flag tells us if we have to switch it on again when reentering
- typedef ::std::map<
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >,
- CursorActionDescription,
- ::comphelper::OInterfaceCompare< ::com::sun::star::sdbc::XResultSet >
- > CursorActions;
- CursorActions m_aCursorActions;
- // all actions on async cursors
-
- ::std::vector< sal_Bool >
- m_aControlLocks;
- // while doing a async cursor action we have to lock all controls of the active controller.
- // m_aControlLocks remembers the previous lock states to be restored afterwards.
::osl::Mutex m_aAsyncSafety;
// secure the access to our thread related members
::osl::Mutex m_aInvalidationSafety;
@@ -377,8 +350,11 @@ protected:
void startListening();
void stopListening();
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl> GetControlFromModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& xModel);
- // liefert das Control, welches das angegebene Model hat
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >
+ impl_getControl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel>& i_rxModel,
+ const FmFormObj& i_rKnownFormObj
+ );
// sammelt in strNames die Namen aller Formulare
static void impl_collectFormSearchContexts_nothrow(
@@ -559,20 +535,7 @@ private:
// ---------------------------------------------------
// asyncronous cursor actions/navigation slot handling
- void setControlLocks(); // lock all controls of the active controller
- void restoreControlLocks(); // restore the lock state of all controls of the active controller
-
public:
- enum CURSOR_ACTION { CA_MOVE_TO_LAST, CA_MOVE_ABSOLUTE };
- void DoAsyncCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController>& _xController, CURSOR_ACTION _eWhat);
- void DoAsyncCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xForm, CURSOR_ACTION _eWhat);
-
- sal_Bool HasAnyPendingCursorAction() const;
- void CancelAnyPendingCursorAction();
-
- sal_Bool HasPendingCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController>& _xController) const;
- sal_Bool HasPendingCursorAction(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xForm) const;
-
/** execute the given form slot
<p>Warning. Only a small set of slots implemented currently.</p>
@param _nSlot
@@ -585,9 +548,6 @@ public:
bool IsFormSlotEnabled( sal_Int32 _nSlot, ::com::sun::star::form::runtime::FeatureState* _pCompleteState = NULL );
protected:
- DECL_LINK(OnCursorActionDone, FmCursorActionThread*);
- DECL_LINK(OnCursorActionDoneMainThread, FmCursorActionThread*);
-
DECL_LINK( OnLoadForms, FmFormPage* );
};
@@ -642,127 +602,4 @@ public:
SVX_DLLPRIVATE virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState);
};
-//==================================================================
-// FmCursorActionThread
-//==================================================================
-
-class SAL_DLLPRIVATE FmCursorActionThread : public ::vos::OThread
-{
- Link m_aTerminationHandler; // the handler to be called upon termination
- ::com::sun::star::sdbc::SQLException m_aRunException; // the database exception thrown by RunImpl
- ::osl::Mutex m_aAccessSafety; // for securing the multi-thread access
- ::osl::Mutex m_aFinalExitControl; // see StopItWait
-
-protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> m_xDataSource; // the cursor which we work with
-
-private:
-
- UniString m_sStopperCaption; // the caption for the ThreadStopper
- sal_Bool m_bCanceled:1; // StopIt has been called ?
- sal_Bool m_bDeleteMyself:1; // delete the thread upon termination (defaults to sal_False) ?
- sal_Bool m_bDisposeCursor:1; // dispose the cursor upon termination (defaults to sal_False) ?
- sal_Bool m_bTerminated:1; // onTerminated already called ?
- sal_Bool m_bRunFailed:1; // a database execption occured in RunImpl ?
-
- // a ThreadStopper will be instantiated so that the open can be canceled via the UI
- class ThreadStopper : protected SfxCancellable
- {
- FmCursorActionThread* m_pOwner;
-
- virtual ~ThreadStopper() { }
-
- public:
- ThreadStopper(FmCursorActionThread* pOwner, const UniString& rTitle);
-
- virtual void Cancel();
-
- virtual void OwnerTerminated();
- // Normally the Owner (a FmCursorActionThread) would delete the stopper when terminated.
- // Unfortunally the application doesn't remove the 'red light' when a SfxCancellable is deleted
- // if it (the app) can't acquire the solar mutex. The deletion is IGNORED then. So we have make
- // sure that a) the stopper is deleted from inside the main thread (where the solar mutex is locked)
- // and b) that in the time between the termination of the thread and the deletion of the stopper
- // the latter doesn't access the former.
- // The OwnerTerminated cares for both aspects.
- // SO DON'T DELETE THE STOPPER EXPLICITLY !
-
- protected:
- // HACK HACK HACK HACK HACK : this should be private, but MSVC doesn't accept the LINK-macro then ....
- DECL_LINK(OnDeleteInMainThread, ThreadStopper*);
- };
- friend class FmCursorActionThread::ThreadStopper;
-
-
-public:
- ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> getDataSource() const { return m_xDataSource; }
-
-private:
- sal_Bool Terminated() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bTerminated; }
-
-public:
- FmCursorActionThread(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDataSource, const UniString& _rStopperCaption);
- virtual ~FmCursorActionThread() {}
-
- // control of self-deletion
- sal_Bool IsSelfDeleteEnabled() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bDeleteMyself; }
- void EnableSelfDelete(sal_Bool bEnable) { ::osl::MutexGuard aGuard(m_aAccessSafety); m_bDeleteMyself = bEnable; }
-
- // control of cursor-dipose
- sal_Bool IsCursorDisposeEnabled() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bDisposeCursor; }
- void EnableCursorDispose(sal_Bool bEnable) { ::osl::MutexGuard aGuard(m_aAccessSafety); m_bDisposeCursor = bEnable; }
-
- // error-access
- sal_Bool RunFailed() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bRunFailed; }
- ::com::sun::star::sdbc::SQLException GetRunException() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_aRunException; }
-
- /// the excution (within the method "run") was canceled ?
- sal_Bool WasCanceled() { ::osl::MutexGuard aGuard(m_aAccessSafety); return m_bCanceled; }
-
- /// the handler will be called synchronously (the parameter is a pointer to the thread)
- void SetTerminationHdl(const Link& aTermHdl) { ::osl::MutexGuard aGuard(m_aAccessSafety); m_aTerminationHandler = aTermHdl; }
-
- /// cancels the process. returns to the caller immediately. to be called from another thread (of course ;)
- void StopIt();
-
- /// cancels the process. does not return to the caller until the thread is terminated.
- void StopItWait();
-
-protected:
- virtual void SAL_CALL run();
- virtual void SAL_CALL onTerminated();
-
- /// called from within run. run itself handles (de)initialisation of the cancel handling.
- virtual void RunImpl() = 0;
-};
-
-//------------------------------------------------------------------------------
-
-#define DECL_CURSOR_ACTION_THREAD(classname) \
- \
-class SAL_DLLPRIVATE classname : public FmCursorActionThread \
-{ \
-public: \
- classname(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDataSource); \
-protected: \
- virtual void RunImpl(); \
-}; \
-
-
-//------------------------------------------------------------------------------
-
-#define IMPL_CURSOR_ACTION_THREAD(classname, caption, action) \
- \
-classname::classname(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDataSource) \
- :FmCursorActionThread(_xDataSource, caption) \
-{ \
-} \
- \
-void classname::RunImpl() \
-{ \
- m_xDataSource->action; \
-} \
-
-
-
#endif // _SVX_FMSHIMP_HXX
diff --git a/svx/source/intro/iso.src b/svx/source/intro/iso.src
index 00a8ffe342..d1fcbc3420 100644
--- a/svx/source/intro/iso.src
+++ b/svx/source/intro/iso.src
@@ -59,7 +59,7 @@ String RID_BUILDVERSION
ModalDialog RID_DEFAULTABOUT
{
OutputSize = TRUE ;
- Size = MAP_APPFONT ( 245 , 200 ) ;
+ Size = MAP_APPFONT ( 245 , 260 ) ;
Moveable = TRUE ;
SVLook = TRUE ;
TEXT_DEFAULTABOUT
@@ -76,12 +76,18 @@ ModalDialog RID_DEFAULTABOUT
WordBreak = TRUE ;
Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ;
};
- FixedText ABOUT_FTXT_COPYRIGHT
+ MultiLineEdit ABOUT_FTXT_COPYRIGHT
{
+ Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 25 ) ;
Size = MAP_APPFONT ( 168 , 51 ) ;
- WordBreak = TRUE ;
- Text[ en-US ] = "Copyright © 2005-2009 Sun Microsystems, Inc. All rights reserved. Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without limitation, these intellectual property rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent applications in the U.S. and in other countries. U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Use is subject to license terms. This distribution may include materials developed by third parties. Sun, Sun Microsystems, the Sun logo, Java, Solaris and StarOffice are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.\n\nThis product is based on the OpenOffice.org project." ;
+ IgnoreTab = TRUE ;
+ ReadOnly = TRUE ;
+ AutoVScroll = TRUE ;
+ };
+ String ABOUT_STR_COPYRIGHT
+ {
+ Text[ en-US ] = "Copyright © 1995, 2010, Oracle and/or its affiliates. All rights reserved.\n\nThis software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.\n\nThe information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.\n\nIf this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:\n\nU.S. GOVERNMENT RIGHTS\nPrograms, software, databases, and related documentation and technical data delivered to U.S. Government customers are \"commercial computer software\" or \"commercial technical data\" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.\n\nThis software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications.\n\nOracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.\n\nThis software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.\n\nThis product is based on the OpenOffice.org project.";
};
StringArray ABOUT_STR_DEVELOPER_ARY
{
@@ -89,7 +95,7 @@ ModalDialog RID_DEFAULTABOUT
};
String ABOUT_STR_FRENCH_COPYRIGHT
{
- Text = "Copyright © 2005-2009 Sun Microsystems, Inc. Tous droits réservés. Sun Microsystems, Inc. détient les droits de propriété intellectuels relatifs á la technologie incorporée dans le produit qui est décrit dans ce document. En particulier, et ce sans limitation, ces droits de propriété intellectuelle peuvent inclure un ou plus des brevets américains listés á l'adresse http://www.sun.com/patents et un ou les brevets supplémentaires ou les applications de brevet en attente aux Etats - Unis et dans les autres pays. L'utilisation est soumise aux termes du contrat de licence. Cette distribution peut comprendre des composants développés par des tierces parties. Sun, Sun Microsystems, le logo Sun, Java, Solaris et StarOffice sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d'autres pays. UNIX est une marque déposée aux Etats-Unis et dans d'autres pays et licenciée exlusivement par X/Open Company, Ltd.\n\nCe produit a été créé á partir du projet OpenOffice.org." ;
+ Text = "Copyright © 1995, 2010, Oracle and/or its affiliates. All rights reserved.\n\nThis software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.\n\nThe information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.\n\nIf this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:\n\nU.S. GOVERNMENT RIGHTS\nPrograms, software, databases, and related documentation and technical data delivered to U.S. Government customers are ""commercial computer software"" or ""commercial technical data"" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.\n\nThis software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications.\n\nOracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.\n\nThis software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.\n\nThis product is based on the OpenOffice.org project." ;
};
String ABOUT_STR_ACCEL
{
diff --git a/svx/source/intro/ooo.src b/svx/source/intro/ooo.src
index f025fb9de0..4c17838687 100644
--- a/svx/source/intro/ooo.src
+++ b/svx/source/intro/ooo.src
@@ -1,4 +1,4 @@
-/*************************************************************************
+/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -65,7 +65,7 @@ String RID_BUILDVERSION
ModalDialog RID_DEFAULTABOUT
{
OutputSize = TRUE ;
- Size = MAP_APPFONT ( 245 , 200 ) ;
+ Size = MAP_APPFONT ( 245 , 260 ) ;
Moveable = TRUE ;
SVLook = TRUE ;
TEXT_DEFAULTABOUT
@@ -81,13 +81,19 @@ ModalDialog RID_DEFAULTABOUT
Size = MAP_APPFONT ( 118 , 16 ) ;
WordBreak = TRUE ;
Text = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION" ;
- };
- FixedText ABOUT_FTXT_COPYRIGHT
+ };
+ MultiLineEdit ABOUT_FTXT_COPYRIGHT
{
+ Border = TRUE ;
Pos = MAP_APPFONT ( 54 , 25 ) ;
Size = MAP_APPFONT ( 168 , 51 ) ;
- Text[ en-US ] ="Copyright 2000-2009 Sun Microsystems Inc.\nThis product was created by " OOO_VENDOR ", based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at http://www.openoffice.org/welcome/credits.html.";
- WordBreak = TRUE ;
+ IgnoreTab = TRUE ;
+ ReadOnly = TRUE ;
+ AutoVScroll = TRUE ;
+ };
+ String ABOUT_STR_COPYRIGHT
+ {
+ Text[ en-US ] = "Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by " OOO_VENDOR ", based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html.";
};
StringArray ABOUT_STR_DEVELOPER_ARY
{
diff --git a/svx/source/items/svxitems.src b/svx/source/items/svxitems.src
index a2fd85293c..d70e69ea99 100644
--- a/svx/source/items/svxitems.src
+++ b/svx/source/items/svxitems.src
@@ -26,8 +26,8 @@
************************************************************************/
// include ------------------------------------------------------------------
-#include <svx/svxitems.hrc>
-#include <svx/svxids.hrc>
+#include "svx/svxitems.hrc"
+#include "svx/svxids.hrc"
#include <editeng/editids.hrc>
StringArray RID_ATTR_NAMES
diff --git a/svx/source/sdr/attribute/makefile.mk b/svx/source/sdr/attribute/makefile.mk
index 5ca44ee5c2..177654ff1e 100644
--- a/svx/source/sdr/attribute/makefile.mk
+++ b/svx/source/sdr/attribute/makefile.mk
@@ -39,7 +39,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
SLOFILES=\
- $(SLO)$/sdrallattribute.obj \
+ $(SLO)$/sdrfilltextattribute.obj \
+ $(SLO)$/sdrlinefillshadowtextattribute.obj \
+ $(SLO)$/sdrlineshadowtextattribute.obj \
+ $(SLO)$/sdrshadowtextattribute.obj \
$(SLO)$/sdrtextattribute.obj \
$(SLO)$/sdrformtextattribute.obj \
$(SLO)$/sdrformtextoutlineattribute.obj
diff --git a/svx/source/sdr/attribute/sdrallattribute.cxx b/svx/source/sdr/attribute/sdrallattribute.cxx
deleted file mode 100644
index 605c023c50..0000000000
--- a/svx/source/sdr/attribute/sdrallattribute.cxx
+++ /dev/null
@@ -1,408 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "precompiled_svx.hxx"
-
-#include <svx/sdr/attribute/sdrallattribute.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
-#include <svx/sdr/attribute/sdrtextattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrShadowTextAttribute::SdrShadowTextAttribute(
- SdrShadowAttribute* pShadow,
- SdrTextAttribute* pTextAttribute)
- : mpShadow(pShadow),
- mpTextAttribute(pTextAttribute)
- {
- }
-
- SdrShadowTextAttribute::SdrShadowTextAttribute(
- const SdrShadowTextAttribute& rCandidate)
- : mpShadow(0),
- mpTextAttribute(0)
- {
- *this = rCandidate;
- }
-
- SdrShadowTextAttribute::~SdrShadowTextAttribute()
- {
- delete mpShadow;
- delete mpTextAttribute;
- }
-
- SdrShadowTextAttribute& SdrShadowTextAttribute::operator=(const SdrShadowTextAttribute& rCandidate)
- {
- // handle mpShadow
- {
- // delete local mpShadow if necessary
- if(mpShadow)
- {
- delete mpShadow;
- mpShadow = 0;
- }
-
- // copy mpShadow if necessary
- if(rCandidate.mpShadow)
- {
- mpShadow = new SdrShadowAttribute(*rCandidate.mpShadow);
- }
- }
-
- // handle mpTextAttribute
- {
- // delete local mpTextAttribute if necessary
- if(mpTextAttribute)
- {
- delete mpTextAttribute;
- mpTextAttribute = 0;
- }
-
- // copy mpTextAttribute if necessary
- if(rCandidate.mpTextAttribute)
- {
- mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute);
- }
- }
-
- return *this;
- }
-
- bool SdrShadowTextAttribute::operator==(const SdrShadowTextAttribute& rCandidate) const
- {
- // handle mpShadow
- if(!pointerOrContentEqual(mpShadow, rCandidate.mpShadow))
- return false;
-
- // handle mpTextAttribute
- if(!pointerOrContentEqual(mpTextAttribute, rCandidate.mpTextAttribute))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrFillTextAttribute::SdrFillTextAttribute(
- SdrFillAttribute* pFill,
- FillGradientAttribute* pFillFloatTransGradient,
- SdrTextAttribute* pTextAttribute)
- : mpFill(pFill),
- mpFillFloatTransGradient(pFillFloatTransGradient),
- mpTextAttribute(pTextAttribute)
- {
- }
-
- SdrFillTextAttribute::SdrFillTextAttribute(
- const SdrFillTextAttribute& rCandidate)
- : mpFill(0),
- mpFillFloatTransGradient(0),
- mpTextAttribute(0)
- {
- *this = rCandidate;
- }
-
- SdrFillTextAttribute::~SdrFillTextAttribute()
- {
- delete mpFill;
- delete mpFillFloatTransGradient;
- delete mpTextAttribute;
- }
-
- SdrFillTextAttribute& SdrFillTextAttribute::operator=(const SdrFillTextAttribute& rCandidate)
- {
- // handle mpFill
- {
- // delete local mpFill if necessary
- if(mpFill)
- {
- delete mpFill;
- mpFill = 0;
- }
-
- // copy mpFill if necessary
- if(rCandidate.mpFill)
- {
- mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill);
- }
- }
-
- // handle mpFillFloatTransGradient
- {
- // delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient)
- {
- delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0;
- }
-
- // copy mpFillFloatTransGradient if necessary
- if(rCandidate.mpFillFloatTransGradient)
- {
- mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
- }
- }
-
- // handle mpTextAttribute
- {
- // delete local mpTextAttribute if necessary
- if(mpTextAttribute)
- {
- delete mpTextAttribute;
- mpTextAttribute = 0;
- }
-
- // copy mpTextAttribute if necessary
- if(rCandidate.mpTextAttribute)
- {
- mpTextAttribute = new SdrTextAttribute(*rCandidate.mpTextAttribute);
- }
- }
-
- return *this;
- }
-
- bool SdrFillTextAttribute::operator==(const SdrFillTextAttribute& rCandidate) const
- {
- // handle mpFill
- if(!pointerOrContentEqual(mpFill, rCandidate.mpFill))
- return false;
-
- // handle mpFillFloatTransGradient
- if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient))
- return false;
-
- // handle mpTextAttribute
- if(!pointerOrContentEqual(mpTextAttribute, rCandidate.mpTextAttribute))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
- SdrLineAttribute* pLine,
- SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow,
- SdrTextAttribute* pTextAttribute)
- : SdrShadowTextAttribute(pShadow, pTextAttribute),
- mpLine(pLine),
- mpLineStartEnd(pLineStartEnd)
- {
- }
-
- SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
- const SdrLineShadowTextAttribute& rCandidate)
- : SdrShadowTextAttribute(0, 0),
- mpLine(0),
- mpLineStartEnd(0)
- {
- *this = rCandidate;
- }
-
- SdrLineShadowTextAttribute::~SdrLineShadowTextAttribute()
- {
- delete mpLine;
- delete mpLineStartEnd;
- }
-
- SdrLineShadowTextAttribute& SdrLineShadowTextAttribute::operator=(const SdrLineShadowTextAttribute& rCandidate)
- {
- // call parent
- SdrShadowTextAttribute::operator=(rCandidate);
-
- // handle mpLine
- {
- // delete local mpLine if necessary
- if(mpLine)
- {
- delete mpLine;
- mpLine = 0;
- }
-
- // copy mpLine if necessary
- if(rCandidate.mpLine)
- {
- mpLine = new SdrLineAttribute(*rCandidate.mpLine);
- }
- }
-
- // handle mpLineStartEnd
- {
- // delete local mpLineStartEnd if necessary
- if(mpLineStartEnd)
- {
- delete mpLineStartEnd;
- mpLineStartEnd = 0;
- }
-
- // copy mpLineStartEnd if necessary
- if(rCandidate.mpLineStartEnd)
- {
- mpLineStartEnd = new SdrLineStartEndAttribute(*rCandidate.mpLineStartEnd);
- }
- }
-
- return *this;
- }
-
- bool SdrLineShadowTextAttribute::operator==(const SdrLineShadowTextAttribute& rCandidate) const
- {
- // call parent
- if(!(SdrShadowTextAttribute::operator==(rCandidate)))
- return false;
-
- // handle mpLine
- if(!pointerOrContentEqual(mpLine, rCandidate.mpLine))
- return false;
-
- // handle mpLineStartEnd
- if(!pointerOrContentEqual(mpLineStartEnd, rCandidate.mpLineStartEnd))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-
-namespace drawinglayer
-{
- namespace attribute
- {
- SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
- SdrLineAttribute* pLine,
- attribute::SdrFillAttribute* pFill,
- SdrLineStartEndAttribute* pLineStartEnd,
- SdrShadowAttribute* pShadow,
- FillGradientAttribute* pFillFloatTransGradient,
- SdrTextAttribute* pTextAttribute)
- : SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pTextAttribute),
- mpFill(pFill),
- mpFillFloatTransGradient(pFillFloatTransGradient)
- {
- }
-
- SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
- const SdrLineFillShadowTextAttribute& rCandidate)
- : SdrLineShadowTextAttribute(0, 0, 0, 0),
- mpFill(0),
- mpFillFloatTransGradient(0)
- {
- *this = rCandidate;
- }
-
- SdrLineFillShadowTextAttribute::~SdrLineFillShadowTextAttribute()
- {
- delete mpFill;
- delete mpFillFloatTransGradient;
- }
-
- SdrLineFillShadowTextAttribute& SdrLineFillShadowTextAttribute::operator=(const SdrLineFillShadowTextAttribute& rCandidate)
- {
- // call parent
- SdrLineShadowTextAttribute::operator=(rCandidate);
-
- // handle mpFill
- {
- // delete local mpFill if necessary
- if(mpFill)
- {
- delete mpFill;
- mpFill = 0;
- }
-
- // copy mpFill if necessary
- if(rCandidate.mpFill)
- {
- mpFill = new attribute::SdrFillAttribute(*rCandidate.mpFill);
- }
- }
-
- // handle mpFillFloatTransGradient
- {
- // delete local mpFillFloatTransGradient if necessary
- if(mpFillFloatTransGradient)
- {
- delete mpFillFloatTransGradient;
- mpFillFloatTransGradient = 0;
- }
-
- // copy mpFillFloatTransGradient if necessary
- if(rCandidate.mpFillFloatTransGradient)
- {
- mpFillFloatTransGradient = new FillGradientAttribute(*rCandidate.mpFillFloatTransGradient);
- }
- }
-
- return *this;
- }
-
- bool SdrLineFillShadowTextAttribute::operator==(const SdrLineFillShadowTextAttribute& rCandidate) const
- {
- // call parent
- if(!(SdrLineShadowTextAttribute::operator==(rCandidate)))
- return false;
-
- // handle mpFill
- if(!pointerOrContentEqual(mpFill, rCandidate.mpFill))
- return false;
-
- // handle mpFillFloatTransGradient
- if(!pointerOrContentEqual(mpFillFloatTransGradient, rCandidate.mpFillFloatTransGradient))
- return false;
-
- return true;
- }
- } // end of namespace attribute
-} // end of namespace drawinglayer
-
-//////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/svx/source/sdr/attribute/sdrfilltextattribute.cxx b/svx/source/sdr/attribute/sdrfilltextattribute.cxx
new file mode 100644
index 0000000000..f31622bfc8
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrfilltextattribute.cxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrfilltextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrFillTextAttribute::SdrFillTextAttribute(
+ const SdrFillAttribute& rFill,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute)
+ : maFill(rFill),
+ maFillFloatTransGradient(rFillFloatTransGradient),
+ maTextAttribute(rTextAttribute)
+ {
+ }
+
+ SdrFillTextAttribute::SdrFillTextAttribute()
+ : maFill(),
+ maFillFloatTransGradient(),
+ maTextAttribute()
+ {
+ }
+
+ SdrFillTextAttribute::SdrFillTextAttribute(const SdrFillTextAttribute& rCandidate)
+ : maFill(rCandidate.getFill()),
+ maFillFloatTransGradient(rCandidate.getFillFloatTransGradient()),
+ maTextAttribute(rCandidate.getText())
+ {
+ }
+
+ SdrFillTextAttribute& SdrFillTextAttribute::operator=(const SdrFillTextAttribute& rCandidate)
+ {
+ maFill = rCandidate.getFill();
+ maFillFloatTransGradient = rCandidate.getFillFloatTransGradient();
+ maTextAttribute = rCandidate.getText();
+
+ return *this;
+ }
+
+ bool SdrFillTextAttribute::isDefault() const
+ {
+ return(getFill().isDefault()
+ && getFillFloatTransGradient().isDefault()
+ && getText().isDefault());
+ }
+
+ bool SdrFillTextAttribute::operator==(const SdrFillTextAttribute& rCandidate) const
+ {
+ return(getFill() == rCandidate.getFill()
+ && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient()
+ && getText() == rCandidate.getText());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx
index d475bd3f60..7cf7b58789 100644
--- a/svx/source/sdr/attribute/sdrformtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx
@@ -28,8 +28,8 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <basegfx/vector/b2enums.hxx>
#include <svl/itemset.hxx>
-
#include <svx/xftdiit.hxx>
#include <svx/xftstit.hxx>
#include <svx/xftshxy.hxx>
@@ -40,11 +40,8 @@
#include <svx/xftshcit.hxx>
#include <svx/xftmrit.hxx>
#include <svx/xftouit.hxx>
-
#include <svx/sdshtitm.hxx>
#include <svx/xlntrit.hxx>
-#include <drawinglayer/attribute/lineattribute.hxx>
-#include <drawinglayer/attribute/strokeattribute.hxx>
#include <svx/sdshcitm.hxx>
#include <svx/xlnclit.hxx>
#include <svx/xlnwtit.hxx>
@@ -52,13 +49,11 @@
#include <svx/xlineit0.hxx>
#include <svx/xdash.hxx>
#include <svx/xlndsit.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
-
-//////////////////////////////////////////////////////////////////////////////
// helper to get line, stroke and transparence attributes from SfxItemSet
namespace
@@ -154,144 +149,272 @@ namespace drawinglayer
{
namespace attribute
{
- SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet)
- : mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
- mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
- mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
- mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
- mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
- meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
- meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
- meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
- maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
- mpOutline(0),
- mpShadowOutline(0),
- mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
- mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
+ class ImpSdrFormTextAttribute
{
- if(getFormTextOutline())
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // FormText (FontWork) Attributes
+ sal_Int32 mnFormTextDistance; // distance from line in upright direction
+ sal_Int32 mnFormTextStart; // shift from polygon start
+ sal_Int32 mnFormTextShdwXVal; // shadow distance or 10th degrees
+ sal_Int32 mnFormTextShdwYVal; // shadow distance or scaling
+ sal_uInt16 mnFormTextShdwTransp; // shadow transparence
+ XFormTextStyle meFormTextStyle; // on/off and char orientation
+ XFormTextAdjust meFormTextAdjust; // adjustment (left/right/center) and scale
+ XFormTextShadow meFormTextShadow; // shadow mode
+ Color maFormTextShdwColor; // shadow color
+
+ // outline attributes; used when getFormTextOutline() is true and (for
+ // shadow) when getFormTextShadow() != XFTSHADOW_NONE
+ SdrFormTextOutlineAttribute maOutline;
+ SdrFormTextOutlineAttribute maShadowOutline;
+
+ // bitfield
+ unsigned mbFormTextMirror : 1; // change orientation
+ unsigned mbFormTextOutline : 1; // show contour of objects
+
+ ImpSdrFormTextAttribute(const SfxItemSet& rSet)
+ : mnRefCount(0),
+ mnFormTextDistance(((const XFormTextDistanceItem&)rSet.Get(XATTR_FORMTXTDISTANCE)).GetValue()),
+ mnFormTextStart(((const XFormTextStartItem&)rSet.Get(XATTR_FORMTXTSTART)).GetValue()),
+ mnFormTextShdwXVal(((const XFormTextShadowXValItem&)rSet.Get(XATTR_FORMTXTSHDWXVAL)).GetValue()),
+ mnFormTextShdwYVal(((const XFormTextShadowYValItem&)rSet.Get(XATTR_FORMTXTSHDWYVAL)).GetValue()),
+ mnFormTextShdwTransp(((const XFormTextShadowTranspItem&)rSet.Get(XATTR_FORMTXTSHDWTRANSP)).GetValue()),
+ meFormTextStyle(((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue()),
+ meFormTextAdjust(((const XFormTextAdjustItem&)rSet.Get(XATTR_FORMTXTADJUST)).GetValue()),
+ meFormTextShadow(((const XFormTextShadowItem&)rSet.Get(XATTR_FORMTXTSHADOW)).GetValue()),
+ maFormTextShdwColor(((const XFormTextShadowColorItem&)rSet.Get(XATTR_FORMTXTSHDWCOLOR)).GetColorValue()),
+ maOutline(),
+ maShadowOutline(),
+ mbFormTextMirror(((const XFormTextMirrorItem&)rSet.Get(XATTR_FORMTXTMIRROR)).GetValue()),
+ mbFormTextOutline(((const XFormTextOutlineItem&)rSet.Get(XATTR_FORMTXTOUTLINE)).GetValue())
{
- const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet));
-
- // also need to prepare attributes for outlines
+ if(getFormTextOutline())
{
- const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet));
- const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet));
-
- mpOutline = new SdrFormTextOutlineAttribute(
- aLineAttribute, aStrokeAttribute, nTransparence);
+ const StrokeAttribute aStrokeAttribute(impGetStrokeAttribute(rSet));
+
+ // also need to prepare attributes for outlines
+ {
+ const LineAttribute aLineAttribute(impGetLineAttribute(false, rSet));
+ const sal_uInt8 nTransparence(impGetStrokeTransparence(false, rSet));
+
+ maOutline = SdrFormTextOutlineAttribute(
+ aLineAttribute, aStrokeAttribute, nTransparence);
+ }
+
+ if(XFTSHADOW_NONE != getFormTextShadow())
+ {
+ // also need to prepare attributes for shadow outlines
+ const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet));
+ const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet));
+
+ maShadowOutline = SdrFormTextOutlineAttribute(
+ aLineAttribute, aStrokeAttribute, nTransparence);
+ }
}
+ }
- if(XFTSHADOW_NONE != getFormTextShadow())
- {
- // also need to prepare attributes for shadow outlines
- const LineAttribute aLineAttribute(impGetLineAttribute(true, rSet));
- const sal_uInt8 nTransparence(impGetStrokeTransparence(true, rSet));
-
- mpShadowOutline = new SdrFormTextOutlineAttribute(
- aLineAttribute, aStrokeAttribute, nTransparence);
- }
+ ImpSdrFormTextAttribute()
+ : mnRefCount(0),
+ mnFormTextDistance(0),
+ mnFormTextStart(0),
+ mnFormTextShdwXVal(0),
+ mnFormTextShdwYVal(0),
+ mnFormTextShdwTransp(0),
+ meFormTextStyle(XFT_NONE),
+ meFormTextAdjust(XFT_CENTER),
+ meFormTextShadow(XFTSHADOW_NONE),
+ maFormTextShdwColor(),
+ maOutline(),
+ maShadowOutline(),
+ mbFormTextMirror(false),
+ mbFormTextOutline(false)
+ {
}
- }
- SdrFormTextAttribute::~SdrFormTextAttribute()
- {
- if(mpOutline)
+ // data read access
+ sal_Int32 getFormTextDistance() const { return mnFormTextDistance; }
+ sal_Int32 getFormTextStart() const { return mnFormTextStart; }
+ sal_Int32 getFormTextShdwXVal() const { return mnFormTextShdwXVal; }
+ sal_Int32 getFormTextShdwYVal() const { return mnFormTextShdwYVal; }
+ sal_uInt16 getFormTextShdwTransp() const { return mnFormTextShdwTransp; }
+ XFormTextStyle getFormTextStyle() const { return meFormTextStyle; }
+ XFormTextAdjust getFormTextAdjust() const { return meFormTextAdjust; }
+ XFormTextShadow getFormTextShadow() const { return meFormTextShadow; }
+ Color getFormTextShdwColor() const { return maFormTextShdwColor; }
+ const SdrFormTextOutlineAttribute& getOutline() const { return maOutline; }
+ const SdrFormTextOutlineAttribute& getShadowOutline() const { return maShadowOutline; }
+ bool getFormTextMirror() const { return mbFormTextMirror; }
+ bool getFormTextOutline() const { return mbFormTextOutline; }
+
+ // compare operator
+ bool operator==(const ImpSdrFormTextAttribute& rCandidate) const
{
- delete mpOutline;
- mpOutline = 0;
+ return (getFormTextDistance() == rCandidate.getFormTextDistance()
+ && getFormTextStart() == rCandidate.getFormTextStart()
+ && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal()
+ && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal()
+ && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp()
+ && getFormTextStyle() == rCandidate.getFormTextStyle()
+ && getFormTextAdjust() == rCandidate.getFormTextAdjust()
+ && getFormTextShadow() == rCandidate.getFormTextShadow()
+ && getFormTextShdwColor() == rCandidate.getFormTextShdwColor()
+ && getOutline() == rCandidate.getOutline()
+ && getShadowOutline() == rCandidate.getShadowOutline()
+ && getFormTextMirror() == rCandidate.getFormTextMirror()
+ && getFormTextOutline() == rCandidate.getFormTextOutline());
}
- if(mpShadowOutline)
+ static ImpSdrFormTextAttribute* get_global_default()
{
- delete mpShadowOutline;
- mpShadowOutline = 0;
+ static ImpSdrFormTextAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFormTextAttribute();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
}
+ };
+
+ SdrFormTextAttribute::SdrFormTextAttribute(const SfxItemSet& rSet)
+ : mpSdrFormTextAttribute(new ImpSdrFormTextAttribute(rSet))
+ {
+ }
+
+ SdrFormTextAttribute::SdrFormTextAttribute()
+ : mpSdrFormTextAttribute(ImpSdrFormTextAttribute::get_global_default())
+ {
+ mpSdrFormTextAttribute->mnRefCount++;
}
SdrFormTextAttribute::SdrFormTextAttribute(const SdrFormTextAttribute& rCandidate)
- : mnFormTextDistance(rCandidate.getFormTextDistance()),
- mnFormTextStart(rCandidate.getFormTextStart()),
- mnFormTextShdwXVal(rCandidate.getFormTextShdwXVal()),
- mnFormTextShdwYVal(rCandidate.getFormTextShdwYVal()),
- mnFormTextShdwTransp(rCandidate.getFormTextShdwTransp()),
- meFormTextStyle(rCandidate.getFormTextStyle()),
- meFormTextAdjust(rCandidate.getFormTextAdjust()),
- meFormTextShadow(rCandidate.getFormTextShadow()),
- maFormTextShdwColor(rCandidate.getFormTextShdwColor()),
- mpOutline(0),
- mpShadowOutline(0),
- mbFormTextMirror(rCandidate.getFormTextMirror()),
- mbFormTextOutline(rCandidate.getFormTextOutline())
+ : mpSdrFormTextAttribute(rCandidate.mpSdrFormTextAttribute)
{
- if(rCandidate.getOutline())
+ mpSdrFormTextAttribute->mnRefCount++;
+ }
+
+ SdrFormTextAttribute::~SdrFormTextAttribute()
+ {
+ if(mpSdrFormTextAttribute->mnRefCount)
{
- mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline());
+ mpSdrFormTextAttribute->mnRefCount--;
}
-
- if(rCandidate.getShadowOutline())
+ else
{
- mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline());
+ delete mpSdrFormTextAttribute;
}
}
+ bool SdrFormTextAttribute::isDefault() const
+ {
+ return mpSdrFormTextAttribute == ImpSdrFormTextAttribute::get_global_default();
+ }
+
SdrFormTextAttribute& SdrFormTextAttribute::operator=(const SdrFormTextAttribute& rCandidate)
{
- mnFormTextDistance = rCandidate.getFormTextDistance();
- mnFormTextStart = rCandidate.getFormTextStart();
- mnFormTextShdwXVal = rCandidate.getFormTextShdwXVal();
- mnFormTextShdwYVal = rCandidate.getFormTextShdwYVal();
- mnFormTextShdwTransp = rCandidate.getFormTextShdwTransp();
- meFormTextStyle = rCandidate.getFormTextStyle();
- meFormTextAdjust = rCandidate.getFormTextAdjust();
- meFormTextShadow = rCandidate.getFormTextShadow();
- maFormTextShdwColor = rCandidate.getFormTextShdwColor();
-
- if(mpOutline)
+ if(rCandidate.mpSdrFormTextAttribute != mpSdrFormTextAttribute)
{
- delete mpOutline;
+ if(mpSdrFormTextAttribute->mnRefCount)
+ {
+ mpSdrFormTextAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFormTextAttribute;
+ }
+
+ mpSdrFormTextAttribute = rCandidate.mpSdrFormTextAttribute;
+ mpSdrFormTextAttribute->mnRefCount++;
}
- mpOutline = 0;
+ return *this;
+ }
- if(rCandidate.getOutline())
+ bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrFormTextAttribute == mpSdrFormTextAttribute)
{
- mpOutline = new SdrFormTextOutlineAttribute(*rCandidate.getOutline());
+ return true;
}
- if(mpShadowOutline)
+ if(rCandidate.isDefault() != isDefault())
{
- delete mpShadowOutline;
+ return false;
}
- mpShadowOutline = 0;
-
- if(rCandidate.getShadowOutline())
- {
- mpShadowOutline = new SdrFormTextOutlineAttribute(*rCandidate.getShadowOutline());
- }
+ return (*rCandidate.mpSdrFormTextAttribute == *mpSdrFormTextAttribute);
+ }
+
+ sal_Int32 SdrFormTextAttribute::getFormTextDistance() const
+ {
+ return mpSdrFormTextAttribute->getFormTextDistance();
+ }
- mbFormTextMirror = rCandidate.getFormTextMirror();
- mbFormTextOutline = rCandidate.getFormTextOutline();
+ sal_Int32 SdrFormTextAttribute::getFormTextStart() const
+ {
+ return mpSdrFormTextAttribute->getFormTextStart();
+ }
- return *this;
+ sal_Int32 SdrFormTextAttribute::getFormTextShdwXVal() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwXVal();
}
- bool SdrFormTextAttribute::operator==(const SdrFormTextAttribute& rCandidate) const
- {
- return (getFormTextDistance() == rCandidate.getFormTextDistance()
- && getFormTextStart() == rCandidate.getFormTextStart()
- && getFormTextShdwXVal() == rCandidate.getFormTextShdwXVal()
- && getFormTextShdwYVal() == rCandidate.getFormTextShdwYVal()
- && getFormTextShdwTransp() == rCandidate.getFormTextShdwTransp()
- && getFormTextStyle() == rCandidate.getFormTextStyle()
- && getFormTextAdjust() == rCandidate.getFormTextAdjust()
- && getFormTextShadow() == rCandidate.getFormTextShadow()
- && getFormTextShdwColor() == rCandidate.getFormTextShdwColor()
- && pointerOrContentEqual(getOutline(), rCandidate.getOutline())
- && pointerOrContentEqual(getShadowOutline(), rCandidate.getShadowOutline())
- && getFormTextMirror() == rCandidate.getFormTextMirror()
- && getFormTextOutline() == rCandidate.getFormTextOutline());
+ sal_Int32 SdrFormTextAttribute::getFormTextShdwYVal() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwYVal();
+ }
+
+ sal_uInt16 SdrFormTextAttribute::getFormTextShdwTransp() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwTransp();
+ }
+
+ XFormTextStyle SdrFormTextAttribute::getFormTextStyle() const
+ {
+ return mpSdrFormTextAttribute->getFormTextStyle();
+ }
+
+ XFormTextAdjust SdrFormTextAttribute::getFormTextAdjust() const
+ {
+ return mpSdrFormTextAttribute->getFormTextAdjust();
+ }
+
+ XFormTextShadow SdrFormTextAttribute::getFormTextShadow() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShadow();
+ }
+
+ Color SdrFormTextAttribute::getFormTextShdwColor() const
+ {
+ return mpSdrFormTextAttribute->getFormTextShdwColor();
+ }
+
+ const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getOutline() const
+ {
+ return mpSdrFormTextAttribute->getOutline();
+ }
+
+ const SdrFormTextOutlineAttribute& SdrFormTextAttribute::getShadowOutline() const
+ {
+ return mpSdrFormTextAttribute->getShadowOutline();
+ }
+
+ bool SdrFormTextAttribute::getFormTextMirror() const
+ {
+ return mpSdrFormTextAttribute->getFormTextMirror();
+ }
+
+ bool SdrFormTextAttribute::getFormTextOutline() const
+ {
+ return mpSdrFormTextAttribute->getFormTextOutline();
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
index cfa1cf49d6..be33783023 100644
--- a/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
+++ b/svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
@@ -28,10 +28,8 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
-
-//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/strokeattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -39,21 +37,146 @@ namespace drawinglayer
{
namespace attribute
{
+ class ImpSdrFormTextOutlineAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // one set of attributes for FormText (FontWork) outline visualisation
+ LineAttribute maLineAttribute;
+ StrokeAttribute maStrokeAttribute;
+ sal_uInt8 mnTransparence;
+
+ ImpSdrFormTextOutlineAttribute(
+ const LineAttribute& rLineAttribute,
+ const StrokeAttribute& rStrokeAttribute,
+ sal_uInt8 nTransparence)
+ : mnRefCount(0),
+ maLineAttribute(rLineAttribute),
+ maStrokeAttribute(rStrokeAttribute),
+ mnTransparence(nTransparence)
+ {
+ }
+
+ // data read access
+ const LineAttribute& getLineAttribute() const { return maLineAttribute; }
+ const StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; }
+ sal_uInt8 getTransparence() const { return mnTransparence; }
+
+ // compare operator
+ bool operator==(const ImpSdrFormTextOutlineAttribute& rCandidate) const
+ {
+ return (getLineAttribute() == rCandidate.getLineAttribute()
+ && getStrokeAttribute() == rCandidate.getStrokeAttribute()
+ && getTransparence() == rCandidate.getTransparence());
+ }
+
+ static ImpSdrFormTextOutlineAttribute* get_global_default()
+ {
+ static ImpSdrFormTextOutlineAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpSdrFormTextOutlineAttribute(
+ LineAttribute(),
+ StrokeAttribute(),
+ 0);
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute(
const LineAttribute& rLineAttribute,
const StrokeAttribute& rStrokeAttribute,
sal_uInt8 nTransparence)
- : maLineAttribute(rLineAttribute),
- maStrokeAttribute(rStrokeAttribute),
- mnTransparence(nTransparence)
+ : mpSdrFormTextOutlineAttribute(new ImpSdrFormTextOutlineAttribute(
+ rLineAttribute, rStrokeAttribute, nTransparence))
+ {
+ }
+
+ SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute()
+ : mpSdrFormTextOutlineAttribute(ImpSdrFormTextOutlineAttribute::get_global_default())
+ {
+ mpSdrFormTextOutlineAttribute->mnRefCount++;
+ }
+
+ SdrFormTextOutlineAttribute::SdrFormTextOutlineAttribute(const SdrFormTextOutlineAttribute& rCandidate)
+ : mpSdrFormTextOutlineAttribute(rCandidate.mpSdrFormTextOutlineAttribute)
{
+ mpSdrFormTextOutlineAttribute->mnRefCount++;
+ }
+
+ SdrFormTextOutlineAttribute::~SdrFormTextOutlineAttribute()
+ {
+ if(mpSdrFormTextOutlineAttribute->mnRefCount)
+ {
+ mpSdrFormTextOutlineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFormTextOutlineAttribute;
+ }
+ }
+
+ bool SdrFormTextOutlineAttribute::isDefault() const
+ {
+ return mpSdrFormTextOutlineAttribute == ImpSdrFormTextOutlineAttribute::get_global_default();
+ }
+
+ SdrFormTextOutlineAttribute& SdrFormTextOutlineAttribute::operator=(const SdrFormTextOutlineAttribute& rCandidate)
+ {
+ if(rCandidate.mpSdrFormTextOutlineAttribute != mpSdrFormTextOutlineAttribute)
+ {
+ if(mpSdrFormTextOutlineAttribute->mnRefCount)
+ {
+ mpSdrFormTextOutlineAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrFormTextOutlineAttribute;
+ }
+
+ mpSdrFormTextOutlineAttribute = rCandidate.mpSdrFormTextOutlineAttribute;
+ mpSdrFormTextOutlineAttribute->mnRefCount++;
+ }
+
+ return *this;
}
bool SdrFormTextOutlineAttribute::operator==(const SdrFormTextOutlineAttribute& rCandidate) const
{
- return (getLineAttribute() == rCandidate.getLineAttribute()
- && getStrokeAttribute() == rCandidate.getStrokeAttribute()
- && getTransparence() == rCandidate.getTransparence());
+ if(rCandidate.mpSdrFormTextOutlineAttribute == mpSdrFormTextOutlineAttribute)
+ {
+ return true;
+ }
+
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
+ return (*rCandidate.mpSdrFormTextOutlineAttribute == *mpSdrFormTextOutlineAttribute);
+ }
+
+ const LineAttribute& SdrFormTextOutlineAttribute::getLineAttribute() const
+ {
+ return mpSdrFormTextOutlineAttribute->getLineAttribute();
+ }
+
+ const StrokeAttribute& SdrFormTextOutlineAttribute::getStrokeAttribute() const
+ {
+ return mpSdrFormTextOutlineAttribute->getStrokeAttribute();
+ }
+
+ sal_uInt8 SdrFormTextOutlineAttribute::getTransparence() const
+ {
+ return mpSdrFormTextOutlineAttribute->getTransparence();
}
} // end of namespace attribute
} // end of namespace drawinglayer
diff --git a/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx
new file mode 100644
index 0000000000..073d9b7cf8
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrlinefillshadowtextattribute.cxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrFillAttribute& rFill,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const FillGradientAttribute& rFillFloatTransGradient,
+ const SdrTextAttribute& rTextAttribute)
+ : SdrLineShadowTextAttribute(rLine, rLineStartEnd, rShadow, rTextAttribute),
+ maFill(rFill),
+ maFillFloatTransGradient(rFillFloatTransGradient)
+ {
+ }
+
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute()
+ : SdrLineShadowTextAttribute(),
+ maFill(),
+ maFillFloatTransGradient()
+ {
+ }
+
+ SdrLineFillShadowTextAttribute::SdrLineFillShadowTextAttribute(const SdrLineFillShadowTextAttribute& rCandidate)
+ : SdrLineShadowTextAttribute(rCandidate),
+ maFill(rCandidate.getFill()),
+ maFillFloatTransGradient(rCandidate.getFillFloatTransGradient())
+ {
+ }
+
+ SdrLineFillShadowTextAttribute& SdrLineFillShadowTextAttribute::operator=(const SdrLineFillShadowTextAttribute& rCandidate)
+ {
+ SdrLineShadowTextAttribute::operator=(rCandidate);
+ maFill = rCandidate.getFill();
+ maFillFloatTransGradient = rCandidate.getFillFloatTransGradient();
+
+ return *this;
+ }
+
+ bool SdrLineFillShadowTextAttribute::isDefault() const
+ {
+ return (SdrLineShadowTextAttribute::isDefault()
+ && getFill().isDefault()
+ && getFillFloatTransGradient().isDefault());
+ }
+
+ bool SdrLineFillShadowTextAttribute::operator==(const SdrLineFillShadowTextAttribute& rCandidate) const
+ {
+ return(SdrLineShadowTextAttribute::operator==(rCandidate)
+ && getFill() == rCandidate.getFill()
+ && getFillFloatTransGradient() == rCandidate.getFillFloatTransGradient());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx
new file mode 100644
index 0000000000..f2042d6d0c
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrlineshadowtextattribute.cxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(
+ const SdrLineAttribute& rLine,
+ const SdrLineStartEndAttribute& rLineStartEnd,
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute)
+ : SdrShadowTextAttribute(rShadow, rTextAttribute),
+ maLine(rLine),
+ maLineStartEnd(rLineStartEnd)
+ {
+ }
+
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute()
+ : SdrShadowTextAttribute(),
+ maLine(),
+ maLineStartEnd()
+ {
+ }
+
+ SdrLineShadowTextAttribute::SdrLineShadowTextAttribute(const SdrLineShadowTextAttribute& rCandidate)
+ : SdrShadowTextAttribute(rCandidate),
+ maLine(rCandidate.getLine()),
+ maLineStartEnd(rCandidate.getLineStartEnd())
+ {
+ }
+
+ SdrLineShadowTextAttribute& SdrLineShadowTextAttribute::operator=(const SdrLineShadowTextAttribute& rCandidate)
+ {
+ SdrShadowTextAttribute::operator=(rCandidate);
+ maLine = rCandidate.getLine();
+ maLineStartEnd = rCandidate.getLineStartEnd();
+
+ return *this;
+ }
+
+ bool SdrLineShadowTextAttribute::isDefault() const
+ {
+ return(SdrShadowTextAttribute::isDefault()
+ && getLine().isDefault()
+ && getLineStartEnd().isDefault());
+ }
+
+ bool SdrLineShadowTextAttribute::operator==(const SdrLineShadowTextAttribute& rCandidate) const
+ {
+ return(SdrShadowTextAttribute::operator==(rCandidate)
+ && getLine() == rCandidate.getLine()
+ && getLineStartEnd() == rCandidate.getLineStartEnd());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrshadowtextattribute.cxx b/svx/source/sdr/attribute/sdrshadowtextattribute.cxx
new file mode 100644
index 0000000000..d1da426a79
--- /dev/null
+++ b/svx/source/sdr/attribute/sdrshadowtextattribute.cxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: sdrallattribute.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+ namespace attribute
+ {
+ SdrShadowTextAttribute::SdrShadowTextAttribute(
+ const SdrShadowAttribute& rShadow,
+ const SdrTextAttribute& rTextAttribute)
+ : maShadow(rShadow),
+ maTextAttribute(rTextAttribute)
+ {
+ }
+
+ SdrShadowTextAttribute::SdrShadowTextAttribute()
+ : maShadow(),
+ maTextAttribute()
+ {
+ }
+
+ SdrShadowTextAttribute::SdrShadowTextAttribute(const SdrShadowTextAttribute& rCandidate)
+ : maShadow(rCandidate.getShadow()),
+ maTextAttribute(rCandidate.getText())
+ {
+ }
+
+ SdrShadowTextAttribute& SdrShadowTextAttribute::operator=(const SdrShadowTextAttribute& rCandidate)
+ {
+ maShadow = rCandidate.getShadow();
+ maTextAttribute = rCandidate.getText();
+
+ return *this;
+ }
+
+ bool SdrShadowTextAttribute::isDefault() const
+ {
+ return (getShadow().isDefault()
+ && getText().isDefault());
+ }
+
+ bool SdrShadowTextAttribute::operator==(const SdrShadowTextAttribute& rCandidate) const
+ {
+ return (getShadow() == rCandidate.getShadow()
+ && getText() == rCandidate.getText());
+ }
+ } // end of namespace attribute
+} // end of namespace drawinglayer
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index b322d82346..c231f2aed4 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -36,15 +36,230 @@
#include <svx/sdr/properties/properties.hxx>
//////////////////////////////////////////////////////////////////////////////
-// pointer compare define
-#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
-
-//////////////////////////////////////////////////////////////////////////////
namespace drawinglayer
{
namespace attribute
{
+ class ImpSdrTextAttribute
+ {
+ public:
+ // refcounter
+ sal_uInt32 mnRefCount;
+
+ // all-text attributes. The SdrText itself and a copy
+ // of te OPO
+ const SdrText* mpSdrText;
+ const OutlinerParaObject* mpOutlinerParaObject;
+
+ // Set when it's a FormText; contains all FormText attributes
+ SdrFormTextAttribute maSdrFormTextAttribute;
+
+ // text distances
+ sal_Int32 maTextLeftDistance;
+ sal_Int32 maTextUpperDistance;
+ sal_Int32 maTextRightDistance;
+ sal_Int32 maTextLowerDistance;
+
+ // #i101556# use versioning from text attributes to detect changes
+ sal_uInt32 maPropertiesVersion;
+
+ // text alignments
+ SdrTextHorzAdjust maSdrTextHorzAdjust;
+ SdrTextVertAdjust maSdrTextVertAdjust;
+
+ // bitfield
+ unsigned mbContour : 1;
+ unsigned mbFitToSize : 1;
+ unsigned mbHideContour : 1;
+ unsigned mbBlink : 1;
+ unsigned mbScroll : 1;
+ unsigned mbInEditMode : 1;
+ unsigned mbFixedCellHeight : 1;
+ unsigned mbWrongSpell : 1;
+
+ public:
+ ImpSdrTextAttribute(
+ const SdrText* pSdrText,
+ const OutlinerParaObject& rOutlinerParaObject,
+ XFormTextStyle eFormTextStyle,
+ sal_Int32 aTextLeftDistance,
+ sal_Int32 aTextUpperDistance,
+ sal_Int32 aTextRightDistance,
+ sal_Int32 aTextLowerDistance,
+ SdrTextHorzAdjust aSdrTextHorzAdjust,
+ SdrTextVertAdjust aSdrTextVertAdjust,
+ bool bContour,
+ bool bFitToSize,
+ bool bHideContour,
+ bool bBlink,
+ bool bScroll,
+ bool bInEditMode,
+ bool bFixedCellHeight,
+ bool bWrongSpell)
+ : mnRefCount(0),
+ mpSdrText(pSdrText),
+ mpOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)),
+ maSdrFormTextAttribute(),
+ maTextLeftDistance(aTextLeftDistance),
+ maTextUpperDistance(aTextUpperDistance),
+ maTextRightDistance(aTextRightDistance),
+ maTextLowerDistance(aTextLowerDistance),
+ maPropertiesVersion(0),
+ maSdrTextHorzAdjust(aSdrTextHorzAdjust),
+ maSdrTextVertAdjust(aSdrTextVertAdjust),
+ mbContour(bContour),
+ mbFitToSize(bFitToSize),
+ mbHideContour(bHideContour),
+ mbBlink(bBlink),
+ mbScroll(bScroll),
+ mbInEditMode(bInEditMode),
+ mbFixedCellHeight(bFixedCellHeight),
+ mbWrongSpell(bWrongSpell)
+ {
+ if(pSdrText)
+ {
+ if(XFT_NONE != eFormTextStyle)
+ {
+ // text on path. Create FormText attribute
+ const SfxItemSet& rSet = pSdrText->GetItemSet();
+ maSdrFormTextAttribute = SdrFormTextAttribute(rSet);
+ }
+
+ // #i101556# init with version number to detect changes of single text
+ // attribute and/or style sheets in primitive data without having to
+ // copy that data locally (which would be better from principle)
+ maPropertiesVersion = pSdrText->GetObject().GetProperties().getVersion();
+ }
+ }
+
+ ImpSdrTextAttribute()
+ : mnRefCount(0),
+ mpSdrText(0),
+ mpOutlinerParaObject(0),
+ maSdrFormTextAttribute(),
+ maTextLeftDistance(0),
+ maTextUpperDistance(0),
+ maTextRightDistance(0),
+ maTextLowerDistance(0),
+ maPropertiesVersion(0),
+ maSdrTextHorzAdjust(SDRTEXTHORZADJUST_LEFT),
+ maSdrTextVertAdjust(SDRTEXTVERTADJUST_TOP),
+ mbContour(false),
+ mbFitToSize(false),
+ mbHideContour(false),
+ mbBlink(false),
+ mbScroll(false),
+ mbInEditMode(false),
+ mbFixedCellHeight(false),
+ mbWrongSpell(false)
+ {
+ }
+
+ ~ImpSdrTextAttribute()
+ {
+ if(mpOutlinerParaObject)
+ {
+ delete mpOutlinerParaObject;
+ }
+ }
+
+ // data read access
+ const SdrText& getSdrText() const
+ {
+ OSL_ENSURE(mpSdrText, "Access to text of default version of ImpSdrTextAttribute (!)");
+ return *mpSdrText;
+ }
+ const OutlinerParaObject& getOutlinerParaObject() const
+ {
+ OSL_ENSURE(mpOutlinerParaObject, "Access to OutlinerParaObject of default version of ImpSdrTextAttribute (!)");
+ return *mpOutlinerParaObject;
+ }
+ bool isContour() const { return mbContour; }
+ bool isFitToSize() const { return mbFitToSize; }
+ bool isHideContour() const { return mbHideContour; }
+ bool isBlink() const { return mbBlink; }
+ bool isScroll() const { return mbScroll; }
+ bool isInEditMode() const { return mbInEditMode; }
+ bool isFixedCellHeight() const { return mbFixedCellHeight; }
+ bool isWrongSpell() const { return mbWrongSpell; }
+ const SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; }
+ sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; }
+ sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; }
+ sal_Int32 getTextRightDistance() const { return maTextRightDistance; }
+ sal_Int32 getTextLowerDistance() const { return maTextLowerDistance; }
+ sal_uInt32 getPropertiesVersion() const { return maPropertiesVersion; }
+ SdrTextHorzAdjust getSdrTextHorzAdjust() const { return maSdrTextHorzAdjust; }
+ SdrTextVertAdjust getSdrTextVertAdjust() const { return maSdrTextVertAdjust; }
+
+ // compare operator
+ bool operator==(const ImpSdrTextAttribute& rCandidate) const
+ {
+ if(mpOutlinerParaObject != rCandidate.mpOutlinerParaObject)
+ {
+ if(mpOutlinerParaObject && rCandidate.mpOutlinerParaObject)
+ {
+ // compares OPO and it's contents, but traditionally not the RedLining
+ // which is not seen as model, but as temporary information
+ if(!(getOutlinerParaObject() == rCandidate.getOutlinerParaObject()))
+ {
+ return false;
+ }
+
+ // #i102062# for primitive visualisation, the WrongList (SpellChecking)
+ // is important, too, so use isWrongListEqual since there is no WrongList
+ // comparison in the regular OutlinerParaObject compare (since it's
+ // not-persistent data)
+ if(!(getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ // only one is zero; not equal
+ return false;
+ }
+ }
+
+ return (
+ getSdrFormTextAttribute() == rCandidate.getSdrFormTextAttribute()
+ && getTextLeftDistance() == rCandidate.getTextLeftDistance()
+ && getTextUpperDistance() == rCandidate.getTextUpperDistance()
+ && getTextRightDistance() == rCandidate.getTextRightDistance()
+ && getTextLowerDistance() == rCandidate.getTextLowerDistance()
+ && getPropertiesVersion() == rCandidate.getPropertiesVersion()
+
+ && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust()
+ && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust()
+
+ && isContour() == rCandidate.isContour()
+ && isFitToSize() == rCandidate.isFitToSize()
+ && isHideContour() == rCandidate.isHideContour()
+ && isBlink() == rCandidate.isBlink()
+ && isScroll() == rCandidate.isScroll()
+ && isInEditMode() == rCandidate.isInEditMode()
+ && isFixedCellHeight() == rCandidate.isFixedCellHeight()
+ && isWrongSpell() == rCandidate.isWrongSpell());
+ }
+
+ static ImpSdrTextAttribute* get_global_default()
+ {
+ static ImpSdrTextAttribute* pDefault = 0;
+
+ if(!pDefault)
+ {
+ // use default constructor
+ pDefault = new ImpSdrTextAttribute();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
+ };
+
SdrTextAttribute::SdrTextAttribute(
const SdrText& rSdrText,
const OutlinerParaObject& rOutlinerParaObject,
@@ -61,146 +276,174 @@ namespace drawinglayer
bool bBlink,
bool bScroll,
bool bInEditMode,
- bool bFixedCellHeight)
- : mpSdrText(&rSdrText),
- maOutlinerParaObject(rOutlinerParaObject),
- mpSdrFormTextAttribute(0),
- maTextLeftDistance(aTextLeftDistance),
- maTextUpperDistance(aTextUpperDistance),
- maTextRightDistance(aTextRightDistance),
- maTextLowerDistance(aTextLowerDistance),
- maPropertiesVersion(0),
- maSdrTextHorzAdjust(aSdrTextHorzAdjust),
- maSdrTextVertAdjust(aSdrTextVertAdjust),
- mbContour(bContour),
- mbFitToSize(bFitToSize),
- mbHideContour(bHideContour),
- mbBlink(bBlink),
- mbScroll(bScroll),
- mbInEditMode(bInEditMode),
- mbFixedCellHeight(bFixedCellHeight)
+ bool bFixedCellHeight,
+ bool bWrongSpell)
+ : mpSdrTextAttribute(new ImpSdrTextAttribute(
+ &rSdrText, rOutlinerParaObject, eFormTextStyle, aTextLeftDistance, aTextUpperDistance,
+ aTextRightDistance, aTextLowerDistance, aSdrTextHorzAdjust, aSdrTextVertAdjust, bContour,
+ bFitToSize, bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell))
{
- if(XFT_NONE != eFormTextStyle)
- {
- // text on path. Create FormText attribute
- const SfxItemSet& rSet = getSdrText().GetItemSet();
- mpSdrFormTextAttribute = new SdrFormTextAttribute(rSet);
- }
+ }
- // #i101556# init with version number to detect changes of single text
- // attribute and/or style sheets in primitive data without having to
- // copy that data locally (which would be better from principle)
- maPropertiesVersion = rSdrText.GetObject().GetProperties().getVersion();
+ SdrTextAttribute::SdrTextAttribute()
+ : mpSdrTextAttribute(ImpSdrTextAttribute::get_global_default())
+ {
+ mpSdrTextAttribute->mnRefCount++;
+ }
+
+ SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
+ : mpSdrTextAttribute(rCandidate.mpSdrTextAttribute)
+ {
+ mpSdrTextAttribute->mnRefCount++;
}
SdrTextAttribute::~SdrTextAttribute()
{
- if(mpSdrFormTextAttribute)
+ if(mpSdrTextAttribute->mnRefCount)
{
- delete mpSdrFormTextAttribute;
- mpSdrFormTextAttribute = 0;
+ mpSdrTextAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrTextAttribute;
}
}
- SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
- : mpSdrText(&rCandidate.getSdrText()),
- maOutlinerParaObject(rCandidate.getOutlinerParaObject()),
- mpSdrFormTextAttribute(0),
- maTextLeftDistance(rCandidate.getTextLeftDistance()),
- maTextUpperDistance(rCandidate.getTextUpperDistance()),
- maTextRightDistance(rCandidate.getTextRightDistance()),
- maTextLowerDistance(rCandidate.getTextLowerDistance()),
- maPropertiesVersion(rCandidate.getPropertiesVersion()),
- maSdrTextHorzAdjust(rCandidate.getSdrTextHorzAdjust()),
- maSdrTextVertAdjust(rCandidate.getSdrTextVertAdjust()),
- mbContour(rCandidate.isContour()),
- mbFitToSize(rCandidate.isFitToSize()),
- mbHideContour(rCandidate.isHideContour()),
- mbBlink(rCandidate.isBlink()),
- mbScroll(rCandidate.isScroll()),
- mbInEditMode(rCandidate.isInEditMode()),
- mbFixedCellHeight(rCandidate.isFixedCellHeight())
+ bool SdrTextAttribute::isDefault() const
{
- if(rCandidate.getSdrFormTextAttribute())
- {
- mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
- }
+ return mpSdrTextAttribute == ImpSdrTextAttribute::get_global_default();
}
SdrTextAttribute& SdrTextAttribute::operator=(const SdrTextAttribute& rCandidate)
{
- mpSdrText = &rCandidate.getSdrText();
- maOutlinerParaObject = rCandidate.getOutlinerParaObject();
+ if(rCandidate.mpSdrTextAttribute != mpSdrTextAttribute)
+ {
+ if(mpSdrTextAttribute->mnRefCount)
+ {
+ mpSdrTextAttribute->mnRefCount--;
+ }
+ else
+ {
+ delete mpSdrTextAttribute;
+ }
+
+ mpSdrTextAttribute = rCandidate.mpSdrTextAttribute;
+ mpSdrTextAttribute->mnRefCount++;
+ }
+
+ return *this;
+ }
- if(mpSdrFormTextAttribute)
+ bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
+ {
+ if(rCandidate.mpSdrTextAttribute == mpSdrTextAttribute)
{
- delete mpSdrFormTextAttribute;
+ return true;
}
-
- mpSdrFormTextAttribute = 0;
- if(rCandidate.getSdrFormTextAttribute())
+ if(rCandidate.isDefault() != isDefault())
{
- mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
+ return false;
}
- maTextLeftDistance = rCandidate.getTextLeftDistance();
- maTextUpperDistance = rCandidate.getTextUpperDistance();
- maTextRightDistance = rCandidate.getTextRightDistance();
- maTextLowerDistance = rCandidate.getTextLowerDistance();
- maPropertiesVersion = rCandidate.getPropertiesVersion();
-
- maSdrTextHorzAdjust = rCandidate.getSdrTextHorzAdjust();
- maSdrTextVertAdjust = rCandidate.getSdrTextVertAdjust();
-
- mbContour = rCandidate.isContour();
- mbFitToSize = rCandidate.isFitToSize();
- mbHideContour = rCandidate.isHideContour();
- mbBlink = rCandidate.isBlink();
- mbScroll = rCandidate.isScroll();
- mbInEditMode = rCandidate.isInEditMode();
- mbFixedCellHeight = rCandidate.isFixedCellHeight();
+ return (*rCandidate.mpSdrTextAttribute == *mpSdrTextAttribute);
+ }
- return *this;
+ const SdrText& SdrTextAttribute::getSdrText() const
+ {
+ return mpSdrTextAttribute->getSdrText();
}
- bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
- {
- return (
- // compares OPO and it's contents, but traditionally not the RedLining
- // which is not seen as model, but as temporary information
- getOutlinerParaObject() == rCandidate.getOutlinerParaObject()
-
- // #i102062# for primitive visualisation, the WrongList (SpellChecking)
- // is important, too, so use isWrongListEqual since there is no WrongList
- // comparison in the regular OutlinerParaObject compare (since it's
- // not-persistent data)
- && getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())
-
- && pointerOrContentEqual(getSdrFormTextAttribute(), rCandidate.getSdrFormTextAttribute())
- && getTextLeftDistance() == rCandidate.getTextLeftDistance()
- && getTextUpperDistance() == rCandidate.getTextUpperDistance()
- && getTextRightDistance() == rCandidate.getTextRightDistance()
- && getTextLowerDistance() == rCandidate.getTextLowerDistance()
- && getPropertiesVersion() == rCandidate.getPropertiesVersion()
+ const OutlinerParaObject& SdrTextAttribute::getOutlinerParaObject() const
+ {
+ return mpSdrTextAttribute->getOutlinerParaObject();
+ }
+
+ bool SdrTextAttribute::isContour() const
+ {
+ return mpSdrTextAttribute->isContour();
+ }
+
+ bool SdrTextAttribute::isFitToSize() const
+ {
+ return mpSdrTextAttribute->isFitToSize();
+ }
+
+ bool SdrTextAttribute::isHideContour() const
+ {
+ return mpSdrTextAttribute->isHideContour();
+ }
- && getSdrTextHorzAdjust() == rCandidate.getSdrTextHorzAdjust()
- && getSdrTextVertAdjust() == rCandidate.getSdrTextVertAdjust()
+ bool SdrTextAttribute::isBlink() const
+ {
+ return mpSdrTextAttribute->isBlink();
+ }
+
+ bool SdrTextAttribute::isScroll() const
+ {
+ return mpSdrTextAttribute->isScroll();
+ }
+
+ bool SdrTextAttribute::isInEditMode() const
+ {
+ return mpSdrTextAttribute->isInEditMode();
+ }
+
+ bool SdrTextAttribute::isFixedCellHeight() const
+ {
+ return mpSdrTextAttribute->isFixedCellHeight();
+ }
+
+ bool SdrTextAttribute::isWrongSpell() const
+ {
+ return mpSdrTextAttribute->isWrongSpell();
+ }
+
+ const SdrFormTextAttribute& SdrTextAttribute::getSdrFormTextAttribute() const
+ {
+ return mpSdrTextAttribute->getSdrFormTextAttribute();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextLeftDistance() const
+ {
+ return mpSdrTextAttribute->getTextLeftDistance();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextUpperDistance() const
+ {
+ return mpSdrTextAttribute->getTextUpperDistance();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextRightDistance() const
+ {
+ return mpSdrTextAttribute->getTextRightDistance();
+ }
+
+ sal_Int32 SdrTextAttribute::getTextLowerDistance() const
+ {
+ return mpSdrTextAttribute->getTextLowerDistance();
+ }
+
+ sal_uInt32 SdrTextAttribute::getPropertiesVersion() const
+ {
+ return mpSdrTextAttribute->getPropertiesVersion();
+ }
+
+ SdrTextHorzAdjust SdrTextAttribute::getSdrTextHorzAdjust() const
+ {
+ return mpSdrTextAttribute->getSdrTextHorzAdjust();
+ }
- && isContour() == rCandidate.isContour()
- && isFitToSize() == rCandidate.isFitToSize()
- && isHideContour() == rCandidate.isHideContour()
- && isBlink() == rCandidate.isBlink()
- && isScroll() == rCandidate.isScroll()
- && isInEditMode() == rCandidate.isInEditMode()
- && isFixedCellHeight() == rCandidate.isFixedCellHeight());
+ SdrTextVertAdjust SdrTextAttribute::getSdrTextVertAdjust() const
+ {
+ return mpSdrTextAttribute->getSdrTextVertAdjust();
}
void SdrTextAttribute::getBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const
{
if(isBlink())
{
- mpSdrText->GetObject().impGetBlinkTextTiming(rAnimList);
+ getSdrText().GetObject().impGetBlinkTextTiming(rAnimList);
}
}
@@ -208,7 +451,7 @@ namespace drawinglayer
{
if(isScroll())
{
- mpSdrText->GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
+ getSdrText().GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
}
}
} // end of namespace attribute
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index 35e7412401..afc2513e8d 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -277,7 +277,8 @@ namespace sdr
DBG_ERROR("ViewContact::createViewIndependentPrimitive2DSequence(): Never call the fallback base implementation, this is always an error (!)");
const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(1000.0, 1000.0, 5000.0, 3000.0)));
const basegfx::BColor aYellow(1.0, 1.0, 0.0);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aYellow));
return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx
index 03643420e4..ff9cd5059f 100644
--- a/svx/source/sdr/contact/viewcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3d.cxx
@@ -33,10 +33,12 @@
#include <svx/obj3d.hxx>
#include <drawinglayer/primitive2d/embedded3dprimitive2d.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <svx/scene3d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -124,13 +126,14 @@ namespace sdr
// create embedded 2d primitive and add. LightNormal and ShadowSlant are needed for evtl.
// 3D shadow extraction for correct B2DRange calculation (shadow is part of the object)
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::Embedded3DPrimitive2D(
- rxContent3D,
- pVCOfE3DScene->getObjectTransformation(),
- aViewInformation3D,
- aLightNormal,
- fShadowSlant,
- rAllContentRange));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::Embedded3DPrimitive2D(
+ rxContent3D,
+ pVCOfE3DScene->getObjectTransformation(),
+ aViewInformation3D,
+ aLightNormal,
+ fShadowSlant,
+ rAllContentRange));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
@@ -175,9 +178,12 @@ namespace sdr
if(!rObjectTransform.isIdentity())
{
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::TransformPrimitive3D(
- rObjectTransform, xRetval));
- return drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::TransformPrimitive3D(
+ rObjectTransform,
+ xRetval));
+
+ xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
}
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dcube.cxx b/svx/source/sdr/contact/viewcontactofe3dcube.cxx
index c4e08c50b9..b7497995c4 100644
--- a/svx/source/sdr/contact/viewcontactofe3dcube.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dcube.cxx
@@ -54,16 +54,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dCubeObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get cube geometry and use as traslation and scaling for unit cube
basegfx::B3DRange aCubeRange;
@@ -96,13 +88,14 @@ namespace sdr
const basegfx::B2DVector aTextureSize(aCubeSize.getX(), aCubeSize.getY());
// create primitive and add
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrCubePrimitive3D(aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrCubePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
-
+
return xRetval;
}
} // end of namespace contact
diff --git a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx
index 85f05dea45..f0dd9197ff 100644
--- a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx
@@ -54,16 +54,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dExtrudeObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get extrude geometry
const basegfx::B2DPolyPolygon aPolyPolygon(GetE3dExtrudeObj().GetExtrudePolygon());
@@ -89,15 +81,15 @@ namespace sdr
// create primitive and add
const basegfx::B3DHomMatrix aWorldTransform;
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrExtrudePrimitive3D(
- aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute,
- aPolyPolygon, fDepth, fDiagonal, fBackScale, bSmoothNormals, true, bSmoothLids,
- bCharacterMode, bCloseFront, bCloseBack));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrExtrudePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute,
+ aPolyPolygon, fDepth, fDiagonal, fBackScale, bSmoothNormals, true, bSmoothLids,
+ bCharacterMode, bCloseFront, bCloseBack));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
index dbe9460bbf..495a1f6df9 100644
--- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx
@@ -54,16 +54,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dLatheObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get extrude geometry
const basegfx::B2DPolyPolygon aPolyPolygon(GetE3dLatheObj().GetPolyPoly2D());
@@ -103,16 +95,16 @@ namespace sdr
// create primitive and add
const basegfx::B3DHomMatrix aWorldTransform;
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrLathePrimitive3D(
- aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute,
- aPolyPolygon, nHorizontalSegments, nVerticalSegments,
- fDiagonal, fBackScale, fRotation,
- bSmoothNormals, true, bSmoothLids, bCharacterMode, bCloseFront, bCloseBack));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrLathePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute,
+ aPolyPolygon, nHorizontalSegments, nVerticalSegments,
+ fDiagonal, fBackScale, fRotation,
+ bSmoothNormals, true, bSmoothLids, bCharacterMode, bCloseFront, bCloseBack));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
index 6d39d8eae9..b8e8c352e5 100644
--- a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx
@@ -56,16 +56,8 @@ namespace sdr
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dPolygonObj().GetMergedItemSet();
const bool bSuppressFill(GetE3dPolygonObj().GetLineOnly());
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, bSuppressFill);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, bSuppressFill));
// get extrude geometry
basegfx::B3DPolyPolygon aPolyPolygon3D(GetE3dPolygonObj().GetPolyPolygon3D());
@@ -177,13 +169,13 @@ namespace sdr
// create primitive and add
const basegfx::B3DHomMatrix aWorldTransform;
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrPolyPolygonPrimitive3D(
- aPolyPolygon3D, aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrPolyPolygonPrimitive3D(
+ aPolyPolygon3D, aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofe3dscene.cxx b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
index 7658ef7dde..36231a3ac7 100644
--- a/svx/source/sdr/contact/viewcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dscene.cxx
@@ -38,11 +38,11 @@
#include <svx/sdr/contact/viewobjectcontactofe3dscene.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/range/b3drange.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/primitive3d/baseprimitive3d.hxx>
#include <svx/sdr/contact/viewcontactofe3d.hxx>
#include <drawinglayer/primitive2d/sceneprimitive2d.hxx>
#include <drawinglayer/primitive3d/transformprimitive3d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -164,21 +164,13 @@ namespace sdr
ViewContactOfE3dScene::ViewContactOfE3dScene(E3dScene& rScene)
: ViewContactOfSdrObj(rScene),
- mpViewInformation3D(0),
- mpObjectTransformation(0),
- mpSdrSceneAttribute(0),
- mpSdrLightingAttribute(0)
+ maViewInformation3D(),
+ maObjectTransformation(),
+ maSdrSceneAttribute(),
+ maSdrLightingAttribute()
{
}
- ViewContactOfE3dScene::~ViewContactOfE3dScene()
- {
- delete mpViewInformation3D;
- delete mpObjectTransformation;
- delete mpSdrSceneAttribute;
- delete mpSdrLightingAttribute;
- }
-
void ViewContactOfE3dScene::createViewInformation3D(const basegfx::B3DRange& rContentRange)
{
basegfx::B3DHomMatrix aTransformation;
@@ -262,34 +254,36 @@ namespace sdr
}
const uno::Sequence< beans::PropertyValue > aEmptyProperties;
- mpViewInformation3D = new drawinglayer::geometry::ViewInformation3D(aTransformation, aOrientation, aProjection, aDeviceToView, 0.0, aEmptyProperties);
+ maViewInformation3D = drawinglayer::geometry::ViewInformation3D(
+ aTransformation, aOrientation, aProjection,
+ aDeviceToView, 0.0, aEmptyProperties);
}
void ViewContactOfE3dScene::createObjectTransformation()
{
// create 2d Object Transformation from relative point in 2d scene to world
- mpObjectTransformation = new basegfx::B2DHomMatrix;
const Rectangle& rRectangle = GetE3dScene().GetSnapRect();
- mpObjectTransformation->set(0, 0, rRectangle.getWidth());
- mpObjectTransformation->set(1, 1, rRectangle.getHeight());
- mpObjectTransformation->set(0, 2, rRectangle.Left());
- mpObjectTransformation->set(1, 2, rRectangle.Top());
+ maObjectTransformation.set(0, 0, rRectangle.getWidth());
+ maObjectTransformation.set(1, 1, rRectangle.getHeight());
+ maObjectTransformation.set(0, 2, rRectangle.Left());
+ maObjectTransformation.set(1, 2, rRectangle.Top());
}
void ViewContactOfE3dScene::createSdrSceneAttribute()
{
const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
- mpSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet);
+ maSdrSceneAttribute = drawinglayer::primitive2d::createNewSdrSceneAttribute(rItemSet);
}
void ViewContactOfE3dScene::createSdrLightingAttribute()
{
const SfxItemSet& rItemSet = GetE3dScene().GetMergedItemSet();
- mpSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet);
+ maSdrLightingAttribute = drawinglayer::primitive2d::createNewSdrLightingAttribute(rItemSet);
}
- drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence(const SetOfByte* pLayerVisibility) const
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfE3dScene::createScenePrimitive2DSequence(
+ const SetOfByte* pLayerVisibility) const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const sal_uInt32 nChildrenCount(GetObjectCount());
@@ -329,19 +323,27 @@ namespace sdr
// on identity and the time on 0.0.
const uno::Sequence< beans::PropertyValue > aEmptyProperties;
const drawinglayer::geometry::ViewInformation3D aNeutralViewInformation3D(aEmptyProperties);
- const basegfx::B3DRange aContentRange(drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D));
+ const basegfx::B3DRange aContentRange(
+ drawinglayer::primitive3d::getB3DRangeFromPrimitive3DSequence(aAllSequence, aNeutralViewInformation3D));
// create 2d primitive 3dscene with generated sub-list from collector
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ScenePrimitive2D(
- bTestVisibility ? aVisibleSequence : aAllSequence,
- getSdrSceneAttribute(),
- getSdrLightingAttribute(),
- getObjectTransformation(),
- getViewInformation3D(aContentRange)));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::ScenePrimitive2D(
+ bTestVisibility ? aVisibleSequence : aAllSequence,
+ getSdrSceneAttribute(),
+ getSdrLightingAttribute(),
+ getObjectTransformation(),
+ getViewInformation3D(aContentRange)));
+
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
+ // always append an invisible outline for the cases where no visible content exists
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, getObjectTransformation()));
+
return xRetval;
}
@@ -355,27 +357,7 @@ namespace sdr
xRetval = createScenePrimitive2DSequence(0);
}
- if(xRetval.hasElements())
- {
- return xRetval;
- }
- else
- {
- // create a gray placeholder hairline polygon in object size as empty 3D scene marker. Use object size
- // model information directly, NOT getBoundRect()/getSnapRect() since these will
- // be using the geometry data we get just asked for. AFAIK for empty 3D Scenes, the model data
- // is SdrObject::aOutRect which i can access directly using GetLastBoundRect() here
- const Rectangle aEmptySceneGeometry(GetE3dScene().GetLastBoundRect());
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(
- aEmptySceneGeometry.Left(), aEmptySceneGeometry.Top(),
- aEmptySceneGeometry.Right(), aEmptySceneGeometry.Bottom())));
- const double fGrayTone(0xc0 / 255.0);
- const basegfx::BColor aGrayTone(fGrayTone, fGrayTone, fGrayTone);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aGrayTone));
-
- // The replacement object may also get a text like 'empty 3D Scene' here later
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ return xRetval;
}
void ViewContactOfE3dScene::ActionChanged()
@@ -384,22 +366,15 @@ namespace sdr
ViewContactOfSdrObj::ActionChanged();
// mark locally cached values as invalid
- delete mpViewInformation3D;
- mpViewInformation3D = 0;
-
- delete mpObjectTransformation;
- mpObjectTransformation = 0;
-
- delete mpSdrSceneAttribute;
- mpSdrSceneAttribute = 0;
-
- delete mpSdrLightingAttribute;
- mpSdrLightingAttribute = 0;
+ maViewInformation3D = drawinglayer::geometry::ViewInformation3D();
+ maObjectTransformation.identity();
+ maSdrSceneAttribute = drawinglayer::attribute::SdrSceneAttribute();
+ maSdrLightingAttribute = drawinglayer::attribute::SdrLightingAttribute();
}
const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D() const
{
- if(!mpViewInformation3D)
+ if(maViewInformation3D.isDefault())
{
// this version will create the content range on demand locally and thus is less
// performant than the other one. Since the information is buffered the planned
@@ -418,47 +393,47 @@ namespace sdr
const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(aContentRange);
}
- return *mpViewInformation3D;
+ return maViewInformation3D;
}
const drawinglayer::geometry::ViewInformation3D& ViewContactOfE3dScene::getViewInformation3D(const basegfx::B3DRange& rContentRange) const
{
- if(!mpViewInformation3D)
+ if(maViewInformation3D.isDefault())
{
const_cast < ViewContactOfE3dScene* >(this)->createViewInformation3D(rContentRange);
}
- return *mpViewInformation3D;
+ return maViewInformation3D;
}
const basegfx::B2DHomMatrix& ViewContactOfE3dScene::getObjectTransformation() const
{
- if(!mpObjectTransformation)
+ if(maObjectTransformation.isIdentity())
{
const_cast < ViewContactOfE3dScene* >(this)->createObjectTransformation();
}
- return *mpObjectTransformation;
+ return maObjectTransformation;
}
const drawinglayer::attribute::SdrSceneAttribute& ViewContactOfE3dScene::getSdrSceneAttribute() const
{
- if(!mpSdrSceneAttribute)
+ if(maSdrSceneAttribute.isDefault())
{
const_cast < ViewContactOfE3dScene* >(this)->createSdrSceneAttribute();
}
- return *mpSdrSceneAttribute;
+ return maSdrSceneAttribute;
}
const drawinglayer::attribute::SdrLightingAttribute& ViewContactOfE3dScene::getSdrLightingAttribute() const
{
- if(!mpSdrLightingAttribute)
+ if(maSdrLightingAttribute.isDefault())
{
const_cast < ViewContactOfE3dScene* >(this)->createSdrLightingAttribute();
}
- return *mpSdrLightingAttribute;
+ return maSdrLightingAttribute;
}
drawinglayer::primitive3d::Primitive3DSequence ViewContactOfE3dScene::getAllPrimitive3DSequence() const
diff --git a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
index 4e30ae592c..9a3d673ca3 100644
--- a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
+++ b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx
@@ -53,16 +53,8 @@ namespace sdr
{
drawinglayer::primitive3d::Primitive3DSequence xRetval;
const SfxItemSet& rItemSet = GetE3dSphereObj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false);
-
- // for 3D Objects, always create a primitive even when not visible. This is necessary ATM
- // since e.g. chart geometries rely on the occupied space of non-visible objects
- if(!pAttribute)
- {
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowAttribute(
- impCreateFallbackLineAttribute(basegfx::BColor(0.0, 1.0, 0.0)),
- 0, 0, 0, 0);
- }
+ const drawinglayer::attribute::SdrLineFillShadowAttribute3D aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowAttribute(rItemSet, false));
// get sphere center and size for geometry
basegfx::B3DRange aSphereRange;
@@ -88,14 +80,14 @@ namespace sdr
F_PI2 * aSphereSize.getY()); // half outline, (PI * d)/2 -> PI/2 * d
// create primitive and add
- const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::SdrSpherePrimitive3D(
- aWorldTransform, aTextureSize, *pAttribute, *pSdr3DObjectAttribute,
- nHorizontalSegments, nVerticalSegments));
+ const drawinglayer::primitive3d::Primitive3DReference xReference(
+ new drawinglayer::primitive3d::SdrSpherePrimitive3D(
+ aWorldTransform, aTextureSize, aAttribute, *pSdr3DObjectAttribute,
+ nHorizontalSegments, nVerticalSegments));
xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
// delete 3D Object Attributes
delete pSdr3DObjectAttribute;
- delete pAttribute;
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 62aa3c6840..019ec8d159 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -30,7 +30,6 @@
#include <svx/sdr/contact/viewcontactofgraphic.hxx>
#include <svx/sdr/contact/viewobjectcontactofgraphic.hxx>
#include <svx/svdograf.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svl/itemset.hxx>
@@ -39,7 +38,6 @@
#endif
#include <svx/sdgcpitm.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
@@ -59,6 +57,7 @@
#include <editeng/eeitem.hxx>
#include <editeng/colritem.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -148,10 +147,9 @@ namespace sdr
* aSmallerMatrix;
const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
- const drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0);
const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
aSmallerMatrix,
- aEmptyAttributes,
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute(),
rGraphicObject,
rLocalGrafInfo));
@@ -177,14 +175,12 @@ namespace sdr
aEmptyGraphicAttr));
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1);
- if(!rAttribute.getLine())
+ if(rAttribute.getLine().isDefault())
{
// create a surrounding frame when no linestyle given
const Color aColor(Application::GetSettings().GetStyleSettings().GetShadowColor());
const basegfx::BColor aBColor(aColor.getBColor());
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
-
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
aOutline.transform(rObjectMatrix);
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
@@ -314,127 +310,123 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createViewIndependentPrimitive2DSequence() const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- SdrText* pSdrText = GetGrafObject().getText(0);
-
- if(pSdrText)
+ const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet();
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetGrafObject().getText(0)));
+
+ // create and fill GraphicAttr
+ GraphicAttr aLocalGrafInfo;
+ const sal_uInt16 nTrans(((SdrGrafTransparenceItem&)rItemSet.Get(SDRATTR_GRAFTRANSPARENCE)).GetValue());
+ const SdrGrafCropItem& rCrop((const SdrGrafCropItem&)rItemSet.Get(SDRATTR_GRAFCROP));
+ aLocalGrafInfo.SetLuminance(((SdrGrafLuminanceItem&)rItemSet.Get(SDRATTR_GRAFLUMINANCE)).GetValue());
+ aLocalGrafInfo.SetContrast(((SdrGrafContrastItem&)rItemSet.Get(SDRATTR_GRAFCONTRAST)).GetValue());
+ aLocalGrafInfo.SetChannelR(((SdrGrafRedItem&)rItemSet.Get(SDRATTR_GRAFRED)).GetValue());
+ aLocalGrafInfo.SetChannelG(((SdrGrafGreenItem&)rItemSet.Get(SDRATTR_GRAFGREEN)).GetValue());
+ aLocalGrafInfo.SetChannelB(((SdrGrafBlueItem&)rItemSet.Get(SDRATTR_GRAFBLUE)).GetValue());
+ aLocalGrafInfo.SetGamma(((SdrGrafGamma100Item&)rItemSet.Get(SDRATTR_GRAFGAMMA)).GetValue() * 0.01);
+ aLocalGrafInfo.SetTransparency((BYTE)::basegfx::fround(Min(nTrans, (USHORT)100) * 2.55));
+ aLocalGrafInfo.SetInvert(((SdrGrafInvertItem&)rItemSet.Get(SDRATTR_GRAFINVERT)).GetValue());
+ aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue());
+ aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom());
+
+ if(aAttribute.isDefault() && 255L != aLocalGrafInfo.GetTransparency())
{
- const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
- drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
- bool bVisible(pAttribute && pAttribute->isVisible());
-
- // create and fill GraphicAttr
- GraphicAttr aLocalGrafInfo;
- const sal_uInt16 nTrans(((SdrGrafTransparenceItem&)rItemSet.Get(SDRATTR_GRAFTRANSPARENCE)).GetValue());
- const SdrGrafCropItem& rCrop((const SdrGrafCropItem&)rItemSet.Get(SDRATTR_GRAFCROP));
- aLocalGrafInfo.SetLuminance(((SdrGrafLuminanceItem&)rItemSet.Get(SDRATTR_GRAFLUMINANCE)).GetValue());
- aLocalGrafInfo.SetContrast(((SdrGrafContrastItem&)rItemSet.Get(SDRATTR_GRAFCONTRAST)).GetValue());
- aLocalGrafInfo.SetChannelR(((SdrGrafRedItem&)rItemSet.Get(SDRATTR_GRAFRED)).GetValue());
- aLocalGrafInfo.SetChannelG(((SdrGrafGreenItem&)rItemSet.Get(SDRATTR_GRAFGREEN)).GetValue());
- aLocalGrafInfo.SetChannelB(((SdrGrafBlueItem&)rItemSet.Get(SDRATTR_GRAFBLUE)).GetValue());
- aLocalGrafInfo.SetGamma(((SdrGrafGamma100Item&)rItemSet.Get(SDRATTR_GRAFGAMMA)).GetValue() * 0.01);
- aLocalGrafInfo.SetTransparency((BYTE)::basegfx::fround(Min(nTrans, (USHORT)100) * 2.55));
- aLocalGrafInfo.SetInvert(((SdrGrafInvertItem&)rItemSet.Get(SDRATTR_GRAFINVERT)).GetValue());
- aLocalGrafInfo.SetDrawMode(((SdrGrafModeItem&)rItemSet.Get(SDRATTR_GRAFMODE)).GetValue());
- aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom());
-
- if(!bVisible && 255L != aLocalGrafInfo.GetTransparency())
+ // no fill, no line, no text (invisible), but the graphic content is visible.
+ // Create evtl. shadow for content which was not created by createNewSdrLineFillShadowTextAttribute yet
+ const drawinglayer::attribute::SdrShadowAttribute aShadow(
+ drawinglayer::primitive2d::createNewSdrShadowAttribute(rItemSet));
+
+ if(!aShadow.isDefault())
{
- // content is visible, so force some fill stuff
- delete pAttribute;
- bVisible = true;
+ // create new attribute set if indeed shadow is used
+ aAttribute = drawinglayer::attribute::SdrLineFillShadowTextAttribute(
+ aAttribute.getLine(),
+ aAttribute.getFill(),
+ aAttribute.getLineStartEnd(),
+ aShadow,
+ aAttribute.getFillFloatTransGradient(),
+ aAttribute.getText());
+ }
+ }
- // check shadow
- drawinglayer::attribute::SdrShadowAttribute* pShadow = drawinglayer::primitive2d::createNewSdrShadowAttribute(rItemSet);
+ // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect()
+ // which will use the primitive data we just create in the near future
+ const Rectangle& rRectangle = GetGrafObject().GetGeoRect();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ // look for mirroring
+ const GeoStat& rGeoStat(GetGrafObject().GetGeoStat());
+ const sal_Int32 nDrehWink(rGeoStat.nDrehWink);
+ const bool bRota180(18000 == nDrehWink);
+ const bool bMirrored(GetGrafObject().IsMirrored());
+ const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1));
+ bool bHMirr((2 == nMirrorCase ) || (4 == nMirrorCase));
+ bool bVMirr((3 == nMirrorCase ) || (4 == nMirrorCase));
+
+ // set mirror flags at LocalGrafInfo. Take into account that the geometry in
+ // aObjectRange is already changed and rotated when bRota180 is used. To rebuild
+ // that old behaviour (as long as part of the model data), correct the H/V flags
+ // accordingly. The created bitmapPrimitive WILL use the rotation, too.
+ if(bRota180)
+ {
+ // if bRota180 which is used for vertical mirroring, the graphic will already be rotated
+ // by 180 degrees. To correct, switch off VMirror and invert HMirroring.
+ bHMirr = !bHMirr;
+ bVMirr = false;
+ }
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
+ if(bHMirr || bVMirr)
+ {
+ aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0));
+ }
- // create new attribute set
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0L, 0L, 0L, pShadow, 0L, 0L);
- }
+ // fill object matrix
+ const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+ const double fRotate(nDrehWink ? (36000 - nDrehWink) * F_PI18000 : 0.0);
+ const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ fShearX, fRotate,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- if(pAttribute)
- {
- if(pAttribute->isVisible() || bVisible)
- {
- // take unrotated snap rect for position and size. Directly use model data, not getBoundRect() or getSnapRect()
- // which will use the primitive data we just create in the near future
- const Rectangle& rRectangle = GetGrafObject().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // look for mirroring
- const GeoStat& rGeoStat(GetGrafObject().GetGeoStat());
- const sal_Int32 nDrehWink(rGeoStat.nDrehWink);
- const bool bRota180(18000 == nDrehWink);
- const bool bMirrored(GetGrafObject().IsMirrored());
- const sal_uInt16 nMirrorCase(bRota180 ? (bMirrored ? 3 : 4) : (bMirrored ? 2 : 1));
- bool bHMirr((2 == nMirrorCase ) || (4 == nMirrorCase));
- bool bVMirr((3 == nMirrorCase ) || (4 == nMirrorCase));
-
- // set mirror flags at LocalGrafInfo. Take into account that the geometry in
- // aObjectRange is already changed and rotated when bRota180 is used. To rebuild
- // that old behaviour (as long as part of the model data), correct the H/V flags
- // accordingly. The created bitmapPrimitive WILL use the rotation, too.
- if(bRota180)
- {
- // if bRota180 which is used for vertical mirroring, the graphic will already be rotated
- // by 180 degrees. To correct, switch off VMirror and invert HMirroring.
- bHMirr = !bHMirr;
- bVMirr = false;
- }
-
- if(bHMirr || bVMirr)
- {
- aLocalGrafInfo.SetMirrorFlags((bHMirr ? BMP_MIRROR_HORZ : 0)|(bVMirr ? BMP_MIRROR_VERT : 0));
- }
-
- // fill object matrix
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(nDrehWink ? (36000 - nDrehWink) * F_PI18000 : 0.0);
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- fShearX, fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // get the current, unchenged graphic obect from SdrGrafObj
- const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
-
- if(visualisationUsesPresObj())
- {
- // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
- // with the content which is the placeholder graphic
- xRetval = createVIP2DSForPresObj(aObjectMatrix, *pAttribute, aLocalGrafInfo);
- }
- else if(visualisationUsesDraft())
- {
- // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
- // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
- // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
- // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
- // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
- xRetval = createVIP2DSForDraft(aObjectMatrix, *pAttribute);
- }
- else
- {
- // create primitive. Info: Calling the copy-constructor of GraphicObject in this
- // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
- aObjectMatrix,
- *pAttribute,
- rGraphicObject,
- aLocalGrafInfo));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
-
- delete pAttribute;
- }
+ // get the current, unchenged graphic obect from SdrGrafObj
+ const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
+
+ if(visualisationUsesPresObj())
+ {
+ // it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
+ // with the content which is the placeholder graphic
+ xRetval = createVIP2DSForPresObj(aObjectMatrix, aAttribute, aLocalGrafInfo);
+ }
+ else if(visualisationUsesDraft())
+ {
+ // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
+ // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
+ // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
+ // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
+ // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
+ xRetval = createVIP2DSForDraft(aObjectMatrix, aAttribute);
}
+ else
+ {
+ // create primitive. Info: Calling the copy-constructor of GraphicObject in this
+ // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
+ const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ rGraphicObject,
+ aLocalGrafInfo));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
+
+ // always append an invisible outline for the cases where no visible content exists
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectMatrix));
return xRetval;
}
diff --git a/svx/source/sdr/contact/viewcontactofgroup.cxx b/svx/source/sdr/contact/viewcontactofgroup.cxx
index 72683559e1..3595c1a8f6 100644
--- a/svx/source/sdr/contact/viewcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewcontactofgroup.cxx
@@ -36,6 +36,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/color/bcolor.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -78,25 +79,22 @@ namespace sdr
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, aCandSeq);
}
}
-
- if(xRetval.hasElements())
- {
- return xRetval;
- }
else
{
- // create a gray placeholder hairline polygon in object size. Use the model data directly. For empty groups,
- // this is SdrObject::aOutRect, as can be seen in SdrObjGroup::GetSnapRect(). Access that using GetLastBoundRect()
- // to not execute anything.
+ // append an invisible outline for the cases where no visible content exists
const Rectangle aCurrentBoundRect(GetSdrObjGroup().GetLastBoundRect());
- const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(
- aCurrentBoundRect.Left(), aCurrentBoundRect.Top(), aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom())));
- const basegfx::BColor aGrayTone(0xc0 / 255.0, 0xc0 / 255.0, 0xc0 / 255.0);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(aOutline, aGrayTone));
+ const basegfx::B2DRange aCurrentRange(
+ aCurrentBoundRect.Left(), aCurrentBoundRect.Top(),
+ aCurrentBoundRect.Right(), aCurrentBoundRect.Bottom());
+
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aCurrentRange));
- // The replacement object may also get a text like 'empty group' here later
- return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+
+ return xRetval;
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
index 3b8dc097a2..d397917edf 100644
--- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx
@@ -38,12 +38,14 @@
#include <svx/svdview.hxx>
#include <svx/sdr/contact/viewcontactofsdrpage.hxx>
#include <svx/sdr/contact/viewobjectcontactofmasterpagedescriptor.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <svx/svdpage.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -59,33 +61,30 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfMasterPageDescriptor::createViewIndependentPrimitive2DSequence() const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
- const SdrObject* pBackgroundCandidate = GetMasterPageDescriptor().GetBackgroundObject();
- if(pBackgroundCandidate)
- {
- // build primitive from pBackgroundCandidate's attributes
- const SfxItemSet& rFillProperties = pBackgroundCandidate->GetMergedItemSet();
- drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties);
-
- if(pFill)
- {
- if(pFill->isVisible())
- {
- // direct model data is the page size, get and use it
- const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
- const basegfx::B2DRange aInnerRange(
- rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(),
- rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(), rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
- const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
- const basegfx::B2DHomMatrix aEmptyTransform;
- const drawinglayer::primitive2d::Primitive2DReference xReference(drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aInnerPolgon), aEmptyTransform, *pFill));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ // build primitive from page fill attributes
+ const SfxItemSet& rPageFillAttributes = GetMasterPageDescriptor().getCorrectFillAttributes();
+ const drawinglayer::attribute::SdrFillAttribute aFill(
+ drawinglayer::primitive2d::createNewSdrFillAttribute(rPageFillAttributes));
- delete pFill;
- }
+ if(!aFill.isDefault())
+ {
+ // direct model data is the page size, get and use it
+ const SdrPage& rOwnerPage = GetMasterPageDescriptor().GetOwnerPage();
+ const basegfx::B2DRange aInnerRange(
+ rOwnerPage.GetLftBorder(), rOwnerPage.GetUppBorder(),
+ rOwnerPage.GetWdt() - rOwnerPage.GetRgtBorder(),
+ rOwnerPage.GetHgt() - rOwnerPage.GetLwrBorder());
+ const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
+ const basegfx::B2DHomMatrix aEmptyTransform;
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aInnerPolgon),
+ aEmptyTransform,
+ aFill,
+ drawinglayer::attribute::FillGradientAttribute()));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
return xRetval;
@@ -105,23 +104,11 @@ namespace sdr
sal_uInt32 ViewContactOfMasterPageDescriptor::GetObjectCount() const
{
- sal_uInt32 nRetval(GetMasterPageDescriptor().GetUsedPage().GetObjCount());
-
- if(nRetval && GetMasterPageDescriptor().GetUsedPage().GetObj(0)->IsMasterPageBackgroundObject())
- {
- nRetval--;
- }
-
- return nRetval;
+ return GetMasterPageDescriptor().GetUsedPage().GetObjCount();
}
ViewContact& ViewContactOfMasterPageDescriptor::GetViewContact(sal_uInt32 nIndex) const
{
- if(GetMasterPageDescriptor().GetUsedPage().GetObjCount() && GetMasterPageDescriptor().GetUsedPage().GetObj(0)->IsMasterPageBackgroundObject())
- {
- nIndex++;
- }
-
return GetMasterPageDescriptor().GetUsedPage().GetObj(nIndex)->GetViewContact();
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
index 85dd101da9..f13d30c8db 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrcaptionobj.hxx>
#include <svx/svdocapt.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrcaptionprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -66,107 +65,108 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SdrCaptionObj& rCaptionObj(GetCaptionObj());
const SfxItemSet& rItemSet = rCaptionObj.GetMergedItemSet();
- SdrText* pSdrText = rCaptionObj.getText(0);
-
- if(pSdrText)
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ rCaptionObj.getText(0)));
+
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = rCaptionObj.GetGeoRect();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+ const GeoStat& rGeoStat(rCaptionObj.GetGeoStat());
+
+ // fill object matrix
+ basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+ // calculate corner radius
+ double fCornerRadiusX;
+ double fCornerRadiusY;
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(
+ rCaptionObj.GetEckenradius(), aObjectRange, fCornerRadiusX, fCornerRadiusY);
+
+ // create primitive. Always create one (even if invisible) to let the decomposition
+ // of SdrCaptionPrimitive2D create needed invisible elements for HitTest and BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrCaptionPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ rCaptionObj.getTailPolygon(),
+ fCornerRadiusX,
+ fCornerRadiusY));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+
+ if(!aAttribute.isDefault() && rCaptionObj.GetSpecialTextBoxShadow())
{
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
-
- if(pAttribute)
+ // for SC, the caption object may have a specialized shadow. The usual object shadow is off
+ // and a specialized shadow gets created here (see old paint)
+ const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
+ const sal_uInt16 nTransp(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
+ const Color aShadCol(rShadColItem.GetColorValue());
+ const XFillStyle eStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue();
+
+ // Create own ItemSet and modify as needed
+ // Always hide lines for special calc shadow
+ SfxItemSet aSet(rItemSet);
+ aSet.Put(XLineStyleItem(XLINE_NONE));
+
+ if(XFILL_HATCH == eStyle)
+ {
+ // #41666# Hatch color is set hard to shadow color
+ XHatch aHatch = ((XFillHatchItem&)(rItemSet.Get(XATTR_FILLHATCH))).GetHatchValue();
+ aHatch.SetColor(aShadCol);
+ aSet.Put(XFillHatchItem(String(),aHatch));
+ }
+ else
{
- if(pAttribute->isVisible())
+ if(XFILL_NONE != eStyle && XFILL_SOLID != eStyle)
{
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = rCaptionObj.GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(rCaptionObj.GetGeoStat());
-
- // fill object matrix
- basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // calculate corner radius
- double fCornerRadiusX;
- double fCornerRadiusY;
- drawinglayer::primitive2d::calculateRelativeCornerRadius(rCaptionObj.GetEckenradius(), aObjectRange, fCornerRadiusX, fCornerRadiusY);
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrCaptionPrimitive2D(
- aObjectMatrix, *pAttribute, rCaptionObj.getTailPolygon(), fCornerRadiusX, fCornerRadiusY));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
-
- if(rCaptionObj.GetSpecialTextBoxShadow())
- {
- // for SC, the caption object may have a specialized shadow. The usual object shadow is off
- // and a specialized shadow gets created here (see old paint)
- const SdrShadowColorItem& rShadColItem = (SdrShadowColorItem&)(rItemSet.Get(SDRATTR_SHADOWCOLOR));
- const sal_uInt16 nTransp(((SdrShadowTransparenceItem&)(rItemSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue());
- const Color aShadCol(rShadColItem.GetColorValue());
- const XFillStyle eStyle = ((XFillStyleItem&)(rItemSet.Get(XATTR_FILLSTYLE))).GetValue();
-
- // Create own ItemSet and modify as needed
- // Always hide lines for special calc shadow
- SfxItemSet aSet(rItemSet);
- aSet.Put(XLineStyleItem(XLINE_NONE));
-
- if(XFILL_HATCH == eStyle)
- {
- // #41666# Hatch color is set hard to shadow color
- XHatch aHatch = ((XFillHatchItem&)(rItemSet.Get(XATTR_FILLHATCH))).GetHatchValue();
- aHatch.SetColor(aShadCol);
- aSet.Put(XFillHatchItem(String(),aHatch));
- }
- else
- {
- if(XFILL_NONE != eStyle && XFILL_SOLID != eStyle)
- {
- // force fill to solid (for Gradient and Bitmap)
- aSet.Put(XFillStyleItem(XFILL_SOLID));
- }
-
- aSet.Put(XFillColorItem(String(),aShadCol));
- aSet.Put(XFillTransparenceItem(nTransp));
- }
-
- // crete FillAttribute from modified ItemSet
- drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(aSet);
- drawinglayer::primitive2d::Primitive2DReference xSpecialShadow;
-
- if(pFill)
- {
- if(pFill->isVisible())
- {
- // add shadow offset to object matrix
- const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
- const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
- aObjectMatrix.translate(nXDist, nYDist);
-
- // create unit outline polygon as geometry (see SdrCaptionPrimitive2D::create2DDecomposition)
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), fCornerRadiusX, fCornerRadiusY));
-
- // create the specialized shadow primitive
- xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), aObjectMatrix, *pFill);
- }
-
- delete pFill;
- }
-
- if(xSpecialShadow.is())
- {
- // if we really got a special shadow, create a two-element retval with the shadow
- // behind the standard object's geometry
- xRetval.realloc(2);
-
- xRetval[0] = xSpecialShadow;
- xRetval[1] = xReference;
- }
- }
+ // force fill to solid (for Gradient and Bitmap)
+ aSet.Put(XFillStyleItem(XFILL_SOLID));
}
- delete pAttribute;
+ aSet.Put(XFillColorItem(String(),aShadCol));
+ aSet.Put(XFillTransparenceItem(nTransp));
+ }
+
+ // crete FillAttribute from modified ItemSet
+ const drawinglayer::attribute::SdrFillAttribute aFill(
+ drawinglayer::primitive2d::createNewSdrFillAttribute(aSet));
+ drawinglayer::primitive2d::Primitive2DReference xSpecialShadow;
+
+ if(!aFill.isDefault() && 1.0 != aFill.getTransparence())
+ {
+ // add shadow offset to object matrix
+ const sal_uInt32 nXDist(((SdrShadowXDistItem&)(rItemSet.Get(SDRATTR_SHADOWXDIST))).GetValue());
+ const sal_uInt32 nYDist(((SdrShadowYDistItem&)(rItemSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
+ aObjectMatrix.translate(nXDist, nYDist);
+
+ // create unit outline polygon as geometry (see SdrCaptionPrimitive2D::create2DDecomposition)
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
+ basegfx::B2DRange(0.0, 0.0, 1.0, 1.0), fCornerRadiusX, fCornerRadiusY));
+
+ // create the specialized shadow primitive
+ xSpecialShadow = drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ aObjectMatrix,
+ aFill,
+ drawinglayer::attribute::FillGradientAttribute());
+ }
+
+ if(xSpecialShadow.is())
+ {
+ // if we really got a special shadow, create a two-element retval with the shadow
+ // behind the standard object's geometry
+ xRetval.realloc(2);
+
+ xRetval[0] = xSpecialShadow;
+ xRetval[1] = xReference;
}
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
index 12db5086bd..10a0d3f733 100644
--- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrcircobj.hxx>
#include <svx/svdocirc.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrellipseprimitive2d.hxx>
#include <svl/itemset.hxx>
#include <svx/sxciaitm.hxx>
@@ -54,56 +53,62 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrCircObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetCircObj().GetMergedItemSet();
- SdrText* pSdrText = GetCircObj().getText(0);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetCircObj().getText(0)));
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
-
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetCircObj().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(GetCircObj().GetGeoStat());
-
- // fill object matrix
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = GetCircObj().GetGeoRect();
+ const basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+ const GeoStat& rGeoStat(GetCircObj().GetGeoStat());
- // create primitive data
- const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier());
+ // fill object matrix
+ const basegfx::B2DHomMatrix aObjectMatrix(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- if(OBJ_CIRC == nIdentifier)
- {
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrEllipsePrimitive2D(aObjectMatrix, *pAttribute));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- else
- {
- const sal_Int32 nNewStart(((SdrCircStartAngleItem&)rItemSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue());
- const sal_Int32 nNewEnd(((SdrCircEndAngleItem&)rItemSet.Get(SDRATTR_CIRCENDANGLE)).GetValue());
- const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000);
- const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000);
- const bool bCloseSegment(OBJ_CARC != nIdentifier);
- const bool bCloseUsingCenter(OBJ_SECT == nIdentifier);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D(aObjectMatrix, *pAttribute, fStart, fEnd, bCloseSegment, bCloseUsingCenter));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
+ // create primitive data
+ const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier());
- delete pAttribute;
- }
+ // always create primitives to allow the decomposition of SdrEllipsePrimitive2D
+ // or SdrEllipseSegmentPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ if(OBJ_CIRC == nIdentifier)
+ {
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrEllipsePrimitive2D(
+ aObjectMatrix,
+ aAttribute));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ else
+ {
+ const sal_Int32 nNewStart(((SdrCircStartAngleItem&)rItemSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue());
+ const sal_Int32 nNewEnd(((SdrCircEndAngleItem&)rItemSet.Get(SDRATTR_CIRCENDANGLE)).GetValue());
+ const double fStart(((36000 - nNewEnd) % 36000) * F_PI18000);
+ const double fEnd(((36000 - nNewStart) % 36000) * F_PI18000);
+ const bool bCloseSegment(OBJ_CARC != nIdentifier);
+ const bool bCloseUsingCenter(OBJ_SECT == nIdentifier);
- return xRetval;
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ fStart,
+ fEnd,
+ bCloseSegment,
+ bCloseUsingCenter));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
index 6f131479c3..6fdd107669 100644
--- a/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdredgeobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdredgeobj.hxx>
#include <svx/svdoedge.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -51,35 +50,27 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrEdgeObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- ::basegfx::B2DPolygon aEdgeTrack(GetEdgeObj().getEdgeTrack());
+ const basegfx::B2DPolygon& rEdgeTrack = GetEdgeObj().getEdgeTrack();
- // base visualisation on EdgeTrack
- if(aEdgeTrack.count())
- {
- // ckeck attributes
- const SfxItemSet& rItemSet = GetEdgeObj().GetMergedItemSet();
- SdrText* pSdrText = GetEdgeObj().getText(0);
+ // what to do when no EdgeTrack is provided (HitTest and selectability) ?
+ OSL_ENSURE(0 != rEdgeTrack.count(), "Connectors with no geometry are not allowed (!)");
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(rItemSet, *pSdrText);
+ // ckeck attributes
+ const SfxItemSet& rItemSet = GetEdgeObj().GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(
+ rItemSet,
+ GetEdgeObj().getText(0)));
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrConnectorPrimitive2D(*pAttribute, aEdgeTrack));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrConnectorPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrConnectorPrimitive2D(
+ aAttribute,
+ rEdgeTrack));
- delete pAttribute;
- }
- }
- }
-
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
index aea0144d47..2ee955d980 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrmeasureobj.hxx>
#include <svx/svdomeas.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svl/itemset.hxx>
#include <svx/sxmbritm.hxx>
#include <svx/sxmlhitm.hxx>
@@ -57,91 +56,85 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrMeasureObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetMeasureObj().GetMergedItemSet();
- SdrText* pSdrText = GetMeasureObj().getText(0);
+ const drawinglayer::attribute::SdrLineShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(
+ rItemSet,
+ GetMeasureObj().getText(0)));
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute(rItemSet, *pSdrText);
+ // take properties which are the model data.
+ const ::basegfx::B2DPoint aStart(GetMeasureObj().GetPoint(0).X(), GetMeasureObj().GetPoint(0).Y());
+ const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetPoint(1).X(), GetMeasureObj().GetPoint(1).Y());
+ const double fDistance(((SdrMeasureLineDistItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue());
+ const double fUpperDistance(((SdrMeasureHelplineOverhangItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue());
+ const double fLowerDistance(((SdrMeasureHelplineDistItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue());
+ const double fLeftDelta(((SdrMeasureHelpline1LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue());
+ const double fRightDelta(((SdrMeasureHelpline2LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue());
+ const bool bBelow(((SdrMeasureBelowRefEdgeItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue());
+ const bool bTextRotation(((SdrMeasureTextRota90Item&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue());
+ const bool bTextAutoAngle(((SdrMeasureTextAutoAngleItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue());
+ drawinglayer::primitive2d::MeasureTextPosition aMTPHor(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
+ drawinglayer::primitive2d::MeasureTextPosition aMTPVer(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
- if(pAttribute)
+ switch(((SdrMeasureTextHPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue())
+ {
+ case SDRMEASURE_TEXTLEFTOUTSIDE :
{
- if(pAttribute->isVisible())
- {
- // take properties which are the model data.
- const ::basegfx::B2DPoint aStart(GetMeasureObj().GetPoint(0).X(), GetMeasureObj().GetPoint(0).Y());
- const ::basegfx::B2DPoint aEnd(GetMeasureObj().GetPoint(1).X(), GetMeasureObj().GetPoint(1).Y());
- const double fDistance(((SdrMeasureLineDistItem&)rItemSet.Get(SDRATTR_MEASURELINEDIST)).GetValue());
- const double fUpperDistance(((SdrMeasureHelplineOverhangItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue());
- const double fLowerDistance(((SdrMeasureHelplineDistItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINEDIST)).GetValue());
- const double fLeftDelta(((SdrMeasureHelpline1LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE1LEN)).GetValue());
- const double fRightDelta(((SdrMeasureHelpline2LenItem&)rItemSet.Get(SDRATTR_MEASUREHELPLINE2LEN)).GetValue());
- const bool bBelow(((SdrMeasureBelowRefEdgeItem&)rItemSet.Get(SDRATTR_MEASUREBELOWREFEDGE)).GetValue());
- const bool bTextRotation(((SdrMeasureTextRota90Item&)rItemSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue());
- const bool bTextAutoAngle(((SdrMeasureTextAutoAngleItem&)rItemSet.Get(SDRATTR_MEASURETEXTAUTOANGLE)).GetValue());
- drawinglayer::primitive2d::MeasureTextPosition aMTPHor(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
- drawinglayer::primitive2d::MeasureTextPosition aMTPVer(drawinglayer::primitive2d::MEASURETEXTPOSITION_AUTOMATIC);
-
- switch(((SdrMeasureTextHPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue())
- {
- case SDRMEASURE_TEXTLEFTOUTSIDE :
- {
- aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
- break;
- }
- case SDRMEASURE_TEXTINSIDE :
- {
- aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
- break;
- }
- case SDRMEASURE_TEXTRIGHTOUTSIDE :
- {
- aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
- break;
- }
- default : // SDRMEASURE_TEXTHAUTO
- {
- break;
- }
- }
-
- switch(((SdrMeasureTextVPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue())
- {
- case SDRMEASURE_ABOVE :
- {
- aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
- break;
- }
- case SDRMEASURETEXT_BREAKEDLINE :
- case SDRMEASURETEXT_VERTICALCENTERED :
- {
- aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
- break;
- }
- case SDRMEASURE_BELOW :
- {
- aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
- break;
- }
- default : // SDRMEASURE_TEXTVAUTO
- {
- break;
- }
- }
-
- // create primitive with the model data
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrMeasurePrimitive2D(*pAttribute,
- aStart, aEnd, aMTPHor, aMTPVer, fDistance, fUpperDistance, fLowerDistance, fLeftDelta, fRightDelta,
- bBelow, bTextRotation, bTextAutoAngle));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
+ aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
+ break;
+ }
+ case SDRMEASURE_TEXTINSIDE :
+ {
+ aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
+ break;
+ }
+ case SDRMEASURE_TEXTRIGHTOUTSIDE :
+ {
+ aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
+ break;
+ }
+ default : // SDRMEASURE_TEXTHAUTO
+ {
+ break;
+ }
+ }
- delete pAttribute;
+ switch(((SdrMeasureTextVPosItem&)rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue())
+ {
+ case SDRMEASURE_ABOVE :
+ {
+ aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
+ break;
+ }
+ case SDRMEASURETEXT_BREAKEDLINE :
+ case SDRMEASURETEXT_VERTICALCENTERED :
+ {
+ aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
+ break;
+ }
+ case SDRMEASURE_BELOW :
+ {
+ aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
+ break;
+ }
+ default : // SDRMEASURE_TEXTVAUTO
+ {
+ break;
}
}
- return xRetval;
+ // create primitive with the model data. Always create primitives to allow the
+ // decomposition of SdrMeasurePrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrMeasurePrimitive2D(
+ aAttribute, aStart, aEnd,
+ aMTPHor, aMTPVer, fDistance,
+ fUpperDistance, fLowerDistance,
+ fLeftDelta, fRightDelta, bBelow,
+ bTextRotation, bTextAutoAngle));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
index af9686e9d6..5a38d50543 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmediaobj.cxx
@@ -154,7 +154,9 @@ namespace sdr
// create range using the model data directly. This is in SdrTextObj::aRect which i will access using
// GetGeoRect() to not trigger any calculations. It's the unrotated geometry which is okay for MediaObjects ATM.
const Rectangle& rRectangle(GetSdrMediaObj().GetGeoRect());
- const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+ const basegfx::B2DRange aRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
// create object transform
basegfx::B2DHomMatrix aTransform;
@@ -163,12 +165,15 @@ namespace sdr
aTransform.set(0, 2, aRange.getMinX());
aTransform.set(1, 2, aRange.getMinY());
- // create media primitive
+ // create media primitive. Always create primitives to allow the
+ // decomposition of MediaPrimitive2D to create needed invisible elements for HitTest
+ // and/or BoundRect
const basegfx::BColor aBackgroundColor(67.0 / 255.0, 67.0 / 255.0, 67.0 / 255.0);
const rtl::OUString& rURL(GetSdrMediaObj().getURL());
const sal_uInt32 nPixelBorder(4L);
- const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::MediaPrimitive2D(
- aTransform, rURL, aBackgroundColor, nPixelBorder));
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ new drawinglayer::primitive2d::MediaPrimitive2D(
+ aTransform, rURL, aBackgroundColor, nPixelBorder));
return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index 9c0d1f5fc8..c998a65591 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -31,13 +31,13 @@
#include <svx/svdoashp.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svditer.hxx>
#include <svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <svx/obj3d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -112,131 +112,126 @@ namespace sdr
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetCustomShapeObj().GetMergedItemSet();
- SdrText* pSdrText = GetCustomShapeObj().getText(0);
- if(pSdrText)
- {
- // #i98072# Get shandow and text; eventually suppress the text if it's
- // a TextPath FontworkGallery object
- drawinglayer::attribute::SdrShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrShadowTextAttribute(
+ // #i98072# Get shandow and text; eventually suppress the text if it's
+ // a TextPath FontworkGallery object
+ const drawinglayer::attribute::SdrShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrShadowTextAttribute(
rItemSet,
- *pSdrText,
- GetCustomShapeObj().IsTextPath());
- drawinglayer::primitive2d::Primitive2DSequence xGroup;
- bool bHasText(pAttribute && pAttribute->getText());
+ GetCustomShapeObj().getText(0),
+ GetCustomShapeObj().IsTextPath()));
+ drawinglayer::primitive2d::Primitive2DSequence xGroup;
+ bool bHasText(!aAttribute.getText().isDefault());
- // create Primitive2DSequence from sub-geometry
- const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape();
- bool b3DShape(false);
+ // create Primitive2DSequence from sub-geometry
+ const SdrObject* pSdrObjRepresentation = GetCustomShapeObj().GetSdrObjectFromCustomShape();
+ bool b3DShape(false);
- if(pSdrObjRepresentation)
+ if(pSdrObjRepresentation)
+ {
+ SdrObjListIter aIterator(*pSdrObjRepresentation);
+
+ while(aIterator.IsMore())
{
- SdrObjListIter aIterator(*pSdrObjRepresentation);
-
- while(aIterator.IsMore())
- {
- SdrObject& rCandidate = *aIterator.Next();
+ SdrObject& rCandidate = *aIterator.Next();
- if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate))
- {
- b3DShape = true;
- }
-
- const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence());
- drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew);
+ if(!b3DShape && dynamic_cast< E3dObject* >(&rCandidate))
+ {
+ b3DShape = true;
}
+
+ const drawinglayer::primitive2d::Primitive2DSequence xNew(rCandidate.GetViewContact().getViewIndependentPrimitive2DSequence());
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xGroup, xNew);
}
+ }
+
+ if(bHasText || xGroup.hasElements())
+ {
+ // prepare text box geometry
+ basegfx::B2DHomMatrix aTextBoxMatrix;
+ bool bWordWrap(false);
- if(bHasText || xGroup.hasElements())
+ if(bHasText)
{
- // prepare text box geometry
- basegfx::B2DHomMatrix aTextBoxMatrix;
- bool bWordWrap(false);
+ // take unrotated snap rect as default, then get the
+ // unrotated text box. Rotation needs to be done centered
+ const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
+ const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
- if(bHasText)
- {
- // take unrotated snap rect as default, then get the
- // unrotated text box. Rotation needs to be done centered
- const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
- const basegfx::B2DRange aObjectRange(aObjectBound.Left(), aObjectBound.Top(), aObjectBound.Right(), aObjectBound.Bottom());
+ // #i101684# get the text range unrotated and absolute to the object range
+ const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect());
- // #i101684# get the text range unrotated and absolute to the object range
- const basegfx::B2DRange aTextRange(getCorrectedTextBoundRect());
+ // give text object a size
+ aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight());
- // give text object a size
- aTextBoxMatrix.scale(aTextRange.getWidth(), aTextRange.getHeight());
+ // check if we have a rotation/shear at all to take care of
+ const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
+ const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
- // check if we have a rotation/shear at all to take care of
- const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
- const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
+ if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
+ {
+ if(aObjectRange != aTextRange)
+ {
+ // move relative to unrotated object range
+ aTextBoxMatrix.translate(
+ aTextRange.getMinX() - aObjectRange.getMinimum().getX(),
+ aTextRange.getMinY() - aObjectRange.getMinimum().getY());
+ }
- if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
+ if(!basegfx::fTools::equalZero(fExtraTextRotation))
{
- if(aObjectRange != aTextRange)
- {
- // move relative to unrotated object range
- aTextBoxMatrix.translate(
- aTextRange.getMinX() - aObjectRange.getMinimum().getX(),
- aTextRange.getMinY() - aObjectRange.getMinimum().getY());
- }
-
- if(!basegfx::fTools::equalZero(fExtraTextRotation))
- {
- basegfx::B2DVector aTranslation(
- ( aTextRange.getWidth() / 2 ) + ( aTextRange.getMinX() - aObjectRange.getMinimum().getX() ),
- ( aTextRange.getHeight() / 2 ) + ( aTextRange.getMinY() - aObjectRange.getMinimum().getY() ) );
- aTextBoxMatrix.translate( -aTranslation.getX(), -aTranslation.getY() );
- aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
- aTextBoxMatrix.translate( aTranslation.getX(), aTranslation.getY() );
- }
-
- if(rGeoStat.nShearWink)
- {
- aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
- }
-
- if(rGeoStat.nDrehWink)
- {
- aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
- }
-
- // give text it's target position
- aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ basegfx::B2DVector aTranslation(
+ ( aTextRange.getWidth() / 2 ) + ( aTextRange.getMinX() - aObjectRange.getMinimum().getX() ),
+ ( aTextRange.getHeight() / 2 ) + ( aTextRange.getMinY() - aObjectRange.getMinimum().getY() ) );
+ aTextBoxMatrix.translate( -aTranslation.getX(), -aTranslation.getY() );
+ aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
+ aTextBoxMatrix.translate( aTranslation.getX(), aTranslation.getY() );
}
- else
+
+ if(rGeoStat.nShearWink)
{
- aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY());
+ aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
}
- // check if SdrTextWordWrapItem is set
- bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
- }
+ if(rGeoStat.nDrehWink)
+ {
+ aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
+ }
- // make sure a (even empty) SdrShadowTextAttribute exists for
- // primitive creation
- if(!pAttribute)
+ // give text it's target position
+ aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
+ }
+ else
{
- pAttribute = new drawinglayer::attribute::SdrShadowTextAttribute(0L, 0L);
+ aTextBoxMatrix.translate(aTextRange.getMinX(), aTextRange.getMinY());
}
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrCustomShapePrimitive2D(
- *pAttribute,
- xGroup,
- aTextBoxMatrix,
- bWordWrap,
- b3DShape,
- false)); // #SJ# New parameter to force to clipped BlockText for SC
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ // check if SdrTextWordWrapItem is set
+ bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
}
- if(pAttribute)
- {
- delete pAttribute;
- }
+ // create primitive
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrCustomShapePrimitive2D(
+ aAttribute,
+ xGroup,
+ aTextBoxMatrix,
+ bWordWrap,
+ b3DShape,
+ false)); // #SJ# New parameter to force to clipped BlockText for SC
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ // always append an invisible outline for the cases where no visible content exists
+ const Rectangle aObjectBound(GetCustomShapeObj().GetGeoRect());
+ const basegfx::B2DRange aObjectRange(
+ aObjectBound.Left(), aObjectBound.Top(),
+ aObjectBound.Right(), aObjectBound.Bottom());
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectRange));
+
return xRetval;
}
} // end of namespace contact
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index ddbae27a9e..b802b2e363 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -30,7 +30,6 @@
#include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdoole2.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/contact/viewobjectcontactofsdrole2obj.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/primitive2d/sdrole2primitive2d.hxx>
@@ -72,59 +71,51 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createPrimitive2DSequenceWithParameters(
bool bHighContrast) const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
- SdrText* pSdrText = GetOle2Obj().getText(0);
-
- if(pSdrText)
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetOle2Obj().GetGeoRect();
- const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // create object matrix
- const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat());
- const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
- const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
- const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
-
- // Prepare attribute settings, will be used soon anyways
- const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
-
- if(!pAttribute)
- {
- // force existence, even when not visible
- pAttribute = new drawinglayer::attribute::SdrLineFillShadowTextAttribute(0, 0, 0, 0, 0, 0);
- }
-
- // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
- // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
- // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
- // It will also take care of HighContrast and ScaleContent
- const drawinglayer::primitive2d::Primitive2DReference xOleContent(
- new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
- GetOle2Obj(),
- aObjectMatrix,
-
- // #i104867# add GraphicVersion number to be able to check for
- // content change in the primitive later
- GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(),
-
- bHighContrast));
-
- // create primitive. Use Ole2 primitive here. Prepare attribute settings, will be used soon anyways.
- const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1);
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrOle2Primitive2D(
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = GetOle2Obj().GetGeoRect();
+ const basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
+
+ // create object matrix
+ const GeoStat& rGeoStat(GetOle2Obj().GetGeoStat());
+ const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+ const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
+ const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+ // Prepare attribute settings, will be used soon anyways
+ const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetOle2Obj().getText(0)));
+
+ // #i102063# embed OLE content in an own primitive; this will be able to decompose accessing
+ // the weak SdrOle2 reference and will also implement getB2DRange() for fast BoundRect
+ // calculations without OLE Graphic access (which may trigger e.g. chart recalculation).
+ // It will also take care of HighContrast and ScaleContent
+ const drawinglayer::primitive2d::Primitive2DReference xOleContent(
+ new drawinglayer::primitive2d::SdrOleContentPrimitive2D(
+ GetOle2Obj(),
+ aObjectMatrix,
+
+ // #i104867# add GraphicVersion number to be able to check for
+ // content change in the primitive later
+ GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion(),
+
+ bHighContrast));
+
+ // create primitive. Use Ole2 primitive here. Prepare attribute settings, will
+ // be used soon anyways. Always create primitives to allow the decomposition of
+ // SdrOle2Primitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DSequence xOLEContent(&xOleContent, 1);
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrOle2Primitive2D(
xOLEContent,
aObjectMatrix,
- *pAttribute));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- delete pAttribute;
- }
+ aAttribute));
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence() const
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index fdfcd53d05..0bf51d58f9 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -42,9 +42,9 @@
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -98,7 +98,8 @@ namespace sdr
const svtools::ColorConfig aColorConfig;
const Color aInitColor(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
const basegfx::BColor aRGBColor(aInitColor.getBColor());
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
@@ -202,38 +203,27 @@ namespace sdr
}
else
{
- OSL_ENSURE(0 != rPage.GetObjCount(), "MasterPage without MPBGO detected (!)");
+ // build primitive from pObject's attributes
+ const SfxItemSet& rFillAttributes = rPage.getSdrPageProperties().GetItemSet();
+ const drawinglayer::attribute::SdrFillAttribute aFill(
+ drawinglayer::primitive2d::createNewSdrFillAttribute(rFillAttributes));
- if(rPage.GetObjCount())
+ if(!aFill.isDefault())
{
- SdrObject* pObject = rPage.GetObj(0);
- OSL_ENSURE(pObject && pObject->IsMasterPageBackgroundObject(), "MasterPage with wrong MPBGO detected (!)");
-
- if(pObject && pObject->IsMasterPageBackgroundObject())
- {
- // build primitive from pObject's attributes
- const SfxItemSet& rFillProperties = pObject->GetMergedItemSet();
- drawinglayer::attribute::SdrFillAttribute* pFill = drawinglayer::primitive2d::createNewSdrFillAttribute(rFillProperties);
-
- if(pFill)
- {
- if(pFill->isVisible())
- {
- // direct model data is the page size, get and use it
- const basegfx::B2DRange aInnerRange(
- rPage.GetLftBorder(), rPage.GetUppBorder(),
- rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder());
- const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
- const basegfx::B2DHomMatrix aEmptyTransform;
- const drawinglayer::primitive2d::Primitive2DReference xReference(drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aInnerPolgon), aEmptyTransform, *pFill));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
-
- delete pFill;
- }
- }
+ // direct model data is the page size, get and use it
+ const basegfx::B2DRange aInnerRange(
+ rPage.GetLftBorder(), rPage.GetUppBorder(),
+ rPage.GetWdt() - rPage.GetRgtBorder(), rPage.GetHgt() - rPage.GetLwrBorder());
+ const basegfx::B2DPolygon aInnerPolgon(basegfx::tools::createPolygonFromRect(aInnerRange));
+ const basegfx::B2DHomMatrix aEmptyTransform;
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aInnerPolgon),
+ aEmptyTransform,
+ aFill,
+ drawinglayer::attribute::FillGradientAttribute()));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
}
@@ -455,23 +445,11 @@ namespace sdr
sal_uInt32 ViewContactOfPageHierarchy::GetObjectCount() const
{
- sal_uInt32 nSubObjectCount(getPage().GetObjCount());
-
- if(nSubObjectCount && getPage().GetObj(0L)->IsMasterPageBackgroundObject())
- {
- nSubObjectCount--;
- }
-
- return nSubObjectCount;
+ return getPage().GetObjCount();
}
ViewContact& ViewContactOfPageHierarchy::GetViewContact(sal_uInt32 nIndex) const
{
- if(getPage().GetObjCount() && getPage().GetObj(0L)->IsMasterPageBackgroundObject())
- {
- nIndex++;
- }
-
SdrObject* pObj = getPage().GetObj(nIndex);
DBG_ASSERT(pObj, "ViewContactOfPageHierarchy::GetViewContact: Corrupt SdrObjList (!)");
return pObj->GetViewContact();
diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index 21cbb4ef94..78f90a54d9 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrpathobj.hxx>
#include <svx/svdopath.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <svx/sdr/primitive2d/sdrpathprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -53,93 +52,91 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrPathObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetPathObj().GetMergedItemSet();
- SdrText* pSdrText = GetPathObj().getText(0);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetPathObj().getText(0)));
+ basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
+ sal_uInt32 nPolyCount(aUnitPolyPolygon.count());
+ sal_uInt32 nPointCount(0);
+
+ for(sal_uInt32 a(0); a < nPolyCount; a++)
+ {
+ nPointCount += aUnitPolyPolygon.getB2DPolygon(a).count();
+ }
- if(pSdrText)
+ if(!nPointCount)
{
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
- drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
- rItemSet,
- *pSdrText);
-
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
- const sal_uInt32 nPolyCount(aUnitPolyPolygon.count());
-
- if(nPolyCount)
- {
- // prepare object transformation and unit polygon (direct model data)
- basegfx::B2DHomMatrix aObjectMatrix;
- const bool bIsLine(
- !aUnitPolyPolygon.areControlPointsUsed()
- && 1 == nPolyCount
- && 2 == aUnitPolyPolygon.getB2DPolygon(0).count());
-
- if(bIsLine)
- {
- // special handling for single line mode (2 points)
- const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
- const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0));
- const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1));
- const basegfx::B2DVector aLine(aEnd - aStart);
-
- // #i102548# create new unit polygon for line (horizontal)
- basegfx::B2DPolygon aNewPolygon;
- aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
- aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
- aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
-
- // #i102548# fill objectMatrix with rotation and offset (no shear for lines)
- aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aLine.getLength(), 1.0,
- 0.0,
- atan2(aLine.getY(), aLine.getX()),
- aStart.getX(), aStart.getY());
- }
- else
- {
- // #i102548# create unscaled, unsheared, unrotated and untranslated polygon
- // (unit polygon) by creating the object matrix and back-transforming the polygon
- const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon));
- const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
- const double fWidth(aObjectRange.getWidth());
- const double fHeight(aObjectRange.getHeight());
- const double fScaleX(basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth);
- const double fScaleY(basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight);
-
- aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- fScaleX, fScaleY,
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY());
-
- // ceate unit polygon from object's absolute path
- basegfx::B2DHomMatrix aInverse(aObjectMatrix);
- aInverse.invert();
- aUnitPolyPolygon.transform(aInverse);
- }
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrPathPrimitive2D(
- aObjectMatrix,
- *pAttribute,
- aUnitPolyPolygon));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
-
- delete pAttribute;
- }
+ OSL_ENSURE(false, "PolyPolygon object without geometry detected, this should not be created (!)");
+ basegfx::B2DPolygon aFallbackLine;
+ aFallbackLine.append(basegfx::B2DPoint(0.0, 0.0));
+ aFallbackLine.append(basegfx::B2DPoint(1000.0, 1000.0));
+ aUnitPolyPolygon = basegfx::B2DPolyPolygon(aFallbackLine);
+
+ nPolyCount = 1;
}
- return xRetval;
+ // prepare object transformation and unit polygon (direct model data)
+ basegfx::B2DHomMatrix aObjectMatrix;
+ const bool bIsLine(
+ !aUnitPolyPolygon.areControlPointsUsed()
+ && 1 == nPolyCount
+ && 2 == aUnitPolyPolygon.getB2DPolygon(0).count());
+
+ if(bIsLine)
+ {
+ // special handling for single line mode (2 points)
+ const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
+ const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0));
+ const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1));
+ const basegfx::B2DVector aLine(aEnd - aStart);
+
+ // #i102548# create new unit polygon for line (horizontal)
+ basegfx::B2DPolygon aNewPolygon;
+ aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
+ aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
+ aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
+
+ // #i102548# fill objectMatrix with rotation and offset (no shear for lines)
+ aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aLine.getLength(), 1.0,
+ 0.0,
+ atan2(aLine.getY(), aLine.getX()),
+ aStart.getX(), aStart.getY());
+ }
+ else
+ {
+ // #i102548# create unscaled, unsheared, unrotated and untranslated polygon
+ // (unit polygon) by creating the object matrix and back-transforming the polygon
+ const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon));
+ const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
+ const double fWidth(aObjectRange.getWidth());
+ const double fHeight(aObjectRange.getHeight());
+ const double fScaleX(basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth);
+ const double fScaleY(basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight);
+
+ aObjectMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ fScaleX, fScaleY,
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY());
+
+ // ceate unit polygon from object's absolute path
+ basegfx::B2DHomMatrix aInverse(aObjectMatrix);
+ aInverse.invert();
+ aUnitPolyPolygon.transform(aInverse);
+ }
+
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrPathPrimitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrPathPrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ aUnitPolyPolygon));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
index 9b9b3a838e..cf2cf35033 100644
--- a/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrrectobj.cxx
@@ -31,7 +31,6 @@
#include <svx/sdr/contact/viewcontactofsdrrectobj.hxx>
#include <svx/svdorect.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/sdrrectangleprimitive2d.hxx>
#include <svl/itemset.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
@@ -55,70 +54,48 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrRectObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const SfxItemSet& rItemSet = GetRectObj().GetMergedItemSet();
- SdrText* pSdrText = GetRectObj().getText(0);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute(
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ GetRectObj().getText(0)));
- if(pSdrText)
- {
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = GetRectObj().GetGeoRect();
+ const ::basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+ const GeoStat& rGeoStat(GetRectObj().GetGeoStat());
+
+ // fill object matrix
+ basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(),
+ rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
+ rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
- if(pAttribute)
- {
- if(pAttribute->isVisible())
- {
- // take unrotated snap rect (direct model data) for position and size
- const Rectangle& rRectangle = GetRectObj().GetGeoRect();
- const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- const GeoStat& rGeoStat(GetRectObj().GetGeoStat());
-
- // fill object matrix
- basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- aObjectRange.getWidth(), aObjectRange.getHeight(),
- rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0,
- rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0,
- aObjectRange.getMinX(), aObjectRange.getMinY()));
+ // calculate corner radius
+ sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
+ double fCornerRadiusX;
+ double fCornerRadiusY;
+ drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
- // calculate corner radius
- sal_uInt32 nCornerRadius(((SdrEckenradiusItem&)(rItemSet.Get(SDRATTR_ECKENRADIUS))).GetValue());
- double fCornerRadiusX;
- double fCornerRadiusY;
- drawinglayer::primitive2d::calculateRelativeCornerRadius(nCornerRadius, aObjectRange, fCornerRadiusX, fCornerRadiusY);
+ // #i105856# use knowledge about pickthrough from the model
+ const bool bPickThroughTransparentTextFrames(
+ GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
- // #i105856# use knowledge about pickthrough from the model
- const bool bPickThroughTransparentTextFrames(
- GetRectObj().GetModel() && GetRectObj().GetModel()->IsPickThroughTransparentTextFrames());
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
- aObjectMatrix,
- *pAttribute,
- fCornerRadiusX,
- fCornerRadiusY,
- // #i105856# use fill for HitTest when TextFrame and not PickThrough
- GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
-
- delete pAttribute;
- }
-
- if(!xRetval.hasElements())
- {
- // #i99123#
- // Object is invisible. Create a fallback primitive for HitTest
- basegfx::B2DHomMatrix aObjectMatrix;
- basegfx::B2DPolyPolygon aObjectPolyPolygon;
- GetRectObj().TRGetBaseGeometry(aObjectMatrix, aObjectPolyPolygon);
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- drawinglayer::primitive2d::createFallbackHitTestPrimitive(aObjectMatrix));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
- }
- }
-
- return xRetval;
+ // create primitive. Always create primitives to allow the decomposition of
+ // SdrRectanglePrimitive2D to create needed invisible elements for HitTest and/or BoundRect
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrRectanglePrimitive2D(
+ aObjectMatrix,
+ aAttribute,
+ fCornerRadiusX,
+ fCornerRadiusY,
+ // #i105856# use fill for HitTest when TextFrame and not PickThrough
+ GetRectObj().IsTextFrame() && !bPickThroughTransparentTextFrames));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofunocontrol.cxx b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
index 16756cd8a8..1e34db7575 100644
--- a/svx/source/sdr/contact/viewcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewcontactofunocontrol.cxx
@@ -47,6 +47,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/controlprimitive2d.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//........................................................................
namespace sdr { namespace contact {
@@ -135,35 +136,43 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfUnoControl::createViewIndependentPrimitive2DSequence() const
{
+ // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use
+ // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj)
+ // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything
+ const Rectangle& rRectangle(GetSdrUnoObj().GetGeoRect());
+ const basegfx::B2DRange aRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ // create object transform
+ basegfx::B2DHomMatrix aTransform;
+
+ aTransform.set(0, 0, aRange.getWidth());
+ aTransform.set(1, 1, aRange.getHeight());
+ aTransform.set(0, 2, aRange.getMinX());
+ aTransform.set(1, 2, aRange.getMinY());
+
Reference< XControlModel > xControlModel = GetSdrUnoObj().GetUnoControlModel();
if(xControlModel.is())
{
- // create range. Use model data directly, not getBoundRect()/getSnapRect; these will use
- // the primitive data themselves in the long run. Use SdrUnoObj's (which is a SdrRectObj)
- // call to GetGeoRect() to access SdrTextObj::aRect directly and without executing anything
- const Rectangle& rRectangle(GetSdrUnoObj().GetGeoRect());
- const basegfx::B2DRange aRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
-
- // create object transform
- basegfx::B2DHomMatrix aTransform;
- aTransform.set(0, 0, aRange.getWidth());
- aTransform.set(1, 1, aRange.getHeight());
- aTransform.set(0, 2, aRange.getMinX());
- aTransform.set(1, 2, aRange.getMinY());
-
// create control primitive WITHOUT possibly existing XControl; this would be done in
// the VOC in createPrimitive2DSequence()
- const drawinglayer::primitive2d::Primitive2DReference xRetval(new drawinglayer::primitive2d::ControlPrimitive2D(
- aTransform, xControlModel));
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ new drawinglayer::primitive2d::ControlPrimitive2D(
+ aTransform,
+ xControlModel));
return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
}
else
{
- // #i93161# This UnoControl does not yet have a xControlModel (can happen
- // during diverse creations). Without a model, create no visualisation.
- return drawinglayer::primitive2d::Primitive2DSequence();
+ // always append an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xRetval(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aTransform));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xRetval, 1);
}
}
diff --git a/svx/source/sdr/contact/viewcontactofvirtobj.cxx b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
index 5269faedfd..a6ccb2b45f 100644
--- a/svx/source/sdr/contact/viewcontactofvirtobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
@@ -33,6 +33,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <vcl/outdev.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -74,29 +75,39 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfVirtObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ // create displacement transformation if we have content
+ basegfx::B2DHomMatrix aObjectMatrix;
+ Point aAnchor(GetVirtObj().GetAnchorPos());
+
+ if(aAnchor.X() || aAnchor.Y())
+ {
+ aObjectMatrix.set(0, 2, aAnchor.X());
+ aObjectMatrix.set(1, 2, aAnchor.Y());
+ }
// use method from referenced object to get the Primitive2DSequence
- const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual(GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence());
+ const drawinglayer::primitive2d::Primitive2DSequence xSequenceVirtual(
+ GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DSequence());
if(xSequenceVirtual.hasElements())
{
- // create displacement transformation if we have content
- ::basegfx::B2DHomMatrix aObjectMatrix;
- Point aAnchor(GetVirtObj().GetAnchorPos());
-
- if(aAnchor.X() || aAnchor.Y())
- {
- aObjectMatrix.set(0, 2, aAnchor.X());
- aObjectMatrix.set(1, 2, aAnchor.Y());
- }
-
// create transform primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::TransformPrimitive2D(aObjectMatrix, xSequenceVirtual));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aObjectMatrix,
+ xSequenceVirtual));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
+ else
+ {
+ // always append an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false, aObjectMatrix));
- return xRetval;
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
}
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
index 2109789ade..0873ef1806 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
@@ -35,7 +35,6 @@
#include <svx/sdr/contact/viewobjectcontactofe3dscene.hxx>
#include <drawinglayer/primitive2d/embedded3dprimitive2d.hxx>
#include <svx/sdr/contact/viewcontactofe3dscene.hxx>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
// predeclarations
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
index 3e13d81f95..01c666b56c 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
@@ -121,17 +121,6 @@ namespace sdr
xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
}
- else
- {
- // do neither print nor PDF export the fallback visualisation
- if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
- {
- // empty group, fallback to parent method which will create the default
- // grayed frame for empty 3d scenes by using model data and
- // createViewIndependentPrimitive2DSequence::ViewContactOfE3dScene
- xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo);
- }
- }
if(bIsActiveVC)
{
diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
index f5f522608a..88e7e842f7 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
@@ -55,20 +55,6 @@ namespace sdr
{
}
- bool ViewObjectContactOfGroup::isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const
- {
- const bool bHasChildren(0 != GetViewContact().GetObjectCount());
-
- if(!bHasChildren && (GetObjectContact().isOutputToPrinter() || GetObjectContact().isOutputToRecordingMetaFile()))
- {
- // empty group uses fallback gray empty frame display. Do neither print nor PDF export it
- return false;
- }
-
- // call parent
- return ViewObjectContactOfSdrObj::isPrimitiveVisible(rDisplayInfo);
- }
-
drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo) const
{
const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
diff --git a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
index 8744fd14a8..85c4068d4f 100644
--- a/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofmasterpagedescriptor.cxx
@@ -94,15 +94,13 @@ namespace sdr
rDisplayInfo.SetProcessLayers(aPreprocessedLayers);
rDisplayInfo.SetSubContentActive(true);
- // check if there is a MasterPageBackgroundObject and if it's visible in the LayerSet
- const SdrObject* pBackgroundCandidate = rDescriptor.GetBackgroundObject();
-
- if(pBackgroundCandidate && aPreprocessedLayers.IsSet(pBackgroundCandidate->GetLayer()))
+ // check layer visibility (traditionally was member of layer 1)
+ if(aPreprocessedLayers.IsSet(1))
{
// hide PageBackground for special DrawModes; historical reasons
if(!GetObjectContact().isDrawModeGray() && !GetObjectContact().isDrawModeHighContrast())
{
- // if yes, create the default background primitive sequence
+ // if visible, create the default background primitive sequence
xRetval = static_cast< ViewContactOfMasterPageDescriptor& >(GetViewContact()).getViewIndependentPrimitive2DSequence();
}
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index b406620e08..fb497d09d3 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -40,7 +40,7 @@
#include <svx/svdpage.hxx>
#include <unoapi.hxx>
#include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -292,28 +292,19 @@ namespace sdr
else if(bCreateGrayFrame)
{
// #i105146# no content, but frame display. To make hitting the page preview objects
- // on the handout page more simple, add a HitTest fill primitive
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange));
- aOutline.transform(aPageObjectTransform);
-
- const drawinglayer::primitive2d::Primitive2DReference xHitFill(
- new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
- basegfx::B2DPolyPolygon(aOutline),
- basegfx::BColor(0.0, 0.0, 0.0)));
-
- const drawinglayer::primitive2d::Primitive2DReference xHit(
- new drawinglayer::primitive2d::HitTestPrimitive2D(
- drawinglayer::primitive2d::Primitive2DSequence(&xHitFill, 1)));
-
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xHit, 1);
+ // on the handout page more simple, add hidden fill geometry
+ const drawinglayer::primitive2d::Primitive2DReference xFrameHit(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false,
+ aPageObjectTransform));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xFrameHit, 1);
}
// add a gray outline frame, except not when printing
if(bCreateGrayFrame)
{
const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor);
- basegfx::B2DPolygon aOwnOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOwnOutline(basegfx::tools::createUnitPolygon());
aOwnOutline.transform(aPageObjectTransform);
const drawinglayer::primitive2d::Primitive2DReference xGrayFrame(
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
index 645a980a1c..182f790fe1 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrole2obj.cxx
@@ -35,11 +35,11 @@
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/svdview.hxx>
#include <drawinglayer/primitive2d/chartprimitive2d.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -203,7 +203,7 @@ namespace sdr
if(!GetObjectContact().isOutputToPrinter() && !GetObjectContact().isOutputToRecordingMetaFile())
{
// shade the representation if the object is activated outplace
- basegfx::B2DPolygon aObjectOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aObjectOutline(basegfx::tools::createUnitPolygon());
aObjectOutline.transform(aObjectTransform);
// Use a FillHatchPrimitive2D with necessary attributes
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 3b53a9c543..1e8f4c79de 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -1689,6 +1689,9 @@ namespace sdr { namespace contact {
if ( !bHadControl && rControl.is() && rControl.isVisible() )
rControl.invalidate();
+ if ( !bHadControl && rControl.is() && rControl.isVisible() )
+ rControl.invalidate();
+
// check if we already have an XControl.
if ( !xControlModel.is() || !rControl.is() )
// use the default mechanism. This will create a ControlPrimitive2D without
diff --git a/svx/source/sdr/overlay/overlayobjectcell.cxx b/svx/source/sdr/overlay/overlayobjectcell.cxx
index 2a908256f7..e7a8a3eae1 100644
--- a/svx/source/sdr/overlay/overlayobjectcell.cxx
+++ b/svx/source/sdr/overlay/overlayobjectcell.cxx
@@ -35,7 +35,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
using namespace ::basegfx;
@@ -84,12 +84,12 @@ namespace sdr
if(mePaintType == CELL_OVERLAY_TRANSPARENT)
{
// embed in 50% transparent paint
- const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aRetval,
0.5));
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1);
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparence, 1);
}
else // CELL_OVERLAY_INVERT
{
diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx
index 4b5a952548..bcf80b7c1d 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -35,7 +35,7 @@
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
@@ -141,8 +141,8 @@ namespace sdr
{
// embed all rectangles in transparent paint
const double fTransparence(mnLastTransparence / 100.0);
- const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence(
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aRetval,
fTransparence));
@@ -156,13 +156,13 @@ namespace sdr
// add both to result
aRetval.realloc(2);
- aRetval[0] = aUnifiedAlpha;
+ aRetval[0] = aUnifiedTransparence;
aRetval[1] = aSelectionOutline;
}
else
{
// just add transparent part
- aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlpha, 1);
+ aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparence, 1);
}
}
}
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index c0f9fd57d9..d18345dd0b 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -54,14 +54,11 @@
#include <svx/sdsxyitm.hxx>
#include <svx/sdshcitm.hxx>
#include <svx/sdshtitm.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <drawinglayer/attribute/sdrfillbitmapattribute.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/svdotext.hxx>
#include <drawinglayer/attribute/fillbitmapattribute.hxx>
#include <svx/sdr/attribute/sdrtextattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/xbtmpit.hxx>
#include <svl/itempool.hxx>
#include <vcl/svapp.hxx>
@@ -69,10 +66,22 @@
#include <svx/svx3ditems.hxx>
#include <com/sun/star/drawing/ProjectionMode.hpp>
#include <com/sun/star/drawing/ShadeMode.hpp>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
#include <drawinglayer/attribute/sdrallattribute3d.hxx>
#include <svx/rectenum.hxx>
#include <svx/sdtfchim.hxx>
+#include <svx/svdoutl.hxx>
+#include <svx/svdmodel.hxx>
+#include <editeng/editstat.hxx>
+#include <drawinglayer/attribute/fillhatchattribute.hxx>
+#include <drawinglayer/attribute/fillgradientattribute.hxx>
+#include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
+#include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
+#include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
+#include <drawinglayer/attribute/sdrsceneattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
+#include <svx/sdr/attribute/sdrfilltextattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -214,9 +223,8 @@ namespace drawinglayer
{
namespace primitive2d
{
- attribute::SdrLineAttribute* createNewSdrLineAttribute(const SfxItemSet& rSet)
+ attribute::SdrLineAttribute createNewSdrLineAttribute(const SfxItemSet& rSet)
{
- attribute::SdrLineAttribute* pRetval(0L);
const XLineStyle eStyle(((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue());
if(XLINE_NONE != eStyle)
@@ -246,7 +254,7 @@ namespace drawinglayer
}
}
- pRetval = new attribute::SdrLineAttribute(
+ return attribute::SdrLineAttribute(
XLineJointtoB2DLineJoin(eJoint),
(double)nWidth,
(double)nTransparence * 0.01,
@@ -256,12 +264,13 @@ namespace drawinglayer
}
}
- return pRetval;
+ return attribute::SdrLineAttribute();
}
- attribute::SdrLineStartEndAttribute* createNewSdrLineStartEndAttribute(const SfxItemSet& rSet, double fWidth)
+ attribute::SdrLineStartEndAttribute createNewSdrLineStartEndAttribute(
+ const SfxItemSet& rSet,
+ double fWidth)
{
- attribute::SdrLineStartEndAttribute* pRetval(0L);
const sal_Int32 nTempStartWidth(((const XLineStartWidthItem&)(rSet.Get(XATTR_LINESTARTWIDTH))).GetValue());
const sal_Int32 nTempEndWidth(((const XLineEndWidthItem&)(rSet.Get(XATTR_LINEENDWIDTH))).GetValue());
basegfx::B2DPolyPolygon aStartPolyPolygon;
@@ -321,15 +330,16 @@ namespace drawinglayer
if(bStartActive || bEndActive)
{
- pRetval = new attribute::SdrLineStartEndAttribute(aStartPolyPolygon, aEndPolyPolygon, fStartWidth, fEndWidth, bStartActive, bEndActive, bStartCentered, bEndCentered);
+ return attribute::SdrLineStartEndAttribute(
+ aStartPolyPolygon, aEndPolyPolygon, fStartWidth, fEndWidth,
+ bStartActive, bEndActive, bStartCentered, bEndCentered);
}
- return pRetval;
+ return attribute::SdrLineStartEndAttribute();
}
- attribute::SdrShadowAttribute* createNewSdrShadowAttribute(const SfxItemSet& rSet)
+ attribute::SdrShadowAttribute createNewSdrShadowAttribute(const SfxItemSet& rSet)
{
- attribute::SdrShadowAttribute* pRetval(0L);
const bool bShadow(((SdrShadowItem&)rSet.Get(SDRATTR_SHADOW)).GetValue());
if(bShadow)
@@ -367,16 +377,15 @@ namespace drawinglayer
(double)((SdrShadowYDistItem&)(rSet.Get(SDRATTR_SHADOWYDIST))).GetValue());
const Color aColor(((SdrShadowColorItem&)(rSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue());
- pRetval = new attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor());
+ return attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor());
}
}
- return pRetval;
+ return attribute::SdrShadowAttribute();
}
- attribute::SdrFillAttribute* createNewSdrFillAttribute(const SfxItemSet& rSet)
+ attribute::SdrFillAttribute createNewSdrFillAttribute(const SfxItemSet& rSet)
{
- attribute::SdrFillAttribute* pRetval(0L);
const XFillStyle eStyle(((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue());
if(XFILL_NONE != eStyle)
@@ -391,9 +400,9 @@ namespace drawinglayer
if(100 != nTransparence)
{
const Color aColor(((const XFillColorItem&)(rSet.Get(XATTR_FILLCOLOR))).GetColorValue());
- attribute::FillGradientAttribute* pGradient(0L);
- attribute::FillHatchAttribute* pHatch(0L);
- attribute::SdrFillBitmapAttribute* pBitmap(0L);
+ attribute::FillGradientAttribute aGradient;
+ attribute::FillHatchAttribute aHatch;
+ attribute::SdrFillBitmapAttribute aBitmap;
switch(eStyle)
{
@@ -405,10 +414,10 @@ namespace drawinglayer
}
case XFILL_GRADIENT :
{
- XGradient aGradient(((XFillGradientItem&)(rSet.Get(XATTR_FILLGRADIENT))).GetGradientValue());
+ XGradient aXGradient(((XFillGradientItem&)(rSet.Get(XATTR_FILLGRADIENT))).GetGradientValue());
- const Color aStartColor(aGradient.GetStartColor());
- const sal_uInt16 nStartIntens(aGradient.GetStartIntens());
+ const Color aStartColor(aXGradient.GetStartColor());
+ const sal_uInt16 nStartIntens(aXGradient.GetStartIntens());
basegfx::BColor aStart(aStartColor.getBColor());
if(nStartIntens != 100)
@@ -417,8 +426,8 @@ namespace drawinglayer
aStart = interpolate(aBlack, aStart, (double)nStartIntens * 0.01);
}
- const Color aEndColor(aGradient.GetEndColor());
- const sal_uInt16 nEndIntens(aGradient.GetEndIntens());
+ const Color aEndColor(aXGradient.GetEndColor());
+ const sal_uInt16 nEndIntens(aXGradient.GetEndIntens());
basegfx::BColor aEnd(aEndColor.getBColor());
if(nEndIntens != 100)
@@ -427,12 +436,12 @@ namespace drawinglayer
aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01);
}
- pGradient = new attribute::FillGradientAttribute(
- XGradientStyleToGradientStyle(aGradient.GetGradientStyle()),
- (double)aGradient.GetBorder() * 0.01,
- (double)aGradient.GetXOffset() * 0.01,
- (double)aGradient.GetYOffset() * 0.01,
- (double)aGradient.GetAngle() * F_PI1800,
+ aGradient = attribute::FillGradientAttribute(
+ XGradientStyleToGradientStyle(aXGradient.GetGradientStyle()),
+ (double)aXGradient.GetBorder() * 0.01,
+ (double)aXGradient.GetXOffset() * 0.01,
+ (double)aXGradient.GetYOffset() * 0.01,
+ (double)aXGradient.GetAngle() * F_PI1800,
aStart,
aEnd,
((const XGradientStepCountItem&)rSet.Get(XATTR_GRADIENTSTEPCOUNT)).GetValue());
@@ -444,7 +453,7 @@ namespace drawinglayer
const XHatch& rHatch(((XFillHatchItem&)(rSet.Get(XATTR_FILLHATCH))).GetHatchValue());
const Color aColorB(rHatch.GetColor());
- pHatch = new attribute::FillHatchAttribute(
+ aHatch = attribute::FillHatchAttribute(
XHatchStyleToHatchStyle(rHatch.GetHatchStyle()),
(double)rHatch.GetDistance(),
(double)rHatch.GetAngle() * F_PI1800,
@@ -455,23 +464,25 @@ namespace drawinglayer
}
case XFILL_BITMAP :
{
- pBitmap = createNewSdrFillBitmapAttribute(rSet);
+ aBitmap = createNewSdrFillBitmapAttribute(rSet);
break;
}
}
- pRetval = new attribute::SdrFillAttribute(
+ return attribute::SdrFillAttribute(
(double)nTransparence * 0.01,
aColor.getBColor(),
- pGradient, pHatch, pBitmap);
+ aGradient,
+ aHatch,
+ aBitmap);
}
}
- return pRetval;
+ return attribute::SdrFillAttribute();
}
// #i101508# Support handing over given text-to-border distances
- attribute::SdrTextAttribute* createNewSdrTextAttribute(
+ attribute::SdrTextAttribute createNewSdrTextAttribute(
const SfxItemSet& rSet,
const SdrText& rText,
const sal_Int32* pLeft,
@@ -479,7 +490,6 @@ namespace drawinglayer
const sal_Int32* pRight,
const sal_Int32* pLower)
{
- attribute::SdrTextAttribute* pRetval(0);
const SdrTextObj& rTextObj = rText.GetObject();
if(rText.GetOutlinerParaObject() && rText.GetModel())
@@ -519,7 +529,11 @@ namespace drawinglayer
const SdrFitToSizeType eFit(rTextObj.GetFitToSize());
const SdrTextAniKind eAniKind(rTextObj.GetTextAniKind());
- pRetval = new attribute::SdrTextAttribute(
+ // #i107346#
+ const SdrOutliner& rDrawTextOutliner = rText.GetModel()->GetDrawOutliner(&rTextObj);
+ const bool bWrongSpell(rDrawTextOutliner.GetControlWord() & EE_CNTRL_ONLINESPELLING);
+
+ return attribute::SdrTextAttribute(
rText,
aOutlinerParaObject,
((const XFormTextStyleItem&)rSet.Get(XATTR_FORMTXTSTYLE)).GetValue(),
@@ -535,18 +549,19 @@ namespace drawinglayer
SDRTEXTANI_BLINK == eAniKind,
SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind,
bInEditMode,
- ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
+ ((const SdrTextFixedCellHeightItem&)rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue(),
+ bWrongSpell);
}
- return pRetval;
+ return attribute::SdrTextAttribute();
}
- attribute::FillGradientAttribute* createNewTransparenceGradientAttribute(const SfxItemSet& rSet)
+ attribute::FillGradientAttribute createNewTransparenceGradientAttribute(const SfxItemSet& rSet)
{
- attribute::FillGradientAttribute* pRetval = 0L;
const SfxPoolItem* pGradientItem;
- if(SFX_ITEM_SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem) && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled())
+ if(SFX_ITEM_SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, TRUE, &pGradientItem)
+ && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled())
{
// test if float transparence is completely transparent
const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue();
@@ -559,7 +574,7 @@ namespace drawinglayer
const double fStartLum(nStartLuminance / 255.0);
const double fEndLum(nEndLuminance / 255.0);
- pRetval = new attribute::FillGradientAttribute(
+ return attribute::FillGradientAttribute(
XGradientStyleToGradientStyle(rGradient.GetGradientStyle()),
(double)rGradient.GetBorder() * 0.01,
(double)rGradient.GetXOffset() * 0.01,
@@ -571,12 +586,11 @@ namespace drawinglayer
}
}
- return pRetval;
+ return attribute::FillGradientAttribute();
}
- attribute::SdrFillBitmapAttribute* createNewSdrFillBitmapAttribute(const SfxItemSet& rSet)
+ attribute::SdrFillBitmapAttribute createNewSdrFillBitmapAttribute(const SfxItemSet& rSet)
{
- attribute::SdrFillBitmapAttribute* pRetval(0L);
Bitmap aBitmap((((const XFillBitmapItem&)(rSet.Get(XATTR_FILLBITMAP))).GetBitmapValue()).GetBitmap());
// make sure it's not empty, use default instead
@@ -623,7 +637,7 @@ namespace drawinglayer
(double)((const SfxUInt16Item&) (rSet.Get(XATTR_FILLBMP_POSOFFSETX))).GetValue(),
(double)((const SfxUInt16Item&) (rSet.Get(XATTR_FILLBMP_POSOFFSETY))).GetValue());
- pRetval = new attribute::SdrFillBitmapAttribute(
+ return attribute::SdrFillBitmapAttribute(
aBitmap,
aSize,
aOffset,
@@ -632,252 +646,174 @@ namespace drawinglayer
((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_TILE))).GetValue(),
((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_STRETCH))).GetValue(),
((const SfxBoolItem&) (rSet.Get(XATTR_FILLBMP_SIZELOG))).GetValue());
-
- return pRetval;
}
- attribute::SdrShadowTextAttribute* createNewSdrShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText, bool bSuppressText)
+ attribute::SdrShadowTextAttribute createNewSdrShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText,
+ bool bSuppressText)
{
- attribute::SdrShadowTextAttribute* pRetval(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrTextAttribute aText;
// #i98072# added option to suppress text
// look for text first
- if(!bSuppressText)
+ if(!bSuppressText && pText)
{
- pText = createNewSdrTextAttribute(rSet, rText);
+ aText = createNewSdrTextAttribute(rSet, *pText);
}
// try shadow
- pShadow = createNewSdrShadowAttribute(rSet);
-
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
-
- if(pText || pShadow)
- {
- pRetval = new attribute::SdrShadowTextAttribute(pShadow, pText);
- }
+ const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet));
- return pRetval;
+ return attribute::SdrShadowTextAttribute(aShadow, aText);
}
- attribute::SdrLineShadowTextAttribute* createNewSdrLineShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText)
+ attribute::SdrLineShadowTextAttribute createNewSdrLineShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText)
{
- attribute::SdrLineShadowTextAttribute* pRetval(0L);
- attribute::SdrLineAttribute* pLine(0L);
- attribute::SdrLineStartEndAttribute* pLineStartEnd(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrLineAttribute aLine;
+ attribute::SdrLineStartEndAttribute aLineStartEnd;
+ attribute::SdrTextAttribute aText;
bool bFontworkHideContour(false);
// look for text first
- pText = createNewSdrTextAttribute(rSet, rText);
-
- // when object has text and text is fontwork and hide contour is set for fontwork, force
- // line and fill style to empty
- if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
+ if(pText)
{
- bFontworkHideContour = true;
+ aText = createNewSdrTextAttribute(rSet, *pText);
+
+ // when object has text and text is fontwork and hide contour is set for fontwork, force
+ // line and fill style to empty
+ if(!aText.isDefault()
+ && !aText.getSdrFormTextAttribute().isDefault()
+ && aText.isHideContour())
+ {
+ bFontworkHideContour = true;
+ }
}
// try line style
if(!bFontworkHideContour)
{
- pLine = createNewSdrLineAttribute(rSet);
+ aLine = createNewSdrLineAttribute(rSet);
- if(pLine && !pLine->isVisible())
- {
- delete pLine;
- pLine = 0L;
- }
-
- if(pLine)
+ if(!aLine.isDefault())
{
// try LineStartEnd
- pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0L;
- }
+ aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth());
}
}
- // try shadow
- if(pLine || pText)
+ if(!aLine.isDefault() || !aText.isDefault())
{
- pShadow = createNewSdrShadowAttribute(rSet);
+ // try shadow
+ const attribute::SdrShadowAttribute aShadow(createNewSdrShadowAttribute(rSet));
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
+ return attribute::SdrLineShadowTextAttribute(aLine, aLineStartEnd, aShadow, aText);
}
- if(pLine || pText)
- {
- pRetval = new attribute::SdrLineShadowTextAttribute(pLine, pLineStartEnd, pShadow, pText);
- }
-
- return pRetval;
+ return attribute::SdrLineShadowTextAttribute();
}
- attribute::SdrLineFillShadowTextAttribute* createNewSdrLineFillShadowTextAttribute(const SfxItemSet& rSet, const SdrText& rText)
+ attribute::SdrLineFillShadowTextAttribute createNewSdrLineFillShadowTextAttribute(
+ const SfxItemSet& rSet,
+ const SdrText* pText)
{
- attribute::SdrLineFillShadowTextAttribute* pRetval(0L);
- attribute::SdrLineAttribute* pLine(0L);
- attribute::SdrFillAttribute* pFill(0L);
- attribute::SdrLineStartEndAttribute* pLineStartEnd(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::FillGradientAttribute* pFillFloatTransGradient(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrLineAttribute aLine;
+ attribute::SdrFillAttribute aFill;
+ attribute::SdrLineStartEndAttribute aLineStartEnd;
+ attribute::SdrShadowAttribute aShadow;
+ attribute::FillGradientAttribute aFillFloatTransGradient;
+ attribute::SdrTextAttribute aText;
bool bFontworkHideContour(false);
// look for text first
- pText = createNewSdrTextAttribute(rSet, rText);
-
- // when object has text and text is fontwork and hide contour is set for fontwork, force
- // line and fill style to empty
- if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
+ if(pText)
{
- bFontworkHideContour = true;
- }
-
- // try line style
- if(!bFontworkHideContour)
- {
- pLine = createNewSdrLineAttribute(rSet);
-
- if(pLine && !pLine->isVisible())
- {
- delete pLine;
- pLine = 0L;
- }
+ aText = createNewSdrTextAttribute(rSet, *pText);
- if(pLine)
+ // when object has text and text is fontwork and hide contour is set for fontwork, force
+ // line and fill style to empty
+ if(!aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour())
{
- // try LineStartEnd
- pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0L;
- }
+ bFontworkHideContour = true;
}
}
- // try fill style
if(!bFontworkHideContour)
{
- pFill = createNewSdrFillAttribute(rSet);
+ // try line style
+ aLine = createNewSdrLineAttribute(rSet);
- if(pFill && !pFill->isVisible())
+ if(!aLine.isDefault())
{
- delete pFill;
- pFill = 0L;
+ // try LineStartEnd
+ aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth());
}
- if(pFill)
+ // try fill style
+ aFill = createNewSdrFillAttribute(rSet);
+
+ if(!aFill.isDefault())
{
// try fillfloattransparence
- pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
+ aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
}
}
- // try shadow
- if(pLine || pFill || pText)
+ if(!aLine.isDefault() || !aFill.isDefault() || !aText.isDefault())
{
- pShadow = createNewSdrShadowAttribute(rSet);
+ // try shadow
+ aShadow = createNewSdrShadowAttribute(rSet);
- if(pShadow && !pShadow->isVisible())
- {
- delete pShadow;
- pShadow = 0L;
- }
+ return attribute::SdrLineFillShadowTextAttribute(
+ aLine, aFill, aLineStartEnd, aShadow, aFillFloatTransGradient, aText);
}
- if(pLine || pFill || pText)
- {
- pRetval = new attribute::SdrLineFillShadowTextAttribute(pLine, pFill, pLineStartEnd, pShadow, pFillFloatTransGradient, pText);
- }
-
- return pRetval;
+ return attribute::SdrLineFillShadowTextAttribute();
}
- attribute::SdrLineFillShadowAttribute* createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill)
+ attribute::SdrLineFillShadowAttribute3D createNewSdrLineFillShadowAttribute(const SfxItemSet& rSet, bool bSuppressFill)
{
- attribute::SdrLineFillShadowAttribute* pRetval(0L);
- attribute::SdrLineAttribute* pLine(0L);
- attribute::SdrFillAttribute* pFill(0L);
- attribute::SdrLineStartEndAttribute* pLineStartEnd(0L);
- attribute::SdrShadowAttribute* pShadow(0L);
- attribute::FillGradientAttribute* pFillFloatTransGradient(0L);
+ attribute::SdrFillAttribute aFill;
+ attribute::SdrLineStartEndAttribute aLineStartEnd;
+ attribute::SdrShadowAttribute aShadow;
+ attribute::FillGradientAttribute aFillFloatTransGradient;
// try line style
- pLine = createNewSdrLineAttribute(rSet);
+ const attribute::SdrLineAttribute aLine(createNewSdrLineAttribute(rSet));
- if(pLine && !pLine->isVisible())
- {
- delete pLine;
- pLine = 0L;
- }
-
- if(pLine)
+ if(!aLine.isDefault())
{
// try LineStartEnd
- pLineStartEnd = createNewSdrLineStartEndAttribute(rSet, pLine->getWidth());
-
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0L;
- }
+ aLineStartEnd = createNewSdrLineStartEndAttribute(rSet, aLine.getWidth());
}
// try fill style
- pFill = bSuppressFill ? 0 : createNewSdrFillAttribute(rSet);
-
- if(pFill && !pFill->isVisible())
+ if(!bSuppressFill)
{
- delete pFill;
- pFill = 0L;
- }
-
- if(pFill)
- {
- // try fillfloattransparence
- pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
- }
+ aFill = createNewSdrFillAttribute(rSet);
- // try shadow
- if(pLine || pFill)
- {
- pShadow = createNewSdrShadowAttribute(rSet);
-
- if(pShadow && !pShadow->isVisible())
+ if(!aFill.isDefault())
{
- delete pShadow;
- pShadow = 0L;
+ // try fillfloattransparence
+ aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
}
}
- if(pLine || pFill)
+ if(!aLine.isDefault() || !aFill.isDefault())
{
- pRetval = new attribute::SdrLineFillShadowAttribute(pLine, pFill, pLineStartEnd, pShadow, pFillFloatTransGradient);
+ // try shadow
+ aShadow = createNewSdrShadowAttribute(rSet);
+
+ return attribute::SdrLineFillShadowAttribute3D(
+ aLine, aFill, aLineStartEnd, aShadow, aFillFloatTransGradient);
}
- return pRetval;
+ return attribute::SdrLineFillShadowAttribute3D();
}
- attribute::SdrSceneAttribute* createNewSdrSceneAttribute(const SfxItemSet& rSet)
+ attribute::SdrSceneAttribute createNewSdrSceneAttribute(const SfxItemSet& rSet)
{
// get perspective
::com::sun::star::drawing::ProjectionMode aProjectionMode(::com::sun::star::drawing::ProjectionMode_PARALLEL);
@@ -914,10 +850,10 @@ namespace drawinglayer
// get two sided lighting
const bool bTwoSidedLighting(((const Svx3DTwoSidedLightingItem&)rSet.Get(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING)).GetValue());
- return new attribute::SdrSceneAttribute(fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting);
+ return attribute::SdrSceneAttribute(fDistance, fShadowSlant, aProjectionMode, aShadeMode, bTwoSidedLighting);
}
- attribute::SdrLightingAttribute* createNewSdrLightingAttribute(const SfxItemSet& rSet)
+ attribute::SdrLightingAttribute createNewSdrLightingAttribute(const SfxItemSet& rSet)
{
// extract lights from given SfxItemSet (from scene)
::std::vector< attribute::Sdr3DLightAttribute > aLightVector;
@@ -982,7 +918,7 @@ namespace drawinglayer
const Color aAmbientValue(((const Svx3DAmbientcolorItem&)rSet.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue());
const basegfx::BColor aAmbientLight(aAmbientValue.getBColor());
- return new attribute::SdrLightingAttribute(aAmbientLight, aLightVector);
+ return attribute::SdrLightingAttribute(aAmbientLight, aLightVector);
}
void calculateRelativeCornerRadius(sal_Int32 nRadius, const basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY)
@@ -1039,57 +975,50 @@ namespace drawinglayer
}
// #i101508# Support handing over given text-to-border distances
- attribute::SdrFillTextAttribute* createNewSdrFillTextAttribute(
+ attribute::SdrFillTextAttribute createNewSdrFillTextAttribute(
const SfxItemSet& rSet,
- const SdrText* pSdrText,
+ const SdrText* pText,
const sal_Int32* pLeft,
const sal_Int32* pUpper,
const sal_Int32* pRight,
const sal_Int32* pLower)
{
- attribute::SdrFillTextAttribute* pRetval(0L);
- attribute::SdrFillAttribute* pFill(0L);
- attribute::FillGradientAttribute* pFillFloatTransGradient(0L);
- attribute::SdrTextAttribute* pText(0L);
+ attribute::SdrFillAttribute aFill;
+ attribute::FillGradientAttribute aFillFloatTransGradient;
+ attribute::SdrTextAttribute aText;
bool bFontworkHideContour(false);
// look for text first
- if(pSdrText)
+ if(pText)
{
- pText = createNewSdrTextAttribute(rSet, *pSdrText, pLeft, pUpper, pRight, pLower);
- }
+ aText = createNewSdrTextAttribute(rSet, *pText, pLeft, pUpper, pRight, pLower);
- // when object has text and text is fontwork and hide contour is set for fontwork, force
- // fill style to empty
- if(pText && pText->getSdrFormTextAttribute() && pText->isHideContour())
- {
- bFontworkHideContour = true;
+ // when object has text and text is fontwork and hide contour is set for fontwork, force
+ // fill style to empty
+ if(!aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour())
+ {
+ bFontworkHideContour = true;
+ }
}
- // try fill style
if(!bFontworkHideContour)
{
- pFill = createNewSdrFillAttribute(rSet);
-
- if(pFill && !pFill->isVisible())
- {
- delete pFill;
- pFill = 0L;
- }
+ // try fill style
+ aFill = createNewSdrFillAttribute(rSet);
- if(pFill)
+ if(!aFill.isDefault())
{
// try fillfloattransparence
- pFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
+ aFillFloatTransGradient = createNewTransparenceGradientAttribute(rSet);
}
}
- if(pFill || pText)
+ if(!aFill.isDefault() || !aText.isDefault())
{
- pRetval = new attribute::SdrFillTextAttribute(pFill, pFillFloatTransGradient, pText);
+ return attribute::SdrFillTextAttribute(aFill, aFillFloatTransGradient, aText);
}
- return pRetval;
+ return attribute::SdrFillTextAttribute();
}
} // end of namespace primitive2d
diff --git a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
index f7c32f5040..b3ee43b883 100644
--- a/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx
@@ -31,7 +31,7 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -46,7 +46,6 @@ namespace drawinglayer
Primitive2DSequence SdrCaptionPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
- Primitive2DSequence aHitTestContent;
// create unit outline polygon
const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
@@ -55,68 +54,66 @@ namespace drawinglayer
getCornerRadiusY()));
// add fill
- if(getSdrLFSTAttribute().getFill())
+ if(getSdrLFSTAttribute().getFill().isDefault())
{
+ // create invisible fill for HitTest
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline),
- getTransform(),
- *getSdrLFSTAttribute().getFill(),
- getSdrLFSTAttribute().getFillFloatTransGradient()));
+ createHiddenGeometryPrimitives2D(
+ true,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
else
{
- // if no fill, create one for HitTest and BoundRect fallback
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolyPolygonFillPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
- attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
+ getSdrLFSTAttribute().getFill(),
getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
+ // create invisible line for HitTest/BoundRect
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolygonLinePrimitive(
- aUnitOutline,
- getTransform(),
- *getSdrLFSTAttribute().getLine()));
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolygonLinePrimitive(
- getTail(),
- getTransform(),
- *getSdrLFSTAttribute().getLine(),
- getSdrLFSTAttribute().getLineStartEnd()));
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(getTail()),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect. It
- // is sufficient to use the tail; the body is already ensured with fill creation
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolygonLinePrimitive(
- getTail(),
+ aUnitOutline,
getTransform(),
- attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
- }
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
- // add HitTest and BoundRect helper geometry (if exists)
- if(aHitTestContent.hasElements())
- {
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
+ createPolygonLinePrimitive(
+ getTail(),
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createTextPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
- *getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getText(),
getSdrLFSTAttribute().getLine(),
false,
false,
@@ -124,9 +121,9 @@ namespace drawinglayer
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
index e4e0c68d6d..2d0148744b 100644
--- a/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx
@@ -31,7 +31,8 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -47,34 +48,45 @@ namespace drawinglayer
{
Primitive2DSequence aRetval;
- // prepare unit transform
- ::basegfx::B2DHomMatrix aEmptyMatrix;
-
// add line
- if(getSdrLSTAttribute().getLine())
+ if(getSdrLSTAttribute().getLine().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, *getSdrLSTAttribute().getLine(), getSdrLSTAttribute().getLineStartEnd()));
+ // create invisible line for HitTest/BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(getUnitPolygon())));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(getUnitPolygon(), aEmptyMatrix, aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ getUnitPolygon(),
+ basegfx::B2DHomMatrix(),
+ getSdrLSTAttribute().getLine(),
+ getSdrLSTAttribute().getLineStartEnd()));
}
// add text
- if(getSdrLSTAttribute().getText())
+ if(!getSdrLSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(getUnitPolygon()), aEmptyMatrix, *getSdrLSTAttribute().getText(), getSdrLSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(getUnitPolygon()),
+ basegfx::B2DHomMatrix(),
+ getSdrLSTAttribute().getText(),
+ getSdrLSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLSTAttribute().getShadow())
+ if(!getSdrLSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index 4359d8b7fe..d3aab33c98 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -32,6 +32,7 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -48,21 +49,23 @@ namespace drawinglayer
Primitive2DSequence aRetval(getSubPrimitives());
// add text
- if(getSdrSTAttribute().getText())
+ if(!getSdrSTAttribute().getText().isDefault())
{
- const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline),
- getTextBox(),
- *getSdrSTAttribute().getText(),
- 0,
- false,
- getWordWrap(),
- isForceTextClipToTextRange()));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTextBox(),
+ getSdrSTAttribute().getText(),
+ attribute::SdrLineAttribute(),
+ false,
+ getWordWrap(),
+ isForceTextClipToTextRange()));
}
// add shadow
- if(aRetval.hasElements() && getSdrSTAttribute().getShadow())
+ if(aRetval.hasElements() && !getSdrSTAttribute().getShadow().isDefault())
{
// #i105323# add generic shadow only for 2D shapes. For
// 3D shapes shadow will be set at the individual created
@@ -76,7 +79,7 @@ namespace drawinglayer
// shadow will be correct (using ColorModifierStack), but expensive.
if(!get3DShape())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(aRetval, getSdrSTAttribute().getShadow());
}
}
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index bc8d928f7b..bccf3afc99 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -27,12 +27,10 @@
#include "precompiled_svx.hxx"
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
-#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
#include <drawinglayer/attribute/strokeattribute.hxx>
@@ -51,6 +49,10 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/primitive2d/texthierarchyprimitive2d.hxx>
+#include <drawinglayer/attribute/sdrfillattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -66,25 +68,25 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrFillAttribute& rFill,
- const attribute::FillGradientAttribute* pFillGradient)
+ const attribute::FillGradientAttribute& rFillGradient)
{
// prepare fully scaled polygon
basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
aScaledPolyPolygon.transform(rObjectTransform);
BasePrimitive2D* pNewFillPrimitive = 0;
- if(rFill.isGradient())
+ if(!rFill.getGradient().isDefault())
{
- pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, *rFill.getGradient());
+ pNewFillPrimitive = new PolyPolygonGradientPrimitive2D(aScaledPolyPolygon, rFill.getGradient());
}
- else if(rFill.isHatch())
+ else if(!rFill.getHatch().isDefault())
{
- pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), *rFill.getHatch());
+ pNewFillPrimitive = new PolyPolygonHatchPrimitive2D(aScaledPolyPolygon, rFill.getColor(), rFill.getHatch());
}
- else if(rFill.isBitmap())
+ else if(!rFill.getBitmap().isDefault())
{
const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
- pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap()->getFillBitmapAttribute(aRange));
+ pNewFillPrimitive = new PolyPolygonBitmapPrimitive2D(aScaledPolyPolygon, rFill.getBitmap().getFillBitmapAttribute(aRange));
}
else
{
@@ -96,9 +98,9 @@ namespace drawinglayer
// create simpleTransparencePrimitive, add created fill primitive
const Primitive2DReference xRefA(pNewFillPrimitive);
const Primitive2DSequence aContent(&xRefA, 1L);
- return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rFill.getTransparence()));
+ return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rFill.getTransparence()));
}
- else if(pFillGradient)
+ else if(!rFillGradient.isDefault())
{
// create sequence with created fill primitive
const Primitive2DReference xRefA(pNewFillPrimitive);
@@ -107,11 +109,11 @@ namespace drawinglayer
// create FillGradientPrimitive2D for transparence and add to new sequence
// fillGradientPrimitive is enough here (compared to PolyPolygonGradientPrimitive2D) since float transparence will be masked anyways
const basegfx::B2DRange aRange(basegfx::tools::getRange(aScaledPolyPolygon));
- const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, *pFillGradient));
+ const Primitive2DReference xRefB(new FillGradientPrimitive2D(aRange, rFillGradient));
const Primitive2DSequence aAlpha(&xRefB, 1L);
- // create AlphaPrimitive2D using alpha and content
- return Primitive2DReference(new AlphaPrimitive2D(aContent, aAlpha));
+ // create TransparencePrimitive2D using alpha and content
+ return Primitive2DReference(new TransparencePrimitive2D(aContent, aAlpha));
}
else
{
@@ -124,7 +126,7 @@ namespace drawinglayer
const basegfx::B2DPolygon& rUnitPolygon,
const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrLineAttribute& rLine,
- const attribute::SdrLineStartEndAttribute* pStroke)
+ const attribute::SdrLineStartEndAttribute& rStroke)
{
// prepare fully scaled polygon
basegfx::B2DPolygon aScaledPolygon(rUnitPolygon);
@@ -135,10 +137,10 @@ namespace drawinglayer
const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen());
BasePrimitive2D* pNewLinePrimitive = 0L;
- if(!rUnitPolygon.isClosed() && pStroke)
+ if(!rUnitPolygon.isClosed() && !rStroke.isDefault())
{
- attribute::LineStartEndAttribute aStart(pStroke->getStartWidth(), pStroke->getStartPolyPolygon(), pStroke->isStartCentered());
- attribute::LineStartEndAttribute aEnd(pStroke->getEndWidth(), pStroke->getEndPolyPolygon(), pStroke->isEndCentered());
+ attribute::LineStartEndAttribute aStart(rStroke.getStartWidth(), rStroke.getStartPolyPolygon(), rStroke.isStartCentered());
+ attribute::LineStartEndAttribute aEnd(rStroke.getEndWidth(), rStroke.getEndPolyPolygon(), rStroke.isEndCentered());
// create data
pNewLinePrimitive = new PolygonStrokeArrowPrimitive2D(aScaledPolygon, aLineAttribute, aStrokeAttribute, aStart, aEnd);
@@ -154,7 +156,7 @@ namespace drawinglayer
// create simpleTransparencePrimitive, add created fill primitive
const Primitive2DReference xRefA(pNewLinePrimitive);
const Primitive2DSequence aContent(&xRefA, 1L);
- return Primitive2DReference(new UnifiedAlphaPrimitive2D(aContent, rLine.getTransparence()));
+ return Primitive2DReference(new UnifiedTransparencePrimitive2D(aContent, rLine.getTransparence()));
}
else
{
@@ -167,7 +169,7 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon& rUnitPolyPolygon,
const basegfx::B2DHomMatrix& rObjectTransform,
const attribute::SdrTextAttribute& rText,
- const attribute::SdrLineAttribute* pStroke,
+ const attribute::SdrLineAttribute& rStroke,
bool bCellText,
bool bWordWrap,
bool bClipOnBounds)
@@ -178,7 +180,7 @@ namespace drawinglayer
if(rText.isContour())
{
// contour text
- if(pStroke && 0.0 != pStroke->getWidth())
+ if(!rStroke.isDefault() && 0.0 != rStroke.getWidth())
{
// take line width into account and shrink contour polygon accordingly
// decompose to get scale
@@ -193,7 +195,7 @@ namespace drawinglayer
fabs(aScale.getX()), fabs(aScale.getY())));
// grow the polygon. To shrink, use negative value (half width)
- aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(pStroke->getWidth() * 0.5));
+ aScaledUnitPolyPolygon = basegfx::tools::growInNormalDirection(aScaledUnitPolyPolygon, -(rStroke.getWidth() * 0.5));
// scale back to unit polygon
aScaledUnitPolyPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(
@@ -217,7 +219,7 @@ namespace drawinglayer
rObjectTransform);
}
}
- else if(rText.getSdrFormTextAttribute())
+ else if(!rText.getSdrFormTextAttribute().isDefault())
{
// text on path, use scaled polygon
basegfx::B2DPolyPolygon aScaledPolyPolygon(rUnitPolyPolygon);
@@ -226,7 +228,7 @@ namespace drawinglayer
&rText.getSdrText(),
rText.getOutlinerParaObject(),
aScaledPolyPolygon,
- *rText.getSdrFormTextAttribute());
+ rText.getSdrFormTextAttribute());
}
else
{
@@ -323,7 +325,7 @@ namespace drawinglayer
if(rText.isScroll())
{
// suppress scroll when FontWork
- if(!rText.getSdrFormTextAttribute())
+ if(rText.getSdrFormTextAttribute().isDefault())
{
// get scroll direction
const SdrTextAniDirection eDirection(rText.getSdrText().GetObject().GetTextAniDirection());
@@ -464,7 +466,7 @@ namespace drawinglayer
const Primitive2DSequence aTempContent(&aRetval[0], 1);
aRetval[0] = Primitive2DReference(
- new UnifiedAlphaPrimitive2D(
+ new UnifiedTransparencePrimitive2D(
aTempContent,
rShadow.getTransparence()));
}
diff --git a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
index 0ad7c86810..8c78c51ea5 100644
--- a/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx
@@ -32,10 +32,9 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <basegfx/color/bcolor.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -55,52 +54,73 @@ namespace drawinglayer
// Do use createPolygonFromUnitCircle, but let create from first quadrant to mimic old geometry creation.
// This is needed to have the same look when stroke is used since the polygon start point defines the
// stroke start, too.
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitCircle(1));
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitCircle(1));
// scale and move UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1)
- const basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
+ const basegfx::B2DHomMatrix aUnitCorrectionMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
// apply to the geometry
aUnitOutline.transform(aUnitCorrectionMatrix);
// add fill
- if(getSdrLFSTAttribute().getFill())
+ if(!getSdrLFSTAttribute().getFill().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ // create invisible line for HitTest/BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrEllipsePrimitive2D::SdrEllipsePrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute)
: BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
@@ -138,7 +158,7 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- ::basegfx::B2DPolygon aUnitOutline(::basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle));
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromUnitEllipseSegment(mfStartAngle, mfEndAngle));
if(mbCloseSegment)
{
@@ -146,57 +166,77 @@ namespace drawinglayer
{
// for compatibility, insert the center point at polygon start to get the same
// line stroking pattern as the old painting mechanisms.
- aUnitOutline.insert(0L, ::basegfx::B2DPoint(0.0, 0.0));
+ aUnitOutline.insert(0L, basegfx::B2DPoint(0.0, 0.0));
}
aUnitOutline.setClosed(true);
}
// move and scale UnitEllipse to UnitObject (-1,-1 1,1) -> (0,0 1,1)
- basegfx::B2DHomMatrix aUnitCorrectionMatrix(basegfx::tools::createTranslateB2DHomMatrix(1.0, 1.0));
- aUnitCorrectionMatrix.scale(0.5, 0.5);
+ const basegfx::B2DHomMatrix aUnitCorrectionMatrix(
+ basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
// apply to the geometry
aUnitOutline.transform(aUnitCorrectionMatrix);
// add fill
- if(getSdrLFSTAttribute().getFill() && aUnitOutline.isClosed())
+ if(!getSdrLFSTAttribute().getFill().isDefault() && aUnitOutline.isClosed())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd()));
+ // create invisible line for HitTest/BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(::basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
}
SdrEllipseSegmentPrimitive2D::SdrEllipseSegmentPrimitive2D(
- const ::basegfx::B2DHomMatrix& rTransform,
+ const basegfx::B2DHomMatrix& rTransform,
const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
double fStartAngle,
double fEndAngle,
diff --git a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
index 9ef9aba423..e7428ede50 100644
--- a/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx
@@ -32,7 +32,8 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -45,21 +46,25 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
// add fill, but only when graphic ist transparent
- if(getSdrLFSTAttribute().getFill() && isTransparent())
+ if(!getSdrLFSTAttribute().getFill().isDefault() && isTransparent())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(!getSdrLFSTAttribute().getLine().isDefault())
{
// if line width is given, polygon needs to be grown by half of it to make the
// outline to be outside of the bitmap
- if(0.0 != getSdrLFSTAttribute().getLine()->getWidth())
+ if(0.0 != getSdrLFSTAttribute().getLine().getWidth())
{
// decompose to get scale
basegfx::B2DVector aScale, aTranslate;
@@ -67,46 +72,61 @@ namespace drawinglayer
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
// create expanded range (add relative half line width to unit rectangle)
- double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5);
+ double fHalfLineWidth(getSdrLFSTAttribute().getLine().getWidth() * 0.5);
double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0);
double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0);
const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aExpandedUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
else
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline, getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
}
- else
- {
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
- }
// add graphic content
if(255L != getGraphicAttr().GetTransparency())
{
- Primitive2DReference xGraphicContentPrimitive(new GraphicPrimitive2D(getTransform(), getGraphicObject(), getGraphicAttr()));
+ const Primitive2DReference xGraphicContentPrimitive(
+ new GraphicPrimitive2D(
+ getTransform(),
+ getGraphicObject(),
+ getGraphicAttr()));
+
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, xGraphicContentPrimitive);
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
index 5ed2734071..5f7e3a047d 100644
--- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx
@@ -35,8 +35,8 @@
#include <basegfx/tools/canvastools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -56,36 +56,44 @@ namespace drawinglayer
bool bLeftActive,
bool bRightActive) const
{
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
+ const attribute::SdrLineStartEndAttribute& rLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
basegfx::B2DPolygon aPolygon;
aPolygon.append(rStart);
aPolygon.append(rEnd);
- if(!pLineStartEnd || (!bLeftActive && !bRightActive))
+ if(rLineStartEnd.isDefault() || (!bLeftActive && !bRightActive))
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, 0);
+ return createPolygonLinePrimitive(
+ aPolygon,
+ rObjectMatrix,
+ rLineAttribute,
+ attribute::SdrLineStartEndAttribute());
}
if(bLeftActive && bRightActive)
{
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, pLineStartEnd);
+ return createPolygonLinePrimitive(
+ aPolygon,
+ rObjectMatrix,
+ rLineAttribute,
+ rLineStartEnd);
}
const basegfx::B2DPolyPolygon aEmpty;
const attribute::SdrLineStartEndAttribute aLineStartEnd(
- bLeftActive ? pLineStartEnd->getStartPolyPolygon() : aEmpty, bRightActive ? pLineStartEnd->getEndPolyPolygon() : aEmpty,
- bLeftActive ? pLineStartEnd->getStartWidth() : 0.0, bRightActive ? pLineStartEnd->getEndWidth() : 0.0,
- bLeftActive ? pLineStartEnd->isStartActive() : false, bRightActive ? pLineStartEnd->isEndActive() : false,
- bLeftActive ? pLineStartEnd->isStartCentered() : false, bRightActive? pLineStartEnd->isEndCentered() : false);
+ bLeftActive ? rLineStartEnd.getStartPolyPolygon() : aEmpty, bRightActive ? rLineStartEnd.getEndPolyPolygon() : aEmpty,
+ bLeftActive ? rLineStartEnd.getStartWidth() : 0.0, bRightActive ? rLineStartEnd.getEndWidth() : 0.0,
+ bLeftActive ? rLineStartEnd.isStartActive() : false, bRightActive ? rLineStartEnd.isEndActive() : false,
+ bLeftActive ? rLineStartEnd.isStartCentered() : false, bRightActive? rLineStartEnd.isEndCentered() : false);
- return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, &aLineStartEnd);
+ return createPolygonLinePrimitive(aPolygon, rObjectMatrix, rLineAttribute, aLineStartEnd);
}
Primitive2DSequence SdrMeasurePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const
{
Primitive2DSequence aRetval;
- SdrBlockTextPrimitive2D* pBlockText = 0L;
+ SdrBlockTextPrimitive2D* pBlockText = 0;
basegfx::B2DRange aTextRange;
double fTextX((getStart().getX() + getEnd().getX()) * 0.5);
double fTextY((getStart().getX() + getEnd().getX()) * 0.5);
@@ -93,11 +101,13 @@ namespace drawinglayer
const double fDistance(aLine.getLength());
const double fAngle(atan2(aLine.getY(), aLine.getX()));
bool bAutoUpsideDown(false);
- const attribute::SdrTextAttribute* pTextAttribute = getSdrLSTAttribute().getText();
+ const attribute::SdrTextAttribute rTextAttribute = getSdrLSTAttribute().getText();
const basegfx::B2DHomMatrix aObjectMatrix(
basegfx::tools::createShearXRotateTranslateB2DHomMatrix(0.0, fAngle, getStart()));
- if(pTextAttribute)
+ // preapare text, but do not add yet; it needs to be aligned to
+ // the line geometry
+ if(!rTextAttribute.isDefault())
{
basegfx::B2DHomMatrix aTextMatrix;
double fTestAngle(fAngle);
@@ -123,58 +133,52 @@ namespace drawinglayer
// create primitive and get text range
pBlockText = new SdrBlockTextPrimitive2D(
- &pTextAttribute->getSdrText(),
- pTextAttribute->getOutlinerParaObject(),
+ &rTextAttribute.getSdrText(),
+ rTextAttribute.getOutlinerParaObject(),
aTextMatrix,
SDRTEXTHORZADJUST_CENTER,
SDRTEXTVERTADJUST_CENTER,
- pTextAttribute->isScroll(),
+ rTextAttribute.isScroll(),
false,
false,
false,
false);
+
aTextRange = pBlockText->getB2DRange(aViewInformation);
}
// prepare line attribute and result
- const attribute::SdrLineAttribute* pLineAttribute(getSdrLSTAttribute().getLine());
-
- if(!pLineAttribute)
- {
- // if initially no line is defined, create one for HitTest and BoundRect
- pLineAttribute = new attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0));
- }
-
{
+ const attribute::SdrLineAttribute rLineAttribute(getSdrLSTAttribute().getLine());
bool bArrowsOutside(false);
bool bMainLineSplitted(false);
- const attribute::SdrLineStartEndAttribute* pLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
+ const attribute::SdrLineStartEndAttribute& rLineStartEnd = getSdrLSTAttribute().getLineStartEnd();
double fStartArrowW(0.0);
double fStartArrowH(0.0);
double fEndArrowW(0.0);
double fEndArrowH(0.0);
- if(pLineStartEnd)
+ if(!rLineStartEnd.isDefault())
{
- if(pLineStartEnd->isStartActive())
+ if(rLineStartEnd.isStartActive())
{
- const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getStartPolyPolygon()));
- fStartArrowW = pLineStartEnd->getStartWidth();
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(rLineStartEnd.getStartPolyPolygon()));
+ fStartArrowW = rLineStartEnd.getStartWidth();
fStartArrowH = aArrowRange.getHeight() * fStartArrowW / aArrowRange.getWidth();
- if(pLineStartEnd->isStartCentered())
+ if(rLineStartEnd.isStartCentered())
{
fStartArrowH *= 0.5;
}
}
- if(pLineStartEnd->isEndActive())
+ if(rLineStartEnd.isEndActive())
{
- const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(pLineStartEnd->getEndPolyPolygon()));
- fEndArrowW = pLineStartEnd->getEndWidth();
+ const basegfx::B2DRange aArrowRange(basegfx::tools::getRange(rLineStartEnd.getEndPolyPolygon()));
+ fEndArrowW = rLineStartEnd.getEndWidth();
fEndArrowH = aArrowRange.getHeight() * fEndArrowW / aArrowRange.getWidth();
- if(pLineStartEnd->isEndCentered())
+ if(rLineStartEnd.isEndCentered())
{
fEndArrowH *= 0.5;
}
@@ -183,7 +187,7 @@ namespace drawinglayer
const double fSpaceNeededByArrows(fStartArrowH + fEndArrowH + ((fStartArrowW + fEndArrowW) * 0.5));
const double fArrowsOutsideLen((fStartArrowH + fEndArrowH + fStartArrowW + fEndArrowW) * 0.5);
- const double fHalfLineWidth(pLineAttribute->getWidth() * 0.5);
+ const double fHalfLineWidth(rLineAttribute.getWidth() * 0.5);
if(fSpaceNeededByArrows > fDistance)
{
@@ -275,12 +279,12 @@ namespace drawinglayer
const basegfx::B2DPoint aMainLeftLeft(aMainLeft.getX() - fLenLeft, aMainLeft.getY());
const basegfx::B2DPoint aMainRightRight(aMainRight.getX() + fLenRight, aMainRight.getY());
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeftLeft, aMainLeft, false, true));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainRight, aMainRightRight, true, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeftLeft, aMainLeft, false, true));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainRight, aMainRightRight, true, false));
if(!bMainLineSplitted || MEASURETEXTPOSITION_CENTERED != eHorizontal)
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(* pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainRight, false, false));
}
}
else
@@ -291,12 +295,12 @@ namespace drawinglayer
const basegfx::B2DPoint aMainInnerLeft(aMainLeft.getX() + fHalfLength, aMainLeft.getY());
const basegfx::B2DPoint aMainInnerRight(aMainRight.getX() - fHalfLength, aMainRight.getY());
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainInnerLeft, true, false));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainInnerRight, aMainRight, false, true));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainInnerLeft, true, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainInnerRight, aMainRight, false, true));
}
else
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aMainLeft, aMainRight, true, true));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aMainLeft, aMainRight, true, true));
}
}
@@ -309,13 +313,13 @@ namespace drawinglayer
const basegfx::B2DPoint aLeftUp(0.0, fTopEdge);
const basegfx::B2DPoint aLeftDown(0.0, fBottomLeft);
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aLeftDown, aLeftUp, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aLeftDown, aLeftUp, false, false));
// right help line
const basegfx::B2DPoint aRightUp(fDistance, fTopEdge);
const basegfx::B2DPoint aRightDown(fDistance, fBottomRight);
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(*pLineAttribute, aObjectMatrix, aRightDown, aRightUp, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, impCreatePart(rLineAttribute, aObjectMatrix, aRightDown, aRightUp, false, false));
// text horizontal position
if(MEASURETEXTPOSITION_NEGATIVE == eHorizontal)
@@ -329,9 +333,9 @@ namespace drawinglayer
fTextX -= (fArrowsOutsideLen - fStartArrowH);
}
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextX -= pTextAttribute->getTextRightDistance();
+ fTextX -= rTextAttribute.getTextRightDistance();
}
}
else if(MEASURETEXTPOSITION_POSITIVE == eHorizontal)
@@ -345,9 +349,9 @@ namespace drawinglayer
fTextX += (fArrowsOutsideLen - fEndArrowH);
}
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextX += pTextAttribute->getTextLeftDistance();
+ fTextX += rTextAttribute.getTextLeftDistance();
}
}
else // MEASURETEXTPOSITION_CENTERED
@@ -355,9 +359,9 @@ namespace drawinglayer
// centered
fTextX = aMainLeft.getX() + ((fDistance - aTextRange.getWidth()) * 0.5);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextX += (pTextAttribute->getTextLeftDistance() - pTextAttribute->getTextRightDistance()) / 2L;
+ fTextX += (rTextAttribute.getTextLeftDistance() - rTextAttribute.getTextRightDistance()) / 2L;
}
}
@@ -368,9 +372,9 @@ namespace drawinglayer
const double fSmall(fArrowsOutsideLen * 0.10);
fTextY = aMainLeft.getY() - (aTextRange.getHeight() + fSmall + fHalfLineWidth);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextY -= pTextAttribute->getTextLowerDistance();
+ fTextY -= rTextAttribute.getTextLowerDistance();
}
}
else if(MEASURETEXTPOSITION_POSITIVE == eVertical)
@@ -379,9 +383,9 @@ namespace drawinglayer
const double fSmall(fArrowsOutsideLen * 0.10);
fTextY = aMainLeft.getY() + (fSmall + fHalfLineWidth);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextY += pTextAttribute->getTextUpperDistance();
+ fTextY += rTextAttribute.getTextUpperDistance();
}
}
else // MEASURETEXTPOSITION_CENTERED
@@ -389,21 +393,19 @@ namespace drawinglayer
// centered
fTextY = aMainLeft.getY() - (aTextRange.getHeight() * 0.5);
- if(pTextAttribute)
+ if(!rTextAttribute.isDefault())
{
- fTextY += (pTextAttribute->getTextUpperDistance() - pTextAttribute->getTextLowerDistance()) / 2L;
+ fTextY += (rTextAttribute.getTextUpperDistance() - rTextAttribute.getTextLowerDistance()) / 2L;
}
}
}
- if(!getSdrLSTAttribute().getLine())
+ if(getSdrLSTAttribute().getLine().isDefault())
{
- // embed line geometry to invisible line group
- const Primitive2DReference xHiddenLines(new HitTestPrimitive2D(aRetval));
+ // embed line geometry to invisible (100% transparent) line group for HitTest
+ const Primitive2DReference xHiddenLines(new HiddenGeometryPrimitive2D(aRetval));
+
aRetval = Primitive2DSequence(&xHiddenLines, 1);
-
- // delete temporary LineAttribute again
- delete pLineAttribute;
}
if(pBlockText)
@@ -433,9 +435,11 @@ namespace drawinglayer
}
// add shadow
- if(getSdrLSTAttribute().getShadow())
+ if(!getSdrLSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
index e4c13a51f6..9bef2207f5 100644
--- a/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrole2primitive2d.cxx
@@ -30,7 +30,8 @@
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -58,8 +59,14 @@ namespace drawinglayer
if(BasePrimitive2D::operator==(rPrimitive))
{
const SdrOle2Primitive2D& rCompare = (SdrOle2Primitive2D&)rPrimitive;
-
- if(getOLEContent() == rCompare.getOLEContent()
+
+ // #i108636# The standard operator== on two UNO sequences did not work as i
+ // would have expected; it just checks the .is() states and the data type
+ // of the sequence. What i need here is detection of equality of the whole
+ // sequence content, thus i need to use the arePrimitive2DSequencesEqual helper
+ // here instead of the operator== which lead to always returning false and thus
+ // always re-decompositions of the subcontent.
+ if(arePrimitive2DSequencesEqual(getOLEContent(), rCompare.getOLEContent())
&& getTransform() == rCompare.getTransform()
&& getSdrLFSTAttribute() == rCompare.getSdrLFSTAttribute())
{
@@ -80,23 +87,29 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// create unit outline polygon
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createUnitPolygon());
// add fill
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getFill())
+ if(!bBehaveCompatibleToPaintVersion
+ && !getSdrLFSTAttribute().getFill().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- createPolyPolygonFillPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ createPolyPolygonFillPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
// #i97981# condition was inverse to purpose. When being compatible to paint version,
// border needs to be suppressed
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getLine())
+ if(!bBehaveCompatibleToPaintVersion
+ && !getSdrLFSTAttribute().getLine().isDefault())
{
// if line width is given, polygon needs to be grown by half of it to make the
// outline to be outside of the bitmap
- if(0.0 != getSdrLFSTAttribute().getLine()->getWidth())
+ if(0.0 != getSdrLFSTAttribute().getLine().getWidth())
{
// decompose to get scale
basegfx::B2DVector aScale, aTranslate;
@@ -104,27 +117,37 @@ namespace drawinglayer
getTransform().decompose(aScale, aTranslate, fRotate, fShearX);
// create expanded range (add relative half line width to unit rectangle)
- double fHalfLineWidth(getSdrLFSTAttribute().getLine()->getWidth() * 0.5);
+ double fHalfLineWidth(getSdrLFSTAttribute().getLine().getWidth() * 0.5);
double fScaleX(0.0 != aScale.getX() ? fHalfLineWidth / fabs(aScale.getX()) : 1.0);
double fScaleY(0.0 != aScale.getY() ? fHalfLineWidth / fabs(aScale.getY()) : 1.0);
const basegfx::B2DRange aExpandedRange(-fScaleX, -fScaleY, 1.0 + fScaleX, 1.0 + fScaleY);
basegfx::B2DPolygon aExpandedUnitOutline(basegfx::tools::createPolygonFromRect(aExpandedRange));
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aExpandedUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aExpandedUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
else
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolygonLinePrimitive(aUnitOutline, getTransform(), *getSdrLFSTAttribute().getLine()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolygonLinePrimitive(
+ aUnitOutline,
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
}
else
{
// if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- const Primitive2DReference xHiddenLineReference(createPolygonLinePrimitive(aUnitOutline, getTransform(), aBlackHairline));
- const Primitive2DSequence xHiddenLineSequence(&xHiddenLineReference, 1);
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
// add graphic content
@@ -132,15 +155,26 @@ namespace drawinglayer
// add text, no need to supress to stay compatible since text was
// always supported by the old paints, too
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(!bBehaveCompatibleToPaintVersion && getSdrLFSTAttribute().getShadow())
+ if(!bBehaveCompatibleToPaintVersion
+ && !getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
index a77f0b0380..12569813c5 100644
--- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx
@@ -134,7 +134,7 @@ namespace drawinglayer
if(aColor.bIsVisible)
{
- basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
+ basegfx::B2DPolygon aOutline(basegfx::tools::createUnitPolygon());
const Color aVclColor(aColor.nColor);
aOutline.transform(getObjectTransform());
const drawinglayer::primitive2d::Primitive2DReference xOutline(
diff --git a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
index e117e97f0d..9c36397600 100644
--- a/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx
@@ -31,7 +31,7 @@
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -48,50 +48,67 @@ namespace drawinglayer
Primitive2DSequence aRetval;
// add fill
- if(getSdrLFSTAttribute().getFill() && getUnitPolyPolygon().isClosed())
+ if(!getSdrLFSTAttribute().getFill().isDefault()
+ && getUnitPolyPolygon().isClosed())
{
// take care for orientations
- basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(basegfx::tools::correctOrientations(getUnitPolyPolygon()));
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(aOrientedUnitPolyPolygon, getTransform(), *getSdrLFSTAttribute().getFill(), getSdrLFSTAttribute().getFillFloatTransGradient()));
+ const basegfx::B2DPolyPolygon aOrientedUnitPolyPolygon(
+ basegfx::tools::correctOrientations(getUnitPolyPolygon()));
+
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
+ aOrientedUnitPolyPolygon,
+ getTransform(),
+ getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFillFloatTransGradient()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(getSdrLFSTAttribute().getLine().isDefault())
{
- Primitive2DSequence aTemp(getUnitPolyPolygon().count());
-
- for(sal_uInt32 a(0L); a < getUnitPolyPolygon().count(); a++)
- {
- aTemp[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), *getSdrLFSTAttribute().getLine(), getSdrLFSTAttribute().getLineStartEnd());
- }
-
- appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp);
+ // if initially no line is defined, create one for HitTest and BoundRect
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ getUnitPolyPolygon(),
+ getTransform()));
}
else
{
- // if initially no line is defined, create one for HitTest and BoundRect
- const attribute::SdrLineAttribute aBlackHairline(basegfx::BColor(0.0, 0.0, 0.0));
- Primitive2DSequence xHiddenLineSequence(getUnitPolyPolygon().count());
-
+ Primitive2DSequence aTemp(getUnitPolyPolygon().count());
+
for(sal_uInt32 a(0); a < getUnitPolyPolygon().count(); a++)
{
- xHiddenLineSequence[a] = createPolygonLinePrimitive(getUnitPolyPolygon().getB2DPolygon(a), getTransform(), aBlackHairline);
+ aTemp[a] = createPolygonLinePrimitive(
+ getUnitPolyPolygon().getB2DPolygon(a),
+ getTransform(),
+ getSdrLFSTAttribute().getLine(),
+ getSdrLFSTAttribute().getLineStartEnd());
}
-
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, Primitive2DReference(new HitTestPrimitive2D(xHiddenLineSequence)));
+
+ appendPrimitive2DSequenceToPrimitive2DSequence(aRetval, aTemp);
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(getUnitPolyPolygon(), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ getUnitPolyPolygon(),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
index 6361e15a49..fbe23b9450 100644
--- a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
+++ b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
@@ -29,10 +29,6 @@
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
#include <vcl/bmpacc.hxx>
#include <osl/mutex.hxx>
-#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolygontools.hxx>
-#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
#include <vcl/lazydelete.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -173,19 +169,6 @@ namespace drawinglayer
return aRetVal.get() ? *aRetVal.get() : BitmapEx();
}
- // #i99123#
- Primitive2DReference createFallbackHitTestPrimitive(const basegfx::B2DHomMatrix& rMatrix)
- {
- // create PolygonHairlinePrimitive2D
- basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
- aUnitOutline.transform(rMatrix);
- const basegfx::BColor aBlack(0.0, 0.0, 0.0);
- const Primitive2DReference xReference(new PolygonHairlinePrimitive2D(aUnitOutline, aBlack));
-
- // create HitTestPrimitive2D with it
- const Primitive2DSequence xSequence(&xReference, 1);
- return Primitive2DReference(new HitTestPrimitive2D(xSequence));
- }
} // end of namespace primitive2d
} // end of namespace drawinglayer
diff --git a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
index 575bfe004f..cb628a19ce 100644
--- a/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx
@@ -31,7 +31,8 @@
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -46,7 +47,6 @@ namespace drawinglayer
Primitive2DSequence SdrRectanglePrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
Primitive2DSequence aRetval;
- Primitive2DSequence aHitTestContent;
// create unit outline polygon
const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(
@@ -55,64 +55,67 @@ namespace drawinglayer
getCornerRadiusY()));
// add fill
- if(getSdrLFSTAttribute().getFill())
+ if(!getSdrLFSTAttribute().getFill().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolyPolygonFillPrimitive(
basegfx::B2DPolyPolygon(aUnitOutline),
getTransform(),
- *getSdrLFSTAttribute().getFill(),
+ getSdrLFSTAttribute().getFill(),
getSdrLFSTAttribute().getFillFloatTransGradient()));
}
else if(getForceFillForHitTest())
{
// if no fill and it's a text frame, create a fill for HitTest and
// BoundRect fallback
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
- createPolyPolygonFillPrimitive(
- basegfx::B2DPolyPolygon(aUnitOutline),
- getTransform(),
- attribute::SdrFillAttribute(0.0, basegfx::BColor(0.0, 0.0, 0.0)),
- getSdrLFSTAttribute().getFillFloatTransGradient()));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ true,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
// add line
- if(getSdrLFSTAttribute().getLine())
+ if(!getSdrLFSTAttribute().getLine().isDefault())
{
appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
createPolygonLinePrimitive(
aUnitOutline,
getTransform(),
- *getSdrLFSTAttribute().getLine()));
+ getSdrLFSTAttribute().getLine(),
+ attribute::SdrLineStartEndAttribute()));
}
else if(!getForceFillForHitTest())
{
// if initially no line is defined and it's not a text frame, create
// a line for HitTest and BoundRect
- appendPrimitive2DReferenceToPrimitive2DSequence(aHitTestContent,
- createPolygonLinePrimitive(
- aUnitOutline,
- getTransform(),
- attribute::SdrLineAttribute(basegfx::BColor(0.0, 0.0, 0.0))));
- }
-
- // add HitTest and BoundRect helper geometry (if exists)
- if(aHitTestContent.hasElements())
- {
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
- Primitive2DReference(new HitTestPrimitive2D(aHitTestContent)));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ false,
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform()));
}
// add text
- if(getSdrLFSTAttribute().getText())
+ if(!getSdrLFSTAttribute().getText().isDefault())
{
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(basegfx::B2DPolyPolygon(aUnitOutline), getTransform(), *getSdrLFSTAttribute().getText(), getSdrLFSTAttribute().getLine(), false, false, false));
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
+ basegfx::B2DPolyPolygon(aUnitOutline),
+ getTransform(),
+ getSdrLFSTAttribute().getText(),
+ getSdrLFSTAttribute().getLine(),
+ false,
+ false,
+ false));
}
// add shadow
- if(getSdrLFSTAttribute().getShadow())
+ if(!getSdrLFSTAttribute().getShadow().isDefault())
{
- aRetval = createEmbeddedShadowPrimitive(aRetval, *getSdrLFSTAttribute().getShadow());
+ aRetval = createEmbeddedShadowPrimitive(
+ aRetval,
+ getSdrLFSTAttribute().getShadow());
}
return aRetval;
diff --git a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
index b20c08e319..83fed6ca42 100644
--- a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
+++ b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx
@@ -30,8 +30,11 @@
#include <svl/itemset.hxx>
#include <com/sun/star/drawing/NormalsKind.hpp>
#include <com/sun/star/drawing/TextureProjectionMode.hpp>
-#include <drawinglayer/attribute/sdrattribute3d.hxx>
+#include <com/sun/star/drawing/TextureKind2.hpp>
+#include <com/sun/star/drawing/TextureMode.hpp>
#include <svx/xflclit.hxx>
+#include <drawinglayer/attribute/materialattribute3d.hxx>
+#include <drawinglayer/attribute/sdrobjectattribute3d.hxx>
//////////////////////////////////////////////////////////////////////////////
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx
index e53117a4b4..8c97ea69bd 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -281,7 +281,19 @@ namespace sdr
// set stylesheet (if used)
if(pStySheet)
{
- ImpAddStyleSheet(pStySheet, sal_True);
+ // #i109515#
+ SfxItemPool* pStyleSheetPool = &pStySheet->GetPool().GetPool();
+
+ if(pStyleSheetPool == pDestPool)
+ {
+ // just re-set stylesheet
+ ImpAddStyleSheet(pStySheet, sal_True);
+ }
+ else
+ {
+ // StyleSheet is NOT from the correct pool; use default
+ ImpAddStyleSheet(pNewModel->GetDefaultStyleSheet(), sal_True);
+ }
}
delete pOldSet;
@@ -584,22 +596,6 @@ namespace sdr
bHintUsed = sal_True;
}
- // #111111#
- // When it's the BackgroundObject, set the MasterPage to changed to
- // get a refresh for the evtl. changed BackgroundStyle
-
- // #114265#
- // To only invalidate the page when the StyleSheet change happens,
- // some more rigid testing is necessary.
- const SfxSimpleHint *pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint);
-
- if(pSimpleHint
- && pSimpleHint->GetId() == SFX_HINT_DATACHANGED
- && GetSdrObject().IsMasterPageBackgroundObject())
- {
- GetSdrObject().GetPage()->ActionChanged();
- }
-
if(!bHintUsed)
{
// forward to SdrObject ATM. Not sure if this will be necessary
diff --git a/svx/source/sdr/properties/makefile.mk b/svx/source/sdr/properties/makefile.mk
index 2ab52e18ae..5296765769 100644
--- a/svx/source/sdr/properties/makefile.mk
+++ b/svx/source/sdr/properties/makefile.mk
@@ -47,6 +47,7 @@ SLOFILES=\
$(SLO)$/textproperties.obj \
$(SLO)$/customshapeproperties.obj \
$(SLO)$/rectangleproperties.obj \
+ $(SLO)$/oleproperties.obj \
$(SLO)$/captionproperties.obj \
$(SLO)$/circleproperties.obj \
$(SLO)$/connectorproperties.obj \
diff --git a/svx/source/sdr/properties/oleproperties.cxx b/svx/source/sdr/properties/oleproperties.cxx
new file mode 100644
index 0000000000..5c6fae24da
--- /dev/null
+++ b/svx/source/sdr/properties/oleproperties.cxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: graphicproperties.cxx,v $
+ * $Revision: 1.12.76.1 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_svx.hxx"
+
+#include <svx/sdr/properties/oleproperties.hxx>
+#include <svl/itemset.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xlineit0.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace sdr
+{
+ namespace properties
+ {
+ OleProperties::OleProperties(SdrObject& rObj)
+ : RectangleProperties(rObj)
+ {
+ }
+
+ OleProperties::OleProperties(const OleProperties& rProps, SdrObject& rObj)
+ : RectangleProperties(rProps, rObj)
+ {
+ }
+
+ OleProperties::~OleProperties()
+ {
+ }
+
+ BaseProperties& OleProperties::Clone(SdrObject& rObj) const
+ {
+ return *(new OleProperties(*this, rObj));
+ }
+
+ void OleProperties::ForceDefaultAttributes()
+ {
+ // call parent
+ RectangleProperties::ForceDefaultAttributes();
+
+ // force ItemSet
+ GetObjectItemSet();
+
+ // #i108221#
+ mpItemSet->Put( XFillStyleItem(XFILL_NONE) );
+ mpItemSet->Put( XLineStyleItem(XLINE_NONE) );
+ }
+ } // end of namespace properties
+} // end of namespace sdr
+
+//////////////////////////////////////////////////////////////////////////////
+// eof
diff --git a/svx/source/svdraw/makefile.mk b/svx/source/svdraw/makefile.mk
index 0108615b10..514c5b6d2c 100644
--- a/svx/source/svdraw/makefile.mk
+++ b/svx/source/svdraw/makefile.mk
@@ -113,8 +113,6 @@ LIB1OBJFILES= \
LIB2TARGET= $(SLB)$/$(TARGET).lib
LIB2OBJFILES= \
- $(SLO)$/svdoimp.obj \
- $(SLO)$/svdscrol.obj \
$(SLO)$/ActionDescriptionProvider.obj \
$(SLO)$/impgrfll.obj
diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
index 0d01693740..3437567da3 100644
--- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx
+++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx
@@ -33,6 +33,8 @@
// #i42075#
#include <svx/svdobj.hxx>
+#include <svx/xfillit0.hxx>
+#include <svl/itemset.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -73,7 +75,8 @@ namespace sdr
{
if(!mpViewContact)
{
- ((MasterPageDescriptor*)this)->mpViewContact = ((MasterPageDescriptor*)this)->CreateObjectSpecificViewContact();
+ const_cast< MasterPageDescriptor* >(this)->mpViewContact =
+ const_cast< MasterPageDescriptor* >(this)->CreateObjectSpecificViewContact();
}
return *mpViewContact;
@@ -93,14 +96,6 @@ namespace sdr
{
maVisibleLayers = rNew;
GetViewContact().ActionChanged();
-
- // #i42075# For AFs convenience, do a change notify at the MasterPageBackgroundObject, too
- SdrObject* pObject = GetBackgroundObject();
-
- if(pObject)
- {
- pObject->BroadcastObjectChange();
- }
}
}
@@ -119,40 +114,16 @@ namespace sdr
|| maVisibleLayers != rCandidate.maVisibleLayers);
}
- // #i42075# Get the correct BackgroundObject
- SdrObject* MasterPageDescriptor::GetBackgroundObject() const
+ const SfxItemSet& MasterPageDescriptor::getCorrectFillAttributes() const
{
- SdrObject* pRetval = 0L;
- const SdrPage& rMasterPage = GetUsedPage();
-
- // Here i will rely on old knowledge about the 0'st element of a masterpage
- // being the PageBackgroundObject. This will be removed again when that definition
- // will be changed.
-#ifdef DBG_UTIL
- const sal_uInt32 nMasterPageObjectCount(rMasterPage.GetObjCount());
- DBG_ASSERT(1 <= nMasterPageObjectCount,
- "MasterPageDescriptor::GetBackgroundObject(): MasterPageBackgroundObject missing (!)");
-#endif
- pRetval = rMasterPage.GetObj(0L);
-
- // Test if it's really what we need. There are known problems where
- // the 0th object is not the MasterPageBackgroundObject at all.
- if(pRetval && !pRetval->IsMasterPageBackgroundObject())
- {
- pRetval = 0L;
- }
-
- // Get the evtl. existing page background object from the using page and use it
- // preferred to the MasterPageBackgroundObject
- const SdrPage& rOwnerPage = GetOwnerPage();
- SdrObject* pCandidate = rOwnerPage.GetBackgroundObj();
+ const SfxItemSet& rOwnerPageAtributes = GetOwnerPage().getSdrPageProperties().GetItemSet();
- if(pCandidate)
+ if(XFILL_NONE != ((const XFillStyleItem&)rOwnerPageAtributes.Get(XATTR_FILLSTYLE)).GetValue())
{
- pRetval = pCandidate;
+ return rOwnerPageAtributes;
}
- return pRetval;
+ return GetUsedPage().getSdrPageProperties().GetItemSet();
}
} // end of namespace sdr
diff --git a/svx/source/svdraw/svdcrtmt.hxx b/svx/source/svdraw/svdcrtmt.hxx
deleted file mode 100644
index 2b99c4a550..0000000000
--- a/svx/source/svdraw/svdcrtmt.hxx
+++ /dev/null
@@ -1,32 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVDCRTMT_HXX
-#define _SVDCRTMT_HXX
-
-#endif //_SVDCRTMT_HXX
-
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 083c819489..0710279c0f 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -66,7 +66,7 @@
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/overlay/overlayprimitive2dsequenceobject.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include "svditer.hxx"
#include <svx/svdopath.hxx>
@@ -75,13 +75,14 @@
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <drawinglayer/primitive2d/markerarrayprimitive2d.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdovirt.hxx>
#include <svx/svdouno.hxx>
#include <svx/sdr/primitive2d/sdrprimitivetools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -674,7 +675,7 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay
createSdrDragEntries();
}
- // if there are entries, derive OverlayObjects fromthe entries, including
+ // if there are entries, derive OverlayObjects from the entries, including
// modification from current interactive state
if(maSdrDragEntries.size())
{
@@ -723,8 +724,8 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay
if(aResultTransparent.hasElements())
{
- drawinglayer::primitive2d::Primitive2DReference aUnifiedAlphaPrimitive2D(new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(aResultTransparent, 0.5));
- aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedAlphaPrimitive2D, 1);
+ drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparencePrimitive2D(new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(aResultTransparent, 0.5));
+ aResultTransparent = drawinglayer::primitive2d::Primitive2DSequence(&aUnifiedTransparencePrimitive2D, 1);
sdr::overlay::OverlayObject* pNewOverlayObject = new sdr::overlay::OverlayPrimitive2DSequenceObject(aResultTransparent);
rOverlayManager.add(*pNewOverlayObject);
@@ -819,38 +820,36 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragMethod::AddConnectorOverla
// this polygon is a temporary calculated connector path, so it is not possible to fetch
// the needed primitives directly from the pEdge object which does not get changed. If full
// drag is on, use the SdrObjects ItemSet to create a adequate representation
- if(getSolidDraggingActive())
- {
- const SfxItemSet& rItemSet = pEdge->GetMergedItemSet();
- drawinglayer::attribute::SdrLineAttribute* pLine = drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet);
- drawinglayer::attribute::SdrLineStartEndAttribute* pLineStartEnd = 0;
+ bool bUseSolidDragging(getSolidDraggingActive());
- if(pLine && !pLine->isVisible())
+ if(bUseSolidDragging)
+ {
+ // switch off solid dragging if connector is not visible
+ if(!pEdge->HasLineStyle())
{
- delete pLine;
- pLine = 0;
+ bUseSolidDragging = false;
}
+ }
- if(pLine)
- {
- pLineStartEnd = drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(rItemSet, pLine->getWidth());
+ if(bUseSolidDragging)
+ {
+ const SfxItemSet& rItemSet = pEdge->GetMergedItemSet();
+ const drawinglayer::attribute::SdrLineAttribute aLine(
+ drawinglayer::primitive2d::createNewSdrLineAttribute(rItemSet));
- if(pLineStartEnd && !pLineStartEnd->isVisible())
- {
- delete pLineStartEnd;
- pLineStartEnd = 0;
- }
+ if(!aLine.isDefault())
+ {
+ const drawinglayer::attribute::SdrLineStartEndAttribute aLineStartEnd(
+ drawinglayer::primitive2d::createNewSdrLineStartEndAttribute(
+ rItemSet,
+ aLine.getWidth()));
drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(
aRetval, drawinglayer::primitive2d::createPolygonLinePrimitive(
- aEdgePolygon, basegfx::B2DHomMatrix(), *pLine, pLineStartEnd));
-
- if(pLineStartEnd)
- {
- delete pLineStartEnd;
- }
-
- delete pLine;
+ aEdgePolygon,
+ basegfx::B2DHomMatrix(),
+ aLine,
+ aLineStartEnd));
}
}
else
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 47aff72541..7023aa8913 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -805,16 +805,101 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark)
void SdrEditView::DeleteMarkedObj()
{
- if (GetMarkedObjectCount()) {
- BrkAction();
- //HMHHideMarkHdl();
- BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE);
+ // moved breaking action and undo start outside loop
+ BrkAction();
+ BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE);
+
+ // remove as long as something is selected. This allows to schedule objects for
+ // removal for a next run as needed
+ while(GetMarkedObjectCount())
+ {
+ // vector to remember the parents which may be empty after object removal
+ std::vector< SdrObject* > aParents;
+
+ {
+ const SdrMarkList& rMarkList = GetMarkedObjectList();
+ const sal_uInt32 nCount(rMarkList.GetMarkCount());
+ sal_uInt32 a(0);
+
+ for(a = 0; a < nCount; a++)
+ {
+ // in the first run, add all found parents, but only once
+ SdrMark* pMark = rMarkList.GetMark(a);
+ SdrObject* pObject = pMark->GetMarkedSdrObj();
+ SdrObject* pParent = pObject->GetObjList()->GetOwnerObj();
+
+ if(pParent)
+ {
+ if(aParents.size())
+ {
+ std::vector< SdrObject* >::iterator aFindResult =
+ std::find(aParents.begin(), aParents.end(), pParent);
+
+ if(aFindResult == aParents.end())
+ {
+ aParents.push_back(pParent);
+ }
+ }
+ else
+ {
+ aParents.push_back(pParent);
+ }
+ }
+ }
+
+ if(aParents.size())
+ {
+ // in a 2nd run, remove all objects which may already be scheduled for
+ // removal. I am not sure if this can happen, but theoretically
+ // a to-be-removed object may already be the group/3DScene itself
+ for(a = 0; a < nCount; a++)
+ {
+ SdrMark* pMark = rMarkList.GetMark(a);
+ SdrObject* pObject = pMark->GetMarkedSdrObj();
+
+ std::vector< SdrObject* >::iterator aFindResult =
+ std::find(aParents.begin(), aParents.end(), pObject);
+
+ if(aFindResult != aParents.end())
+ {
+ aParents.erase(aFindResult);
+ }
+ }
+ }
+ }
+
+ // original stuff: remove selected objects. Handle clear will
+ // do something only once
DeleteMarkedList(GetMarkedObjectList());
GetMarkedObjectListWriteAccess().Clear();
aHdl.Clear();
- EndUndo();
- MarkListHasChanged();
+
+ while(aParents.size() && !GetMarkedObjectCount())
+ {
+ // iterate over remembered parents
+ SdrObject* pParent = aParents.back();
+ aParents.pop_back();
+
+ if(pParent->GetSubList() && 0 == pParent->GetSubList()->GetObjCount())
+ {
+ // we detected an empty parent, a candidate to leave group/3DScene
+ // if entered
+ if(GetSdrPageView()->GetAktGroup()
+ && GetSdrPageView()->GetAktGroup() == pParent)
+ {
+ GetSdrPageView()->LeaveOneGroup();
+ }
+
+ // schedule empty parent for removal
+ GetMarkedObjectListWriteAccess().InsertEntry(
+ SdrMark(pParent, GetSdrPageView()));
+ }
+ }
}
+
+ // end undo and change messaging moved at the end
+ EndUndo();
+ MarkListHasChanged();
}
void SdrEditView::CopyMarkedObj()
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 0be05fbe12..5711ed7d80 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -281,13 +281,13 @@ SdrHdlBitmapSet& getSimpleSet()
SdrHdlBitmapSet& getModernSet()
{
- static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_MARKERS));
+ static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aModernSet(new SdrHdlBitmapSet(SIP_SA_FINE_MARKERS));
return *aModernSet.get();
}
SdrHdlBitmapSet& getHighContrastSet()
{
- static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_MARKERS));
+ static vcl::DeleteOnDeinit< SdrHdlBitmapSet > aHighContrastSet(new SdrHdlBitmapSet(SIP_SA_ACCESSIBILITY_MARKERS));
return *aHighContrastSet.get();
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index bcf81b91ef..b10fab6a67 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -47,7 +47,6 @@
#include <svx/svdpage.hxx>
#include <svx/svdovirt.hxx> // Fuer Add/Del Ref
#include <svx/svdview.hxx> // fuer Dragging (Ortho abfragen)
-#include "svdscrol.hxx"
#include "svdglob.hxx" // StringCache
#include "svdstr.hrc" // Objektname
#include <svx/svdogrp.hxx> // Factory
@@ -326,7 +325,8 @@ sdr::properties::BaseProperties& SdrObject::GetProperties() const
{
if(!mpProperties)
{
- ((SdrObject*)this)->mpProperties = ((SdrObject*)this)->CreateObjectSpecificProperties();
+ const_cast< SdrObject* >(this)->mpProperties =
+ const_cast< SdrObject* >(this)->CreateObjectSpecificProperties();
}
return *mpProperties;
@@ -361,7 +361,8 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const
{
if(!mpViewContact)
{
- ((SdrObject*)this)->mpViewContact = ((SdrObject*)this)->CreateObjectSpecificViewContact();
+ const_cast< SdrObject* >(this)->mpViewContact =
+ const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact();
}
return *mpViewContact;
@@ -370,51 +371,6 @@ sdr::contact::ViewContact& SdrObject::GetViewContact() const
// DrawContact support: Methods for handling Object changes
void SdrObject::ActionChanged() const
{
- // Forward change call to MasterPageDescriptor if BackgroundObject was changed
- const SdrPage* pObjectsPage = GetPage();
-
- if(pObjectsPage)
- {
- // do the necessary ActionChange() forwards when a MasterPageBackgroundObject
- // gets changed. This can be removed as soon as the MasterPageBackgroundObject
- // handling is replaced with the proper ItemSet handling at the SdrPages. The
- // needed ActionChanged calls will then be triggered by changing those ItemSets.
- if(pObjectsPage->IsMasterPage())
- {
- if(IsMasterPageBackgroundObject())
- {
- SdrModel* pObjectsModel = GetModel();
-
- if(pObjectsModel)
- {
- const sal_uInt16 nCount(pObjectsModel->GetPageCount());
-
- for(sal_uInt16 a(0); a < nCount; a++)
- {
- const SdrPage* pUserPage = pObjectsModel->GetPage(a);
-
- if(pUserPage && pUserPage->TRG_HasMasterPage())
- {
- SdrPage& rUsedMasterPage = pUserPage->TRG_GetMasterPage();
-
- if(&rUsedMasterPage == pObjectsPage)
- {
- pUserPage->TRG_GetMasterPageDescriptorViewContact().ActionChanged();
- }
- }
- }
- }
- }
- }
- else
- {
- if(pObjectsPage->TRG_HasMasterPage() && pObjectsPage->GetBackgroundObj() == this)
- {
- pObjectsPage->TRG_GetMasterPageDescriptorViewContact().ActionChanged();
- }
- }
- }
-
// Do necessary ViewContact actions
GetViewContact().ActionChanged();
}
@@ -3112,26 +3068,6 @@ void SdrObject::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const ba
SetSnapRect(aBaseRect);
}
-// #111111#
-// Needed again and again i will now add a test for finding out if
-// this object is the BackgroundObject of the page.
-sal_Bool SdrObject::IsMasterPageBackgroundObject() const
-{
- if(pObjList
- && pObjList == pPage
- && pPage->IsMasterPage()
- && pObjList->GetObj(0) == this
- && 1L == (pPage->GetPageNum() % 2))
- {
- // 0'th object, directly on page, page is MasterPage,
- // MasterPagePageNum is 1,3,5,...
- // --> It's the background object (!)
- return sal_True;
- }
-
- return sal_False;
-}
-
// #116168#
// Give info if object is in destruction
sal_Bool SdrObject::IsInDestruction() const
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 8ef96e7d50..7e88f485d0 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -843,7 +843,7 @@ void SdrCaptionObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, cons
}
// geometry access
-::basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const
+basegfx::B2DPolygon SdrCaptionObj::getTailPolygon() const
{
return aTailPoly.getB2DPolygon();
}
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index 1d30a85acc..428ff28482 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -80,7 +80,7 @@
sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties()
{
- return new sdr::properties::GroupProperties((SdrObject&)(*this));
+ return new sdr::properties::GroupProperties(*this);
}
//////////////////////////////////////////////////////////////////////////////
@@ -163,6 +163,12 @@ void SdrObjGroup::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
}
+void SdrObjGroup::SetBoundRectDirty()
+{
+ // avoid resetting aOutRect which in case of this object is model data,
+ // not re-creatable view data
+}
+
UINT16 SdrObjGroup::GetObjIdentifier() const
{
return UINT16(OBJ_GRUP);
diff --git a/svx/source/svdraw/svdoimp.cxx b/svx/source/svdraw/svdoimp.cxx
deleted file mode 100644
index 4362f5599e..0000000000
--- a/svx/source/svdraw/svdoimp.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#include <svdoimp.hxx>
-
-///////////////////////////////////////////////////////////////////////////////
-// eof
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index dd106da535..68ebcca102 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -85,6 +85,7 @@
#include <svtools/chartprettypainter.hxx>
#include <svx/sdr/contact/viewcontactofsdrole2obj.hxx>
#include <svx/svdograf.hxx>
+#include <svx/sdr/properties/oleproperties.hxx>
// #i100710#
#include <svx/xlnclit.hxx>
@@ -732,6 +733,14 @@ static bool ImplIsMathObj( const uno::Reference < embed::XEmbeddedObject >& rObj
}
//////////////////////////////////////////////////////////////////////////////
+// BaseProperties section
+
+sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties()
+{
+ return new sdr::properties::OleProperties(*this);
+}
+
+//////////////////////////////////////////////////////////////////////////////
// DrawContact section
sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index e7407cd8ec..063a847b75 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -76,6 +76,7 @@ inline double ImplMMToTwips(double fVal) { return (fVal * (72.0 / 127.0)); }
#include <svx/sdr/attribute/sdrtextattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
using namespace sdr;
@@ -2741,13 +2742,10 @@ SdrObject* SdrPathObj::RipPoint(sal_uInt32 nHdlNum, sal_uInt32& rNewPt0Index)
SdrObject* SdrPathObj::DoConvertToPolyObj(BOOL bBezier) const
{
// #i89784# check for FontWork with activated HideContour
- bool bHideContour(false);
-
- {
- drawinglayer::attribute::SdrTextAttribute* pText = drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0));
- bHideContour = pText && pText->getSdrFormTextAttribute() && pText->isHideContour();
- delete pText;
- }
+ const drawinglayer::attribute::SdrTextAttribute aText(
+ drawinglayer::primitive2d::createNewSdrTextAttribute(GetObjectItemSet(), *getText(0)));
+ const bool bHideContour(
+ !aText.isDefault() && !aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour());
SdrObject* pRet = bHideContour ?
0 :
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index f8a1534fd2..e84b403cee 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -316,50 +316,67 @@ void SdrRectObj::NbcSetLogicRect(const Rectangle& rRect)
sal_uInt32 SdrRectObj::GetHdlCount() const
{
- return 9L;
+ return IsTextFrame() ? 10 : 9;
}
SdrHdl* SdrRectObj::GetHdl(sal_uInt32 nHdlNum) const
{
- SdrHdl* pH=NULL;
+ SdrHdl* pH = NULL;
Point aPnt;
- SdrHdlKind eKind=HDL_MOVE;
- if( IsTextFrame() && !nHdlNum )
+ SdrHdlKind eKind = HDL_MOVE;
+
+ if(!IsTextFrame())
{
- pH=new ImpTextframeHdl(aRect);
- pH->SetObj((SdrObject*)this);
- pH->SetDrehWink(aGeo.nDrehWink);
- return pH;
+ nHdlNum++;
}
- else
+
+ switch(nHdlNum)
{
- switch (nHdlNum) {
- case 0: {
- long a=GetEckenradius();
- long b=Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert
- if (a>b) a=b;
- if (a<0) a=0;
- aPnt=aRect.TopLeft();
- aPnt.X()+=a;
- eKind=HDL_CIRC;
- } break; // Eckenradius
- case 1: aPnt=aRect.TopLeft(); eKind=HDL_UPLFT; break; // Oben links
- case 2: aPnt=aRect.TopCenter(); eKind=HDL_UPPER; break; // Oben
- case 3: aPnt=aRect.TopRight(); eKind=HDL_UPRGT; break; // Oben rechts
- case 4: aPnt=aRect.LeftCenter(); eKind=HDL_LEFT ; break; // Links
- case 5: aPnt=aRect.RightCenter(); eKind=HDL_RIGHT; break; // Rechts
- case 6: aPnt=aRect.BottomLeft(); eKind=HDL_LWLFT; break; // Unten links
- case 7: aPnt=aRect.BottomCenter(); eKind=HDL_LOWER; break; // Unten
- case 8: aPnt=aRect.BottomRight(); eKind=HDL_LWRGT; break; // Unten rechts
+ case 0:
+ {
+ pH = new ImpTextframeHdl(aRect);
+ pH->SetObj((SdrObject*)this);
+ pH->SetDrehWink(aGeo.nDrehWink);
+ break;
+ }
+ case 1:
+ {
+ long a = GetEckenradius();
+ long b = Max(aRect.GetWidth(),aRect.GetHeight())/2; // Wird aufgerundet, da GetWidth() eins draufaddiert
+ if (a>b) a=b;
+ if (a<0) a=0;
+ aPnt=aRect.TopLeft();
+ aPnt.X()+=a;
+ eKind = HDL_CIRC;
+ break;
}
+ case 2: aPnt=aRect.TopLeft(); eKind = HDL_UPLFT; break; // Oben links
+ case 3: aPnt=aRect.TopCenter(); eKind = HDL_UPPER; break; // Oben
+ case 4: aPnt=aRect.TopRight(); eKind = HDL_UPRGT; break; // Oben rechts
+ case 5: aPnt=aRect.LeftCenter(); eKind = HDL_LEFT ; break; // Links
+ case 6: aPnt=aRect.RightCenter(); eKind = HDL_RIGHT; break; // Rechts
+ case 7: aPnt=aRect.BottomLeft(); eKind = HDL_LWLFT; break; // Unten links
+ case 8: aPnt=aRect.BottomCenter(); eKind = HDL_LOWER; break; // Unten
+ case 9: aPnt=aRect.BottomRight(); eKind = HDL_LWRGT; break; // Unten rechts
}
- if (aGeo.nShearWink!=0) ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan);
- if (aGeo.nDrehWink!=0) RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
- if (eKind!=HDL_MOVE) {
- pH=new SdrHdl(aPnt,eKind);
+
+ if(!pH)
+ {
+ if(aGeo.nShearWink)
+ {
+ ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan);
+ }
+
+ if(aGeo.nDrehWink)
+ {
+ RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
+ }
+
+ pH = new SdrHdl(aPnt,eKind);
pH->SetObj((SdrObject*)this);
pH->SetDrehWink(aGeo.nDrehWink);
}
+
return pH;
}
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 173abeba43..b65bde818f 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -35,7 +35,6 @@
#include <svx/svdpage.hxx> // und fuer AnimationHandler (Laufschrift)
#include <svx/svdetc.hxx>
#include <svx/svdoutl.hxx>
-#include "svdscrol.hxx" // fuer Laufschrift
#include <svx/svdmodel.hxx> // OutlinerDefaults
#include "svdglob.hxx" // Stringcache
#include "svdstr.hrc" // Objektname
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 0c33a54dc3..afcef6b1b2 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -62,7 +62,7 @@
#include <svx/xlinjoit.hxx>
#include <svx/xlndsit.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <editeng/editstat.hxx>
#include <unoapi.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
@@ -226,7 +226,7 @@ namespace
{
class impPolygonParagraphHandler
{
- const drawinglayer::attribute::SdrFormTextAttribute& mrSdrFormTextAttribute; // FormText parameters
+ const drawinglayer::attribute::SdrFormTextAttribute maSdrFormTextAttribute; // FormText parameters
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrDecomposition; // destination primitive list
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& mrShadowDecomposition; // destination primitive list for shadow
Reference < com::sun::star::i18n::XBreakIterator > mxBreak; // break iterator
@@ -269,7 +269,7 @@ namespace
const drawinglayer::attribute::SdrFormTextAttribute& rSdrFormTextAttribute,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rDecomposition,
std::vector< drawinglayer::primitive2d::BasePrimitive2D* >& rShadowDecomposition)
- : mrSdrFormTextAttribute(rSdrFormTextAttribute),
+ : maSdrFormTextAttribute(rSdrFormTextAttribute),
mrDecomposition(rDecomposition),
mrShadowDecomposition(rShadowDecomposition)
{
@@ -293,18 +293,18 @@ namespace
double fPolyStart(0.0);
double fScaleFactor(1.0);
- if(mrSdrFormTextAttribute.getFormTextMirror())
+ if(maSdrFormTextAttribute.getFormTextMirror())
{
aPolygonCandidate.flip();
}
- if(mrSdrFormTextAttribute.getFormTextStart()
- && (XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust()
- || XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust()))
+ if(maSdrFormTextAttribute.getFormTextStart()
+ && (XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust()
+ || XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust()))
{
- if(XFT_LEFT == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_LEFT == maSdrFormTextAttribute.getFormTextAdjust())
{
- fPolyStart += mrSdrFormTextAttribute.getFormTextStart();
+ fPolyStart += maSdrFormTextAttribute.getFormTextStart();
if(fPolyStart > fPolyEnd)
{
@@ -313,7 +313,7 @@ namespace
}
else
{
- fPolyEnd -= mrSdrFormTextAttribute.getFormTextStart();
+ fPolyEnd -= maSdrFormTextAttribute.getFormTextStart();
if(fPolyEnd < fPolyStart)
{
@@ -322,7 +322,7 @@ namespace
}
}
- if(XFT_LEFT != mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_LEFT != maSdrFormTextAttribute.getFormTextAdjust())
{
// calculate total text length of this paragraph, some layout needs to be done
const double fParagraphTextLength(getParagraphTextLength(rTextPortions));
@@ -331,7 +331,7 @@ namespace
// but still take care of XFT_AUTOSIZE in that case
const bool bTextTooLong(fParagraphTextLength > (fPolyEnd - fPolyStart));
- if(XFT_RIGHT == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_RIGHT == maSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -339,7 +339,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength);
}
}
- else if(XFT_CENTER == mrSdrFormTextAttribute.getFormTextAdjust())
+ else if(XFT_CENTER == maSdrFormTextAttribute.getFormTextAdjust())
{
if(!bTextTooLong)
{
@@ -347,7 +347,7 @@ namespace
fPolyStart += ((fPolyEnd - fPolyStart) - fParagraphTextLength) / 2.0;
}
}
- else if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ else if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// if scale, prepare scale factor between curve length and text length
if(0.0 != fParagraphTextLength)
@@ -382,7 +382,7 @@ namespace
// prepare portion length. Takes RTL sections into account.
double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen));
- if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand portion length
fPortionLength *= fScaleFactor;
@@ -397,27 +397,27 @@ namespace
aNewTransformA.scale(aFontScaling.getX(), aFontScaling.getY());
// prepare scaling of text primitive
- if(XFT_AUTOSIZE == mrSdrFormTextAttribute.getFormTextAdjust())
+ if(XFT_AUTOSIZE == maSdrFormTextAttribute.getFormTextAdjust())
{
// when scaling, expand text primitive scaling
aNewTransformA.scale(fScaleFactor, fScaleFactor);
}
// eventually create shadow primitives from aDecomposition and add to rDecomposition
- const bool bShadow(XFTSHADOW_NONE != mrSdrFormTextAttribute.getFormTextShadow());
+ const bool bShadow(XFTSHADOW_NONE != maSdrFormTextAttribute.getFormTextShadow());
if(bShadow)
{
- if(XFTSHADOW_NORMAL == mrSdrFormTextAttribute.getFormTextShadow())
+ if(XFTSHADOW_NORMAL == maSdrFormTextAttribute.getFormTextShadow())
{
aNewShadowTransform.translate(
- mrSdrFormTextAttribute.getFormTextShdwXVal(),
- -mrSdrFormTextAttribute.getFormTextShdwYVal());
+ maSdrFormTextAttribute.getFormTextShdwXVal(),
+ -maSdrFormTextAttribute.getFormTextShdwYVal());
}
else // XFTSHADOW_SLANT
{
- double fScaleValue(mrSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
- double fShearValue(-mrSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
+ double fScaleValue(maSdrFormTextAttribute.getFormTextShdwYVal() / 100.0);
+ double fShearValue(-maSdrFormTextAttribute.getFormTextShdwXVal() * F_PI1800);
aNewShadowTransform.scale(1.0, fScaleValue);
aNewShadowTransform.shearX(sin(fShearValue));
@@ -425,7 +425,7 @@ namespace
}
}
- switch(mrSdrFormTextAttribute.getFormTextStyle())
+ switch(maSdrFormTextAttribute.getFormTextStyle())
{
case XFT_ROTATE :
{
@@ -483,7 +483,7 @@ namespace
}
// distance from path?
- if(mrSdrFormTextAttribute.getFormTextDistance())
+ if(maSdrFormTextAttribute.getFormTextDistance())
{
if(aEndPos.equal(aStartPos))
{
@@ -493,7 +493,7 @@ namespace
// use back vector (aStartPos - aEndPos) here to get mirrored perpendicular as in old stuff
const basegfx::B2DVector aPerpendicular(
basegfx::getNormalizedPerpendicular(aStartPos - aEndPos) *
- mrSdrFormTextAttribute.getFormTextDistance());
+ maSdrFormTextAttribute.getFormTextDistance());
aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY());
}
@@ -502,7 +502,7 @@ namespace
{
if(pCandidate->getText().Len() && nNextGlyphLen)
{
- const Color aShadowColor(mrSdrFormTextAttribute.getFormTextShdwColor());
+ const Color aShadowColor(maSdrFormTextAttribute.getFormTextShdwColor());
const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor());
const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
const ::std::vector< double > aNewDXArray(
@@ -623,7 +623,7 @@ namespace
{
if(rOutlineAttribute.getTransparence())
{
- // create UnifiedAlphaPrimitive2D
+ // create UnifiedTransparencePrimitive2D
drawinglayer::primitive2d::Primitive2DSequence aStrokePrimitiveSequence(nStrokeCount);
for(sal_uInt32 b(0L); b < nStrokeCount; b++)
@@ -631,8 +631,8 @@ namespace
aStrokePrimitiveSequence[b] = drawinglayer::primitive2d::Primitive2DReference(aStrokePrimitives[b]);
}
- drawinglayer::primitive2d::UnifiedAlphaPrimitive2D* pNew2 =
- new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+ drawinglayer::primitive2d::UnifiedTransparencePrimitive2D* pNew2 =
+ new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
aStrokePrimitiveSequence,
(double)rOutlineAttribute.getTransparence() / 100.0);
aNewPrimitives.push_back(pNew2);
@@ -712,7 +712,9 @@ void SdrTextObj::impDecomposePathTextPrimitive(
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aRegularDecomposition;
std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aShadowDecomposition;
impPolygonParagraphHandler aPolygonParagraphHandler(
- rFormTextAttribute, aRegularDecomposition, aShadowDecomposition);
+ rFormTextAttribute,
+ aRegularDecomposition,
+ aShadowDecomposition);
sal_uInt32 a;
for(a = 0L; a < nLoopCount; a++)
@@ -751,10 +753,14 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add shadow outlines
- if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getShadowOutline())
+ if(rFormTextAttribute.getFormTextOutline()
+ && !rFormTextAttribute.getShadowOutline().isDefault())
{
const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
- impAddPathTextOutlines(aShadowDecomposition, *rFormTextAttribute.getShadowOutline()));
+ impAddPathTextOutlines(
+ aShadowDecomposition,
+ rFormTextAttribute.getShadowOutline()));
+
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalA, aOutlines);
}
}
@@ -770,10 +776,14 @@ void SdrTextObj::impDecomposePathTextPrimitive(
}
// evtl. add outlines
- if(rFormTextAttribute.getFormTextOutline() && rFormTextAttribute.getOutline())
+ if(rFormTextAttribute.getFormTextOutline()
+ && !rFormTextAttribute.getOutline().isDefault())
{
const drawinglayer::primitive2d::Primitive2DSequence aOutlines(
- impAddPathTextOutlines(aRegularDecomposition, *rFormTextAttribute.getOutline()));
+ impAddPathTextOutlines(
+ aRegularDecomposition,
+ rFormTextAttribute.getOutline()));
+
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(aRetvalB, aOutlines);
}
}
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 119141eca5..8cb92ceeb1 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -66,6 +66,7 @@
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include <algorithm>
+#include <svl/smplhint.hxx>
using namespace ::com::sun::star;
@@ -1165,7 +1166,8 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const
{
if(!mpViewContact)
{
- ((SdrPage*)this)->mpViewContact = ((SdrPage*)this)->CreateObjectSpecificViewContact();
+ const_cast< SdrPage* >(this)->mpViewContact =
+ const_cast< SdrPage* >(this)->CreateObjectSpecificViewContact();
}
return *mpViewContact;
@@ -1173,6 +1175,140 @@ sdr::contact::ViewContact& SdrPage::GetViewContact() const
////////////////////////////////////////////////////////////////////////////////////////////////////
+void SdrPageProperties::ImpRemoveStyleSheet()
+{
+ if(mpStyleSheet)
+ {
+ EndListening(*mpStyleSheet);
+ mpProperties->SetParent(0);
+ mpStyleSheet = 0;
+ }
+}
+
+void SdrPageProperties::ImpAddStyleSheet(SfxStyleSheet& rNewStyleSheet)
+{
+ if(mpStyleSheet != &rNewStyleSheet)
+ {
+ ImpRemoveStyleSheet();
+ mpStyleSheet = &rNewStyleSheet;
+ StartListening(rNewStyleSheet);
+ mpProperties->SetParent(&rNewStyleSheet.GetItemSet());
+ }
+}
+
+void ImpPageChange(SdrPage& rSdrPage)
+{
+ rSdrPage.ActionChanged();
+
+ if(rSdrPage.GetModel())
+ {
+ rSdrPage.GetModel()->SetChanged(true);
+ SdrHint aHint(HINT_PAGEORDERCHG);
+ aHint.SetPage(&rSdrPage);
+ rSdrPage.GetModel()->Broadcast(aHint);
+ }
+}
+
+SdrPageProperties::SdrPageProperties(SdrPage& rSdrPage)
+: SfxListener(),
+ mpSdrPage(&rSdrPage),
+ mpStyleSheet(0),
+ mpProperties(new SfxItemSet(mpSdrPage->GetModel()->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST))
+{
+ if(!rSdrPage.IsMasterPage())
+ {
+ mpProperties->Put(XFillStyleItem(XFILL_NONE));
+ }
+}
+
+SdrPageProperties::SdrPageProperties(const SdrPageProperties& rCandidate)
+: SfxListener(),
+ mpSdrPage(rCandidate.mpSdrPage),
+ mpStyleSheet(0),
+ mpProperties(new SfxItemSet(*rCandidate.mpProperties))
+{
+ if(rCandidate.GetStyleSheet())
+ {
+ ImpAddStyleSheet(*rCandidate.GetStyleSheet());
+ }
+}
+
+SdrPageProperties::~SdrPageProperties()
+{
+ ImpRemoveStyleSheet();
+ delete mpProperties;
+}
+
+void SdrPageProperties::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+{
+ const SfxSimpleHint* pSimpleHint = dynamic_cast< const SfxSimpleHint* >(&rHint);
+
+ if(pSimpleHint)
+ {
+ switch(pSimpleHint->GetId())
+ {
+ case SFX_HINT_DATACHANGED :
+ {
+ // notify change, broadcast
+ ImpPageChange(*mpSdrPage);
+ break;
+ }
+ case SFX_HINT_DYING :
+ {
+ // Style needs to be forgotten
+ ImpRemoveStyleSheet();
+ break;
+ }
+ }
+ }
+}
+
+const SfxItemSet& SdrPageProperties::GetItemSet() const
+{
+ return *mpProperties;
+}
+
+void SdrPageProperties::PutItemSet(const SfxItemSet& rSet)
+{
+ OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
+ mpProperties->Put(rSet);
+ ImpPageChange(*mpSdrPage);
+}
+
+void SdrPageProperties::PutItem(const SfxPoolItem& rItem)
+{
+ OSL_ENSURE(!mpSdrPage->IsMasterPage(), "Item set at MasterPage Attributes (!)");
+ mpProperties->Put(rItem);
+ ImpPageChange(*mpSdrPage);
+}
+
+void SdrPageProperties::ClearItem(const sal_uInt16 nWhich)
+{
+ mpProperties->ClearItem(nWhich);
+ ImpPageChange(*mpSdrPage);
+}
+
+void SdrPageProperties::SetStyleSheet(SfxStyleSheet* pStyleSheet)
+{
+ if(pStyleSheet)
+ {
+ ImpAddStyleSheet(*pStyleSheet);
+ }
+ else
+ {
+ ImpRemoveStyleSheet();
+ }
+
+ ImpPageChange(*mpSdrPage);
+}
+
+SfxStyleSheet* SdrPageProperties::GetStyleSheet() const
+{
+ return mpStyleSheet;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
TYPEINIT1(SdrPage,SdrObjList);
DBG_NAME(SdrPage)
SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
@@ -1185,7 +1321,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
nBordRgt(0L),
nBordLwr(0L),
pLayerAdmin(new SdrLayerAdmin(&rNewModel.GetLayerAdmin())),
- pBackgroundObj(0L),
+ mpSdrPageProperties(0),
mpMasterPageDescriptor(0L),
nPageNum(0L),
mbMaster(bMasterPage),
@@ -1197,6 +1333,8 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
DBG_CTOR(SdrPage,NULL);
aPrefVisiLayers.SetAll();
eListKind = (bMasterPage) ? SDROBJLIST_MASTERPAGE : SDROBJLIST_DRAWPAGE;
+
+ mpSdrPageProperties = new SdrPageProperties(*this);
}
SdrPage::SdrPage(const SdrPage& rSrcPage)
@@ -1210,7 +1348,7 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
nBordRgt(rSrcPage.nBordRgt),
nBordLwr(rSrcPage.nBordLwr),
pLayerAdmin(new SdrLayerAdmin(rSrcPage.pModel->GetLayerAdmin())),
- pBackgroundObj(0L),
+ mpSdrPageProperties(0),
mpMasterPageDescriptor(0L),
nPageNum(rSrcPage.nPageNum),
mbMaster(rSrcPage.mbMaster),
@@ -1244,6 +1382,8 @@ SdrPage::SdrPage(const SdrPage& rSrcPage)
mxUnoPage = NULL;
xComponent->dispose();
}
+
+ mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties());
}
SdrPage::~SdrPage()
@@ -1277,7 +1417,6 @@ SdrPage::~SdrPage()
// when they get called from PageInDestruction().
maPageUsers.clear();
- SdrObject::Free( pBackgroundObj );
delete pLayerAdmin;
TRG_ClearMasterPage();
@@ -1289,6 +1428,11 @@ SdrPage::~SdrPage()
mpViewContact = 0L;
}
+ {
+ delete mpSdrPageProperties;
+ mpSdrPageProperties = 0;
+ }
+
DBG_DTOR(SdrPage,NULL);
}
@@ -1300,8 +1444,6 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
mpViewContact = 0L;
}
- SdrObject::Free( pBackgroundObj );
-
// Joe also sets some parameters for the class this one
// is derived from. SdrObjList does the same bad handling of
// copy constructor and operator=, so i better let it stand here.
@@ -1335,14 +1477,9 @@ void SdrPage::operator=(const SdrPage& rSrcPage)
mbObjectsNotPersistent = rSrcPage.mbObjectsNotPersistent;
- if(rSrcPage.pBackgroundObj)
{
- pBackgroundObj = rSrcPage.pBackgroundObj->Clone();
- pBackgroundObj->SetPage( this );
- pBackgroundObj->SetModel( pModel );
-
- // #i62000# for single-page MPBGO, force no line
- pBackgroundObj->SetMergedItem(XLineStyleItem(XLINE_NONE));
+ delete mpSdrPageProperties;
+ mpSdrPageProperties = new SdrPageProperties(rSrcPage.getSdrPageProperties());
}
// Now copy the contained obejcts (by cloning them)
@@ -1522,8 +1659,9 @@ void SdrPage::SetModel(SdrModel* pNewModel)
}
pLayerAdmin->SetModel(pNewModel);
- if( pBackgroundObj )
- pBackgroundObj->SetModel( pNewModel );
+ SdrPageProperties *pNew = new SdrPageProperties(getSdrPageProperties());
+ delete mpSdrPageProperties;
+ mpSdrPageProperties = pNew;
}
// update listeners at possible api wrapper object
@@ -1657,22 +1795,6 @@ XubString SdrPage::GetLayoutName() const
return String();
}
-void SdrPage::SetBackgroundObj( SdrObject* pObj )
-{
- if ( pObj )
- {
- pObj->SetPage( this );
- pObj->SetModel( pModel );
- pObj->SetLayer( 1 ); // Nothing known about the backgroundlayer...
-
- // #i62000# for single-page MPBGO, force no line
- pObj->SetMergedItem(XLineStyleItem(XLINE_NONE));
- }
-
- SdrObject::Free( pBackgroundObj );
- pBackgroundObj = pObj;
-}
-
void SdrPage::SetInserted( bool bIns )
{
if( mbInserted != bIns )
@@ -1746,38 +1868,17 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay )
aColor = pView->GetApplicationDocumentColor();
}
- // first, see if we have a background object
- SdrObject* pBackgroundObj2 = NULL;
-
+ const SfxItemSet* pBackgroundFill = &getSdrPageProperties().GetItemSet();
- if( IsMasterPage() )
- {
- if( GetObjCount() )
- pBackgroundObj2 = GetObj( 0 );
- }
- else
+ if(!IsMasterPage() && TRG_HasMasterPage())
{
- pBackgroundObj2 = GetBackgroundObj();
- if( NULL == pBackgroundObj2 )
+ if(XFILL_NONE == ((const XFillStyleItem&)pBackgroundFill->Get(XATTR_FILLSTYLE)).GetValue())
{
- // if not, see if we have a masterpage and get that background object
- if(TRG_HasMasterPage())
- {
- SdrPage& rMasterPage = TRG_GetMasterPage();
-
- if(rMasterPage.GetObjCount())
- {
- pBackgroundObj2 = rMasterPage.GetObj( 0 );
- }
- }
+ pBackgroundFill = &TRG_GetMasterPage().getSdrPageProperties().GetItemSet();
}
}
- if( pBackgroundObj2 )
- {
- const SfxItemSet& rSet = pBackgroundObj2->GetMergedItemSet();
- GetDraftFillColor( rSet, aColor );
- }
+ GetDraftFillColor(*pBackgroundFill, aColor);
return aColor;
}
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 17c5b6be1f..6b58e623e4 100644..100755
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -294,6 +294,9 @@ SdrPaintView::SdrPaintView(SdrModel* pModel1, OutputDevice* pOut)
SdrPaintView::~SdrPaintView()
{
DBG_DTOR(SdrPaintView,NULL);
+ if (pDefaultStyleSheet)
+ EndListening(*pDefaultStyleSheet);
+
maColorConfig.RemoveListener(this);
ClearPageView();
@@ -317,8 +320,16 @@ SdrPaintView::~SdrPaintView()
////////////////////////////////////////////////////////////////////////////////////////////////////
-void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+void __EXPORT SdrPaintView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
+ //If the stylesheet has been destroyed
+ if (&rBC == pDefaultStyleSheet)
+ {
+ if (rHint.ISA(SfxSimpleHint) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING)
+ pDefaultStyleSheet = NULL;
+ return;
+ }
+
BOOL bObjChg=!bSomeObjChgdFlag; // TRUE= auswerten fuer ComeBack-Timer
if (bObjChg) {
SdrHint* pSdrHint=PTR_CAST(SdrHint,&rHint);
@@ -333,7 +344,7 @@ void __EXPORT SdrPaintView::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint
if (eKind==HINT_PAGEORDERCHG) {
const SdrPage* pPg=pSdrHint->GetPage();
- if(!pPg->IsInserted())
+ if(pPg && !pPg->IsInserted())
{
if(mpPageView && mpPageView->GetPage() == pPg)
{
@@ -1238,7 +1249,12 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, BOOL bReplaceAll)
void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, BOOL bDontRemoveHardAttr)
{
+ if (pDefaultStyleSheet)
+ EndListening(*pDefaultStyleSheet);
pDefaultStyleSheet=pStyleSheet;
+ if (pDefaultStyleSheet)
+ StartListening(*pDefaultStyleSheet);
+
if (pStyleSheet!=NULL && !bDontRemoveHardAttr) {
SfxWhichIter aIter(pStyleSheet->GetItemSet());
USHORT nWhich=aIter.FirstWhich();
diff --git a/svx/source/svdraw/svdscrol.cxx b/svx/source/svdraw/svdscrol.cxx
deleted file mode 100644
index 0e7ebaf7eb..0000000000
--- a/svx/source/svdraw/svdscrol.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-
-#include "svdscrol.hxx"
-
-// eof
diff --git a/svx/source/svdraw/svdscrol.hxx b/svx/source/svdraw/svdscrol.hxx
deleted file mode 100644
index bf900c6380..0000000000
--- a/svx/source/svdraw/svdscrol.hxx
+++ /dev/null
@@ -1,31 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVDSCROL_HXX
-#define _SVDSCROL_HXX
-
-#endif //_SVDSCROL_HXX
diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx
index daa2d0242b..648f1fd6b4 100644
--- a/svx/source/table/tablehandles.cxx
+++ b/svx/source/table/tablehandles.cxx
@@ -47,7 +47,7 @@
#include <svx/svdpagv.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <svx/sdr/overlay/overlayhatchrect.hxx>
-#include <drawinglayer/primitive2d/hittestprimitive2d.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
namespace sdr { namespace table {
@@ -242,10 +242,11 @@ drawinglayer::primitive2d::Primitive2DSequence OverlayTableEdge::createOverlayOb
}
else
{
- // embed in HitTest primitive to support HitTest of this overlay object
+ // embed in HiddenGeometryPrimitive2D to support HitTest of this invisible
+ // overlay object
const drawinglayer::primitive2d::Primitive2DSequence aSequence(&aReference, 1);
const drawinglayer::primitive2d::Primitive2DReference aNewReference(
- new drawinglayer::primitive2d::HitTestPrimitive2D(aSequence));
+ new drawinglayer::primitive2d::HiddenGeometryPrimitive2D(aSequence));
aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aNewReference, 1);
}
}
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index 48c6264caa..5f0af00fc5 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -34,19 +34,20 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
#include <drawinglayer/primitive2d/groupprimitive2d.hxx>
#include <svx/sdr/primitive2d/sdrdecompositiontools.hxx>
-#include <drawinglayer/attribute/sdrattribute.hxx>
#include <svx/sdr/primitive2d/sdrattributecreator.hxx>
-#include <drawinglayer/attribute/fillattribute.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <svx/sdr/attribute/sdrtextattribute.hxx>
-#include <svx/sdr/attribute/sdrallattribute.hxx>
#include <svx/sdr/primitive2d/svx_primitivetypes2d.hxx>
#include <editeng/borderline.hxx>
#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
+#include <svx/sdr/attribute/sdrfilltextattribute.hxx>
+#include <drawinglayer/attribute/sdrlineattribute.hxx>
+#include <drawinglayer/attribute/sdrshadowattribute.hxx>
+#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "cell.hxx"
#include "tablelayouter.hxx"
@@ -94,34 +95,42 @@ namespace drawinglayer
Primitive2DSequence SdrCellPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*aViewInformation*/) const
{
+ // prepare unit polygon
Primitive2DSequence aRetval;
+ const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createUnitPolygon());
- if(getSdrFTAttribute().getFill() || getSdrFTAttribute().getText())
+ // add fill
+ if(!getSdrFTAttribute().getFill().isDefault())
{
- // prepare unit polygon
- const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
- const basegfx::B2DPolyPolygon aUnitPolyPolygon(basegfx::tools::createPolygonFromRect(aUnitRange));
-
- // add fill
- if(getSdrFTAttribute().getFill())
- {
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createPolyPolygonFillPrimitive(
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createPolyPolygonFillPrimitive(
aUnitPolyPolygon,
getTransform(),
- *getSdrFTAttribute().getFill(),
+ getSdrFTAttribute().getFill(),
getSdrFTAttribute().getFillFloatTransGradient()));
- }
+ }
+ else
+ {
+ // if no fill create one for HitTest and BoundRect fallback
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createHiddenGeometryPrimitives2D(
+ true,
+ aUnitPolyPolygon,
+ getTransform()));
+ }
- // add text
- if(getSdrFTAttribute().getText())
- {
- appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
+ // add text
+ if(!getSdrFTAttribute().getText().isDefault())
+ {
+ appendPrimitive2DReferenceToPrimitive2DSequence(aRetval,
+ createTextPrimitive(
aUnitPolyPolygon,
getTransform(),
- *getSdrFTAttribute().getText(),
- 0,
- true, false, false));
- }
+ getSdrFTAttribute().getText(),
+ attribute::SdrLineAttribute(),
+ true,
+ false,
+ false));
}
return aRetval;
@@ -536,14 +545,13 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfTableObj::createViewIndependentPrimitive2DSequence() const
{
- drawinglayer::primitive2d::Primitive2DSequence xRetval;
const sdr::table::SdrTableObj& rTableObj = GetTableObj();
const uno::Reference< com::sun::star::table::XTable > xTable = rTableObj.getTable();
- const SfxItemSet& rObjectItemSet = rTableObj.GetMergedItemSet();
if(xTable.is())
{
// create primitive representation for table
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
const sal_Int32 nRowCount(xTable->getRowCount());
const sal_Int32 nColCount(xTable->getColumnCount());
const sal_Int32 nAllCount(nRowCount * nColCount);
@@ -596,7 +604,7 @@ namespace sdr
const SfxItemSet& rCellItemSet = xCurrentCell->GetItemSet();
const sal_uInt32 nTextIndex(nColCount * aCellPos.mnRow + aCellPos.mnCol);
const SdrText* pSdrText = rTableObj.getText(nTextIndex);
- drawinglayer::attribute::SdrFillTextAttribute* pAttribute = 0;
+ drawinglayer::attribute::SdrFillTextAttribute aAttribute;
if(pSdrText)
{
@@ -606,7 +614,7 @@ namespace sdr
const sal_Int32 nUpper(xCurrentCell->GetTextUpperDistance());
const sal_Int32 nLower(xCurrentCell->GetTextLowerDistance());
- pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
+ aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
rCellItemSet,
pSdrText,
&nLeft,
@@ -616,21 +624,17 @@ namespace sdr
}
else
{
- pAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
+ aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute(
rCellItemSet,
pSdrText);
}
- if(pAttribute)
+ // always create cell primitives for BoundRect and HitTest
{
- if(pAttribute->isVisible())
- {
- const drawinglayer::primitive2d::Primitive2DReference xCellReference(new drawinglayer::primitive2d::SdrCellPrimitive2D(
- aCellMatrix, *pAttribute));
- xCellSequence[nCellInsert++] = xCellReference;
- }
-
- delete pAttribute;
+ const drawinglayer::primitive2d::Primitive2DReference xCellReference(
+ new drawinglayer::primitive2d::SdrCellPrimitive2D(
+ aCellMatrix, aAttribute));
+ xCellSequence[nCellInsert++] = xCellReference;
}
// handle cell borders
@@ -675,21 +679,46 @@ namespace sdr
xRetval = xCellSequence;
drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(xRetval, xBorderSequence);
}
- }
- if(xRetval.hasElements())
- {
- // check and create evtl. shadow for created content
- drawinglayer::attribute::SdrShadowAttribute* pNewShadowAttribute = drawinglayer::primitive2d::createNewSdrShadowAttribute(rObjectItemSet);
-
- if(pNewShadowAttribute)
+ if(xRetval.hasElements())
{
- xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, *pNewShadowAttribute);
- delete pNewShadowAttribute;
+ // check and create evtl. shadow for created content
+ const SfxItemSet& rObjectItemSet = rTableObj.GetMergedItemSet();
+ const drawinglayer::attribute::SdrShadowAttribute aNewShadowAttribute(
+ drawinglayer::primitive2d::createNewSdrShadowAttribute(rObjectItemSet));
+
+ if(!aNewShadowAttribute.isDefault())
+ {
+ xRetval = drawinglayer::primitive2d::createEmbeddedShadowPrimitive(xRetval, aNewShadowAttribute);
+ }
}
- }
- return xRetval;
+ return xRetval;
+ }
+ else
+ {
+ // take unrotated snap rect (direct model data) for position and size
+ const Rectangle& rRectangle = rTableObj.GetGeoRect();
+ const basegfx::B2DRange aObjectRange(
+ rRectangle.Left(), rRectangle.Top(),
+ rRectangle.Right(), rRectangle.Bottom());
+
+ // create object matrix
+ const GeoStat& rGeoStat(rTableObj.GetGeoStat());
+ const double fShearX(rGeoStat.nShearWink ? tan((36000 - rGeoStat.nShearWink) * F_PI18000) : 0.0);
+ const double fRotate(rGeoStat.nDrehWink ? (36000 - rGeoStat.nDrehWink) * F_PI18000 : 0.0);
+ const basegfx::B2DHomMatrix aObjectMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ aObjectRange.getWidth(), aObjectRange.getHeight(), fShearX, fRotate,
+ aObjectRange.getMinX(), aObjectRange.getMinY()));
+
+ // credate an invisible outline for the cases where no visible content exists
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
+ false,
+ aObjectMatrix));
+
+ return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
+ }
}
ViewContactOfTableObj::ViewContactOfTableObj(::sdr::table::SdrTableObj& rTableObj)
diff --git a/svx/source/tbxctrls/tbxcolor.cxx b/svx/source/tbxctrls/tbxcolor.cxx
index 65dff84084..40082c4624 100644
--- a/svx/source/tbxctrls/tbxcolor.cxx
+++ b/svx/source/tbxctrls/tbxcolor.cxx
@@ -62,7 +62,7 @@ namespace svx
{
try
{
- Reference< XFrame > xFrame = SfxViewFrame::Current()->GetFrame()->GetFrameInterface();
+ Reference< XFrame > xFrame = SfxViewFrame::Current()->GetFrame().GetFrameInterface();
Reference< XPropertySet > xFrameProps( xFrame, UNO_QUERY );
if ( xFrameProps.is() )
xFrameProps->getPropertyValue( PROPNAME_LAYOUTMANAGER ) >>= m_xLayouter;
diff --git a/svx/source/unodialogs/textconversiondlgs/export.map b/svx/source/unodialogs/textconversiondlgs/export.map
deleted file mode 100644
index ff4971857d..0000000000
--- a/svx/source/unodialogs/textconversiondlgs/export.map
+++ /dev/null
@@ -1,8 +0,0 @@
-EXTDBI_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/svx/source/unodialogs/textconversiondlgs/makefile.mk b/svx/source/unodialogs/textconversiondlgs/makefile.mk
index 6cdec3906c..b5013ca9d1 100644
--- a/svx/source/unodialogs/textconversiondlgs/makefile.mk
+++ b/svx/source/unodialogs/textconversiondlgs/makefile.mk
@@ -59,7 +59,7 @@ SHL1TARGET= txcnvdlg
.ELSE
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
.ENDIF
-SHL1VERSIONMAP= export.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1STDLIBS= \
$(CPPULIB) \
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index be91f08fe5..1c6a0a17eb 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -615,32 +615,17 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
VirtualDevice aVDev;
const MapMode aMap( mpDoc->GetScaleUnit(), Point(), rSettings.maScaleX, rSettings.maScaleY );
- // create a view
- SdrView* pView;
-
- if( PTR_CAST( FmFormModel, mpDoc ) )
- {
- pView = new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev );
- }
- else
- {
- pView = new SdrView( mpDoc, &aVDev );
- }
-
- pView->SetBordVisible( FALSE );
- pView->SetPageVisible( FALSE );
- pView->ShowSdrPage( pPage );
-
SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL);
maOldCalcFieldValueHdl = rOutl.GetCalcFieldValueHdl();
rOutl.SetCalcFieldValueHdl( LINK(this, GraphicExporter, CalcFieldValueHdl) );
- rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pView->GetSdrPageView()) );
+ rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor() );
// #i102251#
const sal_uInt32 nOldCntrl(rOutl.GetControlWord());
sal_uInt32 nCntrl = nOldCntrl & ~EE_CNTRL_ONLINESPELLING;
rOutl.SetControlWord(nCntrl);
+ SdrObject* pTempBackgroundShape = 0;
std::vector< SdrObject* > aShapes;
bool bRet = true;
@@ -649,19 +634,10 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
{
if( rSettings.mbExportOnlyBackground )
{
- SdrObject* pShape = 0;
- if( pPage->IsMasterPage() )
- {
- if( pPage->GetObjCount() > 0 )
- pShape = pPage->GetObj(0);
- }
- else
- {
- pShape = pPage->GetBackgroundObj();
- }
-
- if( pShape )
- aShapes.push_back( pShape );
+ pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize()));
+ pTempBackgroundShape->SetMergedItemSet(pPage->getSdrPageProperties().GetItemSet());
+ pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE));
+ aShapes.push_back(pTempBackgroundShape);
}
else
{
@@ -738,8 +714,24 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
aVDev.SetDrawMode( aVDev.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT );
aVDev.EnableOutput( FALSE );
aMtf.Record( &aVDev );
-
Size aNewSize;
+
+ // create a view
+ SdrView* pView;
+
+ if( PTR_CAST( FmFormModel, mpDoc ) )
+ {
+ pView = new FmFormView( PTR_CAST( FmFormModel, mpDoc ), &aVDev );
+ }
+ else
+ {
+ pView = new SdrView( mpDoc, &aVDev );
+ }
+
+ pView->SetBordVisible( FALSE );
+ pView->SetPageVisible( FALSE );
+ pView->ShowSdrPage( pPage );
+
if ( pView && pPage )
{
pView->SetBordVisible( FALSE );
@@ -780,6 +772,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
aGraphic = Graphic(aMtf);
}
+ if ( pView )
+ {
+ pView->HideSdrPage();
+ delete pView;
+ }
+
if( rSettings.mbTranslucent )
{
Size aOutSize;
@@ -904,15 +902,6 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
// calculate bound rect for all shapes
Rectangle aBound;
- if(rSettings.mbExportOnlyBackground)
- {
- // shape is MPBGO and if it's not yet set, it's size will
- // be empty when using GetCurrentBoundRect(). Since anyways
- // the page size is used by MPBGO and MPBGO is EOLd, get
- // the wanted size from the page model directly
- aBound = Rectangle(Point(0,0), pPage->GetSize());
- }
- else
{
std::vector< SdrObject* >::iterator aIter = aShapes.begin();
const std::vector< SdrObject* >::iterator aEnd = aShapes.end();
@@ -986,10 +975,9 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
}
}
- if ( pView )
+ if(pTempBackgroundShape)
{
- pView->HideSdrPage();
- delete pView;
+ SdrObject::Free(pTempBackgroundShape);
}
rOutl.SetCalcFieldValueHdl( maOldCalcFieldValueHdl );
diff --git a/svx/source/xml/xmlexport.cxx b/svx/source/xml/xmlexport.cxx
index 87c53533c1..25577a3fed 100644
--- a/svx/source/xml/xmlexport.cxx
+++ b/svx/source/xml/xmlexport.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svx.hxx"
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -52,12 +53,12 @@ using ::rtl::OUString;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
-sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStream> xOut, Reference< lang::XComponent > xComponent )
+sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputStream>& xOut, const Reference< lang::XComponent >& xComponent )
{
return SvxDrawingLayerExport( pModel, xOut, xComponent, "com.sun.star.comp.DrawingLayer.XMLExporter" );
}
-sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStream> xOut, Reference< lang::XComponent > xComponent, const char* pExportService )
+sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputStream>& xOut, const Reference< lang::XComponent >& xComponent, const char* pExportService )
{
sal_Bool bDocRet = xOut.is();
@@ -67,12 +68,13 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
Reference< document::XEmbeddedObjectResolver > xObjectResolver;
SvXMLEmbeddedObjectHelper *pObjectHelper = 0;
+ Reference< lang::XComponent > xSourceDoc( xComponent );
try
{
- if( !xComponent.is() )
+ if( !xSourceDoc.is() )
{
- xComponent = new SvxUnoDrawingModel( pModel );
- pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
+ xSourceDoc = new SvxUnoDrawingModel( pModel );
+ pModel->setUnoModel( Reference< XInterface >::query( xSourceDoc ) );
}
uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() );
@@ -127,7 +129,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
uno::Reference< document::XExporter > xExporter( xFilter, uno::UNO_QUERY );
if( xExporter.is() )
{
- xExporter->setSourceDocument( xComponent );
+ xExporter->setSourceDocument( xSourceDoc );
uno::Sequence< beans::PropertyValue > aDescriptor( 0 );
bDocRet = xFilter->filter( aDescriptor );
@@ -138,11 +140,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
}
catch(uno::Exception e)
{
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "uno Exception caught while exporting:\n" );
- aError += ByteString( String( e.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#endif
+ DBG_UNHANDLED_EXCEPTION();
bDocRet = sal_False;
}
@@ -157,7 +155,7 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
return bDocRet;
}
-sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStream> xOut )
+sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const uno::Reference<io::XOutputStream>& xOut )
{
Reference< lang::XComponent > xComponent;
return SvxDrawingLayerExport( pModel, xOut, xComponent );
@@ -165,12 +163,12 @@ sal_Bool SvxDrawingLayerExport( SdrModel* pModel, uno::Reference<io::XOutputStre
//-////////////////////////////////////////////////////////////////////
-sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStream> xInputStream, Reference< lang::XComponent > xComponent )
+sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStream>& xInputStream, const Reference< lang::XComponent >& xComponent )
{
return SvxDrawingLayerImport( pModel, xInputStream, xComponent, "com.sun.star.comp.Draw.XMLOasisImporter" );
}
-sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStream> xInputStream, Reference< lang::XComponent > xComponent, const char* pImportService )
+sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStream>& xInputStream, const Reference< lang::XComponent >& xComponent, const char* pImportService )
{
sal_uInt32 nRet = 0;
@@ -180,13 +178,14 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
Reference< document::XEmbeddedObjectResolver > xObjectResolver;
SvXMLEmbeddedObjectHelper *pObjectHelper = 0;
- if( !xComponent.is() )
+ Reference< lang::XComponent > xTargetDocument( xComponent );
+ if( !xTargetDocument.is() )
{
- xComponent = new SvxUnoDrawingModel( pModel );
- pModel->setUnoModel( Reference< XInterface >::query( xComponent ) );
+ xTargetDocument = new SvxUnoDrawingModel( pModel );
+ pModel->setUnoModel( Reference< XInterface >::query( xTargetDocument ) );
}
- Reference< frame::XModel > xModel( xComponent, UNO_QUERY );
+ Reference< frame::XModel > xTargetModel( xTargetDocument, UNO_QUERY );
try
{
@@ -199,7 +198,8 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
if( 0 == nRet )
{
- xModel->lockControllers();
+ if ( xTargetModel.is() )
+ xTargetModel->lockControllers();
// -------------------------------------
@@ -248,7 +248,7 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
// connect model and filter
uno::Reference < document::XImporter > xImporter( xFilter, UNO_QUERY );
- xImporter->setTargetDocument( xComponent );
+ xImporter->setTargetDocument( xTargetDocument );
// finally, parser the stream
xParser->parseStream( aParserInput );
@@ -257,45 +257,9 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
}
}
}
- catch( xml::sax::SAXParseException& r )
- {
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "SAX parse exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#else
- (void) r; // avoid warnings
-#endif
- }
- catch( xml::sax::SAXException& r )
- {
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "SAX exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#else
- (void) r; // avoid warnings
-#endif
- }
- catch( io::IOException& r )
- {
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "IO exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#else
- (void) r; // avoid warnings
-#endif
- }
catch( uno::Exception& r )
{
-#if OSL_DEBUG_LEVEL > 1
- ByteString aError( "uno exception catched while importing:\n" );
- aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US );
- DBG_ERROR( aError.GetBuffer() );
-#else
- (void) r; // avoid warnings
-#endif
+ DBG_UNHANDLED_EXCEPTION();
}
if( pGraphicHelper )
@@ -306,13 +270,13 @@ sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStrea
SvXMLEmbeddedObjectHelper::Destroy( pObjectHelper );
xObjectResolver = 0;
- if( xModel.is() )
- xModel->unlockControllers();
+ if ( xTargetModel.is() )
+ xTargetModel->unlockControllers();
return nRet == 0;
}
-sal_Bool SvxDrawingLayerImport( SdrModel* pModel, uno::Reference<io::XInputStream> xInputStream )
+sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStream>& xInputStream )
{
Reference< lang::XComponent > xComponent;
return SvxDrawingLayerImport( pModel, xInputStream, xComponent );