summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2013-08-26 21:44:59 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-09-01 14:18:39 +0000
commitade517fd88b743d30a82788a91a027ee9e885ec9 (patch)
tree484cf4dd0d74e5e8cc382366c385d2a4fd22f73c /sw
parentabe2173ac5a89dd43b648b6dcb93c5ae1f1e8836 (diff)
String to OUString
Change-Id: I0285d1ad9edaf07be869c5e8325ed693beaee5f2 Reviewed-on: https://gerrit.libreoffice.org/5730 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par.cxx29
-rw-r--r--sw/source/filter/ww8/ww8par.hxx4
2 files changed, 19 insertions, 14 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 4cb36f651284..729ad84696d3 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -24,6 +24,8 @@
#include <unotools/ucbstreamhelper.hxx>
#include <rtl/random.h>
+#include "rtl/ustring.hxx"
+#include "rtl/ustrbuf.hxx"
#include <sfx2/docinf.hxx>
#include <sfx2/request.hxx>
@@ -1797,13 +1799,13 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
if( !pSD )
return 0;
- String sAuthor;
- String sInitials;
- String sName;
+ OUString sAuthor;
+ OUString sInitials;
+ OUString sName;
if( bVer67 )
{
const WW67_ATRD* pDescri = (const WW67_ATRD*)pSD->GetData();
- const String* pA = GetAnnotationAuthor(SVBT16ToShort(pDescri->ibst));
+ const OUString* pA = GetAnnotationAuthor(SVBT16ToShort(pDescri->ibst));
if (pA)
sAuthor = *pA;
else
@@ -1815,12 +1817,15 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
const WW8_ATRD* pDescri = (const WW8_ATRD*)pSD->GetData();
{
- sal_uInt16 nLen = SVBT16ToShort(pDescri->xstUsrInitl[0]);
+ const sal_uInt16 nLen = SVBT16ToShort(pDescri->xstUsrInitl[0]);
+ OUStringBuffer aBuf;
+ aBuf.setLength(nLen);
for(sal_uInt16 nIdx = 1; nIdx <= nLen; ++nIdx)
- sInitials += SVBT16ToShort(pDescri->xstUsrInitl[nIdx]);
+ aBuf[nIdx-1] = SVBT16ToShort(pDescri->xstUsrInitl[nIdx]);
+ sInitials = aBuf.makeStringAndClear();
}
- if (const String* pA = GetAnnotationAuthor(SVBT16ToShort(pDescri->ibst)))
+ if (const OUString* pA = GetAnnotationAuthor(SVBT16ToShort(pDescri->ibst)))
sAuthor = *pA;
else
sAuthor = sInitials;
@@ -5497,12 +5502,12 @@ void SwWW8ImplReader::SetOutLineStyles()
}
}
-const String* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx)
+const OUString* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx)
{
if (!mpAtnNames && pWwFib->lcbGrpStAtnOwners)
{
// Determine authors: can be found in the TableStream
- mpAtnNames = new ::std::vector<String>;
+ mpAtnNames = new ::std::vector<OUString>;
SvStream& rStrm = *pTableStream;
long nOldPos = rStrm.Tell();
@@ -5515,19 +5520,19 @@ const String* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx)
{
mpAtnNames->push_back(read_uInt8_PascalString(rStrm,
RTL_TEXTENCODING_MS_1252));
- nRead += mpAtnNames->rbegin()->Len() + 1; // Length + sal_uInt8 count
+ nRead += mpAtnNames->rbegin()->getLength() + 1; // Length + sal_uInt8 count
}
else
{
mpAtnNames->push_back(read_uInt16_PascalString(rStrm));
// Unicode: double the length + sal_uInt16 count
- nRead += mpAtnNames->rbegin()->Len() * 2 + 2;
+ nRead += (mpAtnNames->rbegin()->getLength() + 1)*2;
}
}
rStrm.Seek( nOldPos );
}
- const String *pRet = 0;
+ const OUString *pRet = 0;
if (mpAtnNames && nIdx < mpAtnNames->size())
pRet = &((*mpAtnNames)[nIdx]);
return pRet;
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index c7009710b016..4613727d9ef3 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1164,7 +1164,7 @@ private:
SwMSDffManager* pMSDffManager;
- std::vector<String>* mpAtnNames;
+ std::vector<OUString>* mpAtnNames;
boost::shared_ptr< std::map<sal_uInt32, int> > mpAtnIndexes;
boost::shared_ptr<WW8PLCFspecial> mpAtnStarts;
boost::shared_ptr<WW8PLCFspecial> mpAtnEnds;
@@ -1553,7 +1553,7 @@ private:
// spaeter zu ersetzen durch Aufruf in entsprechend erweiterten SvxMSDffManager
- const String* GetAnnotationAuthor(sal_uInt16 nIdx);
+ const OUString* GetAnnotationAuthor(sal_uInt16 nIdx);
int GetAnnotationIndex(sal_uInt32 nTag);
WW8_CP GetAnnotationStart(int nIndex);
WW8_CP GetAnnotationEnd(int nIndex);