Kaydet (Commit) c3f9fa6f authored tarafından Michael Stahl's avatar Michael Stahl

sw: WW8 export: GetPseudoCharRuns() parameter bSplitOnCharSet is obsolete

Change-Id: Icd1fbf247e63c92c8a51de78eb70e9b8e5f03b5e
üst 55835249
...@@ -445,11 +445,6 @@ namespace sw ...@@ -445,11 +445,6 @@ namespace sw
@param nStart @param nStart
The position in the TextNode to start processing from The position in the TextNode to start processing from
@param bSplitOnCharSet
Set to true is we want to split on ranges of characters that
share a plausible charset for export to e.g. WW7- or perhaps
RTF format, not necessary for a unicode aware format like WW8+
@return STL container of CharRuns which describe the shared @return STL container of CharRuns which describe the shared
direction, script and optionally script of the contiguous sequences direction, script and optionally script of the contiguous sequences
of characters of characters
...@@ -460,7 +455,7 @@ namespace sw ...@@ -460,7 +455,7 @@ namespace sw
@see #i22537# for example @see #i22537# for example
*/ */
CharRuns GetPseudoCharRuns(const SwTextNode& rTextNd, CharRuns GetPseudoCharRuns(const SwTextNode& rTextNd,
sal_Int32 nStart = 0, bool bSplitOnCharSet = false); sal_Int32 nStart = 0);
} }
} }
......
...@@ -518,7 +518,7 @@ namespace sw ...@@ -518,7 +518,7 @@ namespace sw
} }
CharRuns GetPseudoCharRuns(const SwTextNode& rTextNd, CharRuns GetPseudoCharRuns(const SwTextNode& rTextNd,
sal_Int32 nTextStart, bool bSplitOnCharSet) sal_Int32 nTextStart)
{ {
const OUString &rText = rTextNd.GetText(); const OUString &rText = rTextNd.GetText();
...@@ -556,16 +556,11 @@ namespace sw ...@@ -556,16 +556,11 @@ namespace sw
typedef std::vector<DirEntry> DirChanges; typedef std::vector<DirEntry> DirChanges;
typedef DirChanges::const_iterator cDirIter; typedef DirChanges::const_iterator cDirIter;
typedef std::pair<sal_Int32, sal_Int16> CharSetEntry;
typedef std::vector<CharSetEntry> CharSetChanges;
typedef CharSetChanges::const_iterator cCharSetIter;
typedef std::pair<sal_Int32, sal_uInt16> ScriptEntry; typedef std::pair<sal_Int32, sal_uInt16> ScriptEntry;
typedef std::vector<ScriptEntry> ScriptChanges; typedef std::vector<ScriptEntry> ScriptChanges;
typedef ScriptChanges::const_iterator cScriptIter; typedef ScriptChanges::const_iterator cScriptIter;
DirChanges aDirChanges; DirChanges aDirChanges;
CharSetChanges aCharSets;
ScriptChanges aScripts; ScriptChanges aScripts;
UBiDiDirection eDefaultDir = bParaIsRTL ? UBIDI_RTL : UBIDI_LTR; UBiDiDirection eDefaultDir = bParaIsRTL ? UBIDI_RTL : UBIDI_LTR;
...@@ -599,28 +594,6 @@ namespace sw ...@@ -599,28 +594,6 @@ namespace sw
} }
ubidi_close(pBidi); ubidi_close(pBidi);
if (bSplitOnCharSet)
{
//Split unicode text into plausible 8bit ranges for export to
//older non unicode aware format
sal_Int32 nLen = rText.getLength();
sal_Int32 nPos = 0;
while (nPos != nLen)
{
rtl_TextEncoding ScriptType =
getBestMSEncodingByChar(rText[nPos++]);
while (
(nPos != nLen) &&
(ScriptType == getBestMSEncodingByChar(rText[nPos]))
)
{
++nPos;
}
aCharSets.push_back(CharSetEntry(nPos, ScriptType));
}
}
using sw::types::writer_cast; using sw::types::writer_cast;
if (g_pBreakIt && g_pBreakIt->GetBreakIter().is()) if (g_pBreakIt && g_pBreakIt->GetBreakIter().is())
...@@ -640,18 +613,15 @@ namespace sw ...@@ -640,18 +613,15 @@ namespace sw
} }
cDirIter aBiDiEnd = aDirChanges.end(); cDirIter aBiDiEnd = aDirChanges.end();
cCharSetIter aCharSetEnd = aCharSets.end();
cScriptIter aScriptEnd = aScripts.end(); cScriptIter aScriptEnd = aScripts.end();
cDirIter aBiDiIter = aDirChanges.begin(); cDirIter aBiDiIter = aDirChanges.begin();
cCharSetIter aCharSetIter = aCharSets.begin();
cScriptIter aScriptIter = aScripts.begin(); cScriptIter aScriptIter = aScripts.begin();
bool bCharIsRTL = bParaIsRTL; bool bCharIsRTL = bParaIsRTL;
while ( while (
aBiDiIter != aBiDiEnd || aBiDiIter != aBiDiEnd ||
aCharSetIter != aCharSetEnd ||
aScriptIter != aScriptEnd aScriptIter != aScriptEnd
) )
{ {
...@@ -664,13 +634,6 @@ namespace sw ...@@ -664,13 +634,6 @@ namespace sw
bCharIsRTL = aBiDiIter->second; bCharIsRTL = aBiDiIter->second;
} }
if (aCharSetIter != aCharSetEnd)
{
if (aCharSetIter->first < nMinPos)
nMinPos = aCharSetIter->first;
eChrSet = aCharSetIter->second;
}
if (aScriptIter != aScriptEnd) if (aScriptIter != aScriptEnd)
{ {
if (aScriptIter->first < nMinPos) if (aScriptIter->first < nMinPos)
...@@ -687,12 +650,6 @@ namespace sw ...@@ -687,12 +650,6 @@ namespace sw
++aBiDiIter; ++aBiDiIter;
} }
if (aCharSetIter != aCharSetEnd)
{
if (aCharSetIter->first == nMinPos)
++aCharSetIter;
}
if (aScriptIter != aScriptEnd) if (aScriptIter != aScriptEnd)
{ {
if (aScriptIter->first == nMinPos) if (aScriptIter->first == nMinPos)
......
...@@ -179,7 +179,7 @@ void SwWW8AttrIter::IterToCurrent() ...@@ -179,7 +179,7 @@ void SwWW8AttrIter::IterToCurrent()
SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) : SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) :
MSWordAttrIter(rWr), MSWordAttrIter(rWr),
rNd(rTextNd), rNd(rTextNd),
maCharRuns(GetPseudoCharRuns(rTextNd, 0, false)), maCharRuns(GetPseudoCharRuns(rTextNd, 0)),
pCurRedline(0), pCurRedline(0),
nAktSwPos(0), nAktSwPos(0),
nCurRedlinePos(USHRT_MAX), nCurRedlinePos(USHRT_MAX),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment