[Libreoffice-commits] .: 4 commits - framework/inc framework/source svx/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Oct 22 12:19:12 PDT 2010


 framework/inc/general.h                        |    8 -----
 framework/inc/helper/titlehelper.hxx           |    1 
 framework/inc/properties.h                     |   17 -----------
 framework/source/helper/titlebarupdate.cxx     |    2 -
 framework/source/helper/titlehelper.cxx        |   33 ----------------------
 framework/source/services/tabwindowservice.cxx |    2 -
 svx/source/unogallery/unogaltheme.cxx          |   37 ++++++++++++++++++++++++-
 7 files changed, 38 insertions(+), 62 deletions(-)

New commits:
commit b84f1b9df4ae200584a7080f54c01e1d16e1baf9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 22 16:52:41 2010 +0100

    startup optimization, remove unused global strings

diff --git a/framework/inc/general.h b/framework/inc/general.h
index 029fa60..3a88e4b 100644
--- a/framework/inc/general.h
+++ b/framework/inc/general.h
@@ -55,14 +55,6 @@ namespace css = ::com::sun::star;
 namespace framework {
 
 //-----------------------------------------------------------------------------
-/** status event mapped from load event of frame loader
-
-    @todo think about me
-          should be moved to another more specific place.
- */
-static const ::rtl::OUString FEATUREDESCRIPTOR_LOADSTATE = DECLARE_ASCII("loadFinishedOrCancelled");
-
-//-----------------------------------------------------------------------------
 /** Those macro is used to make it more clear where a synchronized block will start.
     Because normal documentation code wont be recognized by some developers to be real
     I need something where they are thinking about.
commit 03523ec6c647add6e3ee339e5752e58c0d2ac34f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 22 16:51:18 2010 +0100

    startup optimization, remove unused global strings

diff --git a/framework/inc/helper/titlehelper.hxx b/framework/inc/helper/titlehelper.hxx
index be935a7..edc0370 100644
--- a/framework/inc/helper/titlehelper.hxx
+++ b/framework/inc/helper/titlehelper.hxx
@@ -181,7 +181,6 @@ class TitleHelper : private ::cppu::BaseMutex
         void impl_appendProductExtension (::rtl::OUStringBuffer& sTitle);
         void impl_appendModuleName (::rtl::OUStringBuffer& sTitle);
         void impl_appendDebugVersion (::rtl::OUStringBuffer& sTitle);
-        void impl_appendEvalVersion (::rtl::OUStringBuffer& sTitle);
     
         void impl_setSubTitle (const css::uno::Reference< css::frame::XTitle >& xSubTitle);
         ::rtl::OUString impl_getSubTitle ();
diff --git a/framework/inc/properties.h b/framework/inc/properties.h
index 84d7370..2b371f0 100644
--- a/framework/inc/properties.h
+++ b/framework/inc/properties.h
@@ -271,27 +271,10 @@ namespace framework{
 #define TABWINDOW_PROPHANDLE_TOPWINDOW                  1
 #define TABWINDOW_PROPCOUNT                             2
 
-//_______________________________________________
-/** properties for tab window service (new) */
-#define TABWINDOWSERVICE_PROPNAME_ASCII_WINDOW          "Window"
-#define TABWINDOWSERVICE_PROPNAME_WINDOW                ::rtl::OUString::createFromAscii( TABWINDOWSERVICE_PROPNAME_ASCII_WINDOW )
-
 #define TABWINDOWSERVICE_PROPHANDLE_WINDOW              0
 #define TABWINDOWSERVICE_PROPCOUNT                      1
 
 //_______________________________________________
-/** properties of tabreg service */
-static const char* TABREG_PROPNAME_ASCII_TITLE          = "title";
-
-static const ::rtl::OUString TABREG_PROPNAME_TITLE      = ::rtl::OUString::createFromAscii(TABREG_PROPNAME_ASCII_TITLE);
-
-//_______________________________________________
-/** properties of controller service */
-static const char* CONTROLLER_PROPNAME_ASCII_ICONID         = "IconId";
-
-static const ::rtl::OUString CONTROLLER_PROPNAME_ICONID     = ::rtl::OUString::createFromAscii(CONTROLLER_PROPNAME_ASCII_ICONID);
-
-//_______________________________________________
 /** provides some helper methods to implement property sets. */
 
 class PropHelper
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index c91eddb..4f72a3c 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -285,7 +285,7 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra
     {
         try
         {
-            xSet->getPropertyValue( CONTROLLER_PROPNAME_ICONID ) >>= nIcon;
+            xSet->getPropertyValue( DECLARE_ASCII("IconId") ) >>= nIcon;
         }
         catch(const css::uno::Exception&)
         {}
diff --git a/framework/source/helper/titlehelper.cxx b/framework/source/helper/titlehelper.cxx
index eefbd0b..b67607e 100644
--- a/framework/source/helper/titlehelper.cxx
+++ b/framework/source/helper/titlehelper.cxx
@@ -512,7 +512,6 @@ void TitleHelper::impl_updateTitleForFrame (const css::uno::Reference< css::fram
     impl_appendProductName      (sTitle);
     impl_appendModuleName       (sTitle);
     impl_appendProductExtension (sTitle);
-    //impl_appendEvalVersion      (sTitle);
     impl_appendDebugVersion     (sTitle);
     
     // SYNCHRONIZED ->
@@ -623,32 +622,6 @@ void TitleHelper::impl_appendDebugVersion (::rtl::OUStringBuffer&)
 }
 #endif
 
-//*****************************************************************************************************************
-void TitleHelper::impl_appendEvalVersion (::rtl::OUStringBuffer& /*sTitle*/)
-{
-    // SYNCHRONIZED ->
- //   ::osl::ResettableMutexGuard aLock(m_aMutex);
- //   css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR ;
-    //aLock.clear ();
-    //// <- SYNCHRONIZED
-
-    //css::uno::Reference< css::beans::XMaterialHolder > xHolder(
- //       xSMGR->createInstance(SERVICENAME_TABREG),
-    //	css::uno::UNO_QUERY);
-
- //   if ( ! xHolder.is())
-    //	return;
-
-    //	  ::comphelper::SequenceAsHashMap aMaterial(xHolder->getMaterial());
-    //const ::rtl::OUString				  sEvalTitle = aMaterial.getUnpackedValueOrDefault(TABREG_PROPNAME_TITLE, ::rtl::OUString());
-
-    //if (sEvalTitle.getLength())
-    //{
-    //	sTitle.appendAscii (" "		  );
-    //	sTitle.append	   (sEvalTitle);
-    //}
-}
-
 //-----------------------------------------------
 void TitleHelper::impl_startListeningForModel (const css::uno::Reference< css::frame::XModel >& xModel)
 {
diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx
index 512a90f..268c40f 100644
--- a/framework/source/services/tabwindowservice.cxx
+++ b/framework/source/services/tabwindowservice.cxx
@@ -323,7 +323,7 @@ void TabWindowService::impl_initializePropInfo()
 
     impl_addPropertyInfo(
         css::beans::Property(
-            TABWINDOWSERVICE_PROPNAME_WINDOW,
+            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Window")),
             TABWINDOWSERVICE_PROPHANDLE_WINDOW,
             ::getCppuType((const css::uno::Reference< css::awt::XWindow >*)NULL),
             css::beans::PropertyAttribute::TRANSIENT));
commit 52e49c216405d277366916ee0f2c61e96c7aa48d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 22 16:42:25 2010 +0100

    startup optimization, remove unused global strings

diff --git a/framework/source/helper/titlehelper.cxx b/framework/source/helper/titlehelper.cxx
index 0574e87..eefbd0b 100644
--- a/framework/source/helper/titlehelper.cxx
+++ b/framework/source/helper/titlehelper.cxx
@@ -57,12 +57,6 @@ namespace framework{
 
 namespace css = ::com::sun::star;
 
-//_______________________________________________
-// definitions
-
-static const ::rtl::OUString ERRMSG_INVALID_COMPONENT_PARAM = ::rtl::OUString::createFromAscii("NULL as component reference not allowed.");
-static const ::rtl::OUString ERRMSG_INVALID_NUMBER_PARAM    = ::rtl::OUString::createFromAscii("Special valkud INVALID_NUMBER not allowed as input parameter.");
-
 //-----------------------------------------------
 TitleHelper::TitleHelper(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
     : ::cppu::BaseMutex ()
commit 58587a2508576f70e64e6a7a8990bb9915f4a69d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 22 16:07:22 2010 +0100

    #i80184# Allow adding drawing documents to gallery via API

diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx
index ba5fc79..d34f57b 100644
--- a/svx/source/unogallery/unogaltheme.cxx
+++ b/svx/source/unogallery/unogaltheme.cxx
@@ -37,6 +37,9 @@
 #include "svx/gallery1.hxx"
 #include "svx/galmisc.hxx"
 #include <svx/fmmodel.hxx>
+#include <svx/svdpage.hxx>
+#include <svx/unopage.hxx>
+#include <svl/itempool.hxx>
 #include <rtl/uuid.h>
 #include <vos/mutex.hxx>
 #include <vcl/svapp.hxx>
@@ -313,7 +316,7 @@ void SAL_CALL GalleryTheme::update(  )
     throw (lang::WrappedTargetException, uno::RuntimeException)
 {
     const ::vos::OGuard aGuard( Application::GetSolarMutex() );
-    sal_Int32 			nRet = -1;
+    sal_Int32           nRet = -1;
 
     if( mpTheme )
     {
@@ -321,11 +324,43 @@ void SAL_CALL GalleryTheme::update(  )
 
         if( pModel && pModel->GetDoc() && pModel->GetDoc()->ISA( FmFormModel ) )
         {
+            //Here we're inserting something that's already a gallery theme drawing
+
             nIndex = ::std::max( ::std::min( nIndex, getCount() ), sal_Int32( 0 ) );
 
             if( mpTheme->InsertModel( *static_cast< FmFormModel* >( pModel->GetDoc() ), nIndex ) )
                 nRet = nIndex;
         }
+        else if (!pModel)
+        {
+            //#i80184# Try to do the right thing and make a Gallery drawing out of an ordinary
+            //Drawing if possible.
+            try
+            {
+                uno::Reference< drawing::XDrawPagesSupplier > xDrawPagesSupplier( Drawing, uno::UNO_QUERY_THROW );
+                uno::Reference< drawing::XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), uno::UNO_QUERY_THROW );
+                uno::Reference< drawing::XDrawPage > xPage( xDrawPages->getByIndex( 0 ), uno::UNO_QUERY_THROW );
+                SvxDrawPage* pUnoPage = xPage.is() ? SvxDrawPage::getImplementation( xPage ) : NULL;
+                SdrModel* pOrigModel = pUnoPage ? pUnoPage->GetSdrPage()->GetModel() : NULL;
+                SdrPage* pOrigPage = pUnoPage ? pUnoPage->GetSdrPage() : NULL;
+
+                if (pOrigPage && pOrigModel)
+                {
+                    FmFormModel* pTmpModel = new FmFormModel(&pOrigModel->GetItemPool());
+                    SdrPage* pNewPage = pOrigPage->Clone();
+                    pTmpModel->InsertPage(pNewPage, 0);
+
+                    uno::Reference< lang::XComponent > xDrawing( new GalleryDrawingModel( pTmpModel ) );
+                    pTmpModel->setUnoModel( uno::Reference< uno::XInterface >::query( xDrawing ) );
+
+                    nRet = insertDrawingByIndex( xDrawing, nIndex );
+                    return nRet;
+                }
+            }
+            catch (...)
+            {
+            }
+        }
     }
 
     return nRet;


More information about the Libreoffice-commits mailing list