connectivity/source/commontools/DateConversion.cxx | 2 - editeng/qa/unit/core-test.cxx | 2 - editeng/source/editeng/impedit3.cxx | 11 ++----- lotuswordpro/qa/cppunit/data/fail/recurse-4.lwp |binary lotuswordpro/source/filter/lwpfrib.cxx | 2 - lotuswordpro/source/filter/lwplayout.cxx | 5 +-- lotuswordpro/source/filter/lwplayout.hxx | 14 +++++++- lotuswordpro/source/filter/lwppagelayout.cxx | 4 +- sc/source/ui/view/gridwin4.cxx | 7 +++- sfx2/source/dialog/dinfdlg.cxx | 14 ++++++++ sw/source/core/tox/tox.cxx | 33 ++++++++++----------- 11 files changed, 60 insertions(+), 34 deletions(-)
New commits: commit 20bf87c6a3a076fe78f938b7a3086146336976e7 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Apr 13 14:33:27 2018 +0100 ofz#7648 Bad-cast Change-Id: I21aaf36f3d6b6c3054649208de809b99aa384c01 Reviewed-on: https://gerrit.libreoffice.org/52836 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit 1db17a71b028c392a00393cdf313e1720b93fd2e) diff --git a/lotuswordpro/source/filter/lwpfrib.cxx b/lotuswordpro/source/filter/lwpfrib.cxx index 737985cacd49..3e35b9883a2c 100644 --- a/lotuswordpro/source/filter/lwpfrib.cxx +++ b/lotuswordpro/source/filter/lwpfrib.cxx @@ -248,7 +248,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) XFTextStyle* pNamedStyle = nullptr; if (m_pModifiers->HasCharStyle && pFoundry) { - pNamedStyle = static_cast<XFTextStyle*> + pNamedStyle = dynamic_cast<XFTextStyle*> (pFoundry->GetStyleManager()->GetStyle(m_pModifiers->CharStyleID)); } if (pNamedStyle) commit 29e9802dcf9318394e2aff747396ff99408270cd Author: Caolán McNamara <caol...@redhat.com> Date: Thu Apr 12 14:53:20 2018 +0100 Related: tdf#100925 background not getting set under X sometimes not sure why this is the case, but it is reminiscent of rhbz#1283420 which results in missing glyphs in some circumstances X11CairoTextRender::getCairoContext has a hack in it for that problem, whic forces a read from the underlying X Drawable before writing to it which seems to have the effect of syncing it up. So, just before drawing the bg, draw a glyph on it to get it synced, and then overwrite it. Reviewed-on: https://gerrit.libreoffice.org/52819 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit e8080c79043a7d9036f27cc24b76b7ff21c58da8) Change-Id: I2ffff7e8e989b91821869d8b75a59728ac513d1b diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 13b82122d6fd..c90407bb2b83 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1047,7 +1047,12 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI } // paint the background - rDevice.DrawRect(rDevice.PixelToLogic(aBackground)); + Rectangle aLogicRect(rDevice.PixelToLogic(aBackground)); + //tdf#100925, rhbz#1283420, Draw some text here, to get + //X11CairoTextRender::getCairoContext called, so that the forced read + //from the underlying X Drawable gets it to sync. + rDevice.DrawText(aLogicRect.BottomLeft(), " "); + rDevice.DrawRect(aLogicRect); // paint the editeng text Rectangle aEditRect(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH())); commit 1c7eeb124ce82bb6f90c54ed7eade9d050aae45e Author: Szymon Kłos <szymon.k...@collabora.com> Date: Fri Mar 23 19:51:37 2018 +0100 tdf#116536 Fix bullet position with linespacing > 100 Change-Id: I862246d9c69e754bdd883787fe42c7d61a1a53d3 Reviewed-on: https://gerrit.libreoffice.org/51790 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> (cherry picked from commit 596fd41b9b19e28bab0c84e3821f79cb5d468f24) Reviewed-on: https://gerrit.libreoffice.org/52149 Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> (cherry picked from commit 4661cd9d17e3f2dc619cb888efde54eb6cf5219a) diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index 01d51eb271d3..b362a9db19ca 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -200,7 +200,7 @@ void Test::testLineSpacing() // Check the first line ParagraphInfos aInfo2 = aEditEngine.GetParagraphInfos(0); - CPPUNIT_ASSERT_EQUAL(sal_uInt16(311), aInfo2.nFirstLineMaxAscent); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(337), aInfo2.nFirstLineMaxAscent); CPPUNIT_ASSERT_EQUAL(sal_uInt16(382), static_cast<sal_uInt16>(aEditEngine.GetLineHeight(0))); } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 6f9f133a6807..f1b4d231cfa9 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1416,14 +1416,11 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) else if ( rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() != 100 ) ) { sal_uInt16 nTxtHeight = pLine->GetHeight(); - sal_Int32 nTxtHeightProp = nTxtHeight * rLSItem.GetPropLineSpace() / 100; - sal_Int32 nHeightProp = pLine->GetHeight() * rLSItem.GetPropLineSpace() / 100; + sal_Int32 nPropTextHeight = nTxtHeight * rLSItem.GetPropLineSpace() / 100; // The Ascent has to be adjusted for the difference: - long nDiff = ( pLine->GetHeight() - nTxtHeightProp ) * 4 / 5; - if ( nDiff > pLine->GetMaxAscent() ) - nDiff = pLine->GetMaxAscent() * 4 / 5; - pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() - nDiff ) ); // 80% - pLine->SetHeight( static_cast<sal_uInt16>( nHeightProp ), nTxtHeightProp ); + long nDiff = pLine->GetHeight() - nPropTextHeight; + pLine->SetMaxAscent( static_cast<sal_uInt16>( pLine->GetMaxAscent() - nDiff ) ); + pLine->SetHeight( static_cast<sal_uInt16>( nPropTextHeight ), nTxtHeight ); } } } commit 4e82bfb26fcb189d18ca6f0e3dbdf79c8b28bf90 Author: Julien Nabet <serval2...@yahoo.fr> Date: Tue Feb 20 23:50:04 2018 +0100 tdf#115853: save current custom property when adding line by reloading current lines before adding a brand new one indeed the info are deleted by ClearCustomProperties each time SfxDocumentInfoItem destructor is called Change-Id: Id1e2e652e90c720f00b8612aa9afbfa91b784d1d Reviewed-on: https://gerrit.libreoffice.org/50070 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Reviewed-on: https://gerrit.libreoffice.org/52349 Reviewed-by: Jean-Baptiste Faure <jbfa...@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> (cherry picked from commit c522b4017915b3a12203ac39f48a75ae6f4a5bc0) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 95476788fa0e..a52506880394 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2118,6 +2118,20 @@ void SfxCustomPropertiesPage::dispose() IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl, Button*, void) { + // tdf#115853: reload current lines before adding a brand new one + // indeed the info are deleted by ClearCustomProperties + // each time SfxDocumentInfoItem destructor is called + SfxDocumentInfoItem pInfo; + Sequence< beans::PropertyValue > aPropertySeq = m_pPropertiesCtrl->GetCustomProperties(); + sal_Int32 i = 0, nCount = aPropertySeq.getLength(); + for ( ; i < nCount; ++i ) + { + if ( !aPropertySeq[i].Name.isEmpty() ) + { + pInfo.AddCustomProperty( aPropertySeq[i].Name, aPropertySeq[i].Value ); + } + } + Any aAny; m_pPropertiesCtrl->AddLine( OUString(), aAny, true ); } commit 1301baea1f2e17d466772f23bbe06d2a2add66ef Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun Apr 8 08:26:55 2018 +0200 SQL string quoting: escape "'" character also at beginning of string Change-Id: I51db43c1a3b6d3c93a04a3419238ea286cab987e Reviewed-on: https://gerrit.libreoffice.org/52578 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> (cherry picked from commit 4bb50524e385803fddc50474667777fcf7ce19e1) diff --git a/connectivity/source/commontools/DateConversion.cxx b/connectivity/source/commontools/DateConversion.cxx index 1986adc5e08e..18599427959e 100644 --- a/connectivity/source/commontools/DateConversion.cxx +++ b/connectivity/source/commontools/DateConversion.cxx @@ -81,7 +81,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const Any& _rVal, bool b { OUString aTemp; _rxTypeConverter->convertToSimpleType(_rVal, TypeClass_STRING) >>= aTemp; - sal_Int32 nIndex = (sal_Int32)-1; + sal_Int32 nIndex = (sal_Int32)-2; const OUString sQuot("\'"); do { commit 79bb8c64b633f9397601df4e73f09d7fef066c2b Author: Caolán McNamara <caol...@redhat.com> Date: Sun Mar 25 14:01:25 2018 +0100 ofz#7109 infinite regress Change-Id: Iac0bd81c9b0e3ac6b005bb0065895ca1b4ca4233 Reviewed-on: https://gerrit.libreoffice.org/51828 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit e4308d4b3638d52ca70778565ba2541e9f3f0ff2) diff --git a/lotuswordpro/qa/cppunit/data/fail/recurse-4.lwp b/lotuswordpro/qa/cppunit/data/fail/recurse-4.lwp new file mode 100644 index 000000000000..f48c5bb718a4 Binary files /dev/null and b/lotuswordpro/qa/cppunit/data/fail/recurse-4.lwp differ diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 4a3f84f44027..a4c0f3d0a80e 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -78,6 +78,7 @@ LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm) , m_bGettingMarginsSameAsParent(false) , m_bGettingHasProtection(false) , m_bGettingIsProtected(false) + , m_bGettingIsAutoGrowDown(false) , m_bGettingMarginsValue(false) , m_bGettingExtMarginsValue(false) , m_nAttributes(0) @@ -391,7 +392,7 @@ LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType) */ bool LwpVirtualLayout::IsFitGraphic() { - return IsAutoGrowRight() && !IsAutoGrowLeft() && IsAutoGrowDown(); + return IsAutoGrowRight() && !IsAutoGrowLeft() && GetIsAutoGrowDown(); } /** @@ -1175,7 +1176,7 @@ bool LwpMiddleLayout::IsAutoGrowDown() rtl::Reference<LwpObject> xBase(GetBasedOnStyle()); if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get())) { - return pLay->IsAutoGrowDown(); + return pLay->GetIsAutoGrowDown(); } } return LwpVirtualLayout::IsAutoGrowDown(); diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 055a0e230186..99a56e9d5781 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -103,7 +103,6 @@ public: virtual double GetColGap(sal_uInt16 nIndex); virtual bool IsAutoGrow(){ return false;} virtual bool IsAutoGrowUp(){ return false;} - virtual bool IsAutoGrowDown(){ return false;} virtual bool IsAutoGrowLeft(){ return false;} virtual bool IsAutoGrowRight(){ return false;} bool IsFitGraphic(); @@ -137,6 +136,15 @@ public: m_bGettingIsProtected = false; return bRet; } + bool GetIsAutoGrowDown() + { + if (m_bGettingIsAutoGrowDown) + throw std::runtime_error("recursion in layout"); + m_bGettingIsAutoGrowDown = true; + bool bRet = IsAutoGrowDown(); + m_bGettingIsAutoGrowDown = false; + return bRet; + } bool GetHasProtection() { if (m_bGettingHasProtection) @@ -216,6 +224,7 @@ protected: bool HasProtection(); virtual bool HonorProtection(); virtual bool IsProtected(); + virtual bool IsAutoGrowDown(){ return false;} virtual double MarginsValue(sal_uInt8 /*nWhichSide*/){return 0;} virtual double ExtMarginsValue(sal_uInt8 /*nWhichSide*/){return 0;} virtual bool MarginsSameAsParent(); @@ -224,6 +233,7 @@ protected: bool m_bGettingMarginsSameAsParent; bool m_bGettingHasProtection; bool m_bGettingIsProtected; + bool m_bGettingIsAutoGrowDown; bool m_bGettingMarginsValue; bool m_bGettingExtMarginsValue; sal_uInt32 m_nAttributes; @@ -351,7 +361,6 @@ public: LwpColor* GetBackColor(); virtual bool IsAutoGrow() override; virtual bool IsAutoGrowUp() override; - virtual bool IsAutoGrowDown() override; virtual bool IsAutoGrowLeft() override; virtual bool IsAutoGrowRight() override; virtual sal_uInt8 GetContentOrientation() override; @@ -389,6 +398,7 @@ protected: virtual bool MarginsSameAsParent() override; virtual double MarginsValue(sal_uInt8 nWhichSide) override; virtual double ExtMarginsValue(sal_uInt8 nWhichSide) override; + virtual bool IsAutoGrowDown() override; private: LwpObjectID m_BasedOnStyle; LwpLayoutGeometry* Geometry(); diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index ee2868f47ff3..057fd3586ee5 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -480,7 +480,7 @@ void LwpPageLayout::ConvertFillerPageText(XFContentContainer* pCont) //get fillerpage story from division info LwpDocument* pDoc = m_pFoundry->GetDocument(); LwpDivInfo* pDivInfo = dynamic_cast<LwpDivInfo*>(pDoc->GetDivInfoID().obj().get()); - LwpStory* pStory = dynamic_cast<LwpStory*>(pDivInfo->GetFillerPageTextID().obj().get()); + LwpStory* pStory = pDivInfo ? dynamic_cast<LwpStory*>(pDivInfo->GetFillerPageTextID().obj().get()) : nullptr; //parse fillerpage story if(pStory) @@ -777,7 +777,7 @@ void LwpHeaderLayout::ParseMargins(XFHeaderStyle* ph1) { //Set height: from top of header to top of body, including the spacing between header and body double height = GetGeometryHeight()- GetMarginsValue(MARGIN_TOP); - if( IsAutoGrowDown() ) + if (GetIsAutoGrowDown()) { ph1->SetMinHeight(height); } commit f2dd38e8aeb7501a5855950d40ddc1818725ff92 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Sun Jan 14 19:12:30 2018 +0100 Return correct length for Authority token Regression from f4fd558ac9d61fe06aa0f56d829916ef9e5ee7b9 Take the chance to calculate token prefix just once. Change-Id: I19ce5cb037198cb918e79c760a92b285f9b725f1 (cherry picked from commit 34b98af8e5a4e568d8316700bea1ce604d825ce8) Reviewed-on: https://gerrit.libreoffice.org/52621 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit c6e8460a5b47fa6fa971dde2a89e80662b6e97ae) Reviewed-on: https://gerrit.libreoffice.org/52626 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit df041d902eafb1e273eb360103252994bbd2cde2) diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index a0fd74689201..4536e02c59b1 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -659,30 +659,29 @@ static FormTokenType lcl_GetTokenType(const OUString & sToken, { static struct { - OUString sNm; - sal_uInt16 nOffset; - FormTokenType eToken; + OUString sTokenStart; + sal_Int16 nTokenLength; + FormTokenType eTokenType; } const aTokenArr[] = { - { SwForm::GetFormTab(), 1, TOKEN_TAB_STOP }, - { SwForm::GetFormPageNums(), 1, TOKEN_PAGE_NUMS }, - { SwForm::GetFormLinkStt(), 1, TOKEN_LINK_START }, - { SwForm::GetFormLinkEnd(), 1, TOKEN_LINK_END }, - { SwForm::GetFormEntryNum(), 1, TOKEN_ENTRY_NO }, - { SwForm::GetFormEntryText(), 1, TOKEN_ENTRY_TEXT }, - { SwForm::GetFormChapterMark(), 1, TOKEN_CHAPTER_INFO }, - { SwForm::GetFormText(), 1, TOKEN_TEXT }, - { SwForm::GetFormEntry(), 1, TOKEN_ENTRY }, - { SwForm::GetFormAuth(), 3, TOKEN_AUTHORITY } + { SwForm::GetFormTab().copy(0, 2), 3, TOKEN_TAB_STOP }, + { SwForm::GetFormPageNums().copy(0, 2), 3, TOKEN_PAGE_NUMS }, + { SwForm::GetFormLinkStt().copy(0, 3), 4, TOKEN_LINK_START }, + { SwForm::GetFormLinkEnd().copy(0, 3), 4, TOKEN_LINK_END }, + { SwForm::GetFormEntryNum().copy(0, 3), 4, TOKEN_ENTRY_NO }, + { SwForm::GetFormEntryText().copy(0, 3), 4, TOKEN_ENTRY_TEXT }, + { SwForm::GetFormChapterMark().copy(0, 2), 3, TOKEN_CHAPTER_INFO }, + { SwForm::GetFormText().copy(0, 2), 3, TOKEN_TEXT }, + { SwForm::GetFormEntry().copy(0, 2), 3, TOKEN_ENTRY }, + { SwForm::GetFormAuth().copy(0, 2), 5, TOKEN_AUTHORITY } }; for(const auto & i : aTokenArr) { - const sal_Int32 nLen(i.sNm.getLength()); - if( sToken.startsWith( i.sNm.copy(0, nLen - i.nOffset) )) + if( sToken.startsWith( i.sTokenStart ) ) { if (pTokenLen) - *pTokenLen = nLen; - return i.eToken; + *pTokenLen = i.nTokenLength; + return i.eTokenType; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits