[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-11-19 Thread Caolán McNamara
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |  177 +
 1 file changed, 97 insertions(+), 80 deletions(-)

New commits:
commit 566300ebd57e6ff07fdb014321e23a92c9bcf5ee
Author: Caolán McNamara 
Date:   Wed Nov 19 12:14:08 2014 +

Resolves: fdo#86451 guard all the tops post pop

Change-Id: I98be6f014893dfc7cee770c44cd9d0be32b39f5c
Reviewed-on: https://gerrit.libreoffice.org/12966
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index be56161..7c5cbf1 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -5637,7 +5637,7 @@ int RTFDocumentImpl::popState()
 case DESTINATION_PARAGRAPHNUMBERING:
 {
 RTFValue::Pointer_t pIdValue = 
aState.aTableAttributes.find(NS_ooxml::LN_CT_AbstractNum_nsid);
-if (pIdValue.get())
+if (pIdValue.get() && !m_aStates.empty())
 {
 // Abstract numbering
 RTFSprms aLeveltextAttributes;
@@ -5706,85 +5706,96 @@ int RTFDocumentImpl::popState()
 }
 break;
 case DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER:
-{
-// FIXME: don't use pDestinationText, points to popped state
-RTFValue::Pointer_t pValue(new 
RTFValue(aState.aDestinationText.makeStringAndClear(), true));
-m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_LevelSuffix_val, 
pValue);
-}
+if (!m_aStates.empty())
+{
+// FIXME: don't use pDestinationText, points to popped state
+RTFValue::Pointer_t pValue(new 
RTFValue(aState.aDestinationText.makeStringAndClear(), true));
+
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_LevelSuffix_val, pValue);
+}
 break;
 case DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE:
-{
-// FIXME: don't use pDestinationText, points to popped state
-RTFValue::Pointer_t pValue(new 
RTFValue(aState.aDestinationText.makeStringAndClear(), true));
-m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_LevelText_val, 
pValue);
-}
+if (!m_aStates.empty())
+{
+// FIXME: don't use pDestinationText, points to popped state
+RTFValue::Pointer_t pValue(new 
RTFValue(aState.aDestinationText.makeStringAndClear(), true));
+
m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_LevelText_val, pValue);
+}
 break;
 case DESTINATION_LISTLEVEL:
-{
-RTFValue::Pointer_t pInnerValue(new 
RTFValue(m_aStates.top().nListLevelNum++));
-aState.aTableAttributes.set(NS_ooxml::LN_CT_Lvl_ilvl, pInnerValue);
+if (!m_aStates.empty())
+{
+RTFValue::Pointer_t pInnerValue(new 
RTFValue(m_aStates.top().nListLevelNum++));
+aState.aTableAttributes.set(NS_ooxml::LN_CT_Lvl_ilvl, pInnerValue);
 
-RTFValue::Pointer_t pValue(new RTFValue(aState.aTableAttributes, 
aState.aTableSprms));
-if (m_aStates.top().nDestinationState != DESTINATION_LFOLEVEL)
-
m_aStates.top().aListLevelEntries.set(NS_ooxml::LN_CT_AbstractNum_lvl, pValue, 
OVERWRITE_NO_APPEND);
-else
-m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_NumLvl_lvl, 
pValue);
-}
+RTFValue::Pointer_t pValue(new RTFValue(aState.aTableAttributes, 
aState.aTableSprms));
+if (m_aStates.top().nDestinationState != DESTINATION_LFOLEVEL)
+
m_aStates.top().aListLevelEntries.set(NS_ooxml::LN_CT_AbstractNum_lvl, pValue, 
OVERWRITE_NO_APPEND);
+else
+m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_NumLvl_lvl, 
pValue);
+}
 break;
 case DESTINATION_LFOLEVEL:
-{
-RTFValue::Pointer_t pInnerValue(new 
RTFValue(m_aStates.top().nListLevelNum++));
-aState.aTableAttributes.set(NS_ooxml::LN_CT_NumLvl_ilvl, pInnerValue);
+if (!m_aStates.empty())
+{
+RTFValue::Pointer_t pInnerValue(new 
RTFValue(m_aStates.top().nListLevelNum++));
+aState.aTableAttributes.set(NS_ooxml::LN_CT_NumLvl_ilvl, 
pInnerValue);
 
-RTFValue::Pointer_t pValue(new RTFValue(aState.aTableAttributes, 
aState.aTableSprms));
-m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Num_lvlOverride, 
pValue);
-}
+RTFValue::Pointer_t pValue(new RTFValue(aState.aTableAttributes, 
aState.aTableSprms));
+m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Num_lvlOverride, 
pValue);
+}
 break;
 // list override table
 case DESTINATION_LISTOVERRIDEENTRY:
-{
-if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDEENTRY)
-{
-// copy properties upwards so upper popState inserts it
-m_aStates.top().aTableAttributes = aState.aTableAttributes;
-m_aStates.top().aTableSprms = aState.aTableSprms;
-}
-els

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-12-08 Thread Caolán McNamara
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit dcc914ab55feb844d5d71e6568801fa1ffd47f6c
Author: Caolán McNamara 
Date:   Mon Dec 8 11:24:14 2014 +

Resolves: fdo#86662 don't crash on docx load

ok in master, so just don't crash in 4-3 series

Change-Id: I2dcb7b0434341ff8058bdbdfc065ad08bd0600bc
Reviewed-on: https://gerrit.libreoffice.org/13374
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 1654744..bc4ff52 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3952,10 +3952,13 @@ void DomainMapper_Impl::CloseFieldCommand()
 OUString aCode( pContext->GetCommand().trim() );
 xFieldInterface = 
m_xTextFactory->createInstance("com.sun.star.text.Fieldmark");
 const uno::Reference 
xTextContent(xFieldInterface, uno::UNO_QUERY_THROW);
-uno::Reference< text::XTextAppend >  xTextAppend;
-xTextAppend = m_aTextAppendStack.top().xTextAppend;
-uno::Reference< text::XTextCursor > xCrsr = 
xTextAppend->createTextCursorByRange(pContext->GetStartRange());
-if (xTextContent.is())
+uno::Reference< text::XTextAppend > xTextAppend;
+if (!m_aTextAppendStack.empty())
+xTextAppend = m_aTextAppendStack.top().xTextAppend;
+uno::Reference< text::XTextCursor > xCrsr;
+if (xTextAppend.is())
+xCrsr = 
xTextAppend->createTextCursorByRange(pContext->GetStartRange());
+if (xTextAppend.is() && xTextContent.is())
 {
 xTextAppend->insertTextContent(xCrsr,xTextContent, 
sal_True);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-10-15 Thread Charu Tyagi
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 00f68a3375e39d293d5397375e257daf7e433bca
Author: Charu Tyagi 
Date:   Fri Jul 18 14:32:10 2014 +0530

fdo#81486:custom property with the same name as Document Property not 
imported
Change-Id: Ieb9cba7b8969787140d6db3b77765e3a15bf89e1
Reviewed-on: https://gerrit.libreoffice.org/10381
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 
Reviewed-on: https://gerrit.libreoffice.org/11960
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ffa4bae..41d12af 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -17,6 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -2856,13 +2860,18 @@ void DomainMapper_Impl::handleAuthor
 //Lines, Manager, NameofApplication, ODMADocId, Pages,
 //Security,
 };
+uno::Reference 
xDocumentPropertiesSupplier(m_xTextDocument, uno::UNO_QUERY);
+uno::Reference xDocumentProperties = 
xDocumentPropertiesSupplier->getDocumentProperties();
+const uno::Reference< beans::XPropertyContainer > xUserProps = 
xDocumentProperties->getUserDefinedProperties();
+uno::Reference  
xUserDefinedProps(xDocumentProperties->getUserDefinedProperties(), 
uno::UNO_QUERY_THROW);
+uno::Reference xPropertySetInfo =  
xUserDefinedProps->getPropertySetInfo();
 //search for a field mapping
 OUString sFieldServiceName;
 sal_uInt16 nMap = 0;
 for( ; nMap < sizeof(aDocProperties) / sizeof(DocPropertyMap);
 ++nMap )
 {
-if (rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName))
+if 
((rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName)) && 
(!xPropertySetInfo->hasPropertyByName(rFirstParam)))
 {
 sFieldServiceName =
 OUString::createFromAscii
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-08-19 Thread Caolán McNamara
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 5b980040676f2ce0f09b37e1070acb506cbe15e0
Author: Caolán McNamara 
Date:   Tue Jun 10 14:07:19 2014 +0100

fix build, coverity#1209547 Unchecked dynamic_cast

(cherry picked from commit f4c80aaf3f2b97661ecf1cfd014aaa5ad00da846)

Change-Id: Ibf614156aeafcd74be444cf388e02a9273d38d5f
Reviewed-on: https://gerrit.libreoffice.org/11018
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index ad460fa..0e18852 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1086,7 +1086,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr 
pPropertyMap )
 dmapper_logger->attribute("isTextAppend", xTextAppend.is());
 #endif
 
-if(xTextAppend.is() && ! getTableManager( ).isIgnore() && pParaContext != 
NULL)
+if (xTextAppend.is() && !getTableManager( ).isIgnore() && pParaContext != 
NULL)
 {
 try
 {
@@ -1221,14 +1221,17 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr 
pPropertyMap )
 }
 
 m_bParaChanged = false;
-if(!pParaContext->IsFrameMode())
+if (!pParaContext || !pParaContext->IsFrameMode())
 { // If the paragraph is in a frame, it's not a paragraph of the section 
itself.
 m_bIsFirstParaInSection = false;
 m_bIsLastParaInSection = false;
 }
 
-// Reset the frame properties for the next paragraph
-pParaContext->ResetFrameProperties();
+if (pParaContext)
+{
+// Reset the frame properties for the next paragraph
+pParaContext->ResetFrameProperties();
+}
 
 #ifdef DEBUG_DOMAINMAPPER
 dmapper_logger->endElement();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-05-27 Thread Miklos Vajna
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit dc17b03f29e206c4d06b047934a2d6d68a288b06
Author: Miklos Vajna 
Date:   Tue May 27 11:10:59 2014 +0200

fdo#78348 DOCX import: end progressbar after parsing is done

Change-Id: Id3db99a7ea341bcfc9bf2cd2b718e70a17d41f76
(cherry picked from commit cd1abdce1eafa7f2225e4050d1a075154b5e7d67)

diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx 
b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index edc53ff..35773d7 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -523,6 +523,9 @@ void OOXMLDocumentImpl::resolve(Stream & rStream)
 }
 }
 
+if (mxStatusIndicator.is())
+mxStatusIndicator->end();
+
 #ifdef DEBUG_RESOLVE
 debug_logger->endElement();
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-06-03 Thread Michael Stahl
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1946977939e4941429383e3a0649ce20ae758930
Author: Michael Stahl 
Date:   Tue Jun 3 23:24:14 2014 +0200

writerfilter: fix log area

Change-Id: Iddedd58dbcdd122ec4177bfdd5e97b9ceca18435
(cherry picked from commit 634f647912c07d366e31bfc168fa1294f1613cd6)

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 9b6229c..c5cf23f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -987,7 +987,7 @@ int RTFDocumentImpl::resolveChars(char ch)
 // fdo#79384: Word will reject Shift-JIS following \loch
 // but apparently OOo could read and (worse) write such documents
 SAL_INFO_IF(m_aStates.top().eRunType != RTFParserState::DBCH,
-"writerfilter.rtftok", "invalid Shift-JIS without DBCH");
+"writerfilter.rtf", "invalid Shift-JIS without DBCH");
 unsigned char uch = ch;
 if ((uch >= 0x80 && uch <= 0x9F) || uch >= 0xE0)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-07-21 Thread Michael Stahl
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a68dbdd334f9e653eb7e4db934055d32be506537
Author: Michael Stahl 
Date:   Fri Jul 18 22:07:02 2014 +0200

(related: fdo#78502) writerfilter: RTF import: fix invalid string copy

... in leveltext destination.

Change-Id: I74de6d14170130bf33923854a0c9851dc7cc390f
(cherry picked from commit b94bd40b915ab32d18d43fc60dfda932e4e00ca8)
Reviewed-on: https://gerrit.libreoffice.org/10395
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index c53174e..bee142c 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4863,7 +4863,7 @@ int RTFDocumentImpl::popState()
 // The first character is the length of the string (the rest should be 
ignored).
 sal_Int32 nLength(aStr.toChar());
 OUString aValue;
-if (nLength <= aStr.getLength())
+if (nLength < aStr.getLength())
 aValue = aStr.copy(1, nLength);
 else
 aValue = aStr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-07-25 Thread Michael Stahl
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   10 +
 writerfilter/source/rtftok/rtfsdrimport.cxx|  135 +++--
 writerfilter/source/rtftok/rtfsdrimport.hxx|8 +
 3 files changed, 101 insertions(+), 52 deletions(-)

New commits:
commit 44828af6a2526ff63b28074ea58a12b8b8bb1257
Author: Michael Stahl 
Date:   Wed Jul 16 18:47:15 2014 +0200

(related: fdo#79319) writerfilter: RTF import: fix crash on "fake" pict

The document has a \pict with {\sp{\sn shapeType}{\sv 1}}, i.e. it's
actually a rectangle shape; Word seems to ignore the picture data in
this case, so try to do the same.  Also consolidate the shape creation
in a new function RTFSdrImport::initShape().

(regression from ba9b63d8101197d3fd8612193b1ca188271dfc1a)

(cherry picked from commit 2b9e782497cb962d9ca74a851a1389b0e29df49c)

Conflicts:
writerfilter/source/rtftok/rtfsdrimport.cxx
writerfilter/source/rtftok/rtfsdrimport.hxx

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

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index bee142c..ef5c241 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4941,9 +4941,6 @@ int RTFDocumentImpl::popState()
 case DESTINATION_BOOKMARKEND:
 
Mapper().props(lcl_getBookmarkProperties(m_aBookmarks[m_aStates.top().aDestinationText.makeStringAndClear()]));
 break;
-case DESTINATION_PICT:
-resolvePict(true, m_pSdrImport->getCurrentShape());
-break;
 case DESTINATION_FORMFIELDNAME:
 {
 RTFValue::Pointer_t pValue(new 
RTFValue(m_aStates.top().aDestinationText.makeStringAndClear()));
@@ -5231,6 +5228,13 @@ int RTFDocumentImpl::popState()
 Mapper().endShape();
 }
 break;
+case DESTINATION_PICT:
+// fdo#79319 ignore picture data if it's really a shape
+if (!m_pSdrImport->isFakePict())
+{
+resolvePict(true, m_pSdrImport->getCurrentShape());
+}
+break;
 case DESTINATION_SHAPE:
 m_bNeedCr = m_bNeedCrOrig;
 if (aState.aFrame.inFrame())
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx 
b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 5edf425..22e257b 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -49,8 +49,9 @@ namespace rtftok
 
 RTFSdrImport::RTFSdrImport(RTFDocumentImpl& rDocument,
uno::Reference const& xDstDoc)
-: m_rImport(rDocument),
-  m_bTextFrame(false)
+: m_rImport(rDocument)
+, m_bTextFrame(false)
+, m_bFakePict(false)
 {
 uno::Reference xDrawings(xDstDoc, 
uno::UNO_QUERY);
 if (xDrawings.is())
@@ -215,21 +216,92 @@ void 
RTFSdrImport::applyProperty(uno::Reference xShape, const O
 }
 }
 
-void RTFSdrImport::resolve(RTFShape& rShape, bool bClose,
-ShapeOrPict const shapeOrPict)
+int RTFSdrImport::initShape(
+uno::Reference & o_xShape,
+uno::Reference & o_xPropSet,
+bool & o_rIsCustomShape,
+RTFShape const& rShape, bool const bClose, ShapeOrPict const shapeOrPict)
 {
+assert(!o_xShape.is());
+assert(!o_xPropSet.is());
+o_rIsCustomShape = false;
+m_bFakePict = false;
+
+// first, find the shape type
 int nType = -1;
+std::vector< std::pair >::const_iterator const iter(
+std::find_if(rShape.aProperties.begin(),
+ rShape.aProperties.end(),
+ boost::bind(&OUString::equals,
+ boost::bind(&std::pair::first, 
_1),
+ OUString("shapeType";
+
+if (iter == rShape.aProperties.end())
+{
+if (SHAPE == shapeOrPict)
+{
+// The spec doesn't state what is the default for shapeType,
+// Word seems to implement it as a rectangle.
+nType = ESCHER_ShpInst_Rectangle;
+}
+else
+{   // pict is picture by default but can be a rectangle too fdo#79319
+nType = ESCHER_ShpInst_PictureFrame;
+}
+}
+else
+{
+nType = iter->second.toInt32();
+if (PICT == shapeOrPict && ESCHER_ShpInst_PictureFrame != nType)
+{
+m_bFakePict = true;
+}
+}
+
+switch (nType)
+{
+case ESCHER_ShpInst_PictureFrame:
+createShape("com.sun.star.drawing.GraphicObjectShape", o_xShape, 
o_xPropSet);
+break;
+case ESCHER_ShpInst_Line:
+createShape("com.sun.star.drawing.LineShape", o_xShape, o_xPropSet);
+break;
+case ESCHER_ShpInst_Rectangle:
+case ESCHER_ShpInst_TextBox:
+// If we're inside a groupshape, can't use text frames.
+if (!bClose && m_aParents.size() ==

[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-07-25 Thread Michael Stahl
 writerfilter/source/rtftok/rtfsdrimport.cxx |   48 
 1 file changed, 48 insertions(+)

New commits:
commit 2ed95c9f8507d711f46360317e546683c7f0b8c2
Author: Michael Stahl 
Date:   Thu Jul 17 15:09:39 2014 +0200

fdo#79319: writerfilter: RTF import: support horizontal rule

There are special properties to create a "horizontal rule" shape
that apparently set some specific defaults; this prevents the
shape being imported as a big fat rectangle over the document.

Change-Id: I402376d7306e870ad895beaa657750cbf3290d98
(cherry picked from commit 589ca2a5e88a976bb10e60fcb1e3e75f4aa2504e)
Reviewed-on: https://gerrit.libreoffice.org/10388
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx 
b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 22e257b..19353fb 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -659,6 +659,54 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, 
ShapeOrPict const shap
 }
 }
 }
+else if (i->first == "fHorizRule") // TODO: what does "fStandardHR" do?
+{   // horizontal rule: relative width defaults to 100% of paragraph
+// TODO: does it have a default height?
+if (!oRelativeWidth)
+{
+oRelativeWidth = 100;
+}
+nRelativeWidthRelation = text::RelOrientation::FRAME;
+sal_Int16 const nVertOrient = text::VertOrientation::CENTER;
+if (xPropertySet.is())
+{
+xPropertySet->setPropertyValue("VertOrient", 
uno::makeAny(nVertOrient));
+}
+}
+else if (i->first == "pctHR")
+{   // horizontal rule relative width in permille
+oRelativeWidth = i->second.toInt32() / 10;
+}
+else if (i->first == "dxHeightHR")
+{   // horizontal rule height
+sal_uInt32 const nHeight(convertTwipToMm100(i->second.toInt32()));
+rShape.nBottom = rShape.nTop + nHeight;
+}
+else if (i->first == "dxWidthHR")
+{   // horizontal rule width
+sal_uInt32 const nWidth(convertTwipToMm100(i->second.toInt32()));
+rShape.nRight = rShape.nLeft + nWidth;
+}
+else if (i->first == "alignHR")
+{   // horizontal orientation *for horizontal rule*
+sal_Int16 nHoriOrient = text::HoriOrientation::NONE;
+switch (i->second.toInt32())
+{
+case 0:
+nHoriOrient = text::HoriOrientation::LEFT;
+break;
+case 1:
+nHoriOrient = text::HoriOrientation::CENTER;
+break;
+case 2:
+nHoriOrient = text::HoriOrientation::RIGHT;
+break;
+}
+if (xPropertySet.is() && text::HoriOrientation::NONE != 
nHoriOrient)
+{
+xPropertySet->setPropertyValue("HoriOrient", 
uno::makeAny(nHoriOrient));
+}
+}
 else
 SAL_INFO("writerfilter", "TODO handle shape property '" << 
i->first << "':'" << i->second << "'");
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-07-30 Thread Michael Stahl
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |3 ---
 writerfilter/source/dmapper/TablePropertiesHandler.cxx   |5 -
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ce65a47f6028879337e9e133053cc397b1b582bd
Author: Michael Stahl 
Date:   Tue Jul 29 22:21:53 2014 +0200

fdo#81384: writerfilter: turn the horrible btLr cell text dir hack

... by 5 degrees to starboard, which lets the row in the bugdoc appear,
altough the height is a bit insufficient still.  Why that works, is a
nautic mystery to me, i'd say this whole btLr emulation nonsense needs
to be keel-hauled, but after this patch i'll need some rum, a...

(regression from commit 0208ead70a9412ccd554fcef3e9308f8ca17037b
 and commit 970160f78ef6cc7abacfa252daa8451e1f0117bb)

Change-Id: Ie0c6ec88b6d6635379b9127f6460647f14776aad
(cherry picked from commit 5893a7536a0bbce57c4a2f89680dcb4cff3d06d7)
Reviewed-on: https://gerrit.libreoffice.org/10627
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 8eaeccc..121ea21 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -357,10 +357,7 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
 if (!getCellProps() || 
getCellProps()->find(PROP_VERTICAL_MERGE) == getCellProps()->end())
 {
 // Though in case there will be a vertical merge, 
don't do this, it hides text that is supposed to be visible.
-TablePropertyMapPtr pRowPropMap( new 
TablePropertyMap );
-pRowPropMap->Insert(PROP_SIZE_TYPE, 
uno::makeAny(text::SizeType::FIX));
 m_bRowSizeTypeInserted = true;
-insertRowProps(pRowPropMap);
 }
 m_bHasBtlrCell = true;
 }
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx 
b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
index 0edbd71..64172a0 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -98,11 +98,14 @@ namespace dmapper {
 
 DomainMapperTableManager* pManager = 
dynamic_cast(m_pTableManager);
 // In case any of the cells has the btLr cell direction, 
then an explicit minimal size will just hide the whole row, don't do that.
-if (pMeasureHandler->GetRowHeightSizeType() != 
text::SizeType::MIN || !pManager || !pManager->HasBtlrCell())
+const int MINLAY = 23; // sw/inc/swtypes.hxx, minimal 
possible size of frames.
+if (!pManager || !pManager->HasBtlrCell() || 
pMeasureHandler->getMeasureValue() > 
ConversionHelper::convertTwipToMM100(MINLAY))
 {
 // In case a cell already wanted fixed size, we should 
not overwrite it here.
 if (!pManager || !pManager->IsRowSizeTypeInserted())
 pPropMap->Insert( PROP_SIZE_TYPE, uno::makeAny( 
pMeasureHandler->GetRowHeightSizeType() ), false);
+else
+pPropMap->Insert( PROP_SIZE_TYPE, 
uno::makeAny(text::SizeType::FIX), false);
 
 pPropMap->Insert( PROP_HEIGHT, 
uno::makeAny(pMeasureHandler->getMeasureValue() ));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-08-02 Thread Michael Stahl
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit d2dd174ac05d7c2844c5e60169128e2a02d4311b
Author: Michael Stahl 
Date:   Fri Aug 1 20:21:21 2014 +0200

writerfilter: RTF import: ignore content of \upr, except for \ud

The content of \upr and its nested \ud destination should be the same
modulo text encoding, so ignore the legacy one.

Change-Id: I007151e3075a9ac879a486ec3b5fb8549435dbba
(cherry picked from commit b46956e73b6daff2578110c0395fd80150dc0b0b)
Reviewed-on: https://gerrit.libreoffice.org/10699
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2372a29..21708cc 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1450,7 +1450,14 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 setNeedSect();
 checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true);
 RTFSkipDestination aSkip(*this);
-switch (nKeyword)
+// special case \upr: ignore everything except nested \ud
+if (DESTINATION_UPR == m_aStates.top().nDestinationState
+&& RTF_UD != nKeyword)
+{
+m_aStates.top().nDestinationState = DESTINATION_SKIP;
+aSkip.setParsed(false);
+}
+else switch (nKeyword)
 {
 case RTF_RTF:
 break;
@@ -1845,11 +1852,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword 
nKeyword)
 m_aStates.top().nDestinationState = 
DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE;
 break;
 case RTF_TITLE:
-// \title inside \upr but outside \ud should be ignored.
-if (m_aStates.top().nDestinationState != DESTINATION_UPR)
-m_aStates.top().nDestinationState = DESTINATION_TITLE;
-else
-m_aStates.top().nDestinationState = DESTINATION_SKIP;
+m_aStates.top().nDestinationState = DESTINATION_TITLE;
 break;
 case RTF_SUBJECT:
 m_aStates.top().nDestinationState = DESTINATION_SUBJECT;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-08-05 Thread Michael Stahl
 writerfilter/source/dmapper/StyleSheetTable.cxx |   18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

New commits:
commit b3b4f0da07710ecfef6ee06345280fb6b77dc781
Author: Michael Stahl 
Date:   Mon Aug 4 17:00:50 2014 +0200

fdo#81993: Revert "Resolves: #i119464# Update default alignment ...

... value for docx [Sub]Title"

This reverts commit acc671ec74c874ffd22803bb2ee54a1f2c027155.

The commit is clearly unnecessary:

1) commit 3f9e7e72c53ecbe8ee1ab060f811cb41eadfc7e1
   appears to be a better fix for alignment

2) commit b95d203bc17c83ec0fe5139f519d53ed1d842d3a
   should have disabled the Center default in Writer already

Change-Id: Ib0cc60af037f12be0a1ab94ab32c743f7fca2b1d
(cherry picked from commit d4b96b45727314585d02394bb5a084393b647729)
Reviewed-on: https://gerrit.libreoffice.org/10733
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx 
b/writerfilter/source/dmapper/StyleSheetTable.cxx
index ed5ecbe..9e76b14 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1085,23 +1085,7 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr 
rFontTable )
 
xState->setPropertyToDefault(rPropNameSupplier.GetName( PROP_CHAR_PROP_HEIGHT   
 ));
 
xState->setPropertyToDefault(rPropNameSupplier.GetName( 
PROP_CHAR_PROP_HEIGHT_ASIAN  ));
 
xState->setPropertyToDefault(rPropNameSupplier.GetName( 
PROP_CHAR_PROP_HEIGHT_COMPLEX));
-}
-else if (sConvertedStyleName == "Title" || 
sConvertedStyleName == "Subtitle")
-{
-//set the default adjust for ParaStyle Title and 
Subtitle to left
-try
-{
-uno::Reference< beans::XPropertySet > xProp( 
xStyle, uno::UNO_QUERY );
-if( xProp.is() )
-{
-uno::Any aMSDefaultVal = uno::makeAny( 
(sal_Int16)style::ParagraphAdjust_LEFT );
-xProp->setPropertyValue( 
rPropNameSupplier.GetName( PROP_PARA_ADJUST), aMSDefaultVal );
-}
-}
-catch(...)
-{
-OSL_ENSURE( false, "Default ParaAdjust style 
property could not be set");
-}
+
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-06-17 Thread Michael Stahl
 writerfilter/source/rtftok/rtfsprm.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5d0552a34dbc34c840aaa7a3e5fb48cb247ac623
Author: Michael Stahl 
Date:   Tue Jun 17 22:58:57 2014 +0200

writerfilter: try to make tinderbox happy again

Change-Id: I445303e52fbfaa58e68c01970e21941537484506
(cherry picked from commit 31376a31d12a22d4870bbe4033dbbce18c13f07d)

diff --git a/writerfilter/source/rtftok/rtfsprm.cxx 
b/writerfilter/source/rtftok/rtfsprm.cxx
index 40b8fcc..1b0df46 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -149,7 +149,7 @@ static RTFValue::Pointer_t getDefaultSPRM(Id const id)
 return RTFValue::Pointer_t(new RTFValue(0));
 
 default:
-return 0;
+return RTFValue::Pointer_t();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-06-27 Thread Michael Stahl
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   41 -
 1 file changed, 27 insertions(+), 14 deletions(-)

New commits:
commit 35314e0a499602936df0062ae9e7ce074d39f801
Author: Michael Stahl 
Date:   Wed Jun 18 00:45:50 2014 +0200

writerfilter: RTF import: fix handling of associated char properties

These are all dependent on the active \lrtch \rtlch \loch \hich \dbch.

There does not appear to be a SPRM Id for CJK bold / italic / fontsize.

Change-Id: I055ac29700ccd3b32b02c3f7685629254a6c3fd6
(cherry picked from commit fc49c052dbdbb5ab3b0a02a13143705f769b9662)
Reviewed-on: https://gerrit.libreoffice.org/9915
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 9d9805f..d05ac5b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3368,10 +3368,11 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 switch (nKeyword)
 {
 case RTF_FS:
-nSprm = NS_ooxml::LN_EG_RPrBase_sz;
-break;
 case RTF_AFS:
-nSprm = NS_ooxml::LN_EG_RPrBase_szCs;
+nSprm = (m_aStates.top().isRightToLeft
+|| m_aStates.top().eRunType == RTFParserState::HICH)
+? NS_ooxml::LN_EG_RPrBase_szCs
+: NS_ooxml::LN_EG_RPrBase_sz;
 break;
 case RTF_ANIMTEXT:
 nSprm = NS_ooxml::LN_EG_RPrBase_effect;
@@ -3397,14 +3398,24 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, 
int nParam)
 switch (nKeyword)
 {
 case RTF_LANG:
-nSprm = NS_ooxml::LN_CT_Language_val;
+case RTF_ALANG:
+if (m_aStates.top().isRightToLeft || m_aStates.top().eRunType == 
RTFParserState::HICH)
+{
+nSprm = NS_ooxml::LN_CT_Language_bidi;
+}
+else if (m_aStates.top().eRunType == RTFParserState::DBCH)
+{
+nSprm = NS_ooxml::LN_CT_Language_eastAsia;
+}
+else
+{
+assert(m_aStates.top().eRunType == RTFParserState::LOCH);
+nSprm = NS_ooxml::LN_CT_Language_val;
+}
 break;
-case RTF_LANGFE:
+case RTF_LANGFE: // this one is always CJK apparently
 nSprm = NS_ooxml::LN_CT_Language_eastAsia;
 break;
-case RTF_ALANG:
-nSprm = NS_ooxml::LN_CT_Language_bidi;
-break;
 default:
 break;
 }
@@ -4608,16 +4619,18 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword 
nKeyword, bool bParam, int nParam
 switch (nKeyword)
 {
 case RTF_B:
-nSprm = NS_ooxml::LN_EG_RPrBase_b;
-break;
 case RTF_AB:
-nSprm = NS_ooxml::LN_EG_RPrBase_bCs;
+nSprm = (m_aStates.top().isRightToLeft
+|| m_aStates.top().eRunType == RTFParserState::HICH)
+? NS_ooxml::LN_EG_RPrBase_bCs
+: NS_ooxml::LN_EG_RPrBase_b;
 break;
 case RTF_I:
-nSprm = NS_ooxml::LN_EG_RPrBase_i;
-break;
 case RTF_AI:
-nSprm = NS_ooxml::LN_EG_RPrBase_iCs;
+nSprm = (m_aStates.top().isRightToLeft
+|| m_aStates.top().eRunType == RTFParserState::HICH)
+? NS_ooxml::LN_EG_RPrBase_iCs
+: NS_ooxml::LN_EG_RPrBase_i;
 break;
 case RTF_OUTL:
 nSprm = NS_ooxml::LN_EG_RPrBase_outline;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-07-05 Thread Michael Stahl
 writerfilter/source/resourcemodel/Fraction.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit e255e5eedf9263b4a98bdf74bcbbc25a52f09bec
Author: Michael Stahl 
Date:   Fri Jul 4 00:29:55 2014 +0200

fdo#76803: writerfilter: fix image wrap polygon import again

The division in Fraction::init() should be a signed one, to prevent a
change in sign, e.g., -220869/9 = +477194047.

(regression from f8307e5ae11e8235fa1fb88ed52625bf9c650dc2)

Change-Id: Icbbd1721144ff42c53ae71312641bd601ba60762
(cherry picked from commit dcbac37efebb9877a72f7c9914b63d60f46a5656)
Reviewed-on: https://gerrit.libreoffice.org/10081
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/resourcemodel/Fraction.cxx 
b/writerfilter/source/resourcemodel/Fraction.cxx
index 1f24bb3..ba76985 100644
--- a/writerfilter/source/resourcemodel/Fraction.cxx
+++ b/writerfilter/source/resourcemodel/Fraction.cxx
@@ -79,9 +79,11 @@ Fraction::~Fraction()
 
 void Fraction::init(sal_Int32 nNumerator, sal_Int32 nDenominator)
 {
-sal_uInt32 nGCD = gcd(abs(nNumerator), abs(nDenominator));
+// fdo#41068 pass non-negative numbers to gcd
+sal_Int32 const nGCD = gcd(abs(nNumerator), abs(nDenominator));
 
-mnNumerator = nNumerator/ nGCD;
+// fdo#76803 do signed division
+mnNumerator = nNumerator / nGCD;
 mnDenominator = nDenominator / nGCD;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-07-10 Thread Matúš Kukan
 writerfilter/source/dmapper/ConversionHelper.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 6d21e5425690732a3254722add7023ace4d3c537
Author: Matúš Kukan 
Date:   Wed Jul 9 14:25:04 2014 +0200

Fix ignoring large twips values like MSO does (cp#187)

which was introduced in 10b4da63e3143108ba75891e9e98fdaa2f7953ab.

Since 1e47614cdb84b018a22a334dad0cdd9f0f53892c, only
convertTwipToMM100Unsigned() ignores large values, which presumably
was not the intention. At least commit message suggests so.

So, move the check back to convertTwipToMM100().

Change-Id: I17040f1987e24789b9de39a837d9f7ecaed520fb
(cherry picked from commit 4d1621136c464b462a598571ecdcfe2ae119d8c7)
Reviewed-on: https://gerrit.libreoffice.org/10177
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx 
b/writerfilter/source/dmapper/ConversionHelper.cxx
index af6ea70..febe4b0 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -228,6 +228,10 @@ OUString ConvertMSFormatStringToSO(
 
 sal_Int32 convertTwipToMM100(sal_Int32 _t)
 {
+// It appears that MSO handles large twip values specially, probably 
legacy 16bit handling,
+// anything that's bigger than 32767 appears to be simply ignored.
+if( _t >= 0x8000 )
+return 0;
 return ::convertTwipToMm100( _t );
 }
 
@@ -235,11 +239,7 @@ sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t)
 {
 if( _t < 0 )
 return 0;
-// It appears that MSO handles large twip values specially, probably 
legacy 16bit handling,
-// anything that's bigger than 32767 appears to be simply ignored.
-if( _t >= 0x8000 )
-return 0;
-return ::convertTwipToMm100( _t );
+return convertTwipToMM100( _t );
 }
 
 sal_Int32 convertEMUToMM100(sal_Int32 _t)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-10-01 Thread Caolán McNamara
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3ebb09e0e7a0ca78e535d3c6721c2b87da37bd9d
Author: Caolán McNamara 
Date:   Sat Sep 27 20:38:24 2014 +0100

Resolves: fdo#79130 Crash in DomainMapper_Impl::CloseFieldCommand

Change-Id: Ia59e0c79ec7f2066891b78657559f41eaeb80a09
(cherry picked from commit a392a1deb0bb55f39f0232f9b3df8ad9ac9062af)
Reviewed-on: https://gerrit.libreoffice.org/11665
Reviewed-by: Miklos Vajna 
Tested-by: Miklos Vajna 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d873892..075a3fa 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3288,7 +3288,7 @@ void DomainMapper_Impl::CloseFieldCommand()
 dmapper_logger->element("closeFieldCommand");
 #endif
 
-FieldContextPtr pContext = m_aFieldStack.top();
+FieldContextPtr pContext = m_aFieldStack.empty() ? NULL : 
m_aFieldStack.top();
 OSL_ENSURE( pContext.get(), "no field context available");
 if( pContext.get() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-10-02 Thread Caolán McNamara
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit b1be18f0e36bac7a82edc8f0b30de6127ff1352b
Author: Caolán McNamara 
Date:   Mon Sep 22 13:56:05 2014 +0100

Related: fdo#37691 \shptxt ... \jpegblip

text shape with jpeg data, should we throw away
the text shape here or keep it ?

Change-Id: I9e4463b5863bf68cdcd18ea5d1f6c831a0de8ec9
(cherry picked from commit cfbcce701cd6dc3af6086428399136efef33ff59)
Signed-off-by: Michael Stahl 

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 62a7794..9f35f26 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -789,9 +789,14 @@ int RTFDocumentImpl::resolvePict(bool const bInline,
 if (xShape.is())
 {
 uno::Reference xSI(xShape, uno::UNO_QUERY_THROW);
-
assert(xSI->supportsService("com.sun.star.drawing.GraphicObjectShape"));
+if (!xSI->supportsService("com.sun.star.drawing.GraphicObjectShape"))
+{
+//fdo37691-1.rtf
+SAL_WARN("writerfilter.rtf", "cannot set graphic on existing 
shape, creating a new GraphicObjectShape");
+xShape.set(NULL);
+}
 }
-else
+if (!xShape.is())
 {
 if (m_xModelFactory.is())
 xShape.set(m_xModelFactory->createInstance(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - writerfilter/source

2014-10-03 Thread Jan-Marek Glogowski
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5401e1b618a59c4a4df7fa073b4a5f481bd1ede7
Author: Jan-Marek Glogowski 
Date:   Fri Oct 3 01:42:13 2014 +0200

Don't assign NULL to boost::shared_ptr

This is already done by the constructor.

Fixes the libreoffic-4-3 build on Ubuntu 12.04.

Change-Id: I7bbec905c0d1efb5670c61c975f36f2e37a74cac
Reviewed-on: https://gerrit.libreoffice.org/11778
Reviewed-by: David Tardon 
Tested-by: David Tardon 

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 075a3fa..23b976b 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3288,7 +3288,8 @@ void DomainMapper_Impl::CloseFieldCommand()
 dmapper_logger->element("closeFieldCommand");
 #endif
 
-FieldContextPtr pContext = m_aFieldStack.empty() ? NULL : 
m_aFieldStack.top();
+FieldContextPtr pContext;
+if (!m_aFieldStack.empty()) pContext = m_aFieldStack.top();
 OSL_ENSURE( pContext.get(), "no field context available");
 if( pContext.get() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits