You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/06/18 18:00:14 UTC
svn commit: r1351396 [2/2] - in /incubator/ooo/branches/alg/aw080/main:
sd/source/ui/func/ sd/source/ui/inc/ svx/inc/svx/
svx/inc/svx/sdr/properties/ svx/source/customshapes/ svx/source/engine3d/
svx/source/sdr/contact/ svx/source/sdr/properties/ svx/s...
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShapeEngine.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShapeEngine.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShapeEngine.cxx Mon Jun 18 16:00:11 2012
@@ -275,8 +275,9 @@ REF( com::sun::star::drawing::XShape ) S
throw ( NMSP_UNO::RuntimeException )
{
REF( com::sun::star::drawing::XShape ) xShape;
- SdrObject* pSdrObjCustomShape( GetSdrObjectFromXShape( mxShape ) );
- if ( pSdrObjCustomShape )
+ SdrObjCustomShape* pSdrObjCustomShape(dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(mxShape)));
+
+ if ( pSdrObjCustomShape )
{
// retrieving the TextPath property to check if feature is enabled
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)
@@ -306,7 +307,7 @@ REF( com::sun::star::drawing::XShape ) S
pRenderedShape = pRenderedFontWork;
}
}
- SdrObject* pRenderedShape3d = EnhancedCustomShape3d::Create3DObject( pRenderedShape, pSdrObjCustomShape );
+ SdrObject* pRenderedShape3d = EnhancedCustomShape3d::Create3DObject(*pRenderedShape, *pSdrObjCustomShape);
if ( pRenderedShape3d )
{
// bFlipV = bFlipH = sal_False;
@@ -350,7 +351,7 @@ REF( com::sun::star::drawing::XShape ) S
// sdr::legacy::MirrorSdrObject(*pRenderedShape, aTop, aBottom );
// }
- pRenderedShape->SetStyleSheet( pSdrObjCustomShape->GetStyleSheet(), sal_True );
+ pRenderedShape->SetStyleSheet(pSdrObjCustomShape->GetStyleSheet(), true);
}
if ( mbForceGroupWithText )
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx Mon Jun 18 16:00:11 2012
@@ -846,12 +846,6 @@ SdrObject* CreateSdrObjectFromParagraphO
aTextAreaIter++;
}
- Point aP( sdr::legacy::GetSnapRect(*pCustomShape).Center() );
- Size aS( sdr::legacy::GetLogicRect(*pCustomShape).GetSize() );
- aP.X() -= aS.Width() / 2;
- aP.Y() -= aS.Height() / 2;
- Rectangle aLogicRect( aP, aS );
-
SfxItemSet aSet( pCustomShape->GetMergedItemSet() );
aSet.ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created
aSet.Put(SdrOnOffItem(SDRATTR_SHADOW, sal_False)); // #i37011# NO shadow for FontWork geometry
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/engine3d/view3d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/engine3d/view3d.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/engine3d/view3d.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/engine3d/view3d.cxx Mon Jun 18 16:00:11 2012
@@ -611,7 +611,7 @@ bool E3dView::ImpCloneAll3DObjectsToDest
// fill and insert new object
pNewCompoundObj->SetLayer(pCompoundObj->GetLayer());
- pNewCompoundObj->SetStyleSheet(pCompoundObj->GetStyleSheet(), sal_True);
+ pNewCompoundObj->SetStyleSheet(pCompoundObj->GetStyleSheet(), true);
pDstScene->Insert3DObj(*pNewCompoundObj);
bRetval = true;
@@ -810,7 +810,7 @@ void E3dView::ImpCreateSingle3DObjectFla
{
p3DObj->SetLayer(pObj->GetLayer());
p3DObj->SetMergedItemSet(aSet);
- p3DObj->SetStyleSheet(pObj->GetStyleSheet(), sal_True);
+ p3DObj->SetStyleSheet(pObj->GetStyleSheet(), true);
// Neues 3D-Objekt einfuegen
pScene->Insert3DObj(*p3DObj);
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx Mon Jun 18 16:00:11 2012
@@ -76,7 +76,7 @@ namespace sdr
if(rCaptionObj.GetEdgeRadius())
{
// get absolute object size
- const basegfx::B2DVector aObjectScale(absolute(rCaptionObj.getSdrObjectScale()));
+ const basegfx::B2DVector aObjectScale(basegfx::absolute(rCaptionObj.getSdrObjectScale()));
drawinglayer::primitive2d::calculateRelativeCornerRadius(
rCaptionObj.GetEdgeRadius(),
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx Mon Jun 18 16:00:11 2012
@@ -142,7 +142,7 @@ namespace sdr
// build unrotated object range
const basegfx::B2DRange aObjectRange(
GetCustomShapeObj().getSdrObjectTranslate(),
- GetCustomShapeObj().getSdrObjectTranslate() + GetCustomShapeObj().getSdrObjectScale());
+ GetCustomShapeObj().getSdrObjectTranslate() + basegfx::absolute(GetCustomShapeObj().getSdrObjectScale()));
if(bHasText || xGroup.hasElements())
{
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/attributeproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/attributeproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/attributeproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/attributeproperties.cxx Mon Jun 18 16:00:11 2012
@@ -55,14 +55,18 @@ namespace sdr
{
namespace properties
{
- void AttributeProperties::ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void AttributeProperties::ImpAddStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
- // test if old StyleSheet is cleared, else it would be lost
- // after this method -> memory leak (!)
- DBG_ASSERT(!mpStyleSheet, "Old style sheet not deleted before setting new one (!)");
+ // test if old StyleSheet is cleared
+ if(GetStyleSheet())
+ {
+ DBG_ASSERT(!mpStyleSheet, "Old style sheet not deleted before setting new one (!)");
+ ImpRemoveStyleSheet();
+ }
if(pNewStyleSheet)
{
+ // remember StyleSheet
mpStyleSheet = pNewStyleSheet;
// local ItemSet is needed here, force it
@@ -97,26 +101,180 @@ namespace sdr
void AttributeProperties::ImpRemoveStyleSheet()
{
- // Check type since it is destroyed when the type is deleted
- if(GetStyleSheet() && dynamic_cast< SfxStyleSheet* >(mpStyleSheet))
+ if(GetStyleSheet())
{
+ // deregister as listener
EndListening(*mpStyleSheet);
EndListening(mpStyleSheet->GetPool());
// reset parent of ItemSet
if(mpItemSet)
{
- mpItemSet->SetParent(0L);
+ mpItemSet->SetParent(0);
}
- SdrObject& rObj = GetSdrObject();
- rObj.ActionChanged();
+ // trigger change at owning SdrObject
+ GetSdrObject().ActionChanged();
+ }
+
+ mpStyleSheet = 0;
+ }
+
+ void AttributeProperties::ImpModelChange(SdrModel& rSourceModel, SdrModel& rTargetModel)
+ {
+ // If metric has changed, scale items.
+ const MapUnit aOldUnit(rSourceModel.GetExchangeObjectUnit());
+ const MapUnit aNewUnit(rTargetModel.GetExchangeObjectUnit());
+ const bool bScaleUnitChanged(aNewUnit != aOldUnit);
+ Fraction aMetricFactor;
+
+ if(bScaleUnitChanged)
+ {
+ aMetricFactor = GetMapFactor(aOldUnit, aNewUnit).X();
+ Scale(aMetricFactor);
}
- mpStyleSheet = 0L;
+ // Move all styles which are used by the object to the new
+ // StyleSheet pool
+ SfxStyleSheet* pOldStyleSheet = GetStyleSheet();
+
+ if(pOldStyleSheet)
+ {
+ SfxStyleSheetBase* pSheet = pOldStyleSheet;
+ SfxStyleSheetBasePool* pOldPool = rSourceModel.GetStyleSheetPool();
+ SfxStyleSheetBasePool* pNewPool = rTargetModel.GetStyleSheetPool();
+
+ if(pOldPool && pNewPool)
+ {
+ // build a list of to-be-copied Styles
+ std::vector< SfxStyleSheetBase* > aStyleSheetStack;
+ SfxStyleSheetBase* pAnchor = 0;
+
+ while(pSheet)
+ {
+ pAnchor = pNewPool->Find(pSheet->GetName(), pSheet->GetFamily());
+
+ if(!pAnchor)
+ {
+ aStyleSheetStack.push_back(pSheet);
+ pSheet = pOldPool->Find(pSheet->GetParent(), pSheet->GetFamily());
+ }
+ else
+ {
+ // the style does exist
+ pSheet = 0L;
+ }
+ }
+
+ // copy and set the parents
+ SfxStyleSheetBase* pNewSheet = 0;
+ SfxStyleSheetBase* pLastSheet = 0;
+ SfxStyleSheetBase* pForThisObject = 0;
+
+ for(sal_uInt32 a(0); a < aStyleSheetStack.size(); a++)
+ {
+ pSheet = aStyleSheetStack[a];
+ pNewSheet = &pNewPool->Make(pSheet->GetName(), pSheet->GetFamily(), pSheet->GetMask());
+ pNewSheet->GetItemSet().Put(pSheet->GetItemSet(), sal_False);
+
+ if(bScaleUnitChanged)
+ {
+ sdr::properties::ScaleItemSet(pNewSheet->GetItemSet(), aMetricFactor);
+ }
+
+ if(pLastSheet)
+ {
+ pLastSheet->SetParent(pNewSheet->GetName());
+ }
+
+ if(!pForThisObject)
+ {
+ pForThisObject = pNewSheet;
+ }
+
+ pLastSheet = pNewSheet;
+ }
+
+ // Set link to the Style found in the Pool
+ if(pAnchor && pLastSheet)
+ {
+ pLastSheet->SetParent(pAnchor->GetName());
+ }
+
+ // if list was empty (all Styles exist in destination pool)
+ // pForThisObject is not yet set
+ if(!pForThisObject && pAnchor)
+ {
+ pForThisObject = pAnchor;
+ }
+
+ // De-register at old and register at new Style
+ if(GetStyleSheet() != pForThisObject)
+ {
+ ImpRemoveStyleSheet();
+ ImpAddStyleSheet((SfxStyleSheet*)pForThisObject, sal_True);
+ }
+ }
+ else
+ {
+ // there is no StyleSheetPool in the new model, thus set
+ // all items as hard items in the object
+ std::vector< const SfxItemSet* > aItemSetStack;
+ const SfxItemSet* pItemSet = &pOldStyleSheet->GetItemSet();
+
+ while(pItemSet)
+ {
+ aItemSetStack.push_back(pItemSet);
+ pItemSet = pItemSet->GetParent();
+ }
+
+ SfxItemSet* pNewSet = &CreateObjectSpecificItemSet(rTargetModel.GetItemPool());
+
+ for(sal_uInt32 a(0); a < aItemSetStack.size(); a++)
+ {
+ pItemSet = aItemSetStack[aItemSetStack.size() - 1 - a];
+ pNewSet->Put(*pItemSet);
+ }
+
+ // Items which were hard attributes before need to stay
+ if(mpItemSet)
+ {
+ SfxWhichIter aIter(*mpItemSet);
+ sal_uInt16 nWhich = aIter.FirstWhich();
+
+ while(nWhich)
+ {
+ if(mpItemSet->GetItemState(nWhich, false) == SFX_ITEM_SET)
+ {
+ pNewSet->Put(mpItemSet->Get(nWhich));
+ }
+
+ nWhich = aIter.NextWhich();
+ }
+ }
+
+ if(bScaleUnitChanged)
+ {
+ ScaleItemSet(*pNewSet, aMetricFactor);
+ }
+
+ if(mpItemSet)
+ {
+ if(GetStyleSheet())
+ {
+ ImpRemoveStyleSheet();
+ }
+
+ delete mpItemSet;
+ mpItemSet = 0;
+ }
+
+ mpItemSet = pNewSet;
+ }
+ }
}
- // create a new itemset
+ // create a new itemset
SfxItemSet& AttributeProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool)
{
return *(new SfxItemSet(rPool,
@@ -132,17 +290,41 @@ namespace sdr
AttributeProperties::AttributeProperties(SdrObject& rObj)
: DefaultProperties(rObj),
- mpStyleSheet(0L)
+ mpStyleSheet(0)
{
+ // use default stylesheet
+ SfxStyleSheet* pTargetStyleSheet = GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet();
+
+ if(pTargetStyleSheet)
+ {
+ ImpAddStyleSheet(pTargetStyleSheet, true);
+ }
}
AttributeProperties::AttributeProperties(const AttributeProperties& rProps, SdrObject& rObj)
: DefaultProperties(rProps, rObj),
- mpStyleSheet(0L)
+ mpStyleSheet(0)
{
- if(rProps.GetStyleSheet())
- {
- ImpAddStyleSheet(rProps.GetStyleSheet(), sal_True);
+ SfxStyleSheet* pTargetStyleSheet = rProps.GetStyleSheet();
+
+ if(pTargetStyleSheet)
+ {
+ if(&rObj.getSdrModelFromSdrObject() != &GetSdrObject().getSdrModelFromSdrObject())
+ {
+ // It is a clone to another model
+ ImpModelChange(rObj.getSdrModelFromSdrObject(), GetSdrObject().getSdrModelFromSdrObject());
+ }
+ }
+
+ if(!pTargetStyleSheet)
+ {
+ // use default stylesheet
+ pTargetStyleSheet = GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet();
+ }
+
+ if(pTargetStyleSheet)
+ {
+ ImpAddStyleSheet(pTargetStyleSheet, true);
}
}
@@ -234,7 +416,7 @@ namespace sdr
}
}
- void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
ImpRemoveStyleSheet();
ImpAddStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
@@ -293,7 +475,7 @@ namespace sdr
void AttributeProperties::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
- sal_Bool bHintUsed(sal_False);
+ bool bHintUsed(sal_False);
const SfxStyleSheetHint *pStyleHint = dynamic_cast< const SfxStyleSheetHint* >( &rHint);
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/captionproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/captionproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/captionproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/captionproperties.cxx Mon Jun 18 16:00:11 2012
@@ -86,7 +86,7 @@ namespace sdr
RectangleProperties::ItemSetChanged(rSet);
}
- void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrCaptionObj& rObj = (SdrCaptionObj&)GetSdrObject();
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/connectorproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/connectorproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/connectorproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/connectorproperties.cxx Mon Jun 18 16:00:11 2012
@@ -86,7 +86,7 @@ namespace sdr
rObj.ImpSetAttrToEdgeInfo();
}
- void ConnectorProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void ConnectorProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrEdgeObj& rObj = (SdrEdgeObj&)GetSdrObject();
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/customshapeproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/customshapeproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/customshapeproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/customshapeproperties.cxx Mon Jun 18 16:00:11 2012
@@ -146,7 +146,7 @@ namespace sdr
rObj.InvalidateRenderGeometry();
}
- void CustomShapeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void CustomShapeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
TextProperties::SetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr );
UpdateTextFrameStatus();
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/defaultproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/defaultproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/defaultproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/defaultproperties.cxx Mon Jun 18 16:00:11 2012
@@ -58,9 +58,10 @@ namespace sdr
{
if(rProps.mpItemSet)
{
- mpItemSet = rProps.mpItemSet->Clone(sal_True);
+ // Clone may be to another model and thus another ItemPool
+ mpItemSet = rProps.mpItemSet->Clone(true, &rObj.getSdrModelFromSdrObject().GetItemPool());
- // do not keep parent info, this may be changed by later construrtors.
+ // do not keep parent info, this may be changed by later constructors.
// This class just copies the ItemSet, ignore parent.
if(mpItemSet && mpItemSet->GetParent())
{
@@ -207,7 +208,7 @@ namespace sdr
CleanupFillProperties(*mpItemSet);
}
- void DefaultProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/)
+ void DefaultProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, bool /*bDontRemoveHardAttr*/)
{
// no StyleSheet in DefaultProperties
}
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/e3dproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/e3dproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/e3dproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/e3dproperties.cxx Mon Jun 18 16:00:11 2012
@@ -81,7 +81,7 @@ namespace sdr
rObj.StructureChanged();
}
- void E3dProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void E3dProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
// call parent
AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/e3dsceneproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/e3dsceneproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/e3dsceneproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/e3dsceneproperties.cxx Mon Jun 18 16:00:11 2012
@@ -242,7 +242,7 @@ namespace sdr
}
}
- void E3dSceneProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void E3dSceneProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/emptyproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/emptyproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/emptyproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/emptyproperties.cxx Mon Jun 18 16:00:11 2012
@@ -133,7 +133,7 @@ namespace sdr
DBG_ASSERT(sal_False, "EmptyProperties::PostItemChange() should never be called (!)");
}
- void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/)
+ void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, bool /*bDontRemoveHardAttr*/)
{
DBG_ASSERT(sal_False, "EmptyProperties::SetStyleSheet() should never be called (!)");
}
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/graphicproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/graphicproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/graphicproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/graphicproperties.cxx Mon Jun 18 16:00:11 2012
@@ -92,7 +92,7 @@ namespace sdr
RectangleProperties::ItemSetChanged(rSet);
}
- void GraphicProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void GraphicProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrGrafObj& rObj = (SdrGrafObj&)GetSdrObject();
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/groupproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/groupproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/groupproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/groupproperties.cxx Mon Jun 18 16:00:11 2012
@@ -234,7 +234,7 @@ namespace sdr
return pRetval;
}
- void GroupProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void GroupProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
const SdrObjList* pSub = GetSdrObject().getChildrenOfSdrObject();
const sal_uInt32 nCount(pSub ? pSub->GetObjCount() : 0);
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/measureproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/measureproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/measureproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/measureproperties.cxx Mon Jun 18 16:00:11 2012
@@ -92,7 +92,7 @@ namespace sdr
rObj.SetTextDirty();
}
- void MeasureProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void MeasureProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrMeasureObj& rObj = (SdrMeasureObj&)GetSdrObject();
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/rectangleproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/rectangleproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/rectangleproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/rectangleproperties.cxx Mon Jun 18 16:00:11 2012
@@ -58,7 +58,7 @@ namespace sdr
}
// set a new StyleSheet and broadcast
- void RectangleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void RectangleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
// call parent
TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/textproperties.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/textproperties.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/textproperties.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/sdr/properties/textproperties.cxx Mon Jun 18 16:00:11 2012
@@ -228,7 +228,7 @@ namespace sdr
}
}
- void TextProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
+ void TextProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/sdrtexthelpers.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/sdrtexthelpers.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/sdrtexthelpers.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/sdrtexthelpers.cxx Mon Jun 18 16:00:11 2012
@@ -161,11 +161,8 @@ basegfx::B2DRange getScaledCenteredTextR
// get unified text range (no mirroring)
const basegfx::B2DRange aUnifiedTextRange(rText.getUnifiedTextRange());
- // scale to object size
- basegfx::B2DRange aRetval(
- basegfx::tools::createScaleB2DHomMatrix(
- rText.getSdrObjectScale()) *
- aUnifiedTextRange);
+ // scale to object size. absolute is not needed, will be centered anyways
+ basegfx::B2DRange aRetval(basegfx::tools::createScaleB2DHomMatrix(rText.getSdrObjectScale()) * aUnifiedTextRange);
// to align centered, just translate to the current object center. This
// will also correct evtl. mirrorings
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdcrtv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdcrtv.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdcrtv.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdcrtv.cxx Mon Jun 18 16:00:11 2012
@@ -830,7 +830,7 @@ void SdrCreateView::ShowCreateObj()
{
SdrCircObj* pCircObj = dynamic_cast< SdrCircObj* >(GetCreateObj());
- if(pCircObj && OBJ_CIRC != pCircObj->GetObjIdentifier())
+ if(pCircObj && CircleType_Circle != pCircObj->GetSdrCircleObjType())
{
// #i103058# Allow SolidDragging with four points
if(GetDragStat().GetPointAnz() < 4)
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx Mon Jun 18 16:00:11 2012
@@ -1811,7 +1811,7 @@ void SdrEditView::ImpDismantleOneObject(
const basegfx::B2DRange aRawUnitTextRange(pCustomShape->getRawUnifiedTextRange());
// get TopLeft and BottomRight when applying current objects scale and translate,
- // but leave out rot and shear
+ // but leave out rot and shear TTTT need to check mirroring
const basegfx::B2DHomMatrix aJustScaleTranslate(
basegfx::tools::createScaleTranslateB2DHomMatrix(
pCustomShape->getSdrObjectScale(),
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedxv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedxv.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedxv.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedxv.cxx Mon Jun 18 16:00:11 2012
@@ -90,6 +90,8 @@ SdrObjEditView::SdrObjEditView(SdrModel&
maOldCalcFieldValueLink(),
maMacroDownPos(0.0, 0.0),
mnMacroTol(0),
+ mpUndoGeoObject(0),
+ mpUndoAttrObject(0),
mbTextEditDontDelete(false),
mbTextEditOnlyOneView(false),
mbTextEditNewObj(false),
@@ -111,6 +113,16 @@ SdrObjEditView::~SdrObjEditView()
{
delete mpTextEditOutliner;
}
+
+ if(mpUndoGeoObject)
+ {
+ delete mpUndoGeoObject;
+ }
+
+ if(mpUndoAttrObject)
+ {
+ delete mpUndoAttrObject;
+ }
}
bool SdrObjEditView::IsAction() const
@@ -872,6 +884,15 @@ bool SdrObjEditView::SdrBeginTextEdit(
mxSelectionController->onSelectionHasChanged();
}
+ if(IsUndoEnabled() && pTextObj && pTextObj->IsTextFrame() && OBJ_TEXT == pTextObj->GetObjIdentifier())
+ {
+ // prepare some undos for things TextFrames might change
+ // text frames might adapt geometry when AutoGrow is active
+ // text frames might changes various items (Min/MaxTextWidth/Height, ...)
+ mpUndoGeoObject = getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoGeoObject(*pTextObj);
+ mpUndoAttrObject = getSdrModelFromSdrView().GetSdrUndoFactory().CreateUndoAttrObject(*pTextObj, false, false);
+ }
+
return true; // Gut gelaufen, TextEdit laeuft nun
}
else
@@ -991,14 +1012,15 @@ SdrEndTextEditKind SdrObjEditView::SdrEn
pTEObj->EndTextEdit(*pTEOutliner);
- if(pTEObj && pTEObj->IsFontwork())
- {
- pTEObj->ActionChanged();
- }
- else if(!basegfx::fTools::equalZero(pTEObj->getSdrObjectRotate()))
- {
- pTEObj->ActionChanged();
- }
+ // TTTT should not be needed
+ // if(pTEObj && pTEObj->IsFontwork())
+ // {
+ // pTEObj->ActionChanged();
+ // }
+ // else if(!basegfx::fTools::equalZero(pTEObj->getSdrObjectRotate()))
+ // {
+ // pTEObj->ActionChanged();
+ // }
if(pTxtUndo)
{
@@ -1041,10 +1063,34 @@ SdrEndTextEditKind SdrObjEditView::SdrEn
AddUndo(pTxtUndo);
}
- eRet=SDRENDTEXTEDIT_CHANGED;
+ if(mpUndoGeoObject)
+ {
+ AddUndo(mpUndoGeoObject);
+ mpUndoGeoObject = 0;
+ }
+
+ if(mpUndoAttrObject)
+ {
+ AddUndo(mpUndoAttrObject);
+ mpUndoAttrObject = 0;
+ }
+
+ eRet=SDRENDTEXTEDIT_CHANGED;
}
- if(pDelUndo)
+ if(mpUndoGeoObject)
+ {
+ delete mpUndoGeoObject;
+ mpUndoGeoObject = 0;
+ }
+
+ if(mpUndoAttrObject)
+ {
+ delete mpUndoAttrObject;
+ mpUndoAttrObject = 0;
+ }
+
+ if(pDelUndo)
{
if( bUndo )
{
@@ -1078,7 +1124,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEn
// Switch on evtl. TextAnimation again after TextEdit
pTEObj->SetTextAnimationAllowed(true);
SetMarkHandles();
- }
+ }
// alle OutlinerViews loeschen
for(sal_uInt32 i(pTEOutliner->GetViewCount()); i > 0;)
@@ -2339,38 +2385,30 @@ void SdrObjEditView::OnEndPasteOrDrop( P
// applications can derive from these virtual methods to do something before a drop or paste operation
}
-bool SdrObjEditView::SupportsFormatPaintbrush( sal_uInt32 nObjectInventor, sal_uInt16 nObjectIdentifier ) const
+bool SdrObjEditView::SupportsFormatPaintbrush(const SdrObject& rSdrObject) const
{
- if( nObjectInventor != SdrInventor && nObjectInventor != E3dInventor )
- return false;
- switch(nObjectIdentifier)
+ if(SdrInventor == rSdrObject.GetObjInventor())
{
- case OBJ_NONE:
- case OBJ_GRUP:
- return false;
- case OBJ_RECT:
- case OBJ_CIRC:
- case OBJ_POLY:
- case OBJ_TEXT:
- case OBJ_TITLETEXT:
- case OBJ_OUTLINETEXT:
- case OBJ_GRAF:
- case OBJ_OLE2:
- case OBJ_TABLE:
- return true;
- case OBJ_EDGE:
- case OBJ_CAPTION:
- return false;
- case OBJ_PAGE:
- case OBJ_MEASURE:
- case OBJ_FRAME:
- case OBJ_UNO:
- return false;
- case OBJ_CUSTOMSHAPE:
- return true;
- default:
- return false;
+ switch(rSdrObject.GetObjIdentifier())
+ {
+ case OBJ_RECT:
+ case OBJ_CIRC:
+ case OBJ_POLY:
+ case OBJ_TEXT:
+ case OBJ_TITLETEXT:
+ case OBJ_OUTLINETEXT:
+ case OBJ_GRAF:
+ case OBJ_OLE2:
+ case OBJ_TABLE:
+ case OBJ_CUSTOMSHAPE:
+ return true;
+ break;
+ default:
+ break;
+ }
}
+
+ return false;
}
static const sal_uInt16* GetFormatRangeImpl( bool bTextOnly )
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx Mon Jun 18 16:00:11 2012
@@ -207,11 +207,10 @@ namespace sdr
}
else
{
- // build range without rotation and shear
- const basegfx::B2DVector& rScale(rObject.getSdrObjectScale());
- const basegfx::B2DPoint& rTranslate(rObject.getSdrObjectTranslate());
-
- return basegfx::B2DRange(rTranslate, rTranslate + rScale);
+ // build range without rotation, mirror and shear
+ return basegfx::B2DRange(
+ rObject.getSdrObjectTranslate(),
+ rObject.getSdrObjectTranslate() + basegfx::absolute(rObject.getSdrObjectScale()));
}
}
@@ -239,6 +238,7 @@ namespace sdr
}
else
{
+ // keep mirroring, rotation and shear, replace absolute size and translation
const basegfx::B2DVector aScale(
rObject.isMirroredX() ? -rRange.getWidth() : rRange.getWidth(),
rObject.isMirroredY() ? -rRange.getHeight() : rRange.getHeight());
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdoashp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdoashp.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdoashp.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdoashp.cxx Mon Jun 18 16:00:11 2012
@@ -2169,14 +2169,15 @@ void SdrObjCustomShape::SetVerticalWriti
}
}
}
-bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(basegfx::B2DRange& o_rRange, bool bHgt, bool bWdt) const
+
+basegfx::B2DRange SdrObjCustomShape::AdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt, bool bWdt) const
{
- if(HasText() && !o_rRange.isEmpty())
+ if(HasText() && !rRange.isEmpty())
{
- return ImpAdjustTextFrameWidthAndHeight(o_rRange, bHgt, bWdt, false);
+ return ImpAdjustTextFrameWidthAndHeight(rRange, bHgt, bWdt, false);
}
- return false;
+ return rRange;
}
basegfx::B2DRange SdrObjCustomShape::ImpCalculateTextFrame(const bool bHgt, const bool bWdt)
@@ -2184,7 +2185,7 @@ basegfx::B2DRange SdrObjCustomShape::Imp
basegfx::B2DRange aReturnValue;
const basegfx::B2DRange aOldObjRange(
getSdrObjectTranslate(),
- getSdrObjectTranslate() + getSdrObjectScale());
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
// initial text rectangle
const basegfx::B2DRange aOldTextRange(aOldObjRange);
@@ -2195,25 +2196,22 @@ basegfx::B2DRange SdrObjCustomShape::Imp
basegfx::B2DRange aNewTextRange(getRawUnifiedTextRange());
aNewTextRange.transform(
basegfx::tools::createScaleTranslateB2DHomMatrix(
- getSdrObjectScale(),
+ basegfx::absolute(getSdrObjectScale()),
getSdrObjectTranslate()));
// new text rectangle is being tested by AdjustTextFrameWidthAndHeight to ensure
// that the new text rectangle is matching the current text size from the outliner
- basegfx::B2DRange aAdjustedTextRange(aNewTextRange);
+ const basegfx::B2DRange aAdjustedTextRange(AdjustTextFrameWidthAndHeight(aNewTextRange, bHgt, bWdt));
- if(AdjustTextFrameWidthAndHeight(aAdjustedTextRange, bHgt, bWdt))
+ if((aAdjustedTextRange != aNewTextRange) && (aOldTextRange != aAdjustedTextRange))
{
- if((aAdjustedTextRange != aNewTextRange) && (aOldTextRange != aAdjustedTextRange))
- {
- const basegfx::B2DVector aScale(aOldTextRange.getRange() / aNewTextRange.getRange());
- const basegfx::B2DVector aTopLeftDiff((aAdjustedTextRange.getMinimum() - aNewTextRange.getMinimum()) * aScale);
- const basegfx::B2DVector aBottomRightDiff((aAdjustedTextRange.getMaximum() - aNewTextRange.getMaximum()) * aScale);
-
- aReturnValue = basegfx::B2DRange(
- aReturnValue.getMinimum() + aTopLeftDiff,
- aReturnValue.getMaximum() + aBottomRightDiff);
- }
+ const basegfx::B2DVector aScale(aOldTextRange.getRange() / aNewTextRange.getRange());
+ const basegfx::B2DVector aTopLeftDiff((aAdjustedTextRange.getMinimum() - aNewTextRange.getMinimum()) * aScale);
+ const basegfx::B2DVector aBottomRightDiff((aAdjustedTextRange.getMaximum() - aNewTextRange.getMaximum()) * aScale);
+
+ aReturnValue = basegfx::B2DRange(
+ aReturnValue.getMinimum() + aTopLeftDiff,
+ aReturnValue.getMaximum() + aBottomRightDiff);
}
return aReturnValue;
@@ -2222,7 +2220,7 @@ basegfx::B2DRange SdrObjCustomShape::Imp
bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
const basegfx::B2DRange aNewTextRange(ImpCalculateTextFrame(bHgt, bWdt));
- const basegfx::B2DRange aOldObjRange(getSdrObjectTranslate(), getSdrObjectTranslate() + getSdrObjectScale());
+ const basegfx::B2DRange aOldObjRange(getSdrObjectTranslate(), getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
if(!aNewTextRange.isEmpty() && !aNewTextRange.equal(aOldObjRange))
{
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdograf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdograf.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdograf.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdograf.cxx Mon Jun 18 16:00:11 2012
@@ -923,7 +923,7 @@ SdrObject* SdrGrafObj::getFullDragClone(
basegfx::B2DPolyPolygon SdrGrafObj::TakeXorPoly() const
{
- if(mbInsidePaint)
+ if(mbInsidePaint) // TTTT exception needed here?
{
// take grown rectangle
const double fHalfLineWidth(ImpGetLineWdt() * 0.5);
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdomeas.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdomeas.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdomeas.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdomeas.cxx Mon Jun 18 16:00:11 2012
@@ -635,11 +635,13 @@ bool SdrMeasureObj::CalcFieldValue(const
void SdrMeasureObj::UndirtyText() const
{
- if (bTextDirty)
+ if(bTextDirty)
{
- SdrOutliner& rOutliner=ImpGetDrawOutliner();
+ SdrOutliner& rOutliner = ImpGetDrawOutliner();
OutlinerParaObject* pOutlinerParaObject = SdrTextObj::GetOutlinerParaObject();
- if(pOutlinerParaObject==NULL)
+ SdrMeasureObj* pThat = const_cast<SdrMeasureObj*>(this);
+
+ if(!pOutlinerParaObject)
{
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_ROTA90BLANCS), EE_FEATURE_FIELD), ESelection(0,0));
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_VALUE), EE_FEATURE_FIELD),ESelection(0,1));
@@ -647,12 +649,15 @@ void SdrMeasureObj::UndirtyText() const
rOutliner.QuickInsertField(SvxFieldItem(SdrMeasureField(SDRMEASUREFIELD_ROTA90BLANCS), EE_FEATURE_FIELD),ESelection(0,3));
if(GetStyleSheet())
+ {
rOutliner.SetStyleSheet(0, GetStyleSheet());
+ }
rOutliner.SetParaAttribs(0, GetObjectItemSet());
- // casting auf nonconst
- const_cast<SdrMeasureObj*>(this)->SetOutlinerParaObject( rOutliner.CreateParaObject() );
+ // need to reset bTextDirty first, else loop is triggered
+ pThat->bTextDirty = false;
+ pThat->SetOutlinerParaObject( rOutliner.CreateParaObject() );
}
else
{
@@ -661,14 +666,11 @@ void SdrMeasureObj::UndirtyText() const
rOutliner.SetUpdateMode(sal_True);
rOutliner.UpdateFields();
- Size aSiz(rOutliner.CalcTextSize());
- rOutliner.Clear();
- // 3x casting auf nonconst
- ((SdrMeasureObj*)this)->aTextSize=aSiz;
- ((SdrMeasureObj*)this)->bTextSizeDirty=sal_False;
- ((SdrMeasureObj*)this)->bTextDirty = false;
- }
+ pThat->aTextSize = rOutliner.CalcTextSize();
+ pThat->bTextSizeDirty=sal_False;
+ rOutliner.Clear();
}
+}
void SdrMeasureObj::TakeObjNameSingul(XubString& rName) const
{
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotext.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotext.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotext.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotext.cxx Mon Jun 18 16:00:11 2012
@@ -163,8 +163,15 @@ void SdrTextObj::copyDataFromSdrObject(c
}
}
- mpText->SetOutlinerParaObject(pNewOutlinerParaObject);
- ImpSetTextStyleSheetListeners();
+ mpText->SetOutlinerParaObject(pNewOutlinerParaObject);
+
+ if(pNewOutlinerParaObject && &rSource.getSdrModelFromSdrObject() != &getSdrModelFromSdrObject())
+ {
+ // It is a clone to another model
+ mpText->ImpModelChange(rSource.getSdrModelFromSdrObject(), getSdrModelFromSdrObject());
+ }
+
+ ImpSetTextStyleSheetListeners();
}
else
{
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxat.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxat.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxat.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxat.cxx Mon Jun 18 16:00:11 2012
@@ -59,34 +59,35 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
-bool SdrTextObj::AdjustTextFrameWidthAndHeight(basegfx::B2DRange& o_rRange, bool bHgt, bool bWdt) const
+basegfx::B2DRange SdrTextObj::AdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt, bool bWdt) const
{
- if(IsTextFrame() && !o_rRange.isEmpty())
+ if(IsTextFrame() && !rRange.isEmpty())
{
const SdrFitToSizeType eFit(GetFitToSize());
const bool bFitToSize(SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit);
if(!bFitToSize)
{
- return ImpAdjustTextFrameWidthAndHeight(o_rRange, bHgt, bWdt, true);
+ return ImpAdjustTextFrameWidthAndHeight(rRange, bHgt, bWdt, true);
}
}
- return false;
+ return rRange;
}
-bool SdrTextObj::ImpAdjustTextFrameWidthAndHeight(basegfx::B2DRange& o_rRange, bool bHgt, bool bWdt, bool bCheckAnimation) const
+basegfx::B2DRange SdrTextObj::ImpAdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHgt, bool bWdt, bool bCheckAnimation) const
{
bool bWdtGrow(bWdt && IsAutoGrowWidth());
bool bHgtGrow(bHgt && IsAutoGrowHeight());
+ basegfx::B2DRange aRetval(rRange);
if(bWdtGrow || bHgtGrow)
{
- basegfx::B2DVector aSize(o_rRange.getRange());
+ basegfx::B2DVector aSize(aRetval.getRange());
basegfx::B2DVector aMaxSize(100000.0, 100000.0);
double fHeight(0.0), fMinHeight(0.0), fMaxHeight(0.0);
double fWidth(0.0), fMinWidth(0.0), fMaxWidth(0.0);
- const basegfx::B2DPoint aOriginalMinimum(o_rRange.getMinimum());
+ const basegfx::B2DPoint aOriginalMinimum(aRetval.getMinimum());
if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getX()))
{
@@ -219,15 +220,15 @@ bool SdrTextObj::ImpAdjustTextFrameWidth
// fMinWidth < fWidth < fMaxWidth
fWidth = std::min(fMaxWidth, std::max(fWidth, fMinWidth));
- fWidth = std::min(1.0, fWidth += aBorders.getX()); // aBorders.getX() may be negative
+ fWidth = std::max(1.0, fWidth += aBorders.getX()); // aBorders.getX() may be negative
// fMinHeight < fHeight < fMaxHeight
fHeight = std::min(fMaxHeight, std::max(fHeight, fMinHeight));
- fHeight = std::min(1.0, fHeight += aBorders.getY()); // aBorders.getY() may be negative
+ fHeight = std::max(1.0, fHeight += aBorders.getY()); // aBorders.getY() may be negative
// get grow sizes
- const double fWidthGrow(fWidth - o_rRange.getWidth());
- const double fHeightGrow(fHeight - o_rRange.getHeight());
+ const double fWidthGrow(fWidth - aRetval.getWidth());
+ const double fHeightGrow(fHeight - aRetval.getHeight());
if(basegfx::fTools::equalZero(fWidthGrow))
{
@@ -247,16 +248,15 @@ bool SdrTextObj::ImpAdjustTextFrameWidth
if(SDRTEXTHORZADJUST_LEFT == eHAdj)
{
- o_rRange.expand(basegfx::B2DTuple(o_rRange.getMaxX() + fWidthGrow, o_rRange.getMinY()));
+ aRetval = basegfx::B2DRange(aRetval.getMinX(), aRetval.getMinY(), aRetval.getMaxX() + fWidthGrow, aRetval.getMaxY());
}
else if(SDRTEXTHORZADJUST_RIGHT == eHAdj)
{
- o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX() - fWidthGrow, o_rRange.getMinY()));
+ aRetval = basegfx::B2DRange(aRetval.getMinX() - fWidthGrow, aRetval.getMinY(), aRetval.getMaxX(), aRetval.getMaxY());
}
else
{
- o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX() - (fWidthGrow * 0.5), o_rRange.getMinY()));
- o_rRange.expand(basegfx::B2DTuple(o_rRange.getMaxX() + (fWidthGrow * 0.5), o_rRange.getMinY()));
+ aRetval = basegfx::B2DRange(aRetval.getMinX() - (fWidthGrow * 0.5), aRetval.getMinY(), aRetval.getMaxX() + (fWidthGrow * 0.5), aRetval.getMaxY());
}
}
@@ -266,35 +266,34 @@ bool SdrTextObj::ImpAdjustTextFrameWidth
if(SDRTEXTVERTADJUST_TOP == eVAdj)
{
- o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX(), o_rRange.getMaxY() + fHeightGrow));
+ aRetval = basegfx::B2DRange(aRetval.getMinX(), aRetval.getMinY(), aRetval.getMaxX(), aRetval.getMaxY() + fHeightGrow);
}
else if(SDRTEXTVERTADJUST_BOTTOM == eVAdj)
{
- o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX(), o_rRange.getMinY() - fHeightGrow));
+ aRetval = basegfx::B2DRange(aRetval.getMinX(), aRetval.getMinY() - fHeightGrow, aRetval.getMaxX(), aRetval.getMaxY());
}
else
{
- o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX(), o_rRange.getMinY() - (fHeightGrow * 0.5)));
- o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX(), o_rRange.getMaxY() + (fHeightGrow * 0.5)));
+ aRetval = basegfx::B2DRange(aRetval.getMinX(), aRetval.getMinY() - (fHeightGrow * 0.5), aRetval.getMaxX(), aRetval.getMaxY() + (fHeightGrow * 0.5));
}
}
- if(!aOriginalMinimum.equal(o_rRange.getMinimum()) && isRotatedOrSheared())
+ if(!aOriginalMinimum.equal(aRetval.getMinimum()) && isRotatedOrSheared())
{
basegfx::B2DHomMatrix aCorrector(
basegfx::tools::createScaleTranslateB2DHomMatrix(
getSdrObjectScale(),
- getSdrObjectTranslate()));
+ basegfx::absolute(getSdrObjectTranslate())));
aCorrector.invert();
aCorrector = getSdrObjectTransformation() * aCorrector;
- const basegfx::B2DPoint aCorrectedTopLeft(aCorrector * o_rRange.getMinimum());
+ const basegfx::B2DPoint aCorrectedTopLeft(aCorrector * aRetval.getMinimum());
aCorrector.identity();
- aCorrector.translate(aCorrectedTopLeft - o_rRange.getMinimum());
+ aCorrector.translate(aCorrectedTopLeft - aRetval.getMinimum());
- o_rRange.transform(aCorrector);
+ aRetval.transform(aCorrector);
// TTTT: Check if the above solution works
//
@@ -310,19 +309,18 @@ bool SdrTextObj::ImpAdjustTextFrameWidth
// rR.Move(aD2.X(),aD2.Y());
//}
}
-
- return true;
}
}
- return false;
+ return aRetval;
}
bool SdrTextObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
- basegfx::B2DRange aNewRange(getSdrObjectTranslate(), getSdrObjectTranslate() + getSdrObjectScale());
+ const basegfx::B2DRange aOldRange(getSdrObjectTranslate(), getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
+ const basegfx::B2DRange aNewRange(AdjustTextFrameWidthAndHeight(aOldRange, bHgt, bWdt));
- if(AdjustTextFrameWidthAndHeight(aNewRange, bHgt, bWdt))
+ if(!aNewRange.equal(aOldRange))
{
const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
sdr::legacy::SetLogicRange(*this, aNewRange);
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx Mon Jun 18 16:00:11 2012
@@ -49,7 +49,10 @@
void SdrTextObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
- const bool bTextAdaption(bTextFrame && !IsPasteResize());
+ // Adapt Width and Height only when text frame (not object with text).
+ // Also do not do it in edit mode, let the object get as small as the
+ // minimum frame width/height without changing these.
+ const bool bTextAdaption(bTextFrame && !IsPasteResize() && !IsInEditMode());
basegfx::B2DVector aOldSize;
if(bTextAdaption)
@@ -276,7 +279,7 @@ SdrObject* SdrTextObj::ImpConvertMakeObj
pPathObj->ClearMergedItem();
pPathObj->SetMergedItemSet(GetObjectItemSet());
- pPathObj->SetStyleSheet(GetStyleSheet(), sal_True);
+ pPathObj->SetStyleSheet(GetStyleSheet(), true);
}
}
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdpage.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdpage.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdpage.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdpage.cxx Mon Jun 18 16:00:11 2012
@@ -276,7 +276,7 @@ void SdrObjList::handleContentChange(con
void SdrObjList::InsertObjectToSdrObjList(SdrObject& rObj, sal_uInt32 nPos)
{
- SdrObject* pOwningGroupObject = getSdrObjectFromSdrObjList();
+ SdrObject* pOwningGroupObject = getSdrObjectFromSdrObjList();
// if anchor is used, reset it before grouping (for SW)
if(pOwningGroupObject)
@@ -589,6 +589,13 @@ void SdrObjList::SetUserNavigationOrder(
void SdrObjList::InsertObjectIntoContainer(SdrObject& rObject, const sal_uInt32 nInsertPosition)
{
+ if(&rObject.getSdrModelFromSdrObject() != &getSdrModelFromSdrObjList())
+ {
+ OSL_ENSURE(false, "InsertObjectToSdrObjList with SdrModel of SdrObject != SdrModel from SdrObjList (!)");
+ deleteSdrObjectSafe(&rObject);
+ return;
+ }
+
// Update the navigation positions.
if(!maUserNavigationOrder.empty())
{
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdtext.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdtext.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdtext.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdtext.cxx Mon Jun 18 16:00:11 2012
@@ -141,3 +141,65 @@ SfxStyleSheet* SdrText::GetStyleSheet()
{
return mrObject.GetStyleSheet();
}
+
+void SdrText::ImpModelChange(SdrModel& rSourceModel, SdrModel& rTargetModel)
+{
+ if(mpOutlinerParaObject && &rSourceModel != &rTargetModel)
+ {
+ const bool bHgtSet(SFX_ITEM_SET == GetObjectItemSet().GetItemState(EE_CHAR_FONTHEIGHT, true));
+ const MapUnit aOldUnit(rSourceModel.GetExchangeObjectUnit());
+ const MapUnit aNewUnit(rTargetModel.GetExchangeObjectUnit());
+ const bool bScaleUnitChanged(aNewUnit != aOldUnit);
+
+ // und nun dem OutlinerParaObject einen neuen Pool verpassen
+ // !!! Hier muss noch DefTab und RefDevice der beiden Models
+ // !!! verglichen werden und dann ggf. AutoGrow zuschlagen !!!
+ // !!! fehlende Implementation !!!
+ const sal_uInt32 nOldFontHgt(rSourceModel.GetDefaultFontHeight());
+ const sal_uInt32 nNewFontHgt(rTargetModel.GetDefaultFontHeight());
+ const bool bDefHgtChanged(nNewFontHgt != nOldFontHgt);
+ const bool bSetHgtItem(bDefHgtChanged && !bHgtSet);
+
+ if(bSetHgtItem)
+ {
+ // #32665#
+ // zunaechst das HeightItem festklopfen, damit
+ // 1. Es eben bestehen bleibt und
+ // 2. DoStretchChars vom richtigen Wert ausgeht
+ SetObjectItem(SvxFontHeightItem(nOldFontHgt, 100, EE_CHAR_FONTHEIGHT));
+ }
+
+ // erst jetzt den Outliner holen, etc. damit obiges SetAttr auch wirkt
+ SdrOutliner& rOutliner = mrObject.ImpGetDrawOutliner();
+
+ rOutliner.SetText(*mpOutlinerParaObject);
+ delete mpOutlinerParaObject;
+ mpOutlinerParaObject = 0;
+
+ if(bScaleUnitChanged)
+ {
+ Fraction aMetricFactor(GetMapFactor(aOldUnit, aNewUnit).X());
+
+ // Funktioniert nicht richtig:
+ // Geht am Outliner leider nur in %
+ // double nPercFloat=double(aMetricFactor)*100+0.5;
+ // sal_uInt16 nPerc=(sal_uInt16)nPercFloat;
+ // rOutliner.DoStretchChars(100,nPerc);
+
+ if(bSetHgtItem)
+ {
+ // Und nun noch das Rahmenattribut korregieren
+ const sal_uInt32 nAdaptedFontHgt(BigMulDiv(nOldFontHgt,aMetricFactor.GetNumerator(),aMetricFactor.GetDenominator()));
+
+ SetObjectItem(SvxFontHeightItem(nAdaptedFontHgt, 100, EE_CHAR_FONTHEIGHT));
+ }
+ }
+
+ SetOutlinerParaObject(rOutliner.CreateParaObject()); // #34494#
+ mpOutlinerParaObject->ClearPortionInfo();
+ mbPortionInfoChecked = false;
+ rOutliner.Clear();
+ }
+}
+
+// eof
\ No newline at end of file
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdxcgv.cxx Mon Jun 18 16:00:11 2012
@@ -270,7 +270,7 @@ bool SdrExchangeView::Paste(const XubStr
if(GetDefaultStyleSheet())
{
- pObj->SetStyleSheet(GetDefaultStyleSheet(), sal_False);
+ pObj->SetStyleSheet(GetDefaultStyleSheet(), false);
}
pObj->SetMergedItemSet(GetDefaultAttr());
@@ -283,12 +283,12 @@ bool SdrExchangeView::Paste(const XubStr
pObj->FitFrameToTextSize();
- const basegfx::B2DVector& rObjectSize(pObj->getSdrObjectScale());
+ const basegfx::B2DVector aObjectSize(basegfx::absolute(pObj->getSdrObjectScale()));
const MapUnit eMap(getSdrModelFromSdrView().GetExchangeObjectUnit());
const Fraction aMap(getSdrModelFromSdrView().GetExchangeObjectScale());
const basegfx::B2DPoint aPos(ImpLimitToWorkArea(rPos));
- ImpPasteObject(pObj, *pLst, aPos, rObjectSize, MapMode(eMap, Point(0,0), aMap, aMap), nOptions);
+ ImpPasteObject(pObj, *pLst, aPos, aObjectSize, MapMode(eMap, Point(0,0), aMap, aMap), nOptions);
return true;
}
@@ -334,7 +334,7 @@ bool SdrExchangeView::Paste(SvStream& rI
if(GetDefaultStyleSheet())
{
- pObj->SetStyleSheet(GetDefaultStyleSheet(), sal_False);
+ pObj->SetStyleSheet(GetDefaultStyleSheet(), false);
}
pObj->SetMergedItemSet(GetDefaultAttr());
@@ -348,12 +348,12 @@ bool SdrExchangeView::Paste(SvStream& rI
pObj->SetText(rInput, rBaseURL, eFormat);
pObj->FitFrameToTextSize();
- const basegfx::B2DVector& rObjectSize(pObj->getSdrObjectScale());
+ const basegfx::B2DVector aObjectSize(basegfx::absolute(pObj->getSdrObjectScale()));
const MapUnit eMap(getSdrModelFromSdrView().GetExchangeObjectUnit());
const Fraction aMap(getSdrModelFromSdrView().GetExchangeObjectScale());
const basegfx::B2DPoint aPos(ImpLimitToWorkArea(rPos));
- ImpPasteObject(pObj, *pLst, aPos, rObjectSize, MapMode(eMap, Point(0, 0), aMap, aMap), nOptions);
+ ImpPasteObject(pObj, *pLst, aPos, aObjectSize, MapMode(eMap, Point(0, 0), aMap, aMap), nOptions);
// TTTT: Shold already be done in ImpPasteObject/onModelChange ?!?
if(pObj && GetDefaultStyleSheet())
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/table/cell.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/table/cell.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/table/cell.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/table/cell.cxx Mon Jun 18 16:00:11 2012
@@ -376,7 +376,7 @@ void Cell::mergeContent( const CellRef&
rOutliner.Clear();
xSourceCell->SetOutlinerParaObject(rOutliner.CreateParaObject());
rOutliner.Clear();
- SetStyleSheet( GetStyleSheet(), sal_True );
+ SetStyleSheet( GetStyleSheet(), true);
}
}
@@ -414,7 +414,7 @@ void Cell::replaceContentAndFormating( c
if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject())
{
- SetStyleSheet( 0, sal_True );
+ SetStyleSheet( 0, true);
}
}
}
@@ -976,7 +976,7 @@ void SAL_CALL Cell::setPropertyValue( co
throw IllegalArgumentException();
SfxUnoStyleSheet* pStyle = SfxUnoStyleSheet::getUnoStyleSheet(xStyle);
- SetStyleSheet( pStyle, sal_True );
+ SetStyleSheet( pStyle, true);
return;
}
case OWN_ATTR_TABLEBORDER:
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx Mon Jun 18 16:00:11 2012
@@ -280,7 +280,7 @@ void SdrTableObjImpl::init( SdrTableObj*
basegfx::B2DRange aObjectRange(
mpTableObj->getSdrObjectTranslate(),
- mpTableObj->getSdrObjectTranslate() + mpTableObj->getSdrObjectScale());
+ mpTableObj->getSdrObjectTranslate() + basegfx::absolute(mpTableObj->getSdrObjectScale()));
LayoutTable( aObjectRange, true, true );
}
@@ -315,7 +315,7 @@ void SdrTableObjImpl::operator=( const S
basegfx::B2DRange aObjectRange(
mpTableObj->getSdrObjectTranslate(),
- mpTableObj->getSdrObjectTranslate() + mpTableObj->getSdrObjectScale());
+ mpTableObj->getSdrObjectTranslate() + basegfx::absolute(mpTableObj->getSdrObjectScale()));
LayoutTable( aObjectRange, false, false );
}
@@ -408,7 +408,7 @@ bool SdrTableObjImpl::ApplyCellStyles()
if( xCell.is() && ( xCell->GetStyleSheet() != pStyle ) )
{
bChanges = true;
- xCell->SetStyleSheet( pStyle, sal_True );
+ xCell->SetStyleSheet( pStyle, true);
}
}
}
@@ -515,7 +515,7 @@ void SdrTableObjImpl::update()
basegfx::B2DRange aObjectRange(
mpTableObj->getSdrObjectTranslate(),
- mpTableObj->getSdrObjectTranslate() + mpTableObj->getSdrObjectScale());
+ mpTableObj->getSdrObjectTranslate() + basegfx::absolute(mpTableObj->getSdrObjectScale()));
LayoutTable( aObjectRange, false, false );
}
@@ -1383,7 +1383,7 @@ void SdrTableObj::onEditOutlinerStatusEv
const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
basegfx::B2DRange aObjectRange(
getSdrObjectTranslate(),
- getSdrObjectTranslate() + getSdrObjectScale());
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
mpImpl->LayoutTable( aObjectRange, false, false );
}
@@ -2093,7 +2093,7 @@ void SdrTableObj::SetOutlinerParaObject(
void SdrTableObj::AdjustToMaxRange( const basegfx::B2DRange& rMaxRange, bool /* bShrinkOnly = false */ )
{
- const double fMyHeight(getSdrObjectScale().getY());
+ const double fMyHeight(fabs(getSdrObjectScale().getY()));
const basegfx::B2DRange aAdjustRange(
rMaxRange.getMinX(),
rMaxRange.getMinY(),
@@ -2108,17 +2108,20 @@ void SdrTableObj::AdjustToMaxRange( cons
void SdrTableObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
{
// remember original scaling
- const basegfx::B2DVector aScaleBefore(getSdrObjectScale());
+ const basegfx::B2DVector aScaleBefore(basegfx::absolute(getSdrObjectScale()));
// call parent
SdrTextObj::setSdrObjectTransformation(rTransformation);
- if(!aScaleBefore.equal(getSdrObjectScale()))
+ // get new scaling
+ const basegfx::B2DVector aNewSize(basegfx::absolute(getSdrObjectScale()));
+
+ if(!aScaleBefore.equal(aNewSize))
{
// react on scale change
AdjustTextFrameWidthAndHeight(
- basegfx::fTools::equal(aScaleBefore.getY(), getSdrObjectScale().getY()),
- basegfx::fTools::equal(aScaleBefore.getX(), getSdrObjectScale().getX()));
+ basegfx::fTools::equal(aScaleBefore.getY(), aNewSize.getY()),
+ basegfx::fTools::equal(aScaleBefore.getX(), aNewSize.getX()));
}
if( mpImpl )
@@ -2132,9 +2135,10 @@ void SdrTableObj::setSdrObjectTransforma
bool SdrTableObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
{
- basegfx::B2DRange aNewRange(getSdrObjectTranslate(), getSdrObjectTranslate() + getSdrObjectScale());
+ const basegfx::B2DRange aOldRange(getSdrObjectTranslate(), getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
+ const basegfx::B2DRange aNewRange(AdjustTextFrameWidthAndHeight(aOldRange, bHgt, bWdt));
- if(AdjustTextFrameWidthAndHeight(aNewRange, bHgt, bWdt))
+ if(!aOldRange.equal(aNewRange))
{
sdr::legacy::SetLogicRange(*this, aNewRange);
@@ -2146,27 +2150,20 @@ bool SdrTableObj::AdjustTextFrameWidthAn
// --------------------------------------------------------------------
-bool SdrTableObj::AdjustTextFrameWidthAndHeight(basegfx::B2DRange& o_rRange, bool bHeight, bool bWidth) const
+basegfx::B2DRange SdrTableObj::AdjustTextFrameWidthAndHeight(const basegfx::B2DRange& rRange, bool bHeight, bool bWidth) const
{
- if(o_rRange.isEmpty() || !mpImpl || !mpImpl->mxTable.is())
+ if(rRange.isEmpty() || !mpImpl || !mpImpl->mxTable.is())
{
- return false;
+ // no change
+ return rRange;
}
+ else
+ {
+ basegfx::B2DRange aNewRange(rRange);
- basegfx::B2DRange aNewRange(o_rRange);
-
- mpImpl->LayoutTable(o_rRange, !bWidth, !bHeight);
-
- if(!o_rRange.equal(aNewRange))
- {
- o_rRange = aNewRange;
-
- return true;
- }
- else
- {
- return false;
- }
+ mpImpl->LayoutTable(aNewRange, !bWidth, !bHeight);
+ return aNewRange;
+ }
}
// --------------------------------------------------------------------
@@ -2533,7 +2530,7 @@ void SdrTableObj::DistributeColumns( sal
TableModelNotifyGuard aGuard( mpImpl->mxTable.get() );
basegfx::B2DRange aObjectRange(
getSdrObjectTranslate(),
- getSdrObjectTranslate() + getSdrObjectScale());
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
mpImpl->mpLayouter->DistributeColumns( aObjectRange, nFirstColumn, nLastColumn );
}
@@ -2548,7 +2545,7 @@ void SdrTableObj::DistributeRows( sal_In
TableModelNotifyGuard aGuard( mpImpl->mxTable.get() );
basegfx::B2DRange aObjectRange(
getSdrObjectTranslate(),
- getSdrObjectTranslate() + getSdrObjectScale());
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
mpImpl->mpLayouter->DistributeRows( aObjectRange, nFirstRow, nLastRow );
}
@@ -2564,7 +2561,7 @@ void SdrTableObj::SetChanged()
{
basegfx::B2DRange aObjectRange(
getSdrObjectTranslate(),
- getSdrObjectTranslate() + getSdrObjectScale());
+ getSdrObjectTranslate() + basegfx::absolute(getSdrObjectScale()));
mpImpl->LayoutTable( aObjectRange, false, false );
}
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/fontworkgallery.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/fontworkgallery.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/fontworkgallery.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/tbxctrls/fontworkgallery.cxx Mon Jun 18 16:00:11 2012
@@ -68,19 +68,21 @@ const int nLineCount = 4;
/*************************************************************************
|* Svx3DWin - FloatingWindow
\************************************************************************/
-FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView& rSdrView, Window* pParent, sal_uInt16 /*nSID*/ ) :
- ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_GALLERY ) ),
- maFLFavorites ( this, SVX_RES( FL_FAVORITES ) ),
- maCtlFavorites ( this, SVX_RES( CTL_FAVORITES ) ),
- maOKButton ( this, SVX_RES( BTN_OK ) ),
- maCancelButton ( this, SVX_RES( BTN_CANCEL ) ),
- maHelpButton ( this, SVX_RES( BTN_HELP ) ),
- mnThemeId ( 0xffff ),
- mrSdrView ( rSdrView ),
- mrModel ( dynamic_cast< FmFormModel& >(rSdrView.getSdrModelFromSdrView()) ),
- maStrClickToAddText ( SVX_RES( STR_CLICK_TO_ADD_TEXT ) ),
- mppSdrObject ( NULL ),
- mpDestModel ( NULL )
+FontWorkGalleryDialog::FontWorkGalleryDialog(
+ SdrView& rSdrView,
+ Window* pParent,
+ SdrObject** ppSdrObject)
+: ModalDialog( pParent, SVX_RES( RID_SVX_MDLG_FONTWORK_GALLERY ) ),
+ maFLFavorites ( this, SVX_RES( FL_FAVORITES ) ),
+ maCtlFavorites ( this, SVX_RES( CTL_FAVORITES ) ),
+ maOKButton ( this, SVX_RES( BTN_OK ) ),
+ maCancelButton ( this, SVX_RES( BTN_CANCEL ) ),
+ maHelpButton ( this, SVX_RES( BTN_HELP ) ),
+ mnThemeId ( 0xffff ),
+ mrSdrView ( rSdrView ),
+ mrModel ( dynamic_cast< FmFormModel& >(rSdrView.getSdrModelFromSdrView()) ),
+ maStrClickToAddText ( SVX_RES( STR_CLICK_TO_ADD_TEXT ) ),
+ mppSdrObject ( ppSdrObject )
{
FreeResource();
@@ -211,12 +213,6 @@ void FontWorkGalleryDialog::changeText(
}
}
-void FontWorkGalleryDialog::SetSdrObjectRef( SdrObject** ppSdrObject, SdrModel* pModel )
-{
- mppSdrObject = ppSdrObject;
- mpDestModel = pModel;
-}
-
void FontWorkGalleryDialog::insertSelectedFontwork()
{
sal_uInt16 nItemId = maCtlFavorites.GetSelectItemId();
@@ -232,7 +228,7 @@ void FontWorkGalleryDialog::insertSelect
if( pPage && pPage->GetObjCount() )
{
- SdrObject* pNewObject = pPage->GetObj(0)->CloneSdrObject(mpDestModel);
+ SdrObject* pNewObject = pPage->GetObj(0)->CloneSdrObject(&mrModel);
// center shape on current view
OutputDevice* pOutDev = mrSdrView.GetFirstOutputDevice();
@@ -249,14 +245,20 @@ void FontWorkGalleryDialog::insertSelect
if ( mppSdrObject )
{
+ // if handle is given register SdrObject there. Ownership change!
*mppSdrObject = pNewObject;
-// (*mppSdrObject)->SetModel( mpDestModel );
}
else if( mrSdrView.GetSdrPageView() )
{
+ // if a SdrPage is given instert SdrObject there. Ownership change!
mrSdrView.InsertObjectAtView( *pNewObject );
-// changeText( dynamic_cast< SdrTextObj* >( pNewObject ) );
}
+ else
+ {
+ // no target for created SdrObject (!)
+ OSL_ENSURE(false, "FontWorkGalleryDialog: No target for created SDrObject (!)");
+ deleteSdrObjectSafeAndClearPointer(pNewObject);
+ }
}
}
}
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/toolbars/fontworkbar.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/toolbars/fontworkbar.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/toolbars/fontworkbar.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/toolbars/fontworkbar.cxx Mon Jun 18 16:00:11 2012
@@ -485,7 +485,7 @@ void FontworkBar::execute( SdrView* pSdr
{
if(pSdrView)
{
- FontWorkGalleryDialog aDlg( *pSdrView, ImpGetViewWin(pSdrView), nSID );
+ FontWorkGalleryDialog aDlg( *pSdrView, ImpGetViewWin(pSdrView) );
aDlg.Execute();
}
else
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unopage.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unopage.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unopage.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unopage.cxx Mon Jun 18 16:00:11 2012
@@ -566,7 +566,7 @@ SdrObject *SvxDrawPage::_CreateSdrObject
basegfx::B2DPolygon aPoly;
aPoly.append(basegfx::B2DPoint(aPos.X, aPos.Y));
- aPoly.append(basegfx::B2DPoint(aPos.X + aSize.Width, aPos.Y + aSize.Height));
+ aPoly.append(basegfx::B2DPoint(aPos.X + 100.0, aPos.Y));
pNewObj = new SdrPathObj(*mpModel, basegfx::B2DPolyPolygon(aPoly));
bSetTransform = false;
}
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx Mon Jun 18 16:00:11 2012
@@ -1211,10 +1211,11 @@ bool SvxShapePolyPolygon::setPropertyVal
// migrate to pool metric
ForceMetricToItemPoolMetric(aNewPolyPolygon);
- // BaseGeometry means the polygon is just scaled, but has no position, shear
+ // BaseGeometry means the polygon is just scaled, but has no position, mirroring, shear
// or rotation. Apply these current values from the object
const basegfx::B2DHomMatrix aNoScaleTrans(
- basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ basegfx::B2DVector(mpObj->isMirroredX() ? -1.0 : 1.0, mpObj->isMirroredY() ? -1.0 : 1.0),
mpObj->getSdrObjectShearX(),
mpObj->getSdrObjectRotate(),
mpObj->getSdrObjectTranslate()));
@@ -1396,19 +1397,19 @@ bool SvxShapePolyPolygon::getPropertyVal
// migrtate to 1/100th mm
ForceMetricTo100th_mm(aPolyPolygon);
- // BaseGeometry means to get only the scaled polygon, so transform
+ // BaseGeometry means to get only the scaled and unmirrored polygon, so transform
// the polygon to only contain object scale
// get object transform
basegfx::B2DHomMatrix aOnlyScaleTransform(mpObj->getSdrObjectTransformation());
// extract the scale
- const basegfx::B2DVector& rScale = mpObj->getSdrObjectScale();
+ const basegfx::B2DVector aScale(basegfx::absolute(mpObj->getSdrObjectScale()));
// get transformation to unit coordinates
aOnlyScaleTransform.invert();
// add scale again
- aOnlyScaleTransform.scale(rScale);
+ aOnlyScaleTransform.scale(aScale);
// transform the polygon
aPolyPolygon.transform(aOnlyScaleTransform);
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx Mon Jun 18 16:00:11 2012
@@ -3209,7 +3209,7 @@ bool SvxShape::getPropertyValueImpl( con
{
SdrCircObj* pSdrCircObj = dynamic_cast< SdrCircObj* >(mpObj.get());
- if(pSdrCircObj && OBJ_CIRC != mpObj->GetObjIdentifier())
+ if(pSdrCircObj && CircleType_Circle != pSdrCircObj->GetSdrCircleObjType())
{
const double fAngle(OWN_ATTR_CIRCSTARTANGLE == pProperty->nWID ? pSdrCircObj->GetStartAngle() : pSdrCircObj->GetEndAngle());
const sal_Int32 nOldAngle(basegfx::fround(((F_2PI - fAngle) * 18000.0) / F_PI) % 36000);
Modified: incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/ui/uiview/viewdraw.cxx Mon Jun 18 16:00:11 2012
@@ -193,8 +193,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
if ( pSdrView )
{
SdrObject* pObj = NULL;
- svx::FontWorkGalleryDialog aDlg( *pSdrView, pWin, nSlotId );
- aDlg.SetSdrObjectRef( &pObj, &pSdrView->getSdrModelFromSdrView() );
+ svx::FontWorkGalleryDialog aDlg( *pSdrView, pWin, &pObj );
aDlg.Execute();
if ( pObj )
{
Modified: incubator/ooo/branches/alg/aw080/main/xmloff/inc/xexptran.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/inc/xexptran.hxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/inc/xexptran.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/inc/xexptran.hxx Mon Jun 18 16:00:11 2012
@@ -144,13 +144,13 @@ public:
const SdXMLImExViewBox& rViewBox,
const com::sun::star::awt::Point& rObjectPos,
const com::sun::star::awt::Size& rObjectSize,
- // #96328#
- const bool bClosed = true);
+ const bool bClosed);
SdXMLImExPointsElement(const rtl::OUString& rNew,
const SdXMLImExViewBox& rViewBox,
const com::sun::star::awt::Point& rObjectPos,
const com::sun::star::awt::Size& rObjectSize,
- const SvXMLUnitConverter& rConv);
+ const SvXMLUnitConverter& rConv,
+ const bool bClosed);
const rtl::OUString& GetExportString() const { return msString; }
const com::sun::star::drawing::PointSequenceSequence& GetPointSequenceSequence() const { return maPoly; }
Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapContext.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapContext.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapContext.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapContext.cxx Mon Jun 18 16:00:11 2012
@@ -504,8 +504,7 @@ void XMLImageMapPolygonContext::Prepare(
// get polygon sequence
awt::Point aPoint(aViewBox.GetX(), aViewBox.GetY());
awt::Size aSize(aViewBox.GetWidth(), aViewBox.GetHeight());
- SdXMLImExPointsElement aPoints( sPointsString, aViewBox, aPoint, aSize,
- GetImport().GetMM100UnitConverter() );
+ SdXMLImExPointsElement aPoints( sPointsString, aViewBox, aPoint, aSize, GetImport().GetMM100UnitConverter(), true );
PointSequenceSequence aPointSeqSeq = aPoints.GetPointSequenceSequence();
// only use first element of sequence-sequence
Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapExport.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapExport.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapExport.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/XMLImageMapExport.cxx Mon Jun 18 16:00:11 2012
@@ -376,7 +376,7 @@ void XMLImageMapExport::ExportPolygon(
// export point sequence
awt::Point aPoint(0, 0);
awt::Size aSize(nWidth, nHeight);
- SdXMLImExPointsElement aPoints( &aPoly, aViewBox, aPoint, aSize );
+ SdXMLImExPointsElement aPoints( &aPoly, aViewBox, aPoint, aSize, true);
mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_POINTS,
aPoints.GetExportString());
}
Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx Mon Jun 18 16:00:11 2012
@@ -1014,9 +1014,7 @@ void XMLShapeExport::ImpExportPolygonSha
drawing::PointSequence* pSequence = pSourcePolyPolygon->getArray();
if(pSequence)
{
- SdXMLImExPointsElement aPoints(pSequence, aViewBox, aPoint, aSize,
- // #96328#
- bClosed);
+ SdXMLImExPointsElement aPoints(pSequence, aViewBox, aPoint, aSize, bClosed);
// write point array
mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_POINTS, aPoints.GetExportString());
Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/xexptran.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/xexptran.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/xexptran.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/xexptran.cxx Mon Jun 18 16:00:11 2012
@@ -1319,7 +1319,6 @@ SdXMLImExPointsElement::SdXMLImExPointsE
const SdXMLImExViewBox& rViewBox,
const awt::Point& rObjectPos,
const awt::Size& rObjectSize,
- // #96328#
const bool bClosed)
: maPoly( 0L )
{
@@ -1385,7 +1384,8 @@ SdXMLImExPointsElement::SdXMLImExPointsE
const SdXMLImExViewBox& rViewBox,
const awt::Point& rObjectPos,
const awt::Size& rObjectSize,
- const SvXMLUnitConverter& rConv)
+ const SvXMLUnitConverter& rConv,
+ const bool bClosed)
: msString( rNew ),
maPoly( 0L )
{
@@ -1423,7 +1423,7 @@ SdXMLImExPointsElement::SdXMLImExPointsE
nPos = 0;
maPoly.realloc(1);
drawing::PointSequence* pOuterSequence = maPoly.getArray();
- pOuterSequence->realloc(nNumPoints);
+ pOuterSequence->realloc(nNumPoints + (bClosed ? 1 : 0));
awt::Point* pInnerSequence = pOuterSequence->getArray();
// object size and ViewBox size different?
@@ -1472,6 +1472,11 @@ SdXMLImExPointsElement::SdXMLImExPointsE
*pInnerSequence = awt::Point( nX, nY );
pInnerSequence++;
}
+
+ if(bClosed)
+ {
+ *pInnerSequence = *pOuterSequence->getArray();
+ }
}
}
Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpshap.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpshap.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpshap.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/draw/ximpshap.cxx Mon Jun 18 16:00:11 2012
@@ -1286,7 +1286,7 @@ void SdXMLPolygonShapeContext::StartElem
}
awt::Point aPosition(aViewBox.GetX(), aViewBox.GetY());
SdXMLImExPointsElement aPoints(maPoints, aViewBox,
- aPosition, aSize, GetImport().GetMM100UnitConverter());
+ aPosition, aSize, GetImport().GetMM100UnitConverter(), mbClosed);
uno::Any aAny;
aAny <<= aPoints.GetPointSequenceSequence();
Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/text/XMLTextFrameContext.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/text/XMLTextFrameContext.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/text/XMLTextFrameContext.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/text/XMLTextFrameContext.cxx Mon Jun 18 16:00:11 2012
@@ -307,7 +307,7 @@ XMLTextFrameContourContext_Impl::XMLText
else
{
SdXMLImExPointsElement aPoints( sPoints, aViewBox, aPoint, aSize,
- GetImport().GetMM100UnitConverter() );
+ GetImport().GetMM100UnitConverter(), true );
aAny <<= aPoints.GetPointSequenceSequence();
}
Modified: incubator/ooo/branches/alg/aw080/main/xmloff/source/text/txtparae.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/xmloff/source/text/txtparae.cxx?rev=1351396&r1=1351395&r2=1351396&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/xmloff/source/text/txtparae.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/xmloff/source/text/txtparae.cxx Mon Jun 18 16:00:11 2012
@@ -2941,7 +2941,7 @@ void XMLTextParagraphExport::exportConto
/*const*/ PointSequence* pSequence =
(PointSequence*)aSourcePolyPolygon.getConstArray();
- SdXMLImExPointsElement aPoints( pSequence, aViewBox, aPoint, aSize );
+ SdXMLImExPointsElement aPoints( pSequence, aViewBox, aPoint, aSize, true);
// write point array
GetExport().AddAttribute( XML_NAMESPACE_DRAW, XML_POINTS,