diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-02-06 12:09:48 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-02-06 12:44:37 +0100 |
commit | 1a3c90a292c7fc9060604151de9dc51eecf5b6a7 (patch) | |
tree | 226567cca6b2f74e749f36cc3ef3b76d67eb91a1 /sw | |
parent | fdfd5c111de740456bc03df727b9c74a617237fc (diff) |
sw: let drawinglayer manage gradient styles of our textframes
With this, the hacks from commits
81a46fc86a530f028a5bd2f5e52fe0372d50ee38 and
d7efffebd9651dd866349915360ade64b97d7301 are no longer necessary.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/unotxdoc.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 8 |
3 files changed, 8 insertions, 9 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index dea4ea7365b9..e3c6acd4ac5a 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -550,7 +550,6 @@ class SwXDocumentPropertyHelper : public SvxUnoForbiddenCharsTable { css::uno::Reference < css::uno::XInterface > xDashTable; css::uno::Reference < css::uno::XInterface > xGradientTable; - css::uno::Reference < css::uno::XInterface > xTextGradientTable; css::uno::Reference < css::uno::XInterface > xHatchTable; css::uno::Reference < css::uno::XInterface > xBitmapTable; css::uno::Reference < css::uno::XInterface > xTransGradientTable; diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 5ca640a00be8..675dcf39a929 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -263,7 +263,15 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SwDoc* pDoc, SfxItemSet& rToSe { rToSet.Put(*pItem); if(pItem != &aFillGradient) + { + // New name was generated? Then insert it to the drawinglayer style table. + uno::Reference<frame::XModel> xModel(pDoc->GetDocShell()->GetModel()); + uno::Reference<lang::XMultiServiceFactory> xServiceFact(xModel, uno::UNO_QUERY); + uno::Reference< container::XNameContainer > xGradients(xServiceFact->createInstance("com.sun.star.drawing.GradientTable"), uno::UNO_QUERY); + xGradients->insertByName(pItem->GetName(), *pFillGradient); + delete pItem; + } } } } diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 12504c3a35ad..d35a18389bc2 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -153,7 +153,6 @@ using ::osl::FileBase; #define SW_CREATE_TRANSGRADIENT_TABLE 0x05 #define SW_CREATE_MARKER_TABLE 0x06 #define SW_CREATE_DRAW_DEFAULTS 0x07 -#define SW_CREATE_TEXT_GRADIENT_TABLE 0x08 extern bool sw_GetPostIts( IDocumentFieldsAccess* pIDFA, _SetGetExpFlds * pSrtLst ); @@ -1692,8 +1691,6 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic { if( 0 == rServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.DocumentSettings") ) ) xRet = Reference < XInterface > ( *new SwXDocumentSettings ( this ) ); - if( 0 == rServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.GradientTable") ) ) - xRet = GetPropertyHelper()->GetDrawTable(SW_CREATE_TEXT_GRADIENT_TABLE); } else if (sCategory == "chart2" ) { @@ -3904,11 +3901,6 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich) xDrawDefaults = (cppu::OWeakObject*)new SwSvxUnoDrawPool(m_pDoc); xRet = xDrawDefaults; break; - case SW_CREATE_TEXT_GRADIENT_TABLE : - if(!xTextGradientTable.is()) - xTextGradientTable = SvxUnoTextGradientTable_createInstance( m_pDoc->GetOrCreateDrawModel(), RES_FILL_GRADIENT ); - xRet = xTextGradientTable; - break; #if OSL_DEBUG_LEVEL > 0 default: OSL_FAIL("which table?"); #endif |