summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2018-05-24 19:09:44 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2018-05-31 15:53:51 +0200
commit4be44a7a6f2f480e55255d7cdd119f3d6577d085 (patch)
treee07008be8355538160d52ea94eb35a10dc83a4a1 /svx/source/svdraw
parent7d275e3ab35b3f9bfd7ff16290393ca027c50355 (diff)
SOSAW080: Cleanup of SdrModel
First step: Find all constructors/derivations, mark all of them. Removed two-value-constructors, adapted code as needed Reduced constructors for SdrModel/FmFormModel to a single one. Removed PathName for List creation, this is not needed and anyways all calls used the default SvtPathOptions().GetPalettePath(). This is also true for usage of IsFuzzing() that is also part of the default creation process (without path). All usages that need an extra-List were setting it after construction explicitely. Removed UseExtColorTable. This prevents a single List to be not created by default, the ColorTable which is replaced later by all callers that used this. This is not needed since the default ColorTable gets constructed just by default, no expensive stuff is triggered (e.g. loading the ColorTable). Thus now a default ColorTable is created and kept for a short moment, destructed again when a ColorTable is explicitely set. Doing so is also more safe - it avoids not creating a default-ColorTable and then not setting one (what would be urgently required). f23c24a8548d5246b77b1cc359ba89564538e81a f124468c3898c5842d37123bdeb87d79a2b19c62 Change-Id: I865de4bb23f673c6684d83c2c6390439506dc5b6 Reviewed-on: https://gerrit.libreoffice.org/55028 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdmodel.cxx53
1 files changed, 14 insertions, 39 deletions
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index bde671498fd1..b28b6f8c734e 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -17,22 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <svx/svdmodel.hxx>
-
#include <cassert>
#include <math.h>
-
#include <osl/endian.h>
#include <rtl/strbuf.hxx>
#include <sal/log.hxx>
-
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/document/XStorageBasedDocument.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
-
#include <unotools/configmgr.hxx>
-
+#include <unotools/pathoptions.hxx>
#include <svl/whiter.hxx>
#include <svl/asiancfg.hxx>
#include <svx/xit.hxx>
@@ -43,12 +38,9 @@
#include <svx/xflftrit.hxx>
#include <svx/xflhtit.hxx>
#include <svx/xlnstit.hxx>
-
#include <editeng/editdata.hxx>
#include <editeng/editeng.hxx>
-
#include <svx/xtable.hxx>
-
#include <svx/svditer.hxx>
#include <svx/svdtrans.hxx>
#include <svx/svdpage.hxx>
@@ -64,10 +56,8 @@
#include <svx/dialmgr.hxx>
#include <svx/strings.hrc>
#include <svdoutlinercache.hxx>
-
#include <svx/xflclit.hxx>
#include <svx/xlnclit.hxx>
-
#include <officecfg/Office/Common.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/colritem.hxx>
@@ -80,10 +70,8 @@
#include <svl/zforlist.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/storagehelper.hxx>
-
#include <tools/tenccvt.hxx>
#include <unotools/syslocale.hxx>
-
#include <svx/sdr/properties/properties.hxx>
#include <editeng/eeitem.hxx>
#include <svl/itemset.hxx>
@@ -111,8 +99,9 @@ struct SdrModelImpl
};
-void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbeddedHelper,
- bool bUseExtColorTable)
+void SdrModel::ImpCtor(
+ SfxItemPool* pPool,
+ ::comphelper::IEmbeddedHelper* _pEmbeddedHelper)
{
mpImpl.reset(new SdrModelImpl);
mpImpl->mpUndoManager=nullptr;
@@ -168,8 +157,6 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
else
mnCharCompressType = CharCompressType::NONE;
- bExtColorTable=bUseExtColorTable;
-
if ( pPool == nullptr )
{
pItemPool=new SdrItemPool(nullptr);
@@ -216,26 +203,13 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
ImpCreateTables();
}
-SdrModel::SdrModel():
- maMaPag(),
+SdrModel::SdrModel(
+ SfxItemPool* pPool,
+ ::comphelper::IEmbeddedHelper* pPers)
+: maMaPag(),
maPages()
{
- ImpCtor(nullptr, nullptr, false);
-}
-
-SdrModel::SdrModel(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers):
- maMaPag(),
- maPages()
-{
- ImpCtor(pPool,pPers,false/*bUseExtColorTable*/);
-}
-
-SdrModel::SdrModel(const OUString& rPath, SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* pPers, bool bUseExtColorTable):
- maMaPag(),
- maPages(),
- aTablePath(rPath)
-{
- ImpCtor(pPool,pPers,bUseExtColorTable);
+ ImpCtor(pPool,pPers);
}
SdrModel::~SdrModel()
@@ -616,11 +590,12 @@ bool SdrModel::IsUndoEnabled() const
void SdrModel::ImpCreateTables()
{
+ // use standard path for initial construction
+ const OUString aTablePath(!utl::ConfigManager::IsFuzzing() ? SvtPathOptions().GetPalettePath() : "");
+
for( auto i : o3tl::enumrange<XPropertyListType>() )
{
- if( !bExtColorTable || i != XPropertyListType::Color )
- maProperties[i] = XPropertyList::CreatePropertyList (
- i, aTablePath, ""/*TODO?*/ );
+ maProperties[i] = XPropertyList::CreatePropertyList(i, aTablePath, ""/*TODO?*/ );
}
}
@@ -655,7 +630,7 @@ void SdrModel::ClearModel(bool bCalledFromDestructor)
SdrModel* SdrModel::AllocModel() const
{
- SdrModel* pModel=new SdrModel;
+ SdrModel* pModel=new SdrModel();
pModel->SetScaleUnit(eObjUnit,aObjUnit);
return pModel;
}