chart2/source/view/main/VLegend.cxx | 4 connectivity/source/drivers/mork/MNSFolders.cxx | 18 connectivity/source/drivers/mork/MNSProfileDiscover.cxx | 9 connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx | 18 connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx | 9 cui/uiconfig/ui/select_persona_dialog.ui | 5 desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 21 extensions/source/bibliography/bibview.cxx | 4 extensions/source/bibliography/datman.cxx | 59 extensions/source/bibliography/general.cxx | 76 extensions/source/bibliography/general.hxx | 1 external/icu/UnpackedTarball_icu.mk | 3 external/icu/icu.changeset_36724.patch.1 | 37 external/icu/icu.changeset_36727.patch.1 | 52 external/icu/icu.changeset_36801.patch.1 | 1222 ++++++++++ filter/source/svg/svgexport.cxx | 4 filter/source/svg/svgwriter.cxx | 4 icon-themes/sifr/cmd/lc_autofilter.png |binary icon-themes/sifr/cmd/lc_connector.png |binary icon-themes/sifr/cmd/lc_connectorarrowend.png |binary icon-themes/sifr/cmd/lc_connectorarrows.png |binary icon-themes/sifr/cmd/lc_connectorarrowstart.png |binary icon-themes/sifr/cmd/lc_connectorcircleend.png |binary icon-themes/sifr/cmd/lc_connectorcircles.png |binary icon-themes/sifr/cmd/lc_connectorcirclestart.png |binary icon-themes/sifr/cmd/lc_connectorcurve.png |binary icon-themes/sifr/cmd/lc_connectorcurvearrowend.png |binary icon-themes/sifr/cmd/lc_connectorcurvearrows.png |binary icon-themes/sifr/cmd/lc_connectorcurvearrowstart.png |binary icon-themes/sifr/cmd/lc_connectorcurvecircleend.png |binary icon-themes/sifr/cmd/lc_connectorcurvecircles.png |binary icon-themes/sifr/cmd/lc_connectorcurvecirclestart.png |binary icon-themes/sifr/cmd/lc_connectorline.png |binary icon-themes/sifr/cmd/lc_connectorlinearrowend.png |binary icon-themes/sifr/cmd/lc_connectorlinearrows.png |binary icon-themes/sifr/cmd/lc_connectorlinearrowstart.png |binary icon-themes/sifr/cmd/lc_connectorlinecircleend.png |binary icon-themes/sifr/cmd/lc_connectorlinecircles.png |binary icon-themes/sifr/cmd/lc_connectorlinecirclestart.png |binary icon-themes/sifr/cmd/lc_connectorlines.png |binary icon-themes/sifr/cmd/lc_connectorlinesarrowend.png |binary icon-themes/sifr/cmd/lc_connectorlinesarrows.png |binary icon-themes/sifr/cmd/lc_connectorlinesarrowstart.png |binary icon-themes/sifr/cmd/lc_connectorlinescircleend.png |binary icon-themes/sifr/cmd/lc_connectorlinescircles.png |binary icon-themes/sifr/cmd/lc_connectorlinescirclestart.png |binary icon-themes/sifr/cmd/lc_line.png |binary icon-themes/sifr/cmd/lc_linearrowcircle.png |binary icon-themes/sifr/cmd/lc_linearrowend.png |binary icon-themes/sifr/cmd/lc_linearrows.png |binary icon-themes/sifr/cmd/lc_linearrowsquare.png |binary icon-themes/sifr/cmd/lc_linearrowstart.png |binary icon-themes/sifr/cmd/lc_linecirclearrow.png |binary icon-themes/sifr/cmd/lc_linediagonal.png |binary icon-themes/sifr/cmd/lc_linesquarearrow.png |binary icon-themes/sifr/cmd/lc_measureline.png |binary icon-themes/sifr/cmd/lc_printdefault.png |binary icon-themes/sifr/cmd/sc_autofilter.png |binary icon-themes/sifr/cmd/sc_printdefault.png |binary include/sfx2/dinfdlg.hxx | 2 include/vcl/floatwin.hxx | 9 include/vcl/window.hxx | 4 offapi/com/sun/star/awt/Key.idl | 1 offapi/type_reference/offapi.idl | 38 oox/source/drawingml/shape.cxx | 17 sc/inc/scmatrix.hxx | 3 sc/source/core/data/document.cxx | 12 sc/source/core/tool/interpr1.cxx | 29 sc/source/core/tool/interpr5.cxx | 15 sc/source/core/tool/scmatrix.cxx | 72 sc/source/filter/oox/stylesbuffer.cxx | 2 sd/qa/unit/data/tdf90403.pptx |binary sd/qa/unit/data/xml/tdf90403_0.xml | 4 sd/qa/unit/import-tests.cxx | 1 sfx2/source/appl/app.cxx | 2 sfx2/source/dialog/dinfdlg.cxx | 7 sfx2/uiconfig/ui/documentinfopage.ui | 25 solenv/gdb/libreoffice/svl.py | 66 svx/source/accessibility/ChildrenManagerImpl.cxx | 20 svx/source/engine3d/scene3d.cxx | 9 svx/source/sidebar/PanelLayout.cxx | 1 sw/inc/IDocumentSettingAccess.hxx | 2 sw/inc/doc.hxx | 8 sw/qa/extras/mailmerge/data/tdf89214.odt |binary sw/qa/extras/mailmerge/mailmerge.cxx | 12 sw/qa/extras/odfimport/data/tdf89802.fodt | 56 sw/qa/extras/odfimport/odfimport.cxx | 12 sw/qa/extras/rtfimport/data/tdf75614.rtf | 18 sw/qa/extras/rtfimport/rtfimport.cxx | 6 sw/source/core/doc/DocumentSettingManager.cxx | 6 sw/source/core/doc/docnum.cxx | 14 sw/source/core/doc/notxtfrm.cxx | 3 sw/source/core/edit/ednumber.cxx | 18 sw/source/core/frmedt/fecopy.cxx | 7 sw/source/core/inc/DocumentSettingManager.hxx | 1 sw/source/core/inc/frmtool.hxx | 3 sw/source/core/layout/paintfrm.cxx | 433 +-- sw/source/core/undo/undobj.cxx | 2 sw/source/filter/xml/xmlimp.cxx | 7 sw/source/ui/chrdlg/drpcps.cxx | 4 sw/source/ui/misc/glossary.cxx | 1 sw/source/uibase/app/docst.cxx | 32 sw/source/uibase/uno/SwXDocumentSettings.cxx | 19 sw/source/uibase/uno/unomailmerge.cxx | 3 udkapi/type_reference/udkapi.idl | 9 vcl/source/control/ilstbox.cxx | 4 vcl/source/gdi/sallayout.cxx | 13 vcl/source/window/menu.cxx | 6 vcl/source/window/syswin.cxx | 4 vcl/source/window/window2.cxx | 13 vcl/source/window/winproc.cxx | 48 writerfilter/source/rtftok/rtfdocumentimpl.cxx | 6 xmloff/source/draw/XMLShapeStyleContext.cxx | 14 113 files changed, 2166 insertions(+), 503 deletions(-)
New commits: commit 25f589d3685710d9e6169505e0359a8dcbeb54bc Author: Andras Timar <andras.ti...@collabora.com> Date: Sat Apr 4 14:13:18 2015 +0200 tdf#90404 OOXML chart legend import improvement In the bugdoc, the chart legend had 6 entries in PowerPoint, but only 5 in Impress. I played a lot with padding and offset parameters in layout algorithm without success. Finally I introduced this 1mm tolerance, so the fixed legend frame can expand up to 1mm, if necessary. Change-Id: Id1ad1df67aab41d942133cea8d16fccf0f215167 Reviewed-on: https://gerrit.libreoffice.org/15149 Reviewed-by: Andras Timar <andras.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> (cherry picked from commit 6220362e844ad0e50a38c1627ddd05a082882009) Reviewed-on: https://gerrit.libreoffice.org/15153 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index 1df4e74..84d62bc 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -390,7 +390,7 @@ awt::Size lcl_placeLegendEntries( nSumHeight += aRowHeights[nR]; sal_Int32 nRemainingSpace = rAvailableSpace.Height - nSumHeight; - if( nRemainingSpace<0 ) + if( nRemainingSpace < -100 ) // 1mm tolerance for OOXML interop tdf#90404 { //remove entries that are too big for( sal_Int32 nR=nNumberOfRows; nR--; ) @@ -418,7 +418,7 @@ awt::Size lcl_placeLegendEntries( } nNumberOfRows = static_cast<sal_Int32>(aRowHeights.size()); } - if( nRemainingSpace > 0 ) + if( nRemainingSpace >= -100 ) // 1mm tolerance for OOXML interop tdf#90404 { sal_Int32 nNormalSpacingHeight = 2*nYPadding+(nNumberOfRows-1)*nYOffset; if( nRemainingSpace < nNormalSpacingHeight ) commit 349a85d22df1cf3bafc8e6d458794c958615adc0 Author: Eike Rathke <er...@redhat.com> Date: Thu Apr 2 21:16:00 2015 +0200 use error value instead of string in array/matrix, tdf#42481 related Change-Id: Iaacf5636749077efc6f91f0eb0bac477cfcf4553 Reviewed-on: https://gerrit.libreoffice.org/15129 Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index 6f8ad91..27d3777 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -264,6 +264,7 @@ public: /// Jump sal_False without path void PutEmptyPath( SCSIZE nC, SCSIZE nR); void PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR ); + void PutError( sal_uInt16 nErrorCode, SCSIZE nIndex ); void PutBoolean( bool bVal, SCSIZE nC, SCSIZE nR); void FillDouble( double fVal, @@ -388,7 +389,7 @@ public: void GetDoubleArray( std::vector<double>& rArray, bool bEmptyAsZero = true ) const; void MergeDoubleArray( std::vector<double>& rArray, Op eOp ) const; - void SubAddOp(bool bSub, double fVal, svl::SharedString aString, ScMatrix& rMat); + void SubAddOp(bool bSub, double fVal, ScMatrix& rMat); ScMatrix& operator+= ( const ScMatrix& r ); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 4ad6f1e..1713089 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -1499,8 +1499,7 @@ void ScInterpreter::ScNeg() if ( pMat->IsValueOrEmpty(i,j) ) pResMat->PutDouble( -pMat->GetDouble(i,j), i, j ); else - pResMat->PutString( - mrStrPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)), i, j); + pResMat->PutError( errNoValue, i, j); } } PushMatrix( pResMat ); @@ -1553,8 +1552,7 @@ void ScInterpreter::ScNot() if ( pMat->IsValueOrEmpty(i,j) ) pResMat->PutDouble( double(pMat->GetDouble(i,j) == 0.0), i, j ); else - pResMat->PutString( - mrStrPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)), i, j); + pResMat->PutError( errNoValue, i, j); } } PushMatrix( pResMat ); diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 7b46fd8..3aab1c2 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -1284,14 +1284,13 @@ void ScInterpreter::CalculateAddSub(bool _bSub) ScMatrixRef pResMat = GetNewMat(nC, nR, true); if (pResMat) { - svl::SharedString aString = mrStrPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)); if (bFlag || !_bSub ) { - pMat->SubAddOp(_bSub, fVal, aString, *pResMat); + pMat->SubAddOp(_bSub, fVal, *pResMat); } else { - pMat->SubAddOp(false, -fVal, aString, *pResMat); + pMat->SubAddOp(false, -fVal, *pResMat); } PushMatrix(pResMat); } @@ -1475,7 +1474,7 @@ void ScInterpreter::ScMul() if (pMat->IsValue(i)) pResMat->PutDouble(pMat->GetDouble(i)*fVal, i); else - pResMat->PutString(mrStrPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)), i); + pResMat->PutError( errNoValue, i); PushMatrix(pResMat); } else @@ -1554,14 +1553,14 @@ void ScInterpreter::ScDiv() if (pMat->IsValue(i)) pResMat->PutDouble( div( fVal, pMat->GetDouble(i)), i); else - pResMat->PutString(mrStrPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)), i); + pResMat->PutError( errNoValue, i); } else { for ( SCSIZE i = 0; i < nCount; i++ ) if (pMat->IsValue(i)) pResMat->PutDouble( div( pMat->GetDouble(i), fVal), i); else - pResMat->PutString(mrStrPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)), i); + pResMat->PutError( errNoValue, i); } PushMatrix(pResMat); } @@ -1633,14 +1632,14 @@ void ScInterpreter::ScPow() if (pMat->IsValue(i)) pResMat->PutDouble(pow(fVal,pMat->GetDouble(i)), i); else - pResMat->PutString(mrStrPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)), i); + pResMat->PutError( errNoValue, i); } else { for ( SCSIZE i = 0; i < nCount; i++ ) if (pMat->IsValue(i)) pResMat->PutDouble(pow(pMat->GetDouble(i),fVal), i); else - pResMat->PutString(mrStrPool.intern(ScGlobal::GetRscString(STR_NO_VALUE)), i); + pResMat->PutError( errNoValue, i); } PushMatrix(pResMat); } diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 4398308..90b2376 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -242,6 +242,7 @@ public: void PutEmpty(SCSIZE nC, SCSIZE nR); void PutEmptyPath(SCSIZE nC, SCSIZE nR); void PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR ); + void PutError( sal_uInt16 nErrorCode, SCSIZE nIndex ); void PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR); sal_uInt16 GetError( SCSIZE nC, SCSIZE nR) const; double GetDouble(SCSIZE nC, SCSIZE nR) const; @@ -488,6 +489,13 @@ void ScMatrixImpl::PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR ) maMat.set(nR, nC, CreateDoubleError(nErrorCode)); } +void ScMatrixImpl::PutError( sal_uInt16 nErrorCode, SCSIZE nIndex ) +{ + SCSIZE nC, nR; + CalcPosition(nIndex, nC, nR); + maMat.set(nR, nC, CreateDoubleError(nErrorCode)); +} + void ScMatrixImpl::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR) { if (ValidColRow( nC, nR)) @@ -1871,34 +1879,11 @@ void ScMatrixImpl::AddValues( const ScMatrixImpl& rMat ) } } -namespace Op { - -template<typename T> -struct return_type -{ - typedef T type; -}; - -template<> -struct return_type<bool> -{ - typedef double type; -}; - -template<> -struct return_type<char> -{ - typedef svl::SharedString type; -}; - -} - template<typename T, typename U> struct wrapped_iterator { typedef ::std::bidirectional_iterator_tag iterator_category; - typedef typename T::const_iterator::value_type old_value_type; - typedef typename Op::return_type<old_value_type>::type value_type; + typedef double value_type; typedef value_type* pointer; typedef value_type& reference; typedef typename T::const_iterator::difference_type difference_type; @@ -2294,6 +2279,11 @@ void ScMatrix::PutError( sal_uInt16 nErrorCode, SCSIZE nC, SCSIZE nR ) pImpl->PutError(nErrorCode, nC, nR); } +void ScMatrix::PutError( sal_uInt16 nErrorCode, SCSIZE nIndex ) +{ + pImpl->PutError(nErrorCode, nIndex); +} + void ScMatrix::PutBoolean(bool bVal, SCSIZE nC, SCSIZE nR) { pImpl->PutBoolean(bVal, nC, nR); @@ -2536,13 +2526,13 @@ struct AddOp { private: double mnVal; - svl::SharedString maString; + double mnError; public: - AddOp(double nVal, svl::SharedString aString): + AddOp(double nVal): mnVal(nVal), - maString(aString) + mnError( CreateDoubleError( errNoValue)) { } @@ -2556,14 +2546,14 @@ public: return mnVal + (double)bVal; } - svl::SharedString operator()(const svl::SharedString&) const + double operator()(const svl::SharedString&) const { - return maString; + return mnError; } - svl::SharedString operator()(char) const + double operator()(char) const { - return maString; + return mnVal; // mnVal + 0.0 } bool useFunctionForEmpty() const @@ -2576,13 +2566,13 @@ struct SubOp { private: double mnVal; - svl::SharedString maString; + double mnError; public: - SubOp(double nVal, svl::SharedString aString): + SubOp(double nVal): mnVal(nVal), - maString(aString) + mnError( CreateDoubleError( errNoValue)) { } @@ -2596,14 +2586,14 @@ public: return mnVal - (double)bVal; } - svl::SharedString operator()(const svl::SharedString&) const + double operator()(const svl::SharedString&) const { - return maString; + return mnError; } - svl::SharedString operator()(char) const + double operator()(char) const { - return maString; + return mnVal; // mnVal - 0.0 } bool useFunctionForEmpty() const @@ -2614,16 +2604,16 @@ public: } -void ScMatrix::SubAddOp(bool bSub, double fVal, svl::SharedString aString, ScMatrix& rMat) +void ScMatrix::SubAddOp(bool bSub, double fVal, ScMatrix& rMat) { if(bSub) { - SubOp aOp(fVal, aString); + SubOp aOp(fVal); pImpl->ApplyOperation(aOp, *rMat.pImpl); } else { - AddOp aOp(fVal, aString); + AddOp aOp(fVal); pImpl->ApplyOperation(aOp, *rMat.pImpl); } } commit 3195ff1ea1863aa91805acb7d4e1e0279cc22826 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Apr 13 15:51:43 2015 +0100 Resolves: tdf#90583 3D pie-chart missing guide handles partial revert of commit db1d2af02861b49e4f53d726d59cd71c20cee9b1 Author: Armin Le Grand <a...@apache.org> Date: Tue Feb 18 21:18:13 2014 +0000 Resolves: #i123539# some optimizations for 3D chart... geometry creation using UNO API (cherry picked from commit bbe35be767d76d08891c4f3d3600d80e0e6805f2) Change-Id: If35f05fb62230e90cfc43a0beac053e8a87820d4 (cherry picked from commit bca8d8985666d3fd22b91eb280f9baaeb933c2d0) Reviewed-on: https://gerrit.libreoffice.org/15283 Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 71eda45..5aaa03b 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -380,14 +380,7 @@ void E3dScene::NewObjectInserted(const E3dObject* p3DObj) void E3dScene::StructureChanged() { E3dObject::StructureChanged(); - - if(!GetModel() || !GetModel()->isLocked()) - { - // #i123539# optimization for 3D chart object generation: do not reset - // already calculated scene projection data every time an object gets - // initialized - SetRectsDirty(); - } + SetRectsDirty(); ImpCleanup3DDepthMapper(); } commit 2db0f8798e15e781d1cd7dabefcc40fe3a1b1f57 Author: Eike Rathke <er...@redhat.com> Date: Mon Apr 13 18:06:46 2015 +0200 string access out of bounds Another UniString to OUString conversion fallout. Change-Id: I5e62b049da3e7f8b5a892ea6aae7110a33564a46 (cherry picked from commit 9f52efa43b2d65c0b6c92790cc2859e752bf975f) Reviewed-on: https://gerrit.libreoffice.org/15286 Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index d79a138..4ad6f1e 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -3187,15 +3187,20 @@ void ScInterpreter::ScCode() { //2do: make it full range unicode? OUString aStr = GetString().getString(); - //"classic" ByteString conversion flags - const sal_uInt32 convertFlags = - RTL_UNICODETOTEXT_FLAGS_NONSPACING_IGNORE | - RTL_UNICODETOTEXT_FLAGS_CONTROL_IGNORE | - RTL_UNICODETOTEXT_FLAGS_FLUSH | - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT | - RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT | - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE; - PushInt( (unsigned char) OUStringToOString(OUString(aStr[0]), osl_getThreadTextEncoding(), convertFlags).toChar() ); + if (aStr.isEmpty()) + PushInt(0); + else + { + //"classic" ByteString conversion flags + const sal_uInt32 convertFlags = + RTL_UNICODETOTEXT_FLAGS_NONSPACING_IGNORE | + RTL_UNICODETOTEXT_FLAGS_CONTROL_IGNORE | + RTL_UNICODETOTEXT_FLAGS_FLUSH | + RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT | + RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT | + RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE; + PushInt( (unsigned char) OUStringToOString(OUString(aStr[0]), osl_getThreadTextEncoding(), convertFlags).toChar() ); + } } void ScInterpreter::ScChar() commit e2bac0ce8c1a256a20efc1edd2ac27df248b0e56 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Apr 9 14:43:09 2015 +0100 Resolves: tdf#90384 queue_resize needs to Invalidate the optimal cache size but the PanelLayout didn't (cherry picked from commit b39a6449d5debc7cdf55c3f967b441f3de4d50f3) Conflicts: svx/source/sidebar/PanelLayout.cxx vcl/source/window/dockwin.cxx vcl/source/window/syswin.cxx Change-Id: I38a8975f1488fa2a2ffe91b66745e1a1c6c48a28 Reviewed-on: https://gerrit.libreoffice.org/15215 Tested-by: David Tardon <dtar...@redhat.com> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 7e09b26..ce43cd4 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1192,9 +1192,11 @@ protected: * the preferred widget size. * * Use get_preferred_size to retrieve this value - * mediated via height and width requests + * cached and mediated via height and width requests */ virtual Size GetOptimalSize() const; + /// clear OptimalSize cache + void InvalidateSizeCache(); private: SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const; diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx index 08256d1..b55b5da 100644 --- a/svx/source/sidebar/PanelLayout.cxx +++ b/svx/source/sidebar/PanelLayout.cxx @@ -51,6 +51,7 @@ void PanelLayout::queue_resize(StateChangedType /*eReason*/) return; if (!isLayoutEnabled(this)) return; + InvalidateSizeCache(); m_aPanelLayoutTimer.Start(); } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 6ecf711..f694081 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -994,9 +994,7 @@ void SystemWindow::queue_resize(StateChangedType /*eReason*/) return; if (!isLayoutEnabled()) return; - WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; - pWindowImpl->mnOptimalWidthCache = -1; - pWindowImpl->mnOptimalHeightCache = -1; + InvalidateSizeCache(); maLayoutTimer.Start(); } diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 8fe7d9d..e4388d8 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1427,16 +1427,23 @@ namespace } } +void Window::InvalidateSizeCache() +{ + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; + pWindowImpl->mnOptimalWidthCache = -1; + pWindowImpl->mnOptimalHeightCache = -1; +} + void Window::queue_resize(StateChangedType eReason) { bool bSomeoneCares = queue_ungrouped_resize(this); - WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; if (eReason != StateChangedType::VISIBLE) { - pWindowImpl->mnOptimalWidthCache = -1; - pWindowImpl->mnOptimalHeightCache = -1; + InvalidateSizeCache(); } + + WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl; if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VCL_SIZE_GROUP_NONE) { std::set<vcl::Window*> &rWindows = pWindowImpl->m_xSizeGroup->get_widgets(); commit 03f3e08aac8ca5e82ebf4230f72729099a7dbaa0 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sun Apr 12 15:01:23 2015 +0200 tdf#75614 RTF import: fix missing text after footnote (cherry picked from commit cec5f2eab25578a9859134d697c200089c597faa) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: I5901094cb603c35a1cd8ac718fd434a9dd55729b Reviewed-on: https://gerrit.libreoffice.org/15270 Tested-by: David Tardon <dtar...@redhat.com> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/sw/qa/extras/rtfimport/data/tdf75614.rtf b/sw/qa/extras/rtfimport/data/tdf75614.rtf new file mode 100644 index 0000000..1233801 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf75614.rtf @@ -0,0 +1,18 @@ +{\rtf1\ansi\ansicpg0\uc1\deff0\deflang0\deflangfe0\fet2 +{\*\ftnsep\pard\plain\chftnsep } +{\*\ftnsepc\pard\plain\chftnsepc} +\paperw8391\paperh11906\margl567\margr567\margt567\margb567\headery567\footery6\viewscale150\viewzk0 +{\fonttbl +{\f0\fnil Arial;} +{\f1\fnil\fcharset204 times new roman;} +{\f2\fnil\fcharset204 cambria;} +{\f3\fnil\fcharset238 cambria;} +{\f4\fnil\fcharset0 cambria;} +{\f5\fnil\fcharset204 courier new;} +{\f6\fnil\fcharset204 arial;} +} +{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;} +\pard\plain Before\plain \super \chftn +{\footnote +\pard Footnote.} +\plain after.\par} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 1d77187..8dce8ee 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2252,6 +2252,12 @@ DECLARE_RTFIMPORT_TEST(testTdf88811, "tdf88811.rtf") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), xDrawPage->getCount()); } +DECLARE_RTFIMPORT_TEST(testFdo75614, "tdf75614.rtf") +{ + // Text after the footnote was missing, so this resulted in a css::container::NoSuchElementException. + CPPUNIT_ASSERT_EQUAL(OUString("after."), getRun(getParagraph(1), 3)->getString()); +} + 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 265fa1d..d589598 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2337,8 +2337,12 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) } break; case RTF_CHFTN: - // Nothing to do, dmapper assumes this is the default. + { + if (m_aStates.top().pCurrentBuffer == &m_aSuperBuffer) + // Stop buffering, there will be no custom mark for this footnote or endnote. + m_aStates.top().pCurrentBuffer = 0; break; + } case RTF_PAGE: { // Ignore page breaks inside tables. commit f570b762bba92a791e9a04c37a66770449601444 Author: Caolán McNamara <caol...@redhat.com> Date: Thu Apr 9 20:43:28 2015 +0100 Related: tdf#90472 initial load of bibliography doesn't... set bibliography type moving to a new row will set the new type, but initially its not set because the ListStore property was set after the model is connected to the database so at the initial connection time there isn't a available set of values to map the row to. So move that connection code from general.cxx to datman.cxx and put it before the connection is established we can then remove the intermediate aBibTypeArr list and those resources then need to be global bib ones. (cherry picked from commit 3e41b069bcc1482eb4d3fabb6d475db4bf3d4e57) Conflicts: extensions/source/bibliography/general.cxx Change-Id: I12276c3df9955ec399e1b5de6d0836c69ebb1ebb Reviewed-on: https://gerrit.libreoffice.org/15219 Tested-by: David Tardon <dtar...@redhat.com> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index cc2e1ed..5071624 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> #include <com/sun/star/task/InteractionHandler.hpp> +#include <com/sun/star/form/ListSourceType.hpp> #include <com/sun/star/form/XLoadable.hpp> #include <com/sun/star/form/runtime/FormController.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> @@ -60,12 +61,12 @@ #include "bibresid.hxx" #include "bibmod.hxx" #include "bibview.hxx" -// #100312# --------- #include "bibprop.hrc" #include "toolbar.hxx" #include "toolbar.hrc" #include "bibconfig.hxx" #include "bibbeam.hxx" +#include "general.hxx" #include "bib.hrc" #include "bibliography.hrc" #include <connectivity/dbtools.hxx> @@ -1272,6 +1273,62 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel( xPropSet->setPropertyValue( FM_PROP_CONTROLSOURCE, makeAny( rName ) ); xPropSet->setPropertyValue("NativeWidgetLook", makeAny( true ) ); + if (bForceListBox) + { + uno::Any aAny; + + //uno::Reference< beans::XPropertySet > xPropSet(xControl, UNO_QUERY); + aAny <<= (sal_Int16)1; + xPropSet->setPropertyValue("BoundColumn", aAny); + ListSourceType eSet = ListSourceType_VALUELIST; + aAny.setValue( &eSet, ::cppu::UnoType<ListSourceType>::get() ); + xPropSet->setPropertyValue("ListSourceType", aAny); + + uno::Sequence<OUString> aListSource(TYPE_COUNT); + OUString* pListSourceArr = aListSource.getArray(); + //pListSourceArr[0] = "select TypeName, TypeIndex from TypeNms"; + for(sal_Int32 i = 0; i < TYPE_COUNT; ++i) + pListSourceArr[i] = OUString::number(i); + aAny.setValue(&aListSource, cppu::UnoType<uno::Sequence<OUString>>::get()); + + xPropSet->setPropertyValue("ListSource", aAny); + + uno::Sequence<OUString> aValues(TYPE_COUNT + 1); + OUString* pValuesArr = aValues.getArray(); + pValuesArr[0] = BIB_RESSTR(ST_TYPE_ARTICLE); + pValuesArr[1] = BIB_RESSTR(ST_TYPE_BOOK); + pValuesArr[2] = BIB_RESSTR(ST_TYPE_BOOKLET); + pValuesArr[3] = BIB_RESSTR(ST_TYPE_CONFERENCE); + pValuesArr[4] = BIB_RESSTR(ST_TYPE_INBOOK ); + pValuesArr[5] = BIB_RESSTR(ST_TYPE_INCOLLECTION); + pValuesArr[6] = BIB_RESSTR(ST_TYPE_INPROCEEDINGS); + pValuesArr[7] = BIB_RESSTR(ST_TYPE_JOURNAL ); + pValuesArr[8] = BIB_RESSTR(ST_TYPE_MANUAL ); + pValuesArr[9] = BIB_RESSTR(ST_TYPE_MASTERSTHESIS); + pValuesArr[10] = BIB_RESSTR(ST_TYPE_MISC ); + pValuesArr[11] = BIB_RESSTR(ST_TYPE_PHDTHESIS ); + pValuesArr[12] = BIB_RESSTR(ST_TYPE_PROCEEDINGS ); + pValuesArr[13] = BIB_RESSTR(ST_TYPE_TECHREPORT ); + pValuesArr[14] = BIB_RESSTR(ST_TYPE_UNPUBLISHED ); + pValuesArr[15] = BIB_RESSTR(ST_TYPE_EMAIL ); + pValuesArr[16] = BIB_RESSTR(ST_TYPE_WWW ); + pValuesArr[17] = BIB_RESSTR(ST_TYPE_CUSTOM1 ); + pValuesArr[18] = BIB_RESSTR(ST_TYPE_CUSTOM2 ); + pValuesArr[19] = BIB_RESSTR(ST_TYPE_CUSTOM3 ); + pValuesArr[20] = BIB_RESSTR(ST_TYPE_CUSTOM4 ); + pValuesArr[21] = BIB_RESSTR(ST_TYPE_CUSTOM5 ); + // empty string if an invalid value no values is set + pValuesArr[TYPE_COUNT].clear(); + + aAny.setValue(&aValues, cppu::UnoType<uno::Sequence<OUString>>::get()); + + xPropSet->setPropertyValue("StringItemList", aAny); + + sal_Bool bTrue = sal_True; + aAny.setValue( &bTrue, cppu::UnoType<bool>::get() ); + xPropSet->setPropertyValue( "Dropdown", aAny ); + } + Reference< XFormComponent > aFormComp(xModel,UNO_QUERY ); Reference< XNameContainer > xNameCont( m_xForm, UNO_QUERY ); diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index a08caf9..1ed5ec9 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -23,7 +23,6 @@ #include <com/sun/star/sdb/XColumn.hpp> #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> -#include <com/sun/star/form/ListSourceType.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <toolkit/helper/vclunohelper.hxx> #include <cppuhelper/implbase1.hxx> @@ -204,29 +203,6 @@ BibGeneralPage::BibGeneralPage(vcl::Window* pParent, BibDataManager* pMan): get(pCustom4FT, "custom4"); get(pCustom5FT, "custom5"); - aBibTypeArr[0] = BIB_RESSTR(ST_TYPE_ARTICLE); - aBibTypeArr[1] = BIB_RESSTR(ST_TYPE_BOOK); - aBibTypeArr[2] = BIB_RESSTR(ST_TYPE_BOOKLET); - aBibTypeArr[3] = BIB_RESSTR(ST_TYPE_CONFERENCE); - aBibTypeArr[4] = BIB_RESSTR(ST_TYPE_INBOOK ); - aBibTypeArr[5] = BIB_RESSTR(ST_TYPE_INCOLLECTION); - aBibTypeArr[6] = BIB_RESSTR(ST_TYPE_INPROCEEDINGS); - aBibTypeArr[7] = BIB_RESSTR(ST_TYPE_JOURNAL ); - aBibTypeArr[8] = BIB_RESSTR(ST_TYPE_MANUAL ); - aBibTypeArr[9] = BIB_RESSTR(ST_TYPE_MASTERSTHESIS); - aBibTypeArr[10] = BIB_RESSTR(ST_TYPE_MISC ); - aBibTypeArr[11] = BIB_RESSTR(ST_TYPE_PHDTHESIS ); - aBibTypeArr[12] = BIB_RESSTR(ST_TYPE_PROCEEDINGS ); - aBibTypeArr[13] = BIB_RESSTR(ST_TYPE_TECHREPORT ); - aBibTypeArr[14] = BIB_RESSTR(ST_TYPE_UNPUBLISHED ); - aBibTypeArr[15] = BIB_RESSTR(ST_TYPE_EMAIL ); - aBibTypeArr[16] = BIB_RESSTR(ST_TYPE_WWW ); - aBibTypeArr[17] = BIB_RESSTR(ST_TYPE_CUSTOM1 ); - aBibTypeArr[18] = BIB_RESSTR(ST_TYPE_CUSTOM2 ); - aBibTypeArr[19] = BIB_RESSTR(ST_TYPE_CUSTOM3 ); - aBibTypeArr[20] = BIB_RESSTR(ST_TYPE_CUSTOM4 ); - aBibTypeArr[21] = BIB_RESSTR(ST_TYPE_CUSTOM5 ); - InitFixedTexts(); sal_Int16* pMap = nFT2CtrlMap; @@ -430,7 +406,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( uno::Reference< awt::XControlModel > xCtrModel; try { - bool bTypeListBox = sTypeColumnName == rName; + const bool bTypeListBox = sTypeColumnName == rName; xCtrModel = pDatMan->loadControlModel(rName, bTypeListBox); if ( xCtrModel.is() ) { @@ -440,9 +416,17 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( { uno::Reference< beans::XPropertySetInfo > xPropInfo = xPropSet->getPropertySetInfo(); - uno::Any aAny = xPropSet->getPropertyValue( "DefaultControl" ); OUString aControlName; - aAny >>= aControlName; + if (bTypeListBox) + { + aControlName = "com.sun.star.form.control.ListBox"; + xLBModel = Reference< form::XBoundComponent >(xCtrModel, UNO_QUERY); + } + else + { + uno::Any aAny = xPropSet->getPropertyValue( "DefaultControl" ); + aAny >>= aControlName; + } OUString uProp("HelpURL"); if(xPropInfo->hasPropertyByName(uProp)) @@ -453,44 +437,6 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl( xPropSet->setPropertyValue( uProp, makeAny( sId ) ); } - if(bTypeListBox) - { - //uno::Reference< beans::XPropertySet > xPropSet(xControl, UNO_QUERY); - aAny <<= (sal_Int16)1; - xPropSet->setPropertyValue("BoundColumn", aAny); - ListSourceType eSet = ListSourceType_VALUELIST; - aAny.setValue( &eSet, ::cppu::UnoType<ListSourceType>::get() ); - xPropSet->setPropertyValue("ListSourceType", aAny); - - uno::Sequence<OUString> aListSource(TYPE_COUNT); - OUString* pListSourceArr = aListSource.getArray(); - //pListSourceArr[0] = "select TypeName, TypeIndex from TypeNms"; - for(sal_Int32 i = 0; i < TYPE_COUNT; ++i) - pListSourceArr[i] = OUString::number(i); - aAny.setValue(&aListSource, ::getCppuType((uno::Sequence<OUString>*)0)); - - xPropSet->setPropertyValue("ListSource", aAny); - - uno::Sequence<OUString> aValues(TYPE_COUNT + 1); - OUString* pValuesArr = aValues.getArray(); - for(sal_uInt16 j = 0; j < TYPE_COUNT; j++) - pValuesArr[j] = aBibTypeArr[j]; - // empty string if an invalid value no values is set - pValuesArr[TYPE_COUNT].clear(); - - aAny.setValue(&aValues, ::getCppuType((uno::Sequence<OUString>*)0)); - - xPropSet->setPropertyValue("StringItemList", aAny); - - sal_Bool bTrue = sal_True; - aAny.setValue( &bTrue, ::getBooleanCppuType() ); - xPropSet->setPropertyValue( "Dropdown", aAny ); - - aControlName = "com.sun.star.form.control.ListBox"; - xLBModel = Reference< form::XBoundComponent >(xCtrModel, UNO_QUERY); - - } - uno::Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); uno::Reference< awt::XControl > xControl( xContext->getServiceManager()->createInstanceWithContext(aControlName, xContext), UNO_QUERY); if ( xControl.is() ) diff --git a/extensions/source/bibliography/general.hxx b/extensions/source/bibliography/general.hxx index 9e96c33..0b89c0e 100644 --- a/extensions/source/bibliography/general.hxx +++ b/extensions/source/bibliography/general.hxx @@ -96,7 +96,6 @@ class BibGeneralPage: public BibGeneralPageBaseClass, public BibTabPage ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > aControls[ FIELD_COUNT ]; - OUString aBibTypeArr[ TYPE_COUNT ]; OUString sErrorPrefix; OUString sTableErrorString; commit ddbafbcb41697b6df0080d13e267accb9323f3a5 Author: Matthias Freund <matti...@secure.mailbox.org> Date: Sun Apr 12 01:56:20 2015 +0200 tdf#75256 Improve sifr - connectors and lines - lc Inkscape redraw of the old bitmap icons and exported as png. Change-Id: Id4b69be05cf8dd7d0683bcd9d693723d5e8f4a0a Reviewed-on: https://gerrit.libreoffice.org/15257 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> (cherry picked from commit 88bf8325f7ae49f949704021081a195d25985867) Reviewed-on: https://gerrit.libreoffice.org/15261 Tested-by: David Tardon <dtar...@redhat.com> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/icon-themes/sifr/cmd/lc_connector.png b/icon-themes/sifr/cmd/lc_connector.png index 6ebb410..3371ca9 100644 Binary files a/icon-themes/sifr/cmd/lc_connector.png and b/icon-themes/sifr/cmd/lc_connector.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorarrowend.png b/icon-themes/sifr/cmd/lc_connectorarrowend.png index 9bdf509..af249b7 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorarrowend.png and b/icon-themes/sifr/cmd/lc_connectorarrowend.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorarrows.png b/icon-themes/sifr/cmd/lc_connectorarrows.png index e597e03..fab39fb 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorarrows.png and b/icon-themes/sifr/cmd/lc_connectorarrows.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorarrowstart.png b/icon-themes/sifr/cmd/lc_connectorarrowstart.png new file mode 100644 index 0000000..a7f97f3 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorarrowstart.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcircleend.png b/icon-themes/sifr/cmd/lc_connectorcircleend.png new file mode 100644 index 0000000..87b021c Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorcircleend.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcircles.png b/icon-themes/sifr/cmd/lc_connectorcircles.png new file mode 100644 index 0000000..f92d0f6 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorcircles.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcirclestart.png b/icon-themes/sifr/cmd/lc_connectorcirclestart.png new file mode 100644 index 0000000..6354bdb Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorcirclestart.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcurve.png b/icon-themes/sifr/cmd/lc_connectorcurve.png index 09e8556..6e3531b 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorcurve.png and b/icon-themes/sifr/cmd/lc_connectorcurve.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcurvearrowend.png b/icon-themes/sifr/cmd/lc_connectorcurvearrowend.png index 3f6c1ef..209e0f5 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorcurvearrowend.png and b/icon-themes/sifr/cmd/lc_connectorcurvearrowend.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcurvearrows.png b/icon-themes/sifr/cmd/lc_connectorcurvearrows.png index 18eaea0..a6bb8cd 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorcurvearrows.png and b/icon-themes/sifr/cmd/lc_connectorcurvearrows.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcurvearrowstart.png b/icon-themes/sifr/cmd/lc_connectorcurvearrowstart.png new file mode 100644 index 0000000..9585ccf Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorcurvearrowstart.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcurvecircleend.png b/icon-themes/sifr/cmd/lc_connectorcurvecircleend.png new file mode 100644 index 0000000..4bd7192 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorcurvecircleend.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcurvecircles.png b/icon-themes/sifr/cmd/lc_connectorcurvecircles.png new file mode 100644 index 0000000..ab6e8b2 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorcurvecircles.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorcurvecirclestart.png b/icon-themes/sifr/cmd/lc_connectorcurvecirclestart.png new file mode 100644 index 0000000..0468538 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorcurvecirclestart.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorline.png b/icon-themes/sifr/cmd/lc_connectorline.png index 323b481..67714c7 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorline.png and b/icon-themes/sifr/cmd/lc_connectorline.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinearrowend.png b/icon-themes/sifr/cmd/lc_connectorlinearrowend.png index 73d8a52..3648c86 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorlinearrowend.png and b/icon-themes/sifr/cmd/lc_connectorlinearrowend.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinearrows.png b/icon-themes/sifr/cmd/lc_connectorlinearrows.png index dcd2b27..7990ed2 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorlinearrows.png and b/icon-themes/sifr/cmd/lc_connectorlinearrows.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinearrowstart.png b/icon-themes/sifr/cmd/lc_connectorlinearrowstart.png new file mode 100644 index 0000000..0e24856 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorlinearrowstart.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinecircleend.png b/icon-themes/sifr/cmd/lc_connectorlinecircleend.png new file mode 100644 index 0000000..9230987 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorlinecircleend.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinecircles.png b/icon-themes/sifr/cmd/lc_connectorlinecircles.png new file mode 100644 index 0000000..840f3dc Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorlinecircles.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinecirclestart.png b/icon-themes/sifr/cmd/lc_connectorlinecirclestart.png new file mode 100644 index 0000000..f70d3d1 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorlinecirclestart.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlines.png b/icon-themes/sifr/cmd/lc_connectorlines.png index c12ff9d..71115b5 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorlines.png and b/icon-themes/sifr/cmd/lc_connectorlines.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinesarrowend.png b/icon-themes/sifr/cmd/lc_connectorlinesarrowend.png index dc0d51b..cbf6c6b 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorlinesarrowend.png and b/icon-themes/sifr/cmd/lc_connectorlinesarrowend.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinesarrows.png b/icon-themes/sifr/cmd/lc_connectorlinesarrows.png index b711986..37e66e0 100644 Binary files a/icon-themes/sifr/cmd/lc_connectorlinesarrows.png and b/icon-themes/sifr/cmd/lc_connectorlinesarrows.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinesarrowstart.png b/icon-themes/sifr/cmd/lc_connectorlinesarrowstart.png new file mode 100644 index 0000000..f39f192 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorlinesarrowstart.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinescircleend.png b/icon-themes/sifr/cmd/lc_connectorlinescircleend.png new file mode 100644 index 0000000..01b4f21 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorlinescircleend.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinescircles.png b/icon-themes/sifr/cmd/lc_connectorlinescircles.png new file mode 100644 index 0000000..01d5d75 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorlinescircles.png differ diff --git a/icon-themes/sifr/cmd/lc_connectorlinescirclestart.png b/icon-themes/sifr/cmd/lc_connectorlinescirclestart.png new file mode 100644 index 0000000..6d1f404 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_connectorlinescirclestart.png differ diff --git a/icon-themes/sifr/cmd/lc_line.png b/icon-themes/sifr/cmd/lc_line.png index 3a8795a..38355f1 100644 Binary files a/icon-themes/sifr/cmd/lc_line.png and b/icon-themes/sifr/cmd/lc_line.png differ diff --git a/icon-themes/sifr/cmd/lc_linearrowcircle.png b/icon-themes/sifr/cmd/lc_linearrowcircle.png new file mode 100644 index 0000000..a450f84 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_linearrowcircle.png differ diff --git a/icon-themes/sifr/cmd/lc_linearrowend.png b/icon-themes/sifr/cmd/lc_linearrowend.png index 4429229..1d07dfc 100644 Binary files a/icon-themes/sifr/cmd/lc_linearrowend.png and b/icon-themes/sifr/cmd/lc_linearrowend.png differ diff --git a/icon-themes/sifr/cmd/lc_linearrows.png b/icon-themes/sifr/cmd/lc_linearrows.png new file mode 100644 index 0000000..4845224 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_linearrows.png differ diff --git a/icon-themes/sifr/cmd/lc_linearrowsquare.png b/icon-themes/sifr/cmd/lc_linearrowsquare.png new file mode 100644 index 0000000..535b36b Binary files /dev/null and b/icon-themes/sifr/cmd/lc_linearrowsquare.png differ diff --git a/icon-themes/sifr/cmd/lc_linearrowstart.png b/icon-themes/sifr/cmd/lc_linearrowstart.png new file mode 100644 index 0000000..40936b7 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_linearrowstart.png differ diff --git a/icon-themes/sifr/cmd/lc_linecirclearrow.png b/icon-themes/sifr/cmd/lc_linecirclearrow.png new file mode 100644 index 0000000..4f87b7e Binary files /dev/null and b/icon-themes/sifr/cmd/lc_linecirclearrow.png differ diff --git a/icon-themes/sifr/cmd/lc_linediagonal.png b/icon-themes/sifr/cmd/lc_linediagonal.png new file mode 100644 index 0000000..8d92641 Binary files /dev/null and b/icon-themes/sifr/cmd/lc_linediagonal.png differ diff --git a/icon-themes/sifr/cmd/lc_linesquarearrow.png b/icon-themes/sifr/cmd/lc_linesquarearrow.png new file mode 100644 index 0000000..535b36b Binary files /dev/null and b/icon-themes/sifr/cmd/lc_linesquarearrow.png differ diff --git a/icon-themes/sifr/cmd/lc_measureline.png b/icon-themes/sifr/cmd/lc_measureline.png new file mode 100644 index 0000000..daa25cb Binary files /dev/null and b/icon-themes/sifr/cmd/lc_measureline.png differ commit 23544a95de23bf633ad084d5fbde5a2e0ebf88fe Author: Adolfo Jayme Barrientos <fit...@ubuntu.com> Date: Sat Apr 11 17:41:34 2015 -0500 Personas: add ânon_homogeneousâ to status message ⦠so that it avoids changing the size of the buttons in some languages. Change-Id: Ida4c6a7f0af338240c61d8febf3b871b577def0e (cherry picked from commit 04b74906e28aa6732ba4bfcd97f4028c0201c166) Reviewed-on: https://gerrit.libreoffice.org/15258 Tested-by: David Tardon <dtar...@redhat.com> Reviewed-by: David Tardon <dtar...@redhat.com> diff --git a/cui/uiconfig/ui/select_persona_dialog.ui b/cui/uiconfig/ui/select_persona_dialog.ui index 47dc17e..ee5100a 100644 --- a/cui/uiconfig/ui/select_persona_dialog.ui +++ b/cui/uiconfig/ui/select_persona_dialog.ui @@ -76,6 +76,7 @@ <property name="fill">True</property> <property name="position">3</property> <property name="secondary">True</property> + <property name="non_homogeneous">True</property> </packing> </child> </object> @@ -108,7 +109,7 @@ <object class="GtkBox" id="box4"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="spacing">12</property> + <property name="spacing">6</property> <child> <object class="GtkEntry" id="search_term"> <property name="visible">True</property> @@ -202,7 +203,7 @@ <object class="GtkBox" id="box7"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="spacing">12</property> + <property name="spacing">6</property> <child> <object class="GtkButton" id="suggestion1"> <property name="visible">True</property> commit e304acd2493908b39052af3e914add7ce227d3aa Author: Andras Timar <andras.ti...@collabora.com> Date: Thu Apr 2 13:42:11 2015 +0200 tdf#90403 PPTX import: use real table size PowerPoint ignores a:ext cx and cy value of p:xfrm, and uses real table width and height. PowerPoint 2010 saves files where cx and cy contains good values, but I found files in the wild whose cx and cy values did not match to actual table width and height, and there was a visible difference between rendering of Impress and PowerPoint. Change-Id: I3f80c0cea4cac46763d449f918bb78dca1a6562d Reviewed-on: https://gerrit.libreoffice.org/15123 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Andras Timar <andras.ti...@collabora.com> (cherry picked from commit 037fe3671cbdad51f52d2f69f72f47f463dba7c2) Reviewed-on: https://gerrit.libreoffice.org/15132 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 81249e5..81251f2 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -405,6 +405,23 @@ Reference< XShape > Shape::createAndInsert( bool bIsEmbMedia = false; SAL_INFO("oox.drawingml", OSL_THIS_FUNC << " id: " << msId); + // tdf#90403 PowerPoint ignores a:ext cx and cy values of p:xfrm, and uses real table width and height + if ( mpTablePropertiesPtr.get() && rServiceName == "com.sun.star.drawing.TableShape" ) + { + maSize.Width = 0; + for( std::vector< sal_Int32 >::const_iterator aTableColIter(mpTablePropertiesPtr->getTableGrid().begin()); + aTableColIter != mpTablePropertiesPtr->getTableGrid().end(); aTableColIter++ ) + { + maSize.Width += *aTableColIter; + } + maSize.Height = 0; + for( std::vector< ::oox::drawingml::table::TableRow >::const_iterator aTableRowIter(mpTablePropertiesPtr->getTableRows().begin()); + aTableRowIter != mpTablePropertiesPtr->getTableRows().end(); aTableRowIter++ ) + { + maSize.Height += (*aTableRowIter).getHeight(); + } + } + awt::Rectangle aShapeRectHmm( maPosition.X / EMU_PER_HMM, maPosition.Y / EMU_PER_HMM, maSize.Width / EMU_PER_HMM, maSize.Height / EMU_PER_HMM ); OUString aServiceName; diff --git a/sd/qa/unit/data/tdf90403.pptx b/sd/qa/unit/data/tdf90403.pptx new file mode 100644 index 0000000..fd48d05 Binary files /dev/null and b/sd/qa/unit/data/tdf90403.pptx differ diff --git a/sd/qa/unit/data/xml/tdf90403_0.xml b/sd/qa/unit/data/xml/tdf90403_0.xml new file mode 100644 index 0000000..297504d --- /dev/null +++ b/sd/qa/unit/data/xml/tdf90403_0.xml @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<XShapes> + <XShape positionX="4233" positionY="3881" sizeX="16932" sizeY="14044" type="com.sun.star.drawing.TableShape" name="Table 1"/> +</XShapes> diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index c9de7bd..7103e3f 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -179,6 +179,7 @@ void SdImportTest::testDocumentLayout() { "n593612.pptx", "xml/n593612_", PPTX, -1 }, { "fdo71434.pptx", "xml/fdo71434_", PPTX, -1 }, { "n902652.pptx", "xml/n902652_", PPTX, -1 }, + { "tdf90403.pptx", "xml/tdf90403_", PPTX, -1 }, // { "pptx/n828390.pptx", "pptx/xml/n828390_", PPTX, PPTX }, // Example }; commit d6018eac98b5582d8c2fc5bd4893648b51c2afcf Author: Caolán McNamara <caol...@redhat.com> Date: Thu Mar 26 11:04:52 2015 +0000 survive 'enable jre' dialog interrupting CreateAccessibilityObjects Change-Id: I4395160780fc055d14554ad62c6ec757ec8dbbe1 (cherry picked from commit f2fcf221a42a87a4604cecd1b6b29d4c20986ec0) Reviewed-on: https://gerrit.libreoffice.org/15093 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index 12e4054..869c5dd 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -276,13 +276,23 @@ void ChildrenManagerImpl::Update (bool bCreateNewObjectsOnDemand) // 6. If children have to be created immediately and not on demand then // create the missing accessible objects now. - if ( ! bCreateNewObjectsOnDemand) - CreateAccessibilityObjects (maVisibleChildren); + if (!bCreateNewObjectsOnDemand) + { + //operate on a copy of the list and restore it afterwards to guard + //against the pathological case where maVisibleChildren gets modified + //by other calls to this object while CreateAccessibilityObjects + //executes which can happen when java is disabled and the "enable-java" + //dialog appears during the instantiation of the linguistic components + //triggered by the creation of shapes belonging to the a11y objects + // + //i.e. launch start-center, launch impress with java disabled and + //a java-using linguistic component installed + maVisibleChildren.swap(aChildList); + CreateAccessibilityObjects(aChildList); + maVisibleChildren.swap(aChildList); + } } - - - void ChildrenManagerImpl::CreateListOfVisibleShapes ( ChildDescriptorListType& raDescriptorList) { commit 50749c2bc8c2395609bf153bc55fc6357aabf9f4 Author: Matthias Freund <matti...@secure.mailbox.org> Date: Sat Apr 11 13:55:12 2015 +0200 Sifr: Adding lc_autofilter and sc_autofilter Change-Id: I3a874c27e10df0366cbbec4bfaf972fc4bcd66bf Reviewed-on: https://gerrit.libreoffice.org/15245 Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> (cherry picked from commit 04c4287714dec047ec64ff6604cc6045f726d9d8) Reviewed-on: https://gerrit.libreoffice.org/15254 diff --git a/icon-themes/sifr/cmd/lc_autofilter.png b/icon-themes/sifr/cmd/lc_autofilter.png new file mode 100644 index 0000000..9e8c53c Binary files /dev/null and b/icon-themes/sifr/cmd/lc_autofilter.png differ diff --git a/icon-themes/sifr/cmd/sc_autofilter.png b/icon-themes/sifr/cmd/sc_autofilter.png new file mode 100644 index 0000000..5cf12ba Binary files /dev/null and b/icon-themes/sifr/cmd/sc_autofilter.png differ commit e254df533284e59c30470445ef3af6dedd73fa1f Author: Matthias Freund <matti...@secure.mailbox.org> Date: Sat Apr 11 22:42:30 2015 +0200 tdf#89617 Sifr icon style "Print document directly" icon same as "Print" sifr lc_printdefault and sc_printdefault have now a flash inside like in oxygen/tango style. Change-Id: Ic960371748a0b76c38d329f92f209be2240ca1ce Reviewed-on: https://gerrit.libreoffice.org/15255 Tested-by: Yousuf Philips <philip...@hotmail.com> Reviewed-by: Yousuf Philips <philip...@hotmail.com> (cherry picked from commit b9b6957ff3fcd2d5828bc2e23e6781fb5292cd63) Reviewed-on: https://gerrit.libreoffice.org/15256 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/icon-themes/sifr/cmd/lc_printdefault.png b/icon-themes/sifr/cmd/lc_printdefault.png index 30966e8..0024548 100644 Binary files a/icon-themes/sifr/cmd/lc_printdefault.png and b/icon-themes/sifr/cmd/lc_printdefault.png differ diff --git a/icon-themes/sifr/cmd/sc_printdefault.png b/icon-themes/sifr/cmd/sc_printdefault.png index 93896c3..d1988f2 100644 Binary files a/icon-themes/sifr/cmd/sc_printdefault.png and b/icon-themes/sifr/cmd/sc_printdefault.png differ commit c86f8a16ed3a8da8faf476f7a650df4b0bebf726 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu Apr 9 14:20:44 2015 +0200 tdf#89214 SwDoc::GetUniqueNumRuleName: always return pChkStr if it's unused Regression from commit bb00a0097900ae054401f7758a915047cfde4065 (do not bother with nice unique names during mailmerge, 2014-11-08), SwAttrSet::CopyToModify() expects that in case SwDoc::FindNumRulePtr() returns 0 for a name, then the call to SwDoc::MakeNumRule() will use the not found name (as SwDoc::GetUniqueNumRuleName() will return the just checked name). As a result, simply always returning a random unique name during mail merge is a problem. Only return a cheap random unique name if no hint is given. (cherry picked from commit ceafd0a76fb062237f627cd9d49d4aad78cf3066) Conflicts: sw/qa/extras/mailmerge/mailmerge.cxx Change-Id: I49d65009ced97d00aa2e8db35a529f2f30ac9ae5 Reviewed-on: https://gerrit.libreoffice.org/15229 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/qa/extras/mailmerge/data/tdf89214.odt b/sw/qa/extras/mailmerge/data/tdf89214.odt new file mode 100644 index 0000000..70def37 Binary files /dev/null and b/sw/qa/extras/mailmerge/data/tdf89214.odt differ diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index d17c835..3ac9724 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -334,6 +334,18 @@ DECLARE_SHELL_MAILMERGE_TEST(testPageBoundaries2Pages, "simple-mail-merge-2pages } } +DECLARE_SHELL_MAILMERGE_TEST(testTdf89214, "tdf89214.odt", "10-testing-addresses.ods", "testing-addresses") +{ + executeMailMerge(); + + uno::Reference<text::XTextDocument> xTextDocument(mxMMComponent, uno::UNO_QUERY); + uno::Reference<text::XTextRange> xParagraph(getParagraphOrTable(3, xTextDocument->getText()), uno::UNO_QUERY); + // Make sure that we assert the right paragraph. + CPPUNIT_ASSERT_EQUAL(OUString("a"), xParagraph->getString()); + // This paragraph had a bullet numbering, make sure that the list id is not empty. + CPPUNIT_ASSERT(!getProperty<OUString>(xParagraph, "ListId").isEmpty()); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 835b1e1..f767f9a 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2188,13 +2188,13 @@ sal_uInt16 SwDoc::MakeNumRule( const OUString &rName, OUString SwDoc::GetUniqueNumRuleName( const OUString* pChkStr, bool bAutoNum ) const { - if( IsInMailMerge()) + // If we got pChkStr, then the caller expects that in case it's not yet + // used, it'll be returned. + if( IsInMailMerge() && !pChkStr ) { OUString newName = "MailMergeNumRule" + OStringToOUString( DateTimeToOString( DateTime( DateTime::SYSTEM )), RTL_TEXTENCODING_ASCII_US ) + OUString::number( mpNumRuleTbl->size() + 1 ); - if( pChkStr ) - newName += *pChkStr; return newName; } commit 45062565368d61c1928ebc4d9d1614392a4e9123 Author: Eike Rathke <er...@redhat.com> Date: Sat Apr 11 00:03:21 2015 +0200 icu: various regex fixes Backported from http://bugs.icu-project.org/trac/changeset/36724 http://bugs.icu-project.org/trac/changeset/36727 http://bugs.icu-project.org/trac/changeset/36801 Change-Id: Ib9a0d47466287fdc1d33fb191c97bc2c45116c80 Reviewed-on: https://gerrit.libreoffice.org/15237 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk index af9c751..e785d6f 100644 --- a/external/icu/UnpackedTarball_icu.mk +++ b/external/icu/UnpackedTarball_icu.mk @@ -27,6 +27,9 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\ external/icu/icu4c-icu11131.patch.1 \ external/icu/icu4c-scriptrun.patch \ external/icu/icu4c-icu11451.patch.1 \ + external/icu/icu.changeset_36724.patch.1 \ + external/icu/icu.changeset_36727.patch.1 \ + external/icu/icu.changeset_36801.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/icu/icu.changeset_36724.patch.1 b/external/icu/icu.changeset_36724.patch.1 new file mode 100644 index 0000000..aba5a56 --- /dev/null +++ b/external/icu/icu.changeset_36724.patch.1 @@ -0,0 +1,37 @@ +diff -ru2 icu/source/i18n/regexcmp.cpp icu/source/i18n/regexcmp.cpp +--- icu/source/i18n/regexcmp.cpp 2013-10-04 22:48:42.000000000 +0200 ++++ icu/source/i18n/regexcmp.cpp 2015-04-10 17:59:24.568227804 +0200 +@@ -2134,4 +2134,8 @@ + int32_t minML = minMatchLength(fMatchOpenParen, patEnd); + int32_t maxML = maxMatchLength(fMatchOpenParen, patEnd); ++ if (URX_TYPE(maxML) != 0) { ++ error(U_REGEX_LOOK_BEHIND_LIMIT); ++ break; ++ } + if (maxML == INT32_MAX) { + error(U_REGEX_LOOK_BEHIND_LIMIT); +@@ -2167,4 +2171,8 @@ + int32_t minML = minMatchLength(fMatchOpenParen, patEnd); + int32_t maxML = maxMatchLength(fMatchOpenParen, patEnd); ++ if (URX_TYPE(maxML) != 0) { ++ error(U_REGEX_LOOK_BEHIND_LIMIT); ++ break; ++ } + if (maxML == INT32_MAX) { + error(U_REGEX_LOOK_BEHIND_LIMIT); +diff -ru2 icu/source/test/testdata/regextst.txt icu/source/test/testdata/regextst.txt +--- icu/source/test/testdata/regextst.txt 2013-10-04 22:48:12.000000000 +0200 ++++ icu/source/test/testdata/regextst.txt 2015-04-10 18:00:41.254717186 +0200 +@@ -1174,4 +1174,12 @@ + + ++# Bug 11370 ++# Max match length computation of look-behind expression gives result that is too big to fit in the ++# in the 24 bit operand portion of the compiled code. Expressions should fail to compile ++# (Look-behind match length must be bounded. This case is treated as unbounded, an error.) ++ ++"(?<!(0123456789a){10000000})x" E "no match" ++"(?<!\\ubeaf(\\ubeaf{11000}){11000})" E "no match" ++ + # Random debugging, Temporary + # diff --git a/external/icu/icu.changeset_36727.patch.1 b/external/icu/icu.changeset_36727.patch.1 new file mode 100644 index 0000000..567a532 --- /dev/null +++ b/external/icu/icu.changeset_36727.patch.1 @@ -0,0 +1,52 @@ +diff -ru2 1.icu/source/i18n/regexcmp.cpp 2.icu/source/i18n/regexcmp.cpp +--- 1.icu/source/i18n/regexcmp.cpp 2015-04-10 18:07:53.410434700 +0200 ++++ 2.icu/source/i18n/regexcmp.cpp 2015-04-10 18:08:23.356622663 +0200 +@@ -2338,5 +2338,13 @@ + if (fIntervalUpper == 0) { + // Pathological case. Attempt no matches, as if the block doesn't exist. ++ // Discard the generated code for the block. ++ // If the block included parens, discard the info pertaining to them as well. + fRXPat->fCompiledPat->setSize(topOfBlock); ++ if (fMatchOpenParen >= topOfBlock) { ++ fMatchOpenParen = -1; ++ } ++ if (fMatchCloseParen >= topOfBlock) { ++ fMatchCloseParen = -1; ++ } + return TRUE; + } +diff -ru2 1.icu/source/i18n/regexcmp.h 2.icu/source/i18n/regexcmp.h +--- 1.icu/source/i18n/regexcmp.h 2013-10-04 22:48:44.000000000 +0200 ++++ 2.icu/source/i18n/regexcmp.h 2015-04-10 18:08:23.356622663 +0200 +@@ -183,5 +183,7 @@ + // of the slot reserved for a state save + // at the start of the most recently processed +- // parenthesized block. ++ // parenthesized block. Updated when processing ++ // a close to the location for the corresponding open. ++ + int32_t fMatchCloseParen; // The position in the pattern of the first + // location after the most recently processed +diff -ru2 1.icu/source/test/testdata/regextst.txt 2.icu/source/test/testdata/regextst.txt +--- 1.icu/source/test/testdata/regextst.txt 2015-04-10 18:07:53.411434706 +0200 ++++ 2.icu/source/test/testdata/regextst.txt 2015-04-10 18:09:19.386974352 +0200 +@@ -1174,4 +1174,13 @@ + + ++# Bug 11369 ++# Incorrect optimization of patterns with a zero length quantifier {0} ++ ++"(.|b)(|b){0}\$(?#xxx){3}(?>\D*)" "AAAAABBBBBCCCCCDDDDEEEEE" ++"(|b)ab(c)" "<0><1></1>ab<2>c</2></0>" ++"(|b){0}a{3}(D*)" "<0>aaa<2></2></0>" ++"(|b){0,1}a{3}(D*)" "<0><1></1>aaa<2></2></0>" ++"((|b){0})a{3}(D*)" "<0><1></1>aaa<3></3></0>" ++ + # Bug 11370 + # Max match length computation of look-behind expression gives result that is too big to fit in the +@@ -1182,4 +1191,5 @@ + "(?<!\\ubeaf(\\ubeaf{11000}){11000})" E "no match" + ++ + # Random debugging, Temporary + # diff --git a/external/icu/icu.changeset_36801.patch.1 b/external/icu/icu.changeset_36801.patch.1 new file mode 100644 index 0000000..8f94c37 --- /dev/null +++ b/external/icu/icu.changeset_36801.patch.1 @@ -0,0 +1,1222 @@ +diff -ur icu.org/source/common/unicode/utypes.h icu/source/common/unicode/utypes.h +--- icu.org/source/common/unicode/utypes.h 2015-04-10 23:48:23.137187140 +0200 ++++ icu/source/common/unicode/utypes.h 2015-04-10 23:50:28.468988046 +0200 +@@ -647,6 +647,7 @@ + U_REGEX_STACK_OVERFLOW, /**< Regular expression backtrack stack overflow. */ + U_REGEX_TIME_OUT, /**< Maximum allowed match time exceeded */ + U_REGEX_STOPPED_BY_CALLER, /**< Matching operation aborted by user callback fn. */ ++ U_REGEX_PATTERN_TOO_BIG, /**< Pattern exceeds limits on size or complexity. @draft ICU 55 */ + U_REGEX_ERROR_LIMIT, /**< This must always be the last value to indicate the limit for regexp errors */ + + /* +diff -ur icu.org/source/common/utypes.c icu/source/common/utypes.c +--- icu.org/source/common/utypes.c 2015-04-10 23:48:23.125187063 +0200 ++++ icu/source/common/utypes.c 2015-04-10 23:50:28.468988046 +0200 +@@ -1,7 +1,7 @@ + /* + ****************************************************************************** + * +-* Copyright (C) 1997-2011, International Business Machines ++* Copyright (C) 1997-2014, International Business Machines + * Corporation and others. All Rights Reserved. + * + ****************************************************************************** +@@ -165,7 +165,8 @@ + "U_REGEX_INVALID_RANGE", + "U_REGEX_STACK_OVERFLOW", + "U_REGEX_TIME_OUT", +- "U_REGEX_STOPPED_BY_CALLER" ++ "U_REGEX_STOPPED_BY_CALLER", ++ "U_REGEX_PATTERN_TOO_BIG" + }; + + static const char * const +diff -ur icu.org/source/i18n/regexcmp.cpp icu/source/i18n/regexcmp.cpp +--- icu.org/source/i18n/regexcmp.cpp 2015-04-10 23:48:23.173187370 +0200 ++++ icu/source/i18n/regexcmp.cpp 2015-04-10 23:50:28.470988059 +0200 +@@ -302,7 +302,7 @@ + // present in the saved state: the input string position (int64_t) and + // the position in the compiled pattern. + // +- fRXPat->fFrameSize+=RESTACKFRAME_HDRCOUNT; ++ allocateStackData(RESTACKFRAME_HDRCOUNT); + + // + // Optimization pass 1: NOPs, back-references, and case-folding +@@ -368,9 +368,9 @@ + // the start of an ( grouping. + //4 NOP Resreved, will be replaced by a save if there are + // OR | operators at the top level +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_STATE_SAVE, 2), *fStatus); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_JMP, 3), *fStatus); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_FAIL, 0), *fStatus); ++ appendOp(URX_STATE_SAVE, 2); ++ appendOp(URX_JMP, 3); ++ appendOp(URX_FAIL, 0); + + // Standard open nonCapture paren action emits the two NOPs and + // sets up the paren stack frame. +@@ -393,7 +393,7 @@ + } + + // add the END operation to the compiled pattern. +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_END, 0), *fStatus); ++ appendOp(URX_END, 0); + + // Terminate the pattern compilation state machine. + returnVal = FALSE; +@@ -415,14 +415,13 @@ + int32_t savePosition = fParenStack.popi(); + int32_t op = (int32_t)fRXPat->fCompiledPat->elementAti(savePosition); + U_ASSERT(URX_TYPE(op) == URX_NOP); // original contents of reserved location +- op = URX_BUILD(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+1); ++ op = buildOp(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+1); + fRXPat->fCompiledPat->setElementAt(op, savePosition); + + // Append an JMP operation into the compiled pattern. The operand for + // the JMP will eventually be the location following the ')' for the + // group. This will be patched in later, when the ')' is encountered. +- op = URX_BUILD(URX_JMP, 0); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_JMP, 0); + + // Push the position of the newly added JMP op onto the parentheses stack. + // This registers if for fixup when this block's close paren is encountered. +@@ -431,7 +430,7 @@ + // Append a NOP to the compiled pattern. This is the slot reserved + // for a SAVE in the event that there is yet another '|' following + // this one. +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus); ++ appendOp(URX_NOP, 0); + fParenStack.push(fRXPat->fCompiledPat->size()-1, *fStatus); + } + break; +@@ -457,12 +456,10 @@ + // END_CAPTURE is encountered. + { + fixLiterals(); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus); +- int32_t varsLoc = fRXPat->fFrameSize; // Reserve three slots in match stack frame. +- fRXPat->fFrameSize += 3; +- int32_t cop = URX_BUILD(URX_START_CAPTURE, varsLoc); +- fRXPat->fCompiledPat->addElement(cop, *fStatus); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus); ++ appendOp(URX_NOP, 0); ++ int32_t varsLoc = allocateStackData(3); // Reserve three slots in match stack frame. ++ appendOp(URX_START_CAPTURE, varsLoc); ++ appendOp(URX_NOP, 0); + + // On the Parentheses stack, start a new frame and add the postions + // of the two NOPs. Depending on what follows in the pattern, the +@@ -487,8 +484,8 @@ + // is an '|' alternation within the parens. + { + fixLiterals(); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus); ++ appendOp(URX_NOP, 0); ++ appendOp(URX_NOP, 0); + + // On the Parentheses stack, start a new frame and add the postions + // of the two NOPs. +@@ -510,12 +507,10 @@ + // is an '|' alternation within the parens. + { + fixLiterals(); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus); +- int32_t varLoc = fRXPat->fDataSize; // Reserve a data location for saving the +- fRXPat->fDataSize += 1; // state stack ptr. +- int32_t stoOp = URX_BUILD(URX_STO_SP, varLoc); +- fRXPat->fCompiledPat->addElement(stoOp, *fStatus); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus); ++ appendOp(URX_NOP, 0); ++ int32_t varLoc = allocateData(1); // Reserve a data location for saving the state stack ptr. ++ appendOp(URX_STO_SP, varLoc); ++ appendOp(URX_NOP, 0); + + // On the Parentheses stack, start a new frame and add the postions + // of the two NOPs. Depending on what follows in the pattern, the +@@ -558,26 +553,14 @@ + // Two data slots are reserved, for saving the stack ptr and the input position. + { + fixLiterals(); +- int32_t dataLoc = fRXPat->fDataSize; +- fRXPat->fDataSize += 2; +- int32_t op = URX_BUILD(URX_LA_START, dataLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- +- op = URX_BUILD(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+ 2); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- +- op = URX_BUILD(URX_JMP, fRXPat->fCompiledPat->size()+ 3); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- +- op = URX_BUILD(URX_LA_END, dataLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- +- op = URX_BUILD(URX_BACKTRACK, 0); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- +- op = URX_BUILD(URX_NOP, 0); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ int32_t dataLoc = allocateData(2); ++ appendOp(URX_LA_START, dataLoc); ++ appendOp(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+ 2); ++ appendOp(URX_JMP, fRXPat->fCompiledPat->size()+ 3); ++ appendOp(URX_LA_END, dataLoc); ++ appendOp(URX_BACKTRACK, 0); ++ appendOp(URX_NOP, 0); ++ appendOp(URX_NOP, 0); + + // On the Parentheses stack, start a new frame and add the postions + // of the NOPs. +@@ -602,16 +585,10 @@ + // an alternate (transparent) region. + { + fixLiterals(); +- int32_t dataLoc = fRXPat->fDataSize; +- fRXPat->fDataSize += 2; +- int32_t op = URX_BUILD(URX_LA_START, dataLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- +- op = URX_BUILD(URX_STATE_SAVE, 0); // dest address will be patched later. +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- +- op = URX_BUILD(URX_NOP, 0); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ int32_t dataLoc = allocateData(2); ++ appendOp(URX_LA_START, dataLoc); ++ appendOp(URX_STATE_SAVE, 0); // dest address will be patched later. ++ appendOp(URX_NOP, 0); + + // On the Parentheses stack, start a new frame and add the postions + // of the StateSave and NOP. +@@ -649,23 +626,19 @@ + fixLiterals(); + + // Allocate data space +- int32_t dataLoc = fRXPat->fDataSize; +- fRXPat->fDataSize += 4; ++ int32_t dataLoc = allocateData(4); + + // Emit URX_LB_START +- int32_t op = URX_BUILD(URX_LB_START, dataLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_LB_START, dataLoc); + + // Emit URX_LB_CONT +- op = URX_BUILD(URX_LB_CONT, dataLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- fRXPat->fCompiledPat->addElement(0, *fStatus); // MinMatchLength. To be filled later. +- fRXPat->fCompiledPat->addElement(0, *fStatus); // MaxMatchLength. To be filled later. +- +- // Emit the NOP +- op = URX_BUILD(URX_NOP, 0); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_LB_CONT, dataLoc); ++ appendOp(URX_RESERVED_OP, 0); // MinMatchLength. To be filled later. ++ appendOp(URX_RESERVED_OP, 0); // MaxMatchLength. To be filled later. ++ ++ // Emit the NOPs ++ appendOp(URX_NOP, 0); ++ appendOp(URX_NOP, 0); + + // On the Parentheses stack, start a new frame and add the postions + // of the URX_LB_CONT and the NOP. +@@ -705,24 +678,20 @@ + fixLiterals(); + + // Allocate data space +- int32_t dataLoc = fRXPat->fDataSize; +- fRXPat->fDataSize += 4; ++ int32_t dataLoc = allocateData(4); + + // Emit URX_LB_START +- int32_t op = URX_BUILD(URX_LB_START, dataLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_LB_START, dataLoc); + + // Emit URX_LBN_CONT +- op = URX_BUILD(URX_LBN_CONT, dataLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- fRXPat->fCompiledPat->addElement(0, *fStatus); // MinMatchLength. To be filled later. +- fRXPat->fCompiledPat->addElement(0, *fStatus); // MaxMatchLength. To be filled later. +- fRXPat->fCompiledPat->addElement(0, *fStatus); // Continue Loc. To be filled later. +- +- // Emit the NOP +- op = URX_BUILD(URX_NOP, 0); +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_LBN_CONT, dataLoc); ++ appendOp(URX_RESERVED_OP, 0); // MinMatchLength. To be filled later. ++ appendOp(URX_RESERVED_OP, 0); // MaxMatchLength. To be filled later. ++ appendOp(URX_RESERVED_OP, 0); // Continue Loc. To be filled later. ++ ++ // Emit the NOPs ++ appendOp(URX_NOP, 0); ++ appendOp(URX_NOP, 0); + + // On the Parentheses stack, start a new frame and add the postions + // of the URX_LB_CONT and the NOP. +@@ -792,12 +761,9 @@ + + if (URX_TYPE(repeatedOp) == URX_SETREF) { + // Emit optimized code for [char set]+ +- int32_t loopOpI = URX_BUILD(URX_LOOP_SR_I, URX_VAL(repeatedOp)); +- fRXPat->fCompiledPat->addElement(loopOpI, *fStatus); +- frameLoc = fRXPat->fFrameSize; +- fRXPat->fFrameSize++; +- int32_t loopOpC = URX_BUILD(URX_LOOP_C, frameLoc); +- fRXPat->fCompiledPat->addElement(loopOpC, *fStatus); ++ appendOp(URX_LOOP_SR_I, URX_VAL(repeatedOp)); ++ frameLoc = allocateStackData(1); ++ appendOp(URX_LOOP_C, frameLoc); + break; + } + +@@ -805,7 +771,7 @@ + URX_TYPE(repeatedOp) == URX_DOTANY_ALL || + URX_TYPE(repeatedOp) == URX_DOTANY_UNIX) { + // Emit Optimized code for .+ operations. +- int32_t loopOpI = URX_BUILD(URX_LOOP_DOT_I, 0); ++ int32_t loopOpI = buildOp(URX_LOOP_DOT_I, 0); + if (URX_TYPE(repeatedOp) == URX_DOTANY_ALL) { + // URX_LOOP_DOT_I operand is a flag indicating ". matches any" mode. + loopOpI |= 1; +@@ -813,11 +779,9 @@ + if (fModeFlags & UREGEX_UNIX_LINES) { + loopOpI |= 2; + } +- fRXPat->fCompiledPat->addElement(loopOpI, *fStatus); +- frameLoc = fRXPat->fFrameSize; +- fRXPat->fFrameSize++; +- int32_t loopOpC = URX_BUILD(URX_LOOP_C, frameLoc); +- fRXPat->fCompiledPat->addElement(loopOpC, *fStatus); ++ appendOp(loopOpI); ++ frameLoc = allocateStackData(1); ++ appendOp(URX_LOOP_C, frameLoc); + break; + } + +@@ -831,18 +795,15 @@ + // Zero length match is possible. + // Emit the code sequence that can handle it. + insertOp(topLoc); +- frameLoc = fRXPat->fFrameSize; +- fRXPat->fFrameSize++; ++ frameLoc = allocateStackData(1); + +- int32_t op = URX_BUILD(URX_STO_INP_LOC, frameLoc); ++ int32_t op = buildOp(URX_STO_INP_LOC, frameLoc); + fRXPat->fCompiledPat->setElementAt(op, topLoc); + +- op = URX_BUILD(URX_JMP_SAV_X, topLoc+1); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_JMP_SAV_X, topLoc+1); + } else { + // Simpler code when the repeated body must match something non-empty +- int32_t jmpOp = URX_BUILD(URX_JMP_SAV, topLoc); +- fRXPat->fCompiledPat->addElement(jmpOp, *fStatus); ++ appendOp(URX_JMP_SAV, topLoc); + } + } + break; +@@ -854,8 +815,7 @@ + // 3. ... + { + int32_t topLoc = blockTopLoc(FALSE); +- int32_t saveStateOp = URX_BUILD(URX_STATE_SAVE, topLoc); +- fRXPat->fCompiledPat->addElement(saveStateOp, *fStatus); ++ appendOp(URX_STATE_SAVE, topLoc); + } + break; + +@@ -869,7 +829,7 @@ + // Insert the state save into the compiled pattern, and we're done. + { + int32_t saveStateLoc = blockTopLoc(TRUE); +- int32_t saveStateOp = URX_BUILD(URX_STATE_SAVE, fRXPat->fCompiledPat->size()); ++ int32_t saveStateOp = buildOp(URX_STATE_SAVE, fRXPat->fCompiledPat->size()); + fRXPat->fCompiledPat->setElementAt(saveStateOp, saveStateLoc); + } + break; +@@ -888,14 +848,12 @@ + int32_t jmp1_loc = blockTopLoc(TRUE); + int32_t jmp2_loc = fRXPat->fCompiledPat->size(); + +- int32_t jmp1_op = URX_BUILD(URX_JMP, jmp2_loc+1); ++ int32_t jmp1_op = buildOp(URX_JMP, jmp2_loc+1); + fRXPat->fCompiledPat->setElementAt(jmp1_op, jmp1_loc); + +- int32_t jmp2_op = URX_BUILD(URX_JMP, jmp2_loc+2); +- fRXPat->fCompiledPat->addElement(jmp2_op, *fStatus); ++ appendOp(URX_JMP, jmp2_loc+2); + +- int32_t save_op = URX_BUILD(URX_STATE_SAVE, jmp1_loc+1); +- fRXPat->fCompiledPat->addElement(save_op, *fStatus); ++ appendOp(URX_STATE_SAVE, jmp1_loc+1); + } + break; + +@@ -935,12 +893,10 @@ + + if (URX_TYPE(repeatedOp) == URX_SETREF) { + // Emit optimized code for a [char set]* +- int32_t loopOpI = URX_BUILD(URX_LOOP_SR_I, URX_VAL(repeatedOp)); ++ int32_t loopOpI = buildOp(URX_LOOP_SR_I, URX_VAL(repeatedOp)); + fRXPat->fCompiledPat->setElementAt(loopOpI, topLoc); +- dataLoc = fRXPat->fFrameSize; +- fRXPat->fFrameSize++; +- int32_t loopOpC = URX_BUILD(URX_LOOP_C, dataLoc); +- fRXPat->fCompiledPat->addElement(loopOpC, *fStatus); ++ dataLoc = allocateStackData(1); ++ appendOp(URX_LOOP_C, dataLoc); + break; + } + +@@ -948,7 +904,7 @@ + URX_TYPE(repeatedOp) == URX_DOTANY_ALL || + URX_TYPE(repeatedOp) == URX_DOTANY_UNIX) { + // Emit Optimized code for .* operations. +- int32_t loopOpI = URX_BUILD(URX_LOOP_DOT_I, 0); ++ int32_t loopOpI = buildOp(URX_LOOP_DOT_I, 0); + if (URX_TYPE(repeatedOp) == URX_DOTANY_ALL) { + // URX_LOOP_DOT_I operand is a flag indicating . matches any mode. + loopOpI |= 1; +@@ -957,10 +913,8 @@ + loopOpI |= 2; + } + fRXPat->fCompiledPat->setElementAt(loopOpI, topLoc); +- dataLoc = fRXPat->fFrameSize; +- fRXPat->fFrameSize++; +- int32_t loopOpC = URX_BUILD(URX_LOOP_C, dataLoc); +- fRXPat->fCompiledPat->addElement(loopOpC, *fStatus); ++ dataLoc = allocateStackData(1); ++ appendOp(URX_LOOP_C, dataLoc); + break; + } + } +@@ -969,30 +923,29 @@ + // The optimizations did not apply. + + int32_t saveStateLoc = blockTopLoc(TRUE); +- int32_t jmpOp = URX_BUILD(URX_JMP_SAV, saveStateLoc+1); ++ int32_t jmpOp = buildOp(URX_JMP_SAV, saveStateLoc+1); + + // Check for minimum match length of zero, which requires + // extra loop-breaking code. + if (minMatchLength(saveStateLoc, fRXPat->fCompiledPat->size()-1) == 0) { + insertOp(saveStateLoc); +- dataLoc = fRXPat->fFrameSize; +- fRXPat->fFrameSize++; ++ dataLoc = allocateStackData(1); + +- int32_t op = URX_BUILD(URX_STO_INP_LOC, dataLoc); ++ int32_t op = buildOp(URX_STO_INP_LOC, dataLoc); + fRXPat->fCompiledPat->setElementAt(op, saveStateLoc+1); +- jmpOp = URX_BUILD(URX_JMP_SAV_X, saveStateLoc+2); ++ jmpOp = buildOp(URX_JMP_SAV_X, saveStateLoc+2); + } + + // Locate the position in the compiled pattern where the match will continue + // after completing the *. (4 or 5 in the comment above) + int32_t continueLoc = fRXPat->fCompiledPat->size()+1; + +- // Put together the save state op store it into the compiled code. +- int32_t saveStateOp = URX_BUILD(URX_STATE_SAVE, continueLoc); ++ // Put together the save state op and store it into the compiled code. ++ int32_t saveStateOp = buildOp(URX_STATE_SAVE, continueLoc); + fRXPat->fCompiledPat->setElementAt(saveStateOp, saveStateLoc); + + // Append the URX_JMP_SAV or URX_JMPX operation to the compiled pattern. +- fRXPat->fCompiledPat->addElement(jmpOp, *fStatus); ++ appendOp(jmpOp); + } + break; + +@@ -1006,10 +959,9 @@ + { + int32_t jmpLoc = blockTopLoc(TRUE); // loc 1. + int32_t saveLoc = fRXPat->fCompiledPat->size(); // loc 3. +- int32_t jmpOp = URX_BUILD(URX_JMP, saveLoc); +- int32_t stateSaveOp = URX_BUILD(URX_STATE_SAVE, jmpLoc+1); ++ int32_t jmpOp = buildOp(URX_JMP, saveLoc); + fRXPat->fCompiledPat->setElementAt(jmpOp, jmpLoc); +- fRXPat->fCompiledPat->addElement(stateSaveOp, *fStatus); ++ appendOp(URX_STATE_SAVE, jmpLoc+1); + } + break; + +@@ -1078,9 +1030,9 @@ + + // First the STO_SP before the start of the loop + insertOp(topLoc); +- int32_t varLoc = fRXPat->fDataSize; // Reserve a data location for saving the +- fRXPat->fDataSize += 1; // state stack ptr. +- int32_t op = URX_BUILD(URX_STO_SP, varLoc); ++ ++ int32_t varLoc = allocateData(1); // Reserve a data location for saving the ++ int32_t op = buildOp(URX_STO_SP, varLoc); + fRXPat->fCompiledPat->setElementAt(op, topLoc); + + int32_t loopOp = (int32_t)fRXPat->fCompiledPat->popi(); +@@ -1089,8 +1041,7 @@ + fRXPat->fCompiledPat->push(loopOp, *fStatus); + + // Then the LD_SP after the end of the loop +- op = URX_BUILD(URX_LD_SP, varLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_LD_SP, varLoc); + } + + break; +@@ -1126,55 +1077,49 @@ + // scanned a ".", match any single character. + { + fixLiterals(FALSE); +- int32_t op; + if (fModeFlags & UREGEX_DOTALL) { +- op = URX_BUILD(URX_DOTANY_ALL, 0); ++ appendOp(URX_DOTANY_ALL, 0); + } else if (fModeFlags & UREGEX_UNIX_LINES) { +- op = URX_BUILD(URX_DOTANY_UNIX, 0); ++ appendOp(URX_DOTANY_UNIX, 0); + } else { +- op = URX_BUILD(URX_DOTANY, 0); ++ appendOp(URX_DOTANY, 0); + } +- fRXPat->fCompiledPat->addElement(op, *fStatus); + } + break; + + case doCaret: + { + fixLiterals(FALSE); +- int32_t op = 0; + if ( (fModeFlags & UREGEX_MULTILINE) == 0 && (fModeFlags & UREGEX_UNIX_LINES) == 0) { +- op = URX_CARET; ++ appendOp(URX_CARET, 0); + } else if ((fModeFlags & UREGEX_MULTILINE) != 0 && (fModeFlags & UREGEX_UNIX_LINES) == 0) { +- op = URX_CARET_M; ++ appendOp(URX_CARET_M, 0); + } else if ((fModeFlags & UREGEX_MULTILINE) == 0 && (fModeFlags & UREGEX_UNIX_LINES) != 0) { +- op = URX_CARET; // Only testing true start of input. ++ appendOp(URX_CARET, 0); // Only testing true start of input. + } else if ((fModeFlags & UREGEX_MULTILINE) != 0 && (fModeFlags & UREGEX_UNIX_LINES) != 0) { +- op = URX_CARET_M_UNIX; ++ appendOp(URX_CARET_M_UNIX, 0); + } +- fRXPat->fCompiledPat->addElement(URX_BUILD(op, 0), *fStatus); + } + break; + + case doDollar: + { + fixLiterals(FALSE); +- int32_t op = 0; + if ( (fModeFlags & UREGEX_MULTILINE) == 0 && (fModeFlags & UREGEX_UNIX_LINES) == 0) { +- op = URX_DOLLAR; ++ appendOp(URX_DOLLAR, 0); + } else if ((fModeFlags & UREGEX_MULTILINE) != 0 && (fModeFlags & UREGEX_UNIX_LINES) == 0) { +- op = URX_DOLLAR_M; ++ appendOp(URX_DOLLAR_M, 0); + } else if ((fModeFlags & UREGEX_MULTILINE) == 0 && (fModeFlags & UREGEX_UNIX_LINES) != 0) { +- op = URX_DOLLAR_D; ++ appendOp(URX_DOLLAR_D, 0); + } else if ((fModeFlags & UREGEX_MULTILINE) != 0 && (fModeFlags & UREGEX_UNIX_LINES) != 0) { +- op = URX_DOLLAR_MD; ++ appendOp(URX_DOLLAR_MD, 0); + } +- fRXPat->fCompiledPat->addElement(URX_BUILD(op, 0), *fStatus); + } + break; + + case doBackslashA: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_CARET, 0), *fStatus); ++ appendOp(URX_CARET, 0); + break; + + case doBackslashB: +@@ -1186,7 +1131,7 @@ + #endif + fixLiterals(FALSE); + int32_t op = (fModeFlags & UREGEX_UWORD)? URX_BACKSLASH_BU : URX_BACKSLASH_B; +- fRXPat->fCompiledPat->addElement(URX_BUILD(op, 1), *fStatus); ++ appendOp(op, 1); + } + break; + +@@ -1199,63 +1144,59 @@ + #endif + fixLiterals(FALSE); + int32_t op = (fModeFlags & UREGEX_UWORD)? URX_BACKSLASH_BU : URX_BACKSLASH_B; +- fRXPat->fCompiledPat->addElement(URX_BUILD(op, 0), *fStatus); ++ appendOp(op, 0); + } + break; + + case doBackslashD: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_D, 1), *fStatus); ++ appendOp(URX_BACKSLASH_D, 1); + break; + + case doBackslashd: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_D, 0), *fStatus); ++ appendOp(URX_BACKSLASH_D, 0); + break; + + case doBackslashG: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_G, 0), *fStatus); ++ appendOp(URX_BACKSLASH_G, 0); + break; + + case doBackslashS: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement( +- URX_BUILD(URX_STAT_SETREF_N, URX_ISSPACE_SET), *fStatus); ++ appendOp(URX_STAT_SETREF_N, URX_ISSPACE_SET); + break; + + case doBackslashs: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement( +- URX_BUILD(URX_STATIC_SETREF, URX_ISSPACE_SET), *fStatus); ++ appendOp(URX_STATIC_SETREF, URX_ISSPACE_SET); + break; + + case doBackslashW: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement( +- URX_BUILD(URX_STAT_SETREF_N, URX_ISWORD_SET), *fStatus); ++ appendOp(URX_STAT_SETREF_N, URX_ISWORD_SET); + break; + + case doBackslashw: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement( +- URX_BUILD(URX_STATIC_SETREF, URX_ISWORD_SET), *fStatus); ++ appendOp(URX_STATIC_SETREF, URX_ISWORD_SET); + break; + + case doBackslashX: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_X, 0), *fStatus); ++ appendOp(URX_BACKSLASH_X, 0); + break; + + + case doBackslashZ: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_DOLLAR, 0), *fStatus); ++ appendOp(URX_DOLLAR, 0); + break; + + case doBackslashz: + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_BACKSLASH_Z, 0), *fStatus); ++ appendOp(URX_BACKSLASH_Z, 0); + break; + + case doEscapeError: +@@ -1315,13 +1256,11 @@ + U_ASSERT(groupNum > 0); // Shouldn't happen. '\0' begins an octal escape sequence, + // and shouldn't enter this code path at all. + fixLiterals(FALSE); +- int32_t op; + if (fModeFlags & UREGEX_CASE_INSENSITIVE) { +- op = URX_BUILD(URX_BACKREF_I, groupNum); ++ appendOp(URX_BACKREF_I, groupNum); + } else { +- op = URX_BUILD(URX_BACKREF, groupNum); ++ appendOp(URX_BACKREF, groupNum); + } +- fRXPat->fCompiledPat->addElement(op, *fStatus); + } + break; + +@@ -1342,22 +1281,18 @@ + { + // Emit the STO_SP + int32_t topLoc = blockTopLoc(TRUE); +- int32_t stoLoc = fRXPat->fDataSize; +- fRXPat->fDataSize++; // Reserve the data location for storing save stack ptr. +- int32_t op = URX_BUILD(URX_STO_SP, stoLoc); ++ int32_t stoLoc = allocateData(1); // Reserve the data location for storing save stack ptr. ++ int32_t op = buildOp(URX_STO_SP, stoLoc); + fRXPat->fCompiledPat->setElementAt(op, topLoc); + + // Emit the STATE_SAVE +- op = URX_BUILD(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+2); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_STATE_SAVE, fRXPat->fCompiledPat->size()+2); + + // Emit the JMP +- op = URX_BUILD(URX_JMP, topLoc+1); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_JMP, topLoc+1); + + // Emit the LD_SP +- op = URX_BUILD(URX_LD_SP, stoLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_LD_SP, stoLoc); + } + break; + +@@ -1377,23 +1312,20 @@ + insertOp(topLoc); + + // emit STO_SP loc +- int32_t stoLoc = fRXPat->fDataSize; +- fRXPat->fDataSize++; // Reserve the data location for storing save stack ptr. +- int32_t op = URX_BUILD(URX_STO_SP, stoLoc); ++ int32_t stoLoc = allocateData(1); // Reserve the data location for storing save stack ptr. ++ int32_t op = buildOp(URX_STO_SP, stoLoc); + fRXPat->fCompiledPat->setElementAt(op, topLoc); + + // Emit the SAVE_STATE 5 + int32_t L7 = fRXPat->fCompiledPat->size()+1; +- op = URX_BUILD(URX_STATE_SAVE, L7); ++ op = buildOp(URX_STATE_SAVE, L7); + fRXPat->fCompiledPat->setElementAt(op, topLoc+1); + + // Append the JMP operation. +- op = URX_BUILD(URX_JMP, topLoc+1); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_JMP, topLoc+1); + + // Emit the LD_SP loc +- op = URX_BUILD(URX_LD_SP, stoLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_LD_SP, stoLoc); + } + break; + +@@ -1412,19 +1344,17 @@ + insertOp(topLoc); + + // Emit the STO_SP +- int32_t stoLoc = fRXPat->fDataSize; +- fRXPat->fDataSize++; // Reserve the data location for storing save stack ptr. +- int32_t op = URX_BUILD(URX_STO_SP, stoLoc); ++ int32_t stoLoc = allocateData(1); // Reserve the data location for storing save stack ptr. ++ int32_t op = buildOp(URX_STO_SP, stoLoc); + fRXPat->fCompiledPat->setElementAt(op, topLoc); + + // Emit the SAVE_STATE + int32_t continueLoc = fRXPat->fCompiledPat->size()+1; +- op = URX_BUILD(URX_STATE_SAVE, continueLoc); ++ op = buildOp(URX_STATE_SAVE, continueLoc); + fRXPat->fCompiledPat->setElementAt(op, topLoc+1); + + // Emit the LD_SP +- op = URX_BUILD(URX_LD_SP, stoLoc); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_LD_SP, stoLoc); + } + break; + +@@ -1481,8 +1411,8 @@ + // is an '|' alternation within the parens. + { + fixLiterals(FALSE); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus); +- fRXPat->fCompiledPat->addElement(URX_BUILD(URX_NOP, 0), *fStatus); ++ appendOp(URX_NOP, 0); ++ appendOp(URX_NOP, 0); + + // On the Parentheses stack, start a new frame and add the postions + // of the two NOPs (a normal non-capturing () frame, except for the +@@ -1819,7 +1749,6 @@ + // + //------------------------------------------------------------------------------ + void RegexCompile::fixLiterals(UBool split) { +- int32_t op = 0; // An op from/for the compiled pattern. + + // If no literal characters have been scanned but not yet had code generated + // for them, nothing needs to be done. +@@ -1858,23 +1787,23 @@ + // Single character, emit a URX_ONECHAR op to match it. + if ((fModeFlags & UREGEX_CASE_INSENSITIVE) && + u_hasBinaryProperty(lastCodePoint, UCHAR_CASE_SENSITIVE)) { +- op = URX_BUILD(URX_ONECHAR_I, lastCodePoint); ++ appendOp(URX_ONECHAR_I, lastCodePoint); + } else { +- op = URX_BUILD(URX_ONECHAR, lastCodePoint); ++ appendOp(URX_ONECHAR, lastCodePoint); + } +- fRXPat->fCompiledPat->addElement(op, *fStatus); + } else { + // Two or more chars, emit a URX_STRING to match them. ++ if (fLiteralChars.length() > 0x00ffffff || fRXPat->fLiteralText.length() > 0x00ffffff) { ++ error(U_REGEX_PATTERN_TOO_BIG); ++ } + if (fModeFlags & UREGEX_CASE_INSENSITIVE) { +- op = URX_BUILD(URX_STRING_I, fRXPat->fLiteralText.length()); ++ appendOp(URX_STRING_I, fRXPat->fLiteralText.length()); + } else { + // TODO here: add optimization to split case sensitive strings of length two + // into two single char ops, for efficiency. +- op = URX_BUILD(URX_STRING, fRXPat->fLiteralText.length()); ++ appendOp(URX_STRING, fRXPat->fLiteralText.length()); + } +- fRXPat->fCompiledPat->addElement(op, *fStatus); +- op = URX_BUILD(URX_STRING_LEN, fLiteralChars.length()); +- fRXPat->fCompiledPat->addElement(op, *fStatus); ++ appendOp(URX_STRING_LEN, fLiteralChars.length()); + + // Add this string into the accumulated strings of the compiled pattern. + fRXPat->fLiteralText.append(fLiteralChars); +@@ -1884,8 +1813,58 @@ + } + + ++int32_t RegexCompile::buildOp(int32_t type, int32_t val) { ++ if (U_FAILURE(*fStatus)) { ++ return 0; ++ } ++ if (type < 0 || type > 255) { ++ U_ASSERT(FALSE); ++ error(U_REGEX_INTERNAL_ERROR); ++ type = URX_RESERVED_OP; ++ } ++ if (val > 0x00ffffff) { ++ U_ASSERT(FALSE); ++ error(U_REGEX_INTERNAL_ERROR); ++ val = 0; ++ } ++ if (val < 0) { ++ if (!(type == URX_RESERVED_OP_N || type == URX_RESERVED_OP)) { ++ U_ASSERT(FALSE); ++ error(U_REGEX_INTERNAL_ERROR); ++ return -1; ++ } ++ if (URX_TYPE(val) != 0xff) { ++ U_ASSERT(FALSE); ++ error(U_REGEX_INTERNAL_ERROR); ++ return -1; ++ } ++ type = URX_RESERVED_OP_N; ++ } ++ return (type << 24) | val; ++} ++ + ++//------------------------------------------------------------------------------ ++// ++// appendOp() Append a new instruction onto the compiled pattern ++// Includes error checking, limiting the size of the ++// pattern to lengths that can be represented in the ++// 24 bit operand field of an instruction. ++// ++//------------------------------------------------------------------------------ ++void RegexCompile::appendOp(int32_t op) { ++ if (U_FAILURE(*fStatus)) { ++ return; ++ } ++ fRXPat->fCompiledPat->addElement(op, *fStatus); ++ if ((fRXPat->fCompiledPat->size() > 0x00fffff0) && U_SUCCESS(*fStatus)) { ++ error(U_REGEX_PATTERN_TOO_BIG); ++ } ++} + ... etc. - the rest is truncated
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits