[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - 2 commits - include/svx sd/source svx/source sw/source
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Sun Aug 4 18:40:15 UTC 2019
include/svx/svdedtv.hxx | 5 --
sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 2
svx/source/svdraw/svddrgmt.cxx | 3 -
svx/source/svdraw/svdedtv.cxx | 13 ++---
svx/source/svdraw/svdedtv1.cxx | 42 +++++++++++------
svx/source/svdraw/svdedxv.cxx | 3 -
sw/source/uibase/misc/swruler.cxx | 5 --
7 files changed, 46 insertions(+), 27 deletions(-)
New commits:
commit 47ac65005e6533c5121edff3985253b7ab919dfa
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Jul 2 00:01:01 2019 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Aug 4 20:39:52 2019 +0200
tdf#126180: EndTextEdit on all views before delete/cut slide
This also reworks the fixes tdf#125824 and tdf#111522 to use EndTextEdit
instead of blocking the undoing
Change-Id: I73c2289a9d950465f020f684e9e736148380f5c5
Reviewed-on: https://gerrit.libreoffice.org/74989
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
(cherry picked from commit e6c7a018a0cfee395ce2886d41c908a2447ef5cc)
Reviewed-on: https://gerrit.libreoffice.org/75027
Reviewed-by: Xisco FaulĂ <xiscofauli at libreoffice.org>
(cherry picked from commit 1aa93766ee3994af9975e96e8ea60e02078de2d8)
Reviewed-on: https://gerrit.libreoffice.org/75031
(cherry picked from commit f160dbfc92b89aff5afc4c87692e52bd50e3f09e)
Reviewed-on: https://gerrit.libreoffice.org/76923
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 17fc9af93c76..941aef9ae81c 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -187,10 +187,9 @@ public:
bool IsUndoEnabled() const;
/**
- * Checks if this or other views have an active text edit, in which case object undos are not
- * created.
+ * Checks if this or other views have an active text edit, if true, end them.
*/
- bool CanDoSdrUndo() const;
+ void EndTextEditAllViews() const;
std::vector< std::unique_ptr<SdrUndoAction> > CreateConnectorUndo( SdrObject& rO );
void AddUndoActions( std::vector< std::unique_ptr<SdrUndoAction> > );
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 0a8f11f58271..1dcf5fc6bdcd 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -234,6 +234,7 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
// (DEL -> accelerator -> SID_CUT).
if (mrSlideSorter.GetModel().GetPageCount() > 1)
{
+ mrSlideSorter.GetView().EndTextEditAllViews();
mrSlideSorter.GetController().GetSelectionManager()->DeleteSelectedPages();
}
@@ -371,6 +372,7 @@ void SlotManager::FuSupport (SfxRequest& rRequest)
case SID_CUT:
case SID_COPY:
case SID_DELETE:
+ mrSlideSorter.GetView().EndTextEditAllViews();
mrSlideSorter.GetController().GetClipboard().HandleSlotCall(rRequest);
break;
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index affd94e14bb6..d6d9a8db0668 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -1323,10 +1323,11 @@ bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/)
{
std::unique_ptr<SdrUndoAction> pUndo;
std::unique_ptr<SdrUndoAction> pUndo2;
- const bool bUndo = getSdrDragView().IsUndoEnabled() && getSdrDragView().CanDoSdrUndo();
+ const bool bUndo = getSdrDragView().IsUndoEnabled();
if( bUndo )
{
+ getSdrDragView().EndTextEditAllViews();
if(!getSdrDragView().IsInsObjPoint() && pObj->IsInserted() )
{
if (DragStat().IsEndDragChangesAttributes())
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index e42e90fcedeb..dc84c10bfdc6 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -977,8 +977,11 @@ bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, SdrInser
rPV.GetObjList()->InsertObject(pObj, SAL_MAX_SIZE);
}
}
- if( IsUndoEnabled() && CanDoSdrUndo())
+ if( IsUndoEnabled())
+ {
+ EndTextEditAllViews();
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
+ }
if (!(nOptions & SdrInsertFlags::DONTMARK)) {
if (!(nOptions & SdrInsertFlags::ADDMARK)) UnmarkAllObj();
@@ -1033,20 +1036,18 @@ bool SdrEditView::IsUndoEnabled() const
return mpModel->IsUndoEnabled();
}
-bool SdrEditView::CanDoSdrUndo() const
+void SdrEditView::EndTextEditAllViews() const
{
size_t nViews = mpModel->GetListenerCount();
for (size_t nView = 0; nView < nViews; ++nView)
{
- SdrEditView* pView = dynamic_cast<SdrEditView*>(mpModel->GetListener(nView));
+ SdrObjEditView* pView = dynamic_cast<SdrObjEditView*>(mpModel->GetListener(nView));
if (!pView)
continue;
if (pView->IsTextEdit())
- return false;
+ pView->SdrEndTextEdit();
}
-
- return true;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 21efbfcb74ea..1b7862623954 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -86,9 +86,12 @@ void SdrEditView::SetMarkedObjRect(const tools::Rectangle& rRect)
long w1=rRect.Right()-x1;
long h1=rRect.Bottom()-y1;
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
+ {
+ EndTextEditAllViews();
BegUndo(ImpGetDescriptionString(STR_EditPosSize));
+ }
for (size_t nm=0; nm<nCount; ++nm)
{
@@ -173,10 +176,11 @@ void SdrEditView::AddUndoActions( std::vector< std::unique_ptr<SdrUndoAction> >
void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy)
{
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aStr(SvxResId(STR_EditMove));
if (bCopy)
aStr += SvxResId(STR_EditWithCopy);
@@ -206,9 +210,10 @@ void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy)
void SdrEditView::ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy)
{
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aStr {ImpGetDescriptionString(STR_EditResize)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -240,9 +245,10 @@ void SdrEditView::ResizeMultMarkedObj(const Point& rRef,
const bool bWdh,
const bool bHgt)
{
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
BegUndo(ImpGetDescriptionString(STR_EditResize));
}
@@ -300,9 +306,10 @@ long SdrEditView::GetMarkedObjRotate() const
void SdrEditView::RotateMarkedObj(const Point& rRef, long nAngle, bool bCopy)
{
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aStr {ImpGetDescriptionString(STR_EditRotate)};
if (bCopy) aStr+=SvxResId(STR_EditWithCopy);
BegUndo(aStr);
@@ -355,10 +362,11 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nAngle, bool bCopy)
void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy)
{
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aStr;
Point aDif(rRef2-rRef1);
if (aDif.X()==0)
@@ -454,10 +462,11 @@ long SdrEditView::GetMarkedObjShear() const
void SdrEditView::ShearMarkedObj(const Point& rRef, long nAngle, bool bVShear, bool bCopy)
{
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aStr {ImpGetDescriptionString(STR_EditShear)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -567,12 +576,13 @@ void SdrEditView::CrookMarkedObj(const Point& rRef, const Point& rRad, SdrCrookM
bool bVertical, bool bNoContortion, bool bCopy)
{
tools::Rectangle aMarkRect(GetMarkedObjRect());
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
bool bRotate=bNoContortion && eMode==SdrCrookMode::Rotate && IsRotateAllowed();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aStr {ImpGetDescriptionString(bNoContortion ? STR_EditCrook : STR_EditCrookContortion)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -642,10 +652,11 @@ void SdrEditView::ImpDistortObj(SdrObject* pO, const tools::Rectangle& rRef, con
void SdrEditView::DistortMarkedObj(const tools::Rectangle& rRef, const XPolygon& rDistortedRect, bool bNoContortion, bool bCopy)
{
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aStr {ImpGetDescriptionString(STR_EditDistort)};
if (bCopy)
aStr+=SvxResId(STR_EditWithCopy);
@@ -751,7 +762,9 @@ void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr)
ShearMarkedObj(aAllSnapRect.Center(),nAngle,true);
}
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
+ if( bUndo )
+ EndTextEditAllViews();
// TODO: check if WhichRange is necessary.
const size_t nMarkCount=GetMarkedObjectCount();
@@ -999,9 +1012,10 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
nWhich = aIter.NextWhich();
}
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
BegUndo(ImpGetDescriptionString(STR_EditSetAttributes));
}
@@ -1177,10 +1191,11 @@ void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRe
{
if (AreObjectsMarked())
{
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aStr;
if (pStyleSheet!=nullptr)
aStr = ImpGetDescriptionString(STR_EditSetStylesheet);
@@ -1739,9 +1754,10 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
if (!GetMarkedObjectCount())
return;
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aStr(GetDescriptionOfMarkedObjects());
if (eHor==SdrHorAlign::NONE)
{
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 2af15dba79a3..c7f8b58e2fdf 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1454,9 +1454,10 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally)
pTEOutliner->SetBeginPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
pTEOutliner->SetEndPasteOrDropHdl(Link<PasteOrDropInfos*,void>());
- const bool bUndo = IsUndoEnabled() && CanDoSdrUndo();
+ const bool bUndo = IsUndoEnabled();
if( bUndo )
{
+ EndTextEditAllViews();
OUString aObjName(pTEObj->TakeObjNameSingul());
BegUndo(SvxResId(STR_UndoObjSetText),aObjName);
}
commit d83a1be6e83cf04d560db550209918b152d6daad
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Jul 11 12:50:42 2019 +0000
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Aug 4 20:39:40 2019 +0200
tdf#126333 use dialog color for "button" highlight
This control has many more problems. This is just a minimal
fix, so it'll use dialog color for the highlight. In addition
it uses the same color for the arrow then for the text.
Reviewed-on: https://gerrit.libreoffice.org/75419
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
(cherry picked from commit 2060f9598bc4480c44465abc9250b595c09af188)
Reviewed-on: https://gerrit.libreoffice.org/75425
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
(cherry picked from commit 54af6c8c873c3f6311806d210d5243b03e2d9fdf)
Change-Id: Iaf263087bc09309267b2d165331d710dfc92fc77
Reviewed-on: https://gerrit.libreoffice.org/75502
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
(cherry picked from commit 7ccc93d947ba3333cba6d99a03ed2d0c27b1983a)
Reviewed-on: https://gerrit.libreoffice.org/76922
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx
index 1784ac20dbcd..86667e6b02d7 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -116,7 +116,7 @@ void SwCommentRuler::DrawCommentControl(vcl::RenderContext& rRenderContext)
// Paint comment control background
// TODO Check if these are best colors to be used
- Color aBgColor = GetFadedColor( rStyleSettings.GetDarkShadowColor(), rStyleSettings.GetWorkspaceColor() );
+ Color aBgColor = GetFadedColor( rStyleSettings.GetDialogColor(), rStyleSettings.GetWorkspaceColor() );
maVirDev->SetFillColor( aBgColor );
if ( mbIsHighlighted || !bIsCollapsed )
@@ -185,8 +185,7 @@ void SwCommentRuler::DrawCommentControl(vcl::RenderContext& rRenderContext)
// Draw arrow
// FIXME consistence of button colors. https://opengrok.libreoffice.org/xref/core/vcl/source/control/button.cxx#785
- Color aArrowColor = GetFadedColor(COL_BLACK, rStyleSettings.GetShadowColor());
- ImplDrawArrow(*maVirDev.get(), aArrowPos.X(), aArrowPos.Y(), aArrowColor, bArrowToRight);
+ ImplDrawArrow(*maVirDev.get(), aArrowPos.X(), aArrowPos.Y(), aTextColor, bArrowToRight);
// Blit comment control
rRenderContext.DrawOutDev(aControlRect.TopLeft(), aControlRect.GetSize(), Point(), aControlRect.GetSize(), *maVirDev.get());
More information about the Libreoffice-commits
mailing list