summaryrefslogtreecommitdiffstats
path: root/svx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
commita2baea7faff31d26459dab3668a39eae85e4991b (patch)
treeeaa2048ce9c715481f932dcfe20368e252b77d2f /svx
parentAdding upstream version 4:24.2.0. (diff)
downloadlibreoffice-a2baea7faff31d26459dab3668a39eae85e4991b.tar.xz
libreoffice-a2baea7faff31d26459dab3668a39eae85e4991b.zip
Adding upstream version 4:24.2.1.upstream/4%24.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/accessibility/AccessibleShape.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpage.cxx6
-rw-r--r--svx/source/svdraw/svdhdl.cxx101
-rw-r--r--svx/source/svdraw/svdpagv.cxx17
-rw-r--r--svx/source/svdraw/svdpntv.cxx15
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx20
6 files changed, 86 insertions, 75 deletions
diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx
index 1edc2c8a26..7a1770b8fd 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -1018,7 +1018,7 @@ void AccessibleShape::disposing()
maShapeTreeInfo.dispose();
// Call base classes.
- AccessibleContextBase::dispose ();
+ AccessibleContextBase::disposing();
}
sal_Int64 SAL_CALL
diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
index 43ca1fd5c0..dfef01d304 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx
@@ -515,10 +515,10 @@ sal_uInt32 ViewContactOfSdrPage::GetObjectCount() const
{
// Fixed count of content. It contains PageBackground (Wiese), PageShadow, PageFill,
// then - depending on if the page has a MasterPage - either MasterPage Hierarchy
- // or MPBGO. Also OuterPageBorder, InnerPageBorder and two pairs of Grid and Helplines
- // (for front and back) which internally are visible or not depending on the current
+ // or MPBGO. Also OuterPageBorder, InnerPageBorder, PageHierarchy and two pairs of Grid and
+ // Helplines (for front and back) which internally are visible or not depending on the current
// front/back setting for those.
- return 10;
+ return 11;
}
ViewContact& ViewContactOfSdrPage::GetViewContact(sal_uInt32 nIndex) const
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 867afa6a90..c8f1fa3159 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1604,66 +1604,67 @@ ImpEdgeHdl::~ImpEdgeHdl()
void ImpEdgeHdl::CreateB2dIAObject()
{
- if(m_nObjHdlNum <= 1 && m_pObj)
+ if(m_nObjHdlNum > 1 || !m_pObj)
{
- // first throw away old one
- GetRidOfIAObject();
+ // call parent
+ SdrHdl::CreateB2dIAObject();
+ return;
+ }
- BitmapColorIndex eColIndex = BitmapColorIndex::LightCyan;
- BitmapMarkerKind eKindOfMarker = BitmapMarkerKind::Rect_7x7;
+ // first throw away old one
+ GetRidOfIAObject();
- if(m_pHdlList)
- {
- SdrMarkView* pView = m_pHdlList->GetView();
+ BitmapColorIndex eColIndex = BitmapColorIndex::LightCyan;
+ BitmapMarkerKind eKindOfMarker = BitmapMarkerKind::Rect_7x7;
- if(pView && !pView->areMarkHandlesHidden())
- {
- const SdrEdgeObj* pEdge = static_cast<SdrEdgeObj*>(m_pObj);
+ if(!m_pHdlList)
+ return;
- if(pEdge->GetConnectedNode(m_nObjHdlNum == 0) != nullptr)
- eColIndex = BitmapColorIndex::LightRed;
+ SdrMarkView* pView = m_pHdlList->GetView();
- if(m_nPPntNum < 2)
- {
- // Handle with plus sign inside
- eKindOfMarker = BitmapMarkerKind::Circ_7x7;
- }
+ if(!pView || pView->areMarkHandlesHidden())
+ return;
- SdrPageView* pPageView = pView->GetSdrPageView();
+ // tdf#159666 Crash when table and line object are selected at the same time
+ auto pEdge = dynamic_cast<SdrEdgeObj*>(m_pObj);
+ if (!pEdge)
+ return;
- if(pPageView)
- {
- for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
- {
- const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
-
- if(rPageWindow.GetPaintWindow().OutputToWindow())
- {
- const rtl::Reference< sdr::overlay::OverlayManager >& xManager = rPageWindow.GetOverlayManager();
- if (xManager.is())
- {
- basegfx::B2DPoint aPosition(m_aPos.X(), m_aPos.Y());
- std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(CreateOverlayObject(
- aPosition,
- eColIndex,
- eKindOfMarker));
-
- // OVERLAYMANAGER
- insertNewlyCreatedOverlayObjectForSdrHdl(
- std::move(pNewOverlayObject),
- rPageWindow.GetObjectContact(),
- *xManager);
- }
- }
- }
- }
- }
- }
+ if(pEdge->GetConnectedNode(m_nObjHdlNum == 0) != nullptr)
+ eColIndex = BitmapColorIndex::LightRed;
+
+ if(m_nPPntNum < 2)
+ {
+ // Handle with plus sign inside
+ eKindOfMarker = BitmapMarkerKind::Circ_7x7;
}
- else
+
+ SdrPageView* pPageView = pView->GetSdrPageView();
+ if(!pPageView)
+ return;
+
+ for(sal_uInt32 b(0); b < pPageView->PageWindowCount(); b++)
{
- // call parent
- SdrHdl::CreateB2dIAObject();
+ const SdrPageWindow& rPageWindow = *pPageView->GetPageWindow(b);
+
+ if(rPageWindow.GetPaintWindow().OutputToWindow())
+ {
+ const rtl::Reference< sdr::overlay::OverlayManager >& xManager = rPageWindow.GetOverlayManager();
+ if (xManager.is())
+ {
+ basegfx::B2DPoint aPosition(m_aPos.X(), m_aPos.Y());
+ std::unique_ptr<sdr::overlay::OverlayObject> pNewOverlayObject(CreateOverlayObject(
+ aPosition,
+ eColIndex,
+ eKindOfMarker));
+
+ // OVERLAYMANAGER
+ insertNewlyCreatedOverlayObjectForSdrHdl(
+ std::move(pNewOverlayObject),
+ rPageWindow.GetObjectContact(),
+ *xManager);
+ }
+ }
}
}
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index 86210865e7..4e5d7a4728 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -557,15 +557,22 @@ void SdrPageView::AdjHdl()
GetView().AdjustMarkHdl();
}
-void SdrPageView::SetLayer(const OUString& rName, SdrLayerIDSet& rBS, bool bJa)
+// return true if changed, false if unchanged
+bool SdrPageView::SetLayer(const OUString& rName, SdrLayerIDSet& rBS, bool bJa)
{
- if(!GetPage())
- return;
+ if (!GetPage())
+ return false;
SdrLayerID nID = GetPage()->GetLayerAdmin().GetLayerID(rName);
- if(SDRLAYER_NOTFOUND != nID)
- rBS.Set(nID, bJa);
+ if (SDRLAYER_NOTFOUND == nID)
+ return false;
+
+ if (rBS.IsSet(nID) == bJa)
+ return false;
+
+ rBS.Set(nID, bJa);
+ return true;
}
bool SdrPageView::IsLayer(const OUString& rName, const SdrLayerIDSet& rBS) const
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 4584e7f831..f092887250 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -414,22 +414,15 @@ void SdrPaintView::DeleteDeviceFromPaintView(OutputDevice& rOldDev)
void SdrPaintView::SetLayerVisible(const OUString& rName, bool bShow)
{
- if(mpPageView)
- {
- mpPageView->SetLayerVisible(rName, bShow);
- }
-
+ const bool bChanged = mpPageView && mpPageView->SetLayerVisible(rName, bShow);
+ if (!bChanged)
+ return;
InvalidateAllWin();
}
bool SdrPaintView::IsLayerVisible(const OUString& rName) const
{
- if(mpPageView)
- {
- return mpPageView->IsLayerVisible(rName);
- }
-
- return false;
+ return mpPageView && mpPageView->IsLayerVisible(rName);
}
void SdrPaintView::SetLayerLocked(const OUString& rName, bool bLock)
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 8e833167ea..f8c4436443 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
@@ -243,12 +244,21 @@ void FindTextFieldControl::SetTextToSelected_Impl()
try
{
css::uno::Reference<css::frame::XController> xController(m_xFrame->getController(), css::uno::UNO_SET_THROW);
- css::uno::Reference<css::frame::XModel> xModel(xController->getModel(), css::uno::UNO_SET_THROW);
- css::uno::Reference<css::container::XIndexAccess> xIndexAccess(xModel->getCurrentSelection(), css::uno::UNO_QUERY_THROW);
- if (xIndexAccess->getCount() > 0)
+ uno::Reference<text::XTextViewCursorSupplier> const xTVCS(xController, uno::UNO_QUERY);
+ if (xTVCS.is())
{
- css::uno::Reference<css::text::XTextRange> xTextRange(xIndexAccess->getByIndex(0), css::uno::UNO_QUERY_THROW);
- aString = xTextRange->getString();
+ uno::Reference<text::XTextViewCursor> const xTVC(xTVCS->getViewCursor());
+ aString = xTVC->getString();
+ }
+ else
+ {
+ uno::Reference<frame::XModel> xModel(xController->getModel(), uno::UNO_SET_THROW);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xModel->getCurrentSelection(), uno::UNO_QUERY_THROW);
+ if (xIndexAccess->getCount() > 0)
+ {
+ uno::Reference<text::XTextRange> xTextRange(xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW);
+ aString = xTextRange->getString();
+ }
}
}
catch ( ... )