[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-09-30 Thread Caolán McNamara (via logerrit)
 svx/source/fmcomp/gridcell.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 7b2021a01303ef9efad652ddedea20758ce1f719
Author: Caolán McNamara 
AuthorDate: Wed Sep 29 09:53:28 2021 +0100
Commit: Michael Stahl 
CommitDate: Thu Sep 30 11:08:30 2021 +0200

Related: tdf#144139 use the classic size calculation

Change-Id: Iac3f9fb9fd6f92f8b17b1f2822dbc9743528cea9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122801
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index ca14d5f0fea3..fd2b83fe9040 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1719,10 +1719,16 @@ void DbCheckBox::PaintCell(OutputDevice& rDev, const 
tools::Rectangle& rRect)
 TriState eState = 
static_cast(m_pWindow.get())->GetState();
 
 MapMode aResMapMode(MapUnit::Map100thMM);
+Size aImageSize = rDev.LogicToPixel(Size(300, 300), aResMapMode);
 Size aBrd1Size = rDev.LogicToPixel(Size(20, 20), aResMapMode);
 Size aBrd2Size = rDev.LogicToPixel(Size(30, 30), aResMapMode);
 int nCheckWidth = rDev.LogicToPixel(Size(20, 20), 
aResMapMode).Width();
-tools::Rectangle aStateRect(rRect);
+
+tools::Rectangle aStateRect;
+aStateRect.SetLeft(rRect.Left() + ((rRect.GetWidth() - 
aImageSize.Width()) / 2));
+aStateRect.SetTop(rRect.Top() + ((rRect.GetHeight() - 
aImageSize.Height()) / 2));
+aStateRect.SetRight(aStateRect.Left() + aImageSize.Width() - 1);
+aStateRect.SetBottom(aStateRect.Top() + aImageSize.Height() - 1);
 
 rDev.Push();
 rDev.SetMapMode();


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-09-29 Thread Caolán McNamara (via logerrit)
 svx/source/fmcomp/gridcell.cxx |   97 -
 svx/source/inc/gridcell.hxx|1 
 2 files changed, 97 insertions(+), 1 deletion(-)

New commits:
commit 40268156401bf20f9ba9e66d4503a5242ec4502b
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 17:01:08 2021 +0100
Commit: Michael Stahl 
CommitDate: Wed Sep 29 10:53:11 2021 +0200

Resolves: tdf#144139 checkboxs in print output shouldn't be themed

this will avoid the crash under gtk

Change-Id: Ibbde5d64595d2fec1fa63756d628cf295dcdbb78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122793
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 625e34c3a3d9..ca14d5f0fea3 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -1681,7 +1681,23 @@ void DbCheckBox::PaintFieldToCell(OutputDevice& rDev, 
const tools::Rectangle& rR
 CheckBoxControl* pControl = 
static_cast(m_pPainter.get());
 lcl_setCheckBoxState( _rxField, pControl );
 
-Size aBoxSize = pControl->GetBox().get_preferred_size();
+Size aBoxSize;
+
+switch (rDev.GetOutDevType())
+{
+case OUTDEV_WINDOW:
+case OUTDEV_VIRDEV:
+aBoxSize = pControl->GetBox().get_preferred_size();
+break;
+case OUTDEV_PRINTER:
+case OUTDEV_PDF:
+{
+auto nSize = std::min(rRect.GetWidth(), rRect.GetHeight());
+aBoxSize = Size(nSize, nSize);
+break;
+}
+}
+
 tools::Rectangle aRect(Point(rRect.Left() + ((rRect.GetWidth() - 
aBoxSize.Width()) / 2),
  rRect.Top() + ((rRect.GetHeight() - 
aBoxSize.Height()) / 2)),
aBoxSize);
@@ -1689,6 +1705,85 @@ void DbCheckBox::PaintFieldToCell(OutputDevice& rDev, 
const tools::Rectangle& rR
 DbCellControl::PaintFieldToCell(rDev, aRect, _rxField, xFormatter);
 }
 
+void DbCheckBox::PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect)
+{
+switch (rDev.GetOutDevType())
+{
+case OUTDEV_WINDOW:
+case OUTDEV_VIRDEV:
+DbCellControl::PaintCell(rDev, rRect);
+break;
+case OUTDEV_PRINTER:
+case OUTDEV_PDF:
+{
+TriState eState = 
static_cast(m_pWindow.get())->GetState();
+
+MapMode aResMapMode(MapUnit::Map100thMM);
+Size aBrd1Size = rDev.LogicToPixel(Size(20, 20), aResMapMode);
+Size aBrd2Size = rDev.LogicToPixel(Size(30, 30), aResMapMode);
+int nCheckWidth = rDev.LogicToPixel(Size(20, 20), 
aResMapMode).Width();
+tools::Rectangle aStateRect(rRect);
+
+rDev.Push();
+rDev.SetMapMode();
+
+rDev.SetLineColor();
+rDev.SetFillColor(COL_BLACK);
+rDev.DrawRect(aStateRect);
+aStateRect.AdjustLeft(aBrd1Size.Width());
+aStateRect.AdjustTop(aBrd1Size.Height());
+aStateRect.AdjustRight(-aBrd1Size.Width());
+aStateRect.AdjustBottom(-aBrd1Size.Height());
+if (eState == TRISTATE_INDET)
+rDev.SetFillColor(COL_LIGHTGRAY);
+else
+rDev.SetFillColor(COL_WHITE);
+rDev.DrawRect(aStateRect);
+
+if (eState == TRISTATE_TRUE)
+{
+aStateRect.AdjustLeft(aBrd2Size.Width());
+aStateRect.AdjustTop(aBrd2Size.Height());
+aStateRect.AdjustRight(-aBrd2Size.Width());
+aStateRect.AdjustBottom(-aBrd2Size.Height());
+Point aPos11(aStateRect.TopLeft());
+Point aPos12(aStateRect.BottomRight());
+Point aPos21(aStateRect.TopRight());
+Point aPos22(aStateRect.BottomLeft());
+Point aTempPos11(aPos11);
+Point aTempPos12(aPos12);
+Point aTempPos21(aPos21);
+Point aTempPos22(aPos22);
+rDev.SetLineColor(COL_BLACK);
+int nDX = 0;
+for (int i = 0; i < nCheckWidth; i++)
+{
+if ( !(i % 2) )
+{
+aTempPos11.setX(aPos11.X() + nDX);
+aTempPos12.setX(aPos12.X() + nDX);
+aTempPos21.setX(aPos21.X() + nDX);
+aTempPos22.setX(aPos22.X() + nDX);
+}
+else
+{
+nDX++;
+aTempPos11.setX(aPos11.X() - nDX);
+aTempPos12.setX(aPos12.X() - nDX);
+aTempPos21.setX(aPos21.X() - nDX);
+aTempPos22.setX(aPos22.X() - nDX);
+}
+rDev.DrawLine(aTempPos11, aTempPos12);
+rDev.DrawLine(aTempPos21, aTempPos22);
+}
+

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-08-18 Thread Caolán McNamara (via logerrit)
 svx/source/accessibility/ChildrenManagerImpl.cxx |  135 ---
 1 file changed, 75 insertions(+), 60 deletions(-)

New commits:
commit d6fcc3fb03a7bc35eb35ab7948803ff2682507de
Author: Caolán McNamara 
AuthorDate: Tue Aug 17 15:43:00 2021 +0100
Commit: Michael Stahl 
CommitDate: Wed Aug 18 10:16:31 2021 +0200

Resolves: tdf#139220 with ~1000 selected shapes a11y UpdateSelection crawls

so fetch the selected shapes once and sort them for quick lookup in the
loop over maVisibleChildren.

As an side, not changed here, SvxShapeCollection::getByIndex looks
suboptimal with a body of

std::vector> 
aElements(maShapeContainer.getElements());
return uno::makeAny(Reference(aElements[Index].get()));

Change-Id: Idec7c003e7c5ee02000d4642d4fdb0d940548d97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120584
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx 
b/svx/source/accessibility/ChildrenManagerImpl.cxx
index 893bc350f1f1..507063e09c43 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -793,20 +794,6 @@ uno::Reference
 */
 void ChildrenManagerImpl::UpdateSelection()
 {
-Reference xController(maShapeTreeInfo.GetController());
-Reference xSelectionSupplier (
-xController, uno::UNO_QUERY);
-
-// Try to cast the selection both to a multi selection and to a single
-// selection.
-Reference xSelectedShapeAccess;
-Reference xSelectedShape;
-if (xSelectionSupplier.is())
-{
-xSelectedShapeAccess.set( xSelectionSupplier->getSelection(), 
uno::UNO_QUERY);
-xSelectedShape.set( xSelectionSupplier->getSelection(), 
uno::UNO_QUERY);
-}
-
 // Remember the current and new focused shape.
 AccessibleShape* pCurrentlyFocusedShape = nullptr;
 AccessibleShape* pNewFocusedShape = nullptr;
@@ -815,73 +802,101 @@ void ChildrenManagerImpl::UpdateSelection()
 VEC_SHAPE vecSelect;
 int nAddSelect=0;
 bool bHasSelectedShape=false;
-for (const auto& rChild : maVisibleChildren)
+if (!maVisibleChildren.empty())
 {
-AccessibleShape* pAccessibleShape = rChild.GetAccessibleShape();
-if (rChild.mxAccessibleShape.is() && rChild.mxShape.is() && 
pAccessibleShape!=nullptr)
+Reference 
xController(maShapeTreeInfo.GetController());
+Reference xSelectionSupplier (
+xController, uno::UNO_QUERY);
+
+// Try to cast the selection both to a multi selection and to a single
+// selection.
+Reference xSelectedShapeAccess;
+Reference xSelectedShape;
+if (xSelectionSupplier.is())
 {
-short nRole = pAccessibleShape->getAccessibleRole();
-bool bDrawShape = (
-nRole == AccessibleRole::GRAPHIC ||
-nRole == AccessibleRole::EMBEDDED_OBJECT ||
-nRole == AccessibleRole::SHAPE ||
-nRole == AccessibleRole::IMAGE_MAP ||
-nRole == AccessibleRole::TABLE_CELL ||
-nRole == AccessibleRole::TABLE );
-bool bShapeIsSelected = false;
-
-// Look up the shape in the (single or multi-) selection.
-if (xSelectedShape.is())
+xSelectedShapeAccess.set( xSelectionSupplier->getSelection(), 
uno::UNO_QUERY);
+xSelectedShape.set( xSelectionSupplier->getSelection(), 
uno::UNO_QUERY);
+}
+
+// tdf#139220 to quickly find if a given drawing::XShape is selected
+o3tl::sorted_vector> 
aSortedSelectedShapes;
+if (!xSelectedShape.is() && xSelectedShapeAccess.is())
+{
+sal_Int32 nCount = xSelectedShapeAccess->getCount();
+aSortedSelectedShapes.reserve(nCount);
+for (sal_Int32 i = 0; i < nCount; ++i)
 {
-if  (rChild.mxShape == xSelectedShape)
-{
-bShapeIsSelected = true;
-pNewFocusedShape = pAccessibleShape;
-}
+css::uno::Reference 
xShape(xSelectedShapeAccess->getByIndex(i), uno::UNO_QUERY);
+aSortedSelectedShapes.insert(xShape);
 }
-else if (xSelectedShapeAccess.is())
+}
+
+for (const auto& rChild : maVisibleChildren)
+{
+AccessibleShape* pAccessibleShape = rChild.GetAccessibleShape();
+if (rChild.mxAccessibleShape.is() && rChild.mxShape.is() && 
pAccessibleShape!=nullptr)
 {
-sal_Int32 nCount=xSelectedShapeAccess->getCount();
-for (sal_Int32 i=0; igetByIndex(i) == rChild.mxShape)
+short nRole = pAccessibleShape->getAccessibleRole();
+bool bDrawShape = (
+nRole == A

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-08-11 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/fillctrl.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b79925cb839093aa11e21e618318bd23630d0b65
Author: Caolán McNamara 
AuthorDate: Tue Aug 10 21:58:27 2021 +0100
Commit: Michael Stahl 
CommitDate: Wed Aug 11 15:15:55 2021 +0200

tdf#143769 don't crash on null XFillColorItem

use same solution as:

commit 5ee0e6ab93ad791f5e79506efafd16cb7364ffb1
Author: Markus Mohrhard 
Date:   Tue Jul 21 19:01:26 2015 +0200

avoid crash with color listbox for now

Change-Id: I36ac6513546961ec8d8d1e9437a8ef88574acbf4

Change-Id: I46c55461e5867431a6e9c838b5ef462f9581eb28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120248
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 788a8fe1c1a1..e327be070b16 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -700,10 +700,11 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, 
weld::ComboBox&, void)
 {
 mpLbFillAttr->hide();
 mpToolBoxColor->show();
-const ::Color aColor = mpColorItem->GetColorValue();
-const XFillColorItem aXFillColorItem( "", aColor );
 if (pSh)
 {
+const ::Color aColor = mpColorItem ? 
mpColorItem->GetColorValue() : COL_AUTO;
+const XFillColorItem aXFillColorItem( "", aColor );
+
 // #i122676# change FillStyle and Color in one call
 pSh->GetDispatcher()->ExecuteList(
 SID_ATTR_FILL_COLOR, SfxCallMode::RECORD,


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-07-16 Thread Eike Rathke (via logerrit)
 svx/source/dialog/langbox.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d82896f74d703bd9122eebc63ee9338328aadc43
Author: Eike Rathke 
AuthorDate: Thu Jul 15 23:53:04 2021 +0200
Commit: Caolán McNamara 
CommitDate: Fri Jul 16 10:17:55 2021 +0200

Resolves: tdf#143372 Exclude {qtz} KeyID from SvxLanguageBox list

Change-Id: I3e52407a33f79713635063ff4ba374267eb98005
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119002
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit da13b76e07231131cb951868a314ee6f51c0f254)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118928
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 5b7526d94084..9e9863cb1408 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -95,6 +95,7 @@ bool lcl_isPrerequisite( LanguageType nLangType )
 nLangType != LANGUAGE_DONTKNOW &&
 nLangType != LANGUAGE_SYSTEM &&
 nLangType != LANGUAGE_NONE &&
+nLangType != LANGUAGE_USER_KEYID &&
 !MsLangId::isLegacy( nLangType) &&
 MsLangId::getSubLanguage( nLangType);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-07-09 Thread Caolán McNamara (via logerrit)
 svx/source/accessibility/GraphCtlAccessibleContext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b8dbe5fe8445cacca919a04611bb09ac4c15937d
Author: Caolán McNamara 
AuthorDate: Thu Jul 8 10:04:10 2021 +0100
Commit: Michael Stahl 
CommitDate: Fri Jul 9 11:18:47 2021 +0200

return value of PixelToLogic ignored

the other uses of SdrObjListPrimitiveHit operate in Logic Position

Change-Id: Id6a834a17e6e2252bd4f58d10cd95f7425191203
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118615
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx 
b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index ffe195b4d990..25a271063bc5 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -176,7 +176,7 @@ Reference< XAccessible > SAL_CALL 
SvxGraphCtrlAccessibleContext::getAccessibleAt
 }
 
 Point aPnt( rPoint.X, rPoint.Y );
-mpControl->GetDrawingArea()->get_ref_device().PixelToLogic( aPnt );
+aPnt = mpControl->GetDrawingArea()->get_ref_device().PixelToLogic(aPnt);
 
 SdrObject* pObj = nullptr;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-07-01 Thread Caolán McNamara (via logerrit)
 svx/source/dialog/weldeditview.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 553b7a044c83498288227e261f1de918db6cd421
Author: Caolán McNamara 
AuthorDate: Tue Jun 29 11:20:40 2021 +0100
Commit: Michael Stahl 
CommitDate: Thu Jul 1 11:46:19 2021 +0200

Related: tdf#143088 return early on notification from frozen editengine

processing EE_NOTIFY_PROCESSNOTIFICATIONS from an EditEngine with an
UpdateMode mode of false will just to on to cause
AccessibleTextHelper_Impl::GetTextForwarder to throw an exception as a
Frozen EditEngine is considered Invalid so return early instead

Change-Id: I86f9647b7bf839cf3c7cf2f029be8c7c5aeef1f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118071
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/svx/source/dialog/weldeditview.cxx 
b/svx/source/dialog/weldeditview.cxx
index 1a315930c332..56ce13f12c3a 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -769,6 +769,19 @@ WeldTextForwarder::~WeldTextForwarder()
 
 IMPL_LINK(WeldTextForwarder, NotifyHdl, EENotify&, rNotify, void)
 {
+if (EditEngine* pEditEngine = m_rEditAcc.GetEditEngine())
+{
+if (rNotify.eNotificationType == EE_NOTIFY_PROCESSNOTIFICATIONS
+&& !pEditEngine->GetUpdateMode())
+{
+// tdf#143088 an UpdateMode of false will just to on to cause
+// AccessibleTextHelper_Impl::GetTextForwarder to throw an
+// exception as a Frozen EditEngine is considered Invalid so return
+// early instead
+return;
+}
+}
+
 ::std::unique_ptr aHint = 
SvxEditSourceHelper::EENotification2Hint(&rNotify);
 if (aHint)
 m_rEditSource.GetBroadcaster().Broadcast(*aHint);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source svx/uiconfig

2021-06-21 Thread Katarina Behrens (via logerrit)
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |2 +-
 svx/uiconfig/ui/sidebarpossize.ui   |1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5a15f6dc15449fd83949fbff296fe2f72c20639f
Author: Katarina Behrens 
AuthorDate: Fri Jun 18 09:48:25 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Jun 21 12:31:59 2021 +0200

tdf#141311: Rotation spinbox in sidebar used to have 2 decimal places

regression from weld-ing (c85fcc6e1994eb8e079aaca85066ab4d67149c15)

Change-Id: Iad0725fd4542ecdddb65092846dbf9d103016d9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117408
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 
(cherry picked from commit 7a717c8b9319edcc12e50ab78554b8e0e7049cbf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117419
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit 1bec8a3d3b16bb8881bd49f58d8786421ff5f839)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117554
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx 
b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index aac8619a448e..b1ac16b96643 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -213,7 +213,7 @@ void PosSizePropertyPanel::Initialize()
 mxCbxScale->connect_toggled( LINK( this, PosSizePropertyPanel, 
ClickAutoHdl ) );
 
 //rotation control
-mxCtrlDial->SetLinkedField(mxMtrAngle.get());
+mxCtrlDial->SetLinkedField(mxMtrAngle.get(), 2);
 mxCtrlDial->SetModifyHdl(LINK( this, PosSizePropertyPanel, RotationHdl));
 
 //use same logic as DialControl_Impl::SetSize
diff --git a/svx/uiconfig/ui/sidebarpossize.ui 
b/svx/uiconfig/ui/sidebarpossize.ui
index b507f2bca7fa..94dade3d1f89 100644
--- a/svx/uiconfig/ui/sidebarpossize.ui
+++ b/svx/uiconfig/ui/sidebarpossize.ui
@@ -400,6 +400,7 @@
 True
 Select the angle for 
rotation.
 True
+2
 adjustmentSpinDegrees
 True
 True
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-06-15 Thread Caolán McNamara (via logerrit)
 svx/source/sidebar/shapes/DefaultShapesPanel.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit ea48cb21bb3b5f8a4f1a01987d393bddb9985a8e
Author: Caolán McNamara 
AuthorDate: Mon Jun 14 14:39:05 2021 +0100
Commit: Xisco Fauli 
CommitDate: Tue Jun 15 09:41:09 2021 +0200

Resolves: tdf#142767 cannot use itemid of 0 in ValueSets

Change-Id: I2c2b655b512e4e7869fe3784f1b073ecdbd0dac9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117123
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx 
b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
index 3d52ae23fb0d..cbbde9196953 100644
--- a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
+++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
@@ -130,8 +130,8 @@ IMPL_LINK(DefaultShapesPanel, ShapeSelectHdl, ValueSet*, 
rValueSet, void)
 {
 if(rValueSet == aSetMap.first)
 {
-int aSelection = aSetMap.first->GetSelectedItemId();
-comphelper::dispatchCommand(aSetMap.second[aSelection], {});
+sal_uInt16 nSelectionId = aSetMap.first->GetSelectedItemId();
+comphelper::dispatchCommand(aSetMap.second[nSelectionId - 1], {});
 }
 else
 aSetMap.first->SetNoSelection();
@@ -152,7 +152,8 @@ void DefaultShapesPanel::populateShapes()
 auto aProperties = 
vcl::CommandInfoProvider::GetCommandProperties(sSlotStr,
 vcl::CommandInfoProvider::GetModuleIdentifier(mxFrame));
 sLabel = vcl::CommandInfoProvider::GetTooltipForCommand(sSlotStr, 
aProperties, mxFrame);
-aSet.first->InsertItem(i, aSlotImage, sLabel);
+sal_uInt16 nSelectionId = i + 1; // tdf#142767 id 0 is reserved 
for nothing-selected
+aSet.first->InsertItem(nSelectionId, aSlotImage, sLabel);
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-05-05 Thread Miklos Vajna (via logerrit)
 svx/source/table/tablecontroller.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 181b5538f6bdbd1d5d2f906a1ad4bc8d0a70a043
Author: Miklos Vajna 
AuthorDate: Mon May 3 20:49:08 2021 +0200
Commit: Michael Stahl 
CommitDate: Wed May 5 10:27:40 2021 +0200

tdf#139500 svx: fix crash on changing table properties during active text 
edit

Regression from commit fdeb04f7c59cf8032fe17072ed779e70505cc6ab
(tdf#129961 svx: finish UI for table shadow as direct format,
2020-12-15), the problem was that the BegUndo() / EndUndo() pair can be
only used if we know that the text edit of a cell of a table shape is
not started or ended in-between.

The bugreport scenario was an active text edit, where setting attributes
on the shape ends the text edit:

#9 0x7f6dbb417121 in SdrEditView::EndTextEditAllViews() const 
/svx/source/svdraw/svdedtv.cxx:1079:20
#10 0x7f6dbb466798 in SdrEditView::SetAttrToMarked(SfxItemSet const&, 
bool) /svx/source/svdraw/svdedtv1.cxx:1095:9
#11 0x7f6dbc34b0af in 
sdr::table::SvxTableController::SetAttrToSelectedShape(SfxItemSet const&) 
/svx/source/table/tablecontroller.cxx:2738:12

Which also means that the underlying edit engine is deleted. But then
undo/redo would still reference that edit engine:

==31830==ERROR: AddressSanitizer: heap-use-after-free on address 
0x60c0001fc300 at pc 0x7f6dd73a9cb9 bp 0x7fff788db4b0 sp 0x7fff788db4a8
READ of size 8 at 0x60c0001fc300 thread T0
#0 0x7f6dd73a9cb8 in EditUndo::GetComment() const 
/editeng/source/editeng/editundo.cxx:147:34

Fix the problem by not grouping in case there is an active text edit,
that's not something I considered when I added the original grouping.

(cherry picked from commit ece86ef173cbc070c76f180d02ac80c65e07fff9)

Change-Id: I4f3583e21a27f8380c35b3f4563ce496819bcb81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114929
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 429b2e58da43..75c49f599e02 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -982,7 +982,7 @@ void SvxTableController::onFormatTable(const SfxRequest& 
rReq)
 // Create a single undo action when applying the result of the 
dialog.
 SdrTableObj& rTableObject(*mxTableObj);
 SdrModel& rSdrModel(rTableObject.getSdrModelFromSdrObject());
-bool bUndo = rSdrModel.IsUndoEnabled();
+bool bUndo = rSdrModel.IsUndoEnabled() && !mrView.IsTextEdit();
 if (bUndo)
 {
 rSdrModel.BegUndo(SvxResId(STR_TABLE_NUMFORMAT));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-04-22 Thread Caolán McNamara (via logerrit)
 svx/source/dialog/fntctrl.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 40868f520f9da24d3eaa5e0489da8657bc8383b4
Author: Caolán McNamara 
AuthorDate: Wed Apr 21 15:53:13 2021 +0100
Commit: Xisco Fauli 
CommitDate: Thu Apr 22 09:57:32 2021 +0200

tdf#141419 restore use any explicitly set background color in previews

regression since...

commit 6f3899b27156591e65f62649a92c727eb6f5dd03
Date:   Thu Oct 29 15:03:44 2020 +0100

Resolves tdf#137059 - Use application colors for font preview

but continue to use the doc-color setting when there isn't an explicit
bg setting in the input propertyset

Change-Id: I531b5ddea7700fcd4a731f32d4830b4d0b767d7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114418
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 1b2eb421aad3..26e44a29939a 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -1008,6 +1008,16 @@ void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet 
&rSet, bool bPreviewBack
 rCJKFont.SetTransparent( bTransparent );
 rCTLFont.SetTransparent( bTransparent );
 
+if( !bPreviewBackgroundToCharacter )
+{
+if( GetWhich( rSet, SID_ATTR_BRUSH, nWhich ) )
+{
+const SvxBrushItem& rBrush = static_cast( 
rSet.Get( nWhich ) );
+if( GPOS_NONE == rBrush.GetGraphicPos() )
+pImpl->mxBackColor = rBrush.GetColor();
+}
+}
+
 // Font
 SetPrevFont( rSet, SID_ATTR_CHAR_FONT, rFont );
 SetPrevFont( rSet, SID_ATTR_CHAR_CJK_FONT, rCJKFont );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-04-21 Thread Michael Stahl (via logerrit)
 svx/source/sdr/properties/defaultproperties.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit ecfa3da07e5b68a4bc24f25d3760e72efc42fe92
Author: Michael Stahl 
AuthorDate: Fri Apr 16 16:21:26 2021 +0200
Commit: Caolán McNamara 
CommitDate: Wed Apr 21 20:53:37 2021 +0200

svx: fix crash in DefaultProperties::dumpAsXml()

mpItemSet can be null

Change-Id: I4192f84639116c550bba5303a5fc70528cb3e8c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114263
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 832b23d9376019619929764606276aacde1e329a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114268
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/sdr/properties/defaultproperties.cxx 
b/svx/source/sdr/properties/defaultproperties.cxx
index e9a9934a9973..9244356af297 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -246,7 +246,10 @@ namespace sdr::properties
 {
 xmlTextWriterStartElement(pWriter, BAD_CAST("DefaultProperties"));
 BaseProperties::dumpAsXml(pWriter);
-mpItemSet->dumpAsXml(pWriter);
+if (mpItemSet)
+{
+mpItemSet->dumpAsXml(pWriter);
+}
 xmlTextWriterEndElement(pWriter);
 }
 } // end of namespace
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-04-21 Thread Samuel Mehrbrodt (via logerrit)
 svx/source/form/fmview.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 966061fa7c02c9dd8d089db2d56ee95667009d26
Author: Samuel Mehrbrodt 
AuthorDate: Wed Apr 21 14:15:07 2021 +0200
Commit: Caolán McNamara 
CommitDate: Wed Apr 21 20:52:29 2021 +0200

Related tdf#139804 Allow activating btn on first click

Change-Id: I3bcdf8bdd6f25fd30106214f40e72bf1506f6bbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114398
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit 8d633320df3fb58e6e9ac12dcf9983ad5d5db75e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114416
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 79651f7ab732..8de9b531950f 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -516,6 +516,7 @@ bool FmFormView::KeyInput(const KeyEvent& rKEvt, 
vcl::Window* pWin)
 if (rI18nHelper.MatchMnemonic(pWindow->GetText(), 
rKEvt.GetCharCode()))
 {
 pWindow->GrabFocus();
+pWindow->KeyInput(rKEvt);
 bDone = true;
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-04-21 Thread Caolán McNamara (via logerrit)
 svx/source/form/fmview.cxx |   34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

New commits:
commit 1b06eb6c96ecfe0c39f50889797ddbf6b839a9e6
Author: Caolán McNamara 
AuthorDate: Fri Mar 19 15:32:53 2021 +
Commit: Samuel Mehrbrodt 
CommitDate: Wed Apr 21 13:24:11 2021 +0200

cid#1474166 Deference null return value

Change-Id: I725eff105f963b139ae8646cd1cb193ce737d313
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112760
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 229558c0bf257e4e559cc1b84bd2918b04c68305)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114365
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 3a4b443f4541..79651f7ab732 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -499,24 +499,26 @@ bool FmFormView::KeyInput(const KeyEvent& rKEvt, 
vcl::Window* pWin)
 // tdf#139804 Allow selecting form controls with Alt-
 if (rKeyCode.IsMod2() && rKeyCode.GetCode())
 {
-FmFormPage* pCurPage = GetCurPage();
-for (size_t a = 0; a < pCurPage->GetObjCount(); ++a)
+if (FmFormPage* pCurPage = GetCurPage())
 {
-SdrObject* pObj = pCurPage->GetObj(a);
-FmFormObj* pFormObject = FmFormObj::GetFormObject(pObj);
-if (!pFormObject)
-continue;
-
-Reference xControl = 
pFormObject->GetUnoControl(*this, *pWin);
-if (!xControl.is())
-continue;
-const vcl::I18nHelper& rI18nHelper = 
Application::GetSettings().GetUILocaleI18nHelper();
-VclPtr pWindow = 
VCLUnoHelper::GetWindow(xControl->getPeer());
-if (rI18nHelper.MatchMnemonic(pWindow->GetText(), 
rKEvt.GetCharCode()))
+for (size_t a = 0; a < pCurPage->GetObjCount(); ++a)
 {
-pWindow->GrabFocus();
-bDone = true;
-break;
+SdrObject* pObj = pCurPage->GetObj(a);
+FmFormObj* pFormObject = FmFormObj::GetFormObject(pObj);
+if (!pFormObject)
+continue;
+
+Reference xControl = 
pFormObject->GetUnoControl(*this, *pWin);
+if (!xControl.is())
+continue;
+const vcl::I18nHelper& rI18nHelper = 
Application::GetSettings().GetUILocaleI18nHelper();
+VclPtr pWindow = 
VCLUnoHelper::GetWindow(xControl->getPeer());
+if (rI18nHelper.MatchMnemonic(pWindow->GetText(), 
rKEvt.GetCharCode()))
+{
+pWindow->GrabFocus();
+bDone = true;
+break;
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-04-10 Thread Caolán McNamara (via logerrit)
 svx/source/dialog/frmsel.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit b606a278aac6ccc395a26bbb6b7a8a5eae91a809
Author: Caolán McNamara 
AuthorDate: Fri Apr 9 20:50:58 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Apr 10 18:01:25 2021 +0200

Resolves: tdf#139075 diagonal focus rects contain focus rects of old size

since...

commit 356f6c5d89dd4dd92b2351898e07f99b96cb34cc
Date:   Tue Jan 15 08:55:00 2013 +

teach FrameSelector to be resizable

Change-Id: I5ac4d1d12f60086349e7dbb3b78d29977f22c226
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113856
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 8854f7d8272c..a7ea0ebedce7 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -413,6 +413,9 @@ void FrameSelectorImpl::InitBorderGeometry()
 maHor.AddFocusPolygon(tools::Rectangle( mnLine1 - mnFocusOffs, mnLine2 
- mnFocusOffs, mnLine3 + mnFocusOffs, mnLine2 + mnFocusOffs ) );
 maBottom.AddFocusPolygon( tools::Rectangle( mnLine1 - mnFocusOffs, mnLine3 
- mnFocusOffs, mnLine3 + mnFocusOffs, mnLine3 + mnFocusOffs ) );
 
+maTLBR.ClearFocusArea();
+maBLTR.ClearFocusArea();
+
 for( nCol = 0, nCols = maArray.GetColCount(); nCol < nCols; ++nCol )
 {
 for( nRow = 0, nRows = maArray.GetRowCount(); nRow < nRows; ++nRow )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-04-06 Thread Arnaud Versini (via logerrit)
 svx/source/svdraw/svdograf.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 6494b99f09a29c22d51fb898423ced36ce02a9e7
Author: Arnaud Versini 
AuthorDate: Mon Apr 5 12:33:11 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Apr 6 21:16:43 2021 +0200

tdf#141297 : remove link to the file

Change-Id: I5c14f46f5fbd51d95eeb58ea0a6d3aa39afef3cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113597
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 7289b9a90f5f8349875856c552330d512004925e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113642
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index f175f9c33181..6bf317f29c02 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -498,6 +498,10 @@ void SdrGrafObj::ReleaseGraphicLink()
 ImpDeregisterLink();
 aFileName.clear();
 aFilterName.clear();
+
+auto aGraphic = mpGraphicObject->GetGraphic();
+aGraphic.setOriginURL("");
+SetGraphic(aGraphic);
 }
 
 bool SdrGrafObj::IsLinkedGraphic() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-02-16 Thread Gülşah Köse (via logerrit)
 svx/source/table/tablelayouter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1fe55d946f8f2adf4a2588dcc7d089b79611eddd
Author: Gülşah Köse 
AuthorDate: Wed Feb 10 08:49:28 2021 +0300
Commit: Xisco Fauli 
CommitDate: Tue Feb 16 12:01:29 2021 +0100

tdf#139511 Correct calculation of minimum row height during resize.

Change-Id: Id47b5877d56850c80395897a83daae8e24f5c099
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110662
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110974

diff --git a/svx/source/table/tablelayouter.cxx 
b/svx/source/table/tablelayouter.cxx
index 80d0a52f4db2..2d8de0c1f8e2 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -789,7 +789,7 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& 
rArea, bool bFit )
 // Case 2: * Row has "Height" property
 // * Calculated minimum height is bigger than 
Height property value and
 // * Row has not any text of any cell in edit 
mode in the row (means completely empty)
-if ((nMinHeight < nRowPropHeight && nRowPropHeight > 0 ) ||
+if ((nMinHeight < nRowPropHeight && nRowPropHeight > 0 && 
(bRowHasText || bRowHasCellInEditMode)) ||
 (nMinHeight > nRowPropHeight && nRowPropHeight > 0 && 
(!bRowHasText && !bRowHasCellInEditMode)))
 {
 nMinHeight = nRowPropHeight;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-02-13 Thread Caolán McNamara (via logerrit)
 svx/source/form/navigatortree.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit dc19de67d6c7f30157b7196773589bba30d9e02f
Author: Caolán McNamara 
AuthorDate: Thu Feb 11 13:11:54 2021 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Feb 13 16:14:08 2021 +0100

tdf#140274 set an initial minimum size

Change-Id: I93f0ac3d63b4864a0a5d98370407f9444b58b75c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110687
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svx/source/form/navigatortree.cxx 
b/svx/source/form/navigatortree.cxx
index 310a1dd1b507..6dee1b1dc000 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -146,6 +146,7 @@ namespace svxform
 ,m_bEditing( false )
 {
 m_xTreeView->set_help_id(HID_FORM_NAVIGATOR);
+m_xTreeView->set_size_request(200, 200);
 
 m_xTreeView->set_selection_mode(SelectionMode::Multiple);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-01-27 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 17d27a27bc12b24ef48aef4722ab104b16eb50d2
Author: Caolán McNamara 
AuthorDate: Tue Jan 26 20:44:50 2021 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Jan 27 18:07:18 2021 +0100

tdf#138590 use the highlighted menu entry, not the combobox active text

Change-Id: I2fb68c1491d129d5fd9b963ae4db1fb83171a154
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109981
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 954ebcf563e4..445e557bb57e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -207,6 +207,7 @@ protected:
 
 SfxStyleFamily  eStyleFamily;
 int m_nMaxUserDrawFontWidth;
+int m_nLastItemWithMenu;
 boolbRelease;
 Reference< XDispatchProvider >  m_xDispatchProvider;
 Reference< XFrame > m_xFrame;
@@ -844,6 +845,7 @@ 
SvxStyleBox_Base::SvxStyleBox_Base(std::unique_ptr xWidget,
 , m_xWidget(std::move(xWidget))
 , eStyleFamily( eFamily )
 , m_nMaxUserDrawFontWidth(0)
+, m_nLastItemWithMenu(-1)
 , bRelease( true )
 , m_xDispatchProvider( rDispatchProvider )
 , m_xFrame(_xFrame)
@@ -905,7 +907,10 @@ void SvxStyleBox_Base::ReleaseFocus()
 
 IMPL_LINK(SvxStyleBox_Base, MenuSelectHdl, const OString&, rMenuIdent, void)
 {
-OUString sEntry = m_xWidget->get_active_text();
+if (m_nLastItemWithMenu < 0 || m_nLastItemWithMenu >= 
m_xWidget->get_count())
+return;
+
+OUString sEntry = m_xWidget->get_text(m_nLastItemWithMenu);
 
 ReleaseFocus(); // It must be after getting entry pos!
 Sequence aArgs(2);
@@ -1141,7 +1146,10 @@ void SvxStyleBox_Base::SetupEntry(vcl::RenderContext& 
rRenderContext, sal_Int32
 if (nItem == 0 || nItem == m_xWidget->get_count() - 1)
 m_xWidget->set_item_menu(OString::number(nItem), nullptr);
 else
+{
+m_nLastItemWithMenu = nItem;
 m_xWidget->set_item_menu(OString::number(nItem), m_xMenu.get());
+}
 }
 
 if (nItem <= 0 || nItem >= m_xWidget->get_count() - 1)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-01-13 Thread Regina Henschel (via logerrit)
 svx/source/svdraw/svdpagv.cxx |   18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 6bb252e26ce1aeb3949c64ec6f0bef502a6a459d
Author: Regina Henschel 
AuthorDate: Fri Jan 8 18:26:38 2021 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 14 08:35:36 2021 +0100

tdf#137083 consider negative width in DrawPageViewGrid

SdrPageView::DrawPageViewGrid is called too for a ScDrawPage of a
RTL-sheet. In that case both the width of the SdrPage and the left
edge of the passed rectangle are negative. The x-values for drawing
the grid were wrong and a right-to-left sheet did not show the grid.
The patch adds a case distinction with correct x-values for case RTL.

Change-Id: I6d0c15bf7bbe8aff6ab2e72a440ba81f2e0e2281
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108989
Tested-by: Jenkins
Reviewed-by: Regina Henschel 
(cherry picked from commit 7635a475130a0e9e3b0dded853348659d07a00d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109119
Reviewed-by: Xisco Fauli 

diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index 0db7711890e0..c793d453734f 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -439,10 +439,20 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, 
const tools::Rectangle& r
 tools::Long nWrX=0;
 tools::Long nWrY=0;
 Point aOrg(aPgOrg);
-tools::Long x1=GetPage()->GetLeftBorder()+1+nWrX;
-tools::Long x2=GetPage()->GetWidth()-GetPage()->GetRightBorder()-1+nWrY;
-tools::Long y1=GetPage()->GetUpperBorder()+1+nWrX;
-tools::Long y2=GetPage()->GetHeight()-GetPage()->GetLowerBorder()-1+nWrY;
+tools::Long x1 = 0;
+tools::Long x2 = 0;
+if (GetPage()->GetWidth() < 0) // ScDrawPage of RTL sheet
+{
+x1 = GetPage()->GetWidth() + GetPage()->GetLeftBorder() + 1;
+x2 = - GetPage()->GetRightBorder() - 1;
+}
+else
+{
+x1 = GetPage()->GetLeftBorder() + 1;
+x2 = GetPage()->GetWidth() - GetPage()->GetRightBorder() - 1;
+}
+tools::Long y1 = GetPage()->GetUpperBorder() + 1;
+tools::Long y2 = GetPage()->GetHeight() - GetPage()->GetLowerBorder() - 1;
 const SdrPageGridFrameList* 
pFrames=GetPage()->GetGridFrameList(this,nullptr);
 
 sal_uInt16 nGridPaintCnt=1;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-01-12 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/fillctrl.cxx |   40 +--
 1 file changed, 22 insertions(+), 18 deletions(-)

New commits:
commit ec542cd17d376b0cfabc0a5cf82edd1fd3012350
Author: Caolán McNamara 
AuthorDate: Mon Jan 11 10:50:59 2021 +
Commit: Michael Stahl 
CommitDate: Tue Jan 12 11:13:58 2021 +0100

rhbz#1913070 null deref

its plausible that SfxViewFrame::Current() has returned null, use
pSh->GetDispatcher() instead protected by null check against pSh

Change-Id: Ibefdcabea09cb3a1a411678585af33a99f8a1c61
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109003
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index d0301b5d3b8c..788a8fe1c1a1 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -687,11 +687,13 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, 
weld::ComboBox&, void)
 mpLbFillAttr->show();
 mpToolBoxColor->hide();
 mpLbFillAttr->set_sensitive(false);
-
-// #i122676# need to call a single SID_ATTR_FILL_STYLE change
-SfxViewFrame::Current()->GetDispatcher()->ExecuteList(
-SID_ATTR_FILL_STYLE, SfxCallMode::RECORD,
-{ &aXFillStyleItem });
+if (pSh)
+{
+// #i122676# need to call a single SID_ATTR_FILL_STYLE change
+pSh->GetDispatcher()->ExecuteList(
+SID_ATTR_FILL_STYLE, SfxCallMode::RECORD,
+{ &aXFillStyleItem });
+}
 break;
 }
 case drawing::FillStyle_SOLID:
@@ -700,11 +702,13 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, 
weld::ComboBox&, void)
 mpToolBoxColor->show();
 const ::Color aColor = mpColorItem->GetColorValue();
 const XFillColorItem aXFillColorItem( "", aColor );
-
-// #i122676# change FillStyle and Color in one call
-SfxViewFrame::Current()->GetDispatcher()->ExecuteList(
-SID_ATTR_FILL_COLOR, SfxCallMode::RECORD,
-{ &aXFillColorItem, &aXFillStyleItem });
+if (pSh)
+{
+// #i122676# change FillStyle and Color in one call
+pSh->GetDispatcher()->ExecuteList(
+SID_ATTR_FILL_COLOR, SfxCallMode::RECORD,
+{ &aXFillColorItem, &aXFillStyleItem });
+}
 break;
 }
 case drawing::FillStyle_GRADIENT:
@@ -731,7 +735,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, 
weld::ComboBox&, void)
 const XFillGradientItem 
aXFillGradientItem(mpLbFillAttr->get_text(mnLastPosGradient), aGradient);
 
 // #i122676# change FillStyle and Gradient in one call
-SfxViewFrame::Current()->GetDispatcher()->ExecuteList(
+pSh->GetDispatcher()->ExecuteList(
 SID_ATTR_FILL_GRADIENT, SfxCallMode::RECORD,
 { &aXFillGradientItem, &aXFillStyleItem });
 mpLbFillAttr->set_active(mnLastPosGradient);
@@ -768,7 +772,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, 
weld::ComboBox&, void)
 const XFillHatchItem 
aXFillHatchItem(mpLbFillAttr->get_active_text(), aHatch);
 
 // #i122676# change FillStyle and Hatch in one call
-SfxViewFrame::Current()->GetDispatcher()->ExecuteList(
+pSh->GetDispatcher()->ExecuteList(
 SID_ATTR_FILL_HATCH, SfxCallMode::RECORD,
 { &aXFillHatchItem, &aXFillStyleItem });
 mpLbFillAttr->set_active(mnLastPosHatch);
@@ -805,7 +809,7 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, 
weld::ComboBox&, void)
 const XFillBitmapItem 
aXFillBitmapItem(mpLbFillAttr->get_active_text(), 
pXBitmapEntry->GetGraphicObject());
 
 // #i122676# change FillStyle and Bitmap in one call
-SfxViewFrame::Current()->GetDispatcher()->ExecuteList(
+pSh->GetDispatcher()->ExecuteList(
 SID_ATTR_FILL_BITMAP, SfxCallMode::RECORD,
 { &aXFillBitmapItem, &aXFillStyleItem });
 mpLbFillAttr->set_active(mnLastPosBitmap);
@@ -839,10 +843,10 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillAttrHdl, 
weld::ComboBox&, void)
 {
 case drawing::FillStyle_SOLID:
 {
-if(bFillStyleChange)
+if (bFillStyleChange && pSh)
 {
 // #i122676# Single FillStyle change call needed here
-SfxViewFrame::Current()->GetDispatcher()->ExecuteList(
+

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2020-12-10 Thread Heiko Tietze (via logerrit)
 svx/source/dialog/frmsel.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit f527846ab9a67387909d225aaeb77301d2b48d5a
Author: Heiko Tietze 
AuthorDate: Wed Nov 11 11:25:40 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Dec 10 10:42:28 2020 +0100

Resolves tdf#138127 - Use document color for border widget

Change-Id: I57fdbd37c23f3bd2c20ac04ef598cd8a182aac6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105577
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
(cherry picked from commit 6f7d1aaa8c375e6b7a9b80d1ae57efc176c6430f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107388
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 78b4f77025fe..8854f7d8272c 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -297,11 +298,12 @@ void FrameSelectorImpl::Initialize( FrameSelFlags nFlags )
 void FrameSelectorImpl::InitColors()
 {
 const StyleSettings& rSettings = 
Application::GetSettings().GetStyleSettings();
-maBackCol = rSettings.GetFieldColor();
+svtools::ColorConfig aColorConfig;
+maBackCol = aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor;
 mbHCMode = rSettings.GetHighContrastMode();
-maArrowCol = rSettings.GetFieldTextColor();
-maMarkCol.operator=(maBackCol).Merge(maArrowCol, mbHCMode ? 0x80 : 0xC0);
-maHCLineCol = rSettings.GetLabelTextColor();
+maArrowCol = aColorConfig.GetColorValue(svtools::DOCBOUNDARIES).nColor;
+maMarkCol = aColorConfig.GetColorValue(svtools::TABLEBOUNDARIES).nColor;
+maHCLineCol = COL_BLACK;
 }
 
 const std::u16string_view aImageIds[] =
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits