[Libreoffice-commits] core.git: Changes to 'refs/changes/45/9545/4'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/45/9545/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/74/9374/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/97/10897/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/97/10897/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/74/9374/5'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/74/9374/4'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/74/9774/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/74/9774/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/86/10486/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/86/10486/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/86/10486/2'
___ 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' - sw/qa vcl/generic
sw/qa/core/data/ooxml/pass/fdo78906.docx |binary vcl/generic/glyphs/scrptrun.cxx |9 - 2 files changed, 8 insertions(+), 1 deletion(-) New commits: commit fbb9bdef45d3a013b5027acc1ceb7faa77f531a4 Author: Umesh Kadam Date: Thu May 29 12:59:13 2014 +0530 fdo#78906 (+dup fdo#82484): File crashes while opening. Handled a memory corruption. Cherry-picked from 14ce4b337232f8fb21cc67e7a2844a7de81dfc4c Change-Id: I195d17bcd0a9a86bcc96cc7ad14f1d5f2908cf8c Reviewed-on: https://gerrit.libreoffice.org/9545 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/10897 Reviewed-by: David Tardon Tested-by: David Tardon diff --git a/sw/qa/core/data/ooxml/pass/fdo78906.docx b/sw/qa/core/data/ooxml/pass/fdo78906.docx new file mode 100644 index 000..1a6c6ea Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo78906.docx differ diff --git a/vcl/generic/glyphs/scrptrun.cxx b/vcl/generic/glyphs/scrptrun.cxx index 9e8eef0..f72d296 100644 --- a/vcl/generic/glyphs/scrptrun.cxx +++ b/vcl/generic/glyphs/scrptrun.cxx @@ -207,7 +207,14 @@ UBool ScriptRun::next() // pop it from the stack if (pairIndex >= 0 && (pairIndex & 1) != 0 && parenSP >= 0) { parenSP -= 1; -startSP -= 1; +/* decrement startSP only if it is >= 0, + decrementing it unnecessarily will lead to memory corruption + while processing the above while block. + e.g. startSP = -4 , parenSP = -1 +*/ +if (startSP >= 0) { +startSP -= 1; +} } } else { // if the run broke on a surrogate pair, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: oox/source sw/qa
oox/source/vml/vmlshape.cxx| 16 sw/qa/extras/ooxmlimport/data/WordArt.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 15 +++ 3 files changed, 31 insertions(+) New commits: commit ded5b1ecdef42fab84fa57ab504b4cc006a4df91 Author: Umesh Kadam Date: Fri Jul 18 13:02:19 2014 +0530 fdo#78301 : Size of word-arts change during import. - Do not resize the fallback geometry for Word-Arts(VML), since the overlay geometry is constructed using the properties of the fallback geometry. - The resize autoshape to fit text attr of FontWork/Word-Art should always be false for the fallback geometry(the SdrObject). Change-Id: If8badb382c525875a07a0a9e6268cec036739001 Reviewed-on: https://gerrit.libreoffice.org/10486 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index f98c717..842a65c 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -58,6 +58,9 @@ #include "oox/vml/vmltextbox.hxx" #include "oox/core/xmlfilterbase.hxx" #include "oox/helper/containerhelper.hxx" +#include "svx/EnhancedCustomShapeTypeNames.hxx" +#include +#include using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Any; @@ -534,6 +537,19 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes } Reference< XShape > xShape = mrDrawing.createAndInsertXShape( maService, rxShapes, aShapeRect ); +SdrObject* pShape = GetSdrObjectFromXShape( xShape ); +if( pShape && getShapeType() >= 0 ) +{ +OUString aShapeType; +aShapeType = EnhancedCustomShapeTypeNames::Get( static_cast< MSO_SPT >(getShapeType()) ); +//The resize autoshape to fit text attr of FontWork/Word-Art should always be false +//for the fallback geometry. +if(aShapeType.startsWith("fontwork")) +{ +pShape->SetMergedItem(SdrTextAutoGrowHeightItem(false)); +pShape->SetMergedItem(SdrTextAutoGrowWidthItem(false)); +} +} convertShapeProperties( xShape ); // Handle left/right/top/bottom wrap distance. diff --git a/sw/qa/extras/ooxmlimport/data/WordArt.docx b/sw/qa/extras/ooxmlimport/data/WordArt.docx new file mode 100644 index 000..3960a15 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/WordArt.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index eca47da..371b303 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -982,6 +982,21 @@ DECLARE_OOXMLIMPORT_TEST(testN792778, "n792778.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(11684), xInnerShape->getPosition().Y); } +DECLARE_OOXMLIMPORT_TEST(testWordArtResizing, "WordArt.docx") +{ +/* The Word-Arts and watermarks were getting resized automatically, It was as if they were + getting glued to the fallback geometry(the sdrObj) and were getting bound to the font size. + The test-case esures the original height and width of the word-art is not changed while importing*/ + +uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xDrawPage(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); + +uno::Reference xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(sal_Int32(10105), xShape->getSize().Width); +CPPUNIT_ASSERT_EQUAL(sal_Int32(4755), xShape->getSize().Height); +} + DECLARE_OOXMLIMPORT_TEST(testGroupshapeLine, "groupshape-line.docx") { /* ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/qa writerfilter/source
sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx |binary sw/qa/extras/ooxmlimport/data/fdo78904.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 11 ++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 23 -- 4 files changed, 28 insertions(+), 6 deletions(-) New commits: commit f11ec770f360c33953efa989532ff21c28dd38df Author: Umesh Kadam Date: Fri Jun 13 17:26:19 2014 +0530 fdo#78904 : LO hangs while saving the document. - In case of framePr attributes being omitted in original xml, LO defaults such attributes to incorrect values. - Correcting these values in this fix. - This fix stops LO from getting hang while saving the document, the actual fix needs to be somewhere in the table layout. We need to restrict the frame from being considered as part of the table as MSO does not allow frame to be part of a table. Reviewed-on: https://gerrit.libreoffice.org/9774 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna (cherry picked from commit 75fc9e669f209472ec6a282848166d96d02d84d9) This also fixes fdo#79391, but not compeletely on this branch. Change-Id: I4c35f7eff6ca1122901f5667fc26b849df527f60 Signed-off-by: Michael Stahl diff --git a/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx b/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx new file mode 100644 index 000..dce50f3 Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo78904.docx b/sw/qa/extras/ooxmlimport/data/fdo78904.docx new file mode 100644 index 000..c171ae2 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo78904.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 26e0e36..0035e7b 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1131,6 +1131,17 @@ DECLARE_OOXMLIMPORT_TEST(testToolsLineNumbering, "tools-line-numbering.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nValue); } +DECLARE_OOXMLIMPORT_TEST(testfdo78904, "fdo78904.docx") +{ +uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); +if (xIndexAccess->getCount()) +{ +uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(0)), getProperty(xFrame, "HoriOrientPosition")); +} +} + DECLARE_OOXMLIMPORT_TEST(testFdo60922, "fdo60922.docx") { // This was 0, not 100, due to wrong import of w:position w:val="0" diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 3bbd965..1d5c199 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -775,6 +776,8 @@ void lcl_AddRangeAndStyle( //define some default frame width - 0cm ATM: this allow the frame to be wrapped around the text #define DEFAULT_FRAME_MIN_WIDTH 0 +#define DEFAULT_FRAME_MIN_HEIGHT 0 +#define DEFAULT_VALUE 0 void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) { @@ -826,7 +829,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) pFrameProperties[1].Value <<= rAppendContext.pLastParagraphProperties->Geth() > 0 ? rAppendContext.pLastParagraphProperties->Geth() : -pStyleProperties->Geth(); +pStyleProperties->Geth() > 0 ? pStyleProperties->Geth() : DEFAULT_FRAME_MIN_HEIGHT; pFrameProperties[2].Value <<= sal_Int16( rAppendContext.pLastParagraphProperties->GethRule() >= 0 ? @@ -841,13 +844,17 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) pStyleProperties->GetxAlign() >= 0 ? pStyleProperties->GetxAlign() : text::HoriOrientation::NONE ); pFrameProperties[4].Value <<= nHoriOrient; +//set a non negative default value pFrameProperties[5].Value <<= rAppendContext.pLastParagraphProperties->IsxValid() ? -rAppendContext.pLastParagraphProperties->Getx() : pStyleProperties->Getx(); +rAppendContext.pLastParagraphProperties->Getx() : +pStyleProperties->IsxValid() ? pStyleProperties->Getx() : DEFAULT_VALUE; + +//Default the anchor in case FramePr_hAnchor is missing ECMA 17.3.1.11 pFrameProperties[6].Value <<= sal_Int16(
[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source
sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx |binary sw/qa/extras/ooxmlimport/data/fdo78904.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 11 ++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 23 -- 4 files changed, 28 insertions(+), 6 deletions(-) New commits: commit 77ab92bfae9cd32f50e993e0fd8cdec4e6e4a2ff Author: Umesh Kadam Date: Fri Jun 13 17:26:19 2014 +0530 fdo#78904 : LO hangs while saving the document. - In case of framePr attributes being omitted in original xml, LO defaults such attributes to incorrect values. - Correcting these values in this fix. - This fix stops LO from getting hang while saving the document, the actual fix needs to be somewhere in the table layout. We need to restrict the frame from being considered as part of the table as MSO does not allow frame to be part of a table. Reviewed-on: https://gerrit.libreoffice.org/9774 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna (cherry picked from commit 75fc9e669f209472ec6a282848166d96d02d84d9) This also fixes fdo#79391. Change-Id: I4c35f7eff6ca1122901f5667fc26b849df527f60 Signed-off-by: Michael Stahl diff --git a/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx b/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx new file mode 100644 index 000..dce50f3 Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo78904.docx b/sw/qa/extras/ooxmlimport/data/fdo78904.docx new file mode 100644 index 000..c171ae2 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo78904.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index de1e641..1dc6161 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1175,6 +1175,17 @@ DECLARE_OOXMLIMPORT_TEST(testToolsLineNumbering, "tools-line-numbering.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nValue); } +DECLARE_OOXMLIMPORT_TEST(testfdo78904, "fdo78904.docx") +{ +uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); +if (xIndexAccess->getCount()) +{ +uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(0)), getProperty(xFrame, "HoriOrientPosition")); +} +} + DECLARE_OOXMLIMPORT_TEST(testFdo60922, "fdo60922.docx") { // This was 0, not 100, due to wrong import of w:position w:val="0" diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index bdad3b1..f6dc73e 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -807,6 +808,8 @@ void lcl_AddRangeAndStyle( //define some default frame width - 0cm ATM: this allow the frame to be wrapped around the text #define DEFAULT_FRAME_MIN_WIDTH 0 +#define DEFAULT_FRAME_MIN_HEIGHT 0 +#define DEFAULT_VALUE 0 void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) { @@ -860,7 +863,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) pFrameProperties[1].Value <<= rAppendContext.pLastParagraphProperties->Geth() > 0 ? rAppendContext.pLastParagraphProperties->Geth() : -pStyleProperties->Geth(); +pStyleProperties->Geth() > 0 ? pStyleProperties->Geth() : DEFAULT_FRAME_MIN_HEIGHT; pFrameProperties[2].Value <<= sal_Int16( rAppendContext.pLastParagraphProperties->GethRule() >= 0 ? @@ -875,13 +878,17 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) pStyleProperties->GetxAlign() >= 0 ? pStyleProperties->GetxAlign() : text::HoriOrientation::NONE ); pFrameProperties[4].Value <<= nHoriOrient; +//set a non negative default value pFrameProperties[5].Value <<= rAppendContext.pLastParagraphProperties->IsxValid() ? -rAppendContext.pLastParagraphProperties->Getx() : pStyleProperties->Getx(); +rAppendContext.pLastParagraphProperties->Getx() : +pStyleProperties->IsxValid() ? pStyleProperties->Getx() : DEFAULT_VALUE; + +//Default the anchor in case FramePr_hAnchor is missing ECMA 17.3.1.11 pFrameProperties[6].Value <<= sal_Int16(
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx |binary sw/qa/extras/ooxmlimport/data/fdo78904.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 11 ++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 23 -- 4 files changed, 28 insertions(+), 6 deletions(-) New commits: commit 75fc9e669f209472ec6a282848166d96d02d84d9 Author: Umesh Kadam Date: Fri Jun 13 17:26:19 2014 +0530 fdo#78904 : LO hangs while saving the document. - In case of framePr attributes being omitted in original xml, LO defaults such attributes to incorrect values. - Correcting these values in this fix. - This fix stops LO from getting hang while saving the document, the actual fix needs to be somewhere in the table layout. We need to restrict the frame from being considered as part of the table as MSO does not allow frame to be part of a table. Change-Id: I4c35f7eff6ca1122901f5667fc26b849df527f60 Reviewed-on: https://gerrit.libreoffice.org/9774 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx b/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx new file mode 100644 index 000..dce50f3 Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo78904_fileHang.docx differ diff --git a/sw/qa/extras/ooxmlimport/data/fdo78904.docx b/sw/qa/extras/ooxmlimport/data/fdo78904.docx new file mode 100644 index 000..c171ae2 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo78904.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index a2c4997..d1b7730 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1175,6 +1175,17 @@ DECLARE_OOXMLIMPORT_TEST(testToolsLineNumbering, "tools-line-numbering.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nValue); } +DECLARE_OOXMLIMPORT_TEST(testfdo78904, "fdo78904.docx") +{ +uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); +if (xIndexAccess->getCount()) +{ +uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(sal_Int32(EMU_TO_MM100(0)), getProperty(xFrame, "HoriOrientPosition")); +} +} + DECLARE_OOXMLIMPORT_TEST(testFdo60922, "fdo60922.docx") { // This was 0, not 100, due to wrong import of w:position w:val="0" diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index cbf7ea3..8b1ea55 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -772,6 +773,8 @@ void lcl_AddRangeAndStyle( //define some default frame width - 0cm ATM: this allow the frame to be wrapped around the text #define DEFAULT_FRAME_MIN_WIDTH 0 +#define DEFAULT_FRAME_MIN_HEIGHT 0 +#define DEFAULT_VALUE 0 void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) { @@ -826,7 +829,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) pFrameProperties[1].Value <<= rAppendContext.pLastParagraphProperties->Geth() > 0 ? rAppendContext.pLastParagraphProperties->Geth() : -pStyleProperties->Geth(); +pStyleProperties->Geth() > 0 ? pStyleProperties->Geth() : DEFAULT_FRAME_MIN_HEIGHT; pFrameProperties[2].Value <<= sal_Int16( rAppendContext.pLastParagraphProperties->GethRule() >= 0 ? @@ -841,13 +844,17 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) pStyleProperties->GetxAlign() >= 0 ? pStyleProperties->GetxAlign() : text::HoriOrientation::NONE ); pFrameProperties[4].Value <<= nHoriOrient; +//set a non negative default value pFrameProperties[5].Value <<= rAppendContext.pLastParagraphProperties->IsxValid() ? -rAppendContext.pLastParagraphProperties->Getx() : pStyleProperties->Getx(); +rAppendContext.pLastParagraphProperties->Getx() : +pStyleProperties->IsxValid() ? pStyleProperties->Getx() : DEFAULT_VALUE; + +//Default the anchor in case FramePr_hAnchor is missing ECMA 17.3.1.11 pFrameProperties[6].Value <<= sal_Int16( rAppendContext.pLastParagraphProperties->GethAnchor() >= 0 ? rAppendContext.pLastParagraphProperties->GethAnchor() : -p
[Libreoffice-commits] core.git: sw/qa vcl/generic
sw/qa/core/data/ooxml/pass/fdo78906.docx |binary vcl/generic/glyphs/scrptrun.cxx |9 - 2 files changed, 8 insertions(+), 1 deletion(-) New commits: commit 14ce4b337232f8fb21cc67e7a2844a7de81dfc4c Author: Umesh Kadam Date: Thu May 29 12:59:13 2014 +0530 fdo#78906 : File crashes while opening. Handled a memory corruption. Change-Id: I195d17bcd0a9a86bcc96cc7ad14f1d5f2908cf8c Reviewed-on: https://gerrit.libreoffice.org/9545 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/core/data/ooxml/pass/fdo78906.docx b/sw/qa/core/data/ooxml/pass/fdo78906.docx new file mode 100644 index 000..1a6c6ea Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/fdo78906.docx differ diff --git a/vcl/generic/glyphs/scrptrun.cxx b/vcl/generic/glyphs/scrptrun.cxx index 9e8eef0..f72d296 100644 --- a/vcl/generic/glyphs/scrptrun.cxx +++ b/vcl/generic/glyphs/scrptrun.cxx @@ -207,7 +207,14 @@ UBool ScriptRun::next() // pop it from the stack if (pairIndex >= 0 && (pairIndex & 1) != 0 && parenSP >= 0) { parenSP -= 1; -startSP -= 1; +/* decrement startSP only if it is >= 0, + decrementing it unnecessarily will lead to memory corruption + while processing the above while block. + e.g. startSP = -4 , parenSP = -1 +*/ +if (startSP >= 0) { +startSP -= 1; +} } } else { // if the run broke on a surrogate pair, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/ShapeOverlappingWithSdt.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |9 + sw/source/filter/ww8/attributeoutputbase.hxx |9 + sw/source/filter/ww8/docxattributeoutput.cxx | 69 +++ sw/source/filter/ww8/docxattributeoutput.hxx |6 + sw/source/filter/ww8/wrtw8nds.cxx | 78 +++-- sw/source/filter/ww8/wrtww8.hxx| 13 ++ 7 files changed, 174 insertions(+), 10 deletions(-) New commits: commit 80fd9fb7209cfd5c0622ee99d59e42e6db32f021 Author: Umesh Kadam Date: Thu May 15 23:02:34 2014 +0530 fdo#78333 : SdtContent and a Shape overlapping causes corruption - Normally if there is a case where text/shape is overlapped with (another) shape then LO used to write the text and the AlternateContent in the same run. - This is supported in MSO and there is no visual difference. - But in case if the SdtContent(with text) is overlapped with the Shape then LO processes sdtContent as a text and ends up putting the alternateContent and the text in a single run. Ultimately it includes the entire run in a SdtContent, which is incorrect. - The fix checks for the aforementioned scenario and puts them in a different run and also restricts the sdtContent being written in an invalid AlternateContent. Change-Id: I36f4cdb1b583523dd8f717ae094bdf09c7a61f62 Reviewed-on: https://gerrit.libreoffice.org/9374 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sw/qa/extras/ooxmlexport/data/ShapeOverlappingWithSdt.docx b/sw/qa/extras/ooxmlexport/data/ShapeOverlappingWithSdt.docx new file mode 100644 index 000..e1ec074 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/ShapeOverlappingWithSdt.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 7a69e67..16d13a2 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2052,6 +2052,15 @@ DECLARE_OOXMLEXPORT_TEST(testFileOpenInputOutputError,"floatingtbl_with_formula. assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal"); } +DECLARE_OOXMLEXPORT_TEST(testSdtAndShapeOverlapping,"ShapeOverlappingWithSdt.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[1]/mc:AlternateContent"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt[1]/w:sdtContent[1]/w:r[1]/w:t[1]"); +} + DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx") { uno::Reference xShape = getShape(1); diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 5a25c86..d2df9c0 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -309,6 +309,15 @@ public: /// Has different headers/footers for the title page. virtual void SectionTitlePage() = 0; +/// If the node has an anchor linked. +virtual void SetAnchorIsLinkedToNode( bool /*bAnchorLinkedToNode*/){}; + +/// Is processing of fly postponed ? +virtual bool IsFlyProcessingPostponed(){ return false; }; + +/// Reset the flag for FlyProcessing +virtual void ResetFlyProcessingFlag(){}; + /// Description of the page borders. virtual void SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* pFirstPageFmt ) = 0; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 96602c3..fb5933d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -287,6 +287,20 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText m_bIsFirstParagraph = false; } +static void lcl_deleteAndResetTheLists( ::sax_fastparser::FastAttributeList* &pSdtPrTokenChildren, ::sax_fastparser::FastAttributeList* &pSdtPrDataBindingAttrs) +{ +if( pSdtPrTokenChildren ) +{ +delete pSdtPrTokenChildren ; +pSdtPrTokenChildren = NULL; +} +if( pSdtPrDataBindingAttrs ) +{ +delete pSdtPrDataBindingAttrs; +pSdtPrDataBindingAttrs = NULL; +} +} + void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) { // write the paragraph properties + the run, already in the correct order @@ -382,8 +396,16 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT } m_pSerializer->endElementNS( XML_w, XML_p ); +if( !m_bAnchorLinkedToNode ) +WriteSdtBlock( m_nParagraphSdtPrToken, m_pParagraphSdtPrTokenChildren, m_p