Rebased ref, commits from common ancestor: commit 0451efeb735359c04c71a6f58e031ebac27b3761 Author: Katarina Behrens <katarina.behr...@cib.de> Date: Mon Jul 2 11:41:10 2018 +0200
Draw button focus so that it doesn't obscure the actual button Change-Id: I0df51b8dfd75dd966639d0893c379f2038c949ff diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 75e7c8664ab4..9377a134fdc4 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -81,6 +81,7 @@ void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf) KDE5SalGraphics::KDE5SalGraphics() : SvpSalGraphics() { + initStyles(); } bool KDE5SalGraphics::IsNativeControlSupported(ControlType type, ControlPart part) @@ -218,12 +219,6 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, case ControlType::Tooltip: m_image->fill(QApplication::palette().color(QPalette::ToolTipBase).rgb()); break; - case ControlType::Pushbutton: - if (nControlState & ControlState::FOCUSED) - m_image->fill(QApplication::palette().color(QPalette::Highlight).rgb()); - else - m_image->fill(QApplication::palette().color(QPalette::Button).rgb()); - break; case ControlType::Scrollbar: if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz)) @@ -241,9 +236,21 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, if (type == ControlType::Pushbutton) { - QStyleOptionButton option; - draw(QStyle::CE_PushButton, &option, m_image.get(), - vclStateValue2StateFlag(nControlState, value)); + if (part == ControlPart::Entire) + { + QStyleOptionButton option; + draw(QStyle::CE_PushButton, &option, m_image.get(), + vclStateValue2StateFlag(nControlState, value)); + } + else if (part == ControlPart::Focus) + { + QStyleOptionButton option; + option.state = QStyle::State_HasFocus; + option.rect = m_image->rect(); + QPainter painter(m_image.get()); + m_focusedButton->style()->drawControl(QStyle::CE_PushButton, &option, &painter, + m_focusedButton.get()); + } } else if (type == ControlType::Menubar) { @@ -991,4 +998,15 @@ bool KDE5SalGraphics::hitTestNativeControl(ControlType nType, ControlPart nPart, return false; } +void KDE5SalGraphics::initStyles() +{ + // button focus + m_focusedButton.reset(new QPushButton()); + QString aHighlightColor = QApplication::palette().color(QPalette::Highlight).name(); + QString focusStyleSheet("background-color: rgb(0,0,0,0%); border: 1px; border-radius: 2px; " + "border-color: %1; border-style:solid;"); + focusStyleSheet.replace("%1", aHighlightColor); + m_focusedButton->setStyleSheet(focusStyleSheet); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx index 77121459e8be..e70159ba9568 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.hxx +++ b/vcl/unx/kde5/KDE5SalGraphics.hxx @@ -25,6 +25,7 @@ #include <headless/svpgdi.hxx> #include <QtGui/QImage> +#include <QtWidgets/QPushButton> class KDE5SalFrame; @@ -49,6 +50,11 @@ public: std::unique_ptr<QImage> m_image; QRect lastPopupRect; + +private: + void initStyles(); + + std::unique_ptr<QPushButton> m_focusedButton; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit ab1e307f3232f2ef3d3d9626e949081d3aa9a3c5 Author: Katarina Behrens <katarina.behr...@cib.de> Date: Thu Jun 28 13:42:00 2018 +0200 Use cairo's OVER operator to preserve transparency Change-Id: I1afae266a5308fa0dbf2488777ddb963e99199c7 diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 9163d8cf8133..de1145a6cc7c 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -35,8 +35,6 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> -#include <cairo.h> - #if ENABLE_CAIRO_CANVAS # if defined CAIRO_VERSION && CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0) # define CAIRO_OPERATOR_DIFFERENCE (static_cast<cairo_operator_t>(23)) @@ -1134,8 +1132,8 @@ void SvpSalGraphics::copyArea( long nDestX, copyBits(aTR, this); } -static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, - cairo_surface_t* source) +static basegfx::B2DRange renderWithOperator(cairo_t* cr, const SalTwoRect& rTR, + cairo_surface_t* source, cairo_operator_t eOperator = CAIRO_OPERATOR_SOURCE) { cairo_rectangle(cr, rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, rTR.mnDestHeight); @@ -1160,24 +1158,35 @@ static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, cairo_pattern_set_extend(sourcepattern, CAIRO_EXTEND_REPEAT); cairo_pattern_set_filter(sourcepattern, CAIRO_FILTER_NEAREST); } - cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); + cairo_set_operator(cr, eOperator); cairo_paint(cr); cairo_restore(cr); return extents; } -void SvpSalGraphics::copySource( const SalTwoRect& rTR, - cairo_surface_t* source ) +static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, + cairo_surface_t* source) +{ + return renderWithOperator(cr, rTR, source, CAIRO_OPERATOR_SOURCE); +} + +void SvpSalGraphics::copyWithOperator( const SalTwoRect& rTR, cairo_surface_t* source, + cairo_operator_t eOp ) { cairo_t* cr = getCairoContext(false); clipRegion(cr); - basegfx::B2DRange extents = renderSource(cr, rTR, source); + basegfx::B2DRange extents = renderWithOperator(cr, rTR, source, eOp); releaseCairoContext(cr, false, extents); } +void SvpSalGraphics::copySource( const SalTwoRect& rTR, cairo_surface_t* source ) +{ + copyWithOperator(rTR, source, CAIRO_OPERATOR_SOURCE); +} + void SvpSalGraphics::copyBits( const SalTwoRect& rTR, SalGraphics* pSrcGraphics ) { @@ -1224,10 +1233,10 @@ void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceB copySource(rTR, source); } -void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, BitmapBuffer* pBuffer) +void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, BitmapBuffer* pBuffer, cairo_operator_t eOp) { cairo_surface_t* source = createCairoSurface( pBuffer ); - copySource(rTR, source); + copyWithOperator(rTR, source, eOp); } void SvpSalGraphics::drawBitmap( const SalTwoRect& rTR, diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index 860eacec7cbf..6571d21cf89d 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -24,6 +24,7 @@ #include <vcl/sysdata.hxx> #include <vcl/metric.hxx> #include <config_cairo_canvas.h> +#include <cairo.h> #include <salgdi.hxx> #include <sallayout.hxx> @@ -111,6 +112,8 @@ public: private: void invert(const basegfx::B2DPolygon &rPoly, SalInvert nFlags); void copySource(const SalTwoRect& rTR, cairo_surface_t* source); + void copyWithOperator(const SalTwoRect& rTR, cairo_surface_t* source, + cairo_operator_t eOp = CAIRO_OPERATOR_SOURCE); void setupPolyPolygon(cairo_t* cr, const basegfx::B2DPolyPolygon& rPolyPoly); void applyColor(cairo_t *cr, Color rColor); void drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly); @@ -225,7 +228,8 @@ public: virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) override; void drawBitmap( const SalTwoRect& rPosAry, - BitmapBuffer* pBuffer ); + BitmapBuffer* pBuffer, + cairo_operator_t eOp ); virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, const SalBitmap& rTransparentBitmap ) override; diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 6ec1e6e385ea..75e7c8664ab4 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -622,7 +622,7 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, QImage2BitmapBuffer(m_image.get(), pBuffer); SalTwoRect aTR(0, 0, m_image.get()->width(), m_image.get()->height(), rControlRegion.getX(), rControlRegion.getY(), rControlRegion.GetWidth(), rControlRegion.GetHeight()); - drawBitmap(aTR, pBuffer); + drawBitmap(aTR, pBuffer, CAIRO_OPERATOR_OVER); delete localClipRegion; return returnVal; commit 0cd51a4931bd61fb4aa9c6f021d00bbf4a879951 Author: Katarina Behrens <katarina.behr...@cib.de> Date: Wed Jun 27 10:41:03 2018 +0200 Implement native modality for modal dialogs instead of hack with hiding the window and showing it again (otherwise modality change has no effect and worse yet, weird things happen) it would be much easier to use QDialog Change-Id: Ie7029ca66380495c4aad246d02f4b96cb55eb01e diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx index 268441ea688a..96446c28a358 100644 --- a/vcl/inc/qt5/Qt5Frame.hxx +++ b/vcl/inc/qt5/Qt5Frame.hxx @@ -107,6 +107,7 @@ public: virtual void GetClientSize(long& rWidth, long& rHeight) override; virtual void GetWorkArea(tools::Rectangle& rRect) override; virtual SalFrame* GetParent() const override; + virtual void SetModal(bool bModal) override; virtual void SetWindowState(const SalFrameState* pState) override; virtual bool GetWindowState(SalFrameState* pState) override; virtual void ShowFullScreen(bool bFullScreen, sal_Int32 nDisplay) override; diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 9c5b8edbc5be..b47b64ab1cb8 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -345,6 +345,18 @@ void Qt5Frame::GetWorkArea(tools::Rectangle& rRect) SalFrame* Qt5Frame::GetParent() const { return m_pParent; } +void Qt5Frame::SetModal(bool bModal) +{ + if (m_pQWidget->isWindow()) + { + // modality change is only effective if the window is hidden + m_pQWidget->windowHandle()->hide(); + m_pQWidget->windowHandle()->setModality(bModal ? Qt::WindowModal : Qt::NonModal); + // and shown again + m_pQWidget->windowHandle()->show(); + } +} + void Qt5Frame::SetWindowState(const SalFrameState* pState) { if (!m_pQWidget->isWindow() || !pState || isChild(true, false)) commit 9ebe6de8a7ae4d0bc19d6805615932149910c6b8 Author: Katarina Behrens <katarina.behr...@cib.de> Date: Tue Jun 26 11:48:52 2018 +0200 Traversing dialog controls backwards (Shift-Tab) works now Change-Id: If0e8d7307dd37436751e524d7ed24e89d5b72db3 diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 3e3448381946..c4d38264782c 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -257,6 +257,10 @@ static sal_uInt16 GetKeyCode(int keyval) nCode = KEY_ESCAPE; break; case Qt::Key_Tab: + // oddly enough, Qt doesn't send Shift-Tab event as 'Tab key pressed with Shift + // modifier' but as 'Backtab key pressed' (while its modifier bits are still + // set to Shift) -- so let's map both Key_Tab and Key_Backtab to VCL's KEY_TAB + case Qt::Key_Backtab: nCode = KEY_TAB; break; case Qt::Key_Backspace: commit b39f5d3149f1a02f6a14db733ae03e2dd2984c60 Author: Katarina Behrens <katarina.behr...@cib.de> Date: Fri Jun 22 15:53:51 2018 +0200 Ignore closeEvent if user has vetoed closing the frame Change-Id: Ib86ec0d297e23c02ad50ce1044859e029eae2ba9 diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 8c62280d3f99..3e3448381946 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -199,9 +199,18 @@ void VclQtMixinBase::mixinShowEvent(QShowEvent*) m_pFrame->CallCallback(SalEvent::Paint, &aPaintEvt); } -void VclQtMixinBase::mixinCloseEvent(QCloseEvent* /*pEvent*/) +void VclQtMixinBase::mixinCloseEvent(QCloseEvent* pEvent) { - m_pFrame->CallCallback(SalEvent::Close, nullptr); + bool bRet = false; + bRet = m_pFrame->CallCallback(SalEvent::Close, nullptr); + + if (bRet) + pEvent->accept(); + // SalEvent::Close returning false may mean that user has vetoed + // closing the frame ("you have unsaved changes" dialog for example) + // We should't process the event in such case + else + pEvent->ignore(); } static sal_uInt16 GetKeyCode(int keyval) commit 304c817b5994462eed8848f14376a5458f771ecf Author: Katarina Behrens <katarina.behr...@cib.de> Date: Fri Jun 22 15:20:34 2018 +0200 Rearrange and annotate funcs by XInterface Change-Id: Ie429074fdbe8fb4e28b1af47486bc70c5f8070e8 diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index d4e6d507dd79..123df3a09118 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -105,17 +105,33 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged); connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged); - connect(this, &KDE5FilePicker::setTitleSignal /*(const OUString&)*/, this, - &KDE5FilePicker::setTitleSlot /*(const OUString&)*/, Qt::BlockingQueuedConnection); - connect(this, &KDE5FilePicker::setDefaultNameSignal, this, &KDE5FilePicker::setDefaultNameSlot, + + // XExecutableDialog + connect(this, &KDE5FilePicker::setTitleSignal, this, &KDE5FilePicker::setTitleSlot, Qt::BlockingQueuedConnection); - connect(this, &KDE5FilePicker::setDisplayDirectorySignal /*(const OUString&)*/, this, - &KDE5FilePicker::setDisplayDirectorySlot /*(const OUString&)*/, + // XFilePicker + connect(this, &KDE5FilePicker::setMultiSelectionSignal, this, + &KDE5FilePicker::setMultiSelectionSlot, Qt::BlockingQueuedConnection); + connect(this, &KDE5FilePicker::setDefaultNameSignal, this, &KDE5FilePicker::setDefaultNameSlot, Qt::BlockingQueuedConnection); + connect(this, &KDE5FilePicker::setDisplayDirectorySignal, this, + &KDE5FilePicker::setDisplayDirectorySlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::getDisplayDirectorySignal, this, &KDE5FilePicker::getDisplayDirectorySlot, Qt::BlockingQueuedConnection); - connect(this, &KDE5FilePicker::setMultiSelectionSignal, this, - &KDE5FilePicker::setMultiSelectionSlot, Qt::BlockingQueuedConnection); + // XFolderPicker + connect(this, &KDE5FilePicker::getDirectorySignal, this, &KDE5FilePicker::getDirectorySlot, + Qt::BlockingQueuedConnection); + // XFilterManager + connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot, + Qt::BlockingQueuedConnection); + connect(this, &KDE5FilePicker::setCurrentFilterSignal, this, + &KDE5FilePicker::setCurrentFilterSlot, Qt::BlockingQueuedConnection); + connect(this, &KDE5FilePicker::getCurrentFilterSignal, this, + &KDE5FilePicker::getCurrentFilterSlot, Qt::BlockingQueuedConnection); + // XFilterGroupManager + connect(this, &KDE5FilePicker::appendFilterGroupSignal, this, + &KDE5FilePicker::appendFilterGroupSlot, Qt::BlockingQueuedConnection); + // XFilePickerControlAccess connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::getValueSignal, this, &KDE5FilePicker::getValueSlot, @@ -126,18 +142,9 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::enableControlSignal, this, &KDE5FilePicker::enableControlSlot, Qt::BlockingQueuedConnection); - connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot, - Qt::BlockingQueuedConnection); - connect(this, &KDE5FilePicker::appendFilterGroupSignal, this, - &KDE5FilePicker::appendFilterGroupSlot, Qt::BlockingQueuedConnection); - connect(this, &KDE5FilePicker::setCurrentFilterSignal, this, - &KDE5FilePicker::setCurrentFilterSlot, Qt::BlockingQueuedConnection); - connect(this, &KDE5FilePicker::getCurrentFilterSignal, this, - &KDE5FilePicker::getCurrentFilterSlot, Qt::BlockingQueuedConnection); + // XFilePicker2 connect(this, &KDE5FilePicker::getSelectedFilesSignal, this, &KDE5FilePicker::getSelectedFilesSlot, Qt::BlockingQueuedConnection); - connect(this, &KDE5FilePicker::getDirectorySignal, this, - &KDE5FilePicker::getDirectorySlot, Qt::BlockingQueuedConnection); qApp->installEventFilter(this); } @@ -161,6 +168,7 @@ void SAL_CALL KDE5FilePicker::removeFilePickerListener(const uno::Reference<XFil m_xListener.clear(); } +// XExecutableDialog void SAL_CALL KDE5FilePicker::setTitle(const OUString& title) { if (qApp->thread() != QThread::currentThread()) @@ -184,6 +192,7 @@ sal_Int16 SAL_CALL KDE5FilePicker::execute() return _dialog->exec() == QFileDialog::Accepted ? 1 : 0; } +// XFilePicker void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) { if (qApp->thread() != QThread::currentThread()) @@ -240,6 +249,7 @@ uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getFiles() return seq; } +// XFilePicker2 uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getSelectedFiles() { if (qApp->thread() != QThread::currentThread()) @@ -260,6 +270,7 @@ uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getSelectedFiles() return seq; } +// XFilterManager void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString& filter) { if (qApp->thread() != QThread::currentThread()) @@ -312,6 +323,7 @@ OUString SAL_CALL KDE5FilePicker::getCurrentFilter() return filter; } +// XFilterGroupManager void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& rGroupTitle, const uno::Sequence<beans::StringPair>& filters) { @@ -329,6 +341,7 @@ void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& rGroupTitle, } } +// XFilePickerControlAccess void SAL_CALL KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, const uno::Any& value) { @@ -433,6 +446,7 @@ OUString SAL_CALL KDE5FilePicker::getLabel(sal_Int16 controlId) return label; } +// XFolderPicker OUString SAL_CALL KDE5FilePicker::getDirectory() { if (qApp->thread() != QThread::currentThread()) @@ -546,6 +560,7 @@ OUString KDE5FilePicker::implGetDirectory() return dir; } +// XInitialization void SAL_CALL KDE5FilePicker::initialize(const uno::Sequence<uno::Any>& args) { // parameter checking @@ -665,11 +680,13 @@ void SAL_CALL KDE5FilePicker::initialize(const uno::Sequence<uno::Any>& args) setTitle(VclResId(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN)); } +// XCancellable void SAL_CALL KDE5FilePicker::cancel() { // TODO } +// XEventListener void KDE5FilePicker::disposing(const lang::EventObject& rEvent) { uno::Reference<XFilePickerListener> xFilePickerListener(rEvent.Source, uno::UNO_QUERY); @@ -680,6 +697,7 @@ void KDE5FilePicker::disposing(const lang::EventObject& rEvent) } } +// XServiceInfo OUString SAL_CALL KDE5FilePicker::getImplementationName() { return OUString("com.sun.star.ui.dialogs.KDE5FilePicker"); commit 55541d9a0db888b598e93c2dbcd54cee96b684e5 Author: Katarina Behrens <katarina.behr...@cib.de> Date: Wed Jun 20 11:51:35 2018 +0200 Implement getDirectory, signal+slot also factor some shared code out into separate func Change-Id: I49d25eeb4eb647b72dae78c42301091d198eeff4 diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 6f175cc375cf..d1a300be014c 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -157,6 +157,7 @@ public: private: //add a custom control widget to the file dialog void addCustomControl(sal_Int16 controlId); + OUString implGetDirectory(); // emit XFilePickerListener controlStateChanged event void filterChanged(); @@ -171,6 +172,7 @@ Q_SIGNALS: void setDefaultNameSignal(const OUString& rName); void setDisplayDirectorySignal(const OUString& rDir); OUString getDisplayDirectorySignal(); + OUString getDirectorySignal(); void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue); css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction); @@ -189,7 +191,8 @@ private Q_SLOTS: void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } void setDefaultNameSlot(const OUString& rName) { return setDefaultName(rName); } void setDisplayDirectorySlot(const OUString& rDir) { return setDisplayDirectory(rDir); } - OUString getDisplayDirectorySlot() { return getDisplayDirectory(); } + OUString getDisplayDirectorySlot() { return implGetDirectory(); } + OUString getDirectorySlot() { return implGetDirectory(); } void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue) { return setValue(nControlId, nControlAction, rValue); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 56734b4d36e9..d4e6d507dd79 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -136,6 +136,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) &KDE5FilePicker::getCurrentFilterSlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::getSelectedFilesSignal, this, &KDE5FilePicker::getSelectedFilesSlot, Qt::BlockingQueuedConnection); + connect(this, &KDE5FilePicker::getDirectorySignal, this, + &KDE5FilePicker::getDirectorySlot, Qt::BlockingQueuedConnection); qApp->installEventFilter(this); } @@ -227,8 +229,7 @@ OUString SAL_CALL KDE5FilePicker::getDisplayDirectory() return Q_EMIT getDisplayDirectorySignal(); } - OUString dir = toOUString(_dialog->directoryUrl().url()); - return dir; + return implGetDirectory(); } uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getFiles() @@ -432,7 +433,16 @@ OUString SAL_CALL KDE5FilePicker::getLabel(sal_Int16 controlId) return label; } -OUString SAL_CALL KDE5FilePicker::getDirectory() { return OUString(); } +OUString SAL_CALL KDE5FilePicker::getDirectory() +{ + if (qApp->thread() != QThread::currentThread()) + { + SolarMutexReleaser aReleaser; + return Q_EMIT getDirectorySignal(); + } + + return implGetDirectory(); +} void SAL_CALL KDE5FilePicker::setDescription(const OUString&) {} @@ -530,6 +540,12 @@ void KDE5FilePicker::addCustomControl(sal_Int16 controlId) } } +OUString KDE5FilePicker::implGetDirectory() +{ + OUString dir = toOUString(_dialog->directoryUrl().url()); + return dir; +} + void SAL_CALL KDE5FilePicker::initialize(const uno::Sequence<uno::Any>& args) { // parameter checking commit e4601e4e2f9651a732635f639b6cd04f2f78688a Author: Katarina Behrens <katarina.behr...@cib.de> Date: Tue Jun 19 15:59:50 2018 +0200 Folder picker is now really a folder picker and not a regular file picker with wrong title Change-Id: I849e7bb3d0cad197880fadd865f4d39f13245e97 diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 4fbbc487394c..6f175cc375cf 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -79,6 +79,7 @@ protected: QGridLayout* _layout; bool allowRemoteUrls; + bool mbIsFolderPicker; public: explicit KDE5FilePicker(QFileDialog::FileMode); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 46bcccf4bd24..56734b4d36e9 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -83,6 +83,7 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) , _extraControls(new QWidget) , _layout(new QGridLayout(_extraControls)) , allowRemoteUrls(false) + , mbIsFolderPicker(eMode == QFileDialog::Directory) { _dialog->setSupportedSchemes({ QStringLiteral("file"), @@ -96,14 +97,12 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) _dialog->setFileMode(eMode); - if (eMode == QFileDialog::Directory) + if (mbIsFolderPicker) { _dialog->setOption(QFileDialog::ShowDirsOnly, true); _dialog->setWindowTitle(toQString(VclResId(STR_FPICKER_FOLDER_DEFAULT_TITLE))); } - setMultiSelectionMode(false); - connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged); connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged); connect(this, &KDE5FilePicker::setTitleSignal /*(const OUString&)*/, this, @@ -191,6 +190,9 @@ void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) return Q_EMIT setMultiSelectionSignal(multiSelect); } + if (mbIsFolderPicker) + return; + _dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile); } commit 9346170029cef61e84adccb4a2a55e3ea5b77ce9 Author: Katarina Behrens <katarina.behr...@cib.de> Date: Tue Jun 19 13:01:43 2018 +0200 Fix initial switch to folder in fileopen dlg the argument passed is an URL, so using setDirectory wouldn't do the trick, setDirectoryUrl would Change-Id: I312f6e2a06b46777dc126f95f63ec0dbcb1f5799 diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 3d1491eab5cc..46bcccf4bd24 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -213,7 +213,8 @@ void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir) return Q_EMIT setDisplayDirectorySignal(dir); } - _dialog->setDirectory(toQString(dir)); + QString qDir(toQString(dir)); + _dialog->setDirectoryUrl(QUrl(qDir)); } OUString SAL_CALL KDE5FilePicker::getDisplayDirectory() commit 322083e0cf1268bc5d40f0d49eb50f00f503ef15 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Jul 3 09:52:52 2018 +0200 ScFormEditData copy functions can be deleted Change-Id: Id6aad74198da68aa6475bcd3b17c993a51ccabe9 Reviewed-on: https://gerrit.libreoffice.org/56846 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sc/source/ui/formdlg/formdata.cxx b/sc/source/ui/formdlg/formdata.cxx index 3dfb94754fb5..3ab8130d7721 100644 --- a/sc/source/ui/formdlg/formdata.cxx +++ b/sc/source/ui/formdlg/formdata.cxx @@ -31,11 +31,6 @@ ScFormEditData::~ScFormEditData() { } -ScFormEditData::ScFormEditData( const ScFormEditData& r ) : formula::FormEditData(r) -{ - *this = r; -} - void ScFormEditData::SaveValues() { Reset(); diff --git a/sc/source/ui/inc/formdata.hxx b/sc/source/ui/inc/formdata.hxx index b1cd27d711e7..28fa69398a33 100644 --- a/sc/source/ui/inc/formdata.hxx +++ b/sc/source/ui/inc/formdata.hxx @@ -39,8 +39,8 @@ public: virtual void SaveValues() override; private: - ScFormEditData( const ScFormEditData& ); -// const ScFormEditData& operator=( const ScFormEditData& r ); + ScFormEditData(ScFormEditData &) = delete; + void operator =(ScFormEditData) = delete; ScInputHandler* pInputHandler; ScDocShell* pScDocShell; commit 75b3f109f674a295c88c29bf03f6c4d10d7d7343 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Jul 3 09:48:52 2018 +0200 ScAsciiOptions copy assignment op can be left implicitly defined ...which removes a -Wdeprecated-copy (because the copy ctor is already not user- declared) with GCC trunk towards GCC 9 (and makes SetColInfo unused). Curiously, the user-provided copy assignment op didn't copy the eLang member, but assume that was by accident rather than on purpose. Change-Id: I3116500b748f0625acf1368d0106ade94f0dfa26 Reviewed-on: https://gerrit.libreoffice.org/56845 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index d8ea57518e93..94bcb4494544 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -47,17 +47,6 @@ ScAsciiOptions::~ScAsciiOptions() { } -void ScAsciiOptions::SetColInfo( sal_uInt16 nCount, const sal_Int32* pStart, const sal_uInt8* pFormat ) -{ - mvColStart.resize(nCount); - mvColFormat.resize(nCount); - for (sal_uInt16 i=0; i<nCount; i++) - { - mvColStart[i] = pStart[i]; - mvColFormat[i] = pFormat[i]; - } -} - void ScAsciiOptions::SetColumnInfo( const ScCsvExpDataVec& rDataVec ) { sal_uInt16 nInfoCount = static_cast< sal_uInt16 >( rDataVec.size() ); @@ -70,27 +59,6 @@ void ScAsciiOptions::SetColumnInfo( const ScCsvExpDataVec& rDataVec ) } } -ScAsciiOptions& ScAsciiOptions::operator=( const ScAsciiOptions& rCpy ) -{ - SetColInfo( rCpy.mvColStart.size(), rCpy.mvColStart.data(), rCpy.mvColFormat.data() ); - - bFixedLen = rCpy.bFixedLen; - aFieldSeps = rCpy.aFieldSeps; - bMergeFieldSeps = rCpy.bMergeFieldSeps; - bRemoveSpace = rCpy.bRemoveSpace; - bQuotedFieldAsText = rCpy.bQuotedFieldAsText; - bDetectSpecialNumber = rCpy.bDetectSpecialNumber; - bSkipEmptyCells = rCpy.bSkipEmptyCells; - bSaveAsShown = rCpy.bSaveAsShown; - bSaveFormulas = rCpy.bSaveFormulas; - cTextSep = rCpy.cTextSep; - eCharSet = rCpy.eCharSet; - bCharSetSystem = rCpy.bCharSetSystem; - nStartRow = rCpy.nStartRow; - - return *this; -} - static OUString lcl_decodeSepString( const OUString & rSepNums, bool & o_bMergeFieldSeps ) { OUString aFieldSeps; diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx index d89fd6e1369a..c91ac25a5be5 100644 --- a/sc/source/ui/inc/asciiopt.hxx +++ b/sc/source/ui/inc/asciiopt.hxx @@ -51,8 +51,6 @@ public: static const sal_Unicode cDefaultTextSep = '"'; - ScAsciiOptions& operator=( const ScAsciiOptions& rCpy ); - void ReadFromString( const OUString& rString ); OUString WriteToString() const; @@ -84,7 +82,6 @@ public: void SetStartRow( long nRow) { nStartRow= nRow; } void SetLanguage(LanguageType e) { eLang = e; } - void SetColInfo( sal_uInt16 nCount, const sal_Int32* pStart, const sal_uInt8* pFormat ); void SetColumnInfo( const ScCsvExpDataVec& rDataVec ); /** From the import field separators obtain the one most likely to be used commit 79cb267812f0c22919fddc4d60d381fa649f8d05 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Tue Jul 3 10:19:21 2018 +0200 no need to switch models in the SvTreeListBox since we're replacing it completely anyhow. which means we can remove DisconnectFromModel Change-Id: I2f31d93eb95a641f3364d715111e70817c7e5087 Reviewed-on: https://gerrit.libreoffice.org/56849 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx index 75efb9995aa5..38e94cbcf199 100644 --- a/dbaccess/source/ui/browser/dbtreeview.cxx +++ b/dbaccess/source/ui/browser/dbtreeview.cxx @@ -50,18 +50,15 @@ DBTreeView::~DBTreeView() void DBTreeView::dispose() { - if (m_pTreeListBox) - { - if (m_pTreeListBox->GetModel()) - { - m_pTreeListBox->GetModel()->RemoveView(m_pTreeListBox); - m_pTreeListBox->DisconnectFromModel(); - } - } m_pTreeListBox.disposeAndClear(); vcl::Window::dispose(); } +SvTreeList* DBTreeView::GetTreeModel() +{ + return m_pTreeListBox->GetModel(); +} + void DBTreeView::SetPreExpandHandler(const Link<SvTreeListEntry*,bool>& _rHdl) { m_pTreeListBox->SetPreExpandHandler(_rHdl); @@ -78,13 +75,6 @@ void DBTreeView::Resize() m_pTreeListBox->SetPosSizePixel(Point(0,0),GetOutputSizePixel()); } -void DBTreeView::setModel(SvTreeList* _pTreeModel) -{ - if (_pTreeModel) - _pTreeModel->InsertView(m_pTreeListBox); - m_pTreeListBox->SetModel(_pTreeModel); -} - void DBTreeView::setSelChangeHdl( const Link<LinkParamNone*,void>& _rHdl ) { m_pTreeListBox->SetSelChangeHdl( _rHdl ); diff --git a/dbaccess/source/ui/browser/dbtreeview.hxx b/dbaccess/source/ui/browser/dbtreeview.hxx index 40994107f3d9..6ff5959e9ae5 100644 --- a/dbaccess/source/ui/browser/dbtreeview.hxx +++ b/dbaccess/source/ui/browser/dbtreeview.hxx @@ -52,7 +52,7 @@ namespace dbaui void setCopyHandler(const Link<LinkParamNone*,void>& _rHdl); - void setModel(SvTreeList* _pTreeModel); + SvTreeList* GetTreeModel(); void setSelChangeHdl(const Link<LinkParamNone*,void>& _rHdl); DBTreeListBox& getListBox() const { return *m_pTreeListBox; } diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index e5944d1969a0..1dd3a0991fb9 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -109,7 +109,7 @@ void SbaTableQueryBrowser::select(SvTreeListEntry* _pEntry, bool _bSelect) if (pTextItem) { static_cast<OBoldListboxString*>(pTextItem)->emphasize(_bSelect); - m_pTreeModel->InvalidateEntry(_pEntry); + m_pTreeView->GetTreeModel()->InvalidateEntry(_pEntry); } else { OSL_FAIL("SbaTableQueryBrowser::select: invalid entry!"); @@ -121,7 +121,7 @@ void SbaTableQueryBrowser::selectPath(SvTreeListEntry* _pEntry, bool _bSelect) while (_pEntry) { select(_pEntry, _bSelect); - _pEntry = m_pTreeModel->GetParent(_pEntry); + _pEntry = m_pTreeView->GetTreeModel()->GetParent(_pEntry); } } @@ -197,14 +197,15 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() { if ( m_pTreeView ) { + auto pTreeModel = m_pTreeView->GetTreeModel(); // change all bitmap entries - SvTreeListEntry* pEntryLoop = m_pTreeModel->First(); + SvTreeListEntry* pEntryLoop = pTreeModel->First(); while ( pEntryLoop ) { DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pEntryLoop->GetUserData()); if ( !pData ) { - pEntryLoop = m_pTreeModel->Next(pEntryLoop); + pEntryLoop = pTreeModel->Next(pEntryLoop); continue; } @@ -245,7 +246,7 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() break; } - pEntryLoop = m_pTreeModel->Next(pEntryLoop); + pEntryLoop = pTreeModel->Next(pEntryLoop); } } } diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx index dc34baf2443e..8ec849dac474 100644 --- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx +++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx @@ -233,10 +233,11 @@ namespace dbaui } void SbaTableQueryBrowser::clearTreeModel() { - if (m_pTreeModel) + if (m_pTreeView) { + auto pTreeModel = m_pTreeView->GetTreeModel(); // clear the user data of the tree model - SvTreeListEntry* pEntryLoop = m_pTreeModel->First(); + SvTreeListEntry* pEntryLoop = pTreeModel->First(); while (pEntryLoop) { DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pEntryLoop->GetUserData()); @@ -256,7 +257,7 @@ namespace dbaui delete pData; } - pEntryLoop = m_pTreeModel->Next(pEntryLoop); + pEntryLoop = pTreeModel->Next(pEntryLoop); } } m_pCurrentlyDisplayed = nullptr; diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 44fcb8688a07..6eb0557ceed3 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -213,7 +213,6 @@ SbaTableQueryBrowser::SbaTableQueryBrowser(const Reference< XComponentContext >& ,m_aTableCopyHelper(this) ,m_pTreeView(nullptr) ,m_pSplitter(nullptr) - ,m_pTreeModel(nullptr) ,m_pCurrentlyDisplayed(nullptr) ,m_nAsyncDrop(nullptr) ,m_bQueryEscapeProcessing( false ) @@ -286,16 +285,12 @@ void SAL_CALL SbaTableQueryBrowser::disposing() m_aSelectionListeners.disposeAndClear(aEvt); m_aContextMenuInterceptors.disposeAndClear(aEvt); - // reset the content's tree view: it holds a reference to our model which is to be deleted immediately, - // and it will live longer than we do. if (getBrowserView()) - getBrowserView()->setTreeView(nullptr); - - clearTreeModel(); - // clear the tree model { - std::unique_ptr<SvTreeList> aTemp(m_pTreeModel); - m_pTreeModel = nullptr; + // Need to do some cleaup of the data pointed to the tree view entries before we remove the treeview + clearTreeModel(); + m_pTreeView = nullptr; + getBrowserView()->setTreeView(nullptr); } // remove ourself as status listener @@ -364,10 +359,9 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent) getBrowserView()->setTreeView(m_pTreeView); // fill view with data - m_pTreeModel = new SvTreeList; - m_pTreeModel->SetSortMode(SortAscending); - m_pTreeModel->SetCompareHdl(LINK(this, SbaTableQueryBrowser, OnTreeEntryCompare)); - m_pTreeView->setModel(m_pTreeModel); + auto pTreeModel = m_pTreeView->GetTreeModel(); + pTreeModel->SetSortMode(SortAscending); + pTreeModel->SetCompareHdl(LINK(this, SbaTableQueryBrowser, OnTreeEntryCompare)); m_pTreeView->setSelChangeHdl( LINK( this, SbaTableQueryBrowser, OnSelectionChange ) ); // TODO @@ -2455,7 +2449,7 @@ SvTreeListEntry* SbaTableQueryBrowser::implGetConnectionEntry(SvTreeListEntry* _ DBTreeListUserData* pEntryData = static_cast< DBTreeListUserData* >( pCurrentEntry->GetUserData() ); while(pEntryData->eType != etDatasource ) { - pCurrentEntry = m_pTreeModel->GetParent(pCurrentEntry); + pCurrentEntry = m_pTreeView->GetTreeModel()->GetParent(pCurrentEntry); pEntryData = static_cast< DBTreeListUserData* >( pCurrentEntry->GetUserData() ); } return pCurrentEntry; @@ -2477,11 +2471,11 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry ) return false; } - OSL_ENSURE(m_pTreeModel->HasParent(_pEntry), "SbaTableQueryBrowser::implSelect: invalid entry (1)!"); - OSL_ENSURE(m_pTreeModel->HasParent(m_pTreeModel->GetParent(_pEntry)), "SbaTableQueryBrowser::implSelect: invalid entry (2)!"); + OSL_ENSURE(m_pTreeView->GetTreeModel()->HasParent(_pEntry), "SbaTableQueryBrowser::implSelect: invalid entry (1)!"); + OSL_ENSURE(m_pTreeView->GetTreeModel()->HasParent(m_pTreeView->GetTreeModel()->GetParent(_pEntry)), "SbaTableQueryBrowser::implSelect: invalid entry (2)!"); // get the entry for the tables or queries - SvTreeListEntry* pContainer = m_pTreeModel->GetParent(_pEntry); + SvTreeListEntry* pContainer = m_pTreeView->GetTreeModel()->GetParent(_pEntry); DBTreeListUserData* pContainerData = static_cast<DBTreeListUserData*>(pContainer->GetUserData()); // get the entry for the datasource @@ -2506,13 +2500,13 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry ) if ( etQueryContainer == pContainerData->eType ) { SvTreeListEntry* pTemp = pContainer; - while( m_pTreeModel->GetParent(pTemp) != pConnection ) + while( m_pTreeView->GetTreeModel()->GetParent(pTemp) != pConnection ) { sNameBuffer.insert(0,'/'); pString = static_cast<SvLBoxString*>(pTemp->GetFirstItem(SvLBoxItemType::String)); OSL_ENSURE(pString,"There must be a string item!"); sNameBuffer.insert(0,pString->GetText()); - pTemp = m_pTreeModel->GetParent(pTemp); + pTemp = m_pTreeView->GetTreeModel()->GetParent(pTemp); } } OUString aName = sNameBuffer.makeStringAndClear(); @@ -2773,12 +2767,12 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven pTemp->SetUserData(nullptr); delete pData; // the data could be null because we have a table which isn't correct - m_pTreeModel->Remove(pTemp); + m_pTreeView->GetTreeModel()->Remove(pTemp); } else { // remove the entry from the model - SvTreeListEntry* pChild = m_pTreeModel->FirstChild(pContainer); + SvTreeListEntry* pChild = m_pTreeView->GetTreeModel()->FirstChild(pContainer); while(pChild) { if (m_pTreeView->getListBox().GetEntryText(pChild) == aName) @@ -2786,7 +2780,7 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pChild->GetUserData()); pChild->SetUserData(nullptr); delete pData; - m_pTreeModel->Remove(pChild); + m_pTreeView->GetTreeModel()->Remove(pChild); break; } pChild = pChild->NextSibling(); @@ -2834,7 +2828,7 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve else { // find the entry for this name - SvTreeListEntry* pChild = m_pTreeModel->FirstChild(pContainer); + SvTreeListEntry* pChild = m_pTreeView->GetTreeModel()->FirstChild(pContainer); while(pChild) { if (m_pTreeView->getListBox().GetEntryText(pChild) == aName) @@ -2921,9 +2915,9 @@ void SbaTableQueryBrowser::closeConnection(SvTreeListEntry* _pDSEntry, bool _bDi unloadAndCleanup(_bDisposeConnection); // collapse the query/table container - for (SvTreeListEntry* pContainers = m_pTreeModel->FirstChild(_pDSEntry); pContainers; pContainers = pContainers->NextSibling()) + for (SvTreeListEntry* pContainers = m_pTreeView->GetTreeModel()->FirstChild(_pDSEntry); pContainers; pContainers = pContainers->NextSibling()) { - SvTreeListEntry* pElements = m_pTreeModel->FirstChild(pContainers); + SvTreeListEntry* pElements = m_pTreeView->GetTreeModel()->FirstChild(pContainers); if ( pElements ) m_pTreeView->getListBox().Collapse(pContainers); m_pTreeView->getListBox().EnableExpandHandler(pContainers); @@ -2935,7 +2929,7 @@ void SbaTableQueryBrowser::closeConnection(SvTreeListEntry* _pDSEntry, bool _bDi DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pRemove->GetUserData()); pRemove->SetUserData(nullptr); delete pData; - m_pTreeModel->Remove(pRemove); + m_pTreeView->GetTreeModel()->Remove(pRemove); } } // collapse the entry itself @@ -3273,7 +3267,7 @@ bool SbaTableQueryBrowser::getExistentConnectionFor( SvTreeListEntry* _pAnyEntry bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvTreeListEntry* _pEntry ) const { - return m_pTreeModel->GetRootLevelParent( _pEntry ) == _pEntry; + return m_pTreeView->GetTreeModel()->GetRootLevelParent( _pEntry ) == _pEntry; } bool SbaTableQueryBrowser::ensureConnection( SvTreeListEntry* _pDSEntry, void* pDSData, SharedConnection& _rConnection ) @@ -3596,7 +3590,7 @@ OUString SbaTableQueryBrowser::getPrivateTitle() const OUString sTitle; if ( m_pCurrentlyDisplayed ) { - SvTreeListEntry* pContainer = m_pTreeModel->GetParent(m_pCurrentlyDisplayed); + SvTreeListEntry* pContainer = m_pTreeView->GetTreeModel()->GetParent(m_pCurrentlyDisplayed); // get the entry for the datasource SvTreeListEntry* pConnection = implGetConnectionEntry(pContainer); OUString sName = m_pTreeView->getListBox().GetEntryText(m_pCurrentlyDisplayed); @@ -3721,7 +3715,7 @@ void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const OUString& _rDataSo // delete any user data of the child entries of the to-be-removed entry std::pair<SvTreeListEntries::const_iterator, SvTreeListEntries::const_iterator> aIters = - m_pTreeModel->GetChildIterators(pDataSourceEntry); + m_pTreeView->GetTreeModel()->GetChildIterators(pDataSourceEntry); SvTreeListEntries::const_iterator it = aIters.first, itEnd = aIters.second; @@ -3737,7 +3731,7 @@ void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const OUString& _rDataSo DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( pDataSourceEntry->GetUserData() ); pDataSourceEntry->SetUserData( nullptr ); delete pData; - m_pTreeModel->Remove( pDataSourceEntry ); + m_pTreeView->GetTreeModel()->Remove( pDataSourceEntry ); } void SAL_CALL SbaTableQueryBrowser::revokedDatabaseLocation( const DatabaseRegistrationEvent& Event ) diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index 49ee4e3b513e..1e4417c5df47 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -99,9 +99,8 @@ namespace dbaui OUString m_sQueryCommand; // the command of the query currently loaded (if any) //OUString m_sToBeLoaded; // contains the element name which should be loaded if any - VclPtr<DBTreeView> m_pTreeView; + VclPtr<DBTreeView> m_pTreeView; // contains the datasources of the registry VclPtr<Splitter> m_pSplitter; - SvTreeList* m_pTreeModel; // contains the datasources of the registry SvTreeListEntry* m_pCurrentlyDisplayed; ImplSVEvent * m_nAsyncDrop; diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx index 5bb92a84a005..248e9d8d4e80 100644 --- a/include/svtools/treelistbox.hxx +++ b/include/svtools/treelistbox.hxx @@ -582,8 +582,6 @@ public: void SetNoAutoCurEntry( bool b ); - void DisconnectFromModel(); - void EnableCheckButton( SvLBoxButtonData* ); void SetCheckButtonData( SvLBoxButtonData* ); void SetNodeBitmaps( const Image& rCollapsedNodeBmp, const Image& rExpandedNodeBmp ); diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 5d9bc907ae24..716a1a2cc00b 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -1402,15 +1402,6 @@ void SvTreeListBox::SetBaseModel( SvTreeList* pNewModel ) } } -void SvTreeListBox::DisconnectFromModel() -{ - SvTreeList* pNewModel = new SvTreeList; - pNewModel->SetRefCount( 0 ); // else this will never be deleted - SvListView::SetModel( pNewModel ); - - pImpl->SetModel( GetModel() ); -} - void SvTreeListBox::SetSublistOpenWithReturn() { pImpl->bSubLstOpRet = true; commit e119194aeec907f3d02cb914e5afde5ac763df7c Author: Gabor Kelemen <kelem...@ubuntu.com> Date: Tue Jul 3 07:41:47 2018 +0200 tdf#118452 Don't crash when multi thread calculation is disabled ...by default configuration. Change-Id: If6075ae66537f613434dd38766324436f2426517 Reviewed-on: https://gerrit.libreoffice.org/56840 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx index 77652e6d22b5..dc9ae0e28284 100644 --- a/sc/source/ui/optdlg/tpcalc.cxx +++ b/sc/source/ui/optdlg/tpcalc.cxx @@ -183,7 +183,7 @@ void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ ) m_pEdPrec->SetValue(nPrec); } - m_pBtnThread->Enable(); + m_pBtnThread->Enable( !officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::isReadOnly() ); m_pBtnThread->Check( officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get() ); CheckClickHdl(m_pBtnIterate); commit 73356ae1a5c3eba957331d66bed042edb1fc7f6d Author: Andrea Gelmini <andrea.gelm...@gelma.net> Date: Mon Jun 25 23:48:38 2018 +0200 Removed executable permission on pptx files Change-Id: I4c7cc0f462fdd3ee2d2b44bc73f0313e6cd4176a Reviewed-on: https://gerrit.libreoffice.org/56423 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/sd/qa/unit/data/pptx/smartart-basicprocess.pptx b/sd/qa/unit/data/pptx/smartart-basicprocess.pptx old mode 100755 new mode 100644 diff --git a/sd/qa/unit/data/pptx/smartart-hierarchy.pptx b/sd/qa/unit/data/pptx/smartart-hierarchy.pptx old mode 100755 new mode 100644 diff --git a/sd/qa/unit/data/pptx/smartart-horizontalbulletlist.pptx b/sd/qa/unit/data/pptx/smartart-horizontalbulletlist.pptx old mode 100755 new mode 100644 diff --git a/sd/qa/unit/data/pptx/smartart-invertedPyramid.pptx b/sd/qa/unit/data/pptx/smartart-invertedPyramid.pptx old mode 100755 new mode 100644 diff --git a/sd/qa/unit/data/pptx/smartart-matrix.pptx b/sd/qa/unit/data/pptx/smartart-matrix.pptx old mode 100755 new mode 100644 diff --git a/sd/qa/unit/data/pptx/smartart-mutidirectional.pptx b/sd/qa/unit/data/pptx/smartart-mutidirectional.pptx old mode 100755 new mode 100644 diff --git a/sd/qa/unit/data/pptx/smartart-pyramid.pptx b/sd/qa/unit/data/pptx/smartart-pyramid.pptx old mode 100755 new mode 100644 diff --git a/sd/qa/unit/data/pptx/smartart-venndiagram.pptx b/sd/qa/unit/data/pptx/smartart-venndiagram.pptx old mode 100755 new mode 100644 commit 17882b5adfbfe8f92233a33d6f7e56e445a0f9f1 Author: Andrea Gelmini <andrea.gelm...@gelma.net> Date: Fri Jun 29 16:46:05 2018 +0200 Fix typos Change-Id: Ieacea4f6f53a0e55876a8b84d0dfeea8e308035d Reviewed-on: https://gerrit.libreoffice.org/56712 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx index 6abb875ff18f..309690048a49 100644 --- a/include/tools/urlobj.hxx +++ b/include/tools/urlobj.hxx @@ -202,7 +202,7 @@ public: specified character set and that can be converted to UTF-32 characters, are first decoded. If they have to be encoded, they are converted to UTF-8 characters and are than translated into - (sequences of) escape sequences. Other escape sequences are + (sequences of) escape sequences. Other escape sequences are copied verbatim (but using upper case hex digits). */ WasEncoded, @@ -386,7 +386,7 @@ public: /** Check if the scheme is one of the WebDAV scheme * we know about. * - * @return true is one othe scheme either public scheme or private scheme. + * @return true is one other scheme either public scheme or private scheme. */ bool isAnyKnownWebDAVScheme() const; commit 71654c950e7d56453cf314cfd179cd8afb9ce879 Author: Andrea Gelmini <andrea.gelm...@gelma.net> Date: Mon Jul 2 23:35:30 2018 +0200 Fix typo Change-Id: I8f2692a7f917b53c28783599b589fd0a39e3b880 Reviewed-on: https://gerrit.libreoffice.org/56835 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index c7d2a2ca2af3..ab7df4cdcf31 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1252,7 +1252,7 @@ DECLARE_RTFIMPORT_TEST(testTdf90097, "tdf90097.rtf") // thus I will correct the values here. // Indeed need to use the Linux values, I have no idea why these differ // from Mac/Win ones, but the disable above hints to that (maybe a problem - // of it's own). Factor between Twips and 100thmm is ca. 1.76 -> stable change + // of its own). Factor between Twips and 100thmm is ca. 1.76 -> stable change // Vertical flip for the line shape was ignored, so Y coordinates were swapped. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4972), rPolygon[0].X); // was: 2819, win is 10927 commit dbdf5ef32e2fc041183b762d9a1561430c96470b Author: Noel Grandin <noelgran...@gmail.com> Date: Sun Jul 1 22:04:20 2018 +0200 use std::unique_ptr for CreateObjectSpecificViewContact Change-Id: I0fed54d345a43fe0bc21ebbe424e6fdc7eac9523 Reviewed-on: https://gerrit.libreoffice.org/56823 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svx/cube3d.hxx b/include/svx/cube3d.hxx index 570805f8a908..b67d6995a5de 100644 --- a/include/svx/cube3d.hxx +++ b/include/svx/cube3d.hxx @@ -55,7 +55,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC E3dCubeObj final : public E3dCompoundObject bool bPosIsCenter : 1; void SetDefaultAttributes(const E3dDefaultAttributes& rDefault); - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; private: // protected destructor - due to final, make private diff --git a/include/svx/extrud3d.hxx b/include/svx/extrud3d.hxx index 656a1114a3ee..4bdb696decdf 100644 --- a/include/svx/extrud3d.hxx +++ b/include/svx/extrud3d.hxx @@ -38,7 +38,7 @@ private: // geometry, which determines the object basegfx::B2DPolyPolygon maExtrudePolygon; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; void SetDefaultAttributes(const E3dDefaultAttributes& rDefault); diff --git a/include/svx/lathe3d.hxx b/include/svx/lathe3d.hxx index 073bf5787e3c..8875621dc4ea 100644 --- a/include/svx/lathe3d.hxx +++ b/include/svx/lathe3d.hxx @@ -37,7 +37,7 @@ class SVX_DLLPUBLIC E3dLatheObj final : public E3dCompoundObject { basegfx::B2DPolyPolygon maPolyPoly2D; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; void SetDefaultAttributes(const E3dDefaultAttributes& rDefault); diff --git a/include/svx/polygn3d.hxx b/include/svx/polygn3d.hxx index da2225c74360..9d5940adf9e4 100644 --- a/include/svx/polygn3d.hxx +++ b/include/svx/polygn3d.hxx @@ -36,7 +36,7 @@ private: SVX_DLLPRIVATE void CreateDefaultTexture(); protected: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; // protected destructor virtual ~E3dPolygonObj() override; diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx index bc65f352f741..d3682c7369ff 100644 --- a/include/svx/scene3d.hxx +++ b/include/svx/scene3d.hxx @@ -61,7 +61,7 @@ class SVX_DLLPUBLIC E3dScene : public E3dObject, public SdrObjList { protected: virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; // transformations B3dCamera aCameraSet; diff --git a/include/svx/sphere3d.hxx b/include/svx/sphere3d.hxx index ca1d9ec644ef..490bf268942a 100644 --- a/include/svx/sphere3d.hxx +++ b/include/svx/sphere3d.hxx @@ -33,7 +33,7 @@ private: basegfx::B3DPoint aCenter; basegfx::B3DVector aSize; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; void SetDefaultAttributes(const E3dDefaultAttributes& rDefault); diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx index 8247b9b5fcce..f88b67755257 100644 --- a/include/svx/svdoashp.hxx +++ b/include/svx/svdoashp.hxx @@ -80,7 +80,7 @@ private: bool mbAdjustingTextFrameWidthAndHeight; protected: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual void impl_setUnoShape(const css::uno::Reference<css::uno::XInterface>& rxUnoShape) override; public: diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index d97edb022e4c..fa3a9cfff7b8 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -951,7 +951,7 @@ protected: virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties(); - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact(); + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact(); tools::Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const; diff --git a/include/svx/svdocapt.hxx b/include/svx/svdocapt.hxx index 0539861eb969..6791cf95d218 100644 --- a/include/svx/svdocapt.hxx +++ b/include/svx/svdocapt.hxx @@ -48,7 +48,7 @@ private: protected: virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; private: tools::Polygon aTailPoly; // the whole tail polygon diff --git a/include/svx/svdocirc.hxx b/include/svx/svdocirc.hxx index 0ec5ff01afae..62fa7c8be431 100644 --- a/include/svx/svdocirc.hxx +++ b/include/svx/svdocirc.hxx @@ -47,7 +47,7 @@ private: // only for SdrCircleAttributes SdrObjKind GetCircleKind() const { return meCircleKind; } - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; SdrObjKind meCircleKind; diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx index 366963395a32..723741ef12a1 100644 --- a/include/svx/svdoedge.hxx +++ b/include/svx/svdoedge.hxx @@ -136,7 +136,7 @@ private: friend class ImpEdgeHdl; protected: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; SdrObjConnection aCon1; // Connection status of the beginning of the line diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index 8171f353936d..6a146934ad5d 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -85,7 +85,7 @@ private: friend class SdrExchangeView; // Only for a ForceSwapIn() call. friend class SdrGraphicLink; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; void ImpSetAttrToGrafInfo(); // Copy values from the pool diff --git a/include/svx/svdogrp.hxx b/include/svx/svdogrp.hxx index 53f4107b8248..351000746e0a 100644 --- a/include/svx/svdogrp.hxx +++ b/include/svx/svdogrp.hxx @@ -32,7 +32,7 @@ class SfxItemSet; class SVX_DLLPUBLIC SdrObjGroup final : public SdrObject, public SdrObjList { private: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; Point aRefPoint; // Reference point inside the object group diff --git a/include/svx/svdomeas.hxx b/include/svx/svdomeas.hxx index 0e30251dcab5..6e3e6afdf455 100644 --- a/include/svx/svdomeas.hxx +++ b/include/svx/svdomeas.hxx @@ -52,7 +52,7 @@ private: friend class SdrMeasureField; protected: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; Point aPt1; diff --git a/include/svx/svdomedia.hxx b/include/svx/svdomedia.hxx index f99fd2570133..c5dfdda2ea2b 100644 --- a/include/svx/svdomedia.hxx +++ b/include/svx/svdomedia.hxx @@ -73,7 +73,7 @@ public: private: void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState ); - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; struct Impl; std::unique_ptr<Impl> m_xImpl; diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx index 4a202632edea..a0bb2c385df9 100644 --- a/include/svx/svdoole2.hxx +++ b/include/svx/svdoole2.hxx @@ -62,7 +62,7 @@ private: SVX_DLLPRIVATE void Init(); protected: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; // protected destructor diff --git a/include/svx/svdopage.hxx b/include/svx/svdopage.hxx index a23727e62b72..c666e552e56e 100644 --- a/include/svx/svdopage.hxx +++ b/include/svx/svdopage.hxx @@ -37,7 +37,7 @@ private: SdrPage* mpShownPage; protected: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; // protected destructor diff --git a/include/svx/svdopath.hxx b/include/svx/svdopath.hxx index d626747f31b6..0f58f1f7354c 100644 --- a/include/svx/svdopath.hxx +++ b/include/svx/svdopath.hxx @@ -47,7 +47,7 @@ class SVX_DLLPUBLIC SdrPathObj final : public SdrTextObj private: friend class ImpPathForDragAndCreate; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; basegfx::B2DPolyPolygon maPathPolygon; SdrObjKind meKind; diff --git a/include/svx/svdorect.hxx b/include/svx/svdorect.hxx index 125d1d7fb5b3..ac015cb498c0 100644 --- a/include/svx/svdorect.hxx +++ b/include/svx/svdorect.hxx @@ -44,7 +44,7 @@ private: friend class SdrTextObj; // Due to SetXPolyDirty for GrowAdjust protected: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; std::unique_ptr<XPolygon> mpXPoly; diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx index ad42885a124f..8d9c03a3c5da 100644 --- a/include/svx/svdotable.hxx +++ b/include/svx/svdotable.hxx @@ -268,7 +268,7 @@ private: protected: virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; virtual SdrObjGeoData* NewGeoData() const override; virtual void SaveGeoData(SdrObjGeoData& rGeo) const override; diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 3b0e307246ba..b7e606e11cfc 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -148,7 +148,7 @@ private: protected: virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override; - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; private: // This method is only allowed for sdr::properties::TextProperties diff --git a/include/svx/svdouno.hxx b/include/svx/svdouno.hxx index 245069635910..cd47eadef182 100644 --- a/include/svx/svdouno.hxx +++ b/include/svx/svdouno.hxx @@ -127,7 +127,7 @@ public: protected: // SdrObject overridables - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; private: /** Retrieves the typed ViewContact for the object diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx index 7376b0506b76..45c04ccff893 100644 --- a/include/svx/svdovirt.hxx +++ b/include/svx/svdovirt.hxx @@ -34,7 +34,7 @@ public: virtual sdr::properties::BaseProperties& GetProperties() const override; protected: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; SdrObject& rRefObj; // Referenced drawing object tools::Rectangle aSnapRect; diff --git a/svx/source/engine3d/cube3d.cxx b/svx/source/engine3d/cube3d.cxx index a8c92b0556b8..ecc3dc74abc8 100644 --- a/svx/source/engine3d/cube3d.cxx +++ b/svx/source/engine3d/cube3d.cxx @@ -25,13 +25,14 @@ #include <basegfx/point/b3dpoint.hxx> #include <basegfx/polygon/b3dpolygon.hxx> #include <sdr/contact/viewcontactofe3dcube.hxx> +#include <o3tl/make_unique.hxx> // DrawContact section -sdr::contact::ViewContact* E3dCubeObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> E3dCubeObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfE3dCube(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfE3dCube>(*this); } diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx index b28132fd3c65..6ab1ae7440a3 100644 --- a/svx/source/engine3d/extrud3d.cxx +++ b/svx/source/engine3d/extrud3d.cxx @@ -36,12 +36,13 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b3dpolygontools.hxx> #include <basegfx/polygon/b3dpolypolygontools.hxx> +#include <o3tl/make_unique.hxx> // DrawContact section -sdr::contact::ViewContact* E3dExtrudeObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> E3dExtrudeObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfE3dExtrude(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfE3dExtrude>(*this); } sdr::properties::BaseProperties* E3dExtrudeObj::CreateObjectSpecificProperties() diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx index 40bfd69f276b..629ecfb85127 100644 --- a/svx/source/engine3d/lathe3d.cxx +++ b/svx/source/engine3d/lathe3d.cxx @@ -34,12 +34,13 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <o3tl/make_unique.hxx> // DrawContact section -sdr::contact::ViewContact* E3dLatheObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> E3dLatheObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfE3dLathe(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfE3dLathe>(*this); } sdr::properties::BaseProperties* E3dLatheObj::CreateObjectSpecificProperties() diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx index 68f808f5e41c..a94c316fe4bf 100644 --- a/svx/source/engine3d/polygn3d.cxx +++ b/svx/source/engine3d/polygn3d.cxx @@ -24,11 +24,12 @@ #include <sdr/contact/viewcontactofe3dpolygon.hxx> #include <basegfx/polygon/b3dpolygon.hxx> #include <basegfx/polygon/b3dpolygontools.hxx> +#include <o3tl/make_unique.hxx> // DrawContact section -sdr::contact::ViewContact* E3dPolygonObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> E3dPolygonObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfE3dPolygon(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfE3dPolygon>(*this); } E3dPolygonObj::E3dPolygonObj( diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index c98ea6d97dca..a6cf651fa9b9 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -46,6 +46,7 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <svx/e3dsceneupdater.hxx> #include <svx/svdmodel.hxx> +#include <o3tl/make_unique.hxx> class ImpRemap3DDepth @@ -164,9 +165,9 @@ sdr::properties::BaseProperties* E3dScene::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* E3dScene::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> E3dScene::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfE3dScene(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfE3dScene>(*this); } diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx index a3a3f0c168c1..c528d47e5713 100644 --- a/svx/source/engine3d/sphere3d.cxx +++ b/svx/source/engine3d/sphere3d.cxx @@ -32,11 +32,12 @@ #include <basegfx/point/b3dpoint.hxx> #include <sdr/contact/viewcontactofe3dsphere.hxx> #include <basegfx/polygon/b3dpolygon.hxx> +#include <o3tl/make_unique.hxx> // DrawContact section -sdr::contact::ViewContact* E3dSphereObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> E3dSphereObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfE3dSphere(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfE3dSphere>(*this); } sdr::properties::BaseProperties* E3dSphereObj::CreateObjectSpecificProperties() diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 5f448b6fb53b..c0a139c26ef7 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -82,6 +82,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svdobjplusdata.hxx> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -3048,9 +3049,9 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf return false; } -sdr::contact::ViewContact* SdrObjCustomShape::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrObjCustomShape::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrObjCustomShape(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrObjCustomShape>(*this); } // #i33136# diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 663c4b07083a..a463ea523fae 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -130,6 +130,7 @@ #include <rtl/strbuf.hxx> #include <svdobjplusdata.hxx> #include <svdobjuserdatalist.hxx> +#include <o3tl/make_unique.hxx> #include <boost/optional.hpp> #include <libxml/xmlwriter.h> @@ -256,17 +257,17 @@ void SdrObject::RemoveObjectUser(sdr::ObjectUser& rOldUser) // DrawContact section -sdr::contact::ViewContact* SdrObject::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrObject::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrObj>(*this); } sdr::contact::ViewContact& SdrObject::GetViewContact() const { if(!mpViewContact) { - const_cast< SdrObject* >(this)->mpViewContact.reset( - const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact() ); + const_cast< SdrObject* >(this)->mpViewContact = + const_cast< SdrObject* >(this)->CreateObjectSpecificViewContact(); } return *mpViewContact; diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index e02b596f2195..1a4ea0c18bcc 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -58,6 +58,7 @@ #include <svx/xlnwtit.hxx> #include <svx/xpoly.hxx> #include <svx/xpool.hxx> +#include <o3tl/make_unique.hxx> enum EscDir {LKS,RTS,OBN,UNT}; @@ -182,9 +183,9 @@ sdr::properties::BaseProperties* SdrCaptionObj::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* SdrCaptionObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrCaptionObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrCaptionObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrCaptionObj>(*this); } diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index e55f79183d18..71dad28a7b6e 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -49,6 +49,7 @@ #include <svx/xlnstwit.hxx> #include <svx/xlnwtit.hxx> #include <svx/xpool.hxx> +#include <o3tl/make_unique.hxx> using namespace com::sun::star; @@ -99,9 +100,9 @@ sdr::properties::BaseProperties* SdrCircObj::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* SdrCircObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrCircObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrCircObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrCircObj>(*this); } SdrCircObj::SdrCircObj( diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 860b4f018a81..ca3174a6de5e 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -47,6 +47,7 @@ #include <svx/sxenditm.hxx> #include <svx/xpoly.hxx> #include <svx/xpool.hxx> +#include <o3tl/make_unique.hxx> SdrObjConnection::~SdrObjConnection() @@ -155,9 +156,9 @@ sdr::properties::BaseProperties* SdrEdgeObj::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* SdrEdgeObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrEdgeObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrEdgeObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrEdgeObj>(*this); } diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index aefebe7b3a7c..90e6d4a0c391 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -62,6 +62,7 @@ #include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx> #include <memory> #include <vcl/GraphicLoader.hxx> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -272,9 +273,9 @@ sdr::properties::BaseProperties* SdrGrafObj::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* SdrGrafObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrGrafObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfGraphic(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfGraphic>(*this); } // check if SVG and if try to get ObjectInfoPrimitive2D and extract info diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index c0e6ae0b468d..c66ee4f1bff3 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -49,6 +49,7 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <libxml/xmlwriter.h> +#include <o3tl/make_unique.hxx> // BaseProperties section sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties() @@ -57,9 +58,9 @@ sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties() } // DrawContact section -sdr::contact::ViewContact* SdrObjGroup::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrObjGroup::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfGroup(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfGroup>(*this); } SdrObjGroup::SdrObjGroup(SdrModel& rSdrModel) diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index b0738696d733..cc6ba7d6f5cb 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -68,6 +68,7 @@ #include <svx/xlnwtit.hxx> #include <svx/xpoly.hxx> #include <unotools/syslocale.hxx> +#include <o3tl/make_unique.hxx> SdrMeasureObjGeoData::SdrMeasureObjGeoData() {} @@ -192,9 +193,9 @@ sdr::properties::BaseProperties* SdrMeasureObj::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* SdrMeasureObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrMeasureObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrMeasureObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrMeasureObj>(*this); } diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index 6767d05eb7d4..54c3d66846da 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -38,6 +38,7 @@ #include <svx/strings.hrc> #include <svx/sdr/contact/viewcontactofsdrmediaobj.hxx> #include <avmedia/mediawindow.hxx> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; @@ -88,9 +89,9 @@ bool SdrMediaObj::HasTextEdit() const return false; } -sdr::contact::ViewContact* SdrMediaObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrMediaObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrMediaObj( *this ); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrMediaObj>( *this ); } void SdrMediaObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index feb7caf6700c..d854ffbc3488 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -676,9 +676,9 @@ sdr::properties::BaseProperties* SdrOle2Obj::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrOle2Obj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrOle2Obj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrOle2Obj>(*this); } void SdrOle2Obj::Init() diff --git a/svx/source/svdraw/svdopage.cxx b/svx/source/svdraw/svdopage.cxx index c9dfa21838de..ceb4a130fc59 100644 --- a/svx/source/svdraw/svdopage.cxx +++ b/svx/source/svdraw/svdopage.cxx @@ -31,6 +31,7 @@ #include <svl/itemset.hxx> #include <sdr/properties/pageproperties.hxx> #include <svx/sdr/contact/viewcontactofpageobj.hxx> +#include <o3tl/make_unique.hxx> // BaseProperties section @@ -43,9 +44,9 @@ sdr::properties::BaseProperties* SdrPageObj::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* SdrPageObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrPageObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfPageObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfPageObj>(*this); } diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 4c5ad7e7bffa..d98c9d6a21fd 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -51,6 +51,7 @@ #include <svx/sdr/primitive2d/sdrattributecreator.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <svx/sdr/attribute/sdrformtextattribute.hxx> +#include <o3tl/make_unique.hxx> #include <memory> using namespace sdr; @@ -1616,9 +1617,9 @@ SdrPathObjGeoData::~SdrPathObjGeoData() // DrawContact section -sdr::contact::ViewContact* SdrPathObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrPathObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrPathObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrPathObj>(*this); } diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index c9f8ee955e3b..c1a102b15ac3 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -43,6 +43,7 @@ #include <svx/sdr/contact/viewcontactofsdrrectobj.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <o3tl/make_unique.hxx> using namespace com::sun::star; @@ -56,9 +57,9 @@ sdr::properties::BaseProperties* SdrRectObj::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* SdrRectObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrRectObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfSdrRectObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfSdrRectObj>(*this); } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 1e6780866101..7a1d1c9421ce 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -60,6 +60,7 @@ #include <drawinglayer/geometry/viewinformation2d.hxx> #include <vcl/virdev.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <o3tl/make_unique.hxx> using namespace com::sun::star; @@ -70,9 +71,9 @@ sdr::properties::BaseProperties* SdrTextObj::CreateObjectSpecificProperties() } // DrawContact section -sdr::contact::ViewContact* SdrTextObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrTextObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfTextObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfTextObj>(*this); } SdrTextObj::SdrTextObj(SdrModel& rSdrModel) diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index 40e8c9601edb..68b13f3d2e4f 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -48,6 +48,7 @@ #include <svx/sdrpaintwindow.hxx> #include <tools/diagnose_ex.h> #include <svx/svdograf.hxx> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; using namespace sdr::contact; @@ -525,9 +526,9 @@ bool SdrUnoObj::impl_getViewContact( ViewContactOfUnoControl*& _out_rpContact ) } -sdr::contact::ViewContact* SdrUnoObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrUnoObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfUnoControl( *this ); + return o3tl::make_unique<sdr::contact::ViewContactOfUnoControl>( *this ); } diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 55d564dc71f2..698ac2051adc 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -28,6 +28,7 @@ #include <svx/svdograf.hxx> #include <svx/svddrgv.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <o3tl/make_unique.hxx> sdr::properties::BaseProperties& SdrVirtObj::GetProperties() const @@ -37,9 +38,9 @@ sdr::properties::BaseProperties& SdrVirtObj::GetProperties() const // #i27224# -sdr::contact::ViewContact* SdrVirtObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrVirtObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfVirtObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfVirtObj>(*this); } SdrVirtObj::SdrVirtObj( diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 6a7dcd3f3427..4586485156d2 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -846,9 +846,9 @@ sdr::properties::BaseProperties* SdrTableObj::CreateObjectSpecificProperties() // DrawContact section -sdr::contact::ViewContact* SdrTableObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SdrTableObj::CreateObjectSpecificViewContact() { - return new sdr::contact::ViewContactOfTableObj(*this); + return o3tl::make_unique<sdr::contact::ViewContactOfTableObj>(*this); } SdrTableObj::SdrTableObj(SdrModel& rSdrModel) diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx index a25c1ac9e54c..ea0261cde391 100644 --- a/sw/inc/dcontact.hxx +++ b/sw/inc/dcontact.hxx @@ -225,7 +225,7 @@ class SwDrawVirtObj : public SdrVirtObj /** AW: Need own sdr::contact::ViewContact since AnchorPos from parent is not used but something own (top left of new SnapRect minus top left of original SnapRect) */ - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; // protected destructor virtual ~SwDrawVirtObj() override; diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 132d8f83662e..96c0787ae835 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -71,6 +71,7 @@ #include <calbck.hxx> #include <algorithm> #include <txtfly.hxx> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; @@ -2149,9 +2150,9 @@ namespace sdr } // end of namespace sdr /// implementation of class <SwDrawVirtObj> -sdr::contact::ViewContact* SwDrawVirtObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SwDrawVirtObj::CreateObjectSpecificViewContact() { - return new sdr::contact::VCOfDrawVirtObj(*this); + return o3tl::make_unique<sdr::contact::VCOfDrawVirtObj>(*this); } SwDrawVirtObj::SwDrawVirtObj( diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 3646acaf75da..70fab4972352 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -64,6 +64,7 @@ #include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <notxtfrm.hxx> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; @@ -114,11 +115,11 @@ sdr::properties::BaseProperties* SwFlyDrawObj::CreateObjectSpecificProperties() return new sdr::properties::DefaultProperties(*this); } -sdr::contact::ViewContact* SwFlyDrawObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SwFlyDrawObj::CreateObjectSpecificViewContact() { // needs an own VC since createViewIndependentPrimitive2DSequence() // is called when RecalcBoundRect() is used - return new sdr::contact::VCOfSwFlyDrawObj(*this); + return o3tl::make_unique<sdr::contact::VCOfSwFlyDrawObj>(*this); } SwFlyDrawObj::SwFlyDrawObj(SdrModel& rSdrModel) @@ -410,11 +411,11 @@ void SwVirtFlyDrawObj::Rotate(const Point& rRef, long nAngle, double sn, double } } -sdr::contact::ViewContact* SwVirtFlyDrawObj::CreateObjectSpecificViewContact() +std::unique_ptr<sdr::contact::ViewContact> SwVirtFlyDrawObj::CreateObjectSpecificViewContact() { // need an own ViewContact (VC) to allow creation of a specialized primitive // for being able to visualize the FlyFrames in primitive renderers - return new sdr::contact::VCOfSwVirtFlyDrawObj(*this); + return o3tl::make_unique<sdr::contact::VCOfSwVirtFlyDrawObj>(*this); } SwVirtFlyDrawObj::SwVirtFlyDrawObj( diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx index c22ffae16251..181eeac6c95e 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -38,7 +38,7 @@ private: protected: // #i95264# SwFlyDrawObj needs an own VC since createViewIndependentPrimitive2DSequence() // is called when RecalcBoundRect() is used - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; // protected destructor virtual ~SwFlyDrawObj() override; @@ -67,7 +67,7 @@ protected: // AW: Need own sdr::contact::ViewContact since AnchorPos from parent is // not used but something own (top left of new SnapRect minus top left // of original SnapRect) - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; + virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; // protected destructor virtual ~SwVirtFlyDrawObj() override; commit 24218c21712bc900a6641bd1844878f07b173df7 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Mon Jul 2 14:45:07 2018 +0200 loplugin:useuniqueptr in SwDropPortionPart Change-Id: I9aaaeb2b5cb05d350059554555ecb0c195c51a74 Reviewed-on: https://gerrit.libreoffice.org/56830 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/text/pordrop.hxx b/sw/source/core/text/pordrop.hxx index e0f7a4ea21f4..7d2293d17648 100644 --- a/sw/source/core/text/pordrop.hxx +++ b/sw/source/core/text/pordrop.hxx @@ -33,8 +33,8 @@ extern SwDropCapCache *pDropCapCache; // attribute changes inside them. class SwDropPortionPart { - SwDropPortionPart* pFollow; - SwFont* pFnt; + std::unique_ptr<SwDropPortionPart> pFollow; + std::unique_ptr<SwFont> pFnt; TextFrameIndex nLen; sal_uInt16 nWidth; bool m_bJoinBorderWithNext; @@ -45,8 +45,8 @@ public: : pFollow( nullptr ), pFnt( &rFont ), nLen( nL ), nWidth( 0 ), m_bJoinBorderWithNext(false), m_bJoinBorderWithPrev(false) {}; ~SwDropPortionPart(); - SwDropPortionPart* GetFollow() const { return pFollow; }; - void SetFollow( SwDropPortionPart* pNew ) { pFollow = pNew; }; + SwDropPortionPart* GetFollow() const { return pFollow.get(); }; + void SetFollow( std::unique_ptr<SwDropPortionPart> pNew ) { pFollow = std::move(pNew); }; SwFont& GetFont() const { return *pFnt; } TextFrameIndex GetLen() const { return nLen; } sal_uInt16 GetWidth() const { return nWidth; } diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 317eb084a4c1..6ced927d91cb 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -95,8 +95,8 @@ SwDropSave::~SwDropSave() /// SwDropPortionPart DTor SwDropPortionPart::~SwDropPortionPart() { - delete pFollow; - delete pFnt; + pFollow.reset(); + pFnt.reset(); } /// SwDropPortion CTor, DTor @@ -641,7 +641,7 @@ SwDropPortion *SwTextFormatter::NewDropPortion( SwTextFormatInfo &rInf ) if ( ! pCurrPart ) pDropPor->SetPart( pPart ); else - pCurrPart->SetFollow( pPart ); + pCurrPart->SetFollow( std::unique_ptr<SwDropPortionPart>(pPart) ); pCurrPart = pPart; } commit 3769a6271120e0e856b53f906654bc2c593804fe Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Mon Jul 2 16:56:17 2018 +0200 loplugin:useuniqueptr in ScHeaderFooterTextData Change-Id: Ia359ee8e9e4876f6bbf86702c476c9f9602295a0 Reviewed-on: https://gerrit.libreoffice.org/56832 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx index 0d3919727436..bb90c82f85f4 100644 --- a/sc/inc/textuno.hxx +++ b/sc/inc/textuno.hxx @@ -105,8 +105,8 @@ private: std::unique_ptr<EditTextObject> mpTextObj; css::uno::WeakReference<css::sheet::XHeaderFooterContent> xContentObj; ScHeaderFooterPart nPart; - ScEditEngineDefaulter* pEditEngine; - SvxEditEngineForwarder* pForwarder; + std::unique_ptr<ScEditEngineDefaulter> pEditEngine; + std::unique_ptr<SvxEditEngineForwarder> pForwarder; bool bDataValid; public: @@ -120,7 +120,7 @@ public: SvxTextForwarder* GetTextForwarder(); void UpdateData(); void UpdateData(EditEngine& rEditEngine); - ScEditEngineDefaulter* GetEditEngine() { GetTextForwarder(); return pEditEngine; } + ScEditEngineDefaulter* GetEditEngine() { GetTextForwarder(); return pEditEngine.get(); } ScHeaderFooterPart GetPart() const { return nPart; } const css::uno::Reference<css::sheet::XHeaderFooterContent> GetContentObj() const { return xContentObj; } diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 49fc91b2037a..7d92fd868a67 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -187,8 +187,6 @@ ScHeaderFooterTextData::ScHeaderFooterTextData( mpTextObj(pTextObj ? pTextObj->Clone() : nullptr), xContentObj( xContent ), nPart( nP ), - pEditEngine( nullptr ), - pForwarder( nullptr ), bDataValid(false) { } @@ -197,8 +195,8 @@ ScHeaderFooterTextData::~ScHeaderFooterTextData() { SolarMutexGuard aGuard; // needed for EditEngine dtor - delete pForwarder; - delete pEditEngine; + pForwarder.reset(); + pEditEngine.reset(); } SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder() @@ -207,7 +205,7 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder() { SfxItemPool* pEnginePool = EditEngine::CreatePool(); pEnginePool->FreezeIdRanges(); - ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool ); + std::unique_ptr<ScHeaderEditEngine> pHdrEngine(new ScHeaderEditEngine( pEnginePool )); pHdrEngine->EnableUndo( false ); pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip)); @@ -232,18 +230,18 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder() ScHeaderFooterTextObj::FillDummyFieldData( aData ); pHdrEngine->SetData( aData ); - pEditEngine = pHdrEngine; - pForwarder = new SvxEditEngineForwarder(*pEditEngine); + pEditEngine = std::move(pHdrEngine); + pForwarder.reset( new SvxEditEngineForwarder(*pEditEngine) ); } if (bDataValid) - return pForwarder; + return pForwarder.get(); if (mpTextObj) pEditEngine->SetText(*mpTextObj); bDataValid = true; - return pForwarder; + return pForwarder.get(); } void ScHeaderFooterTextData::UpdateData() commit 09d9419bf2072fdab2d7c1d1c6a8dee70b9f0f8a Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Mon Jul 2 15:20:42 2018 +0200 loplugin:useuniqueptr in SwWrongList and simplify, just use copy constructors and operator=, instead of special-case CopyFrom methods Change-Id: I3e14fa08e820cf7ae2c5424ae22ae95516933773 Reviewed-on: https://gerrit.libreoffice.org/56831 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/inc/SwGrammarMarkUp.hxx b/sw/source/core/inc/SwGrammarMarkUp.hxx index f37605556353..94cf6c93a6aa 100644 --- a/sw/source/core/inc/SwGrammarMarkUp.hxx +++ b/sw/source/core/inc/SwGrammarMarkUp.hxx @@ -39,10 +39,10 @@ class SwGrammarMarkUp : public SwWrongList public: SwGrammarMarkUp() : SwWrongList( WRONGLIST_GRAMMAR ) {} + SwGrammarMarkUp(SwGrammarMarkUp const &); virtual ~SwGrammarMarkUp() override; - virtual SwWrongList* Clone() override; - virtual void CopyFrom( const SwWrongList& rCopy ) override; + virtual std::unique_ptr<SwWrongList> Clone() override; /* SwWrongList::Move() + handling of maSentence */ void MoveGrammar( sal_Int32 nPos, sal_Int32 nDiff ); diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx index 0003d54266ba..695a33b6219d 100644 --- a/sw/source/core/inc/wrong.hxx +++ b/sw/source/core/inc/wrong.hxx @@ -59,7 +59,7 @@ public: css::uno::Reference< css::container::XStringKeyMap > mxPropertyBag; sal_Int32 mnPos; sal_Int32 mnLen; - SwWrongList* mpSubList; + std::unique_ptr<SwWrongList> mpSubList; Color mColor; WrongAreaLineType mLineType; @@ -75,6 +75,10 @@ public: sal_Int32 nPos, sal_Int32 nLen, SwWrongList* pSubList); + + SwWrongArea( const SwWrongArea& ); + SwWrongArea& operator=( const SwWrongArea& ); + private: static Color getGrammarColor ( css::uno::Reference< css::container::XStringKeyMap > const & xPropertyBag) @@ -253,14 +257,13 @@ class SwWrongList void Remove( sal_uInt16 nIdx, sal_uInt16 nLen ); SwWrongList& operator= (const SwWrongList &) = delete; - SwWrongList( const SwWrongList& rCpy ) = delete; public: SwWrongList( WrongListType eType ); + SwWrongList( SwWrongList const & ); virtual ~SwWrongList(); - virtual SwWrongList* Clone(); - virtual void CopyFrom( const SwWrongList& rCopy ); + virtual std::unique_ptr<SwWrongList> Clone(); WrongListType GetWrongListType() const { return meType; } sal_Int32 GetBeginInv() const { return mnBeginInvalid; } @@ -319,14 +322,14 @@ public: SwWrongList* SubList( sal_uInt16 nIdx ) const { - return nIdx < maList.size() ? maList[nIdx].mpSubList : nullptr; + return maList[nIdx].mpSubList.get(); } void InsertSubList( sal_Int32 nNewPos, sal_Int32 nNewLen, sal_uInt16 nWhere, SwWrongList* pSubList ); const SwWrongArea* GetElement( sal_uInt16 nIdx ) const { - return nIdx < maList.size() ? &maList[nIdx] : nullptr; + return &maList[nIdx]; } void RemoveEntry( sal_Int32 nBegin, sal_Int32 nEnd ); ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits