[Libreoffice-commits] core.git: svx/source
svx/source/form/fmshimp.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6bc0020108e8b45954727276ba11b462feb9a4bf Author: Julien Nabet AuthorDate: Mon Dec 4 18:23:32 2023 +0100 Commit: Julien Nabet CommitDate: Mon Dec 4 20:28:02 2023 +0100 Put back the message in assert after b50da6f3a9109fc1d4468c15aa7d5c68773ec199 Change-Id: Ie469e94ff51f1ca6dbbd65020f02fe43e0c1608c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160318 Reviewed-by: Julien Nabet Tested-by: Julien Nabet diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index a71f78f2296b..5dce31f180ba 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -3380,7 +3380,7 @@ void FmXFormShell::CreateExternalView_Lock() // value list MapUString2UstringSeq::const_iterator aCurrentValueList = aRadioValueLists.find(rCtrlSource.first); -assert(aCurrentValueList != aRadioValueLists.end()); +assert(aCurrentValueList != aRadioValueLists.end() && "FmXFormShell::CreateExternalView : inconsistent radio descriptions !"); pListBoxDescription->Name = FM_PROP_STRINGITEMLIST; pListBoxDescription->Value <<= (*aCurrentValueList).second; ++pListBoxDescription;
[Libreoffice-commits] core.git: svx/source
svx/source/form/labelitemwindow.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 48ba98a51f029cd14b5d982dab36eb581d40fef3 Author: Heiko Tietze AuthorDate: Wed Nov 29 14:29:57 2023 +0100 Commit: Heiko Tietze CommitDate: Thu Nov 30 11:41:38 2023 +0100 Resolves tdf#158412 - Don't show chevron in quick find bar Change-Id: I50f0bb7d8a406b77baccc626ca99b656d170ecf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160093 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/svx/source/form/labelitemwindow.cxx b/svx/source/form/labelitemwindow.cxx index 1ccbe6c5d156..c9afd1534acc 100644 --- a/svx/source/form/labelitemwindow.cxx +++ b/svx/source/form/labelitemwindow.cxx @@ -50,7 +50,8 @@ void LabelItemWindow::set_label(const OUString& rLabel, const LabelItemWindowTyp m_xLabel->set_font_color(Color(0x00, 0x47, 0x85)); m_xBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as InfobarType::INFO } -m_xLabel->set_visible(!rLabel.isEmpty()); +m_xLabel->set_visible( +true); // always show and not just if !rLabel.isEmpty() to not make the chevron appear } OUString LabelItemWindow::get_label() const { return m_xLabel->get_label(); }
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/optgrid.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 15ea67e549507f71b4367b7709339e61ba780c92 Author: Andrea Gelmini AuthorDate: Wed Nov 29 14:29:08 2023 +0100 Commit: Julien Nabet CommitDate: Wed Nov 29 16:49:46 2023 +0100 Remove duplicated include Change-Id: Ieea181852d18be586d50b049c46f2bdc4324183f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160092 Reviewed-by: Julien Nabet Tested-by: Jenkins diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx index 59bc67b2e26a..c0e6f6ebe03b 100644 --- a/svx/source/dialog/optgrid.cxx +++ b/svx/source/dialog/optgrid.cxx @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdoashp.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2b62b4021fb91e4f18a0b8eceace52046948a74e Author: Caolán McNamara AuthorDate: Tue Nov 28 09:23:07 2023 + Commit: Caolán McNamara CommitDate: Wed Nov 29 09:38:00 2023 +0100 cid#136 Use of auto that causes a copy Change-Id: Iae373b1aa5c25732b0e459778e4e85a3e96f138c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160013 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 21998ff4e339..eeaa5571576b 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1727,7 +1727,7 @@ SdrGluePoint SdrObjCustomShape::GetVertexGluePoint(sal_uInt16 nPosNum) const } Point aPt; -auto aRectangle = getRectangle(); +tools::Rectangle aRectangle = getRectangle(); switch (nPosNum) { case 0: aPt = aRectangle.TopCenter();aPt.AdjustY( -nWdt ); break;
[Libreoffice-commits] core.git: svx/source vcl/source vcl/workben
svx/source/dialog/_bmpmask.cxx|5 + vcl/source/graphic/GraphicObject2.cxx |2 +- vcl/source/rendercontext/drawmode.cxx |2 +- vcl/workben/vcldemo.cxx |3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) New commits: commit f4edd6258dff38c45e4a6b709e4e1d72a55a446c Author: Noel Grandin AuthorDate: Tue Nov 28 12:43:25 2023 +0200 Commit: Noel Grandin CommitDate: Tue Nov 28 19:55:51 2023 +0100 simplify some BitmapEx constructions using the color bitmap __and__ the alpha from another BitmapEx is equivalent to just doing a straight copy/assign Change-Id: I134ab8a1197ed538823afc4a8cd28b3d5986c6b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160019 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 1db7e661cdd7..3e6a56a79f91 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -994,10 +994,7 @@ Graphic SvxBmpMask::Mask( const Graphic& rGraphic ) if ( aBitmapEx.GetSizePixel().Width() && aBitmapEx.GetSizePixel().Height() ) { ImpMask( aBitmapEx ); -if ( aGraphic.IsTransparent() ) -aGraphic = Graphic( BitmapEx( aBitmapEx.GetBitmap(), aBitmapEx.GetAlphaMask() ) ); -else -aGraphic = aBitmapEx; +aGraphic = Graphic( aBitmapEx ); } } } diff --git a/vcl/source/graphic/GraphicObject2.cxx b/vcl/source/graphic/GraphicObject2.cxx index 02a9374759bf..2f60e315d5ef 100644 --- a/vcl/source/graphic/GraphicObject2.cxx +++ b/vcl/source/graphic/GraphicObject2.cxx @@ -457,7 +457,7 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx, if( rBmpEx.IsAlpha() ) { -aBmpEx2 = BitmapEx( rBmpEx.GetBitmap(), rBmpEx.GetAlphaMask() ); +aBmpEx2 = rBmpEx; } else { diff --git a/vcl/source/rendercontext/drawmode.cxx b/vcl/source/rendercontext/drawmode.cxx index ab3b36e0223d..fd3f29ac275f 100644 --- a/vcl/source/rendercontext/drawmode.cxx +++ b/vcl/source/rendercontext/drawmode.cxx @@ -269,7 +269,7 @@ BitmapEx GetBitmapEx(BitmapEx const& rBitmapEx, DrawModeFlags nDrawMode) } else { -aBmpEx = BitmapEx(aColorBmp, aBmpEx.GetAlphaMask()); +aBmpEx = BitmapEx(aColorBmp); } } diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 346de0b52a09..1214a61a9406 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -1406,8 +1406,7 @@ public: rDev.DrawBitmap(aBelow, aGrey); aBelow.Move(aGrey.GetSizePixel().Width(),0); -BitmapEx aGreyMask(aSrc.GetBitmap(), - aSrc.GetAlphaMask()); +BitmapEx aGreyMask(aSrc); rDev.DrawBitmapEx(aBelow, aGreyMask); aLocation.Move(aSrc.GetSizePixel().Width()*6,0);
[Libreoffice-commits] core.git: svx/source svx/uiconfig
svx/source/dialog/srchdlg.cxx|1 + svx/source/form/labelitemwindow.cxx |1 + svx/uiconfig/ui/findreplacedialog.ui | 11 ++- svx/uiconfig/ui/labelbox.ui |2 +- 4 files changed, 9 insertions(+), 6 deletions(-) New commits: commit 5a622f1a29d249a512cc24f99d189f748623c678 Author: Heiko Tietze AuthorDate: Tue Nov 28 11:10:58 2023 +0100 Commit: Heiko Tietze CommitDate: Tue Nov 28 14:33:18 2023 +0100 Related tdf#156227 - Find/quickfind design Themed icons look bad when drawn white on light blue; using the same icon as on the infobar makes more sense Change-Id: I6b4fd2bac7dce41b8196c702e0f0dc87712e2b8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160017 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index b5cf7bcf34fd..b1c87a6db7c8 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -344,6 +344,7 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, SfxChildWindow* pChildWi m_xSearchLabel->set_font_color(Color(0x00, 0x47, 0x85)); this->SetSearchLabel(""); // hide the message but keep the box height +m_xSearchIcon->set_size_request(24, 24); // vcl/res/infobar.png is 32x32 - too large here m_xReplaceTmplLB->make_sorted(); m_xReplaceAttrText->hide(); diff --git a/svx/source/form/labelitemwindow.cxx b/svx/source/form/labelitemwindow.cxx index bdff03e060f2..1ccbe6c5d156 100644 --- a/svx/source/form/labelitemwindow.cxx +++ b/svx/source/form/labelitemwindow.cxx @@ -19,6 +19,7 @@ LabelItemWindow::LabelItemWindow(vcl::Window* pParent, const OUString& rLabel) m_xLabel->set_label(rLabel); m_xImage->hide(); +m_xImage->set_size_request(24, 24); // vcl/res/infobar.png is 32x32 - too large here SetOptimalSize(); diff --git a/svx/uiconfig/ui/findreplacedialog.ui b/svx/uiconfig/ui/findreplacedialog.ui index 57a16e666a2f..e915a647f710 100644 --- a/svx/uiconfig/ui/findreplacedialog.ui +++ b/svx/uiconfig/ui/findreplacedialog.ui @@ -290,15 +290,16 @@ True False +center 6 3 3 3 -res/info.png +vcl/res/infobox.png - -Search icon - + +Search icon + @@ -323,7 +324,7 @@ 0 - notification +notification diff --git a/svx/uiconfig/ui/labelbox.ui b/svx/uiconfig/ui/labelbox.ui index f77cd5da7f4e..29210661b91c 100644 --- a/svx/uiconfig/ui/labelbox.ui +++ b/svx/uiconfig/ui/labelbox.ui @@ -15,7 +15,7 @@ 6 3 3 -res/info.png +vcl/res/infobox.png False
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/framelinkarray.cxx | 207 +-- 1 file changed, 104 insertions(+), 103 deletions(-) New commits: commit ac424db10e963864bc5744897561e0bf127a615c Author: Noel Grandin AuthorDate: Thu Nov 23 09:28:46 2023 +0200 Commit: Noel Grandin CommitDate: Thu Nov 23 10:37:23 2023 +0100 re-apply "Work with what we have in ArrayImpl: pointers" re-apply commit f7df46c917533d3ce3528d52f49629fe9f51e67b "Work with what we have in ArrayImpl: pointers", which I somehow managed to revert while preparing commit d9c726beb64968e84d2150824c81dcf0a8b66ec2 "optimise framelinkarray lookup" Change-Id: I05c3da965ef334597f17fea9deded28218b15a47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159846 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index 3431c861fcfd..21afef6441f5 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -228,6 +228,7 @@ bool Cell::operator==(const Cell& rOther) const && mnAddTop == rOther.mnAddTop && mnAddBottom == rOther.mnAddBottom && meRotMode == rOther.meRotMode +&& mfOrientation == rOther.mfOrientation && mbOverlapX == rOther.mbOverlapX && mbOverlapY == rOther.mbOverlapY; } @@ -246,6 +247,7 @@ size_t Cell::hashCode() const o3tl::hash_combine(seed, mnAddTop); o3tl::hash_combine(seed, mnAddBottom); o3tl::hash_combine(seed, meRotMode); +o3tl::hash_combine(seed, mfOrientation); o3tl::hash_combine(seed, mbOverlapX); o3tl::hash_combine(seed, mbOverlapY); return seed; @@ -321,7 +323,7 @@ struct ArrayImpl sal_Int32 GetIndex( sal_Int32 nCol, sal_Int32 nRow ) const { return nRow * mnWidth + nCol; } -const Cell& GetCell( sal_Int32 nCol, sal_Int32 nRow ) const; +const Cell* GetCell( sal_Int32 nCol, sal_Int32 nRow ) const; voidPutCell( sal_Int32 nCol, sal_Int32 nRow, const Cell& ); sal_Int32 GetMergedFirstCol( sal_Int32 nCol, sal_Int32 nRow ) const; @@ -329,8 +331,8 @@ struct ArrayImpl sal_Int32 GetMergedLastCol( sal_Int32 nCol, sal_Int32 nRow ) const; sal_Int32 GetMergedLastRow( sal_Int32 nCol, sal_Int32 nRow ) const; -const Cell& GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) const; -const Cell& GetMergedLastCell( sal_Int32 nCol, sal_Int32 nRow ) const; +const Cell* GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) const; +const Cell* GetMergedLastCell( sal_Int32 nCol, sal_Int32 nRow ) const; boolIsMergedOverlappedLeft( sal_Int32 nCol, sal_Int32 nRow ) const; boolIsMergedOverlappedRight( sal_Int32 nCol, sal_Int32 nRow ) const; @@ -408,9 +410,9 @@ Cell* ArrayImpl::createOrFind(const Cell& rCell) return pRetval; } -const Cell& ArrayImpl::GetCell( sal_Int32 nCol, sal_Int32 nRow ) const +const Cell* ArrayImpl::GetCell( sal_Int32 nCol, sal_Int32 nRow ) const { -return IsValidPos( nCol, nRow ) ? *maCells[ GetIndex( nCol, nRow ) ] : OBJ_CELL_NONE; +return IsValidPos( nCol, nRow ) ? maCells[ GetIndex( nCol, nRow ) ] : &OBJ_CELL_NONE; } void ArrayImpl::PutCell( sal_Int32 nCol, sal_Int32 nRow, const Cell & rCell ) @@ -422,61 +424,61 @@ void ArrayImpl::PutCell( sal_Int32 nCol, sal_Int32 nRow, const Cell & rCell ) sal_Int32 ArrayImpl::GetMergedFirstCol( sal_Int32 nCol, sal_Int32 nRow ) const { sal_Int32 nFirstCol = nCol; -while( (nFirstCol > 0) && GetCell( nFirstCol, nRow ).mbOverlapX ) --nFirstCol; +while( (nFirstCol > 0) && GetCell( nFirstCol, nRow )->mbOverlapX ) --nFirstCol; return nFirstCol; } sal_Int32 ArrayImpl::GetMergedFirstRow( sal_Int32 nCol, sal_Int32 nRow ) const { sal_Int32 nFirstRow = nRow; -while( (nFirstRow > 0) && GetCell( nCol, nFirstRow ).mbOverlapY ) --nFirstRow; +while( (nFirstRow > 0) && GetCell( nCol, nFirstRow )->mbOverlapY ) --nFirstRow; return nFirstRow; } sal_Int32 ArrayImpl::GetMergedLastCol( sal_Int32 nCol, sal_Int32 nRow ) const { sal_Int32 nLastCol = nCol + 1; -while( (nLastCol < mnWidth) && GetCell( nLastCol, nRow ).mbOverlapX ) ++nLastCol; +while( (nLastCol < mnWidth) && GetCell( nLastCol, nRow )->mbOverlapX ) ++nLastCol; return nLastCol - 1; } sal_Int32 ArrayImpl::GetMergedLastRow( sal_Int32 nCol, sal_Int32 nRow ) const { sal_Int32 nLastRow = nRow + 1; -while( (nLastRow < mnHeight) && GetCell( nCol, nLastRow ).mbOverlapY ) ++nLastRow; +while( (nLastRow < mnHeight) && GetCell( nCol, nLastRow )->mbOverlapY ) ++nLastRow; return nLastRow - 1; } -const Cell& ArrayImpl::GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) const +const Cell* ArrayImpl::GetMergedOriginCell( sal_Int32 nCol, sal_Int32 n
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit f17b89b9e4d1e5c1cf608a2ce1ed218917e3447b Author: Andrea Gelmini AuthorDate: Wed Nov 22 16:16:49 2023 +0100 Commit: Julien Nabet CommitDate: Wed Nov 22 21:04:58 2023 +0100 Fix typo Change-Id: I66cb84da082a7498b1c6a79e989dd94d9f7b1b56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159828 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 2d86e99073c2..2e19aa344ec4 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -832,8 +832,8 @@ static void FitTextOutlinesToShapeOutlines(const tools::PolyPolygon& aOutlines2d sal_uInt16 i; for (i = 0; i < nPointCount; i++) { -//Normal vector for a point will be calculated from its neightbour points -//except if is in the start/end of the vector +//Normal vector for a point will be calculated from its neighbour points +//except if it is in the start/end of the vector sal_uInt16 nPointIdx1 = i == 0 ? i : i - 1; sal_uInt16 nPointIdx2 = i == nPointCount - 1 ? i : i + 1;
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8b6e497a3a9c0d3ce054d3516a2646576a5c8247 Author: Andrea Gelmini AuthorDate: Wed Nov 22 16:20:36 2023 +0100 Commit: Julien Nabet CommitDate: Wed Nov 22 21:03:10 2023 +0100 Fix typo Change-Id: I6e6955b18078685ebbe215e496a0b459afb33f27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159833 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index ff6903d1f181..a51e93588582 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -828,7 +828,7 @@ static void FitTextOutlinesToShapeOutlines(const tools::PolyPolygon& aOutlines2d vCurOutline.reserve(nPointCount); vNorm.reserve(nPointCount); -// Calculate Normal vectors, and allocate curve datas +// Calculate Normal vectors, and allocate curve data sal_uInt16 i; for (i = 0; i < nPointCount; i++) {
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d2cfc1cbcb70954951a7bd95a95da26233552733 Author: Andrea Gelmini AuthorDate: Wed Nov 22 16:15:08 2023 +0100 Commit: Julien Nabet CommitDate: Wed Nov 22 21:02:50 2023 +0100 Fix typo Change-Id: I034c3b76a8f35700d528b06d7816c0062fe16b86 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159822 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 8a2984cbdd10..ff6903d1f181 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -930,7 +930,7 @@ static void FitTextOutlinesToShapeOutlines(const tools::PolyPolygon& aOutlines2d // if fAdjust<0, then it means, the text was longer, as // the current outline, so we will skip the text scaling, and -// the text horizontal alignment ajustment +// the text horizontal alignment adjustment // so the text will be rendered just as long as the cureve is. if (fAdjust >= 0) {
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ac2839458c5f497b907506da07dcd1b451b62372 Author: Andrea Gelmini AuthorDate: Wed Nov 22 16:16:24 2023 +0100 Commit: Julien Nabet CommitDate: Wed Nov 22 21:02:11 2023 +0100 Fix typo Change-Id: I3201adc92bec156014b8044371a79a8255c58aa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159827 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 733483e4a75e..8a2984cbdd10 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -903,7 +903,7 @@ static void FitTextOutlinesToShapeOutlines(const tools::PolyPolygon& aOutlines2d = nAdjust * (fCurWidth - rParagraph.aBoundRect.GetWidth()) / 2; } else -fAdjust = -1; // we neet tho shrink the text to fit the curve +fAdjust = -1; // we need to shrink the text to fit the curve for ( auto& rCharacter : rParagraph.vCharacters ) {
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 99ef89ba4cd2497f3a46448692a71d98c721ae9e Author: Andrea Gelmini AuthorDate: Wed Nov 22 16:15:56 2023 +0100 Commit: Julien Nabet CommitDate: Wed Nov 22 21:01:54 2023 +0100 Fix typo Change-Id: Id19012a207b6df24188e424414e103c7c3dc3d5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159825 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index ba7b2890f905..733483e4a75e 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -784,7 +784,7 @@ static void FitTextOutlinesToShapeOutlines(const tools::PolyPolygon& aOutlines2d if ( !vDistances.empty() ) { -// horizontal aligment: how much we have to move text to the right. +// horizontal alignment: how much we have to move text to the right. int nAdjust = -1; switch (eHorzAdjust) {
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c49d688d212fd89daee5563b67b55f687f6d901a Author: Andrea Gelmini AuthorDate: Wed Nov 22 16:16:06 2023 +0100 Commit: Julien Nabet CommitDate: Wed Nov 22 21:01:01 2023 +0100 Fix typo Change-Id: I15170c332c7b9943433fc7113c3b3e8c44c765cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159826 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 47d2c0830e3f..0bbf501835aa 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -867,7 +867,7 @@ static void FitTextOutlinesToShapeOutlines(const tools::PolyPolygon& aOutlines2d double fCurvesDist = rTextArea.aBoundRect.GetHeight() / 2.0 + rTextArea.aBoundRect.Top() - rParagraph.aBoundRect.Center().Y(); -// verical alignment adjust +// vertical alignment adjust fCurvesDist -= rTextArea.nHAlignMove; for (i = 0; i < nPointCount; i++)
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 84d8a1caf124a25fb081562e4db32acf19e0f301 Author: Andrea Gelmini AuthorDate: Wed Nov 22 16:15:24 2023 +0100 Commit: Julien Nabet CommitDate: Wed Nov 22 21:00:37 2023 +0100 Fix typo Change-Id: I76ea5af4ec21ca55a2b88f48e6d476feec065349 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159823 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 8f2896109e9e..47d2c0830e3f 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -939,7 +939,7 @@ static void FitTextOutlinesToShapeOutlines(const tools::PolyPolygon& aOutlines2d } // 0 <= fM1,fM2 <= 1 should be true, but rounding errors can // make a small mistake. -// make sure they are >0 becuase GetPoint() need that +// make sure they are >0 because GetPoint() need that if (fM1 < 0) fM1 = 0; if (fM2 < 0) fM2 = 0;
[Libreoffice-commits] core.git: svx/source
svx/source/accessibility/ChildrenManagerImpl.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 23e9a4cf1eec75cdd40a695ecae2af9b952178d3 Author: Armin Le Grand (allotropia) AuthorDate: Fri Nov 10 17:59:11 2023 +0100 Commit: Armin Le Grand CommitDate: Fri Nov 10 20:05:11 2023 +0100 tdf#158169 take no actions in disposed incarnation Using the described steps in the bug report it is possible to have an already disposed incarnation of ChildrenManagerImpl that gets called with notifyEvent. If exposed it is necessary not to execute actions, but to inform the caller by triggering a lang::DisposedException(). The SfxBaseModel::notifyEvent that executes this will then remove the instance from it's list. Change-Id: Ie39e37d6e55ea66f441e732b612774b18d7c3ca1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159306 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx b/svx/source/accessibility/ChildrenManagerImpl.cxx index 96e27c079e9b..5271f1887b83 100644 --- a/svx/source/accessibility/ChildrenManagerImpl.cxx +++ b/svx/source/accessibility/ChildrenManagerImpl.cxx @@ -681,6 +681,11 @@ void SAL_CALL ChildrenManagerImpl::notifyEvent ( const document::EventObject& rEventObject) { +// tdf#158169 if we are already disposed, execute no actions, but inform the +// caller that we are disposed +if ( m_bDisposed ) +throw lang::DisposedException(); + if (rEventObject.EventName == "ShapeInserted") AddShape (Reference(rEventObject.Source, uno::UNO_QUERY)); else if (rEventObject.EventName == "ShapeRemoved")
[Libreoffice-commits] core.git: svx/source
svx/source/gallery2/galleryfilestorage.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 1d939b782235a62c965a4c8309869796b5838acf Author: Thorsten Behrens AuthorDate: Sun Nov 5 01:26:46 2023 +0100 Commit: Thorsten Behrens CommitDate: Sun Nov 5 21:21:27 2023 +0100 reprobuild: don't write nondeterministic textencoding No need to write this legacy int16, that we ignore on read anyway. Change-Id: I5ee071aa0562b8e2718a1a83dffc543c9a104360 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158942 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/svx/source/gallery2/galleryfilestorage.cxx b/svx/source/gallery2/galleryfilestorage.cxx index 1838520ec60a..e9a8cd0aa8b6 100644 --- a/svx/source/gallery2/galleryfilestorage.cxx +++ b/svx/source/gallery2/galleryfilestorage.cxx @@ -697,7 +697,8 @@ SvStream& GalleryFileStorage::writeGalleryTheme(SvStream& rOStm, const GalleryTh rOStm.WriteUInt16(0x0004); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, pThm->GetThemeName(), RTL_TEXTENCODING_UTF8); -rOStm.WriteUInt32(nCount).WriteUInt16(osl_getThreadTextEncoding()); +rOStm.WriteUInt32(nCount); +rOStm.WriteUInt16(RTL_TEXTENCODING_UTF8); // unused on reading for (sal_uInt32 i = 0; i < nCount; i++) {
[Libreoffice-commits] core.git: svx/source
svx/source/unodraw/unoshape.cxx | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) New commits: commit e5675d7e03de5962af8828663529a780ca31dd5b Author: Noel Grandin AuthorDate: Mon Oct 30 10:40:03 2023 +0200 Commit: Noel Grandin CommitDate: Mon Oct 30 14:21:51 2023 +0100 rename mxItemSet->moItemSet in SvxShapeImpl because the improved naming is useful for a bigger patch that I want to land Change-Id: I3acea11288a2e70d6ea91c99b52d3a05916da4d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158643 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 2ce0ed35c3e6..b6ef17b86616 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -111,7 +111,7 @@ class GDIMetaFile; struct SvxShapeImpl { -std::optional mxItemSet; +std::optional moItemSet; SdrObjKind mnObjId; SvxShapeMaster* mpMaster; boolmbDisposing; @@ -1534,11 +1534,11 @@ void SvxShape::_setPropertyValue( const OUString& rPropertyName, const uno::Any& SfxItemSet* pSet; if( mbIsMultiPropertyCall && !bIsNotPersist ) { -if( !mpImpl->mxItemSet ) +if( !mpImpl->moItemSet ) { -mpImpl->mxItemSet.emplace( GetSdrObject()->GetProperties().CreateObjectSpecificItemSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool() ) ); +mpImpl->moItemSet.emplace( GetSdrObject()->GetProperties().CreateObjectSpecificItemSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool() ) ); } -pSet = &*mpImpl->mxItemSet; +pSet = &*mpImpl->moItemSet; } else { @@ -1713,15 +1713,15 @@ void SAL_CALL SvxShape::setPropertyValues( const css::uno::Sequence< OUString >& } } -if( mpImpl->mxItemSet && HasSdrObject() ) -GetSdrObject()->SetMergedItemSetAndBroadcast( *mpImpl->mxItemSet ); +if( mpImpl->moItemSet && HasSdrObject() ) +GetSdrObject()->SetMergedItemSetAndBroadcast( *mpImpl->moItemSet ); } void SvxShape::endSetPropertyValues() { mbIsMultiPropertyCall = false; -mpImpl->mxItemSet.reset(); +mpImpl->moItemSet.reset(); }
[Libreoffice-commits] core.git: svx/source
svx/source/unodraw/unoshape.cxx |5 - 1 file changed, 5 deletions(-) New commits: commit 123a0ef011f5627b213aef0a20215970ada30fe6 Author: Noel Grandin AuthorDate: Fri Oct 20 10:40:11 2023 +0200 Commit: Noel Grandin CommitDate: Fri Oct 20 13:26:23 2023 +0200 remove SAL_WARN in _setPropertyValue since so much code higher level code is now just asking for random properties and just catching the UnknownPropertyException for the cases where the object does not support that property Change-Id: I9198ec0c540252783015cffa088be30451f92c3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158231 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index c7fb448fe575..45d1589728be 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1506,12 +1506,7 @@ void SvxShape::_setPropertyValue( const OUString& rPropertyName, const uno::Any& } if (!pMap) -{ -// reduce log noise by ignoring two properties that higher level code queries for on all objects -SAL_WARN_IF(rPropertyName != "FromWordArt" && rPropertyName != "GraphicColorMode", -"svx.uno", "Unknown Property: " << rPropertyName); throw beans::UnknownPropertyException( rPropertyName, getXWeak()); -} if ((pMap->nFlags & beans::PropertyAttribute::READONLY) != 0) throw beans::PropertyVetoException(
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/contact/viewcontactofsdrpathobj.cxx | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) New commits: commit f5c4635c8bbd27b06a81bfa8d75f986994065310 Author: Noel Grandin AuthorDate: Thu Oct 19 11:50:57 2023 +0200 Commit: Noel Grandin CommitDate: Thu Oct 19 15:20:57 2023 +0200 tdf#155410 small optimisation Change-Id: I736b5959d52c57ee5e05e349d0c421896229e554 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158172 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index 42b699374e1c..d95d5fbeb75e 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -90,15 +90,13 @@ namespace sdr::contact if(bIsLine) { // special handling for single line mode (2 points) -const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0)); -const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0)); -const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1)); +const basegfx::B2DPolygon & rSubPolygon(aUnitPolyPolygon.getB2DPolygon(0)); +const basegfx::B2DPoint aStart(rSubPolygon.getB2DPoint(0)); +const basegfx::B2DPoint aEnd(rSubPolygon.getB2DPoint(1)); const basegfx::B2DVector aLine(aEnd - aStart); // #i102548# create new unit polygon for line (horizontal) -basegfx::B2DPolygon aNewPolygon; -aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0)); -aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0)); +static const basegfx::B2DPolygon aNewPolygon{basegfx::B2DPoint(0.0, 0.0), basegfx::B2DPoint(1.0, 0.0)}; aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon); // #i102548# fill objectMatrix with rotation and offset (no shear for lines)
[Libreoffice-commits] core.git: svx/source
svx/source/unodraw/unoshape.cxx | 26 +- 1 file changed, 17 insertions(+), 9 deletions(-) New commits: commit 878c2da6d2d5576d6c3266b38eae4ac80bcbe2c1 Author: Caolán McNamara AuthorDate: Mon Oct 16 11:52:11 2023 +0100 Commit: Caolán McNamara CommitDate: Mon Oct 16 17:20:28 2023 +0200 Related: tdf#157726 restore try/catch block before commit de42529ca9107b24b6367b40801300416d4a51a1 Date: Wed Sep 6 14:49:19 2023 +0200 replace svx::PropertyValueProvider with simpler implementation PropertyChangeNotifier::notifyPropertyChange had a try/catch, but afterwards SvxShape::notifyPropertyChange doesn't Change-Id: If78732bea08d0f760b3b616ad55d28d40fa50fcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158026 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 949728d4bf12..c7fb448fe575 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -264,15 +264,23 @@ void SvxShape::notifyPropertyChange(const OUString& rPropName) mpImpl->maPropertyChangeListeners.getContainer( g, OUString() ); if (pPropListeners || pAllListeners) { -// Handle/OldValue not supported -beans::PropertyChangeEvent aEvt; -aEvt.Source = static_cast(this); -aEvt.PropertyName = rPropName; -aEvt.NewValue = getPropertyValue(rPropName); -if (pPropListeners) -pPropListeners->notifyEach( g, &beans::XPropertyChangeListener::propertyChange, aEvt ); -if (pAllListeners) -pAllListeners->notifyEach( g, &beans::XPropertyChangeListener::propertyChange, aEvt ); +try +{ +// Handle/OldValue not supported +beans::PropertyChangeEvent aEvt; +aEvt.Source = static_cast(this); +aEvt.PropertyName = rPropName; +aEvt.NewValue = getPropertyValue(rPropName); +if (pPropListeners) +pPropListeners->notifyEach( g, &beans::XPropertyChangeListener::propertyChange, aEvt ); +if (pAllListeners) +pAllListeners->notifyEach( g, &beans::XPropertyChangeListener::propertyChange, aEvt ); +} +catch( const Exception& ) +{ +DBG_UNHANDLED_EXCEPTION("svx"); +} + } }
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdhdl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3d1cd490ac0366245c4b55d711611c21149a76e9 Author: Michael Weghorn AuthorDate: Thu Oct 12 18:57:57 2023 +0200 Commit: Michael Weghorn CommitDate: Thu Oct 12 21:10:06 2023 +0200 tdf#141828 svx: Use pointing hand for custom shape handles Use the *pointing* hand cursor (`PointerStyle::RefHand`) instead of the hand symbol cursor (`PointerStyle::Hand`) for handles for custom shape interaction. (S. how `SdrHdlKind::CustomShape1` is only specified in `SdrObjCustomShape::AddToHdlList`, except for read-only switch/cases elsewhere). As mentioned in tdf#141828, this has the advantage that the user can see where the handle is being moved. For gtk3, this doesn't make any difference in practice, because it's using the same cursor type for both, `PointerStyle::RefHand` and `PointerStyle::Hand` (s. `GtkSalDisplay::getCursor`, but the Qt-based VCL plugins (`QtData::getCursor`) and macOS (s. `AquaSalFrame::getCurrentCursor`) make a distinction between them. Change-Id: I5d35481e5c5edc1895a7c4a973315ee6b187b983 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157891 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index deb8da05d9d5..867534e9a08f 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -1011,7 +1011,7 @@ PointerStyle SdrHdl::GetPointer() const case SdrHdlKind::Ref2 : ePtr=PointerStyle::RefHand; break; case SdrHdlKind::BezierWeight : ePtr=PointerStyle::MoveBezierWeight; break; case SdrHdlKind::Glue : ePtr=PointerStyle::MovePoint; break; -case SdrHdlKind::CustomShape1 : ePtr=PointerStyle::Hand; break; +case SdrHdlKind::CustomShape1 : ePtr=PointerStyle::RefHand; break; default: break; }
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShape3d.cxx | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) New commits: commit cc81d424a29dd4b421bc1775faaa51c58195fadc Author: Julien Nabet AuthorDate: Fri Oct 6 17:29:54 2023 +0200 Commit: Julien Nabet CommitDate: Sat Oct 7 09:57:31 2023 +0200 Related tdf#157532: deal "ShadeMode" for extruded custom shapes via BASIC macro Change-Id: I9ff65f58d48c2b61819533f62c42e2ab07ad4fb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157655 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index e543f490ca8a..a401246277cc 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -141,7 +141,16 @@ drawing::ShadeMode GetShadeMode( const SdrCustomShapeGeometryItem& rItem, const drawing::ShadeMode eRet( eDefault ); const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "ShadeMode" ); if ( pAny ) -*pAny >>= eRet; +{ +if (!(*pAny >>= eRet)) +{ +sal_Int32 nEnum = 0; +if(*pAny >>= nEnum) +{ +eRet = static_cast(nEnum); +} +} +} return eRet; }
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShape3d.cxx | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) New commits: commit f1aa554cd0b471e0c9424ece7ab3d9b3d7723a1d Author: Julien Nabet AuthorDate: Fri Oct 6 17:19:28 2023 +0200 Commit: Julien Nabet CommitDate: Fri Oct 6 20:04:01 2023 +0200 tdf#157532: deal "ProjectionMode" for extruded custom shapes via BASIC macro I took example on SdrTextAniDirectionItem::PutValue from svx/source/svdraw/svdattr.cxx Change-Id: I9165b9a310ff6bee287e7fb817502c0c99f0747b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157654 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 468a1c66fa93..e543f490ca8a 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -332,8 +332,17 @@ rtl::Reference EnhancedCustomShape3d::Create3DObject( drawing::ProjectionMode eProjectionMode( drawing::ProjectionMode_PARALLEL ); const Any* pAny = rGeometryItem.GetPropertyValueByName( "Extrusion", "ProjectionMode" ); -if ( pAny ) -*pAny >>= eProjectionMode; +if (pAny) +{ +if(!(*pAny >>= eProjectionMode)) +{ +sal_Int32 nEnum = 0; +if(*pAny >>= nEnum) +{ +eProjectionMode = static_cast(nEnum); +} +} +} // pShape2d Convert in scenes which include 3D Objects E3dDefaultAttributes a3DDefaultAttr; a3DDefaultAttr.SetDefaultLatheCharacterMode( true );
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdedtv.cxx | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) New commits: commit cb5285d544a355026a38c69ccf5473956d60e4ee Author: Caolán McNamara AuthorDate: Thu Oct 5 21:23:49 2023 +0100 Commit: Caolán McNamara CommitDate: Fri Oct 6 11:45:33 2023 +0200 Related: cool#7373 set name of object before broadcasting ScDrawChanged which adding it to undo does. That way the object already has a name when the navigator looks for the new object's name, and so a drawing shape appears in the navigator when it appears in the document. Change-Id: I47fed30753bc186e462cc5be8f86d51325192da9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157607 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index 88589a52271f..8c1c60bba681 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -992,12 +992,6 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInser if (!pObj->IsInserted()) { rPV.GetObjList()->InsertObject(pObj, SAL_MAX_SIZE); } -if( IsUndoEnabled()) -{ -bool bDontDeleteReally = true; -EndTextEditCurrentView(bDontDeleteReally); -AddUndo(GetModel().GetSdrUndoFactory().CreateUndoNewObject(*pObj)); -} css::uno::Reference xServices(GetModel().getUnoModel(), css::uno::UNO_QUERY); @@ -1010,6 +1004,13 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInser GetModel().EnableUndo(bUndo); } +if( IsUndoEnabled()) +{ +bool bDontDeleteReally = true; +EndTextEditCurrentView(bDontDeleteReally); +AddUndo(GetModel().GetSdrUndoFactory().CreateUndoNewObject(*pObj)); +} + if (!(nOptions & SdrInsertFlags::DONTMARK)) { if (!(nOptions & SdrInsertFlags::ADDMARK)) UnmarkAllObj(); MarkObj(pObj,&rPV);
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 32 +++- svx/source/sidebar/possize/PosSizePropertyPanel.hxx |7 ++-- 2 files changed, 22 insertions(+), 17 deletions(-) New commits: commit e47c1737d6f1365aa640f1960fb0c9892fde6d77 Author: Caolán McNamara AuthorDate: Tue Oct 3 14:53:17 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Oct 3 21:02:01 2023 +0200 tdf#155756 sidebar properties not displaying height over 100 Change-Id: I5ea2441319e0d7c34ffdcd179d8a82738da4733f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157519 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index c89d1b0b95a6..0024a41458db 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -94,6 +94,7 @@ PosSizePropertyPanel::PosSizePropertyPanel( mlRotY(0), mePoolUnit(), meDlgUnit(FieldUnit::INCH), // #i124409# init with fallback default +mbFieldMetricOutDated(true), maTransfPosXControl(SID_ATTR_TRANSFORM_POS_X, *pBindings, *this), maTransfPosYControl(SID_ATTR_TRANSFORM_POS_Y, *pBindings, *this), maTransfWidthControl(SID_ATTR_TRANSFORM_WIDTH, *pBindings, *this), @@ -686,10 +687,13 @@ void PosSizePropertyPanel::NotifyItemUpdate( break; case SID_ATTR_METRIC: -MetricState( eState, pState ); -UpdateUIScale(); +{ +const Fraction aUIScale(mpView->GetModel().GetUIScale()); +MetricState(eState, pState, aUIScale); +UpdateUIScale(aUIScale); +mbFieldMetricOutDated = false; break; - +} default: break; } @@ -855,7 +859,7 @@ void PosSizePropertyPanel::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) PanelLayout::DumpAsPropertyTree(rJsonWriter); } -void PosSizePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* pState ) +void PosSizePropertyPanel::MetricState(SfxItemState eState, const SfxPoolItem* pState, const Fraction& rUIScale) { bool bPosXBlank = false; bool bPosYBlank = false; @@ -865,7 +869,8 @@ void PosSizePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* // #i124409# use the given Item to get the correct UI unit and initialize it // and the Fields using it FieldUnit eDlgUnit = GetCurrentUnit(eState, pState); -if (eDlgUnit == meDlgUnit) +mbFieldMetricOutDated |= (eDlgUnit != meDlgUnit || maUIScale != rUIScale); +if (!mbFieldMetricOutDated) return; meDlgUnit = eDlgUnit; @@ -880,7 +885,8 @@ void PosSizePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* SetFieldUnit( *mxMtrPosY, meDlgUnit, true ); if(bPosYBlank) mxMtrPosY->set_text(OUString()); -SetPosSizeMinMax(); + +SetPosSizeMinMax(rUIScale); if (mxMtrWidth->get_text().isEmpty()) bWidthBlank = true; @@ -1008,7 +1014,7 @@ void PosSizePropertyPanel::DisableControls() } } -void PosSizePropertyPanel::SetPosSizeMinMax() +void PosSizePropertyPanel::SetPosSizeMinMax(const Fraction& rUIScale) { SdrPageView* pPV = mpView->GetSdrPageView(); if (!pPV) @@ -1021,9 +1027,8 @@ void PosSizePropertyPanel::SetPosSizeMinMax() pPV->LogicToPagePos(aTmpRect2); maWorkArea = vcl::unotools::b2DRectangleFromRectangle(aTmpRect2); -const Fraction aUIScale(mpView->GetModel().GetUIScale()); -TransfrmHelper::ScaleRect( maWorkArea, aUIScale ); -TransfrmHelper::ScaleRect( maRect, aUIScale ); +TransfrmHelper::ScaleRect(maWorkArea, rUIScale); +TransfrmHelper::ScaleRect(maRect, rUIScale); const sal_uInt16 nDigits(mxMtrPosX->get_digits()); TransfrmHelper::ConvertRect( maWorkArea, nDigits, mePoolUnit, meDlgUnit ); @@ -1058,16 +1063,15 @@ void PosSizePropertyPanel::SetPosSizeMinMax() limitWidth(*mxMtrHeight); } -void PosSizePropertyPanel::UpdateUIScale() +void PosSizePropertyPanel::UpdateUIScale(const Fraction& rUIScale) { -const Fraction aUIScale (mpView->GetModel().GetUIScale()); -if (maUIScale == aUIScale) +if (maUIScale == rUIScale) return; // UI scale has changed. // Remember the new UI scale. -maUIScale = aUIScale; +maUIScale = rUIScale; // The content of the position and size boxes is only updated when item changes are notified. // Request such notifications without changing the actual item values. diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx index 42af309883b2..b57d0bcf7dde 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx @@ -128,6 +128,7 @@ private: FractionmaUIScale; MapUnit
[Libreoffice-commits] core.git: svx/source
svx/source/styles/CommonStylePreviewRenderer.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit d9eed9b489d8ad208df307588595f3a8d3b7539b Author: Khaled Hosny AuthorDate: Sun Sep 24 18:10:21 2023 +0300 Commit: خالد حسني CommitDate: Sun Sep 24 18:23:47 2023 +0200 tdf#157067: Fix missing background color in style preview Set the colors after setting the font not before as otherwise they seem to get overridden. Change-Id: I258cb762fd2328369bd8adae63e94ec87c666bb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157208 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index c23861e92a72..d92aac21d89c 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -335,12 +335,6 @@ bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, Rend mrOutputDev.DrawRect(aRectangle); } -if (maFontColor != COL_AUTO) -mrOutputDev.SetTextColor(maFontColor); - -if (maHighlightColor != COL_AUTO) -mrOutputDev.SetTextFillColor(maHighlightColor); - Point aFontDrawPosition = aRectangle.TopLeft(); aFontDrawPosition.AdjustY(mnBaseLine); if (eRenderAlign == RenderAlign::CENTER) @@ -376,10 +370,16 @@ bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, Rend mrOutputDev.Push(vcl::PushFlags::FONT); if (oFont) -{ mrOutputDev.SetFont(*oFont); + +if (maFontColor != COL_AUTO) +mrOutputDev.SetTextColor(maFontColor); + +if (maHighlightColor != COL_AUTO) +mrOutputDev.SetTextFillColor(maHighlightColor); + +if (oFont) oFont->QuickDrawText(&mrOutputDev, aFontDrawPosition, rText, nStart, nEnd - nStart, {}); -} else mrOutputDev.DrawText(aFontDrawPosition, rText, nStart, nEnd - nStart);
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/tbunocontroller.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 6182deca602d533d1b2e379ba62d890681608144 Author: Szymon Kłos AuthorDate: Sat Sep 9 22:24:07 2023 +0200 Commit: Szymon Kłos CommitDate: Mon Sep 18 18:13:41 2023 +0200 jsdialog: set WindowId for font size combobox this is required to put combobox in correct map for receiveing events from user. without that font size was not possible to be changed from notebookbar in lok Change-Id: Id688b8fc1b3f565278ae651e050d18d75a048103 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156783 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157023 Tested-by: Jenkins diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index dfdb431dc504..148098c10e82 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -308,7 +309,7 @@ void SvxFontSizeBox_Impl::SetOptimalSize() SvxFontSizeBox_Impl::SvxFontSizeBox_Impl(vcl::Window* pParent, const uno::Reference& rFrame, FontHeightToolBoxControl& rCtrl) -: InterimItemWindow(pParent, "svx/ui/fontsizebox.ui", "FontSizeBox") +: InterimItemWindow(pParent, "svx/ui/fontsizebox.ui", "FontSizeBox", true, reinterpret_cast(SfxViewShell::Current())) , SvxFontSizeBox_Base(m_xBuilder->weld_combo_box("fontsizecombobox"), rFrame, rCtrl) { }
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdpage.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 17cd1dacf6a4b587b524edc7384ff26990208132 Author: Julien Nabet AuthorDate: Thu Sep 14 22:50:37 2023 +0200 Commit: Noel Grandin CommitDate: Fri Sep 15 13:45:17 2023 +0200 tdf#157174: fix crash when clicking "Print Preview" Don't call Reformat method when treating a virtual SdrObject bt: 4 0x7fd7ff446eb4 in SdrObject::GetBroadcaster() const (this=0x4) at /home/julien/lo/libreoffice/svx/source/svdraw/svdobj.cxx:698 5 0x7fd7ff48eaee in SdrEdgeObj::Reformat() (this=0x564e82ef22d0) at /home/julien/lo/libreoffice/svx/source/svdraw/svdoedge.cxx:1666 6 0x7fd7ff551bd9 in SdrObjList::ImplReformatAllEdgeObjects(SdrObjList const&) (this=0x564e82a371e0, rObjList=...) at /home/julien/lo/libreoffice/svx/source/svdraw/svdpage.cxx:760 7 0x7fd7ff551b38 in SdrObjList::ReformatAllEdgeObjects() (this=0x564e82a371e0) at /home/julien/lo/libreoffice/svx/source/svdraw/svdpage.cxx:744 8 0x7fd7ff3d8d1c in SdrModel::ImpReformatAllEdgeObjects() (this=0x564e7f79dc50) at /home/julien/lo/libreoffice/svx/source/svdraw/svdmodel.cxx:752 9 0x7fd7ff3dda3b in SdrModel::setLock(bool) (this=0x564e7f79dc50, bLock=false) at /home/julien/lo/libreoffice/svx/source/svdraw/svdmodel.cxx:1618 10 0x7fd7c58a9a76 in SwView::~SwView() (this=0x564e82e7bb00) at /home/julien/lo/libreoffice/sw/source/uibase/uiview/view.cxx:1163 11 0x7fd7c58a9f99 in SwView::~SwView() (this=0x564e82e7bb00) at /home/julien/lo/libreoffice/sw/source/uibase/uiview/view.cxx:1122 12 0x7fd801835308 in SfxViewFrame::SwitchToViewShell_Impl(unsigned short, bool) (this=0x564e82b17680, nViewIdOrNo=1, bIsIndex=true) at /home/julien/lo/libreoffice/sfx2/source/view/viewfrm.cxx:2528 See complete bt here: https://bugs.documentfoundation.org/attachment.cgi?id=189470 Change-Id: I4de5127686c01a40c1666f6089efa4fe7a114cd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156934 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 840d9d6cc0e7..8570a2157295 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -754,7 +754,9 @@ void SdrObjList::ImplReformatAllEdgeObjects(const SdrObjList& rObjList) const bool bIsGroup(nullptr != pChildren); if(!bIsGroup) { -if (pSdrObject->GetObjIdentifier() == SdrObjKind::Edge) +// Check IsVirtualObj because sometimes we get SwDrawVirtObj here +if (pSdrObject->GetObjIdentifier() == SdrObjKind::Edge + && !pSdrObject->IsVirtualObj()) { SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* >(pSdrObject); pSdrEdgeObj->Reformat();
[Libreoffice-commits] core.git: svx/source
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 819dec3533750a3a8f483351febe40aae85ca0b7 Author: Noel Grandin AuthorDate: Mon Sep 11 10:29:50 2023 +0200 Commit: Noel Grandin CommitDate: Mon Sep 11 11:49:24 2023 +0200 tdf#157173 Enlarging Fontwork shape replaces used font regression from commit b153d147c9d813f78dd551fc186c261f52c929a1 Author: Noel Grandin Date: Wed Apr 28 15:27:14 2021 +0200 remove support for BITMASK in vcl backends So the code that I removed had if (meFormat == DeviceFormat::BITMASK) SetAntialiasing( AntialiasingFlags::DisableText ); in the VirtualDevice::ImplInitVirDev method. Possibly we will need to make similar fixes in other places that used BITMASK, but this looks like the only spot that really needs it. No idea exactly how this line of code relates to the observed bug though. Change-Id: I858f15cf70a452568128d5b365d9a11f7062 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156815 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index d40d22e987c9..7d7ee4fdbc81 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -230,6 +230,7 @@ static void CalculateHorizontalScalingFactor( ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::WITHOUT_ALPHA); pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVirDev->SetFont( aFont ); +pVirDev->SetAntialiasing( AntialiasingFlags::DisableText ); if ( nOutlinesCount2d & 1 ) bSingleLineMode = true; @@ -343,6 +344,8 @@ static void GetTextAreaOutline( ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::WITHOUT_ALPHA); pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVirDev->SetFont( aFont ); +pVirDev->SetAntialiasing( AntialiasingFlags::DisableText ); + pVirDev->EnableRTL(); if ( rParagraph.nFrameDirection == SvxFrameDirection::Horizontal_RL_TB ) pVirDev->SetLayoutMode( vcl::text::ComplexTextLayoutFlags::BiDiRtl );
[Libreoffice-commits] core.git: svx/source
svx/source/inc/GraphCtlAccessibleContext.hxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 0db4cad99ff3746cc39f106a32bf2642628e336b Author: Noel Grandin AuthorDate: Sun Sep 10 12:11:58 2023 +0200 Commit: Noel Grandin CommitDate: Sun Sep 10 18:02:49 2023 +0200 SvxGraphCtrlAccessibleContext does not need to implement XAggreggation Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference const &) final { assert(false); } Change-Id: I4735bb086df297baff3b066a69e817e365007ba5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156791 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/inc/GraphCtlAccessibleContext.hxx b/svx/source/inc/GraphCtlAccessibleContext.hxx index 094d9bd18ba5..3e328e9f89a3 100644 --- a/svx/source/inc/GraphCtlAccessibleContext.hxx +++ b/svx/source/inc/GraphCtlAccessibleContext.hxx @@ -21,7 +21,7 @@ #ifndef INCLUDED_SVX_SOURCE_INC_GRAPHCTLACCESSIBLECONTEXT_HXX #define INCLUDED_SVX_SOURCE_INC_GRAPHCTLACCESSIBLECONTEXT_HXX -#include +#include #include #include #include @@ -57,7 +57,7 @@ class SdrView; AccessibleContext service. */ -typedef ::cppu::WeakAggComponentImplHelper7< +typedef ::cppu::WeakComponentImplHelper< css::accessibility::XAccessible, css::accessibility::XAccessibleComponent, css::accessibility::XAccessibleContext,
[Libreoffice-commits] core.git: svx/source
svx/source/table/tablecolumns.hxx |4 ++-- svx/source/table/tablerows.hxx|4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) New commits: commit b7431e530145c543604cf02808e439feca034333 Author: Noel Grandin AuthorDate: Fri Sep 8 14:59:50 2023 +0200 Commit: Noel Grandin CommitDate: Sat Sep 9 13:35:49 2023 +0200 TableColumns does not need to implement XAggreggation Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference const &) final { assert(false); } Change-Id: I650ef48d993450650bfe466ca9d4a9ab32b4493d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156724 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/svx/source/table/tablecolumns.hxx b/svx/source/table/tablecolumns.hxx index 2371ef1ba1b1..1a194033aa8f 100644 --- a/svx/source/table/tablecolumns.hxx +++ b/svx/source/table/tablecolumns.hxx @@ -21,14 +21,14 @@ #define INCLUDED_SVX_SOURCE_TABLE_TABLECOLUMNS_HXX #include -#include +#include #include namespace sdr::table { -class TableColumns : public ::cppu::WeakAggImplHelper1< css::table::XTableColumns > +class TableColumns : public ::cppu::WeakImplHelper< css::table::XTableColumns > { public: explicit TableColumns( TableModelRef xTableModel ); diff --git a/svx/source/table/tablerows.hxx b/svx/source/table/tablerows.hxx index 3141a7aac2c1..ea2cc892186e 100644 --- a/svx/source/table/tablerows.hxx +++ b/svx/source/table/tablerows.hxx @@ -21,13 +21,13 @@ #define INCLUDED_SVX_SOURCE_TABLE_TABLEROWS_HXX #include -#include +#include #include namespace sdr::table { -class TableRows : public ::cppu::WeakAggImplHelper1 +class TableRows : public ::cppu::WeakImplHelper { public: explicit TableRows(TableModelRef xTableModel);
[Libreoffice-commits] core.git: svx/source
svx/source/unogallery/unogalitem.cxx | 14 -- svx/source/unogallery/unogalitem.hxx | 11 --- 2 files changed, 8 insertions(+), 17 deletions(-) New commits: commit 4b814e8db4ce5f233c4bea041f90b6893084ede0 Author: Noel Grandin AuthorDate: Thu Sep 7 09:34:52 2023 +0200 Commit: Noel Grandin CommitDate: Thu Sep 7 18:41:46 2023 +0200 GalleryItem does not need to implement XAggreggation Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference const &) final { assert(false); } + Change-Id: I136a7b51ba7d5500876dcd8892f1165334daa15f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156643 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/svx/source/unogallery/unogalitem.cxx b/svx/source/unogallery/unogalitem.cxx index c08e182a46aa..5e72a25c0a28 100644 --- a/svx/source/unogallery/unogalitem.cxx +++ b/svx/source/unogallery/unogalitem.cxx @@ -70,7 +70,7 @@ bool GalleryItem::isValid() const } -uno::Any SAL_CALL GalleryItem::queryAggregation( const uno::Type & rType ) +uno::Any SAL_CALL GalleryItem::queryInterface( const uno::Type & rType ) { uno::Any aAny; @@ -87,29 +87,23 @@ uno::Any SAL_CALL GalleryItem::queryAggregation( const uno::Type & rType ) else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< beans::XMultiPropertySet >(this); else -aAny = OWeakAggObject::queryAggregation( rType ); +aAny = OWeakObject::queryInterface( rType ); return aAny; } -uno::Any SAL_CALL GalleryItem::queryInterface( const uno::Type & rType ) -{ -return OWeakAggObject::queryInterface( rType ); -} - - void SAL_CALL GalleryItem::acquire() noexcept { -OWeakAggObject::acquire(); +OWeakObject::acquire(); } void SAL_CALL GalleryItem::release() noexcept { -OWeakAggObject::release(); +OWeakObject::release(); } diff --git a/svx/source/unogallery/unogalitem.hxx b/svx/source/unogallery/unogalitem.hxx index 42bc0ba603cf..5674739a8aa7 100644 --- a/svx/source/unogallery/unogalitem.hxx +++ b/svx/source/unogallery/unogalitem.hxx @@ -26,7 +26,7 @@ #include #include #include -#include +#include class GalleryTheme; struct GalleryObject; @@ -34,12 +34,10 @@ namespace unogallery { class GalleryTheme; } namespace unogallery { +typedef ::comphelper::WeakComponentImplHelper GalleryItem_Base; -class GalleryItem final : public ::cppu::OWeakAggObject, -public css::lang::XServiceInfo, -public css::lang::XTypeProvider, -public css::gallery::XGalleryItem, -public ::comphelper::PropertySetHelper +class GalleryItem final : public GalleryItem_Base, + public ::comphelper::PropertySetHelper { friend class ::unogallery::GalleryTheme; @@ -53,7 +51,6 @@ public: private: // XInterface -virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override; virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; virtual void SAL_CALL acquire() noexcept override; virtual void SAL_CALL release() noexcept override;
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit 300dc54b0424add2dbab5443dcbd46ba12f418fc Author: Sarper Akdemir AuthorDate: Tue Sep 5 17:41:42 2023 +0300 Commit: Sarper Akdemir CommitDate: Tue Sep 5 22:05:16 2023 +0200 related tdf#150557: fix unified transparence initialization with alpha In 98319164284c4a25d6a2313e6b8a35d244d94e91, shadow alpha was passed in to UnifiedTransparencePrimitive2D instead of shadow transparence mistakenly. Fix that and pass shadow transparence instead. Change-Id: Idabedade5d753961648683869cb077de0e4523eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156573 Tested-by: Jenkins Reviewed-by: Sarper Akdemir diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 33e42efc6d23..50f66391d95e 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -856,10 +856,8 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const if (rShadow.getTransparence() != 0.0) { Primitive2DContainer aTempContent{ aRetval.back() }; - -double fShadowAlpha = 1.0 - rShadow.getTransparence(); aRetval.back() = Primitive2DReference(new UnifiedTransparencePrimitive2D( -std::move(aTempContent), fShadowAlpha)); +std::move(aTempContent), rShadow.getTransparence())); } }
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) New commits: commit b5effb66ee1563689c27ff10b682357120ab7786 Author: Samuel Mehrbrodt AuthorDate: Mon Sep 4 11:52:08 2023 +0200 Commit: Samuel Mehrbrodt CommitDate: Mon Sep 4 13:29:08 2023 +0200 tdf#151188 Select correct fill type in sidebar Change-Id: Ic123e6b21009cc57bf1c4b5f4edc6dcd277bae0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156510 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index 3659110f16db..9adff2c65dfd 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -1066,10 +1066,14 @@ void AreaPropertyPanelBase::updateFillUseBackground(bool bDisabled, bool bDefaul if (pState) { const XFillUseSlideBackgroundItem* pItem = static_cast(pState); -// When XFillUseSlideBackgroundItem is true, select "Use Background Fill". When false, select "None" +// When XFillUseSlideBackgroundItem is set, select "Use Background Fill". +// When false, select "None" (only if "Use background fill" was selected beforehand) int nPos = pItem->GetValue() ? USE_BACKGROUND : NONE; -mxLbFillType->set_active(nPos); -FillStyleChanged(false); +if ((nPos == NONE && mxLbFillType->get_active() == USE_BACKGROUND) || nPos == USE_BACKGROUND) +{ +mxLbFillType->set_active(nPos); +FillStyleChanged(false); +} } } }
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/Palette.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 2ee60cb3535937eb85b808977a020b55a7123a92 Author: Julien Nabet AuthorDate: Fri Sep 1 15:56:01 2023 +0200 Commit: Julien Nabet CommitDate: Sat Sep 2 08:59:35 2023 +0200 tdf#156126: fix crash when using gpl color palette keep the do/while instead of a plain while since: 1) you'll always got a empty line since aLine isn't initialized 2) some palette may contain empty line eg: "Office 2016" palette from https://extensions.libreoffice.org/en/extensions/show/o2k10-color-palette Change-Id: I2874261b8dd13ce180ed05628b11bd3efce6720c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156421 Reviewed-by: Julien Nabet Tested-by: Julien Nabet diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx index 8c81eb53167e..b3f1965de31b 100644 --- a/svx/source/tbxctrls/Palette.cxx +++ b/svx/source/tbxctrls/Palette.cxx @@ -262,6 +262,9 @@ void PaletteGPL::LoadPalette() OStringBuffer aLine; do { +if (aLine.isEmpty()) +continue; + if (aLine[0] != '#' && aLine[0] != '\n') { // TODO check if r,g,b are 0<= x <=255, or just clamp?
[Libreoffice-commits] core.git: svx/source
svx/source/unodraw/unoshape.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5f89cf39c8c6228e3580aa94db4978825ea1fba2 Author: Noel Grandin AuthorDate: Thu Aug 31 14:49:17 2023 +0200 Commit: Noel Grandin CommitDate: Thu Aug 31 17:45:07 2023 +0200 improve debug warning message Change-Id: I72f5966a6c144a40d81e479c3d8d27d345064993 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156342 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 362c0ba149a6..6bd355391301 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1876,7 +1876,7 @@ uno::Any SvxShape::GetAnyForItem( SfxItemSet const & aSet, const SfxItemProperty } else { -OSL_FAIL("SvxShape::GetAnyForItem() Returnvalue has wrong Type!" ); +SAL_WARN("svx", "SvxShape::GetAnyForItem() Return value has wrong Type, " << pMap->aType << " != " << aAny.getValueType()); } }
[Libreoffice-commits] core.git: svx/source
svx/source/unodraw/unoshape.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6baacabbb74171287d449f23cb70bd2523b18039 Author: Noel Grandin AuthorDate: Thu Aug 31 14:16:05 2023 +0200 Commit: Noel Grandin CommitDate: Thu Aug 31 15:39:28 2023 +0200 ignore UnknownPropertyException in SvxShape::setPropertyValues which greatly reduces the log noise when debugging Change-Id: I556fb79c04b23f757b92ed635233d5222c177df1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156338 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index e3663d024f5e..362c0ba149a6 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1709,7 +1709,7 @@ void SAL_CALL SvxShape::setPropertyValues( const css::uno::Sequence< OUString >& } catch (beans::UnknownPropertyException&) { -DBG_UNHANDLED_EXCEPTION("svx"); +// ignore, various code likes to opportunisticly set properties on objects that don't support those properties } catch (uno::Exception&) {
[Libreoffice-commits] core.git: svx/source
svx/source/theme/ThemeColorChangerCommon.cxx | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) New commits: commit 60880c9a7634468a852d4b0bf2d7a69d41ac7d11 Author: Caolán McNamara AuthorDate: Thu Aug 31 09:03:31 2023 +0100 Commit: Caolán McNamara CommitDate: Thu Aug 31 15:23:18 2023 +0200 cid#1542447 Explicit null dereferenced Change-Id: I1de10a8a459175f79bb2b8f796cde287be1945c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156326 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/theme/ThemeColorChangerCommon.cxx b/svx/source/theme/ThemeColorChangerCommon.cxx index 5629036f9a68..44f041f5f3b0 100644 --- a/svx/source/theme/ThemeColorChangerCommon.cxx +++ b/svx/source/theme/ThemeColorChangerCommon.cxx @@ -48,16 +48,16 @@ const SvxColorItem* getColorItem(const editeng::Section& rSection) return nullptr; } -bool updateEditEngTextSections(model::ColorSet const& rColorSet, SdrObject* pObject, SdrView* pView) +bool updateEditEngTextSections(model::ColorSet const& rColorSet, SdrObject* pObject, SdrView& rView) { SdrTextObj* pTextObject = DynCastSdrTextObj(pObject); if (!pTextObject) return false; -pView->SdrBeginTextEdit(pTextObject); +rView.SdrBeginTextEdit(pTextObject); -auto* pOutlinerView = pView->GetTextEditOutlinerView(); +auto* pOutlinerView = rView.GetTextEditOutlinerView(); if (!pOutlinerView) return false; @@ -96,7 +96,7 @@ bool updateEditEngTextSections(model::ColorSet const& rColorSet, SdrObject* pObj } } -pView->SdrEndTextEdit(); +rView.SdrEndTextEdit(); return true; } @@ -165,7 +165,8 @@ void updateSdrObject(model::ColorSet const& rColorSet, SdrObject* pObject, SdrVi if (!pObject) return; -updateEditEngTextSections(rColorSet, pObject, pView); +if (pView) +updateEditEngTextSections(rColorSet, pObject, *pView); updateObjectAttributes(rColorSet, *pObject, pUndoManager); }
[Libreoffice-commits] core.git: svx/source
svx/source/accessibility/AccessibleControlShape.cxx | 44 +++- 1 file changed, 16 insertions(+), 28 deletions(-) New commits: commit aa3eea21fcf302ef4ddbba5841037378945f9d5e Author: Arnaud VERSINI AuthorDate: Sun Aug 27 18:44:21 2023 +0200 Commit: Noel Grandin CommitDate: Sun Aug 27 20:46:23 2023 +0200 svx : replace local function with OUStringLiteral Change-Id: Ica39cd5b6da3c97dd03aa9844e2dd8d99c279697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156170 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index 8fe42db6dada..e625beaec508 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -61,29 +61,18 @@ using namespace ::com::sun::star::container; namespace { -OUString lcl_getNamePropertyName( ) -{ -return "Name"; -} -OUString lcl_getDescPropertyName( ) -{ -return "HelpText"; -} -OUString lcl_getLabelPropertyName( ) -{ -return "Label"; -} -OUString lcl_getLabelControlPropertyName( ) -{ -return "LabelControl"; -} +constexpr OUStringLiteral NAME_PROPERTY_NAME = u"Name"; +constexpr OUStringLiteral DESC_PROPERTY_NAME = u"HelpText"; +constexpr OUStringLiteral LABEL_PROPERTY_NAME = u"Label"; +constexpr OUStringLiteral LABEL_CONTROL_PROPERTY_NAME = u"LabelControl"; + // return the property which should be used as AccessibleName OUString lcl_getPreferredAccNameProperty( const Reference< XPropertySetInfo >& _rxPSI ) { -if ( _rxPSI.is() && _rxPSI->hasPropertyByName( lcl_getLabelPropertyName() ) ) -return lcl_getLabelPropertyName(); +if ( _rxPSI.is() && _rxPSI->hasPropertyByName( LABEL_PROPERTY_NAME ) ) +return LABEL_PROPERTY_NAME; else -return lcl_getNamePropertyName(); +return NAME_PROPERTY_NAME; } // determines whether or not a state which belongs to the inner context needs to be forwarded to the "composed" @@ -325,7 +314,7 @@ OUString case DRAWING_CONTROL: { // check if we can obtain the "Desc" property from the model -OUString sDesc( getControlModelStringProperty( lcl_getDescPropertyName() ) ); +OUString sDesc( getControlModelStringProperty( DESC_PROPERTY_NAME ) ); if ( sDesc.isEmpty() ) { // no -> use the default aDG.Initialize (STR_ObjNameSingulUno); @@ -333,7 +322,7 @@ OUString aDG.AddProperty ( "ControlBorder", DescriptionGenerator::PropertyType::Integer); } // ensure that we are listening to the Name property -m_bListeningForDesc = ensureListeningState( m_bListeningForDesc, true, lcl_getDescPropertyName() ); +m_bListeningForDesc = ensureListeningState( m_bListeningForDesc, true, DESC_PROPERTY_NAME ); } break; @@ -357,14 +346,14 @@ void SAL_CALL AccessibleControlShape::propertyChange( const PropertyChangeEvent& ::osl::MutexGuard aGuard( m_aMutex ); // check if it is the name or the description -if ( _rEvent.PropertyName == lcl_getNamePropertyName() -|| _rEvent.PropertyName == lcl_getLabelPropertyName() ) +if ( _rEvent.PropertyName == NAME_PROPERTY_NAME +|| _rEvent.PropertyName == LABEL_PROPERTY_NAME ) { SetAccessibleName( CreateAccessibleName(), AccessibleContextBase::AutomaticallyCreated); } -else if ( _rEvent.PropertyName == lcl_getDescPropertyName() ) +else if ( _rEvent.PropertyName == DESC_PROPERTY_NAME ) { SetAccessibleDescription( CreateAccessibleDescription(), @@ -612,7 +601,7 @@ void SAL_CALL AccessibleControlShape::disposing() { // ensure we're not listening m_bListeningForName = ensureListeningState( m_bListeningForName, false, lcl_getPreferredAccNameProperty( m_xModelPropsMeta ) ); -m_bListeningForDesc = ensureListeningState( m_bListeningForDesc, false, lcl_getDescPropertyName() ); +m_bListeningForDesc = ensureListeningState( m_bListeningForDesc, false, DESC_PROPERTY_NAME ); if ( m_bMultiplexingStates ) stopStateMultiplexing( ); @@ -843,12 +832,11 @@ AccessibleControlShape* AccessibleControlShape::GetLabeledByControlShape( ) { if(m_xControlModel.is()) { -const OUString& rAccLabelControlProperty = lcl_getLabelControlPropertyName(); Any sCtlLabelBy; // get the "label by" property value of the control -if (::comphelper::hasProperty(rAccLabelControlProperty, m_xControlModel)) +if (::comphelper::hasProperty(LABEL_CONTROL_PROPERTY_NAME, m_xControlModel)) { -sCtlLabelBy = m_xControlModel->getPropertyValue(rAccLabelControl
[Libreoffice-commits] core.git: svx/source
svx/source/theme/ThemeColorChangerCommon.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 0f1eeebfcb6177073ce15ec4a357ab80d6955870 Author: Andrea Gelmini AuthorDate: Fri Aug 25 18:51:07 2023 +0200 Commit: Julien Nabet CommitDate: Sat Aug 26 11:20:34 2023 +0200 Remove duplicated include Change-Id: Ife90baef2ceff442f51c03805eda945b2b2baf34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156118 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/svx/source/theme/ThemeColorChangerCommon.cxx b/svx/source/theme/ThemeColorChangerCommon.cxx index 29d65cdda960..5629036f9a68 100644 --- a/svx/source/theme/ThemeColorChangerCommon.cxx +++ b/svx/source/theme/ThemeColorChangerCommon.cxx @@ -30,7 +30,6 @@ #include #include -#include using namespace css;
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/contact/viewobjectcontact.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9679bc5f24a8965341840c458ba69479585815f7 Author: Andrea Gelmini AuthorDate: Thu Aug 24 17:14:49 2023 +0200 Commit: Julien Nabet CommitDate: Thu Aug 24 22:13:53 2023 +0200 Fix typo Change-Id: I9d1b0bbd99caa53515b8d8bf7d86723cd51aca6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156059 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 450b8215482e..8482187f959b 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -584,7 +584,7 @@ const basegfx::B2DVector& ViewObjectContact::getGridOffset() const // calculation have changed. E.g. - I saw errors with +/-5740, that // was in the environment of massive external UNO API using LO as // target. -// If condtions for this calculation change, it is usually required to call +// If conditions for this calculation change, it is usually required to call // - ViewObjectContact::resetGridOffset(), or // - ObjectContact::resetAllGridOffsets() or // - ScDrawView::resetGridOffsetsForAllSdrPageViews()
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/contact/viewobjectcontact.cxx | 35 --- 1 file changed, 32 insertions(+), 3 deletions(-) New commits: commit 382dfb3e6ee73fc94a556e37d261e8219e08826c Author: Armin Le Grand (allotropia) AuthorDate: Wed Aug 23 16:55:07 2023 +0200 Commit: Armin Le Grand CommitDate: Thu Aug 24 12:34:24 2023 +0200 Reset buffered GridOffset(s) for suspicious values Huge offsets of GridOffset(s) are a hint for error -> usually the conditions for calculation have changed. E.g. - I saw errors with +/-5740, that was in the environment of massive external UNO API using LO as target. If condtions for this calculation change, it is usually required to call - ViewObjectContact::resetGridOffset(), or - ObjectContact::resetAllGridOffsets() or - ScDrawView::resetGridOffsetsForAllSdrPageViews() as it is done e.g. when zoom changes (see ScDrawView::RecalcScale()). Theoretically these resets have to be done for any precondition changed that is used in the calculation of that value (see ScDrawView::calculateGridOffsetForSdrObject). This is not complete and would be hard to do so. Since it is just a buffered value and re-calculation is not expensive (linear O(n)) we can just reset suspicious values here what fixes the problem. Hopefully - when that non-linear ViewTransformation problem for the calc-view gets solved one day - all this can be removed again. For now, let's just reset here and force re-calculation. Added a SAL_WARN to inform about this, too. Change-Id: I09137f7703fd00c2351a288a40bf87a2691ba6e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155983 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 91ee66dff1ae..450b8215482e 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -576,10 +576,39 @@ void ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplay // (->View) that has then all needed information const basegfx::B2DVector& ViewObjectContact::getGridOffset() const { -if(0.0 == maGridOffset.getX() && 0.0 == maGridOffset.getY() && GetObjectContact().supportsGridOffsets()) +if (GetObjectContact().supportsGridOffsets()) { -// create on-demand - GetObjectContact().calculateGridOffsetForViewOjectContact(const_cast(this)->maGridOffset, *this); +if (fabs(maGridOffset.getX()) > 1000.0) +{ +// Huge offsets are a hint for error -> usually the conditions for +// calculation have changed. E.g. - I saw errors with +/-5740, that +// was in the environment of massive external UNO API using LO as +// target. +// If condtions for this calculation change, it is usually required to call +// - ViewObjectContact::resetGridOffset(), or +// - ObjectContact::resetAllGridOffsets() or +// - ScDrawView::resetGridOffsetsForAllSdrPageViews() +// as it is done e.g. when zoom changes (see ScDrawView::RecalcScale()). +// Theoretically these resets have to be done for any precondition +// changed that is used in the calculation of that value (see +// ScDrawView::calculateGridOffsetForSdrObject). +// This is not complete and would be hard to do so. +// Since it is just a buffered value and re-calculation is not +// expensive (linear O(n)) we can just reset suspicious values here. +// Hopefully - when that non-linear ViewTransformation problem for +// the calc-view gets solved one day - all this can be removed +// again. For now, let's just reset here and force re-calculation. +// Add a SAL_WARN to inform about this. +SAL_WARN("svx", "Suspicious GridOffset value resetted (!)"); +const_cast(this)->maGridOffset.setX(0.0); +const_cast(this)->maGridOffset.setY(0.0); +} + +if(0.0 == maGridOffset.getX() && 0.0 == maGridOffset.getY() && GetObjectContact().supportsGridOffsets()) +{ +// create on-demand + GetObjectContact().calculateGridOffsetForViewOjectContact(const_cast(this)->maGridOffset, *this); +} } return maGridOffset;
[Libreoffice-commits] core.git: svx/source
svx/source/form/navigatortree.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit f6e8e1799315fd9494db514d969c24cf0ca46753 Author: Caolán McNamara AuthorDate: Wed Aug 23 16:50:40 2023 +0100 Commit: Caolán McNamara CommitDate: Wed Aug 23 21:08:43 2023 +0200 crashreporting: crash seen in FormNavigator set_text(rVclIter.iter, rText, col); ... m_xTreeView->set_text(*xEntry, pNameChangedHint->GetNewName()); ... m_pNavModel->Broadcast( aNameChangedHint ); Change-Id: I31275dd37de0146eae2ebb0931a5450e34fd21fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155985 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index bf860ce7198d..8ee866edb8d3 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -579,7 +579,8 @@ namespace svxform else if( auto pNameChangedHint = dynamic_cast(&rHint) ) { std::unique_ptr xEntry = FindEntry(pNameChangedHint->GetEntryData()); -m_xTreeView->set_text(*xEntry, pNameChangedHint->GetNewName()); +if (xEntry) +m_xTreeView->set_text(*xEntry, pNameChangedHint->GetNewName()); } else if( dynamic_cast(&rHint) ) {
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdotextdecomposition.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 12a754e7bc94e96ac3e8ddb9e62454e7192bd62d Author: Andrea Gelmini AuthorDate: Wed Aug 23 15:14:01 2023 +0200 Commit: Julien Nabet CommitDate: Wed Aug 23 15:48:23 2023 +0200 Fix typo Change-Id: Iaa9fbb1545a2dbe373ba0f71eaf10fe067888ab9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155982 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 6a1a54f2321e..cfe4c1b3c3f0 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -322,7 +322,7 @@ namespace drawinglayer::primitive2d::Primitive2DContainer aContainer; aContainer.swap(maTextPortionPrimitives); -// Take any decoration for the whole formatted portion and keep it to get continous over/under/strike-through +// Take any decoration for the whole formatted portion and keep it to get continuous over/under/strike-through if (pNewPrimitive->getPrimitive2DID() == PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D) { const drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D* pTCPP =
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdotextdecomposition.cxx | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) New commits: commit 8ec43f37a7a5babe9227a5ca1ea84720fc2e15e5 Author: Caolán McNamara AuthorDate: Mon Aug 21 11:41:26 2023 +0100 Commit: Caolán McNamara CommitDate: Mon Aug 21 14:12:42 2023 +0200 spellchecking wave doesn't extend to the full width of superscript text or subscript, e.g. enter tmalltmalltmalltmalltmalltmalltmall in impress, format character, position, superscript, ok and without this change the wave extends only 80% of the width of the misspelt text Change-Id: I5d3ad61541152199809c950349533ca3fa7ed1c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155890 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 5d7c51208154..66c97d29b9b1 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -168,11 +168,9 @@ namespace // look for proportional font scaling, if necessary, scale accordingly sal_Int8 nPropr(rInfo.mrFont.GetPropr()); -if(100 != nPropr) -{ -const double fFactor(rInfo.mrFont.GetPropr() / 100.0); -aNewTransform.scale(fFactor, fFactor); -} +const double fPropFontFactor(nPropr / 100.0); +if (100 != nPropr) +aNewTransform.scale(fPropFontFactor, fPropFontFactor); // apply font rotate if(rInfo.mrFont.GetOrientation()) @@ -439,7 +437,7 @@ namespace // need to take FontScaling out of values; it's already part of // aNewTransform and would be double applied -const double fFontScaleX(aFontScaling.getX()); +const double fFontScaleX(aFontScaling.getX() * fPropFontFactor); if(!basegfx::fTools::equal(fFontScaleX, 1.0) && !basegfx::fTools::equalZero(fFontScaleX))
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/docrecovery.cxx |4 ++-- svx/source/inc/docrecovery.hxx|2 +- svx/source/unodraw/recoveryui.cxx |2 +- 3 files changed, 4 insertions(+), 4 deletions(-) New commits: commit 47cff47966ea2876765bdfb2dfb83eaeb1db1e1a Author: Justin Luth AuthorDate: Thu Aug 10 09:33:26 2023 -0400 Commit: Justin Luth CommitDate: Fri Aug 11 00:11:35 2023 +0200 autorecovery: DLG_RET_OK_AUTOLUNCH => DLG_RET_OK_AUTOLAUNCH Change-Id: I3f1436fa1b8ff5b34c65b103b0dd26dffc0e558d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155566 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index f77418227c78..1e40115270bb 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -607,9 +607,9 @@ IMPL_LINK_NOARG(SaveDialog, OKButtonHdl, weld::Button&, void) xProgress.reset(); // if "CANCEL" => return "CANCEL" -// if "OK" => "AUTOLUNCH" always ! +// if "OK" => request a restart always! if (nResult == DLG_RET_OK) -nResult = DLG_RET_OK_AUTOLUNCH; +nResult = DLG_RET_OK_AUTOLAUNCH; m_xDialog->response(nResult); } diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx index 9660f20bef3a..16b8917ee552 100644 --- a/svx/source/inc/docrecovery.hxx +++ b/svx/source/inc/docrecovery.hxx @@ -64,7 +64,7 @@ inline constexpr OUStringLiteral STATEPROP_MODULE = u"Module"; #define DLG_RET_UNKNOWN -1 #define DLG_RET_OK RET_OK #define DLG_RET_CANCEL RET_CANCEL -#define DLG_RET_OK_AUTOLUNCH101 +#define DLG_RET_OK_AUTOLAUNCH 101 // request a restart enum class EDocStates diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index 010d901f5dc3..a8e2e9395417 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -256,7 +256,7 @@ bool RecoveryUI::impl_doEmergencySave() // start the dialog short nRet = xDialog->run(); -return (nRet==DLG_RET_OK_AUTOLUNCH); +return (nRet==DLG_RET_OK_AUTOLAUNCH); } bool RecoveryUI::impl_doRecovery()
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/tbxcolorupdate.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f69a98d1175720db3b1ce5f5ae2c7fc0fc35a2b2 Author: Noel Grandin AuthorDate: Mon Aug 7 14:18:16 2023 +0200 Commit: Noel Grandin CommitDate: Mon Aug 7 15:49:24 2023 +0200 tdf#156629 Font,highlighting color buttons in sidebar have white background... ..after transparency -> alpha change regression from commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Author: Noel Grandin Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: Id1a578fcd30a9315fd5910ccdbff5d759cba77fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155425 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index edd835736268..970fa40181af 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -213,7 +213,7 @@ namespace svx return; ScopedVclPtr pVirDev(CreateVirtualDevice()); -pVirDev->SetOutputSizePixel(aItemSize); +pVirDev->SetOutputSizePixel(aItemSize, /*bErase*/true, /*bAlphaMaskTransparent*/true); maBmpSize = aItemSize; std::unique_ptr xMetaFile;
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/docrecovery.cxx | 22 +- svx/source/inc/docrecovery.hxx|2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) New commits: commit 6444f5e2c5c8b3d1fac12755af09339083c74055 Author: Justin Luth AuthorDate: Sat Aug 5 16:42:23 2023 -0400 Commit: Justin Luth CommitDate: Sun Aug 6 03:58:21 2023 +0200 tdf#145606 autorecover: skip "Finish" button if all recovered OK. Change-Id: I59036b98b33d85305b13430113a3a3d399dea27d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155379 Reviewed-by: Justin Luth Tested-by: Jenkins diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index 6675a05c64ea..f77418227c78 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -737,6 +737,21 @@ RecoveryDialog::~RecoveryDialog() xComp->dispose(); } +bool RecoveryDialog::allSuccessfullyRecovered() +{ +const int c = m_xFileListLB->n_children(); +for (int i = 0; i < c; ++i) +{ +TURLInfo* pInfo = weld::fromId(m_xFileListLB->get_id(i)); +if (!pInfo) +continue; + +if (pInfo->RecoveryState != E_SUCCESSFULLY_RECOVERED) +return false; +} +return true; +} + short RecoveryDialog::execute() { ::SolarMutexGuard aSolarLock; @@ -761,7 +776,12 @@ short RecoveryDialog::execute() Application::Yield(); m_pCore->setUpdateListener(nullptr); -m_eRecoveryState = RecoveryDialog::E_RECOVERY_CORE_DONE; + +// Skip FINISH button if everything was successfully recovered +if (allSuccessfullyRecovered()) +m_eRecoveryState = RecoveryDialog::E_RECOVERY_DONE; +else +m_eRecoveryState = RecoveryDialog::E_RECOVERY_CORE_DONE; return execute(); } diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx index d7442d2c7ab1..9660f20bef3a 100644 --- a/svx/source/inc/docrecovery.hxx +++ b/svx/source/inc/docrecovery.hxx @@ -438,6 +438,8 @@ class RecoveryDialog final : public weld::GenericDialogController virtual void stepNext(TURLInfo* pItem) override; virtual void end() override; +bool allSuccessfullyRecovered(); + short execute(); // helper
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/contact/objectcontactofpageview.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 34387332173782498acd4998c7c665d04ebc3c7d Author: Armin Le Grand (allotropia) AuthorDate: Wed Aug 2 16:02:16 2023 +0200 Commit: Thorsten Behrens CommitDate: Thu Aug 3 00:58:10 2023 +0200 tdf#153102: use given RedrawArea in DoProcessDisplay In ObjectContactOfPageView::DoProcessDisplay someone changed (seven years ago) to ignore the given RedrawArea if comphelper::LibreOfficeKit::isActive(). Using and setting that RedrawArea is needed to get the visual clipping against e.g. PageBounds in Writer paint working. Adding that again. Change-Id: If628039379c2756aac8865c3632e37c19993d0da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155262 Tested-by: Jenkins Reviewed-by: Thorsten Behrens diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index 1c698227a951..eadfe787966e 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -149,7 +149,9 @@ namespace sdr::contact bool bClipRegionPushed(false); const vcl::Region& rRedrawArea(rDisplayInfo.GetRedrawArea()); -if(!rRedrawArea.IsEmpty() && !comphelper::LibreOfficeKit::isActive()) +// tdf#153102 using the given RedrawArea is needed e.g. for Writer's +// visual clipping against PageBounds (also for android viewer) +if(!rRedrawArea.IsEmpty()) { bClipRegionPushed = true; pOutDev->Push(vcl::PushFlags::CLIPREGION);
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/ThemeDialog.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 2b2fdfa0e9aea207a065506c56c2a0033b4cbd44 Author: Noel Grandin AuthorDate: Mon Jul 24 10:16:11 2023 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Jul 24 16:38:27 2023 +0200 fix COOL crash in theme dialog ==3975==ERROR: AddressSanitizer: heap-use-after-free /opt/collaboraoffice/program/libmergedlo.so std::vector >::clear() /home/collabora/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/stl_vector.h:1248 /opt/collaboraoffice/program/libmergedlo.so operator() /home/collabora/online-buildscripts/staging/builddir/libreoffice/svx/source/dialog/ThemeDialog.cxx:96 /opt/collaboraoffice/program/libmergedlo.so std::function::operator()(int) const /home/collabora/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:706 /opt/collaboraoffice/program/libmergedlo.so Dialog::EndDialog(long) /home/collabora/online-buildscripts/staging/builddir/libreoffice/vcl/source/window/dialog.cxx:1192 /opt/collaboraoffice/program/libmergedlo.so jsdialog::ExecuteAction(std::__cxx11::basic_string, std::allocator > const&, rtl::OString const&, std::map, std::allocator > >&) /home/collabora/online-buildscripts/staging/builddir/libreoffice/vcl/jsdialog/executor.cxx:566 /opt/collaboraoffice/program/libmergedlo.so lcl_sendDialogEvent(unsigned long long, char const*) /home/collabora/online-buildscripts/staging/builddir/libreoffice/desktop/source/lib/init.cxx:4735 /usr/bin/coolforkit lok::Document::sendDialogEvent(unsigned long long, char const*) /home/collabora/online-buildscripts/staging/builddir/libreoffice/include/LibreOfficeKit/LibreOfficeKit.hxx:323 /usr/bin/coolforkit Change-Id: I7b34c9649c96f6745c2230ac347644fb45ec7f6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154836 Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl (cherry picked from commit 2ee535bfdb089511261daff20e515714ed2c0563) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154851 Tested-by: Jenkins diff --git a/svx/source/dialog/ThemeDialog.cxx b/svx/source/dialog/ThemeDialog.cxx index cda60a457b04..ab743b0df4bd 100644 --- a/svx/source/dialog/ThemeDialog.cxx +++ b/svx/source/dialog/ThemeDialog.cxx @@ -86,7 +86,8 @@ IMPL_LINK_NOARG(ThemeDialog, SelectItem, ValueSet*, void) void ThemeDialog::runThemeColorEditDialog() { auto pDialog = std::make_shared(mpWindow, *mpCurrentColorSet); -weld::DialogController::runAsync(pDialog, [this, pDialog](sal_uInt32 nResult) { +std::shared_ptr xKeepAlive(shared_from_this()); +weld::DialogController::runAsync(pDialog, [this, xKeepAlive, pDialog](sal_uInt32 nResult) { if (nResult != RET_OK) { mxAdd->set_sensitive(true);
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit efbdd13f96888ae06717afafb1e4014ce502aa3e Author: Jim Raykowski AuthorDate: Wed Jul 19 21:35:16 2023 -0800 Commit: Jim Raykowski CommitDate: Sun Jul 23 20:27:05 2023 +0200 tdf#154038 tdf#83618 fix wrong line spacing value Impress and Writer seem to require different MapUnit values for fixed line spacing metric values to be correctly calculated. This patch initially sets the MapUnit unit value to Map100thMM, which is what it was before commit 849b837d1a3b185a8dd893a8f6eaed53605bcab1, which works for Impress. For Writer, the value is set to MapTwip. Change-Id: I49e9b80aa4d3fbda1f19101903d2a4459089024c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154665 Tested-by: Jenkins Reviewed-by: Jim Raykowski diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index fee659817a14..4c756a5b1224 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -32,6 +32,8 @@ #include +#include + #define DEFAULT_LINE_SPACING 200 #define FIX_DIST_DEF 283 #define LINESPACE_1 100 @@ -134,7 +136,12 @@ void ParaLineSpacingControl::Initialize() if( bItemStateSet && (eState == SfxItemState::DEFAULT || eState == SfxItemState::SET) ) { const SvxLineSpacingItem* currSPItem = pItem; -MapUnit eUnit = pCurrent->GetPool().GetMetric(currSPItem->Which()); +// It seems draw/impress and writer require different MapUnit values for fixed line spacing +// metric values to be correctly calculated. +MapUnit eUnit = MapUnit::Map100thMM; // works for draw/impress +if (vcl::CommandInfoProvider::GetModuleIdentifier(pCurrent->GetFrame().GetFrameInterface()) +== "com.sun.star.text.TextDocument") +eUnit = MapUnit::MapTwip; // works for writer meLNSpaceUnit = eUnit; switch( currSPItem->GetLineSpaceRule() )
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/tools/ValueSetWithTextControl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6256d5fe2e7cb1bb002d5fe59527d3a3fbf6963f Author: Justin Luth AuthorDate: Mon Jul 10 15:27:29 2023 -0400 Commit: Justin Luth CommitDate: Tue Jul 18 02:40:08 2023 +0200 tdf#136905 NBB: use label font in ValueSetWithTextControl The label font is taken from the system settings, and doing this matched the "more options" button font as well as the nearby "margins" and "columns" as well as pretty much everything else in the notebookbar. I tested this by changing "Font Selection" in my Ubuntu Cinnamon to a flowery font. Prior to the patch it was a normalish font, but after the change it was using the flowery font. Change-Id: I2585e6aec31aa4195a2354337eb243e63c719ec0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154555 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx index 77b260272264..91cea51325e6 100644 --- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx +++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx @@ -75,7 +75,7 @@ void ValueSetWithTextControl::UserDraw( const UserDrawEvent& rUDEvt ) const tools::Long nRectHeight = aRect.GetHeight(); -vcl::Font aFont(OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, MsLangId::getConfiguredSystemLanguage(), GetDefaultFontFlags::OnlyOne)); +vcl::Font aFont(Application::GetSettings().GetStyleSettings().GetLabelFont()); { Size aSize = aFont.GetFontSize(); aSize.setHeight( (nRectHeight*4)/9 );
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/ThemeDialog.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit e73b2bc4e6fdaba3098fa2c701342e1df112514c Author: Gülşah Köse AuthorDate: Mon Jul 17 11:27:08 2023 +0300 Commit: Tomaž Vajngerl CommitDate: Mon Jul 17 13:53:20 2023 +0200 Prevent to open multiple Theme Color Edit dialog Signed-off-by: Gülşah Köse Change-Id: Ibf4db096b44ce941140a12d003b89b636f5e7224 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154514 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/svx/source/dialog/ThemeDialog.cxx b/svx/source/dialog/ThemeDialog.cxx index 8af6f5975df2..cda60a457b04 100644 --- a/svx/source/dialog/ThemeDialog.cxx +++ b/svx/source/dialog/ThemeDialog.cxx @@ -88,7 +88,10 @@ void ThemeDialog::runThemeColorEditDialog() auto pDialog = std::make_shared(mpWindow, *mpCurrentColorSet); weld::DialogController::runAsync(pDialog, [this, pDialog](sal_uInt32 nResult) { if (nResult != RET_OK) +{ +mxAdd->set_sensitive(true); return; +} auto aColorSet = pDialog->getColorSet(); if (!aColorSet.getName().isEmpty()) { @@ -102,6 +105,7 @@ void ThemeDialog::runThemeColorEditDialog() mpCurrentColorSet = std::make_shared(maColorSets[maColorSets.size() - 1]); } +mxAdd->set_sensitive(true); }); } @@ -110,6 +114,7 @@ IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, rButton, void) if (mpCurrentColorSet && mxAdd.get() == &rButton) { runThemeColorEditDialog(); +mxAdd->set_sensitive(false); } }
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/svxruler.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a177a4474b8c31f44741e2834df2c76ea8074aa3 Author: Mike Kaganski AuthorDate: Thu Jul 13 21:07:08 2023 +0300 Commit: Mike Kaganski CommitDate: Thu Jul 13 23:45:51 2023 +0200 tdf#142808: use SvxLRSpaceItem::GetTextLeft instead of GetLeft Because we need the value without the negative (hanging) indent. Change-Id: I65f779476be5e8a57b723c289c6c3a9c75875bb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154398 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 2211f09a20e1..ffc34cd5bfb5 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -2152,7 +2152,7 @@ void SvxRuler::ApplyTabs() = lAppNullOffset + (bRTL ? GetRightFrameMargin() : GetLeftFrameMargin()); if (mxRulerImpl->bIsTabsRelativeToIndent && mxParaItem) { -nTmpLeftIndentLogic += bRTL ? mxParaItem->GetRight() : mxParaItem->GetLeft(); +nTmpLeftIndentLogic += bRTL ? mxParaItem->GetRight() : mxParaItem->GetTextLeft(); } aTabStop.GetTabPos() = mxRulerImpl->lMaxRightLogic - lLogicNullOffset - nTmpLeftIndentLogic;
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/tbcontrl.cxx | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) New commits: commit c2a77967cf16a9465f86b5aed62497141fbef535 Author: Justin Luth AuthorDate: Fri Jul 7 11:34:07 2023 -0400 Commit: Justin Luth CommitDate: Wed Jul 12 21:05:45 2023 +0200 tdf#125504 SvxStyleBox: don't use disposed DispatchProvider .uno:StyleApply in the notebookbar was doing nothing because the view switching from print preview caused the saved XDispatchProvider to become disposed. Thanks to Maxim, my patch is completely re-written. Change-Id: I655c393def75f966a97ac7a04395aee19befd132 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154196 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 0c16e26dbb06..0d862f8964f8 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -142,7 +142,6 @@ class SvxStyleBox_Base { public: SvxStyleBox_Base(std::unique_ptr xWidget, OUString rCommand, SfxStyleFamily eFamily, - const Reference& rDispatchProvider, const Reference& _xFrame, OUString aClearFormatKey, OUString aMoreKey, bool bInSpecialMode, SvxStyleToolBoxControl& rCtrl); @@ -237,7 +236,6 @@ protected: int m_nMaxUserDrawFontWidth; int m_nLastItemWithMenu; boolbRelease; -Reference< XDispatchProvider > m_xDispatchProvider; Reference< XFrame > m_xFrame; OUStringm_aCommand; OUStringaClearFormatKey; @@ -257,7 +255,7 @@ class SvxStyleBox_Impl final : public InterimItemWindow , public SvxStyleBox_Base { public: -SvxStyleBox_Impl(vcl::Window* pParent, const OUString& rCommand, SfxStyleFamily eFamily, const Reference< XDispatchProvider >& rDispatchProvider, +SvxStyleBox_Impl(vcl::Window* pParent, const OUString& rCommand, SfxStyleFamily eFamily, const Reference< XFrame >& _xFrame,const OUString& rClearFormatKey, const OUString& rMoreKey, bool bInSpecialMode, SvxStyleToolBoxControl& rCtrl); virtual ~SvxStyleBox_Impl() override @@ -864,7 +862,6 @@ class SfxStyleControllerItem_Impl : public SfxStatusListener SvxStyleBox_Base::SvxStyleBox_Base(std::unique_ptr xWidget, OUString aCommand, SfxStyleFamily eFamily, - const Reference< XDispatchProvider >& rDispatchProvider, const Reference< XFrame >& _xFrame, OUString _aClearFormatKey, OUString _aMoreKey, @@ -877,7 +874,6 @@ SvxStyleBox_Base::SvxStyleBox_Base(std::unique_ptr xWidget, , m_nMaxUserDrawFontWidth(0) , m_nLastItemWithMenu(-1) , bRelease( true ) -, m_xDispatchProvider( rDispatchProvider ) , m_xFrame(_xFrame) , m_aCommand(std::move( aCommand )) , aClearFormatKey(std::move( _aClearFormatKey )) @@ -909,14 +905,13 @@ IMPL_LINK(SvxStyleBox_Base, CustomGetSizeHdl, OutputDevice&, rArg, Size) SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent, const OUString& rCommand, SfxStyleFamily eFamily, - const Reference< XDispatchProvider >& rDispatchProvider, const Reference< XFrame >& _xFrame, const OUString& rClearFormatKey, const OUString& rMoreKey, bool bInSpec, SvxStyleToolBoxControl& rCtrl) : InterimItemWindow(pParent, "svx/ui/applystylebox.ui", "ApplyStyleBox") -, SvxStyleBox_Base(m_xBuilder->weld_combo_box("applystyle"), rCommand, eFamily, - rDispatchProvider, _xFrame, rClearFormatKey, rMoreKey, bInSpec, rCtrl) +, SvxStyleBox_Base(m_xBuilder->weld_combo_box("applystyle"), rCommand, eFamily, _xFrame, + rClearFormatKey, rMoreKey, bInSpec, rCtrl) { InitControlBase(m_xWidget.get()); @@ -947,15 +942,14 @@ IMPL_LINK(SvxStyleBox_Base, MenuSelectHdl, const OUString&, rMenuIdent, void) comphelper::makePropertyValue("Family", sal_Int16( eStyleFamily )) }; +const Reference xProvider(m_xFrame, UNO_QUERY); if (rMenuIdent == "update") { -SfxToolBoxControl::Dispatch( m_xDispatchProvider, -".uno:StyleUpdateByExample", aArgs ); +SfxToolBoxControl::Dispatch(xProvider, ".uno:StyleUpdateByExample", aArgs); } else if (rMenuIdent == "edit") {
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/tbcontrl.cxx | 37 + 1 file changed, 13 insertions(+), 24 deletions(-) New commits: commit 24c04a2c13c2bf110c4b600f03236c35a5ddfd14 Author: Justin Luth AuthorDate: Fri Jul 7 12:27:52 2023 -0400 Commit: Justin Luth CommitDate: Wed Jul 12 21:03:46 2023 +0200 tdf#125504 SvxFontNameBox: don't use disposed DispatchProvider .uno:CharFontName in the notebookbar was doing nothing because the view switching from print preview caused the saved XDispatchProvider to become disposed. Thanks to Maxim, my patch is completely re-written. Change-Id: I5ac1aa870de2f4ac922f076a5401f1264d6b085f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154195 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index da8493c75059..0c16e26dbb06 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -340,7 +340,6 @@ protected: vcl::Font aCurFont; sal_uInt16 nFtCount; bool bRelease; -Reference< XDispatchProvider > m_xDispatchProvider; Reference< XFrame >m_xFrame; boolmbCheckingUnknownFont; @@ -351,17 +350,16 @@ protected: voidEndPreview() { Sequence< PropertyValue > aArgs; -SfxToolBoxControl::Dispatch( m_xDispatchProvider, - ".uno:CharEndPreviewFontName", - aArgs ); +const Reference xProvider(m_xFrame, UNO_QUERY); +SfxToolBoxControl::Dispatch(xProvider, ".uno:CharEndPreviewFontName", aArgs); } boolCheckFontIsAvailable(std::u16string_view fontname); voidCheckAndMarkUnknownFont(); public: -SvxFontNameBox_Base(std::unique_ptr xWidget, const Reference& rDispatchProvider, -const Reference& rFrame, SvxFontNameToolBoxControl& rCtrl); +SvxFontNameBox_Base(std::unique_ptr xWidget, const Reference& rFrame, +SvxFontNameToolBoxControl& rCtrl); virtual ~SvxFontNameBox_Base() { m_xListener->dispose(); @@ -423,7 +421,7 @@ private: virtual bool DoKeyInput(const KeyEvent& rKEvt) override; public: -SvxFontNameBox_Impl(vcl::Window* pParent, const Reference& rDispatchProvider, +SvxFontNameBox_Impl(vcl::Window* pParent, const Reference& rFrame, SvxFontNameToolBoxControl& rCtrl); virtual void dispose() override @@ -1717,7 +1715,6 @@ static bool lcl_GetDocFontList(const FontList** ppFontList, SvxFontNameBox_Base* } SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr xWidget, - const Reference& rDispatchProvider, const Reference& rFrame, SvxFontNameToolBoxControl& rCtrl) : m_xListener(new comphelper::ConfigurationListener("/org.openoffice.Office.Common/Font/View")) @@ -1728,7 +1725,6 @@ SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr xWidget , pFontList(nullptr) , nFtCount(0) , bRelease(true) -, m_xDispatchProvider(rDispatchProvider) , m_xFrame(rFrame) , mbCheckingUnknownFont(false) { @@ -1744,10 +1740,10 @@ SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr xWidget m_xWidget->set_entry_width_chars(COMBO_WIDTH_IN_CHARS + 5); } -SvxFontNameBox_Impl::SvxFontNameBox_Impl(vcl::Window* pParent, const Reference& rDispatchProvider, - const Reference& rFrame, SvxFontNameToolBoxControl& rCtrl) +SvxFontNameBox_Impl::SvxFontNameBox_Impl(vcl::Window* pParent, const Reference& rFrame, + SvxFontNameToolBoxControl& rCtrl) : InterimItemWindow(pParent, "svx/ui/fontnamebox.ui", "FontNameBox") -, SvxFontNameBox_Base(m_xBuilder->weld_combo_box("fontnamecombobox"), rDispatchProvider, rFrame, rCtrl) +, SvxFontNameBox_Base(m_xBuilder->weld_combo_box("fontnamecombobox"), rFrame, rCtrl) { set_id("fontnamecombobox"); SetOptimalSize(); @@ -1969,6 +1965,7 @@ void SvxFontNameBox_Base::Select(bool bNonTravelSelect) pArgs[0].Value = a; } +const Reference xProvider(m_xFrame, UNO_QUERY); if (bNonTravelSelect) { CheckAndMarkUnknownFont(); @@ -1980,9 +1977,7 @@ void SvxFontNameBox_Base::Select(bool bNonTravelSelect) if (pFontItem) { pArgs[0].Name = "CharFontName"; -SfxToolBoxControl::Dispatch( m_xDispatchProvider, - ".uno:CharFontName", - aArgs ); +SfxToolBoxControl::Dispatch(xProvider, ".uno:CharFontName", aArgs); } } else @@ -1990,9 +1985,7 @@ void SvxF
[Libreoffice-commits] core.git: svx/source
svx/source/inc/StylesPreviewToolBoxControl.hxx |2 - svx/source/inc/StylesPreviewWindow.hxx | 15 ++-- svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx |7 - svx/source/tbxctrls/StylesPreviewWindow.cxx | 24 +--- 4 files changed, 25 insertions(+), 23 deletions(-) New commits: commit 42ee261d01983c94d8be60fccae37ae5af53bf5e Author: Justin Luth AuthorDate: Thu Jul 6 16:29:02 2023 -0400 Commit: Justin Luth CommitDate: Wed Jul 12 02:21:48 2023 +0200 tdf#125504 StylesPreviewWindow: don't use disposed DispatchProvider .uno:StylesPreview in the notebookbar was doing nothing because the view switching from print preview caused the saved XDispatchProvider to become disposed. Thanks to Maxim, my patch is completely re-written. I think I have implemented the method he has suggested. Change-Id: Iae01116c742bc27ed2c14d983e7347d39c9acaf6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154148 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Maxim Monastirsky diff --git a/svx/source/inc/StylesPreviewToolBoxControl.hxx b/svx/source/inc/StylesPreviewToolBoxControl.hxx index d8d12a0f20a8..f1f943dfffbe 100644 --- a/svx/source/inc/StylesPreviewToolBoxControl.hxx +++ b/svx/source/inc/StylesPreviewToolBoxControl.hxx @@ -32,8 +32,6 @@ class StylesPreviewToolBoxControl final VclPtr m_xVclBox; std::unique_ptr m_xWeldBox; -css::uno::Reference m_xDispatchProvider; - std::vector> m_aDefaultStyles; public: diff --git a/svx/source/inc/StylesPreviewWindow.hxx b/svx/source/inc/StylesPreviewWindow.hxx index 1e9b01a6df1b..76b385c084d2 100644 --- a/svx/source/inc/StylesPreviewWindow.hxx +++ b/svx/source/inc/StylesPreviewWindow.hxx @@ -23,6 +23,7 @@ #include #include #include +#include #include class StylesPreviewWindow_Base; @@ -95,7 +96,7 @@ class StylesPreviewWindow_Base protected: static constexpr unsigned STYLES_COUNT = 6; -css::uno::Reference m_xDispatchProvider; +css::uno::Reference m_xFrame; std::unique_ptr m_xStylesView; @@ -115,9 +116,9 @@ protected: DECL_LINK(DoJsonProperty, const weld::json_prop_query&, bool); public: -StylesPreviewWindow_Base( -weld::Builder& xBuilder, std::vector>&& aDefaultStyles, -const css::uno::Reference& xDispatchProvider); +StylesPreviewWindow_Base(weld::Builder& xBuilder, + std::vector>&& aDefaultStyles, + const css::uno::Reference& xFrame); ~StylesPreviewWindow_Base(); void Select(const OUString& rStyleName); @@ -134,9 +135,9 @@ private: class StylesPreviewWindow_Impl final : public InterimItemWindow, public StylesPreviewWindow_Base { public: -StylesPreviewWindow_Impl( -vcl::Window* pParent, std::vector>&& aDefaultStyles, -const css::uno::Reference& xDispatchProvider); +StylesPreviewWindow_Impl(vcl::Window* pParent, + std::vector>&& aDefaultStyles, + const css::uno::Reference& xFrame); ~StylesPreviewWindow_Impl(); void dispose(); diff --git a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx index 64e6ed7822fe..d26063d5447e 100644 --- a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx +++ b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx @@ -35,12 +35,7 @@ StylesPreviewToolBoxControl::initialize(const css::uno::Sequence& svt::ToolboxController::initialize(rArguments); if (m_xFrame.is()) -{ InitializeStyles(m_xFrame->getController()->getModel()); - -m_xDispatchProvider = css::uno::Reference( -m_xFrame->getController(), css::uno::UNO_QUERY); -} } void SAL_CALL StylesPreviewToolBoxControl::dispose() @@ -156,7 +151,7 @@ StylesPreviewToolBoxControl::createItemWindow(const css::uno::Reference::Create( -pParent, std::vector(m_aDefaultStyles), m_xDispatchProvider); +pParent, std::vector(m_aDefaultStyles), m_xFrame); xItemWindow = VCLUnoHelper::GetInterface(m_xVclBox); } } diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx index c5215cba4a6d..27e992c92059 100644 --- a/svx/source/tbxctrls/StylesPreviewWindow.cxx +++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx @@ -208,7 +208,9 @@ bool StylesPreviewWindow_Base::Command(const CommandEvent& rEvent) { css::uno::Sequence aArgs(0); -SfxToolBoxControl::Dispatch(m_xDispatchProvider, +const css::uno::Reference xProvider(m_xFrame, + css::uno::UNO_QUERY); +SfxToolBoxControl::Dispatch(xProvider, rIdent == "update" ? OUString(".uno:StyleUpdateByExample")
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/contact/objectcontactofpageview.cxx | 31 - 1 file changed, 25 insertions(+), 6 deletions(-) New commits: commit 2dde0bf99ed11feb32d361303bb15fbd6d33ec0e Author: Armin Le Grand (allotropia) AuthorDate: Wed Jul 5 16:02:26 2023 +0200 Commit: Armin Le Grand CommitDate: Thu Jul 6 15:21:15 2023 +0200 tdf#122735 get the correct ActiveViewContact In ObjectContactOfPageView::getActiveViewContact() the decision which ViewContact is to be returned depends on if the SdrObjList fetched from the SdrPageView is a SdrObject or a SdrPage. Both are derived from SdrObjList, so to decide that the helpers getSdrObjectFromSdrObjList and getSdrPageFromSdrObjList are used. For SdrObject the 1st will return ptr, 2nd nullptr. For SdrPage the 1st and 2nd will return ptr due to 1st trying to return something useful by getting up the hierarchy and return the SdrPage the SdrObjList/SdrObject is inserted (as the name says). This means that here the test for SdrObject *has* to be used 1st to correctly decide of what nature SdrObjList is. NOTE: Here it would also be possible to use dynamic_cast(s) to the classes to test for, but tooling is virtual/faster. Change-Id: I113afceddd3210aa63960d248f7c7356f82cf413 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154065 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index ce0ca6463370..e07cf01bb86c 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -303,15 +303,34 @@ namespace sdr::contact if(pActiveGroupList) { -if(nullptr != pActiveGroupList->getSdrPageFromSdrObjList()) +// tdf#122735 +// Here it is necessary to check for SdrObject 1st, that may +// return nullptr if it is not a SdrObject/SdrObjGroup. +// Checking for SrPage OTOH will *always* try to return +// something useful due to SdrObjGroup::getSdrPageFromSdrObjList +// using getSdrPageFromSdrObject which will recursively go up the +// hierarchy to get the SdrPage the SdrObject belongs to, so +// this will *not* be nullptr for e.g. a SdrObjGroup if the +// SdrObjGroup is inserted to a SdrPage. +// NOTE: It is also possible to use dynamic_cast +// here, but getSdrObjectFromSdrObjList and +// getSdrPageFromSdrObjListexist to not need to do that +SdrObject* pSdrObject(pActiveGroupList->getSdrObjectFromSdrObjList()); + +if(nullptr != pSdrObject) { -// It's a Page itself -return &(pActiveGroupList->getSdrPageFromSdrObjList()->GetViewContact()); +// It is a group object +return &(pSdrObject->GetViewContact()); } -else if(pActiveGroupList->getSdrObjectFromSdrObjList()) +else { -// Group object -return &(pActiveGroupList->getSdrObjectFromSdrObjList()->GetViewContact()); +SdrPage* pSdrPage(pActiveGroupList->getSdrPageFromSdrObjList()); + +if(nullptr != pSdrPage) +{ +// It's a Page itself +return &(pSdrPage->GetViewContact()); +} } } else if(GetSdrPage())
[Libreoffice-commits] core.git: svx/source svx/uiconfig sw/uiconfig
svx/source/sidebar/text/TextPropertyPanel.cxx |8 -- svx/source/sidebar/text/TextPropertyPanel.hxx |2 - svx/uiconfig/ui/sidebartextpanel.ui | 32 +++--- sw/uiconfig/sglobal/toolbar/textstylebar.xml |2 - sw/uiconfig/swriter/toolbar/textstylebar.xml |2 - sw/uiconfig/swriter/ui/notebookbar_groups.ui |2 - 6 files changed, 8 insertions(+), 40 deletions(-) New commits: commit c0f1f67bfd2853554b58127e91443526c44163d7 Author: Maxim Monastirsky AuthorDate: Wed Jul 5 01:28:05 2023 +0300 Commit: Maxim Monastirsky CommitDate: Wed Jul 5 08:14:20 2023 +0200 Swap .uno:FontColor for .uno:Color Following tdf#105293, which left some UI elements unchanged. This also simplifies the sidebar, as .uno:Color is universal while .uno:FontColor works only with Writer text. It also benefits tdf#154270, as using the same command in the toolbar and the sidebar will keep their color in sync. Change-Id: Ia6e1ffef4012b6f8db4c9079d0b0c99a59887670 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154012 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx index d5bfc2a480df..5b4e907cd86b 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.cxx +++ b/svx/source/sidebar/text/TextPropertyPanel.cxx @@ -49,9 +49,7 @@ TextPropertyPanel::TextPropertyPanel(weld::Widget* pParent, const css::uno::Refe , mxFontEffectsDispatch(new ToolbarUnoDispatcher(*mxFontEffects, *m_xBuilder, rxFrame)) , mxFontAdjust(m_xBuilder->weld_toolbar("fontadjust")) , mxFontAdjustDispatch(new ToolbarUnoDispatcher(*mxFontAdjust, *m_xBuilder, rxFrame)) -, mxToolBoxFontColorSw(m_xBuilder->weld_toolbar("colorbar_writer")) -, mxToolBoxFontColorSwDispatch(new ToolbarUnoDispatcher(*mxToolBoxFontColorSw, *m_xBuilder, rxFrame)) -, mxToolBoxFontColor(m_xBuilder->weld_toolbar("colorbar_others")) +, mxToolBoxFontColor(m_xBuilder->weld_toolbar("colorbar")) , mxToolBoxFontColorDispatch(new ToolbarUnoDispatcher(*mxToolBoxFontColor, *m_xBuilder, rxFrame)) , mxToolBoxBackgroundColor(m_xBuilder->weld_toolbar("colorbar_background")) , mxToolBoxBackgroundColorDispatch(new ToolbarUnoDispatcher(*mxToolBoxBackgroundColor, *m_xBuilder, rxFrame)) @@ -78,7 +76,6 @@ TextPropertyPanel::~TextPropertyPanel() mxDefaultBarDispatch.reset(); mxPositionBarDispatch.reset(); mxSpacingBarDispatch.reset(); -mxToolBoxFontColorSwDispatch.reset(); mxToolBoxFontColorDispatch.reset(); mxToolBoxBackgroundColorDispatch.reset(); mxFontAdjustDispatch.reset(); @@ -90,7 +87,6 @@ TextPropertyPanel::~TextPropertyPanel() mxDefaultBar.reset(); mxPositionBar.reset(); mxSpacingBar.reset(); -mxToolBoxFontColorSw.reset(); mxToolBoxFontColor.reset(); mxToolBoxBackgroundColor.reset(); mxFontAdjust.reset(); @@ -143,8 +139,6 @@ void TextPropertyPanel::HandleContextChange ( break; } -mxToolBoxFontColor->set_visible(!bWriterText); -mxToolBoxFontColorSw->set_visible(bWriterText); mxToolBoxBackgroundColor->set_visible(bWriterText || bDrawText); mxResetBar->set_visible(bWriterText || bCalcText); mxDefaultBar->set_visible(bDrawText); diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx index 3ad44bde78ac..c383ef1bd891 100644 --- a/svx/source/sidebar/text/TextPropertyPanel.hxx +++ b/svx/source/sidebar/text/TextPropertyPanel.hxx @@ -53,8 +53,6 @@ private: std::unique_ptr mxFontEffectsDispatch; std::unique_ptr mxFontAdjust; std::unique_ptr mxFontAdjustDispatch; -std::unique_ptr mxToolBoxFontColorSw; -std::unique_ptr mxToolBoxFontColorSwDispatch; std::unique_ptr mxToolBoxFontColor; std::unique_ptr mxToolBoxFontColorDispatch; std::unique_ptr mxToolBoxBackgroundColor; diff --git a/svx/uiconfig/ui/sidebartextpanel.ui b/svx/uiconfig/ui/sidebartextpanel.ui index 732c3ee421ed..97a92d97a0f5 100644 --- a/svx/uiconfig/ui/sidebartextpanel.ui +++ b/svx/uiconfig/ui/sidebartextpanel.ui @@ -161,31 +161,7 @@ False 6 - -True -True -icons -False -2 - - -True -True - - -False -False - - - - -False -True -0 - - - - + True True icons @@ -205,7 +181,7 @@ False True -1 +0
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/PaletteManager.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7fede2c47f8a24b80700fe3b82f71a0f60bffd3d Author: Regina Henschel AuthorDate: Sun Jul 2 18:14:54 2023 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Jul 4 11:15:13 2023 +0200 tdf#153487 First color item needs mnId = 1 The SvxColorValueSet for the other color palettes is build so that the first item gets value 1 in its mnId component. But for the new theme color palette it was 0. That results in the error, that the first color (top-left in the dialog) could not be selected. An Id of value 0 is handled as 'fail' in various places. Thus use starting mnId = 1 for theme color palette too. Change-Id: Ic0b63fee641d4424cabaf25a7f803acd734cbfa3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153860 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 607bd60df921..9fcefd34d1c8 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -207,7 +207,7 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet &rColorSet) auto pColorSet = pObjectShell->GetThemeColors(); mnColorCount = 12; rColorSet.Clear(); -sal_uInt16 nItemId = 0; +sal_uInt16 nItemId = 1; if (!pColorSet) return;
[Libreoffice-commits] core.git: svx/source
svx/source/xoutdev/xattr.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 99c0922f9b16e0f2a015db41f1acbeece3cc5e69 Author: Andrea Gelmini AuthorDate: Sun Jul 2 00:43:41 2023 +0200 Commit: Julien Nabet CommitDate: Sun Jul 2 09:52:14 2023 +0200 Fix typo Change-Id: I0fd7f5aaa51e58ec88daad30f003bf5c853385b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153853 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index c7299b6d1b92..1550b8ac02a1 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2530,7 +2530,7 @@ bool XFillFloatTransparenceItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMem || MID_GRADIENT_ENDINTENSITY == nMemberId || MID_GRADIENT_STEPCOUNT == nMemberId) { -// tdf#155913 handle attributes not suppoted by transparency gradient as error +// tdf#155913 handle attributes not supported by transparency gradient as error return false; } @@ -2551,7 +2551,7 @@ bool XFillFloatTransparenceItem::PutValue( const css::uno::Any& rVal, sal_uInt8 || MID_GRADIENT_ENDINTENSITY == nMemberId || MID_GRADIENT_STEPCOUNT == nMemberId) { -// tdf#155913 handle attributes not suppoted by transparency gradient as error +// tdf#155913 handle attributes not supported by transparency gradient as error return false; }
[Libreoffice-commits] core.git: svx/source
svx/source/table/tablecontroller.cxx | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) New commits: commit c7d202a61f9ce81b76b29e61252c23aa66daff07 Author: Caolán McNamara AuthorDate: Sat Jul 1 20:28:54 2023 +0100 Commit: Caolán McNamara CommitDate: Sat Jul 1 22:59:05 2023 +0200 cid#1532376 Big parameter passed by value Change-Id: I6e0717ce5b035c1a4f4ec3abbd23ae60c98c8181 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153851 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index a5469e949ba5..af11e5c875f7 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -935,14 +935,13 @@ void SvxTableController::onFormatTable(const SfxRequest& rReq) SfxItemSet aNewAttr(rModel.GetItemPool()); // merge drawing layer text distance items into SvxBoxItem used by the dialog -SvxBoxItem aBoxItem(TextDistancesToSvxBoxItem(aNewAttr)); - -SvxBoxInfoItem aBoxInfoItem( aNewAttr.Get( SDRATTR_TABLE_BORDER_INNER ) ); +auto xBoxItem(std::make_shared(TextDistancesToSvxBoxItem(aNewAttr))); +auto xBoxInfoItem(std::make_shared(aNewAttr.Get(SDRATTR_TABLE_BORDER_INNER))); MergeAttrFromSelectedCells(aNewAttr, false); -FillCommonBorderAttrFromSelectedCells( aBoxItem, aBoxInfoItem ); -aNewAttr.Put( aBoxItem ); -aNewAttr.Put( aBoxInfoItem ); +FillCommonBorderAttrFromSelectedCells(*xBoxItem, *xBoxInfoItem); +aNewAttr.Put(*xBoxItem); +aNewAttr.Put(*xBoxInfoItem); // Fill in shadow properties. const SfxItemSet& rTableItemSet = rTableObj.GetMergedItemSet(); @@ -963,7 +962,7 @@ void SvxTableController::onFormatTable(const SfxRequest& rReq) rModel, false) ); // Even Cancel Button is returning positive(101) value, -xDlg->StartExecuteAsync([xDlg, this, aBoxItem, aBoxInfoItem](int nResult){ +xDlg->StartExecuteAsync([xDlg, this, xBoxItem, xBoxInfoItem](int nResult){ if (nResult == RET_OK) { SfxItemSet aNewSet(*(xDlg->GetOutputItemSet())); @@ -975,14 +974,14 @@ void SvxTableController::onFormatTable(const SfxRequest& rReq) //unchanged state back to their input properties if (aNewSet.GetItemState(SDRATTR_TABLE_BORDER, false) != SfxItemState::SET) { -aNewSet.Put(aBoxItem); +aNewSet.Put(*xBoxItem); } if (aNewSet.GetItemState(SDRATTR_TABLE_BORDER_INNER, false) != SfxItemState::SET) { -aNewSet.Put(aBoxInfoItem); +aNewSet.Put(*xBoxInfoItem); } -SvxBoxItemToTextDistances(aBoxItem, aNewSet); +SvxBoxItemToTextDistances(*xBoxItem, aNewSet); if (checkTableObject() && mxTable.is()) {
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/primitive2d/sdrattributecreator.cxx | 11 --- svx/source/xoutdev/xattr.cxx | 17 + 2 files changed, 21 insertions(+), 7 deletions(-) New commits: commit 59abf300e342556ad9cdcd5fd57b9d887776c441 Author: Armin Le Grand (allotropia) AuthorDate: Fri Jun 30 11:07:07 2023 +0200 Commit: Armin Le Grand CommitDate: Fri Jun 30 17:47:06 2023 +0200 MCGR: tdf#155913 Non-supported attributes for TransparenceGradient In ODF spec there is no - MID_GRADIENT_STARTINTENSITY - MID_GRADIENT_ENDINTENSITY - MID_GRADIENT_STEPCOUNT so these should not be used in the core data, too. The last one leads to this error. I experimentally added to hanle these 'harder' in the UNO API implementation, too, to reflect that these are not supported and produce UNO API access errors. This is not urgently necessary, but let's see if that triggers problems. That these attributes were initially supported is due to the Item hosting those values for transparency gradient is directly derived from gradient and the implementations usually use the fallback to call the parent implementation(s). Change-Id: I982c4047d82bfe306dbcef9d1b64b8d212bf8d59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153799 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index aad8ba4576e4..2b9f9b767763 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -619,6 +619,8 @@ namespace drawinglayer::primitive2d if (rGradient.GetStartIntens() != 100 || rGradient.GetEndIntens() != 100) { +// tdf#155913 Start/EndIntens is not used for transparency gradient, +// so might even get asserted (?) // this may also be set for transparence, so need to take care of it aColorStops.blendToIntensity( rGradient.GetStartIntens() * 0.01, @@ -626,19 +628,14 @@ namespace drawinglayer::primitive2d basegfx::BColor()); // COL_BLACK } +// tdf#155913 GradientStepCount is not used for transparency gradient return attribute::FillGradientAttribute( rGradient.GetGradientStyle(), static_cast(rGradient.GetBorder()) * 0.01, static_cast(rGradient.GetXOffset()) * 0.01, static_cast(rGradient.GetYOffset()) * 0.01, toRadians(rGradient.GetAngle()), -aColorStops, -// oops - the gradientStepCount was missing here. If we want to use -// a combination of gradient & transparencyGradient to represent -// imported gradients of formats which do originally support transparency -// in gradients, then the gradient has to be exactly defined the same, -// including the (evtl. used) gradientStepCount -rSet.Get(XATTR_GRADIENTSTEPCOUNT).GetValue()); +aColorStops); } } diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 3cb12c467b74..c7299b6d1b92 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2526,11 +2526,20 @@ XFillFloatTransparenceItem* XFillFloatTransparenceItem::Clone( SfxItemPool* /*pP bool XFillFloatTransparenceItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const { +if (MID_GRADIENT_STARTINTENSITY == nMemberId +|| MID_GRADIENT_ENDINTENSITY == nMemberId +|| MID_GRADIENT_STEPCOUNT == nMemberId) +{ +// tdf#155913 handle attributes not suppoted by transparency gradient as error +return false; +} + if (!IsEnabled() && nMemberId == MID_NAME) { // make sure that we return empty string in case of query for // "FillTransparenceGradientName" if the item is disabled rVal <<= OUString(); +return true; } return XFillGradientItem::QueryValue( rVal, nMemberId ); @@ -2538,6 +2547,14 @@ bool XFillFloatTransparenceItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMem bool XFillFloatTransparenceItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) { +if (MID_GRADIENT_STARTINTENSITY == nMemberId +|| MID_GRADIENT_ENDINTENSITY == nMemberId +|| MID_GRADIENT_STEPCOUNT == nMemberId) +{ +// tdf#155913 handle attributes not suppoted by transparency gradient as error +return false; +} + return XFillGradientItem::PutValue( rVal, nMemberId );
[Libreoffice-commits] core.git: svx/source
svx/source/accessibility/AccessibleShape.cxx | 4 +- svx/source/accessibility/GraphCtlAccessibleContext.cxx | 2 - svx/source/fmcomp/fmgridif.cxx | 10 +++ svx/source/form/fmdmod.cxx | 2 - svx/source/form/formcontroller.cxx | 2 - svx/source/svdraw/svdmodel.cxx | 2 - svx/source/svdraw/svdpage.cxx | 4 -- svx/source/table/accessiblecell.cxx| 2 - svx/source/table/cell.cxx | 10 +++ svx/source/table/propertyset.cxx | 2 - svx/source/table/tablecolumn.cxx | 4 +- svx/source/table/tabledesign.cxx | 8 ++--- svx/source/table/tablemodel.cxx| 2 - svx/source/table/tablerow.cxx | 4 +- svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx | 2 - svx/source/unodraw/SvxXTextColumns.cxx | 8 ++--- svx/source/unodraw/UnoNamespaceMap.cxx | 2 - svx/source/unodraw/unomod.cxx | 10 ++- svx/source/unodraw/unopool.cxx | 4 +- svx/source/unodraw/unoshap2.cxx| 2 - svx/source/unodraw/unoshap4.cxx| 8 ++--- svx/source/unodraw/unoshape.cxx| 14 +- svx/source/unodraw/unoshcol.cxx| 2 - svx/source/xml/xmleohlp.cxx| 2 - 24 files changed, 54 insertions(+), 58 deletions(-) New commits: commit 7881ae1ee91b5739f8d6b8adfac04bc432717a9a Author: Mike Kaganski AuthorDate: Sun Apr 23 20:15:04 2023 +0300 Commit: Mike Kaganski CommitDate: Thu Jun 29 22:43:57 2023 +0200 Use getXWeak in svx Change-Id: I7e5c029a79b8437ae5f803df5ad20217c240d1d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150874 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index e3116a9762b7..ba8b7fd7f6f8 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -345,7 +345,7 @@ uno::Reference SAL_CALL else throw lang::IndexOutOfBoundsException ( "shape has no child with index " + OUString::number(nIndex), -static_cast(this)); +getXWeak()); return xChild; } @@ -534,7 +534,7 @@ awt::Rectangle SAL_CALL AccessibleShape::getBounds() if (maShapeTreeInfo.GetViewForwarder() == nullptr) throw uno::RuntimeException ( "AccessibleShape has no valid view forwarder", -static_cast(this)); +getXWeak()); ::Size aPixelSize = maShapeTreeInfo.GetViewForwarder()->LogicToPixel ( ::Size (aBoundingBox.Width, aBoundingBox.Height)); ::Point aPixelPosition = maShapeTreeInfo.GetViewForwarder()->LogicToPixel ( diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx index 989d5b4650cd..c30756804b49 100644 --- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx +++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx @@ -302,7 +302,7 @@ void SvxGraphCtrlAccessibleContext::CommitChange ( const uno::Any& rOldValue) { AccessibleEventObject aEvent ( -static_cast(this), +getXWeak(), nEventId, rNewValue, rOldValue, -1); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 5fe9c608bbbd..d7fe7c9c23dd 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -391,7 +391,7 @@ void SAL_CALL FmXGridControl::dispose() SolarMutexGuard aGuard; EventObject aEvt; -aEvt.Source = static_cast< ::cppu::OWeakObject* >(this); +aEvt.Source = getXWeak(); m_aModifyListeners.disposeAndClear(aEvt); m_aUpdateListeners.disposeAndClear(aEvt); m_aContainerListeners.disposeAndClear(aEvt); @@ -1022,7 +1022,7 @@ void FmXGridPeer::selectionChanged() { std::unique_lock g(m_aMutex); EventObject aSource; -aSource.Source = static_cast< ::cppu::OWeakObject* >(this); +aSource.Source = getXWeak(); m_aSelectionListeners.notifyEach( g, &XSelectionChangeListener::select
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdotextdecomposition.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 2ef138de767c312188d41a7f206234eafac3108b Author: Khaled Hosny AuthorDate: Mon Jun 26 11:18:58 2023 +0300 Commit: خالد حسني CommitDate: Mon Jun 26 11:34:04 2023 +0200 tdf#156050: Fix how misspelling line is calculated for RTL text Partially revert: commit 74b6c5ea3c333de7c5e7ef8636732edadd9083f2 Author: Khaled Hosny Date: Thu Jun 8 16:41:18 2023 +0300 tdf#151968: Fix vertical position of RTL spelling wavy line Instead of changing how fStart and fEnd are calculated, calculate them like before then swap them. This seems to be more reliable, and matches what we do in Writer. Change-Id: Ia15408881666a86151a12fcf016cc81c1568f7e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153572 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 726ee850eb8b..5d7c51208154 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -427,12 +427,14 @@ namespace // full portion width const double fTextWidth(aDXArray[aDXArray.size() - 1]); +fStart = fTextWidth - fStart; +fEnd = fTextWidth - fEnd; + // tdf#151968 // if start < end, OutputDevice::DrawWaveLine() will // think it is a rotated line, so we swap fStart and // fEnd to avoid this. -fStart = fTextWidth - fEnd; -fEnd = fTextWidth - fStart; +std::swap(fStart, fEnd); } // need to take FontScaling out of values; it's already part of
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/area/AreaPropertyPanelBase.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 4acf48b99804be712d2bd6e3e73c1f030ec637d5 Author: Caolán McNamara AuthorDate: Sun Jun 25 14:25:07 2023 +0100 Commit: Caolán McNamara CommitDate: Sun Jun 25 17:40:46 2023 +0200 cid#1532451 silence Iterator container mismatch Change-Id: I8560f3e5c7820fef8e27433321c97fc3a0b29746 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153552 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx index 582d4536d981..3659110f16db 100644 --- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx +++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx @@ -519,8 +519,7 @@ void AreaPropertyPanelBase::FillStyleChanged(bool bUpdateModel) // MCGR: preserve ColorStops if given // tdf#155901 We need offset of first and last stop, so include them. if (aGradient.GetColorStops().size() >= 2) -maColorStops = basegfx::BColorStops(aGradient.GetColorStops().begin(), - aGradient.GetColorStops().end()); +maColorStops = aGradient.GetColorStops(); else maColorStops.clear();
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/PaletteManager.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit bbf6fa94a92abc1085addaba20519ee0166bae5e Author: Tomaž Vajngerl AuthorDate: Fri Jun 23 00:01:19 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Fri Jun 23 03:53:23 2023 +0200 fix crash in PaletteManager triggered by the color picker The code expects the SfxObjectShell::GetThemeColors() always returns a current set of theme colors, but then for some modules we return nullptr. Change-Id: I4096b75942d818965cedf43f35444faeb870cb74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153424 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 141938d145d7..7735e09d44e8 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -209,6 +209,9 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet &rColorSet) rColorSet.Clear(); sal_uInt16 nItemId = 0; +if (!pColorSet) +return; + svx::ThemeColorPaletteManager aThemeColorManager(pColorSet); moThemePaletteCollection = aThemeColorManager.generate();
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/framelinkarray.cxx | 151 ++- 1 file changed, 113 insertions(+), 38 deletions(-) New commits: commit e27d4cc31e04be4c47b5085dfa2363ee45457e8a Author: Noel Grandin AuthorDate: Mon Jun 19 12:23:55 2023 +0200 Commit: Noel Grandin CommitDate: Mon Jun 19 18:26:03 2023 +0200 tdf#150534 reduce the memory consumption of cells when calculating borders - if there are a lot hidden columns, we end up allocating a lot of cells. Since most of the cells have the same settings, use a SfxItemPool to consolidate them. Change-Id: If2dd77b3eabc5d37eb8804953f8c89ffa04f2400 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153258 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index 918aa76dc7ae..5ad6c03c770d 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,7 @@ namespace svx::frame { namespace { -class Cell +class Cell final : public SfxPoolItem { private: Style maLeft; @@ -69,7 +70,11 @@ public: boolmbOverlapY; public: -explicitCell(); +explicit Cell(); +explicit Cell(const Cell&) = default; + +virtual bool operator==( const SfxPoolItem& ) const override; +virtual Cell* Clone( SfxItemPool *pPool = nullptr ) const override; void SetStyleLeft(const Style& rStyle) { maLeft = rStyle; } void SetStyleRight(const Style& rStyle) { maRight = rStyle; } @@ -98,7 +103,7 @@ public: } -typedef std::vector< Cell > CellVec; +typedef std::vector< const Cell* > CellVec; basegfx::B2DHomMatrix Cell::HelperCreateB2DHomMatrixFromB2DRange( const basegfx::B2DRange& rRange ) const @@ -197,6 +202,7 @@ basegfx::B2DHomMatrix Cell::CreateCoordinateSystemMergedCell( } Cell::Cell() : +SfxPoolItem(10), mnAddLeft( 0 ), mnAddRight( 0 ), mnAddTop( 0 ), @@ -209,6 +215,32 @@ Cell::Cell() : { } +Cell* Cell::Clone(SfxItemPool* /*pPool*/) const +{ +return new Cell(*this); +} + +bool Cell::operator==(const SfxPoolItem& rItem) const +{ +if (!SfxPoolItem::operator==(rItem)) +return false; +const Cell& rOther = static_cast(rItem); +return maLeft == rOther.maLeft +&& maRight == rOther.maRight +&& maTop == rOther.maTop +&& maBottom == rOther.maBottom +&& maTLBR == rOther.maTLBR +&& maBLTR == rOther.maBLTR +&& mnAddLeft == rOther.mnAddLeft +&& mnAddRight == rOther.mnAddRight +&& mnAddTop == rOther.mnAddTop +&& mnAddBottom == rOther.mnAddBottom +&& meRotMode == rOther.meRotMode +&& mbMergeOrig == rOther.mbMergeOrig +&& mbOverlapX == rOther.mbOverlapX +&& mbOverlapY == rOther.mbOverlapY; +} + void Cell::MirrorSelfX() { std::swap( maLeft, maRight ); @@ -230,19 +262,23 @@ static void lclRecalcCoordVec( std::vector& rCoords, const std::vecto } } -static void lclSetMergedRange( CellVec& rCells, sal_Int32 nWidth, sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow ) +static void lclSetMergedRange( SfxItemPool& rPool, CellVec& rCells, sal_Int32 nWidth, sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow ) { for( sal_Int32 nCol = nFirstCol; nCol <= nLastCol; ++nCol ) { for( sal_Int32 nRow = nFirstRow; nRow <= nLastRow; ++nRow ) { -Cell& rCell = rCells[ nRow * nWidth + nCol ]; -rCell.mbMergeOrig = false; -rCell.mbOverlapX = nCol > nFirstCol; -rCell.mbOverlapY = nRow > nFirstRow; +const Cell* pCell = rCells[ nRow * nWidth + nCol ]; +Cell aTempCell(*pCell); +aTempCell.mbMergeOrig = false; +aTempCell.mbOverlapX = nCol > nFirstCol; +aTempCell.mbOverlapY = nRow > nFirstRow; +rCells[ nRow * nWidth + nCol ] = &rPool.Put(aTempCell); } } -rCells[ nFirstRow * nWidth + nFirstCol ].mbMergeOrig = true; +Cell aTempCell(*rCells[ nFirstRow * nWidth + nFirstCol ]); +aTempCell.mbMergeOrig = false; +rCells[ nFirstRow * nWidth + nFirstCol ] = &rPool.Put(aTempCell); } @@ -251,6 +287,9 @@ const Cell OBJ_CELL_NONE; struct ArrayImpl { +// used to reduce the memory consumption of cells +rtl::Reference mxPool; +const Cell* mpDefaultCell; CellVec maCells; std::vector maWidths; std::vector maHeights; @@ -274,7 +313,7 @@ struct ArrayImpl { return nRow * mnWidth + nCol; } const Cell& GetCell( sal_Int32 nCol, sal_Int32 nRow ) const; -Cell& GetCellAcc( sal_Int32 nCol, sal_Int32 nRow ); +voidPutCell( sal_Int32 nCol
[Libreoffice-commits] core.git: svx/source sw/source
svx/source/svdraw/svdotextdecomposition.cxx |8 ++-- sw/source/core/txtnode/fntcache.cxx | 10 ++ 2 files changed, 16 insertions(+), 2 deletions(-) New commits: commit 74b6c5ea3c333de7c5e7ef8636732edadd9083f2 Author: Khaled Hosny AuthorDate: Thu Jun 8 16:41:18 2023 +0300 Commit: خالد حسني CommitDate: Sat Jun 10 19:05:13 2023 +0200 tdf#151968: Fix vertical position of RTL spelling wavy line Second try. This time making sure start > end even for RTL text. This also now works for horizontal, vertical and rotated Arabic text, in Writer and Edit Engine. Change-Id: I6fe1e9dbb9c071287054200a58d4ee073311 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152743 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 138b709e9769..726ee850eb8b 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -427,8 +427,12 @@ namespace // full portion width const double fTextWidth(aDXArray[aDXArray.size() - 1]); -fStart = fTextWidth - fStart; -fEnd = fTextWidth - fEnd; +// tdf#151968 +// if start < end, OutputDevice::DrawWaveLine() will +// think it is a rotated line, so we swap fStart and +// fEnd to avoid this. +fStart = fTextWidth - fEnd; +fEnd = fTextWidth - fStart; } // need to take FontScaling out of values; it's already part of diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index e125906767f6..bc5dd603a433 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -241,10 +241,20 @@ static void lcl_calcLinePos( const CalcLinePosData &rData, break; } +// tdf#151968 +// if start < end, OutputDevice::DrawWaveLine() will think it is a rotated +// line, so we swap nStart and nEnd to avoid this. +if ( rData.bBidiPor ) +std::swap(rStart, rEnd); + if ( rData.bSwitchL2R ) { rData.rInf.GetFrame()->SwitchLTRtoRTL( rStart ); rData.rInf.GetFrame()->SwitchLTRtoRTL( rEnd ); + +// tdf#151968 +// We need to do this here as well for LTR text in a RTL paragraph. +std::swap(rStart, rEnd); } if ( rData.bSwitchH2V )
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/StylesPreviewWindow.cxx | 41 1 file changed, 36 insertions(+), 5 deletions(-) New commits: commit aae8841e2057d522b3cae7b5792ae75cc8d6b5b4 Author: Caolán McNamara AuthorDate: Wed Jun 7 20:43:12 2023 +0100 Commit: Caolán McNamara CommitDate: Fri Jun 9 17:52:23 2023 +0200 Related: cool#6511 hold json preview cache longer due to oddities related to tdf155720 the notebookbar the cache is hooked to can be torn down and replaced if the 1st session is interacted with while multiple other users join. So count goes to 0 just at the wrong time to trigger throwing away the cache and forcing regeneration. An Idle doesn't suffice here. https: //github.com/CollaboraOnline/online/issues/6511 Change-Id: I148c99115fc497e34bf8920b6f59adc47605b8a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152720 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx index 53a8f14511a9..c5215cba4a6d 100644 --- a/svx/source/tbxctrls/StylesPreviewWindow.cxx +++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx @@ -68,35 +68,66 @@ namespace { class StylePreviewCache { +private: +class JsonStylePreviewCacheClear final : public Timer +{ +public: +JsonStylePreviewCacheClear() +: Timer("Json Style Preview Cache clear callback") +{ +// a generous 30 secs +SetTimeout(3); +SetStatic(); +} +virtual void Invoke() override { StylePreviewCache::gJsonStylePreviewCache.clear(); } +}; + static std::map> gStylePreviewCache; static std::map gJsonStylePreviewCache; static int gStylePreviewCacheClients; +static JsonStylePreviewCacheClear gJsonIdleClear; public: static std::map>& Get() { return gStylePreviewCache; } static std::map& GetJson() { return gJsonStylePreviewCache; } -static void ClearCache() +static void ClearCache(bool bHard) { for (auto& aPreview : gStylePreviewCache) aPreview.second.disposeAndClear(); gStylePreviewCache.clear(); -gJsonStylePreviewCache.clear(); +if (bHard) +{ +StylePreviewCache::gJsonStylePreviewCache.clear(); +gJsonIdleClear.Stop(); +} +else +{ +// tdf#155720 don't immediately clear the json representation +gJsonIdleClear.Start(); +} +} + +static void RegisterClient() +{ +if (!gStylePreviewCacheClients) +gJsonIdleClear.Stop(); +gStylePreviewCacheClients++; } -static void RegisterClient() { gStylePreviewCacheClients++; } static void UnregisterClient() { gStylePreviewCacheClients--; if (!gStylePreviewCacheClients) -ClearCache(); +ClearCache(false); } }; std::map> StylePreviewCache::gStylePreviewCache; std::map StylePreviewCache::gJsonStylePreviewCache; int StylePreviewCache::gStylePreviewCacheClients; +StylePreviewCache::JsonStylePreviewCacheClear StylePreviewCache::gJsonIdleClear; } StyleStatusListener::StyleStatusListener( @@ -143,7 +174,7 @@ StylePoolChangeListener::~StylePoolChangeListener() void StylePoolChangeListener::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) { if (rHint.GetId() == SfxHintId::StyleSheetModified) -StylePreviewCache::ClearCache(); +StylePreviewCache::ClearCache(true); m_pPreviewControl->RequestStylesListUpdate(); }
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/langbox.cxx | 44 +- 1 file changed, 35 insertions(+), 9 deletions(-) New commits: commit 9b03f778adfb87a10d781860930ed4d09410af9c Author: Mike Kaganski AuthorDate: Tue Jun 6 14:12:38 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Jun 6 17:52:32 2023 +0200 Language list: sort generic language before country variants In Edit Modules dialog, the language list may include entries added by LanguageTool, and among them are generic language-only entries like "Spanish {es}", stanfing for simple language tags like "es". These languages should go before country variants like "Spanish (Argentina)", but since "{" is sorted after "(", the order is the opposite. This change fixes this. Since other lists do not include generic language-only languages (filtered out by lcl_isPrerequisite and its requireSublang argument), this does not apply to them, but the code will execute nevertheless; hope that this UI-only performance hit will not be noticeable. Change-Id: I97adc1ae8feb4c8a94b567b33363d63d899cabaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152676 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index fae7cf66e8d8..e552f68cc749 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -190,16 +190,42 @@ void SvxLanguageBox::AddLanguages(const std::vector< LanguageType >& rLanguageTy static void SortLanguages(std::vector& rEntries) { -std::sort(rEntries.begin(), rEntries.end(), - [](const weld::ComboBoxEntry e1, const weld::ComboBoxEntry e2) - { - static const auto aSorter = comphelper::string::NaturalStringSorter( - ::comphelper::getProcessComponentContext(), - Application::GetSettings().GetUILanguageTag().getLocale()); - return aSorter.compare(e1.sString, e2.sString) < 0; - }); +auto langLess = [](const weld::ComboBoxEntry& e1, const weld::ComboBoxEntry& e2) +{ +if (e1.sId == e2.sId) +return false; // shortcut +// Make sure that e.g. generic 'Spanish {es}' goes before 'Spanish (Argentina)'. +// We can't depend on MsLangId::getPrimaryLanguage/getSubLanguage, because e.g. +// for generic Bosnian {bs}, the MS-LCID is 0x781A, and getSubLanguage is not 0. +// So we have to do the expensive LanguageTag construction. +LanguageTag lt1(LanguageType(e1.sId.toInt32())), lt2(LanguageType(e2.sId.toInt32())); +if (lt1.getLanguage() == lt2.getLanguage()) +{ +const bool isLangOnly1 = lt1.isIsoLocale() && lt1.getCountry().isEmpty(); +const bool isLangOnly2 = lt2.isIsoLocale() && lt2.getCountry().isEmpty(); + +if (isLangOnly1) +{ +// lt1 is a generic language-only tag +if (!isLangOnly2) +return true; // lt2 is not +} +else if (isLangOnly2) +{ +// lt2 is a generic language-only tag, lt1 is not +return false; +} +} +// Do a normal string comparison for other cases +static const auto aSorter = comphelper::string::NaturalStringSorter( +comphelper::getProcessComponentContext(), +Application::GetSettings().GetUILanguageTag().getLocale()); +return aSorter.compare(e1.sString, e2.sString) < 0; +}; + +std::sort(rEntries.begin(), rEntries.end(), langLess); rEntries.erase(std::unique(rEntries.begin(), rEntries.end(), - [](const weld::ComboBoxEntry e1, const weld::ComboBoxEntry e2) + [](const weld::ComboBoxEntry& e1, const weld::ComboBoxEntry& e2) { return e1.sId == e2.sId; }), rEntries.end()); }
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/langbox.cxx | 102 -- 1 file changed, 49 insertions(+), 53 deletions(-) New commits: commit 4e6c636433f7b1e4e3580fa99cbff2487e53f984 Author: Mike Kaganski AuthorDate: Mon Jun 5 14:15:47 2023 +0300 Commit: Mike Kaganski CommitDate: Mon Jun 5 20:25:38 2023 +0200 Restructure SvxLanguageBox::SetLanguageList for clarity And extract sorting and removing duplicates to a separate function. Change-Id: I57ed8d3960eefb8df8128cdb461a0621ed998bbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152612 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index b489ea58a546..b7623d6f8c0d 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -67,18 +68,16 @@ OUString GetDicInfoStr( std::u16string_view rName, const LanguageType nLang, boo } // misc local helper functions -static std::vector< LanguageType > lcl_LocaleSeqToLangSeq( Sequence< css::lang::Locale > const &rSeq ) +static void appendLocaleSeqToLangs(Sequence const& rSeq, + std::vector& aLangs) { sal_Int32 nCount = rSeq.getLength(); -std::vector< LanguageType > aLangs; -aLangs.reserve(nCount); +aLangs.reserve(aLangs.size() + nCount); std::transform(rSeq.begin(), rSeq.end(), std::back_inserter(aLangs), [](const css::lang::Locale& rLocale) -> LanguageType { return LanguageTag::convertToLanguageType(rLocale); }); - -return aLangs; } static bool lcl_SeqHasLang( const Sequence< sal_Int16 > & rLangSeq, sal_Int16 nLang ) @@ -183,15 +182,28 @@ void SvxLanguageBox::AddLanguages(const std::vector< LanguageType >& rLanguageTy weld::ComboBoxEntry aNewEntry(BuildEntry(nLang)); if (aNewEntry.sString.isEmpty()) continue; -if (std::any_of(rEntries.begin(), rEntries.end(), - [&](const weld::ComboBoxEntry& rEntry){ return rEntry.sId == aNewEntry.sId; })) -continue; rEntries.push_back(aNewEntry); } } } } +static void SortLanguages(std::vector& rEntries) +{ +std::sort(rEntries.begin(), rEntries.end(), + [](const weld::ComboBoxEntry e1, const weld::ComboBoxEntry e2) + { + static const auto aSorter = comphelper::string::NaturalStringSorter( + ::comphelper::getProcessComponentContext(), + Application::GetSettings().GetUILanguageTag().getLocale()); + return aSorter.compare(e1.sString, e2.sString) < 0; + }); +rEntries.erase(std::unique(rEntries.begin(), rEntries.end(), + [](const weld::ComboBoxEntry e1, const weld::ComboBoxEntry e2) + { return e1.sId == e2.sId; }), + rEntries.end()); +} + void SvxLanguageBox::SetLanguageList(SvxLanguageListFlags nLangList, bool bHasLangNone, bool bLangNoneIsLangAll, bool bCheckSpellAvail, bool bDefaultLangExist, LanguageType eDefaultLangType, @@ -201,36 +213,44 @@ void SvxLanguageBox::SetLanguageList(SvxLanguageListFlags nLangList, bool bHasLa m_bLangNoneIsLangAll= bLangNoneIsLangAll; m_bWithCheckmark= bCheckSpellAvail; +m_xControl->freeze(); +comphelper::ScopeGuard aThawGuard([this]() { m_xControl->thaw(); }); +m_xControl->clear(); + if (SvxLanguageListFlags::EMPTY == nLangList) -{ -m_xControl->clear(); return; + +bool bAddSeparator = false; + +if (bHasLangNone) +{ +m_xControl->append(BuildEntry(LANGUAGE_NONE)); +bAddSeparator = true; +} + +if (bDefaultLangExist) +{ +m_xControl->append(BuildEntry(eDefaultLangType, nDefaultType)); +bAddSeparator = true; } +if (bAddSeparator) +m_xControl->append_separator(""); + bool bAddAvailable = (!(nLangList & SvxLanguageListFlags::ONLY_KNOWN) && ((nLangList & SvxLanguageListFlags::ALL) || (nLangList & SvxLanguageListFlags::WESTERN) || (nLangList & SvxLanguageListFlags::CTL) || (nLangList & SvxLanguageListFlags::CJK))); -std::vector< LanguageType > aSpellAvailLang; -std::vector< LanguageType > aHyphAvailLang; -std::vector< LanguageType > aThesAvailLang; +std::vector< LanguageType > aAvailLang; Sequence< sal_Int16 > aSpellUsedLang; -Reference< XAvailableLocales > xAvail( LinguMgr::GetLngSvcMgr() ); -if (xAvail.is()) +if (bAddAvailable) { -Sequence< css::lang::Locale > aTmp; - -if (bAddAvailable) +if (auto xAvail = LinguMgr::GetLngSvcMgr())
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdmodel.cxx | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) New commits: commit f97a7b965be154824e108802b386e3132b0a237a Author: Julien Nabet AuthorDate: Sun Jun 4 21:59:50 2023 +0200 Commit: Julien Nabet CommitDate: Mon Jun 5 00:03:04 2023 +0200 Simplify vector intialization in svx/svdmodel Change-Id: Ieaed80e4621084baf531b794323b2742ccd80310 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152594 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 82c9a92fa503..4e1ea3c78ac5 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1834,23 +1834,15 @@ void SdrModel::ReadUserDataSequenceValue(const beans::PropertyValue* pValue) } } -template -static void addPair(std::vector< std::pair< OUString, uno::Any > >& aUserData, const OUString& name, const T val) -{ -aUserData.push_back(std::pair< OUString, uno::Any >(name, uno::Any(val))); -} - void SdrModel::WriteUserDataSequence(uno::Sequence & rValues) { -std::vector< std::pair< OUString, uno::Any > > aUserData; -addPair(aUserData, "AnchoredTextOverflowLegacy", - GetCompatibilityFlag(SdrCompatibilityFlag::AnchoredTextOverflowLegacy)); -addPair(aUserData, "LegacySingleLineFontwork", - GetCompatibilityFlag(SdrCompatibilityFlag::LegacySingleLineFontwork)); -addPair(aUserData, "ConnectorUseSnapRect", -GetCompatibilityFlag(SdrCompatibilityFlag::ConnectorUseSnapRect)); -addPair(aUserData, "IgnoreBreakAfterMultilineField", - GetCompatibilityFlag(SdrCompatibilityFlag::IgnoreBreakAfterMultilineField)); +std::vector< std::pair< OUString, uno::Any > > aUserData +{ +{ "AnchoredTextOverflowLegacy", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::AnchoredTextOverflowLegacy)) }, +{ "LegacySingleLineFontwork", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::LegacySingleLineFontwork)) }, +{ "ConnectorUseSnapRect", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::ConnectorUseSnapRect)) }, +{ "IgnoreBreakAfterMultilineField", uno::Any(GetCompatibilityFlag(SdrCompatibilityFlag::IgnoreBreakAfterMultilineField)) } +}; const sal_Int32 nOldLength = rValues.getLength(); rValues.realloc(nOldLength + aUserData.size());
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/StylesPreviewWindow.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 666925f2ab06e690c41c470713dc83f2d752bfb7 Author: Caolán McNamara AuthorDate: Sat Jun 3 15:23:15 2023 +0100 Commit: Caolán McNamara CommitDate: Sat Jun 3 20:23:28 2023 +0200 perf: use freeze/thaw around block insert of multiple icons into the style preview widget in the tabbed view |--1.67%--StylesListUpdateTask::Invoke | StylesPreviewWindow_Base::UpdateStylesList | weld::IconView::append (inlined) | JSIconView::insert | | | |--1.58%--SalInstanceIconView::insert | | | | | |--1.19%--SvTreeListBox::Insert | | | SvTreeList::Insert | | | SvTreeList::Broadcast (inlined) | | | SvTreeListBox::ModelNotification Change-Id: I1c1058324a056e7c8fb42f31c5b4919fcc5870e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152577 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx index a51283d0d750..3cc669ff98ce 100644 --- a/svx/source/tbxctrls/StylesPreviewWindow.cxx +++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx @@ -541,6 +541,7 @@ void StylesPreviewWindow_Base::UpdateStylesList() } } +m_xStylesView->freeze(); m_xStylesView->clear(); for (const auto& rStyle : m_aAllStyles) { @@ -548,6 +549,7 @@ void StylesPreviewWindow_Base::UpdateStylesList() m_xStylesView->append(rStyle.first, rStyle.second, pImg); } +m_xStylesView->thaw(); } StylesPreviewWindow_Impl::StylesPreviewWindow_Impl(
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/contact/viewobjectcontact.cxx | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) New commits: commit 4f98574b78ed1b06bac1d440d75d8ce1ddea8309 Author: Noel Grandin AuthorDate: Wed May 31 13:53:43 2023 +0200 Commit: Noel Grandin CommitDate: Wed May 31 17:45:22 2023 +0200 speed up tab-switching in a calc document with a lot of graphic objects if we are in the destructor, and we have never painted the object in question, then we don't need to do an expensive object-range calculation and invalidation Change-Id: I857c3d927142f4e90d54f79fa6c293731382f0d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152424 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 82b21d137ef1..bc3b5ee178bd 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -167,10 +167,14 @@ ViewObjectContact::ViewObjectContact(ObjectContact& rObjectContact, ViewContact& ViewObjectContact::~ViewObjectContact() { -// invalidate in view -if(!getObjectRange().isEmpty()) +// if the object range is empty, then we have never had the primitive range change, so nothing to invalidate +if (!maObjectRange.isEmpty()) { -GetObjectContact().InvalidatePartOfView(maObjectRange); +// invalidate in view +if(!getObjectRange().isEmpty()) +{ +GetObjectContact().InvalidatePartOfView(maObjectRange); +} } // delete PrimitiveAnimation
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdoole2.cxx | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) New commits: commit 5316e32d72584a60054c4ba98c40067712058d26 Author: Noel Grandin AuthorDate: Mon May 29 15:34:09 2023 +0200 Commit: Noel Grandin CommitDate: Mon May 29 21:35:07 2023 +0200 avoid some invalid Fraction objects when loading spreadsheet with embedded OLE objects Change-Id: Ib8fe88f0ffec03e8b92d8d8b69c8763164f4dd05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152370 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 45235d8a9db3..58c0c5d8ff91 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -1932,12 +1932,20 @@ bool SdrOle2Obj::CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHei aObjAreaSize = mpImpl->mxObjRef.GetSize( &aMapMode ); Size aSize = getRectangle().GetSize(); -aScaleWidth = Fraction(aSize.Width(), aObjAreaSize.Width() ); -aScaleHeight = Fraction(aSize.Height(), aObjAreaSize.Height() ); - -// reduce to 10 binary digits -aScaleHeight.ReduceInaccurate(10); -aScaleWidth.ReduceInaccurate(10); +if (!aObjAreaSize.Width() || !aObjAreaSize.Height()) +{ +// avoid invalid fractions +aScaleWidth = Fraction(1,1); +aScaleHeight = Fraction(1,1); +} +else +{ +aScaleWidth = Fraction(aSize.Width(), aObjAreaSize.Width() ); +aScaleHeight = Fraction(aSize.Height(), aObjAreaSize.Height() ); +// reduce to 10 binary digits +aScaleHeight.ReduceInaccurate(10); +aScaleWidth.ReduceInaccurate(10); +} return true; }
[Libreoffice-commits] core.git: svx/source vcl/inc vcl/unx
svx/source/accessibility/AccessibleControlShape.cxx | 11 +++ vcl/inc/unx/gtk/gtkdata.hxx |5 +++-- vcl/unx/gtk3/a11y/atkutil.cxx | 19 --- 3 files changed, 22 insertions(+), 13 deletions(-) New commits: commit a12633a9982d34eb8f0b714d5f25cff3040f33ab Author: Noel Grandin AuthorDate: Mon May 29 09:50:33 2023 +0200 Commit: Noel Grandin CommitDate: Mon May 29 12:53:13 2023 +0200 tdf#155515 tdf#155528 crash on exit regression from commit 3b7db802731826b6cc3b55100470b0c61c1f2dfa Author: Noel Grandin Date: Thu May 4 10:06:14 2023 +0200 tdf#105404 [API CHANGE] add index to accessiblity change event Fix a handful of things related to accessibility objects being destructed later than they should and consequently trying at access other stuff that has already been destructed. (1) AccessibleControlShape::disposing check the window still exists (2) DocumentFocusListener::notifyEvent, handle INVALIDATE_ALL_CHILDREN (3) hold DocumentFocusListener by weak reference in GtkSalData, so that it dies when the related UI widgets die Change-Id: I38bf68a748b37e6abc4a8cfcc961436728e081bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152365 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index bf085bb753a4..8fe42db6dada 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -629,11 +629,14 @@ void SAL_CALL AccessibleControlShape::disposing() if ( m_bWaitingForControl ) { OSL_FAIL( "AccessibleControlShape::disposing: this should never happen!" ); -Reference< XContainer > xContainer = lcl_getControlContainer( maShapeTreeInfo.GetWindow()->GetOutDev(), maShapeTreeInfo.GetSdrView() ); -if ( xContainer.is() ) +if (auto pWindow = maShapeTreeInfo.GetWindow()) { -m_bWaitingForControl = false; -xContainer->removeContainerListener( this ); +Reference< XContainer > xContainer = lcl_getControlContainer( pWindow->GetOutDev(), maShapeTreeInfo.GetSdrView() ); +if ( xContainer.is() ) +{ +m_bWaitingForControl = false; +xContainer->removeContainerListener( this ); +} } } diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index b39d5dc1aacf..cd03de599887 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -283,13 +284,13 @@ class GtkSalData final : public GenericUnixSalData osl::Condition m_aDispatchCondition; std::exception_ptr m_aException; -rtl::Reference m_xDocumentFocusListener; +unotools::WeakReference m_xDocumentFocusListener; public: GtkSalData(); virtual ~GtkSalData() override; -DocumentFocusListener & GetDocumentFocusListener(); +rtl::Reference GetDocumentFocusListener(); void Init(); virtual void Dispose() override; diff --git a/vcl/unx/gtk3/a11y/atkutil.cxx b/vcl/unx/gtk3/a11y/atkutil.cxx index b16648ecbf0e..fc15351374fd 100644 --- a/vcl/unx/gtk3/a11y/atkutil.cxx +++ b/vcl/unx/gtk3/a11y/atkutil.cxx @@ -162,8 +162,11 @@ void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObj } case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN: -SAL_INFO("vcl.a11y", "Invalidate all children called"); +{ +if (uno::Reference< accessibility::XAccessible > xAcc = getAccessible(aEvent)) +detachRecursive(xAcc); break; +} default: break; @@ -433,13 +436,15 @@ WindowList g_aWindowList; } -DocumentFocusListener & GtkSalData::GetDocumentFocusListener() +rtl::Reference GtkSalData::GetDocumentFocusListener() { -if (!m_xDocumentFocusListener) +rtl::Reference xDFL = m_xDocumentFocusListener.get(); +if (!xDFL) { -m_xDocumentFocusListener = new DocumentFocusListener; +xDFL = new DocumentFocusListener; +m_xDocumentFocusListener = xDFL.get(); } -return *m_xDocumentFocusListener; +return xDFL; } static void handle_get_focus(::VclWindowEvent const * pEvent) @@ -447,7 +452,7 @@ static void handle_get_focus(::VclWindowEvent const * pEvent) GtkSalData *const pSalData(GetGtkSalData()); assert(pSalData); -DocumentFocusListener & rDocumentFocusListener(pSalData->GetDocumentFocusListener()); +rtl::Reference xDocumentFocusListener(pSalData->GetDocumentFocusListener()); vcl::Window *pWindow = pEvent->GetWindow(); @@ -493,7 +498,7 @@ static void handle_get_fo
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdpage.cxx |4 1 file changed, 4 insertions(+) New commits: commit ca10ae200aac01e6b238567fa637cdc293f70f7a Author: Heiko Tietze AuthorDate: Fri May 26 10:17:53 2023 +0200 Commit: Heiko Tietze CommitDate: Fri May 26 13:05:07 2023 +0200 Suppress variable not used warning Change-Id: Ie154c9ad2d187adf735590da2e23420572dd5de4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152294 Reviewed-by: Stephan Bergmann Tested-by: Jenkins diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 55d3e7f5aa6b..175f58b2ad7a 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -139,7 +139,9 @@ void SdrObjList::CopyObjects(const SdrObjList& rSrcList) mbObjOrdNumsDirty = false; mbRectsDirty = false; +#ifdef DBG_UTIL size_t nCloneErrCnt(0); +#endif const size_t nCount(rSrcList.GetObjCount()); if(nullptr == getSdrObjectFromSdrObjList() && nullptr == getSdrPageFromSdrObjList()) @@ -162,10 +164,12 @@ void SdrObjList::CopyObjects(const SdrObjList& rSrcList) NbcInsertObject(pDO.get(), SAL_MAX_SIZE); aCloneList.AddPair(pSO, pDO.get()); } +#ifdef DBG_UTIL else { nCloneErrCnt++; } +#endif } // Wires up the connections
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/clonelist.cxx | 50 1 file changed, 15 insertions(+), 35 deletions(-) New commits: commit 69384d208a2c40c14de73d67d3620596678bf502 Author: Dr. David Alan Gilbert AuthorDate: Sun May 21 18:29:16 2023 +0100 Commit: Noel Grandin CommitDate: Wed May 24 08:13:16 2023 +0200 CloneList::CopyConnections: Replace duplicated code by loop There's a chunk of code copied for the two ends of the connection; replace it by a loop with the original code. Change-Id: I80d80f61879a08612dd8314963cccb35651c2091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152073 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/svdraw/clonelist.cxx b/svx/source/svdraw/clonelist.cxx index 1fe6bd99e478..ffb1ccc6766c 100644 --- a/svx/source/svdraw/clonelist.cxx +++ b/svx/source/svdraw/clonelist.cxx @@ -78,46 +78,26 @@ void CloneList::CopyConnections() const if(pOriginalEdge && pCloneEdge) { -SdrObject* pOriginalNode1 = pOriginalEdge->GetConnectedNode(true); -SdrObject* pOriginalNode2 = pOriginalEdge->GetConnectedNode(false); - -if(pOriginalNode1) +for (bool bTail1 : { true, false }) { -std::vector::const_iterator it = std::find(maOriginalList.begin(), - maOriginalList.end(), - pOriginalNode1); - -sal_uInt32 nPos = it - maOriginalList.begin(); - -if(it != maOriginalList.end()) +SdrObject* pOriginalNode = pOriginalEdge->GetConnectedNode(bTail1); +if (pOriginalNode) { -SdrObject *cObj = nullptr; +std::vector::const_iterator it = std::find(maOriginalList.begin(), + maOriginalList.end(), + pOriginalNode); -if (nPos < cloneCount) -cObj = GetClone(nPos); - -if(pOriginalEdge->GetConnectedNode(true) != cObj) -pCloneEdge->ConnectToNode(true, cObj); -} -} - -if(pOriginalNode2) -{ -std::vector::const_iterator it = std::find(maOriginalList.begin(), - maOriginalList.end(), - pOriginalNode2); - -sal_uInt32 nPos = it - maOriginalList.begin(); - -if(it != maOriginalList.end()) -{ -SdrObject *cObj = nullptr; +if(it != maOriginalList.end()) +{ +sal_uInt32 nPos = it - maOriginalList.begin(); +SdrObject *cObj = nullptr; -if (nPos < cloneCount) -cObj = GetClone(nPos); +if (nPos < cloneCount) +cObj = GetClone(nPos); -if(pOriginalEdge->GetConnectedNode(false) != cObj) -pCloneEdge->ConnectToNode(false, cObj); +if(pOriginalNode != cObj) +pCloneEdge->ConnectToNode(bTail1, cObj); +} } } }
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdpage.cxx | 58 ++ 1 file changed, 9 insertions(+), 49 deletions(-) New commits: commit 26b0870f4e16a8ce53129045d6feea4f8139487f Author: Dr. David Alan Gilbert AuthorDate: Sun May 21 13:44:49 2023 +0100 Commit: Noel Grandin CommitDate: Tue May 23 15:05:05 2023 +0200 tdf#120283 CopyObjects: Use CloneList to wire up connectors Remove the old connector wiring code and replace it by CloneList. The copy/paste code uses CloneList to do this work, and CloneList knows how to deal with groups; and not dealing with groups is the cause of tdf#120283 Change-Id: I48476a93a89c1a14f55ba206e0c8354823d0e8c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152070 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index b2a839a3c785..55d3e7f5aa6b 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include #include @@ -131,6 +132,8 @@ SdrObject* SdrObjList::getSdrObjectFromSdrObjList() const void SdrObjList::CopyObjects(const SdrObjList& rSrcList) { +CloneList aCloneList; + // clear SdrObjects with broadcasting ClearSdrObjList(); @@ -157,6 +160,7 @@ void SdrObjList::CopyObjects(const SdrObjList& rSrcList) if(pDO) { NbcInsertObject(pDO.get(), SAL_MAX_SIZE); +aCloneList.AddPair(pSO, pDO.get()); } else { @@ -164,53 +168,11 @@ void SdrObjList::CopyObjects(const SdrObjList& rSrcList) } } -// and now for the Connectors -// The new objects would be shown in the rSrcList -// and then the object connections are made. -// Similar implementation are setup as the following: -//void SdrObjList::CopyObjects(const SdrObjList& rSrcList) -//SdrModel* SdrExchangeView::CreateMarkedObjModel() const -//BOOL SdrExchangeView::Paste(const SdrModel& rMod,...) -//void SdrEditView::CopyMarked() -if (nCloneErrCnt==0) { -for (size_t no=0; no( pSrcOb ); -if (pSrcEdge!=nullptr) { -SdrObject* pSrcNode1=pSrcEdge->GetConnectedNode(true); -SdrObject* pSrcNode2=pSrcEdge->GetConnectedNode(false); -if (pSrcNode1!=nullptr && pSrcNode1->getParentSdrObjListFromSdrObject()!=pSrcEdge->getParentSdrObjListFromSdrObject()) pSrcNode1=nullptr; // can't do this -if (pSrcNode2!=nullptr && pSrcNode2->getParentSdrObjListFromSdrObject()!=pSrcEdge->getParentSdrObjListFromSdrObject()) pSrcNode2=nullptr; // across all lists (yet) -if (pSrcNode1!=nullptr || pSrcNode2!=nullptr) { -SdrObject* pEdgeObjTmp=GetObj(no); -SdrEdgeObj* pDstEdge=dynamic_cast( pEdgeObjTmp ); -if (pDstEdge!=nullptr) { -if (pSrcNode1!=nullptr) { -sal_uInt32 nDstNode1=pSrcNode1->GetOrdNum(); -SdrObject* pDstNode1=GetObj(nDstNode1); -if (pDstNode1!=nullptr) { // else we get an error! -pDstEdge->ConnectToNode(true,pDstNode1); -} else { -OSL_FAIL("SdrObjList::operator=(): pDstNode1==NULL!"); -} -} -if (pSrcNode2!=nullptr) { -sal_uInt32 nDstNode2=pSrcNode2->GetOrdNum(); -SdrObject* pDstNode2=GetObj(nDstNode2); -if (pDstNode2!=nullptr) { // else the node was probably not selected -pDstEdge->ConnectToNode(false,pDstNode2); -} else { -OSL_FAIL("SdrObjList::operator=(): pDstNode2==NULL!"); -} -} -} else { -OSL_FAIL("SdrObjList::operator=(): pDstEdge==NULL!"); -} -} -} -} -} else { +// Wires up the connections +aCloneList.CopyConnections(); #ifdef DBG_UTIL +if (nCloneErrCnt != 0) +{ OStringBuffer aStr("SdrObjList::operator=(): Error when cloning "); if(nCloneErrCnt == 1) @@ -223,11 +185,9 @@ void SdrObjList::CopyObjects(const SdrObjList& rSrcList) + " drawing objects."); } -aStr.append(" Not copying connectors."); - OSL_FAIL(aStr.getStr()); -#endif } +#endif } void SdrObjList::RecalcObjOrdNums()
[Libreoffice-commits] core.git: svx/source
svx/source/unodraw/unoshape.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit 1167bfefe539417a24016f2c4e69f39ed10d2624 Author: Noel Grandin AuthorDate: Mon May 22 11:49:17 2023 +0200 Commit: Noel Grandin CommitDate: Tue May 23 13:49:35 2023 +0200 avoid some ref-counting traffic in SvxShape::Notify which is quite a hot method Change-Id: I7fe6557d48cff8c9312b4dbcd24c215f16b9fcfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152139 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 8494f493513d..32695605dfb0 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -950,19 +950,20 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) noexcept // do cheap checks first, this method is hot if (rHint.GetId() != SfxHintId::ThisIsAnSdrHint) return; -rtl::Reference pSdrObject(mxSdrObject); -if( !pSdrObject ) +if( !mxSdrObject ) return; const SdrHint* pSdrHint = static_cast(&rHint); // #i55919# SdrHintKind::ObjectChange is only interesting if it's for this object if ((pSdrHint->GetKind() != SdrHintKind::ModelCleared) && - (pSdrHint->GetKind() != SdrHintKind::ObjectChange || pSdrHint->GetObject() != pSdrObject.get() )) + (pSdrHint->GetKind() != SdrHintKind::ObjectChange || pSdrHint->GetObject() != mxSdrObject.get() )) return; -uno::Reference< uno::XInterface > xSelf( pSdrObject->getWeakUnoShape() ); +// prevent object being deleted from under us +rtl::Reference xSdrSelf(mxSdrObject); +uno::Reference< uno::XInterface > xSelf( mxSdrObject->getWeakUnoShape() ); if( !xSelf.is() ) { -EndListening(pSdrObject->getSdrModelFromSdrObject()); +EndListening(mxSdrObject->getSdrModelFromSdrObject()); mxSdrObject.clear(); return; } @@ -973,9 +974,8 @@ void SvxShape::Notify( SfxBroadcaster&, const SfxHint& rHint ) noexcept } else // (pSdrHint->GetKind() == SdrHintKind::ModelCleared) { -EndListening(pSdrObject->getSdrModelFromSdrObject()); -pSdrObject->setUnoShape(nullptr); -pSdrObject.clear(); +EndListening(mxSdrObject->getSdrModelFromSdrObject()); +mxSdrObject->setUnoShape(nullptr); mxSdrObject.clear(); if(!mpImpl->mbDisposing)
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/tbcontrl.cxx | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) New commits: commit 63707596eefa4f141a5c7146e69bb5684ed51cf6 Author: Xisco Fauli AuthorDate: Thu May 18 15:52:37 2023 +0200 Commit: Caolán McNamara CommitDate: Fri May 19 10:05:04 2023 +0200 svx: check SfxObjectShell::Current() See https://crashreport.libreoffice.org/stats/signature/static%20void%20%60anonymous%20namespace'::SvxStyleBox_Base::Select(bool) Change-Id: I6edce9c8bad1ee087ddf884ff47439cceee3f1de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151964 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 4feda3af8f75..ed8034028891 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1011,6 +1011,9 @@ void SvxStyleBox_Base::Select(bool bNonTravelSelect) //Do we need to create a new style? SfxObjectShell *pShell = SfxObjectShell::Current(); +if (!pShell) +return; + SfxStyleSheetBasePool* pPool = pShell->GetStyleSheetPool(); SfxStyleSheetBase* pStyle = nullptr; @@ -1321,11 +1324,13 @@ static bool SetFontSize(vcl::RenderContext& rRenderContext, const SfxItemSet& rS if (GetWhich(rSet, nSlot, nWhich)) { const auto& rFontHeightItem = static_cast(rSet.Get(nWhich)); -SfxObjectShell *pShell = SfxObjectShell::Current(); -Size aFontSize(0, rFontHeightItem.GetHeight()); -Size aPixelSize(rRenderContext.LogicToPixel(aFontSize, MapMode(pShell->GetMapUnit(; -rFont.SetFontSize(aPixelSize); -return true; +if (SfxObjectShell *pShell = SfxObjectShell::Current()) +{ +Size aFontSize(0, rFontHeightItem.GetHeight()); +Size aPixelSize(rRenderContext.LogicToPixel(aFontSize, MapMode(pShell->GetMapUnit(; +rFont.SetFontSize(aPixelSize); +return true; +} } return false; }
[Libreoffice-commits] core.git: svx/source
svx/source/xml/xmlxtimp.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 44b2a04e3123054c1103be6c74742105dab32ee3 Author: Andrea Gelmini AuthorDate: Mon May 8 14:18:44 2023 +0200 Commit: Julien Nabet CommitDate: Mon May 8 17:57:12 2023 +0200 Fix typos Change-Id: I1d171c2177a83b0918c483e8c34399b0f70fd59b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151507 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index 0cb79c981acb..19c2a66ce1bb 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -265,8 +265,8 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > break; default: // SvxXMLTableImportContextEnum::Gradient -// is no longer imported hee as 'fixed content' -// but dynamicalloy using an own ImportContext +// is no longer imported as 'fixed content' +// but dynamically using an own ImportContext break; }
[Libreoffice-commits] core.git: svx/source sw/qa
svx/source/inc/findtextfield.hxx |2 svx/source/tbxctrls/tbunosearchcontrollers.cxx | 26 +++--- sw/qa/uitest/findBar/tdf154818.py | 65 + sw/qa/uitest/findReplace/findReplace.py| 22 4 files changed, 98 insertions(+), 17 deletions(-) New commits: commit 4cae4a11642f0d8f0c8005141893e34e1c216fde Author: Andreas Heinisch AuthorDate: Wed May 3 18:02:30 2023 +0200 Commit: Andreas Heinisch CommitDate: Thu May 4 12:08:55 2023 +0200 tdf#154818 - Find bar: remember and reuse last search string Changed remembered search string in the find bar from user configuration to session and added UI test. Change-Id: Idf211f1fadd87ba935fe3948c20c4e511aa8afdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151335 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/svx/source/inc/findtextfield.hxx b/svx/source/inc/findtextfield.hxx index 8cfa98f03242..2c79a529b3f4 100644 --- a/svx/source/inc/findtextfield.hxx +++ b/svx/source/inc/findtextfield.hxx @@ -67,6 +67,8 @@ private: // tdf#154269 - respect FindReplaceRememberedSearches expert option sal_uInt16 m_nRememberSize; +// tdf#154818 - remember last search string +static OUString m_sRememberedSearchString; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 1ae8a0b5c738..e2c76a9800de 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -60,7 +60,6 @@ #include #include #include -#include #include @@ -192,6 +191,9 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext } +// tdf#154818 - remember last search string +OUString FindTextFieldControl::m_sRememberedSearchString; + FindTextFieldControl::FindTextFieldControl( vcl::Window* pParent, css::uno::Reference< css::frame::XFrame > xFrame, css::uno::Reference< css::uno::XComponentContext > xContext) : @@ -260,20 +262,12 @@ void FindTextFieldControl::SetTextToSelected_Impl() m_xWidget->set_entry_text(aString); m_aChangeHdl.Call(*m_xWidget); } -else +// tdf#154818 - reuse last search string +else if (!m_sRememberedSearchString.isEmpty() || get_count() > 0) { -// tdf#154818 - reuse last search string -SvtViewOptions aDlgOpt(EViewType::Dialog, m_xWidget->get_help_id()); -if (aDlgOpt.Exists()) -{ -css::uno::Any aUserItem = aDlgOpt.GetUserItem("UserItem"); -aUserItem >>= aString; -} -else if (get_count() > 0) -aString = m_xWidget->get_text(0); - // prepopulate with last search word (fdo#84256) -m_xWidget->set_entry_text(aString); +m_xWidget->set_entry_text(m_sRememberedSearchString.isEmpty() ? m_xWidget->get_text(0) + : m_sRememberedSearchString); } } @@ -340,10 +334,8 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const KeyEvent&, rKeyEvent, bool) void FindTextFieldControl::ActivateFind(bool bShift) { // tdf#154818 - remember last search string -const OUString aLastSearchString = m_xWidget->get_active_text(); -SvtViewOptions aDlgOpt(EViewType::Dialog, m_xWidget->get_help_id()); -aDlgOpt.SetUserItem("UserItem", css::uno::Any(aLastSearchString)); -Remember_Impl(aLastSearchString); +m_sRememberedSearchString = m_xWidget->get_active_text(); +Remember_Impl(m_sRememberedSearchString); vcl::Window* pWindow = GetParent(); ToolBox* pToolBox = static_cast(pWindow); diff --git a/sw/qa/uitest/findBar/tdf154818.py b/sw/qa/uitest/findBar/tdf154818.py new file mode 100644 index ..e0470206faf8 --- /dev/null +++ b/sw/qa/uitest/findBar/tdf154818.py @@ -0,0 +1,65 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict, select_pos +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf154818(UITestCase): + +def test_tdf154818_remember_search_item(self): +with self.ui_test.create_doc_in_start_center("writer"): +xWriterDoc = self.xUITest.getTopFocusWindow() +xWriterEdit = xWriterDoc.getChild("writer_edit") + +# Search for an entry and check again if it is preselected (A -> B -> A) +searchTerms = ["A", "B", "A"] +for searchTerm in searchTerms: +xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE"
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdpage.cxx | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) New commits: commit d72f3d480eaffd8bd6d14fe60f01c995886cf317 Author: Noel Grandin AuthorDate: Wed May 3 10:47:43 2023 +0200 Commit: Noel Grandin CommitDate: Wed May 3 12:47:49 2023 +0200 tdf#137544 simplify SdrObjList destructor by allowing the maList to destruct naturally, it deletes the objects from first to last. This speeds up the search process when these objects remove themselves from broadcasters. Change-Id: I0534b39bc82b24d0e4245773e105a77bce735c9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151315 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index e685c40c89a5..351278cf789c 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -112,14 +112,9 @@ void SdrObjList::ClearSdrObjList() SdrObjList::~SdrObjList() { -// clear SdrObjects without broadcasting -while(!maList.empty()) -{ -// remove last object from list -SdrObject& rObj = *maList.back(); -rObj.setParentOfSdrObject(nullptr); -maList.pop_back(); -} +// Clear SdrObjects without broadcasting. +for (auto& rxObj : maList) +rxObj->setParentOfSdrObject(nullptr); } SdrPage* SdrObjList::getSdrPageFromSdrObjList() const
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/contact/viewcontactofsdrpathobj.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 7a2435b4ae52bbbe8bd7d0fd0cf6a32ee42aac98 Author: Noel Grandin AuthorDate: Tue May 2 14:03:55 2023 +0200 Commit: Noel Grandin CommitDate: Tue May 2 19:42:00 2023 +0200 fix mistake in commit "optimise ensureGeometry" In commit bfe32f3e50b5406810e740ac41368f101033e766 Author: Noel Grandin Date: Wed Jan 12 20:51:39 2022 +0200 optimise ensureGeometry I got the return value wrong for the early exit case. I am quite surprised this did not mess up something in the drawinglayer line handling. Change-Id: I6788ef8898575c89344f25f6e66c4ae0a999f013 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151268 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx index 0b546cd34d5a..0c1ed2af250b 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx @@ -49,8 +49,9 @@ namespace sdr::contact for(auto const& rPolygon : std::as_const(rUnitPolyPolygon)) { nPointCount += rPolygon.count(); +// return early if we definitely have geometry if (nPointCount > 1) -return false; +return nPolyCount == 1; } if(!nPointCount)
[Libreoffice-commits] core.git: svx/source
svx/source/sdr/properties/textproperties.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit ff307906ce794173e4f26dcad84518d010668ea3 Author: Noel Grandin AuthorDate: Mon May 1 21:06:32 2023 +0200 Commit: Noel Grandin CommitDate: Tue May 2 07:12:46 2023 +0200 elide temporary copy Change-Id: I3818767811ee92b39f475533144d0163a7e6931e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151236 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index d8cdf80dfc29..55059d3a 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -135,8 +135,7 @@ namespace sdr::properties // force ItemSet GetObjectItemSet(); -SfxItemSet aNewSet(pOutliner->GetParaAttribs(0)); -mxItemSet->Put(aNewSet); +mxItemSet->Put(pOutliner->GetParaAttribs(0)); } std::optional pTemp = pOutliner->CreateParaObject(0, nParaCount);
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdotext.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit fd99725abdeea92e8cd46bb3e8e6fdcad8180e8a Author: Tomaž Vajngerl AuthorDate: Sat Apr 29 11:05:00 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Sat Apr 29 05:59:33 2023 +0200 Prevent to get 0 font size in the auto-fitting algorithm When the text box is empty, the size of the box can be returned as (0,0) so the auto-fitting algorithm will calculate the scaling to 0%, which means the text is shrinked to very small size or is invisible. This change fixes the issue so that if the size is (0,0) we just return and leave the scaling at 100%. Change-Id: Ie359461f23a1f7a496eb03b5670f588ad48bbf49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151178 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 52bf41312eed..4eab532af59b 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1359,6 +1359,9 @@ void SdrTextObj::autoFitTextForCompatibility(SdrOutliner& rOutliner, const Size& } Size aCurrentTextBoxSize = rOutliner.CalcTextSizeNTP(); +if (aCurrentTextBoxSize.Height() == 0) +return; + tools::Long nExtendTextBoxBy = -50; aCurrentTextBoxSize.extendBy(0, nExtendTextBoxBy); double fCurrentFitFactor = double(rTextBoxSize.Height()) / aCurrentTextBoxSize.Height();
[Libreoffice-commits] core.git: svx/source svx/uiconfig
svx/source/dialog/ThemeDialog.cxx |4 +++- svx/uiconfig/ui/themedialog.ui|2 -- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit dcb8f373d7bcd328e69e0bea85b76874923ce0dd Author: Tomaž Vajngerl AuthorDate: Thu Apr 27 20:31:05 2023 +0900 Commit: Tomaž Vajngerl CommitDate: Fri Apr 28 14:11:51 2023 +0200 disable dbl-click in ThemeDialog in LOK, remove the dialog size The double click in THemeDialog exits the dialog automatically, but this causes a crash in online, so disable it there. No need to set the theme dialog size to a certain fixed value so we don't add white space. Change-Id: I555a631b7d0c515ec326c3654138982c59d3f021 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151106 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/svx/source/dialog/ThemeDialog.cxx b/svx/source/dialog/ThemeDialog.cxx index c440292b723d..01f88fa036ed 100644 --- a/svx/source/dialog/ThemeDialog.cxx +++ b/svx/source/dialog/ThemeDialog.cxx @@ -15,6 +15,7 @@ #include #include #include +#include namespace svx { @@ -65,7 +66,8 @@ void ThemeDialog::initColorSets() IMPL_LINK_NOARG(ThemeDialog, DoubleClickValueSetHdl, ValueSet*, void) { SelectItem(nullptr); -m_xDialog->response(RET_OK); +if (!comphelper::LibreOfficeKit::isActive()) +m_xDialog->response(RET_OK); } IMPL_LINK_NOARG(ThemeDialog, SelectItem, ValueSet*, void) diff --git a/svx/uiconfig/ui/themedialog.ui b/svx/uiconfig/ui/themedialog.ui index 80bbcc5fca67..6895f51dff24 100644 --- a/svx/uiconfig/ui/themedialog.ui +++ b/svx/uiconfig/ui/themedialog.ui @@ -3,8 +3,6 @@ -640 -480 False True True
[Libreoffice-commits] core.git: svx/source
svx/source/tbxctrls/tbunosearchcontrollers.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 89afe2978500233dc7b58d39cc519ecb9c224e98 Author: Andreas Heinisch AuthorDate: Wed Apr 26 19:40:34 2023 +0200 Commit: Andreas Heinisch CommitDate: Thu Apr 27 11:12:52 2023 +0200 tdf#154818 - Find bar: remember and reuse last search string If there exists no last search string in the view options and there exists a search history, preselect the last search item. Change-Id: Ic6056e02eaf6c0ee7e266e47ba961dff11e9f9da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151072 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index d43222fe4e32..1ae8a0b5c738 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -268,9 +268,12 @@ void FindTextFieldControl::SetTextToSelected_Impl() { css::uno::Any aUserItem = aDlgOpt.GetUserItem("UserItem"); aUserItem >>= aString; -// prepopulate with last search word (fdo#84256) -m_xWidget->set_entry_text(aString); } +else if (get_count() > 0) +aString = m_xWidget->get_text(0); + +// prepopulate with last search word (fdo#84256) +m_xWidget->set_entry_text(aString); } }
[Libreoffice-commits] core.git: svx/source
svx/source/xoutdev/xtabgrdt.cxx | 31 --- 1 file changed, 12 insertions(+), 19 deletions(-) New commits: commit 6c0ce7f7124ea7d91eada9a544c52235770fa255 Author: Armin Le Grand (allotropia) AuthorDate: Wed Apr 19 16:24:22 2023 +0200 Commit: Armin Le Grand CommitDate: Thu Apr 20 13:56:22 2023 +0200 MCGR: Correct creation for Gradient-Previews Change-Id: Iafadcaa93660317d65c8f45940653273b562f37e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150651 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx index 7fee511072c3..c853e69a3a44 100644 --- a/svx/source/xoutdev/xtabgrdt.cxx +++ b/svx/source/xoutdev/xtabgrdt.cxx @@ -101,24 +101,7 @@ BitmapEx XGradientList::CreateBitmap( tools::Long nIndex, const Size& rSize ) co basegfx::B2DRange(0.0, 0.0, rSize.Width(), rSize.Height(; const XGradient& rGradient = GetGradient(nIndex)->GetGradient(); -const sal_uInt16 nStartIntens(rGradient.GetStartIntens()); -basegfx::BColor aStart(rGradient.GetColorStops().front().getStopColor()); - -if(nStartIntens != 100) -{ -const basegfx::BColor aBlack; -aStart = interpolate(aBlack, aStart, static_cast(nStartIntens) * 0.01); -} - -const sal_uInt16 nEndIntens(rGradient.GetEndIntens()); -basegfx::BColor aEnd(rGradient.GetColorStops().back().getStopColor()); - -if(nEndIntens != 100) -{ -const basegfx::BColor aBlack; -aEnd = interpolate(aBlack, aEnd, static_cast(nEndIntens) * 0.01); -} - +basegfx::ColorStops aColorStops(rGradient.GetColorStops()); drawinglayer::attribute::GradientStyle aGradientStyle(drawinglayer::attribute::GradientStyle::Rect); switch(rGradient.GetGradientStyle()) @@ -155,13 +138,23 @@ BitmapEx XGradientList::CreateBitmap( tools::Long nIndex, const Size& rSize ) co } } +if (rGradient.GetStartIntens() != 100 || rGradient.GetEndIntens() != 100) +{ +// Need to do the (old, crazy) blend against black +basegfx::utils::blendColorStopsToIntensity( +aColorStops, +rGradient.GetStartIntens() * 0.01, +rGradient.GetEndIntens() * 0.01, +basegfx::BColor()); // COL_BLACK +} + drawinglayer::attribute::FillGradientAttribute aFillGradient( aGradientStyle, static_cast(rGradient.GetBorder()) * 0.01, static_cast(rGradient.GetXOffset()) * 0.01, static_cast(rGradient.GetYOffset()) * 0.01, toRadians(rGradient.GetAngle()), -basegfx::utils::createColorStopsFromStartEndColor(aStart, aEnd)); +aColorStops); const drawinglayer::primitive2d::Primitive2DReference aGradientPrimitive( new drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D(
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/compressgraphicdialog.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit b167bc073b6b83110242bfbace107f6978e5bca7 Author: Noel Grandin AuthorDate: Thu Apr 20 11:47:43 2023 +0200 Commit: Noel Grandin CommitDate: Thu Apr 20 13:06:35 2023 +0200 tdf#153190 Compressing tool calculates compression rate wrong on large images calculation used sal_Int32, which overflowed on large values, rather use floating point to do the calculation Change-Id: I15974c5bf785a800a8f71711acfa9895361bad7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150683 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 91399497c48e..a8be5ed6c5e8 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -377,7 +377,11 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, CalculateClickHdl, weld::Button&, void { OUString aSizeAsString = OUString::number(aSize / 1024); -OUString aReductionSizeAsString = OUString::number( m_aNativeSize > 0 ? (m_aNativeSize - aSize) * 100 / m_aNativeSize : 0 ); +OUString aReductionSizeAsString; +if (m_aNativeSize > 0 ) + aReductionSizeAsString = OUString::number( static_cast((m_aNativeSize - aSize) * 100.0 / m_aNativeSize) ); +else + aReductionSizeAsString = "0"; OUString aNewSizeString = SvxResId(STR_IMAGE_CAPACITY_WITH_REDUCTION); aNewSizeString = aNewSizeString.replaceAll("$(CAPACITY)", aSizeAsString);
[Libreoffice-commits] core.git: svx/source
svx/source/dialog/srchdlg.cxx | 24 +--- svx/source/tbxctrls/tbunosearchcontrollers.cxx | 36 +++-- 2 files changed, 36 insertions(+), 24 deletions(-) New commits: commit 695f08911f40ab8d457c7c7e37bf87bb301ef98d Author: Andreas Heinisch AuthorDate: Mon Apr 17 11:07:35 2023 +0200 Commit: Andreas Heinisch CommitDate: Wed Apr 19 18:25:20 2023 +0200 tdf#154818 - Find bar: remember and reuse last search string In addition, the search items are rearranged to their usage order. Change-Id: I4f4bdfd869a981726ef84060e93c178502eaefef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150485 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 69483c124770..4805bbd8159e 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1591,20 +1591,22 @@ void SvxSearchDialog::Remember_Impl( const OUString &rStr, bool _bSearch ) std::vector* pArr = _bSearch ? &aSearchStrings : &aReplaceStrings; weld::ComboBox* pListBox = _bSearch ? m_xSearchLB.get() : m_xReplaceLB.get(); -// ignore identical strings -if (std::find(pArr->begin(), pArr->end(), rStr) != pArr->end()) -return; +// tdf#154818 - rearrange the search items +const auto nPos = pListBox->find_text(rStr); +if (nPos != -1) +{ +pListBox->remove(nPos); +pArr->erase(pArr->begin() + nPos); +} +else if (pListBox->get_count() >= nRememberSize) +{ +// delete oldest entry at maximum occupancy (ListBox and Array) +pListBox->remove(nRememberSize - 1); +pArr->erase(pArr->begin() + nRememberSize - 1); +} pArr->insert(pArr->begin(), rStr); pListBox->insert_text(0, rStr); - -// delete oldest entry at maximum occupancy (ListBox and Array) -size_t nArrSize = pArr->size(); -if (nArrSize > nRememberSize) -{ -pListBox->remove(nArrSize - 1); -pArr->erase(pArr->begin() + nArrSize - 1); -} } void SvxSearchDialog::TemplatesChanged_Impl( SfxStyleSheetBasePool& rPool ) diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 9611f4d686c0..d43222fe4e32 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -60,6 +60,7 @@ #include #include #include +#include #include @@ -222,17 +223,15 @@ FindTextFieldControl::FindTextFieldControl( vcl::Window* pParent, void FindTextFieldControl::Remember_Impl(const OUString& rStr) { -const sal_Int32 nCount = m_xWidget->get_count(); - -for (sal_Int32 i=0; iget_text(i)) -return; -} +if (rStr.isEmpty()) +return; -if (nCount == m_nRememberSize) +// tdf#154818 - rearrange the search items +const auto nPos = m_xWidget->find_text(rStr); +if (nPos != -1) +m_xWidget->remove(nPos); +else if (m_xWidget->get_count() >= m_nRememberSize) m_xWidget->remove(m_nRememberSize - 1); - m_xWidget->insert_text(0, rStr); } @@ -261,10 +260,17 @@ void FindTextFieldControl::SetTextToSelected_Impl() m_xWidget->set_entry_text(aString); m_aChangeHdl.Call(*m_xWidget); } -else if (get_count() > 0) +else { -// Else, prepopulate with last search word (fdo#84256) -m_xWidget->set_entry_text(m_xWidget->get_text(0)); +// tdf#154818 - reuse last search string +SvtViewOptions aDlgOpt(EViewType::Dialog, m_xWidget->get_help_id()); +if (aDlgOpt.Exists()) +{ +css::uno::Any aUserItem = aDlgOpt.GetUserItem("UserItem"); +aUserItem >>= aString; +// prepopulate with last search word (fdo#84256) +m_xWidget->set_entry_text(aString); +} } } @@ -330,7 +336,11 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const KeyEvent&, rKeyEvent, bool) void FindTextFieldControl::ActivateFind(bool bShift) { -Remember_Impl(m_xWidget->get_active_text()); +// tdf#154818 - remember last search string +const OUString aLastSearchString = m_xWidget->get_active_text(); +SvtViewOptions aDlgOpt(EViewType::Dialog, m_xWidget->get_help_id()); +aDlgOpt.SetUserItem("UserItem", css::uno::Any(aLastSearchString)); +Remember_Impl(aLastSearchString); vcl::Window* pWindow = GetParent(); ToolBox* pToolBox = static_cast(pWindow);
[Libreoffice-commits] core.git: svx/source
svx/source/unodraw/unoshap4.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 02379929bd0e1d1676635f0ca1920422702ebb7c Author: Caolán McNamara AuthorDate: Tue Apr 18 08:56:32 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 18 21:53:07 2023 +0200 allow SvxOle2Shape::resetModifiedState to survive having no SdrObject Change-Id: Iea059262c124e3f44249e49b4189732310d28156 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150538 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index ae26aaabeca6..bfde63a2bac1 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -499,10 +499,11 @@ void SvxOle2Shape::createLink( const OUString& aLinkURL ) void SvxOle2Shape::resetModifiedState() { -::comphelper::IEmbeddedHelper* pPersist = GetSdrObject()->getSdrModelFromSdrObject().GetPersist(); +SdrObject* pObject = GetSdrObject(); +::comphelper::IEmbeddedHelper* pPersist = pObject ? pObject->getSdrModelFromSdrObject().GetPersist() : nullptr; if( pPersist && !pPersist->isEnableSetModified() ) { -SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >( GetSdrObject() ); +SdrOle2Obj* pOle = dynamic_cast< SdrOle2Obj* >(pObject); if( pOle && !pOle->IsEmpty() ) { uno::Reference < util::XModifiable > xMod( pOle->GetObjRef(), uno::UNO_QUERY );
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/line/LinePropertyPanelBase.cxx | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) New commits: commit d68d1876216f7d69830fdc16d4a1dd9d9952c2df Author: Caolán McNamara AuthorDate: Tue Apr 18 11:18:56 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 18 13:55:33 2023 +0200 reduce copy and paste a bit Change-Id: I65cb71d44828e0c0d738c4192c39a697513bc6e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150549 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 81ccc4688bd7..b065a66f65a5 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -260,16 +260,8 @@ void LinePropertyPanelBase::updateLineJoint(bool bDisabled, bool bSetOrDefault, void LinePropertyPanelBase::updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pState) { -if(bDisabled) -{ -mxLBCapStyle->set_sensitive(false); -mxFTCapStyle->set_sensitive(false); -} -else -{ -mxLBCapStyle->set_sensitive(true); -mxFTCapStyle->set_sensitive(true); -} +mxLBCapStyle->set_sensitive(!bDisabled); +mxFTCapStyle->set_sensitive(!bDisabled); if(bSetOrDefault) {
[Libreoffice-commits] core.git: svx/source
svx/source/sidebar/line/LinePropertyPanelBase.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e535a2bd67b50cc529115e9ac9e346140ea164dc Author: Caolán McNamara AuthorDate: Tue Apr 18 11:16:45 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 18 13:46:17 2023 +0200 Resolves: tdf#154870 label grayed out when it should not be Change-Id: I1d84434622f09e6e91bea550f5dc0321cb7d89ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150548 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 49f970e1a2ec..81ccc4688bd7 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -268,7 +268,7 @@ void LinePropertyPanelBase::updateLineCap(bool bDisabled, bool bSetOrDefault, else { mxLBCapStyle->set_sensitive(true); -mxLBCapStyle->set_sensitive(true); +mxFTCapStyle->set_sensitive(true); } if(bSetOrDefault)
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdmodel.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 41741d0417a11ab3033e4dc6c899646d42871546 Author: Noel Grandin AuthorDate: Mon Apr 17 11:40:55 2023 +0200 Commit: Noel Grandin CommitDate: Mon Apr 17 14:57:01 2023 +0200 tdf#154473 remove assert so the commit that caused this: commit 8611f6e259b807b4f19c8dc0eab86ca648891ce3 Author: Noel Grandin Date: Thu May 27 10:27:46 2021 +0200 ref-count SdrObject did its job - we have far fewer crashes due to accessing dead SdrObjects - but the wide variety of other, smaller leaks, means that sometimes we have leaks of SdrObjects too. So just remove this assert for now (but leave the warning in DBG_UTIL mode in) Change-Id: I2123ba0f28a0cb4356eab3cbf34c8b67d785c516 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150486 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index c3716a4a3efa..7bf82ca9747f 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -224,7 +224,6 @@ SdrModel::~SdrModel() for (const auto & pObj : maAllIncarnatedObjects) SAL_WARN("svx", "leaked instance of " << typeid(*pObj).name()); } -assert(maAllIncarnatedObjects.empty()); #endif m_pLayerAdmin.reset();
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdtext.cxx | 21 - 1 file changed, 21 deletions(-) New commits: commit abc09fe149ed971074eecb0cc1808c35add6ccfa Author: Noel Grandin AuthorDate: Sun Apr 16 17:05:25 2023 +0200 Commit: Noel Grandin CommitDate: Sun Apr 16 18:31:37 2023 +0200 remove dead code it is easier to see that is dead if you look at the code prior to eec42f0dbcc79a4c9f456ce97fa1066b8031ea28, when we were using unique_ptr, which means that the pointer comparisons could never be true. Change-Id: I2e8608e468868a1f6b657a90b3db580334ec0490 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150457 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx index e013620b7d06..0fe4fa47d405 100644 --- a/svx/source/svdraw/svdtext.cxx +++ b/svx/source/svdraw/svdtext.cxx @@ -71,16 +71,6 @@ const SfxItemSet& SdrText::GetItemSet() const void SdrText::SetOutlinerParaObject( std::optional pTextObject ) { -// Update HitTestOutliner -const SdrTextObj* pTestObj(mrObject.getSdrModelFromSdrObject().GetHitTestOutliner().GetTextObj()); - -if(pTestObj) -if ( (!pTestObj->GetOutlinerParaObject() && !mpOutlinerParaObject) -|| (pTestObj->GetOutlinerParaObject() && mpOutlinerParaObject && *pTestObj->GetOutlinerParaObject() == *mpOutlinerParaObject) ) -{ - mrObject.getSdrModelFromSdrObject().GetHitTestOutliner().SetTextObj(nullptr); -} - mpOutlinerParaObject = std::move(pTextObject); mbPortionInfoChecked = false; } @@ -98,19 +88,8 @@ const OutlinerParaObject* SdrText::GetOutlinerParaObject() const /** returns the current OutlinerParaObject and removes it from this instance */ std::optional SdrText::RemoveOutlinerParaObject() { -// Update HitTestOutliner -const SdrTextObj* pTestObj(mrObject.getSdrModelFromSdrObject().GetHitTestOutliner().GetTextObj()); - -if(pTestObj) -if ( (!pTestObj->GetOutlinerParaObject() && !mpOutlinerParaObject) -|| (pTestObj->GetOutlinerParaObject() && mpOutlinerParaObject && *pTestObj->GetOutlinerParaObject() == *mpOutlinerParaObject) ) -{ - mrObject.getSdrModelFromSdrObject().GetHitTestOutliner().SetTextObj(nullptr); -} - std::optional pOPO = std::move(mpOutlinerParaObject); mbPortionInfoChecked = false; - return pOPO; }
[Libreoffice-commits] core.git: svx/source sw/qa vcl/source
svx/source/inc/findtextfield.hxx |3 ++ svx/source/tbxctrls/tbunosearchcontrollers.cxx | 12 +--- sw/qa/uitest/findBar/tdf154269.py | 36 + vcl/source/uitest/uiobject.cxx |1 4 files changed, 48 insertions(+), 4 deletions(-) New commits: commit b8349ca053753bb0dc713933628a1575a70677d3 Author: Andreas Heinisch AuthorDate: Wed Apr 12 12:13:17 2023 +0200 Commit: Andreas Heinisch CommitDate: Sat Apr 15 11:33:08 2023 +0200 tdf#154269 - Respect FindReplaceRememberedSearches expert option in quick find Change-Id: I88c1bed647bf6f77953ccd9921e515c1246fa96f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150273 Tested-by: Jenkins Reviewed-by: Andreas Heinisch diff --git a/svx/source/inc/findtextfield.hxx b/svx/source/inc/findtextfield.hxx index eb1b6cc11ee5..8cfa98f03242 100644 --- a/svx/source/inc/findtextfield.hxx +++ b/svx/source/inc/findtextfield.hxx @@ -64,6 +64,9 @@ private: void FocusIn(); void ActivateFind(bool bShift); + +// tdf#154269 - respect FindReplaceRememberedSearches expert option +sal_uInt16 m_nRememberSize; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 304eb8123c56..9611f4d686c0 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -73,8 +74,6 @@ constexpr OUStringLiteral COMMAND_FINDALL = u".uno:FindAll"; constexpr OUStringLiteral COMMAND_MATCHCASE = u".uno:MatchCase"; constexpr OUStringLiteral COMMAND_SEARCHFORMATTED = u".uno:SearchFormattedDisplayString"; -const sal_Int32 REMEMBER_SIZE = 10; - class CheckButtonItemWindow final : public InterimItemWindow { public: @@ -214,6 +213,11 @@ FindTextFieldControl::FindTextFieldControl( vcl::Window* pParent, m_xWidget->set_size_request(250, -1); SetSizePixel(m_xWidget->get_preferred_size()); + +// tdf#154269 - respect FindReplaceRememberedSearches expert option +m_nRememberSize = officecfg::Office::Common::Misc::FindReplaceRememberedSearches::get(); +if (m_nRememberSize < 1) +m_nRememberSize = 1; } void FindTextFieldControl::Remember_Impl(const OUString& rStr) @@ -226,8 +230,8 @@ void FindTextFieldControl::Remember_Impl(const OUString& rStr) return; } -if (nCount == REMEMBER_SIZE) -m_xWidget->remove(REMEMBER_SIZE-1); +if (nCount == m_nRememberSize) +m_xWidget->remove(m_nRememberSize - 1); m_xWidget->insert_text(0, rStr); } diff --git a/sw/qa/uitest/findBar/tdf154269.py b/sw/qa/uitest/findBar/tdf154269.py new file mode 100755 index ..d5752093b2b6 --- /dev/null +++ b/sw/qa/uitest/findBar/tdf154269.py @@ -0,0 +1,36 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf154269(UITestCase): + +def test_tdf154269(self): + +with self.ui_test.create_doc_in_start_center("writer"): +# Open quick search +self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar") +xWriterDoc = self.xUITest.getTopFocusWindow() +xFind = xWriterDoc.getChild("find") + +# Generate a search history with more than 10 entries (A to Z) +for searchTerm in map(chr, range(65, 91)): +# Search twice to generate a search history +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"})) +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) +xFind.executeAction("TYPE", mkPropertyValues({"TEXT": searchTerm})) +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) +xFind.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ESC"})) + self.xUITest.executeCommand("vnd.sun.star.findbar:FocusToFindbar") + +# The default value of FindReplaceRememberedSearches has been respected +self.assertEqual("10", get_state_as_dict(xFind)["EntryCount"]) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 38079425a41d..623591e7e218 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -1224,6 +1224,7 @@ StringMap ComboBoxUIObject::get_state() { StringMap aMap = WindowUIO
[Libreoffice-commits] core.git: svx/source
svx/source/table/cell.cxx | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) New commits: commit ad97694737c99889bc0eb21efccb83768d510361 Author: Noel Grandin AuthorDate: Thu Apr 13 21:26:43 2023 +0200 Commit: Noel Grandin CommitDate: Fri Apr 14 07:53:23 2023 +0200 tdf#154501 - Fileopen PPTX: Table with rotated text wrong regression from commit eec42f0dbcc79a4c9f456ce97fa1066b8031ea28 Author: Noel Grandin Date: Sun Aug 15 17:35:58 2021 +0200 pass OutlinerParaObject around by value where some of code I converted needed to be mutating the OutlinerParaObject that something else held, rather than mutating a local copy. Change-Id: Ib91dddb3fc0d4190868f9fd59becb0d366af5e19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150376 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index c39ac6ae7afd..97490977a50e 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -309,14 +309,13 @@ namespace sdr::properties rObj.SetVerticalWriting(bVertical); // Set a cell vertical property -std::optional pParaObj = mxCell->CreateEditOutlinerParaObject(); - -if( !pParaObj && mxCell->GetOutlinerParaObject() ) -pParaObj = *mxCell->GetOutlinerParaObject(); +std::optional pEditParaObj = mxCell->CreateEditOutlinerParaObject(); -if(pParaObj) +if( !pEditParaObj && mxCell->GetOutlinerParaObject() ) { -pParaObj->SetVertical(bVertical); +OutlinerParaObject* pParaObj = mxCell->GetOutlinerParaObject(); +if(pParaObj) +pParaObj->SetVertical(bVertical); } } @@ -325,22 +324,23 @@ namespace sdr::properties const SvxTextRotateItem* pRotateItem = static_cast(pNewItem); // Set a cell vertical property -std::optional pParaObj = mxCell->CreateEditOutlinerParaObject(); +std::optional pEditParaObj = mxCell->CreateEditOutlinerParaObject(); -if (!pParaObj && mxCell->GetOutlinerParaObject()) -pParaObj = *mxCell->GetOutlinerParaObject(); - -if (pParaObj) +if (!pEditParaObj && mxCell->GetOutlinerParaObject()) { -if(pRotateItem->IsVertical() && pRotateItem->IsTopToBottom()) -pParaObj->SetRotation(TextRotation::TOPTOBOTTOM); -else if (pRotateItem->IsVertical()) -pParaObj->SetRotation(TextRotation::BOTTOMTOTOP); -else -pParaObj->SetRotation(TextRotation::NONE); +OutlinerParaObject* pParaObj = mxCell->GetOutlinerParaObject(); +if (pParaObj) +{ +if(pRotateItem->IsVertical() && pRotateItem->IsTopToBottom()) +pParaObj->SetRotation(TextRotation::TOPTOBOTTOM); +else if (pRotateItem->IsVertical()) +pParaObj->SetRotation(TextRotation::BOTTOMTOTOP); +else +pParaObj->SetRotation(TextRotation::NONE); +} } - // Change autogrow direction +// Change autogrow direction SdrTextObj& rObj = static_cast(GetSdrObject()); // rescue object size