diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-08-16 23:17:31 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-08-17 13:01:48 +0000 |
commit | 4cf1c9058610b10a8081b10342653ae08a9181a3 (patch) | |
tree | 897581529bd722b8487bc06684d6cdb3829821c5 /sw | |
parent | cc65e4d2fd1dd0c03cf652b5aada6870e1a939f1 (diff) |
String to OUString
Change-Id: I73aef8d848e738fef987449ca60fe8340428e4c9
Reviewed-on: https://gerrit.libreoffice.org/5463
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/redline.hxx | 2 | ||||
-rw-r--r-- | sw/inc/swmodule.hxx | 15 | ||||
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/app/swmodul1.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/app/swmodule.cxx | 2 |
5 files changed, 22 insertions, 19 deletions
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 2c54a2ea61a4..e6d0d9948709 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -215,7 +215,7 @@ public: sal_uInt16 GetStackCount() const; sal_uInt16 GetAuthor( sal_uInt16 nPos = 0) const; - const String& GetAuthorString( sal_uInt16 nPos = 0 ) const; + OUString GetAuthorString( sal_uInt16 nPos = 0 ) const; const DateTime& GetTimeStamp( sal_uInt16 nPos = 0) const; RedlineType_t GetRealType( sal_uInt16 nPos = 0 ) const; RedlineType_t GetType( sal_uInt16 nPos = 0) const diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index f9f043ebc70e..41e9cd9dc346 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -16,9 +16,8 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef _SWMODULE_HXX -#define _SWMODULE_HXX -#include <tools/string.hxx> +#ifndef SWMODULE_HXX +#define SWMODULE_HXX #include <tools/fldunit.hxx> #include <svl/lstner.hxx> #include <unotools/options.hxx> @@ -66,7 +65,7 @@ namespace com{ namespace sun{ namespace star{ namespace scanner{ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::ConfigurationListener { - String sActAuthor; + OUString sActAuthor; // ConfigItems SwModuleOptions* pModuleConfig; @@ -95,7 +94,7 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C SwView* pView; // List of all Redline-authors. - std::vector<String>* pAuthorNames; + std::vector<OUString>* pAuthorNames; // DictionaryList listener to trigger spellchecking or hyphenation ::com::sun::star::uno::Reference< @@ -186,9 +185,9 @@ public: // Redlining. sal_uInt16 GetRedlineAuthor(); - const String& GetRedlineAuthor(sal_uInt16 nPos); - sal_uInt16 InsertRedlineAuthor(const String& rAuthor); - void SetRedlineAuthor(const String& rAuthor); // for unit tests + OUString GetRedlineAuthor(sal_uInt16 nPos); + sal_uInt16 InsertRedlineAuthor(const OUString& rAuthor); + void SetRedlineAuthor(const OUString& rAuthor); // for unit tests void GetInsertAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet); void GetDeletedAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 29209b7bf44b..0acb59251d47 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -291,7 +291,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) _CHECK_REDLINE( this ) if( IsRedlineOn() && !IsShowOriginal( meRedlineMode ) && - pNewRedl->GetAuthorString().Len() ) + !pNewRedl->GetAuthorString().isEmpty() ) { pNewRedl->InvalidateRange(); @@ -3711,7 +3711,7 @@ sal_uInt16 SwRedline::GetAuthor( sal_uInt16 nPos ) const return GetRedlineData(nPos).nAuthor; } -const String& SwRedline::GetAuthorString( sal_uInt16 nPos ) const +OUString SwRedline::GetAuthorString( sal_uInt16 nPos ) const { return SW_MOD()->GetRedlineAuthor(GetRedlineData(nPos).nAuthor); } diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index cad791d70427..235410ecc81c 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -398,32 +398,36 @@ sal_uInt16 SwModule::GetRedlineAuthor() if (!bAuthorInitialised) { const SvtUserOptions& rOpt = GetUserOptions(); - if( !(sActAuthor = rOpt.GetFullName()).Len() ) - if( !(sActAuthor = rOpt.GetID()).Len() ) - sActAuthor = String( SW_RES( STR_REDLINE_UNKNOWN_AUTHOR )); + sActAuthor = rOpt.GetFullName(); + if (sActAuthor.isEmpty()) + { + sActAuthor = rOpt.GetID(); + if (sActAuthor.isEmpty()) + sActAuthor = SW_RESSTR( STR_REDLINE_UNKNOWN_AUTHOR ); + } bAuthorInitialised = sal_True; } return InsertRedlineAuthor( sActAuthor ); } -void SwModule::SetRedlineAuthor(const String &rAuthor) +void SwModule::SetRedlineAuthor(const OUString &rAuthor) { bAuthorInitialised = sal_True; sActAuthor = rAuthor; InsertRedlineAuthor( sActAuthor ); } -const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos) +OUString SwModule::GetRedlineAuthor(sal_uInt16 nPos) { OSL_ENSURE(nPos < pAuthorNames->size(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash while(!(nPos < pAuthorNames->size())) { - InsertRedlineAuthor(String("nn")); + InsertRedlineAuthor("nn"); }; return (*pAuthorNames)[nPos]; } -sal_uInt16 SwModule::InsertRedlineAuthor(const String& rAuthor) +sal_uInt16 SwModule::InsertRedlineAuthor(const OUString& rAuthor) { sal_uInt16 nPos = 0; diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index b0465ca7672b..c903c4af1192 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -191,7 +191,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, pStdFontConfig = new SwStdFontConfig; - pAuthorNames = new std::vector<String>; // All Redlining-Authors + pAuthorNames = new std::vector<OUString>; // All Redlining-Authors // replace SvxAutocorrect with SwAutocorrect SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get(); |