summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2020-05-09 14:35:25 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-05-11 10:42:13 +0200
commit598ca431de96d8bfcf18fa2945e9e30f98387474 (patch)
tree508ead485cf73b0e77797a76c162cd6ac3b40901 /sw/source
parent628cde6409eb471024a6aca5a8262b00f448c8cf (diff)
tdf#132766: DOCX export: always try to set bullet font for list
There are some problems with bullet if we use MS Wingdigs bullets and do not specify Symbol font for it. It shiuld be either UTF-8 or Symbol, but not mixture of both. Change-Id: Ie4a6f7e8fee6cfab21a18fc080f33d1bff455dd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93846 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx5
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx65
2 files changed, 31 insertions, 39 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 22cad9dff565..7c576e26538e 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6988,7 +6988,10 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
FSNS( XML_w, XML_cs ), aFamilyName,
FSNS( XML_w, XML_hint ), "default" );
}
- m_rExport.OutputItemSet( *pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.m_bExportModeRTF );
+ else
+ {
+ m_rExport.OutputItemSet(*pOutSet, false, true, i18n::ScriptType::LATIN, m_rExport.m_bExportModeRTF);
+ }
WriteCollectedRunProperties();
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index cc6795aeb3b2..ca3a026f2323 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -452,7 +452,11 @@ void MSWordExportBase::NumberingLevel(
// #i86652#
if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
{
- nFollow = 2; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
+ // <nFollow = 2>, if minimum label width equals 0 and
+ // minimum distance between label and text equals 0
+ nFollow = (rFormat.GetFirstLineOffset() == 0 &&
+ rFormat.GetCharTextDistance() == 0)
+ ? 2 : 0; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
}
else if (rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT)
{
@@ -490,44 +494,20 @@ void MSWordExportBase::NumberingLevel(
const vcl::Font* pBulletFont=nullptr;
rtl_TextEncoding eChrSet=0;
FontFamily eFamily=FAMILY_DECORATIVE;
-
if (!rRule.Get(nLvl).GetListFormat().isEmpty())
{
- // We have stored list format, use it
+ // Nothing to construct: we have it already
sNumStr = rRule.Get(nLvl).GetListFormat();
}
else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() ||
SVX_NUM_BITMAP == rFormat.GetNumberingType())
{
+ // Use bullet
sNumStr = OUString(rFormat.GetBulletChar());
- bWriteBullet = true;
-
- pBulletFont = rFormat.GetBulletFont();
- if (!pBulletFont)
- {
- pBulletFont = &numfunc::GetDefBulletFont();
- }
-
- eChrSet = pBulletFont->GetCharSet();
- sFontName = pBulletFont->GetFamilyName();
- eFamily = pBulletFont->GetFamilyType();
-
- if (IsStarSymbol(sFontName))
- SubstituteBullet( sNumStr, eChrSet, sFontName );
-
- // #i86652#
- if (rFormat.GetPositionAndSpaceMode() ==
- SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
- {
- // <nFollow = 2>, if minimum label width equals 0 and
- // minimum distance between label and text equals 0
- nFollow = (rFormat.GetFirstLineOffset() == 0 &&
- rFormat.GetCharTextDistance() == 0)
- ? 2 : 0; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
- }
}
else
{
+ // Construct list format string from prefix, level numbers and suffix
if (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType())
{
sal_uInt8* pLvlPos = aNumLvlPos;
@@ -547,16 +527,6 @@ void MSWordExportBase::NumberingLevel(
sNumStr = sNumStr.replaceAt( nFnd, 1, OUString(static_cast<char>(i)) );
}
}
- // #i86652#
- if (rFormat.GetPositionAndSpaceMode() ==
- SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
- {
- // <nFollow = 2>, if minimum label width equals 0 and
- // minimum distance between label and text equals 0
- nFollow = (rFormat.GetFirstLineOffset() == 0 &&
- rFormat.GetCharTextDistance() == 0)
- ? 2 : 0; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
- }
}
if (!rFormat.GetPrefix().isEmpty())
@@ -564,6 +534,25 @@ void MSWordExportBase::NumberingLevel(
sNumStr += rFormat.GetSuffix();
}
+ if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() ||
+ SVX_NUM_BITMAP == rFormat.GetNumberingType())
+ {
+ bWriteBullet = true;
+
+ pBulletFont = rFormat.GetBulletFont();
+ if (!pBulletFont)
+ {
+ pBulletFont = &numfunc::GetDefBulletFont();
+ }
+
+ eChrSet = pBulletFont->GetCharSet();
+ sFontName = pBulletFont->GetFamilyName();
+ eFamily = pBulletFont->GetFamilyType();
+
+ if (IsStarSymbol(sFontName))
+ SubstituteBullet(sNumStr, eChrSet, sFontName);
+ }
+
// Attributes of the numbering
std::unique_ptr<wwFont> pPseudoFont;
const SfxItemSet* pOutSet = nullptr;