[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2018-02-22 Thread Caolán McNamara
 svx/source/dialog/srchdlg.cxx |   42 +-
 1 file changed, 17 insertions(+), 25 deletions(-)

New commits:
commit 9a28fdb9f508204b886ddbc57d6a5aaa53ffc929
Author: Caolán McNamara 
Date:   Tue Feb 20 13:59:08 2018 +

Resolves: rhbz#1546997 'search not found' at 0,0 when window too narrow

if the statusbar hadn't got space for the initial label, then it doesn't 
get set a position,
so when later forced visible it draws at 0,0

call Resize on the toolbox to get it to relayout, and while we're at it
set the required size of the label so we might have space for it if that
text is shorter than the original len allocation

Change-Id: I37d20125d8195b2c75e83e9673c82c2011ceda8e
Reviewed-on: https://gerrit.libreoffice.org/50043
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 2fbeeaf30088..e94f1da3b81c 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -2369,11 +2369,11 @@ SfxChildWinInfo SvxSearchDialogWrapper::GetInfo() const
 }
 
 
-static vcl::Window* lcl_GetSearchLabelWindow()
+static void lcl_SetSearchLabelWindow(const OUString& rStr)
 {
 SfxViewFrame* pViewFrame = SfxViewFrame::Current();
 if (!pViewFrame)
-return nullptr;
+return;
 
 css::uno::Reference< css::beans::XPropertySet > xPropSet(
 pViewFrame->GetFrame().GetFrameInterface(), 
css::uno::UNO_QUERY_THROW);
@@ -2382,7 +2382,7 @@ static vcl::Window* lcl_GetSearchLabelWindow()
 css::uno::Reference< css::ui::XUIElement > xUIElement =
 xLayoutManager->getElement("private:resource/toolbar/findbar");
 if (!xUIElement.is())
-return nullptr;
+return;
 css::uno::Reference< css::awt::XWindow > xWindow(
 xUIElement->getRealInterface(), css::uno::UNO_QUERY_THROW);
 VclPtr< ToolBox > pToolBox = static_cast( 
VCLUnoHelper::GetWindow(xWindow).get() );
@@ -2390,9 +2390,19 @@ static vcl::Window* lcl_GetSearchLabelWindow()
 {
 sal_uInt16 id = pToolBox->GetItemId(i);
 if (pToolBox->GetItemCommand(id) == ".uno:SearchLabel")
-return pToolBox->GetItemWindow(id);
+{
+vcl::Window* pSearchLabel = pToolBox->GetItemWindow(id);
+assert(pSearchLabel);
+pSearchLabel->Hide();
+pSearchLabel->SetText(rStr);
+if (!rStr.isEmpty())
+{
+pSearchLabel->SetSizePixel(pSearchLabel->get_preferred_size());
+pSearchLabel->Show();
+}
+}
 }
-return nullptr;
+pToolBox->Resize();
 }
 
 void SvxSearchDialogWrapper::SetSearchLabel(const SearchLabel& rSL)
@@ -2407,16 +2417,7 @@ void SvxSearchDialogWrapper::SetSearchLabel(const 
SearchLabel& rSL)
 else if (rSL == SearchLabel::NotFound)
 sStr = SvxResId(RID_SVXSTR_SEARCH_NOT_FOUND);
 
-if (vcl::Window *pSearchLabel = lcl_GetSearchLabelWindow())
-{
-if (sStr.isEmpty())
-pSearchLabel->Hide();
-else
-{
-pSearchLabel->SetText(sStr);
-pSearchLabel->Show();
-}
-}
+lcl_SetSearchLabelWindow(sStr);
 if (SvxSearchDialogWrapper *pWrp = static_cast( 
SfxViewFrame::Current()->
 GetChildWindow( SvxSearchDialogWrapper::GetChildWindowId() )))
 pWrp->getDialog()->SetSearchLabel(sStr);
@@ -2425,16 +2426,7 @@ void SvxSearchDialogWrapper::SetSearchLabel(const 
SearchLabel& rSL)
 void SvxSearchDialogWrapper::SetSearchLabel(const OUString& sStr)
 {
 
-if (vcl::Window *pSearchLabel = lcl_GetSearchLabelWindow())
-{
-if (sStr.isEmpty())
-pSearchLabel->Hide();
-else
-{
-pSearchLabel->SetText(sStr);
-pSearchLabel->Show();
-}
-}
+lcl_SetSearchLabelWindow(sStr);
 if (SvxSearchDialogWrapper *pWrp = static_cast( 
SfxViewFrame::Current()->
 GetChildWindow( SvxSearchDialogWrapper::GetChildWindowId() )))
 pWrp->getDialog()->SetSearchLabel(sStr);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2018-01-04 Thread Julien Nabet
 svx/source/form/filtnav.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3877cd896236b604d0d195260f6c5119f0913c3e
Author: Julien Nabet 
Date:   Wed Jan 3 19:09:49 2018 +0100

tdf#114788: fix crash in form-based filter

regression from 
https://cgit.freedesktop.org/libreoffice/core/diff/svx/source/form/filtnav.cxx?id=85f93697defd9a812a0cda0bc4e9364e28c0339e

Change-Id: If6f248b460a55aa1e30902d5edeb807dabb37d7b
(cherry picked from commit 93f8172ffb783da95391ac53ab6402f5a055aa44)
Reviewed-on: https://gerrit.libreoffice.org/47370
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 50c7f557e6ce..dd566a26a9ce 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1147,7 +1147,7 @@ bool FmFilterNavigator::EditingEntry( SvTreeListEntry* 
pEntry, Selection& rSelec
 if (!SvTreeListBox::EditingEntry( pEntry, rSelection ))
 return false;
 
-return pEntry && dynamic_cast(static_cast(pEntry->GetUserData())) == nullptr;
+return pEntry && dynamic_cast(static_cast(pEntry->GetUserData())) != nullptr;
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-11-24 Thread Julien Nabet
 svx/source/dialog/fntctrl.cxx |   32 +---
 1 file changed, 21 insertions(+), 11 deletions(-)

New commits:
commit 479719b1f53cb5f44bbcc57e75dad1aae604cd20
Author: Julien Nabet 
Date:   Wed Nov 8 23:17:56 2017 +0100

tdf#113657: fix crash when trying to format empty paragraph

by creating a function to clean line feeds and returns if it's empty or not

Reviewed-on: https://gerrit.libreoffice.org/44513
Tested-by: Jenkins 
Tested-by: Xisco Faulí 
Reviewed-by: Michael Stahl 
(cherry picked from commit 3f289fef2f2b00dcca4948dd9fb2ba2c493fac6f)

svx: loplugin:staticmethods
(cherry picked from commit 16687c57b5e378db93972fc1887b9b19747d068c)

Change-Id: I3a744c52bdb457c92f38595463099e1cbf17a37e
Reviewed-on: https://gerrit.libreoffice.org/45151
Reviewed-by: Michael Stahl 
Tested-by: Jenkins 

diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 213126c069c1..f139cb7f631f 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -611,6 +611,24 @@ void SvxFontPrevWindow::UseResourceText()
 pImpl->mbUseResText = true;
 }
 
+/*
+ * removes line feeds and carriage returns from string
+ * returns if param is empty
+ */
+bool CleanAndCheckEmpty(OUString& rText)
+{
+bool bEmpty = true;
+for (sal_Int32 i = 0; i < rText.getLength(); ++i)
+{
+if (0xa == rText[i] || 0xd == rText[i])
+rText = rText.replaceAt(i, 1, " ");
+else
+bEmpty = false;
+}
+return bEmpty;
+}
+
+
 void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&)
 {
 ApplySettings(rRenderContext);
@@ -644,7 +662,7 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::R
 {
 pImpl->maText = pSh->GetSelectionText();
 pImpl->mbGetSelection = true;
-pImpl->mbSelection = !pImpl->maText.isEmpty();
+pImpl->mbSelection = !CleanAndCheckEmpty(pImpl->maText);
 }
 
 if (!pImpl->mbSelection || pImpl->mbUseFontNameAsText)
@@ -680,16 +698,8 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::R
 pImpl->maText = makeRepresentativeTextForFont(LATIN, rFont);
 }
 
-// remove line feeds and carriage returns from string
-bool bNotEmpty = false;
-for (sal_Int32 i = 0; i < pImpl->maText.getLength(); ++i)
-{
-if (0xa == pImpl->maText[i] || 0xd == pImpl->maText[i])
- pImpl->maText = pImpl->maText.replaceAt(i, 1, " ");
-else
-bNotEmpty = true;
-}
-if (!bNotEmpty)
+bool bEmpty = CleanAndCheckEmpty(pImpl->maText);
+if (bEmpty)
 pImpl->maText = GetText();
 
 if (pImpl->maText.getLength() > (TEXT_WIDTH - 1))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-11-22 Thread Julien Nabet
 svx/source/tbxctrls/tbcontrl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 439a6e7c7e32089810b878dca77fa64ee454a596
Author: Julien Nabet 
Date:   Tue Sep 19 20:41:13 2017 +0200

tdf#111894: fix leak memory with PaletteManager (take 2)

Thanks to Maxim Monastirsky for the suggestion!

Change-Id: I6ab799848f80f785fd24905c0a540885c41afb86
Reviewed-on: https://gerrit.libreoffice.org/42494
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 
(cherry picked from commit 46fa042b94a0364c09482e8a09f8874119db231c)
Reviewed-on: https://gerrit.libreoffice.org/42610
Reviewed-by: David Tardon 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 628bacad7065..5ef9cf378206 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3230,7 +3230,7 @@ void SvxColorListBox::EnsurePaletteManager()
 if (!m_xPaletteManager)
 {
 m_xPaletteManager.reset(new PaletteManager);
-m_xPaletteManager->SetColorSelectFunction(m_aColorWrapper);
+m_xPaletteManager->SetColorSelectFunction(std::ref(m_aColorWrapper));
 m_xPaletteManager->SetLastColor(m_aSelectedColor.first);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-10-25 Thread Caolán McNamara
 svx/source/tbxctrls/tbcontrl.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit d9525910e183c75f6d76b3be7d6b369da322feac
Author: Caolán McNamara 
Date:   Wed Oct 25 12:10:01 2017 +0100

Resolves: tdf#113328 crash in color replacer if parent closed before it

Change-Id: I41a7af332cd36c9645b6042785c4d72f70e67795
Reviewed-on: https://gerrit.libreoffice.org/43825
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 706bdecd860e..61b56a852447 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3200,6 +3200,8 @@ 
SvxListBoxColorWrapper::SvxListBoxColorWrapper(SvxColorListBox* pControl)
 
 void SvxListBoxColorWrapper::operator()(const OUString& /*rCommand*/, const 
NamedColor& rColor)
 {
+if (!mxControl)
+return;
 mxControl->Selected(rColor);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-10-20 Thread Caolán McNamara
 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bc12c38f0c8fd4d2a1c13a72dc27f49ff44b48c4
Author: Caolán McNamara 
Date:   Wed Oct 18 11:09:01 2017 +0100

potential deref of empty xStateSet

Change-Id: I83d876b0d966b18cdf85249b7e856e4e4f4dec27
Reviewed-on: https://gerrit.libreoffice.org/43488
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 811e636d920ee96e7ebd120b3931cb3da43d0143)
Reviewed-on: https://gerrit.libreoffice.org/43548
Reviewed-by: Michael Stahl 

diff --git a/svx/source/accessibility/AccessibleShape.cxx 
b/svx/source/accessibility/AccessibleShape.cxx
index ffc2a6bc5f2e..3a3af9f9d34d 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -461,7 +461,7 @@ uno::Reference SAL_CALL
 xStateSet.set( new ::utl::AccessibleStateSetHelper (*pStateSet));
 }
 }
-if (!bDisposed && mpParent && mpParent->IsDocumentSelAll())
+if (!bDisposed && xStateSet.is() && mpParent && 
mpParent->IsDocumentSelAll())
 {
 ::utl::AccessibleStateSetHelper* pStateSet =
 static_cast< ::utl::AccessibleStateSetHelper*>(xStateSet.get());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-10-20 Thread Caolán McNamara
 svx/source/tbxctrls/tbcontrl.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 8d357a851f7dc4374eda88628a970f766d2234f2
Author: Caolán McNamara 
Date:   Wed Oct 18 16:28:08 2017 +0100

Resolves: tdf#113214 change back to previous entry after 'more' is 
dispatcher

Change-Id: Ic5bd5f9182e47c6dfdab8fcd6399ffc482a4fb6a
Reviewed-on: https://gerrit.libreoffice.org/43512
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 7ff293f2d2793b30f30d2f499b332e5329d4ddb4)
Reviewed-on: https://gerrit.libreoffice.org/43517
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 85ab2abfede7..706bdecd860e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -459,6 +459,8 @@ void SvxStyleBox_Impl::Select()
 pViewFrm->ShowChildWindow( SID_SIDEBAR );
 ::sfx2::sidebar::Sidebar::ShowPanel("StyleListPanel",
 
pViewFrm->GetFrame().GetFrameInterface());
+//tdf#113214 change text back to previous entry
+SetText(GetSavedValue());
 bDoIt = false;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-10-19 Thread Caolán McNamara
 svx/source/accessibility/AccessibleShape.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit a2cd7c7a1015abe17b46cd40ae4bf5b3296d62e7
Author: Caolán McNamara 
Date:   Wed Oct 18 11:05:20 2017 +0100

Resolves: tdf#109282: a11y crash in use after dispose

calc, chart in tab 3 with a11y enabled, select chart
switch to tab 1, crash cause mpParent has been deleted, IsDisposed
is correctly set, but shape accesses parent anyway

Change-Id: I6f57a798bfcc82eebb883291cec54e157ff5187b
Reviewed-on: https://gerrit.libreoffice.org/43490
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/svx/source/accessibility/AccessibleShape.cxx 
b/svx/source/accessibility/AccessibleShape.cxx
index de059e9bb7fd..ffc2a6bc5f2e 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -408,7 +408,9 @@ uno::Reference SAL_CALL
 ::osl::MutexGuard aGuard (maMutex);
 Reference xStateSet;
 
-if (IsDisposed())
+bool bDisposed = IsDisposed();
+
+if (bDisposed)
 {
 // Return a minimal state set that only contains the DEFUNC state.
 xStateSet = AccessibleContextBase::getAccessibleStateSet ();
@@ -459,7 +461,7 @@ uno::Reference SAL_CALL
 xStateSet.set( new ::utl::AccessibleStateSetHelper (*pStateSet));
 }
 }
-if (mpParent && mpParent->IsDocumentSelAll())
+if (!bDisposed && mpParent && mpParent->IsDocumentSelAll())
 {
 ::utl::AccessibleStateSetHelper* pStateSet =
 static_cast< ::utl::AccessibleStateSetHelper*>(xStateSet.get());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-09-19 Thread Julien Nabet
 svx/source/tbxctrls/tbcontrl.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 324d7f28beaf36c91361debf478e74b9fced7bfb
Author: Julien Nabet 
Date:   Tue Sep 19 09:10:41 2017 +0200

Revert "tdf#111894: fix leak memory with PaletteManager with 
SvxColorListBox"

See Maxim's comment here: 
https://gerrit.libreoffice.org/#/c/42138/2/svx/source/tbxctrls/tbcontrl.cxx

This reverts commit 61d85c4e7c30ea0f5242d927b7456190020b4fbe.

Change-Id: I0d88a5f5806cb5d3b9f3a5ebb0c7baed968469ec
Reviewed-on: https://gerrit.libreoffice.org/42445
Reviewed-by: Noel Grandin 
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 07582e68d56c..ea33ee769209 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3233,6 +3233,7 @@ void SvxColorListBox::SetSlotId(sal_uInt16 nSlotId, bool 
bShowNoneButton)
 {
 m_nSlotId = nSlotId;
 m_bShowNoneButton = bShowNoneButton;
+m_xColorWindow.disposeAndClear();
 m_aSelectedColor = bShowNoneButton ? GetNoneColor() : 
GetAutoColor(m_nSlotId);
 ShowPreview(m_aSelectedColor);
 createColorWindow();
@@ -3343,11 +3344,6 @@ SvxColorListBox::~SvxColorListBox()
 
 void SvxColorListBox::dispose()
 {
-// TODO: reset should be made automatically but...
-// tdf#111894: avoid memory leak with PaletteManager with SvxColorListBox
-// m_xColorWindow is made with m_xPaletteManager
-// so reset this last one before disposeAndClear first one
-m_xPaletteManager.reset();
 m_xColorWindow.disposeAndClear();
 m_aColorWrapper.dispose();
 MenuButton::dispose();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-09-15 Thread Julien Nabet
 svx/source/tbxctrls/tbcontrl.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 61d85c4e7c30ea0f5242d927b7456190020b4fbe
Author: Julien Nabet 
Date:   Sat Sep 9 00:47:20 2017 +0200

tdf#111894: fix leak memory with PaletteManager with SvxColorListBox

m_xColorWindow is made with m_xPaletteManager so reset this last one before 
disposeAndClear first one

By tracing constructor/destructor of PaletteManager, it seems there's no 
need
to call m_xColorWindow.disposeAndClear() in SetSlotId.

Change-Id: Ib3c236f8fd7fd12aaa86389f5c4c26fe58ba833e
Reviewed-on: https://gerrit.libreoffice.org/42121
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 
(cherry picked from commit e40ba034fa01cc271ad0e1940f623e551793f80b)
Reviewed-on: https://gerrit.libreoffice.org/42138
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index ea33ee769209..07582e68d56c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3233,7 +3233,6 @@ void SvxColorListBox::SetSlotId(sal_uInt16 nSlotId, bool 
bShowNoneButton)
 {
 m_nSlotId = nSlotId;
 m_bShowNoneButton = bShowNoneButton;
-m_xColorWindow.disposeAndClear();
 m_aSelectedColor = bShowNoneButton ? GetNoneColor() : 
GetAutoColor(m_nSlotId);
 ShowPreview(m_aSelectedColor);
 createColorWindow();
@@ -3344,6 +3343,11 @@ SvxColorListBox::~SvxColorListBox()
 
 void SvxColorListBox::dispose()
 {
+// TODO: reset should be made automatically but...
+// tdf#111894: avoid memory leak with PaletteManager with SvxColorListBox
+// m_xColorWindow is made with m_xPaletteManager
+// so reset this last one before disposeAndClear first one
+m_xPaletteManager.reset();
 m_xColorWindow.disposeAndClear();
 m_aColorWrapper.dispose();
 MenuButton::dispose();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-09-13 Thread Caolán McNamara
 svx/source/tbxctrls/layctrl.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 3181238d88c01245d9fd1aba5cca388174113c83
Author: Caolán McNamara 
Date:   Tue Sep 12 12:12:19 2017 +0100

Resolves: tdf#106163 safe fix for wrong final row/col selection in rtl

Change-Id: I773de03768b0a5b28e6b4f63bd65dd270dc975cd
Reviewed-on: https://gerrit.libreoffice.org/42198
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index 33da56fe3227..3140923ade31 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -161,6 +161,8 @@ void TableWindow::dispose()
 void TableWindow::MouseMove( const MouseEvent& rMEvt )
 {
 SfxPopupWindow::MouseMove( rMEvt );
+if (IsInCleanUp())
+return;
 Point aPos = rMEvt.GetPosPixel();
 Point aMousePos( aPos );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-09-01 Thread Julien Nabet
 svx/source/tbxctrls/tbunosearchcontrollers.cxx |   30 ++---
 1 file changed, 13 insertions(+), 17 deletions(-)

New commits:
commit bb8641f649cb53a4afe0653d641bd9907e2dfa57
Author: Julien Nabet 
Date:   Mon Aug 28 18:42:50 2017 +0200

tdf#111818: add SearchItem.AlgorithmType2 option

and use InitPropertySequence

Change-Id: I1e7b6498828fc19c46c51501f1908dc830d8d826
Reviewed-on: https://gerrit.libreoffice.org/41654
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 
(cherry picked from commit 97cd8e4d64632bb65445cb2f395b1385a0a2a13b)
Reviewed-on: https://gerrit.libreoffice.org/41782
Reviewed-by: Eike Rathke 

diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx 
b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 90d104ae5e14..cdf087654b4b 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -28,6 +28,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -113,14 +114,6 @@ void impl_executeSearch( const css::uno::Reference< 
css::uno::XComponentContext
 }
 }
 
-css::uno::Sequence< css::beans::PropertyValue > lArgs(7);
-lArgs[0].Name = "SearchItem.SearchString";
-lArgs[0].Value <<= sFindText;
-lArgs[1].Name = "SearchItem.Backward";
-lArgs[1].Value <<= aSearchBackwards;
-lArgs[2].Name = "SearchItem.SearchFlags";
-lArgs[2].Value <<= (sal_Int32)0;
-lArgs[3].Name = "SearchItem.TransliterateFlags";
 SvtCTLOptions aCTLOptions;
 TransliterationFlags nFlags = TransliterationFlags::NONE;
 if (!aMatchCase)
@@ -129,21 +122,24 @@ void impl_executeSearch( const css::uno::Reference< 
css::uno::XComponentContext
 nFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL;
 if (aCTLOptions.IsCTLFontEnabled())
 nFlags |= TransliterationFlags::IGNORE_KASHIDA_CTL;
-lArgs[3].Value <<= (sal_Int32)nFlags;
-lArgs[4].Name = "SearchItem.Command";
-lArgs[4].Value <<= (sal_Int16)(aFindAll ?
-SvxSearchCmd::FIND_ALL : SvxSearchCmd::FIND );
-lArgs[5].Name = "SearchItem.AlgorithmType";
-lArgs[5].Value <<= (sal_Int16)0;  // 0 == SearchAlgorithms_ABSOLUTE
-lArgs[6].Name = "SearchItem.SearchFormatted";
-lArgs[6].Value <<= bSearchFormatted;
+
+auto aArgs( comphelper::InitPropertySequence( {
+{ "SearchItem.SearchString", css::uno::makeAny( sFindText ) },
+{ "SearchItem.Backward", css::uno::makeAny( aSearchBackwards ) },
+{ "SearchItem.SearchFlags", css::uno::makeAny( (sal_Int32)0 ) },
+{ "SearchItem.TransliterateFlags", css::uno::makeAny( 
(sal_Int32)nFlags ) },
+{ "SearchItem.Command", css::uno::makeAny( (sal_Int16)(aFindAll 
?SvxSearchCmd::FIND_ALL : SvxSearchCmd::FIND ) ) },
+{ "SearchItem.AlgorithmType", css::uno::makeAny( (sal_Int16)0 ) }, // 
0 == SearchAlgorithms_ABSOLUTE
+{ "SearchItem.AlgorithmType2", css::uno::makeAny( (sal_Int16)1 ) }, // 
1 == SearchAlgorithms2_ABSOLUTE
+{ "SearchItem.SearchFormatted", css::uno::makeAny( bSearchFormatted ) }
+} ) );
 
 css::uno::Reference< css::frame::XDispatchProvider > 
xDispatchProvider(xFrame, css::uno::UNO_QUERY);
 if ( xDispatchProvider.is() )
 {
 css::uno::Reference< css::frame::XDispatch > xDispatch = 
xDispatchProvider->queryDispatch( aURL, OUString(), 0 );
 if ( xDispatch.is() && !aURL.Complete.isEmpty() )
-xDispatch->dispatch( aURL, lArgs );
+xDispatch->dispatch( aURL, aArgs );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source sw/qa

2017-08-30 Thread Caolán McNamara
 svx/source/unodraw/unoshape.cxx|3 ++-
 sw/qa/core/data/odt/pass/tdf112017.odt |binary
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 9c781148593b71eaca1798d4415f63d8bc289899
Author: Caolán McNamara 
Date:   Tue Aug 29 11:43:42 2017 +0100

Resolves: tdf#112017 crash on particular odt

Change-Id: I6ba2e73562a16afecb6abdfe4f1a40b1e316379e
Reviewed-on: https://gerrit.libreoffice.org/41711
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 7cc707c7f510..784f4673bff7 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -3043,7 +3043,8 @@ void SvxShape::setAllPropertiesToDefault()
 mpObj->SetMergedItem(Svx3DCharacterModeItem(true));
 }
 
-mpModel->SetChanged();
+if (mpModel)
+mpModel->SetChanged();
 }
 
 void SvxShape::setPropertiesToDefault(
diff --git a/sw/qa/core/data/odt/pass/tdf112017.odt 
b/sw/qa/core/data/odt/pass/tdf112017.odt
new file mode 100644
index ..02a24d9db146
Binary files /dev/null and b/sw/qa/core/data/odt/pass/tdf112017.odt differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-08-23 Thread Tamás Zolnai
 svx/source/table/svdotable.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e96856b791b74e941130b32c1b7f2f1587a349c6
Author: Tamás Zolnai 
Date:   Sun Aug 13 17:31:20 2017 +0200

tdf#85909: EDITING: Native tables visualization not refreshed

... after changes to borders

Regression from:
26b06662ebc3e5d664400bc95c39d6220de03136
"avoid repeated table layouting (fdo#75622)"

It was a performance change, but it was a bad idea to avoid
table layout refresh on this way

Anyway I added a call for border update even if not all
the table layouting is done. I tested with the test
document attached to fdo#75622, import time seems similar
so it does not cause perfromance issue to do that.

Change-Id: I7c6fcf105c89233512390dc2ecbd111a32f6779a
Reviewed-on: https://gerrit.libreoffice.org/41116
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 
(cherry picked from commit 3f72879a8e54e18f3ad587f7284b84db592c8d1a)
Reviewed-on: https://gerrit.libreoffice.org/41119
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index ef58d32b4a5b..25694d72fd7b 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -719,6 +719,7 @@ void SdrTableObjImpl::LayoutTable( tools::Rectangle& rArea, 
bool bFitWidth, bool
 else
 {
 rArea = lastLayoutResultRectangle;
+mpLayouter->UpdateBorderLayout();
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-07-26 Thread Caolán McNamara
 svx/source/dialog/imapdlg.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 07838a39305d0ea95a43766cdeee53545ad80cec
Author: Caolán McNamara 
Date:   Tue Jul 25 13:39:18 2017 +0100

fix image map item ids

broken since...

commit 4bbf35572d94efe8b321e3159e9810f52bc3f9f8
Date:   Mon Jul 7 11:24:48 2014 +0200

RID_SVXDLG_IMAP conversion to .ui

Change-Id: Ic08b82af0b8890fb910153c87fb170618d95f34f
Reviewed-on: https://gerrit.libreoffice.org/40405
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 
Reviewed-by: Michael Stahl 

diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 6c6cb6467bf9..f79cb383c7ce 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -405,8 +405,8 @@ IMPL_LINK( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
 else if(nNewItemId == mnActiveId)
 {
 URLLoseFocusHdl( *m_pURLBox );
-bool bNewState = !pTbx->IsItemChecked( TBI_ACTIVE );
-pTbx->CheckItem( TBI_ACTIVE, bNewState );
+bool bNewState = !pTbx->IsItemChecked(mnActiveId);
+pTbx->CheckItem(mnActiveId, bNewState);
 pIMapWnd->SetCurrentObjState( !bNewState );
 }
 else if(nNewItemId == mnMacroId)
@@ -416,8 +416,8 @@ IMPL_LINK( SvxIMapDlg, TbxClickHdl, ToolBox*, pTbx, void )
 else if(nNewItemId == mnPolyEditId)
 {
 SetActiveTool( nNewItemId );
-pIMapWnd->SetPolyEditMode( pTbx->IsItemChecked( TBI_POLYEDIT ) ? 
SID_BEZIER_MOVE : 0 );
-if( pTbx->IsKeyEvent() && pTbx->IsItemChecked( TBI_POLYEDIT ) )
+pIMapWnd->SetPolyEditMode( pTbx->IsItemChecked(mnPolyEditId) ? 
SID_BEZIER_MOVE : 0 );
+if( pTbx->IsKeyEvent() && pTbx->IsItemChecked(mnPolyEditId) )
 pIMapWnd->StartPolyEdit();
 }
 else if(nNewItemId == mnPolyMoveId)
@@ -573,8 +573,8 @@ void SvxIMapDlg::SetActiveTool( sal_uInt16 nId )
 
 bool bMove = mnPolyMoveId == nId
 || ( mnPolyEditId == nId
-&& !m_pTbxIMapDlg1->IsItemChecked( TBI_POLYINSERT )
-&& !m_pTbxIMapDlg1->IsItemChecked( TBI_POLYDELETE ) );
+&& !m_pTbxIMapDlg1->IsItemChecked(mnPolyInsertId)
+&& !m_pTbxIMapDlg1->IsItemChecked(mnPolyDeleteId) );
 
 m_pTbxIMapDlg1->CheckItem( mnPolyMoveId, bMove );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-07-26 Thread Noel Grandin
 svx/source/unodraw/unoshap2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c694ce3e0b3a6832ed36b3ca683d18d740310bbd
Author: Noel Grandin 
Date:   Tue Jul 25 15:57:04 2017 +0200

tdf#109242 fix save/load of form button alignment

Regression introduced by commit
dcffc21805828ddff7de1282f3d40ffdf3fac38d
"use actual UNO enums in svx"

Change-Id: Ie3bb025fa0ef52d2e746e4556cf29dbd3c3d55a9
Reviewed-on: https://gerrit.libreoffice.org/40416
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 
(cherry picked from commit a4bab9609b04cb644859cf548bb4739a9d5aa590)
Reviewed-on: https://gerrit.libreoffice.org/40432

diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 48c0158b8fb9..fa6b6f0eef09 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -687,7 +687,7 @@ namespace
 for ( auto const & rEntry : aMapAdjustToAlign )
 if ( nValue == rEntry.nFormValue )
 {
-_rValue <<= rEntry.nAPIValue;
+_rValue <<= (sal_uInt16)rEntry.nAPIValue;
 return;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-07-14 Thread Tamás Zolnai
 svx/source/table/tablecontroller.cxx |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 73ea880fe1a21af5233b1cbb91618b568b760d8b
Author: Tamás Zolnai 
Date:   Tue Jul 11 21:32:33 2017 +0200

tdf#109050: Moving table object with ALT+Arrow keys does not work properly

ALT+up/down behaves differently inside a table: cursor is moved
to the left/right neighbouring cell instead of up/down. However
when the whole table is selected a different behavior is expected:
moving the table as an object.

Reviewed-on: https://gerrit.libreoffice.org/39810
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit f5637ae74ad6bb517255510a8ae786fd2a3cf977)

Change-Id: I82c7a3cc7d215b21f19fbf08dcdb7318a7e75289
Reviewed-on: https://gerrit.libreoffice.org/39837
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 47ca6dbcd5ad..6921f1d4190c 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1567,15 +1567,19 @@ SvxTableController::TblAction 
SvxTableController::getKeyboardAction(const KeyEve
 
 if( !bMod1 && bMod2 )
 {
-if( (nCode == awt::Key::UP) || (nCode == awt::Key::NUM8) )
+if(bTextEdit || mbCellSelectionMode)
 {
-nAction = TblAction::GotoLeftCell;
-}
-else if( (nCode == awt::Key::DOWN) || (nCode == awt::Key::NUM2) )
-{
-nAction = TblAction::GotoRightCell;
+if( (nCode == awt::Key::UP) || (nCode == awt::Key::NUM8) )
+{
+nAction = TblAction::GotoLeftCell;
+break;
+}
+else if( (nCode == awt::Key::DOWN) || (nCode == 
awt::Key::NUM2) )
+{
+nAction = TblAction::GotoRightCell;
+break;
+}
 }
-break;
 }
 
 bool bTextMove = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-07-04 Thread Tamás Zolnai
 svx/source/svdraw/svdedxv.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 893c6e4007da093d2e954b5a0cb847f8d3d65d66
Author: Tamás Zolnai 
Date:   Sat Jul 1 14:48:22 2017 +0200

tdf#107505: Impress - crash with two people co-editing one slide

In tiledrendering mode cursor inside shapes are not handled very well now.
Different LO instances manipulates the same cursor instead of having
one separate cursor for all instances (as in case of simple text editing
in Writer).

Crashes caused by that one cursor is owned (created and destroyed) by one
LO instance but used by an other instance in the meantime. We can avoid
this by not making this cursor available to the other instances. Cursor is
hidden anyway so don't need to have it set to the corresponding Window.

Change-Id: Id78f79e73eda88f3c2c6aa7f534c32f3f8aba174
Reviewed-on: https://gerrit.libreoffice.org/39432
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 258df6f41d89a606a980942df6337d446634c0a6)
Reviewed-on: https://gerrit.libreoffice.org/39435
Reviewed-by: Miklos Vajna 

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index f9aeb4ae1c1e..11fffc5c8a38 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -909,6 +909,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
 {
 OutlinerView* pOutlView = 
ImpMakeOutlinerView(static_cast(), nullptr);
 pOutlView->HideCursor();
+
static_cast()->SetCursor(nullptr);
 pTextEditOutliner->InsertView(pOutlView);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-06-21 Thread Caolán McNamara
 svx/source/styles/CommonStylePreviewRenderer.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 65afee1494ac1f71b39e4b3dc1ced52c5f21de54
Author: Caolán McNamara 
Date:   Tue Jun 20 11:44:47 2017 +0100

tdf#93968 bullet char style preview is unreadable, cause uses opensymbol

Change-Id: I1bd0a0e85c9d956184680d7e15709b3a7b590c30
Reviewed-on: https://gerrit.libreoffice.org/39010
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx 
b/svx/source/styles/CommonStylePreviewRenderer.cxx
index 45360ba89eb9..a1096c5e3e80 100644
--- a/svx/source/styles/CommonStylePreviewRenderer.cxx
+++ b/svx/source/styles/CommonStylePreviewRenderer.cxx
@@ -134,6 +134,8 @@ bool CommonStylePreviewRenderer::recalculate()
 if ((pItem = pItemSet->GetItem(SID_ATTR_CHAR_FONT)) != nullptr)
 {
 const SvxFontItem* pFontItem = static_cast(pItem);
+if (IsStarSymbol(pFontItem->GetFamilyName()))
+return false;
 pFont->SetFamilyName(pFontItem->GetFamilyName());
 pFont->SetStyleName(pFontItem->GetStyleName());
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-06-18 Thread Tamás Zolnai
 svx/source/svdraw/svdedxv.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a6c80dcb93a73d8d56122dab5030ed7eec17c109
Author: Tamás Zolnai 
Date:   Sun Jun 18 17:03:07 2017 +0200

tdf#107666: EDITING: No caret outside the textbox after inserting a textbox

This reverts commit 44555103217df34b218787f3dc6a2634b41fe52e.

Now revert the related commit, need to revisit the original bug later.

Change-Id: I08f42c4e859277ab411e4be5ad065fe3cca8bbb6
Reviewed-on: https://gerrit.libreoffice.org/38925
Reviewed-by: Tamás Zolnai 
Tested-by: Tamás Zolnai 

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index ea521d790752..f9aeb4ae1c1e 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1222,7 +1222,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool 
bDontDeleteReally)
 // and now the Outliner itself
 if (!bTextEditDontDelete) delete pTEOutliner;
 else pTEOutliner->Clear();
-if (bTextEditDontDelete && pTEWin!=nullptr) {
+if (pTEWin!=nullptr) {
 pTEWin->SetCursor(pTECursorMerker);
 }
 maHdlList.SetMoveOutside(false);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-06-16 Thread Caolán McNamara
 svx/source/tbxctrls/grafctrl.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3776f6e5c9418e82a882134e0177d07cb79d25e5
Author: Caolán McNamara 
Date:   Fri Jun 16 09:46:14 2017 +0100

only some languages put a space between number and %

Change-Id: I9dbbf403624a49513e4c596aef80754cd4e0a88d
Reviewed-on: https://gerrit.libreoffice.org/38868
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 7392ab25a906..71ef9f35b48f 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -19,6 +19,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -92,7 +93,7 @@ ImplGrafMetricField::ImplGrafMetricField( vcl::Window* 
pParent, const OUString&
 maCommand( rCmd ),
 mxFrame( rFrame )
 {
-Size aSize(CalcMinimumSizeForText("-100 %"));
+Size aSize(CalcMinimumSizeForText(unicode::formatPercent(-100, 
Application::GetSettings().GetUILanguageTag(;
 SetSizePixel(aSize);
 
 if ( maCommand == ".uno:GrafGamma" )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-06-16 Thread Caolán McNamara
 svx/source/tbxctrls/grafctrl.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 0ea4515cf252069ccbc22847ab5f8262a8de0243
Author: Caolán McNamara 
Date:   Fri Jun 16 09:42:47 2017 +0100

Resolves: tdf#108419 use spinfield preferred size as transparency widget 
size

Change-Id: I7b5c8aeb087efe007c687dc1f206bcb0e8b0173e
Reviewed-on: https://gerrit.libreoffice.org/38865
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 19a41f4e6f2d..7392ab25a906 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -92,11 +92,8 @@ ImplGrafMetricField::ImplGrafMetricField( vcl::Window* 
pParent, const OUString&
 maCommand( rCmd ),
 mxFrame( rFrame )
 {
-Size aSize( GetTextWidth( "-100 %" ), GetTextHeight() );
-
-aSize.Width() += 20;
-aSize.Height() += 6;
-SetSizePixel( aSize );
+Size aSize(CalcMinimumSizeForText("-100 %"));
+SetSizePixel(aSize);
 
 if ( maCommand == ".uno:GrafGamma" )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-06-13 Thread Tamás Zolnai
 svx/source/svdraw/svdedxv.cxx  |9 -
 svx/source/table/svdotable.cxx |   19 ++-
 2 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit cd38a25d41e1ce2acad25b1b5b2a5e77239e36ed
Author: Tamás Zolnai 
Date:   Mon Jun 12 14:34:59 2017 +0200

tdf#108480: Undo from clone formating does not remove vertical alignment

In the related change:
d36aa2ba3132ce62a370b7260ca620642cbf7dbf
wrong method was used to set cell properties, which does
not handle undo actions, so use the proper function.

Other issue was related to undo handling of vertical text
alignment in general. In some cases undo actions were lost
after user clicked out of the cell. It is because vertical
alignment is not affecting the outliner and so the related
undo actions were just dropped in EndTextEdit() method.

Change-Id: I3a6a95fac711056a658a3dee616733939cd13330
Reviewed-on: https://gerrit.libreoffice.org/38699
Tested-by: Jenkins 
Reviewed-by: Tamás Zolnai 
(cherry picked from commit 37d8ac12902506f4185e10f1de4f566dbaf53e42)
Reviewed-on: https://gerrit.libreoffice.org/38724

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index ff71c07db5bb..ea521d790752 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2228,9 +2228,8 @@ void SdrObjEditView::TakeFormatPaintBrush( 
std::shared_ptr< SfxItemSet >& rForma
 if( pObj && (pObj->GetObjInventor() == SdrInventor::Default ) && 
(pObj->GetObjIdentifier() == OBJ_TABLE) )
 {
 auto pTable = static_cast(pObj);
-if (pTable->getActiveCell().is()) {
-SfxItemSet const & rSet = pTable->GetActiveCellItemSet();
-rFormatSet->Put(rSet);
+if (mxSelectionController.is() && pTable->getActiveCell().is()) {
+mxSelectionController->GetAttributes(*rFormatSet, false);
 }
 }
 }
@@ -2378,8 +2377,8 @@ void SdrObjEditView::ApplyFormatPaintBrush( SfxItemSet& 
rFormatSet, bool bNoChar
 if( pObj && (pObj->GetObjInventor() == SdrInventor::Default) && 
(pObj->GetObjIdentifier() == OBJ_TABLE) )
 {
 auto pTable = static_cast(pObj);
-if (pTable->getActiveCell().is()) {
-pTable->SetMergedItemSetAndBroadcastOnActiveCell(rFormatSet);
+if (pTable->getActiveCell().is() && mxSelectionController.is()) {
+mxSelectionController->SetAttributes(rFormatSet, false);
 }
 }
 }
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 4c51d4149465..ef58d32b4a5b 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1768,18 +1768,19 @@ bool SdrTableObj::BegTextEdit(SdrOutliner& rOutl)
 
 void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
 {
-if(rOutl.IsModified())
+
+if (GetModel() && GetModel()->IsUndoEnabled() && !mpImpl->maUndos.empty())
 {
-if( GetModel() && GetModel()->IsUndoEnabled() )
-{
-// These actions should be on the undo stack after text edit.
-for (std::unique_ptr& pAction : mpImpl->maUndos)
-GetModel()->AddUndo(pAction.release());
-mpImpl->maUndos.clear();
+// These actions should be on the undo stack after text edit.
+for (std::unique_ptr& pAction : mpImpl->maUndos)
+GetModel()->AddUndo(pAction.release());
+mpImpl->maUndos.clear();
 
-GetModel()->AddUndo( 
GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*this) );
-}
+
GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*this));
+}
 
+if(rOutl.IsModified())
+{
 OutlinerParaObject* pNewText = nullptr;
 Paragraph* p1stPara = rOutl.GetParagraph( 0 );
 sal_Int32 nParaAnz = rOutl.GetParagraphCount();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source

2017-05-30 Thread Caolán McNamara
 svx/source/unodraw/unoshtxt.cxx |   20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit e7ee5921b366d885b1f3edd617764730d2aa03d9
Author: Caolán McNamara 
Date:   Tue May 30 10:49:01 2017 +0100

Related: tdf#107961 ensure notifyhdl is unset after dispose

Change-Id: I69790c8d3cfffc09ee6d6c165e17823223c5058a
Reviewed-on: https://gerrit.libreoffice.org/38237
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 0d688e55bf3c..2c8d5c31ea90 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -101,6 +101,7 @@ private:
 boolmbForwarderIsEditMode;  // have to 
reflect that, since ENDEDIT can happen more often
 boolmbShapeIsEditMode;  // only true, 
if SdrHintKind::BeginEdit was received
 boolmbNotificationsDisabled;// prevent 
EditEngine/Outliner notifications (e.g. when setting up forwarder)
+boolmbNotifyEditOutlinerSet;
 
 SvxUnoTextRangeBaseList maTextRanges;
 
@@ -173,7 +174,8 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* 
pObject, SdrText* pText
 mbOldUndoMode   ( false ),
 mbForwarderIsEditMode ( false ),
 mbShapeIsEditMode ( false ),
-mbNotificationsDisabled ( false )
+mbNotificationsDisabled ( false ),
+mbNotifyEditOutlinerSet ( false )
 {
 DBG_ASSERT( mpObject, "invalid pObject!" );
 
@@ -209,7 +211,8 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject& 
rObject, SdrText* pText
 mbOldUndoMode   ( false ),
 mbForwarderIsEditMode ( false ),
 mbShapeIsEditMode ( true ),
-mbNotificationsDisabled ( false )
+mbNotificationsDisabled ( false ),
+mbNotifyEditOutlinerSet ( false )
 {
 if( !mpText )
 {
@@ -390,7 +393,10 @@ void SvxTextEditSourceImpl::Notify(SfxBroadcaster& rBC, 
const SfxHint& rHint)
 
 // register as listener - need to broadcast state change 
messages
 if( mpView && mpView->GetTextEditOutliner() )
+{
 mpView->GetTextEditOutliner()->SetNotifyHdl( 
LINK(this, SvxTextEditSourceImpl, NotifyHdl) );
+mbNotifyEditOutlinerSet = true;
+}
 
 // Only now we're really in edit mode
 mbShapeIsEditMode = true;
@@ -409,7 +415,10 @@ void SvxTextEditSourceImpl::Notify(SfxBroadcaster& rBC, 
const SfxHint& rHint)
 
 // remove as listener - outliner might outlive ourselves
 if( mpView && mpView->GetTextEditOutliner() )
+{
 mpView->GetTextEditOutliner()->SetNotifyHdl( 
Link() );
+mbNotifyEditOutlinerSet = false;
+}
 
 // destroy view forwarder, OutlinerView no longer
 // valid (no need for UpdateData(), it's been
@@ -483,6 +492,12 @@ void SvxTextEditSourceImpl::dispose()
 
 if( mpView )
 {
+// remove as listener - outliner might outlive ourselves
+if (mbNotifyEditOutlinerSet && mpView && mpView->GetTextEditOutliner())
+{
+
mpView->GetTextEditOutliner()->SetNotifyHdl(Link());
+mbNotifyEditOutlinerSet = false;
+}
 EndListening( *mpView );
 mpView = nullptr;
 }
@@ -730,6 +745,7 @@ SvxDrawOutlinerViewForwarder* 
SvxTextEditSourceImpl::CreateViewForwarder()
 {
 // register as listener - need to broadcast state change messages
 mpView->GetTextEditOutliner()->SetNotifyHdl( LINK(this, 
SvxTextEditSourceImpl, NotifyHdl) );
+mbNotifyEditOutlinerSet = true;
 
 SdrTextObj* pTextObj = dynamic_cast( mpObject  );
 if( pTextObj )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - svx/source sw/qa

2017-05-19 Thread Vasily Melenchuk
 svx/source/customshapes/EnhancedCustomShape2d.cxx |   17 +++-
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |9 
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx  |   45 ++
 3 files changed, 60 insertions(+), 11 deletions(-)

New commits:
commit d82ef41ecfb92a3d6b138cf5cbce4ea1407fc8d4
Author: Vasily Melenchuk 
Date:   Mon May 15 13:41:14 2017 +0300

tdf#100072 zero height of shape's path was causing geometry errors

DOCX custom geometry shape's path width and height are now used
independently for scaling calculations.

Change-Id: I368dd4dc065b8f122c4eb2911261e45047f03c70
Reviewed-on: https://gerrit.libreoffice.org/37639
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 5477f7274e4df1210298c0f503a54eabc0f06bfc)
Reviewed-on: https://gerrit.libreoffice.org/37810
Tested-by: Thorsten Behrens 

diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index c3c2d4c33099..c4de12bbcfc3 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -651,10 +651,23 @@ void EnhancedCustomShape2d::SetPathSize( sal_Int32 nIndex 
)
 "svx",
 "ooxml shape, path width: " << nCoordWidth << " height: "
 << nCoordHeight);
+
+// Try to set up scale separately, if given only width or height
+// This is possible case in OOXML when only width or height is non-zero
 if ( nCoordWidth == 0 )
-fXScale = 1.0;
+{
+if ( nWidth )
+fXScale = (double)aLogicRect.GetWidth() / (double)nWidth;
+else
+fXScale = 1.0;
+}
 if ( nCoordHeight == 0 )
-fYScale = 1.0;
+{
+if ( nHeight )
+fYScale = (double)aLogicRect.GetHeight() / (double)nHeight;
+else
+fYScale = 1.0;
+}
 }
 if ( (sal_uInt32)nXRef != 0x8000 && aLogicRect.GetHeight() )
 {
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index ce8a77a02c8c..2aff1fb23ed1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -490,15 +490,6 @@ DECLARE_OOXMLEXPORT_TEST(testTdf107033, "tdf107033.docx")
 CPPUNIT_ASSERT_EQUAL(static_cast(25), 
getProperty(xPageStyle, "FootnoteLineRelativeWidth"));
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf100072, "tdf100072.docx")
-{
-// Ensure that shape has non-zero height
-CPPUNIT_ASSERT(getShape(1)->getSize().Height > 0);
-
-// Ensure that shape left corner is within page (positive)
-CPPUNIT_ASSERT(getShape(1)->getPosition().X > 0);
-}
-
 DECLARE_OOXMLEXPORT_TEST(testTdf107889, "tdf107889.docx")
 {
 uno::Reference xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
diff --git a/sw/qa/extras/ooxmlexport/data/tdf100072.docx 
b/sw/qa/extras/ooxmlimport/data/tdf100072.docx
similarity index 100%
rename from sw/qa/extras/ooxmlexport/data/tdf100072.docx
rename to sw/qa/extras/ooxmlimport/data/tdf100072.docx
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 87ccce61d9b5..90e36f1ef593 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -59,6 +60,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class Test : public SwModelTestBase
 {
@@ -1306,6 +1308,49 @@ DECLARE_OOXMLIMPORT_TEST(testTdf101627, "tdf101627.docx")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(466), getProperty(xFrame, 
"Height"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf100072, "tdf100072.docx")
+{
+uno::Reference xShape = getShape(1);
+
+// Ensure that shape has non-zero height
+CPPUNIT_ASSERT(xShape->getSize().Height > 0);
+
+// Ensure that shape left corner is within page (positive)
+CPPUNIT_ASSERT(xShape->getPosition().X > 0);
+
+// Save the first shape to a metafile.
+uno::Reference xGraphicExporter = 
drawing::GraphicExportFilter::create(comphelper::getProcessComponentContext());
+uno::Reference xSourceDoc(xShape, uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xSourceDoc);
+
+SvMemoryStream aStream;
+uno::Reference xOutputStream(new 
utl::OStreamWrapper(aStream));
+uno::Sequence aDescriptor =
+{
+beans::PropertyValue("OutputStream", sal_Int32(0), 
uno::makeAny(xOutputStream), beans::PropertyState_DIRECT_VALUE),
+beans::PropertyValue("FilterName", sal_Int32(0), 
uno::makeAny(OUString("SVM")), beans::PropertyState_DIRECT_VALUE)
+};
+xGraphicExporter->filter(aDescriptor);
+aStream.Seek(STREAM_SEEK_TO_BEGIN);
+
+// Read it back and dump it as an