summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r--writerfilter/source/dmapper/BorderHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/ConversionHelper.cxx9
-rw-r--r--writerfilter/source/dmapper/ConversionHelper.hxx3
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx48
-rw-r--r--writerfilter/source/dmapper/DomainMapper.hxx1
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx61
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.hxx4
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx18
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.hxx5
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx86
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx18
-rw-r--r--writerfilter/source/dmapper/FFDataHandler.hxx4
-rw-r--r--writerfilter/source/dmapper/FieldTypes.hxx4
-rw-r--r--writerfilter/source/dmapper/FontTable.hxx5
-rw-r--r--writerfilter/source/dmapper/FormControlHelper.hxx5
-rw-r--r--writerfilter/source/dmapper/GraphicHelpers.hxx5
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx36
-rw-r--r--writerfilter/source/dmapper/GraphicImport.hxx5
-rw-r--r--writerfilter/source/dmapper/LatentStyleHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/LoggedResources.hxx4
-rw-r--r--writerfilter/source/dmapper/MeasureHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/ModelEventListener.hxx4
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx3
-rw-r--r--writerfilter/source/dmapper/NumberingManager.hxx5
-rw-r--r--writerfilter/source/dmapper/OLEHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/PageBordersHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx3
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx5
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx34
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx8
-rw-r--r--writerfilter/source/dmapper/PropertyMapHelper.hxx5
-rw-r--r--writerfilter/source/dmapper/SdtHelper.hxx5
-rw-r--r--writerfilter/source/dmapper/SectionColumnHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/SettingsTable.hxx5
-rw-r--r--writerfilter/source/dmapper/SmartTagHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/StyleSheetTable.hxx5
-rw-r--r--writerfilter/source/dmapper/TDefTableHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/TableData.hxx5
-rw-r--r--writerfilter/source/dmapper/TableManager.hxx16
-rw-r--r--writerfilter/source/dmapper/TablePositionHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/TablePropertiesHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/TagLogger.cxx22
-rw-r--r--writerfilter/source/dmapper/TagLogger.hxx5
-rw-r--r--writerfilter/source/dmapper/TblStylePrHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/TextEffectsHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/ThemeTable.hxx5
-rw-r--r--writerfilter/source/dmapper/TrackChangesHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/WrapPolygonHandler.hxx5
-rw-r--r--writerfilter/source/dmapper/util.hxx5
49 files changed, 308 insertions, 223 deletions
diff --git a/writerfilter/source/dmapper/BorderHandler.hxx b/writerfilter/source/dmapper/BorderHandler.hxx
index 1261416760b3..6c607ca5aea2 100644
--- a/writerfilter/source/dmapper/BorderHandler.hxx
+++ b/writerfilter/source/dmapper/BorderHandler.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_BORDERHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_BORDERHANDLER_HXX
+#pragma once
#include <vector>
#include "LoggedResources.hxx"
@@ -76,6 +75,4 @@ public:
};
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index 809e85c90372..ac877c5d723a 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -475,7 +475,8 @@ sal_Int16 convertTableJustification( sal_Int32 nIntValue )
return nOrient;
}
-sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
+// Return the suggested default if the given format has no known conversion
+sal_Int16 ConvertNumberingType(const sal_Int32 nFmt, const sal_Int16 nDefault)
{
sal_Int16 nRet;
switch(nFmt)
@@ -557,6 +558,9 @@ sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
case NS_ooxml::LN_Value_ST_NumberFormat_arabicAlpha:
nRet = style::NumberingType::CHARS_ARABIC;
break;
+ case NS_ooxml::LN_Value_ST_NumberFormat_arabicAbjad:
+ nRet = style::NumberingType::CHARS_ARABIC_ABJAD;
+ break;
case NS_ooxml::LN_Value_ST_NumberFormat_hindiVowels:
nRet = style::NumberingType::CHARS_NEPALI;
break;
@@ -594,7 +598,7 @@ sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
case NS_ooxml::LN_Value_ST_NumberFormat_decimalZero:
nRet = style::NumberingType::ARABIC_ZERO;
break;
- default: nRet = style::NumberingType::ARABIC;
+ default: nRet = nDefault;
}
/* TODO: Lots of additional values are available - some are supported in the I18 framework
NS_ooxml::LN_Value_ST_NumberFormat_hex = 91685;
@@ -610,7 +614,6 @@ sal_Int16 ConvertNumberingType(sal_Int32 nFmt)
NS_ooxml::LN_Value_ST_NumberFormat_koreanLegal = 91719;
NS_ooxml::LN_Value_ST_NumberFormat_vietnameseCounting = 91721;
NS_ooxml::LN_Value_ST_NumberFormat_numberInDash = 91725;
- NS_ooxml::LN_Value_ST_NumberFormat_arabicAbjad:
NS_ooxml::LN_Value_ST_NumberFormat_hindiConsonants = 91731;
NS_ooxml::LN_Value_ST_NumberFormat_hindiNumbers = 91732;
NS_ooxml::LN_Value_ST_NumberFormat_hindiCounting = 91733;
diff --git a/writerfilter/source/dmapper/ConversionHelper.hxx b/writerfilter/source/dmapper/ConversionHelper.hxx
index ad0cd615fbec..72c0efe0d540 100644
--- a/writerfilter/source/dmapper/ConversionHelper.hxx
+++ b/writerfilter/source/dmapper/ConversionHelper.hxx
@@ -21,6 +21,7 @@
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include <com/sun/star/util/DateTime.hpp>
+#include <com/sun/star/style/NumberingType.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/text/RubyAdjust.hpp>
@@ -49,7 +50,7 @@ namespace writerfilter::dmapper::ConversionHelper{
SAL_DLLPUBLIC_EXPORT sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t);
sal_Int16 convertTableJustification( sal_Int32 nIntValue );
css::text::RubyAdjust convertRubyAlign( sal_Int32 nIntValue );
- sal_Int16 ConvertNumberingType(sal_Int32 nFmt);
+ sal_Int16 ConvertNumberingType(const sal_Int32 nFmt, const sal_Int16 nDefault = css::style::NumberingType::ARABIC);
sal_Int16 ConvertCustomNumberFormat(std::u16string_view rFormat);
css::util::DateTime ConvertDateStringToDateTime(const OUString& rDateTime);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 964abf0e58fd..2561120adb2d 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1074,29 +1074,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
case NS_ooxml::LN_CT_PageNumber_fmt:
if (pSectionContext)
{
- switch (nIntValue)
- {
- case NS_ooxml::LN_Value_ST_NumberFormat_decimal:
- // 1, 2, ...
- pSectionContext->SetPageNumberType(style::NumberingType::ARABIC);
- break;
- case NS_ooxml::LN_Value_ST_NumberFormat_upperLetter:
- // A, B, ...
- pSectionContext->SetPageNumberType(style::NumberingType::CHARS_UPPER_LETTER_N);
- break;
- case NS_ooxml::LN_Value_ST_NumberFormat_lowerLetter:
- // a, b, ...
- pSectionContext->SetPageNumberType(style::NumberingType::CHARS_LOWER_LETTER_N);
- break;
- case NS_ooxml::LN_Value_ST_NumberFormat_upperRoman:
- // I, II, ...
- pSectionContext->SetPageNumberType(style::NumberingType::ROMAN_UPPER);
- break;
- case NS_ooxml::LN_Value_ST_NumberFormat_lowerRoman:
- // i, ii, ...
- pSectionContext->SetPageNumberType(style::NumberingType::ROMAN_LOWER);
- break;
- }
+ sal_Int16 nNumberType = ConversionHelper::ConvertNumberingType(nIntValue, -1);
+ if (nNumberType != -1)
+ pSectionContext->SetPageNumberType(nNumberType);
}
break;
case NS_ooxml::LN_CT_FtnEdn_type:
@@ -1599,6 +1579,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
pSectionContext->Insert(PROP_WRITING_MODE, uno::makeAny(writingMode));
}
break;
+ case NS_ooxml::LN_EG_SectPrContents_rtlGutter:
+ if (pSectionContext != nullptr)
+ {
+ bool bRtlGutter = nIntValue != 0;
+ pSectionContext->Insert(PROP_RTL_GUTTER, uno::makeAny(bRtlGutter));
+ }
+ break;
case NS_ooxml::LN_EG_RPrBase_highlight:
{
// MS Word completely ignores character highlighting in character styles.
@@ -1809,7 +1796,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
// The spec says 0 is the same as the lack of the value, so don't parse that.
if ( nIntValue )
{
- if ( !IsStyleSheetImport() )
+ if (!IsStyleSheetImport() && !IsNumberingImport())
m_pImpl->deferCharacterProperty( nSprmId, uno::makeAny( nIntValue ));
else if (!m_pImpl->IsDocDefaultsImport())
{
@@ -3253,7 +3240,10 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len)
case 0x0c: //page break
// page breaks aren't supported in footnotes and endnotes
if (!m_pImpl->IsInFootOrEndnote())
+ {
m_pImpl->deferBreak(PAGE_BREAK);
+ m_pImpl->SetIsDummyParaAddedForTableInSectionPage(false);
+ }
return;
case 0x0e: //column break
m_pImpl->deferBreak(COLUMN_BREAK);
@@ -3589,7 +3579,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
(!m_pImpl->GetParaChanged() && m_pImpl->GetParaSectpr()
&& !bSingleParagraphAfterRedline
&& !m_pImpl->GetParaHadField()
- && !m_pImpl->GetIsDummyParaAddedForTableInSection()
+ && (!m_pImpl->GetIsDummyParaAddedForTableInSectionPage())
&& !( pSectionContext && pSectionContext->GetBreakType() != -1 && pContext && pContext->isSet(PROP_BREAK_TYPE) )
&& !m_pImpl->GetIsPreviousParagraphFramed()
&& !m_pImpl->HasTopAnchoredObjects()
@@ -3699,10 +3689,11 @@ void DomainMapper::lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t
break;
case NS_ooxml::LN_NUMBERING:
{
-
+ m_pImpl->SetNumberingImport(true);
//the same for list tables
ref->resolve( *m_pImpl->GetListTable() );
m_pImpl->GetListTable( )->CreateNumberingRules( );
+ m_pImpl->SetNumberingImport(false);
}
break;
case NS_ooxml::LN_THEMETABLE:
@@ -4035,6 +4026,11 @@ bool DomainMapper::IsStyleSheetImport() const
return m_pImpl->IsStyleSheetImport();
}
+bool DomainMapper::IsNumberingImport() const
+{
+ return m_pImpl->IsNumberingImport();
+}
+
void DomainMapper::enableInteropGrabBag(const OUString& aName)
{
m_pImpl->m_aInteropGrabBagName = aName;
diff --git a/writerfilter/source/dmapper/DomainMapper.hxx b/writerfilter/source/dmapper/DomainMapper.hxx
index 46bbd2b39018..4e47dd70a441 100644
--- a/writerfilter/source/dmapper/DomainMapper.hxx
+++ b/writerfilter/source/dmapper/DomainMapper.hxx
@@ -114,6 +114,7 @@ public:
bool IsInTable() const;
void SetDocDefaultsImport(bool bSet);
bool IsStyleSheetImport() const;
+ bool IsNumberingImport() const;
bool IsInShape() const;
void hasControls( const bool bSet ) { mbHasControls = bSet; }
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index fd21827211bb..55c48740f0ec 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/SizeType.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/XTextField.hpp>
#include <com/sun/star/text/XTextRangeCompare.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -339,9 +340,43 @@ void lcl_adjustBorderDistance(TableInfo& rInfo, const table::BorderLine2& rLeftB
rInfo.nRightBorderDistance = nActualR;
}
+void lcl_fillEmptyFrameProperties(std::vector<beans::PropertyValue>& rFrameProperties)
+{
+ // fill empty frame properties to create an invisible frame around the table:
+ // hide frame borders and zero inner and outer frame margins
+ beans::PropertyValue aValue;
+ aValue.Name = getPropertyName( PROP_ANCHOR_TYPE );
+ aValue.Value <<= text::TextContentAnchorType_AS_CHARACTER;
+ rFrameProperties.push_back(aValue);
+
+ table::BorderLine2 aEmptyBorder;
+ static const std::vector<std::u16string_view> aBorderNames
+ = { u"TopBorder", u"LeftBorder", u"BottomBorder", u"RightBorder" };
+ for (size_t i = 0; i < aBorderNames.size(); ++i)
+ {
+ beans::PropertyValue aBorderValue;
+ aBorderValue.Name = aBorderNames[i];
+ aBorderValue.Value <<= aEmptyBorder;
+ rFrameProperties.push_back(aBorderValue);
+ }
+ static const std::vector<std::u16string_view> aMarginNames
+ = { u"TopBorderDistance", u"LeftBorderDistance",
+ u"BottomBorderDistance", u"RightBorderDistance",
+ u"TopMargin", u"LeftMargin", u"BottomMargin", u"RightMargin" };
+ for (size_t i = 0; i < aMarginNames.size(); ++i)
+ {
+ beans::PropertyValue aMarginValue;
+ aMarginValue.Name = aMarginNames[i];
+ aMarginValue.Value <<= sal_Int32(10);
+ rFrameProperties.push_back(aMarginValue);
+ }
+}
+
}
-TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo & rInfo, std::vector<beans::PropertyValue>& rFrameProperties)
+TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo & rInfo,
+ std::vector<beans::PropertyValue>& rFrameProperties,
+ bool bConvertToFloatingInFootnote)
{
// will receive the table style if any
TableStyleSheetEntry* pTableStyle = nullptr;
@@ -394,6 +429,11 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
aGrabBag["TablePosition"] <<= aGrabBagTS;
}
+ else if (bConvertToFloatingInFootnote)
+ {
+ // define empty "TablePosition" to avoid export temporary floating
+ aGrabBag["TablePosition"] = uno::Any();
+ }
std::optional<PropertyMap::Property> aTableStyleVal = m_aTableProperties->getProperty(META_PROP_TABLE_STYLE_NAME);
if(aTableStyleVal)
@@ -1375,7 +1415,15 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab
(m_rDMapper_Impl.getTableManager().getCurrentTablePosition());
TableInfo aTableInfo;
aTableInfo.nNestLevel = nestedTableLevel;
- aTableInfo.pTableStyle = endTableGetTableStyle(aTableInfo, aFrameProperties);
+
+ // non-floating tables need floating in footnotes and endnotes, because
+ // Writer core cannot handle (i.e. save in ODT, copy, edit etc.) them otherwise
+ bool bConvertToFloating = aFrameProperties.empty() &&
+ nestedTableLevel <= 1 &&
+ m_rDMapper_Impl.IsInFootOrEndnote();
+ bool bFloating = !aFrameProperties.empty() || bConvertToFloating;
+
+ aTableInfo.pTableStyle = endTableGetTableStyle(aTableInfo, aFrameProperties, bConvertToFloating);
// expands to uno::Sequence< Sequence< beans::PropertyValues > >
std::vector<HorizontallyMergedCell> aMerges;
@@ -1392,7 +1440,8 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab
uno::Reference<text::XTextRange> xStart;
uno::Reference<text::XTextRange> xEnd;
- bool bFloating = !aFrameProperties.empty();
+ if ( bConvertToFloating )
+ lcl_fillEmptyFrameProperties(aFrameProperties);
// OOXML table style may contain paragraph properties, apply these on cell paragraphs
if ( m_aTableRanges[0].hasElements() && m_aTableRanges[0][0].hasElements() )
@@ -1585,7 +1634,11 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab
sal_Int32 nTableWidthType = text::SizeType::FIX;
m_aTableProperties->getValue(TablePropertyMap::TABLE_WIDTH_TYPE, nTableWidthType);
if (m_rDMapper_Impl.GetSectionContext() && nestedTableLevel <= 1 && !m_rDMapper_Impl.IsInHeaderFooter())
- m_rDMapper_Impl.m_aPendingFloatingTables.emplace_back(xStart, xEnd, comphelper::containerToSequence(aFrameProperties), nTableWidth, nTableWidthType);
+ {
+ m_rDMapper_Impl.m_aPendingFloatingTables.emplace_back(xStart, xEnd,
+ comphelper::containerToSequence(aFrameProperties),
+ nTableWidth, nTableWidthType, bConvertToFloating);
+ }
else
{
// m_xText points to the body text, get the current xText from m_rDMapper_Impl, in case e.g. we would be in a header.
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
index 900ff747f4cc..5a2a37acd90f 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
@@ -70,7 +70,9 @@ class DomainMapperTableHandler final : public virtual SvRefBase
/// Did we have a foot or endnote in this table?
bool m_bHadFootOrEndnote;
- TableStyleSheetEntry * endTableGetTableStyle(TableInfo & rInfo, std::vector<css::beans::PropertyValue>& rFrameProperties);
+ TableStyleSheetEntry * endTableGetTableStyle(TableInfo & rInfo,
+ std::vector<css::beans::PropertyValue>& rFrameProperties,
+ bool bConvertToFloating);
CellPropertyValuesSeq_t endTableGetCellProperties(TableInfo & rInfo, std::vector<HorizontallyMergedCell>& rMerges);
css::uno::Sequence<css::beans::PropertyValues> endTableGetRowProperties();
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index da78cb682e5c..a3a76dccbf82 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -693,17 +693,25 @@ void DomainMapperTableManager::endOfRowAction()
size_t nWidthsBound = getCurrentGridBefore() + m_nCell.back() - 1;
if (nWidthsBound)
{
- if (nFullWidthRelative == 0)
- throw o3tl::divide_by_zero();
-
::std::vector< sal_uInt32 >::const_iterator aSpansIter = rCurrentSpans.begin();
for( size_t nBorder = 0; nBorder < nWidthsBound; ++nBorder )
{
- double fGridWidth = 0.;
+ double nRelPos, fGridWidth = 0.;
for ( sal_Int32 nGridCount = *aSpansIter; nGridCount > 0; --nGridCount )
fGridWidth += (*pTableGrid)[nBorderGridIndex++];
- double nRelPos = (fGridWidth * 10000) / nFullWidthRelative;
+ if (fGridWidth == 0.)
+ {
+ // allow nFullWidthRelative here, with a sane 0.0 result
+ nRelPos = 0.;
+ }
+ else
+ {
+ if (nFullWidthRelative == 0)
+ throw o3tl::divide_by_zero();
+
+ nRelPos = (fGridWidth * 10000) / nFullWidthRelative;
+ }
pSeparators[nBorder].Position = rtl::math::round(nRelPos + nLastRelPos);
pSeparators[nBorder].IsVisible = true;
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
index 9b30e6dd8315..8c337e6b48c8 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_DOMAINMAPPERTABLEMANAGER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_DOMAINMAPPERTABLEMANAGER_HXX
+#pragma once
#include "TablePropertiesHandler.hxx"
#include "TablePositionHandler.hxx"
@@ -133,6 +132,4 @@ public:
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_DOMAINMAPPERTABLEMANAGER_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index c102d7bcc565..b446190c50b6 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -20,6 +20,7 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
+#include <com/sun/star/xml/sax/SAXException.hpp>
#include <ooxml/resourceids.hxx>
#include "DomainMapper_Impl.hxx"
#include "ConversionHelper.hxx"
@@ -301,6 +302,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_sDefaultParaStyleName(),
m_bInDocDefaultsImport(false),
m_bInStyleSheetImport( false ),
+ m_bInNumberingImport(false),
m_bInAnyTableImport( false ),
m_eInHeaderFooterImport( HeaderFooterImportState::none ),
m_bDiscardHeaderFooter( false ),
@@ -318,6 +320,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bIsFirstParaInSection( true ),
m_bIsFirstParaInSectionAfterRedline( true ),
m_bDummyParaAddedForTableInSection( false ),
+ m_bDummyParaAddedForTableInSectionPage( false ),
m_bTextFrameInserted(false),
m_bIsPreviousParagraphFramed( false ),
m_bIsLastParaInSection( false ),
@@ -352,7 +355,8 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bParaAutoBefore(false),
m_bFirstParagraphInCell(true),
m_bSaveFirstParagraphInCell(false),
- m_bParaWithInlineObject(false)
+ m_bParaWithInlineObject(false),
+ m_bSaxError(false)
{
m_aBaseUrl = rMediaDesc.getUnpackedValueOrDefault(
@@ -568,7 +572,7 @@ void DomainMapper_Impl::RemoveLastParagraph( )
(sizeof(SAL_NEWLINE_STRING)-1 == 2 && xCursor->getString() == "\n"))
{
uno::Reference<beans::XPropertySet> xDocProps(GetTextDocument(), uno::UNO_QUERY);
- const OUString aRecordChanges("RecordChanges");
+ static const OUStringLiteral aRecordChanges(u"RecordChanges");
uno::Any aPreviousValue(xDocProps->getPropertyValue(aRecordChanges));
// disable redlining for this operation, otherwise we might
@@ -628,6 +632,12 @@ void DomainMapper_Impl::SetIsFirstParagraphInShape(bool bIsFirst)
void DomainMapper_Impl::SetIsDummyParaAddedForTableInSection( bool bIsAdded )
{
m_bDummyParaAddedForTableInSection = bIsAdded;
+ m_bDummyParaAddedForTableInSectionPage = bIsAdded;
+}
+
+void DomainMapper_Impl::SetIsDummyParaAddedForTableInSectionPage( bool bIsAdded )
+{
+ m_bDummyParaAddedForTableInSectionPage = bIsAdded;
}
@@ -2579,6 +2589,30 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::P
: xText->createTextCursorByRange(xText->getStart())));
m_bDiscardHeaderFooter = false; // set only on success!
}
+ // If we have *hidden* header footer
+ else if (bLeft && !GetSettingsTable()->GetEvenAndOddHeaders())
+ {
+ bool bIsShared = false;
+ // Turn on the headers
+ xPageStyle->setPropertyValue(getPropertyName(ePropIsOn), uno::makeAny(true));
+ // Store the state of the previous state of shared prop
+ xPageStyle->getPropertyValue(getPropertyName(ePropShared)) >>= bIsShared;
+ // Turn on the shared prop in order to save the headers/footers in time
+ xPageStyle->setPropertyValue(getPropertyName(ePropShared), uno::makeAny(false));
+ // Add the content of the headers footers to the doc
+ uno::Reference<text::XText> xText;
+ xPageStyle->getPropertyValue(getPropertyName(bLeft ? ePropTextLeft : ePropText))
+ >>= xText;
+
+ m_aTextAppendStack.push(
+ TextAppendContext(uno::Reference<text::XTextAppend>(xText, uno::UNO_QUERY_THROW),
+ m_bIsNewDoc ? uno::Reference<text::XTextCursor>()
+ : xText->createTextCursorByRange(xText->getStart())));
+ m_bDiscardHeaderFooter = false; // set only on success!
+ // Restore the original state of the shared prop after we stored the neccessary values.
+ xPageStyle->setPropertyValue(getPropertyName(ePropShared), uno::makeAny(bIsShared));
+ }
+
}
catch( const uno::Exception& )
{
@@ -2941,23 +2975,26 @@ void DomainMapper_Impl::PopFootOrEndnote()
xFootnotes->getByIndex(1) >>= xFootnoteFirst;
else
xEndnotes->getByIndex(1) >>= xFootnoteFirst;
- uno::Reference< text::XText > xSrc( xFootnoteFirst, uno::UNO_QUERY_THROW );
- uno::Reference< text::XText > xDest( xFootnoteLast, uno::UNO_QUERY_THROW );
- uno::Reference< text::XTextCopy > xTxt, xTxt2;
- xTxt.set( xSrc, uno::UNO_QUERY_THROW );
- xTxt2.set( xDest, uno::UNO_QUERY_THROW );
- xTxt2->copyText( xTxt );
-
- // copy its redlines
- std::vector<sal_Int32> redPos, redLen;
- sal_Int32 redIdx;
- enum StoredRedlines eType = IsInFootnote() ? StoredRedlines::FOOTNOTE : StoredRedlines::ENDNOTE;
- lcl_CopyRedlines(xSrc, m_aStoredRedlines[eType], redPos, redLen, redIdx);
- lcl_PasteRedlines(xDest, m_aStoredRedlines[eType], redPos, redLen, redIdx);
-
- // remove processed redlines
- for( size_t i = 0; redIdx > -1 && i <= sal::static_int_cast<size_t>(redIdx) + 2; i++)
- m_aStoredRedlines[eType].pop_front();
+ if (!m_bSaxError)
+ {
+ uno::Reference< text::XText > xSrc( xFootnoteFirst, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XText > xDest( xFootnoteLast, uno::UNO_QUERY_THROW );
+ uno::Reference< text::XTextCopy > xTxt, xTxt2;
+ xTxt.set( xSrc, uno::UNO_QUERY_THROW );
+ xTxt2.set( xDest, uno::UNO_QUERY_THROW );
+ xTxt2->copyText( xTxt );
+
+ // copy its redlines
+ std::vector<sal_Int32> redPos, redLen;
+ sal_Int32 redIdx;
+ enum StoredRedlines eType = IsInFootnote() ? StoredRedlines::FOOTNOTE : StoredRedlines::ENDNOTE;
+ lcl_CopyRedlines(xSrc, m_aStoredRedlines[eType], redPos, redLen, redIdx);
+ lcl_PasteRedlines(xDest, m_aStoredRedlines[eType], redPos, redLen, redIdx);
+
+ // remove processed redlines
+ for( size_t i = 0; redIdx > -1 && i <= sal::static_int_cast<size_t>(redIdx) + 2; i++)
+ m_aStoredRedlines[eType].pop_front();
+ }
// remove temporary footnote
xFootnoteFirst->getAnchor()->setString("");
@@ -7608,7 +7645,16 @@ void DomainMapper_Impl::substream(Id rName,
PushAnnotation();
break;
}
- ref->resolve(m_rDMapper);
+
+ try
+ {
+ ref->resolve(m_rDMapper);
+ }
+ catch (xml::sax::SAXException const&)
+ {
+ m_bSaxError = true;
+ throw;
+ }
switch( rName )
{
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 581d2dba6692..c4d9b5014c04 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -395,16 +395,19 @@ struct FloatingTableInfo
sal_Int32 m_nTableWidthType;
/// Break type of the section that contains this table.
sal_Int32 m_nBreakType = -1;
+ /// Tables in footnotes and endnotes are always floating
+ bool m_bConvertToFloatingInFootnote = false;
FloatingTableInfo(css::uno::Reference<css::text::XTextRange> const& xStart,
css::uno::Reference<css::text::XTextRange> const& xEnd,
const css::uno::Sequence<css::beans::PropertyValue>& aFrameProperties,
- sal_Int32 nTableWidth, sal_Int32 nTableWidthType)
+ sal_Int32 nTableWidth, sal_Int32 nTableWidthType, bool bConvertToFloatingInFootnote)
: m_xStart(xStart),
m_xEnd(xEnd),
m_aFrameProperties(aFrameProperties),
m_nTableWidth(nTableWidth),
- m_nTableWidthType(nTableWidthType)
+ m_nTableWidthType(nTableWidthType),
+ m_bConvertToFloatingInFootnote(bConvertToFloatingInFootnote)
{
}
css::uno::Any getPropertyValue(std::u16string_view propertyName);
@@ -521,6 +524,7 @@ private:
OUString m_sDefaultParaStyleName; //caches the ConvertedStyleName of the default paragraph style
bool m_bInDocDefaultsImport;
bool m_bInStyleSheetImport; //in import of fonts, styles, lists or lfos
+ bool m_bInNumberingImport; //in import of numbering (i.e. numbering.xml)
bool m_bInAnyTableImport; //in import of fonts, styles, lists or lfos
enum class HeaderFooterImportState
{
@@ -565,6 +569,7 @@ private:
bool m_bIsFirstParaInSectionAfterRedline;
bool m_bIsFirstParaInShape = false;
bool m_bDummyParaAddedForTableInSection;
+ bool m_bDummyParaAddedForTableInSectionPage;
bool m_bTextFrameInserted;
bool m_bIsPreviousParagraphFramed;
bool m_bIsLastParaInSection;
@@ -665,6 +670,8 @@ public:
bool GetIsFirstParagraphInShape() const { return m_bIsFirstParaInShape; }
void SetIsDummyParaAddedForTableInSection( bool bIsAdded );
bool GetIsDummyParaAddedForTableInSection() const { return m_bDummyParaAddedForTableInSection;}
+ void SetIsDummyParaAddedForTableInSectionPage(bool bIsAdded);
+ bool GetIsDummyParaAddedForTableInSectionPage() const { return m_bDummyParaAddedForTableInSectionPage; }
/// Track if a textframe has been inserted into this section
void SetIsTextFrameInserted( bool bIsInserted );
@@ -785,6 +792,8 @@ public:
bool IsDocDefaultsImport()const { return m_bInDocDefaultsImport;}
void SetStyleSheetImport( bool bSet ) { m_bInStyleSheetImport = bSet;}
bool IsStyleSheetImport()const { return m_bInStyleSheetImport;}
+ void SetNumberingImport( bool bSet ) { m_bInNumberingImport = bSet;}
+ bool IsNumberingImport() const { return m_bInNumberingImport;}
void SetAnyTableImport( bool bSet ) { m_bInAnyTableImport = bSet;}
bool IsAnyTableImport()const { return m_bInAnyTableImport;}
bool IsInShape()const { return m_aAnchoredStack.size() > 0;}
@@ -986,8 +995,7 @@ public:
m_bFrameDirectionSet = false;
}
void SetFrameDirection(sal_Int16 nDirection) {
- if (!m_bFrameDirectionSet) {
- assert(!m_aFrameDirectionQueue.empty());
+ if (!m_bFrameDirectionSet && !m_aFrameDirectionQueue.empty()) {
m_aFrameDirectionQueue.back() = nDirection;
m_bFrameDirectionSet = true;
}
@@ -1136,6 +1144,8 @@ private:
bool m_bSaveFirstParagraphInCell;
/// Current paragraph had at least one inline object in it.
bool m_bParaWithInlineObject;
+ /// SAXException was seen so document will be abandoned
+ bool m_bSaxError;
};
} //namespace writerfilter::dmapper
diff --git a/writerfilter/source/dmapper/FFDataHandler.hxx b/writerfilter/source/dmapper/FFDataHandler.hxx
index 1603d39b0ad0..f8a88f5c9d6b 100644
--- a/writerfilter/source/dmapper/FFDataHandler.hxx
+++ b/writerfilter/source/dmapper/FFDataHandler.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FFDATAHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FFDATAHANDLER_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <rtl/ustring.hxx>
#include <vector>
@@ -96,6 +95,5 @@ private:
void lcl_attribute(Id name, Value& val) override;
};
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FFDATAHANDLER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/FieldTypes.hxx b/writerfilter/source/dmapper/FieldTypes.hxx
index 7755c3feb7ca..f28d0f03179f 100644
--- a/writerfilter/source/dmapper/FieldTypes.hxx
+++ b/writerfilter/source/dmapper/FieldTypes.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FIELDTYPES_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FIELDTYPES_HXX
+#pragma once
namespace writerfilter::dmapper {
@@ -301,6 +300,5 @@ enum FieldId
};
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FIELDTYPES_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/FontTable.hxx b/writerfilter/source/dmapper/FontTable.hxx
index 1276eaa8d705..0a360b2f14ca 100644
--- a/writerfilter/source/dmapper/FontTable.hxx
+++ b/writerfilter/source/dmapper/FontTable.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FONTTABLE_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FONTTABLE_HXX
+#pragma once
#include <memory>
#include <vector>
@@ -102,6 +101,4 @@ private:
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/FormControlHelper.hxx b/writerfilter/source/dmapper/FormControlHelper.hxx
index f3cb74549226..b1f2620249c0 100644
--- a/writerfilter/source/dmapper/FormControlHelper.hxx
+++ b/writerfilter/source/dmapper/FormControlHelper.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FORMCONTROLHELPER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FORMCONTROLHELPER_HXX
+#pragma once
#include "FFDataHandler.hxx"
#include <com/sun/star/text/XTextDocument.hpp>
@@ -50,6 +49,4 @@ private:
};
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_FORMCONTROLHELPER_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/GraphicHelpers.hxx b/writerfilter/source/dmapper/GraphicHelpers.hxx
index 66fd06c06281..4d9c463945bf 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.hxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_GRAPHICHELPERS_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_GRAPHICHELPERS_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <com/sun/star/text/WrapTextMode.hpp>
@@ -77,6 +76,4 @@ public:
};
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index cc81850bfc86..1aa0a03082a9 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -810,25 +810,51 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
// Include effect extent in the margin to bring Writer layout closer
// to Word. But do this for non-rotated shapes only, where effect
// extents map to increased margins as-is.
+
+ sal_Int32 nLineWidth{};
+ if (xShapeProps->getPropertySetInfo()->hasPropertyByName("LineWidth"))
+ {
+ xShapeProps->getPropertyValue("LineWidth") >>= nLineWidth;
+ }
+
if (m_pImpl->m_oEffectExtentLeft)
{
- m_pImpl->nLeftMargin += oox::drawingml::convertEmuToHmm(
+ sal_Int32 nLeft = oox::drawingml::convertEmuToHmm(
*m_pImpl->m_oEffectExtentLeft);
+ if (nLeft >= nLineWidth / 2)
+ {
+ nLeft -= nLineWidth / 2;
+ }
+ m_pImpl->nLeftMargin += nLeft;
}
if (m_pImpl->m_oEffectExtentTop)
{
- m_pImpl->nTopMargin += oox::drawingml::convertEmuToHmm(
- *m_pImpl->m_oEffectExtentTop);
+ sal_Int32 nTop = oox::drawingml::convertEmuToHmm(*m_pImpl->m_oEffectExtentTop);
+ if (nTop >= nLineWidth / 2)
+ {
+ nTop -= nLineWidth / 2;
+ }
+ m_pImpl->nTopMargin += nTop;
}
if (m_pImpl->m_oEffectExtentRight)
{
- m_pImpl->nRightMargin += oox::drawingml::convertEmuToHmm(
+ sal_Int32 nRight = oox::drawingml::convertEmuToHmm(
*m_pImpl->m_oEffectExtentRight);
+ if (nRight >= nLineWidth / 2)
+ {
+ nRight -= nLineWidth / 2;
+ }
+ m_pImpl->nRightMargin += nRight;
}
if (m_pImpl->m_oEffectExtentBottom)
{
- m_pImpl->nBottomMargin += oox::drawingml::convertEmuToHmm(
+ sal_Int32 nBottom = oox::drawingml::convertEmuToHmm(
*m_pImpl->m_oEffectExtentBottom);
+ if (nBottom >= nLineWidth / 2)
+ {
+ nBottom -= nLineWidth / 2;
+ }
+ m_pImpl->nBottomMargin += nBottom;
}
}
}
diff --git a/writerfilter/source/dmapper/GraphicImport.hxx b/writerfilter/source/dmapper/GraphicImport.hxx
index 9ea3984db23b..d1030b983d82 100644
--- a/writerfilter/source/dmapper/GraphicImport.hxx
+++ b/writerfilter/source/dmapper/GraphicImport.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_GRAPHICIMPORT_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_GRAPHICIMPORT_HXX
+#pragma once
#include <queue>
#include <memory>
@@ -131,6 +130,4 @@ typedef tools::SvRef<GraphicImport> GraphicImportPtr;
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/LatentStyleHandler.hxx b/writerfilter/source/dmapper/LatentStyleHandler.hxx
index db46e974f9f7..52a4d9e7c318 100644
--- a/writerfilter/source/dmapper/LatentStyleHandler.hxx
+++ b/writerfilter/source/dmapper/LatentStyleHandler.hxx
@@ -6,8 +6,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_LATENTSTYLEHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_LATENTSTYLEHANDLER_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <vector>
@@ -33,6 +32,4 @@ public:
} // namespace writerfilter::dmapper
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/LoggedResources.hxx b/writerfilter/source/dmapper/LoggedResources.hxx
index 52ef6a43e9d2..a6f49cf07d29 100644
--- a/writerfilter/source/dmapper/LoggedResources.hxx
+++ b/writerfilter/source/dmapper/LoggedResources.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_LOGGEDRESOURCES_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_LOGGEDRESOURCES_HXX
+#pragma once
#include <sal/config.h>
@@ -133,6 +132,5 @@ protected:
#endif
};
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_LOGGEDRESOURCES_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/MeasureHandler.hxx b/writerfilter/source/dmapper/MeasureHandler.hxx
index 3b70987d5345..8a6f9639eec5 100644
--- a/writerfilter/source/dmapper/MeasureHandler.hxx
+++ b/writerfilter/source/dmapper/MeasureHandler.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_MEASUREHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_MEASUREHANDLER_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <vector>
@@ -58,6 +57,4 @@ public:
typedef tools::SvRef<MeasureHandler> MeasureHandlerPtr;
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/ModelEventListener.hxx b/writerfilter/source/dmapper/ModelEventListener.hxx
index 7080674ff27c..47cd94b80a82 100644
--- a/writerfilter/source/dmapper/ModelEventListener.hxx
+++ b/writerfilter/source/dmapper/ModelEventListener.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_MODELEVENTLISTENER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_MODELEVENTLISTENER_HXX
+#pragma once
#include <com/sun/star/document/XEventListener.hpp>
#include <cppuhelper/implbase.hxx>
@@ -37,6 +36,5 @@ public:
virtual void SAL_CALL disposing(const css::lang::EventObject& Source) override;
};
} //namespace writerfilter::dmapper
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 2143f3b2f04c..ac8a9a4216eb 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -165,10 +165,9 @@ static bool IgnoreForCharStyle(std::u16string_view aStr, const bool bIsSymbol)
//Names found in PropertyIds.cxx, Lines 56-396
return (aStr==u"Adjust" || aStr==u"IndentAt" || aStr==u"FirstLineIndent"
|| aStr==u"FirstLineOffset" || aStr==u"LeftMargin"
- || aStr==u"CharInteropGrabBag" || aStr==u"ParaInteropGrabBag" ||
// We need font names when they are different for the bullet and for the text.
// But leave symbols alone, we only want to keep the font style for letters and numbers.
- (bIsSymbol && aStr==u"CharFontName")
+ || (bIsSymbol && aStr==u"CharFontName")
);
}
uno::Sequence< beans::PropertyValue > ListLevel::GetCharStyleProperties( )
diff --git a/writerfilter/source/dmapper/NumberingManager.hxx b/writerfilter/source/dmapper/NumberingManager.hxx
index 0a4c3e18f8e6..2a1e0204e02d 100644
--- a/writerfilter/source/dmapper/NumberingManager.hxx
+++ b/writerfilter/source/dmapper/NumberingManager.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_NUMBERINGMANAGER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_NUMBERINGMANAGER_HXX
+#pragma once
#include "PropertyMap.hxx"
@@ -254,6 +253,4 @@ public:
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx
index eb04d4782c90..f0279d1dc854 100644
--- a/writerfilter/source/dmapper/OLEHandler.hxx
+++ b/writerfilter/source/dmapper/OLEHandler.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_OLEHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_OLEHANDLER_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <com/sun/star/awt/Size.hpp>
@@ -92,6 +91,4 @@ public:
};
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/PageBordersHandler.hxx b/writerfilter/source/dmapper/PageBordersHandler.hxx
index 4b913c09af1d..537d34b8104b 100644
--- a/writerfilter/source/dmapper/PageBordersHandler.hxx
+++ b/writerfilter/source/dmapper/PageBordersHandler.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PAGEBORDERSHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PAGEBORDERSHANDLER_HXX
+#pragma once
#include "PropertyMap.hxx"
@@ -60,6 +59,4 @@ public:
};
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 5450c0c0dfc6..0100313bdf45 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -360,6 +360,9 @@ OUString getPropertyName( PropertyIds eId )
case PROP_GUTTER_MARGIN:
sName = "GutterMargin";
break;
+ case PROP_RTL_GUTTER:
+ sName = "RtlGutter";
+ break;
}
assert(sName.getLength()>0);
return sName;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 766748116a70..a6afe0c5313f 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PROPERTYIDS_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PROPERTYIDS_HXX
+#pragma once
#include <rtl/ustring.hxx>
@@ -360,6 +359,7 @@ enum PropertyIds
,PROP_CELL_FORMULA
,PROP_CELL_FORMULA_CONVERTED
,PROP_GUTTER_MARGIN
+ ,PROP_RTL_GUTTER
};
//Returns the UNO string equivalent to eId.
@@ -370,6 +370,5 @@ bool isCharacterProperty(const PropertyIds eId);
bool isParagraphProperty(const PropertyIds eId);
} // namespace writerfilter::dmapper
-#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 50af6463fcf1..cc556ddc6330 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -620,10 +620,10 @@ void SectionPropertyMap::ApplyBorderToPageStyles( DomainMapper_Impl& rDM_Impl,
nLineWidth = m_oBorderLines[nBorder]->LineWidth;
if ( xFirst.is() )
SetBorderDistance( xFirst, aMarginIds[nBorder], aBorderDistanceIds[nBorder],
- m_nBorderDistances[nBorder], eOffsetFrom, nLineWidth );
+ m_nBorderDistances[nBorder], eOffsetFrom, nLineWidth, rDM_Impl );
if ( xSecond.is() )
SetBorderDistance( xSecond, aMarginIds[nBorder], aBorderDistanceIds[nBorder],
- m_nBorderDistances[nBorder], eOffsetFrom, nLineWidth );
+ m_nBorderDistances[nBorder], eOffsetFrom, nLineWidth, rDM_Impl );
}
}
@@ -655,7 +655,8 @@ void SectionPropertyMap::SetBorderDistance( const uno::Reference< beans::XProper
PropertyIds eDistId,
sal_Int32 nDistance,
BorderOffsetFrom eOffsetFrom,
- sal_uInt32 nLineWidth )
+ sal_uInt32 nLineWidth,
+ DomainMapper_Impl& rDM_Impl )
{
if (!xStyle.is())
return;
@@ -667,6 +668,25 @@ void SectionPropertyMap::SetBorderDistance( const uno::Reference< beans::XProper
editeng::BorderDistanceFromWord(eOffsetFrom == BorderOffsetFrom::Edge, nMargin, nDistance,
nLineWidth);
+ if (eOffsetFrom == BorderOffsetFrom::Edge)
+ {
+ uno::Any aGutterMargin = xStyle->getPropertyValue( "GutterMargin" );
+ sal_Int32 nGutterMargin = 0;
+ aGutterMargin >>= nGutterMargin;
+
+ if (eMarginId == PROP_LEFT_MARGIN && !rDM_Impl.GetSettingsTable()->GetGutterAtTop())
+ {
+ nMargin -= nGutterMargin;
+ nDistance += nGutterMargin;
+ }
+
+ if (eMarginId == PROP_TOP_MARGIN && rDM_Impl.GetSettingsTable()->GetGutterAtTop())
+ {
+ nMargin -= nGutterMargin;
+ nDistance += nGutterMargin;
+ }
+ }
+
// Change the margins with the border distance
uno::Reference< beans::XMultiPropertySet > xMultiSet( xStyle, uno::UNO_QUERY_THROW );
uno::Sequence<OUString> aProperties { sMarginName, sBorderDistanceName };
@@ -1118,6 +1138,9 @@ void SectionPropertyMap::HandleMarginsHeaderFooter( bool bFirstPage, DomainMappe
bool SectionPropertyMap::FloatingTableConversion( const DomainMapper_Impl& rDM_Impl, FloatingTableInfo& rInfo )
{
+ // always convert non-floating tables to floating ones in footnotes and endnotes
+ if ( rInfo.m_bConvertToFloatingInFootnote )
+ return true;
// This is OOXML version of the code deciding if the table needs to be
// in a floating frame.
// For ww8 code, see SwWW8ImplReader::FloatingTableConversion in
@@ -1368,12 +1391,15 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
// Text area width is known at the end of a section: decide if tables should be converted or not.
std::vector<FloatingTableInfo>& rPendingFloatingTables = rDM_Impl.m_aPendingFloatingTables;
- uno::Reference<text::XTextAppendAndConvert> xBodyText( rDM_Impl.GetBodyText(), uno::UNO_QUERY );
for ( FloatingTableInfo & rInfo : rPendingFloatingTables )
{
rInfo.m_nBreakType = m_nBreakType;
if ( FloatingTableConversion( rDM_Impl, rInfo ) )
{
+ uno::Reference<text::XTextAppendAndConvert> xBodyText(
+ rInfo.m_bConvertToFloatingInFootnote
+ ? rInfo.m_xStart->getText()
+ : rDM_Impl.GetBodyText(), uno::UNO_QUERY );
std::deque<css::uno::Any> aFramedRedlines = rDM_Impl.m_aStoredRedlines[StoredRedlines::FRAME];
try
{
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index f8c976abd388..d5282991f1b5 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PROPERTYMAP_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PROPERTYMAP_HXX
+#pragma once
#include <rtl/ustring.hxx>
#include <tools/ref.hxx>
@@ -316,7 +315,8 @@ private:
PropertyIds eDistId,
sal_Int32 nDistance,
BorderOffsetFrom eOffsetFrom,
- sal_uInt32 nLineWidth );
+ sal_uInt32 nLineWidth,
+ DomainMapper_Impl& rDM_Impl );
// Determines if conversion of a given floating table is wanted or not.
bool FloatingTableConversion( const DomainMapper_Impl& rDM_Impl, FloatingTableInfo& rInfo );
@@ -604,6 +604,4 @@ typedef std::shared_ptr< std::vector<TableParagraph> > TableParagraphVectorPtr;
} // namespace writerfilter::dmapper
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PROPERTYMAP_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/PropertyMapHelper.hxx b/writerfilter/source/dmapper/PropertyMapHelper.hxx
index 044ae1b92f35..472e1bcfa6f5 100644
--- a/writerfilter/source/dmapper/PropertyMapHelper.hxx
+++ b/writerfilter/source/dmapper/PropertyMapHelper.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PROPERTYMAPHELPER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PROPERTYMAPHELPER_HXX
+#pragma once
#include <com/sun/star/beans/PropertyValues.hpp>
@@ -32,6 +31,4 @@ void lcl_DumpPropertyValueSeq(css::uno::Sequence<css::beans::PropertyValues> con
#endif // DBG_UTIL
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_PROPERTYMAPHELPER_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/SdtHelper.hxx b/writerfilter/source/dmapper/SdtHelper.hxx
index e5decd927ad0..13859aab0f2c 100644
--- a/writerfilter/source/dmapper/SdtHelper.hxx
+++ b/writerfilter/source/dmapper/SdtHelper.hxx
@@ -7,8 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_SDTHELPER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_SDTHELPER_HXX
+#pragma once
#include <vector>
@@ -111,6 +110,4 @@ public:
} // namespace writerfilter::dmapper
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/SectionColumnHandler.hxx b/writerfilter/source/dmapper/SectionColumnHandler.hxx
index 70c9d6d7209f..cbef67460ed7 100644
--- a/writerfilter/source/dmapper/SectionColumnHandler.hxx
+++ b/writerfilter/source/dmapper/SectionColumnHandler.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_SECTIONCOLUMNHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_SECTIONCOLUMNHANDLER_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <vector>
@@ -60,6 +59,4 @@ public:
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
index 79defda867df..431bb5d7c671 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_SETTINGSTABLE_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_SETTINGSTABLE_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <com/sun/star/text/XTextDocument.hpp>
@@ -107,6 +106,4 @@ private:
typedef tools::SvRef<SettingsTable> SettingsTablePtr;
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/SmartTagHandler.hxx b/writerfilter/source/dmapper/SmartTagHandler.hxx
index ef3dd1243231..7999b9dcc22a 100644
--- a/writerfilter/source/dmapper/SmartTagHandler.hxx
+++ b/writerfilter/source/dmapper/SmartTagHandler.hxx
@@ -6,8 +6,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_SMARTTAGHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_SMARTTAGHANDLER_HXX
+#pragma once
#include <vector>
@@ -58,6 +57,4 @@ public:
} // namespace writerfilter::dmapper
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx
index 69469d19d37a..ade93bb5da4d 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.hxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_STYLESHEETTABLE_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_STYLESHEETTABLE_HXX
+#pragma once
#include <memory>
#include "TblStylePrHandler.hxx"
@@ -145,6 +144,4 @@ private:
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TDefTableHandler.hxx b/writerfilter/source/dmapper/TDefTableHandler.hxx
index 3c9ca8daf73f..17e6f2ed4fab 100644
--- a/writerfilter/source/dmapper/TDefTableHandler.hxx
+++ b/writerfilter/source/dmapper/TDefTableHandler.hxx
@@ -16,8 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TDEFTABLEHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TDEFTABLEHANDLER_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <vector>
@@ -70,6 +69,4 @@ public:
};
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TableData.hxx b/writerfilter/source/dmapper/TableData.hxx
index 78ddf86ec049..a863e9d9fdd7 100644
--- a/writerfilter/source/dmapper/TableData.hxx
+++ b/writerfilter/source/dmapper/TableData.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEDATA_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEDATA_HXX
+#pragma once
#include <com/sun/star/text/XTextRange.hpp>
@@ -388,6 +387,4 @@ public:
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_RESOURCEMODEL_TABLEDATA_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx
index 2dcf679e135f..aa611e412b59 100644
--- a/writerfilter/source/dmapper/TableManager.hxx
+++ b/writerfilter/source/dmapper/TableManager.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEMANAGER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEMANAGER_HXX
+#pragma once
#include <memory>
#include <stack>
@@ -112,7 +111,14 @@ class TableManager : public virtual SvRefBase
void resetCellProps()
{
- mpCellProps = getTableExceptionProps();
+ // copy tblPrEx table exception properties, if they exist
+ if (getTableExceptionProps().is())
+ {
+ mpCellProps = new TablePropertyMap;
+ mpCellProps->InsertProps(getTableExceptionProps().get());
+ }
+ else
+ mpCellProps.clear();
}
void setCellProps(TablePropertyMapPtr pProps)
@@ -147,6 +153,8 @@ class TableManager : public virtual SvRefBase
void setTableExceptionProps(TablePropertyMapPtr pProps)
{
mpTableExceptionProps = pProps;
+ // set table exception properties of the first cell
+ resetCellProps();
}
const TablePropertyMapPtr& getTableExceptionProps() const
@@ -519,6 +527,4 @@ public:
-#endif // INCLUDED_WRITERFILTER_INC_RESOURCEMODEL_TABLEMANAGER_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TablePositionHandler.hxx b/writerfilter/source/dmapper/TablePositionHandler.hxx
index 0a9a29d61f37..23d042b69d2a 100644
--- a/writerfilter/source/dmapper/TablePositionHandler.hxx
+++ b/writerfilter/source/dmapper/TablePositionHandler.hxx
@@ -6,8 +6,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPOSITIONHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPOSITIONHANDLER_HXX
+#pragma once
#include "LoggedResources.hxx"
@@ -66,6 +65,4 @@ public:
using TablePositionHandlerPtr = tools::SvRef<TablePositionHandler>;
} // namespace writerfilter::dmapper
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.hxx b/writerfilter/source/dmapper/TablePropertiesHandler.hxx
index 6ba81cf9010f..bd0901356418 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.hxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPROPERTIESHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPROPERTIESHANDLER_HXX
+#pragma once
#include "PropertyMap.hxx"
@@ -92,6 +91,4 @@ private:
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TagLogger.cxx b/writerfilter/source/dmapper/TagLogger.cxx
index a7443f056d29..1e9c14aa8066 100644
--- a/writerfilter/source/dmapper/TagLogger.cxx
+++ b/writerfilter/source/dmapper/TagLogger.cxx
@@ -69,7 +69,7 @@ namespace writerfilter
pWriter = xmlNewTextWriterFilename( fileName.c_str(), 0 );
xmlTextWriterSetIndent(pWriter,1);
- xmlTextWriterSetIndentString(pWriter, BAD_CAST(" "));
+ (void)xmlTextWriterSetIndentString(pWriter, BAD_CAST(" "));
xmlTextWriterSetIndent( pWriter, 4 );
}
@@ -77,15 +77,15 @@ namespace writerfilter
{
if (!pWriter)
return;
- xmlTextWriterStartDocument( pWriter, nullptr, nullptr, nullptr );
- xmlTextWriterStartElement( pWriter, BAD_CAST( "root" ) );
+ (void)xmlTextWriterStartDocument( pWriter, nullptr, nullptr, nullptr );
+ (void)xmlTextWriterStartElement( pWriter, BAD_CAST( "root" ) );
}
void TagLogger::endDocument()
{
if (!pWriter)
return;
- xmlTextWriterEndDocument( pWriter );
+ (void)xmlTextWriterEndDocument( pWriter );
xmlFreeTextWriter( pWriter );
pWriter = nullptr;
}
@@ -149,7 +149,7 @@ struct TheTagLogger:
if (!pWriter)
return;
xmlChar* xmlName = xmlCharStrdup( name.c_str() );
- xmlTextWriterStartElement( pWriter, xmlName );
+ (void)xmlTextWriterStartElement( pWriter, xmlName );
xmlFree( xmlName );
}
#endif
@@ -160,7 +160,7 @@ struct TheTagLogger:
return;
xmlChar* xmlName = xmlCharStrdup( name.c_str() );
xmlChar* xmlValue = xmlCharStrdup( value.c_str() );
- xmlTextWriterWriteAttribute( pWriter, xmlName, xmlValue );
+ (void)xmlTextWriterWriteAttribute( pWriter, xmlName, xmlValue );
xmlFree( xmlValue );
xmlFree( xmlName );
@@ -177,7 +177,7 @@ struct TheTagLogger:
if (!pWriter)
return;
xmlChar* xmlName = xmlCharStrdup( name.c_str() );
- xmlTextWriterWriteFormatAttribute( pWriter, xmlName,
+ (void)xmlTextWriterWriteFormatAttribute( pWriter, xmlName,
"%" SAL_PRIuUINT32, value );
xmlFree( xmlName );
}
@@ -194,12 +194,12 @@ struct TheTagLogger:
xmlChar* xmlName = xmlCharStrdup( name.c_str() );
if ( aAny >>= nInt )
{
- xmlTextWriterWriteFormatAttribute( pWriter, xmlName,
+ (void)xmlTextWriterWriteFormatAttribute( pWriter, xmlName,
"%" SAL_PRIdINT32, nInt );
}
else if ( aAny >>= nFloat )
{
- xmlTextWriterWriteFormatAttribute( pWriter, xmlName,
+ (void)xmlTextWriterWriteFormatAttribute( pWriter, xmlName,
"%f", nFloat );
}
else if ( aAny >>= aStr )
@@ -214,7 +214,7 @@ struct TheTagLogger:
if (!pWriter)
return;
xmlChar* xmlChars = xmlCharStrdup( rChars.c_str() );
- xmlTextWriterWriteString( pWriter, xmlChars );
+ (void)xmlTextWriterWriteString( pWriter, xmlChars );
xmlFree( xmlChars );
}
@@ -227,7 +227,7 @@ struct TheTagLogger:
{
if (!pWriter)
return;
- xmlTextWriterEndElement( pWriter );
+ (void)xmlTextWriterEndElement( pWriter );
}
#endif
diff --git a/writerfilter/source/dmapper/TagLogger.hxx b/writerfilter/source/dmapper/TagLogger.hxx
index f28b58b59f26..33da346eec12 100644
--- a/writerfilter/source/dmapper/TagLogger.hxx
+++ b/writerfilter/source/dmapper/TagLogger.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TAGLOGGER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TAGLOGGER_HXX
+#pragma once
#include <rtl/ustring.hxx>
#include <tools/ref.hxx>
@@ -63,6 +62,4 @@ namespace writerfilter
};
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TAGLOGGER_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TblStylePrHandler.hxx b/writerfilter/source/dmapper/TblStylePrHandler.hxx
index df493eb11187..4be7d379a647 100644
--- a/writerfilter/source/dmapper/TblStylePrHandler.hxx
+++ b/writerfilter/source/dmapper/TblStylePrHandler.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TBLSTYLEPRHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TBLSTYLEPRHANDLER_HXX
+#pragma once
#include "TablePropertiesHandler.hxx"
@@ -80,6 +79,4 @@ private:
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TextEffectsHandler.hxx b/writerfilter/source/dmapper/TextEffectsHandler.hxx
index d7df31d85515..22127c6c81b2 100644
--- a/writerfilter/source/dmapper/TextEffectsHandler.hxx
+++ b/writerfilter/source/dmapper/TextEffectsHandler.hxx
@@ -8,8 +8,7 @@
*
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TEXTEFFECTSHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TEXTEFFECTSHANDLER_HXX
+#pragma once
#include "LoggedResources.hxx"
@@ -67,6 +66,4 @@ public:
};
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TEXTEFFECTSHANDLER_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/ThemeTable.hxx b/writerfilter/source/dmapper/ThemeTable.hxx
index eed737020247..164f083c9ea3 100644
--- a/writerfilter/source/dmapper/ThemeTable.hxx
+++ b/writerfilter/source/dmapper/ThemeTable.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_THEMETABLE_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_THEMETABLE_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -56,6 +55,4 @@ private:
typedef tools::SvRef<ThemeTable> ThemeTablePtr;
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/TrackChangesHandler.hxx b/writerfilter/source/dmapper/TrackChangesHandler.hxx
index bd29fc4a20b2..b3417ccced1f 100644
--- a/writerfilter/source/dmapper/TrackChangesHandler.hxx
+++ b/writerfilter/source/dmapper/TrackChangesHandler.hxx
@@ -6,8 +6,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TRACKCHANGESHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TRACKCHANGESHANDLER_HXX
+#pragma once
#include "LoggedResources.hxx"
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -38,6 +37,4 @@ public:
};
}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.hxx b/writerfilter/source/dmapper/WrapPolygonHandler.hxx
index 2267ce8f35e8..8d3e1a3d8493 100644
--- a/writerfilter/source/dmapper/WrapPolygonHandler.hxx
+++ b/writerfilter/source/dmapper/WrapPolygonHandler.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_WRAPPOLYGONHANDLER_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_WRAPPOLYGONHANDLER_HXX
+#pragma once
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include "LoggedResources.hxx"
@@ -80,6 +79,4 @@ private:
};
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_WRAPPOLYGONHANDLER_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/util.hxx b/writerfilter/source/dmapper/util.hxx
index 5a94a5d0932d..9d172331a7ca 100644
--- a/writerfilter/source/dmapper/util.hxx
+++ b/writerfilter/source/dmapper/util.hxx
@@ -17,8 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_UTIL_HXX
-#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_UTIL_HXX
+#pragma once
#include <com/sun/star/text/XTextRange.hpp>
#include <string>
@@ -30,6 +29,4 @@ std::string XTextRangeToString(css::uno::Reference<css::text::XTextRange> const&
void resolveSprmProps(Properties& rHandler, Sprm& rSprm);
}
-#endif // INCLUDED_WRITERFILTER_SOURCE_DMAPPER_UTIL_HXX
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */