cui/source/tabpages/chardlg.cxx | 20 +++ download.lst | 4 external/libcdr/UnpackedTarball_libcdr.mk | 4 external/libcdr/libcdr-wpx_seek_end.patch.1 | 14 -- reportdesign/source/ui/report/ViewsWindow.cxx | 13 ++ sc/source/filter/excel/xestream.cxx | 2 svtools/source/control/ctrlbox.cxx | 9 + svx/source/dialog/langbox.cxx | 4 svx/source/smarttags/SmartTagMgr.cxx | 2 sw/qa/extras/rtfimport/data/fdo74823.rtf | 32 ++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 10 + sw/qa/extras/ww8import/data/bnc821208.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 3 sw/source/core/ole/ndole.cxx | 17 +-- sw/source/core/text/inftxt.cxx | 5 sw/source/core/text/inftxt.hxx | 2 sw/source/core/text/itrform2.cxx | 48 ++++++++- sw/source/core/text/porfld.cxx | 6 - sw/source/core/text/porfld.hxx | 15 ++ sw/source/core/text/portxt.cxx | 82 ++-------------- sw/source/core/text/portxt.hxx | 9 - sw/source/core/txtnode/thints.cxx | 2 sw/uiconfig/swriter/ui/outlinenumbering.ui | 2 vcl/qa/cppunit/graphicfilter/data/wmf/pass/noheader.wmf |binary vcl/source/gdi/dibtools.cxx | 4 vcl/source/gdi/outdev3.cxx | 3 vcl/source/gdi/pdfwriter_impl.cxx | 19 +-- vcl/source/gdi/pdfwriter_impl.hxx | 4 writerfilter/source/rtftok/rtfdocumentimpl.cxx | 53 ++++++++-- writerfilter/source/rtftok/rtfdocumentimpl.hxx | 8 + xmloff/source/style/bordrhdl.cxx | 51 +++------ xmloff/source/style/xmlnumfi.cxx | 9 + 32 files changed, 284 insertions(+), 172 deletions(-)
New commits: commit 902a3b030adf899699fc46d1a857734886eaceb4 Author: Laurent Balland-Poirier <laurent.balland-poir...@laposte.net> Date: Sun Apr 6 19:30:46 2014 +0200 fdo#75772 Correct name of Outline Numbering dialog Change-Id: I14ffe5a9135f0fc37f839a386f4dc63c5831b9d4 Reviewed-on: https://gerrit.libreoffice.org/8875 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/uiconfig/swriter/ui/outlinenumbering.ui b/sw/uiconfig/swriter/ui/outlinenumbering.ui index 60dbfe7..d90a99a 100644 --- a/sw/uiconfig/swriter/ui/outlinenumbering.ui +++ b/sw/uiconfig/swriter/ui/outlinenumbering.ui @@ -4,7 +4,7 @@ <object class="GtkDialog" id="OutlineNumberingDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> - <property name="title" translatable="yes">Character</property> + <property name="title" translatable="yes">Outline Numbering</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> commit 39d8fd7b2d1b3496354bab840b2da1c937a4c079 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sat Apr 5 15:38:18 2014 +0200 fdo#74823 RTF import: work around wrong table column width on invalid input This scenario is not a valid one, Word doesn't handle it, either -- but the old LO 3.4 parser did. So add minimal support for it to avoid the regression. (cherry picked from commit 0a215b9a980e68f899ad548f780bbe5a1fec8732) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Icc2e8d3bf314e9cadda57956668033aa6d092457 Reviewed-on: https://gerrit.libreoffice.org/8871 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/rtfimport/data/fdo74823.rtf b/sw/qa/extras/rtfimport/data/fdo74823.rtf new file mode 100644 index 0000000..709e375 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo74823.rtf @@ -0,0 +1,32 @@ +{\rtf1 +\cellx2500 +\cellx5000 +\cellx5500 +\cellx6000 +\cellx6500 +\cellx7000 +\cellx10200 +\intbl +A1\cell +B1\cell +C1\cell +D1\cell +E1\cell +F1\cell +G1\cell +\trowd +\row +\cellx2500 +\cellx5000 +\cellx5500 +\cellx6000 +\cellx6500 +\cellx7000 +\cellx10200 +\intbl +A2\cell +\trowd +\intbl +\cell C2\cell\cell\cell\cell\cell \par\row +\pard\plain \par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 8d24829..7961519 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1605,6 +1605,16 @@ DECLARE_RTFIMPORT_TEST(testDprectAnchor, "dprect-anchor.rtf") CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType")); } +DECLARE_RTFIMPORT_TEST(testFdo74823, "fdo74823.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + // Cell width of C2 was too large / column separator being 3749 too small (e.g. not set, around 3/7 of total width) + uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int16(5391), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[2].Position); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 5078491..4bf522f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -255,6 +255,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x m_nInheritingCells(0), m_nNestedCurrentCellX(0), m_nTopLevelCurrentCellX(0), + m_nBackupTopLevelCurrentCellX(0), m_aTableBufferStack(1), // create top-level buffer already m_aSuperBuffer(), m_bHasFootnote(false), @@ -2050,6 +2051,15 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) break; case RTF_ROW: { + bool bRestored = false; + // Ending a row, but no cells defined? + // See if there was an invalid table row reset, so we can restore cell infos to help invalid documents. + if (!m_nTopLevelCurrentCellX && m_nBackupTopLevelCurrentCellX) + { + restoreTableRowProperties(); + bRestored = true; + } + // If the right edge of the last cell (row width) is smaller than the width of some other row, mimic WW8TabDesc::CalcDefaults(): add a fake cell. const int MINLAY = 23; // sw/inc/swtypes.hxx, minimal possible size of frames. if ((m_nCellxMax - m_nTopLevelCurrentCellX) >= MINLAY) @@ -2104,6 +2114,11 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) m_bNeedFinalPar = true; m_aTableBufferStack.back().clear(); m_nTopLevelCells = 0; + + if (bRestored) + // We restored cell definitions, clear these now. + // This is necessary, as later cell definitions want to overwrite the restored ones. + resetTableRowProperties(); } break; case RTF_COLUMN: @@ -2196,6 +2211,34 @@ bool lcl_findPropertyName(const std::vector<beans::PropertyValue>& rProperties, return false; } +void RTFDocumentImpl::backupTableRowProperties() +{ + if (m_nTopLevelCurrentCellX) + { + m_aBackupTableRowSprms = m_aStates.top().aTableRowSprms; + m_aBackupTableRowAttributes = m_aStates.top().aTableRowAttributes; + m_nBackupTopLevelCurrentCellX = m_nTopLevelCurrentCellX; + } +} + +void RTFDocumentImpl::restoreTableRowProperties() +{ + m_aStates.top().aTableRowSprms = m_aBackupTableRowSprms; + m_aStates.top().aTableRowAttributes = m_aBackupTableRowAttributes; + m_nTopLevelCurrentCellX = m_nBackupTopLevelCurrentCellX; +} + +void RTFDocumentImpl::resetTableRowProperties() +{ + m_aStates.top().aTableRowSprms = m_aDefaultState.aTableRowSprms; + m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TblGridBase_gridCol, RTFValue::Pointer_t(new RTFValue(-1)), false); + m_aStates.top().aTableRowAttributes = m_aDefaultState.aTableRowAttributes; + if (DESTINATION_NESTEDTABLEPROPERTIES == m_aStates.top().nDestinationState) + m_nNestedCurrentCellX = 0; + else + m_nTopLevelCurrentCellX = 0; +} + int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) { setNeedSect(); @@ -2488,13 +2531,9 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) break; case RTF_TROWD: { - m_aStates.top().aTableRowSprms = m_aDefaultState.aTableRowSprms; - m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TblGridBase_gridCol, RTFValue::Pointer_t(new RTFValue(-1)), false); - m_aStates.top().aTableRowAttributes = m_aDefaultState.aTableRowAttributes; - if (DESTINATION_NESTEDTABLEPROPERTIES == m_aStates.top().nDestinationState) - m_nNestedCurrentCellX = 0; - else - m_nTopLevelCurrentCellX = 0; + // Back these up, in case later we still need this info. + backupTableRowProperties(); + resetTableRowProperties(); // In case the table definition is in the middle of the row // (invalid), make sure table definition is emitted. m_bNeedPap = true; diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index fa1f3d6..8c8edcf 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -404,6 +404,9 @@ namespace writerfilter { void checkUnicode(bool bUnicode, bool bHex); /// If we need a final section break at the end of the document. void setNeedSect(bool bNeedSect = true); + void resetTableRowProperties(); + void backupTableRowProperties(); + void restoreTableRowProperties(); uno::Reference<uno::XComponentContext> const& m_xContext; uno::Reference<io::XInputStream> const& m_xInputStream; @@ -467,6 +470,11 @@ namespace writerfilter { /// Current cellx value (top-level table) int m_nTopLevelCurrentCellX; + // Backup of what \trowd clears, to work around invalid input. + RTFSprms m_aBackupTableRowSprms; + RTFSprms m_aBackupTableRowAttributes; + int m_nBackupTopLevelCurrentCellX; + /// Buffered table cells, till cell definitions are not reached. /// for nested table, one buffer per table level std::deque< RTFBuffer_t > m_aTableBufferStack; commit 0771cfd06828a315628c3b566aab281ae236ab60 Author: Michael Stahl <mst...@redhat.com> Date: Mon Apr 7 10:21:05 2014 +0200 fdo#76298: sw: do not start up every OLE object on deletion First check if it's actually a Chart embedded object; starting up external processes on Windows for arbitrary OLEs is likely expensive. (regression from 1ba29be90f7141077f2d079d40dffc2efd4f1a2c) (cherry picked from commit 206848294f686a0ccf4c741d7e92a2314a88ea48) Conflicts: sw/source/core/ole/ndole.cxx Change-Id: I3c64444b6cf4d4f791cafc77ec1f9b2b0150ad1b Reviewed-on: https://gerrit.libreoffice.org/8881 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 9ec8330..0941fdb 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -340,27 +340,28 @@ sal_Bool SwOLENode::SavePersistentData() if ( xChild.is() ) xChild->setParent( 0 ); - // pCnt->RemoveEmbeddedObject( aOLEObj.aName, sal_False ); /* #i119941: When cut or move the chart, SwUndoFlyBase::DelFly will call SaveSection to store the comtent to strorage. In this step, chart filter functions will be called. And chart filter will call chart core functions to create the chart again. Then chart core function will call the class ExplicitCategoryProvider to create data source. - In this step, when SW data source provider create the data source, it will create a new SwFlyFrm. + In this step, when SW + source provider create the data source, an UnoActionRemoveContext + will mess with the layout and create a new SwFlyFrm. But later in SwUndoFlyBase::DelFly, it will clear anchor related attributes of SwFlyFrm. Then finally null pointer occur. Resolution: In pCnt->RemoveEmbeddedObject in SaveSection process of table chart, only remove the object from the object container, without removing it's storage and graphic stream. The chart already removed from formatter.> */ - sal_Bool bChartWithInternalProvider = sal_False; sal_Bool bKeepObjectToTempStorage = sal_True; uno::Reference < embed::XEmbeddedObject > xIP = GetOLEObj().GetOleRef(); - if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) + if (IsChart() && !sChartTblName.isEmpty() + && svt::EmbeddedObjectRef::TryRunningState(xIP)) { uno::Reference< chart2::XChartDocument > xChart( xIP->getComponent(), UNO_QUERY ); - if ( xChart.is() && xChart->hasInternalDataProvider() ) - bChartWithInternalProvider = sal_True; + if (xChart.is() && !xChart->hasInternalDataProvider()) + { + bKeepObjectToTempStorage = sal_False; + } } - if ( IsChart() && !sChartTblName.isEmpty() && !bChartWithInternalProvider ) - bKeepObjectToTempStorage = sal_False; pCnt->RemoveEmbeddedObject( aOLEObj.aName, sal_False, bKeepObjectToTempStorage ); // modify end commit 723120e8bd04feed76c67756c4978238f304b13f Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri Apr 4 17:29:02 2014 +0200 WMF import: restore support for the ImplReadDIB(bFileHeader=false) version Regression from commit f7799c9317cc3187ae8aaedc36f829d478a59e77 (Resolves: #i124467# add check for image data offset..., 2014-03-28). Change-Id: I71e78aefca2ca5b07f763ec798226b9bb39a5254 (cherry picked from commit 9984807f17593b97778fc31824c50706ea2e826c) Reviewed-on: https://gerrit.libreoffice.org/8849 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/qa/cppunit/graphicfilter/data/wmf/pass/noheader.wmf b/vcl/qa/cppunit/graphicfilter/data/wmf/pass/noheader.wmf new file mode 100644 index 0000000..bfd7e20 Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/wmf/pass/noheader.wmf differ diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 2759c20..077f0b0 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -626,7 +626,9 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLon if(ImplReadDIBInfoHeader(rIStm, aHeader, bTopDown) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount) { - if (aHeader.nSize > nOffset) + // In case ImplReadDIB() didn't call ImplReadDIBFileHeader() before + // this method, nOffset is 0, that's OK. + if (nOffset && aHeader.nSize > nOffset) { // Header size claims to extend into the image data. // Looks like an error. commit 1fcb6a8fe5ec6779d17bc6272894bdfebbbcf786 Author: Fridrich Štrba <fridrich.st...@bluewin.ch> Date: Fri Apr 4 15:45:36 2014 +0200 Uploading libcdr-0.0.15: Support for CorelDraw x7 (cherry picked from commit 32f301f5a64d8ff7815cf88858fc8a87cb9ad76a) Conflicts: download.lst Change-Id: I1cc6c6ab39ec27dbf08c2019c7dd7f8f29537520 Reviewed-on: https://gerrit.libreoffice.org/8845 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/download.lst b/download.lst index 3cd3bdf..3ee7cbd 100644 --- a/download.lst +++ b/download.lst @@ -4,8 +4,8 @@ APR_MD5SUM := eff9d741b0999a9bbab96862dd2a2a3d export APR_TARBALL := apr-1.4.8.tar.gz APR_UTIL_MD5SUM := 71a11d037240b292f824ba1eb537b4e3 export APR_UTIL_TARBALL := apr-util-1.5.3.tar.gz -CDR_MD5SUM := d88f9b94df880d2c05be943b000ca112 -export CDR_TARBALL := libcdr-0.0.14.tar.bz2 +CDR_MD5SUM := fbcd8619fc6646f41d527c1329102998 +export CDR_TARBALL := libcdr-0.0.15.tar.bz2 COINMP_MD5SUM := 1cce53bf4b40ae29790d2c5c9f8b1129 export COINMP_TARBALL := CoinMP-1.7.6.tgz EBOOK_MD5SUM := 2f1ceaf2ac8752ed278e175447d9b978 diff --git a/external/libcdr/UnpackedTarball_libcdr.mk b/external/libcdr/UnpackedTarball_libcdr.mk index dff6a57..a91bc8e 100644 --- a/external/libcdr/UnpackedTarball_libcdr.mk +++ b/external/libcdr/UnpackedTarball_libcdr.mk @@ -11,8 +11,4 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libcdr)) $(eval $(call gb_UnpackedTarball_set_tarball,libcdr,$(CDR_TARBALL))) -$(eval $(call gb_UnpackedTarball_add_patches,libcdr,\ - external/libcdr/libcdr-wpx_seek_end.patch.1 \ -)) - # vim: set noet sw=4 ts=4: diff --git a/external/libcdr/libcdr-wpx_seek_end.patch.1 b/external/libcdr/libcdr-wpx_seek_end.patch.1 deleted file mode 100644 index 67b8587..0000000 --- a/external/libcdr/libcdr-wpx_seek_end.patch.1 +++ /dev/null @@ -1,14 +0,0 @@ ---- a/src/lib/CDRZipStream.cpp -+++ b/src/lib/CDRZipStream.cpp -@@ -160,11 +160,7 @@ WPXInputStream *libcdr::CDRZipStream::getDocumentOLEStream(const char *name) - - bool libcdr::CDRZipStreamImpl::findCentralDirectoryEnd() - { --#if defined(LIBWPD_STREAM_VERSION_MAJOR) && defined(LIBWPD_STREAM_VERSION_MINOR) && defined(LIBWPD_STREAM_VERSION_REVISION) \ -- && (LIBWPD_STREAM_VERSION_MAJOR > 0 || (LIBWPD_STREAM_VERSION_MAJOR == 0 && (LIBWPD_STREAM_VERSION_MINOR > 9 \ -- || (LIBWPD_STREAM_VERSION_MINOR == 9 && LIBWPD_STREAM_VERSION_REVISION >= 5)))) - if (m_cdir_offset || m_input->seek(-1024, WPX_SEEK_END)) --#endif - m_input->seek(m_cdir_offset, WPX_SEEK_SET); - try - { commit 1cfbc0ebb8198f5ebd966968086c121d83442a3a Author: Eike Rathke <er...@redhat.com> Date: Fri Apr 4 11:57:43 2014 +0200 accept proper number style condition != as not equal operator, fdo#76777 ODF 1.2 specifies '!=' as not equal operator in <number:number-style> <style:map> style:condition attribute. So far '<>' is written, accept the correct operator. Change-Id: I6087992ee35fff5c7aa52b7cec2b83b0a78dbac1 (cherry picked from commit dfcc851d65c8d81988843ef31a75b5d30051ddfd) Reviewed-on: https://gerrit.libreoffice.org/8834 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 20500af..8773f3a 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -2068,7 +2068,14 @@ void SvXMLNumFormatContext::AddCondition( const sal_Int32 nIndex ) if (!bDefaultCond) { - sal_Int32 nPos = sRealCond.indexOf( '.' ); + // Convert != to <> + sal_Int32 nPos = sRealCond.indexOf( "!=" ); + if ( nPos >= 0 ) + { + sRealCond = sRealCond.replaceAt( nPos, 2, "<>" ); + } + + nPos = sRealCond.indexOf( '.' ); if ( nPos >= 0 ) { // #i8026# #103991# localize decimal separator commit 12cf22b54ddefb6287f1a521cbd1083acfcb8c2b Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Apr 3 17:40:05 2014 +0200 bnc#821208 DOC import: fix unwanted char background in numbering char style Word supports formatting the paragraph parker itself, and we import that as a formatting at a position after the last character (e.g. "foo" will have that formatting at char pos 3, which is ignored by the layout). In addition to this hack, commit 1c22545edf9085b9f2656ca92781158b6b123db3 (Fix issue #i119405: Numbering text style changed after importing the *.doc, 2012-08-24) added a SwTxtNode::TryCharSetExpandToNum() hack to Writer core, where in case such a paragraph marker attribute is set, and the SwTxtNode has a numbering, then also modify the associated character style as well. As that commit already noticed, there are attributes which should not be propagated to that character style. Extend this blacklist to ignore RES_CHRATR_BACKGROUND as well, as Word does. Change-Id: Idcb40d37d8688c76fbd61f28428f6e3bc995f799 (cherry picked from commit 5a5d948e230dfea61108452579b68da75706cad4) Reviewed-on: https://gerrit.libreoffice.org/8827 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/ww8import/data/bnc821208.doc b/sw/qa/extras/ww8import/data/bnc821208.doc index d89d711..cfe7680 100755 Binary files a/sw/qa/extras/ww8import/data/bnc821208.doc and b/sw/qa/extras/ww8import/data/bnc821208.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 17296e4..410b02b 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -241,6 +241,9 @@ DECLARE_WW8IMPORT_TEST(testBnc821208, "bnc821208.doc") beans::PropertyState ePropertyState = xPropertyState->getPropertyState("CharFontName"); // This was beans::PropertyState_DIRECT_VALUE. CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, ePropertyState); + + // Background of the numbering itself should have been the default, was yellow (0xffff00). + CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(xPropertyState, "CharBackColor")); } DECLARE_WW8IMPORT_TEST(testCp1000044, "cp1000044.doc") diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 9e56478..7b417df 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1758,7 +1758,7 @@ void SwTxtNode::DelSoftHyph( const xub_StrLen nStt, const xub_StrLen nEnd ) //In MS Word, the font underline setting of the paragraph end position wont affect the formatting of numbering, so we ignore it bool lcl_IsIgnoredCharFmtForNumbering(const sal_uInt16 nWhich) { - return (nWhich == RES_CHRATR_UNDERLINE); + return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_BACKGROUND); } //In MS Word, following properties of the paragraph end position wont affect the formatting of bullets, so we ignore them: commit 74aed16f68bd164ab4846063513bcebbb6f8b02e Author: Eike Rathke <er...@redhat.com> Date: Thu Apr 3 20:57:54 2014 +0200 fixed display of available dictionaries strings Since commit 9dc57be59d1a8dc17e77f21cbce04e2bb7247dca under Tools->Options->LanguageSettings->WritingAids "User-defined dictionaries" the language strings are displayed as " '[' Language (Country) ']'" that before was and instead should be "[Language (Country)]" Change-Id: Id7e7ef6ab86112c46707f1451a072dfc196aec44 (cherry picked from commit cc658066aec0a0f9589e7f9522c4431b3a3d5e96) Reviewed-on: https://gerrit.libreoffice.org/8829 Tested-by: Michael Stahl <mst...@redhat.com> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 3b3eca6..33bc845 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -58,9 +58,9 @@ OUString GetDicInfoStr( const OUString& rName, const sal_uInt16 nLang, bool bNeg aTmp += SVX_RESSTR(RID_SVXSTR_LANGUAGE_ALL); else { - aTmp += " '[' "; + aTmp += "["; aTmp += SvtLanguageTable::GetLanguageString( (LanguageType)nLang ); - aTmp += " ']' "; + aTmp += "]"; } return aTmp; commit 5af391b9201ae481270dd45f2d818637289de224 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Apr 2 12:38:36 2014 +0100 coverity#707971 Uninitialized scalar field Change-Id: I5c1045253c082a00397cf0f048baee947232c9b1 (cherry picked from commit 4ab06a576313de973ae96787a19215b208737859) Reviewed-on: https://gerrit.libreoffice.org/8820 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 910f056..7608789 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -958,8 +958,17 @@ namespace sal_Bool m_bCopy; public: - ApplySectionViewAction( sal_Bool _bCopy ) : m_eAction( eEndDragObj ), m_bCopy( _bCopy ) { } - ApplySectionViewAction(SectionViewAction _eAction = eEndAction ) : m_eAction( _eAction ) { } + ApplySectionViewAction(sal_Bool _bCopy) + : m_eAction(eEndDragObj) + , m_bCopy(_bCopy) + { + } + + ApplySectionViewAction(SectionViewAction _eAction = eEndAction) + : m_eAction(_eAction) + , m_bCopy(false) + { + } void operator() ( const OViewsWindow::TSectionsMap::value_type& _rhs ) { commit c90af0c028040242d789ef5be5fc1c03f26396cf Author: Caolán McNamara <caol...@redhat.com> Date: Wed Apr 2 13:47:54 2014 +0100 Resolves: fdo#76905 long delay when changing font size from % to pt (cherry picked from commit aa16ca73260681b19f0be8a58be95ed454580f7f) Conflicts: svtools/source/control/ctrlbox.cxx Change-Id: I33d72b51536ab96653ccda64c6e058c497289327 Reviewed-on: https://gerrit.libreoffice.org/8814 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index fe48970..9250f30 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1879,13 +1879,13 @@ void FontSizeBox::SetRelative( sal_Bool bNewRelative ) if ( bPtRelative ) { + Clear(); //clear early because SetDecimalDigits is a slow recalc + SetDecimalDigits( 1 ); SetMin( nPtRelMin ); SetMax( nPtRelMax ); SetUnit( FUNIT_POINT ); - Clear(); - short i = nPtRelMin, n = 0; // JP 30.06.98: more than 100 values are not useful while ( i <= nPtRelMax && n++ < 100 ) @@ -1896,13 +1896,14 @@ void FontSizeBox::SetRelative( sal_Bool bNewRelative ) } else { + Clear(); //clear early because SetDecimalDigits is a slow recalc + SetDecimalDigits( 0 ); SetMin( nRelMin ); SetMax( nRelMax ); SetCustomUnitText(OUString('%')); SetUnit( FUNIT_CUSTOM ); - Clear(); sal_uInt16 i = nRelMin; while ( i <= nRelMax ) { @@ -1913,6 +1914,8 @@ void FontSizeBox::SetRelative( sal_Bool bNewRelative ) } else { + if (pFontList) + Clear(); //clear early because SetDecimalDigits is a slow recalc bRelative = bPtRelative = sal_False; SetDecimalDigits( 1 ); SetMin( 20 ); commit 27a15d36e11b90d91ca05bea10a11d29451b9426 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Mar 26 17:08:35 2014 +0000 Resolves: fdo#73936 make FormFieldDropDowns a real fieldportion split the checkbox and list and use a field portion for the list. That way it knows how to line break correctly wrt hardspaces and doesn't hang when the situation arises. (cherry picked from commit a52ee51269a47e52d68405caf8507e1abaa6fd8f) Conflicts: sw/source/core/text/itrform2.cxx sw/source/core/text/portxt.cxx sw/source/core/text/portxt.hxx Change-Id: I46d73f19ef8e51e7c21c8783ce70bb80d98a784c Reviewed-on: https://gerrit.libreoffice.org/8776 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index adf78fa..8d03d84 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1056,7 +1056,7 @@ void SwTxtPaintInfo::DrawPostIts( const SwLinePortion&, sal_Bool bScript ) const } } -void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const +void SwTxtPaintInfo::DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool bChecked) const { SwRect aIntersect; CalcRect( rPor, &aIntersect, 0 ); @@ -1078,7 +1078,8 @@ void SwTxtPaintInfo::DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) m_pOut->SetLineColor( Color(0, 0, 0)); m_pOut->SetFillColor(); m_pOut->DrawRect( r ); - if (checked) { + if (bChecked) + { m_pOut->DrawLine(r.TopLeft(), r.BottomRight()); m_pOut->DrawLine(r.TopRight(), r.BottomLeft()); } diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 2127221..8c3ed9a 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -450,7 +450,7 @@ public: **/ void DrawBorder( const SwLinePortion &rPor ) const; - void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const; + void DrawCheckBox(const SwFieldFormCheckboxPortion &rPor, bool bChecked) const; inline void NotifyURL( const SwLinePortion &rPor ) const { if( URLNotify() ) _NotifyURL( rPor ); } diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 12c58e4..9cb57bc 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -55,6 +55,7 @@ #include <doc.hxx> #include <pormulti.hxx> #include <unotools/charclass.hxx> +#include <xmloff/odffields.hxx> #include <vector> @@ -876,11 +877,31 @@ void SwMetaPortion::Paint( const SwTxtPaintInfo &rInf ) const } } +namespace { + using namespace sw::mark; + static OUString getCurrentListIndex(IFieldmark* pBM) + { + const IFieldmark::parameter_map_t* const pParameters = pBM->GetParameters(); + sal_Int32 nCurrentIdx = 0; + const IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find(OUString(ODF_FORMDROPDOWN_RESULT)); + if(pResult != pParameters->end()) + pResult->second >>= nCurrentIdx; + + const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(OUString(ODF_FORMDROPDOWN_LISTENTRY)); + if (pListEntries != pParameters->end()) + { + uno::Sequence< OUString > vListEntries; + pListEntries->second >>= vListEntries; + if (nCurrentIdx < vListEntries.getLength()) + return vListEntries[nCurrentIdx]; + } + return OUString(); + } +} /************************************************************************* * SwTxtFormatter::WhichTxtPor() *************************************************************************/ - SwTxtPortion *SwTxtFormatter::WhichTxtPor( SwTxtFormatInfo &rInf ) const { SwTxtPortion *pPor = 0; @@ -912,7 +933,29 @@ SwTxtPortion *SwTxtFormatter::WhichTxtPor( SwTxtFormatInfo &rInf ) const else if( rInf.GetTxt()[rInf.GetIdx()]==CH_TXT_ATR_FIELDEND ) pPor = new SwFieldMarkPortion(); else if( rInf.GetTxt()[rInf.GetIdx()]==CH_TXT_ATR_FORMELEMENT ) - pPor = new SwFieldFormPortion(); + { + SwTxtNode *pNd = const_cast<SwTxtNode *>(rInf.GetTxtFrm()->GetTxtNode()); + const SwDoc *doc = pNd->GetDoc(); + SwIndex aIndex(pNd, rInf.GetIdx()); + SwPosition aPosition(*pNd, aIndex); + sw::mark::IFieldmark *pBM = doc->getIDocumentMarkAccess()->getFieldmarkFor(aPosition); + OSL_ENSURE(pBM != NULL, "Where is my form field bookmark???"); + if (pBM != NULL) + { + if (pBM->GetFieldname( ) == ODF_FORMCHECKBOX) + { + pPor = new SwFieldFormCheckboxPortion(); + } + else if (pBM->GetFieldname( ) == ODF_FORMDROPDOWN) + { + pPor = new SwFieldFormDropDownPortion(getCurrentListIndex(pBM)); + } + else + { + assert( false ); // unknown type... + } + } + } } if( !pPor ) { @@ -1010,7 +1053,6 @@ SwTxtPortion *SwTxtFormatter::NewTxtPortion( SwTxtFormatInfo &rInf ) /************************************************************************* * SwTxtFormatter::WhichFirstPortion() *************************************************************************/ - SwLinePortion *SwTxtFormatter::WhichFirstPortion(SwTxtFormatInfo &rInf) { SwLinePortion *pPor = 0; diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index b0c57ac..f2f5a0f 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -40,7 +40,6 @@ #include <porftn.hxx> #include <accessibilityoptions.hxx> #include <editeng/lrspitem.hxx> - #include <unicode/ubidi.h> using namespace ::com::sun::star; @@ -1352,4 +1351,9 @@ KSHORT SwCombinedPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const return SwFldPortion::GetViewWidth( rInf ); } +SwFldPortion *SwFieldFormDropDownPortion::Clone(const OUString &rExpand) const +{ + return new SwFieldFormDropDownPortion(rExpand); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx index ef9f956..16ab858 100644 --- a/sw/source/core/text/porfld.hxx +++ b/sw/source/core/text/porfld.hxx @@ -246,6 +246,21 @@ public: OUTPUT_OPERATOR }; +namespace sw { namespace mark { + class IFieldmark; +} } + +class SwFieldFormDropDownPortion : public SwFldPortion +{ +public: + SwFieldFormDropDownPortion(const OUString &rExpand) + : SwFldPortion(rExpand) + { + } + // Field cloner for SplitGlue + virtual SwFldPortion *Clone( const OUString &rExpand ) const; +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 68a290bd..b6ee27e 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -916,32 +916,7 @@ sal_Bool SwFieldMarkPortion::Format( SwTxtFormatInfo & ) return ret; } -namespace { - static sal_Int32 getCurrentListIndex( IFieldmark* pBM, - OUString* io_pCurrentText = NULL ) - { - const IFieldmark::parameter_map_t* const pParameters = pBM->GetParameters(); - sal_Int32 nCurrentIdx = 0; - const IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find(OUString(ODF_FORMDROPDOWN_RESULT)); - if(pResult != pParameters->end()) - pResult->second >>= nCurrentIdx; - if(io_pCurrentText) - { - const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(OUString(ODF_FORMDROPDOWN_LISTENTRY)); - if(pListEntries != pParameters->end()) - { - uno::Sequence< OUString > vListEntries; - pListEntries->second >>= vListEntries; - if(nCurrentIdx < vListEntries.getLength()) - *io_pCurrentText = vListEntries[nCurrentIdx]; - } - } - return nCurrentIdx; - } -} - -//FIXME Fieldbk -void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const +void SwFieldFormCheckboxPortion::Paint( const SwTxtPaintInfo& rInf ) const { SwTxtNode* pNd = const_cast<SwTxtNode*>(rInf.GetTxtFrm()->GetTxtNode()); const SwDoc *doc=pNd->GetDoc(); @@ -950,33 +925,18 @@ void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const IFieldmark* pBM = doc->getIDocumentMarkAccess( )->getFieldmarkFor( aPosition ); - OSL_ENSURE( pBM, - "SwFieldFormPortion::Paint(..)" - " - Where is my form field bookmark???"); + OSL_ENSURE(pBM && pBM->GetFieldname( ) == ODF_FORMCHECKBOX, + "Where is my form field bookmark???"); - if ( pBM != NULL ) + if (pBM && pBM->GetFieldname( ) == ODF_FORMCHECKBOX) { - if ( pBM->GetFieldname( ) == ODF_FORMCHECKBOX ) - { // a checkbox... - ICheckboxFieldmark* pCheckboxFm = dynamic_cast< ICheckboxFieldmark* >(pBM); - bool checked = pCheckboxFm->IsChecked(); - rInf.DrawCheckBox(*this, checked); - } - else if ( pBM->GetFieldname( ) == ODF_FORMDROPDOWN ) - { // a list... - OUString aTxt; - getCurrentListIndex( pBM, &aTxt ); - rInf.DrawViewOpt( *this, POR_FLD ); - rInf.DrawText( aTxt, *this, 0, aTxt.getLength(), false ); - } - else - { - assert(0); // unknown type... - } + const ICheckboxFieldmark* pCheckboxFm = dynamic_cast< ICheckboxFieldmark* >(pBM); + bool bChecked = pCheckboxFm && pCheckboxFm->IsChecked(); + rInf.DrawCheckBox(*this, bChecked); } } -sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo & rInf ) +sal_Bool SwFieldFormCheckboxPortion::Format( SwTxtFormatInfo & rInf ) { sal_Bool ret = 0; SwTxtNode *pNd = const_cast < SwTxtNode * >( rInf.GetTxtFrm( )->GetTxtNode( ) ); @@ -984,28 +944,12 @@ sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo & rInf ) SwIndex aIndex( pNd, rInf.GetIdx( ) ); SwPosition aPosition( *pNd, aIndex ); IFieldmark *pBM = doc->getIDocumentMarkAccess( )->getFieldmarkFor( aPosition ); - OSL_ENSURE( pBM != NULL, "Where is my form field bookmark???" ); - if ( pBM != NULL ) + OSL_ENSURE(pBM && pBM->GetFieldname( ) == ODF_FORMCHECKBOX, "Where is my form field bookmark???"); + if (pBM && pBM->GetFieldname( ) == ODF_FORMCHECKBOX) { - if ( pBM->GetFieldname( ) == ODF_FORMCHECKBOX ) - { - Width( rInf.GetTxtHeight( ) ); - Height( rInf.GetTxtHeight( ) ); - SetAscent( rInf.GetAscent( ) ); - } - else if ( pBM->GetFieldname( ) == ODF_FORMDROPDOWN ) - { - OUString aTxt; - getCurrentListIndex( pBM, &aTxt ); - SwPosSize aPosSize = rInf.GetTxtSize( aTxt ); - Width( aPosSize.Width( ) ); - Height( aPosSize.Height( ) ); - SetAscent( rInf.GetAscent( ) ); - } - else - { - assert( 0 ); // unknown type... - } + Width( rInf.GetTxtHeight( ) ); + Height( rInf.GetTxtHeight( ) ); + SetAscent( rInf.GetAscent( ) ); } return ret; } diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx index 71e6de5..4cec8cf 100644 --- a/sw/source/core/text/portxt.hxx +++ b/sw/source/core/text/portxt.hxx @@ -108,11 +108,12 @@ class SwFieldMarkPortion : public SwTxtPortion virtual sal_Bool Format( SwTxtFormatInfo &rInf ); }; -class SwFieldFormPortion : public SwTxtPortion +class SwFieldFormCheckboxPortion : public SwTxtPortion { - public: - inline SwFieldFormPortion() : SwTxtPortion() - { } +public: + SwFieldFormCheckboxPortion() : SwTxtPortion() + { + } virtual void Paint( const SwTxtPaintInfo &rInf ) const; virtual sal_Bool Format( SwTxtFormatInfo &rInf ); }; commit 5761abe0813eee11a7b7c6fe3acefd612176b366 Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Apr 3 12:59:21 2014 +0200 Support SmartTagRecognizers again The XContentEnumerationAccess is at the service manager, not the component context. Regression introduced in LO 4.0 with 4381f3dd5ae9e042840a16f69d07267208160420 "fdo#46808, Use BreakIterator ::create method." Change-Id: Idb7d38b9c14beea9a9ad347e6cbc8190d7248b2d (cherry picked from commit d4c8325ea9cbffeff91de49d5e1f1f026be319de) Reviewed-on: https://gerrit.libreoffice.org/8824 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx index 218406c..6a97d3c 100644 --- a/svx/source/smarttags/SmartTagMgr.cxx +++ b/svx/source/smarttags/SmartTagMgr.cxx @@ -345,7 +345,7 @@ void SmartTagMgr::changesOccurred( const util::ChangesEvent& rEvent ) throw( Run */ void SmartTagMgr::LoadLibraries() { - Reference< container::XContentEnumerationAccess > rContent( mxContext , UNO_QUERY ); + Reference< container::XContentEnumerationAccess > rContent( mxContext->getServiceManager(), UNO_QUERY ); if ( !rContent.is() ) return; commit 7be065822c3c07e523a3234f69916916de6ed6bb Author: Eike Rathke <er...@redhat.com> Date: Wed Apr 2 16:54:17 2014 +0200 resolved fdo#76949 correct grammar is GRAM_OOXML Regression introduced with ca8ca8c28742879220f3ff88ae0d71c8d69b11cd that used GRAM_ENGLISH_XL_OOX instead, which is English UI function names with OOXML reference syntax. Change-Id: If6b73e85a45e57f6ef281d1edf8e34dec7cb9bb8 (cherry picked from commit 31e4419ac7581aa7864905bcd4ce42e14df6c9bb) Reviewed-on: https://gerrit.libreoffice.org/8817 Reviewed-by: Kohei Yoshida <libreoff...@kohei.us> Tested-by: Kohei Yoshida <libreoff...@kohei.us> diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 3e9935d..035a827 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -824,7 +824,7 @@ OUString XclXmlUtils::ToOUString( ScDocument& rDocument, const ScAddress& rAddress, const ScTokenArray* pTokenArray ) { ScCompiler aCompiler( &rDocument, rAddress, const_cast<ScTokenArray&>(*pTokenArray)); - aCompiler.SetGrammar(FormulaGrammar::GRAM_ENGLISH_XL_OOX); + aCompiler.SetGrammar(FormulaGrammar::GRAM_OOXML); OUStringBuffer aBuffer( pTokenArray->GetLen() * 5 ); aCompiler.CreateStringFromTokenArray( aBuffer ); commit 830864ccc4d4e8028b2918062edc7db623b40999 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Apr 2 15:18:05 2014 +0100 Resolves: fdo#75307 discard invalid user data Change-Id: Id39b51c344004e02d3d5a281ba98721b944468c3 (cherry picked from commit f5b9db43080658201caf07cd646bae4f4f2acc95) Reviewed-on: https://gerrit.libreoffice.org/8815 Tested-by: Michael Stahl <mst...@redhat.com> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 3e6807c..28222fa 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -2897,6 +2897,26 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) m_nSubEsc = (short)sUser.getToken( 1, ';' ).toInt32(); m_nSuperProp = (sal_uInt8)sUser.getToken( 2, ';' ).toInt32(); m_nSubProp = (sal_uInt8)sUser.getToken( 3, ';' ).toInt32(); + + //fdo#75307 validate all the entries and discard all of them if any are + //out of range + bool bValid = true; + if (m_nSuperEsc < m_pHighLowMF->GetMin() || m_nSuperEsc > m_pHighLowMF->GetMax()) + bValid = false; + if (m_nSubEsc*-1 < m_pHighLowMF->GetMin() || m_nSubEsc*-1 > m_pHighLowMF->GetMax()) + bValid = false; + if (m_nSuperProp < m_pFontSizeMF->GetMin() || m_nSuperProp > m_pFontSizeMF->GetMax()) + bValid = false; + if (m_nSubProp < m_pFontSizeMF->GetMin() || m_nSubProp > m_pFontSizeMF->GetMax()) + bValid = false; + + if (!bValid) + { + m_nSuperEsc = DFLT_ESC_SUPER; + m_nSubEsc = DFLT_ESC_SUB; + m_nSuperProp = DFLT_ESC_PROP; + m_nSubProp = DFLT_ESC_PROP; + } } short nEsc = 0; commit b9fc7db35f9b71fb85f953b1fbe3da876a8ad891 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Sun Feb 2 18:23:48 2014 -0500 fdo#76697: Remove this duplicate and use the UNO constant values instead. (cherry picked from commit 72b2fafebfc44fa90f08cc198e2fa5fc26154c5b) Conflicts: xmloff/source/style/bordrhdl.cxx This fixes the bug because in XMLBorderHdl::importXML() the value "none" was rejected as invalid because API_LINE_NONE pointlessly had a different value than BorderLineStyle::NONE. Change-Id: Id81aacc6c594ad25d97f6f6dc578ed9ca16549ab Signed-off-by: Michael Stahl <mst...@redhat.com> diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx index e0c7be5..cecc3b1 100644 --- a/xmloff/source/style/bordrhdl.cxx +++ b/xmloff/source/style/bordrhdl.cxx @@ -29,23 +29,6 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; -const sal_uInt16 API_LINE_SOLID = 0; -const sal_uInt16 API_LINE_DOTTED = 1; -const sal_uInt16 API_LINE_DASHED = 2; -const sal_uInt16 API_LINE_DOUBLE = 3; -const sal_uInt16 API_LINE_THINTHICK_SMALLGAP = 4; -const sal_uInt16 API_LINE_THINTHICK_MEDIUMGAP = 5; -const sal_uInt16 API_LINE_THINTHICK_LARGEGAP = 6; -const sal_uInt16 API_LINE_THICKTHIN_SMALLGAP = 7; -const sal_uInt16 API_LINE_THICKTHIN_MEDIUMGAP = 8; -const sal_uInt16 API_LINE_THICKTHIN_LARGEGAP = 9; -const sal_uInt16 API_LINE_EMBOSSED = 10; -const sal_uInt16 API_LINE_ENGRAVED = 11; -const sal_uInt16 API_LINE_OUTSET = 12; -const sal_uInt16 API_LINE_INSET = 13; -const sal_uInt16 API_LINE_FINE_DASHED = 14; -const sal_uInt16 API_LINE_NONE = USHRT_MAX; - #define DEF_LINE_WIDTH_0 1 #define DEF_LINE_WIDTH_1 35 #define DEF_LINE_WIDTH_2 88 @@ -90,7 +73,7 @@ static sal_uInt16 const aBorderWidths[] = static void lcl_frmitems_setXMLBorderStyle( table::BorderLine2 & rBorderLine, sal_uInt16 nStyle ) { sal_Int16 eStyle = -1; // None - if ( nStyle != API_LINE_NONE ) + if (nStyle != table::BorderLineStyle::NONE) eStyle = sal_Int16( nStyle ); rBorderLine.LineStyle = eStyle; @@ -238,7 +221,7 @@ bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, co // if there is no style or a different style than none but no width, // then the declaration is not valid. - if( !bHasStyle || (API_LINE_NONE != nStyle && !bHasWidth) ) + if (!bHasStyle || (table::BorderLineStyle::NONE != nStyle && !bHasWidth)) return false; table::BorderLine2 aBorderLine; @@ -252,7 +235,7 @@ bool XMLBorderHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, co } // first of all, delete an empty line - if( (bHasStyle && API_LINE_NONE == nStyle) || + if ((bHasStyle && table::BorderLineStyle::NONE == nStyle) || (bHasWidth && USHRT_MAX == nNamedWidth && 0 == nWidth) ) { aBorderLine.InnerLineWidth = 0; @@ -312,34 +295,34 @@ bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue, co XMLTokenEnum eStyleToken = XML_SOLID; switch ( aBorderLine.LineStyle ) { - case API_LINE_DASHED: + case table::BorderLineStyle::DASHED: eStyleToken = XML_DASHED; break; - case API_LINE_DOTTED: + case table::BorderLineStyle::DOTTED: eStyleToken = XML_DOTTED; break; - case API_LINE_DOUBLE: - case API_LINE_THINTHICK_SMALLGAP: - case API_LINE_THINTHICK_MEDIUMGAP: - case API_LINE_THINTHICK_LARGEGAP: - case API_LINE_THICKTHIN_SMALLGAP: - case API_LINE_THICKTHIN_MEDIUMGAP: - case API_LINE_THICKTHIN_LARGEGAP: + case table::BorderLineStyle::DOUBLE: + case table::BorderLineStyle::THINTHICK_SMALLGAP: + case table::BorderLineStyle::THINTHICK_MEDIUMGAP: + case table::BorderLineStyle::THINTHICK_LARGEGAP: + case table::BorderLineStyle::THICKTHIN_SMALLGAP: + case table::BorderLineStyle::THICKTHIN_MEDIUMGAP: + case table::BorderLineStyle::THICKTHIN_LARGEGAP: eStyleToken = XML_DOUBLE; break; - case API_LINE_EMBOSSED: + case table::BorderLineStyle::EMBOSSED: eStyleToken = XML_RIDGE; break; - case API_LINE_ENGRAVED: + case table::BorderLineStyle::ENGRAVED: eStyleToken = XML_GROOVE; break; - case API_LINE_OUTSET: + case table::BorderLineStyle::OUTSET: eStyleToken = XML_OUTSET; break; - case API_LINE_INSET: + case table::BorderLineStyle::INSET: eStyleToken = XML_INSET; break; - case API_LINE_FINE_DASHED: + case table::BorderLineStyle::FINE_DASHED: eStyleToken = XML_FINE_DASHED; break; case table::BorderLineStyle::DOUBLE_THIN: commit 5011fe850b13daa5771e8f0b2ca0ebea9eb05a47 Author: Michael Stahl <mst...@redhat.com> Date: Wed Apr 2 11:09:46 2014 +0200 fdo#63786 rhbz#1081968: fix PDF export of cropped SVG When a META_FLOATTRANSPARENT_ACTION is exported, the beginTransparencyGroup()/endTransparencyGroup() will write something like "Q 0 0 0 rg" where the Q clears the previously set clipping region, which is then not restored. bdf75c7d9bce985ed10a9c41d03420f33ce82142 appears to be a fix for a previous related problem; this essentially reverts it since it introduced the current cropping problem. (Particularly funny is the comment "force reemitting clip region" since the commit does the opposite.) It does not really make sense to me to write something to the page content stream from beginRedirect()/endRedirect(), because that does not actually have any effect on the _content_ of the substream, because the referencing of the substream is only written _after_ endRedirect() returns, so basically what is written can in the best case cancel itself out and in the worst case introduce bugs; the state manipulations there are just to modify the m_aCurrentPDFState following the push()/pop() (it is necessary to clear the clip region before starting the substream to avoid spurious "Q" at the beginning of the stream). Change-Id: I4a5f57b784068bd7d3ba187115444574f7418195 (cherry picked from commit e8062623355fcf3e65beae7f8f5e4d46384141f2) Reviewed-on: https://gerrit.libreoffice.org/8813 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 8f86255..89355ad 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8662,9 +8662,12 @@ void PDFWriterImpl::beginRedirect( SvStream* pStream, const Rectangle& rTargetRe { push( PUSH_ALL ); - // force reemitting clip region + // force reemitting clip region inside the new stream, and + // prevent emitting an unbalanced "Q" at the start clearClipRegion(); - updateGraphicsState(); + // this is needed to point m_aCurrentPDFState at the pushed state + // ... but it's pointless to actually write into the "outer" stream here! + updateGraphicsState(NOWRITE); m_aOutputStreams.push_front( StreamRedirect() ); m_aOutputStreams.front().m_pStream = pStream; @@ -8701,14 +8704,12 @@ SvStream* PDFWriterImpl::endRedirect() } pop(); - // force reemitting colors and clip region - clearClipRegion(); - m_aCurrentPDFState.m_bClipRegion = m_aGraphicsStack.front().m_bClipRegion; - m_aCurrentPDFState.m_aClipRegion = m_aGraphicsStack.front().m_aClipRegion; + m_aCurrentPDFState.m_aLineColor = Color( COL_TRANSPARENT ); m_aCurrentPDFState.m_aFillColor = Color( COL_TRANSPARENT ); - updateGraphicsState(); + // needed after pop() to set m_aCurrentPDFState + updateGraphicsState(NOWRITE); return pStream; } @@ -10497,7 +10498,7 @@ void PDFWriterImpl::drawWallpaper( const Rectangle& rRect, const Wallpaper& rWal } } -void PDFWriterImpl::updateGraphicsState() +void PDFWriterImpl::updateGraphicsState(Mode const mode) { OStringBuffer aLine( 256 ); GraphicsState& rNewState = m_aGraphicsStack.front(); @@ -10593,7 +10594,7 @@ void PDFWriterImpl::updateGraphicsState() // everything is up to date now m_aCurrentPDFState = m_aGraphicsStack.front(); - if( !aLine.isEmpty() ) + if ((mode != NOWRITE) && !aLine.isEmpty()) writeBuffer( aLine.getStr(), aLine.getLength() ); } diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 4602044..8e622fa 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -840,10 +840,12 @@ i12626 void drawRelief( SalLayout& rLayout, const OUString& rText, bool bTextLines ); void drawShadow( SalLayout& rLayout, const OUString& rText, bool bTextLines ); + enum Mode { DEFAULT, NOWRITE }; + /* writes differences between graphics stack and current real PDF * state to the file */ - void updateGraphicsState(); + void updateGraphicsState(Mode mode = DEFAULT); /* writes a transparency group object */ bool writeTransparentObject( TransparencyEmit& rObject ); commit 6cb9d0e14f3d1acad7b186d3f493823cd767c9bc Author: Matúš Kukan <matus.ku...@collabora.com> Date: Tue Apr 1 13:01:14 2014 +0200 fdo#74302: Adapt to OUString changes and set length exactly. This was fixed in master by 4c539fac018dfd44cd8db52161a8cb930c627da7 Change-Id: I69219e643f5eff3126191220ce2b1d0e1089a93e Reviewed-on: https://gerrit.libreoffice.org/8808 Tested-by: Michael Stahl <mst...@redhat.com> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index d97b71b..537f8aa 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -5399,6 +5399,9 @@ void OutputDevice::DrawText( const Point& rStartPt, const OUString& rStr, OUStringToOString( rStr, RTL_TEXTENCODING_UTF8 ).getStr() ); #endif + if( nLen == STRING_LEN ) + nLen = rStr.getLength() - nIndex; + if ( mpMetaFile ) mpMetaFile->AddAction( new MetaTextAction( rStartPt, rStr, nIndex, nLen ) ); if( pVector )
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits