[Libreoffice-commits] core.git: writerfilter/source

2018-05-14 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper.cxx  |4 ++--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   11 +--
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |6 +++---
 3 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 36839898fadddee155fb73e70d16e1eea4f5f9f0
Author: Justin Luth 
Date:   Wed May 9 18:43:54 2018 +0300

writerfilter NFC: save ConvertedParaStyleName, not WW8Name

and rename m_sCurrentParaStyleId -> m_sCurrentParaStyleName

This is prep work for tdf#117504, where the value
saved in m_sCurrentParaStyleId is not accurate. Since the
actual value saved inside the paragraph properties is the
ConvertStyleName(), lets use the LO-version of the
style name, so that FindStyleSheetByConvertedStyleName()
can be used for either the paragraph's PropertyValue or
m_pImpl->m_sCurrentParaStyleName.

Change-Id: I8aed80094417ea91f2515e666dc05ecbb021a128
Reviewed-on: https://gerrit.libreoffice.org/54084
Reviewed-by: Justin Luth 
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 41e35e0bad04..cbcce6bda2ef 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2115,9 +2115,9 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 break;
 case NS_ooxml::LN_CT_PPrBase_pStyle:
 {
-m_pImpl->SetCurrentParaStyleId( sStringValue );
 StyleSheetTablePtr pStyleTable = m_pImpl->GetStyleSheetTable();
 const OUString sConvertedStyleName = pStyleTable->ConvertStyleName( 
sStringValue, true );
+m_pImpl->SetCurrentParaStyleName( sConvertedStyleName );
 if (m_pImpl->GetTopContext() && m_pImpl->GetTopContextType() != 
CONTEXT_SECTION)
 {
 m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, 
uno::makeAny( sConvertedStyleName ));
@@ -2947,7 +2947,7 @@ void DomainMapper::lcl_startParagraphGroup()
 if (!m_pImpl->IsInShape())
 {
 m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, 
uno::makeAny( OUString("Standard") ) ); //ConvertedStyleName
-m_pImpl->SetCurrentParaStyleId("Normal"); //WW8 name
+m_pImpl->SetCurrentParaStyleName("Standard");
 }
 if (m_pImpl->isBreakDeferred(PAGE_BREAK))
 m_pImpl->GetTopContext()->Insert(PROP_BREAK_TYPE, 
uno::makeAny(style::BreakType_PAGE_BEFORE));
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 99c520c30aa5..3cd7492538a5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -206,7 +206,7 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_sCurrentPermId(0),
 m_pLastSectionContext( ),
 m_pLastCharacterContext(),
-m_sCurrentParaStyleId(),
+m_sCurrentParaStyleName(),
 m_bInStyleSheetImport( false ),
 m_bInAnyTableImport( false ),
 m_bInHeaderFooterImport( false ),
@@ -657,8 +657,7 @@ uno::Any 
DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId)
 if( m_bInStyleSheetImport )
 pEntry = GetStyleSheetTable()->FindParentStyleSheet(OUString());
 else
-pEntry =
-
GetStyleSheetTable()->FindStyleSheetByISTD(GetCurrentParaStyleId());
+pEntry = 
GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(GetCurrentParaStyleName());
 while(pEntry.get( ) )
 {
 //is there a tab stop set?
@@ -1114,7 +1113,7 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap )
 //does not specify the numbering
 if( pParaContext && !pParaContext->isSet(PROP_NUMBERING_RULES) )
 {
-const StyleSheetEntryPtr pEntry = 
GetStyleSheetTable()->FindStyleSheetByISTD( GetCurrentParaStyleId() );
+const StyleSheetEntryPtr pEntry = 
GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( 
GetCurrentParaStyleName() );
 OSL_ENSURE( pEntry.get(), "no style sheet found" );
 const StyleSheetPropertyMap* pStyleSheetProperties = 
dynamic_cast(pEntry ? pEntry->pProperties.get() : 
nullptr);
 
@@ -5497,10 +5496,10 @@ uno::Reference 
DomainMapper_Impl::GetCurrentNumberingRu
 uno::Reference xRet;
 try
 {
-OUString aStyle = GetCurrentParaStyleId();
+OUString aStyle = GetCurrentParaStyleName();
 if (aStyle.isEmpty())
 return xRet;
-const StyleSheetEntryPtr pEntry = 
GetStyleSheetTable()->FindStyleSheetByISTD(aStyle);
+const StyleSheetEntryPtr pEntry = 
GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(aStyle);
 if (!pEntry)
 return 

[Libreoffice-commits] core.git: writerfilter/source writerperfect/source

2018-05-10 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfsprm.cxx   |4 ++--
 writerfilter/source/rtftok/rtfsprm.hxx   |2 +-
 writerperfect/source/writer/EPUBExportDialog.cxx |2 +-
 writerperfect/source/writer/exp/txtparai.cxx |1 -
 4 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 7e0f06f412bce0f2dd896cb4159e99a150778c40
Author: Miklos Vajna 
Date:   Thu May 10 09:31:46 2018 +0200

writerfilter, writerperfect: various small cleanups

Change-Id: Iea26b73bd91ed178cc4f2279c23246d79f48a6be
Reviewed-on: https://gerrit.libreoffice.org/54063
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerfilter/source/rtftok/rtfsprm.cxx 
b/writerfilter/source/rtftok/rtfsprm.cxx
index 89d520c391bb..f768785a5cba 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -242,7 +242,7 @@ static void cloneAndDeduplicateSprm(std::pair const& rS
 }
 
 /// Extracts the list level matching nLevel from pAbstract.
-static RTFValue::Pointer_t getListLevel(RTFValue::Pointer_t pAbstract, int 
nLevel)
+static RTFValue::Pointer_t getListLevel(const RTFValue::Pointer_t& pAbstract, 
int nLevel)
 {
 for (const auto& rPair : pAbstract->getSprms())
 {
@@ -287,7 +287,7 @@ void RTFSprms::deduplicateList(const std::map& 
rInvalidListLevelFirstI
 eraseNestedAttribute(*this, NS_ooxml::LN_CT_PPrBase_ind, 
NS_ooxml::LN_CT_Ind_firstLine);
 }
 
-void RTFSprms::duplicateList(RTFValue::Pointer_t pAbstract)
+void RTFSprms::duplicateList(const RTFValue::Pointer_t& pAbstract)
 {
 int nLevel = 0;
 RTFValue::Pointer_t pLevelId
diff --git a/writerfilter/source/rtftok/rtfsprm.hxx 
b/writerfilter/source/rtftok/rtfsprm.hxx
index 79694e5864bd..2c4247925f8b 100644
--- a/writerfilter/source/rtftok/rtfsprm.hxx
+++ b/writerfilter/source/rtftok/rtfsprm.hxx
@@ -58,7 +58,7 @@ public:
 /// (yes, really; that's what Word does).
 RTFSprms cloneAndDeduplicate(RTFSprms& rReference) const;
 /// Inserts default values to override attributes of pAbstract.
-void duplicateList(RTFValue::Pointer_t pAbstract);
+void duplicateList(const RTFValue::Pointer_t& pAbstract);
 /// Removes duplicated values based on in-list properties.
 void deduplicateList(const std::map& 
rInvalidListLevelFirstIndents);
 std::size_t size() const { return m_pSprms->size(); }
diff --git a/writerperfect/source/writer/EPUBExportDialog.cxx 
b/writerperfect/source/writer/EPUBExportDialog.cxx
index fa9bc9193992..935858dfd27d 100644
--- a/writerperfect/source/writer/EPUBExportDialog.cxx
+++ b/writerperfect/source/writer/EPUBExportDialog.cxx
@@ -221,7 +221,7 @@ IMPL_LINK_NOARG(EPUBExportDialog, OKClickHdl, 
weld::Button&, void)
 m_xDialog->response(RET_OK);
 }
 
-EPUBExportDialog::~EPUBExportDialog() {}
+EPUBExportDialog::~EPUBExportDialog() = default;
 
 } // namespace writerperfect
 
diff --git a/writerperfect/source/writer/exp/txtparai.cxx 
b/writerperfect/source/writer/exp/txtparai.cxx
index 297c5824ccf8..3a5d6bf44d46 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -202,7 +202,6 @@ private:
 XMLRubyContext::XMLRubyContext(XMLImport& rImport,
const librevenge::RVNGPropertyList& 
rPropertyList)
 : XMLImportContext(rImport)
-, m_sRubyText()
 {
 // Inherit properties from parent.
 librevenge::RVNGPropertyList::Iter itProp(rPropertyList);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-05-09 Thread Justin Luth
 writerfilter/source/dmapper/NumberingManager.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ac27f4e7abf5339f71d4f5f3fc09a13b25669fe4
Author: Justin Luth 
Date:   Sat Apr 21 11:35:31 2018 +0300

tdf#117137: DOCX import: don't try to set grab-bag as UNO prop

This modifies commit a6f2199e9888cb75960f1d35034bd44fb45e5565
"DOCX import: don't try to set grab-gag props as UNO props"

Perhaps that commit should simply be reverted, but I will trust
that the commit was mostly OK and simply adjust the logic so
that *InteropGrabBag is ignored as before.

Doing this resolves MSO being unable to open a specific document
and LO missing some numbering during LO round-tripping.
Probably these are just side-effects from other locations in the
code that couldn't deal with these unexpected properties. For
example, the numbering.xml file is malformed, since it is
missing the w14: namespace.

Unfortunately, I failed in my attempt to create a minimal
test document.

Change-Id: Idf88cd09d96546b7f03d326afb5f6e58439bcf20
Reviewed-on: https://gerrit.libreoffice.org/53271
Tested-by: Jenkins 
Reviewed-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 02f49c62c67e..c76c3824f70c 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -218,7 +218,7 @@ uno::Sequence< beans::PropertyValue > 
ListLevel::GetCharStyleProperties( )
 {
 if (IgnoreForCharStyle(aValIter->Name))
 continue;
-else
+else if ( aValIter->Name != "CharInteropGrabBag" && aValIter->Name != 
"ParaInteropGrabBag" )
 rProperties.emplace_back(aValIter->Name, 0, aValIter->Value, 
beans::PropertyState_DIRECT_VALUE);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-03-23 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d47c84a5fd38c1aa28fe6e3144b4efd0226f8f97
Author: Justin Luth 
Date:   Wed Mar 21 20:47:11 2018 +0300

comment: Word does not use tabs in footnote implementation

Tabs are inserted when LO exports to MS formats in an attempt to
emulate its "magical" spacing which uses the paragraph margin.

By default, the Footnote paragraph style has a paragraph margin of
0.60cm. A hanging indent places the footnote character before the
margin, and thus a tab advances to the margin. So the emulation
works well.

The previous comment was misleading because it suggests that this
was a Microsoft convention, but actually this is an OOo innovation.

Change-Id: Ie8708998457bcb3363bbc760086cf2b41d3eb104
Reviewed-on: https://gerrit.libreoffice.org/51753
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 3526f8b38a69..7755480dffed 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1827,9 +1827,9 @@ void DomainMapper_Impl::PushFootOrEndnote( bool 
bIsFootnote )
 // Redlines for the footnote anchor
 CheckRedline( xFootnote->getAnchor( ) );
 
-// Word has a leading tab on footnotes, but we may implement space
-// between the footnote number and text using a paragraph margin, not a
-// tab (Writer default). So ignore that in case there is a margin set.
+// LO inserts a tab when exporting to MS formats in order to emulate 
its automatic space
+// between the footnote number and text using the paragraph margin.
+// So ignore that tab when there is a margin set.
 uno::Reference xStylesSupplier( 
GetTextDocument(), uno::UNO_QUERY);
 uno::Reference xStyleFamilies = 
xStylesSupplier->getStyleFamilies();
 uno::Reference xStyles;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-03-19 Thread Caolán McNamara
 writerfilter/source/ooxml/OOXMLPropertySet.cxx |7 ++-
 writerfilter/source/ooxml/OOXMLPropertySet.hxx |1 -
 2 files changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 6b8362acf9e496d5c76e16b6830d63020da77930
Author: Caolán McNamara 
Date:   Mon Mar 19 15:02:25 2018 +

coverity#1430069 silence Uninitialized scalar field

Change-Id: I54b2140d965fc9c7dddfdcbddd9602ede800c3f7
Reviewed-on: https://gerrit.libreoffice.org/51566
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx 
b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index 13c5cf0493b7..82ccae8cab37 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -582,12 +582,9 @@ string OOXMLHexValue::toString() const
   class OOXMLHexColorValue
 */
 OOXMLHexColorValue::OOXMLHexColorValue(const char * pValue)
+: OOXMLHexValue(sal_uInt32(COL_AUTO))
 {
-if (!strcmp(pValue, "auto"))
-{
-mnValue = sal_uInt32(COL_AUTO);
-}
-else
+if (strcmp(pValue, "auto"))
 {
 mnValue = rtl_str_toUInt32(pValue, 16);
 }
diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.hxx 
b/writerfilter/source/ooxml/OOXMLPropertySet.hxx
index d8c38d87d904..327d3dd09a32 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.hxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.hxx
@@ -213,7 +213,6 @@ class OOXMLHexValue : public OOXMLValue
 {
 protected:
 sal_uInt32 mnValue;
-OOXMLHexValue() {}
 public:
 explicit OOXMLHexValue(sal_uInt32 nValue);
 explicit OOXMLHexValue(const char * pValue);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-03-14 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfsprm.cxx |8 
 writerfilter/source/rtftok/rtfsprm.hxx |   15 +++
 2 files changed, 7 insertions(+), 16 deletions(-)

New commits:
commit 80f9383f1adf3a42c22765c7c8bee8e705e39d0b
Author: Miklos Vajna 
Date:   Tue Mar 13 22:12:05 2018 +0100

boost::intrusive_ptr->tools::SvRef

To avoid semi-manual refcount handling.

Change-Id: I4a0bcd00ef2811a76f85313d2f821daa1731898c
Reviewed-on: https://gerrit.libreoffice.org/51242
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerfilter/source/rtftok/rtfsprm.cxx 
b/writerfilter/source/rtftok/rtfsprm.cxx
index e021feee623c..271ad821cef3 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -273,9 +273,9 @@ bool RTFSprms::equals(RTFValue& rOther)
 
 void RTFSprms::ensureCopyBeforeWrite()
 {
-if (m_pSprms->m_nRefCount > 1)
+if (m_pSprms->GetRefCount() > 1)
 {
-boost::intrusive_ptr pClone(new RTFSprmsImpl);
+tools::SvRef pClone(new RTFSprmsImpl);
 for (auto& rSprm : *m_pSprms)
 pClone->push_back(
 std::make_pair(rSprm.first, 
RTFValue::Pointer_t(rSprm.second->Clone(;
@@ -294,10 +294,10 @@ RTFSprms::RTFSprms(const RTFSprms& rSprms) { *this = 
rSprms; }
 
 void RTFSprms::clear()
 {
-if (m_pSprms->m_nRefCount == 1)
+if (m_pSprms->GetRefCount() == 1)
 return m_pSprms->clear();
 
-m_pSprms.reset(new RTFSprmsImpl);
+m_pSprms = tools::SvRef(new RTFSprmsImpl);
 }
 
 } // namespace rtftok
diff --git a/writerfilter/source/rtftok/rtfsprm.hxx 
b/writerfilter/source/rtftok/rtfsprm.hxx
index 7839682343b8..bb9228074277 100644
--- a/writerfilter/source/rtftok/rtfsprm.hxx
+++ b/writerfilter/source/rtftok/rtfsprm.hxx
@@ -14,7 +14,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include "rtfvalue.hxx"
 
 namespace writerfilter
@@ -24,19 +24,10 @@ namespace rtftok
 using RTFSprmsImplBase = std::vector>;
 
 /// The payload of RTFSprms which is only copied on write.
-class RTFSprmsImpl : public RTFSprmsImplBase
+class RTFSprmsImpl : public RTFSprmsImplBase, public SvRefBase
 {
-public:
-sal_Int32 m_nRefCount = 0;
 };
 
-inline void intrusive_ptr_add_ref(RTFSprmsImpl* p) { ++(p->m_nRefCount); }
-inline void intrusive_ptr_release(RTFSprmsImpl* p)
-{
-if (!--(p->m_nRefCount))
-delete p;
-}
-
 enum class RTFOverwrite
 {
 YES, ///< Yes, if an existing key is found, overwrite it.
@@ -75,7 +66,7 @@ public:
 
 private:
 void ensureCopyBeforeWrite();
-boost::intrusive_ptr m_pSprms;
+tools::SvRef m_pSprms;
 };
 
 /// RTF keyword with a parameter
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-03-13 Thread Mike Kaganski
 writerfilter/source/dmapper/DomainMapper.cxx   |1 -
 writerfilter/source/dmapper/PageBordersHandler.cxx |1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6d20aeeda8a346ac10782d44214a89878fd00c40
Author: Mike Kaganski 
Date:   Tue Mar 13 09:20:57 2018 +0100

If handler sets contexts properties, it should do it properly

Change-Id: I0b58ab924214e1cbbc89af94c037e29d14d45856
Reviewed-on: https://gerrit.libreoffice.org/51195
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 5af309e1cbcf..60f65a481084 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2093,7 +2093,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 
 // Set the borders to the context and apply them to the styles
 pHandler->SetBorders( pSectionContext );
-pSectionContext->SetBorderParams( pHandler->GetDisplayOffset( ) );
 }
 }
 break;
diff --git a/writerfilter/source/dmapper/PageBordersHandler.cxx 
b/writerfilter/source/dmapper/PageBordersHandler.cxx
index f9fe9685692b..fc1867be3c80 100644
--- a/writerfilter/source/dmapper/PageBordersHandler.cxx
+++ b/writerfilter/source/dmapper/PageBordersHandler.cxx
@@ -137,6 +137,7 @@ void PageBordersHandler::SetBorders( SectionPropertyMap* 
pSectContext )
 {
 pSectContext->SetBorder( rBorder.m_ePos, rBorder.m_nDistance, 
rBorder.m_rLine, rBorder.m_bShadow );
 }
+pSectContext->SetBorderParams(GetDisplayOffset());
 }
 
 } }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-03-08 Thread Tomaž Vajngerl
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   45 -
 1 file changed, 16 insertions(+), 29 deletions(-)

New commits:
commit 060b0fb4b93ee09770ed9398cca46e365dda5be8
Author: Tomaž Vajngerl 
Date:   Thu Mar 8 16:37:46 2018 +0900

change RTFDocumentImpl to use Graphic instead of GraphicURL

Change-Id: I4d2f7dd540651a54e4da3dedf315a61a4f8a75cc
Reviewed-on: https://gerrit.libreoffice.org/50924
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a499234f1d80..c5d603bd1fa4 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -840,27 +840,24 @@ void RTFDocumentImpl::resolvePict(bool const bInline, 
uno::ReferencesupportsService("com.sun.star.text.TextFrame"))
 pExtHeader = nullptr;
-OUString aGraphicUrl = m_pGraphicHelper->importGraphicObject(xInputStream, 
pExtHeader);
+
+uno::Reference xGraphic;
+xGraphic = m_pGraphicHelper->importGraphic(xInputStream, pExtHeader);
 
 if (m_aStates.top().aPicture.eStyle != RTFBmpStyle::NONE)
 {
 // In case of PNG/JPEG, the real size is known, don't use the values
 // provided by picw and pich.
-OString aURLBS(OUStringToOString(aGraphicUrl, RTL_TEXTENCODING_UTF8));
-const char aURLBegin[] = "vnd.sun.star.GraphicObject:";
-if (aURLBS.startsWith(aURLBegin))
-{
-Graphic aGraphic = 
GraphicObject(aURLBS.copy(RTL_CONSTASCII_LENGTH(aURLBegin)))
-   .GetTransformedGraphic();
-Size aSize(aGraphic.GetPrefSize());
-MapMode aMap(MapUnit::Map100thMM);
-if (aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
-aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, 
aMap);
-else
-aSize = OutputDevice::LogicToLogic(aSize, 
aGraphic.GetPrefMapMode(), aMap);
-m_aStates.top().aPicture.nWidth = aSize.Width();
-m_aStates.top().aPicture.nHeight = aSize.Height();
-}
+
+Graphic aGraphic(xGraphic);
+Size aSize(aGraphic.GetPrefSize());
+MapMode aMap(MapUnit::Map100thMM);
+if (aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel)
+aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMap);
+else
+aSize = OutputDevice::LogicToLogic(aSize, 
aGraphic.GetPrefMapMode(), aMap);
+m_aStates.top().aPicture.nWidth = aSize.Width();
+m_aStates.top().aPicture.nHeight = aSize.Height();
 }
 
 // Wrap it in an XShape.
@@ -895,20 +892,13 @@ void RTFDocumentImpl::resolvePict(bool const bInline, 
uno::Reference xPropertySet(xShape, uno::UNO_QUERY);
 
+if (xPropertySet.is())
+xPropertySet->setPropertyValue("Graphic", uno::Any(xGraphic));
+
 // check if the picture is in an OLE object and if the \objdata element is 
used
 // (see RTF_OBJECT in RTFDocumentImpl::dispatchDestination)
 if (m_bObject)
 {
-// Set bitmap
-beans::PropertyValues aMediaProperties(1);
-aMediaProperties[0].Name = "URL";
-aMediaProperties[0].Value <<= aGraphicUrl;
-uno::Reference xGraphicProvider(
-graphic::GraphicProvider::create(m_xContext));
-uno::Reference xGraphic
-= xGraphicProvider->queryGraphic(aMediaProperties);
-xPropertySet->setPropertyValue("Graphic", uno::Any(xGraphic));
-
 // Set the object size
 awt::Size aSize;
 aSize.Width = (m_aStates.top().aPicture.nGoalWidth ? 
m_aStates.top().aPicture.nGoalWidth
@@ -926,9 +916,6 @@ void RTFDocumentImpl::resolvePict(bool const bInline, 
uno::ReferencesetPropertyValue("GraphicURL", uno::Any(aGraphicUrl));
-
 if (m_aStates.top().bInListpicture)
 {
 // Send the shape directly, no section is started, to additional 
properties will be ignored anyway.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-03-04 Thread Caolán McNamara
 writerfilter/source/dmapper/DomainMapper.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 09c311b0fb4dbed5220ca50f133687ebfea24646
Author: Caolán McNamara 
Date:   Sun Mar 4 15:34:15 2018 +

ofz#6720 Divide-by-zero

Change-Id: I81d89a41437456535949e1cd214ec4e514c26494
Reviewed-on: https://gerrit.libreoffice.org/50733
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index d31ca615de86..5af309e1cbcf 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2834,15 +2834,19 @@ void DomainMapper::processDeferredCharacterProperties( 
const std::map< sal_Int32
 {
 double fontSize = 0;
 font->second >>= fontSize;
-nEscapement = nIntValue * 100 / fontSize;
+if (fontSize != 0.0)
+nEscapement = nIntValue * 100 / fontSize;
 }
 // TODO if not direct formatting, check the style first, not 
directly the default char props.
 else if (aDefaultFont)
 {
 double fHeight = 0;
 aDefaultFont->second >>= fHeight;
-// fHeight is in points, nIntValue is in half points, 
nEscapement is in percents.
-nEscapement = nIntValue * 100 / fHeight / 2;
+if (fHeight != 0.0)
+{
+// fHeight is in points, nIntValue is in half points, 
nEscapement is in percents.
+nEscapement = nIntValue * 100 / fHeight / 2;
+}
 }
 else
 { // TODO: Find out the font size. The 58/-58 values were here 
previous, but I have
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-03-02 Thread Caolán McNamara
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 3d5a7631942171c2d73fbb172c2a9e7a50e9c3e3
Author: Caolán McNamara 
Date:   Thu Mar 1 20:43:59 2018 +

forcepoint #12 top empty stack

Change-Id: I51f02be13b3cf69e9aaef644a6c4837f1c47ff62
Reviewed-on: https://gerrit.libreoffice.org/50602
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 408a5dc12722..649898923a9b 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2284,8 +2284,11 @@ void DomainMapper_Impl::PopShapeContext()
 {
 const uno::Reference xShapePropertySet( 
xShape, uno::UNO_QUERY );
 SectionPropertyMap* pSectionContext = GetSectionContext();
-if ( pSectionContext && !getTableManager().isInTable() && 
xShapePropertySet->getPropertySetInfo()->hasPropertyByName(getPropertyName(PROP_RELATIVE_WIDTH))
 )
+if ( pSectionContext && (!hasTableManager() || 
!getTableManager().isInTable()) &&
+ 
xShapePropertySet->getPropertySetInfo()->hasPropertyByName(getPropertyName(PROP_RELATIVE_WIDTH))
 )
+{
 pSectionContext->addRelativeWidthShape(xShape);
+}
 }
 
 m_aAnchoredStack.pop();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-02-07 Thread Caolán McNamara
 writerfilter/source/dmapper/NumberingManager.cxx |   51 +--
 1 file changed, 30 insertions(+), 21 deletions(-)

New commits:
commit 469430a7d36fc1e860b4b68137261ec0833386c0
Author: Caolán McNamara 
Date:   Tue Feb 6 21:12:48 2018 +

rtf: null-deref

Change-Id: I9c4510cb91e2572a3ab2b62497dc4dd9fd1119c8
Reviewed-on: https://gerrit.libreoffice.org/49319
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 2e5794c31495..b406c44a6152 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -863,6 +863,7 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
 }
 break;
 case NS_ooxml::LN_CT_Lvl_lvlPicBulletId:
+if (ListLevel::Pointer pCurrentLevel = 
m_pCurrentDefinition->GetCurrentLevel())
 {
 uno::Reference xShape;
 for (std::vector::iterator it = 
m_aNumPicBullets.begin(); it != m_aNumPicBullets.end(); ++it)
@@ -879,15 +880,15 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
 try
 {
 uno::Any aAny = 
xPropertySet->getPropertyValue("GraphicURL");
-if (aAny.has())
-
m_pCurrentDefinition->GetCurrentLevel()->SetGraphicURL(aAny.get());
+if (aAny.has() && pCurrentLevel)
+pCurrentLevel->SetGraphicURL(aAny.get());
 } catch(const beans::UnknownPropertyException&)
 {}
 try
 {
 uno::Reference< graphic::XGraphic > gr;
 xPropertySet->getPropertyValue("Bitmap") >>= gr;
-
m_pCurrentDefinition->GetCurrentLevel()->SetGraphicBitmap( gr );
+pCurrentLevel->SetGraphicBitmap( gr );
 } catch(const beans::UnknownPropertyException&)
 {}
 
@@ -902,12 +903,12 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
 int nWidth = (nHeight * aPrefSize.Width) / 
aPrefSize.Height;
 
 awt::Size aSize( convertMm100ToTwip(nWidth), 
convertMm100ToTwip(nHeight) );
-
m_pCurrentDefinition->GetCurrentLevel()->SetGraphicSize( aSize );
+pCurrentLevel->SetGraphicSize( aSize );
 }
 else
 {
 awt::Size aSize( convertMm100ToTwip(aPrefSize.Width), 
convertMm100ToTwip(aPrefSize.Height) );
-
m_pCurrentDefinition->GetCurrentLevel()->SetGraphicSize( aSize );
+pCurrentLevel->SetGraphicSize( aSize );
 }
 }
 }
@@ -938,26 +939,26 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
 }
 break;
 case NS_ooxml::LN_CT_Lvl_start:
-if (m_pCurrentDefinition->GetCurrentLevel().get())
-m_pCurrentDefinition->GetCurrentLevel( )->SetValue( 
nSprmId, nIntValue );
+if (ListLevel::Pointer pCurrentLevel = 
m_pCurrentDefinition->GetCurrentLevel())
+pCurrentLevel->SetValue( nSprmId, nIntValue );
 bIsStartVisited = true;
 break;
 case NS_ooxml::LN_CT_Lvl_numFmt:
 case NS_ooxml::LN_CT_Lvl_isLgl:
 case NS_ooxml::LN_CT_Lvl_legacy:
-if (m_pCurrentDefinition->GetCurrentLevel().get())
+if (ListLevel::Pointer pCurrentLevel = 
m_pCurrentDefinition->GetCurrentLevel())
 {
-m_pCurrentDefinition->GetCurrentLevel( )->SetValue( 
nSprmId, nIntValue );
+pCurrentLevel->SetValue( nSprmId, nIntValue );
 if( !bIsStartVisited )
 {
-m_pCurrentDefinition->GetCurrentLevel( )->SetValue( 
NS_ooxml::LN_CT_Lvl_start, 0 );
+pCurrentLevel->SetValue( NS_ooxml::LN_CT_Lvl_start, 0 
);
 bIsStartVisited = true;
 }
 }
 break;
 case NS_ooxml::LN_CT_Lvl_suff:
 {
-if (m_pCurrentDefinition->GetCurrentLevel().get())
+if (ListLevel::Pointer pCurrentLevel = 
m_pCurrentDefinition->GetCurrentLevel())
 {
 SvxNumberFormat::LabelFollowedBy value = 
SvxNumberFormat::LISTTAB;
 if( rSprm.getValue()->getString() == "tab" )
@@ -969,7 +970,7 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
 else
 SAL_WARN( "writerfilter", 

[Libreoffice-commits] core.git: writerfilter/source

2018-02-02 Thread Miklos Vajna
 writerfilter/source/dmapper/NumberingManager.cxx |9 -
 1 file changed, 9 deletions(-)

New commits:
commit a6f2199e9888cb75960f1d35034bd44fb45e5565
Author: Miklos Vajna 
Date:   Thu Feb 1 16:26:09 2018 +0100

DOCX import: don't try to set grab-gag props as UNO props

This fixes loads of warnings like this one:


warn:legacy.osl:22335:22335:writerfilter/source/dmapper/StyleSheetTable.cxx:1611:
 Exception in StyleSheetTable::getOrCreateCharStyle - Style::setPropertyValue

during import. They are harmless as we catch the exception, but they are
just noise. It seems the code that transforms grab-bag pseudo-props into
real props was added in commit 4c3ba3a413be7339115ea5e6edc825a8434cd345
(fdo#75757: Remove inheritance from std::map., 2014-07-26), which is
supposed to be a pure refactoring, so just remove this problematic
transformation.

Change-Id: Ibf45bfedc661f9e065405c47623516c4026148a4
Reviewed-on: https://gerrit.libreoffice.org/49105
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 72308e05c117..2e5794c31495 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -217,15 +217,6 @@ uno::Sequence< beans::PropertyValue > 
ListLevel::GetCharStyleProperties( )
 {
 if (IgnoreForCharStyle(aValIter->Name))
 continue;
-else if(aValIter->Name=="CharInteropGrabBag" || 
aValIter->Name=="ParaInteropGrabBag") {
-uno::Sequence vGrabVals;
-aValIter->Value >>= vGrabVals;
-beans::PropertyValue* aGrabIter = vGrabVals.begin();
-for(; aGrabIter!=vGrabVals.end(); ++aGrabIter) {
-if(!IgnoreForCharStyle(aGrabIter->Name))
-rProperties.emplace_back(aGrabIter->Name, 0, 
aGrabIter->Value, beans::PropertyState_DIRECT_VALUE);
-}
-}
 else
 rProperties.emplace_back(aValIter->Name, 0, aValIter->Value, 
beans::PropertyState_DIRECT_VALUE);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-28 Thread Mike Kaganski
 writerfilter/source/rtftok/rtfdispatchvalue.cxx |6 ++---
 writerfilter/source/rtftok/rtfdocumentimpl.cxx  |7 --
 writerfilter/source/rtftok/rtfdocumentimpl.hxx  |   27 
 3 files changed, 27 insertions(+), 13 deletions(-)

New commits:
commit faa499cf6c9ccc0503fdc889727e1affcca8e930
Author: Mike Kaganski 
Date:   Sun Jan 28 13:17:50 2018 +0100

tdf#115278: an empty entry in color table is auto color

A unit test will come in a separate commit

Change-Id: I89dd9cae6e099509d21398e29ccf6412791accc2
Reviewed-on: https://gerrit.libreoffice.org/48781
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx 
b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index 726cb90acb37..1529e3805448 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -371,13 +371,13 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword 
nKeyword, int nParam)
 }
 break;
 case RTF_RED:
-m_aStates.top().aCurrentColor.nRed = nParam;
+m_aStates.top().aCurrentColor.SetRed(nParam);
 break;
 case RTF_GREEN:
-m_aStates.top().aCurrentColor.nGreen = nParam;
+m_aStates.top().aCurrentColor.SetGreen(nParam);
 break;
 case RTF_BLUE:
-m_aStates.top().aCurrentColor.nBlue = nParam;
+m_aStates.top().aCurrentColor.SetBlue(nParam);
 break;
 case RTF_FCHARSET:
 {
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 0474991024e4..0bc42bb73eee 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1210,10 +1210,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
 if (m_aStates.top().eDestination == Destination::COLORTABLE)
 {
 // we hit a ';' at the end of each color entry
-sal_uInt32 color = (m_aStates.top().aCurrentColor.nRed << 16)
-   | (m_aStates.top().aCurrentColor.nGreen << 8)
-   | m_aStates.top().aCurrentColor.nBlue;
-m_aColorTable.push_back(color);
+m_aColorTable.push_back(m_aStates.top().aCurrentColor.GetColor());
 // set components back to zero
 m_aStates.top().aCurrentColor = RTFColorTableEntry();
 }
@@ -3425,8 +3422,6 @@ RTFParserState::RTFParserState(RTFDocumentImpl* 
pDocumentImpl)
 
 void RTFDocumentImpl::resetFrame() { m_aStates.top().aFrame = 
RTFFrame(_aStates.top()); }
 
-RTFColorTableEntry::RTFColorTableEntry() = default;
-
 RTFPicture::RTFPicture() = default;
 
 RTFShape::RTFShape() = default;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 386f1950080f..9d162490a8d1 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include "rtfreferencetable.hxx"
@@ -127,10 +128,28 @@ struct TableRowBuffer
 class RTFColorTableEntry
 {
 public:
-RTFColorTableEntry();
-sal_uInt8 nRed = 0;
-sal_uInt8 nGreen = 0;
-sal_uInt8 nBlue = 0;
+void SetRed(sal_uInt8 nRed)
+{
+m_bAuto = false;
+m_nR = nRed;
+}
+void SetGreen(sal_uInt8 nGreen)
+{
+m_bAuto = false;
+m_nG = nGreen;
+}
+void SetBlue(sal_uInt8 nBlue)
+{
+m_bAuto = false;
+m_nB = nBlue;
+}
+ColorData GetColor() const { return m_bAuto ? COL_AUTO : 
RGB_COLORDATA(m_nR, m_nG, m_nB); }
+
+private:
+bool m_bAuto = true;
+sal_uInt8 m_nR = 0;
+sal_uInt8 m_nG = 0;
+sal_uInt8 m_nB = 0;
 };
 
 /// Stores the properties of a shape.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-28 Thread Mike Kaganski
 writerfilter/source/rtftok/rtfdispatchvalue.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 968084838e980b4152d88b95570c16ebad9d9b16
Author: Mike Kaganski 
Date:   Sun Jan 28 13:07:40 2018 +0100

tdf#115276: multiply quarter-points by 5 (not divide) to convert to twips

Unit test will come in separate commit

Change-Id: I4cd6983d708868883c766b239cb57752106a59bf
Reviewed-on: https://gerrit.libreoffice.org/48780
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx 
b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index a704bbdf2ffa..726cb90acb37 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -557,7 +557,8 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword 
nKeyword, int nParam)
 break;
 case RTF_EXPND:
 {
-auto pValue = std::make_shared(nParam / 5);
+// Convert quarter-points to twentieths of a point
+auto pValue = std::make_shared(nParam * 5);
 
m_aStates.top().aCharacterSprms.set(NS_ooxml::LN_EG_RPrBase_spacing, pValue);
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-27 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper.cxx|2 +-
 writerfilter/source/dmapper/StyleSheetTable.cxx |   15 ---
 writerfilter/source/dmapper/StyleSheetTable.hxx |1 -
 3 files changed, 1 insertion(+), 17 deletions(-)

New commits:
commit 99d08aa87b945f909d0d0439e2f636918b0b858d
Author: Justin Luth 
Date:   Wed Jan 17 12:36:39 2018 +0300

writerfilter: FindStyleSheetBy... remove StyleName option

It is confusing having three undocumented Find functions.
Reduce by one - either search on the imported WW8 (ISTD) name
or on the internal (converted) name.

The one remaining use of ByStyleName was testing against an
already set property, so by definition it was set using
convertedStyleName.  (Plus, that was my code anyway...)

Change-Id: If5a352bedb7d297698f449fbb629a1350e27c51c
Reviewed-on: https://gerrit.libreoffice.org/48037
Tested-by: Jenkins 
Reviewed-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index a573275a338b..464910fb625c 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2546,7 +2546,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 OUString sStyleName;
 pParagraphProps->getProperty(PROP_PARA_STYLE_NAME)->second >>= 
sStyleName;
 if( !sStyleName.isEmpty() && GetStyleSheetTable() )
-pStyle = GetStyleSheetTable()->FindStyleSheetByStyleName( 
sStyleName );
+pStyle = 
GetStyleSheetTable()->FindStyleSheetByConvertedStyleName( sStyleName );
 
 if( pStyle && pStyle->pProperties
 && pStyle->pProperties->isSet(PROP_BREAK_TYPE)
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 7c52ef505aef..433405feabf4 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1247,21 +1247,6 @@ const StyleSheetEntryPtr 
StyleSheetTable::FindStyleSheetByISTD(const OUString& s
 }
 
 
-const StyleSheetEntryPtr StyleSheetTable::FindStyleSheetByStyleName(const 
OUString& sIndex)
-{
-StyleSheetEntryPtr pRet;
-for(StyleSheetEntryPtr & rpEntry : m_pImpl->m_aStyleSheetEntries)
-{
-if( rpEntry->sStyleName == sIndex)
-{
-pRet = rpEntry;
-break;
-}
-}
-return pRet;
-}
-
-
 const StyleSheetEntryPtr 
StyleSheetTable::FindStyleSheetByConvertedStyleName(const OUString& sIndex)
 {
 StyleSheetEntryPtr pRet;
diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx 
b/writerfilter/source/dmapper/StyleSheetTable.hxx
index 933a6e20fd85..767a16af3dfb 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.hxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx
@@ -91,7 +91,6 @@ public:
 
 void ApplyStyleSheets( const FontTablePtr& rFontTable );
 const StyleSheetEntryPtr FindStyleSheetByISTD(const OUString& sIndex);
-const StyleSheetEntryPtr FindStyleSheetByStyleName(const OUString& rIndex);
 const StyleSheetEntryPtr FindStyleSheetByConvertedStyleName(const 
OUString& rIndex);
 const StyleSheetEntryPtr FindDefaultParaStyle();
 // returns the parent of the one with the given name - if empty the parent 
of the current style sheet is returned
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-25 Thread ekuiitr
 writerfilter/source/rtftok/rtfcontrolwords.cxx | 3652 -
 writerfilter/source/rtftok/rtfcontrolwords.hxx |2 
 writerfilter/source/rtftok/rtftokenizer.cxx|   12 
 3 files changed, 1833 insertions(+), 1833 deletions(-)

New commits:
commit 061145e2172886f0bd8b33f16ede7c21dba6f3f6
Author: ekuiitr 
Date:   Tue Jan 23 12:07:03 2018 +0530

tdf#105910 Allow defaults to be used as parameters for RTF control words.

[MS-RTF] specifies in "Conventions of an RTF Reader" section
("Change Formatting Property" action), that if a control word
requires a parameter, and it isn't specified, then a control-word-
specific default value is used. This patch implements the said
rule.
[MS-RTF]: https://www.microsoft.com/download/details.aspx?id=10725

Change-Id: Ic0b76bf16b01c65e1b89c243698fd46fd6426d90
Reviewed-on: https://gerrit.libreoffice.org/48375
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/rtftok/rtfcontrolwords.cxx 
b/writerfilter/source/rtftok/rtfcontrolwords.cxx
index 1894055baf63..f1c39391fc6e 100644
--- a/writerfilter/source/rtftok/rtfcontrolwords.cxx
+++ b/writerfilter/source/rtftok/rtfcontrolwords.cxx
@@ -17,1831 +17,1831 @@ namespace rtftok
 {
 RTFSymbol aRTFControlWords[] = {
 // sKeyword nControlType nIndex
-{ "'", CONTROL_SYMBOL, RTF_HEXCHAR },
-{ "-", CONTROL_SYMBOL, RTF_OPTHYPH },
-{ "*", CONTROL_SYMBOL, RTF_IGNORE },
-{ ":", CONTROL_SYMBOL, RTF_SUBENTRY },
-{ "\\", CONTROL_SYMBOL, RTF_BACKSLASH },
-{ "\n", CONTROL_SYMBOL, RTF_PAR },
-{ "\r", CONTROL_SYMBOL, RTF_PAR },
-{ "\r\n", CONTROL_SYMBOL, RTF_PAR },
-{ "_", CONTROL_SYMBOL, RTF_NOBRKHYPH },
-{ "{", CONTROL_SYMBOL, RTF_LBRACE },
-{ "|", CONTROL_SYMBOL, RTF_FORMULA },
-{ "}", CONTROL_SYMBOL, RTF_RBRACE },
-{ "~", CONTROL_SYMBOL, RTF_NOBREAK },
-{ "ab", CONTROL_TOGGLE, RTF_AB },
-{ "absh", CONTROL_VALUE, RTF_ABSH },
-{ "abslock", CONTROL_FLAG, RTF_ABSLOCK },
-{ "absnoovrlp", CONTROL_TOGGLE, RTF_ABSNOOVRLP },
-{ "absw", CONTROL_VALUE, RTF_ABSW },
-{ "acaps", CONTROL_TOGGLE, RTF_ACAPS },
-{ "acccircle", CONTROL_TOGGLE, RTF_ACCCIRCLE },
-{ "acccomma", CONTROL_TOGGLE, RTF_ACCCOMMA },
-{ "accdot", CONTROL_TOGGLE, RTF_ACCDOT },
-{ "accnone", CONTROL_TOGGLE, RTF_ACCNONE },
-{ "accunderdot", CONTROL_TOGGLE, RTF_ACCUNDERDOT },
-{ "acf", CONTROL_VALUE, RTF_ACF },
-{ "adeff", CONTROL_VALUE, RTF_ADEFF },
-{ "additive", CONTROL_FLAG, RTF_ADDITIVE },
-{ "adeflang", CONTROL_VALUE, RTF_ADEFLANG },
-{ "adjustright", CONTROL_FLAG, RTF_ADJUSTRIGHT },
-{ "adn", CONTROL_VALUE, RTF_ADN },
-{ "aenddoc", CONTROL_FLAG, RTF_AENDDOC },
-{ "aendnotes", CONTROL_FLAG, RTF_AENDNOTES },
-{ "aexpnd", CONTROL_VALUE, RTF_AEXPND },
-{ "af", CONTROL_VALUE, RTF_AF },
-{ "afelev", CONTROL_FLAG, RTF_AFELEV },
-{ "afs", CONTROL_VALUE, RTF_AFS },
-{ "aftnbj", CONTROL_FLAG, RTF_AFTNBJ },
-{ "aftncn", CONTROL_DESTINATION, RTF_AFTNCN },
-{ "aftnnalc", CONTROL_FLAG, RTF_AFTNNALC },
-{ "aftnnar", CONTROL_FLAG, RTF_AFTNNAR },
-{ "aftnnauc", CONTROL_FLAG, RTF_AFTNNAUC },
-{ "aftnnchi", CONTROL_FLAG, RTF_AFTNNCHI },
-{ "aftnnchosung", CONTROL_FLAG, RTF_AFTNNCHOSUNG },
-{ "aftnncnum", CONTROL_FLAG, RTF_AFTNNCNUM },
-{ "aftnndbar", CONTROL_FLAG, RTF_AFTNNDBAR },
-{ "aftnndbnum", CONTROL_FLAG, RTF_AFTNNDBNUM },
-{ "aftnndbnumd", CONTROL_FLAG, RTF_AFTNNDBNUMD },
-{ "aftnndbnumk", CONTROL_FLAG, RTF_AFTNNDBNUMK },
-{ "aftnndbnumt", CONTROL_FLAG, RTF_AFTNNDBNUMT },
-{ "aftnnganada", CONTROL_FLAG, RTF_AFTNNGANADA },
-{ "aftnngbnum", CONTROL_FLAG, RTF_AFTNNGBNUM },
-{ "aftnngbnumd", CONTROL_FLAG, RTF_AFTNNGBNUMD },
-{ "aftnngbnumk", CONTROL_FLAG, RTF_AFTNNGBNUMK },
-{ "aftnngbnuml", CONTROL_FLAG, RTF_AFTNNGBNUML },
-{ "aftnnrlc", CONTROL_FLAG, RTF_AFTNNRLC },
-{ "aftnnruc", CONTROL_FLAG, RTF_AFTNNRUC },
-{ "aftnnzodiac", CONTROL_FLAG, RTF_AFTNNZODIAC },
-{ "aftnnzodiacd", CONTROL_FLAG, RTF_AFTNNZODIACD },
-{ "aftnnzodiacl", CONTROL_FLAG, RTF_AFTNNZODIACL },
-{ "aftnrestart", CONTROL_FLAG, RTF_AFTNRESTART },
-{ "aftnrstcont", CONTROL_FLAG, RTF_AFTNRSTCONT },
-{ "aftnsep", CONTROL_DESTINATION, RTF_AFTNSEP },
-{ "aftnsepc", CONTROL_DESTINATION, RTF_AFTNSEPC },
-{ "aftnstart", CONTROL_VALUE, RTF_AFTNSTART },
-{ "aftntj", CONTROL_FLAG, RTF_AFTNTJ },
-{ "ai", CONTROL_TOGGLE, RTF_AI },
-{ "alang", CONTROL_VALUE, RTF_ALANG },
-{ "allowfieldendsel", CONTROL_FLAG, RTF_ALLOWFIELDENDSEL },
-{ "allprot", CONTROL_FLAG, RTF_ALLPROT },
-{ "alntblind", CONTROL_FLAG, RTF_ALNTBLIND },
-{ "alt", CONTROL_FLAG, RTF_ALT },
-{ "animtext", CONTROL_VALUE, RTF_ANIMTEXT },
-{ "annotation", CONTROL_DESTINATION, RTF_ANNOTATION },
-{ "annotprot", 

[Libreoffice-commits] core.git: writerfilter/source

2018-01-25 Thread Patrick Jaap
 writerfilter/source/dmapper/GraphicHelpers.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 82dcf015154c3fb00240c5630ae926c74c7f4213
Author: Patrick Jaap 
Date:   Wed Jan 24 11:45:57 2018 +0100

Add SAL_WARN in writerfilter graphic import

Change-Id: Iac6265094572c57f421b0533db2c90a41b2ef427
Reviewed-on: https://gerrit.libreoffice.org/48492
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx 
b/writerfilter/source/dmapper/GraphicHelpers.cxx
index a7ce01868714..ca2892a013af 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -83,6 +83,8 @@ void PositionHandler::lcl_attribute( Id aName, Value& rVal )
 break;
 
 // TODO There are some other unhandled values
+default:
+SAL_WARN("writerfilter", "unhandled case (" << 
nIntValue << ") in NS_ooxml::LN_CT_PosV_relativeFrom");
 }
 }
 break;
@@ -116,6 +118,8 @@ void PositionHandler::lcl_attribute( Id aName, Value& rVal )
 break;
 
 // TODO There are some other unhandled values
+default:
+SAL_WARN("writerfilter", "unhandled case (" << 
nIntValue << ") in NS_ooxml::LN_CT_PosH_relativeFrom");
 }
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-24 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 9dfd46ef4b341a5dfed7d320696959402a549fdb
Author: Justin Luth 
Date:   Wed Jan 17 12:03:53 2018 +0300

writerfilter: use WW8 name for StyleId

The sStyleIdentifierD for the default style is "Normal".
FindStyleSheetByISTD uses sStyleIndentifierD for its comparison.
SetCurrentParaStyleId() is used to save the WW8 provided name.
Thus, the default style should do the same.

The SetCurrentParaStyleId was added here by
commit 4abb20ee162ff874cc143fd952f72d30ddc9d136
Author: Miklos Vajna
Date:   Tue Jun 19 17:36:28 2012 +0200

Also removing the static variable, since it serves no purpose.

Change-Id: I58659e9d809c32dd799fb46217971707991b2803
Reviewed-on: https://gerrit.libreoffice.org/48034
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 32945c9d6bb4..35693db196ec 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2998,13 +2998,12 @@ void DomainMapper::lcl_startParagraphGroup()
 if (!(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH) == 
m_pImpl->GetTopContext()))
 m_pImpl->PushProperties(CONTEXT_PARAGRAPH);
 
-static const char sDefault[] = "Standard";
 if (m_pImpl->GetTopContext())
 {
 if (!m_pImpl->IsInShape())
 {
-m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, 
uno::makeAny( OUString(sDefault) ) );
-m_pImpl->SetCurrentParaStyleId(sDefault);
+m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, 
uno::makeAny( OUString("Standard") ) ); //ConvertedStyleName
+m_pImpl->SetCurrentParaStyleId("Normal"); //WW8 name
 }
 if (m_pImpl->isBreakDeferred(PAGE_BREAK))
 m_pImpl->GetTopContext()->Insert(PROP_BREAK_TYPE, 
uno::makeAny(style::BreakType_PAGE_BEFORE));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-19 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 254c80037a3939c110d5c66fef6c28caf47625e5
Author: Justin Luth 
Date:   Wed Jan 17 16:25:56 2018 +0300

writerfilter: move TopContextType==Para requirement

This is prep work for tdf#95377. I need this function to
run when there is no TopContext. This function doesn't do anything
with the context, so in that regard I wonder if it is even
necessary? My guess would be that it is a leftover piece from
discovering the fix for n75883.

However, to avoid causing a regression, I'm just pulling this test
into the calling functions. (Of the three instances
calling this function, two need to be contextless..)

This is not truly NFC because if the followup patch is reverted,
then this one will cause a change. But that is actually OK, because
if my follow-up patch breaks because of these two functions changing
to become contextless, then I'll be better able to pin-point the
reason for the regression.

Original commit adding this function was
commit 2123ede032ca64f696ef54af4ad3238974ca2b5d

Change-Id: I471aa852aa48527d69e0343a2ac28fa6e8acb209
Reviewed-on: https://gerrit.libreoffice.org/48062
Reviewed-by: Justin Luth 
Tested-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ee3533bc134e..c66b087eca67 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -5409,7 +5409,7 @@ uno::Reference 
DomainMapper_Impl::GetCurrentNumberingRu
 try
 {
 OUString aStyle = GetCurrentParaStyleId();
-if (aStyle.isEmpty() || GetTopContextType() != CONTEXT_PARAGRAPH)
+if (aStyle.isEmpty())
 return xRet;
 const StyleSheetEntryPtr pEntry = 
GetStyleSheetTable()->FindStyleSheetByISTD(aStyle);
 if (!pEntry)
@@ -5446,7 +5446,9 @@ uno::Reference 
DomainMapper_Impl::GetCurrentNumberingCharSt
 try
 {
 sal_Int32 nListLevel = -1;
-uno::Reference xLevels = 
GetCurrentNumberingRules();
+uno::Reference xLevels;
+if ( GetTopContextType() == CONTEXT_PARAGRAPH )
+xLevels = GetCurrentNumberingRules();
 if (!xLevels.is())
 {
 PropertyMapPtr pContext = m_pTopContext;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-17 Thread Justin Luth
 writerfilter/source/dmapper/StyleSheetTable.cxx |2 --
 writerfilter/source/dmapper/StyleSheetTable.hxx |1 -
 2 files changed, 3 deletions(-)

New commits:
commit ee2750f3a5324166e844f9c6afa399742ea96743
Author: Justin Luth 
Date:   Wed Jan 17 12:22:24 2018 +0300

writerfilter: remove unused sStyleName1

Both sStyleName and sStyleName1 were part of the original
fork from the OOo project. I'm
not sure if/how it was ever used, but sStyleName1 is unused now.

Change-Id: I71b54645aa0615101529aa4d5008973f740da1f0
Reviewed-on: https://gerrit.libreoffice.org/48036
Reviewed-by: Justin Luth 
Tested-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index eec228747398..7c52ef505aef 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -81,7 +81,6 @@ TableStyleSheetEntry::TableStyleSheetEntry( StyleSheetEntry 
const & rEntry ):
 sBaseStyleIdentifier = rEntry.sBaseStyleIdentifier;
 sNextStyleIdentifier = rEntry.sNextStyleIdentifier;
 sStyleName = rEntry.sStyleName;
-sStyleName1 = rEntry.sStyleName1;
 sStyleIdentifierD = rEntry.sStyleIdentifierD;
 }
 
@@ -530,7 +529,6 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
 case NS_ooxml::LN_CT_Style_name:
 //this is only a UI name!
 m_pImpl->m_pCurrentEntry->sStyleName = sStringValue;
-m_pImpl->m_pCurrentEntry->sStyleName1 = sStringValue;
 if(m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE)
 {
 TableStyleSheetEntry* pTableEntry = 
static_cast(m_pImpl->m_pCurrentEntry.get());
diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx 
b/writerfilter/source/dmapper/StyleSheetTable.hxx
index fa8b40cb0434..933a6e20fd85 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.hxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx
@@ -62,7 +62,6 @@ public:
 OUString sBaseStyleIdentifier;
 OUString sNextStyleIdentifier;
 OUString sStyleName;
-OUString sStyleName1;
 PropertyMapPtr  pProperties;
 OUString sConvertedStyleName;
 std::vector aLatentStyles; ///< Attributes of 
latentStyles
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-17 Thread Justin Luth
 writerfilter/source/dmapper/StyleSheetTable.cxx |7 ++-
 writerfilter/source/dmapper/StyleSheetTable.hxx |3 +--
 2 files changed, 3 insertions(+), 7 deletions(-)

New commits:
commit ae094e77035baed23c02516b4b445e044e631b40
Author: Justin Luth 
Date:   Wed Jan 17 12:13:00 2018 +0300

NFC writerfilter: remove redundant sStyleIdentifierI

Originally, StyleIdentiferI was the string name, and
StyleIdentifierD was an integer. That changed a long
time ago.

Both identifiers are only assigned a value once, and
both are given identical values at the same time.
Thus, one is completely redundant and is being removed.

Change-Id: Ia7e9bbeec53110fa8e56cdfb13b9871486f335fa
Reviewed-on: https://gerrit.libreoffice.org/48035
Reviewed-by: Justin Luth 
Tested-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 3e17b25eae89..eec228747398 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -53,8 +53,7 @@ typedef ::std::map< OUString, OUString> StringPairMap_t;
 
 
 StyleSheetEntry::StyleSheetEntry() :
-sStyleIdentifierI()
-,sStyleIdentifierD()
+sStyleIdentifierD()
 ,bIsDefaultStyle(false)
 ,bIsChapterNumbering(false)
 ,bInvalidHeight(false)
@@ -83,7 +82,6 @@ TableStyleSheetEntry::TableStyleSheetEntry( StyleSheetEntry 
const & rEntry ):
 sNextStyleIdentifier = rEntry.sNextStyleIdentifier;
 sStyleName = rEntry.sStyleName;
 sStyleName1 = rEntry.sStyleName1;
-sStyleIdentifierI = rEntry.sStyleIdentifierI;
 sStyleIdentifierD = rEntry.sStyleIdentifierD;
 }
 
@@ -152,7 +150,7 @@ beans::PropertyValues 
StyleSheetEntry::GetInteropGrabBagSeq()
 beans::PropertyValue StyleSheetEntry::GetInteropGrabBag()
 {
 beans::PropertyValue aRet;
-aRet.Name = sStyleIdentifierI;
+aRet.Name = sStyleIdentifierD;
 
 beans::PropertyValues aSeq = GetInteropGrabBagSeq();
 aRet.Value <<= aSeq;
@@ -477,7 +475,6 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val)
 }
 break;
 case NS_ooxml::LN_CT_Style_styleId:
-m_pImpl->m_pCurrentEntry->sStyleIdentifierI = sValue;
 m_pImpl->m_pCurrentEntry->sStyleIdentifierD = sValue;
 if(m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE)
 {
diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx 
b/writerfilter/source/dmapper/StyleSheetTable.hxx
index 959a2b9184a1..fa8b40cb0434 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.hxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.hxx
@@ -53,8 +53,7 @@ class StyleSheetEntry
 {
 std::vector m_aInteropGrabBag;
 public:
-OUString sStyleIdentifierI;
-OUString sStyleIdentifierD;
+OUString sStyleIdentifierD;   // WW8 name
 boolbIsDefaultStyle;
 boolbIsChapterNumbering;  //LO built-in Chapter Numbering 
"Outline" list style
 boolbInvalidHeight;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-12 Thread Justin Luth
 writerfilter/source/dmapper/StyleSheetTable.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 60c84cd52b291f7cfa4f44366bf021f34ef230f6
Author: Justin Luth 
Date:   Wed Jan 10 17:45:45 2018 +0300

remove unused include XChapterNumberingSupplier.hpp

The code moved to NumberingManager.cxx I believe.

Change-Id: I6f21e913e8fa52ffd47a3004137e7b5043421613
Reviewed-on: https://gerrit.libreoffice.org/47826
Tested-by: Jenkins 
Reviewed-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index d09ecfffb5e5..54a85958f11e 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2018-01-12 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 5f25cfde82013d34276ed0ac12d4c2879888db7b
Author: Justin Luth 
Date:   Thu Jan 4 17:01:59 2018 +0300

unused variable: DomainMapper_Impl::PushAnnotation() pTopContext

unused even on the day when the function was created in 2009:
CWS-TOOLING: integrate CWS os124.

Change-Id: I20e46d6b55f307744851fc4fe1773549535bcfd7
Reviewed-on: https://gerrit.libreoffice.org/47448
Tested-by: Jenkins 
Reviewed-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 4b84edb98b66..5f514dc67709 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1858,7 +1858,6 @@ void DomainMapper_Impl::PushAnnotation()
 {
 try
 {
-PropertyMapPtr pTopContext = GetTopContext();
 m_bIsInComments = true;
 if (!GetTextFactory().is())
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-12-28 Thread Caolán McNamara
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 996fbf1cefff1d991e4c89919797e5f0daeaafa9
Author: Caolán McNamara 
Date:   Wed Dec 27 21:02:53 2017 +

ofz#4814 asserts and Null-dereference on broken shape

the attempt is made, but the shape isn't there, so m_bShapeSent
wasn't set, so it will get called again and the markstacks are popped
to many times. Lets set it when the effort is made.

Change-Id: I58dfe11316112cca6ff69ea518ed0b4908f25d6c
Reviewed-on: https://gerrit.libreoffice.org/47106
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx 
b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 138954023f89..9379fa95f3b4 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1662,12 +1662,12 @@ void OOXMLFastContextHandlerShape::sendShape( Token_t 
Element )
 awt::Point aPosition = mpStream->getPositionOffset();
 mrShapeContext->setPosition(aPosition);
 uno::Reference xShape(mrShapeContext->getShape());
+m_bShapeSent = true;
 if (xShape.is())
 {
 OOXMLValue::Pointer_t
 pValue(new OOXMLShapeValue(xShape));
 newProperty(NS_ooxml::LN_shape, pValue);
-m_bShapeSent = true;
 
 bool bIsPicture = Element == ( NMSP_dmlPicture | XML_pic );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-12-27 Thread Jochen Nitschke
 writerfilter/source/dmapper/PropertyMap.cxx |   26 --
 writerfilter/source/dmapper/PropertyMap.hxx |1 -
 2 files changed, 27 deletions(-)

New commits:
commit 3b35f1d985d2cd230c0676d01d3f2518acb1e50c
Author: Jochen Nitschke 
Date:   Wed Dec 27 12:36:26 2017 +0100

clang-tidy-modernize-use-equals-default in writerfilter

Change-Id: I5725602be8a3da8e58a6885f64a7b720061c11ce
Reviewed-on: https://gerrit.libreoffice.org/47085
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 03508ec263c0..e6b58422b9c6 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1591,32 +1591,6 @@ ParagraphProperties::ParagraphProperties()
 {
 }
 
-ParagraphProperties::ParagraphProperties( const ParagraphProperties& rCopy )
-: m_bFrameMode( rCopy.m_bFrameMode )
-, m_nDropCap( rCopy.m_nDropCap )
-, m_nLines( rCopy.m_nLines )
-, m_w( rCopy.m_w )
-, m_h( rCopy.m_h )
-, m_nWrap( rCopy.m_nWrap )
-, m_hAnchor( rCopy.m_hAnchor )
-, m_vAnchor( rCopy.m_vAnchor )
-, m_x( rCopy.m_x )
-, m_bxValid( rCopy.m_bxValid )
-, m_y( rCopy.m_y )
-, m_byValid( rCopy.m_byValid )
-, m_hSpace( rCopy.m_hSpace )
-, m_vSpace( rCopy.m_vSpace )
-, m_hRule( rCopy.m_hRule )
-, m_xAlign( rCopy.m_xAlign )
-, m_yAlign( rCopy.m_yAlign )
-, m_bAnchorLock( rCopy.m_bAnchorLock )
-, m_nDropCapLength( rCopy.m_nDropCapLength )
-, m_sParaStyleName( rCopy.m_sParaStyleName )
-, m_xStartingRange( rCopy.m_xStartingRange )
-, m_xEndingRange( rCopy.m_xEndingRange )
-{
-}
-
 bool ParagraphProperties::operator==( const ParagraphProperties& rCompare )
 {
 return ( m_bFrameMode  == rCompare.m_bFrameMode &&
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx 
b/writerfilter/source/dmapper/PropertyMap.hxx
index cc20cd56518d..3e09007d8f6a 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -391,7 +391,6 @@ private:
 
 public:
 ParagraphProperties();
-ParagraphProperties( const ParagraphProperties& );
 virtual ~ParagraphProperties() {}
 
 // Does not compare the starting/ending range, m_sParaStyleName and 
m_nDropCapLength
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-12-18 Thread Michael Stahl
 writerfilter/source/rtftok/rtfdispatchdestination.cxx |9 -
 writerfilter/source/rtftok/rtfsdrimport.cxx   |1 +
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 706728df38830536354ba902978cc8297f787dfc
Author: Michael Stahl 
Date:   Mon Dec 18 17:17:44 2017 +0100

tdf#114303 writerfilter: RTF import: fix default vert orient of shapes

The bugdoc is affected by the change of default vertical alignment, it
doesn't contain anything that would set the VertOrient property.

(regression from c79467ba954987f1d239c594c1e1b3af3f5515f6)

Setting the AnchorType property before adding the shape is actually not
as effective as expected: it does cause the old default vertical
alignment to be used, but does not actually set the anchor type because
there is no anchor position and so SwXDrawPage::add resets the anchor
type to FLY_AT_PAGE; it's less confusing to set the VertOrient
property instead.

Change-Id: Ib0a71d20d479776ab5e4c21c3dd13c0c307a045e

diff --git a/writerfilter/source/rtftok/rtfdispatchdestination.cxx 
b/writerfilter/source/rtftok/rtfdispatchdestination.cxx
index f844de1bf94c..0f795c7d50e0 100644
--- a/writerfilter/source/rtftok/rtfdispatchdestination.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchdestination.cxx
@@ -11,7 +11,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -598,11 +598,10 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 if (xDrawSupplier.is())
 {
 uno::Reference xShape(xGroupShape, 
uno::UNO_QUERY);
-// set AnchorType before inserting
+// set default VertOrient before inserting
 uno::Reference(xShape, 
uno::UNO_QUERY)
-->setPropertyValue(
-"AnchorType",
-
uno::makeAny(text::TextContentAnchorType_AT_CHARACTER));
+->setPropertyValue("VertOrient",
+   
uno::makeAny(text::VertOrientation::NONE));
 xDrawSupplier->getDrawPage()->add(xShape);
 }
 m_pSdrImport->pushParent(xGroupShape);
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx 
b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 5605f5cfb27d..b79d37123399 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -341,6 +341,7 @@ int 
RTFSdrImport::initShape(uno::Reference& o_xShape,
 o_xPropSet->setPropertyValue(
 "FillColor",
 uno::makeAny(sal_uInt32(0xff))); // White in Word, kind of 
blue in Writer.
+o_xPropSet->setPropertyValue("VertOrient", 
uno::makeAny(text::VertOrientation::NONE));
 }
 
 return nType;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-12-06 Thread tagezi
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx |   25 +---
 1 file changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 58e4b36ace484f2743a3b9919d830c175464b05d
Author: tagezi 
Date:   Wed Dec 6 21:23:37 2017 +0200

tdf#104650 Creating guard to reset status indicator

Change-Id: Ic1e79badedc031a588c0b07958002ad7c558ba82
Reviewed-on: https://gerrit.libreoffice.org/45987
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx 
b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 2223b2a6c61c..c23aa86b464a 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -417,8 +417,30 @@ void OOXMLDocumentImpl::resolveFooter(Stream & rStream,
  }
 }
 
+namespace {
+// Ensures that the indicator is reset after exiting OOXMLDocumentImpl::resolve
+class StatusIndicatorGuard{
+public:
+explicit 
StatusIndicatorGuard(css::uno::Reference& 
xStatusIndicator)
+:mxStatusIndicator(xStatusIndicator)
+{
+}
+
+~StatusIndicatorGuard()
+{
+if (mxStatusIndicator.is())
+mxStatusIndicator->end();
+}
+
+private:
+css::uno::Reference mxStatusIndicator;
+};
+}
+
 void OOXMLDocumentImpl::resolve(Stream & rStream)
 {
+StatusIndicatorGuard aStatusIndicatorGuard(mxStatusIndicator);
+
 if 
(utl::MediaDescriptor(maMediaDescriptor).getUnpackedValueOrDefault("ReadGlossaries",
 false))
 {
 resolveFastSubStream(rStream, OOXMLStream::GLOSSARY);
@@ -515,9 +537,6 @@ void OOXMLDocumentImpl::resolve(Stream & rStream)
 "OOXMLDocumentImpl::resolve(): non-UNO exception");
 }
 }
-
-if (mxStatusIndicator.is())
-mxStatusIndicator->end();
 }
 
 void OOXMLDocumentImpl::incrementProgress()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-12-06 Thread Mike Kaganski
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e5a3f12588e8e8eb80cc5af4e412fa2c83f0895e
Author: Mike Kaganski 
Date:   Wed Dec 6 15:14:43 2017 +0200

Check if we have status indicator

In other methods it's always checked, so presumably it might be absent.
In caller sites (like OOXMLFastContextHandler::endOfParagraph), it can't
(and shouldn't) be checked.

Change-Id: Ia2edf8b121cac15e6454bc6321d76517fcdf110f
Reviewed-on: https://gerrit.libreoffice.org/45951
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx 
b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 44552eee5e5f..2223b2a6c61c 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -529,7 +529,8 @@ void OOXMLDocumentImpl::incrementProgress()
 if (mnProgressEndPos && mnProgressCurrentPos > (mnProgressLastPos + 
mnPercentSize) && mnProgressLastPos < mnProgressEndPos)
 {
 mnProgressLastPos = mnProgressCurrentPos;
-mxStatusIndicator->setValue(mnProgressLastPos);
+if (mxStatusIndicator.is())
+mxStatusIndicator->setValue(mnProgressLastPos);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-11-24 Thread Stephan Bergmann
 writerfilter/source/rtftok/rtftokenizer.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 392e5dfee9947d07d093c8045c9a6e7b078e2721
Author: Stephan Bergmann 
Date:   Fri Nov 24 17:03:49 2017 +0100

loplugin:unnecessaryparen

Change-Id: I5a1fa919b7fe8c91ac886a796426b5671573dbb6

diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx 
b/writerfilter/source/rtftok/rtftokenizer.cxx
index b2acac10b2db..8a2f53ae1eda 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -79,7 +79,7 @@ RTFError RTFTokenizer::resolveParse()
 m_xStatusIndicator->setValue(nLastPos = nCurrentPos);
 }
 
-while ((Strm().ReadChar(ch), !Strm().eof()))
+while (Strm().ReadChar(ch), !Strm().eof())
 {
 //SAL_INFO("writerfilter", OSL_THIS_FUNC << ": parsing character '" << 
ch << "'");
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-11-24 Thread Miklos Vajna
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4bae4ebd527e9deed9e1bd1be0e4bc4506d05e6f
Author: Miklos Vajna 
Date:   Fri Nov 24 15:36:24 2017 +0100

writerfilter: fix loplugin:simplifybool warning

Change-Id: I23806d8839bc6227311cb5f5d39c779f23e72e83

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 700651290f93..e5eee0325289 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -267,7 +267,7 @@ DomainMapper_Impl::DomainMapper_Impl(
 getTableManager( ).setHandler(m_pTableHandler);
 
 getTableManager( ).startLevel();
-m_bUsingEnhancedFields = !utl::ConfigManager::IsFuzzing() ? 
officecfg::Office::Common::Filter::Microsoft::Import::ImportWWFieldsAsEnhancedFields::get(m_xComponentContext)
 : false;
+m_bUsingEnhancedFields = !utl::ConfigManager::IsFuzzing() && 
officecfg::Office::Common::Filter::Microsoft::Import::ImportWWFieldsAsEnhancedFields::get(m_xComponentContext);
 
 m_pSdtHelper.reset(new SdtHelper(*this));
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-11-24 Thread Caolán McNamara
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit d26ebaa2d45dfdd9437f1c24abc119a69d989654
Author: Caolán McNamara 
Date:   Fri Nov 24 10:48:08 2017 +

pick a default during fuzzing

Change-Id: I98d99465d32b553ae55d76c99125f83e686ea2a1
Reviewed-on: https://gerrit.libreoffice.org/45215
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 0443954f5a41..700651290f93 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -87,12 +87,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 
-
-
-
 using namespace ::com::sun::star;
 using namespace oox;
 namespace writerfilter {
@@ -269,7 +267,7 @@ DomainMapper_Impl::DomainMapper_Impl(
 getTableManager( ).setHandler(m_pTableHandler);
 
 getTableManager( ).startLevel();
-m_bUsingEnhancedFields = 
officecfg::Office::Common::Filter::Microsoft::Import::ImportWWFieldsAsEnhancedFields::get(m_xComponentContext);
+m_bUsingEnhancedFields = !utl::ConfigManager::IsFuzzing() ? 
officecfg::Office::Common::Filter::Microsoft::Import::ImportWWFieldsAsEnhancedFields::get(m_xComponentContext)
 : false;
 
 m_pSdtHelper.reset(new SdtHelper(*this));
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-11-19 Thread Szymon Kłos
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 40acf8d6447065077acba9e800c56239f58c8262
Author: Szymon Kłos 
Date:   Tue Nov 14 19:55:42 2017 +0100

tdf#86087 DOCX Import link as relative if preferred

Change-Id: I92e273aa57db8b4b9779d8d784c5bbad42d720e5
Reviewed-on: https://gerrit.libreoffice.org/44735
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f5786ac3fe38..0443954f5a41 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4035,7 +4035,7 @@ void DomainMapper_Impl::CloseFieldCommand()
 // Try to make absolute any relative URLs, except
 // for relative same-document URLs that only 
contain
 // a fragment part:
-if (!sURL.startsWith("#")) {
+if (!sURL.startsWith("#") && 
!m_aSaveOpt.IsSaveRelFSys()) {
 try {
 sURL = rtl::Uri::convertRelToAbs(
 m_aBaseUrl, sURL);
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index bf5c2644e182..589a79953f13 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -391,6 +392,7 @@ public:
 private:
 SourceDocumentType 
 m_eDocumentType;
 DomainMapper&  
 m_rDMapper;
+SvtSaveOptions 
 m_aSaveOpt;
 OUString m_aBaseUrl;
 css::uno::Reference m_xTextDocument;
 css::uno::Reference m_xDocumentSettings;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-11-03 Thread Stephan Bergmann
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit a5c4b406a8ff80aaa2df96ce455d3b080b77a9a4
Author: Stephan Bergmann 
Date:   Fri Nov 3 18:42:44 2017 +0100

Only downcast to OOXMLFastContextHandlerShape when actually necessary

After bd3c5c4c234e3dc6b89cd235321945a41a08d562 "[API CHANGE] tdf#65393 
Import
signature line images from ooxml", UBSan CppunitTest_chart2_export had 
started
to fail with

> writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1898:25: runtime 
error: downcast of address 0x61200070a440 which does not point to an object of 
type 'writerfilter::ooxml::OOXMLFastContextHandlerShape'
> 0x61200070a440: note: object is of type 
'writerfilter::ooxml::OOXMLFastContextHandlerWrapper'
>  0e 10 00 20  50 86 4a 00 a2 7f 00 00  01 00 00 00 be be be be  00 00 00 
00 00 00 00 00  00 00 00 00
>   ^~~
>   vptr for 
'writerfilter::ooxml::OOXMLFastContextHandlerWrapper'

Change-Id: I028ef619766466e8cd9bb0ca09174b926fc6d23c

diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx 
b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index e25e7bc40fae..138954023f89 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1895,11 +1895,10 @@ 
OOXMLFastContextHandlerWrapper::lcl_createFastChildContext
 // here until we need a more generic solution.
 bool bIsWrap = Element == static_cast(NMSP_vmlWord | XML_wrap);
 bool bIsSignatureLine = Element == static_cast(NMSP_vmlOffice | 
XML_signatureline);
-bool bIsShapeSent = 
static_cast(mpParent)->isShapeSent();
 bool bSkipImages = getDocument()->IsSkipImages() && 
oox::getNamespace(Element) == static_cast(NMSP_dml) &&
 !((oox::getBaseToken(Element) == XML_linkedTxbx) || 
(oox::getBaseToken(Element) == XML_txbx));
 
-if ( bInNamespaces && ((!bIsWrap && !bIsSignatureLine) || bIsShapeSent) )
+if ( bInNamespaces && ((!bIsWrap && !bIsSignatureLine) || 
static_cast(mpParent)->isShapeSent()) )
 xResult.set(OOXMLFactory::createFastChildContextFromStart(this, 
Element));
 else if (mxContext.is()  && !bSkipImages)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-25 Thread Thomas Beck
 writerfilter/source/rtftok/rtfdispatchdestination.cxx |   24 +++---
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|2 -
 2 files changed, 4 insertions(+), 22 deletions(-)

New commits:
commit c1cf755afefec033377b8a693afed73d837a1387
Author: Thomas Beck 
Date:   Tue Oct 24 11:57:36 2017 +0200

tdf#108947 - Fixed regression

Handled Header/Footer that are specifically for Left/Right pages the old
way again. Fix done previously was too much.

Change-Id: I0f9e8d23022300a06bd3fb45054cca1b03cf096f
Reviewed-on: https://gerrit.libreoffice.org/43749
Tested-by: Jenkins 
Reviewed-by: Bartosz Kosiorek 

diff --git a/writerfilter/source/rtftok/rtfdispatchdestination.cxx 
b/writerfilter/source/rtftok/rtfdispatchdestination.cxx
index 2aa635e13488..ed5748ab0c85 100644
--- a/writerfilter/source/rtftok/rtfdispatchdestination.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchdestination.cxx
@@ -216,18 +216,10 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 }
 break;
 case RTF_HEADERL:
-if (!m_hasLHeader)
-{
-nId = NS_ooxml::LN_headerl;
-m_hasLHeader = true;
-}
+nId = NS_ooxml::LN_headerl;
 break;
 case RTF_HEADERR:
-if (!m_hasRHeader)
-{
-nId = NS_ooxml::LN_headerr;
-m_hasRHeader = true;
-}
+nId = NS_ooxml::LN_headerr;
 break;
 case RTF_HEADERF:
 if (!m_hasFHeader)
@@ -237,18 +229,10 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 }
 break;
 case RTF_FOOTERL:
-if (!m_hasLFooter)
-{
-nId = NS_ooxml::LN_footerl;
-m_hasLFooter = true;
-}
+nId = NS_ooxml::LN_footerl;
 break;
 case RTF_FOOTERR:
-if (!m_hasRFooter)
-{
-nId = NS_ooxml::LN_footerr;
-m_hasRFooter = true;
-}
+nId = NS_ooxml::LN_footerr;
 break;
 case RTF_FOOTERF:
 if (!m_hasFFooter)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 8780abc8ce66..386d3085d903 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -630,8 +630,6 @@ void RTFDocumentImpl::sectBreak(bool bFinal)
 {
 m_hasFHeader = false;
 m_hasRHeader = false;
-m_hasLHeader = false;
-m_hasLFooter = false;
 m_hasRFooter = false;
 m_hasFFooter = false;
 Mapper().endSectionGroup();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-24 Thread Andrea Gelmini
 writerfilter/source/dmapper/DomainMapper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 073814d83e6c93d84004bb3927f1d40ed1e8ff3a
Author: Andrea Gelmini 
Date:   Tue Oct 24 18:44:45 2017 +0200

Fix typo

Change-Id: I143e8df0e16ad921777b9caabde8e1c3f8bd61df
Reviewed-on: https://gerrit.libreoffice.org/43788
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 2a831262e6de..4d034cab669a 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -412,7 +412,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
 uno::Any aContextualSpacingFromStyle = 
m_pImpl->GetPropertyFromStyleSheet(PROP_PARA_CONTEXT_MARGIN);
 if (aContextualSpacingFromStyle.hasValue())
 // Setting "after" spacing means Writer doesn't inherit
-// contexual spacing anymore from style, but Word does.
+// contextual spacing anymore from style, but Word does.
 m_pImpl->GetTopContext()->Insert(PROP_PARA_CONTEXT_MARGIN, 
aContextualSpacingFromStyle);
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-20 Thread Caolán McNamara
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 1f4674c7c123a667f4fe96b1a1d0e083f19c
Author: Caolán McNamara 
Date:   Fri Oct 20 12:04:09 2017 +0100

Resolves: tdf#113230 crash in finishParagraph

Change-Id: I94535a51a87be097ff7356edff935877b42c3272
Reviewed-on: https://gerrit.libreoffice.org/43598
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 6870e5ff335c..6a4677f7ddf0 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4857,7 +4857,10 @@ void DomainMapper_Impl::StartOrEndBookmark( const 
OUString& rId )
 {
 uno::Reference< text::XTextCursor > xCursor = 
xTextAppend->createTextCursorByRange( xTextAppend->getEnd() );
 
-if(!bIsAfterDummyPara)
+if (!xCursor)
+return;
+
+if (!bIsAfterDummyPara)
 bIsStart = !xCursor->goLeft(1, false);
 xCurrent = xCursor->getStart();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-19 Thread Serge Krot
 writerfilter/source/dmapper/DomainMapper.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit f89dcfd3ce8b0ea788589247fb8c1124af51d30d
Author: Serge Krot 
Date:   Wed Sep 27 21:20:03 2017 +0200

related tdf#87533: handle LN_EG_SectPrContents_bidi correctly

Change-Id: I90d220550d24fb964cf4e528a1f506033f05de95
Reviewed-on: https://gerrit.libreoffice.org/42896
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 2e19432a9b56..af3579441047 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1519,7 +1519,10 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 break;
 case NS_ooxml::LN_EG_SectPrContents_bidi:
 if (pSectionContext != nullptr)
-pSectionContext->Insert(PROP_WRITING_MODE, uno::makeAny( 
sal_Int16(text::WritingMode2::RL_TB) ));
+{
+const sal_Int16 writingMode = (nIntValue != 0) ? 
sal_Int16(text::WritingMode2::RL_TB) : sal_Int16(text::WritingMode2::LR_TB);
+pSectionContext->Insert(PROP_WRITING_MODE, 
uno::makeAny(writingMode));
+}
 break;
 case NS_ooxml::LN_EG_RPrBase_highlight:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-18 Thread Andrea Gelmini
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 93c34fea480275343896ef25289a2b41ce19b114
Author: Andrea Gelmini 
Date:   Wed Oct 18 12:57:27 2017 +0200

Fix typo

Change-Id: Ie29a05fec90c0d81b4a0399505b0a6761dfdef69
Reviewed-on: https://gerrit.libreoffice.org/43463
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 545a003bb3e3..6870e5ff335c 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1186,7 +1186,7 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap )
 {
 // Workaround to make sure char props of the field are 
not lost.
 // Not relevant for editeng-based comments.
-// Nor revelent for fields inside a TOC field.
+// Not relevant for fields inside a TOC field.
 OUString const sMarker("X");
 xCursor = xTextAppend->getText()->createTextCursor();
 if (xCursor.is())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-16 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 250b52263a0e6030be51c4ce75c527f5f14ae43b
Author: Justin Luth 
Date:   Mon Oct 16 20:53:46 2017 +0300

Inconsistent block / missing TblBorders_right

Likely a copy/paste error, imported from OOo.

Change-Id: I29713309164170e86f8e793e2f15a601ce2b5da7
Reviewed-on: https://gerrit.libreoffice.org/43431
Reviewed-by: Justin Luth 
Tested-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 227f55935ee3..2e19432a9b56 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -697,10 +697,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
  */
 //TODO: unsupported?
 break;
-case NS_ooxml::LN_CT_TblCellMar_right: // 92375;
-case NS_ooxml::LN_CT_TblBorders_top: // 92377;
-case NS_ooxml::LN_CT_TblBorders_left: // 92378;
-case NS_ooxml::LN_CT_TblBorders_bottom: // 92379;
+case NS_ooxml::LN_CT_TblBorders_right:
+case NS_ooxml::LN_CT_TblBorders_top:
+case NS_ooxml::LN_CT_TblBorders_left:
+case NS_ooxml::LN_CT_TblBorders_bottom:
 //todo: handle cell mar
 break;
 case NS_ooxml::LN_blip: // contains the binary graphic
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-11 Thread Andrea Gelmini
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 10ba813b349fc7db3a2304ab9d31cccd06039cc6
Author: Andrea Gelmini 
Date:   Wed Oct 11 12:47:52 2017 +0200

Fix typo

Change-Id: Iab17008c8cc122176fb51b8766540d59cd681b35
Reviewed-on: https://gerrit.libreoffice.org/43316
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 8e1423cf1380..3ae08a1f56cf 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4971,7 +4971,7 @@ void 
DomainMapper_Impl::startOrEndPermissionRange(sal_Int32 permissinId)
 xTextAppend->insertTextContent(xCurrent, xPerm, bAbsorb);
 }
 
-// remove proccessed permission
+// remove processed permission
 m_aPermMap.erase(aPermIter);
 
 // clean up
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-06 Thread Serge Krot
 writerfilter/source/ooxml/factoryimpl.py|5 ++---
 writerfilter/source/ooxml/factoryimpl_ns.py |6 --
 2 files changed, 2 insertions(+), 9 deletions(-)

New commits:
commit f4cbd31465d3737855e694b7341fb3bc063d63c4
Author: Serge Krot 
Date:   Wed Oct 4 09:45:53 2017 +0200

related tdf#66398 remove useless breaks

Change-Id: I39caad06bcd645d582c180195a839113759b57a1
Reviewed-on: https://gerrit.libreoffice.org/43159
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/writerfilter/source/ooxml/factoryimpl.py 
b/writerfilter/source/ooxml/factoryimpl.py
index 2168fff556d7..3605892fe71f 100644
--- a/writerfilter/source/ooxml/factoryimpl.py
+++ b/writerfilter/source/ooxml/factoryimpl.py
@@ -25,7 +25,7 @@ def createFastChildContextFromFactory(model):
 (OOXMLFastContextHandler* pHandler, OOXMLFactory_ns::Pointer_t pFactory, 
Token_t Element)
 {
 uno::Reference  aResult;
-Id nDefine = pHandler->getDefine();
+const Id nDefine = pHandler->getDefine();
 
 if (pFactory.get() != NULL)
 {
@@ -33,7 +33,7 @@ def createFastChildContextFromFactory(model):
 Id nElementId;
 if (pFactory->getElementId(nDefine, Element, nResource, nElementId))
 {
-Id nId = pFactory->getResourceId(nDefine, Element);
+const Id nId = pFactory->getResourceId(nDefine, Element);
 
 switch (nResource)
 {""")
@@ -108,7 +108,6 @@ def fastTokenToId(model):
 print("""
 std::string fastTokenToId(sal_uInt32 nToken)
 {
-
 std::string sResult;
 #ifdef DEBUG_WRITERFILTER
 
diff --git a/writerfilter/source/ooxml/factoryimpl_ns.py 
b/writerfilter/source/ooxml/factoryimpl_ns.py
index 1134a14cb331..54e3b8c9060a 100644
--- a/writerfilter/source/ooxml/factoryimpl_ns.py
+++ b/writerfilter/source/ooxml/factoryimpl_ns.py
@@ -235,7 +235,6 @@ def printValueData(values):
 output_else = "else "
 print("else { return false; }")
 print("return true;")
-print("break;")
 print("}")
 
 
@@ -258,7 +257,6 @@ def factoryGetListValue(nsNode):
 appendValueData(values, valueData, 
idToLabel(valueNode.getAttribute("tokenid")))
 printValueData(values)
 print("return false;")
-print("break;")
 
 print("""default:
 break;
@@ -376,7 +374,6 @@ def factoryCreateElementMap(files, nsNode):
 print("default: return false;")
 print("}")
 print("return true;")
-print("break;")
 print("default:")
 print("switch (nId)")
 print("{")
@@ -384,10 +381,7 @@ def factoryCreateElementMap(files, nsNode):
 print("""default: return false;
 }
 return true;
-break;
 }
-
-return false;
 }
 """)
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-05 Thread Caolán McNamara
 writerfilter/source/dmapper/NumberingManager.cxx |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit ca95e886b42157d1d6394ed0b4c910978f5c2fda
Author: Caolán McNamara 
Date:   Thu Oct 5 15:54:42 2017 +0100

crashtesting: crash on import of abi3007-4.rtf

which started happending at...

commit 56a695fddb915bcba13b088b5b2b4e0841d4acbc
Date:   Tue Sep 26 09:13:05 2017 +0200

tdf#112211 RTF import: fix unwanted direct formatting for left indents

Change-Id: Id3e8c4452238b48495b1014eff14cdaddcb047ab
Reviewed-on: https://gerrit.libreoffice.org/43172
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index d1406421140a..c6165aad8784 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -754,16 +754,19 @@ void ListsManager::lcl_attribute( Id nName, Value& rVal )
 }
 break;
 case NS_ooxml::LN_CT_Ind_left:
-pCurrentLvl->Insert(
-PROP_INDENT_AT, uno::makeAny( 
ConversionHelper::convertTwipToMM100( nIntValue ) ));
+if ( pCurrentLvl.get( ) )
+pCurrentLvl->Insert(
+PROP_INDENT_AT, uno::makeAny( 
ConversionHelper::convertTwipToMM100( nIntValue ) ));
 break;
 case NS_ooxml::LN_CT_Ind_hanging:
-pCurrentLvl->Insert(
-PROP_FIRST_LINE_INDENT, uno::makeAny( - 
ConversionHelper::convertTwipToMM100( nIntValue ) ));
+if ( pCurrentLvl.get( ) )
+pCurrentLvl->Insert(
+PROP_FIRST_LINE_INDENT, uno::makeAny( - 
ConversionHelper::convertTwipToMM100( nIntValue ) ));
 break;
 case NS_ooxml::LN_CT_Ind_firstLine:
-pCurrentLvl->Insert(
-PROP_FIRST_LINE_INDENT, uno::makeAny( 
ConversionHelper::convertTwipToMM100( nIntValue ) ));
+if ( pCurrentLvl.get( ) )
+pCurrentLvl->Insert(
+PROP_FIRST_LINE_INDENT, uno::makeAny( 
ConversionHelper::convertTwipToMM100( nIntValue ) ));
 break;
 case NS_ooxml::LN_CT_Lvl_ilvl: //overrides previous level - unsupported
 case NS_ooxml::LN_CT_Lvl_tplc: //template code - unsupported
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-10-04 Thread Mike Kaganski
 writerfilter/source/dmapper/BorderHandler.cxx|8 +++---
 writerfilter/source/dmapper/CellColorHandler.cxx |8 +++---
 writerfilter/source/dmapper/CellMarginHandler.cxx|6 ++--
 writerfilter/source/dmapper/ConversionHelper.cxx |2 -
 writerfilter/source/dmapper/DomainMapper.cxx |   20 +++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   14 +-
 writerfilter/source/dmapper/DomainMapperTableHandler.hxx |4 +--
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |   16 ++--
 writerfilter/source/dmapper/DomainMapperTableManager.hxx |2 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|   10 +++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx|2 -
 writerfilter/source/dmapper/FontTable.cxx|2 -
 writerfilter/source/dmapper/GraphicImport.cxx|2 -
 writerfilter/source/dmapper/LatentStyleHandler.cxx   |2 -
 writerfilter/source/dmapper/MeasureHandler.cxx   |6 ++--
 writerfilter/source/dmapper/ModelEventListener.cxx   |4 +--
 writerfilter/source/dmapper/NumberingManager.hxx |2 -
 writerfilter/source/dmapper/OLEHandler.cxx   |6 ++--
 writerfilter/source/dmapper/PropertyMap.cxx  |6 ++--
 writerfilter/source/dmapper/SdtHelper.cxx|2 -
 writerfilter/source/dmapper/SdtHelper.hxx|2 -
 writerfilter/source/dmapper/SectionColumnHandler.cxx |6 ++--
 writerfilter/source/dmapper/SettingsTable.cxx|6 ++--
 writerfilter/source/dmapper/SmartTagHandler.cxx  |2 -
 writerfilter/source/dmapper/StyleSheetTable.cxx  |   12 -
 writerfilter/source/dmapper/StyleSheetTable.hxx  |2 -
 writerfilter/source/dmapper/TDefTableHandler.cxx |6 ++--
 writerfilter/source/dmapper/TableManager.cxx |8 +++---
 writerfilter/source/dmapper/TableManager.hxx |4 +--
 writerfilter/source/dmapper/TablePositionHandler.cxx |4 +--
 writerfilter/source/dmapper/TablePropertiesHandler.cxx   |2 -
 writerfilter/source/dmapper/TablePropertiesHandler.hxx   |2 -
 writerfilter/source/dmapper/TblStylePrHandler.cxx|4 +--
 writerfilter/source/dmapper/TblStylePrHandler.hxx|2 -
 writerfilter/source/dmapper/TextEffectsHandler.cxx   |2 -
 writerfilter/source/dmapper/TextEffectsHandler.hxx   |2 -
 writerfilter/source/dmapper/ThemeTable.cxx   |2 -
 writerfilter/source/dmapper/TrackChangesHandler.cxx  |6 ++--
 writerfilter/source/dmapper/TrackChangesHandler.hxx  |2 -
 writerfilter/source/dmapper/domainmapperfactory.cxx  |2 -
 writerfilter/source/dmapper/util.cxx |2 -
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx  |2 -
 writerfilter/source/ooxml/OOXMLStreamImpl.cxx|2 -
 writerfilter/source/rtftok/rtfcharsets.cxx   |2 -
 writerfilter/source/rtftok/rtfcontrolwords.cxx   |2 -
 writerfilter/source/rtftok/rtfdispatchdestination.cxx|   10 +++
 writerfilter/source/rtftok/rtfdispatchflag.cxx   |6 ++--
 writerfilter/source/rtftok/rtfdispatchsymbol.cxx |6 ++--
 writerfilter/source/rtftok/rtfdispatchvalue.cxx  |   10 +++
 writerfilter/source/rtftok/rtfdocumentfactory.cxx|2 -
 writerfilter/source/rtftok/rtfdocumentimpl.cxx   |   12 -
 writerfilter/source/rtftok/rtfdocumentimpl.hxx   |8 +++---
 writerfilter/source/rtftok/rtflistener.hxx   |2 -
 writerfilter/source/rtftok/rtflookahead.cxx  |2 -
 writerfilter/source/rtftok/rtflookahead.hxx  |4 +--
 writerfilter/source/rtftok/rtfreferenceproperties.cxx|2 -
 writerfilter/source/rtftok/rtfreferenceproperties.hxx|2 -
 writerfilter/source/rtftok/rtfreferencetable.cxx |2 -
 writerfilter/source/rtftok/rtfsdrimport.cxx  |4 +--
 writerfilter/source/rtftok/rtfsdrimport.hxx  |2 -
 writerfilter/source/rtftok/rtfskipdestination.cxx|2 -
 writerfilter/source/rtftok/rtfskipdestination.hxx|2 -
 writerfilter/source/rtftok/rtfsprm.cxx   |2 -
 writerfilter/source/rtftok/rtfsprm.hxx   |2 -
 writerfilter/source/rtftok/rtftokenizer.cxx  |4 +--
 writerfilter/source/rtftok/rtftokenizer.hxx  |2 -
 writerfilter/source/rtftok/rtfvalue.cxx  |4 +--
 67 files changed, 152 insertions(+), 152 deletions(-)

New commits:
commit 633f405701fc5cadfa73e950f7a8c122ad01c149
Author: Mike Kaganski 
Date:   Wed Oct 4 19:01:14 2017 +0300

writerfilter: consistently use "" and <> in include directives

[cpp.include] tells that includes in <> are searched in 
implementation-defined

[Libreoffice-commits] core.git: writerfilter/source

2017-09-29 Thread Noel Grandin
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 8b12c98ec7ec0b5ba20c28890ee63803fb9518d5
Author: Noel Grandin 
Date:   Fri Sep 29 14:44:16 2017 +0200

remove some SAL_WARN in DomainMapper_Impl

it's obviously not a real problem, because higher up code calls this
even if it doesn't intend to use the result, and in the places where it
does intend to use the result, it warns again, so this warning is
redundant.
And it's the 3rd largest number of warnings in our logs.

Change-Id: I1a6c40bc99a3252594f87e121a81c661686c5348

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 3f07f324a461..a6223b741061 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -575,8 +575,6 @@ voidDomainMapper_Impl::PopProperties(ContextType eId)
 PropertyMapPtr DomainMapper_Impl::GetTopContextOfType(ContextType eId)
 {
 PropertyMapPtr pRet;
-SAL_WARN_IF( m_aPropertyStacks[eId].empty(), "writerfilter.dmapper",
-"no context of type " << static_cast(eId) << " available");
 if(!m_aPropertyStacks[eId].empty())
 pRet = m_aPropertyStacks[eId].top();
 return pRet;
@@ -5365,7 +5363,6 @@ SectionPropertyMap * 
DomainMapper_Impl::GetSectionContext()
 if( !IsAnyTableImport() )
 {
 PropertyMapPtr pContext = GetTopContextOfType(CONTEXT_SECTION);
-OSL_ENSURE(pContext.get(), "Section context is not in the stack!");
 pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() 
);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-09-29 Thread Miklos Vajna
 writerfilter/source/ooxml/OOXMLPropertySet.cxx |   18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit a3c2cce616c3a072ed7f7f8133b88db165ccbc5c
Author: Miklos Vajna 
Date:   Fri Sep 29 10:37:38 2017 +0200

Revert "writerfilter: convert loops to range-based-for"

This reverts commit 25cd067a82742210793e39708cc1de9ff84692a7, as it
broke CppunitTest_sw_ooxmlexport4. The comment above the change suggests
that perhaps the usage of indexes was intentional to avoid the usage of
invalidated iterators.

diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx 
b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index d4b7d1284af7..bd80f8dc5112 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -329,8 +329,8 @@ OOXMLValue * OOXMLInputStreamValue::clone() const
 */
 
 OOXMLPropertySet::OOXMLPropertySet()
-: maType("OOXMLPropertySet")
 {
+maType = "OOXMLPropertySet";
 }
 
 OOXMLPropertySet::~OOXMLPropertySet()
@@ -343,8 +343,10 @@ void OOXMLPropertySet::resolve(Properties & rHandler)
 // be appended to mProperties. I don't think it can cause elements
 // to be deleted. But let's check with < here just to be safe that
 // the indexing below works.
-for (OOXMLProperty::Pointer_t & pProp : mProperties)
+for (size_t nIt = 0; nIt < mProperties.size(); ++nIt)
 {
+OOXMLProperty::Pointer_t pProp = mProperties[nIt];
+
 if (pProp.get() != nullptr)
 pProp->resolve(rHandler);
 }
@@ -745,17 +747,23 @@ OOXMLTable::~OOXMLTable()
 
 void OOXMLTable::resolve(Table & rTable)
 {
+Table * pTable = 
+
 int nPos = 0;
 
-for (const ValuePointer_t & it : mPropertySets)
+PropertySets_t::iterator it = mPropertySets.begin();
+PropertySets_t::iterator itEnd = mPropertySets.end();
+
+while (it != itEnd)
 {
 writerfilter::Reference::Pointer_t pProperties
-(it->getProperties());
+((*it)->getProperties());
 
 if (pProperties.get() != nullptr)
-rTable.entry(nPos, pProperties);
+pTable->entry(nPos, pProperties);
 
 ++nPos;
+++it;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-09-28 Thread Serge Krot
 writerfilter/source/ooxml/OOXMLPropertySet.cxx |   18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

New commits:
commit 25cd067a82742210793e39708cc1de9ff84692a7
Author: Serge Krot 
Date:   Thu Sep 28 12:55:45 2017 +0200

writerfilter: convert loops to range-based-for

Change-Id: I424fd1bf8eef7112a8cff54ab46a07bb41596ca5
Reviewed-on: https://gerrit.libreoffice.org/42901
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx 
b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index bd80f8dc5112..d4b7d1284af7 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -329,8 +329,8 @@ OOXMLValue * OOXMLInputStreamValue::clone() const
 */
 
 OOXMLPropertySet::OOXMLPropertySet()
+: maType("OOXMLPropertySet")
 {
-maType = "OOXMLPropertySet";
 }
 
 OOXMLPropertySet::~OOXMLPropertySet()
@@ -343,10 +343,8 @@ void OOXMLPropertySet::resolve(Properties & rHandler)
 // be appended to mProperties. I don't think it can cause elements
 // to be deleted. But let's check with < here just to be safe that
 // the indexing below works.
-for (size_t nIt = 0; nIt < mProperties.size(); ++nIt)
+for (OOXMLProperty::Pointer_t & pProp : mProperties)
 {
-OOXMLProperty::Pointer_t pProp = mProperties[nIt];
-
 if (pProp.get() != nullptr)
 pProp->resolve(rHandler);
 }
@@ -747,23 +745,17 @@ OOXMLTable::~OOXMLTable()
 
 void OOXMLTable::resolve(Table & rTable)
 {
-Table * pTable = 
-
 int nPos = 0;
 
-PropertySets_t::iterator it = mPropertySets.begin();
-PropertySets_t::iterator itEnd = mPropertySets.end();
-
-while (it != itEnd)
+for (const ValuePointer_t & it : mPropertySets)
 {
 writerfilter::Reference::Pointer_t pProperties
-((*it)->getProperties());
+(it->getProperties());
 
 if (pProperties.get() != nullptr)
-pTable->entry(nPos, pProperties);
+rTable.entry(nPos, pProperties);
 
 ++nPos;
-++it;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-09-26 Thread Stephan Bergmann
 writerfilter/source/rtftok/rtfdispatchvalue.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 01dea3321c23c7a83134f25a1ea62a6d3e8cddf4
Author: Stephan Bergmann 
Date:   Tue Sep 26 10:38:19 2017 +0200

Map RTF codepage 0 to osl_getThreadTextEncoding()

...instead of RTL_TEXTENCODING_DONTKNOW.  (A file actually using that 
codepage
is sw/qa/core/data/rtf/pass/CVE-2014-6357.rtf, processed by
CppunitTest/sw_filters_test, where it caused OStringToOUString to be called 
with
RTL_TEXTENCODING_DONTKNOW from
writerfilter::rtftok::RTFDocumentImpl::resolveChars.)

Change-Id: I41081c5df5c3aa80b4f1c7d52b158e73ef68cf38

diff --git a/writerfilter/source/rtftok/rtfdispatchvalue.cxx 
b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
index f6a243e2fbc0..bebaee85107e 100644
--- a/writerfilter/source/rtftok/rtfdispatchvalue.cxx
+++ b/writerfilter/source/rtftok/rtfdispatchvalue.cxx
@@ -13,6 +13,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -386,7 +387,9 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword 
nKeyword, int nParam)
 // not found
 return RTFError::OK;
 
-m_nCurrentEncoding = 
rtl_getTextEncodingFromWindowsCodePage(aRTFEncodings[i].codepage);
+m_nCurrentEncoding = aRTFEncodings[i].codepage == 0 // Default (CP_ACP)
+? osl_getThreadTextEncoding()
+: 
rtl_getTextEncodingFromWindowsCodePage(aRTFEncodings[i].codepage);
 m_aStates.top().nCurrentEncoding = m_nCurrentEncoding;
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source writerperfect/source

2017-09-25 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx   |9 -
 writerperfect/source/writer/EPUBExportFilter.cxx |   10 +-
 2 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 59ec0fe032badfb9dae59f27e97f842c11c60d98
Author: Miklos Vajna 
Date:   Mon Sep 25 09:13:58 2017 +0200

RTF import: split this call into simpler ones

Hopefully with this it's easier to see which is the usual and which one
is the exceptional case.

Change-Id: Iac1b49b2a4f2b909db46155d1ff10d2ba99fd655

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index e8483bb43f2f..575562fb2eca 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3209,11 +3209,10 @@ void RTFDocumentImpl::checkUnicode(bool bUnicode, bool 
bHex)
 }
 if (bHex && !m_aHexBuffer.isEmpty())
 {
-OUString aString = OStringToOUString(
-m_aHexBuffer.makeStringAndClear(),
-((m_aStates.top().eDestination == Destination::FONTENTRY
-  && m_aStates.top().nCurrentEncoding == RTL_TEXTENCODING_SYMBOL)
- ? RTL_TEXTENCODING_MS_1252 : m_aStates.top().nCurrentEncoding));
+rtl_TextEncoding nEncoding = m_aStates.top().nCurrentEncoding;
+if (m_aStates.top().eDestination == Destination::FONTENTRY && 
m_aStates.top().nCurrentEncoding == RTL_TEXTENCODING_SYMBOL)
+nEncoding = RTL_TEXTENCODING_MS_1252;
+OUString aString = 
OStringToOUString(m_aHexBuffer.makeStringAndClear(), nEncoding);
 text(aString);
 }
 }
diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx 
b/writerperfect/source/writer/EPUBExportFilter.cxx
index eefbdc4c9d4d..239884ef605f 100644
--- a/writerperfect/source/writer/EPUBExportFilter.cxx
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -28,11 +28,11 @@ using namespace com::sun::star;
 #if !LIBEPUBGEN_VERSION_SUPPORT
 namespace libepubgen
 {
-enum EPUBStylesMethod
-{
-EPUB_STYLES_METHOD_CSS, //< The styles will be described in a separate 
CSS file.
-EPUB_STYLES_METHOD_INLINE, //< The styles will be described inline.
-};
+enum EPUBStylesMethod
+{
+EPUB_STYLES_METHOD_CSS, //< The styles will be described in a separate CSS 
file.
+EPUB_STYLES_METHOD_INLINE, //< The styles will be described inline.
+};
 }
 #endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source writerperfect/source xmlhelp/source xmlreader/source xmlscript/source xmlsecurity/source

2017-09-14 Thread Noel Grandin
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |4 +--
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|   10 
 writerfilter/source/dmapper/NumberingManager.cxx |   12 +++---
 writerfilter/source/dmapper/StyleSheetTable.cxx  |2 -
 writerperfect/source/common/WPXSvInputStream.cxx |6 ++---
 xmlhelp/source/cxxhelp/provider/databases.cxx|6 ++---
 xmlreader/source/xmlreader.cxx   |   16 +
 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx  |2 -
 xmlsecurity/source/dialogs/resourcemanager.cxx   |4 +--
 xmlsecurity/source/helper/xmlsignaturehelper.cxx |   18 +++
 10 files changed, 37 insertions(+), 43 deletions(-)

New commits:
commit b0de7bc428aaf914a836da3c33b123e4195e603e
Author: Noel Grandin 
Date:   Thu Aug 31 12:05:39 2017 +0200

clang-tidy modernize-use-emplace in various

Change-Id: Id1bbd3f380c17beeaab11f7140d4df1304c3d0d8
Reviewed-on: https://gerrit.libreoffice.org/41750
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index a00548c84b56..98faa97b635d 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -1152,7 +1152,7 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel, bool bTab
 sal_Int32 nTableWidth = 0;
 m_aTableProperties->getValue(TablePropertyMap::TABLE_WIDTH, 
nTableWidth);
 if (m_rDMapper_Impl.GetSectionContext() && nestedTableLevel <= 1 
&& !m_rDMapper_Impl.IsInHeaderFooter())
-
m_rDMapper_Impl.m_aPendingFloatingTables.push_back(FloatingTableInfo(xStart, 
xEnd, comphelper::containerToSequence(aFrameProperties), nTableWidth));
+m_rDMapper_Impl.m_aPendingFloatingTables.emplace_back(xStart, 
xEnd, comphelper::containerToSequence(aFrameProperties), nTableWidth);
 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.
@@ -1183,7 +1183,7 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel, bool bTab
 void DomainMapperTableHandler::startRow(const TablePropertyMapPtr& pProps)
 {
 m_aRowProperties.push_back( pProps );
-m_aCellProperties.push_back( PropertyMapVector1() );
+m_aCellProperties.emplace_back( );
 
 #ifdef DEBUG_WRITERFILTER
 TagLogger::getInstance().startElement("table.row");
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 2cd7f7fff6c2..1b777821b8b3 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -600,7 +600,7 @@ void DomainMapper_Impl::InitTabStopFromStyle( const 
uno::Sequence< style::TabSto
 OSL_ENSURE(m_aCurrentTabStops.empty(), "tab stops already initialized");
 for( sal_Int32 nTab = 0; nTab < rInitTabStops.getLength(); ++nTab)
 {
-m_aCurrentTabStops.push_back( DeletableTabStop(rInitTabStops[nTab]) );
+m_aCurrentTabStops.emplace_back(rInitTabStops[nTab] );
 }
 }
 
@@ -5227,13 +5227,13 @@ void DomainMapper_Impl::ApplySettingsTable()
 std::vector aViewProps;
 if (m_pSettingsTable->GetZoomFactor())
 {
-aViewProps.push_back(beans::PropertyValue("ZoomFactor", 
-1, uno::makeAny(m_pSettingsTable->GetZoomFactor()), 
beans::PropertyState_DIRECT_VALUE));
-aViewProps.push_back(beans::PropertyValue("VisibleBottom", 
-1, uno::makeAny(sal_Int32(0)), beans::PropertyState_DIRECT_VALUE));
-aViewProps.push_back(beans::PropertyValue("ZoomType", -1, 
uno::makeAny(sal_Int16(0)), beans::PropertyState_DIRECT_VALUE));
+aViewProps.emplace_back("ZoomFactor", -1, 
uno::makeAny(m_pSettingsTable->GetZoomFactor()), 
beans::PropertyState_DIRECT_VALUE);
+aViewProps.emplace_back("VisibleBottom", -1, 
uno::makeAny(sal_Int32(0)), beans::PropertyState_DIRECT_VALUE);
+aViewProps.emplace_back("ZoomType", -1, 
uno::makeAny(sal_Int16(0)), beans::PropertyState_DIRECT_VALUE);
 }
 if (m_pSettingsTable->GetView())
 {
-
aViewProps.push_back(beans::PropertyValue("ShowOnlineLayout", -1, 
uno::makeAny(m_pSettingsTable->GetView() == 
NS_ooxml::LN_Value_doc_ST_View_web), beans::PropertyState_DIRECT_VALUE));
+aViewProps.emplace_back("ShowOnlineLayout", -1, 
uno::makeAny(m_pSettingsTable->GetView() == 
NS_ooxml::LN_Value_doc_ST_View_web), beans::PropertyState_DIRECT_VALUE);
 }
 

[Libreoffice-commits] core.git: writerfilter/source

2017-09-07 Thread Miklos Vajna
 writerfilter/source/dmapper/SdtHelper.hxx |2 
 writerfilter/source/dmapper/TableManager.cxx  |   10 +--
 writerfilter/source/filter/RtfFilter.cxx  |2 
 writerfilter/source/filter/WriterFilter.cxx   |4 -
 writerfilter/source/rtftok/rtfdispatchdestination.cxx |2 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|   55 --
 writerfilter/source/rtftok/rtfdocumentimpl.hxx|   20 +++---
 writerfilter/source/rtftok/rtfsdrimport.cxx   |6 -
 writerfilter/source/rtftok/rtfsdrimport.hxx   |2 
 writerfilter/source/rtftok/rtfsprm.cxx|   16 ++---
 writerfilter/source/rtftok/rtftokenizer.cxx   |2 
 writerfilter/source/rtftok/rtfvalue.cxx   |   12 +--
 12 files changed, 64 insertions(+), 69 deletions(-)

New commits:
commit 105b9ce13cbf19e898b5971279b5fe53410ddb71
Author: Miklos Vajna 
Date:   Thu Sep 7 09:09:47 2017 +0200

writerfilter: size() > 0 -> !empty() and other small cleanups

Change-Id: I808a3ed8180b6f2164f14d736e2c8dc4bb8948bc
Reviewed-on: https://gerrit.libreoffice.org/42037
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerfilter/source/dmapper/SdtHelper.hxx 
b/writerfilter/source/dmapper/SdtHelper.hxx
index 3f3574af7adf..595071377cf0 100644
--- a/writerfilter/source/dmapper/SdtHelper.hxx
+++ b/writerfilter/source/dmapper/SdtHelper.hxx
@@ -67,7 +67,7 @@ class SdtHelper final
 bool m_bOutsideAParagraph;
 
 /// Create and append the drawing::XControlShape, containing the various 
models.
-void createControlShape(css::awt::Size aSize, 
css::uno::Reference const&, const 
css::uno::Sequence& rGrabBag);
+void createControlShape(css::awt::Size aSize, 
css::uno::Reference const& xControlModel, const 
css::uno::Sequence& rGrabBag);
 public:
 explicit SdtHelper(DomainMapper_Impl& rDM_Impl);
 ~SdtHelper();
diff --git a/writerfilter/source/dmapper/TableManager.cxx 
b/writerfilter/source/dmapper/TableManager.cxx
index 697d109136d0..87ca79b5e118 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -39,7 +39,7 @@ void TableManager::openCell(const 
css::uno::Reference& rH
 TagLogger::getInstance().endElement();
 #endif
 
-if (mTableDataStack.size() > 0)
+if (!mTableDataStack.empty())
 {
 TableData::Pointer_t pTableData = mTableDataStack.top();
 
@@ -197,7 +197,7 @@ void TableManager::closeCell(const 
css::uno::Reference& r
 TagLogger::getInstance().endElement();
 #endif
 
-if (mTableDataStack.size() > 0)
+if (!mTableDataStack.empty())
 {
 TableData::Pointer_t pTableData = mTableDataStack.top();
 
@@ -214,7 +214,7 @@ void TableManager::ensureOpenCell(const 
TablePropertyMapPtr& pProps)
 TagLogger::getInstance().startElement("tablemanager.ensureOpenCell");
 #endif
 
-if (mTableDataStack.size() > 0)
+if (!mTableDataStack.empty())
 {
 TableData::Pointer_t pTableData = mTableDataStack.top();
 
@@ -345,7 +345,7 @@ void TableManager::endLevel()
 #ifdef DEBUG_WRITERFILTER
 TableData::Pointer_t pTableData;
 
-if (mTableDataStack.size() > 0)
+if (!mTableDataStack.empty())
 pTableData = mTableDataStack.top();
 
 TagLogger::getInstance().startElement("tablemanager.endLevel");
@@ -363,7 +363,7 @@ void TableManager::startLevel()
 #ifdef DEBUG_WRITERFILTER
 TableData::Pointer_t pTableData;
 
-if (mTableDataStack.size() > 0)
+if (!mTableDataStack.empty())
 pTableData = mTableDataStack.top();
 
 TagLogger::getInstance().startElement("tablemanager.startLevel");
diff --git a/writerfilter/source/filter/RtfFilter.cxx 
b/writerfilter/source/filter/RtfFilter.cxx
index d985942b863f..6487b015c6bf 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -204,7 +204,7 @@ uno::Sequence 
RtfFilter::getSupportedServiceNames()
 return aRet;
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* SAL_CALL 
com_sun_star_comp_Writer_RtfFilter_get_implementation(uno::XComponentContext* 
pComponent, uno::Sequence const&)
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* SAL_CALL 
com_sun_star_comp_Writer_RtfFilter_get_implementation(uno::XComponentContext* 
pComponent, uno::Sequence const& /*rSequence*/)
 {
 return cppu::acquire(new RtfFilter(pComponent));
 }
diff --git a/writerfilter/source/filter/WriterFilter.cxx 
b/writerfilter/source/filter/WriterFilter.cxx
index eafbb21d0bd5..36527b7a5223 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -149,7 +149,7 @@ sal_Bool WriterFilter::filter(const uno::Sequence< 
beans::PropertyValue >& rDesc
 xExprtr->setSourceDocument(m_xSrcDoc);
 return xFltr->filter(rDescriptor);
 }
-else if (m_xDstDoc.is())
+if (m_xDstDoc.is())
 

[Libreoffice-commits] core.git: writerfilter/source

2017-08-25 Thread Miklos Vajna
 writerfilter/source/dmapper/LatentStyleHandler.cxx   |4 ++--
 writerfilter/source/dmapper/LatentStyleHandler.hxx   |2 +-
 writerfilter/source/dmapper/SmartTagHandler.cxx  |6 +++---
 writerfilter/source/dmapper/SmartTagHandler.hxx  |4 ++--
 writerfilter/source/dmapper/TableManager.hxx |4 ++--
 writerfilter/source/dmapper/TablePositionHandler.cxx |4 ++--
 writerfilter/source/dmapper/TablePositionHandler.hxx |2 +-
 writerfilter/source/filter/RtfFilter.cxx |8 
 writerfilter/source/filter/WriterFilter.cxx  |8 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx   |4 ++--
 writerfilter/source/rtftok/rtfdocumentimpl.hxx   |4 ++--
 writerfilter/source/rtftok/rtfsdrimport.cxx  |4 ++--
 writerfilter/source/rtftok/rtfsdrimport.hxx  |4 ++--
 13 files changed, 29 insertions(+), 29 deletions(-)

New commits:
commit 329213cb249e92d2483780f9193e3355854234f2
Author: Miklos Vajna 
Date:   Thu Aug 24 22:51:54 2017 +0200

writerfilter: fix inconsistent param naming in interface/implementation

Talking about names when those are numbers is confusing.

Change-Id: Icfeed8924daeb1d6f658118515f9d4a76229106e
Reviewed-on: https://gerrit.libreoffice.org/41540
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerfilter/source/dmapper/LatentStyleHandler.cxx 
b/writerfilter/source/dmapper/LatentStyleHandler.cxx
index 5be3e72d65ee..cfd01c770cc7 100644
--- a/writerfilter/source/dmapper/LatentStyleHandler.cxx
+++ b/writerfilter/source/dmapper/LatentStyleHandler.cxx
@@ -23,11 +23,11 @@ LatentStyleHandler::LatentStyleHandler() :
 
 LatentStyleHandler::~LatentStyleHandler() = default;
 
-void LatentStyleHandler::lcl_attribute(Id rName, Value& rVal)
+void LatentStyleHandler::lcl_attribute(Id nId, Value& rVal)
 {
 beans::PropertyValue aValue;
 bool bFound = true;
-switch (rName)
+switch (nId)
 {
 case NS_ooxml::LN_CT_LsdException_name:
 aValue.Name = "name";
diff --git a/writerfilter/source/dmapper/LatentStyleHandler.hxx 
b/writerfilter/source/dmapper/LatentStyleHandler.hxx
index 778c108d9a88..f75b77c2caf2 100644
--- a/writerfilter/source/dmapper/LatentStyleHandler.hxx
+++ b/writerfilter/source/dmapper/LatentStyleHandler.hxx
@@ -26,7 +26,7 @@ class LatentStyleHandler
 std::vector m_aAttributes;
 
 // Properties
-void lcl_attribute(Id Name, Value& val) override;
+void lcl_attribute(Id nId, Value& rVal) override;
 void lcl_sprm(Sprm& sprm) override;
 
 public:
diff --git a/writerfilter/source/dmapper/SmartTagHandler.cxx 
b/writerfilter/source/dmapper/SmartTagHandler.cxx
index 1d8c8a385486..4a1ee2b4cfdf 100644
--- a/writerfilter/source/dmapper/SmartTagHandler.cxx
+++ b/writerfilter/source/dmapper/SmartTagHandler.cxx
@@ -44,9 +44,9 @@ 
SmartTagHandler::SmartTagHandler(uno::Reference xCompone
 
 SmartTagHandler::~SmartTagHandler() = default;
 
-void SmartTagHandler::lcl_attribute(Id nName, Value& rValue)
+void SmartTagHandler::lcl_attribute(Id nId, Value& rValue)
 {
-switch (nName)
+switch (nId)
 {
 case NS_ooxml::LN_CT_Attr_name:
 m_aAttributes.emplace_back(rValue.getString(), OUString());
@@ -56,7 +56,7 @@ void SmartTagHandler::lcl_attribute(Id nName, Value& rValue)
 m_aAttributes.back().second = rValue.getString();
 break;
 default:
-SAL_WARN("writerfilter", "SmartTagHandler::lcl_attribute: unhandled 
attribute " << nName << " (string value: '"<

[Libreoffice-commits] core.git: writerfilter/source

2017-08-22 Thread Justin Luth
 writerfilter/source/dmapper/GraphicImport.cxx |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit d092521b2595963dcf0928f5fee7ed1903ff4aef
Author: Justin Luth 
Date:   Sat Aug 19 22:07:41 2017 -0400

writerfilter: default graphics in header to the background.

Instead of always qualifying each bOpaque query with an additional
check to see if it is in the header/footer, base the default
value conditionally on IsInHeaderFooter().

This doesn't cause any logic change, but it does re-enforce the
concept that for compatibility, graphics in header/footers are
always behind the text. Especially helpful to prevent errors
in future uses of bOpaque that otherwise might miss this
important qualification.

Change-Id: I7c0142f220d454c09ff14af65382317273402a86
Reviewed-on: https://gerrit.libreoffice.org/41346
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/GraphicImport.cxx 
b/writerfilter/source/dmapper/GraphicImport.cxx
index 12f2e1130638..65a20747c38f 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -265,7 +265,7 @@ public:
 ,nVertRelation( text::RelOrientation::FRAME )
 ,nWrap(text::WrapTextMode_NONE)
 ,bLayoutInCell(false)
-,bOpaque( true )
+,bOpaque( !rDMapper.IsInHeaderFooter() )
 ,bContour(false)
 ,bContourOutside(true)
 ,nLeftMargin(319)
@@ -839,8 +839,7 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
 
 xShapeProps->setPropertyValue("SurroundContour", 
uno::makeAny(m_pImpl->bContour));
 m_pImpl->applyMargins(xShapeProps);
-bool bOpaque = m_pImpl->bOpaque && 
!m_pImpl->rDomainMapper.IsInHeaderFooter();
-xShapeProps->setPropertyValue("Opaque", 
uno::makeAny(bOpaque));
+xShapeProps->setPropertyValue("Opaque", 
uno::makeAny(m_pImpl->bOpaque));
 xShapeProps->setPropertyValue("Surround", 
uno::makeAny((sal_Int32)m_pImpl->nWrap));
 m_pImpl->applyZOrder(xShapeProps);
 m_pImpl->applyName(xShapeProps);
@@ -1256,11 +1255,9 @@ uno::Reference< text::XTextContent > 
GraphicImport::createGraphicObject( const b
 
 m_pImpl->applyPosition(xGraphicObjectProperties);
 m_pImpl->applyRelativePosition(xGraphicObjectProperties);
-bool bOpaque = m_pImpl->bOpaque && 
!m_pImpl->rDomainMapper.IsInHeaderFooter( );
-if( !bOpaque )
+if( !m_pImpl->bOpaque )
 {
-
xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_OPAQUE ),
-uno::makeAny(bOpaque));
+
xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_OPAQUE ), 
uno::makeAny(m_pImpl->bOpaque));
 }
 xGraphicObjectProperties->setPropertyValue(getPropertyName( 
PROP_SURROUND ),
 uno::makeAny((sal_Int32)m_pImpl->nWrap));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-08-09 Thread Tamás Zolnai
 writerfilter/source/dmapper/OLEHandler.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 368b583b992f2e9cad46c2362c9529a07c36d7a9
Author: Tamás Zolnai 
Date:   Wed Aug 9 21:43:09 2017 +0200

Avoid warning in OleHandler

Related to ActiveX controls.

Change-Id: Ief7ee67ca8e4f086a1d5e0400d0eaf3ebc8cdaaf
Reviewed-on: https://gerrit.libreoffice.org/40934
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 

diff --git a/writerfilter/source/dmapper/OLEHandler.cxx 
b/writerfilter/source/dmapper/OLEHandler.cxx
index 24ec24c8f844..ae1e13a0041b 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -100,6 +101,12 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal)
 {
 uno::Reference< drawing::XShape > xTempShape;
 rVal.getAny() >>= xTempShape;
+
+// Control shape is handled on a different code path
+uno::Reference< lang::XServiceInfo > xSInfo( xTempShape, 
uno::UNO_QUERY_THROW );
+if(xSInfo->supportsService("com.sun.star.drawing.ControlShape"))
+break;
+
 if( xTempShape.is() )
 {
 m_xShape.set( xTempShape );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-08-08 Thread Mike Kaganski
 writerfilter/source/dmapper/TableManager.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 35f6c447dba89d5c8b1f80ae7068fbb45901406f
Author: Mike Kaganski 
Date:   Tue Aug 8 16:52:02 2017 +0200

TableManager::endParagraphGroup(): remove unused variable

Change-Id: I06bd74118a7bc3d68267688ae2477b31b2c8d068
Reviewed-on: https://gerrit.libreoffice.org/40889
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/dmapper/TableManager.cxx 
b/writerfilter/source/dmapper/TableManager.cxx
index 38f7d0fa..697d109136d0 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -255,8 +255,6 @@ void TableManager::endParagraphGroup()
 
 if (mnTableDepth > 0)
 {
-TableData::Pointer_t pTableData = mTableDataStack.top();
-
 if (isRowEnd())
 {
 endOfRowAction();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-08-07 Thread Justin Luth
 writerfilter/source/rtftok/rtftokenizer.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0342c5e8086c8200ecadbe9d52dd4ef6a093effb
Author: Justin Luth 
Date:   Mon Aug 7 15:33:52 2017 -0400

wrong word in comment: should be signal instead of single.

...confirmed by the similar comment immediately before it.

Change-Id: Id334a81bb9078a761d233631639c007b7bf2c17f
Reviewed-on: https://gerrit.libreoffice.org/40855
Tested-by: Jenkins 
Reviewed-by: Justin Luth 

diff --git a/writerfilter/source/rtftok/rtftokenizer.hxx 
b/writerfilter/source/rtftok/rtftokenizer.hxx
index 343e597720d0..19c26d8d196b 100644
--- a/writerfilter/source/rtftok/rtftokenizer.hxx
+++ b/writerfilter/source/rtftok/rtftokenizer.hxx
@@ -39,7 +39,7 @@ public:
 }
 /// To be invoked by the pushState() callback to signal when the importer 
enters a group.
 void pushGroup();
-/// To be invoked by the popState() callback to single when the importer 
leaves a group.
+/// To be invoked by the popState() callback to signal when the importer 
leaves a group.
 void popGroup();
 OUString getPosition();
 std::size_t getGroupStart()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-29 Thread Mike Kaganski
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx   |   16 -
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |  153 ++
 writerfilter/source/ooxml/OOXMLFastContextHandler.hxx |2 
 writerfilter/source/ooxml/OOXMLPropertySet.cxx|8 
 writerfilter/source/ooxml/OOXMLPropertySet.hxx|3 
 5 files changed, 69 insertions(+), 113 deletions(-)

New commits:
commit fb497a1bd0287999819f12388c73d86f793fae76
Author: Mike Kaganski 
Date:   Sat Jul 29 10:55:52 2017 +0300

OOXMLPropertySet: simplify adding property; use pointer_t consistently

Change-Id: I0f457e60da1ca765dfdb1458b9de629b0dbeccad
Reviewed-on: https://gerrit.libreoffice.org/40545
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx 
b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index c4eda1d02186..77e30bf386e2 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -356,23 +356,15 @@ OOXMLPropertySet * OOXMLDocumentImpl::getPicturePropSet
 
 OOXMLValue::Pointer_t pPayloadValue(new OOXMLBinaryValue(pPicture));
 
-OOXMLProperty::Pointer_t pPayloadProperty
-(new OOXMLProperty(NS_ooxml::LN_payload, pPayloadValue,
-   OOXMLProperty::ATTRIBUTE));
-
 OOXMLPropertySet::Pointer_t pBlipSet(new OOXMLPropertySet);
 
-pBlipSet->add(pPayloadProperty);
+pBlipSet->add(NS_ooxml::LN_payload, pPayloadValue, 
OOXMLProperty::ATTRIBUTE);
 
 OOXMLValue::Pointer_t pBlipValue(new OOXMLPropertySetValue(pBlipSet));
 
-OOXMLProperty::Pointer_t pBlipProperty
-(new OOXMLProperty(NS_ooxml::LN_blip, pBlipValue,
-   OOXMLProperty::ATTRIBUTE));
-
 OOXMLPropertySet * pProps = new OOXMLPropertySet;
 
-pProps->add(pBlipProperty);
+pProps->add(NS_ooxml::LN_blip, pBlipValue, OOXMLProperty::ATTRIBUTE);
 
 return pProps;
 }
@@ -380,9 +372,9 @@ OOXMLPropertySet * OOXMLDocumentImpl::getPicturePropSet
 void OOXMLDocumentImpl::resolvePicture(Stream & rStream,
const OUString & rId)
 {
-OOXMLPropertySet * pProps = getPicturePropSet(rId);
+OOXMLPropertySet::Pointer_t pProps(getPicturePropSet(rId));
 
-rStream.props(writerfilter::Reference::Pointer_t(pProps));
+rStream.props(pProps);
 }
 
 OUString OOXMLDocumentImpl::getTargetForId(const OUString & rId)
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx 
b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 1bf94413caa6..c82b62113876 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -305,21 +305,17 @@ void OOXMLFastContextHandler::sendTableDepth() const
 {
 if (mnTableDepth > 0)
 {
-OOXMLPropertySet * pProps = new OOXMLPropertySet;
+OOXMLPropertySet::Pointer_t pProps(new OOXMLPropertySet);
 {
 OOXMLValue::Pointer_t pVal = 
OOXMLIntegerValue::Create(mnTableDepth);
-OOXMLProperty::Pointer_t pProp
-(new OOXMLProperty(NS_ooxml::LN_tblDepth, pVal, 
OOXMLProperty::SPRM));
-pProps->add(pProp);
+pProps->add(NS_ooxml::LN_tblDepth, pVal, OOXMLProperty::SPRM);
 }
 {
 OOXMLValue::Pointer_t pVal = OOXMLIntegerValue::Create(1);
-OOXMLProperty::Pointer_t pProp
-(new OOXMLProperty(NS_ooxml::LN_inTbl, pVal, 
OOXMLProperty::SPRM));
-pProps->add(pProp);
+pProps->add(NS_ooxml::LN_inTbl, pVal, OOXMLProperty::SPRM);
 }
 
-
mpStream->props(writerfilter::Reference::Pointer_t(pProps));
+mpStream->props(pProps);
 }
 }
 
@@ -396,20 +392,18 @@ void OOXMLFastContextHandler::endParagraphGroup()
 
 void OOXMLFastContextHandler::startSdt()
 {
-OOXMLPropertySet * pProps = new OOXMLPropertySet;
+OOXMLPropertySet::Pointer_t pProps(new OOXMLPropertySet);
 OOXMLValue::Pointer_t pVal = OOXMLIntegerValue::Create(1);
-OOXMLProperty::Pointer_t pProp(new 
OOXMLProperty(NS_ooxml::LN_CT_SdtBlock_sdtContent, pVal, 
OOXMLProperty::ATTRIBUTE));
-pProps->add(pProp);
-mpStream->props(writerfilter::Reference::Pointer_t(pProps));
+pProps->add(NS_ooxml::LN_CT_SdtBlock_sdtContent, pVal, 
OOXMLProperty::ATTRIBUTE);
+mpStream->props(pProps);
 }
 
 void OOXMLFastContextHandler::endSdt()
 {
-OOXMLPropertySet * pProps = new OOXMLPropertySet;
+OOXMLPropertySet::Pointer_t pProps(new OOXMLPropertySet);
 OOXMLValue::Pointer_t pVal = OOXMLIntegerValue::Create(1);
-OOXMLProperty::Pointer_t pProp(new 
OOXMLProperty(NS_ooxml::LN_CT_SdtBlock_sdtEndContent, pVal, 
OOXMLProperty::ATTRIBUTE));
-pProps->add(pProp);
-mpStream->props(writerfilter::Reference::Pointer_t(pProps));
+

[Libreoffice-commits] core.git: writerfilter/source

2017-07-25 Thread Mike Kaganski
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |   11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

New commits:
commit d3f48117216a02bc8ae86e821b54abae1a2c2c39
Author: Mike Kaganski 
Date:   Tue Jul 25 14:10:31 2017 +0200

DomainMapperTableManager::sprm: use std::find

Change-Id: Iaad2fe950372ecd5261d83554015dc771b3abbf8
Reviewed-on: https://gerrit.libreoffice.org/40403
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index fa86c2e1471f..82e7640471fe 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -176,18 +176,9 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
 the final sizing of the table, but then must use 
the contents of each cell to determine final column widths.
 (See 17.18.87 of the ISO/IEC 29500-1:2011.)
 */
-bool bFixed = true;
 IntVectorPtr pCellWidths = getCurrentCellWidths();
 // Check whether all cells have fixed widths in 
the given row of table.
-for (std::vector::const_iterator 
aValIter = pCellWidths->begin(); aValIter != pCellWidths->end(); ++aValIter)
-{
-if (*aValIter == -1)
-{
-bFixed = false;
-break;
-}
-}
-
+bool bFixed = std::find(pCellWidths->begin(), 
pCellWidths->end(), -1) == pCellWidths->end();
 if (!bFixed)
 {
 // Set the width type of table with 'Auto' and 
set the width value to 0 (as per grid values)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-25 Thread Mike Kaganski
 writerfilter/source/ooxml/OOXMLPropertySet.cxx |   27 ++---
 1 file changed, 7 insertions(+), 20 deletions(-)

New commits:
commit 123ea883b0643894c928bd8edd4203bdc60cc054
Author: Mike Kaganski 
Date:   Tue Jul 25 13:15:36 2017 +0200

OOXMLPropertySet: initialize variables on creation and cleanup

Change-Id: Iea92bdb4759ed9514674125325352d2fd2b372f8
Reviewed-on: https://gerrit.libreoffice.org/40400
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx 
b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index 118850144686..4947eef47475 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -75,9 +75,7 @@ writerfilter::Reference::Pointer_t 
OOXMLProperty::getProps()
 #ifdef DEBUG_WRITERFILTER
 string OOXMLProperty::getName() const
 {
-string sResult;
-
-sResult = (*QNameToString::Instance())(mId);
+string sResult((*QNameToString::Instance())(mId));
 
 if (sResult.length() == 0)
 sResult = fastTokenToId(mId);
@@ -113,17 +111,14 @@ string OOXMLProperty::toString() const
 
 void OOXMLProperty::resolve(writerfilter::Properties & rProperties)
 {
-writerfilter::Properties * pProperties = nullptr;
-pProperties = 
-
 switch (meType)
 {
 case SPRM:
 if (mId != 0x0)
-pProperties->sprm(*this);
+rProperties.sprm(*this);
 break;
 case ATTRIBUTE:
-pProperties->attribute(mId, *getValue());
+rProperties.attribute(mId, *getValue());
 break;
 }
 }
@@ -250,9 +245,7 @@ int OOXMLBooleanValue::getInt() const
 
 uno::Any OOXMLBooleanValue::getAny() const
 {
-uno::Any aResult(mbValue);
-
-return aResult;
+return uno::Any(mbValue);
 }
 
 #ifdef DEBUG_WRITERFILTER
@@ -282,9 +275,7 @@ OOXMLStringValue::~OOXMLStringValue()
 
 uno::Any OOXMLStringValue::getAny() const
 {
-uno::Any aAny(mStr);
-
-return aAny;
+return uno::Any(mStr);
 }
 
 OUString OOXMLStringValue::getString() const
@@ -318,9 +309,7 @@ OOXMLInputStreamValue::~OOXMLInputStreamValue()
 
 uno::Any OOXMLInputStreamValue::getAny() const
 {
-uno::Any aAny(mxInputStream);
-
-return aAny;
+return uno::Any(mxInputStream);
 }
 
 #ifdef DEBUG_WRITERFILTER
@@ -526,9 +515,7 @@ int OOXMLIntegerValue::getInt() const
 
 uno::Any OOXMLIntegerValue::getAny() const
 {
-uno::Any aResult(mnValue);
-
-return aResult;
+return uno::Any(mnValue);
 }
 
 OOXMLValue * OOXMLIntegerValue::clone() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-25 Thread Mike Kaganski
 writerfilter/source/dmapper/MeasureHandler.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 376e27dd498d64212e570354a94c527b37d367b1
Author: Mike Kaganski 
Date:   Tue Jul 25 12:24:09 2017 +0200

MeasureHandler: Remove incorrect numeric-value-of-constant comments

Change-Id: I89ab3028af12cede2ff1c80c41be053208bf9a43
Reviewed-on: https://gerrit.libreoffice.org/40396
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/writerfilter/source/dmapper/MeasureHandler.cxx 
b/writerfilter/source/dmapper/MeasureHandler.cxx
index 43fce6b4b24f..69a824826324 100644
--- a/writerfilter/source/dmapper/MeasureHandler.cxx
+++ b/writerfilter/source/dmapper/MeasureHandler.cxx
@@ -49,7 +49,7 @@ void MeasureHandler::lcl_attribute(Id rName, Value & rVal)
 sal_Int32 nIntValue = rVal.getInt();
 switch( rName )
 {
-case NS_ooxml::LN_CT_TblWidth_type:// = 90668;
+case NS_ooxml::LN_CT_TblWidth_type:
 {
 //can be: NS_ooxml::LN_Value_ST_TblWidth_nil, 
NS_ooxml::LN_Value_ST_TblWidth_pct,
 //NS_ooxml::LN_Value_ST_TblWidth_dxa, 
NS_ooxml::LN_Value_ST_TblWidth_auto;
@@ -70,14 +70,14 @@ void MeasureHandler::lcl_attribute(Id rName, Value & rVal)
 }
 }
 break;
-case NS_ooxml::LN_CT_Height_hRule: // 90666;
+case NS_ooxml::LN_CT_Height_hRule:
 {
 OUString sHeightType = rVal.getString();
 if ( sHeightType == "exact" )
 m_nRowHeightSizeType = text::SizeType::FIX;
 }
 break;
-case NS_ooxml::LN_CT_TblWidth_w:// = 90667;
+case NS_ooxml::LN_CT_TblWidth_w:
 m_nMeasureValue = nIntValue;
 if (!m_aInteropGrabBagName.isEmpty())
 {
@@ -87,7 +87,7 @@ void MeasureHandler::lcl_attribute(Id rName, Value & rVal)
 m_aInteropGrabBag.push_back(aValue);
 }
 break;
-case NS_ooxml::LN_CT_Height_val: // 90665 -- a string value
+case NS_ooxml::LN_CT_Height_val: // a string value
 {
 m_nUnit = NS_ooxml::LN_Value_ST_TblWidth_dxa;
 OUString sHeight = rVal.getString();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-25 Thread Mike Kaganski
 writerfilter/source/ooxml/OOXMLPropertySet.cxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 0e1e33f053c235dd8b63c60f68280f9cf9571281
Author: Mike Kaganski 
Date:   Tue Jul 25 11:58:57 2017 +0200

OOXMLPropertySet::add: resize->reserve + range-based loop

Change-Id: I22fd6893137fcc8815fa222fdfa59f7076887399
Reviewed-on: https://gerrit.libreoffice.org/40393
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx 
b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index da8a3dd1bf23..118850144686 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -399,10 +399,9 @@ void OOXMLPropertySet::add(const 
OOXMLPropertySet::Pointer_t& pPropertySet)
 
 if (pSet != nullptr)
 {
-mProperties.resize(mProperties.size() + pSet->mProperties.size());
-for (OOXMLProperties_t::iterator aIt = pSet->mProperties.begin();
- aIt != pSet->mProperties.end(); ++aIt)
-add(*aIt);
+mProperties.reserve(mProperties.size() + pSet->mProperties.size());
+for (const auto& aIt: pSet->mProperties)
+add(aIt);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-25 Thread Mike Kaganski
 writerfilter/source/ooxml/OOXMLPropertySet.cxx |   17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 04a6a5d5cdc6889c6f0e41b3df537f59baeee9f9
Author: Mike Kaganski 
Date:   Tue Jul 25 09:10:01 2017 +0200

OOXMLPropertySet::add: remove redundant check

Change-Id: I06aa0d2a2e463069ad200c93329d263f0bd2a00e
Reviewed-on: https://gerrit.libreoffice.org/40388
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx 
b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index b7b50d1bf20f..da8a3dd1bf23 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -395,17 +395,14 @@ void OOXMLPropertySet::add(const 
OOXMLProperty::Pointer_t& pProperty)
 
 void OOXMLPropertySet::add(const OOXMLPropertySet::Pointer_t& pPropertySet)
 {
-if (pPropertySet.get() != nullptr)
+OOXMLPropertySet * pSet = pPropertySet.get();
+
+if (pSet != nullptr)
 {
-OOXMLPropertySet * pSet = pPropertySet.get();
-
-if (pSet != nullptr)
-{
-mProperties.resize(mProperties.size() + pSet->mProperties.size());
-for (OOXMLProperties_t::iterator aIt = pSet->mProperties.begin();
- aIt != pSet->mProperties.end(); ++aIt)
-add(*aIt);
-}
+mProperties.resize(mProperties.size() + pSet->mProperties.size());
+for (OOXMLProperties_t::iterator aIt = pSet->mProperties.begin();
+ aIt != pSet->mProperties.end(); ++aIt)
+add(*aIt);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-11 Thread Mike Kaganski
 writerfilter/source/dmapper/DomainMapper.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 8f40e90fdf03fe47f1b49d1f4ce15da85998eb0d
Author: Mike Kaganski 
Date:   Tue Jul 11 07:57:40 2017 +0200

Small cleanup

Change-Id: I68ffa3f79df0acf484868c13817d76582edd7a41
Reviewed-on: https://gerrit.libreoffice.org/39790
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 92bcdc30f969..9c61c5365161 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3218,10 +3218,7 @@ void DomainMapper::lcl_positivePercentage(const 
OUString& rText)
 
 void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
 {
-OUString sText;
-OUStringBuffer aBuffer = OUStringBuffer(sal::static_int_cast(len));
-aBuffer.append( reinterpret_cast(data_), len);
-sText = aBuffer.makeStringAndClear();
+OUString sText(reinterpret_cast(data_), len);
 const RubyInfo & aInfo = m_pImpl->GetRubyInfo();
 if (aInfo.nSprmId == NS_ooxml::LN_CT_Ruby_rt)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-10 Thread Mike Kaganski
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit f2a1298ea409141a9190c7789b39546644084980
Author: Mike Kaganski 
Date:   Mon Jul 10 12:00:13 2017 +0200

DomainMapper_Impl: remove redundant check

Change-Id: I09d5ec303e08e1a49c55dd91ccfdad9d6f07e04b
Reviewed-on: https://gerrit.libreoffice.org/39747
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 584368f5199f..9dfa48f1d657 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1071,9 +1071,7 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap )
 if (m_aTextAppendStack.empty())
 return;
 TextAppendContext& rAppendContext = m_aTextAppendStack.top();
-uno::Reference< text::XTextAppend >  xTextAppend;
-if (!m_aTextAppendStack.empty())
-xTextAppend = rAppendContext.xTextAppend;
+uno::Reference< text::XTextAppend > 
xTextAppend(rAppendContext.xTextAppend);
 
 #ifdef DEBUG_WRITERFILTER
 TagLogger::getInstance().attribute("isTextAppend", 
sal_uInt32(xTextAppend.is()));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-08 Thread Szymon Kłos
 writerfilter/source/dmapper/OLEHandler.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 505ce3a2ba3adeef46daecbf9b14c42cea211408
Author: Szymon Kłos 
Date:   Fri Jul 7 12:58:42 2017 +0200

tdf#108544 edit in window (XLSX inside DOCX)

Change-Id: If1dd46643dc2ae9cc74ba94038609ae3445a416c
Reviewed-on: https://gerrit.libreoffice.org/39706
Tested-by: Jenkins 
Reviewed-by: Szymon Kłos 

diff --git a/writerfilter/source/dmapper/OLEHandler.cxx 
b/writerfilter/source/dmapper/OLEHandler.cxx
index 68067648c1ef..24ec24c8f844 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -186,6 +186,8 @@ void OLEHandler::importStream(const 
uno::Reference& xCom
 OUString aFilterService;
 if (m_sProgId == "Word.Document.12")
 aFilterService = "com.sun.star.comp.Writer.WriterFilter";
+else if (m_sProgId == "Excel.Sheet.12")
+aFilterService = "com.sun.star.comp.oox.xls.ExcelFilter";
 else if (m_sProgId == "Equation.3")
 aFilterService = "com.sun.star.comp.Math.MathTypeFilter";
 else
@@ -228,6 +230,11 @@ OUString OLEHandler::getCLSID(const 
uno::Reference& xCom
 if 
(officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get(xComponentContext))
 aRet = "8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6";
 }
+else if (m_sProgId == "Excel.Sheet.12")
+{
+if 
(officecfg::Office::Common::Filter::Microsoft::Import::ExcelToCalc::get(xComponentContext))
+aRet = "47BBB4CB-CE4C-4E80-A591-42D9AE74950F";
+}
 else if (m_sProgId == "Equation.3")
 {
 if 
(officecfg::Office::Common::Filter::Microsoft::Import::MathTypeToMath::get(xComponentContext))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-06 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit eda9605ad51c82c4dc7dedcb8910f2384d6cc460
Author: Justin Luth 
Date:   Wed Jul 5 21:34:12 2017 -0400

writerfilter: remove unused nkey variable assignment

Introduced with Noel's commit f433a86839499662cfc1356882b0538f01d850b6.
It looks like leftover debugging code (to check that the value written
is the value retrieved).

Change-Id: Idd9dffedf14788be19193785855060733a0b3e3e
Reviewed-on: https://gerrit.libreoffice.org/39616
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index dfa7d58d8114..8b8a78995b8a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2576,8 +2576,6 @@ void DomainMapper_Impl::SetNumberFormat( const OUString& 
rCommand,
 xPropertySet->setPropertyValue(
 getPropertyName(PROP_NUMBER_FORMAT),
 uno::makeAny( nKey ));
-xPropertySet->getPropertyValue(
-getPropertyName(PROP_NUMBER_FORMAT ) ) >>= nKey;
 }
 catch(const uno::Exception&)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-07-03 Thread Miklos Vajna
 writerfilter/source/filter/RtfFilter.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 75bb1926c5ec3ea4b40d578851774725de0e7440
Author: Miklos Vajna 
Date:   Mon Jul 3 08:01:10 2017 +0200

writerfilter: fix indentation

Change-Id: Ibc258a02ddb6385fb50206a6cc694f169432bd22

diff --git a/writerfilter/source/filter/RtfFilter.cxx 
b/writerfilter/source/filter/RtfFilter.cxx
index 61dcaac29c01..1d77b5253ed1 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -139,8 +139,8 @@ sal_Bool RtfFilter::filter(const uno::Sequence< 
beans::PropertyValue >& aDescrip
 
 writerfilter::Stream::Pointer_t pStream(
 writerfilter::dmapper::DomainMapperFactory::createMapper(
-m_xContext, xInputStream, m_xDstDoc, bRepairStorage,
-writerfilter::dmapper::SourceDocumentType::RTF, 
aMediaDesc));
+m_xContext, xInputStream, m_xDstDoc, bRepairStorage,
+writerfilter::dmapper::SourceDocumentType::RTF, aMediaDesc));
 writerfilter::rtftok::RTFDocument::Pointer_t pDocument(
 
writerfilter::rtftok::RTFDocumentFactory::createDocument(m_xContext, 
xInputStream, m_xDstDoc, xFrame, xStatusIndicator, aMediaDesc));
 pDocument->resolve(*pStream);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-30 Thread Justin Luth
 writerfilter/source/dmapper/StyleSheetTable.cxx |   35 +++-
 1 file changed, 23 insertions(+), 12 deletions(-)

New commits:
commit fb39062ed958c2a5df90c0aff7d873746122067c
Author: Justin Luth 
Date:   Thu Jun 22 17:53:00 2017 -0400

revert related tdf#82173 writerfilter: ignore case when mapping styles

and added the missing lowercase "Xnote reference" mappings.

Word can create both Heading1 and heading1 styles in the same
document. So case CAN be important.

Unfortunately, these mappings precede git history, so it will require
trial and error to judge which mappings are obsolete or simply invalid.
At least one of the existing mappings was not really correct anyway
(Endnote Text"->"Endnote Symbol") so reverting the change
to prevent other unanticipated regressions.

Change-Id: I3fcce125f8822040897e99f5101e277cc705ae75
Reviewed-on: https://gerrit.libreoffice.org/39132
Reviewed-by: Justin Luth 
Tested-by: Justin Luth 
Reviewed-on: https://gerrit.libreoffice.org/39396
Tested-by: Jenkins 

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 2861377454ad..13d520f75441 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -46,22 +46,11 @@
 
 using namespace ::com::sun::star;
 
-namespace {
-
-/** Functor for case-insensitive string comparison, usable in maps etc. */
-struct IgnoreCaseCompare
-{
-bool operator()( const OUString& rName1, const OUString& rName2 ) const
-{ return rName1.compareToIgnoreAsciiCase( rName2 ) < 0; }
-};
-
-} // namespace
-
 namespace writerfilter {
 namespace dmapper
 {
 
-typedef ::std::map< OUString, OUString, IgnoreCaseCompare> StringPairMap_t;
+typedef ::std::map< OUString, OUString> StringPairMap_t;
 
 
 StyleSheetEntry::StyleSheetEntry() :
@@ -1302,6 +1291,15 @@ const StyleSheetEntryPtr 
StyleSheetTable::FindParentStyleSheet(const OUString& _
 static const sal_Char* const aStyleNamePairs[] =
 {
 "Normal", "Standard",
+"heading 1",  "Heading 1",
+"heading 2",  "Heading 2",
+"heading 3",  "Heading 3",
+"heading 4",  "Heading 4",
+"heading 5",  "Heading 5",
+"heading 6",  "Heading 6",
+"heading 7",  "Heading 7",
+"heading 8",  "Heading 8",
+"heading 9",  "Heading 9",
 "Heading1",   "Heading 1",
 "Heading2",   "Heading 2",
 "Heading3",   "Heading 3",
@@ -1339,6 +1337,15 @@ static const sal_Char* const aStyleNamePairs[] =
 "TOC 8", "Contents 8",
 "TOC 9", "Contents 9",
 "TOCHeading","Contents Heading",
+"toc 1", "Contents 1",
+"toc 2", "Contents 2",
+"toc 3", "Contents 3",
+"toc 4", "Contents 4",
+"toc 5", "Contents 5",
+"toc 6", "Contents 6",
+"toc 7", "Contents 7",
+"toc 8", "Contents 8",
+"toc 9", "Contents 9",
 "TOC1", "Contents 1",
 "TOC2", "Contents 2",
 "TOC3", "Contents 3",
@@ -1353,16 +1360,20 @@ static const sal_Char* const aStyleNamePairs[] =
 "Footnote Text", "Footnote",
 "Annotation Text",   "",
 "Header","Header",
+"header","Header",
 "Footer","Footer",
+"footer","Footer",
 "Index Heading", "Index Heading",
 "Caption",   "",
 "Table of Figures",  "",
 "Envelope Address",  "Addressee",
 "Envelope Return",   "Sender",
+"footnote reference","Footnote Characters",
 "Footnote Reference","Footnote Characters",
 "Annotation Reference",  "",
 "Line Number",   "Line numbering",
 "Page Number",   "Page Number",
+"endnote reference", "Endnote Characters",
 "Endnote Reference", "Endnote Characters",
 "endnote text",  "Endnote",
 "Endnote Text",  "Endnote",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-29 Thread Stephan Bergmann
 writerfilter/source/dmapper/StyleSheetTable.cxx |   34 
 1 file changed, 12 insertions(+), 22 deletions(-)

New commits:
commit 1091744caf4f5509a67b5e5fc8ba2251ef5a6a18
Author: Stephan Bergmann 
Date:   Thu Jun 29 09:53:54 2017 +0200

Revert "revert related tdf#82173 writerfilter: ignore case when mapping 
styles"

This reverts commit 803a17533f25d9174c6a19aa913a6713980c193d, which caused
CppunitTest_sw_ooxmlexport9 to fail.

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 27e0ade07925..699f605a52a6 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -46,11 +46,22 @@
 
 using namespace ::com::sun::star;
 
+namespace {
+
+/** Functor for case-insensitive string comparison, usable in maps etc. */
+struct IgnoreCaseCompare
+{
+bool operator()( const OUString& rName1, const OUString& rName2 ) const
+{ return rName1.compareToIgnoreAsciiCase( rName2 ) < 0; }
+};
+
+} // namespace
+
 namespace writerfilter {
 namespace dmapper
 {
 
-typedef ::std::map< OUString, OUString> StringPairMap_t;
+typedef ::std::map< OUString, OUString, IgnoreCaseCompare> StringPairMap_t;
 
 
 StyleSheetEntry::StyleSheetEntry() :
@@ -1291,15 +1302,6 @@ const StyleSheetEntryPtr 
StyleSheetTable::FindParentStyleSheet(const OUString& _
 static const sal_Char* const aStyleNamePairs[] =
 {
 "Normal", "Standard",
-"heading 1",  "Heading 1",
-"heading 2",  "Heading 2",
-"heading 3",  "Heading 3",
-"heading 4",  "Heading 4",
-"heading 5",  "Heading 5",
-"heading 6",  "Heading 6",
-"heading 7",  "Heading 7",
-"heading 8",  "Heading 8",
-"heading 9",  "Heading 9",
 "Heading1",   "Heading 1",
 "Heading2",   "Heading 2",
 "Heading3",   "Heading 3",
@@ -1337,15 +1339,6 @@ static const sal_Char* const aStyleNamePairs[] =
 "TOC 8", "Contents 8",
 "TOC 9", "Contents 9",
 "TOCHeading","Contents Heading",
-"toc 1", "Contents 1",
-"toc 2", "Contents 2",
-"toc 3", "Contents 3",
-"toc 4", "Contents 4",
-"toc 5", "Contents 5",
-"toc 6", "Contents 6",
-"toc 7", "Contents 7",
-"toc 8", "Contents 8",
-"toc 9", "Contents 9",
 "TOC1", "Contents 1",
 "TOC2", "Contents 2",
 "TOC3", "Contents 3",
@@ -1359,15 +1352,12 @@ static const sal_Char* const aStyleNamePairs[] =
 "Footnote Text", "Footnote",
 "Annotation Text",   "",
 "Header","Header",
-"header","Header",
 "Footer","Footer",
-"footer","Footer",
 "Index Heading", "Index Heading",
 "Caption",   "",
 "Table of Figures",  "",
 "Envelope Address",  "Addressee",
 "Envelope Return",   "Sender",
-"footnote reference","Footnote Characters",
 "Footnote Reference","Footnote Characters",
 "Annotation Reference",  "",
 "Line Number",   "Line numbering",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-28 Thread Justin Luth
 writerfilter/source/dmapper/StyleSheetTable.cxx |   34 +++-
 1 file changed, 22 insertions(+), 12 deletions(-)

New commits:
commit 803a17533f25d9174c6a19aa913a6713980c193d
Author: Justin Luth 
Date:   Thu Jun 22 17:53:00 2017 -0400

revert related tdf#82173 writerfilter: ignore case when mapping styles

and added the missing lowercase "footnote reference" mapping.

Word can create both Heading1 and heading1 styles in the same
document. So case CAN be important.

Unfortunately, these mappings precede git history, so it will require
trial and error to judge which mappings are obsolete or simply invalid.
At least one of the existing mappings was not really correct anyway
(Endnote Text"->"Endnote Symbol") so reverting the change
to prevent other unanticipated regressions.

Change-Id: Ia8669c975debcb3074e758b42c24fb65233f8369
Reviewed-on: https://gerrit.libreoffice.org/39132
Reviewed-by: Justin Luth 
Tested-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 699f605a52a6..27e0ade07925 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -46,22 +46,11 @@
 
 using namespace ::com::sun::star;
 
-namespace {
-
-/** Functor for case-insensitive string comparison, usable in maps etc. */
-struct IgnoreCaseCompare
-{
-bool operator()( const OUString& rName1, const OUString& rName2 ) const
-{ return rName1.compareToIgnoreAsciiCase( rName2 ) < 0; }
-};
-
-} // namespace
-
 namespace writerfilter {
 namespace dmapper
 {
 
-typedef ::std::map< OUString, OUString, IgnoreCaseCompare> StringPairMap_t;
+typedef ::std::map< OUString, OUString> StringPairMap_t;
 
 
 StyleSheetEntry::StyleSheetEntry() :
@@ -1302,6 +1291,15 @@ const StyleSheetEntryPtr 
StyleSheetTable::FindParentStyleSheet(const OUString& _
 static const sal_Char* const aStyleNamePairs[] =
 {
 "Normal", "Standard",
+"heading 1",  "Heading 1",
+"heading 2",  "Heading 2",
+"heading 3",  "Heading 3",
+"heading 4",  "Heading 4",
+"heading 5",  "Heading 5",
+"heading 6",  "Heading 6",
+"heading 7",  "Heading 7",
+"heading 8",  "Heading 8",
+"heading 9",  "Heading 9",
 "Heading1",   "Heading 1",
 "Heading2",   "Heading 2",
 "Heading3",   "Heading 3",
@@ -1339,6 +1337,15 @@ static const sal_Char* const aStyleNamePairs[] =
 "TOC 8", "Contents 8",
 "TOC 9", "Contents 9",
 "TOCHeading","Contents Heading",
+"toc 1", "Contents 1",
+"toc 2", "Contents 2",
+"toc 3", "Contents 3",
+"toc 4", "Contents 4",
+"toc 5", "Contents 5",
+"toc 6", "Contents 6",
+"toc 7", "Contents 7",
+"toc 8", "Contents 8",
+"toc 9", "Contents 9",
 "TOC1", "Contents 1",
 "TOC2", "Contents 2",
 "TOC3", "Contents 3",
@@ -1352,12 +1359,15 @@ static const sal_Char* const aStyleNamePairs[] =
 "Footnote Text", "Footnote",
 "Annotation Text",   "",
 "Header","Header",
+"header","Header",
 "Footer","Footer",
+"footer","Footer",
 "Index Heading", "Index Heading",
 "Caption",   "",
 "Table of Figures",  "",
 "Envelope Address",  "Addressee",
 "Envelope Return",   "Sender",
+"footnote reference","Footnote Characters",
 "Footnote Reference","Footnote Characters",
 "Annotation Reference",  "",
 "Line Number",   "Line numbering",
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source xmlhelp/source

2017-06-28 Thread Noel Grandin
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   19 +++
 writerfilter/source/filter/RtfFilter.cxx  |6 --
 writerfilter/source/filter/WriterFilter.cxx   |6 --
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx   |9 +++--
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|2 +-
 xmlhelp/source/cxxhelp/provider/databases.cxx |9 +++--
 xmlhelp/source/cxxhelp/provider/db.cxx|3 +--
 7 files changed, 23 insertions(+), 31 deletions(-)

New commits:
commit bdabb4c07d89bf57fa5cc52455c889337052a8c8
Author: Noel Grandin 
Date:   Wed Jun 28 09:13:04 2017 +0200

loplugin:oncevar in writerfilter..xmlhelp

Change-Id: I1319494e16586f7e0b5149faecd3d1c36e336b1b
Reviewed-on: https://gerrit.libreoffice.org/39343
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 7e4da2b359a5..89783dde0597 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -773,7 +773,7 @@ static void 
lcl_MoveBorderPropertiesToFrame(std::vector& r
 if(!xTextRangeProperties.is())
 return ;
 
-PropertyIds aBorderProperties[] =
+static PropertyIds const aBorderProperties[] =
 {
 PROP_LEFT_BORDER,
 PROP_RIGHT_BORDER,
@@ -785,9 +785,7 @@ static void 
lcl_MoveBorderPropertiesToFrame(std::vector& r
 PROP_BOTTOM_BORDER_DISTANCE
 };
 
-sal_uInt32 const nBorderPropertyCount = SAL_N_ELEMENTS( 
aBorderProperties );
-
-for( sal_uInt32 nProperty = 0; nProperty < nBorderPropertyCount; 
++nProperty)
+for( sal_uInt32 nProperty = 0; nProperty < SAL_N_ELEMENTS( 
aBorderProperties ); ++nProperty)
 {
 OUString sPropertyName = 
getPropertyName(aBorderProperties[nProperty]);
 beans::PropertyValue aValue;
@@ -1188,7 +1186,7 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap )
 {
 // Workaround to make sure char props of the field are 
not lost.
 // Not relevant for editeng-based comments.
-OUString sMarker("X");
+OUString const sMarker("X");
 xCursor = xTextAppend->getText()->createTextCursor();
 if (xCursor.is())
 xCursor->gotoEnd(false);
@@ -3080,10 +3078,9 @@ void DomainMapper_Impl::handleFieldFormula
 
 // we don't copy the = symbol from the command
 OUString formula = command.copy(1);
-sal_Int32 standardFormat = 0;
 
 xFieldProperties->setPropertyValue(getPropertyName(PROP_CONTENT), 
uno::makeAny(formula));
-xFieldProperties->setPropertyValue(getPropertyName(PROP_NUMBER_FORMAT), 
uno::makeAny(standardFormat));
+xFieldProperties->setPropertyValue(getPropertyName(PROP_NUMBER_FORMAT), 
uno::makeAny(sal_Int32(0)));
 xFieldProperties->setPropertyValue("IsShowFormula", uno::makeAny(false));
 }
 
@@ -3574,7 +3571,7 @@ void DomainMapper_Impl::handleToc
 pContext->SetTOC( xTOC );
 m_bParaHadField = false;
 
-OUString sMarker("Y");
+OUString const sMarker("Y");
 //insert index
 uno::Reference< text::XTextContent > xToInsert( xTOC, uno::UNO_QUERY );
 uno::Reference< text::XTextAppend >  xTextAppend = 
m_aTextAppendStack.top().xTextAppend;
@@ -3864,8 +3861,7 @@ void DomainMapper_Impl::CloseFieldCommand()
 msfilter::util::EquationResult 
aResult(msfilter::util::ParseCombinedChars(aCommand));
 if (!aResult.sType.isEmpty() && m_xTextFactory.is())
 {
-OUString 
sServiceName("com.sun.star.text.TextField.");
-xFieldInterface = 
m_xTextFactory->createInstance(sServiceName + aResult.sType);
+xFieldInterface = 
m_xTextFactory->createInstance("com.sun.star.text.TextField." + aResult.sType);
 xFieldProperties =
 uno::Reference< beans::XPropertySet >( 
xFieldInterface,
 uno::UNO_QUERY_THROW);
@@ -4964,8 +4960,7 @@ void  DomainMapper_Impl::ImportGraphic(const 
writerfilter::Reference< Properties
 if (eGraphicImportType == IMPORT_AS_DETECTED_ANCHOR)
 {
 uno::Reference xEmbeddedProps(m_xEmbedded, 
uno::UNO_QUERY);
-text::TextContentAnchorType eAnchorType = 
text::TextContentAnchorType_AT_CHARACTER;
-xEmbeddedProps->setPropertyValue("AnchorType", 
uno::makeAny(eAnchorType));
+xEmbeddedProps->setPropertyValue("AnchorType", 
uno::makeAny(text::TextContentAnchorType_AT_CHARACTER));
 uno::Reference 

[Libreoffice-commits] core.git: writerfilter/source

2017-06-20 Thread Jochen Nitschke
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4d8347dff173cd8ded4ee290bba21ceefecd2aa2
Author: Jochen Nitschke 
Date:   Mon Jun 19 09:34:32 2017 +0200

writerfilter: change map to unorded_map

Change-Id: I782713940fc978f38193c59d16667633167535d7
Reviewed-on: https://gerrit.libreoffice.org/38949
Reviewed-by: Jochen Nitschke 
Tested-by: Jochen Nitschke 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 522511d0306f..ef3d0ade41e5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -78,6 +78,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -161,8 +162,7 @@ struct FieldConversion
 FieldId eFieldId;
 };
 
-typedef ::std::map< OUString, FieldConversion>
-FieldConversionMap_t;
+typedef std::unordered_map 
FieldConversionMap_t;
 
 uno::Any FloatingTableInfo::getPropertyValue(const OUString )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-19 Thread Noel Grandin
 writerfilter/source/dmapper/DomainMapper.cxx|6 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx   |9 +-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx   |8 -
 writerfilter/source/dmapper/FontTable.cxx   |6 ++--
 writerfilter/source/dmapper/FontTable.hxx   |2 -
 writerfilter/source/dmapper/GraphicImport.cxx   |3 --
 writerfilter/source/dmapper/NumberingManager.cxx|   12 ++--
 writerfilter/source/dmapper/NumberingManager.hxx|8 -
 writerfilter/source/dmapper/OLEHandler.cxx  |4 --
 writerfilter/source/dmapper/OLEHandler.hxx  |2 -
 writerfilter/source/dmapper/PropertyMap.cxx |9 --
 writerfilter/source/dmapper/PropertyMap.hxx |   27 ---
 writerfilter/source/dmapper/SettingsTable.cxx   |9 --
 writerfilter/source/dmapper/StyleSheetTable.cxx |   28 ++--
 writerfilter/source/dmapper/StyleSheetTable.hxx |7 -
 writerfilter/source/dmapper/TrackChangesHandler.cxx |4 --
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx |4 --
 writerfilter/source/ooxml/OOXMLDocumentImpl.hxx |1 
 18 files changed, 17 insertions(+), 132 deletions(-)

New commits:
commit 42ab759336cd4a4cbcc5be66de33d05b7fc46be4
Author: Noel Grandin 
Date:   Thu Jun 15 12:03:06 2017 +0200

loplugin:unusedfields in writerfilter

Change-Id: I2f74dee5c05420275aae57485b8d81f60fff2d5d
Reviewed-on: https://gerrit.libreoffice.org/38823
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 7161b1fe6ace..67bd4648e42f 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -85,7 +85,6 @@ namespace dmapper{
 
 struct
 {
-sal_Int32 code;
 sal_Int32 h;
 bool  orient;
 sal_Int32 w;
@@ -567,7 +566,6 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
 break;
 
 case NS_ooxml::LN_CT_PageSz_code:
-CT_PageSz.code = nIntValue;
 break;
 case NS_ooxml::LN_CT_PageSz_h:
 {
@@ -895,7 +893,6 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
 pSectionContext->SetLnnMod( nIntValue );
 break;
 case NS_ooxml::LN_CT_LineNumber_start:
-aSettings.nStartValue = nIntValue; // todo: has to be set 
at (each) first paragraph
 OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
 if( pSectionContext )
 pSectionContext->SetLnnMin( nIntValue );
@@ -1947,7 +1944,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 {
 resolveSprmProps(*this, rSprm);
 LineNumberSettings aSettings = m_pImpl->GetLineNumberSettings();
-aSettings.bIsOn = true;
 m_pImpl->SetLineNumberSettings( aSettings );
 //apply settings at XLineNumberingProperties
 try
@@ -1986,7 +1982,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 }
 break;
 case NS_ooxml::LN_EG_SectPrContents_pgSz:
-CT_PageSz.code = 0;
 {
 PaperInfo aLetter(PAPER_LETTER);
 CT_PageSz.w = aLetter.getWidth();
@@ -2000,7 +1995,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 pSectionContext->Insert( PROP_HEIGHT, uno::makeAny( CT_PageSz.h ) 
);
 pSectionContext->Insert( PROP_IS_LANDSCAPE, uno::makeAny( 
CT_PageSz.orient ));
 pSectionContext->Insert( PROP_WIDTH, uno::makeAny( CT_PageSz.w ) );
-pSectionContext->SetLandscape( CT_PageSz.orient );
 }
 break;
 
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index c58bdaf94143..9e2737322922 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -198,7 +198,6 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_bStartedTOC(false),
 m_bStartIndex(false),
 m_bStartBibliography(false),
-m_bTOCPageRef(false),
 m_bStartGenericField(false),
 m_bTextInserted(false),
 m_pLastSectionContext( ),
@@ -3718,7 +3717,6 @@ void DomainMapper_Impl::CloseFieldCommand()
 }
 if (m_bStartTOC && (aIt->second.eFieldId == FIELD_PAGEREF) )
 {
-m_bTOCPageRef = true;
 bCreateField = false;
 }
 
@@ -5006,7 +5004,7 @@ void DomainMapper_Impl::SetPageMarginTwip( PageMarElement 
eElement, sal_Int32 nV
 case PAGE_MAR_LEFT   : m_aPageMargins.left= nValue; break;
 case 

[Libreoffice-commits] core.git: writerfilter/source

2017-06-19 Thread Jochen Nitschke
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   26 +++---
 1 file changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 0df3de34ad775d6d3c49036c03c3f6dad7141536
Author: Jochen Nitschke 
Date:   Mon Jun 19 00:51:56 2017 +0200

writerfilter: make local helpers static

Change-Id: I93d1ae29bc414c5a60e793acd9e92d35608552ee
Reviewed-on: https://gerrit.libreoffice.org/38940
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ff72b1ee26df..c58bdaf94143 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -94,7 +94,7 @@ namespace writerfilter {
 namespace dmapper{
 
 //line numbering for header/footer
-void lcl_linenumberingHeaderFooter( const 
uno::Reference& xStyles, const OUString& rname, 
DomainMapper_Impl* dmapper )
+static void lcl_linenumberingHeaderFooter( const 
uno::Reference& xStyles, const OUString& rname, 
DomainMapper_Impl* dmapper )
 {
 const StyleSheetEntryPtr pEntry = 
dmapper->GetStyleSheetTable()->FindStyleSheetByISTD( rname );
 if (!pEntry)
@@ -118,7 +118,7 @@ void lcl_linenumberingHeaderFooter( const 
uno::Reference& 
rxFieldProps, const FFDataHandler::Pointer_t& pFFDataHandler )
+static void lcl_handleDropdownField( const uno::Reference< beans::XPropertySet 
>& rxFieldProps, const FFDataHandler::Pointer_t& pFFDataHandler )
 {
 if ( rxFieldProps.is() )
 {
@@ -139,7 +139,7 @@ void lcl_handleDropdownField( const uno::Reference< 
beans::XPropertySet >& rxFie
 }
 }
 
-void lcl_handleTextField( const uno::Reference< beans::XPropertySet >& 
rxFieldProps, const FFDataHandler::Pointer_t& pFFDataHandler )
+static void lcl_handleTextField( const uno::Reference< beans::XPropertySet >& 
rxFieldProps, const FFDataHandler::Pointer_t& pFFDataHandler )
 {
 if ( rxFieldProps.is() && pFFDataHandler )
 {
@@ -759,7 +759,7 @@ bool DomainMapper_Impl::isParaSdtEndDeferred()
 return m_bParaSdtEndDeferred;
 }
 
-void lcl_MoveBorderPropertiesToFrame(std::vector& 
rFrameProperties,
+static void lcl_MoveBorderPropertiesToFrame(std::vector& 
rFrameProperties,
 uno::Reference const& xStartTextRange,
 uno::Reference const& xEndTextRange )
 {
@@ -805,7 +805,7 @@ void 
lcl_MoveBorderPropertiesToFrame(std::vector& rFramePr
 }
 
 
-void lcl_AddRangeAndStyle(
+static void lcl_AddRangeAndStyle(
 ParagraphPropertiesPtr& pToBeSavedProperties,
 uno::Reference< text::XTextAppend > const& xTextAppend,
 const PropertyMapPtr& pPropertyMap,
@@ -2187,7 +2187,7 @@ void DomainMapper_Impl::ClearPreviousParagraph()
 m_xPreviousParagraph.clear();
 }
 
-sal_Int16 lcl_ParseNumberingType( const OUString& rCommand )
+static sal_Int16 lcl_ParseNumberingType( const OUString& rCommand )
 {
 sal_Int16 nRet = style::NumberingType::PAGE_DESCRIPTOR;
 
@@ -2284,7 +2284,7 @@ style::NumberingType::
 }
 
 
-OUString lcl_ParseFormat( const OUString& rCommand )
+static OUString lcl_ParseFormat( const OUString& rCommand )
 {
 //  The command looks like: " DATE \@"dd  "
 //  Remove whitespace permitted by standard between \@ and "
@@ -2438,7 +2438,7 @@ std::tuple splitFieldCo
 return std::make_tuple(sType, arguments, switches);
 }
 
-OUString lcl_ExctractVariableAndHint( const OUString& rCommand, OUString& 
rHint )
+static OUString lcl_ExctractVariableAndHint( const OUString& rCommand, 
OUString& rHint )
 {
 // the first word after "ASK " is the variable
 // the text after the variable and before a '\' is the hint
@@ -2463,7 +2463,7 @@ OUString lcl_ExctractVariableAndHint( const OUString& 
rCommand, OUString& rHint
 }
 
 
-bool lcl_FindInCommand(
+static bool lcl_FindInCommand(
 const OUString& rCommand,
 sal_Unicode cSwitch,
 OUString& rValue )
@@ -2880,7 +2880,7 @@ void DomainMapper_Impl::AppendFieldCommand(OUString& 
rPartOfCommand)
 
 typedef std::multimap < sal_Int32, OUString > TOCStyleMap;
 
-const FieldConversionMap_t & lcl_GetFieldConversion()
+static const FieldConversionMap_t & lcl_GetFieldConversion()
 {
 static const FieldConversionMap_t aFieldConversionMap
 {
@@ -2953,7 +2953,7 @@ const FieldConversionMap_t & lcl_GetFieldConversion()
 return aFieldConversionMap;
 }
 
-const FieldConversionMap_t & lcl_GetEnhancedFieldConversion()
+static const FieldConversionMap_t & lcl_GetEnhancedFieldConversion()
 {
 static const FieldConversionMap_t aEnhancedFieldConversionMap =
 {
@@ -3278,7 +3278,7 @@ void DomainMapper_Impl::handleAuthor
 #undef SET_DATE
 }
 
-uno::Sequence< beans::PropertyValues > lcl_createTOXLevelHyperlinks( bool 
bHyperlinks, const OUString& sChapterNoSeparator,
+static uno::Sequence< beans::PropertyValues > lcl_createTOXLevelHyperlinks( 
bool bHyperlinks, const 

[Libreoffice-commits] core.git: writerfilter/source

2017-06-19 Thread Jochen Nitschke
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit 66f026445cbb1802730a7227820178b7feab166b
Author: Jochen Nitschke 
Date:   Mon Jun 19 02:00:00 2017 +0200

writerfilter: SET_FULL_NAME is never set

Change-Id: I704919e0a834e1431e153cd57f48de08c0f09c11
Reviewed-on: https://gerrit.libreoffice.org/38948
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 5719880dd01b..ff72b1ee26df 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3188,7 +3188,6 @@ void DomainMapper_Impl::handleAuthor
 if (!rFirstParam.isEmpty())
 {
 #define SET_ARABIC  0x01
-#define SET_FULL_NAME   0x02
 #define SET_DATE0x04
 struct DocPropertyMap
 {
@@ -3265,10 +3264,6 @@ void DomainMapper_Impl::handleAuthor
 xFieldProperties->setPropertyValue(
 getPropertyName(PROP_NUMBERING_TYPE),
 uno::makeAny( style::NumberingType::ARABIC ));
-else if(0 != (aDocProperties[nMap].nFlags & SET_FULL_NAME))
-xFieldProperties->setPropertyValue(
-getPropertyName(PROP_FULL_NAME),
-uno::makeAny( true ));
 else if(0 != (aDocProperties[nMap].nFlags & SET_DATE))
 {
 xFieldProperties->setPropertyValue(
@@ -3280,7 +3275,6 @@ void DomainMapper_Impl::handleAuthor
 }
 
 #undef SET_ARABIC
-#undef SET_FULL_NAME
 #undef SET_DATE
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-19 Thread Noel Grandin
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |  101 -
 1 file changed, 52 insertions(+), 49 deletions(-)

New commits:
commit 0cbdbb4a41c2fda7cb196299f151f1396b3354c0
Author: Noel Grandin 
Date:   Mon Jun 19 09:40:42 2017 +0200

fix lost read of m_bFormField field

in commit 42922c40362f414ee06e65636f61798ef28cdcde
"RTFDocumentImpl::popState: use switch here"

found while running the unusedfields plugin

Change-Id: I4be41dba976a13dc6d39155fb2a04d039dc0443a
Reviewed-on: https://gerrit.libreoffice.org/38950
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5fc97ab5053f..f9a4983dcf67 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2194,60 +2194,63 @@ RTFError RTFDocumentImpl::popState()
 break;
 case Destination::DATAFIELD:
 {
-if (_aStates.top().aDestinationText != 
m_aStates.top().pDestinationText)
-break; // not for nested group
-OString aStr = 
OUStringToOString(m_aStates.top().pDestinationText->makeStringAndClear(), 
aState.nCurrentEncoding);
-// decode hex dump
-OStringBuffer aBuf;
-int b = 0, count = 2;
-for (int i = 0; i < aStr.getLength(); ++i)
-{
-char ch = aStr[i];
-if (ch != 0x0d && ch != 0x0a)
+if (m_bFormField)
+{
+if (_aStates.top().aDestinationText != 
m_aStates.top().pDestinationText)
+break; // not for nested group
+OString aStr = 
OUStringToOString(m_aStates.top().pDestinationText->makeStringAndClear(), 
aState.nCurrentEncoding);
+// decode hex dump
+OStringBuffer aBuf;
+int b = 0, count = 2;
+for (int i = 0; i < aStr.getLength(); ++i)
 {
-b = b << 4;
-sal_Int8 parsed = RTFTokenizer::asHex(ch);
-if (parsed == -1)
-return RTFError::HEX_INVALID;
-b += parsed;
-count--;
-if (!count)
+char ch = aStr[i];
+if (ch != 0x0d && ch != 0x0a)
 {
-aBuf.append((char)b);
-count = 2;
-b = 0;
+b = b << 4;
+sal_Int8 parsed = RTFTokenizer::asHex(ch);
+if (parsed == -1)
+return RTFError::HEX_INVALID;
+b += parsed;
+count--;
+if (!count)
+{
+aBuf.append((char)b);
+count = 2;
+b = 0;
+}
 }
 }
-}
-aStr = aBuf.makeStringAndClear();
-
-// ignore the first bytes
-if (aStr.getLength() > 8)
-aStr = aStr.copy(8);
-// extract name
-sal_Int32 nLength = aStr.toChar();
-if (!aStr.isEmpty())
-aStr = aStr.copy(1);
-nLength = std::min(nLength, aStr.getLength());
-OString aName = aStr.copy(0, nLength);
-if (aStr.getLength() > nLength)
-aStr = aStr.copy(nLength+1); // zero-terminated string
-else
-aStr.clear();
-// extract default text
-nLength = aStr.toChar();
-if (!aStr.isEmpty())
-aStr = aStr.copy(1);
-auto pNValue = std::make_shared(OStringToOUString(aName, 
aState.nCurrentEncoding));
-m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFData_name, pNValue);
-if (nLength > 0)
-{
-OString aDefaultText = aStr.copy(0, std::min(nLength, 
aStr.getLength()));
-auto pDValue = 
std::make_shared(OStringToOUString(aDefaultText, 
aState.nCurrentEncoding));
-m_aFormfieldSprms.set(NS_ooxml::LN_CT_FFTextInput_default, 
pDValue);
-}
+aStr = aBuf.makeStringAndClear();
+
+// ignore the first bytes
+if (aStr.getLength() > 8)
+aStr = aStr.copy(8);
+// extract name
+sal_Int32 nLength = aStr.toChar();
+if (!aStr.isEmpty())
+aStr = aStr.copy(1);
+nLength = std::min(nLength, aStr.getLength());
+OString aName = aStr.copy(0, nLength);
+if (aStr.getLength() > nLength)
+aStr = aStr.copy(nLength+1); // zero-terminated string
+else
+aStr.clear();
+// extract default text
+nLength = aStr.toChar();
+if (!aStr.isEmpty())
+aStr = aStr.copy(1);
+auto pNValue = std::make_shared(OStringToOUString(aName, 
aState.nCurrentEncoding));
+   

[Libreoffice-commits] core.git: writerfilter/source

2017-06-19 Thread Jochen Nitschke
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |  178 --
 1 file changed, 72 insertions(+), 106 deletions(-)

New commits:
commit 42d0e756122ac7e341c3b8a93c7fb551f410dc90
Author: Jochen Nitschke 
Date:   Mon Jun 19 00:50:44 2017 +0200

writerfilter: use list-initialization for constant maps

Change-Id: Ie7d06e972dfa3ffb00c66a4fa5f062e3ea93f787
Reviewed-on: https://gerrit.libreoffice.org/38939
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index f6b45597ebf5..5719880dd01b 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -157,7 +157,6 @@ void lcl_handleTextField( const uno::Reference< 
beans::XPropertySet >& rxFieldPr
 
 struct FieldConversion
 {
-OUStringsWordCommand;
 const sal_Char* cFieldServiceName;
 FieldId eFieldId;
 };
@@ -2883,119 +2882,86 @@ typedef std::multimap < sal_Int32, OUString > 
TOCStyleMap;
 
 const FieldConversionMap_t & lcl_GetFieldConversion()
 {
-static FieldConversionMap_t aFieldConversionMap;
-
-static bool bFilled = false;
-
-if(!bFilled)
-{
-static const FieldConversion aFields[] =
-{
-//{OUString("ADDRESSBLOCK"),  "", "", 
FIELD_ADDRESSBLOCK  },
-//{OUString("ADVANCE"),   "", "", 
FIELD_ADVANCE   },
-{OUString("ASK"),   "SetExpression",  FIELD_ASK
  },
-{OUString("AUTONUM"),   "SetExpression",
FIELD_AUTONUM   },
-{OUString("AUTONUMLGL"), "SetExpression",   
FIELD_AUTONUMLGL },
-{OUString("AUTONUMOUT"), "SetExpression",   
FIELD_AUTONUMOUT },
-{OUString("AUTHOR"),"DocInfo.CreateAuthor", 
FIELD_AUTHOR   },
-{OUString("DATE"),  "DateTime", FIELD_DATE 
},
-{OUString("COMMENTS"),  "DocInfo.Description",  
FIELD_COMMENTS },
-{OUString("CREATEDATE"),"DocInfo.CreateDateTime",   
FIELD_CREATEDATE   },
-{OUString("DOCPROPERTY"),   "", 
FIELD_DOCPROPERTY },
-{OUString("DOCVARIABLE"),   "User", 
FIELD_DOCVARIABLE  },
-{OUString("EDITTIME"),  "DocInfo.EditTime", 
FIELD_EDITTIME },
-{OUString("EQ"),"", FIELD_EQ   
  },
-{OUString("FILLIN"),"Input",
FIELD_FILLIN   },
-{OUString("FILENAME"),  "FileName", 
FIELD_FILENAME },
-//{OUString("FILESIZE"),  "", 
FIELD_FILESIZE },
-{OUString("FORMULA"),   "TableFormula", 
FIELD_FORMULA },
-{OUString("FORMCHECKBOX"), "",
FIELD_FORMCHECKBOX},
-{OUString("FORMDROPDOWN"), "DropDown",
FIELD_FORMDROPDOWN},
-{OUString("FORMTEXT"), "Input", FIELD_FORMTEXT},
-//{OUString("GOTOBUTTON"),"", 
FIELD_GOTOBUTTON   },
-{OUString("HYPERLINK"), "", 
FIELD_HYPERLINK},
-{OUString("IF"),"ConditionalText",  FIELD_IF   
},
-//{OUString("INFO"),  "",FIELD_INFO },
-{OUString("INCLUDEPICTURE"), "",
FIELD_INCLUDEPICTURE},
-{OUString("KEYWORDS"),  "DocInfo.KeyWords", 
FIELD_KEYWORDS },
-{OUString("LASTSAVEDBY"),   "DocInfo.ChangeAuthor",
 FIELD_LASTSAVEDBY  },
-{OUString("MACROBUTTON"),   "Macro", 
FIELD_MACROBUTTON  },
-{OUString("MERGEFIELD"),"Database", 
FIELD_MERGEFIELD},
-{OUString("MERGEREC"),  "DatabaseNumberOfSet",  
FIELD_MERGEREC },
-//{OUString("MERGESEQ"),  "", 
FIELD_MERGESEQ },
-{OUString("NEXT"),  "DatabaseNextSet",  FIELD_NEXT 
},
-{OUString("NEXTIF"),"DatabaseNextSet",  
FIELD_NEXTIF   },
-{OUString("PAGE"),  "PageNumber",   FIELD_PAGE 
},
-{OUString("PAGEREF"),   "GetReference", 
FIELD_PAGEREF  },
-{OUString("REF"),   "GetReference", FIELD_REF  
},
-{OUString("REVNUM"),"DocInfo.Revision", 
FIELD_REVNUM   },
-{OUString("SAVEDATE"),  "DocInfo.Change",   
FIELD_SAVEDATE },
-//{OUString("SECTION"), 

[Libreoffice-commits] core.git: writerfilter/source

2017-06-18 Thread Jochen Nitschke
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 493407c470e7051a801e2a0ad8253f7b87c4434f
Author: Jochen Nitschke 
Date:   Mon Jun 19 00:08:22 2017 +0200

writerfilter: don't copy constant maps

Change-Id: I87bc0bea5db27a967f996c7597b6f4884a748b56
Reviewed-on: https://gerrit.libreoffice.org/38938
Reviewed-by: Jochen Nitschke 
Tested-by: Jochen Nitschke 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 635c06ea0f54..f6b45597ebf5 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3703,7 +3703,7 @@ void DomainMapper_Impl::CloseFieldCommand()
 m_bSetUserFieldContent = false;
 m_bSetCitation = false;
 m_bSetDateValue = false;
-FieldConversionMap_t aFieldConversionMap = lcl_GetFieldConversion();
+const FieldConversionMap_t& aFieldConversionMap = 
lcl_GetFieldConversion();
 
 try
 {
@@ -3714,7 +3714,7 @@ void DomainMapper_Impl::CloseFieldCommand()
 OUString const sFirstParam(std::get<1>(field).empty()
 ? OUString() : std::get<1>(field).front());
 
-FieldConversionMap_t::iterator const aIt =
+FieldConversionMap_t::const_iterator const aIt =
 aFieldConversionMap.find(std::get<0>(field));
 if(aIt != aFieldConversionMap.end())
 {
@@ -3768,8 +3768,8 @@ void DomainMapper_Impl::CloseFieldCommand()
 OUString sServiceName("com.sun.star.text.");
 if ( bCreateEnhancedField )
 {
-FieldConversionMap_t aEnhancedFieldConversionMap = 
lcl_GetEnhancedFieldConversion();
-FieldConversionMap_t::iterator aEnhancedIt =
+const FieldConversionMap_t& 
aEnhancedFieldConversionMap = lcl_GetEnhancedFieldConversion();
+FieldConversionMap_t::const_iterator aEnhancedIt =
 
aEnhancedFieldConversionMap.find(std::get<0>(field));
 if ( aEnhancedIt != aEnhancedFieldConversionMap.end())
 sServiceName += 
OUString::createFromAscii(aEnhancedIt->second.cFieldServiceName );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-18 Thread Jochen Nitschke
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit c50ae538a6656889c68c43bd9fe0347c61c82aa5
Author: Jochen Nitschke 
Date:   Sun Jun 18 23:38:36 2017 +0200

writerfilter: remove unused static var

Change-Id: I0c31593cc03ae795df458233f33323e7a5f38894
Reviewed-on: https://gerrit.libreoffice.org/38937
Tested-by: Jenkins 
Reviewed-by: Jochen Nitschke 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 4949deb0a030..635c06ea0f54 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2884,7 +2884,6 @@ typedef std::multimap < sal_Int32, OUString > TOCStyleMap;
 const FieldConversionMap_t & lcl_GetFieldConversion()
 {
 static FieldConversionMap_t aFieldConversionMap;
-static FieldConversionMap_t aEnhancedFieldConversionMap;
 
 static bool bFilled = false;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-16 Thread Mark Hung
 writerfilter/source/dmapper/DomainMapper.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 6e855d89e9d7807c16569ec7e335ea2dbafba47d
Author: Mark Hung 
Date:   Sun Jun 11 08:47:41 2017 +0800

tdf#85161 fix the case for ooxml fields without any seperator.

Field commands were closed when a seperator appeared. Those
fields that only had begin and end fldChar just disapeared.

Change-Id: I77928393826a3ffd4a35fb8fe9adeb1892f99683
Reviewed-on: https://gerrit.libreoffice.org/38653
Tested-by: Jenkins 
Reviewed-by: Mark Hung 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 4ef535bc20e1..7161b1fe6ace 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3143,6 +3143,9 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, 
size_t len)
 m_pImpl->CloseFieldCommand();
 return;
 case cFieldEnd:
+// In case there isn't any field seperator.
+if ( m_pImpl->IsOpenFieldCommand() )
+m_pImpl->CloseFieldCommand();
 m_pImpl->PopFieldContext();
 return;
 default:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-09 Thread Stephan Bergmann
 writerfilter/source/ooxml/OOXMLPropertySet.cxx |   12 ++--
 writerfilter/source/ooxml/OOXMLPropertySet.hxx |2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 600ec501bafc691d37078a0ed5b4ca8bf32340f1
Author: Stephan Bergmann 
Date:   Fri Jun 9 10:02:52 2017 +0200

Avoid UBSan warning about negative double -> sal_uInt32 conversion

Since ea890b1d4bcd6dd59db9f52dce1609c020804e24 "tdf#108408: support unit
specifications for ST_HpsMeasure", the OOXMLUniversalMeasureValue ctor is
converting textual data to mnValue via intermediary double instead of 
sal_Int32,
so textual data representing negative values now triggers UBSan warnings 
(e.g.,
"writerfilter/source/ooxml/OOXMLPropertySet.cxx:630:43: runtime error: -70 
is
outside the range of representable values of type 'unsigned int'" during
CppunitTest_chart2_export; it appears that, while HpsMeasure may be 
documented
to only cover positive values, TwipsMeasure may be negative).

But OOXMLUniversalMeasureValue::mnValue is apparently only used in
OOXMLUniversalMeasureValue::getInt, to return an int value, so just change 
its
type.

Change-Id: I44eabb78f09100c05cc9d1e79a739648f34ea743

diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.cxx 
b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
index 3ef7a30b11ff..0b353dfb8039 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.cxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.cxx
@@ -599,35 +599,35 @@ 
OOXMLUniversalMeasureValue::OOXMLUniversalMeasureValue(const char * pValue, sal_
 pValue[nLen-2] == 'p' &&
 pValue[nLen-1] == 't')
 {
-mnValue = static_cast(val * npPt);
+mnValue = static_cast(val * npPt);
 }
 else if (nLen > 2 &&
 pValue[nLen - 2] == 'c' &&
 pValue[nLen - 1] == 'm')
 {
-mnValue = static_cast(val * npPt * 72 / 2.54);
+mnValue = static_cast(val * npPt * 72 / 2.54);
 }
 else if (nLen > 2 &&
 pValue[nLen - 2] == 'm' &&
 pValue[nLen - 1] == 'm')
 {
-mnValue = static_cast(val * npPt * 72 / 25.4);
+mnValue = static_cast(val * npPt * 72 / 25.4);
 }
 else if (nLen > 2 &&
 pValue[nLen - 2] == 'i' &&
 pValue[nLen - 1] == 'n')
 {
-mnValue = static_cast(val * npPt * 72);
+mnValue = static_cast(val * npPt * 72);
 }
 else if (nLen > 2 &&
 pValue[nLen - 2] == 'p' &&
 ( pValue[nLen - 1] == 'c' || pValue[nLen - 1] == 'i' ))
 {
-mnValue = static_cast(val * npPt * 12);
+mnValue = static_cast(val * npPt * 12);
 }
 else
 {
-mnValue = static_cast(val);
+mnValue = static_cast(val);
 }
 }
 
diff --git a/writerfilter/source/ooxml/OOXMLPropertySet.hxx 
b/writerfilter/source/ooxml/OOXMLPropertySet.hxx
index 73889a4abb9b..45aba15e2ccc 100644
--- a/writerfilter/source/ooxml/OOXMLPropertySet.hxx
+++ b/writerfilter/source/ooxml/OOXMLPropertySet.hxx
@@ -232,7 +232,7 @@ public:
 class OOXMLUniversalMeasureValue : public OOXMLValue
 {
 private:
-sal_uInt32 mnValue;
+int mnValue;
 public:
 OOXMLUniversalMeasureValue(const char * pValue, sal_uInt32 npPt);
 virtual ~OOXMLUniversalMeasureValue() override;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-03 Thread Bartosz Kosiorek
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx |1 -
 writerfilter/source/ooxml/OOXMLDocumentImpl.hxx |1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4e547d147d6df7042db58bfa3060140c849493f4
Author: Bartosz Kosiorek 
Date:   Sat Jun 3 12:31:32 2017 +0200

tdf#73873 Fix missing embeddings in word/embeddings directory

In commit:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=ad90e22f1970d019e1f2a1e8ba8020c0f0cb36c4
the refactor was made. Unorfunately due to mistake
the embedding was always resetting.
As a result only one embedding document was added.

Change-Id: Ie268b1bf8906ac7b8e061526a9186b3b4b46bef6
Reviewed-on: https://gerrit.libreoffice.org/38369
Tested-by: Jenkins 
Reviewed-by: Bartosz Kosiorek 

diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx 
b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 550820be018e..5eb517810957 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -724,7 +724,6 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const 
OOXMLStream::Pointer_t& pS
 {
 uno::Reference xRelationshipAccess;
 
xRelationshipAccess.set((dynamic_cast(*pStream.get())).accessDocumentStream(),
 uno::UNO_QUERY);
-std::vector aEmbeddings;
 if (xRelationshipAccess.is())
 {
 OUString 
sChartType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart;);
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx 
b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx
index c4245cae7b02..1922e225e168 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.hxx
@@ -53,6 +53,7 @@ class OOXMLDocumentImpl : public OOXMLDocument
 css::uno::Reference mxActiveXBin;
 css::uno::Reference mxEmbeddings;
 css::uno::Sequence < css::beans::PropertyValue > mxEmbeddingsList;
+std::vector aEmbeddings;
 /// List of VBA-related streams.
 css::uno::Sequence maVBA;
 bool mbIsSubstream;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-06-01 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit be84b4a5f6f68ce30a5d82d73ae392cf27c369ce
Author: Justin Luth 
Date:   Thu Jun 1 08:03:39 2017 +0300

writerfilter: remove unused variable pFontTable

Change-Id: If48795746adecf6762a5f1173171c62faf1ac345
Reviewed-on: https://gerrit.libreoffice.org/38290
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 3963cdcb8ca2..4bb4013ade9e 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1691,7 +1691,6 @@ void DomainMapper_Impl::PushFootOrEndnote( bool 
bIsFootnote )
 uno::UNO_QUERY_THROW );
 uno::Reference< text::XFootnote > xFootnote( xFootnoteText, 
uno::UNO_QUERY_THROW );
 pTopContext->SetFootnote( xFootnote );
-FontTablePtr pFontTable = GetFontTable();
 uno::Sequence< beans::PropertyValue > aFontProperties;
 appendTextContent( uno::Reference< text::XTextContent >( 
xFootnoteText, uno::UNO_QUERY_THROW ), aFontProperties );
 m_aTextAppendStack.push(TextAppendContext(uno::Reference< 
text::XTextAppend >( xFootnoteText, uno::UNO_QUERY_THROW ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-05-31 Thread Justin Luth
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 --
 writerfilter/source/dmapper/PropertyMap.hxx   |3 ---
 2 files changed, 9 deletions(-)

New commits:
commit fcbdef309cde7d5eefa77e1e3c902447519a34f9
Author: Justin Luth 
Date:   Tue May 30 16:59:08 2017 +0300

writerfilter : remove dead code with m_sFootnoteFontName

The string variable is never initialized or set,
and the only use is if it is not empty.

In 2007, author Oliver Specht 2007-06-12 04:41:16 in
range fe8e4e774087465a10ecd8f366b7f0c272d8319a
introduced m_sFootnoteFontName in a pair of commits.

The call to SetFootnoteFontname() was removed in 2008
with commit 009e3f4841378f13a2764a2c84e147e401b70525

The SetFootnoteFontName() function was removed as unused in
commit 6ea66657ebca5b3ec63f93b496b812888e0d53c9

Since the footnote name is never set, it is always
empty, and thus this code is useless.

Change-Id: I64898ce9fa6673fbef0106054b5aa5a817c145d5
Reviewed-on: https://gerrit.libreoffice.org/38257
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 38633e688552..3963cdcb8ca2 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1693,12 +1693,6 @@ void DomainMapper_Impl::PushFootOrEndnote( bool 
bIsFootnote )
 pTopContext->SetFootnote( xFootnote );
 FontTablePtr pFontTable = GetFontTable();
 uno::Sequence< beans::PropertyValue > aFontProperties;
-if(!pTopContext->GetFootnoteFontName().isEmpty())
-{
-PropertyMapPtr aFontProps( new PropertyMap );
-aFontProps->Insert(PROP_CHAR_FONT_NAME, uno::makeAny( 
pTopContext->GetFootnoteFontName()  ));
-aFontProperties = aFontProps->GetPropertyValues();
-}
 appendTextContent( uno::Reference< text::XTextContent >( 
xFootnoteText, uno::UNO_QUERY_THROW ), aFontProperties );
 m_aTextAppendStack.push(TextAppendContext(uno::Reference< 
text::XTextAppend >( xFootnoteText, uno::UNO_QUERY_THROW ),
 
xFootnoteText->createTextCursorByRange(xFootnoteText->getStart(;
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx 
b/writerfilter/source/dmapper/PropertyMap.hxx
index 96883755159f..16358d1a5650 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -122,7 +122,6 @@ private:
 
 // marks context as footnote context - ::text( ) events contain either the 
footnote character or can be ignored
 // depending on sprmCSymbol
-OUStringm_sFootnoteFontName;
 css::uno::Reference< css::text::XFootnote > m_xFootnote;
 std::map< PropertyIds, PropValue >  m_vMap;
 std::vector< RedlineParamsPtr > m_aRedlines;
@@ -156,8 +155,6 @@ public:
 
 void SetFootnote( const css::uno::Reference< css::text::XFootnote >& xF ) 
{ m_xFootnote = xF; }
 
-const OUString& GetFootnoteFontName() const { return m_sFootnoteFontName; }
-
 virtual void insertTableProperties( const PropertyMap* );
 
 const std::vector< RedlineParamsPtr >& Redlines() const { return 
m_aRedlines; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-05-09 Thread Mike Kaganski
 writerfilter/source/dmapper/GraphicHelpers.cxx |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit f66b76a4d20719e4c13bd755c49f8140a0e72816
Author: Mike Kaganski 
Date:   Mon May 8 16:42:55 2017 +0300

tdf#105688: findZOrder: catch exceptions from getPropertyValue

For some reason, sometimes items in GraphicZOrderHelper don't
have ZOrder property value, and so throw in getPropertyValue.
E.g., SwXFrame::getPropertyValue throws uno::RuntimeException
when its GetFrameFormat() returns nullptr.

The patch catches these to allow to proceed with fallback z-order.

Change-Id: I96140195f45364bccee7c5547d373158e2b49154
Reviewed-on: https://gerrit.libreoffice.org/37392
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx 
b/writerfilter/source/dmapper/GraphicHelpers.cxx
index 2ae112af294b..c970f8999cc0 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -273,20 +273,23 @@ sal_Int32 GraphicZOrderHelper::findZOrder( sal_Int32 
relativeHeight, bool bOldSt
 else
 ++it;
 }
+sal_Int32 itemZOrderOffset(0); // before the item
 if( it == items.end()) // we're topmost
 {
 if( items.empty())
 return 0;
-sal_Int32 itemZOrder(0);
 --it;
-if( it->second->getPropertyValue(getPropertyName( PROP_Z_ORDER )) >>= 
itemZOrder )
-return itemZOrder + 1; // after the topmost
+itemZOrderOffset = 1; // after the topmost
 }
-else
-{
+// SwXFrame::getPropertyValue throws uno::RuntimeException
+// when its GetFrameFormat() returns nullptr
+try {
 sal_Int32 itemZOrder(0);
 if( it->second->getPropertyValue(getPropertyName( PROP_Z_ORDER )) >>= 
itemZOrder )
-return itemZOrder; // before the item
+return itemZOrder + itemZOrderOffset;
+}
+catch (const uno::RuntimeException&) {
+SAL_WARN("writerfilter", "Exception when getting item z-order");
 }
 SAL_WARN( "writerfilter", "findZOrder() didn't find item z-order" );
 return 0; // this should not(?) happen
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-05-05 Thread Michael Stahl
 writerfilter/source/dmapper/PropertyMap.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit e4da2e5dfa9e462e0d9c23a1a60caf4b3ef2dc56
Author: Michael Stahl 
Date:   Fri May 5 22:05:46 2017 +0200

tdf#104407 writerfilter: fix crash with null xRangeProperties

The m_xStartingRange is null at this point for whatever reason,
and the block immediately above this one already checks
xRangeProperties, so let's just do the same here. (Also IsNewDoc(),
where the logic between PageDescName and PageNumberOffset presumably
shouldn't differ?).

(started to crash with abaf6bde4ee91c628bd55a7ec2e876a5d0ecff6e
 as previously that code was unreachable in RTF import)

Change-Id: I20539c3a753ecea357e556ea556c3c26983ce1d1

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 44a8bf016252..8e308940e7e0 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1377,16 +1377,18 @@ void SectionPropertyMap::CloseSectionGroup( 
DomainMapper_Impl& rDM_Impl )
 }
 
 if ( xRangeProperties.is() && rDM_Impl.IsNewDoc() )
+{
 xRangeProperties->setPropertyValue(
 getPropertyName( PROP_PAGE_DESC_NAME ),
 uno::makeAny( m_bTitlePage ? m_sFirstPageStyleName
 : m_sFollowPageStyleName ) );
 
-if ( m_bPageNoRestart || m_nPageNumber >= 0 )
-{
-sal_Int16 nPageNumber = m_nPageNumber >= 0 ? static_cast< 
sal_Int16 >(m_nPageNumber) : 1;
-xRangeProperties->setPropertyValue( getPropertyName( 
PROP_PAGE_NUMBER_OFFSET ),
-uno::makeAny( nPageNumber ) );
+if (m_bPageNoRestart || 0 <= m_nPageNumber)
+{
+sal_Int16 nPageNumber = m_nPageNumber >= 0 ? 
static_cast< sal_Int16 >(m_nPageNumber) : 1;
+
xRangeProperties->setPropertyValue(getPropertyName(PROP_PAGE_NUMBER_OFFSET),
+uno::makeAny(nPageNumber));
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-05-05 Thread Noel Grandin
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |3 -
 writerfilter/source/dmapper/DomainMapperTableHandler.hxx |3 -
 writerfilter/source/dmapper/TableManager.cxx |2 
 writerfilter/source/ooxml/OOXMLFactory.cxx   |4 -
 writerfilter/source/ooxml/OOXMLFactory.hxx   |4 -
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx|   42 +++
 writerfilter/source/ooxml/OOXMLFastContextHandler.hxx|4 -
 7 files changed, 30 insertions(+), 32 deletions(-)

New commits:
commit 19710ef250a7da5f7fcc2d017bc60fdee91925ef
Author: Noel Grandin 
Date:   Fri May 5 09:56:43 2017 +0200

loplugin:checkunusedparams in writerfilter

Change-Id: I52860115a65a23651b6f96363c6f8e5baa78cfad
Reviewed-on: https://gerrit.libreoffice.org/37278
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index b79a1d71214b..7ed678863e37 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -64,8 +64,7 @@ DomainMapperTableHandler::~DomainMapperTableHandler()
 {
 }
 
-void DomainMapperTableHandler::startTable(unsigned int /*nDepth*/,
-  const TablePropertyMapPtr& pProps)
+void DomainMapperTableHandler::startTable(const TablePropertyMapPtr& pProps)
 {
 m_aTableProperties = pProps;
 m_aTableRanges.clear();
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
index 4881f37a8d9d..85f84c78ded9 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx
@@ -87,10 +87,9 @@ public:
 /**
Handle start of table.
 
-   @param nDepth  depth of the table in surrounding table hierarchy
@param pProps  properties of the table
  */
-void startTable(unsigned int nDepth, const TablePropertyMapPtr& pProps);
+void startTable(const TablePropertyMapPtr& pProps);
 /// Handle end of table.
 void endTable(unsigned int nestedTableLevel, bool bTableStartsAtCellStart);
 /**
diff --git a/writerfilter/source/dmapper/TableManager.cxx 
b/writerfilter/source/dmapper/TableManager.cxx
index 32b77410e332..38f7d0fa 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -298,7 +298,7 @@ void TableManager::resolveCurrentTable()
 
 unsigned int nRows = pTableData->getRowCount();
 
-mpTableDataHandler->startTable(pTableData->getDepth(), 
getTableProps());
+mpTableDataHandler->startTable(getTableProps());
 
 for (unsigned int nRow = 0; nRow < nRows; ++nRow)
 {
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx 
b/writerfilter/source/ooxml/OOXMLFactory.cxx
index ff65144d3444..b951245ba376 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -153,7 +153,7 @@ void OOXMLFactory::characters(OOXMLFastContextHandler * 
pHandler,
 }
 }
 
-void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler, Token_t 
/*nToken*/)
+void OOXMLFactory::startAction(OOXMLFastContextHandler * pHandler)
 {
 Id nDefine = pHandler->getDefine();
 OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
@@ -164,7 +164,7 @@ void OOXMLFactory::startAction(OOXMLFastContextHandler * 
pHandler, Token_t /*nTo
 }
 }
 
-void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler, Token_t 
/*nToken*/)
+void OOXMLFactory::endAction(OOXMLFastContextHandler * pHandler)
 {
 Id nDefine = pHandler->getDefine();
 OOXMLFactory_ns::Pointer_t pFactory = getFactoryForNamespace(nDefine);
diff --git a/writerfilter/source/ooxml/OOXMLFactory.hxx 
b/writerfilter/source/ooxml/OOXMLFactory.hxx
index cbb9ca295217..9e4b495fd0fc 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.hxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.hxx
@@ -92,8 +92,8 @@ public:
 
 static void characters(OOXMLFastContextHandler * pHandler, const OUString 
& rString);
 
-static void startAction(OOXMLFastContextHandler * pHandler, Token_t 
nToken);
-static void endAction(OOXMLFastContextHandler * pHandler, Token_t nToken);
+static void startAction(OOXMLFastContextHandler * pHandler);
+static void endAction(OOXMLFastContextHandler * pHandler);
 
 private:
 OOXMLFactory() = delete;
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx 
b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 3310314d1436..48f51b4df512 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -194,7 +194,7 @@ void 

[Libreoffice-commits] core.git: writerfilter/source

2017-04-28 Thread Caolán McNamara
 writerfilter/source/dmapper/GraphicHelpers.cxx  |2 +-
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx |2 +-
 writerfilter/source/rtftok/rtftokenizer.cxx |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e4ad1d174bf2f991c83aee3572d8292a15ec8d8c
Author: Caolán McNamara 
Date:   Fri Apr 28 14:44:49 2017 +0100

drop toString

Change-Id: If32d2bb0947d13c904da9514873f33c4c2641069

diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx 
b/writerfilter/source/dmapper/GraphicHelpers.cxx
index eae2d27ca647..2096adf802c4 100644
--- a/writerfilter/source/dmapper/GraphicHelpers.cxx
+++ b/writerfilter/source/dmapper/GraphicHelpers.cxx
@@ -304,7 +304,7 @@ OUString GraphicNamingHelper::NameGraphic(const OUString& 
rTemplate)
 {
 // Empty template: then auto-generate a unique name.
 std::unique_ptr pResMgr(ResMgr::CreateResMgr("svx", 
Application::GetSettings().GetUILanguageTag()));
-OUString aPrefix(ResId(STR_ObjNameSingulGRAF, *pResMgr).toString());
+OUString aPrefix(ResId(STR_ObjNameSingulGRAF, *pResMgr));
 aRet += aPrefix + OUString::number(++m_nCounter);
 }
 
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx 
b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index b700f3087d56..089c0e2a8f26 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -462,7 +462,7 @@ void OOXMLDocumentImpl::resolve(Stream & rStream)
 // Set the end position only here, so later it's enough to 
check if that is non-zero in incrementProgress().
 mnProgressEndPos = nValue;
 static ResMgr* pResMgr = ResMgr::CreateResMgr("svx", 
Application::GetSettings().GetUILanguageTag());
-OUString aDocLoad(ResId(RID_SVXSTR_DOC_LOAD, 
*pResMgr).toString());
+OUString aDocLoad(ResId(RID_SVXSTR_DOC_LOAD, *pResMgr));
 mxStatusIndicator->start(aDocLoad, mnProgressEndPos);
 mnPercentSize = mnProgressEndPos / 100;
 }
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx 
b/writerfilter/source/rtftok/rtftokenizer.cxx
index 361928e468b0..5661d4137b5b 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -66,7 +66,7 @@ RTFError RTFTokenizer::resolveParse()
 if (m_xStatusIndicator.is())
 {
 static ResMgr* pResMgr = ResMgr::CreateResMgr("svx", 
Application::GetSettings().GetUILanguageTag());
-OUString sDocLoad(ResId(RID_SVXSTR_DOC_LOAD, *pResMgr).toString());
+OUString sDocLoad(ResId(RID_SVXSTR_DOC_LOAD, *pResMgr));
 
 sal_uInt64 const nCurrentPos = Strm().Tell();
 sal_uInt64 const nEndPos = nCurrentPos + Strm().remainingSize();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-04-27 Thread Miklos Vajna
 writerfilter/source/dmapper/DomainMapper.cxx |8 
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit e0c7f21c1e9a2e2e60c4650643232266d3428e4f
Author: Miklos Vajna 
Date:   Thu Apr 27 14:18:12 2017 +0200

writerfilter: SvxFrameDirectionItem::PutValue() wants an UNO short

And not an UNO com.sun.star.text.WritingMode. This fixes the following
warnings during DOCX import:

warn:legacy.osl:12884:1:writerfilter/source/dmapper/PropertyMap.cxx:1484: 
Exception in SectionPropertyMap::ApplyProperties_
warn:legacy.osl:12884:1:writerfilter/source/dmapper/PropertyMap.cxx:1496: 
Exception in SectionPropertyMap::ApplyProperties_

Change-Id: Ib4f392b3e4328311baa5767b5a2079730218fca3
Reviewed-on: https://gerrit.libreoffice.org/37028
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index ca2091f77a0b..0ce36604fda3 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1439,13 +1439,13 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 {
 if (nIntValue != 0)
 {
-rContext->Insert(PROP_WRITING_MODE, uno::makeAny( 
text::WritingMode2::RL_TB ));
+rContext->Insert(PROP_WRITING_MODE, uno::makeAny( 
sal_Int16(text::WritingMode2::RL_TB) ));
 if (!IsRTFImport())
 rContext->Insert(PROP_PARA_ADJUST, uno::makeAny( 
style::ParagraphAdjust_RIGHT ), /*bOverwrite=*/false);
 }
 else
 {
-rContext->Insert(PROP_WRITING_MODE, uno::makeAny( 
text::WritingMode2::LR_TB ));
+rContext->Insert(PROP_WRITING_MODE, uno::makeAny( 
sal_Int16(text::WritingMode2::LR_TB) ));
 if (!IsRTFImport())
 rContext->Insert(PROP_PARA_ADJUST, uno::makeAny( 
style::ParagraphAdjust_LEFT ), /*bOverwrite=*/false);
 }
@@ -1454,7 +1454,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 break;
 case NS_ooxml::LN_EG_SectPrContents_bidi:
 if (pSectionContext != nullptr)
-pSectionContext->Insert(PROP_WRITING_MODE, uno::makeAny( 
text::WritingMode2::RL_TB));
+pSectionContext->Insert(PROP_WRITING_MODE, uno::makeAny( 
sal_Int16(text::WritingMode2::RL_TB) ));
 break;
 case NS_ooxml::LN_EG_RPrBase_highlight:
 {
@@ -1790,7 +1790,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 pTargetContext = pSectionContext;
 }
 
-pTargetContext->Insert(PROP_WRITING_MODE, uno::makeAny( nDirection ) );
+pTargetContext->Insert(PROP_WRITING_MODE, uno::makeAny( 
sal_Int16(nDirection) ) );
 }
 break;  // sprmSTextFlow
 // the following are not part of the official documentation
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 7884d3cfdc95..7b2d188346f6 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -376,7 +376,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
 case NS_ooxml::LN_CT_TblPrBase_bidiVisual:
 {
 TablePropertyMapPtr pPropMap(new TablePropertyMap());
-pPropMap->Insert(PROP_WRITING_MODE, uno::makeAny(nIntValue ? 
text::WritingMode2::RL_TB : text::WritingMode2::LR_TB));
+pPropMap->Insert(PROP_WRITING_MODE, 
uno::makeAny(sal_Int16(nIntValue ? text::WritingMode2::RL_TB : 
text::WritingMode2::LR_TB)));
 insertTableProps(pPropMap);
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-04-27 Thread Caolán McNamara
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3eda8234acf09cd5a31cdcde76f04631a51fcc37
Author: Caolán McNamara 
Date:   Thu Apr 27 15:25:20 2017 +0100

Resolves: tdf#107411 LibreOffice hangs at RTF import time

regression from...

commit b993942622897fc64a1f7462189fa0463eb30e1c
Author: Caolán McNamara 
Date:   Sat Apr 1 16:43:04 2017 +0100

ubsan: use WrapTextMode_MAKE_FIXED_SIZE instead of -1 as unset flag

cause WrapTextMode_MAKE_FIXED_SIZE is >= 0

Change-Id: I6b5adbcc38cc841c5df9a0af9acdf634d3c6c757

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 912bb6672977..a11b10c78844 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -918,9 +918,9 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
 pStyleProperties->GetvAnchor() >= 0 ? 
pStyleProperties->GetvAnchor() : text::RelOrientation::FRAME )));
 
 
aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SURROUND),
-rAppendContext.pLastParagraphProperties->GetWrap() >= 
text::WrapTextMode_NONE
+rAppendContext.pLastParagraphProperties->GetWrap() != 
text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE
 ? rAppendContext.pLastParagraphProperties->GetWrap()
-: pStyleProperties->GetWrap() >= text::WrapTextMode_NONE
+: pStyleProperties->GetWrap() != 
text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE
   ? pStyleProperties->GetWrap()
   : text::WrapTextMode_NONE ));
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-04-13 Thread Vitaliy Anderson
 writerfilter/source/dmapper/PropertyMap.cxx | 1473 +---
 writerfilter/source/dmapper/PropertyMap.hxx |  646 ++--
 2 files changed, 1043 insertions(+), 1076 deletions(-)

New commits:
commit d9febd5d725f1a17e7b64e2c44de189144ab4f9c
Author: Vitaliy Anderson 
Date:   Tue Apr 11 14:41:42 2017 +0300

PropertyMap.cxx: Indents and formatting

Change-Id: Ibd27ecf4d06f3982ae703f5e2fd01f063ce8f409
Reviewed-on: https://gerrit.libreoffice.org/36444
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 907bb43cde55..6dd001acc3bb 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -48,129 +48,110 @@
 #include 
 #include "PropertyMapHelper.hxx"
 
-using namespace ::com::sun::star;
+using namespace com::sun::star;
 
 namespace writerfilter {
-namespace dmapper{
+namespace dmapper {
 
-
-PropertyMap::PropertyMap()
-{
-}
-
-
-PropertyMap::~PropertyMap()
-{
-}
-
-
-uno::Sequence< beans::PropertyValue > PropertyMap::GetPropertyValues(bool 
bCharGrabBag)
+uno::Sequence< beans::PropertyValue > PropertyMap::GetPropertyValues( bool 
bCharGrabBag )
 {
 using comphelper::makePropertyValue;
-if(m_aValues.empty() && !m_vMap.empty())
+
+if ( m_aValues.empty() && !m_vMap.empty() )
 {
 size_t nCharGrabBag = 0;
 size_t nParaGrabBag = 0;
 size_t nCellGrabBag = 0;
-size_t nRowGrabBag = 0;
-for (MapIterator i = m_vMap.begin(); i != m_vMap.end(); ++i)
+size_t nRowGrabBag  = 0;
+
+const PropValue* pParaStyleProp = nullptr;
+const PropValue* pCharStyleProp = nullptr;
+const PropValue* pNumRuleProp   = nullptr;
+
+for ( const auto& rPropPair : m_vMap )
 {
-if ( i->second.getGrabBagType() == CHAR_GRAB_BAG )
+if ( rPropPair.second.getGrabBagType() == CHAR_GRAB_BAG )
 nCharGrabBag++;
-else if ( i->second.getGrabBagType() == PARA_GRAB_BAG )
+else if ( rPropPair.second.getGrabBagType() == PARA_GRAB_BAG )
 nParaGrabBag++;
-else if ( i->second.getGrabBagType() == CELL_GRAB_BAG )
+else if ( rPropPair.second.getGrabBagType() == CELL_GRAB_BAG )
 nCellGrabBag++;
-else if ( i->first == PROP_CELL_INTEROP_GRAB_BAG)
+else if ( rPropPair.first == PROP_CELL_INTEROP_GRAB_BAG )
 {
-uno::Sequence aSeq;
-i->second.getValue() >>= aSeq;
+uno::Sequence< beans::PropertyValue > aSeq;
+rPropPair.second.getValue() >>= aSeq;
 nCellGrabBag += aSeq.getLength();
 }
-else if ( i->second.getGrabBagType() == ROW_GRAB_BAG )
+else if ( rPropPair.second.getGrabBagType() == ROW_GRAB_BAG )
 nRowGrabBag++;
-}
 
-//style names have to be the first elements within the property 
sequence
-//otherwise they will overwrite 'hard' attributes
-MapIterator aParaStyleIter = m_vMap.find(PROP_PARA_STYLE_NAME);
-if( aParaStyleIter != m_vMap.end())
-{
-m_aValues.push_back( makePropertyValue(
-getPropertyName( aParaStyleIter->first ),
-aParaStyleIter->second.getValue()
-) );
+if ( rPropPair.first == PROP_PARA_STYLE_NAME ) pParaStyleProp = 

+if ( rPropPair.first == PROP_CHAR_STYLE_NAME ) pCharStyleProp = 

+if ( rPropPair.first == PROP_NUMBERING_RULES ) pNumRuleProp   = 

 }
 
-MapIterator aCharStyleIter = m_vMap.find(PROP_CHAR_STYLE_NAME);
-if( aCharStyleIter != m_vMap.end())
-{
-m_aValues.push_back( makePropertyValue(
-getPropertyName( aCharStyleIter->first ),
-aCharStyleIter->second.getValue()
-) );
-}
-MapIterator aNumRuleIter = m_vMap.find(PROP_NUMBERING_RULES);
-if( aNumRuleIter != m_vMap.end())
-{
-m_aValues.push_back( makePropertyValue(
-getPropertyName( aNumRuleIter->first ),
-aNumRuleIter->second.getValue()
-) );
-}
+// Style names have to be the first elements within the property 
sequence
+// otherwise they will overwrite 'hard' attributes
+if ( pParaStyleProp != nullptr )
+m_aValues.push_back( makePropertyValue( getPropertyName( 
PROP_PARA_STYLE_NAME ), pParaStyleProp->getValue() ) );
+if ( pCharStyleProp != nullptr )
+m_aValues.push_back( makePropertyValue( getPropertyName( 
PROP_CHAR_STYLE_NAME ), pCharStyleProp->getValue() ) );
+if ( pNumRuleProp 

[Libreoffice-commits] core.git: writerfilter/source

2017-04-12 Thread Vitaliy Anderson
 writerfilter/source/dmapper/NumberingManager.cxx |   11 ---
 writerfilter/source/dmapper/NumberingManager.hxx |4 
 2 files changed, 15 deletions(-)

New commits:
commit 66f71c7e8b68a3e35e258ff1131f5e3d27fd9e85
Author: Vitaliy Anderson 
Date:   Wed Apr 12 16:05:19 2017 +0300

NumberingManager.cxx: remove unused

Change-Id: I43266bba61ae95386383b7080c9c5983804afe4a
Reviewed-on: https://gerrit.libreoffice.org/36478
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 325cef9fd982..3fbc70eb56a1 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -41,9 +41,6 @@
 
 using namespace com::sun::star;
 
-#define NUMBERING_MAX_LEVELS10
-
-
 namespace writerfilter {
 namespace dmapper {
 
@@ -295,14 +292,6 @@ uno::Sequence< beans::PropertyValue > 
ListLevel::GetLevelProperties( )
 //2.3
 //3.4
 
-
-if( m_nFWord6 > 0) //Word 6 compatibility
-{
-if( m_nFPrev == 1)
-
aNumberingProperties.push_back(lcl_makePropVal(PROP_PARENT_NUMBERING,
 NUMBERING_MAX_LEVELS));
-//TODO: prefixing space nFPrevSpace; - has not been used in 
WW8 filter
-}
-
 //TODO: sRGBXchNums; array of inherited numbers
 
 //  nXChFollow; following character 0 - tab, 1 - space, 2 - nothing
diff --git a/writerfilter/source/dmapper/NumberingManager.hxx 
b/writerfilter/source/dmapper/NumberingManager.hxx
index f2cb1d2c637e..723ca47fdab2 100644
--- a/writerfilter/source/dmapper/NumberingManager.hxx
+++ b/writerfilter/source/dmapper/NumberingManager.hxx
@@ -45,9 +45,7 @@ class ListLevel : public PropertyMap
 sal_Int32 m_nNFC;
//LN_CT_Lvl_numFmt
 sal_Int32 m_nJC; //LN_JC
 sal_Int32 m_nFLegal; 
//LN_FLEGAL
-sal_Int32 m_nFPrev;  //LN_FPREV
 sal_Int32 m_nFPrevSpace; 
//LN_FPREVSPACE
-sal_Int32 m_nFWord6; 
//LN_FWORD6
 sal_Int16 m_nXChFollow;  
//LN_IXCHFOLLOW
 OUString   m_sBulletChar;
 OUString   m_sGraphicURL;
@@ -66,9 +64,7 @@ public:
 ,m_nNFC(-1)
 ,m_nJC(-1)
 ,m_nFLegal(-1)
-,m_nFPrev(-1)
 ,m_nFPrevSpace(-1)
-,m_nFWord6(-1)
 ,m_nXChFollow(SvxNumberFormat::LISTTAB)
 ,m_nTabstop( 0 )
 ,m_outline(false)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-04-01 Thread Caolán McNamara
 writerfilter/source/dmapper/PropertyMap.cxx|4 ++--
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +-
 writerfilter/source/rtftok/rtfsdrimport.cxx|2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b993942622897fc64a1f7462189fa0463eb30e1c
Author: Caolán McNamara 
Date:   Sat Apr 1 16:43:04 2017 +0100

ubsan: use WrapTextMode_MAKE_FIXED_SIZE instead of -1 as unset flag

Change-Id: I0d460c5a0c14d078623fb1669a529a411002cad0
Reviewed-on: https://gerrit.libreoffice.org/36009
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 9add77dea8a7..2597f092cb62 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1557,7 +1557,7 @@ ParagraphProperties::ParagraphProperties() :
 m_nLines(0),
 m_w(-1),
 m_h(-1),
-m_nWrap((text::WrapTextMode)-1),
+m_nWrap(text::WrapTextMode_MAKE_FIXED_SIZE),
 m_hAnchor(-1),
 m_vAnchor(-1),
 m_x(-1),
@@ -1637,7 +1637,7 @@ void ParagraphProperties::ResetFrameProperties()
 m_nLines = 0;
 m_w = -1;
 m_h = -1;
-m_nWrap = (text::WrapTextMode)-1;
+m_nWrap = text::WrapTextMode_MAKE_FIXED_SIZE;
 m_hAnchor = -1;
 m_vAnchor = -1;
 m_x = -1;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 598175806400..bafdd3484ab0 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3272,7 +3272,7 @@ RTFShape::RTFShape()
   nVertOrientRelation(0),
   nHoriOrientRelationToken(0),
   nVertOrientRelationToken(0),
-  nWrap((text::WrapTextMode)-1),
+  nWrap(text::WrapTextMode_MAKE_FIXED_SIZE),
   bInBackground(false)
 {
 }
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx 
b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 28ef52f8bfa3..18263f32106a 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -958,7 +958,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, 
ShapeOrPict const shap
 xPropertySet->setPropertyValue("HoriOrientRelation", 
uno::makeAny(rShape.nHoriOrientRelation));
 if (rShape.nVertOrientRelation != 0)
 xPropertySet->setPropertyValue("VertOrientRelation", 
uno::makeAny(rShape.nVertOrientRelation));
-if (rShape.nWrap != (text::WrapTextMode)-1)
+if (rShape.nWrap != text::WrapTextMode_MAKE_FIXED_SIZE)
 xPropertySet->setPropertyValue("Surround", 
uno::makeAny(text::WrapTextMode(rShape.nWrap)));
 oox::ModelObjectHelper aModelObjectHelper(m_rImport.getModelFactory());
 if (aFillModel.moType.has())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-03-31 Thread Justin Luth
 writerfilter/source/dmapper/PropertyMap.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 541b377a94fb1247dbf4c39b5bcf55deb8e5ef60
Author: Justin Luth 
Date:   Thu Mar 16 16:19:04 2017 +0300

writerfilter: default break type identified as _nextPage

Change-Id: I9247c75819425a97d19c95c48fbaf7a4f8d92c62
Reviewed-on: https://gerrit.libreoffice.org/35379
Tested-by: Jenkins 
Reviewed-by: Justin Luth 

diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index af073bd5b758..9add77dea8a7 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1178,10 +1178,13 @@ void SectionPropertyMap::CloseSectionGroup( 
DomainMapper_Impl& rDM_Impl )
 }
 }
 
+// The default section type is nextPage.
+if( m_nBreakType == -1 )
+m_nBreakType = NS_ooxml::LN_Value_ST_SectionMark_nextPage;
+
 // depending on the break type no page styles should be created
-// If the section type is missing, but we have columns without new style 
info, then this should be
-// handled as a continuous section break.
-const bool bTreatAsContinuous = (m_nBreakType == -1 || m_nBreakType == 
NS_ooxml::LN_Value_ST_SectionMark_nextPage)
+// Continuous sections usually create only a section, and not a new page 
style
+const bool bTreatAsContinuous = m_nBreakType == 
NS_ooxml::LN_Value_ST_SectionMark_nextPage
 && m_nColumnCount > 0
 && !HasHeader(m_bTitlePage) && 
!HasFooter(m_bTitlePage)
 && (m_bIsFirstSection || 
m_sFollowPageStyleName.isEmpty() || (m_sFirstPageStyleName.isEmpty() && 
m_bTitlePage));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-03-31 Thread Noel Grandin
 writerfilter/source/dmapper/ConversionHelper.cxx |5 ++---
 writerfilter/source/dmapper/ConversionHelper.hxx |4 +++-
 writerfilter/source/dmapper/DomainMapper.cxx |   12 ++--
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|   14 --
 writerfilter/source/dmapper/FormControlHelper.cxx|2 +-
 writerfilter/source/dmapper/GraphicHelpers.cxx   |5 ++---
 writerfilter/source/dmapper/GraphicHelpers.hxx   |3 ++-
 writerfilter/source/dmapper/GraphicImport.cxx|8 
 writerfilter/source/dmapper/OLEHandler.cxx   |4 ++--
 writerfilter/source/dmapper/OLEHandler.hxx   |4 ++--
 writerfilter/source/dmapper/PropertyMap.cxx  |4 ++--
 writerfilter/source/dmapper/PropertyMap.hxx  |7 ---
 writerfilter/source/rtftok/rtfdocumentimpl.cxx   |2 +-
 writerfilter/source/rtftok/rtfdocumentimpl.hxx   |3 ++-
 writerfilter/source/rtftok/rtfsdrimport.cxx  |2 +-
 16 files changed, 43 insertions(+), 38 deletions(-)

New commits:
commit 64b6e19323cdd80ac5469ff43cac263df7e18329
Author: Noel Grandin 
Date:   Thu Mar 30 16:28:56 2017 +0200

use actual UNO enums in writerfilter

Change-Id: I59afe1ec7096cc7d173baab2042254eb647587b5
Reviewed-on: https://gerrit.libreoffice.org/35918
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx 
b/writerfilter/source/dmapper/ConversionHelper.cxx
index 805bac53d2e0..7560a8ff9ef5 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -424,9 +423,9 @@ sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t)
 return convertTwipToMM100( _t );
 }
 
-sal_Int16 convertRubyAlign( sal_Int32 nIntValue )
+text::RubyAdjust convertRubyAlign( sal_Int32 nIntValue )
 {
-sal_Int16 rubyAdjust = text::RubyAdjust_LEFT;
+text::RubyAdjust rubyAdjust = text::RubyAdjust_LEFT;
 switch( nIntValue )
 {
 case NS_ooxml::LN_Value_ST_RubyAlign_center:
diff --git a/writerfilter/source/dmapper/ConversionHelper.hxx 
b/writerfilter/source/dmapper/ConversionHelper.hxx
index faf5c27d234a..25ca7f8b8ce9 100644
--- a/writerfilter/source/dmapper/ConversionHelper.hxx
+++ b/writerfilter/source/dmapper/ConversionHelper.hxx
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+
 namespace com{ namespace sun{ namespace star{
 namespace lang{
 struct Locale;
@@ -47,7 +49,7 @@ namespace ConversionHelper{
 SAL_DLLPUBLIC_EXPORT sal_Int32 convertTwipToMM100(sal_Int32 _t);
 SAL_DLLPUBLIC_EXPORT sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t);
 sal_Int16 convertTableJustification( sal_Int32 nIntValue );
-sal_Int16 convertRubyAlign( sal_Int32 nIntValue );
+css::text::RubyAdjust convertRubyAlign( sal_Int32 nIntValue );
 sal_Int16 ConvertNumberingType(sal_Int32 nFmt);
 
 css::util::DateTime ConvertDateStringToDateTime(const OUString& rDateTime);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 2c44cbbc141f..4e3ff7676b5e 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1773,7 +1773,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 /* 0 HoriLR 1 Vert TR 2 Vert TR 3 Vert TT 4 HoriLT
 only 0 and 1 can be imported correctly
   */
-sal_Int16 nDirection = text::WritingMode_LR_TB;
+text::WritingMode nDirection = text::WritingMode_LR_TB;
 switch( nIntValue )
 {
 case NS_ooxml::LN_Value_ST_TextDirection_lrTb:
@@ -2726,7 +2726,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 {
 rContext->Insert(PROP_RUBY_TEXT, uno::makeAny(aInfo.sRubyText));
 rContext->Insert(PROP_RUBY_STYLE, uno::makeAny(aInfo.sRubyStyle));
-rContext->Insert(PROP_RUBY_ADJUST, 
uno::makeAny(ConversionHelper::convertRubyAlign(aInfo.nRubyAlign)));
+rContext->Insert(PROP_RUBY_ADJUST, 
uno::makeAny(ConversionHelper::convertRubyAlign(aInfo.nRubyAlign)));
 m_pImpl->SetRubySprmId(0);
 }
 }
@@ -3498,8 +3498,8 @@ void DomainMapper::handleUnderlineType(const Id nId, 
const ::std::shared_ptr& rContext, const bool bExchangeLeftRight)
 {
-sal_Int16 nAdjust = 0;
-sal_Int16 nLastLineAdjust = 0;
+style::ParagraphAdjust nAdjust = style::ParagraphAdjust_LEFT;
+style::ParagraphAdjust nLastLineAdjust = style::ParagraphAdjust_LEFT;
 OUString aStringValue = "left";
 

[Libreoffice-commits] core.git: writerfilter/source

2017-03-30 Thread Michael Stahl
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit c382c998ffdaf80c10a3f078fb4f0a37224d1158
Author: Michael Stahl 
Date:   Thu Mar 30 23:11:41 2017 +0200

writerfilter: DOCX import: fix handling of w:hideMark vs. w:vMerge

The problem is that Writer's layout can't handle the case where cells
are vertically merged and the last row has a fixed height; the vertically
merged cell will grow up to the height of the other cells in the non-
fixed rows plus the fixed row height, but no larger.

So for now, avoid setting fixed row heights in this case.

(regression from d1278ef4849661b9ae0eb7aaf4d74fbf91ccaf11)

Change-Id: Iac3689e0bb0d5b8a62115ca0fb1f2c553a6e6bbc

diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index ec5285ab26ee..2c33391d9c7b 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -875,8 +875,12 @@ CellPropertyValuesSeq_t 
DomainMapperTableHandler::endTableGetCellProperties(Tabl
 bool lcl_hideMarks(PropertyMapVector1& rCellProperties)
 {
 for (PropertyMapPtr & p : rCellProperties)
-if (!p->isSet(PROP_CELL_HIDE_MARK))
+{
+// if anything is vertically merged, the row must not be set to fixed
+// as Writer's layout doesn't handle that well
+if (!p->isSet(PROP_CELL_HIDE_MARK) || p->isSet(PROP_VERTICAL_MERGE))
 return false;
+}
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-03-07 Thread Stephan Bergmann
 writerfilter/source/dmapper/NumberingManager.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 265a19ca74bd62d4b3eecfc4b7dbb4c9cc50e014
Author: Stephan Bergmann 
Date:   Tue Mar 7 19:51:59 2017 +0100

loplugin:loopvartoosmall

Change-Id: I089affb48717d64846064b61344820f1b87ac317

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx 
b/writerfilter/source/dmapper/NumberingManager.cxx
index 965fd27..a27af1d 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -540,14 +540,14 @@ void ListDef::CreateNumberingRules( DomainMapper& 
rDMapper,
 uno::Sequence< uno::Sequence< beans::PropertyValue > > aProps = 
GetPropertyValues( );
 
 sal_Int32 nAbstLevels = m_pAbstractDef ? m_pAbstractDef->Size() : 
0;
-sal_Int16 nLevel = 0;
+sal_Int32 nLevel = 0;
 while ( nLevel < nAbstLevels )
 {
 ListLevel::Pointer pAbsLevel = m_pAbstractDef->GetLevel( 
nLevel );
 ListLevel::Pointer pLevel = GetLevel( nLevel );
 
 // Get the merged level properties
-auto aLvlProps = comphelper::sequenceToContainer< 
std::vector >(aProps[sal_Int32(nLevel)]);
+auto aLvlProps = comphelper::sequenceToContainer< 
std::vector >(aProps[nLevel]);
 
 // Get the char style
 uno::Sequence< beans::PropertyValue > aAbsCharStyleProps = 
pAbsLevel->GetCharStyleProperties( );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source xmlsecurity/inc xmlsecurity/qa xmlsecurity/source

2017-03-02 Thread Miklos Vajna
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|3 +
 xmlsecurity/inc/biginteger.hxx|9 
-
 xmlsecurity/qa/unit/signing/signing.cxx   |1 
 xmlsecurity/source/component/documentdigitalsignatures.cxx|   16 
+-
 xmlsecurity/source/dialogs/certificatechooser.cxx |4 --
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx|9 
+
 xmlsecurity/source/dialogs/macrosecurity.cxx  |6 
---
 xmlsecurity/source/helper/documentsignaturemanager.cxx|5 
+--
 xmlsecurity/source/xmlsec/biginteger.cxx  |3 +
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |2 -
 xmlsecurity/source/xmlsec/serialnumberadapter.cxx |4 +-
 11 files changed, 23 insertions(+), 39 deletions(-)

New commits:
commit 42460fd4eb4757dcdf3b3e533aafabda77751321
Author: Miklos Vajna 
Date:   Thu Mar 2 08:10:07 2017 +0100

xmlsecurity: avoid using the SerialNumberAdapter wrapper

This service is only used in xmlsecurity and it's a wrapper around two
free functions in the same module.

Change-Id: Ibc5a026b51eda6c2b4b27b7254dedc220dbf909a
Reviewed-on: https://gerrit.libreoffice.org/34772
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 7286a83..785d797 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -211,7 +211,8 @@ const char* keywordToString(RTFKeyword nKeyword)
 static util::DateTime lcl_getDateTime(RTFParserState& aState)
 {
 return {0 /*100sec*/, 0 /*sec*/, aState.nMinute, aState.nHour,
-  aState.nDay, aState.nMonth, aState.nYear, false};
+aState.nDay, aState.nMonth, aState.nYear, false
+   };
 }
 
 static void lcl_DestinationToMath(OUStringBuffer* pDestinationText, 
oox::formulaimport::XmlStreamBuilder& rMathBuffer, bool& rMathNor)
diff --git a/xmlsecurity/inc/biginteger.hxx b/xmlsecurity/inc/biginteger.hxx
index 73f6259..2cd116d 100644
--- a/xmlsecurity/inc/biginteger.hxx
+++ b/xmlsecurity/inc/biginteger.hxx
@@ -25,8 +25,13 @@
 
 #include 
 
-OUString bigIntegerToNumericString( const css::uno::Sequence< sal_Int8 >& 
serial );
-css::uno::Sequence< sal_Int8 > numericStringToBigInteger ( const OUString& 
serialNumber );
+#include 
+
+namespace xmlsecurity
+{
+XSECXMLSEC_DLLPUBLIC OUString bigIntegerToNumericString( const 
css::uno::Sequence< sal_Int8 >& serial );
+XSECXMLSEC_DLLPUBLIC css::uno::Sequence< sal_Int8 > numericStringToBigInteger 
( const OUString& serialNumber );
+}
 
 #endif
 
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx 
b/xmlsecurity/qa/unit/signing/signing.cxx
index 03c7c96..f8fe7b5 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx 
b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 81d6aeb..54b0840 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -42,7 +42,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -316,9 +315,6 @@ DocumentDigitalSignatures::ImplVerifySignatures(
 
 if ( nInfos )
 {
-   Reference xSerialNumberAdapter =
-css::security::SerialNumberAdapter::create(mxCtx);
-
 for( int n = 0; n < nInfos; ++n )
 {
 DocumentSignatureAlgorithm mode = 
DocumentSignatureHelper::getDocumentAlgorithm(
@@ -333,7 +329,7 @@ DocumentDigitalSignatures::ImplVerifySignatures(
 if (!rInfo.ouX509Certificate.isEmpty())
rSigInfo.Signer = xSecEnv->createCertificateFromAscii( 
rInfo.ouX509Certificate ) ;
 if (!rSigInfo.Signer.is())
-rSigInfo.Signer = xSecEnv->getCertificate( 
rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( 
rInfo.ouX509SerialNumber ) );
+rSigInfo.Signer = xSecEnv->getCertificate( 
rInfo.ouX509IssuerName, xmlsecurity::numericStringToBigInteger( 
rInfo.ouX509SerialNumber ) );
 
 // Time support again (#i38744#)
 Date aDate( rInfo.stDateTime.Day, rInfo.stDateTime.Month, 
rInfo.stDateTime.Year );
@@ -431,10 +427,7 @@ sal_Bool DocumentDigitalSignatures::isAuthorTrusted(
 {
 bool bFound = false;
 
-Reference xSerialNumberAdapter =
-css::security::SerialNumberAdapter::create(mxCtx);
-
-OUString sSerialNum = xSerialNumberAdapter->toString( 
Author->getSerialNumber() );
+OUString 

[Libreoffice-commits] core.git: writerfilter/source

2017-02-28 Thread Miklos Vajna
 writerfilter/source/dmapper/SdtHelper.cxx  |2 +-
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 ++--
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |   10 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit d97380c66904328e9d706a0b03a6800dc048aa7d
Author: Miklos Vajna 
Date:   Tue Feb 28 20:33:17 2017 +0100

writerfilter: avoid repeating the return type from the declaration

Change-Id: I4fb7993482e71c936d820b559aa6b4a212c8175d
Reviewed-on: https://gerrit.libreoffice.org/34729
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/SdtHelper.cxx 
b/writerfilter/source/dmapper/SdtHelper.cxx
index a27c017..b9c3b9f 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -59,7 +59,7 @@ awt::Size lcl_getOptimalWidth(const StyleSheetTablePtr& 
pStyleSheet, OUString& r
 sal_Int32 nBorder = nHeight / 2;
 
 // Width: space for the text + the square having the dropdown arrow.
-return awt::Size(nWidth + nBorder + nHeight, nHeight + nBorder);
+return {nWidth + nBorder + nHeight, nHeight + nBorder};
 }
 
 SdtHelper::SdtHelper(DomainMapper_Impl& rDM_Impl)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 719d82c..7286a83 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -210,8 +210,8 @@ const char* keywordToString(RTFKeyword nKeyword)
 
 static util::DateTime lcl_getDateTime(RTFParserState& aState)
 {
-return util::DateTime(0 /*100sec*/, 0 /*sec*/, aState.nMinute, 
aState.nHour,
-  aState.nDay, aState.nMonth, aState.nYear, false);
+return {0 /*100sec*/, 0 /*sec*/, aState.nMinute, aState.nHour,
+  aState.nDay, aState.nMonth, aState.nYear, false};
 }
 
 static void lcl_DestinationToMath(OUStringBuffer* pDestinationText, 
oox::formulaimport::XmlStreamBuilder& rMathBuffer, bool& rMathNor)
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 5b09a50..5128264a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -274,11 +274,11 @@ public:
 bool isRightToLeft;
 
 // Info group.
-int nYear;
-int nMonth;
-int nDay;
-int nHour;
-int nMinute;
+sal_Int16 nYear;
+sal_uInt16 nMonth;
+sal_uInt16 nDay;
+sal_uInt16 nHour;
+sal_uInt16 nMinute;
 
 /// Text from special destinations.
 OUStringBuffer aDestinationText;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/source

2017-02-05 Thread Noel Grandin
 writerfilter/source/ooxml/OOXMLFactory.cxx  |   12 +++
 writerfilter/source/ooxml/OOXMLFactory.hxx  |   47 +---
 writerfilter/source/ooxml/factory_ns.py |2 -
 writerfilter/source/ooxml/factoryimpl.py|6 +--
 writerfilter/source/ooxml/factoryimpl_ns.py |8 ++--
 5 files changed, 37 insertions(+), 38 deletions(-)

New commits:
commit 005ef926c692f790cd319130243cb053ef9af26c
Author: Noel Grandin 
Date:   Fri Feb 3 15:04:48 2017 +0200

writerfilter: convert ResourceType to scoped enum

and drop unused constant StreamProperties

Change-Id: I6a358cf7914412231d6c8f926a0d2fbd4bb8009b
Reviewed-on: https://gerrit.libreoffice.org/33885
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx 
b/writerfilter/source/ooxml/OOXMLFactory.cxx
index 4227ae2..ff65144 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -63,7 +63,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * 
pHandler,
 
 switch (pAttr->m_nResource)
 {
-case RT_Boolean:
+case ResourceType::Boolean:
 {
 const char *pValue = "";
 pAttribs->getAsChar(nToken, pValue);
@@ -72,7 +72,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * 
pHandler,
 pFactory->attributeAction(pHandler, nToken, xValue);
 }
 break;
-case RT_String:
+case ResourceType::String:
 {
 OUString aValue(pAttribs->getValue(nToken));
 OOXMLValue::Pointer_t xValue(new OOXMLStringValue(aValue));
@@ -80,7 +80,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * 
pHandler,
 pFactory->attributeAction(pHandler, nToken, xValue);
 }
 break;
-case RT_Integer:
+case ResourceType::Integer:
 {
 sal_Int32 nValue;
 pAttribs->getAsInteger(nToken,nValue);
@@ -89,7 +89,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * 
pHandler,
 pFactory->attributeAction(pHandler, nToken, xValue);
 }
 break;
-case RT_Hex:
+case ResourceType::Hex:
 {
 const char *pValue = "";
 pAttribs->getAsChar(nToken, pValue);
@@ -98,7 +98,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * 
pHandler,
 pFactory->attributeAction(pHandler, nToken, xValue);
 }
 break;
-case RT_UniversalMeasure:
+case ResourceType::UniversalMeasure:
 {
 const char *pValue = "";
 pAttribs->getAsChar(nToken, pValue);
@@ -107,7 +107,7 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * 
pHandler,
 pFactory->attributeAction(pHandler, nToken, xValue);
 }
 break;
-case RT_List:
+case ResourceType::List:
 {
 sal_uInt32 nValue;
 if (pFactory->getListValue(pAttr->m_nRef, 
Attribs->getValue(nToken), nValue))
diff --git a/writerfilter/source/ooxml/OOXMLFactory.hxx 
b/writerfilter/source/ooxml/OOXMLFactory.hxx
index e1f7a63..574550b 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.hxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.hxx
@@ -32,34 +32,33 @@
 namespace writerfilter {
 namespace ooxml {
 
-enum ResourceType_t {
-RT_NoResource,
-RT_Table,
-RT_Stream,
-RT_StreamProperties,
-RT_List,
-RT_Integer,
-RT_Properties,
-RT_Hex,
-RT_String,
-RT_Shape,
-RT_Boolean,
-RT_HexValue,
-RT_Value,
-RT_XNote,
-RT_TextTableCell,
-RT_TextTableRow,
-RT_TextTable,
-RT_PropertyTable,
-RT_Math,
-RT_Any,
-RT_UniversalMeasure
+enum class ResourceType {
+NoResource,
+Table,
+Stream,
+List,
+Integer,
+Properties,
+Hex,
+String,
+Shape,
+Boolean,
+HexValue,
+Value,
+XNote,
+TextTableCell,
+TextTableRow,
+TextTable,
+PropertyTable,
+Math,
+Any,
+UniversalMeasure
 };
 
 struct AttributeInfo
 {
 Token_t m_nToken;
-ResourceType_t m_nResource;
+ResourceType m_nResource;
 Id m_nRef;
 };
 
@@ -79,7 +78,7 @@ public:
 virtual bool getListValue(Id nId, const OUString& rValue, sal_uInt32& 
rOutValue) = 0;
 virtual Id getResourceId(Id nDefine, sal_Int32 nToken) = 0;
 virtual const AttributeInfo* getAttributeInfoArray(Id nId) = 0;
-virtual bool getElementId(Id nDefine, Id nId, ResourceType_t& 
rOutResource, Id& rOutElement) = 0;
+virtual bool getElementId(Id nDefine, Id nId, ResourceType& rOutResource, 
Id& rOutElement) = 0;
 };
 
 class OOXMLFactory
diff --git a/writerfilter/source/ooxml/factory_ns.py 

[Libreoffice-commits] core.git: writerfilter/source

2017-02-02 Thread Michael Stahl
 writerfilter/source/ooxml/factoryimpl.py |   12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

New commits:
commit 19c0eff34a5e1de4f3aff723b7750d4e01d4ba6d
Author: Michael Stahl 
Date:   Thu Feb 2 15:04:36 2017 +0100

writerfilter: remove gperf related declarations

Reportedly gperf 3.1 changes the signature of in_word_set(), where the
len parameter changes from unsigned int to size_t.

It turns out the only forward declaration for this function is currently
unused, so just remove it.

Change-Id: Ifbc582cd31ca37fff9ff95a3706ee902ecfe5223

diff --git a/writerfilter/source/ooxml/factoryimpl.py 
b/writerfilter/source/ooxml/factoryimpl.py
index 8584e19..dbb391c 100644
--- a/writerfilter/source/ooxml/factoryimpl.py
+++ b/writerfilter/source/ooxml/factoryimpl.py
@@ -105,17 +105,7 @@ def createFastChildContextFromStart(model):
 
 
 def fastTokenToId(model):
-print("""namespace tokenmap {
-struct token { const char* name; Token_t nToken; };
-class Perfect_Hash
-{
-private:
-  static inline unsigned int hash (const char* str, unsigned int len);
-public:
-  static struct token* in_word_set (const char* str, unsigned int len);
-};
-}
-
+print("""
 std::string fastTokenToId(sal_uInt32 nToken)
 {
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


<    1   2   3   4   5   6   7   8   9   >