ooo-build r12645 - in trunk: . patches/dev300



Author: jannieuw
Date: Fri May 23 13:44:12 2008
New Revision: 12645
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12645&view=rev

Log:
2008-05-23  Jan Nieuwenhuizen  <janneke gnu org>

	* patches/dev300/layout-tab-toolkit.diff: 
	* patches/dev300/layout-plugin-toolkit.diff: Update from GIT:
	fix UCB init for dev300 >= m4.  Test app works again!


Modified:
   trunk/ChangeLog
   trunk/patches/dev300/layout-plugin-toolkit.diff
   trunk/patches/dev300/layout-tab-toolkit.diff

Modified: trunk/patches/dev300/layout-plugin-toolkit.diff
==============================================================================
--- trunk/patches/dev300/layout-plugin-toolkit.diff	(original)
+++ trunk/patches/dev300/layout-plugin-toolkit.diff	Fri May 23 13:44:12 2008
@@ -433,7 +433,7 @@
  #define DBG_ERROR printf
  #undef DBG_ERROR1
 diff --git a/source/layout/helper.cxx b/source/layout/helper.cxx
-index 5cfddf6..76f4d2b 100644
+index 5cfddf6..78cdbd4 100644
 --- toolkit/source/layout/helper.cxx
 +++ toolkit/source/layout/helper.cxx
 @@ -46,7 +46,7 @@
@@ -445,6 +445,15 @@
  #undef DBG_ERROR
  #define DBG_ERROR printf
  #undef DBG_ERROR1
+@@ -178,7 +178,7 @@ createToolkitWidget( uno::Reference< awt::XToolkit > xToolkit,
+     uno::Reference< awt::XWindowPeer > xWinPeer;
+     try
+     {
+-        DBG_ERROR1("Asking toolkit: %s\n", OUSTRING_CSTR( desc.WindowServiceName ) );
++        OSL_TRACE("Asking toolkit: %s", OUSTRING_CSTR( desc.WindowServiceName ) );
+         xWinPeer = xToolkit->createWindow( desc );
+         if ( !xWinPeer.is() )
+             throw uno::RuntimeException(
 @@ -352,6 +352,7 @@ PropHelper::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::
  #include <awt/vclxscroller.hxx>
  #include <awt/vclxsplitter.hxx>
@@ -510,7 +519,7 @@
  
  #include <com/sun/star/xml/input/XRoot.hpp>
 diff --git a/source/layout/proplist.cxx b/source/layout/proplist.cxx
-index 889dbac..3e85aee 100644
+index 889dbac..eef28ea 100644
 --- toolkit/source/layout/proplist.cxx
 +++ toolkit/source/layout/proplist.cxx
 @@ -46,7 +46,7 @@
@@ -522,6 +531,25 @@
  #undef DBG_ERROR
  #define DBG_ERROR printf
  #undef DBG_ERROR1
+@@ -258,8 +258,7 @@ setProperties( uno::Reference< uno::XInterface > const& xPeer,
+         PropList::const_iterator cur;
+         for( cur = rProps.begin(); cur != rProps.end(); cur++ )
+         {
+-            OString attr = OUStringToOString( cur->first, RTL_TEXTENCODING_UTF8 );
+-            OString value = OUStringToOString( cur->second, RTL_TEXTENCODING_UTF8 );
++            DBG_ERROR1( "%s=%s\n", OUSTRING_CSTR( cur->first ), OUSTRING_CSTR( cur->second ) );
+         }
+         return;
+     }
+@@ -275,7 +274,7 @@ setProperty( uno::Reference< uno::XInterface > const& xPeer,
+ {
+     OUString unoAttr = toUnoNaming( attr );
+ 
+-    OSL_TRACE( "setting %s=%s\n", OUSTRING_CSTR( attr ), OUSTRING_CSTR( value ) );
++    OSL_TRACE( "setting %s=%s", OUSTRING_CSTR( attr ), OUSTRING_CSTR( value ) );
+     // get a Property object
+     beans::Property prop;
+     try
 diff --git a/source/layout/root.cxx b/source/layout/root.cxx
 index 25c4463..3cec64e 100644
 --- toolkit/source/layout/root.cxx
@@ -587,7 +615,7 @@
      friend class LayoutRoot;
  
 diff --git a/source/layout/translate.cxx b/source/layout/translate.cxx
-index 7eac2ba..0f87022 100644
+index 7eac2ba..97ed3c7 100644
 --- toolkit/source/layout/translate.cxx
 +++ toolkit/source/layout/translate.cxx
 @@ -37,7 +37,7 @@
@@ -599,6 +627,28 @@
  #endif
  
  #include <osl/process.h>
+@@ -97,9 +97,7 @@ getFirstExisting( OUString const& aDir, std::list<OUString> const& aSubDirs,
+           i != aSubDirs.end(); i++ )
+     {
+         String aFile = aDir + aSlash + *i + aSlash + aXMLName;
+-#if TEST_LAYOUT
+-        printf( "testing: %s\n", OUSTRING_CSTR( aFile ) );
+-#endif
++        OSL_TRACE( "testing: %s", OUSTRING_CSTR( aFile ) );
+         if ( fileExists( aFile ) )
+             return aFile;
+     }
+@@ -133,9 +131,7 @@ readRightTranslation( OUString const& aXMLName )
+         aXMLFile = getFirstExisting( aXMLDir, aSubdirs, aXMLName );
+     }
+ 
+-#if TEST_LAYOUT
+-    printf( "FOUND:%s\n", OUSTRING_CSTR ( OUString (aXMLFile) ) );
+-#endif /* TEST_LAYOUT */
++    OSL_TRACE( "FOUND:%s", OUSTRING_CSTR ( OUString (aXMLFile) ) );
+     return aXMLFile;
+ }
+ 
 diff --git a/source/vclcompat/wbutton.cxx b/source/vclcompat/wbutton.cxx
 index 5757ebc..17c2142 100644
 --- toolkit/source/vclcompat/wbutton.cxx
@@ -780,9 +830,18 @@
  //#define FILEDLG
  
 diff --git a/workben/layout/makefile.mk b/workben/layout/makefile.mk
-index fc8fb2c..d7303af 100644
+index fc8fb2c..7126deb 100644
 --- toolkit/workben/layout/makefile.mk
 +++ toolkit/workben/layout/makefile.mk
+@@ -47,7 +47,7 @@ ENABLE_EXCEPTIONS=TRUE
+ CFLAGS += -I$(PRJ)/source/layout
+ 
+ # Allow zoom and wordcount to be built without depending on svx,sv,sfx2
+-CFLAGS += -I../$(PRJ)/svx/inc -I../$(PRJ)/svtools/inc -I../$(PRJ)/sfx2/inc
++CFLAGS += -I../$(PRJ)/svx/inc -I../$(PRJ)/svtools/inc
+ 
+ .INCLUDE : $(PRJ)$/util$/makefile.pmk
+ 
 @@ -59,6 +59,7 @@ CFLAGS+=-Wall -Wno-non-virtual-dtor
  
  CXXFILES=\
@@ -799,16 +858,43 @@
  	$(OBJ)$/recover.obj \
  	$(OBJ)$/test.obj \
  	$(OBJ)$/wordcountdialog.obj \
-@@ -81,7 +83,8 @@ APP1STDLIBS= \
+@@ -81,12 +83,15 @@ APP1STDLIBS= \
  		$(CPPUHELPERLIB)		\
  		$(SALLIB)			\
  		$(XMLSCRIPTLIB)			\
 -		$(TKLIB)
 +		$(TKLIB) \
-+		$(SVXLIB)
++		$(SVXLIB) \
++		$(ISCLIB) \
++#
  
  svtools = $(INCCOM)/svtools
- all: $(svtools) ALLTAR
+-all: $(svtools) ALLTAR
++default: ALLTAR
+ 
+-.INCLUDE :  target.mk
++.INCLUDE : target.mk
+ 
+ XML_FILES=\
+ 	recover.xml\
+@@ -96,13 +101,15 @@ XML_FILES=\
+ TRALAY=tralay
+ XML_LANGS=$(alllangiso)
+ 
+-#ALL_XMLS=$(foreach,i,$(XML_LANGS) $(foreach,j,$(XML_FILES) $i/$j))
+-ALLTAR: $(foreach,i,$(XML_FILES) en-US/$i)
++ALLTAR: $(BIN)/testrc $(svtools) $(foreach,i,$(XML_FILES) en-US/$i)
+ 
+ $(XML_LANGS:f:t"/%.xml ")/%.xml: %.xml
+ 	$(TRALAY) -m localize.sdf -o . -l $(XML_LANGS:f:t" -l ") $<
+ 	rm -rf en-US
+ 
++$(BIN)/%: %.in
++	cp $< $@
++
+ $(svtools):
+ 	# FIXME: there's a bug in svtools layout or usage
+ 	# Include files are in svtools/inc, but are referenced as <svtools/..>
 diff --git a/workben/layout/plugin.cxx b/workben/layout/plugin.cxx
 new file mode 100644
 index 0000000..9ceb9d0
@@ -1014,40 +1100,300 @@
  namespace SVX {
  #include <svx/paraprev.hxx>        // Preview
 diff --git a/workben/layout/test.cxx b/workben/layout/test.cxx
-index 5a059ee..4049e60 100644
+index 5a059ee..0408590 100644
 --- toolkit/workben/layout/test.cxx
 +++ toolkit/workben/layout/test.cxx
-@@ -60,6 +60,9 @@
- #include "zoom.hxx"
- #undef _LAYOUT_POST_HXX
+@@ -34,7 +34,6 @@
+  ************************************************************************/
+ 
+ #include <vcl/svapp.hxx>
+-//#include <transex3/vosapp.hxx>
+ 
+ // This works and was used before for standalone test, not sure why
+ // we'd want it.
+@@ -42,28 +41,29 @@
+ #include "uno.hxx"
+ 
+ #include <cstdio>
+-#include <osl/file.h>
++#include <cstdlib>
+ 
+-#include <rtl/ustring.hxx>
++#include <com/sun/star/xml/sax/SAXException.hpp>
++#include <comphelper/processfactory.hxx>
+ #include <cppuhelper/bootstrap.hxx>
+-
+-#include <ucbhelper/contentbroker.hxx>
++#include <rtl/ustring.hxx>
+ #include <ucbhelper/configurationkeys.hxx>
+-
+-#include <comphelper/processfactory.hxx>
+-#include <com/sun/star/xml/sax/SAXException.hpp>
++#include <ucbhelper/contentbroker.hxx>
  
+ #include "editor.hxx"
+ 
+-#include "wordcountdialog.hxx"
+-#undef _LAYOUT_POST_HXX
+-#include "zoom.hxx"
 +#include "plugin.hxx"
-+#undef _LAYOUT_POST_HXX
-+
+ #undef _LAYOUT_POST_HXX
+ 
  #include "recover.hxx"
  #undef _LAYOUT_POST_HXX
  
-@@ -237,7 +240,7 @@ void LayoutTest::RunEditor()
+-//#undef SW_WORDCOUNTDIALOG_HXX
++#include "wordcountdialog.hxx"
++#undef _LAYOUT_POST_HXX
++
++#include "zoom.hxx"
++#undef _LAYOUT_POST_HXX
++
+ #include <layout/layout-pre.hxx>
+ 
+ using namespace ::rtl;
+@@ -71,38 +71,6 @@ using namespace ::cppu;
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+ 
+-Reference< XComponentContext > createInitialComponentContext(
+-    OUString const & inst_dir )
+-{
+-    Reference< XComponentContext > xContext;
+-    
+-    try
+-    {
+-        OUString file_url;
+-        oslFileError rc = osl_getFileURLFromSystemPath(
+-            inst_dir.pData, &file_url.pData );
+-        OSL_ASSERT( osl_File_E_None == rc );
+-        (void) rc;  // quiet warning
+-        
+-        OUString unorc = file_url + OUString(
+-            OUString::createFromAscii( "/program/" SAL_CONFIGFILE( "uno" )) );
+-        
+-        return defaultBootstrap_InitialComponentContext( unorc );
+-    }
+-    
+-    catch( Exception& rExc )
+-    {
+-        OString aStr( OUStringToOString( rExc.Message,
+-                                         RTL_TEXTENCODING_ASCII_US ) );
+-        OSL_ENSURE( 0, aStr.getStr() );
+-    }
+-    
+-    return xContext;
+-}
+-
+-
+-// -----------------------------------------------------------------------
+-
+ class LayoutTest : public Application
+ {
+     Reference< XComponentContext > mxContext;
+@@ -118,7 +86,7 @@ public:
+     void RunEditor();
+     void RunFiles();
+     void ExceptionalMain();
+-    void IInit();
++    void Init();
+     void InitUCB();
+     void LoadFile( OUString const &aName );
+     void Main();
+@@ -127,18 +95,29 @@ public:
+ 
+ static void usage()
+ {
+-    fprintf (stderr, "usage: test [--inst inst_dir] [DIALOG.XML]... | --test [DIALOG.XML]\n" );
++    fprintf (stderr, "usage: test [--inst OOO_INSTALL_PREFIX] [DIALOG.XML]... | --test [DIALOG.XML]\n" );
+     exit( 2 );
+ }
+ 
++static uno::Reference< lang::XSingleServiceFactory > get_factory( char const *service )
++{
++    uno::Reference< lang::XSingleServiceFactory > xFactory(
++        comphelper::createProcessComponent(
++            rtl::OUString::createFromAscii( service ) ), uno::UNO_QUERY );
++
++    if ( !xFactory.is() )
++        fprintf( stderr, "error loading: %s\n", service );
++    return xFactory;
++}
++
++#define GET_FACTORY(x) get_factory( #x )
++    
+ void LayoutTest::LoadFile( const OUString &aTestFile )
+ {
+     fprintf( stderr, "TEST: layout instance\n" );
+ 
+-    uno::Reference< lang::XSingleServiceFactory > xFactory(
+-        comphelper::createProcessComponent(
+-            rtl::OUString::createFromAscii( "com.sun.star.awt.Layout" ) ),
+-        uno::UNO_QUERY );
++    uno::Reference< lang::XSingleServiceFactory > xFactory
++        = GET_FACTORY( com.sun.star.awt.Layout );
+     if ( !xFactory.is() )
+     {
+         fprintf( stderr, "Layout engine not installed\n" );
+@@ -158,40 +137,34 @@ void LayoutTest::LoadFile( const OUString &aTestFile )
+     fprintf( stderr, "TEST: file loaded\n" );
+ }
+ 
+-// Nurgh ...
+ void LayoutTest::InitUCB()
+ {
+     OUString aEmpty;
+-    Sequence< Any > aArgs(6);
++    Sequence< Any > aArgs( 6 );
+     aArgs[0]
+-        <<= OUString::createFromAscii(UCB_CONFIGURATION_KEY1_LOCAL);
++        <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL );
+     aArgs[1]
+-        <<= OUString::createFromAscii(UCB_CONFIGURATION_KEY2_OFFICE);
++        <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE );
+     aArgs[2] <<= OUString::createFromAscii( "PIPE" );
+     aArgs[3] <<= aEmpty;
+     aArgs[4] <<= OUString::createFromAscii( "PORTAL" );
+     aArgs[5] <<= aEmpty;
+ 
+-    if (! ::ucbhelper::ContentBroker::initialize( mxMSF, aArgs ) )
++    if ( !::ucbhelper::ContentBroker::initialize( mxMSF, aArgs ) )
++    {
+         fprintf( stderr, "Failed to init content broker\n" );
++        fprintf( stderr, "arg[0]: %s\n", UCB_CONFIGURATION_KEY1_LOCAL );
++        fprintf( stderr, "arg[1]: %s\n", UCB_CONFIGURATION_KEY2_OFFICE );
++    }
+ }
+ 
+-#define INIT_ENV_VOODOO( installDir )                                   \
+-    /* Unless you do this, obviously you don't deserve to have anything work */ \
+-    OString aCfg = "CFG_INIFILE=file://"                                \
+-                 + OUStringToOString( installDir, RTL_TEXTENCODING_UTF8 ) \
+-                 + "/program/configmgrrc";                              \
+-    putenv( (char *)aCfg.getStr() );                                    \
+-    /* Unless you do this, obviously you don't want your paths to be correct & \
+-       hence no images.zip location is possible. */                     \
+-    OString aBaseInst = "BaseInstallation=file://"                      \
+-                 + OUStringToOString( installDir, RTL_TEXTENCODING_UTF8 ); \
+-    putenv( (char *)aBaseInst.getStr() );                               \
+-
+-void LayoutTest::IInit()
++void LayoutTest::Init()
+ {
+-    INIT_ENV_VOODOO( mInstallDir );
+-    mxContext = createInitialComponentContext( mInstallDir );
++    ParseCommandLine();
++    if (!getenv ("OOO_INSTALL_PREFIX") )
++        setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( mInstallDir ), 1 );
++    OSL_TRACE( "OOO_INSTALL_PREFIX=%s\n", getenv( "OOO_INSTALL_PREFIX" ) );
++    mxContext = defaultBootstrap_InitialComponentContext();
+     mxMSF = new UnoBootstrapLayout( Reference< lang::XMultiServiceFactory >( mxContext->getServiceManager(), UNO_QUERY ) );
+     ::comphelper::setProcessServiceFactory( mxMSF );
+     InitUCB();
+@@ -199,6 +172,7 @@ void LayoutTest::IInit()
+ 
+ void LayoutTest::ParseCommandLine()
+ {
++    printf ("%s\n", __PRETTY_FUNCTION__);
+     for ( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ )
+     {
+         OUString aParam = OUString( GetCommandLineParam( i ) );
+@@ -209,6 +183,7 @@ void LayoutTest::ParseCommandLine()
+             if ( i >= GetCommandLineParamCount() - 1)
+                 usage();
+             mInstallDir = GetCommandLineParam( ++i );
++            setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( mInstallDir ), 1 );
+         }
+         else if ( aParam.equalsAscii( "--test" ) )
+         {
+@@ -237,7 +212,17 @@ void LayoutTest::RunEditor()
      editor.Execute();
  }
  
 -void RunDialog( layout::Dialog& dialog )
 +void RunDialog( Dialog& dialog )
++{
++    dialog.Show();
++    dialog.Execute();
++    fprintf( stderr, "1st execute exited" );
++    dialog.Execute();
++    fprintf( stderr, "2nd execute exited" );
++}
++
++#undef Dialog
++void RunDialog( ::Dialog& dialog )
  {
      dialog.Show();
      dialog.Execute();
-@@ -258,6 +261,11 @@ void TestDialog( OUString const& name )
-         SwWordCountDialog words ( 0 );
-         RunDialog( words );
-     }
+@@ -248,20 +233,27 @@ void RunDialog( layout::Dialog& dialog )
+ 
+ void TestDialog( OUString const& name )
+ {
+-    if ( name.equalsAscii( "zoom" ) )
++    if ( 0 )
++        ;
 +    else if ( name.equalsAscii( "plugin" ) )
-+    {
+     {
+-        SvxZoomDialog zoom( 0 );
+-        RunDialog( zoom );
 +        PluginDialog plugin ( 0 );
 +        RunDialog( plugin );
 +    }
-     else if ( name.equalsAscii( "recover" ) )
++    else if ( name.equalsAscii( "recover" ) )
++    {
++        SvxRecoverDialog recover ( 0 );
++        RunDialog( recover );
+     }
+     else if ( name.equalsAscii( "wordcount" ) )
+     {
+         SwWordCountDialog words ( 0 );
+         RunDialog( words );
+     }
+-    else if ( name.equalsAscii( "recover" ) )
++    else if ( name.equalsAscii( "zoom" ) )
      {
-         SvxRecoverDialog recover ( 0 );
+-        SvxRecoverDialog recover ( 0 );
+-        RunDialog( recover );
++        SvxZoomDialog zoom( 0 );
++        RunDialog( zoom );
+     }
+ }
+ 
+@@ -277,10 +269,6 @@ void LayoutTest::RunFiles()
+ 
+ void LayoutTest::ExceptionalMain()
+ {
+-    ParseCommandLine();
+-    IInit();
+-    INIT_ENV_VOODOO( mInstallDir );
+-
+     if ( mTestDialog.getLength() )
+         TestDialog( mTestDialog );
+     else if ( mEditMode )
+@@ -326,4 +314,4 @@ LayoutTest::LayoutTest( char const* installDir )
+ {
+ }
+ 
+-LayoutTest lt( "/usr/local/lib/ooo" );
++LayoutTest layout_test( "/usr/local/lib/ooo" );
+diff --git a/workben/layout/testrc.in b/workben/layout/testrc.in
+new file mode 100644
+index 0000000..15e190d
+--- /dev/null
++++ toolkit/workben/layout/testrc.in
+@@ -0,0 +1,12 @@
++OOO_INSTALL_PREFIX_URL=file://${OOO_INSTALL_PREFIX}
++OOO_BASIS_URL=${OOO_INSTALL_PREFIX_URL}/openoffice.org/basis3.0
++OOO_BASIS_BIN_URL=${OOO_INSTALL_PREFIX_URL}/openoffice.org/basis3.0/program
++OOO_URE_URL=${OOO_INSTALL_PREFIX_URL}/openoffice.org/ure
++#
++#CFG_INIFILE=${OOO_BASIS_BIN_URL}/configmgrrc
++#BaseInstallation=${OOO_BASIS_URL}
++BRAND_BASE_DIR=${OOO_INSTALL_PREFIX_URL}/openoffice.org3
++OOO_BASE_DIR=${OOO_BASIS_URL}
++#
++UNO_TYPES=${OOO_URE_URL}/share/misc/types.rdb ${OOO_BASIS_BIN_URL}/offapi.rdb
++UNO_SERVICES=${OOO_URE_URL}/share/misc/services.rdb ${OOO_BASIS_BIN_URL}/services.rdb
 diff --git a/workben/layout/uno.hxx b/workben/layout/uno.hxx
 index 6e1f837..63d170f 100644
 --- toolkit/workben/layout/uno.hxx

Modified: trunk/patches/dev300/layout-tab-toolkit.diff
==============================================================================
--- trunk/patches/dev300/layout-tab-toolkit.diff	(original)
+++ trunk/patches/dev300/layout-tab-toolkit.diff	Fri May 23 13:44:12 2008
@@ -542,7 +542,7 @@
  
      return children;
 diff --git a/source/layout/helper.cxx b/source/layout/helper.cxx
-index 76f4d2b..37aa5d2 100644
+index 78cdbd4..e2c9eae 100644
 --- toolkit/source/layout/helper.cxx
 +++ toolkit/source/layout/helper.cxx
 @@ -254,7 +254,7 @@ PropHelper::getInfoHelper()
@@ -604,7 +604,7 @@
              OUString( RTL_CONSTASCII_USTRINGPARAM( "invalid namespace!" ) ),
              uno::Reference< uno::XInterface >(), uno::Any() );
 diff --git a/source/layout/proplist.cxx b/source/layout/proplist.cxx
-index 3e85aee..d1da2a4 100644
+index eef28ea..b65f918 100644
 --- toolkit/source/layout/proplist.cxx
 +++ toolkit/source/layout/proplist.cxx
 @@ -200,8 +200,8 @@ uno::Any anyFromString( OUString const& value, uno::Type const& type )
@@ -618,21 +618,18 @@
                  seq[ i ] = *it;
  
              return uno::makeAny( seq );
-@@ -255,18 +255,17 @@ setProperties( uno::Reference< uno::XInterface > const& xPeer,
+@@ -255,17 +255,17 @@ setProperties( uno::Reference< uno::XInterface > const& xPeer,
      if ( !prophlp::canHandleProps( xPeer ) )
      {
          DBG_ERROR( "Error: setProperties - bad handle ignoring props:\n" );
 -        PropList::const_iterator cur;
 -        for( cur = rProps.begin(); cur != rProps.end(); cur++ )
--        {
--            OString attr = OUStringToOString( cur->first, RTL_TEXTENCODING_UTF8 );
--            OString value = OUStringToOString( cur->second, RTL_TEXTENCODING_UTF8 );
--        }
-+         for ( PropList::const_iterator it = rProps.begin(); it != rProps.end();
++        for ( PropList::const_iterator it = rProps.begin(); it != rProps.end();
 +              it++ )
-+         {
-+             OSL_TRACE( "%s=%s\n", OUSTRING_CSTR( it->first ), OUSTRING_CSTR( it->second ) );
-+         }
+         {
+-            DBG_ERROR1( "%s=%s\n", OUSTRING_CSTR( cur->first ), OUSTRING_CSTR( cur->second ) );
++            DBG_ERROR1( "%s=%s\n", OUSTRING_CSTR( it->first ), OUSTRING_CSTR( it->second ) );
+         }
          return;
      }
  
@@ -645,7 +642,7 @@
  }
  
  void
-@@ -354,7 +353,7 @@ static const AttributesMap attribsMap[] =
+@@ -353,7 +353,7 @@ static const AttributesMap attribsMap[] =
      { "spin",         awt::VclWindowPeerAttribute::SPIN,         false },
      { "vscroll",      awt::VclWindowPeerAttribute::VSCROLL,      false },
  
@@ -654,7 +651,7 @@
  };
  static const int attribsMapLen = sizeof( attribsMap ) / sizeof( AttributesMap );
  
-@@ -386,10 +385,8 @@ long getAttribute( const OUString &rName, bool bTopWindow )
+@@ -385,10 +385,8 @@ long getAttribute( const OUString &rName, bool bTopWindow )
  void propsFromAttributes( const uno::Reference<xml::input::XAttributes> & xAttributes,
                            PropList &rProps, sal_Int32 nNamespace )
  {
@@ -666,7 +663,7 @@
      {
          if ( nNamespace != xAttributes->getUidByIndex( i ) )
              continue;
-@@ -406,15 +403,15 @@ void propsFromAttributes( const uno::Reference<xml::input::XAttributes> & xAttri
+@@ -405,15 +403,15 @@ void propsFromAttributes( const uno::Reference<xml::input::XAttributes> & xAttri
  bool
  findAndRemove( const char *pAttr, PropList &rProps, OUString &rValue )
  {
@@ -687,7 +684,7 @@
              return true;
          }
      }
-@@ -437,7 +434,7 @@ getAttributeProps( PropList &rProps )
+@@ -436,7 +434,7 @@ getAttributeProps( PropList &rProps )
      else
          nAttrs |= awt::WindowAttribute::SHOW;
  
@@ -1481,24 +1478,19 @@
 +
 +  Start a [Writer] document and choose View/Zoom or Extra/Word count.
 diff --git a/workben/layout/makefile.mk b/workben/layout/makefile.mk
-index d7303af..8ac422a 100644
+index 7126deb..51e9fa6 100644
 --- toolkit/workben/layout/makefile.mk
 +++ toolkit/workben/layout/makefile.mk
-@@ -44,10 +44,11 @@ ENABLE_EXCEPTIONS=TRUE
- 
- .IF "$(ENABLE_LAYOUT)" == "TRUE"
- 
--CFLAGS += -I$(PRJ)/source/layout
-+.INCLUDE :  minor.mk
-+CFLAGS += -I$(PRJ)/source/layout -DRSCVERSION=$(RSCVERSION)
+@@ -47,7 +47,7 @@ ENABLE_EXCEPTIONS=TRUE
+ CFLAGS += -I$(PRJ)/source/layout
  
  # Allow zoom and wordcount to be built without depending on svx,sv,sfx2
--CFLAGS += -I../$(PRJ)/svx/inc -I../$(PRJ)/svtools/inc -I../$(PRJ)/sfx2/inc
+-CFLAGS += -I../$(PRJ)/svx/inc -I../$(PRJ)/svtools/inc
 +CFLAGS += -I../$(PRJ)/svx/inc -I../$(PRJ)/svtools/inc -I../$(PRJ)/sfx2/inc -I../$(PRJ)/sc/inc -I../$(PRJ)/sc/source/ui/inc
  
  .INCLUDE : $(PRJ)$/util$/makefile.pmk
  
-@@ -70,6 +71,8 @@ OBJFILES=\
+@@ -70,6 +70,8 @@ OBJFILES=\
  	$(OBJ)$/plugin.obj \
  	$(OBJ)$/recover.obj \
  	$(OBJ)$/test.obj \
@@ -1507,18 +1499,7 @@
  	$(OBJ)$/wordcountdialog.obj \
  	$(OBJ)$/zoom.obj
  
-@@ -84,7 +87,9 @@ APP1STDLIBS= \
- 		$(SALLIB)			\
- 		$(XMLSCRIPTLIB)			\
- 		$(TKLIB) \
--		$(SVXLIB)
-+		$(SVXLIB) \
-+		$(ISCLIB) \
-+#
- 
- svtools = $(INCCOM)/svtools
- all: $(svtools) ALLTAR
-@@ -93,6 +98,7 @@ all: $(svtools) ALLTAR
+@@ -95,6 +97,7 @@ default: ALLTAR
  
  XML_FILES=\
  	recover.xml\
@@ -2227,273 +2208,74 @@
 +    </vbox>
 +</tabdialog>
 diff --git a/workben/layout/test.cxx b/workben/layout/test.cxx
-index 4049e60..67ef4d6 100644
+index 0408590..e6f9387 100644
 --- toolkit/workben/layout/test.cxx
 +++ toolkit/workben/layout/test.cxx
-@@ -53,20 +53,29 @@
- #include <comphelper/processfactory.hxx>
- #include <com/sun/star/xml/sax/SAXException.hpp>
+@@ -50,6 +50,12 @@
+ #include <ucbhelper/configurationkeys.hxx>
+ #include <ucbhelper/contentbroker.hxx>
  
-+#include "dbcolect.hxx"
-+#include <sfx2/shell.hxx>
-+
++#define SORT_DLG 1 /* requires sfx2, svx to be compiled */
++#if SORT_DLG
 +#include "scitems.hxx"
 +#include "uiitems.hxx"
++#endif /* SORT_DLG */
 +
  #include "editor.hxx"
  
--#include "wordcountdialog.hxx"
-+#include "plugin.hxx"
- #undef _LAYOUT_POST_HXX
--#include "zoom.hxx"
-+
-+#include "recover.hxx"
+ #include "plugin.hxx"
+@@ -58,6 +64,11 @@
+ #include "recover.hxx"
  #undef _LAYOUT_POST_HXX
  
--#include "plugin.hxx"
++#if SORT_DLG
 +#include "sortdlg.hxx"
- #undef _LAYOUT_POST_HXX
- 
--#include "recover.hxx"
-+#include "wordcountdialog.hxx"
 +#undef _LAYOUT_POST_HXX
++#endif /* SORT_DLG */
 +
-+#include "zoom.hxx"
+ #include "wordcountdialog.hxx"
  #undef _LAYOUT_POST_HXX
  
--//#undef SW_WORDCOUNTDIALOG_HXX
- #include <layout/layout-pre.hxx>
- 
- using namespace ::rtl;
-@@ -81,16 +90,34 @@ Reference< XComponentContext > createInitialComponentContext(
-     
-     try
-     {
-+        OUString base = OUString::createFromAscii( SAL_CONFIGFILE( "uno" ) );
-+            
-+#if RSCVERSION < 300
-+        OUString file_name = inst_dir 
-+            + OUString::createFromAscii( "/program/" )
-+            + base;
-+#else
-+        OUString file_name = inst_dir 
-+            + OUString::createFromAscii( "/openoffice.org/basis3.0/program/" )
-+            + base;
-+#endif
-+        if ( FILE* f = fopen( OUSTRING_CSTR( file_name ), "r" ) )
-+        {
-+            printf( "found %s: %s\n", OUSTRING_CSTR( base ),
-+                    OUSTRING_CSTR( file_name ) );
-+            fclose( f );
-+        }
-+        else
-+            printf( "%s not found, no such file: %s\n",
-+                    OUSTRING_CSTR( base ), OUSTRING_CSTR( file_name ) );
-+        
-         OUString file_url;
--        oslFileError rc = osl_getFileURLFromSystemPath(
--            inst_dir.pData, &file_url.pData );
-+        oslFileError rc = osl_getFileURLFromSystemPath( file_name.pData,
-+                                                        &file_url.pData );
-         OSL_ASSERT( osl_File_E_None == rc );
--        (void) rc;  // quiet warning
--        
--        OUString unorc = file_url + OUString(
--            OUString::createFromAscii( "/program/" SAL_CONFIGFILE( "uno" )) );
-+        ( void ) rc;
-         
--        return defaultBootstrap_InitialComponentContext( unorc );
-+        return defaultBootstrap_InitialComponentContext( file_url );
-     }
-     
-     catch( Exception& rExc )
-@@ -161,29 +188,75 @@ void LayoutTest::LoadFile( const OUString &aTestFile )
-     fprintf( stderr, "TEST: file loaded\n" );
- }
- 
-+#include <vos/process.hxx>
-+#include <rtl/ustrbuf.hxx>
-+
- // Nurgh ...
- void LayoutTest::InitUCB()
- {
-+#if  RSCVERSION < 300
-     OUString aEmpty;
--    Sequence< Any > aArgs(6);
-+    Sequence< Any > aArgs( 6 );
-     aArgs[0]
--        <<= OUString::createFromAscii(UCB_CONFIGURATION_KEY1_LOCAL);
-+        <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL );
-     aArgs[1]
--        <<= OUString::createFromAscii(UCB_CONFIGURATION_KEY2_OFFICE);
-+        <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE );
-     aArgs[2] <<= OUString::createFromAscii( "PIPE" );
-     aArgs[3] <<= aEmpty;
-     aArgs[4] <<= OUString::createFromAscii( "PORTAL" );
-     aArgs[5] <<= aEmpty;
- 
--    if (! ::ucbhelper::ContentBroker::initialize( mxMSF, aArgs ) )
-+    if ( !::ucbhelper::ContentBroker::initialize( mxMSF, aArgs ) )
-+    {
-         fprintf( stderr, "Failed to init content broker\n" );
-+        fprintf( stderr, "arg[0]: %s\n", UCB_CONFIGURATION_KEY1_LOCAL );
-+        fprintf( stderr, "arg[1]: %s\n", UCB_CONFIGURATION_KEY2_OFFICE );
-+    }
-+#else
-+    OUString rPortalConnect;
-+    bool bServer = false;
-+
-+
-+
-+    OUString aPipe = OUString::createFromAscii( "1000" );
-+    vos::OSecurity().getUserIdent( aPipe );
-+ 
-+    OUStringBuffer aPortal;
-+    if ( rPortalConnect.getLength() != 0 )
-+    {
-+        aPortal.append( sal_Unicode( ',' ) );
-+        aPortal.append( rPortalConnect );
-+    }
-+
-+    Sequence< Any > aArgs(6);
-+    aArgs[0]
-+        <<= rtl::OUString::createFromAscii( bServer
-+                                            ? UCB_CONFIGURATION_KEY1_SERVER
-+                                            : UCB_CONFIGURATION_KEY1_LOCAL);
-+    aArgs[1]
-+        <<= rtl::OUString::createFromAscii(UCB_CONFIGURATION_KEY2_OFFICE);
-+    aArgs[2] <<= rtl::OUString::createFromAscii("PIPE");
-+    aArgs[3] <<= aPipe;
-+    aArgs[4] <<= rtl::OUString::createFromAscii("PORTAL");
-+    aArgs[5] <<= aPortal.makeStringAndClear();
-+    
-+    if ( !::ucbhelper::ContentBroker::initialize( mxMSF, aArgs ) )
-+    {
-+        fprintf( stderr, "Failed to init content broker\n" );
-+        //fprintf( stderr, "arg[0]: %s\n", OUSTRING_CSTR( aArgs[0].get<OUString> ) );
-+        //fprintf( stderr, "arg[1]: %s\n", OUSTRING_CSTR( OUString( aArgs[0] ) );
-+    }
-+#endif
- }
- 
-+#if RSCVERSION < 300
-+
- #define INIT_ENV_VOODOO( installDir )                                   \
-     /* Unless you do this, obviously you don't deserve to have anything work */ \
-     OString aCfg = "CFG_INIFILE=file://"                                \
-                  + OUStringToOString( installDir, RTL_TEXTENCODING_UTF8 ) \
--                 + "/program/configmgrrc";                              \
-+                 + "/program/"                                          \
-+                 + SAL_CONFIGFILE( "configmgr" );                       \
-     putenv( (char *)aCfg.getStr() );                                    \
-     /* Unless you do this, obviously you don't want your paths to be correct & \
-        hence no images.zip location is possible. */                     \
-@@ -191,6 +264,24 @@ void LayoutTest::InitUCB()
-                  + OUStringToOString( installDir, RTL_TEXTENCODING_UTF8 ); \
-     putenv( (char *)aBaseInst.getStr() );                               \
- 
-+#else
-+
-+#define INIT_ENV_VOODOO( installDir )                                   \
-+    /* Unless you do this, obviously you don't deserve to have anything work */ \
-+    OString aCfg = "CFG_INIFILE=file://"                                \
-+                 + OUStringToOString( installDir, RTL_TEXTENCODING_UTF8 ) \
-+                 + "/openoffice.org/basis3.0/program/"                  \
-+                 + SAL_CONFIGFILE( "configmgr" );                       \
-+    putenv( (char *)aCfg.getStr() );                                    \
-+    /* Unless you do this, obviously you don't want your paths to be correct & \
-+       hence no images.zip location is possible. */                     \
-+    OString aBaseInst = "BaseInstallation=file://"                      \
-+                 + OUStringToOString( installDir, RTL_TEXTENCODING_UTF8 ) \
-+                 + "/openoffice.org/basis3.0";                          \
-+    putenv( (char *)aBaseInst.getStr() );                               \
-+
-+#endif
-+
- void LayoutTest::IInit()
- {
-     INIT_ENV_VOODOO( mInstallDir );
-@@ -249,18 +340,48 @@ void RunDialog( Dialog& dialog )
+@@ -163,7 +174,7 @@ void LayoutTest::Init()
+     ParseCommandLine();
+     if (!getenv ("OOO_INSTALL_PREFIX") )
+         setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( mInstallDir ), 1 );
+-    OSL_TRACE( "OOO_INSTALL_PREFIX=%s\n", getenv( "OOO_INSTALL_PREFIX" ) );
++    OSL_TRACE( "OOO_INSTALL_PREFIX=%s", getenv( "OOO_INSTALL_PREFIX" ) );
+     mxContext = defaultBootstrap_InitialComponentContext();
+     mxMSF = new UnoBootstrapLayout( Reference< lang::XMultiServiceFactory >( mxContext->getServiceManager(), UNO_QUERY ) );
+     ::comphelper::setProcessServiceFactory( mxMSF );
+@@ -231,6 +242,15 @@ void RunDialog( ::Dialog& dialog )
      fprintf( stderr, "2nd execute exited" );
  }
  
--void TestDialog( OUString const& name )
-+#undef Dialog
-+void RunDialog( ::Dialog& dialog )
- {
--    if ( name.equalsAscii( "zoom" ) )
--    {
--        SvxZoomDialog zoom( 0 );
--        RunDialog( zoom );
--    }
--    else if ( name.equalsAscii( "wordcount" ) )
-+    dialog.Show();
-+    dialog.Execute();
-+    fprintf( stderr, "1st execute exited" );
-+    dialog.Execute();
-+    fprintf( stderr, "2nd execute exited" );
-+}
-+
-+#include <sfx2/sfxuno.hxx>
-+static void get_factory( char const *service )
-+{
-+    uno::Reference< lang::XSingleServiceFactory > xFactory(
-+        comphelper::createProcessComponent(
-+            rtl::OUString::createFromAscii( service ) ), uno::UNO_QUERY );
-+
-+    if ( !xFactory.is() )
-     {
--        SwWordCountDialog words ( 0 );
--        RunDialog( words );
-+        fprintf( stderr, "error loading: %s\n", service );
-+#if 0
-+        throw uno::RuntimeException(
-+            rtl::OUString::createFromAscii( "error loading service: " )
-+            + rtl::OUString::createFromAscii( service ) ),
-+            uno::Reference< uno::XInterface >() );
-+#endif
-     }
-+}
-+
-+#define GET_FACTORY(x) get_factory( #x )
-+    
++#if SORT_DLG
 +static void LoadSC()
 +{
 +    get_factory( "com.sun.star.comp.sfx2.DocumentTemplates" );
 +    get_factory( "com.sun.star.comp.Calc.SpreadsheetDocument" );
 +    GET_FACTORY( com.sun.star.i18n.Transliteration.l10n );
 +}
++#endif /* SORT_DLG */
 +
-+void TestDialog( OUString const& name )
-+{
-+    if ( 0 )
-+        ;
-     else if ( name.equalsAscii( "plugin" ) )
-     {
-         PluginDialog plugin ( 0 );
-@@ -271,6 +392,22 @@ void TestDialog( OUString const& name )
+ void TestDialog( OUString const& name )
+ {
+     if ( 0 )
+@@ -245,6 +265,14 @@ void TestDialog( OUString const& name )
          SvxRecoverDialog recover ( 0 );
          RunDialog( recover );
      }
++#if SORT_DLG
 +    else if ( name.equalsAscii( "sort" ) )
 +    {
 +        LoadSC();
 +        ScSortDlg sort ( 0, 0 );
 +        RunDialog( sort );
 +    }
-+    else if ( name.equalsAscii( "wordcount" ) )
-+    {
-+        SwWordCountDialog words ( 0 );
-+        RunDialog( words );
-+    }
-+    else if ( name.equalsAscii( "zoom" ) )
-+    {
-+        SvxZoomDialog zoom( 0 );
-+        RunDialog( zoom );
-+    }
- }
- 
- void LayoutTest::RunFiles()
++#endif /* SORT_DLG */
+     else if ( name.equalsAscii( "wordcount" ) )
+     {
+         SwWordCountDialog words ( 0 );
 diff --git a/workben/layout/tpsort.cxx b/workben/layout/tpsort.cxx
 new file mode 100644
 index 0000000..9b669da



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]