Anonymous avatar Anonymous committed 11f0039 Merge

CWS-TOOLING: integrate CWS kso46

Comments (0)

Files changed (21)

comphelper/source/officeinstdir/officeinstallationdirectories.cxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 
 OfficeInstallationDirectories::OfficeInstallationDirectories(
         const uno::Reference< uno::XComponentContext > & xCtx )
-: m_aOfficeDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(baseinsturl)" ) ),
+: m_aOfficeBrandDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(brandbaseurl)" ) ),
+  m_aOfficeBaseDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(baseinsturl)" ) ),
   m_aUserDirMacro( RTL_CONSTASCII_USTRINGPARAM( "$(userdataurl)" ) ),
   m_xCtx( xCtx ),
-  m_pOfficeDir( 0 ),
+  m_pOfficeBrandDir( 0 ),
+  m_pOfficeBaseDir( 0 ),
   m_pUserDir( 0 )
 {
 }
 // virtual
 OfficeInstallationDirectories::~OfficeInstallationDirectories()
 {
+    delete m_pOfficeBrandDir;
+    delete m_pOfficeBaseDir;
+    delete m_pUserDir;
 }
 
 //=========================================================================
 OfficeInstallationDirectories::getOfficeInstallationDirectoryURL()
     throw ( uno::RuntimeException )
 {
-    // late init m_pOfficeDir and m_pUserDir
     initDirs();
-    return rtl::OUString( *m_pOfficeDir );
+    return rtl::OUString( *m_pOfficeBrandDir );
 }
 
 //=========================================================================
 OfficeInstallationDirectories::getOfficeUserDataDirectoryURL()
     throw ( uno::RuntimeException )
 {
-    // late init m_pOfficeDir and m_pUserDir
     initDirs();
     return rtl::OUString( *m_pUserDir );
 }
 {
     if ( URL.getLength() > 0 )
     {
-        // late init m_pOfficeDir and m_pUserDir
         initDirs();
 
         rtl::OUString aCanonicalURL( URL );
         makeCanonicalFileURL( aCanonicalURL );
 
-        sal_Int32 nIndex = aCanonicalURL.indexOf( *m_pOfficeDir );
+        sal_Int32 nIndex = aCanonicalURL.indexOf( *m_pOfficeBrandDir );
         if ( nIndex  != -1 )
         {
             return rtl::OUString(
                 URL.replaceAt( nIndex,
-                               m_pOfficeDir->getLength(),
-                               m_aOfficeDirMacro ) );
+                               m_pOfficeBrandDir->getLength(),
+                               m_aOfficeBrandDirMacro ) );
         }
         else
         {
-            nIndex = aCanonicalURL.indexOf( *m_pUserDir );
+            nIndex = aCanonicalURL.indexOf( *m_pOfficeBaseDir );
             if ( nIndex  != -1 )
             {
                 return rtl::OUString(
                     URL.replaceAt( nIndex,
-                                   m_pUserDir->getLength(),
-                                   m_aUserDirMacro ) );
+                                   m_pOfficeBaseDir->getLength(),
+                                   m_aOfficeBaseDirMacro ) );
+            }
+            else
+            {
+                nIndex = aCanonicalURL.indexOf( *m_pUserDir );
+                if ( nIndex  != -1 )
+                {
+                    return rtl::OUString(
+                        URL.replaceAt( nIndex,
+                                       m_pUserDir->getLength(),
+                                       m_aUserDirMacro ) );
+                }
             }
         }
     }
 {
     if ( URL.getLength() > 0 )
     {
-        sal_Int32 nIndex = URL.indexOf( m_aOfficeDirMacro );
+        sal_Int32 nIndex = URL.indexOf( m_aOfficeBrandDirMacro );
         if ( nIndex != -1 )
         {
-            // late init m_pOfficeDir and m_pUserDir
             initDirs();
 
             return rtl::OUString(
                 URL.replaceAt( nIndex,
-                               m_aOfficeDirMacro.getLength(),
-                               *m_pOfficeDir ) );
+                               m_aOfficeBrandDirMacro.getLength(),
+                               *m_pOfficeBrandDir ) );
         }
         else
         {
-            nIndex = URL.indexOf( m_aUserDirMacro );
+            nIndex = URL.indexOf( m_aOfficeBaseDirMacro );
             if ( nIndex != -1 )
             {
-                // late init m_pOfficeDir and m_pUserDir
                 initDirs();
 
                 return rtl::OUString(
                     URL.replaceAt( nIndex,
-                                   m_aUserDirMacro.getLength(),
-                                   *m_pUserDir ) );
+                                   m_aOfficeBaseDirMacro.getLength(),
+                                   *m_pOfficeBaseDir ) );
+            }
+            else
+            {
+                nIndex = URL.indexOf( m_aUserDirMacro );
+                if ( nIndex != -1 )
+                {
+                    initDirs();
+
+                    return rtl::OUString(
+                        URL.replaceAt( nIndex,
+                                       m_aUserDirMacro.getLength(),
+                                       *m_pUserDir ) );
+                }
             }
         }
     }
 
 void OfficeInstallationDirectories::initDirs()
 {
-    if ( m_pOfficeDir == 0 )
+    if ( m_pOfficeBrandDir == 0 )
     {
         osl::MutexGuard aGuard( m_aMutex );
-        if ( m_pOfficeDir == 0 )
+        if ( m_pOfficeBrandDir == 0 )
         {
-            m_pOfficeDir = new rtl::OUString;
-            m_pUserDir   = new rtl::OUString;
+            m_pOfficeBrandDir = new rtl::OUString;
+            m_pOfficeBaseDir  = new rtl::OUString;
+            m_pUserDir        = new rtl::OUString;
 
             uno::Reference< util::XMacroExpander > xExpander;
 
 
             if ( xExpander.is() )
             {
-                *m_pOfficeDir =
+                *m_pOfficeBrandDir =
+                    xExpander->expandMacros(
+                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR" ) ) );
+
+                OSL_ENSURE( m_pOfficeBrandDir->getLength() > 0,
+                            "Unable to obtain office brand installation directory!" );
+
+                makeCanonicalFileURL( *m_pOfficeBrandDir );
+
+                *m_pOfficeBaseDir =
                     xExpander->expandMacros(
                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
                             "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":BaseInstallation}" ) ) );
 
-                OSL_ENSURE( m_pOfficeDir->getLength() > 0,
-                        "Unable to obtain office installation directory!" );
+                OSL_ENSURE( m_pOfficeBaseDir->getLength() > 0,
+                            "Unable to obtain office base installation directory!" );
 
-                makeCanonicalFileURL( *m_pOfficeDir );
+                makeCanonicalFileURL( *m_pOfficeBaseDir );
 
                 *m_pUserDir =
                     xExpander->expandMacros(
                             "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ) ) );
 
                 OSL_ENSURE( m_pUserDir->getLength() > 0,
-                        "Unable to obtain office user data directory!" );
+                            "Unable to obtain office user data directory!" );
 
                 makeCanonicalFileURL( *m_pUserDir );
             }

comphelper/source/officeinstdir/officeinstallationdirectories.hxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 private:
     void initDirs();
 
-    rtl::OUString                                   m_aOfficeDirMacro;
+    rtl::OUString                                   m_aOfficeBrandDirMacro;
+    rtl::OUString                                   m_aOfficeBaseDirMacro;
     rtl::OUString                                   m_aUserDirMacro;
     com::sun::star::uno::Reference<
         com::sun::star::uno::XComponentContext >    m_xCtx;
-    rtl::OUString *                                 m_pOfficeDir;
+    rtl::OUString *                                 m_pOfficeBrandDir;
+    rtl::OUString *                                 m_pOfficeBaseDir;
     rtl::OUString *                                 m_pUserDir;
 };
 
 if test -n "$with_system_neon" -o -n "$with_system_libs" && \
 	test "$with_system_neon" != "no"; then
         AC_MSG_RESULT([external])
-        PKG_CHECK_MODULES(NEON, neon >= 0.24.0, , AC_MSG_ERROR([you need neon >= 0.24.x for system-neon]))
+        PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
         NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
         NEON_CFLAGS="$NEON_CFLAGS -DSYSTEM_NEON -DUSE_DAV_LOCKS=1"
         SYSTEM_NEON=YES

l10ntools/source/help/HelpLinker.cxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 
 #define DBHELP_ONLY
 
-
 class IndexerPreProcessor
 {
 private:
-	std::string				m_aModuleName;
-    fs::path				m_fsIndexBaseDir;
-    fs::path				m_fsCaptionFilesDirName;
-    fs::path				m_fsContentFilesDirName;
+    std::string       m_aModuleName;
+    fs::path          m_fsIndexBaseDir;
+    fs::path          m_fsCaptionFilesDirName;
+    fs::path          m_fsContentFilesDirName;
 
-	xsltStylesheetPtr		m_xsltStylesheetPtrCaption;
-	xsltStylesheetPtr		m_xsltStylesheetPtrContent;
+    xsltStylesheetPtr m_xsltStylesheetPtrCaption;
+    xsltStylesheetPtr m_xsltStylesheetPtrContent;
 
-public: 
+public:
     IndexerPreProcessor( const std::string& aModuleName, const fs::path& fsIndexBaseDir,
-		 const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet );
-	~IndexerPreProcessor();
+         const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet );
+    ~IndexerPreProcessor();
 
-	void processDocument( xmlDocPtr doc, const std::string& EncodedDocPath );
+    void processDocument( xmlDocPtr doc, const std::string& EncodedDocPath );
 };
 
 IndexerPreProcessor::IndexerPreProcessor
-	( const std::string& aModuleName, const fs::path& fsIndexBaseDir,
-	  const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet )
-		: m_aModuleName( aModuleName )
-		, m_fsIndexBaseDir( fsIndexBaseDir )
+    ( const std::string& aModuleName, const fs::path& fsIndexBaseDir,
+      const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet )
+        : m_aModuleName( aModuleName )
+        , m_fsIndexBaseDir( fsIndexBaseDir )
 {
     m_fsCaptionFilesDirName = fsIndexBaseDir / "caption";
     fs::create_directory( m_fsCaptionFilesDirName );
     m_fsContentFilesDirName = fsIndexBaseDir / "content";
     fs::create_directory( m_fsContentFilesDirName );
 
-	m_xsltStylesheetPtrCaption = xsltParseStylesheetFile
-		((const xmlChar *)idxCaptionStylesheet.native_file_string().c_str());
-	m_xsltStylesheetPtrContent = xsltParseStylesheetFile
-		((const xmlChar *)idxContentStylesheet.native_file_string().c_str());
+    m_xsltStylesheetPtrCaption = xsltParseStylesheetFile
+        ((const xmlChar *)idxCaptionStylesheet.native_file_string().c_str());
+    m_xsltStylesheetPtrContent = xsltParseStylesheetFile
+        ((const xmlChar *)idxContentStylesheet.native_file_string().c_str());
 }
 
 IndexerPreProcessor::~IndexerPreProcessor()
 {
-	if( m_xsltStylesheetPtrCaption )
-		xsltFreeStylesheet( m_xsltStylesheetPtrCaption );
-	if( m_xsltStylesheetPtrContent )
-		xsltFreeStylesheet( m_xsltStylesheetPtrContent );
+    if( m_xsltStylesheetPtrCaption )
+        xsltFreeStylesheet( m_xsltStylesheetPtrCaption );
+    if( m_xsltStylesheetPtrContent )
+        xsltFreeStylesheet( m_xsltStylesheetPtrContent );
 }
 
 
 std::string getEncodedPath( const std::string& Path )
 {
-	rtl::OString aOStr_Path( Path.c_str() );
-	rtl::OUString aOUStr_Path( rtl::OStringToOUString
-		( aOStr_Path, fs::getThreadTextEncoding() ) );
-	rtl::OUString aPathURL;
-	osl::File::getFileURLFromSystemPath( aOUStr_Path, aPathURL );
-	rtl::OString aOStr_PathURL( rtl::OUStringToOString
-		( aPathURL, fs::getThreadTextEncoding() ) );
-	std::string aStdStr_PathURL( aOStr_PathURL.getStr() );
-	return aStdStr_PathURL;
+    rtl::OString aOStr_Path( Path.c_str() );
+    rtl::OUString aOUStr_Path( rtl::OStringToOUString
+        ( aOStr_Path, fs::getThreadTextEncoding() ) );
+    rtl::OUString aPathURL;
+    osl::File::getFileURLFromSystemPath( aOUStr_Path, aPathURL );
+    rtl::OString aOStr_PathURL( rtl::OUStringToOString
+        ( aPathURL, fs::getThreadTextEncoding() ) );
+    std::string aStdStr_PathURL( aOStr_PathURL.getStr() );
+    return aStdStr_PathURL;
 }
 
 void IndexerPreProcessor::processDocument
-	( xmlDocPtr doc, const std::string &EncodedDocPath )
+    ( xmlDocPtr doc, const std::string &EncodedDocPath )
 {
-	std::string aStdStr_EncodedDocPathURL = getEncodedPath( EncodedDocPath );
+    std::string aStdStr_EncodedDocPathURL = getEncodedPath( EncodedDocPath );
 
-	if( m_xsltStylesheetPtrCaption )
-	{
-		xmlDocPtr resCaption = xsltApplyStylesheet( m_xsltStylesheetPtrCaption, doc, NULL );
-		xmlNodePtr pResNodeCaption = resCaption->xmlChildrenNode;
-		if( pResNodeCaption )
-		{
-			fs::path fsCaptionPureTextFile_docURL = m_fsCaptionFilesDirName / aStdStr_EncodedDocPathURL;
-			std::string aCaptionPureTextFileStr_docURL = fsCaptionPureTextFile_docURL.native_file_string();
-			FILE* pFile_docURL = fopen( aCaptionPureTextFileStr_docURL.c_str(), "w" );
-			if( pFile_docURL )
-			{
-				fprintf( pFile_docURL, "%s\n", pResNodeCaption->content );
-				fclose( pFile_docURL );
-			}
-		}
-		xmlFreeDoc(resCaption);
-	}
+    if( m_xsltStylesheetPtrCaption )
+    {
+        xmlDocPtr resCaption = xsltApplyStylesheet( m_xsltStylesheetPtrCaption, doc, NULL );
+        xmlNodePtr pResNodeCaption = resCaption->xmlChildrenNode;
+        if( pResNodeCaption )
+        {
+            fs::path fsCaptionPureTextFile_docURL = m_fsCaptionFilesDirName / aStdStr_EncodedDocPathURL;
+            std::string aCaptionPureTextFileStr_docURL = fsCaptionPureTextFile_docURL.native_file_string();
+            FILE* pFile_docURL = fopen( aCaptionPureTextFileStr_docURL.c_str(), "w" );
+            if( pFile_docURL )
+            {
+                fprintf( pFile_docURL, "%s\n", pResNodeCaption->content );
+                fclose( pFile_docURL );
+            }
+        }
+        xmlFreeDoc(resCaption);
+    }
 
-	if( m_xsltStylesheetPtrContent )
-	{
-		xmlDocPtr resContent = xsltApplyStylesheet( m_xsltStylesheetPtrContent, doc, NULL );
-		xmlNodePtr pResNodeContent = resContent->xmlChildrenNode;
-		if( pResNodeContent )
-		{
-			fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL;
-			std::string aContentPureTextFileStr_docURL = fsContentPureTextFile_docURL.native_file_string();
-			FILE* pFile_docURL = fopen( aContentPureTextFileStr_docURL.c_str(), "w" );
-			if( pFile_docURL )
-			{
-				fprintf( pFile_docURL, "%s\n", pResNodeContent->content );
-				fclose( pFile_docURL );
-			}
-		}
-	    xmlFreeDoc(resContent);
-	}
+    if( m_xsltStylesheetPtrContent )
+    {
+        xmlDocPtr resContent = xsltApplyStylesheet( m_xsltStylesheetPtrContent, doc, NULL );
+        xmlNodePtr pResNodeContent = resContent->xmlChildrenNode;
+        if( pResNodeContent )
+        {
+            fs::path fsContentPureTextFile_docURL = m_fsContentFilesDirName / aStdStr_EncodedDocPathURL;
+            std::string aContentPureTextFileStr_docURL = fsContentPureTextFile_docURL.native_file_string();
+            FILE* pFile_docURL = fopen( aContentPureTextFileStr_docURL.c_str(), "w" );
+            if( pFile_docURL )
+            {
+                fprintf( pFile_docURL, "%s\n", pResNodeContent->content );
+                fclose( pFile_docURL );
+            }
+        }
+        xmlFreeDoc(resContent);
+    }
 }
 
 struct Data
 
 void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const std::string& aValueStr )
 {
-	if( pFile == NULL )
-		return;
-	char cLF = 10;
-	unsigned int nKeyLen = aKeyStr.length();
-	unsigned int nValueLen = aValueStr.length();
-	fprintf( pFile, "%x ", nKeyLen );
-	if( nKeyLen > 0 )
-	{
+    if( pFile == NULL )
+        return;
+    char cLF = 10;
+    unsigned int nKeyLen = aKeyStr.length();
+    unsigned int nValueLen = aValueStr.length();
+    fprintf( pFile, "%x ", nKeyLen );
+    if( nKeyLen > 0 )
+    {
         if (fwrite( aKeyStr.c_str(), 1, nKeyLen, pFile ) != nKeyLen)
             fprintf(stderr, "fwrite to db failed\n");
-	}
-	if (fprintf( pFile, " %x ", nValueLen ) < 0)
+    }
+    if (fprintf( pFile, " %x ", nValueLen ) < 0)
         fprintf(stderr, "fwrite to db failed\n");
-	if( nValueLen > 0 )
-	{
-		if (fwrite( aValueStr.c_str(), 1, nValueLen, pFile ) != nValueLen)
+    if( nValueLen > 0 )
+    {
+        if (fwrite( aValueStr.c_str(), 1, nValueLen, pFile ) != nValueLen)
             fprintf(stderr, "fwrite to db failed\n");
-	}
-	if (fprintf( pFile, "%c", cLF ) < 0)
+    }
+    if (fprintf( pFile, "%c", cLF ) < 0)
         fprintf(stderr, "fwrite to db failed\n");
 }
 
         }
     }
 
-	void dump_DBHelp( const std::string& rFileName )
+    void dump_DBHelp( const std::string& rFileName )
     {
-		FILE* pFile = fopen( rFileName.c_str(), "wb" );
-		if( pFile == NULL )
-			return;
+        FILE* pFile = fopen( rFileName.c_str(), "wb" );
+        if( pFile == NULL )
+            return;
 
         DataHashtable::const_iterator aEnd = _hash.end();
         for (DataHashtable::const_iterator aIter = _hash.begin(); aIter != aEnd; ++aIter)
-			writeKeyValue_DBHelp( pFile, aIter->first, aIter->second.getString() );
+            writeKeyValue_DBHelp( pFile, aIter->first, aIter->second.getString() );
 
-		fclose( pFile );
+        fclose( pFile );
     }
 };
 
 {
 public:
     void main(std::vector<std::string> &args,
-//		std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL )
-              std::string* pExtensionPath = NULL, 
-              std::string* pDestination = NULL, 
+              std::string* pExtensionPath = NULL,
+              std::string* pDestination = NULL,
               const rtl::OUString* pOfficeHelpPath = NULL )
 
-			throw( HelpProcessingException );
+            throw( HelpProcessingException );
 
     HelpLinker()
-		: init(true)
-		, m_pIndexerPreProcessor(NULL)
-	{}
+        : init(true)
+        , m_pIndexerPreProcessor(NULL)
+    {}
     ~HelpLinker()
-		{ delete m_pIndexerPreProcessor; }
+        { delete m_pIndexerPreProcessor; }
 
 private:
     int locCount, totCount;
     std::string lang;
     std::string extensionPath;
     std::string extensionDestination;
-	bool bExtensionMode;
+    bool bExtensionMode;
     fs::path indexDirName;
     fs::path indexDirParentName;
     bool init;
     void initIndexerPreProcessor();
     void link() throw( HelpProcessingException );
     void addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishid,
-        const std::string& fileB, const std::string& anchorB, 
+        const std::string& fileB, const std::string& anchorB,
         const std::string& jarfileB, const std::string& titleB );
 #if 0
     /**
     {
         const char *good = "!$&'()*+,-.=@_";
         static const char hex[17] = "0123456789ABCDEF";
-    
+
         std::string result;
         for (size_t i=0; i < rIn.length(); ++i)
         {
     dataB[i++] = static_cast<unsigned char>(fileLen);
     for (size_t j = 0; j < fileB.length(); ++j)
         dataB[i++] = fileB[j];
-    if (!anchorB.empty()) 
+    if (!anchorB.empty())
     {
         dataB[i++] = '#';
         for (size_t j = 0; j < anchorB.length(); ++j)
     data.data = &dataB[0];
     data.size = dataB.size();
 
-	if( dbBase != NULL )
-		dbBase->put(dbBase, NULL, &key, &data, 0);
+    if( dbBase != NULL )
+        dbBase->put(dbBase, NULL, &key, &data, 0);
 
-	if( pFile_DBHelp != NULL )
-	{
-		std::string aValueStr( dataB.begin(), dataB.end() );
-		writeKeyValue_DBHelp( pFile_DBHelp, thishid, aValueStr );
-	}
+    if( pFile_DBHelp != NULL )
+    {
+        std::string aValueStr( dataB.begin(), dataB.end() );
+        writeKeyValue_DBHelp( pFile_DBHelp, thishid, aValueStr );
+    }
 }
 
 void HelpLinker::initIndexerPreProcessor()
 {
     if( m_pIndexerPreProcessor )
-		delete m_pIndexerPreProcessor;
+        delete m_pIndexerPreProcessor;
     std::string mod = module;
     std::transform (mod.begin(), mod.end(), mod.begin(), tolower);
     m_pIndexerPreProcessor = new IndexerPreProcessor( mod, indexDirParentName,
-		 idxCaptionStylesheet, idxContentStylesheet );
+         idxCaptionStylesheet, idxContentStylesheet );
 }
 
 /**
-* 
+*
 */
 void HelpLinker::link() throw( HelpProcessingException )
 {
-	bool bIndexForExtension = true;
+    bool bIndexForExtension = true;
 
-	if( bExtensionMode )
-	{
-		//indexDirParentName = sourceRoot;
+    if( bExtensionMode )
+    {
+        //indexDirParentName = sourceRoot;
         indexDirParentName = extensionDestination;
-	}
-	else
-	{
-		indexDirParentName = zipdir;
-		fs::create_directory(indexDirParentName);
-	}
+    }
+    else
+    {
+        indexDirParentName = zipdir;
+        fs::create_directory(indexDirParentName);
+    }
 
 #ifdef CMC_DEBUG
     std::cerr << "will not delete tmpdir of " << indexDirParentName.native_file_string().c_str() << std::endl;
     if (appl[0] == 's')
         appl = appl.substr(1);
 
-	bool bUse_ = true;
+    bool bUse_ = true;
 #ifdef DBHELP_ONLY
-	if( !bExtensionMode )
-		bUse_ = false;
+    if( !bExtensionMode )
+        bUse_ = false;
 #endif
 
     DB* helpText(0);
 #ifndef DBHELP_ONLY
     fs::path helpTextFileName(indexDirParentName / (mod + ".ht"));
     db_create(&helpText,0,0);
-    helpText->open(helpText, NULL, helpTextFileName.native_file_string().c_str(), NULL, DB_BTREE, 
+    helpText->open(helpText, NULL, helpTextFileName.native_file_string().c_str(), NULL, DB_BTREE,
         DB_CREATE | DB_TRUNCATE, 0644);
 #endif
 
     fs::path helpTextFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".ht_" : ".ht")));
-	FILE* pFileHelpText_DBHelp = fopen
-		( helpTextFileName_DBHelp.native_file_string().c_str(), "wb" );
+    FILE* pFileHelpText_DBHelp = fopen
+        ( helpTextFileName_DBHelp.native_file_string().c_str(), "wb" );
 
     DB* dbBase(0);
 #ifndef DBHELP_ONLY
     fs::path dbBaseFileName(indexDirParentName / (mod + ".db"));
     db_create(&dbBase,0,0);
-    dbBase->open(dbBase, NULL, dbBaseFileName.native_file_string().c_str(), NULL, DB_BTREE, 
+    dbBase->open(dbBase, NULL, dbBaseFileName.native_file_string().c_str(), NULL, DB_BTREE,
         DB_CREATE | DB_TRUNCATE, 0644);
 #endif
 
-	fs::path dbBaseFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".db_" : ".db")));
-	FILE* pFileDbBase_DBHelp = fopen
-		( dbBaseFileName_DBHelp.native_file_string().c_str(), "wb" );
+    fs::path dbBaseFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".db_" : ".db")));
+    FILE* pFileDbBase_DBHelp = fopen
+        ( dbBaseFileName_DBHelp.native_file_string().c_str(), "wb" );
 
 #ifndef DBHELP_ONLY
     DB* keyWord(0);
     fs::path keyWordFileName(indexDirParentName / (mod + ".key"));
     db_create(&keyWord,0,0);
-    keyWord->open(keyWord, NULL, keyWordFileName.native_file_string().c_str(), NULL, DB_BTREE, 
+    keyWord->open(keyWord, NULL, keyWordFileName.native_file_string().c_str(), NULL, DB_BTREE,
         DB_CREATE | DB_TRUNCATE, 0644);
 #endif
 
 
     HelpKeyword helpKeyword;
 
-	// catch HelpProcessingException to avoid locking data bases
-	try
-	{
+    // catch HelpProcessingException to avoid locking data bases
+    try
+    {
 
     // lastly, initialize the indexBuilder
     if ( (!bExtensionMode || bIndexForExtension) && !helpFiles.empty())
-		initIndexerPreProcessor();
+        initIndexerPreProcessor();
 
-	if( !bExtensionMode )
-	{
+    if( !bExtensionMode )
+    {
 #ifndef OS2 // YD @TODO@ crashes libc runtime :-(
-        std::cout << "Making " << outputFile.native_file_string() << 
-			" from " << helpFiles.size() << " input files" << std::endl;
+        std::cout << "Making " << outputFile.native_file_string() <<
+            " from " << helpFiles.size() << " input files" << std::endl;
 #endif
-	}
+    }
 
     // here we start our loop over the hzip files.
     HashSet::iterator end = helpFiles.end();
     for (HashSet::iterator iter = helpFiles.begin(); iter != end; ++iter)
     {
-		if( !bExtensionMode )
-		{
-			std::cout << ".";
-			std::cout.flush();
-		}
-		 
+        if( !bExtensionMode )
+        {
+            std::cout << ".";
+            std::cout.flush();
+        }
+
         // process one file
         // streamTable contains the streams in the hzip file
         StreamTable streamTable;
         fs::path langsourceRoot(sourceRoot);
         fs::path xhpFile;
 
-		if( bExtensionMode )
-		{
-			// langsourceRoot == sourceRoot for extensions
-	        std::string xhpFileNameComplete( extensionPath );
-			xhpFileNameComplete.append( '/' + xhpFileName );
-	        xhpFile = fs::path( xhpFileNameComplete );
-		}
-		else
-		{
-			langsourceRoot.append('/' + lang + '/');
-	        xhpFile = fs::path(xhpFileName, fs::native);
-		}
-		 
-        HelpCompiler hc( streamTable, xhpFile, langsourceRoot, 
-			embeddStylesheet, module, lang, bExtensionMode );
+        if( bExtensionMode )
+        {
+            // langsourceRoot == sourceRoot for extensions
+            std::string xhpFileNameComplete( extensionPath );
+            xhpFileNameComplete.append( '/' + xhpFileName );
+            xhpFile = fs::path( xhpFileNameComplete );
+        }
+        else
+        {
+            langsourceRoot.append('/' + lang + '/');
+            xhpFile = fs::path(xhpFileName, fs::native);
+        }
+
+        HelpCompiler hc( streamTable, xhpFile, langsourceRoot,
+            embeddStylesheet, module, lang, bExtensionMode );
 
         HCDBG(std::cerr << "before compile of " << xhpFileName << std::endl);
         bool success = hc.compile();
 
         if (!success && !bExtensionMode)
         {
-			std::stringstream aStrStream;
-			aStrStream << 
+            std::stringstream aStrStream;
+            aStrStream <<
                 "\nERROR: compiling help particle '"
                     << xhpFileName
                     << "' for language '"
                     << lang
                     << "' failed!";
-			throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+            throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
         }
 
         const std::string documentBaseId = streamTable.document_id;
                 // std::cerr << hzipFileName << std::endl;
                 const LinkedList& ll = enumer->second;
                 LinkedList::const_iterator aOtherEnd = ll.end();
-                for (LinkedList::const_iterator llIter = ll.begin(); 
+                for (LinkedList::const_iterator llIter = ll.begin();
                     llIter != aOtherEnd; ++llIter)
                 {
                         helpKeyword.insert(*llIter, totalId);
                 }
             }
-                
+
         }
 
         // and last the helptexts
                 std::string helpTextId = helpTextIter->first;
                 const std::string& helpTextText = helpTextIter->second;
 
-                helpTextId = URLEncoder::encode(helpTextId); 
+                helpTextId = URLEncoder::encode(helpTextId);
 
                 DBT keyDbt;
                 memset(&keyDbt, 0, sizeof(keyDbt));
                 textDbt.data = const_cast<char*>(helpTextText.c_str());
                 textDbt.size = helpTextText.length();
 
-				if( helpText != NULL )
-	                helpText->put(helpText, NULL, &keyDbt, &textDbt, 0);
+                if( helpText != NULL )
+                    helpText->put(helpText, NULL, &keyDbt, &textDbt, 0);
 
-				if( pFileHelpText_DBHelp != NULL )
-					writeKeyValue_DBHelp( pFileHelpText_DBHelp, helpTextId, helpTextText );
+                if( pFileHelpText_DBHelp != NULL )
+                    writeKeyValue_DBHelp( pFileHelpText_DBHelp, helpTextId, helpTextText );
             }
         }
 
-		//IndexerPreProcessor
-		if( !bExtensionMode || bIndexForExtension )
-		{
-			// now the indexing
-			xmlDocPtr document = streamTable.appl_doc;
-			if (!document)
-				document = streamTable.default_doc;
-			if (document)
-			{
-				std::string temp = module;
-				std::transform (temp.begin(), temp.end(), temp.begin(), tolower); 
-				m_pIndexerPreProcessor->processDocument(document, URLEncoder::encode(documentPath) );
-			}
-		}
+        //IndexerPreProcessor
+        if( !bExtensionMode || bIndexForExtension )
+        {
+            // now the indexing
+            xmlDocPtr document = streamTable.appl_doc;
+            if (!document)
+                document = streamTable.default_doc;
+            if (document)
+            {
+                std::string temp = module;
+                std::transform (temp.begin(), temp.end(), temp.begin(), tolower);
+                m_pIndexerPreProcessor->processDocument(document, URLEncoder::encode(documentPath) );
+            }
+        }
 
     } // while loop over hzip files ending
-	if( !bExtensionMode )
-		std::cout << std::endl;
+    if( !bExtensionMode )
+        std::cout << std::endl;
 
-	}	// try
-	catch( HelpProcessingException& )
-	{
-		// catch HelpProcessingException to avoid locking data bases
+    } // try
+    catch( const HelpProcessingException& )
+    {
+        // catch HelpProcessingException to avoid locking data bases
 #ifndef DBHELP_ONLY
-		helpText->close(helpText, 0);
-		dbBase->close(dbBase, 0);
-		keyWord->close(keyWord, 0);
+        helpText->close(helpText, 0);
+        dbBase->close(dbBase, 0);
+        keyWord->close(keyWord, 0);
 #endif
-		if( pFileHelpText_DBHelp != NULL )
-			fclose( pFileHelpText_DBHelp );
-		if( pFileDbBase_DBHelp != NULL )
-			fclose( pFileDbBase_DBHelp );
-		throw;
-	}
+        if( pFileHelpText_DBHelp != NULL )
+            fclose( pFileHelpText_DBHelp );
+        if( pFileDbBase_DBHelp != NULL )
+            fclose( pFileDbBase_DBHelp );
+        throw;
+    }
 
 #ifndef DBHELP_ONLY
     helpText->close(helpText, 0);
     helpKeyword.dump(keyWord);
     keyWord->close(keyWord, 0);
 #endif
-	if( pFileHelpText_DBHelp != NULL )
-		fclose( pFileHelpText_DBHelp );
-	if( pFileDbBase_DBHelp != NULL )
-		fclose( pFileDbBase_DBHelp );
+    if( pFileHelpText_DBHelp != NULL )
+        fclose( pFileHelpText_DBHelp );
+    if( pFileDbBase_DBHelp != NULL )
+        fclose( pFileDbBase_DBHelp );
 
-	helpKeyword.dump_DBHelp( keyWordFileName_DBHelp.native_file_string() );
+    helpKeyword.dump_DBHelp( keyWordFileName_DBHelp.native_file_string() );
 
-	if( !bExtensionMode )
-	{
-		// New index
-		Stringtable::iterator aEnd = additionalFiles.end();
-		for (Stringtable::iterator enumer = additionalFiles.begin(); enumer != aEnd;
-			++enumer)
-		{
-			const std::string &additionalFileName = enumer->second;
-			const std::string &additionalFileKey = enumer->first;
+    if( !bExtensionMode )
+    {
+        // New index
+        Stringtable::iterator aEnd = additionalFiles.end();
+        for (Stringtable::iterator enumer = additionalFiles.begin(); enumer != aEnd;
+            ++enumer)
+        {
+            const std::string &additionalFileName = enumer->second;
+            const std::string &additionalFileKey = enumer->first;
 
-			fs::path fsAdditionalFileName( additionalFileName, fs::native );
-				std::string aNativeStr = fsAdditionalFileName.native_file_string();
-				const char* pStr = aNativeStr.c_str();
-				std::cerr << pStr;
+            fs::path fsAdditionalFileName( additionalFileName, fs::native );
+                std::string aNativeStr = fsAdditionalFileName.native_file_string();
+                const char* pStr = aNativeStr.c_str();
+                std::cerr << pStr;
 
-		    fs::path fsTargetName( indexDirParentName / additionalFileKey );
+            fs::path fsTargetName( indexDirParentName / additionalFileKey );
 
-			fs::copy( fsAdditionalFileName, fsTargetName );
-		}
-	}
+            fs::copy( fsAdditionalFileName, fsTargetName );
+        }
+    }
 
 /*
     /////////////////////////////////////////////////////////////////////////
     /// remove temprary directory for index creation
     /////////////////////////////////////////////////////////////////////////
 #ifndef CMC_DEBUG
-	if( !bExtensionMode )
-	    fs::remove_all( indexDirParentName );
+    if( !bExtensionMode )
+        fs::remove_all( indexDirParentName );
 #endif
 */
 }
 
 
 void HelpLinker::main( std::vector<std::string> &args,
-                       std::string* pExtensionPath, std::string* pDestination,  
+                       std::string* pExtensionPath, std::string* pDestination,
                        const rtl::OUString* pOfficeHelpPath )
     throw( HelpProcessingException )
 {
-	bExtensionMode = false;
+    bExtensionMode = false;
     helpFiles.clear();
 
     if (args.size() > 0 && args[0][0] == '@')
         if (args[i].compare("-extlangsrc") == 0)
         {
             ++i;
-            if (i >= args.size()) 
+            if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "extension source missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "extension source missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
             extsource = args[i];
         }
             //If this argument is not provided then the location provided in -extsource will
             //also be the destination
             ++i;
-            if (i >= args.size()) 
+            if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "extension destination missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "extension destination missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
             extdestination = args[i];
         }
         else if (args[i].compare("-src") == 0)
         {
             ++i;
-            if (i >= args.size()) 
+            if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "sourceroot missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "sourceroot missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
             bSrcOption = true;
             sourceRoot = fs::path(args[i], fs::native);
         }
-        else if (args[i].compare("-sty") == 0) 
+        else if (args[i].compare("-sty") == 0)
         {
             ++i;
             if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "embeddingStylesheet missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "embeddingStylesheet missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
 
-			embeddStylesheet = fs::path(args[i], fs::native);
-        } 
-        else if (args[i].compare("-zipdir") == 0) 
+            embeddStylesheet = fs::path(args[i], fs::native);
+        }
+        else if (args[i].compare("-zipdir") == 0)
         {
             ++i;
-            if (i >= args.size()) 
+            if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "idxtemp missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "idxtemp missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
 
             zipdir = fs::path(args[i], fs::native);
-        } 
-        else if (args[i].compare("-idxcaption") == 0) 
+        }
+        else if (args[i].compare("-idxcaption") == 0)
         {
             ++i;
-            if (i >= args.size()) 
+            if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "idxcaption stylesheet missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "idxcaption stylesheet missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
 
             idxCaptionStylesheet = fs::path(args[i], fs::native);
-        } 
-        else if (args[i].compare("-idxcontent") == 0) 
+        }
+        else if (args[i].compare("-idxcontent") == 0)
         {
             ++i;
-            if (i >= args.size()) 
+            if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "idxcontent stylesheet missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "idxcontent stylesheet missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
 
             idxContentStylesheet = fs::path(args[i], fs::native);
             ++i;
             if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "outputfilename missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "outputfilename missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
 
             outputFile = fs::path(args[i], fs::native);
-        } 
-        else if (args[i].compare("-mod") == 0) 
+        }
+        else if (args[i].compare("-mod") == 0)
         {
             ++i;
             if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "module name missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "module name missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
 
             module = args[i];
-        } 
+        }
         else if (args[i].compare("-lang") == 0)
         {
             ++i;
             if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "language name missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "language name missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
 
             lang = args[i];
-        } 
+        }
         else if (args[i].compare("-hid") == 0)
         {
             ++i;
-			throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, "obsolete -hid argument used" );
-        } 
+            throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, "obsolete -hid argument used" );
+        }
         else if (args[i].compare("-add") == 0)
         {
             std::string addFile, addFileUnderPath;
             ++i;
             if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "pathname missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "pathname missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
 
             addFileUnderPath = args[i];
             ++i;
             if (i >= args.size())
             {
-				std::stringstream aStrStream;
-				aStrStream << "pathname missing" << std::endl;
-				throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+                std::stringstream aStrStream;
+                aStrStream << "pathname missing" << std::endl;
+                throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
             }
             addFile = args[i];
             if (!addFileUnderPath.empty() && !addFile.empty())
                 additionalFiles[addFileUnderPath] = addFile;
         }
-        else 
+        else
             helpFiles.push_back(args[i]);
         ++i;
     }
     //In the latter case extsource is not used.
     if( (pExtensionPath && pExtensionPath->length() > 0 && pOfficeHelpPath)
         || !extsource.empty())
-	{
-		bExtensionMode = true;
+    {
+        bExtensionMode = true;
         if (!extsource.empty())
         {
             //called from helplinker.exe, pExtensionPath and pOfficeHelpPath
             aStrStream << "-src must not be used together with -extsource missing" << std::endl;
             throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
         }
-	}
-    
+    }
+
     if (!bExtensionMode && zipdir.empty())
     {
-		std::stringstream aStrStream;
-		aStrStream << "no index dir given" << std::endl;
-		throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+        std::stringstream aStrStream;
+        aStrStream << "no index dir given" << std::endl;
+        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
     }
-    
+
     if (!bExtensionMode && idxCaptionStylesheet.empty()
         || !extsource.empty() && idxCaptionStylesheet.empty())
     {
         //No extension mode and extension mode using commandline
         //!extsource.empty indicates extension mode using commandline
         // -idxcaption paramter is required
-		std::stringstream aStrStream;
-		aStrStream << "no index caption stylesheet given" << std::endl;
-		throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+        std::stringstream aStrStream;
+        aStrStream << "no index caption stylesheet given" << std::endl;
+        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
     }
     else if ( bExtensionMode &&  extsource.empty())
     {
         //This part is used when compileExtensionHelp is called from the extensions manager.
         //If extension help is compiled using helplinker in the build process
-		rtl::OUString aIdxCaptionPathFileURL( *pOfficeHelpPath );
-		aIdxCaptionPathFileURL += rtl::OUString::createFromAscii( "/idxcaption.xsl" );
+        rtl::OUString aIdxCaptionPathFileURL( *pOfficeHelpPath );
+        aIdxCaptionPathFileURL += rtl::OUString::createFromAscii( "/idxcaption.xsl" );
 
-		rtl::OString aOStr_IdxCaptionPathFileURL( rtl::OUStringToOString
-			( aIdxCaptionPathFileURL, fs::getThreadTextEncoding() ) );
-		std::string aStdStr_IdxCaptionPathFileURL( aOStr_IdxCaptionPathFileURL.getStr() );
+        rtl::OString aOStr_IdxCaptionPathFileURL( rtl::OUStringToOString
+            ( aIdxCaptionPathFileURL, fs::getThreadTextEncoding() ) );
+        std::string aStdStr_IdxCaptionPathFileURL( aOStr_IdxCaptionPathFileURL.getStr() );
 
-		idxCaptionStylesheet = fs::path( aStdStr_IdxCaptionPathFileURL );
-	}
-    
+        idxCaptionStylesheet = fs::path( aStdStr_IdxCaptionPathFileURL );
+    }
+
     if (!bExtensionMode && idxContentStylesheet.empty()
         || !extsource.empty() && idxContentStylesheet.empty())
     {
         //No extension mode and extension mode using commandline
         //!extsource.empty indicates extension mode using commandline
         // -idxcontent paramter is required
-		std::stringstream aStrStream;
-		aStrStream << "no index content stylesheet given" << std::endl;
-		throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+        std::stringstream aStrStream;
+        aStrStream << "no index content stylesheet given" << std::endl;
+        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
     }
     else if ( bExtensionMode && extsource.empty())
     {
         //If extension help is compiled using helplinker in the build process
         //then  -idxcontent must be supplied
         //This part is used when compileExtensionHelp is called from the extensions manager.
-		rtl::OUString aIdxContentPathFileURL( *pOfficeHelpPath );
-		aIdxContentPathFileURL += rtl::OUString::createFromAscii( "/idxcontent.xsl" );
+        rtl::OUString aIdxContentPathFileURL( *pOfficeHelpPath );
+        aIdxContentPathFileURL += rtl::OUString::createFromAscii( "/idxcontent.xsl" );
 
-		rtl::OString aOStr_IdxContentPathFileURL( rtl::OUStringToOString
-			( aIdxContentPathFileURL, fs::getThreadTextEncoding() ) );
-		std::string aStdStr_IdxContentPathFileURL( aOStr_IdxContentPathFileURL.getStr() );
+        rtl::OString aOStr_IdxContentPathFileURL( rtl::OUStringToOString
+            ( aIdxContentPathFileURL, fs::getThreadTextEncoding() ) );
+        std::string aStdStr_IdxContentPathFileURL( aOStr_IdxContentPathFileURL.getStr() );
 
-		idxContentStylesheet = fs::path( aStdStr_IdxContentPathFileURL );
-	}
+        idxContentStylesheet = fs::path( aStdStr_IdxContentPathFileURL );
+    }
     if (!bExtensionMode && embeddStylesheet.empty())
     {
-		std::stringstream aStrStream;
-		aStrStream << "no embedding resolving file given" << std::endl;
-		throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+        std::stringstream aStrStream;
+        aStrStream << "no embedding resolving file given" << std::endl;
+        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
     }
     if (sourceRoot.empty())
     {
-		std::stringstream aStrStream;
-		aStrStream << "no sourceroot given" << std::endl;
-		throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+        std::stringstream aStrStream;
+        aStrStream << "no sourceroot given" << std::endl;
+        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
     }
     if (!bExtensionMode && outputFile.empty())
     {
-		std::stringstream aStrStream;
-		aStrStream << "no output file given" << std::endl;
-		throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+        std::stringstream aStrStream;
+        aStrStream << "no output file given" << std::endl;
+        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
     }
     if (module.empty())
     {
-		std::stringstream aStrStream;
-		aStrStream << "module missing" << std::endl;
-		throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+        std::stringstream aStrStream;
+        aStrStream << "module missing" << std::endl;
+        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
     }
     if (!bExtensionMode && lang.empty())
     {
-		std::stringstream aStrStream;
-		aStrStream << "language missing" << std::endl;
-		throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
+        std::stringstream aStrStream;
+        aStrStream << "language missing" << std::endl;
+        throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() );
     }
-
     link();
 }
 
     std::vector<std::string> args;
     for (int i = 1; i < argc; ++i)
         args.push_back(std::string(argv[i]));
-	try
-	{
-		HelpLinker* pHelpLinker = new HelpLinker();
-	    pHelpLinker->main( args );
-		delete pHelpLinker;
-	}
-	catch( const HelpProcessingException& e )
-	{
-		std::cerr << e.m_aErrorMsg;
-		exit(1);
-	}
+    try
+    {
+        HelpLinker* pHelpLinker = new HelpLinker();
+        pHelpLinker->main( args );
+        delete pHelpLinker;
+    }
+    catch( const HelpProcessingException& e )
+    {
+        std::cerr << e.m_aErrorMsg;
+        exit(1);
+    }
     sal_uInt32 endtime = osl_getGlobalTimer();
 #ifndef OS2 // YD @TODO@ crashes libc runtime :-(
     std::cout << "time taken was " << (endtime-starttime)/1000.0 << " seconds" << std::endl;
 
 extern "C" void StructuredXMLErrorFunction(void *userData, xmlErrorPtr error)
 {
-	(void)userData;
-	(void)error;
+    (void)userData;
+    (void)error;
 
-	std::string aErrorMsg = error->message;
-	std::string aXMLParsingFile;
-	if( error->file != NULL )
-		aXMLParsingFile = error->file;
-	int nXMLParsingLine = error->line;
-	HelpProcessingException* pException = new HelpProcessingException( aErrorMsg, aXMLParsingFile, nXMLParsingLine );
-	GpXMLParsingException = pException;
+    std::string aErrorMsg = error->message;
+    std::string aXMLParsingFile;
+    if( error->file != NULL )
+        aXMLParsingFile = error->file;
+    int nXMLParsingLine = error->line;
+    HelpProcessingException* pException = new HelpProcessingException( aErrorMsg, aXMLParsingFile, nXMLParsingLine );
+    GpXMLParsingException = pException;
 
-	// Reset error handler
-	xmlSetStructuredErrorFunc( NULL, NULL ); 
+    // Reset error handler
+    xmlSetStructuredErrorFunc( NULL, NULL );
 }
 
 HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpProcessingException& e )
 {
-	m_eErrorClass = e.m_eErrorClass;
+    m_eErrorClass = e.m_eErrorClass;
     rtl::OString tmpErrorMsg( e.m_aErrorMsg.c_str() );
     m_aErrorMsg = rtl::OStringToOUString( tmpErrorMsg, fs::getThreadTextEncoding() );
     rtl::OString tmpXMLParsingFile( e.m_aXMLParsingFile.c_str() );
     m_aXMLParsingFile = rtl::OStringToOUString( tmpXMLParsingFile, fs::getThreadTextEncoding() );
-	m_nXMLParsingLine = e.m_nXMLParsingLine;
-	return *this;
+    m_nXMLParsingLine = e.m_nXMLParsingLine;
+    return *this;
 }
 
 
 // Returns true in case of success, false in case of error
 HELPLINKER_DLLPUBLIC bool compileExtensionHelp
 (
- 	const rtl::OUString& aOfficeHelpPath,
-	const rtl::OUString& aExtensionName,
-	const rtl::OUString& aExtensionLanguageRoot,
-	sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,
+    const rtl::OUString& aOfficeHelpPath,
+    const rtl::OUString& aExtensionName,
+    const rtl::OUString& aExtensionLanguageRoot,
+    sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles,
     const rtl::OUString& aDestination,
-	HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo
+    HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo
 )
 {
-	bool bSuccess = true;
-
-	sal_Int32 argc = nXhpFileCount + 3;
-	const char** argv = new const char*[argc];
-	argv[0] = "";
-	argv[1] = "-mod";
-	rtl::OString aOExtensionName = rtl::OUStringToOString( aExtensionName, fs::getThreadTextEncoding() );
-	argv[2] = aOExtensionName.getStr();
-
-	for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
-	{
-		rtl::OUString aXhpFile = pXhpFiles[iXhp];
-
-		rtl::OString aOXhpFile = rtl::OUStringToOString( aXhpFile, fs::getThreadTextEncoding() );
-		char* pArgStr = new char[aOXhpFile.getLength() + 1];
-		strcpy( pArgStr, aOXhpFile.getStr() );
-		argv[iXhp + 3] = pArgStr;
-	}
+    bool bSuccess = true;
 
     std::vector<std::string> args;
-    for( sal_Int32 i = 1; i < argc; ++i )
-        args.push_back(std::string( argv[i]) );
+    args.reserve(nXhpFileCount + 2);
+    args.push_back(std::string("-mod"));
+    rtl::OString aOExtensionName = rtl::OUStringToOString( aExtensionName, fs::getThreadTextEncoding() );
+    args.push_back(std::string(aOExtensionName.getStr()));
 
-	for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
-		delete[] argv[iXhp + 3];
-	delete[] argv;
+    for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp )
+    {
+        rtl::OUString aXhpFile = pXhpFiles[iXhp];
 
-	rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() );
-	const char* pExtensionPath = aOExtensionLanguageRoot.getStr();
-	std::string aStdStrExtensionPath = pExtensionPath;
+        rtl::OString aOXhpFile = rtl::OUStringToOString( aXhpFile, fs::getThreadTextEncoding() );
+        args.push_back(std::string(aOXhpFile.getStr()));
+    }
+
+    rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() );
+    const char* pExtensionPath = aOExtensionLanguageRoot.getStr();
+    std::string aStdStrExtensionPath = pExtensionPath;
     rtl::OString aODestination = rtl::OUStringToOString(aDestination, fs::getThreadTextEncoding());
     const char* pDestination = aODestination.getStr();
     std::string aStdStrDestination = pDestination;
 
-	// Set error handler
-	xmlSetStructuredErrorFunc( NULL, (xmlStructuredErrorFunc)StructuredXMLErrorFunction ); 
-	try
-	{
-		HelpLinker* pHelpLinker = new HelpLinker();
-	    pHelpLinker->main( args, &aStdStrExtensionPath, &aStdStrDestination, &aOfficeHelpPath );
-		delete pHelpLinker;
-	}
-	catch( const HelpProcessingException& e )
-	{
-		if( GpXMLParsingException != NULL )
-		{
-			o_rHelpProcessingErrorInfo = *GpXMLParsingException;
-			delete GpXMLParsingException;
-			GpXMLParsingException = NULL;
-		}
-		else
-		{
-			o_rHelpProcessingErrorInfo = e;
-		}
-		bSuccess = false;
-	}
-	// Reset error handler
-	xmlSetStructuredErrorFunc( NULL, NULL ); 
+    // Set error handler
+    xmlSetStructuredErrorFunc( NULL, (xmlStructuredErrorFunc)StructuredXMLErrorFunction );
+    try
+    {
+        HelpLinker* pHelpLinker = new HelpLinker();
+        pHelpLinker->main( args, &aStdStrExtensionPath, &aStdStrDestination, &aOfficeHelpPath );
+        delete pHelpLinker;
+    }
+    catch( const HelpProcessingException& e )
+    {
+        if( GpXMLParsingException != NULL )
+        {
+            o_rHelpProcessingErrorInfo = *GpXMLParsingException;
+            delete GpXMLParsingException;
+            GpXMLParsingException = NULL;
+        }
+        else
+        {
+            o_rHelpProcessingErrorInfo = e;
+        }
+        bSuccess = false;
+    }
+    // Reset error handler
+    xmlSetStructuredErrorFunc( NULL, NULL );
 
-	// i83624: Tree files
-	::rtl::OUString aTreeFileURL = aExtensionLanguageRoot;
-	aTreeFileURL += rtl::OUString::createFromAscii( "/help.tree" );
-	osl::DirectoryItem aTreeFileItem;
-	osl::FileBase::RC rcGet = osl::DirectoryItem::get( aTreeFileURL, aTreeFileItem );
-	osl::FileStatus aFileStatus( FileStatusMask_FileSize );
-	if( rcGet == osl::FileBase::E_None &&
-		aTreeFileItem.getFileStatus( aFileStatus ) == osl::FileBase::E_None && 
-		aFileStatus.isValid( FileStatusMask_FileSize ) )
-	{
-		sal_uInt64 ret, len = aFileStatus.getFileSize();
-		char* s = new char[ int(len) ];  // the buffer to hold the installed files
-		osl::File aFile( aTreeFileURL );
-		aFile.open( OpenFlag_Read );
-		aFile.read( s, len, ret );
-		aFile.close();
+    // i83624: Tree files
+    ::rtl::OUString aTreeFileURL = aExtensionLanguageRoot;
+    aTreeFileURL += rtl::OUString::createFromAscii( "/help.tree" );
+    osl::DirectoryItem aTreeFileItem;
+    osl::FileBase::RC rcGet = osl::DirectoryItem::get( aTreeFileURL, aTreeFileItem );
+    osl::FileStatus aFileStatus( FileStatusMask_FileSize );
+    if( rcGet == osl::FileBase::E_None &&
+        aTreeFileItem.getFileStatus( aFileStatus ) == osl::FileBase::E_None &&
+        aFileStatus.isValid( FileStatusMask_FileSize ) )
+    {
+        sal_uInt64 ret, len = aFileStatus.getFileSize();
+        char* s = new char[ int(len) ];  // the buffer to hold the installed files
+        osl::File aFile( aTreeFileURL );
+        aFile.open( OpenFlag_Read );
+        aFile.read( s, len, ret );
+        aFile.close();
 
-		XML_Parser parser = XML_ParserCreate( 0 );
-		int parsed = XML_Parse( parser, s, int( len ), true );
+        XML_Parser parser = XML_ParserCreate( 0 );
+        int parsed = XML_Parse( parser, s, int( len ), true );
 
-		if( parsed == 0 )
-		{
-			XML_Error nError = XML_GetErrorCode( parser );
-			o_rHelpProcessingErrorInfo.m_eErrorClass = HELPPROCESSING_XMLPARSING_ERROR;
-			o_rHelpProcessingErrorInfo.m_aErrorMsg = rtl::OUString::createFromAscii( XML_ErrorString( nError ) );;
-			o_rHelpProcessingErrorInfo.m_aXMLParsingFile = aTreeFileURL;
-			// CRAHSES!!! o_rHelpProcessingErrorInfo.m_nXMLParsingLine = XML_GetCurrentLineNumber( parser );
-			bSuccess = false;
-		}
+        if( parsed == 0 )
+        {
+            XML_Error nError = XML_GetErrorCode( parser );
+            o_rHelpProcessingErrorInfo.m_eErrorClass = HELPPROCESSING_XMLPARSING_ERROR;
+            o_rHelpProcessingErrorInfo.m_aErrorMsg = rtl::OUString::createFromAscii( XML_ErrorString( nError ) );;
+            o_rHelpProcessingErrorInfo.m_aXMLParsingFile = aTreeFileURL;
+            // CRAHSES!!! o_rHelpProcessingErrorInfo.m_nXMLParsingLine = XML_GetCurrentLineNumber( parser );
+            bSuccess = false;
+        }
 
-		XML_ParserFree( parser );		
-		delete[] s;
-	}
+        XML_ParserFree( parser );
+        delete[] s;
+    }
 
-	return bSuccess;
+    return bSuccess;
 }
 
-// vnd.sun.star.help://swriter/52821?Language=en-US&System=UNIX
-/* vi:set tabstop=4 shiftwidth=4 expandtab: */
-

offapi/com/sun/star/util/OfficeInstallationDirectories.idl

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 
     @since OOo 2.0.0
  */
-service OfficeInstallationDirectories
+published service OfficeInstallationDirectories
 {
   /** provides access to the current office installation directories (office
       base installation and user data).
 
     @see OfficeInstallationDirectories
 */
-singleton theOfficeInstallationDirectories
+published singleton theOfficeInstallationDirectories
 {
     service com::sun::star::util::OfficeInstallationDirectories;
 };

offapi/com/sun/star/util/XOfficeInstallationDirectories.idl

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 
     @since OOo 2.0.0
  */
-interface XOfficeInstallationDirectories : com::sun::star::uno::XInterface
+published interface XOfficeInstallationDirectories : com::sun::star::uno::XInterface
 {
     //------------------------------------------------------------------------
     /** returns the absolute URL containing the directory of the current office
 
     //------------------------------------------------------------------------
     /** returns the absolute URL containing the directory where the current
-        office installation expects its user data (e.g. "file:///home/kso".)
+        office installation expects its user data (e.g.
+        "file:///home/kso/.openoffice.org".)
 
         @returns
         the absolute URL containing the directory of the current office

sfx2/inc/sfx2/sfxsids.hrc

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 #define SID_JUMPTOMARK                      (SID_SFX_START + 598)
 #define SID_OPENTEMPLATE                    (SID_SFX_START + 594)
 #define SID_SAVEASDOC                       (SID_SFX_START + 502)
-#define SID_CLOSING                       	(SID_SFX_START +1539)
+#define SID_CLOSING                         (SID_SFX_START +1539)
 #define SID_CLOSEDOC                        (SID_SFX_START + 503)
 #define SID_CLOSEDOCS                       (SID_SFX_START + 595)
 #define SID_CLOSEDOC_SAVE                   (SID_SFX_START +   1)
 #define SID_RELOAD                          (SID_SFX_START + 508)
 #define SID_PRINTDOCDIRECT                  (SID_SFX_START + 509)
 #define SID_PICKLIST                        (SID_SFX_START + 510)
-#define SID_ATTR_XWINDOW                	(SID_SFX_START + 777)
+#define SID_ATTR_XWINDOW                    (SID_SFX_START + 777)
 #define SID_PLUGIN_MODE                     (SID_SFX_START + 827)
 #define SID_EXPORTDOC                       (SID_SFX_START + 829)
 #define SID_EXPORTDOCASPDF					(SID_SFX_START + 1673)
 #define SID_EXPLORER_FILEPROPS_START        (SID_SFX_START + 1390)
 #define SID_EXPLORER_FILEPROPS_END          (SID_SFX_START + 1399)
 
-#define ID_FILETP_START 					SID_EXPLORER_FILEPROPS_START
-#define ID_FILETP_READONLY 					(ID_FILETP_START + 0)
-#define ID_FILETP_TITLE	  					(ID_FILETP_START + 1)
+#define ID_FILETP_START                     SID_EXPLORER_FILEPROPS_START
+#define ID_FILETP_READONLY                      (ID_FILETP_START + 0)
+#define ID_FILETP_TITLE	                    (ID_FILETP_START + 1)
 
 #define SID_EXPLORER_PROPS_START            (SID_SFX_START + 1410)
 #define SID_EXPLORER_PROPS_END              (SID_SFX_START + 1499)
 
-#define SID_AUTOLOAD            			(SID_SFX_START + 1509)
+#define SID_AUTOLOAD                        (SID_SFX_START + 1509)
 #define SID_FILLFRAME                       (SID_SFX_START + 1516)
 #define SID_BASEURL					        (SID_SFX_START + 1518)
-#define SID_TEMPLATE 				        (SID_SFX_START + 1519)
+#define SID_TEMPLATE                        (SID_SFX_START + 1519)
 
 #define SID_ONLINE_REGISTRATION				(SID_SFX_START + 1537)
 
 
 #define SID_OFFICE_PLK						(SID_SFX_START + 1601)
 #define SID_OFFICE_PALK						(SID_SFX_START + 1604)
-#define SID_CHECK_KEY                    	(SID_SFX_START + 1605)
-#define SID_OFFICE_PRIVATE_USE             	(SID_SFX_START + 1606)
-#define SID_OFFICE_COMMERCIAL_USE          	(SID_SFX_START + 1607)
-#define SID_OFFICE_CUSTOMERNUMBER          	(SID_SFX_START + 1608)
+#define SID_CHECK_KEY                       (SID_SFX_START + 1605)
+#define SID_OFFICE_PRIVATE_USE                  (SID_SFX_START + 1606)
+#define SID_OFFICE_COMMERCIAL_USE               (SID_SFX_START + 1607)
+#define SID_OFFICE_CUSTOMERNUMBER               (SID_SFX_START + 1608)
 #define SID_OFFICE_INVALIDATE_TITLE			(SID_SFX_START + 1609)
 #define SID_OFFICE_CHECK_PLZ                (SID_SFX_START + 1610)
 #define SID_INTERNET_SEARCH					(SID_SFX_START + 1611)
 #define SID_NEW_MSG_PARENT                  (SID_SFX_START + 1622)
 
 
-#define SID_PGP_ENCODE 			            (SID_SFX_START + 1625)
-#define SID_PGP_DECODE 			            (SID_SFX_START + 1626)
-#define SID_TIPWINDOW                  		(SID_SFX_START + 1632)
-#define SID_CHARSET                  		(SID_SFX_START + 1633)
-#define SID_OVERWRITE                  		(SID_SFX_START + 1634)
+#define SID_PGP_ENCODE                          (SID_SFX_START + 1625)
+#define SID_PGP_DECODE                          (SID_SFX_START + 1626)
+#define SID_TIPWINDOW                           (SID_SFX_START + 1632)
+#define SID_CHARSET                         (SID_SFX_START + 1633)
+#define SID_OVERWRITE                           (SID_SFX_START + 1634)
 #define SID_RENAME                          (SID_SFX_START + 1653)
-#define SID_PARTWIN                  		(SID_SFX_START + 1640)
-#define SID_CRASH                 			(SID_SFX_START + 1645)
+#define SID_PARTWIN                         (SID_SFX_START + 1640)
+#define SID_CRASH                           (SID_SFX_START + 1645)
 #define SID_FAIL_ON_WARNING                 (SID_SFX_START + 1646)
 #define SID_MAIL_CHILDWIN					(SID_SFX_START + 1647)
 #define SID_INPUTSTREAM                     (SID_SFX_START + 1648)
 #define SID_SHOW_IME_STATUS_WINDOW          (SID_SFX_START + 1680)
 #define SID_UPDATE_CONFIG                   (SID_SFX_START + 1681)
 #define SID_VIEWONLY                        (SID_SFX_START + 1682)
-#define SID_REPAIRPACKAGE          			(SID_SFX_START + 1683)
+#define SID_REPAIRPACKAGE                       (SID_SFX_START + 1683)
 #define SID_ADDONHELP						(SID_SFX_START + 1684)
 #define SID_OBJECTSHELL                     (SID_SFX_START + 1685)
 #define SID_MINIMIZED                       (SID_SFX_START + 1687)
 #define SID_MACROORGANIZER                  (SID_SFX_START + 1691)
 #define SID_RUNMACRO                        (SID_SFX_START + 1692)
 #define SID_AVMEDIA_TOOLBOX		            (SID_SFX_START + 1693)
-#define SID_AVMEDIA_PLAYER	            	(SID_SFX_START + 1694)
+#define SID_AVMEDIA_PLAYER	                (SID_SFX_START + 1694)
 #define SID_INSERT_AVMEDIA                  (SID_SFX_START + 1696)
 #define SID_RECENTFILELIST                  (SID_SFX_START + 1697)
 #define SID_AVAILABLE_TOOLBARS              (SID_SFX_START + 1698)
 #define SID_DEFAULTFILENAME                 (SID_SFX_START + 1717)
 #define SID_MODIFYPASSWORDINFO              (SID_SFX_START + 1718)
 #define SID_RECOMMENDREADONLY               (SID_SFX_START + 1719)
-#define SID_SFX_free_START                  (SID_SFX_START + 1720)
-#define SID_SFX_free_END  					(SID_SFX_START + 3999)
+#define SID_SUGGESTEDSAVEASDIR              (SID_SFX_START + 1720)
+#define SID_SUGGESTEDSAVEASNAME             (SID_SFX_START + 1721)
+#define SID_SFX_free_START                  (SID_SFX_START + 1722)
+#define SID_SFX_free_END                    (SID_SFX_START + 3999)
 
 #define SID_OPEN_NEW_VIEW                   (SID_SFX_START + 520)
     // FREE, was SID_VIEW_ZOOM_MODE
 #define SID_PASTE                           (SID_SFX_START + 712)
 
 // steht unter diesem Wert in chaos/cntids.hrc!!!
-//#define SID_DELETE   			(SID_SFX_START + 713)
+//#define SID_DELETE                (SID_SFX_START + 713)
 
 #define SID_BACKSPACE                       (SID_SFX_START + 714)
 #define SID_FORMATPAINTBRUSH                (SID_SFX_START + 715)
 #define SID_RESTORETOOLBOX                  (SID_SFX_START + 903)
 #define SID_CONFIG                          (SID_SFX_START + 904)
 #define SID_TOGGLECOMMONTASKBAR             (SID_SFX_START + 928)
-#define SID_TOGGLEINETBAR             		(SID_SFX_START + 928)
+#define SID_TOGGLEINETBAR                   (SID_SFX_START + 928)
 #define SID_TOGGLEOBJECTBAR                 (SID_SFX_START + 905)
 #define SID_CONFIGTOOLBOX                   (SID_SFX_START + 906)
 #define SID_TOOLBOXOPTIONS                  (SID_SFX_START + 907)
 
 #define SID_OPT_DESKTOP_PATH                (SID_SFX_START + 1558)
 #define SID_OPT_CACHE_PATH                  (SID_SFX_START + 1559)
-#define SID_OPT_HELP_PATH                	(SID_SFX_START + 1560)
+#define SID_OPT_HELP_PATH                   (SID_SFX_START + 1560)
 #define SID_OPT_BOOKMARKS_PATH              (SID_SFX_START + 1561)
 #define SID_OPT_GALLERY_PATH                (SID_SFX_START + 1562)
-#define SID_OPT_NEWDOC_PATH                	(SID_SFX_START + 1563)
+#define SID_OPT_NEWDOC_PATH                     (SID_SFX_START + 1563)
 #define SID_OPT_AGENTS_PATH                 (SID_SFX_START + 1564)
 #define SID_OPT_AUTOPILOT_PATH              (SID_SFX_START + 1565)
 #define SID_OPT_EXPLORER_PATH               (SID_SFX_START + 1566)
 #define SID_ATTR_AUTOHELPAGENT			(SID_OPTIONS_START + 67)
 #define SID_AUTOHELPAGENT_RESET			(SID_OPTIONS_START + 68)
 #define SID_HELPAGENT_TIMEOUT			(SID_OPTIONS_START + 93)
-#define SID_ATTR_WELCOMESCREEN 			(SID_OPTIONS_START + 81)
+#define SID_ATTR_WELCOMESCREEN              (SID_OPTIONS_START + 81)
 #define SID_WELCOMESCREEN_RESET			(SID_OPTIONS_START + 82)
-#define SID_RESTORE_EXPAND_STATE	   	(SID_OPTIONS_START + 83)
+#define SID_RESTORE_EXPAND_STATE	        (SID_OPTIONS_START + 83)
 #define SID_ATTR_QUICKLAUNCHER			(SID_OPTIONS_START + 74)
 #define SID_ATTR_YEAR2000				(SID_OPTIONS_START + 87)
-#define SID_ATTR_ALLOWFOLDERWEBVIEW   	(SID_OPTIONS_START + 92)
+#define SID_ATTR_ALLOWFOLDERWEBVIEW     (SID_OPTIONS_START + 92)
 
 
 // PathTabPage
 
 #define SID_INET_CHANNELS_ONOFF         (SID_OPTIONS_START + 64)
 
-#define SID_INET_COOKIESHANDLE 			(SID_OPTIONS_START + 69)
+#define SID_INET_COOKIESHANDLE              (SID_OPTIONS_START + 69)
 
 #define SID_INET_CACHEJS				(SID_OPTIONS_START + 70)
 #define SID_INET_CACHEEXPIRED			(SID_OPTIONS_START + 71)
 #define SID_SAVEREL_FSYS                (SID_OPTIONS_START + 31)
 
 // Automatisches update von Styles - Verwalten-TabPage
-#define SID_ATTR_AUTO_STYLE_UPDATE    	(SID_OPTIONS_START + 65)
+#define SID_ATTR_AUTO_STYLE_UPDATE      (SID_OPTIONS_START + 65)
 
-#define SID_SECURE_URL   				(SID_OPTIONS_START + 66)
+#define SID_SECURE_URL                  (SID_OPTIONS_START + 66)
 
 
 #define SID_OPT_SCREENSCALING			(SID_OPTIONS_START + 78)
 #define SID_BASICIDE_ARG_COLUMN1			( SID_BASICIDE_START + 49 )
 #define SID_BASICIDE_ARG_COLUMN2			( SID_BASICIDE_START + 50 )
 #define SID_BASICIDE_ARG_DOCUMENT_MODEL     ( SID_BASICIDE_START + 51 )
-#define SID_BASICIDE_MANAGE_LANG        	( SID_BASICIDE_START + 52 )
+#define SID_BASICIDE_MANAGE_LANG            ( SID_BASICIDE_START + 52 )
 #define SID_BASICIDE_CURRENT_LANG			( SID_BASICIDE_START + 53 )
 
 // SlotIds f"ur Apps --------------------------------------------------------
 
 //-----------------------------------------------------------------------
 
-#define SID_ATTR_CHAR_FILLCOLOR		    	(SID_SFX_START + 1551)
+#define SID_ATTR_CHAR_FILLCOLOR		        (SID_SFX_START + 1551)
 
 // SfxScriptOrganizerItem
 #define MID_SCRIPT_ORGANIZER_LANGUAGE       1 // Don't use zero for MID's. It's forbidden to do it!

sfx2/source/appl/appuno.cxx

 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2000, 2010 Oracle and/or its affiliates.
  *
  * OpenOffice.org - a multi-platform office productivity suite
 static char const sSilent[] = "Silent";
 static char const sJumpMark[] = "JumpMark";
 static char const sFileName[] = "FileName";
-static char const sSalvageURL[] = "SalvagedFile";
+static char const sSalvagedFile[] = "SalvagedFile";
 static char const sStatusInd[] = "StatusIndicator";
 static char const sModel[] = "Model";
 static char const sFrame[] = "Frame";
 static char const sStandardDir[] = "StandardDir";
 static char const sBlackList[] = "BlackList";
 static char const sModifyPasswordInfo[] = "ModifyPasswordInfo";
+static char const sSuggestedSaveAsDir[] = "SuggestedSaveAsDir";
+static char const sSuggestedSaveAsName[] = "SuggestedSaveAsName";
 
 void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot )
 {
                 DBG_ERROR( aStr.GetBuffer() );
             }
 #endif
-		}
+        }
 #ifdef DBG_UTIL
         else if ( nSubCount == 0 )
         {
             for ( sal_uInt16 n=0; n<nCount; n++ )
             {
                 const ::com::sun::star::beans::PropertyValue& rPropValue = pPropsVal[n];
-				USHORT nSub;
+                USHORT nSub;
                 for ( nSub=0; nSub<nSubCount; nSub++ )
                 {
                     // search sub item by name
                     aStr += ByteString( pType->aAttrib[nSub].pName );
                     const char* pName = aStr.GetBuffer();
                     if ( rPropValue.Name.compareToAscii( pName ) == COMPARE_EQUAL )
-					{
+                    {
                         BYTE nSubId = (BYTE) (sal_Int8) pType->aAttrib[nSub].nAID;
                         if ( bConvertTwips )
                             nSubId |= CONVERT_TWIPS;
                             DBG_ERROR( aDbgStr.GetBuffer() );
                         }
 #endif
-						break;
-					}
+                        break;
+                    }
                 }
 
 #ifdef DBG_UTIL
                 return;
             }
 
-        	USHORT nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId);
+            USHORT nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId);
             BOOL bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == SFX_MAPUNIT_TWIP );
             pItem->SetWhich( nWhich );
             const SfxType* pType = rArg.pType;
                 if ( !bAsWholeItem )
                 {
                     // complex argument; collect sub items from argument array and reconstruct complex item
-				    // only put item if at least one member was found and had the correct type
-				    // (is this a good idea?! Should we ask for *all* members?)
+                    // only put item if at least one member was found and had the correct type
+                    // (is this a good idea?! Should we ask for *all* members?)
                     BOOL bRet = FALSE;
                     for ( sal_uInt16 n=0; n<nCount; n++ )
                     {
                             const char* pName = aStr.GetBuffer();
                             if ( rProp.Name.compareToAscii( pName ) == COMPARE_EQUAL )
                             {
-							    // at least one member found ...
-							    bRet = TRUE;
+                                // at least one member found ...
+                                bRet = TRUE;
 #ifdef DBG_UTIL
                                 ++nFoundArgs;
 #endif
                                     nSubId |= CONVERT_TWIPS;
                                 if (!pItem->PutValue( rProp.Value, nSubId ) )
                                 {
-								    // ... but it was not convertable
+                                    // ... but it was not convertable
                                     bRet = FALSE;
 #ifdef DBG_UTIL
                                     ByteString aDbgStr( "Property not convertable: ");
 #endif
                                 }
 
-							    break;
+                                break;
                             }
                         }
                     }
             }
         }
         else if ( nSlotId == SID_OPENDOC || nSlotId == SID_EXPORTDOC || nSlotId == SID_SAVEASDOC || nSlotId == SID_SAVEDOC ||
-				  nSlotId == SID_SAVETO || nSlotId == SID_EXPORTDOCASPDF || nSlotId == SID_DIRECTEXPORTDOCASPDF )
+                  nSlotId == SID_SAVETO || nSlotId == SID_EXPORTDOCASPDF || nSlotId == SID_DIRECTEXPORTDOCASPDF )
         {
             for ( sal_uInt16 n=0; n<nCount; n++ )
             {
                 }
                 else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStatusInd)) )
                 {
-                	Reference< ::com::sun::star::task::XStatusIndicator > xVal;
-                	sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
-                	DBG_ASSERT( bOK, "invalid type for StatusIndicator" );
-                	if (bOK)
-                    	rSet.Put( SfxUnoAnyItem( SID_PROGRESS_STATUSBAR_CONTROL, rProp.Value ) );
+                    Reference< ::com::sun::star::task::XStatusIndicator > xVal;
+                    sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
+                    DBG_ASSERT( bOK, "invalid type for StatusIndicator" );
+                    if (bOK)
+                        rSet.Put( SfxUnoAnyItem( SID_PROGRESS_STATUSBAR_CONTROL, rProp.Value ) );
                 }
                 else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sInteractionHdl)) )
                 {
-                	Reference< ::com::sun::star::task::XInteractionHandler > xVal;
-                	sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
-                	DBG_ASSERT( bOK, "invalid type for InteractionHandler" );
-                	if (bOK)
-                    	rSet.Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, rProp.Value ) );
+                    Reference< ::com::sun::star::task::XInteractionHandler > xVal;
+                    sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
+                    DBG_ASSERT( bOK, "invalid type for InteractionHandler" );
+                    if (bOK)
+                        rSet.Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, rProp.Value ) );
                 }
                 else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sViewData)) )
                     rSet.Put( SfxUnoAnyItem( SID_VIEW_DATA, rProp.Value ) );
                 else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFilterData)) )
-					rSet.Put( SfxUnoAnyItem( SID_FILTER_DATA, rProp.Value ) );
+                    rSet.Put( SfxUnoAnyItem( SID_FILTER_DATA, rProp.Value ) );
                 else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sInputStream)) )
                 {
-                	Reference< XInputStream > xVal;
-                	sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
-                	DBG_ASSERT( bOK, "invalid type for InputStream" );
-                	if (bOK)
-                    	rSet.Put( SfxUnoAnyItem( SID_INPUTSTREAM, rProp.Value ) );
+                    Reference< XInputStream > xVal;
+                    sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
+                    DBG_ASSERT( bOK, "invalid type for InputStream" );
+                    if (bOK)
+                        rSet.Put( SfxUnoAnyItem( SID_INPUTSTREAM, rProp.Value ) );
                 }
                 else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStream)) )
                 {
-                	Reference< XInputStream > xVal;
-                	sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
+                    Reference< XInputStream > xVal;
+                    sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
                     DBG_ASSERT( bOK, "invalid type for Stream" );
-                	if (bOK)
+                    if (bOK)
                         rSet.Put( SfxUnoAnyItem( SID_STREAM, rProp.Value ) );
                 }
                 else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sUCBContent)) )
                 {
-                	Reference< XContent > xVal;
-                	sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
-                	DBG_ASSERT( bOK, "invalid type for UCBContent" );
-                	if (bOK)
-                    	rSet.Put( SfxUnoAnyItem( SID_CONTENT, rProp.Value ) );
+                    Reference< XContent > xVal;
+                    sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
+                    DBG_ASSERT( bOK, "invalid type for UCBContent" );
+                    if (bOK)
+                        rSet.Put( SfxUnoAnyItem( SID_CONTENT, rProp.Value ) );
                 }
                 else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sOutputStream)) )
                 {
-                	Reference< XOutputStream > xVal;
-                	sal_Bool bOK = ((rProp.Value >>= xVal) && xVal.is());
-                	DBG_ASSERT( bOK, "invalid type for OutputStream" );
-                	if (bOK)
-                    	rSet.Put( SfxUnoAnyItem( SID_OUTPUTSTREAM, rP