summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbaccess/source/core/api/tablecontainer.cxx30
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.cxx56
-rw-r--r--dbaccess/source/ui/app/AppController.cxx123
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx126
-rw-r--r--dbaccess/source/ui/dlg/indexdialog.cxx36
-rw-r--r--dbaccess/source/ui/misc/WTypeSelect.cxx26
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx33
-rw-r--r--dbaccess/source/ui/tabledesign/TableRow.cxx85
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx48
-rw-r--r--desktop/source/deployment/misc/dp_interact.cxx40
-rw-r--r--desktop/source/deployment/registry/script/dp_script.cxx46
-rw-r--r--desktop/source/lib/init.cxx84
-rw-r--r--drawinglayer/source/primitive2d/borderlineprimitive2d.cxx24
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx49
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx58
-rw-r--r--drawinglayer/source/primitive2d/svggradientprimitive2d.cxx58
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx32
17 files changed, 471 insertions, 483 deletions
diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx
index 7aefea3e2306..9bcf4b610eec 100644
--- a/dbaccess/source/core/api/tablecontainer.cxx
+++ b/dbaccess/source/core/api/tablecontainer.cxx
@@ -62,26 +62,24 @@ namespace
bool lcl_isPropertySetDefaulted(const Sequence< OUString>& _aNames,const Reference<XPropertySet>& _xProp)
{
Reference<XPropertyState> xState(_xProp,UNO_QUERY);
- if ( xState.is() )
+ if ( !xState )
+ return false;
+ const OUString* pIter = _aNames.getConstArray();
+ const OUString* pEnd = pIter + _aNames.getLength();
+ for(;pIter != pEnd;++pIter)
{
- const OUString* pIter = _aNames.getConstArray();
- const OUString* pEnd = pIter + _aNames.getLength();
- for(;pIter != pEnd;++pIter)
+ try
{
- try
- {
- PropertyState aState = xState->getPropertyState(*pIter);
- if ( aState != PropertyState_DEFAULT_VALUE )
- break;
- }
- catch(const Exception&)
- {
- TOOLS_WARN_EXCEPTION("dbaccess", "" );
- }
+ PropertyState aState = xState->getPropertyState(*pIter);
+ if ( aState != PropertyState_DEFAULT_VALUE )
+ break;
+ }
+ catch(const Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("dbaccess", "" );
}
- return ( pIter == pEnd );
}
- return false;
+ return ( pIter == pEnd );
}
}
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 88765c186961..6848d5a1bb2d 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -132,42 +132,40 @@ static ErrCode ReadThroughComponent(
OSL_ENSURE( xStorage.is(), "Need storage!");
OSL_ENSURE(nullptr != pStreamName, "Please, please, give me a name!");
- if ( xStorage.is() )
- {
- uno::Reference< io::XStream > xDocStream;
+ if ( !xStorage )
+ // TODO/LATER: better error handling
+ return ErrCode(1);
- try
- {
- // open stream (and set parser input)
- OUString sStreamName = OUString::createFromAscii(pStreamName);
- if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) )
- {
- // stream name not found! return immediately with OK signal
- return ERRCODE_NONE;
- }
+ uno::Reference< io::XStream > xDocStream;
- // get input stream
- xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
- }
- catch (const packages::WrongPasswordException&)
- {
- return ERRCODE_SFX_WRONGPASSWORD;
- }
- catch (const uno::Exception&)
+ try
+ {
+ // open stream (and set parser input)
+ OUString sStreamName = OUString::createFromAscii(pStreamName);
+ if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) )
{
- return ErrCode(1); // TODO/LATER: error handling
+ // stream name not found! return immediately with OK signal
+ return ERRCODE_NONE;
}
- uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream();
- // read from the stream
- return ReadThroughComponent( xInputStream
- ,xModelComponent
- ,rxContext
- ,_rFilter );
+ // get input stream
+ xDocStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
+ }
+ catch (const packages::WrongPasswordException&)
+ {
+ return ERRCODE_SFX_WRONGPASSWORD;
+ }
+ catch (const uno::Exception&)
+ {
+ return ErrCode(1); // TODO/LATER: error handling
}
- // TODO/LATER: better error handling
- return ErrCode(1);
+ uno::Reference< XInputStream > xInputStream = xDocStream->getInputStream();
+ // read from the stream
+ return ReadThroughComponent( xInputStream
+ ,xModelComponent
+ ,rxContext
+ ,_rFilter );
}
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 003b295e3178..f6837cfdbe65 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -1694,23 +1694,23 @@ bool OApplicationController::onEntryDoubleClick(const weld::TreeView& rTreeView)
if (!rTreeView.get_cursor(xHdlEntry.get()))
return false;
- if (pContainer->isLeaf(rTreeView, *xHdlEntry))
+ if (!pContainer->isLeaf(rTreeView, *xHdlEntry))
+ return false; // not handled
+
+ try
{
- try
- {
- // opens a new frame with either the table or the query or report or form or view
- openElementWithArguments(
- getContainer()->getQualifiedName(xHdlEntry.get()),
- getContainer()->getElementType(),
- E_OPEN_NORMAL,
- 0,
- ::comphelper::NamedValueCollection() );
- return true; // handled
- }
- catch(const Exception&)
- {
- DBG_UNHANDLED_EXCEPTION("dbaccess");
- }
+ // opens a new frame with either the table or the query or report or form or view
+ openElementWithArguments(
+ getContainer()->getQualifiedName(xHdlEntry.get()),
+ getContainer()->getElementType(),
+ E_OPEN_NORMAL,
+ 0,
+ ::comphelper::NamedValueCollection() );
+ return true; // handled
+ }
+ catch(const Exception&)
+ {
+ DBG_UNHANDLED_EXCEPTION("dbaccess");
}
return false; // not handled
@@ -2324,43 +2324,42 @@ sal_Int8 OApplicationController::queryDrop( const AcceptDropEvent& _rEvt, const
sal_Int8 nActionAskedFor = _rEvt.mnAction;
// check if we're a table or query container
OApplicationView* pView = getContainer();
- if ( pView && !isDataSourceReadOnly() )
+ if ( !pView || isDataSourceReadOnly() )
+ return DND_ACTION_NONE;
+
+ ElementType eType = pView->getElementType();
+ if ( eType == E_NONE || (eType == E_TABLE && isConnectionReadOnly()) )
+ return DND_ACTION_NONE;
+
+ // check for the concrete type
+ if(std::any_of(_rFlavors.begin(),_rFlavors.end(),TAppSupportedSotFunctor(eType)))
+ return DND_ACTION_COPY;
+
+ if ( eType != E_FORM && eType != E_REPORT )
+ return DND_ACTION_NONE;
+
+ sal_Int8 nAction = OComponentTransferable::canExtractComponentDescriptor(_rFlavors,eType == E_FORM) ? DND_ACTION_COPY : DND_ACTION_NONE;
+ if ( nAction == DND_ACTION_NONE )
+ return DND_ACTION_NONE;
+
+ auto xHitEntry = pView->getEntry(_rEvt.maPosPixel);
+ if (xHitEntry)
{
- ElementType eType = pView->getElementType();
- if ( eType != E_NONE && (eType != E_TABLE || !isConnectionReadOnly()) )
+ OUString sName = pView->getQualifiedName(xHitEntry.get());
+ if ( !sName.isEmpty() )
{
- // check for the concrete type
- if(std::any_of(_rFlavors.begin(),_rFlavors.end(),TAppSupportedSotFunctor(eType)))
- return DND_ACTION_COPY;
- if ( eType == E_FORM || eType == E_REPORT )
+ Reference< XHierarchicalNameAccess > xContainer(getElements(pView->getElementType()),UNO_QUERY);
+ if ( xContainer.is() && xContainer->hasByHierarchicalName(sName) )
{
- sal_Int8 nAction = OComponentTransferable::canExtractComponentDescriptor(_rFlavors,eType == E_FORM) ? DND_ACTION_COPY : DND_ACTION_NONE;
- if ( nAction != DND_ACTION_NONE )
- {
- auto xHitEntry = pView->getEntry(_rEvt.maPosPixel);
- if (xHitEntry)
- {
- OUString sName = pView->getQualifiedName(xHitEntry.get());
- if ( !sName.isEmpty() )
- {
- Reference< XHierarchicalNameAccess > xContainer(getElements(pView->getElementType()),UNO_QUERY);
- if ( xContainer.is() && xContainer->hasByHierarchicalName(sName) )
- {
- Reference< XHierarchicalNameAccess > xHitObject(xContainer->getByHierarchicalName(sName),UNO_QUERY);
- if ( xHitObject.is() )
- nAction = nActionAskedFor & DND_ACTION_COPYMOVE;
- }
- else
- nAction = DND_ACTION_NONE;
- }
- }
- }
- return nAction;
+ Reference< XHierarchicalNameAccess > xHitObject(xContainer->getByHierarchicalName(sName),UNO_QUERY);
+ if ( xHitObject.is() )
+ nAction = nActionAskedFor & DND_ACTION_COPYMOVE;
}
+ else
+ nAction = DND_ACTION_NONE;
}
}
-
- return DND_ACTION_NONE;
+ return nAction;
}
sal_Int8 OApplicationController::executeDrop( const ExecuteDropEvent& _rEvt )
@@ -2616,25 +2615,25 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
}
// initial preview mode
- if ( m_xDataSource.is() )
+ if ( !m_xDataSource )
+ return true;
+
+ try
{
- try
- {
- // to get the 'modified' for the data source
- ::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) );
- if ( aLayoutInfo.has( INFO_PREVIEW ) )
- {
- const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( INFO_PREVIEW, sal_Int32(0) ) );
- m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode );
- if ( getView() )
- getContainer()->switchPreview( m_ePreviewMode );
- }
- }
- catch( const Exception& )
+ // to get the 'modified' for the data source
+ ::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) );
+ if ( aLayoutInfo.has( INFO_PREVIEW ) )
{
- DBG_UNHANDLED_EXCEPTION("dbaccess");
+ const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( INFO_PREVIEW, sal_Int32(0) ) );
+ m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode );
+ if ( getView() )
+ getContainer()->switchPreview( m_ePreviewMode );
}
}
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION("dbaccess");
+ }
return true;
}
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 035a0e1ef8c2..ee07b531f8b2 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -286,49 +286,49 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent)
{
SAL_WARN("dbaccess.ui", "SbaTableQueryBrowser::Construct: could not create (or start listening at) the database context!");
}
+
// some help ids
- if (getBrowserView() && getBrowserView()->getVclControl())
- {
+ if (!getBrowserView() || !getBrowserView()->getVclControl())
+ return true;
- // create controls and set sizes
- const tools::Long nFrameWidth = getBrowserView()->LogicToPixel(::Size(3, 0), MapMode(MapUnit::MapAppFont)).Width();
+ // create controls and set sizes
+ const tools::Long nFrameWidth = getBrowserView()->LogicToPixel(::Size(3, 0), MapMode(MapUnit::MapAppFont)).Width();
- m_pSplitter = VclPtr<Splitter>::Create(getBrowserView(),WB_HSCROLL);
- m_pSplitter->SetPosSizePixel( ::Point(0,0), ::Size(nFrameWidth,0) );
- m_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
+ m_pSplitter = VclPtr<Splitter>::Create(getBrowserView(),WB_HSCROLL);
+ m_pSplitter->SetPosSizePixel( ::Point(0,0), ::Size(nFrameWidth,0) );
+ m_pSplitter->SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) );
- m_pTreeView = VclPtr<InterimDBTreeListBox>::Create(getBrowserView());
+ m_pTreeView = VclPtr<InterimDBTreeListBox>::Create(getBrowserView());
- weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- rTreeView.connect_expanding(LINK(this, SbaTableQueryBrowser, OnExpandEntry));
+ weld::TreeView& rTreeView = m_pTreeView->GetWidget();
+ rTreeView.connect_expanding(LINK(this, SbaTableQueryBrowser, OnExpandEntry));
- m_pTreeView->setCopyHandler(LINK(this, SbaTableQueryBrowser, OnCopyEntry));
+ m_pTreeView->setCopyHandler(LINK(this, SbaTableQueryBrowser, OnCopyEntry));
- m_pTreeView->setContextMenuProvider( this );
- m_pTreeView->setControlActionListener( this );
- m_pTreeView->SetHelpId(HID_CTL_TREEVIEW);
+ m_pTreeView->setContextMenuProvider( this );
+ m_pTreeView->setControlActionListener( this );
+ m_pTreeView->SetHelpId(HID_CTL_TREEVIEW);
- // a default pos for the splitter, so that the listbox is about 80 (logical) pixels wide
- m_pSplitter->SetSplitPosPixel(getBrowserView()->LogicToPixel(::Size(80, 0), MapMode(MapUnit::MapAppFont)).Width());
+ // a default pos for the splitter, so that the listbox is about 80 (logical) pixels wide
+ m_pSplitter->SetSplitPosPixel(getBrowserView()->LogicToPixel(::Size(80, 0), MapMode(MapUnit::MapAppFont)).Width());
- getBrowserView()->setSplitter(m_pSplitter);
- getBrowserView()->setTreeView(m_pTreeView);
+ getBrowserView()->setSplitter(m_pSplitter);
+ getBrowserView()->setTreeView(m_pTreeView);
- // fill view with data
- rTreeView.set_sort_order(true);
- rTreeView.set_sort_func([this](const weld::TreeIter& rLeft, const weld::TreeIter& rRight){
- return OnTreeEntryCompare(rLeft, rRight);
- });
- rTreeView.make_sorted();
- m_pTreeView->SetSelChangeHdl(LINK(this, SbaTableQueryBrowser, OnSelectionChange));
- m_pTreeView->show_container();
+ // fill view with data
+ rTreeView.set_sort_order(true);
+ rTreeView.set_sort_func([this](const weld::TreeIter& rLeft, const weld::TreeIter& rRight){
+ return OnTreeEntryCompare(rLeft, rRight);
+ });
+ rTreeView.make_sorted();
+ m_pTreeView->SetSelChangeHdl(LINK(this, SbaTableQueryBrowser, OnSelectionChange));
+ m_pTreeView->show_container();
- // TODO
- getBrowserView()->getVclControl()->SetHelpId(HID_CTL_TABBROWSER);
- if (getBrowserView()->getVclControl()->GetHeaderBar())
- getBrowserView()->getVclControl()->GetHeaderBar()->SetHelpId(HID_DATABROWSE_HEADER);
- InvalidateFeature(ID_BROWSER_EXPLORER);
- }
+ // TODO
+ getBrowserView()->getVclControl()->SetHelpId(HID_CTL_TABBROWSER);
+ if (getBrowserView()->getVclControl()->GetHeaderBar())
+ getBrowserView()->getVclControl()->GetHeaderBar()->SetHelpId(HID_DATABROWSE_HEADER);
+ InvalidateFeature(ID_BROWSER_EXPLORER);
return true;
}
@@ -2427,45 +2427,45 @@ bool SbaTableQueryBrowser::implSelect(const OUString& _rDataSourceName, const OU
const SharedConnection& _rxConnection,
bool _bSelectDirect)
{
- if (_rDataSourceName.getLength() && _rCommand.getLength() && (-1 != nCommandType))
- {
- std::unique_ptr<weld::TreeIter> xDataSource;
- std::unique_ptr<weld::TreeIter> xCommandType;
- std::unique_ptr<weld::TreeIter> xCommand = getObjectEntry( _rDataSourceName, _rCommand, nCommandType, &xDataSource, &xCommandType, true, _rxConnection );
+ if (!_rDataSourceName.getLength() || !_rCommand.getLength() || (-1 == nCommandType))
+ return false;
- if (xCommand)
- {
- weld::TreeView& rTreeView = m_pTreeView->GetWidget();
+ std::unique_ptr<weld::TreeIter> xDataSource;
+ std::unique_ptr<weld::TreeIter> xCommandType;
+ std::unique_ptr<weld::TreeIter> xCommand = getObjectEntry( _rDataSourceName, _rCommand, nCommandType, &xDataSource, &xCommandType, true, _rxConnection );
- bool bSuccess = true;
- if ( _bSelectDirect )
- {
- bSuccess = implSelect(xCommand.get());
- }
- else
- {
- rTreeView.select(*xCommand);
- }
+ if (xCommand)
+ {
+ weld::TreeView& rTreeView = m_pTreeView->GetWidget();
- if ( bSuccess )
- {
- rTreeView.scroll_to_row(*xCommand);
- rTreeView.set_cursor(*xCommand);
- }
+ bool bSuccess = true;
+ if ( _bSelectDirect )
+ {
+ bSuccess = implSelect(xCommand.get());
}
- else if (!xCommandType)
+ else
{
- if (m_xCurrentlyDisplayed)
- {
- // tell the old entry (if any) it has been deselected
- selectPath(m_xCurrentlyDisplayed.get(), false);
- m_xCurrentlyDisplayed.reset();
- }
+ rTreeView.select(*xCommand);
+ }
- // we have a command and need to display this in the rowset
- return implLoadAnything(_rDataSourceName, _rCommand, nCommandType, _bEscapeProcessing, _rxConnection);
+ if ( bSuccess )
+ {
+ rTreeView.scroll_to_row(*xCommand);
+ rTreeView.set_cursor(*xCommand);
}
}
+ else if (!xCommandType)
+ {
+ if (m_xCurrentlyDisplayed)
+ {
+ // tell the old entry (if any) it has been deselected
+ selectPath(m_xCurrentlyDisplayed.get(), false);
+ m_xCurrentlyDisplayed.reset();
+ }
+
+ // we have a command and need to display this in the rowset
+ return implLoadAnything(_rDataSourceName, _rCommand, nCommandType, _bEscapeProcessing, _rxConnection);
+ }
return false;
}
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index cbe866cf5be4..4c93128482d5 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -537,28 +537,28 @@ namespace dbaui
bool DbaIndexDialog::implSaveModified(bool _bPlausibility)
{
- if (m_xPreviousSelection)
- {
- // try to commit the previously selected index
- if (m_xFields->IsModified() && !m_xFields->SaveModified())
- return false;
+ if (!m_xPreviousSelection)
+ return true;
- Indexes::iterator aPreviouslySelected = m_xIndexes->begin() + m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
+ // try to commit the previously selected index
+ if (m_xFields->IsModified() && !m_xFields->SaveModified())
+ return false;
- // the unique flag
- aPreviouslySelected->bUnique = m_xUnique->get_active();
- if (m_xUnique->get_state_changed_from_saved())
- aPreviouslySelected->setModified(true);
+ Indexes::iterator aPreviouslySelected = m_xIndexes->begin() + m_xIndexList->get_id(*m_xPreviousSelection).toUInt32();
- // the fields
- m_xFields->commitTo(aPreviouslySelected->aFields);
- if (m_xFields->GetSavedValue() != aPreviouslySelected->aFields)
- aPreviouslySelected->setModified(true);
+ // the unique flag
+ aPreviouslySelected->bUnique = m_xUnique->get_active();
+ if (m_xUnique->get_state_changed_from_saved())
+ aPreviouslySelected->setModified(true);
- // plausibility checks
- if (_bPlausibility && !implCheckPlausibility(aPreviouslySelected))
- return false;
- }
+ // the fields
+ m_xFields->commitTo(aPreviouslySelected->aFields);
+ if (m_xFields->GetSavedValue() != aPreviouslySelected->aFields)
+ aPreviouslySelected->setModified(true);
+
+ // plausibility checks
+ if (_bPlausibility && !implCheckPlausibility(aPreviouslySelected))
+ return false;
return true;
}
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx
index 245e6281ed87..6f3fbd79d22c 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -391,25 +391,25 @@ IMPL_LINK(OWizTypeSelectList, CommandHdl, const CommandEvent&, rCEvt, bool)
xContextMenu->set_active("primarykey", true);
OString sCommand(xContextMenu->popup_at_rect(m_xControl.get(), tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1))));
- if (sCommand == "primarykey")
+ if (sCommand != "primarykey")
+ return true;
+
+ for (sal_Int32 j = 0 ; j < nCount; ++j)
{
- for (sal_Int32 j = 0 ; j < nCount; ++j)
+ OFieldDescription* pFieldDescr = reinterpret_cast<OFieldDescription*>(m_xControl->get_id(j).toInt64());
+ if (pFieldDescr)
{
- OFieldDescription* pFieldDescr = reinterpret_cast<OFieldDescription*>(m_xControl->get_id(j).toInt64());
- if (pFieldDescr)
+ if(!bCheckOk && m_xControl->is_selected(j))
{
- if(!bCheckOk && m_xControl->is_selected(j))
- {
- setPrimaryKey(pFieldDescr,j,true);
- }
- else
- {
- setPrimaryKey(pFieldDescr,j);
- }
+ setPrimaryKey(pFieldDescr,j,true);
+ }
+ else
+ {
+ setPrimaryKey(pFieldDescr,j);
}
}
- m_aChangeHdl.Call(*m_xControl);
}
+ m_aChangeHdl.Call(*m_xControl);
return true;
}
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 4ea3681e26cd..ce6c45673688 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -1819,27 +1819,26 @@ namespace
else
return false;
- if ( eJoinType == CROSS_JOIN || bNatural )
- {
+ if ( eJoinType != CROSS_JOIN && !bNatural )
+ return true;
- OQueryTableWindow* pLeftWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pNode->getChild(0)) );
- OQueryTableWindow* pRightWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pRightTableRef) );
- OSL_ENSURE(pLeftWindow && pRightWindow,"Table Windows could not be found!");
- if ( !pLeftWindow || !pRightWindow )
- return false;
+ OQueryTableWindow* pLeftWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pNode->getChild(0)) );
+ OQueryTableWindow* pRightWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pRightTableRef) );
+ OSL_ENSURE(pLeftWindow && pRightWindow,"Table Windows could not be found!");
+ if ( !pLeftWindow || !pRightWindow )
+ return false;
- OTableFieldDescRef aDragLeft = new OTableFieldDesc();
- aDragLeft->SetTabWindow(pLeftWindow);
- aDragLeft->SetTable(pLeftWindow->GetTableName());
- aDragLeft->SetAlias(pLeftWindow->GetAliasName());
+ OTableFieldDescRef aDragLeft = new OTableFieldDesc();
+ aDragLeft->SetTabWindow(pLeftWindow);
+ aDragLeft->SetTable(pLeftWindow->GetTableName());
+ aDragLeft->SetAlias(pLeftWindow->GetAliasName());
- OTableFieldDescRef aDragRight = new OTableFieldDesc();
- aDragRight->SetTabWindow(pRightWindow);
- aDragRight->SetTable(pRightWindow->GetTableName());
- aDragRight->SetAlias(pRightWindow->GetAliasName());
+ OTableFieldDescRef aDragRight = new OTableFieldDesc();
+ aDragRight->SetTabWindow(pRightWindow);
+ aDragRight->SetTable(pRightWindow->GetTableName());
+ aDragRight->SetAlias(pRightWindow->GetAliasName());
- insertConnection(_pView,eJoinType,aDragLeft,aDragRight,bNatural);
- }
+ insertConnection(_pView,eJoinType,aDragLeft,aDragRight,bNatural);
return true;
}
diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx
index 54c6f3b48aec..8f13193e1c41 100644
--- a/dbaccess/source/ui/tabledesign/TableRow.cxx
+++ b/dbaccess/source/ui/tabledesign/TableRow.cxx
@@ -130,53 +130,52 @@ namespace dbaui
_rStr.ReadInt32( _rRow.m_nPos );
sal_Int32 nValue = 0;
_rStr.ReadInt32( nValue );
- if ( nValue )
+ if ( !nValue )
+ return _rStr;
+ OFieldDescription* pFieldDesc = new OFieldDescription();
+ _rRow.m_pActFieldDescr = pFieldDesc;
+ pFieldDesc->SetName(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
+ pFieldDesc->SetDescription(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
+ pFieldDesc->SetHelpText(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
+
+ _rStr.ReadInt32( nValue );
+ Any aControlDefault;
+ switch ( nValue )
{
- OFieldDescription* pFieldDesc = new OFieldDescription();
- _rRow.m_pActFieldDescr = pFieldDesc;
- pFieldDesc->SetName(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
- pFieldDesc->SetDescription(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
- pFieldDesc->SetHelpText(_rStr.ReadUniOrByteString(_rStr.GetStreamCharSet()));
-
- _rStr.ReadInt32( nValue );
- Any aControlDefault;
- switch ( nValue )
+ case 1:
{
- case 1:
- {
- double nControlDefault;
- _rStr.ReadDouble( nControlDefault );
- aControlDefault <<= nControlDefault;
- break;
- }
- case 2:
- aControlDefault <<= _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
- break;
+ double nControlDefault;
+ _rStr.ReadDouble( nControlDefault );
+ aControlDefault <<= nControlDefault;
+ break;
}
-
- pFieldDesc->SetControlDefault(aControlDefault);
-
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetTypeValue(nValue);
-
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetPrecision(nValue);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetScale(nValue);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetIsNullable(nValue);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetFormatKey(nValue);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetHorJustify(static_cast<SvxCellHorJustify>(nValue));
-
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetAutoIncrement(nValue != 0);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetPrimaryKey(nValue != 0);
- _rStr.ReadInt32( nValue );
- pFieldDesc->SetCurrency(nValue != 0);
+ case 2:
+ aControlDefault <<= _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
+ break;
}
+
+ pFieldDesc->SetControlDefault(aControlDefault);
+
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetTypeValue(nValue);
+
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetPrecision(nValue);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetScale(nValue);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetIsNullable(nValue);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetFormatKey(nValue);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetHorJustify(static_cast<SvxCellHorJustify>(nValue));
+
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetAutoIncrement(nValue != 0);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetPrimaryKey(nValue != 0);
+ _rStr.ReadInt32( nValue );
+ pFieldDesc->SetCurrency(nValue != 0);
return _rStr;
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index ceccee017442..f66c016ea6a7 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -765,39 +765,37 @@ OUString ExtensionBox_Impl::RequestHelp(tools::Rectangle& rRect)
bool ExtensionBox_Impl::MouseButtonDown( const MouseEvent& rMEvt )
{
- if ( rMEvt.IsLeft() )
+ if ( !rMEvt.IsLeft() )
+ return false;
+
+ if (rMEvt.IsMod1() && m_bHasActive)
+ selectEntry(ExtensionBox_Impl::ENTRY_NOTFOUND); // Selecting a not existing entry will deselect the current one
+ else
{
- if (rMEvt.IsMod1() && m_bHasActive)
- selectEntry(ExtensionBox_Impl::ENTRY_NOTFOUND); // Selecting a not existing entry will deselect the current one
- else
- {
- auto nPos = PointToPos( rMEvt.GetPosPixel() );
+ auto nPos = PointToPos( rMEvt.GetPosPixel() );
- if ( ( nPos >= 0 ) && ( nPos < static_cast<tools::Long>(m_vEntries.size()) ) )
+ if ( ( nPos >= 0 ) && ( nPos < static_cast<tools::Long>(m_vEntries.size()) ) )
+ {
+ const auto& rEntry = m_vEntries[nPos];
+ if (!rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.Contains(rMEvt.GetPosPixel()))
{
- const auto& rEntry = m_vEntries[nPos];
- if (!rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.Contains(rMEvt.GetPosPixel()))
+ try
+ {
+ css::uno::Reference<css::system::XSystemShellExecute> xSystemShellExecute(
+ css::system::SystemShellExecute::create(comphelper::getProcessComponentContext()));
+ //throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
+ xSystemShellExecute->execute(rEntry->m_sPublisherURL, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY);
+ }
+ catch (...)
{
- try
- {
- css::uno::Reference<css::system::XSystemShellExecute> xSystemShellExecute(
- css::system::SystemShellExecute::create(comphelper::getProcessComponentContext()));
- //throws css::lang::IllegalArgumentException, css::system::SystemShellExecuteException
- xSystemShellExecute->execute(rEntry->m_sPublisherURL, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY);
- }
- catch (...)
- {
- }
- return true;
}
+ return true;
}
-
- selectEntry( nPos );
}
- return true;
- }
- return false;
+ selectEntry( nPos );
+ }
+ return true;
}
bool ExtensionBox_Impl::KeyInput(const KeyEvent& rKEvt)
diff --git a/desktop/source/deployment/misc/dp_interact.cxx b/desktop/source/deployment/misc/dp_interact.cxx
index 9c5818cc669a..ae928a28e889 100644
--- a/desktop/source/deployment/misc/dp_interact.cxx
+++ b/desktop/source/deployment/misc/dp_interact.cxx
@@ -98,25 +98,27 @@ bool interactContinuation( Any const & request,
OSL_ASSERT(
cppu::UnoType<task::XInteractionContinuation>::get().isAssignableFrom(
continuation ) );
- if (xCmdEnv.is()) {
- Reference<task::XInteractionHandler> xInteractionHandler(
- xCmdEnv->getInteractionHandler() );
- if (xInteractionHandler.is()) {
- bool cont = false;
- bool abort = false;
- std::vector< Reference<task::XInteractionContinuation> > conts {
- new InteractionContinuationImpl(continuation, &cont ),
- new InteractionContinuationImpl( cppu::UnoType<task::XInteractionAbort>::get(), &abort ) };
- xInteractionHandler->handle(
- new ::comphelper::OInteractionRequest( request, std::move(conts) ) );
- if (cont || abort) {
- if (pcont != nullptr)
- *pcont = cont;
- if (pabort != nullptr)
- *pabort = abort;
- return true;
- }
- }
+ if (!xCmdEnv)
+ return false;
+
+ Reference<task::XInteractionHandler> xInteractionHandler(
+ xCmdEnv->getInteractionHandler() );
+ if (!xInteractionHandler)
+ return false;
+
+ bool cont = false;
+ bool abort = false;
+ std::vector< Reference<task::XInteractionContinuation> > conts {
+ new InteractionContinuationImpl(continuation, &cont ),
+ new InteractionContinuationImpl( cppu::UnoType<task::XInteractionAbort>::get(), &abort ) };
+ xInteractionHandler->handle(
+ new ::comphelper::OInteractionRequest( request, std::move(conts) ) );
+ if (cont || abort) {
+ if (pcont != nullptr)
+ *pcont = cont;
+ if (pabort != nullptr)
+ *pabort = abort;
+ return true;
}
return false;
}
diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx
index 4dd3d3b3eb79..3dc951a6f1d4 100644
--- a/desktop/source/deployment/registry/script/dp_script.cxx
+++ b/desktop/source/deployment/registry/script/dp_script.cxx
@@ -347,36 +347,36 @@ lcl_maybeAddScript(
OUString const& rScriptURL,
Reference<css::script::XLibraryContainer3> const& xScriptLibs)
{
- if (bExists && xScriptLibs.is())
+ if (!bExists || !xScriptLibs)
+ return false;
+
+ bool bCanAdd = true;
+ if (xScriptLibs->hasByName(rName))
{
- bool bCanAdd = true;
- if (xScriptLibs->hasByName(rName))
+ const OUString sOriginalUrl = xScriptLibs->getOriginalLibraryLinkURL(rName);
+ //We assume here that library names in extensions are unique, which may not be the case
+ //ToDo: If the script exist in another extension, then both extensions must have the
+ //same id
+ if (sOriginalUrl.match("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE")
+ || sOriginalUrl.match("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE")
+ || sOriginalUrl.match("vnd.sun.star.expand:$BUNDLED_EXTENSIONS")
+ || sOriginalUrl.match("$(INST)/share/basic/Access2Base/"))
{
- const OUString sOriginalUrl = xScriptLibs->getOriginalLibraryLinkURL(rName);
- //We assume here that library names in extensions are unique, which may not be the case
- //ToDo: If the script exist in another extension, then both extensions must have the
- //same id
- if (sOriginalUrl.match("vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE")
- || sOriginalUrl.match("vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE")
- || sOriginalUrl.match("vnd.sun.star.expand:$BUNDLED_EXTENSIONS")
- || sOriginalUrl.match("$(INST)/share/basic/Access2Base/"))
- {
- xScriptLibs->removeLibrary(rName);
- bCanAdd = true;
- }
- else
- {
- bCanAdd = false;
- }
+ xScriptLibs->removeLibrary(rName);
+ bCanAdd = true;
}
-
- if (bCanAdd)
+ else
{
- xScriptLibs->createLibraryLink(rName, rScriptURL, false);
- return xScriptLibs->hasByName(rName);
+ bCanAdd = false;
}
}
+ if (bCanAdd)
+ {
+ xScriptLibs->createLibraryLink(rName, rScriptURL, false);
+ return xScriptLibs->hasByName(rName);
+ }
+
return false;
}
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 434c7d80e01e..fc43e606d7bb 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -564,25 +564,25 @@ RectangleAndPart RectangleAndPart::Create(const std::string& rPayload)
tools::Rectangle RectangleAndPart::SanitizedRectangle(tools::Long nLeft, tools::Long nTop, tools::Long nWidth, tools::Long nHeight)
{
- if (nWidth > 0 && nHeight > 0)
- {
- // The top-left corner starts at (0, 0).
- // Anything negative is invalid.
- if (nLeft < 0)
- {
- nWidth += nLeft;
- nLeft = 0;
- }
+ if (nWidth <= 0 || nHeight <= 0)
+ return tools::Rectangle();
- if (nTop < 0)
- {
- nHeight += nTop;
- nTop = 0;
- }
+ // The top-left corner starts at (0, 0).
+ // Anything negative is invalid.
+ if (nLeft < 0)
+ {
+ nWidth += nLeft;
+ nLeft = 0;
+ }
- if (nWidth > 0 && nHeight > 0)
- return tools::Rectangle(nLeft, nTop, nLeft + nWidth, nTop + nHeight);
+ if (nTop < 0)
+ {
+ nHeight += nTop;
+ nTop = 0;
}
+
+ if (nWidth > 0 && nHeight > 0)
+ return tools::Rectangle(nLeft, nTop, nLeft + nWidth, nTop + nHeight);
// Else set empty rect.
return tools::Rectangle();
}
@@ -2699,41 +2699,39 @@ static int lo_runMacro(LibreOfficeKit* pThis, const char *pURL)
xFactory = xContext->getServiceManager();
- if (xFactory.is())
- {
- uno::Reference<frame::XDispatchProvider> xDP;
- xSFactory.set(xFactory, uno::UNO_QUERY_THROW);
- xDP.set( xSFactory->createInstance("com.sun.star.comp.sfx2.SfxMacroLoader"), uno::UNO_QUERY );
- uno::Reference<frame::XDispatch> xD = xDP->queryDispatch( aURL, OUString(), 0);
+ if (!xFactory)
+ return false;
- if (!xD.is())
- {
- pLib->maLastExceptionMsg = "Macro loader is not available";
- SAL_INFO("lok", "Macro loader is not available");
- return false;
- }
+ uno::Reference<frame::XDispatchProvider> xDP;
+ xSFactory.set(xFactory, uno::UNO_QUERY_THROW);
+ xDP.set( xSFactory->createInstance("com.sun.star.comp.sfx2.SfxMacroLoader"), uno::UNO_QUERY );
+ uno::Reference<frame::XDispatch> xD = xDP->queryDispatch( aURL, OUString(), 0);
- uno::Reference < frame::XSynchronousDispatch > xSyncDisp( xD, uno::UNO_QUERY_THROW );
- uno::Sequence<css::beans::PropertyValue> aEmpty;
- css::beans::PropertyValue aErr;
- uno::Any aRet = xSyncDisp->dispatchWithReturnValue( aURL, aEmpty );
- aRet >>= aErr;
+ if (!xD.is())
+ {
+ pLib->maLastExceptionMsg = "Macro loader is not available";
+ SAL_INFO("lok", "Macro loader is not available");
+ return false;
+ }
- if (aErr.Name == "ErrorCode")
- {
- sal_uInt32 nErrCode = 0; // ERRCODE_NONE
- aErr.Value >>= nErrCode;
+ uno::Reference < frame::XSynchronousDispatch > xSyncDisp( xD, uno::UNO_QUERY_THROW );
+ uno::Sequence<css::beans::PropertyValue> aEmpty;
+ css::beans::PropertyValue aErr;
+ uno::Any aRet = xSyncDisp->dispatchWithReturnValue( aURL, aEmpty );
+ aRet >>= aErr;
- pLib->maLastExceptionMsg = "An error occurred running macro (error code: " + OUString::number( nErrCode ) + ")";
- SAL_INFO("lok", "Macro execution terminated with error code " << nErrCode);
+ if (aErr.Name == "ErrorCode")
+ {
+ sal_uInt32 nErrCode = 0; // ERRCODE_NONE
+ aErr.Value >>= nErrCode;
- return false;
- }
+ pLib->maLastExceptionMsg = "An error occurred running macro (error code: " + OUString::number( nErrCode ) + ")";
+ SAL_INFO("lok", "Macro execution terminated with error code " << nErrCode);
- return true;
+ return false;
}
- return false;
+ return true;
}
static bool lo_signDocument(LibreOfficeKit* /*pThis*/,
diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index cc48f6467364..3aa4f01b6d53 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -276,22 +276,22 @@ namespace drawinglayer::primitive2d
bool BorderLinePrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const BorderLinePrimitive2D& rCompare = static_cast<const BorderLinePrimitive2D&>(rPrimitive);
+ if(!BufferedDecompositionPrimitive2D::operator==(rPrimitive))
+ return false;
+
+ const BorderLinePrimitive2D& rCompare = static_cast<const BorderLinePrimitive2D&>(rPrimitive);
- if (getStart() == rCompare.getStart()
- && getEnd() == rCompare.getEnd()
- && getStrokeAttribute() == rCompare.getStrokeAttribute())
+ if (getStart() == rCompare.getStart()
+ && getEnd() == rCompare.getEnd()
+ && getStrokeAttribute() == rCompare.getStrokeAttribute())
+ {
+ if (getBorderLines().size() == rCompare.getBorderLines().size())
{
- if (getBorderLines().size() == rCompare.getBorderLines().size())
+ for (size_t a(0); a < getBorderLines().size(); a++)
{
- for (size_t a(0); a < getBorderLines().size(); a++)
+ if (!(getBorderLines()[a] == rCompare.getBorderLines()[a]))
{
- if (!(getBorderLines()[a] == rCompare.getBorderLines()[a]))
- {
- return false;
- }
+ return false;
}
}
}
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index 24094bb58210..db27950df5d5 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -271,38 +271,37 @@ namespace drawinglayer::primitive2d
bool ControlPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
// use base class compare operator
- if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
- {
- const ControlPrimitive2D& rCompare = static_cast<const ControlPrimitive2D&>(rPrimitive);
+ if(!BufferedDecompositionPrimitive2D::operator==(rPrimitive))
+ return false;
- if(getTransform() == rCompare.getTransform())
- {
- // check if ControlModel references both are/are not
- bool bRetval(getControlModel().is() == rCompare.getControlModel().is());
+ const ControlPrimitive2D& rCompare = static_cast<const ControlPrimitive2D&>(rPrimitive);
- if(bRetval && getControlModel().is())
- {
- // both exist, check for equality
- bRetval = (getControlModel() == rCompare.getControlModel());
- }
+ if(getTransform() != rCompare.getTransform())
+ return false;
- if(bRetval)
- {
- // check if XControl references both are/are not
- bRetval = (getXControl().is() == rCompare.getXControl().is());
- }
+ // check if ControlModel references both are/are not
+ if (getControlModel().is() != rCompare.getControlModel().is())
+ return false;
- if(bRetval && getXControl().is())
- {
- // both exist, check for equality
- bRetval = (getXControl() == rCompare.getXControl());
- }
+ if(getControlModel().is())
+ {
+ // both exist, check for equality
+ if (getControlModel() != rCompare.getControlModel())
+ return false;
+ }
- return bRetval;
- }
+ // check if XControl references both are/are not
+ if (getXControl().is() != rCompare.getXControl().is())
+ return false;
+
+ if(getXControl().is())
+ {
+ // both exist, check for equality
+ if (getXControl() != rCompare.getXControl())
+ return false;
}
- return false;
+ return true;
}
basegfx::B2DRange ControlPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index da8618614fd3..4f238cef4792 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -525,43 +525,41 @@ namespace drawinglayer::primitive2d
bool ScenePrimitive2D::tryToCheckLastVisualisationDirectHit(const basegfx::B2DPoint& rLogicHitPoint, bool& o_rResult) const
{
- if(!maOldRenderedBitmap.IsEmpty() && !maOldUnitVisiblePart.isEmpty())
- {
- basegfx::B2DHomMatrix aInverseSceneTransform(getObjectTransformation());
- aInverseSceneTransform.invert();
- const basegfx::B2DPoint aRelativePoint(aInverseSceneTransform * rLogicHitPoint);
-
- if(maOldUnitVisiblePart.isInside(aRelativePoint))
- {
- // calculate coordinates relative to visualized part
- double fDivisorX(maOldUnitVisiblePart.getWidth());
- double fDivisorY(maOldUnitVisiblePart.getHeight());
+ if(maOldRenderedBitmap.IsEmpty() || maOldUnitVisiblePart.isEmpty())
+ return false;
- if(basegfx::fTools::equalZero(fDivisorX))
- {
- fDivisorX = 1.0;
- }
+ basegfx::B2DHomMatrix aInverseSceneTransform(getObjectTransformation());
+ aInverseSceneTransform.invert();
+ const basegfx::B2DPoint aRelativePoint(aInverseSceneTransform * rLogicHitPoint);
- if(basegfx::fTools::equalZero(fDivisorY))
- {
- fDivisorY = 1.0;
- }
+ if(!maOldUnitVisiblePart.isInside(aRelativePoint))
+ return false;
- const double fRelativeX((aRelativePoint.getX() - maOldUnitVisiblePart.getMinX()) / fDivisorX);
- const double fRelativeY((aRelativePoint.getY() - maOldUnitVisiblePart.getMinY()) / fDivisorY);
+ // calculate coordinates relative to visualized part
+ double fDivisorX(maOldUnitVisiblePart.getWidth());
+ double fDivisorY(maOldUnitVisiblePart.getHeight());
- // combine with real BitmapSizePixel to get bitmap coordinates
- const Size aBitmapSizePixel(maOldRenderedBitmap.GetSizePixel());
- const sal_Int32 nX(basegfx::fround(fRelativeX * aBitmapSizePixel.Width()));
- const sal_Int32 nY(basegfx::fround(fRelativeY * aBitmapSizePixel.Height()));
+ if(basegfx::fTools::equalZero(fDivisorX))
+ {
+ fDivisorX = 1.0;
+ }
- // try to get a statement about transparency in that pixel
- o_rResult = (0 != maOldRenderedBitmap.GetAlpha(nX, nY));
- return true;
- }
+ if(basegfx::fTools::equalZero(fDivisorY))
+ {
+ fDivisorY = 1.0;
}
- return false;
+ const double fRelativeX((aRelativePoint.getX() - maOldUnitVisiblePart.getMinX()) / fDivisorX);
+ const double fRelativeY((aRelativePoint.getY() - maOldUnitVisiblePart.getMinY()) / fDivisorY);
+
+ // combine with real BitmapSizePixel to get bitmap coordinates
+ const Size aBitmapSizePixel(maOldRenderedBitmap.GetSizePixel());
+ const sal_Int32 nX(basegfx::fround(fRelativeX * aBitmapSizePixel.Width()));
+ const sal_Int32 nY(basegfx::fround(fRelativeY * aBitmapSizePixel.Height()));
+
+ // try to get a statement about transparency in that pixel
+ o_rResult = (0 != maOldRenderedBitmap.GetAlpha(nX, nY));
+ return true;
}
ScenePrimitive2D::ScenePrimitive2D(
diff --git a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
index f4970777d13c..5295cbedc37d 100644
--- a/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/svggradientprimitive2d.cxx
@@ -817,22 +817,22 @@ namespace drawinglayer::primitive2d
{
const SvgGradientHelper* pSvgGradientHelper = dynamic_cast< const SvgGradientHelper* >(&rPrimitive);
- if(pSvgGradientHelper && SvgGradientHelper::operator==(*pSvgGradientHelper))
- {
- const SvgRadialGradientPrimitive2D& rCompare = static_cast< const SvgRadialGradientPrimitive2D& >(rPrimitive);
+ if(!pSvgGradientHelper || !SvgGradientHelper::operator==(*pSvgGradientHelper))
+ return false;
+
+ const SvgRadialGradientPrimitive2D& rCompare = static_cast< const SvgRadialGradientPrimitive2D& >(rPrimitive);
- if(getRadius() == rCompare.getRadius())
+ if(getRadius() == rCompare.getRadius())
+ {
+ if(isFocalSet() == rCompare.isFocalSet())
{
- if(isFocalSet() == rCompare.isFocalSet())
+ if(isFocalSet())
{
- if(isFocalSet())
- {
- return getFocal() == rCompare.getFocal();
- }
- else
- {
- return true;
- }
+ return getFocal() == rCompare.getFocal();
+ }
+ else
+ {
+ return true;
}
}
}
@@ -1061,24 +1061,24 @@ namespace drawinglayer::primitive2d
bool SvgRadialAtomPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
{
- if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
- {
- const SvgRadialAtomPrimitive2D& rCompare = static_cast< const SvgRadialAtomPrimitive2D& >(rPrimitive);
+ if(!DiscreteMetricDependentPrimitive2D::operator==(rPrimitive))
+ return false;
- if(getColorA() == rCompare.getColorA()
- && getColorB() == rCompare.getColorB()
- && getScaleA() == rCompare.getScaleA()
- && getScaleB() == rCompare.getScaleB())
+ const SvgRadialAtomPrimitive2D& rCompare = static_cast< const SvgRadialAtomPrimitive2D& >(rPrimitive);
+
+ if(getColorA() == rCompare.getColorA()
+ && getColorB() == rCompare.getColorB()
+ && getScaleA() == rCompare.getScaleA()
+ && getScaleB() == rCompare.getScaleB())
+ {
+ if(isTranslateSet() && rCompare.isTranslateSet())
{
- if(isTranslateSet() && rCompare.isTranslateSet())
- {
- return (getTranslateA() == rCompare.getTranslateA()
- && getTranslateB() == rCompare.getTranslateB());
- }
- else if(!isTranslateSet() && !rCompare.isTranslateSet())
- {
- return true;
- }
+ return (getTranslateA() == rCompare.getTranslateA()
+ && getTranslateB() == rCompare.getTranslateB());
+ }
+ else if(!isTranslateSet() && !rCompare.isTranslateSet())
+ {
+ return true;
}
}
diff --git a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
index 2993b1dd27c3..a7015ff8e578 100644
--- a/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudelathetools3d.cxx
@@ -312,26 +312,26 @@ namespace
// polygon is closed, one of the points is a member
const sal_uInt32 nPointCount(rPoly.count());
- if(nPointCount)
- {
- basegfx::B2DPoint aCurrent(rPoly.getB2DPoint(0));
- const basegfx::B2DVector aVector(rEnd - rStart);
+ if(!nPointCount)
+ return false;
- for(sal_uInt32 a(0); a < nPointCount; a++)
- {
- const sal_uInt32 nNextIndex((a + 1) % nPointCount);
- const basegfx::B2DPoint aNext(rPoly.getB2DPoint(nNextIndex));
- const basegfx::B2DVector aEdgeVector(aNext - aCurrent);
+ basegfx::B2DPoint aCurrent(rPoly.getB2DPoint(0));
+ const basegfx::B2DVector aVector(rEnd - rStart);
- if(basegfx::utils::findCut(
- rStart, aVector,
- aCurrent, aEdgeVector) != CutFlagValue::NONE)
- {
- return true;
- }
+ for(sal_uInt32 a(0); a < nPointCount; a++)
+ {
+ const sal_uInt32 nNextIndex((a + 1) % nPointCount);
+ const basegfx::B2DPoint aNext(rPoly.getB2DPoint(nNextIndex));
+ const basegfx::B2DVector aEdgeVector(aNext - aCurrent);
- aCurrent = aNext;
+ if(basegfx::utils::findCut(
+ rStart, aVector,
+ aCurrent, aEdgeVector) != CutFlagValue::NONE)
+ {
+ return true;
}
+
+ aCurrent = aNext;
}
return false;