summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/inc/svx/sdr/properties/pageproperties.hxx3
-rw-r--r--svx/inc/svx/sdr/properties/properties.hxx4
-rw-r--r--svx/inc/svx/svdmodel.hxx1
-rw-r--r--svx/inc/svx/svdobj.hxx3
-rw-r--r--svx/inc/svx/svdogrp.hxx3
-rw-r--r--svx/inc/svx/svdovirt.hxx2
-rw-r--r--svx/source/sdr/properties/defaultproperties.cxx4
-rw-r--r--svx/source/sdr/properties/pageproperties.cxx6
-rw-r--r--svx/source/sdr/properties/properties.cxx30
-rw-r--r--svx/source/svdraw/svdmodel.cxx16
-rw-r--r--svx/source/svdraw/svdobj.cxx6
-rw-r--r--svx/source/svdraw/svdogrp.cxx11
-rw-r--r--svx/source/svdraw/svdovirt.cxx2
-rw-r--r--svx/source/table/svdotable.cxx2
-rw-r--r--svx/source/xoutdev/xpool.cxx4
-rw-r--r--xmloff/source/transform/ActionMapTypesOOo.hxx1
-rw-r--r--xmloff/source/transform/AttrTransformerAction.hxx1
-rw-r--r--xmloff/source/transform/OOo2Oasis.cxx24
-rw-r--r--xmloff/source/transform/TransformerBase.cxx11
19 files changed, 125 insertions, 9 deletions
diff --git a/svx/inc/svx/sdr/properties/pageproperties.hxx b/svx/inc/svx/sdr/properties/pageproperties.hxx
index d85686b3bc5b..9dbbc645d9be 100644
--- a/svx/inc/svx/sdr/properties/pageproperties.hxx
+++ b/svx/inc/svx/sdr/properties/pageproperties.hxx
@@ -45,6 +45,9 @@ namespace sdr
// Do the ItemChange, may do special handling
virtual void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = 0);
+ // Called after ItemChange() is done for all items.
+ virtual void PostItemChange(const sal_uInt16 nWhich);
+
public:
// basic constructor
PageProperties(SdrObject& rObj);
diff --git a/svx/inc/svx/sdr/properties/properties.hxx b/svx/inc/svx/sdr/properties/properties.hxx
index 311c2ccfd1a5..99ebdfbb1be9 100644
--- a/svx/inc/svx/sdr/properties/properties.hxx
+++ b/svx/inc/svx/sdr/properties/properties.hxx
@@ -187,6 +187,10 @@ namespace sdr
// default implementation returns 0 (zero)
virtual sal_uInt32 getVersion() const;
};
+
+ // checks the FillStyle item and removes unneeded Gradient, FillBitmap and Hatch items
+ void SVX_DLLPUBLIC CleanupFillProperties( SfxItemSet& rItemSet );
+
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx
index a32147a3032f..3c112bc57700 100644
--- a/svx/inc/svx/svdmodel.hxx
+++ b/svx/inc/svx/svdmodel.hxx
@@ -742,6 +742,7 @@ public:
also during the runtime of the Undo() and Redo() methods. */
bool IsUndoEnabled() const;
+ void SetDrawingLayerPoolDefaults();
};
typedef tools::WeakReference< SdrModel > SdrModelWeakRef;
diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx
index 86d6f0717bb7..ef915a43ae30 100644
--- a/svx/inc/svx/svdobj.hxx
+++ b/svx/inc/svx/svdobj.hxx
@@ -673,7 +673,8 @@ public:
// a new method for accessing the last BoundRect.
virtual const Rectangle& GetLastBoundRect() const;
- virtual void RecalcBoundRect();
+ // If bForced is true, the boundrect is also calculated when the model is locked
+ virtual void RecalcBoundRect(bool bForced = false);
void BroadcastObjectChange() const;
diff --git a/svx/inc/svx/svdogrp.hxx b/svx/inc/svx/svdogrp.hxx
index 9cf0ad056047..bae18a85a261 100644
--- a/svx/inc/svx/svdogrp.hxx
+++ b/svx/inc/svx/svdogrp.hxx
@@ -79,6 +79,9 @@ public:
virtual const Rectangle& GetCurrentBoundRect() const;
virtual const Rectangle& GetSnapRect() const;
+ // If bForced is true, the boundrect is also calculated when the model is locked
+ virtual void RecalcBoundRect(bool bForced = false);
+
virtual void operator=(const SdrObject& rObj);
virtual void TakeObjNameSingul(String& rName) const;
diff --git a/svx/inc/svx/svdovirt.hxx b/svx/inc/svx/svdovirt.hxx
index dba62f84730e..b169e9e03958 100644
--- a/svx/inc/svx/svdovirt.hxx
+++ b/svx/inc/svx/svdovirt.hxx
@@ -76,7 +76,7 @@ public:
virtual const Rectangle& GetCurrentBoundRect() const;
virtual const Rectangle& GetLastBoundRect() const;
- virtual void RecalcBoundRect();
+ virtual void RecalcBoundRect(bool bForced = false);
virtual void SetChanged();
virtual SdrObject* Clone() const;
virtual void operator=(const SdrObject& rObj);
diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx
index 7d51b26a0051..41149a965248 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -204,8 +204,10 @@ namespace sdr
{
}
- void DefaultProperties::PostItemChange(const sal_uInt16 /*nWhich*/)
+ void DefaultProperties::PostItemChange(const sal_uInt16 nWhich )
{
+ if( (nWhich == XATTR_FILLSTYLE) && (mpItemSet != NULL) )
+ CleanupFillProperties(*mpItemSet);
}
void DefaultProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, sal_Bool /*bDontRemoveHardAttr*/)
diff --git a/svx/source/sdr/properties/pageproperties.cxx b/svx/source/sdr/properties/pageproperties.cxx
index 2fc92633b953..c1d0467b740e 100644
--- a/svx/source/sdr/properties/pageproperties.cxx
+++ b/svx/source/sdr/properties/pageproperties.cxx
@@ -89,6 +89,12 @@ namespace sdr
return 0L;
}
+ void PageProperties::PostItemChange(const sal_uInt16 nWhich )
+ {
+ if( (nWhich == XATTR_FILLSTYLE) && (mpEmptyItemSet != NULL) )
+ CleanupFillProperties(*mpEmptyItemSet);
+ }
+
void PageProperties::ClearObjectItem(const sal_uInt16 /*nWhich*/)
{
// simply ignore item clearing on page objects
diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx
index f8c307f26309..0439fd6baf4c 100644
--- a/svx/source/sdr/properties/properties.cxx
+++ b/svx/source/sdr/properties/properties.cxx
@@ -32,6 +32,7 @@
#include <svl/itemset.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svditer.hxx>
+#include <svx/xfillit0.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -182,6 +183,35 @@ namespace sdr
{
return 0;
}
+
+ void CleanupFillProperties( SfxItemSet& rItemSet )
+ {
+ const bool bFillBitmap = rItemSet.GetItemState(XATTR_FILLBITMAP, sal_False) == SFX_ITEM_SET;
+ const bool bFillGradient = rItemSet.GetItemState(XATTR_FILLGRADIENT, sal_False) == SFX_ITEM_SET;
+ const bool bFillHatch = rItemSet.GetItemState(XATTR_FILLHATCH, sal_False) == SFX_ITEM_SET;
+ if( bFillBitmap || bFillGradient || bFillHatch )
+ {
+ const XFillStyleItem* pFillStyleItem = dynamic_cast< const XFillStyleItem* >( rItemSet.GetItem(XATTR_FILLSTYLE) );
+ if( pFillStyleItem )
+ {
+ if( bFillBitmap && (pFillStyleItem->GetValue() != XFILL_BITMAP) )
+ {
+ rItemSet.ClearItem( XATTR_FILLBITMAP );
+ }
+
+ if( bFillGradient && (pFillStyleItem->GetValue() != XFILL_GRADIENT) )
+ {
+ rItemSet.ClearItem( XATTR_FILLGRADIENT );
+ }
+
+ if( bFillHatch && (pFillStyleItem->GetValue() != XFILL_HATCH) )
+ {
+ rItemSet.ClearItem( XATTR_FILLHATCH );
+ }
+ }
+ }
+ }
+
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 5328e5f1a3d1..eeefc7223b77 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -69,6 +69,9 @@
#include "svx/svdstr.hrc" // Objektname
#include "svdoutlinercache.hxx"
+#include "svx/xflclit.hxx"
+#include "svx/xflhtit.hxx"
+#include "svx/xlnclit.hxx"
#include <svl/asiancfg.hxx>
#include "editeng/fontitem.hxx"
@@ -210,6 +213,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
pItemPool->SetPoolDefaultItem( SdrTextWordWrapItem( sal_False ) );
SetTextDefaults();
+
pLayerAdmin=new SdrLayerAdmin;
pLayerAdmin->SetModel(this);
ImpSetUIUnit();
@@ -2167,6 +2171,18 @@ const ::com::sun::star::uno::Sequence< sal_Int8 >& SdrModel::getUnoTunnelImpleme
return *pSeq;
}
+void SdrModel::SetDrawingLayerPoolDefaults()
+{
+ const String aNullStr;
+ const Color aNullLineCol(COL_DEFAULT_SHAPE_STROKE);
+ const Color aNullFillCol(COL_DEFAULT_SHAPE_FILLING);
+ const XHatch aNullHatch(aNullLineCol);
+
+ pItemPool->SetPoolDefaultItem( XFillColorItem(aNullStr,aNullFillCol) );
+ pItemPool->SetPoolDefaultItem( XFillHatchItem(pItemPool,aNullHatch) );
+ pItemPool->SetPoolDefaultItem( XLineColorItem(aNullStr,aNullLineCol) );
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
TYPEINIT1(SdrHint,SfxHint);
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index c0d9e8613a92..2655a335eedc 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -926,14 +926,14 @@ const Rectangle& SdrObject::GetLastBoundRect() const
return aOutRect;
}
-void SdrObject::RecalcBoundRect()
+void SdrObject::RecalcBoundRect(bool bForced)
{
// #i101680# suppress BoundRect calculations on import(s)
- if(pModel && pModel->isLocked() )
+ if(pModel && pModel->isLocked() && !bForced )
return;
// central new method which will calculate the BoundRect using primitive geometry
- if(aOutRect.IsEmpty())
+ if(aOutRect.IsEmpty() || bForced)
{
const drawinglayer::primitive2d::Primitive2DSequence xPrimitives(GetViewContact().getViewIndependentPrimitive2DSequence());
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index ede6b35178f9..c62732ed044b 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -282,6 +282,17 @@ const Rectangle& SdrObjGroup::GetCurrentBoundRect() const
// <--
}
+void SdrObjGroup::RecalcBoundRect(bool bForced)
+{
+ if( bForced )
+ {
+ sal_uIntPtr nAnz=pSub->GetObjCount();
+ for( sal_uIntPtr i=0; i<nAnz; i++)
+ pSub->GetObj(i)->RecalcBoundRect(true);
+ }
+
+ SdrObject::RecalcBoundRect(bForced);
+}
const Rectangle& SdrObjGroup::GetSnapRect() const
{
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index c6703f2305df..53d81b54d27e 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -148,7 +148,7 @@ const Rectangle& SdrVirtObj::GetLastBoundRect() const
return aOutRect;
}
-void SdrVirtObj::RecalcBoundRect()
+void SdrVirtObj::RecalcBoundRect(bool bForced)
{
aOutRect=rRefObj.GetCurrentBoundRect();
aOutRect+=aAnchor;
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 9ac652f5e025..5618a2880e31 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -330,6 +330,7 @@ void SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource )
void SdrTableObjImpl::SetModel(SdrModel* /*pOldModel*/, SdrModel* pNewModel)
{
// try to find new table style
+ disconnectTableStyle();
Reference< XIndexAccess > xNewTableStyle;
if( mxTableStyle.is() ) try
@@ -360,6 +361,7 @@ void SdrTableObjImpl::SetModel(SdrModel* /*pOldModel*/, SdrModel* pNewModel)
mxTableStyle = xNewTableStyle;
+ connectTableStyle();
update();
}
diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx
index 305b181a65a2..a86baef14810 100644
--- a/svx/source/xoutdev/xpool.cxx
+++ b/svx/source/xoutdev/xpool.cxx
@@ -52,8 +52,8 @@ XOutdevItemPool::XOutdevItemPool(
const XubString aNullStr;
const Bitmap aNullBmp;
const basegfx::B2DPolyPolygon aNullPol;
- const Color aNullLineCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE));
- const Color aNullFillCol(RGB_Color(COL_DEFAULT_SHAPE_FILLING));
+ const Color aNullLineCol(RGB_Color(COL_BLACK));
+ const Color aNullFillCol(RGB_COLORDATA( 153, 204, 255 ));
const Color aNullShadowCol(RGB_Color(COL_LIGHTGRAY));
const XDash aNullDash;
const XGradient aNullGrad(aNullLineCol, RGB_Color(COL_WHITE));
diff --git a/xmloff/source/transform/ActionMapTypesOOo.hxx b/xmloff/source/transform/ActionMapTypesOOo.hxx
index ff8081b025cf..a9ed15ecb74a 100644
--- a/xmloff/source/transform/ActionMapTypesOOo.hxx
+++ b/xmloff/source/transform/ActionMapTypesOOo.hxx
@@ -86,6 +86,7 @@ enum ActionMapTypesOOo
OOO_SOURCE_SERVICE_ACTIONS,
OOO_DRAW_AREA_POLYGON_ACTIONS,
OOO_SCRIPT_ACTIONS,
+ OOO_ANIMATION_ACTIONS,
MAX_OOO_ACTIONS
};
diff --git a/xmloff/source/transform/AttrTransformerAction.hxx b/xmloff/source/transform/AttrTransformerAction.hxx
index ffcd8b43ada0..0cfb6a116c2c 100644
--- a/xmloff/source/transform/AttrTransformerAction.hxx
+++ b/xmloff/source/transform/AttrTransformerAction.hxx
@@ -135,6 +135,7 @@ enum XMLAttrTransformerAction
XML_ATACTION_GAMMA_OOO, // converts double value to percentage
XML_ATACTION_DECODE_ID, // converts strings with non numeric characters to only numeric character ids
XML_ATACTION_OPACITY_FIX, // converts transparency to opacity and back
+ XML_ATACTION_SHAPEID, // convert shape id
XML_ATACTION_USER_DEFINED=0x40000000,// user defined actions start here
XML_ATACTION_END=XML_TACTION_END
};
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index 103202c48866..b678da6b2304 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -573,6 +573,14 @@ static XMLTransformerActionInit aActionTable[] =
ENTRY1( TABLE, SOURCE_SERVICE, XML_ETACTION_PROC_ATTRS,
OOO_SOURCE_SERVICE_ACTIONS ),
+ // fix id strings in old animation elements
+ ENTRY1( PRESENTATION, DIM, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
+ ENTRY1( PRESENTATION, PLAY, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
+ ENTRY1( PRESENTATION, SHOW_TEXT, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
+ ENTRY1( PRESENTATION, SHOW_SHAPE, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
+ ENTRY1( PRESENTATION, HIDE_TEXT, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
+ ENTRY1( PRESENTATION, HIDE_SHAPE, XML_ETACTION_PROC_ATTRS, OOO_ANIMATION_ACTIONS ),
+
ENTRY0( OFFICE, TOKEN_INVALID, XML_ETACTION_EOT )
};
@@ -755,6 +763,9 @@ static XMLTransformerActionInit aShapeActionTable[] =
ENTRY2( CHART, LEGEND_POSITION, XML_ATACTION_RENAME_ATTRIBUTE,
RENAME_ENTRY( XML_LEFT, XML_START ),
RENAME_ENTRY( XML_RIGHT, XML_END )),
+ ENTRY0( DRAW, ID, XML_ATACTION_SHAPEID ),
+ ENTRY0( DRAW, START_SHAPE, XML_ATACTION_SHAPEID ),
+ ENTRY0( DRAW, END_SHAPE, XML_ATACTION_SHAPEID ),
ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
};
@@ -778,6 +789,7 @@ static XMLTransformerActionInit aConnectorActionTable[] =
ENTRY1Q( FORM, ID, XML_ATACTION_RENAME,
XML_NAMESPACE_DRAW, XML_CONTROL ),
ENTRY1( XLINK, HREF, XML_ATACTION_URI_OOO, sal_True ),
+ ENTRY0( DRAW, ID, XML_ATACTION_SHAPEID ),
ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
};
@@ -1036,6 +1048,14 @@ static XMLTransformerActionInit aSourceServiceActionTable[] =
ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
};
+// OOO_ANIMATION_ACTIONS
+static XMLTransformerActionInit aAnimationsActionTable[] =
+{
+ ENTRY0( DRAW, SHAPE_ID, XML_ATACTION_SHAPEID ),
+ ENTRY0( PRESENTATION, PATH_ID, XML_ATACTION_SHAPEID ),
+ ENTRY0( OFFICE, TOKEN_INVALID, XML_ATACTION_EOT )
+};
+
// OOO_DRAW_AREA_POLYGON_ACTIONS (to be added to OOO_SHAPE_ACTIONS)
static XMLTransformerActionInit aDrawAreaPolygonActionTable[] =
{
@@ -1777,6 +1797,10 @@ XMLTransformerActions *OOo2OasisTransformer::GetUserDefinedActions(
m_aActions[OOO_SCRIPT_ACTIONS] =
new XMLTransformerActions( aScriptActionTable );
break;
+ case OOO_ANIMATION_ACTIONS:
+ m_aActions[OOO_ANIMATION_ACTIONS] =
+ new XMLTransformerActions( aAnimationsActionTable );
+ break;
}
}
pActions = m_aActions[n];
diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx
index 61bb73120da6..f2d7af5585c0 100644
--- a/xmloff/source/transform/TransformerBase.cxx
+++ b/xmloff/source/transform/TransformerBase.cxx
@@ -248,6 +248,9 @@ void SAL_CALL XMLTransformerBase::startElement( const OUString& rName,
{
SvXMLNamespaceMap *pRewindMap = 0;
+ bool bRect = rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "presentation:show-shape" ) );
+ (void)bRect;
+
// Process namespace attributes. This must happen before creating the
// context, because namespace decaration apply to the element name itself.
XMLMutableAttributeList *pMutableAttrList = 0;
@@ -888,6 +891,14 @@ XMLMutableAttributeList *XMLTransformerBase::ProcessAttrList(
}
break;
// <--
+ case XML_ATACTION_SHAPEID:
+ {
+ OUString sNewValue( RTL_CONSTASCII_USTRINGPARAM( "shape" ) );
+ sNewValue += rAttrValue;
+ pMutableAttrList->SetValueByIndex( i, sNewValue );
+ break;
+ }
+
default:
OSL_ENSURE( !this, "unknown action" );
break;