diff options
author | obo <obo@openoffice.org> | 2010-05-20 11:31:55 +0200 |
---|---|---|
committer | obo <obo@openoffice.org> | 2010-05-20 11:31:55 +0200 |
commit | 1def7b79edd1b04a4232c5f950547f9319e30362 (patch) | |
tree | 4aa890bd31b356f293be32006ce83e1b0acd4d24 | |
parent | bca7f6bd134b5708e4d96dc0528ec7725c1b34f7 (diff) | |
parent | 1b013a8ae93ab3a079c5530703f8a7c84de276b8 (diff) |
CWS-TOOLING: integrate CWS sdk321ooo/OOO320_m19ooo/OOO320_m18
-rw-r--r-- | basic/source/uno/scriptcont.cxx | 2 | ||||
-rw-r--r-- | svx/source/sdr/properties/attributeproperties.cxx | 22 |
2 files changed, 21 insertions, 3 deletions
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 54c8aa27cc..de8090f86c 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -942,7 +942,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary try { xElementRootStorage = ::comphelper::OStorageHelper::GetStorageFromURL( aElementPath, - embed::ElementModes::READWRITE ); + embed::ElementModes::READ ); } catch( uno::Exception& ) { // TODO: error handling diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index 18f420c418..1b514e8418 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -259,6 +259,8 @@ namespace sdr void AttributeProperties::MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel) { + OSL_ASSERT(pNewModel!=NULL); + if(pSrcPool && pDestPool && (pSrcPool != pDestPool)) { if(mpItemSet) @@ -291,8 +293,24 @@ namespace sdr } else { - // StyleSheet is NOT from the correct pool; use default - ImpAddStyleSheet(pNewModel->GetDefaultStyleSheet(), sal_True); + // StyleSheet is NOT from the correct pool. + // Look one up in the right pool with the same + // name or use the default. + + // Look up the style in the new document. + OSL_ASSERT(pNewModel->GetStyleSheetPool() != NULL); + SfxStyleSheet* pNewStyleSheet = dynamic_cast<SfxStyleSheet*>( + pNewModel->GetStyleSheetPool()->Find( + pStySheet->GetName(), + SFX_STYLE_FAMILY_ALL)); + if (pNewStyleSheet == NULL + || &pNewStyleSheet->GetPool().GetPool() != pDestPool) + { + // There is no copy of the style in the new + // document. Use the default as a fallback. + pNewStyleSheet = pNewModel->GetDefaultStyleSheet(); + } + ImpAddStyleSheet(pNewStyleSheet, sal_True); } } |