[ooo-build-commit] patches/dev300

Thorsten Behrens thorsten at kemper.freedesktop.org
Tue Dec 15 02:31:47 PST 2009


 patches/dev300/apply                               |    6 
 patches/dev300/dlopen-global-symbols.diff          |  115 +++++++++++++
 patches/dev300/layout-crash-fix.diff               |   24 ++
 patches/dev300/layout-fix-experimental-layout.diff |  180 +++++++++++++++++++++
 4 files changed, 325 insertions(+)

New commits:
commit ab021f888941725d2f06cdb43b920679361bc0de
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Tue Dec 15 11:24:34 2009 +0100

    Superficially fix the crash with layout dialogs
    
    * patches/dev300/apply: added next three patches
    * patches/dev300/dlopen-global-symbols.diff: affecting more places
      than just this crash, but: a bunch of dialog and filter libs have
      been dlopen-ed with flags that may lead to problems during symbol
      resolution. Changed to match the gold standard of uno component
      loading. Fixes at least the typeinfo output for layout classes.
    * patches/dev300/layout-crash-fix.diff: lame fix for one crash in
      layout dialogs, by substituting the failing dynamic_cast with a
      static_cast (having the wrong subclass there would be a logic
      error anyway)
    * patches/dev300/layout-fix-experimental-layout.diff: fixes the way
      experimental layout dialogs were turned off, that led to violations
      of the ODR (one definition rule). Makes sure compiler sees same
      class decls in all translation units.

diff --git a/patches/dev300/apply b/patches/dev300/apply
index cde223c..0dccfde 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2367,6 +2367,8 @@ buildfix-sw-uiconfig-layout.diff
 build-fix-layout-numfmt.diff
 # Fix heavy parallel build of the zips containing the xmls
 layout-parallel-build.diff
+layout-fix-experimental-layout.diff, n#557230, thorsten
+layout-crash-fix.diff, n#557230, thorsten
 
 [ FrameworkFeature ]
 SectionOwner => kohei
@@ -3235,6 +3237,10 @@ unotools-tempfile-nonlocking.diff, n#560877, i#107511, jholesov
 # fix framework to no longer pull presenter screen for all apps
 framework-extra-job-config.diff, i#107568, thorsten
 
+# make dlopen-ed libs to use the global namespace for symbol
+# resolution
+dlopen-global-symbols.diff, thorsten
+
 [ NLPSolverBits ]
 # build NLPSolver extension when enabled (fate#304653)
 postprocess-nlpsolver.diff, pmladek
diff --git a/patches/dev300/dlopen-global-symbols.diff b/patches/dev300/dlopen-global-symbols.diff
new file mode 100644
index 0000000..44b4fd7
--- /dev/null
+++ b/patches/dev300/dlopen-global-symbols.diff
@@ -0,0 +1,115 @@
+dlopen libs with global symbol namespace
+
+From: Thorsten Behrens <thb at openoffice.org>
+
+
+---
+
+ sc/source/ui/attrdlg/scabstdlg.cxx |    3 ++-
+ sc/source/ui/docshell/impex.cxx    |    3 ++-
+ sd/source/filter/sdfilter.cxx      |    3 ++-
+ sd/source/ui/dlg/sdabstdlg.cxx     |    3 ++-
+ sw/source/filter/basflt/fltini.cxx |    3 ++-
+ sw/source/ui/dialog/swabstdlg.cxx  |    3 ++-
+ vcl/source/window/abstdlg.cxx      |    3 ++-
+ 7 files changed, 14 insertions(+), 7 deletions(-)
+
+
+diff --git sc/source/ui/attrdlg/scabstdlg.cxx sc/source/ui/attrdlg/scabstdlg.cxx
+index abb1d31..eb30872 100644
+--- sc/source/ui/attrdlg/scabstdlg.cxx
++++ sc/source/ui/attrdlg/scabstdlg.cxx
+@@ -50,7 +50,8 @@ ScAbstractDialogFactory* ScAbstractDialogFactory::Create()
+     OUStringBuffer aStrBuf;
+     aStrBuf.appendAscii( SVLIBRARY("scui") );
+ 
+-    if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, aStrBuf.makeStringAndClear() ) )
++    if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, aStrBuf.makeStringAndClear(),
++                                                             SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
+         fp = ( ScAbstractDialogFactory* (__LOADONCALLAPI*)() )
+             aDialogLibrary.getFunctionSymbol( ::rtl::OUString::createFromAscii("CreateDialogFactory") );
+     if ( fp )
+diff --git sc/source/ui/docshell/impex.cxx sc/source/ui/docshell/impex.cxx
+index 8dc8646..26aa5d1 100644
+--- sc/source/ui/docshell/impex.cxx
++++ sc/source/ui/docshell/impex.cxx
+@@ -2105,7 +2105,8 @@ ScFormatFilterPlugin &ScFormatFilter::Get()
+ 
+     static ::osl::Module aModule;
+     if ( aModule.loadRelative( &thisModule,
+-                   ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "scfilt" ) ) ) ) )
++                   ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "scfilt" ) ) ),
++                               SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
+     {
+     oslGenericFunction fn = aModule.getFunctionSymbol( ::rtl::OUString::createFromAscii( "ScFilterCreate" ) );
+     if (fn != NULL)
+diff --git sd/source/filter/sdfilter.cxx sd/source/filter/sdfilter.cxx
+index 9e6860f..6aec89c 100644
+--- sd/source/filter/sdfilter.cxx
++++ sd/source/filter/sdfilter.cxx
+@@ -95,7 +95,8 @@ extern "C" { static void SAL_CALL thisModule() {} }
+ ::osl::Module* SdFilter::OpenLibrary( const ::rtl::OUString& rLibraryName ) const
+ {
+     std::auto_ptr< osl::Module > mod(new osl::Module);
+-    return mod->loadRelative(&thisModule, ImplGetFullLibraryName(rLibraryName))
++    return mod->loadRelative(&thisModule, ImplGetFullLibraryName(rLibraryName),
++                             SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY)
+         ? mod.release() : 0;
+ }
+ 
+diff --git sd/source/ui/dlg/sdabstdlg.cxx sd/source/ui/dlg/sdabstdlg.cxx
+index 1b1418c..2369fca 100644
+--- sd/source/ui/dlg/sdabstdlg.cxx
++++ sd/source/ui/dlg/sdabstdlg.cxx
+@@ -45,7 +45,8 @@ SdAbstractDialogFactory* SdAbstractDialogFactory::Create()
+ {
+     SdFuncPtrCreateDialogFactory fp = 0;
+     static ::osl::Module aDialogLibrary;
+-    if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( RTL_CONSTASCII_USTRINGPARAM( DLL_NAME ) ) ) )
++    if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( RTL_CONSTASCII_USTRINGPARAM( DLL_NAME ) ),
++                                                             SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
+         fp = ( SdAbstractDialogFactory* (__LOADONCALLAPI*)() )
+             aDialogLibrary.getFunctionSymbol( ::rtl::OUString::createFromAscii("CreateDialogFactory") );
+     if ( fp )
+diff --git sw/source/filter/basflt/fltini.cxx sw/source/filter/basflt/fltini.cxx
+index 4e55ee6..4a2869f 100644
+--- sw/source/filter/basflt/fltini.cxx
++++ sw/source/filter/basflt/fltini.cxx
+@@ -961,7 +961,8 @@ static oslGenericFunction GetMswordLibSymbol( const char *pSymbol )
+     static ::osl::Module aModule;
+     if ( aModule.is() ||
+          aModule.loadRelative( &thisModule,
+-             ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "msword" ) ) ) ) )
++             ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVLIBRARY( "msword" ) ) ),
++                               SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
+     {
+         return aModule.getFunctionSymbol( ::rtl::OUString::createFromAscii( pSymbol ) );
+     }
+diff --git sw/source/ui/dialog/swabstdlg.cxx sw/source/ui/dialog/swabstdlg.cxx
+index 596ee4e..68a4c10 100644
+--- sw/source/ui/dialog/swabstdlg.cxx
++++ sw/source/ui/dialog/swabstdlg.cxx
+@@ -45,7 +45,8 @@ SwAbstractDialogFactory* SwAbstractDialogFactory::Create()
+ {
+     SwFuncPtrCreateDialogFactory fp = 0;
+     static ::osl::Module aDialogLibrary;
+-    if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( RTL_CONSTASCII_USTRINGPARAM( DLL_NAME ) ) ) )
++    if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( RTL_CONSTASCII_USTRINGPARAM( DLL_NAME ) ),
++                                                             SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
+         fp = ( SwAbstractDialogFactory* (__LOADONCALLAPI*)() )
+             aDialogLibrary.getFunctionSymbol( ::rtl::OUString::createFromAscii("CreateDialogFactory") );
+     if ( fp )
+diff --git vcl/source/window/abstdlg.cxx vcl/source/window/abstdlg.cxx
+index 5c3a500..057cadc 100644
+--- vcl/source/window/abstdlg.cxx
++++ vcl/source/window/abstdlg.cxx
+@@ -45,7 +45,8 @@ VclAbstractDialogFactory* VclAbstractDialogFactory::Create()
+ {
+     FuncPtrCreateDialogFactory fp = 0;
+     static ::osl::Module aDialogLibrary;
+-    if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( RTL_CONSTASCII_USTRINGPARAM( DLL_NAME ) ) ) )
++    if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( RTL_CONSTASCII_USTRINGPARAM( DLL_NAME ) ),
++                                                             SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
+         fp = ( VclAbstractDialogFactory* (__LOADONCALLAPI*)() )
+             aDialogLibrary.getFunctionSymbol( ::rtl::OUString::createFromAscii("CreateDialogFactory") );
+     if ( fp )
diff --git a/patches/dev300/layout-crash-fix.diff b/patches/dev300/layout-crash-fix.diff
new file mode 100644
index 0000000..30b53a6
--- /dev/null
+++ b/patches/dev300/layout-crash-fix.diff
@@ -0,0 +1,24 @@
+Lame fix for layout crash
+
+From: Thorsten Behrens <thb at openoffice.org>
+
+
+---
+
+ toolkit/inc/layout/layout.hxx |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+
+diff --git toolkit/inc/layout/layout.hxx toolkit/inc/layout/layout.hxx
+index 1917950..893f4f1 100644
+--- toolkit/inc/layout/layout.hxx
++++ toolkit/inc/layout/layout.hxx
+@@ -114,7 +114,7 @@ public:
+         inline t##Impl &getImpl() const
+ 
+ #define DECL_GET_WINDOW( cls ) ::cls* Get##cls() const
+-#define IMPL_GET_WINDOW( cls ) ::cls* cls::Get##cls() const { return dynamic_cast< ::cls*>( GetWindow() ); }
++#define IMPL_GET_WINDOW( cls ) ::cls* cls::Get##cls() const { return static_cast< ::cls*>( GetWindow() ); }
+ 
+ #define DECL_GET_VCLXWINDOW( cls ) ::VCLX##cls* GetVCLX##cls() const
+ #define IMPL_GET_VCLXWINDOW( cls ) ::VCLX##cls* cls::Get##VCLX##cls() const { return dynamic_cast< ::VCLX##cls*>( GetVCLXWindow() ); }
diff --git a/patches/dev300/layout-fix-experimental-layout.diff b/patches/dev300/layout-fix-experimental-layout.diff
new file mode 100644
index 0000000..ca5c1fd
--- /dev/null
+++ b/patches/dev300/layout-fix-experimental-layout.diff
@@ -0,0 +1,180 @@
+Fix conditional compilation of experimental layout
+
+From: Thorsten Behrens <thb at openoffice.org>
+
+
+---
+
+ sc/source/ui/attrdlg/scdlgfact.cxx |    8 ++------
+ sc/source/ui/attrdlg/scdlgfact.hxx |    5 +++--
+ svx/source/cui/numfmt.cxx          |   20 ++++++++------------
+ svx/source/cui/numfmt.hxx          |    6 ++++++
+ 4 files changed, 19 insertions(+), 20 deletions(-)
+
+
+diff --git sc/source/ui/attrdlg/scdlgfact.cxx sc/source/ui/attrdlg/scdlgfact.cxx
+index 26fe4be..4d19c53 100644
+--- sc/source/ui/attrdlg/scdlgfact.cxx
++++ sc/source/ui/attrdlg/scdlgfact.cxx
+@@ -31,10 +31,6 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_sc.hxx"
+ 
+-#if ! ENABLE_LAYOUT_EXPERIMENTAL
+-#undef ENABLE_LAYOUT
+-#endif
+-
+ #undef SC_DLLIMPLEMENTATION
+ 
+ #include "scdlgfact.hxx"
+@@ -156,7 +152,7 @@ String AbstractTabDialog_Impl::GetText() const
+     return pDlg->GetText();
+ }
+ 
+-#if ENABLE_LAYOUT
++#if ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT
+ namespace layout
+ {
+ IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for ScAttrDlg, ScHFEditDlg, ScStyleDlg, ScSubTotalDlg,ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg
+@@ -191,7 +187,7 @@ String AbstractTabDialog_Impl::GetText() const
+     return pDlg->GetText();
+ }
+ }
+-#endif /* ENABLE_LAYOUT */
++#endif /* ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT */
+ 
+ //add for AbstractTabDialog_Impl end
+ // AbstractScImportAsciiDlg_Impl begin
+diff --git sc/source/ui/attrdlg/scdlgfact.hxx sc/source/ui/attrdlg/scdlgfact.hxx
+index 611a107..68245f2 100644
+--- sc/source/ui/attrdlg/scdlgfact.hxx
++++ sc/source/ui/attrdlg/scdlgfact.hxx
+@@ -377,7 +377,8 @@ class AbstractTabDialog_Impl : public SfxAbstractTabDialog
+     virtual void		SetText( const XubString& rStr ); //add by CHINA001
+     virtual String   	GetText() const; //add by CHINA001
+ };
+-#if ENABLE_LAYOUT
++
++#if ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT
+ namespace layout
+ {
+ //add for ScAttrDlg , ScHFEditDlg, ScStyleDlg, ScSubTotalDlg, ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg
+@@ -393,7 +394,7 @@ class AbstractTabDialog_Impl : public SfxAbstractTabDialog
+     virtual String   	GetText() const; //add by CHINA001
+ };
+ } // end namespace layout
+-#endif /* ENABLE_LAYOUT */
++#endif /* ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT */
+ //------------------------------------------------------------------------
+ //AbstractDialogFactory_Impl implementations
+ class ScAbstractDialogFactory_Impl : public ScAbstractDialogFactory
+diff --git svx/source/cui/numfmt.cxx svx/source/cui/numfmt.cxx
+index 66b4957..135b7b5 100644
+--- svx/source/cui/numfmt.cxx
++++ svx/source/cui/numfmt.cxx
+@@ -28,10 +28,6 @@
+  *
+  ************************************************************************/
+ 
+-#if !ENABLE_LAYOUT_EXPERIMENTAL && defined (ENABLE_LAYOUT)
+-#undef ENABLE_LAYOUT
+-#endif
+-
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_svx.hxx"
+ 
+@@ -240,19 +236,19 @@ void SvxNumberPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt )
+ 
+ #define HDL(hdl) LINK( this, SvxNumberFormatTabPage, hdl )
+ 
++#if ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT
+ #include <layout/layout-pre.hxx>
+ 
+-#if ENABLE_LAYOUT
+ #undef SVX_RES
+ #define SVX_RES(x) #x
+ #define SVX_RES_PLAIN(x) ResId (x, DIALOG_MGR ())
+ #define THIS_SVX_RES(x) this, #x
+ #undef SfxTabPage
+ #define SfxTabPage( parent, id, args ) SfxTabPage( parent, "number-format.xml", id, &args )
+-#else /* !ENABLE_LAYOUT */
++#else /* ! ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT */
+ #define SVX_RES_PLAIN SVX_RES
+ #define THIS_SVX_RES SVX_RES
+-#endif /* !ENABLE_LAYOUT */
++#endif /* ! ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT */
+ 
+ SvxNumberFormatTabPage::SvxNumberFormatTabPage( Window*				pParent,
+                                                 const SfxItemSet&	rCoreAttrs )
+@@ -283,7 +279,7 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage( Window*				pParent,
+         aFtComment      ( this, SVX_RES( FT_COMMENT ) ),
+         aEdComment      ( this, SVX_RES( ED_COMMENT ) ),
+         
+-#if ENABLE_LAYOUT
++#if ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT
+         aWndPreview     ( LAYOUT_THIS_WINDOW(this), SVX_RES_PLAIN( WND_NUMBER_PREVIEW ) ),
+ #else
+         aWndPreview     ( this, SVX_RES_PLAIN( WND_NUMBER_PREVIEW ) ),
+@@ -295,7 +291,7 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage( Window*				pParent,
+         sAutomaticEntry ( THIS_SVX_RES( STR_AUTO_ENTRY)),
+         pLastActivWindow( NULL )
+ {
+-#if ENABLE_LAYOUT
++#if ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT
+     aLbFormat.Clear ();
+ #endif /* ENABLE_LAYOUT */
+ 
+@@ -1173,7 +1169,7 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl
+             aPos.Y()=nStdFormatY;
+             aSize.Height()=nStdFormatHeight;
+             aLbFormat.SetPosSizePixel(aPos,aSize);
+-#if ENABLE_LAYOUT
++#if ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT
+             aLbCurrency.Disable();
+ #else /* !ENABLE_LAYOUT */
+             aLbCurrency.Hide();
+@@ -1184,7 +1180,7 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl
+             aPos.Y()=nCurFormatY;
+             aSize.Height()=nCurFormatHeight;
+             aLbFormat.SetPosSizePixel(aPos,aSize);
+-#if ENABLE_LAYOUT
++#if ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT
+             aLbCurrency.Enable();
+ #else /* !ENABLE_LAYOUT */
+             aLbCurrency.Show();
+@@ -1322,7 +1318,7 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb )
+ 
+         // Reinit options enable/disable for current selection.
+ 
+-#if ENABLE_LAYOUT
++#if ENABLE_LAYOUT_EXPERIMENTAL && ENABLE_LAYOUT
+         if (aLbFormat.GetSelectEntryPos () == LISTBOX_ENTRY_NOTFOUND)
+ #else /* !ENABLE_LAYOUT */
+         // Current category may be UserDefined with no format entries defined.
+diff --git svx/source/cui/numfmt.hxx svx/source/cui/numfmt.hxx
+index b5e2df0..6f99be8 100644
+--- svx/source/cui/numfmt.hxx
++++ svx/source/cui/numfmt.hxx
+@@ -95,8 +95,12 @@ public:
+ 
+ // -----------------------------------------------------------------------
+ 
++#if ENABLE_LAYOUT_EXPERIMENTAL
+ #include <sfx2/layout.hxx>
+ #include <layout/layout-pre.hxx>
++#else
++#define LocalizedString String
++#endif /* !ENABLE_LAYOUT_EXPERIMENTAL */
+ 
+ class SvxNumberFormatTabPage : public SfxTabPage
+ {
+@@ -200,7 +204,9 @@ private:
+ #endif
+ };
+ 
++#if ENABLE_LAYOUT_EXPERIMENTAL
+ #include <layout/layout-post.hxx>
++#endif /* ENABLE_LAYOUT_EXPERIMENTAL */
+ 
+ #endif
+ 


More information about the ooo-build-commit mailing list