summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/doc/number.cxx7
-rw-r--r--sw/source/core/text/txttab.cxx10
2 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 481ebfada8eb..c636273e6f54 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -664,6 +664,13 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto
if (nPosition >= 0)
sLevelFormat = sLevelFormat.replaceAt(nPosition, sFind.getLength(), sReplacement);
}
+
+ // As a fallback: caller code expects nonempty string as a result.
+ // But if we have empty string (and had no errors before) this is valid result.
+ // So use classical hack with zero-width-space as a string filling.
+ if (sLevelFormat.isEmpty())
+ sLevelFormat = OUStringChar(CHAR_ZWSP);
+
aStr = sLevelFormat;
}
else
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index c2fded221827..37b00c532bae 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -122,7 +122,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto
// #i24363# tab stops relative to indent
// nSearchPos: The current position relative to the tabs origin
- const SwTwips nSearchPos = bRTL ?
+ SwTwips nSearchPos = bRTL ?
nTabLeft - nCurrentAbsPos :
nCurrentAbsPos - nTabLeft;
@@ -130,6 +130,14 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto
// any hard set tab stops:
// Note: If there are no user defined tab stops, there is always a
// default tab stop.
+
+ // If search is started from zero position (beginning of line), than
+ // lets do it from -1: this will allow to include into account potential
+ // tab stop at zero position. Yes, it will be zero width tab useless
+ // mostly, but this have sense in case of lists.
+ if (nSearchPos == 0)
+ nSearchPos = -1;
+
const SvxTabStop* pTabStop = m_aLineInf.GetTabStop( nSearchPos, nMyRight );
if ( pTabStop )
{