summaryrefslogtreecommitdiff
path: root/svgio/source/svgreader/svgtools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svgio/source/svgreader/svgtools.cxx')
-rw-r--r--svgio/source/svgreader/svgtools.cxx36
1 files changed, 10 insertions, 26 deletions
diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx
index 5e56ee83b19e..92b2ecab3fb3 100644
--- a/svgio/source/svgreader/svgtools.cxx
+++ b/svgio/source/svgreader/svgtools.cxx
@@ -1375,7 +1375,7 @@ namespace svgio::svgreader
}
}
- OUString convert(const OUString& rCandidate, sal_Unicode nPattern, sal_Unicode nNew, bool bRemove)
+ OUString convert(const OUString& rCandidate, sal_Unicode nPattern, sal_Unicode nNew)
{
const sal_Int32 nLen(rCandidate.getLength());
@@ -1392,11 +1392,7 @@ namespace svgio::svgreader
if(nPattern == aChar)
{
bChanged = true;
-
- if(!bRemove)
- {
- aBuffer.append(nNew);
- }
+ aBuffer.append(nNew);
}
else
{
@@ -1513,42 +1509,30 @@ namespace svgio::svgreader
return rCandidate;
}
- OUString whiteSpaceHandlingDefault(const OUString& rCandidate)
+ OUString xmlSpaceHandling(const OUString& rCandidate, bool bIsDefault)
{
const sal_Unicode aNewline('\n');
const sal_Unicode aTab('\t');
const sal_Unicode aSpace(' ');
// remove all newline characters
- OUString aRetval(convert(rCandidate, aNewline, aNewline, true));
+ OUString aRetval(convert(rCandidate, aNewline, aSpace));
// convert tab to space
- aRetval = convert(aRetval, aTab, aSpace, false);
+ aRetval = convert(aRetval, aTab, aSpace);
// strip of all leading and trailing spaces
aRetval = aRetval.trim();
- // consolidate contiguous space
- aRetval = consolidateContiguousSpace(aRetval);
+ if(bIsDefault)
+ {
+ // consolidate contiguous space
+ aRetval = consolidateContiguousSpace(aRetval);
+ }
return aRetval;
}
- OUString whiteSpaceHandlingPreserve(const OUString& rCandidate)
- {
- const sal_Unicode aNewline('\n');
- const sal_Unicode aTab('\t');
- const sal_Unicode aSpace(' ');
-
- // convert newline to space
- convert(rCandidate, aNewline, aSpace, false);
-
- // convert tab to space
- convert(rCandidate, aTab, aSpace, false);
-
- return rCandidate;
- }
-
::std::vector< double > solveSvgNumberVector(const SvgNumberVector& rInput, const InfoProvider& rInfoProvider)
{
::std::vector< double > aRetval;