summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-01-30 20:14:10 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-01-31 07:21:39 +0000
commit1e92059fe95cc1ba31aab4a66926d55bc00d0684 (patch)
treef6d6523928daff96ff0a2d15ab923c4777ab09e7 /basctl
parentd9ebb2e76bf7ec068ebfceccf7f477471012d157 (diff)
svx: Refactor (sdr) views to access the SdrModel by reference
In SdrPaintView (and subclasses) the mpModel variable is always the same as the input (reference) model, so there is no need for that extra variable. Change the strange and confusing var. name mrSdrModelFromSdrView (the input reference to SdrModel) to just mrModel and use that in GetModel(). Change the GetModel() to return a reference instead of a pointer and reactor the code to accomodate the change. This gets rid of many nullptr checks for the pointer that the GetModel() returns and makes the code more simple is some cases. Change-Id: I18351a417fd82f49262a83de036ec1420a65399c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146373 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/dlged/dlged.cxx2
-rw-r--r--basctl/source/dlged/propbrw.cxx6
2 files changed, 4 insertions, 4 deletions
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 77ed2e8042db..cede03ac4f41 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -217,7 +217,7 @@ DlgEditor::DlgEditor (
rWindow.SetMapMode( MapMode( MapUnit::Map100thMM ) );
pDlgEdPage->SetSize( rWindow.PixelToLogic( Size(DLGED_PAGE_WIDTH_MIN, DLGED_PAGE_HEIGHT_MIN) ) );
- pDlgEdView->ShowSdrPage(pDlgEdView->GetModel()->GetPage(0));
+ pDlgEdView->ShowSdrPage(pDlgEdView->GetModel().GetPage(0));
pDlgEdView->SetLayerVisible( "HiddenLayer", false );
pDlgEdView->SetMoveSnapOnlyTopLeft(true);
pDlgEdView->SetWorkArea( tools::Rectangle( Point( 0, 0 ), pDlgEdPage->GetSize() ) );
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index 30823a1da7cd..f95157d4f7d7 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -443,7 +443,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView
{
if ( pView )
{
- EndListening( *(pView->GetModel()) );
+ EndListening(pView->GetModel());
pView = nullptr;
}
@@ -464,7 +464,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView
if ( nMarkCount == 0 )
{
- EndListening( *(pView->GetModel()) );
+ EndListening(pView->GetModel());
pView = nullptr;
implSetNewObject( nullptr );
return;
@@ -492,7 +492,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView
else
implSetNewObject( xNewObject );
- StartListening( *(pView->GetModel()) );
+ StartListening(pView->GetModel());
}
catch ( const PropertyVetoException& ) { /* silence */ }
catch ( const Exception& )