[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sd/source

2014-11-05 Thread Marco Cecchetti
 sd/source/ui/inc/ViewShellManager.hxx  |4 
 sd/source/ui/view/ViewShellManager.cxx |   24 +++-
 sd/source/ui/view/drviews1.cxx |9 +
 sd/source/ui/view/outlview.cxx |   11 ++-
 4 files changed, 42 insertions(+), 6 deletions(-)

New commits:
commit 613d312d771840225d75d2d61c66ffa614f66198
Author: Marco Cecchetti mrcek...@gmail.com
Date:   Wed Nov 5 20:15:32 2014 +0100

fix bnc#624546 (fdo#83773) slide pane cut/copy/paste in outline view

Problem:
When I'm in outline mode, if I select a slide in the left slide preview
pane, ctrl-c, then select another slide I would like it after and hit
ctrl-v; it refuses to cut/paste.

Analysis:
This issue is due to the fact that the outline view always grabs focus
when activated and a view is activated whenever is pushed to the
sfx shell stack even if it is not the new top-most active view shell
(see `ViewShellManager`, `SfxViewShell`, `SfxDispacther`).

Solution:
Make the `OutlineViewShell` grabs focus only if it is the top-most
active view shell.

Rationale:
When `OutlineViewShell::Activate` is invoked, instead of removing
the focus grabbing action completely, we check if the
`OutlineViewShell` instance is the the top-most view shell and
perform the focus grabbing action only in such a case. This change
required to have also the `DrawViewShell` grabbing focus on
activation (only when it is the top-most view shell). In order to
implement this solution I needed to add a new method (and data
member) to the `ViewShellManager` class. I named it
`GetTopViewShell`. This method returns a pointer to the top-most
active view shell of the internal stack. The returned pointer is
updated in the `UpdateShellStack` method, before the sfx shell
stack is updated.

For more details see :
https://gist.github.com/mcecchetti/15b3ebc505d6582ea0db

(cherry picked from commit 967a386bccb15b99915a1e878e42450fbe9a2d0e)
Signed-off-by: Andras Timar andras.ti...@collabora.com

Conflicts:
sd/source/ui/view/ViewShellManager.cxx

Change-Id: I619a406864f50f0e62dee3fcb9ac5d46e3d48272

diff --git a/sd/source/ui/inc/ViewShellManager.hxx 
b/sd/source/ui/inc/ViewShellManager.hxx
index 18ac6eb..926dbf8 100644
--- a/sd/source/ui/inc/ViewShellManager.hxx
+++ b/sd/source/ui/inc/ViewShellManager.hxx
@@ -165,6 +165,10 @@ public:
 */
 SfxShell* GetTopShell (void) const;
 
+/** Return the top-most active view shell on the internal shell stack.
+*/
+SfxShell* GetTopViewShell (void) const;
+
 /** Use this class to safely lock updates of the view shell stack.
 */
 class UpdateLock
diff --git a/sd/source/ui/view/ViewShellManager.cxx 
b/sd/source/ui/view/ViewShellManager.cxx
index bfb8ef8..21c5aa5 100644
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -126,6 +126,7 @@ public:
 void MoveToTop (const SfxShell rParentShell);
 SfxShell* GetShell (ShellId nId) const;
 SfxShell* GetTopShell (void) const;
+SfxShell* GetTopViewShell (void) const;
 void Shutdown (void);
 void InvalidateAllSubShells (const SfxShell* pParentShell);
 
@@ -203,6 +204,8 @@ private:
 bool mbFormShellAboveParent;
 
 SfxShell* mpTopShell;
+SfxShell* mpTopViewShell;
+
 
 void GatherActiveShells (ShellStack rShellList);
 
@@ -386,8 +389,13 @@ SfxShell* ViewShellManager::GetTopShell (void) const
 return NULL;
 }
 
-
-
+SfxShell* ViewShellManager::GetTopViewShell (void) const
+{
+if (mbValid)
+return mpImpl-GetTopViewShell();
+else
+return NULL;
+}
 
 void ViewShellManager::Shutdown (void)
 {
@@ -431,7 +439,8 @@ ViewShellManager::Implementation::Implementation (
   mpFormShell(NULL),
   mpFormShellParent(NULL),
   mbFormShellAboveParent(true),
-  mpTopShell(NULL)
+  mpTopShell(NULL),
+  mpTopViewShell(NULL)
 {
 (void)rManager;
 }
@@ -815,8 +824,10 @@ SfxShell* ViewShellManager::Implementation::GetTopShell 
(void) const
 return mpTopShell;
 }
 
-
-
+SfxShell* ViewShellManager::Implementation::GetTopViewShell (void) const
+{
+return mpTopViewShell;
+}
 
 void ViewShellManager::Implementation::LockUpdate (void)
 {
@@ -867,6 +878,9 @@ void ViewShellManager::Implementation::UpdateShellStack 
(void)
 // 1. Create the missing shells.
 CreateShells();
 
+// Update the pointer to the top-most active view shell.
+mpTopViewShell = maActiveViewShells.begin()-mpShell;
+
 
 // 2. Create the internal target stack.
 ShellStack aTargetStack;
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index bffde5d..2c949bf 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -91,6 +91,15 @@ namespace sd {
 void DrawViewShell::Activate(sal_Bool bIsMDIActivate)
 {
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sd/source

2014-10-03 Thread Tor Lillqvist
 sd/source/ui/docshell/docshel4.cxx |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit 8f8f7e944a0fce6d240550453696de3a78791204
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Oct 2 16:52:54 2014 +0300

bnc#657899: Paragraph vertical spacing differs from PowerPoint

We need to set the paragraph summation flag also for .pptx import. (As is
already done for .ppt import.)

This is what in the Options (Preferences) UI is called Add spacing between
paragraphs and tables (in current document), on the LibreOffice
Impress:General page. This is a setting that when set becomes local to the
document. I actually don't really understand why this needs to be a
user-visible option, wouldn't it be enough for it to be an internal flag 
that
is set for documents imported from .ppt and .pptx, and is clear otherwise?

(cherry picked from commit 96d210bf9ca0a99fc8256d6e0a4952207cce69e0)
Signed-off-by: Andras Timar andras.ti...@collabora.com

Conflicts:
sd/source/ui/docshell/docshel4.cxx

Change-Id: I525178957276e7d587b6ac4be8ae7919fc245a27

diff --git a/sd/source/ui/docshell/docshel4.cxx 
b/sd/source/ui/docshell/docshel4.cxx
index 91370cb..66df3ed 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -24,6 +24,8 @@
 #include sfx2/progress.hxx
 #include vcl/waitobj.hxx
 #include svx/svxids.hrc
+#include editeng/editeng.hxx
+#include editeng/editstat.hxx
 #include editeng/flstitem.hxx
 #include editeng/eeitem.hxx
 #include svl/aeitem.hxx
@@ -380,6 +382,26 @@ sal_Bool DrawDocShell::LoadFrom( SfxMedium rMedium )
 bool DrawDocShell::ImportFrom(SfxMedium rMedium,
 uno::Referencetext::XTextRange const xInsertPosition)
 {
+const OUString aFilterName( rMedium.GetFilter()-GetFilterName() );
+if( aFilterName == Impress MS PowerPoint 2007 XML ||
+aFilterName == Impress MS PowerPoint 2007 XML AutoPlay )
+{
+// As this is a MSFT format, we should use the MS Compat
+// mode for spacing before and after paragraphs.
+
+// This is copied from what is done for .ppt import in
+// ImplSdPPTImport::Import() in sd/source/filter/ppt/pptin.cxx
+// in. We need to tell both the edit engine of the draw outliner,
+// and the document, to do summation of paragraphs.
+SdrOutliner rOutl = mpDoc-GetDrawOutliner();
+sal_uInt32 nControlWord = rOutl.GetEditEngine().GetControlWord();
+nControlWord |=  EE_CNTRL_ULSPACESUMMATION;
+nControlWord =~ EE_CNTRL_ULSPACEFIRSTPARA;
+((EditEngine)rOutl.GetEditEngine()).SetControlWord( nControlWord );
+
+mpDoc-SetSummationOfParagraphs( true );
+}
+
 const sal_Bool bRet = SfxObjectShell::ImportFrom(rMedium, xInsertPosition);
 
 SfxItemSet* pSet = rMedium.GetItemSet();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sd/source

2014-04-27 Thread Luboš Luňák
 sd/source/ui/view/sdview3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 5d870f0474d43d6bbcaabda6ac3912c2ae2bbe28
Author: Luboš Luňák l.lu...@collabora.com
Date:   Sun Apr 27 12:55:32 2014 +0200

do not crash when pasting impress page into another impress page 
(cp#167)

Put an Impress page into clipboard, create new document, click 'Click to add
title', paste - crash.
Introduced by 5aee0c13cc62a81a38d4132db7972dc301c21b3d.

Change-Id: Ibe61a780244ce98205e5ae3964971d7d75e30870
(cherry picked from commit dffcd67a9a9865c9eca9756eea4e85445b50a15e)

diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index f0f21cf..0aecf6a 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -360,6 +360,7 @@ sal_Bool View::InsertData( const TransferableDataHelper 
rDataHelper,
 if( pOwnData-GetDocShell()  pOwnData-IsPageTransferable()  ISA( 
View ) )
 {
 mpClipboard-HandlePageDrop (*pOwnData);
+bReturn = true;
 }
 else if( pSourceView )
 {
@@ -1346,6 +1347,7 @@ sal_Bool View::InsertData( const TransferableDataHelper 
rDataHelper,
 // add text color
 pPickObj-SetMergedItemSetAndBroadcast( aSet );
 }
+bReturn = true;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits