[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - writerfilter/source

2015-04-29 Thread Miklos Vajna
 writerfilter/source/dmapper/DomainMapper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e503b429899b6edc510d4481d39aabd29fef52ce
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Apr 27 14:45:29 2015 +0200

cp#1000125 DOCX import: fix non-zero para indent

This only affects libreoffice-4-3 and earlier, libreoffice-4-4 and newer
is unaffected.

The problem is that the document had this XML fragment:

w:p
  w:pPr
w:numPr
  ...
/w:numPr
w:ind w:left=0 w:firstLine=0/
  /w:pPr
/w:p

The order of generated tokens for the left and firstLine attributes is
~random (but with the exact CPLinux config or on Windows, it's
firstLine, left), while it's always left, firstLine on newer
versions, since iterating over the keys of the boost::unordered_map has
been cleaned up.

When left is the later attribute, then the ParaFirstLineIndent
property should be set in the left handler only in case firstLine
did not set it already, so switch off overwriting.

Change-Id: Ifd0f6f7e1e85ac485be326d52b6db89f32d77357
(cherry picked from commit 8961fa8c1a72c81cee091f3e447a0f6cac7f6bea)

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 76d61e1..ed0fdac 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1075,7 +1075,7 @@ void DomainMapper::lcl_attribute(Id nName, Value  val)
 sal_Int32 nFirstLineIndent = 
m_pImpl-getCurrentNumberingProperty(FirstLineIndent);
 
 if (nFirstLineIndent != 0)
-
m_pImpl-GetTopContext()-Insert(PROP_PARA_FIRST_LINE_INDENT, 
uno::makeAny(nFirstLineIndent));
+
m_pImpl-GetTopContext()-Insert(PROP_PARA_FIRST_LINE_INDENT, 
uno::makeAny(nFirstLineIndent), /*bOverwrite=*/false);
 
 m_pImpl-GetTopContext()-Insert(
 PROP_PARA_LEFT_MARGIN, uno::makeAny( 
ConversionHelper::convertTwipToMM100(nIntValue ) ));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - writerfilter/source

2014-09-25 Thread Luboš Luňák
 writerfilter/source/dmapper/GraphicImport.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5aa05e27c8920be0c164683187170f1c5670189d
Author: Luboš Luňák l.lu...@collabora.com
Date:   Wed Sep 24 16:34:42 2014 +0200

add missing break

Should have been included in 3891ba42a886fa85eb43da24d1badf44e765d54c.

Change-Id: I22e5ba931a58c83efdbf996ce701c52dcf0bf9c5

diff --git a/writerfilter/source/dmapper/GraphicImport.cxx 
b/writerfilter/source/dmapper/GraphicImport.cxx
index 2c57337..9cda86a 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -857,6 +857,7 @@ void GraphicImport::lcl_attribute(Id nName, Value  val)
 m_pImpl-bOpaque = false;
 break;
 case NS_ooxml::LN_CT_Anchor_locked: // 90990; - ignored
+break;
 case NS_ooxml::LN_CT_Anchor_layoutInCell: // 90991; - ignored
 m_pImpl-bLayoutInCell = nIntValue != 0;
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - writerfilter/source

2014-09-24 Thread Tor Lillqvist
 writerfilter/source/dmapper/DomainMapperTableManager.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d801b901bfac152ed8d08e21822940d1588dfc32
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Apr 24 23:11:39 2014 +0300

Blind fix: writerfilter::TableManager used without template parameters

Change-Id: I351478d9dbde6f7459145b82a73fb5bb119a6bdb

diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
index 1162387..8fe9fb3 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
@@ -149,7 +149,7 @@ public:
 
 bool isInCell()
 {
-return TableManager::isInCell();
+return DomainMapperTableManager_Base_t::isInCell();
 }
 
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - writerfilter/source

2014-09-09 Thread sushil_shinde
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   34 ++
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |1 
 2 files changed, 24 insertions(+), 11 deletions(-)

New commits:
commit 3c03c0af168dd0fec4827b8d6b0761f7ca2f80c7
Author: sushil_shinde sushil.shi...@synerzip.com
Date:   Thu Jun 26 15:40:05 2014 +0530

fdo#77129 DOCX:Only Six pages were loaded out of 60 pages.

   - Footer reference was inside TOC field.
   - m_bStartTOC flag was enabled while handling TOC from document.
   - Since m_bStartTOC was enabled while importing footer it was inserting 
extra textcursors entries
 to m_aTextAppendStack.
   - Due to bad entries in textappendstack, footer was not popped properly.
   - Because of this all lost data after sixth page was inserted into 
footer node and it was not
 visible on page.
   - Added new flag to differentiate TOC from main document and Header or 
Footer.

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
https://gerrit.libreoffice.org/9930

(cherry picked from commit 9948d9566e86b190e74a62e63f273f5fa0eb8929)
Signed-off-by: Luboš Luňák l.lu...@collabora.com

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx

Change-Id: I5288f5c313c890e0fdddf3c60c4609eab30edde6

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 4e9a6f1..47f3a41 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -155,6 +155,7 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_bIsColumnBreakDeferred( false ),
 m_bIsPageBreakDeferred( false ),
 m_bStartTOC(false),
+m_bStartTOCHeaderFooter(false),
 m_bStartedTOC(false),
 m_bTOCPageRef(false),
 m_nSymboldata(-1),
@@ -1316,22 +1317,29 @@ void DomainMapper_Impl::appendTextPortion( const 
OUString rString, PropertyMapP
 {
 if (m_bStartTOC)
 {
-m_bStartedTOC = true;
-uno::Reference text::XTextCursor  xTOCTextCursor;
-xTOCTextCursor = xTextAppend-getEnd()-getText( 
)-createTextCursor( );
-xTOCTextCursor-gotoEnd(false);
-if (xTOCTextCursor.is())
+if(m_bInHeaderFooterImport  !m_bStartTOCHeaderFooter)
 {
-xTextRange = xTextAppend-insertTextPortion(rString, 
pValues, xTOCTextCursor);
-xTOCTextCursor-gotoRange(xTextRange-getEnd(), true);
+xTextRange = xTextAppend-appendTextPortion(rString, 
pValues);
 }
 else
 {
-xTextRange = xTextAppend-appendTextPortion(rString, 
pValues);
-xTOCTextCursor = xTextAppend-createTextCursor();
-xTOCTextCursor-gotoRange(xTextRange-getEnd(), false);
+m_bStartedTOC = true;
+uno::Reference text::XTextCursor  xTOCTextCursor;
+xTOCTextCursor = xTextAppend-getEnd()-getText( 
)-createTextCursor( );
+xTOCTextCursor-gotoEnd(false);
+if (xTOCTextCursor.is())
+{
+xTextRange = 
xTextAppend-insertTextPortion(rString, pValues, xTOCTextCursor);
+xTOCTextCursor-gotoRange(xTextRange-getEnd(), 
true);
+}
+else
+{
+xTextRange = 
xTextAppend-appendTextPortion(rString, pValues);
+xTOCTextCursor = xTextAppend-createTextCursor();
+xTOCTextCursor-gotoRange(xTextRange-getEnd(), 
false);
+}
+m_aTextAppendStack.push(TextAppendContext(xTextAppend, 
xTOCTextCursor));
 }
-m_aTextAppendStack.push(TextAppendContext(xTextAppend, 
xTOCTextCursor));
 }
 else
 xTextRange = xTextAppend-appendTextPortion(rString, 
pValues);
@@ -2885,6 +2893,8 @@ void DomainMapper_Impl::handleToc
 {
 OUString sValue;
 m_bStartTOC = true;
+if(m_bInHeaderFooterImport)
+m_bStartTOCHeaderFooter = true;
 bool bTableOfFigures = false;
 bool bHyperlinks = false;
 bool bFromOutline = false;
@@ -3839,6 +3849,8 @@ void DomainMapper_Impl::PopFieldContext()
 xTOCMarkerCursor-goLeft(1,sal_True);
 xTOCMarkerCursor-setString(OUString());
 }
+if(m_bInHeaderFooterImport  m_bStartTOCHeaderFooter)
+

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - writerfilter/source

2014-09-08 Thread Michael Stahl
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 +-
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|   51 --
 writerfilter/source/rtftok/rtfdocumentimpl.hxx|3 -
 3 files changed, 24 insertions(+), 36 deletions(-)

New commits:
commit 01a53d19b138cf7285e3b31be545dc915958b3c9
Author: Michael Stahl mst...@redhat.com
Date:   Sat Aug 2 18:55:55 2014 +0200

fdo#81944 fdo#82107: writerfilter: RTF import: don't drop fonts in 
stylesheet

The font definitions in the style sheet meet an untimely death in
StyleSheetTable::lcl_sprm(), which special-cases LN_EG_RPrBase_rFonts,
routing it into TblStylePrHandler.

Avoid this by sending style entries to the domain mapper in the same way
as the OOXML tokenizer, i.e., with paragraph and run properties nested
below CT_Style_pPr/rPr.

This reveals that the CT_Style_basedOn was wrongly handled as paragraph
property.

(cherry picked from commit f8e8e476aa0a5576234dbb4daac9dc299e044e61)

Conflicts:
writerfilter/source/rtftok/rtfdocumentimpl.cxx

Change-Id: Ic724ba48fe36bf782b1b430bdafdb1df480d5ad3

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 2b87cd7..4e9a6f1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4333,15 +4333,17 @@ uno::Referencecontainer::XIndexAccess 
DomainMapper_Impl::GetCurrentNumberingRu
 
 // So we are in a paragraph style and it has numbering. Look up the 
relevant numbering rules.
 OUString aListName = ListDef::GetStyleName(nListId);
-uno::Reference style::XStyleFamiliesSupplier  
xStylesSupplier(GetTextDocument(), uno::UNO_QUERY);
+uno::Reference style::XStyleFamiliesSupplier  
xStylesSupplier(GetTextDocument(), uno::UNO_QUERY_THROW);
 uno::Reference container::XNameAccess  xStyleFamilies = 
xStylesSupplier-getStyleFamilies();
 uno::Referencecontainer::XNameAccess xNumberingStyles;
 xStyleFamilies-getByName(NumberingStyles) = xNumberingStyles;
 uno::Referencebeans::XPropertySet 
xStyle(xNumberingStyles-getByName(aListName), uno::UNO_QUERY);
 xRet.set(xStyle-getPropertyValue(NumberingRules), uno::UNO_QUERY);
 }
-catch( const uno::Exception )
+catch (const uno::Exception e)
 {
+SAL_WARN(writerfilter.dmapper,
+GetCurrentNumberingRules: exception caught:   e.Message);
 }
 return xRet;
 }
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 649b3fc..76a083c 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1127,7 +1127,7 @@ void RTFDocumentImpl::text(OUString rString)
 
m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Style_name, pValue);
 
 writerfilter::ReferenceProperties::Pointer_t 
const pProp(
-new 
RTFReferenceProperties(mergeAttributes(), mergeSprms())
+   createStyleProperties()
 );
 
m_aStyleTableEntries.insert(make_pair(m_nCurrentStyleIndex, pProp));
 }
@@ -3059,6 +3059,10 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 case RTF_LEVELNFC: nSprm = NS_rtf::LN_NFC; break;
 case RTF_LEVELSTARTAT: nSprm = NS_rtf::LN_ISTARTAT; break;
 case RTF_LEVELPICTURE: nSprm = NS_ooxml::LN_CT_Lvl_lvlPicBulletId; 
break;
+case RTF_SBASEDON:
+   nSprm = (nKeyword == RTF_SBASEDON) ? NS_ooxml::LN_CT_Style_basedOn 
: NS_ooxml::LN_CT_Style_next;
+   pIntValue.reset(new RTFValue(getStyleName(nParam)));
+   break;
 default: break;
 }
 if (nSprm  0)
@@ -3096,10 +3100,6 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 case RTF_RI: nSprm = NS_sprm::LN_PDxaRight; break;
 case RTF_RIN: nSprm = 0x845d; break;
 case RTF_ITAP: nSprm = NS_sprm::LN_PTableDepth; break;
-case RTF_SBASEDON:
-   nSprm = (nKeyword == RTF_SBASEDON) ? NS_ooxml::LN_CT_Style_basedOn 
: NS_ooxml::LN_CT_Style_next;
-   pIntValue.reset(new RTFValue(getStyleName(nParam)));
-   break;
 default: break;
 }
 if (nSprm  0)
@@ -4194,19 +4194,21 @@ int RTFDocumentImpl::pushState()
 return 0;
 }
 
-RTFSprms RTFDocumentImpl::mergeSprms()
+writerfilter::ReferenceProperties::Pointer_t
+RTFDocumentImpl::createStyleProperties()
 {
-RTFSprms aSprms;
-for (RTFSprms::Iterator_t i = m_aStates.top().aTableSprms.begin();
-i != m_aStates.top().aTableSprms.end(); ++i)
-aSprms.set(i-first, i-second);
-for (RTFSprms::Iterator_t i = m_aStates.top().aCharacterSprms.begin();
-