[ooo-build-commit] Branch 'ooo/master' - 3 commits - drawinglayer/source framework/source svx/inc svx/source

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Sep 9 20:12:04 PDT 2009


 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx     |    4 
 framework/source/accelerators/acceleratorconfiguration.cxx     |  127 ++---
 framework/source/inc/accelerators/acceleratorconfiguration.hxx |    4 
 svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx      |    6 
 svx/source/customshapes/EnhancedCustomShape2d.cxx              |  245 ++++++----
 svx/source/customshapes/EnhancedCustomShape2d.hxx              |    5 
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx        |    4 
 svx/source/msfilter/msdffimp.cxx                               |   19 
 svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx      |   14 
 svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx       |   16 
 svx/source/svdraw/svdedtv.cxx                                  |    5 
 svx/source/svdraw/svdfppt.cxx                                  |   33 +
 svx/source/svdraw/svdmrkv.cxx                                  |    6 
 svx/source/svdraw/svdotextdecomposition.cxx                    |   69 ++
 svx/source/table/cell.cxx                                      |   13 
 svx/source/table/cellcursor.cxx                                |   17 
 svx/source/table/tablecontroller.cxx                           |   41 -
 svx/source/table/tablelayouter.cxx                             |    1 
 svx/source/table/tablemodel.cxx                                |   14 
 19 files changed, 431 insertions(+), 212 deletions(-)

New commits:
commit ffb423afc7dbcc6cf15860425a10b39df8a19a47
Author: Oliver Bolte <obo at openoffice.org>
Date:   Wed Sep 9 11:10:21 2009 +0000

    #i10000# corrected Version by OJ

diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index 4a9fadb..5788a30 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -111,11 +111,10 @@ namespace framework
     namespace fpc = ::framework::pattern::configuration;
 #endif
 
-    ::rtl::OUString lcl_getKeyString(const css::awt::KeyEvent& aKeyEvent)
+    ::rtl::OUString lcl_getKeyString(KeyMapping& _rKeyMapping,const css::awt::KeyEvent& aKeyEvent)
     {
-        KeyMapping aKeyMapping;
         const sal_Int32 nBeginIndex = 4; // "KEY_" is the prefix of a identifier...
-        ::rtl::OUStringBuffer sKeyBuffer((aKeyMapping.mapCodeToIdentifier(aKeyEvent.KeyCode)).copy(nBeginIndex));
+        ::rtl::OUStringBuffer sKeyBuffer((_rKeyMapping.mapCodeToIdentifier(aKeyEvent.KeyCode)).copy(nBeginIndex));
         
         if ( (aKeyEvent.Modifiers & css::awt::KeyModifier::SHIFT) == css::awt::KeyModifier::SHIFT )
             sKeyBuffer.appendAscii("_SHIFT");
@@ -708,7 +707,6 @@ XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration(const css::un
                                 , m_pPrimaryWriteCache(0                        )
                                 , m_pSecondaryWriteCache(0                      )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration" );
     static const ::rtl::OUString CFG_ENTRY_ACCELERATORS(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Accelerators"));
     m_xCfg = css::uno::Reference< css::container::XNameAccess > ( 
              ::comphelper::ConfigurationHelper::openConfig( m_xSMGR, CFG_ENTRY_ACCELERATORS, ::comphelper::ConfigurationHelper::E_ALL_LOCALES ), 
@@ -724,7 +722,6 @@ XCUBasedAcceleratorConfiguration::~XCUBasedAcceleratorConfiguration()
 css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfiguration::getAllKeyEvents()
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::getAllKeyEvents" );
     // SAFE -> ----------------------------------
     ReadGuard aReadLock(m_aLock);
 
@@ -747,7 +744,6 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati
     throw(css::container::NoSuchElementException,
           css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::getCommandByKeyEvent" );
     // SAFE -> ----------------------------------
     ReadGuard aReadLock(m_aLock);
 
@@ -773,7 +769,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE
                                                     throw(css::lang::IllegalArgumentException,
                                                     css::uno::RuntimeException         )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::setKeyEvent" );
     RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::setKeyEvent" );
 
     if (
@@ -860,7 +855,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeKeyEvent(const css::awt::K
     throw(css::container::NoSuchElementException,
           css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::removeKeyEvent" );
     // SAFE -> ----------------------------------
     WriteGuard aWriteLock(m_aLock);
 
@@ -905,7 +899,6 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati
         css::container::NoSuchElementException,
         css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::getKeyEventsByCommand" );
     if (!sCommand.getLength())
         throw css::lang::IllegalArgumentException(
                 ::rtl::OUString::createFromAscii("Empty command strings are not allowed here."),
@@ -959,7 +952,6 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XCUBasedAcceleratorConfiguration::g
     throw(css::lang::IllegalArgumentException   ,
         css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::getPreferredKeyEventsForCommandList" );
     // SAFE -> ----------------------------------
     ReadGuard aReadLock(m_aLock);
 
@@ -1004,7 +996,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents(co
         css::container::NoSuchElementException,
         css::uno::RuntimeException            )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents" );
     if (!sCommand.getLength())
         throw css::lang::IllegalArgumentException(
                 ::rtl::OUString::createFromAscii("Empty command strings are not allowed here."),
@@ -1036,7 +1027,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reload()
     throw(css::uno::Exception       ,
         css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::reload" );
     RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::reload()" );
 
     // SAFE -> ----------------------------------
@@ -1078,7 +1068,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::store()
     throw(css::uno::Exception       ,
           css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::reload" );
     RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::store()" );
 
     // SAFE -> ----------------------------------
@@ -1108,7 +1097,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R
     throw(css::uno::Exception       ,
       css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::storeToStorage" );
     // use m_aCache + old AcceleratorXMLWriter to store data directly on storage given as parameter ...  
     if (!xStorage.is())
         return;
@@ -1175,7 +1163,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R
 ::sal_Bool SAL_CALL XCUBasedAcceleratorConfiguration::isModified()
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::isModified" );
     return sal_False;
 }
 
@@ -1183,7 +1170,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R
 ::sal_Bool SAL_CALL XCUBasedAcceleratorConfiguration::isReadOnly()
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::isReadOnly" );
     return sal_False;
 }
 
@@ -1191,7 +1177,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R
 void SAL_CALL XCUBasedAcceleratorConfiguration::setStorage(const css::uno::Reference< css::embed::XStorage >& /*xStorage*/)
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::setStorage" );
     LOG_WARNING("XCUBasedAcceleratorConfiguration::setStorage()", "TODO implement this HACK .-)")
 }
 
@@ -1199,7 +1184,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setStorage(const css::uno::Refer
 ::sal_Bool SAL_CALL XCUBasedAcceleratorConfiguration::hasStorage()
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::hasStorage" );
     LOG_WARNING("XCUBasedAcceleratorConfiguration::hasStorage()", "TODO implement this HACK .-)")
         return sal_False;
 }
@@ -1208,7 +1192,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setStorage(const css::uno::Refer
 void SAL_CALL XCUBasedAcceleratorConfiguration::addConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener >& /*xListener*/)
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::addConfigurationListener" );
     LOG_WARNING("XCUBasedAcceleratorConfiguration::addConfigurationListener()", "TODO implement me")
 }
 
@@ -1216,7 +1199,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::addConfigurationListener(const c
 void SAL_CALL XCUBasedAcceleratorConfiguration::removeConfigurationListener(const css::uno::Reference< css::ui::XUIConfigurationListener >& /*xListener*/)
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::removeConfigurationListener" );
     LOG_WARNING("XCUBasedAcceleratorConfiguration::removeConfigurationListener()", "TODO implement me")
 }
 
@@ -1224,7 +1206,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeConfigurationListener(cons
 void SAL_CALL XCUBasedAcceleratorConfiguration::reset()
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::reset" );
     css::uno::Reference< css::container::XNamed > xNamed(m_xCfg, css::uno::UNO_QUERY);
     ::rtl::OUString sConfig = xNamed->getName();
     if ( sConfig.equalsAscii("Global") )
@@ -1247,7 +1228,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reset()
 void SAL_CALL XCUBasedAcceleratorConfiguration::addResetListener(const css::uno::Reference< css::form::XResetListener >& /*xListener*/)
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::reload" );
     LOG_WARNING("XCUBasedAcceleratorConfiguration::addResetListener()", "TODO implement me")
 }
 
@@ -1255,7 +1235,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::addResetListener(const css::uno:
 void SAL_CALL XCUBasedAcceleratorConfiguration::removeResetListener(const css::uno::Reference< css::form::XResetListener >& /*xListener*/)
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::removeResetListener" );
     LOG_WARNING("XCUBasedAcceleratorConfiguration::removeResetListener()", "TODO implement me")
 }
 
@@ -1263,7 +1242,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeResetListener(const css::u
 void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util::ChangesEvent& aEvent)
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::changesOccurred" );
     RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::changesOccurred()" );
 
     css::uno::Reference< css::container::XHierarchicalNameAccess > xHAccess;
@@ -1318,13 +1296,11 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util:
 void SAL_CALL XCUBasedAcceleratorConfiguration::disposing(const css::lang::EventObject& /*aSource*/)
     throw(css::uno::RuntimeException)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::changesOccurred" );
 }
 
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const css::uno::Reference< css::container::XNameAccess >& xCfg )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::impl_ts_load" );
     AcceleratorCache aReadCache = AcceleratorCache();
     css::uno::Reference< css::container::XNameAccess > xAccess;
     if (m_sGlobalOrModules.equalsAscii("Global"))
@@ -1435,7 +1411,6 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::impl_ts_save(sal_Bool bPreferred, const css::uno::Reference< css::container::XNameAccess >& /*xCfg*/)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::impl_ts_save" );
     if (bPreferred)
     {
         AcceleratorCache::TKeyList::const_iterator pIt;
@@ -1529,7 +1504,6 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(sal_Bool bPreferred, const c
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::insertKeyToConfiguration( const css::awt::KeyEvent& aKeyEvent, const ::rtl::OUString& sCommand, const sal_Bool bPreferred )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::insertKeyToConfiguration" );
     css::uno::Reference< css::container::XNameAccess > xAccess;
     css::uno::Reference< css::container::XNameContainer > xContainer;
     css::uno::Reference< css::lang::XSingleServiceFactory > xFac;
@@ -1555,7 +1529,7 @@ void XCUBasedAcceleratorConfiguration::insertKeyToConfiguration( const css::awt:
         xModules->getByName(m_sModuleCFG) >>= xContainer;
     }
 
-    const ::rtl::OUString sKey = lcl_getKeyString(aKeyEvent);
+    const ::rtl::OUString sKey = lcl_getKeyString(m_rKeyMapping,aKeyEvent);
     css::uno::Reference< css::container::XNameAccess > xKey;
     css::uno::Reference< css::container::XNameContainer > xCommand;
     if ( !xContainer->hasByName(sKey) )
@@ -1577,7 +1551,6 @@ void XCUBasedAcceleratorConfiguration::insertKeyToConfiguration( const css::awt:
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::removeKeyFromConfiguration( const css::awt::KeyEvent& aKeyEvent, const sal_Bool bPreferred )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::removeKeyFromConfiguration" );
     css::uno::Reference< css::container::XNameAccess > xAccess;
     css::uno::Reference< css::container::XNameContainer > xContainer;
 
@@ -1597,14 +1570,13 @@ void XCUBasedAcceleratorConfiguration::removeKeyFromConfiguration( const css::aw
         xModules->getByName(m_sModuleCFG) >>= xContainer;
     }
 
-    const ::rtl::OUString sKey = lcl_getKeyString(aKeyEvent);
+    const ::rtl::OUString sKey = lcl_getKeyString(m_rKeyMapping,aKeyEvent);
     xContainer->removeByName(sKey);
 }
 
 //----------------------------------------------- 
 void XCUBasedAcceleratorConfiguration::reloadChanged( const ::rtl::OUString& sPrimarySecondary, const ::rtl::OUString& sGlobalModules, const ::rtl::OUString& sModule, const ::rtl::OUString& sKey )
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::reloadChanged" );
     css::uno::Reference< css::container::XNameAccess > xAccess;
     css::uno::Reference< css::container::XNameContainer > xContainer;
 
@@ -1676,7 +1648,6 @@ void XCUBasedAcceleratorConfiguration::reloadChanged( const ::rtl::OUString& sPr
 //-----------------------------------------------    
 AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPreferred, sal_Bool bWriteAccessRequested)
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::impl_getCFG" );
     // SAFE -> ----------------------------------
     WriteGuard aWriteLock(m_aLock);
 
@@ -1726,7 +1697,6 @@ AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPrefer
 //-----------------------------------------------    
 ::comphelper::Locale XCUBasedAcceleratorConfiguration::impl_ts_getLocale() const
 {
-    RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::impl_ts_getLocale" );
     static ::rtl::OUString LOCALE_PACKAGE = ::rtl::OUString::createFromAscii("/org.openoffice.Setup");
     static ::rtl::OUString LOCALE_PATH    = ::rtl::OUString::createFromAscii("L10N"                 );
     static ::rtl::OUString LOCALE_KEY     = ::rtl::OUString::createFromAscii("ooLocale"             );
commit 36bff0ce9171dcb81e9c733e2c03fbe06ae1225a
Author: Oliver Bolte <obo at openoffice.org>
Date:   Wed Sep 9 09:19:53 2009 +0000

    CWS-TOOLING: integrate CWS impress174
    2009-08-27 18:21:38 +0200 af  r275502 : #i73289# Fixed detection of the cases when the layout menu is be disabled.
    2009-08-24 17:45:50 +0200 sj  r275326 : #i103360# only setting filltype if there is also a correct fill element
    2009-08-24 16:11:06 +0200 cl  r275322 : #i73871# only remove replaced objects from mark list if replaced by SdrEditView::ReplaceObjectAtView(). see issue for reason
    2009-08-24 15:03:33 +0200 cl  r275319 : fixed merge error
    2009-08-20 12:45:29 +0200 sj  r275174 : CWS-TOOLING: rebase CWS impress174 to trunk at 275001 (milestone: DEV300:m55)
    2009-08-19 15:54:47 +0200 sj  r275153 : #158486# text of flipped shapes is not flipped in word
    2009-08-17 17:30:16 +0200 sj  r275063 : #158486# also correcting text bound for additional text rotation
    2009-08-05 11:09:32 +0200 sj  r274643 : #i102797# adapted customshape coloring (fixed fontwork)
    2009-08-04 14:17:36 +0200 sj  r274620 : #i99501# pdf export: fixed export of rotated graphics
    2009-07-30 16:15:44 +0200 sj  r274494 : #158653# binary ppt import: fixed table border lines
    2009-07-27 18:28:02 +0200 sj  r274376 : added shape text clipping for customshapes
    2009-07-20 18:09:14 +0200 sj  r274154 : #i101918# fixed gallery preview (now taking the correct mapmode)
    2009-07-13 18:00:58 +0200 cl  r273948 : #i103238# clear hard set attributes only if new style set is manually applied
    2009-07-13 17:58:07 +0200 cl  r273947 : #i73289# do not expand a toolpanel when it gets enabled
    2009-07-08 12:39:49 +0200 sj  r273827 : #i101566# applied patch from cmc to solve font width inconsistencies
    2009-07-08 12:11:13 +0200 sj  r273826 : #i87727# added PDFDialog service
    2009-07-06 17:22:40 +0200 sj  r273755 : #i103360# fixed a merge problem, no more looping when loading transparence gradients on background page
    2009-07-03 14:42:07 +0200 sj  r273701 : #102797# added patch from thb (Adapted customshape coloring)
    2009-07-03 14:09:44 +0200 sj  r273696 : #102797# removed warning
    2009-07-03 14:01:47 +0200 sj  r273695 : #102797# added patch from thb (Adapted customshape coloring)
    2009-07-03 13:13:39 +0200 sj  r273688 : #102797# added patch from thb (Adapted customshape coloring)
    2009-07-03 11:25:30 +0200 sj  r273684 : #i103278# fixed import of lines
    2009-07-01 16:23:47 +0200 cl  r273599 : #i96820# correctly call setChanged on model if table is modified
    2009-07-01 14:43:09 +0200 cl  r273588 : #i8770# Patch: fix missing type provider for pdf export dialog
    2009-07-01 14:40:28 +0200 cl  r273586 : #i73871# activate picture bar after converting shape to bitmap
    2009-07-01 14:39:05 +0200 cl  r273584 : #i73871# activate picture bar after converting shape to bitmap
    2009-07-01 14:04:53 +0200 cl  r273578 : #i73289# PATCH: Disable layout pane on the masterslide

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index c75e500..82db20f 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -614,13 +614,13 @@ namespace drawinglayer
                         {
                             const GraphicAttr& rAttr = rGraphicPrimitive.getGraphicAttr();
 
-                            if(!rAttr.IsSpecialDrawMode() && !rAttr.IsMirrored() && !rAttr.IsRotated() && !rAttr.IsAdjusted())
+                            if(!rAttr.IsSpecialDrawMode() && !rAttr.IsAdjusted())
                             {
                                 const basegfx::B2DHomMatrix& rTransform = rGraphicPrimitive.getTransform();
                                 double fRotate, fShearX;
                                 rTransform.decompose(aScale, aTranslate, fRotate, fShearX);
 
-                                if(aScale.getX() > 0.0 && aScale.getY() > 0.0)
+                                if( basegfx::fTools::equalZero( fRotate ) && ( aScale.getX() > 0.0 ) && ( aScale.getY() > 0.0 ) )
                                 {
                                     bUsingPDFExtOutDevData = true;
                                     mpPDFExtOutDevData->BeginGroup();
diff --git a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
index 00d98e9..09da0ee 100644
--- a/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
+++ b/svx/inc/svx/sdr/primitive2d/sdrcustomshapeprimitive2d.hxx
@@ -56,6 +56,8 @@ namespace drawinglayer
             // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means
             // that the text needs to be block formatted
             unsigned                                    mbWordWrap : 1;
+            // #SJ# Allow text clipping against TextBox in special cases (used for SC)
+            unsigned                                    mbForceTextClipToTextRange : 1;
 
         protected:
             // local decomposition.
@@ -66,13 +68,15 @@ namespace drawinglayer
                 const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
                 const Primitive2DSequence& rSubPrimitives,
                 const basegfx::B2DHomMatrix& rTextBox,
-                bool bWordWrap);
+                bool bWordWrap,
+                bool bForceTextClipToTextRange);
 
             // data access
             const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; }
             const Primitive2DSequence& getSubPrimitives() const { return maSubPrimitives; }
             const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; }
             bool getWordWrap() const { return mbWordWrap; }
+            bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; }
 
             // compare operator
             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 1f411f3..16f4858 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -55,6 +55,12 @@
 #include <svx/xlnedwit.hxx>
 #include <svx/xlnstcit.hxx>
 #include <svx/xlnedcit.hxx>
+#include <svx/xflgrit.hxx>
+#include <svx/xflhtit.hxx>
+#include <svx/xbtmpit.hxx>
+#include <svx/xgrad.hxx>
+#include <svx/xbitmap.hxx>
+#include <svx/xhatch.hxx>
 #include <com/sun/star/awt/Size.hpp>
 #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
 #ifndef __COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPESEGMENTCOMMAND_HPP__
@@ -64,6 +70,7 @@
 #include <boost/shared_ptr.hpp>
 #endif
 #include <basegfx/numeric/ftools.hxx>
+#include <basegfx/color/bcolortools.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 
 // #i76201#
@@ -724,23 +731,23 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
     /*const sal_Int32* pDefData =*/ ApplyShapeAttributes( rGeometryItem );
     switch( eSpType )
     {
-        case mso_sptCan :						nColorData = 0x20200000; break;
-        case mso_sptCube :						nColorData = 0x302d0000; break;
-        case mso_sptActionButtonBlank :			nColorData = 0x502ad400; break;
-        case mso_sptActionButtonHome :			nColorData = 0x702ad4ad; break;
-        case mso_sptActionButtonHelp :			nColorData = 0x602ad4a0; break;
-        case mso_sptActionButtonInformation :	nColorData = 0x702ad4a5; break;
-        case mso_sptActionButtonBackPrevious :	nColorData = 0x602ad4a0; break;
-        case mso_sptActionButtonForwardNext :	nColorData = 0x602ad4a0; break;
-        case mso_sptActionButtonBeginning :		nColorData = 0x602ad4a0; break;
-        case mso_sptActionButtonEnd :			nColorData = 0x602ad4a0; break;
-        case mso_sptActionButtonReturn :		nColorData = 0x602ad4a0; break;
-        case mso_sptActionButtonDocument :		nColorData = 0x702ad4da; break;
-        case mso_sptActionButtonSound :			nColorData = 0x602ad4a0; break;
-        case mso_sptActionButtonMovie :			nColorData = 0x602ad4a0; break;
-        case mso_sptBevel :						nColorData = 0x502ad400; break;
-        case mso_sptFoldedCorner :				nColorData = 0x20d00000; break;
-        case mso_sptSmileyFace :				nColorData = 0x20d00000; break;
+        case mso_sptCan :						nColorData = 0x20400000; break;
+        case mso_sptCube :						nColorData = 0x302e0000; break;
+        case mso_sptActionButtonBlank :			nColorData = 0x502ce400; break;
+        case mso_sptActionButtonHome :			nColorData = 0x702ce4ce; break;
+        case mso_sptActionButtonHelp :			nColorData = 0x602ce4c0; break;
+        case mso_sptActionButtonInformation :	nColorData = 0x702ce4c5; break;
+        case mso_sptActionButtonBackPrevious :	nColorData = 0x602ce4c0; break;
+        case mso_sptActionButtonForwardNext :	nColorData = 0x602ce4c0; break;
+        case mso_sptActionButtonBeginning :		nColorData = 0x602ce4c0; break;
+        case mso_sptActionButtonEnd :			nColorData = 0x602ce4c0; break;
+        case mso_sptActionButtonReturn :		nColorData = 0x602ce4c0; break;
+        case mso_sptActionButtonDocument :		nColorData = 0x702ce4ec; break;
+        case mso_sptActionButtonSound :			nColorData = 0x602ce4c0; break;
+        case mso_sptActionButtonMovie :			nColorData = 0x602ce4c0; break;
+        case mso_sptBevel :						nColorData = 0x502ce400; break;
+        case mso_sptFoldedCorner :				nColorData = 0x20e00000; break;
+        case mso_sptSmileyFace :				nColorData = 0x20e00000; break;
         case mso_sptNil :
         {
             if( sShapeType.getLength() > 4 &&
@@ -754,14 +761,14 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
         case mso_sptCurvedRightArrow :
         case mso_sptCurvedUpArrow :
         case mso_sptCurvedDownArrow :			nColorData = 0x2d000000; break;
-        case mso_sptRibbon2 :					nColorData = 0x30dd0000; break;
-        case mso_sptRibbon :					nColorData = 0x30dd0000; break;
+        case mso_sptRibbon2 :					nColorData = 0x30ee0000; break;
+        case mso_sptRibbon :					nColorData = 0x30ee0000; break;
 
-        case mso_sptEllipseRibbon2 :			nColorData = 0x30dd0000; break;
-        case mso_sptEllipseRibbon :				nColorData = 0x30dd0000; break;
+        case mso_sptEllipseRibbon2 :			nColorData = 0x30ee0000; break;
+        case mso_sptEllipseRibbon :				nColorData = 0x30ee0000; break;
 
-        case mso_sptVerticalScroll :			nColorData = 0x30dd0000; break;
-        case mso_sptHorizontalScroll :			nColorData = 0x30dd0000; break;
+        case mso_sptVerticalScroll :			nColorData = 0x30ee0000; break;
+        case mso_sptHorizontalScroll :			nColorData = 0x30ee0000; break;
         default:
             break;
     }
@@ -1022,41 +1029,48 @@ sal_Bool EnhancedCustomShape2d::GetParameter( double& rRetValue, const EnhancedC
 // nLumDat 27-24 = nLumDatEntry 0
 // nLumDat 23-20 = nLumDatEntry 1 ...
 // each 4bit entry is to be interpreted as a 10 percent signed luminance changing
-Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 nIndex )
+sal_Int32 EnhancedCustomShape2d::GetLuminanceChange( sal_uInt32 nIndex ) const
 {
-    Color aRetColor;
+    const sal_uInt32 nCount = nColorData >> 28;
+    if ( !nCount )
+        return 0;
 
-    sal_uInt32 i, nColor, nTmp, nCount = nColorData >> 28;
+    if ( nIndex >= nCount )
+        nIndex = nCount - 1;
 
-    if ( nCount )
+    const sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 );
+    return ( nLumDat >> 28 ) * 10;
+}
+
+Color EnhancedCustomShape2d::GetColorData( const Color& rFillColor, sal_uInt32 nIndex ) const
+{
+    const sal_Int32 nLuminance = GetLuminanceChange(nIndex);
+    if( !nLuminance )
+        return rFillColor;
+
+    basegfx::BColor aHSVColor=
+        basegfx::tools::rgb2hsv(
+            basegfx::BColor(rFillColor.GetRed()/255.0,
+                            rFillColor.GetGreen()/255.0,
+                            rFillColor.GetBlue()/255.0));
+    if( nLuminance > 0 )
+    {
+        aHSVColor.setGreen(
+            aHSVColor.getGreen() * (1.0-nLuminance/100.0));
+        aHSVColor.setBlue(
+            nLuminance/100.0 + 
+            (1.0-nLuminance/100.0)*aHSVColor.getBlue());
+    }
+    else if( nLuminance < 0 )
     {
-        if ( nIndex >= nCount )
-            nIndex = nCount - 1;
-
-        sal_uInt32 nFillColor = (sal_uInt32)rFillColor.GetRed() |
-                                    ((sal_uInt32)rFillColor.GetGreen() << 8 ) |
-                                        ((sal_uInt32)rFillColor.GetBlue() << 16 );
-
-        sal_Int32 nLumDat = nColorData << ( ( 1 + nIndex ) << 2 );
-        sal_Int32 nLuminance = ( nLumDat >> 28 ) * 12;
-
-        nTmp = nFillColor;
-        nColor = 0;
-        for ( i = 0; i < 3; i++ )
-        {
-            sal_Int32 nC = (sal_uInt8)nTmp;
-            nTmp >>= 8;
-            nC += ( ( nLuminance * nC ) >> 8 );
-            if ( nC < 0 )
-                nC = 0;
-            else if ( nC &~ 0xff )
-                nC = 0xff;
-            nColor >>= 8;
-            nColor |= nC << 16;
-        }
-        aRetColor = Color( (sal_uInt8)nColor, (sal_uInt8)( nColor >> 8 ), (sal_uInt8)( nColor >> 16 ) );
+        aHSVColor.setBlue(
+            (1.0+nLuminance/100.0)*aHSVColor.getBlue());
     }
-    return aRetColor;
+
+    aHSVColor = basegfx::tools::hsv2rgb(aHSVColor);
+    return Color( (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getRed(),0.0,1.0) * 255.0 + 0.5 ), 
+                  (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getGreen(),0.0,1.0) * 255.0 + 0.5 ),
+                  (sal_uInt8)static_cast< sal_Int32 >( basegfx::clamp(aHSVColor.getBlue(),0.0,1.0) * 255.0 + 0.5 ) );
 }
 
 Rectangle EnhancedCustomShape2d::GetTextRect() const
@@ -1687,6 +1701,19 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
 
     if(aNewB2DPolyPolygon.count())
     {
+        if( !bLineGeometryNeededOnly )
+        {
+            // hack aNewB2DPolyPolygon to fill logic rect - this is
+            // needed to produce gradient fills that look like mso
+            aNewB2DPolygon.clear();
+            aNewB2DPolygon.append(basegfx::B2DPoint(0,0));
+            aNewB2DPolyPolygon.append(aNewB2DPolygon);
+
+            aNewB2DPolygon.clear();
+            aNewB2DPolygon.append(basegfx::B2DPoint(aLogicRect.GetWidth(),
+                                                    aLogicRect.GetHeight()));
+            aNewB2DPolyPolygon.append(aNewB2DPolygon);
+        }
         // #i37011#
         bool bForceCreateTwoObjects(false);
 
@@ -1856,6 +1883,78 @@ void CorrectCalloutArrows( MSO_SPT eSpType, sal_uInt32 nLineObjectCount, std::ve
     }
 }
 
+void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet, 
+                                          sal_uInt32& nColorIndex, sal_uInt32 nColorCount)
+{
+    if ( !rObj.IsLine() )
+    {
+        const XFillStyle eFillStyle = ((const XFillStyleItem&)rObj.GetMergedItem(XATTR_FILLSTYLE)).GetValue();
+        switch( eFillStyle )
+        {
+            default:
+            case XFILL_SOLID:
+            {
+                Color aFillColor;
+                if ( nColorCount )
+                {
+                    aFillColor = GetColorData( 
+                        ((XFillColorItem&)rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue(), 
+                        std::min(nColorIndex, nColorCount-1) );
+                    rObj.SetMergedItem( XFillColorItem( String(), aFillColor ) );
+                }
+                break;
+            }
+            case XFILL_GRADIENT:
+            {
+                XGradient aXGradient(((const XFillGradientItem&)rObj.GetMergedItem(XATTR_FILLGRADIENT)).GetGradientValue());
+                if ( nColorCount )
+                {
+                    aXGradient.SetStartColor(
+                        GetColorData(
+                            aXGradient.GetStartColor(), 
+                            std::min(nColorIndex, nColorCount-1) ));
+                    aXGradient.SetEndColor(
+                        GetColorData(
+                            aXGradient.GetEndColor(), 
+                            std::min(nColorIndex, nColorCount-1) ));
+                }
+
+                rObj.SetMergedItem( XFillGradientItem( String(), aXGradient ) );
+                break;
+            }
+            case XFILL_HATCH:
+            {
+                XHatch aXHatch(((const XFillHatchItem&)rObj.GetMergedItem(XATTR_FILLHATCH)).GetHatchValue());
+                if ( nColorCount )
+                {
+                    aXHatch.SetColor(
+                        GetColorData(
+                            aXHatch.GetColor(), 
+                            std::min(nColorIndex, nColorCount-1) ));
+                }
+
+                rObj.SetMergedItem( XFillHatchItem( String(), aXHatch ) );
+                break;
+            }
+            case XFILL_BITMAP:
+            {
+                Bitmap aBitmap(((const XFillBitmapItem&)rObj.GetMergedItem(XATTR_FILLBITMAP)).GetBitmapValue().GetBitmap());
+                if ( nColorCount )
+                {
+                    aBitmap.Adjust(
+                        static_cast< short > ( GetLuminanceChange(
+                            std::min(nColorIndex, nColorCount-1))));
+                }
+
+                rObj.SetMergedItem( XFillBitmapItem( String(), aBitmap ) );
+                break;
+            }
+        }
+
+        if ( nColorIndex < nColorCount )
+            nColorIndex++;
+    }
+}
 
 SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnly )
 {
@@ -1880,18 +1979,10 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
     if ( vObjectList.size() )
     {
         const SfxItemSet& rCustomShapeSet = pCustomShapeObj->GetMergedItemSet();
-        // For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here
-        // const sal_Bool	bShadow(((SdrShadowItem&)rCustomShapeSet.Get( SDRATTR_SHADOW )).GetValue());
-        Color			aBasicColor( COL_WHITE );
         Color			aFillColor;
         sal_uInt32		nColorCount = nColorData >> 28;
         sal_uInt32		nColorIndex	= 0;
 
-        if ( nColorCount )
-        {
-            aBasicColor = ((XFillColorItem&)rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue();
-        }
-
         // #i37011# remove invisible objects
         if(vObjectList.size())
         {
@@ -1916,26 +2007,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
         if(1L == vObjectList.size())
         {
             // a single object, correct some values
-            SdrPathObj* pObj(vObjectList[0L]);
-
-// For primitive rendering, shadow handling is done completely based on the geometry, so i removed it here
-//			if(bShadow)
-//			{
-//				pObj->SetMergedItem(SdrShadowItem(sal_True));
-//			}
-
-            if(!pObj->IsLine())
-            {
-                if ( nColorIndex < nColorCount )
-                {
-                    aFillColor = GetColorData( aBasicColor, nColorIndex++ );
-                }
-
-                if ( nColorCount )
-                {
-                    pObj->SetMergedItem( XFillColorItem( String(), aFillColor ) );
-                }
-            }
+            AdaptObjColor(*vObjectList[0L],rCustomShapeSet,nColorIndex,nColorCount);
         }
         else
         {
@@ -1954,16 +2026,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl
                 else
                 {
                     nAreaObjectCount++;
-
-                    if ( nColorIndex < nColorCount )
-                    {
-                        aFillColor = GetColorData( aBasicColor, nColorIndex++ );
-                    }
-
-                    if ( nColorCount )
-                    {
-                        pObj->SetMergedItem( XFillColorItem( String(), aFillColor ) );
-                    }
+                    AdaptObjColor(*pObj,rCustomShapeSet,nColorIndex,nColorCount);
                 }
             }
 
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.hxx b/svx/source/customshapes/EnhancedCustomShape2d.hxx
index 134118e..e8f40b4 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.hxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.hxx
@@ -120,7 +120,10 @@ class EnhancedCustomShape2d : public SfxItemSet
         sal_Int32					nRotateAngle;
 
         sal_Bool					SetAdjustValueAsDouble( const double& rValue, const sal_Int32 nIndex );
-        Color						GetColorData( const Color& rFillColor, sal_uInt32 nIndex );
+        sal_Int32                   GetLuminanceChange( sal_uInt32 nIndex ) const;
+        Color						GetColorData( const Color& rFillColor, sal_uInt32 nIndex ) const;
+        void                        AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rCustomShapeSet, 
+                                                  sal_uInt32& nColorIndex, sal_uInt32 nColorCount);
         sal_Bool					GetParameter( double& rParameterReturnValue,  const com::sun::star::drawing::EnhancedCustomShapeParameter&,
                                                     const sal_Bool bReplaceGeoWidth, const sal_Bool bReplaceGeoHeight ) const;
         Point						GetPoint( const com::sun::star::drawing::EnhancedCustomShapeParameterPair&,
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index d4e8ca8..1769009 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -683,7 +683,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW
                 break;
             const Polygon& rOutlinePoly( aOutlines2d[ nOutline2dIdx++ ] );
             const sal_uInt16 nPointCount = rOutlinePoly.GetSize();
-            if ( nPointCount )
+            if ( nPointCount > 1 )
             {
                 std::vector< double > vDistances;
                 vDistances.reserve( nPointCount );
@@ -745,7 +745,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW
             const Polygon& rOutlinePoly2( aOutlines2d[ nOutline2dIdx++ ] );
             const sal_uInt16 nPointCount = rOutlinePoly.GetSize();
             const sal_uInt16 nPointCount2 = rOutlinePoly2.GetSize();
-            if ( nPointCount && nPointCount2 )
+            if ( ( nPointCount > 1 ) && ( nPointCount2 > 1 ) )
             {
                 std::vector< double > vDistances;
                 vDistances.reserve( nPointCount );
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index 31e7716..159ffee 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -1912,12 +1912,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
             XGradientStyle eGrad = XGRAD_LINEAR;
             sal_Int32 nChgColors = 0;
 
-            if ( !nAngle )
-                nChgColors ^= 1;
-
-            if ( !nFocus )
-                nChgColors ^= 1;
-            else if ( nFocus < 0 )		// Bei negativem Focus sind die Farben zu tauschen
+            if ( nFocus < 0 )		// Bei negativem Focus sind die Farben zu tauschen
             {
                 nFocus =- nFocus;
                 nChgColors ^= 1;
@@ -1925,8 +1920,8 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
             if( nFocus > 40 && nFocus < 60 )
             {
                 eGrad = XGRAD_AXIAL;	// Besser gehts leider nicht
-                nChgColors ^= 1;
             }
+
             USHORT nFocusX = (USHORT)nFocus;
             USHORT nFocusY = (USHORT)nFocus;
 
@@ -4955,6 +4950,16 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                 ApplyAttributes( rSt, aSet, aObjData );
                 pRet->SetMergedItemSet(aSet);
             }
+            else if ( aObjData.eShapeType == mso_sptLine )
+            {
+                basegfx::B2DPolygon aPoly;
+                aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
+                aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
+                pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
+                pRet->SetModel( pSdrModel );
+                ApplyAttributes( rSt, aSet, aObjData );
+                pRet->SetMergedItemSet(aSet);
+            }
             else
             {
                 if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) )
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index 0545052..ef7df1a 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -66,10 +66,11 @@ namespace sdr
             // no need to correct if no extra text range
             if(aTextRange != aObjectRange)
             {
+                const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation());
                 const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat());
 
                 // only correct when rotation and/or shear is used
-                if(rGeoStat.nShearWink || rGeoStat.nDrehWink)
+                if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation))
                 {
                     // text range needs to be corrected by 
                     // aObjectRange.getCenter() - aRotObjectRange.getCenter() since it's
@@ -93,6 +94,11 @@ namespace sdr
                         aRotMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
                     }
 
+                    if(!basegfx::fTools::equalZero(fExtraTextRotation))
+                    {
+                        aRotMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180);
+                    }
+
                     aRotMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY());
                     aRotObjectRange.transform(aRotMatrix);
 
@@ -210,7 +216,11 @@ namespace sdr
 
                     // create primitive
                     const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrCustomShapePrimitive2D(
-                        *pAttribute, xGroup, aTextBoxMatrix, bWordWrap));
+                        *pAttribute,
+                        xGroup,
+                        aTextBoxMatrix,
+                        bWordWrap,
+                        false));		// #SJ# New parameter to force to clipped BlockText for SC
                     xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
                 }
 
diff --git a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
index 9269673..2a433ec 100644
--- a/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrcustomshapeprimitive2d.cxx
@@ -56,7 +56,12 @@ namespace drawinglayer
             {
                 const basegfx::B2DPolygon aUnitOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
                 appendPrimitive2DReferenceToPrimitive2DSequence(aRetval, createTextPrimitive(
-                    basegfx::B2DPolyPolygon(aUnitOutline), getTextBox(), *getSdrSTAttribute().getText(), 0, false, getWordWrap()));
+                    basegfx::B2DPolyPolygon(aUnitOutline),
+                    getTextBox(),
+                    *getSdrSTAttribute().getText(),
+                    0,
+                    isForceTextClipToTextRange(), // #SJ# use CellText mode; text upper-left
+                    getWordWrap()));
             }
 
             // add shadow
@@ -72,12 +77,14 @@ namespace drawinglayer
             const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
             const Primitive2DSequence& rSubPrimitives,
             const basegfx::B2DHomMatrix& rTextBox,
-            bool bWordWrap)
+            bool bWordWrap,
+            bool bForceTextClipToTextRange)
         :	BasePrimitive2D(),
             maSdrSTAttribute(rSdrSTAttribute),
             maSubPrimitives(rSubPrimitives),
             maTextBox(rTextBox),
-            mbWordWrap(bWordWrap)
+            mbWordWrap(bWordWrap),
+            mbForceTextClipToTextRange(bForceTextClipToTextRange)
         {
         }
 
@@ -90,7 +97,8 @@ namespace drawinglayer
                 return (getSdrSTAttribute() == rCompare.getSdrSTAttribute()
                     && getSubPrimitives() == rCompare.getSubPrimitives()
                     && getTextBox() == rCompare.getTextBox()
-                    && getWordWrap() == rCompare.getWordWrap());
+                    && getWordWrap() == rCompare.getWordWrap()
+                    && isForceTextClipToTextRange() == rCompare.isForceTextClipToTextRange());
             }
 
             return false;
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 7b7881e..ec5d5ba 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -937,7 +937,12 @@ void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrO
     const bool bUndo = IsUndoEnabled();
     if( bUndo  )
         AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoReplaceObject(*pOldObj,*pNewObj));
+
+    if( IsObjMarked( pOldObj ) )
+        MarkObj( pOldObj, &rPV, TRUE /*unmark!*/ );
+
     pOL->ReplaceObject(pNewObj,pOldObj->GetOrdNum());
+            
     if( !bUndo )
         SdrObject::Free( pOldObj );
     
diff --git a/svx/source/svdraw/svdfppt.cxx b/svx/source/svdraw/svdfppt.cxx
index 38ca489..aedaad1 100644
--- a/svx/source/svdraw/svdfppt.cxx
+++ b/svx/source/svdraw/svdfppt.cxx
@@ -7601,6 +7601,11 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
                 CreateTableRows( xColumnRowRange->getRows(), aRows, pGroup->GetSnapRect().Bottom() );
                 CreateTableColumns( xColumnRowRange->getColumns(), aColumns, pGroup->GetSnapRect().Right() );
                 
+                sal_Int32 nCellCount = aRows.size() * aColumns.size();
+                sal_Int32 *pMergedCellIndexTable = new sal_Int32[ nCellCount ];
+                for ( sal_Int32 i = 0; i < nCellCount; i++ )
+                    pMergedCellIndexTable[ i ] = i;
+
                 aGroupIter.Reset();
                 while( aGroupIter.IsMore() )
                 {
@@ -7621,7 +7626,16 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
                             ApplyCellAttributes( pObj, xCell );
 
                             if ( ( nRowCount > 1 ) || ( nColumnCount > 1 ) )	// cell merging
+                            {
                                 MergeCells( xTable, nColumn, nRow, nColumnCount, nRowCount );
+                                for ( sal_Int32 nRowIter = 0; nRowIter < nRowCount; nRowIter++ )
+                                {
+                                    for ( sal_Int32 nColumnIter = 0; nColumnIter < nColumnCount; nColumnIter++ )
+                                    {	// now set the correct index for the merged cell
+                                        pMergedCellIndexTable[ ( ( nRow + nRowIter ) * aColumns.size() ) + nColumn + nColumnIter ] = nTableIndex;
+                                    }
+                                }
+                            }
         
                             // applying text
                             OutlinerParaObject* pParaObject = pObj->GetOutlinerParaObject();
@@ -7633,13 +7647,30 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
                             }
                         }
                     }
-                    else
+                }
+                aGroupIter.Reset();
+                while( aGroupIter.IsMore() )
+                {
+                    SdrObject* pObj( aGroupIter.Next() );
+                    if ( IsLine( pObj ) )
                     {
                         std::vector< sal_Int32 > vPositions;	// containing cell indexes + cell position
                         GetLinePositions( pObj, aRows, aColumns, vPositions, pGroup->GetSnapRect() );
+                        
+                        // correcting merged cell position
+                        std::vector< sal_Int32 >::iterator aIter( vPositions.begin() );
+                        while( aIter != vPositions.end() )
+                        {
+                            sal_Int32 nOldPosition = *aIter & 0xffff;
+                            sal_Int32 nOldFlags = *aIter & 0xffff0000;					
+                            sal_Int32 nNewPosition = pMergedCellIndexTable[ nOldPosition ] | nOldFlags;
+                            *aIter++ = nNewPosition; 
+                        }
                         ApplyCellLineAttributes( pObj, xTable, vPositions, aColumns.size() );
                     }
                 }
+                delete[] pMergedCellIndexTable;
+                
                 // we are replacing the whole group object by a single table object, so
                 // possibly connections to the group object have to be removed.
                 if ( pSolverContainer )
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index d5afb80..d8a14f1 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -208,6 +208,12 @@ void __EXPORT SdrMarkView::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
             bMarkedObjRectDirty=TRUE;
             bMarkedPointsRectsDirty=TRUE;
         }
+/* removed for now since this breaks existing code who iterates over the mark list and sequentially replaces objects		
+        if( eKind==HINT_OBJREMOVED && IsObjMarked( const_cast<SdrObject*>(pSdrHint->GetObject()) ) )
+        {
+            MarkObj( const_cast<SdrObject*>(pSdrHint->GetObject()), GetSdrPageView(), TRUE );
+        }		
+*/
     }
     SdrSnapView::Notify(rBC,rHint);
 }
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index cd760c7..18b53f4 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -119,6 +119,12 @@ namespace
         // the visible area for contour text decomposition
         basegfx::B2DVector                                          maScale;
 
+        // #SJ# ClipRange for BlockText decomposition; only text portions completely
+        // inside are to be accepted, so this is different from geometric clipping
+        // (which would allow e.g. upper parts of portions to remain). Only used for 
+        // BlockText (see there)
+        basegfx::B2DRange                                           maClipRange;
+
         DECL_LINK(decomposeContourTextPrimitive, DrawPortionInfo* );
         DECL_LINK(decomposeBlockTextPrimitive, DrawPortionInfo* );
         DECL_LINK(decomposeStretchTextPrimitive, DrawPortionInfo* );
@@ -137,7 +143,14 @@ namespace
 
     public:
         impTextBreakupHandler(SdrOutliner& rOutliner)
-        :	mrOutliner(rOutliner)
+        :	maTextPortionPrimitives(),
+            maLinePrimitives(),
+            maParagraphPrimitives(),
+            mrOutliner(rOutliner),
+            maNewTransformA(),
+            maNewTransformB(),
+            maScale(),
+            maClipRange()
         {
         }
 
@@ -153,10 +166,14 @@ namespace
             mrOutliner.SetDrawBulletHdl(Link());
         }
 
-        void decomposeBlockTextPrimitive(const basegfx::B2DHomMatrix& rNewTransformA, const basegfx::B2DHomMatrix& rNewTransformB)
+        void decomposeBlockTextPrimitive(
+            const basegfx::B2DHomMatrix& rNewTransformA,
+            const basegfx::B2DHomMatrix& rNewTransformB,
+            const basegfx::B2DRange& rClipRange)
         {
             maNewTransformA = rNewTransformA;
             maNewTransformB = rNewTransformB;
+            maClipRange = rClipRange;
             mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decomposeBlockTextPrimitive));
             mrOutliner.SetDrawBulletHdl(LINK(this, impTextBreakupHandler, decomposeBlockBulletPrimitive));
             mrOutliner.StripPortions();
@@ -588,6 +605,43 @@ namespace
     {
         if(pInfo)
         {
+            // #SJ# Is clipping wanted? This is text clipping; only accept a portion
+            // if it's completely in the range
+            if(!maClipRange.isEmpty())
+            {
+                // Test start position first; this allows to not get the text range at
+                // all if text is far outside
+                const basegfx::B2DPoint aStartPosition(pInfo->mrStartPos.X(), pInfo->mrStartPos.Y());
+
+                if(!maClipRange.isInside(aStartPosition))
+                {
+                    return 0;
+                }
+
+                // Start position is inside. Get TextBoundRect and TopLeft next
+                drawinglayer::primitive2d::TextLayouterDevice aTextLayouterDevice;
+                aTextLayouterDevice.setFont(pInfo->mrFont);
+
+                const basegfx::B2DRange aTextBoundRect(
+                    aTextLayouterDevice.getTextBoundRect(
+                        pInfo->mrText, pInfo->mnTextStart, pInfo->mnTextLen));
+                const basegfx::B2DPoint aTopLeft(aTextBoundRect.getMinimum() + aStartPosition);
+
+                if(!maClipRange.isInside(aTopLeft))
+                {
+                    return 0;
+                }
+
+                // TopLeft is inside. Get BottomRight and check
+                const basegfx::B2DPoint aBottomRight(aTextBoundRect.getMaximum() + aStartPosition);
+
+                if(!maClipRange.isInside(aBottomRight))
+                {
+                    return 0;
+                }
+
+                // all inside, clip was successful
+            }
             impHandleDrawPortionInfo(*pInfo);
         }
 
@@ -903,9 +957,18 @@ bool SdrTextObj::impDecomposeBlockTextPrimitive(
     aNewTransformB.rotate(fRotate);
     aNewTransformB.translate(aTranslate.getX(), aTranslate.getY());
 
+    // #SJ# create ClipRange (if needed)
+    basegfx::B2DRange aClipRange;
+
+    if(bIsCell)
+    {
+        aClipRange.expand(basegfx::B2DTuple(0.0, 0.0));
+        aClipRange.expand(basegfx::B2DTuple(aAnchorTextSize.Width(), aAnchorTextSize.Height()));
+    }
+
     // now break up text primitives.
     impTextBreakupHandler aConverter(rOutliner);
-    aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB);
+    aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB, aClipRange);
 
     // cleanup outliner
     rOutliner.Clear();
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index b63ce98..0f399fa 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -278,19 +278,6 @@ namespace sdr
         void CellProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, sal_Bool bDontRemoveHardAttr)
         {
             TextProperties::SetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr );
-
-            if( bDontRemoveHardAttr && pNewStyleSheet )
-            {
-                GetObjectItemSet();
-
-                const SfxItemSet& rStyleAttribs = pNewStyleSheet->GetItemSet();
-
-                for ( USHORT nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ )
-                {
-                    if ( rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON )
-                        mpItemSet->ClearItem( nWhich );					
-                }
-            }
         }
     } // end of namespace properties
 } // end of namespace sdr
diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx
index d996af5..7ed2328 100644
--- a/svx/source/table/cellcursor.cxx
+++ b/svx/source/table/cellcursor.cxx
@@ -269,7 +269,9 @@ void SAL_CALL CellCursor::merge(  ) throw (NoSupportException, RuntimeException)
         throw DisposedException();
 
     SdrModel* pModel = mxTable->getSdrTableObj()->GetModel();
-    if( pModel )
+    const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled();
+    
+    if( bUndo )
         pModel->BegUndo( ImpGetResStr(STR_TABLE_MERGE) );
 
     try
@@ -283,8 +285,11 @@ void SAL_CALL CellCursor::merge(  ) throw (NoSupportException, RuntimeException)
         DBG_ERROR("sdr::table::CellCursor::merge(), exception caught!");
     }
 
-    if( pModel )
+    if( bUndo )
         pModel->EndUndo();
+    
+    if( pModel )
+        pModel->SetChanged();
 }
 
 // -----------------------------------------------------------------------------
@@ -530,7 +535,8 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No
         throw DisposedException();
 
     SdrModel* pModel = mxTable->getSdrTableObj()->GetModel();
-    if( pModel )
+    const bool bUndo = pModel && mxTable->getSdrTableObj()->IsInserted() && pModel->IsUndoEnabled();
+    if( bUndo )
         pModel->BegUndo( ImpGetResStr(STR_TABLE_SPLIT) );
 
     try
@@ -550,8 +556,11 @@ void SAL_CALL CellCursor::split( sal_Int32 nColumns, sal_Int32 nRows ) throw (No
         throw NoSupportException();
     }
 
-    if( pModel )
+    if( bUndo )
         pModel->EndUndo();
+        
+    if( pModel )
+        pModel->SetChanged();
 }
 
 // -----------------------------------------------------------------------------
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 180485f..4d6eb39 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -568,9 +568,6 @@ void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs )
             if( bUndo )
                 mpModel->EndUndo();
 
-            if( mpModel )
-                mpModel->SetChanged();
-
             aStart.mnCol = nNewStartColumn;
             aStart.mnRow = 0;
             aEnd.mnCol = aStart.mnCol + nNewColumns - 1;
@@ -602,13 +599,7 @@ void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs )
             }
 
             if( bUndo )
-            {
                 mpModel->EndUndo();
-                mpModel->SetChanged();
-            }
-
-            if( mpModel )
-                mpModel->SetChanged();
 
             aStart.mnCol = 0;
             aStart.mnRow = nNewRowStart;
@@ -879,7 +870,8 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
                 pModel->AddUndo( new TableStyleUndo( *pTableObj ) );
             }
 
-/*
+            pTableObj->setTableStyle( xNewTableStyle );
+
             const sal_Int32 nRowCount = mxTable->getRowCount();
             const sal_Int32 nColCount = mxTable->getColumnCount();
             for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ )
@@ -889,9 +881,26 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
                     CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( nCol, nRow ).get() ) );
                     if( xCell.is() )
                     {
-                        if( bUndo )
-                            xCell->AddUndo();
-                        xCell->setAllPropertiesToDefault();
+                        SfxItemSet aSet( xCell->GetItemSet() );
+                        bool bChanges = false;                        
+                        const SfxItemSet& rStyleAttribs = xCell->GetStyleSheet()->GetItemSet();
+
+                        for ( USHORT nWhich = SDRATTR_START; nWhich <= SDRATTR_TABLE_LAST; nWhich++ )
+                        {
+                            if( (rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON) && (aSet.GetItemState( nWhich ) == SFX_ITEM_ON) )
+                            {
+                                aSet.ClearItem( nWhich );					
+                                bChanges = true;
+                            }
+                        }
+                        
+                        if( bChanges )
+                        {
+                            if( bUndo )
+                                xCell->AddUndo();
+                                
+                            xCell->SetMergedItemSetAndBroadcast( aSet, sal_True );	                    
+                        }
                     }
                 }
                 catch( Exception& e )
@@ -900,9 +909,6 @@ void SvxTableController::SetTableStyle( const SfxItemSet* pArgs )
                     DBG_ERROR( "svx::SvxTableController::SetTableStyle(), exception caught!" );
                 }
             }
-*/
-
-            pTableObj->setTableStyle( xNewTableStyle );
 
             if( bUndo )
                 pModel->EndUndo();
@@ -1067,9 +1073,6 @@ void SvxTableController::SplitMarkedCells()
 
                 if( bUndo )
                     mpModel->EndUndo();
-
-                if( mpModel )
-                    mpModel->SetChanged();
             }
             aEnd.mnRow += mxTable->getRowCount() - nRowCount;
             aEnd.mnCol += mxTable->getColumnCount() - nColCount;
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 9818f0a..b27529a 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -118,7 +118,6 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos  ) const
 
                 width += maColumns[aPos.mnCol++].mnSize;
                 nColSpan--;
-                nColSpan--;
             }
         }
     }
diff --git a/svx/source/table/tablemodel.cxx b/svx/source/table/tablemodel.cxx
index bd1fe4d..901f777 100644
--- a/svx/source/table/tablemodel.cxx
+++ b/svx/source/table/tablemodel.cxx
@@ -794,6 +794,9 @@ void TableModel::insertColumns( sal_Int32 nIndex, sal_Int32 nCount )
 
             if( bUndo )
                 pModel->EndUndo();
+                
+            if( pModel )
+                pModel->SetChanged();
 
         }
         catch( Exception& )
@@ -900,10 +903,10 @@ void TableModel::removeColumns( sal_Int32 nIndex, sal_Int32 nCount )
                 maRows[nRows]->removeColumns( nIndex, nCount );
 
             if( bUndo )
-            {
                 pModel->EndUndo();
+                
+            if( pModel )
                 pModel->SetChanged();
-            }
         }
         catch( Exception& )
         {
@@ -969,6 +972,9 @@ void TableModel::insertRows( sal_Int32 nIndex, sal_Int32 nCount )
         }
         if( bUndo )
             pModel->EndUndo();
+            
+        if( pModel )
+            pModel->SetChanged();
 
         updateRows();
         setModified(sal_True);
@@ -1056,10 +1062,10 @@ void TableModel::removeRows( sal_Int32 nIndex, sal_Int32 nCount )
             remove_range<RowVector,RowVector::iterator>( maRows, nIndex, nCount );
 
             if( bUndo )
-            {
                 pModel->EndUndo();
+                
+            if( pModel )
                 pModel->SetChanged();
-            }
         }
         catch( Exception& )
         {
commit 7510cc3ff1359d2f3c9d5654260721056740e566
Author: Oliver Bolte <obo at openoffice.org>
Date:   Wed Sep 9 03:41:07 2009 +0000

    CWS-TOOLING: integrate CWS acceleratorsfix01
    2009-08-31 06:45:23 +0200 wuy  r275582 : i104644 - make the XCUBasedAcceleratorConfiguration::KeyMapping singleton; i104645 - interface storeToStorage of XCUBasedAcceleratorConfiguration is unimplemented
    2009-08-31 06:41:51 +0200 wuy  r275581 : i104644 - make the XCUBasedAcceleratorConfiguration::KeyMapping singleton
    2009-08-14 03:44:15 +0200 wuy  r274967 : CWS-TOOLING: rebase CWS acceleratorsfix01 to trunk at 274622 (milestone: DEV300:m54)
    2009-05-18 11:39:26 +0200 wuy  r272007 : CWS-TOOLING: rebase CWS acceleratorsfix01 to trunk at 271830 (milestone: DEV300:m48)

diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index 7fc92fe..4a9fadb 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -61,10 +61,6 @@
 // other includes
 #include <vcl/svapp.hxx>
 
-#ifndef __FRAMEWORK_ACCELERATORS_KEYMAPPING_HXX_
-#include <accelerators/keymapping.hxx>
-#endif
-
 #ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
 #include <com/sun/star/container/XNamed.hpp>
 #endif
@@ -778,7 +774,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE
                                                     css::uno::RuntimeException         )
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::setKeyEvent" );
-    RTL_LOGFILE_PRODUCT_CONTEXT( aLog1, " start XCUBasedAcceleratorConfiguration::setKeyEvent" );
+    RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::setKeyEvent" );
 
     if (
         (aKeyEvent.KeyCode   == 0) &&
@@ -857,8 +853,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE
 
     aWriteLock.unlock();
     // <- SAFE ----------------------------------
-
-    RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, " end XCUBasedAcceleratorConfiguration::setKeyEvent" );
 }
 
 //-----------------------------------------------    
@@ -1043,7 +1037,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reload()
         css::uno::RuntimeException)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::reload" );
-    RTL_LOGFILE_PRODUCT_CONTEXT( aLog1, " start XCUBasedAcceleratorConfiguration::reload()" );
+    RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::reload()" );
 
     // SAFE -> ----------------------------------
     WriteGuard aWriteLock(m_aLock);
@@ -1077,8 +1071,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reload()
 
     aWriteLock.unlock();  
     // <- SAFE ----------------------------------
-
-    RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, " end XCUBasedAcceleratorConfiguration::reload()" );
 }
 
 //-----------------------------------------------    
@@ -1087,7 +1079,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::store()
           css::uno::RuntimeException)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::reload" );
-    RTL_LOGFILE_PRODUCT_CONTEXT( aLog1, " start XCUBasedAcceleratorConfiguration::store()" );
+    RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::store()" );
 
     // SAFE -> ----------------------------------
     ReadGuard aReadLock(m_aLock);
@@ -1109,18 +1101,74 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::store()
 
     aReadLock.unlock();
     // <- SAFE ----------------------------------
-
-    RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, " end XCUBasedAcceleratorConfiguration::store()" );
 }
 
 //-----------------------------------------------    
-void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::Reference< css::embed::XStorage >& /*xStorage*/)
+void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::Reference< css::embed::XStorage >& xStorage)
     throw(css::uno::Exception       ,
       css::uno::RuntimeException)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::storeToStorage" );
-    // todo implement me
     // use m_aCache + old AcceleratorXMLWriter to store data directly on storage given as parameter ...  
+    if (!xStorage.is())
+        return;
+
+    long nOpenModes = css::embed::ElementModes::READWRITE;
+    css::uno::Reference< css::embed::XStorage > xAcceleratorTypeStorage = xStorage->openStorageElement(::rtl::OUString::createFromAscii("accelerator"), nOpenModes);
+    if (!xAcceleratorTypeStorage.is())
+        return;
+
+    css::uno::Reference< css::io::XStream > xStream = xAcceleratorTypeStorage->openStreamElement(::rtl::OUString::createFromAscii("current"), nOpenModes);
+    css::uno::Reference< css::io::XOutputStream > xOut;
+    if (xStream.is())
+        xOut = xStream->getOutputStream();
+    if (!xOut.is())
+        throw css::io::IOException(
+        ::rtl::OUString::createFromAscii("Could not open accelerator configuration for saving."),
+        static_cast< ::cppu::OWeakObject* >(this));
+
+    // the original m_aCache has been split into primay cache and secondary cache...
+    // we should merge them before storing to storage
+    // SAFE -> ----------------------------------
+    WriteGuard aWriteLock(m_aLock);
+
+    AcceleratorCache aCache;
+    if (m_pPrimaryWriteCache != 0)
+        aCache.takeOver(*m_pPrimaryWriteCache);
+    else
+        aCache.takeOver(m_aPrimaryReadCache);
+
+    AcceleratorCache::TKeyList lKeys;
+    AcceleratorCache::TKeyList::const_iterator pIt;
+    if (m_pSecondaryWriteCache!=0)
+    {
+        lKeys = m_pSecondaryWriteCache->getAllKeys();
+        for ( pIt=lKeys.begin(); pIt!=lKeys.end(); ++pIt )
+            aCache.setKeyCommandPair(*pIt, m_pSecondaryWriteCache->getCommandByKey(*pIt));
+    }
+    else
+    {
+        lKeys = m_aSecondaryReadCache.getAllKeys();
+        for ( pIt=lKeys.begin(); pIt!=lKeys.end(); ++pIt )
+            aCache.setKeyCommandPair(*pIt, m_aSecondaryReadCache.getCommandByKey(*pIt));
+    }
+
+    aWriteLock.unlock();
+    // <- SAFE ----------------------------------
+
+    css::uno::Reference< css::io::XTruncate > xClearable(xOut, css::uno::UNO_QUERY_THROW);
+    xClearable->truncate();
+    css::uno::Reference< css::io::XSeekable > xSeek(xOut, css::uno::UNO_QUERY);
+    if (xSeek.is())
+        xSeek->seek(0);
+
+    css::uno::Reference< css::xml::sax::XDocumentHandler > xWriter    (m_xSMGR->createInstance(SERVICENAME_SAXWRITER), css::uno::UNO_QUERY_THROW);
+    css::uno::Reference< css::io::XActiveDataSource>       xDataSource(xWriter                                     , css::uno::UNO_QUERY_THROW);
+    xDataSource->setOutputStream(xOut);
+
+    // write into the stream
+    AcceleratorConfigurationWriter aWriter(aCache, xWriter);
+    aWriter.flush();
 }
 
 //-----------------------------------------------    
@@ -1216,7 +1264,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util:
     throw(css::uno::RuntimeException)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen at sun.com", "XCUBasedAcceleratorConfiguration::changesOccurred" );
-    RTL_LOGFILE_PRODUCT_CONTEXT( aLog1, " start XCUBasedAcceleratorConfiguration::changesOccurred()" );
+    RTL_LOGFILE_PRODUCT_CONTEXT( aLog, "XCUBasedAcceleratorConfiguration::changesOccurred()" );
 
     css::uno::Reference< css::container::XHierarchicalNameAccess > xHAccess;
     aEvent.Base >>= xHAccess;
@@ -1264,8 +1312,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util:
                 reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey);
         }
     }
-
-    RTL_LOGFILE_PRODUCT_CONTEXT( aLog2, " end XCUBasedAcceleratorConfiguration::changesOccurred()" );
 }
 
 //----------------------------------------------- 
@@ -1290,7 +1336,6 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
         xModules->getByName(m_sModuleCFG) >>= xAccess;
     }
 
-    static KeyMapping aKeyMapping;
     const ::rtl::OUString sIsoLang       = impl_ts_getLocale().toISO();
     const ::rtl::OUString sDefaultLocale = ::rtl::OUString::createFromAscii("en-US");
 
@@ -1342,7 +1387,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const
             sal_Int32 nIndex = 0;
             ::rtl::OUString sKeyCommand = sKey.getToken(0, '_', nIndex);
             ::rtl::OUString sPrefix = ::rtl::OUString::createFromAscii("KEY_");
-            aKeyEvent.KeyCode = aKeyMapping.mapIdentifierToCode(sPrefix + sKeyCommand);
+            aKeyEvent.KeyCode = m_rKeyMapping->mapIdentifierToCode(sPrefix + sKeyCommand);
 
             css::uno::Sequence< ::rtl::OUString > sToken(4);
             const sal_Int32 nToken = 4;
@@ -1575,13 +1620,12 @@ void XCUBasedAcceleratorConfiguration::reloadChanged( const ::rtl::OUString& sPr
         xModules->getByName(sModule) >>= xContainer;
     }
 
-    KeyMapping aKeyMapping;
     css::awt::KeyEvent aKeyEvent;
     ::rtl::OUString sKeyIdentifier;
 
     sal_Int32 nIndex = 0;
     sKeyIdentifier = sKey.getToken(0, '_', nIndex);
-    aKeyEvent.KeyCode = aKeyMapping.mapIdentifierToCode(::rtl::OUString::createFromAscii("KEY_")+sKeyIdentifier);
+    aKeyEvent.KeyCode = m_rKeyMapping->mapIdentifierToCode(::rtl::OUString::createFromAscii("KEY_")+sKeyIdentifier);
 
     css::uno::Sequence< ::rtl::OUString > sToken(3);
     const sal_Int32 nToken = 3;
@@ -1704,4 +1748,3 @@ AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPrefer
 }
 
 } // namespace framework
-
diff --git a/framework/source/inc/accelerators/acceleratorconfiguration.hxx b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
index 5b0da6d..57d0001 100644
--- a/framework/source/inc/accelerators/acceleratorconfiguration.hxx
+++ b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
@@ -37,6 +37,7 @@
 #include <accelerators/istoragelistener.hxx>
 #include <accelerators/presethandler.hxx>
 #include <accelerators/acceleratorcache.hxx>
+#include <accelerators/keymapping.hxx>
 #include <macros/xinterface.hxx>
 #include <macros/xtypeprovider.hxx>
 #include <threadhelp/threadhelpbase.hxx>
@@ -67,6 +68,7 @@
 #include <cppuhelper/propshlp.hxx>
 #include <cppuhelper/weak.hxx>
 #include <comphelper/locale.hxx>
+#include <salhelper/singletonref.hxx>
 
 //__________________________________________
 // definition
@@ -338,6 +340,8 @@ class XCUBasedAcceleratorConfiguration : protected ThreadHelpBase
         ::rtl::OUString m_sGlobalOrModules;
         ::rtl::OUString m_sModuleCFG;
 
+        ::salhelper::SingletonRef< KeyMapping > m_rKeyMapping;
+
         //______________________________________
         // native interface!
 


More information about the ooo-build-commit mailing list