summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/inc/address.hxx2
-rw-r--r--sc/inc/document.hxx3
-rw-r--r--sc/inc/externalrefmgr.hxx109
-rw-r--r--sc/inc/tablink.hxx4
-rw-r--r--sc/source/core/data/document.cxx14
-rw-r--r--sc/source/core/tool/address.cxx12
-rw-r--r--sc/source/core/tool/compiler.cxx28
-rw-r--r--sc/source/core/tool/interpr1.cxx3
-rw-r--r--sc/source/core/tool/interpr4.cxx4
-rw-r--r--sc/source/core/tool/rangeutl.cxx4
-rw-r--r--sc/source/filter/excel/xeformula.cxx2
-rw-r--r--sc/source/filter/excel/xelink.cxx6
-rw-r--r--sc/source/filter/excel/xihelper.cxx10
-rw-r--r--sc/source/filter/inc/xihelper.hxx6
-rw-r--r--sc/source/filter/xcl97/XclImpChangeTrack.cxx2
-rw-r--r--sc/source/filter/xml/XMLTableSourceContext.cxx2
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx10
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx179
-rw-r--r--sc/source/ui/docshell/tablink.cxx13
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx4
-rw-r--r--sc/source/ui/view/viewfun6.cxx2
21 files changed, 237 insertions, 182 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 74920c7575b7..8778354d2137 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -280,7 +280,7 @@ public:
struct ExternalInfo
{
- String maTabName;
+ ::rtl::OUString maTabName;
sal_uInt16 mnFileId;
bool mbExternal;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 0cf2c94a15f6..9d275d220d9b 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -524,7 +524,8 @@ public:
SC_DLLPUBLIC void SetVisibleTab(SCTAB nTab) { nVisibleTab = nTab; }
SC_DLLPUBLIC sal_Bool HasTable( SCTAB nTab ) const;
- SC_DLLPUBLIC sal_Bool GetName( SCTAB nTab, String& rName ) const;
+ SC_DLLPUBLIC bool GetName( SCTAB nTab, String& rName ) const;
+ SC_DLLPUBLIC bool GetName( SCTAB nTab, ::rtl::OUString& rName ) const;
SC_DLLPUBLIC sal_Bool GetCodeName( SCTAB nTab, String& rName ) const;
SC_DLLPUBLIC sal_Bool SetCodeName( SCTAB nTab, const String& rName );
SC_DLLPUBLIC sal_Bool GetTable( const String& rName, SCTAB& rTab ) const;
diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx
index aa6f5cb32d7c..7de8232f0958 100644
--- a/sc/inc/externalrefmgr.hxx
+++ b/sc/inc/externalrefmgr.hxx
@@ -99,10 +99,10 @@ public:
struct TableName
{
- String maUpperName;
- String maRealName;
+ ::rtl::OUString maUpperName;
+ ::rtl::OUString maRealName;
- explicit TableName(const String& rUppper, const String& rReal);
+ explicit TableName(const ::rtl::OUString& rUppper, const ::rtl::OUString& rReal);
};
struct CellFormat
@@ -205,14 +205,15 @@ public:
ReferencedFlag meReferenced;
};
- typedef ::boost::shared_ptr<Table> TableTypeRef;
- typedef ::boost::unordered_map<String, size_t, ScStringHashCode> TableNameIndexMap;
+ typedef ::boost::shared_ptr<Table> TableTypeRef;
+ typedef ::boost::unordered_map< ::rtl::OUString, size_t, ::rtl::OUStringHash>
+ TableNameIndexMap;
ScExternalRefCache();
~ScExternalRefCache();
- const String* getRealTableName(sal_uInt16 nFileId, const String& rTabName) const;
- const String* getRealRangeName(sal_uInt16 nFileId, const String& rRangeName) const;
+ const ::rtl::OUString* getRealTableName(sal_uInt16 nFileId, const ::rtl::OUString& rTabName) const;
+ const ::rtl::OUString* getRealRangeName(sal_uInt16 nFileId, const ::rtl::OUString& rRangeName) const;
/**
* Get a cached cell data at specified cell location.
@@ -225,7 +226,7 @@ public:
* @return pointer to the token instance in the cache.
*/
ScExternalRefCache::TokenRef getCellData(
- sal_uInt16 nFileId, const String& rTabName, SCCOL nCol, SCROW nRow, sal_uInt32* pnFmtIndex);
+ sal_uInt16 nFileId, const ::rtl::OUString& rTabName, SCCOL nCol, SCROW nRow, sal_uInt32* pnFmtIndex);
/**
* Get a cached cell range data.
@@ -235,29 +236,30 @@ public:
* guaranteed if the TokenArrayRef is properly used..
*/
ScExternalRefCache::TokenArrayRef getCellRangeData(
- sal_uInt16 nFileId, const String& rTabName, const ScRange& rRange);
+ sal_uInt16 nFileId, const ::rtl::OUString& rTabName, const ScRange& rRange);
- ScExternalRefCache::TokenArrayRef getRangeNameTokens(sal_uInt16 nFileId, const String& rName);
- void setRangeNameTokens(sal_uInt16 nFileId, const String& rName, TokenArrayRef pArray);
+ ScExternalRefCache::TokenArrayRef getRangeNameTokens(sal_uInt16 nFileId, const ::rtl::OUString& rName);
+ void setRangeNameTokens(sal_uInt16 nFileId, const ::rtl::OUString& rName, TokenArrayRef pArray);
- void setCellData(sal_uInt16 nFileId, const String& rTabName, SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uInt32 nFmtIndex);
+ void setCellData(sal_uInt16 nFileId, const ::rtl::OUString& rTabName,
+ SCCOL nCol, SCROW nRow, TokenRef pToken, sal_uInt32 nFmtIndex);
struct SingleRangeData
{
/** This name must be in upper-case. */
- String maTableName;
+ ::rtl::OUString maTableName;
ScMatrixRef mpRangeData;
};
void setCellRangeData(sal_uInt16 nFileId, const ScRange& rRange, const ::std::vector<SingleRangeData>& rData,
const TokenArrayRef& pArray);
bool isDocInitialized(sal_uInt16 nFileId);
- void initializeDoc(sal_uInt16 nFileId, const ::std::vector<String>& rTabNames);
+ void initializeDoc(sal_uInt16 nFileId, const ::std::vector<rtl::OUString>& rTabNames);
String getTableName(sal_uInt16 nFileId, size_t nCacheId) const;
void getAllTableNames(sal_uInt16 nFileId, ::std::vector<rtl::OUString>& rTabNames) const;
- SCsTAB getTabSpan( sal_uInt16 nFileId, const String& rStartTabName, const String& rEndTabName ) const;
+ SCsTAB getTabSpan( sal_uInt16 nFileId, const ::rtl::OUString& rStartTabName, const ::rtl::OUString& rEndTabName ) const;
void getAllNumberFormats(::std::vector<sal_uInt32>& rNumFmts) const;
- bool hasCacheTable(sal_uInt16 nFileId, const String& rTabName) const;
+ bool hasCacheTable(sal_uInt16 nFileId, const ::rtl::OUString& rTabName) const;
size_t getCacheTableCount(sal_uInt16 nFileId) const;
/**
@@ -271,7 +273,7 @@ public:
* Set a table as referenced, used only during store-to-file.
* @returns <TRUE/> if ALL tables of ALL documents are marked.
*/
- bool setCacheTableReferenced( sal_uInt16 nFileId, const String& rTabName, size_t nSheets, bool bPermanent );
+ bool setCacheTableReferenced( sal_uInt16 nFileId, const ::rtl::OUString& rTabName, size_t nSheets, bool bPermanent );
void setAllCacheTableReferencedStati( bool bReferenced );
bool areAllCacheTablesReferenced() const;
@@ -279,7 +281,7 @@ public:
* Set a table as permanently referenced, to be called if not in
* mark-during-store-to-file cycle.
*/
- void setCacheTableReferencedPermanently( sal_uInt16 nFileId, const String& rTabName, size_t nSheets );
+ void setCacheTableReferencedPermanently( sal_uInt16 nFileId, const ::rtl::OUString& rTabName, size_t nSheets );
private:
struct ReferencedStatus
@@ -306,7 +308,7 @@ private:
public:
ScExternalRefCache::TableTypeRef getCacheTable(sal_uInt16 nFileId, size_t nTabIndex) const;
- ScExternalRefCache::TableTypeRef getCacheTable(sal_uInt16 nFileId, const String& rTabName, bool bCreateNew, size_t* pnIndex);
+ ScExternalRefCache::TableTypeRef getCacheTable(sal_uInt16 nFileId, const ::rtl::OUString& rTabName, bool bCreateNew, size_t* pnIndex);
void clearCache(sal_uInt16 nFileId);
@@ -321,9 +323,9 @@ private:
}
};
- typedef ::boost::unordered_map<String, TokenArrayRef, ScStringHashCode> RangeNameMap;
- typedef ::boost::unordered_map<ScRange, TokenArrayRef, RangeHash> RangeArrayMap;
- typedef ::boost::unordered_map<String, String, ScStringHashCode> NamePairMap;
+ typedef ::boost::unordered_map<rtl::OUString, TokenArrayRef, rtl::OUStringHash> RangeNameMap;
+ typedef ::boost::unordered_map<ScRange, TokenArrayRef, RangeHash> RangeArrayMap;
+ typedef ::boost::unordered_map<rtl::OUString, rtl::OUString, rtl::OUStringHash> NamePairMap;
// SUNWS needs a forward declared friend, otherwise types and members
// of the outer class are not accessible.
@@ -423,11 +425,11 @@ public:
/** Source document meta-data container. */
struct SrcFileData
{
- String maFileName; /// original file name as loaded from the file.
- String maRealFileName; /// file name created from the relative name.
- String maRelativeName;
- String maFilterName;
- String maFilterOptions;
+ ::rtl::OUString maFileName; /// original file name as loaded from the file.
+ ::rtl::OUString maRealFileName; /// file name created from the relative name.
+ ::rtl::OUString maRelativeName;
+ ::rtl::OUString maFilterName;
+ ::rtl::OUString maFilterOptions;
void maybeCreateRealFileName(const String& rOwnDocName);
};
@@ -436,7 +438,7 @@ public:
explicit ScExternalRefManager(ScDocument* pDoc);
virtual ~ScExternalRefManager();
- virtual String getCacheTableName(sal_uInt16 nFileId, size_t nTabIndex) const;
+ virtual ::rtl::OUString getCacheTableName(sal_uInt16 nFileId, size_t nTabIndex) const;
/**
* Get a cache table instance for specified table and table index. Unlike
@@ -470,7 +472,7 @@ public:
*
* @return shared_ptr to the cache table instance
*/
- ScExternalRefCache::TableTypeRef getCacheTable(sal_uInt16 nFileId, const String& rTabName, bool bCreateNew, size_t* pnIndex = 0);
+ ScExternalRefCache::TableTypeRef getCacheTable(sal_uInt16 nFileId, const ::rtl::OUString& rTabName, bool bCreateNew, size_t* pnIndex = 0);
/** Returns a vector containing all (real) table names and cache tables of
the specified file.
@@ -495,7 +497,8 @@ public:
* -1 if nFileId or rStartTabName not found
* 0 if rEndTabName not found
*/
- SCsTAB getCachedTabSpan( sal_uInt16 nFileId, const String& rStartTabName, const String& rEndTabName ) const;
+ SCsTAB getCachedTabSpan(
+ sal_uInt16 nFileId, const ::rtl::OUString& rStartTabName, const ::rtl::OUString& rEndTabName) const;
/**
* Get all unique number format indices that are used in the cache tables.
@@ -505,7 +508,7 @@ public:
*/
void getAllCachedNumberFormats(::std::vector<sal_uInt32>& rNumFmts) const;
- bool hasCacheTable(sal_uInt16 nFileId, const String& rTabName) const;
+ bool hasCacheTable(sal_uInt16 nFileId, const ::rtl::OUString& rTabName) const;
size_t getCacheTableCount(sal_uInt16 nFileId) const;
sal_uInt16 getExternalFileCount() const;
@@ -522,14 +525,14 @@ public:
* Set a table as referenced, used only during store-to-file.
* @returns <TRUE/> if ALL tables of ALL external documents are marked.
*/
- bool setCacheTableReferenced( sal_uInt16 nFileId, const String& rTabName, size_t nSheets );
+ bool setCacheTableReferenced( sal_uInt16 nFileId, const ::rtl::OUString& rTabName, size_t nSheets );
void setAllCacheTableReferencedStati( bool bReferenced );
/**
* Set a table as permanently referenced, to be called if not in
* mark-during-store-to-file cycle.
*/
- void setCacheTableReferencedPermanently( sal_uInt16 nFileId, const String& rTabName, size_t nSheets );
+ void setCacheTableReferencedPermanently( sal_uInt16 nFileId, const ::rtl::OUString& rTabName, size_t nSheets );
/**
* @returns <TRUE/> if setAllCacheTableReferencedStati(false) was called,
@@ -537,10 +540,10 @@ public:
*/
bool isInReferenceMarking() const { return mbInReferenceMarking; }
- void storeRangeNameTokens(sal_uInt16 nFileId, const String& rName, const ScTokenArray& rArray);
+ void storeRangeNameTokens(sal_uInt16 nFileId, const ::rtl::OUString& rName, const ScTokenArray& rArray);
ScExternalRefCache::TokenRef getSingleRefToken(
- sal_uInt16 nFileId, const String& rTabName, const ScAddress& rCell,
+ sal_uInt16 nFileId, const ::rtl::OUString& rTabName, const ScAddress& rCell,
const ScAddress* pCurPos, SCTAB* pTab, ScExternalRefCache::CellFormat* pFmt = NULL);
/**
@@ -557,7 +560,7 @@ public:
* delete the instance returned by this method.</i>
*/
ScExternalRefCache::TokenArrayRef getDoubleRefTokens(
- sal_uInt16 nFileId, const String& rTabName, const ScRange& rRange, const ScAddress* pCurPos);
+ sal_uInt16 nFileId, const ::rtl::OUString& rTabName, const ScRange& rRange, const ScAddress* pCurPos);
/**
* Get an array of tokens corresponding with a specified name in a
@@ -571,10 +574,10 @@ public:
* @return shared_ptr to array of tokens composing the name
*/
ScExternalRefCache::TokenArrayRef getRangeNameTokens(
- sal_uInt16 nFileId, const String& rName, const ScAddress* pCurPos = NULL);
+ sal_uInt16 nFileId, const ::rtl::OUString& rName, const ScAddress* pCurPos = NULL);
- const String& getOwnDocumentName() const;
- bool isOwnDocument(const String& rFile) const;
+ ::rtl::OUString getOwnDocumentName() const;
+ bool isOwnDocument(const ::rtl::OUString& rFile) const;
/**
* Takes a flat file name, and convert it to an absolute URL path. An
@@ -582,8 +585,8 @@ public:
*
* @param rFile file name to convert
*/
- void convertToAbsName(String& rFile) const;
- sal_uInt16 getExternalFileId(const String& rFile);
+ void convertToAbsName(::rtl::OUString& rFile) const;
+ sal_uInt16 getExternalFileId(const ::rtl::OUString& rFile);
/**
* It returns a pointer to the name of the URI associated with a given
@@ -598,16 +601,16 @@ public:
*
* @return const String* external document URI.
*/
- const String* getExternalFileName(sal_uInt16 nFileId, bool bForceOriginal = false);
+ const ::rtl::OUString* getExternalFileName(sal_uInt16 nFileId, bool bForceOriginal = false);
bool hasExternalFile(sal_uInt16 nFileId) const;
- bool hasExternalFile(const String& rFile) const;
+ bool hasExternalFile(const ::rtl::OUString& rFile) const;
const SrcFileData* getExternalFileData(sal_uInt16 nFileId) const;
- const String* getRealTableName(sal_uInt16 nFileId, const String& rTabName) const;
- const String* getRealRangeName(sal_uInt16 nFileId, const String& rRangeName) const;
+ const ::rtl::OUString* getRealTableName(sal_uInt16 nFileId, const ::rtl::OUString& rTabName) const;
+ const ::rtl::OUString* getRealRangeName(sal_uInt16 nFileId, const ::rtl::OUString& rRangeName) const;
void refreshNames(sal_uInt16 nFileId);
void breakLink(sal_uInt16 nFileId);
- void switchSrcFile(sal_uInt16 nFileId, const String& rNewFile, const String& rNewFilter);
+ void switchSrcFile(sal_uInt16 nFileId, const ::rtl::OUString& rNewFile, const ::rtl::OUString& rNewFilter);
/**
* Set a relative file path for the specified file ID. Note that the
@@ -616,7 +619,7 @@ public:
* @param nFileId file ID for an external document
* @param rRelUrl relative URL
*/
- void setRelativeFileName(sal_uInt16 nFileId, const String& rRelUrl);
+ void setRelativeFileName(sal_uInt16 nFileId, const ::rtl::OUString& rRelUrl);
/**
* Set the filter name and options if any for a given source document.
@@ -626,7 +629,7 @@ public:
* @param rFilterName
* @param rOptions
*/
- void setFilterData(sal_uInt16 nFileId, const String& rFilterName, const String& rOptions);
+ void setFilterData(sal_uInt16 nFileId, const ::rtl::OUString& rFilterName, const ::rtl::OUString& rOptions);
void clear();
@@ -640,7 +643,7 @@ public:
* @param rBaseFileUrl Absolute URL of the content.xml fragment of the
* document being exported.
*/
- void resetSrcFileData(const String& rBaseFileUrl);
+ void resetSrcFileData(const ::rtl::OUString& rBaseFileUrl);
/**
* Stop tracking a specific formula cell.
@@ -677,7 +680,7 @@ public:
* Check if the file specified by the path is a legitimate file that
* exists & can be loaded.
*/
- bool isFileLoadable(const String& rFile) const;
+ bool isFileLoadable(const ::rtl::OUString& rFile) const;
private:
ScExternalRefManager();
@@ -708,7 +711,7 @@ private:
* @return range token array
*/
ScExternalRefCache::TokenArrayRef getDoubleRefTokensFromSrcDoc(
- const ScDocument* pSrcDoc, const String& rTabName, ScRange& rRange,
+ const ScDocument* pSrcDoc, const ::rtl::OUString& rTabName, ScRange& rRange,
::std::vector<ScExternalRefCache::SingleRangeData>& rCacheData);
/**
@@ -724,11 +727,11 @@ private:
* @return range name token array
*/
ScExternalRefCache::TokenArrayRef getRangeNameTokensFromSrcDoc(
- sal_uInt16 nFileId, const ScDocument* pSrcDoc, String& rName);
+ sal_uInt16 nFileId, const ScDocument* pSrcDoc, ::rtl::OUString& rName);
const ScDocument* getInMemorySrcDocument(sal_uInt16 nFileId);
const ScDocument* getSrcDocument(sal_uInt16 nFileId);
- SfxObjectShellRef loadSrcDocument(sal_uInt16 nFileId, String& rFilter);
+ SfxObjectShellRef loadSrcDocument(sal_uInt16 nFileId, ::rtl::OUString& rFilter);
void maybeLinkExternalFile(sal_uInt16 nFileId);
diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx
index 2d2959a6b91a..d7227b285614 100644
--- a/sc/inc/tablink.hxx
+++ b/sc/inc/tablink.hxx
@@ -112,6 +112,10 @@ public:
String& rFilter, String& rOptions,
sal_Bool bWithContent, sal_Bool bWithInteraction );
+ static bool GetFilterName( const ::rtl::OUString& rFileName,
+ ::rtl::OUString& rFilter, ::rtl::OUString& rOptions,
+ bool bWithContent, bool bWithInteraction );
+
static void RemoveAppPrefix( String& rFilterName );
};
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 64ba9adf536f..23ba47fe5b7d 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -105,6 +105,7 @@ namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::sheet::TablePageBreakData;
using ::std::set;
+using ::rtl::OUString;
// The constant parameters to CopyBlockFromClip
struct ScCopyBlockFromClipParams
@@ -161,19 +162,26 @@ sal_Bool ScDocument::HasTable( SCTAB nTab ) const
return false;
}
-
-sal_Bool ScDocument::GetName( SCTAB nTab, String& rName ) const
+bool ScDocument::GetName( SCTAB nTab, String& rName ) const
{
if (VALIDTAB(nTab))
if (pTab[nTab])
{
pTab[nTab]->GetName( rName );
- return sal_True;
+ return true;
}
rName.Erase();
return false;
}
+bool ScDocument::GetName( SCTAB nTab, OUString& rName ) const
+{
+ String aTmp;
+ bool bRet = GetName(nTab, aTmp);
+ rName = aTmp;
+ return bRet;
+}
+
sal_Bool ScDocument::SetCodeName( SCTAB nTab, const String& rName )
{
if (VALIDTAB(nTab))
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index fba193fbf88c..e7865a9163af 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -490,7 +490,9 @@ const sal_Unicode* ScRange::Parse_XL_Header(
if (rExternDocName.Len())
{
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- pRefMgr->convertToAbsName( rExternDocName);
+ OUString aTmp = rExternDocName;
+ pRefMgr->convertToAbsName(aTmp);
+ rExternDocName = aTmp;
}
else
{
@@ -948,7 +950,7 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd
ScAddress::ExternalInfo* pExtInfo = NULL, ScRange* pRange = NULL )
{
sal_uInt16 nRes = 0;
- String aDocName; // der pure Dokumentenname
+ OUString aDocName; // der pure Dokumentenname
String aTab;
bool bExtDoc = false;
bool bExtDocInherited = false;
@@ -959,7 +961,9 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd
if (*p == '\'')
{
const sal_Unicode* pStart = p;
- p = lcl_ParseQuotedName(p, aDocName);
+ String aTmp;
+ p = lcl_ParseQuotedName(p, aTmp);
+ aDocName = aTmp;
if (*p++ == SC_COMPILER_FILE_TAB_SEP)
bExtDoc = true;
else
@@ -1094,7 +1098,7 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress& rAdd
// Need document name if inherited.
if (bExtDocInherited)
{
- const String* pFileName = pRefMgr->getExternalFileName( pExtInfo->mnFileId);
+ const OUString* pFileName = pRefMgr->getExternalFileName( pExtInfo->mnFileId);
if (pFileName)
aDocName = *pFileName;
else
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 2cacd81940d1..b554bcffd685 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -931,7 +931,7 @@ struct ConventionOOO_A1 : public Convention_A1
if (bDisplayTabName)
{
String aFile;
- const String* p = pRefMgr->getExternalFileName(nFileId);
+ const OUString* p = pRefMgr->getExternalFileName(nFileId);
if (p)
{
if (bEncodeUrl)
@@ -1440,7 +1440,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
// whole file path with [] because the file name can contain any
// characters.
- const String* pFullName = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pFullName = pRefMgr->getExternalFileName(nFileId);
if (!pFullName)
return;
@@ -1459,7 +1459,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef,
ScExternalRefManager* pRefMgr ) const
{
- const String* pFullName = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pFullName = pRefMgr->getExternalFileName(nFileId);
if (!pFullName)
return;
@@ -1646,7 +1646,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
// whole file path with [] because the file name can contain any
// characters.
- const String* pFullName = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pFullName = pRefMgr->getExternalFileName(nFileId);
if (!pFullName)
return;
@@ -1666,7 +1666,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rRef,
ScExternalRefManager* pRefMgr ) const
{
- const String* pFullName = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pFullName = pRefMgr->getExternalFileName(nFileId);
if (!pFullName)
return;
@@ -2696,7 +2696,7 @@ sal_Bool ScCompiler::IsDoubleReference( const String& rName )
if (aExtInfo.mbExternal)
{
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- const String* pRealTab = pRefMgr->getRealTableName(aExtInfo.mnFileId, aExtInfo.maTabName);
+ const OUString* pRealTab = pRefMgr->getRealTableName(aExtInfo.mnFileId, aExtInfo.maTabName);
aToken.SetExternalDoubleRef(
aExtInfo.mnFileId, pRealTab ? *pRealTab : aExtInfo.maTabName, aRef);
}
@@ -2744,7 +2744,7 @@ sal_Bool ScCompiler::IsSingleReference( const String& rName )
if (aExtInfo.mbExternal)
{
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- const String* pRealTab = pRefMgr->getRealTableName(aExtInfo.mnFileId, aExtInfo.maTabName);
+ const OUString* pRealTab = pRefMgr->getRealTableName(aExtInfo.mnFileId, aExtInfo.maTabName);
aToken.SetExternalSingleRef(
aExtInfo.mnFileId, pRealTab ? *pRealTab : aExtInfo.maTabName, aRef);
}
@@ -2937,14 +2937,16 @@ bool ScCompiler::IsExternalNamedRange( const String& rSymbol )
return false;
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- pRefMgr->convertToAbsName(aFile);
+ OUString aTmp = aFile;
+ pRefMgr->convertToAbsName(aTmp);
+ aFile = aTmp;
sal_uInt16 nFileId = pRefMgr->getExternalFileId(aFile);
if (!pRefMgr->getRangeNameTokens(nFileId, aName).get())
// range name doesn't exist in the source document.
return false;
- const String* pRealName = pRefMgr->getRealRangeName(nFileId, aName);
- aToken.SetExternalName(nFileId, pRealName ? *pRealName : aName);
+ const OUString* pRealName = pRefMgr->getRealRangeName(nFileId, aName);
+ aToken.SetExternalName(nFileId, pRealName ? *pRealName : OUString(aTmp));
pRawToken = aToken.Clone();
return true;
}
@@ -3970,7 +3972,7 @@ sal_Bool ScCompiler::HandleExternalReference(const FormulaToken& _aToken)
case svExternalName:
{
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- const String* pFile = pRefMgr->getExternalFileName(_aToken.GetIndex());
+ const OUString* pFile = pRefMgr->getExternalFileName(_aToken.GetIndex());
if (!pFile)
{
SetError(errNoName);
@@ -4969,8 +4971,8 @@ void ScCompiler::CreateStringFromExternal(rtl::OUStringBuffer& rBuffer, FormulaT
{
case svExternalName:
{
- const String *pStr = pRefMgr->getExternalFileName(t->GetIndex());
- String aFileName = pStr ? *pStr : ScGlobal::GetRscString(STR_NO_NAME_REF);
+ const OUString *pStr = pRefMgr->getExternalFileName(t->GetIndex());
+ OUString aFileName = pStr ? *pStr : OUString(ScGlobal::GetRscString(STR_NO_NAME_REF));
rBuffer.append(pConv->makeExternalNameStr( aFileName, t->GetString()));
}
break;
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 656eff60b8fe..84719748bd99 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -85,6 +85,7 @@ sal_Bool ScInterpreter::bGlobalStackInUse = false;
using namespace formula;
using ::std::auto_ptr;
+using ::rtl::OUString;
//-----------------------------------------------------------------------------
// Functions
@@ -6505,7 +6506,7 @@ ScTokenArray* lcl_CreateExternalRefTokenArray( const ScAddress& rPos, ScDocument
{
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
size_t nSheets = 1;
- const String* pRealTab = pRefMgr->getRealTableName( rExtInfo.mnFileId, rExtInfo.maTabName);
+ const OUString* pRealTab = pRefMgr->getRealTableName( rExtInfo.mnFileId, rExtInfo.maTabName);
ScTokenArray* pTokenArray = new ScTokenArray;
if (pRefAd2)
{
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 5a6c62a42c03..12672f5fe34a 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1450,7 +1450,7 @@ void ScInterpreter::PopExternalSingleRef(ScExternalRefCache::TokenRef& rToken, S
return;
ScExternalRefManager* pRefMgr = pDok->GetExternalRefManager();
- const String* pFile = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pFile = pRefMgr->getExternalFileName(nFileId);
if (!pFile)
{
SetError(errNoName);
@@ -1542,7 +1542,7 @@ void ScInterpreter::GetExternalDoubleRef(
sal_uInt16 nFileId, const String& rTabName, const ScComplexRefData& rData, ScExternalRefCache::TokenArrayRef& rArray)
{
ScExternalRefManager* pRefMgr = pDok->GetExternalRefManager();
- const String* pFile = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pFile = pRefMgr->getExternalFileName(nFileId);
if (!pFile)
{
SetError(errNoName);
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index b73ec5b81c96..d0e5f22f6361 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -800,7 +800,7 @@ static void lcl_appendCellAddress(
if (rExtInfo.mbExternal)
{
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- const String* pFilePath = pRefMgr->getExternalFileName(rExtInfo.mnFileId, true);
+ const OUString* pFilePath = pRefMgr->getExternalFileName(rExtInfo.mnFileId, true);
if (!pFilePath)
return;
@@ -835,7 +835,7 @@ static void lcl_appendCellRangeAddress(
OSL_ENSURE(rExtInfo1.mnFileId == rExtInfo2.mnFileId, "File IDs do not match between 1st and 2nd addresses.");
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- const String* pFilePath = pRefMgr->getExternalFileName(rExtInfo1.mnFileId, true);
+ const OUString* pFilePath = pRefMgr->getExternalFileName(rExtInfo1.mnFileId, true);
if (!pFilePath)
return;
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 9220a46314c7..a3ab112d4525 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -2123,7 +2123,7 @@ void XclExpFmlaCompImpl::ProcessExternalName( const XclExpScToken& rTokData )
// insert the new external name and create the tNameX token
sal_uInt16 nExtSheet, nExtName;
- const String* pFile = rExtRefMgr.getExternalFileName( nFileId );
+ const ::rtl::OUString* pFile = rExtRefMgr.getExternalFileName( nFileId );
if( pFile && mxData->mpLinkMgr->InsertExtName( nExtSheet, nExtName, *pFile, rName, xArray ) )
{
AppendNameXToken( nExtSheet, nExtName, rTokData.mnSpaces );
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index d8b23750839e..14092c71b94f 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -1662,7 +1662,7 @@ private:
void XclExpSupbookBuffer::StoreCell( sal_uInt16 nFileId, const String& rTabName, const ScAddress& rCell )
{
ScExternalRefManager* pRefMgr = GetDoc().GetExternalRefManager();
- const String* pUrl = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pUrl = pRefMgr->getExternalFileName(nFileId);
if (!pUrl)
return;
@@ -1700,7 +1700,7 @@ void XclExpSupbookBuffer::StoreCell( sal_uInt16 nFileId, const String& rTabName,
void XclExpSupbookBuffer::StoreCellRange( sal_uInt16 nFileId, const String& rTabName, const ScRange& rRange )
{
ScExternalRefManager* pRefMgr = GetDoc().GetExternalRefManager();
- const String* pUrl = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pUrl = pRefMgr->getExternalFileName(nFileId);
if (!pUrl)
return;
@@ -1828,7 +1828,7 @@ XclExpXti XclExpSupbookBuffer::GetXti( sal_uInt16 nFileId, const String& rTabNam
{
XclExpXti aXti(0, EXC_NOTAB, EXC_NOTAB);
ScExternalRefManager* pRefMgr = GetDoc().GetExternalRefManager();
- const String* pUrl = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pUrl = pRefMgr->getExternalFileName(nFileId);
if (!pUrl)
return aXti;
diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx
index 621f17f49b42..8db09e997b96 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -759,6 +759,16 @@ void XclImpUrlHelper::DecodeUrl(
OSL_ENSURE( !aTabName.Len(), "XclImpUrlHelper::DecodeUrl - sheet name ignored" );
}
+void XclImpUrlHelper::DecodeUrl(
+ ::rtl::OUString& rUrl, bool& rbSameWb, const XclImpRoot& rRoot, const ::rtl::OUString& rEncodedUrl )
+{
+ String aTabName;
+ String aUrl;
+ DecodeUrl( aUrl, aTabName, rbSameWb, rRoot, rEncodedUrl );
+ rUrl = aUrl;
+ OSL_ENSURE( !aTabName.Len(), "XclImpUrlHelper::DecodeUrl - sheet name ignored" );
+}
+
bool XclImpUrlHelper::DecodeLink( String& rApplic, String& rTopic, const String rEncUrl )
{
xub_StrLen nPos = rEncUrl.Search( EXC_DDE_DELIM );
diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx
index 90b9d8c88c50..3726deef0981 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -276,6 +276,12 @@ public:
const XclImpRoot& rRoot,
const String& rEncodedUrl );
+ static void DecodeUrl(
+ ::rtl::OUString& rUrl,
+ bool& rbSameWb,
+ const XclImpRoot& rRoot,
+ const ::rtl::OUString& rEncodedUrl );
+
/** Decodes the passed URL to OLE or DDE link components.
@descr For DDE links: Decodes to application name and topic.
For OLE object links: Decodes to class name and document URL.
diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
index 140bc04d9edf..5c8aac38328d 100644
--- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
@@ -168,7 +168,7 @@ sal_Bool XclImpChangeTrack::Read3DTabRefInfo( SCTAB& rFirstTab, SCTAB& rLastTab,
// external ref - read doc and tab name and find sc tab num
// - URL
String aEncUrl( pStrm->ReadUniString() );
- String aUrl;
+ ::rtl::OUString aUrl;
bool bSelf;
XclImpUrlHelper::DecodeUrl( aUrl, bSelf, GetRoot(), aEncUrl );
pStrm->Ignore( 1 );
diff --git a/sc/source/filter/xml/XMLTableSourceContext.cxx b/sc/source/filter/xml/XMLTableSourceContext.cxx
index 303b4eb684c2..5febeaf6097d 100644
--- a/sc/source/filter/xml/XMLTableSourceContext.cxx
+++ b/sc/source/filter/xml/XMLTableSourceContext.cxx
@@ -121,7 +121,7 @@ void ScXMLTableSourceContext::EndElement()
if (pDoc->RenameTab( static_cast<SCTAB>(GetScImport().GetTables().GetCurrentSheet()),
GetScImport().GetTables().GetCurrentSheetName(), false, sal_True))
{
- String aFileString(sLink);
+ String aFileString(sLink);
String aFilterString(sFilterName);
String aOptString(sFilterOptions);
String aSheetString(sTableName);
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index cf906833ed4f..4bdd0e739525 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3818,7 +3818,7 @@ void ScXMLExport::WriteExternalRefCaches()
sal_uInt16 nCount = pRefMgr->getExternalFileCount();
for (sal_uInt16 nFileId = 0; nFileId < nCount; ++nFileId)
{
- const String* pUrl = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pUrl = pRefMgr->getExternalFileName(nFileId);
if (!pUrl)
continue;
@@ -3848,17 +3848,17 @@ void ScXMLExport::WriteExternalRefCaches()
const ScExternalRefManager::SrcFileData* pExtFileData = pRefMgr->getExternalFileData(nFileId);
if (pExtFileData)
{
- String aRelUrl;
- if (pExtFileData->maRelativeName.Len())
+ OUString aRelUrl;
+ if (!pExtFileData->maRelativeName.isEmpty())
aRelUrl = pExtFileData->maRelativeName;
else
aRelUrl = GetRelativeReference(pExtFileData->maRelativeName);
AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE);
AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aRelUrl);
AddAttribute(XML_NAMESPACE_TABLE, XML_TABLE_NAME, *itr);
- if (pExtFileData->maFilterName.Len())
+ if (!pExtFileData->maFilterName.isEmpty())
AddAttribute(XML_NAMESPACE_TABLE, XML_FILTER_NAME, pExtFileData->maFilterName);
- if (pExtFileData->maFilterOptions.Len())
+ if (!pExtFileData->maFilterOptions.isEmpty())
AddAttribute(XML_NAMESPACE_TABLE, XML_FILTER_OPTIONS, pExtFileData->maFilterOptions);
AddAttribute(XML_NAMESPACE_TABLE, XML_MODE, XML_COPY_RESULTS_ONLY);
}
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index d8ed36826a91..72aa2cf16ca5 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -89,7 +89,7 @@ namespace {
class TabNameSearchPredicate : public unary_function<ScExternalRefCache::TableName, bool>
{
public:
- explicit TabNameSearchPredicate(const String& rSearchName) :
+ explicit TabNameSearchPredicate(const OUString& rSearchName) :
maSearchName(ScGlobal::pCharClass->upper(rSearchName))
{
}
@@ -97,28 +97,28 @@ public:
bool operator()(const ScExternalRefCache::TableName& rTabNameSet) const
{
// Ok, I'm doing case insensitive search here.
- return rTabNameSet.maUpperName.Equals(maSearchName);
+ return rTabNameSet.maUpperName.equals(maSearchName);
}
private:
- String maSearchName;
+ OUString maSearchName;
};
class FindSrcFileByName : public unary_function<ScExternalRefManager::SrcFileData, bool>
{
public:
- FindSrcFileByName(const String& rMatchName) :
+ FindSrcFileByName(const OUString& rMatchName) :
mrMatchName(rMatchName)
{
}
bool operator()(const ScExternalRefManager::SrcFileData& rSrcData) const
{
- return rSrcData.maFileName.Equals(mrMatchName);
+ return rSrcData.maFileName.equals(mrMatchName);
}
private:
- const String& mrMatchName;
+ const OUString& mrMatchName;
};
class NotifyLinkListener : public unary_function<ScExternalRefManager::LinkListener*, void>
@@ -485,7 +485,7 @@ ScExternalRefCache::TokenRef ScExternalRefCache::Table::getEmptyOrNullToken(
// ----------------------------------------------------------------------------
-ScExternalRefCache::TableName::TableName(const String& rUpper, const String& rReal) :
+ScExternalRefCache::TableName::TableName(const OUString& rUpper, const OUString& rReal) :
maUpperName(rUpper), maRealName(rReal)
{
}
@@ -506,7 +506,7 @@ ScExternalRefCache::~ScExternalRefCache()
{
}
-const String* ScExternalRefCache::getRealTableName(sal_uInt16 nFileId, const String& rTabName) const
+const OUString* ScExternalRefCache::getRealTableName(sal_uInt16 nFileId, const OUString& rTabName) const
{
DocDataType::const_iterator itrDoc = maDocs.find(nFileId);
if (itrDoc == maDocs.end())
@@ -527,7 +527,7 @@ const String* ScExternalRefCache::getRealTableName(sal_uInt16 nFileId, const Str
return &rDoc.maTableNames[itrTabId->second].maRealName;
}
-const String* ScExternalRefCache::getRealRangeName(sal_uInt16 nFileId, const String& rRangeName) const
+const OUString* ScExternalRefCache::getRealRangeName(sal_uInt16 nFileId, const OUString& rRangeName) const
{
DocDataType::const_iterator itrDoc = maDocs.find(nFileId);
if (itrDoc == maDocs.end())
@@ -547,7 +547,7 @@ const String* ScExternalRefCache::getRealRangeName(sal_uInt16 nFileId, const Str
}
ScExternalRefCache::TokenRef ScExternalRefCache::getCellData(
- sal_uInt16 nFileId, const String& rTabName, SCCOL nCol, SCROW nRow, sal_uInt32* pnFmtIndex)
+ sal_uInt16 nFileId, const OUString& rTabName, SCCOL nCol, SCROW nRow, sal_uInt32* pnFmtIndex)
{
DocDataType::const_iterator itrDoc = maDocs.find(nFileId);
if (itrDoc == maDocs.end())
@@ -576,7 +576,7 @@ ScExternalRefCache::TokenRef ScExternalRefCache::getCellData(
}
ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
- sal_uInt16 nFileId, const String& rTabName, const ScRange& rRange)
+ sal_uInt16 nFileId, const OUString& rTabName, const ScRange& rRange)
{
DocDataType::iterator itrDoc = maDocs.find(nFileId);
if (itrDoc == maDocs.end())
@@ -686,7 +686,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getCellRangeData(
return pArray;
}
-ScExternalRefCache::TokenArrayRef ScExternalRefCache::getRangeNameTokens(sal_uInt16 nFileId, const String& rName)
+ScExternalRefCache::TokenArrayRef ScExternalRefCache::getRangeNameTokens(sal_uInt16 nFileId, const OUString& rName)
{
DocItem* pDoc = getDocItem(nFileId);
if (!pDoc)
@@ -701,7 +701,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefCache::getRangeNameTokens(sal_uIn
return itr->second;
}
-void ScExternalRefCache::setRangeNameTokens(sal_uInt16 nFileId, const String& rName, TokenArrayRef pArray)
+void ScExternalRefCache::setRangeNameTokens(sal_uInt16 nFileId, const OUString& rName, TokenArrayRef pArray)
{
DocItem* pDoc = getDocItem(nFileId);
if (!pDoc)
@@ -713,7 +713,7 @@ void ScExternalRefCache::setRangeNameTokens(sal_uInt16 nFileId, const String& rN
pDoc->maRealRangeNameMap.insert(NamePairMap::value_type(aUpperName, rName));
}
-void ScExternalRefCache::setCellData(sal_uInt16 nFileId, const String& rTabName, SCCOL nCol, SCROW nRow,
+void ScExternalRefCache::setCellData(sal_uInt16 nFileId, const OUString& rTabName, SCCOL nCol, SCROW nRow,
TokenRef pToken, sal_uInt32 nFmtIndex)
{
if (!isDocInitialized(nFileId))
@@ -827,7 +827,7 @@ static bool lcl_getTableDataIndex(const ScExternalRefCache::TableNameIndexMap& r
return true;
}
-void ScExternalRefCache::initializeDoc(sal_uInt16 nFileId, const vector<String>& rTabNames)
+void ScExternalRefCache::initializeDoc(sal_uInt16 nFileId, const vector<OUString>& rTabNames)
{
DocItem* pDoc = getDocItem(nFileId);
if (!pDoc)
@@ -840,7 +840,7 @@ void ScExternalRefCache::initializeDoc(sal_uInt16 nFileId, const vector<String>&
// when loading cached data from, say, Excel XCT/CRN records.
vector<TableName> aNewTabNames;
aNewTabNames.reserve(n);
- for (vector<String>::const_iterator itr = rTabNames.begin(), itrEnd = rTabNames.end();
+ for (vector<OUString>::const_iterator itr = rTabNames.begin(), itrEnd = rTabNames.end();
itr != itrEnd; ++itr)
{
TableName aNameItem(ScGlobal::pCharClass->upper(*itr), *itr);
@@ -892,7 +892,7 @@ void ScExternalRefCache::getAllTableNames(sal_uInt16 nFileId, vector<OUString>&
rTabNames.push_back(itr->maRealName);
}
-SCsTAB ScExternalRefCache::getTabSpan( sal_uInt16 nFileId, const String& rStartTabName, const String& rEndTabName ) const
+SCsTAB ScExternalRefCache::getTabSpan( sal_uInt16 nFileId, const OUString& rStartTabName, const OUString& rEndTabName ) const
{
DocItem* pDoc = getDocItem(nFileId);
if (!pDoc)
@@ -943,7 +943,7 @@ void ScExternalRefCache::getAllNumberFormats(vector<sal_uInt32>& rNumFmts) const
rNumFmts.swap(aNumFmts);
}
-bool ScExternalRefCache::hasCacheTable(sal_uInt16 nFileId, const String& rTabName) const
+bool ScExternalRefCache::hasCacheTable(sal_uInt16 nFileId, const OUString& rTabName) const
{
DocItem* pDoc = getDocItem(nFileId);
if (!pDoc)
@@ -979,7 +979,7 @@ bool ScExternalRefCache::setCacheDocReferenced( sal_uInt16 nFileId )
return areAllCacheTablesReferenced();
}
-bool ScExternalRefCache::setCacheTableReferenced( sal_uInt16 nFileId, const String& rTabName, size_t nSheets, bool bPermanent )
+bool ScExternalRefCache::setCacheTableReferenced( sal_uInt16 nFileId, const OUString& rTabName, size_t nSheets, bool bPermanent )
{
DocItem* pDoc = getDocItem(nFileId);
if (pDoc)
@@ -1010,7 +1010,7 @@ bool ScExternalRefCache::setCacheTableReferenced( sal_uInt16 nFileId, const Stri
return areAllCacheTablesReferenced();
}
-void ScExternalRefCache::setCacheTableReferencedPermanently( sal_uInt16 nFileId, const String& rTabName, size_t nSheets )
+void ScExternalRefCache::setCacheTableReferencedPermanently( sal_uInt16 nFileId, const OUString& rTabName, size_t nSheets )
{
DocItem* pDoc = getDocItem(nFileId);
if (pDoc)
@@ -1172,7 +1172,7 @@ ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nF
return pDoc->maTables[nTabIndex];
}
-ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nFileId, const String& rTabName, bool bCreateNew, size_t* pnIndex)
+ScExternalRefCache::TableTypeRef ScExternalRefCache::getCacheTable(sal_uInt16 nFileId, const OUString& rTabName, bool bCreateNew, size_t* pnIndex)
{
// In API, the index is transported as cached sheet ID of type sal_Int32 in
// sheet::SingleReference.Sheet or sheet::ComplexReference.Reference1.Sheet
@@ -1276,11 +1276,11 @@ void ScExternalRefLink::Closed()
if (!pMgr->isFileLoadable(aFile))
return ERROR_GENERAL;
- const String* pCurFile = pMgr->getExternalFileName(mnFileId);
+ const OUString* pCurFile = pMgr->getExternalFileName(mnFileId);
if (!pCurFile)
return ERROR_GENERAL;
- if (pCurFile->Equals(aFile))
+ if (pCurFile->equals(aFile))
{
// Refresh the current source document.
pMgr->refreshNames(mnFileId);
@@ -1521,7 +1521,7 @@ ScExternalRefManager::~ScExternalRefManager()
clear();
}
-String ScExternalRefManager::getCacheTableName(sal_uInt16 nFileId, size_t nTabIndex) const
+OUString ScExternalRefManager::getCacheTableName(sal_uInt16 nFileId, size_t nTabIndex) const
{
return maRefCache.getTableName(nFileId, nTabIndex);
}
@@ -1531,7 +1531,8 @@ ScExternalRefCache::TableTypeRef ScExternalRefManager::getCacheTable(sal_uInt16
return maRefCache.getCacheTable(nFileId, nTabIndex);
}
-ScExternalRefCache::TableTypeRef ScExternalRefManager::getCacheTable(sal_uInt16 nFileId, const String& rTabName, bool bCreateNew, size_t* pnIndex)
+ScExternalRefCache::TableTypeRef ScExternalRefManager::getCacheTable(
+ sal_uInt16 nFileId, const OUString& rTabName, bool bCreateNew, size_t* pnIndex)
{
return maRefCache.getCacheTable(nFileId, rTabName, bCreateNew, pnIndex);
}
@@ -1569,7 +1570,7 @@ void ScExternalRefManager::getAllCachedTableNames(sal_uInt16 nFileId, vector<OUS
maRefCache.getAllTableNames(nFileId, rTabNames);
}
-SCsTAB ScExternalRefManager::getCachedTabSpan( sal_uInt16 nFileId, const String& rStartTabName, const String& rEndTabName ) const
+SCsTAB ScExternalRefManager::getCachedTabSpan( sal_uInt16 nFileId, const OUString& rStartTabName, const OUString& rEndTabName ) const
{
return maRefCache.getTabSpan( nFileId, rStartTabName, rEndTabName);
}
@@ -1579,7 +1580,7 @@ void ScExternalRefManager::getAllCachedNumberFormats(vector<sal_uInt32>& rNumFmt
maRefCache.getAllNumberFormats(rNumFmts);
}
-bool ScExternalRefManager::hasCacheTable(sal_uInt16 nFileId, const String& rTabName) const
+bool ScExternalRefManager::hasCacheTable(sal_uInt16 nFileId, const OUString& rTabName) const
{
return maRefCache.hasCacheTable(nFileId, rTabName);
}
@@ -1627,12 +1628,12 @@ bool ScExternalRefManager::markUsedExternalRefCells()
return false;
}
-bool ScExternalRefManager::setCacheTableReferenced( sal_uInt16 nFileId, const String& rTabName, size_t nSheets )
+bool ScExternalRefManager::setCacheTableReferenced( sal_uInt16 nFileId, const OUString& rTabName, size_t nSheets )
{
return maRefCache.setCacheTableReferenced( nFileId, rTabName, nSheets, false);
}
-void ScExternalRefManager::setCacheTableReferencedPermanently( sal_uInt16 nFileId, const String& rTabName, size_t nSheets )
+void ScExternalRefManager::setCacheTableReferencedPermanently( sal_uInt16 nFileId, const OUString& rTabName, size_t nSheets )
{
if (isInReferenceMarking())
// Do all maintenance work.
@@ -1648,7 +1649,7 @@ void ScExternalRefManager::setAllCacheTableReferencedStati( bool bReferenced )
maRefCache.setAllCacheTableReferencedStati( bReferenced );
}
-void ScExternalRefManager::storeRangeNameTokens(sal_uInt16 nFileId, const String& rName, const ScTokenArray& rArray)
+void ScExternalRefManager::storeRangeNameTokens(sal_uInt16 nFileId, const OUString& rName, const ScTokenArray& rArray)
{
ScExternalRefCache::TokenArrayRef pArray(rArray.Clone());
maRefCache.setRangeNameTokens(nFileId, rName, pArray);
@@ -1735,11 +1736,11 @@ void initDocInCache(ScExternalRefCache& rRefCache, const ScDocument* pSrcDoc, sa
if (nTabCount)
{
// Populate the cache with all table names in the source document.
- vector<String> aTabNames;
+ vector<OUString> aTabNames;
aTabNames.reserve(nTabCount);
for (SCTAB i = 0; i < nTabCount; ++i)
{
- String aName;
+ OUString aName;
pSrcDoc->GetName(i, aName);
aTabNames.push_back(aName);
}
@@ -1750,7 +1751,7 @@ void initDocInCache(ScExternalRefCache& rRefCache, const ScDocument* pSrcDoc, sa
}
ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
- sal_uInt16 nFileId, const String& rTabName, const ScAddress& rCell,
+ sal_uInt16 nFileId, const OUString& rTabName, const ScAddress& rCell,
const ScAddress* pCurPos, SCTAB* pTab, ScExternalRefCache::CellFormat* pFmt)
{
if (pCurPos)
@@ -1843,7 +1844,7 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefToken(
}
ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokens(
- sal_uInt16 nFileId, const String& rTabName, const ScRange& rRange, const ScAddress* pCurPos)
+ sal_uInt16 nFileId, const OUString& rTabName, const ScRange& rRange, const ScAddress* pCurPos)
{
if (pCurPos)
insertRefCell(nFileId, *pCurPos);
@@ -1888,14 +1889,15 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokens(
return pArray;
}
-ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokens(sal_uInt16 nFileId, const String& rName, const ScAddress* pCurPos)
+ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokens(
+ sal_uInt16 nFileId, const OUString& rName, const ScAddress* pCurPos)
{
if (pCurPos)
insertRefCell(nFileId, *pCurPos);
maybeLinkExternalFile(nFileId);
- String aName = rName; // make a copy to have the casing corrected.
+ OUString aName = rName; // make a copy to have the casing corrected.
const ScDocument* pSrcDoc = getInMemorySrcDocument(nFileId);
if (pSrcDoc)
{
@@ -2010,7 +2012,7 @@ ScExternalRefCache::TokenRef ScExternalRefManager::getSingleRefTokenFromSrcDoc(
}
ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSrcDoc(
- const ScDocument* pSrcDoc, const String& rTabName, ScRange& rRange,
+ const ScDocument* pSrcDoc, const OUString& rTabName, ScRange& rRange,
vector<ScExternalRefCache::SingleRangeData>& rCacheData)
{
ScExternalRefCache::TokenArrayRef pArray;
@@ -2034,7 +2036,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSr
for (SCTAB i = 1; i < nTabSpan + 1; ++i)
{
- String aTabName;
+ OUString aTabName;
if (!pSrcDoc->GetName(nTab1 + 1, aTabName))
// source document doesn't have any table by the specified name.
break;
@@ -2053,7 +2055,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSr
}
ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokensFromSrcDoc(
- sal_uInt16 nFileId, const ScDocument* pSrcDoc, String& rName)
+ sal_uInt16 nFileId, const ScDocument* pSrcDoc, OUString& rName)
{
ScRangeName* pExtNames = pSrcDoc->GetRangeName();
String aUpperName = ScGlobal::pCharClass->upper(rName);
@@ -2077,7 +2079,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokensFromSr
case svSingleRef:
{
const ScSingleRefData& rRef = static_cast<const ScToken*>(pToken)->GetSingleRef();
- String aTabName;
+ OUString aTabName;
pSrcDoc->GetName(rRef.nTab, aTabName);
ScExternalSingleRefToken aNewToken(nFileId, aTabName, static_cast<const ScToken*>(pToken)->GetSingleRef());
pNew->AddToken(aNewToken);
@@ -2087,7 +2089,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokensFromSr
case svDoubleRef:
{
const ScSingleRefData& rRef = static_cast<const ScToken*>(pToken)->GetSingleRef();
- String aTabName;
+ OUString aTabName;
pSrcDoc->GetName(rRef.nTab, aTabName);
ScExternalDoubleRefToken aNewToken(nFileId, aTabName, static_cast<const ScToken*>(pToken)->GetDoubleRef());
pNew->AddToken(aNewToken);
@@ -2108,7 +2110,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getRangeNameTokensFromSr
const ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
{
- const String* pFileName = getExternalFileName(nFileId);
+ const OUString* pFileName = getExternalFileName(nFileId);
if (!pFileName)
return NULL;
@@ -2120,9 +2122,9 @@ const ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileI
SfxMedium* pMedium = pShell->GetMedium();
if (pMedium)
{
- String aName = pMedium->GetName();
+ OUString aName = pMedium->GetName();
// TODO: We should make the case sensitivity platform dependent.
- if (pFileName->EqualsIgnoreCaseAscii(aName))
+ if (pFileName->equalsIgnoreAsciiCase(aName))
{
// Found !
pSrcDoc = pShell->GetDocument();
@@ -2153,12 +2155,12 @@ const ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
return static_cast<ScDocShell*>(p)->GetDocument();
}
- const String* pFile = getExternalFileName(nFileId);
+ const OUString* pFile = getExternalFileName(nFileId);
if (!pFile)
// no file name associated with this ID.
return NULL;
- String aFilter;
+ OUString aFilter;
SrcShell aSrcDoc;
aSrcDoc.maShell = loadSrcDocument(nFileId, aFilter);
if (!aSrcDoc.maShell.Is())
@@ -2180,7 +2182,7 @@ const ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
return pSrcDoc;
}
-SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, String& rFilter)
+SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUString& rFilter)
{
const SrcFileData* pFileData = getExternalFileData(nFileId);
if (!pFileData)
@@ -2190,36 +2192,36 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, Stri
// path. If the referenced document is not there, simply exit. The
// original file name should be used only when the relative path is not
// given.
- String aFile = pFileData->maFileName;
+ OUString aFile = pFileData->maFileName;
maybeCreateRealFileName(nFileId);
- if (pFileData->maRealFileName.Len())
+ if (!pFileData->maRealFileName.isEmpty())
aFile = pFileData->maRealFileName;
if (!isFileLoadable(aFile))
return NULL;
- String aOptions( pFileData->maFilterOptions );
+ OUString aOptions = pFileData->maFilterOptions;
ScDocumentLoader::GetFilterName(aFile, rFilter, aOptions, true, false);
const SfxFilter* pFilter = ScDocShell::Factory().GetFilterContainer()->GetFilter4FilterName(rFilter);
- if (!pFileData->maRelativeName.Len())
+ if (pFileData->maRelativeName.isEmpty())
{
// Generate a relative file path.
INetURLObject aBaseURL(getOwnDocumentName());
aBaseURL.insertName(OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")));
- String aStr = URIHelper::simpleNormalizedMakeRelative(
+ OUString aStr = URIHelper::simpleNormalizedMakeRelative(
aBaseURL.GetMainURL(INetURLObject::NO_DECODE), aFile);
setRelativeFileName(nFileId, aStr);
}
SfxItemSet* pSet = new SfxAllItemSet(SFX_APP()->GetPool());
- if (aOptions.Len())
+ if (!aOptions.isEmpty())
pSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, aOptions));
// make medium hidden to prevent assertion from progress bar
- pSet->Put( SfxBoolItem( SID_HIDDEN, sal_True ) );
+ pSet->Put( SfxBoolItem(SID_HIDDEN, true) );
auto_ptr<SfxMedium> pMedium(new SfxMedium(aFile, STREAM_STD_READ, false, pFilter, pSet));
if (pMedium->GetError() != ERRCODE_NONE)
@@ -2250,17 +2252,17 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, Stri
pNewShell->DoLoad(pMedium.release());
// with UseInteractionHandler, options may be set by dialog during DoLoad
- String aNew = ScDocumentLoader::GetOptions(*pNewShell->GetMedium());
- if (aNew.Len() && aNew != aOptions)
+ OUString aNew = ScDocumentLoader::GetOptions(*pNewShell->GetMedium());
+ if (!aNew.isEmpty() && aNew != aOptions)
aOptions = aNew;
setFilterData(nFileId, rFilter, aOptions); // update the filter data, including the new options
return aRef;
}
-bool ScExternalRefManager::isFileLoadable(const String& rFile) const
+bool ScExternalRefManager::isFileLoadable(const OUString& rFile) const
{
- if (!rFile.Len())
+ if (rFile.isEmpty())
return false;
if (isOwnDocument(rFile))
@@ -2279,16 +2281,17 @@ void ScExternalRefManager::maybeLinkExternalFile(sal_uInt16 nFileId)
return;
// Source document not linked yet. Link it now.
- const String* pFileName = getExternalFileName(nFileId);
+ const OUString* pFileName = getExternalFileName(nFileId);
if (!pFileName)
return;
- String aFilter, aOptions;
+ OUString aFilter, aOptions;
ScDocumentLoader::GetFilterName(*pFileName, aFilter, aOptions, true, false);
sfx2::LinkManager* pLinkMgr = mpDoc->GetLinkManager();
ScExternalRefLink* pLink = new ScExternalRefLink(mpDoc, nFileId, aFilter);
OSL_ENSURE(pFileName, "ScExternalRefManager::insertExternalFileLink: file name pointer is NULL");
- pLinkMgr->InsertFileLink(*pLink, OBJECT_CLIENT_FILE, *pFileName, &aFilter);
+ String aTmp = aFilter;
+ pLinkMgr->InsertFileLink(*pLink, OBJECT_CLIENT_FILE, *pFileName, &aTmp);
pLink->SetDoReferesh(false);
pLink->Update();
@@ -2299,16 +2302,16 @@ void ScExternalRefManager::maybeLinkExternalFile(sal_uInt16 nFileId)
void ScExternalRefManager::SrcFileData::maybeCreateRealFileName(const String& rOwnDocName)
{
- if (!maRelativeName.Len())
+ if (maRelativeName.isEmpty())
// No relative path given. Nothing to do.
return;
- if (maRealFileName.Len())
+ if (!maRealFileName.isEmpty())
// Real file name already created. Nothing to do.
return;
// Formulate the absolute file path from the relative path.
- const String& rRelPath = maRelativeName;
+ const OUString& rRelPath = maRelativeName;
INetURLObject aBaseURL(rOwnDocName);
aBaseURL.insertName(OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")));
bool bWasAbs = false;
@@ -2323,32 +2326,32 @@ void ScExternalRefManager::maybeCreateRealFileName(sal_uInt16 nFileId)
maSrcFiles[nFileId].maybeCreateRealFileName(getOwnDocumentName());
}
-const String& ScExternalRefManager::getOwnDocumentName() const
+OUString ScExternalRefManager::getOwnDocumentName() const
{
SfxObjectShell* pShell = mpDoc->GetDocumentShell();
if (!pShell)
// This should not happen!
- return EMPTY_STRING;
+ return OUString();
SfxMedium* pMed = pShell->GetMedium();
if (!pMed)
- return EMPTY_STRING;
+ return OUString();
return pMed->GetName();
}
-bool ScExternalRefManager::isOwnDocument(const String& rFile) const
+bool ScExternalRefManager::isOwnDocument(const OUString& rFile) const
{
- return getOwnDocumentName().Equals(rFile);
+ return getOwnDocumentName().equals(rFile);
}
-void ScExternalRefManager::convertToAbsName(String& rFile) const
+void ScExternalRefManager::convertToAbsName(OUString& rFile) const
{
SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
rFile = ScGlobal::GetAbsDocName(rFile, pDocShell);
}
-sal_uInt16 ScExternalRefManager::getExternalFileId(const String& rFile)
+sal_uInt16 ScExternalRefManager::getExternalFileId(const OUString& rFile)
{
vector<SrcFileData>::const_iterator itrBeg = maSrcFiles.begin(), itrEnd = maSrcFiles.end();
vector<SrcFileData>::const_iterator itr = find_if(itrBeg, itrEnd, FindSrcFileByName(rFile));
@@ -2364,7 +2367,7 @@ sal_uInt16 ScExternalRefManager::getExternalFileId(const String& rFile)
return static_cast<sal_uInt16>(maSrcFiles.size() - 1);
}
-const String* ScExternalRefManager::getExternalFileName(sal_uInt16 nFileId, bool bForceOriginal)
+const OUString* ScExternalRefManager::getExternalFileName(sal_uInt16 nFileId, bool bForceOriginal)
{
if (nFileId >= maSrcFiles.size())
return NULL;
@@ -2374,10 +2377,10 @@ const String* ScExternalRefManager::getExternalFileName(sal_uInt16 nFileId, bool
maybeCreateRealFileName(nFileId);
- if (maSrcFiles[nFileId].maRealFileName.Len())
+ if (!maSrcFiles[nFileId].maRealFileName.isEmpty())
return &maSrcFiles[nFileId].maRealFileName;
- else
- return &maSrcFiles[nFileId].maFileName;
+
+ return &maSrcFiles[nFileId].maFileName;
}
bool ScExternalRefManager::hasExternalFile(sal_uInt16 nFileId) const
@@ -2385,7 +2388,7 @@ bool ScExternalRefManager::hasExternalFile(sal_uInt16 nFileId) const
return nFileId < maSrcFiles.size();
}
-bool ScExternalRefManager::hasExternalFile(const String& rFile) const
+bool ScExternalRefManager::hasExternalFile(const OUString& rFile) const
{
vector<SrcFileData>::const_iterator itrBeg = maSrcFiles.begin(), itrEnd = maSrcFiles.end();
vector<SrcFileData>::const_iterator itr = find_if(itrBeg, itrEnd, FindSrcFileByName(rFile));
@@ -2400,12 +2403,12 @@ const ScExternalRefManager::SrcFileData* ScExternalRefManager::getExternalFileDa
return &maSrcFiles[nFileId];
}
-const String* ScExternalRefManager::getRealTableName(sal_uInt16 nFileId, const String& rTabName) const
+const OUString* ScExternalRefManager::getRealTableName(sal_uInt16 nFileId, const OUString& rTabName) const
{
return maRefCache.getRealTableName(nFileId, rTabName);
}
-const String* ScExternalRefManager::getRealRangeName(sal_uInt16 nFileId, const String& rRangeName) const
+const OUString* ScExternalRefManager::getRealRangeName(sal_uInt16 nFileId, const OUString& rRangeName) const
{
return maRefCache.getRealRangeName(nFileId, rRangeName);
}
@@ -2478,28 +2481,28 @@ void ScExternalRefManager::breakLink(sal_uInt16 nFileId)
notifyAllLinkListeners(nFileId, LINK_BROKEN);
}
-void ScExternalRefManager::switchSrcFile(sal_uInt16 nFileId, const String& rNewFile, const String& rNewFilter)
+void ScExternalRefManager::switchSrcFile(sal_uInt16 nFileId, const OUString& rNewFile, const OUString& rNewFilter)
{
maSrcFiles[nFileId].maFileName = rNewFile;
- maSrcFiles[nFileId].maRelativeName.Erase();
- maSrcFiles[nFileId].maRealFileName.Erase();
- if (!maSrcFiles[nFileId].maFilterName.Equals(rNewFilter))
+ maSrcFiles[nFileId].maRelativeName = OUString();
+ maSrcFiles[nFileId].maRealFileName = OUString();
+ if (!maSrcFiles[nFileId].maFilterName.equals(rNewFilter))
{
// Filter type has changed.
maSrcFiles[nFileId].maFilterName = rNewFilter;
- maSrcFiles[nFileId].maFilterOptions.Erase();
+ maSrcFiles[nFileId].maFilterOptions = OUString();
}
refreshNames(nFileId);
}
-void ScExternalRefManager::setRelativeFileName(sal_uInt16 nFileId, const String& rRelUrl)
+void ScExternalRefManager::setRelativeFileName(sal_uInt16 nFileId, const OUString& rRelUrl)
{
if (nFileId >= maSrcFiles.size())
return;
maSrcFiles[nFileId].maRelativeName = rRelUrl;
}
-void ScExternalRefManager::setFilterData(sal_uInt16 nFileId, const String& rFilterName, const String& rOptions)
+void ScExternalRefManager::setFilterData(sal_uInt16 nFileId, const OUString& rFilterName, const OUString& rOptions)
{
if (nFileId >= maSrcFiles.size())
return;
@@ -2522,14 +2525,14 @@ bool ScExternalRefManager::hasExternalData() const
return !maSrcFiles.empty();
}
-void ScExternalRefManager::resetSrcFileData(const String& rBaseFileUrl)
+void ScExternalRefManager::resetSrcFileData(const OUString& rBaseFileUrl)
{
for (vector<SrcFileData>::iterator itr = maSrcFiles.begin(), itrEnd = maSrcFiles.end();
itr != itrEnd; ++itr)
{
// Re-generate relative file name from the absolute file name.
- String aAbsName = itr->maRealFileName;
- if (!aAbsName.Len())
+ OUString aAbsName = itr->maRealFileName;
+ if (aAbsName.isEmpty())
aAbsName = itr->maFileName;
itr->maRelativeName = URIHelper::simpleNormalizedMakeRelative(
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 96e91b2d3ce5..54380e25d6b1 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -64,6 +64,8 @@
#include "dociter.hxx"
#include "formula/opcode.hxx"
+using ::rtl::OUString;
+
struct TableLink_Impl
{
ScDocShell* m_pDocSh;
@@ -522,6 +524,17 @@ sal_Bool ScDocumentLoader::GetFilterName( const String& rFileName,
return bOK;
}
+bool ScDocumentLoader::GetFilterName(
+ const OUString& rFilterName, OUString& rFilter, OUString& rOptions,
+ bool bWithContent, bool bWithInteraction)
+{
+ String aTmp1, aTmp2;
+ bool bRet = GetFilterName(rFilterName, aTmp1, aTmp2, bWithContent, bWithInteraction);
+ rFilter = aTmp1;
+ rOptions = aTmp2;
+ return bRet;
+}
+
void ScDocumentLoader::RemoveAppPrefix( String& rFilterName )
{
String aAppPrefix = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( STRING_SCAPP ));
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index 0990552b251a..8cc27ffaee88 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -1753,8 +1753,8 @@ Sequence< OUString > SAL_CALL ScExternalDocLinksObj::getElementNames()
Sequence<OUString> aSeq(n);
for (sal_uInt16 i = 0; i < n; ++i)
{
- const String* pName = mpRefMgr->getExternalFileName(i);
- aSeq[i] = pName ? *pName : EMPTY_STRING;
+ const OUString* pName = mpRefMgr->getExternalFileName(i);
+ aSeq[i] = pName ? *pName : OUString();
}
return aSeq;
diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index 5a7e9b8ce976..47a87a18f0ed 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -224,7 +224,7 @@ void ScViewFunc::DetectiveMarkPred()
sal_uInt16 nFileId = p->GetIndex();
ScExternalRefManager* pRefMgr = pDoc->GetExternalRefManager();
- const String* pPath = pRefMgr->getExternalFileName(nFileId);
+ const OUString* pPath = pRefMgr->getExternalFileName(nFileId);
ScRange aRange;
if (pPath && ScRefTokenHelper::getRangeFromToken(aRange, p, true))