[Libreoffice-commits] core.git: officecfg/registry sd/sdi sd/source
Andrzej Hunt
andrzej.hunt at collabora.com
Wed Feb 5 13:04:06 PST 2014
officecfg/registry/data/org/openoffice/Office/Accelerators.xcu | 6 ++
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 5 ++
officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 5 --
sd/sdi/_drvwsh.sdi | 5 ++
sd/sdi/outlnvsh.sdi | 5 ++
sd/source/ui/app/sddll.cxx | 1
sd/source/ui/func/fuoltext.cxx | 15 ++++++
sd/source/ui/func/fupoor.cxx | 18 +++++++
sd/source/ui/inc/fuoltext.hxx | 1
sd/source/ui/inc/fupoor.hxx | 1
sd/source/ui/view/drviews7.cxx | 4 +
sd/source/ui/view/drviewse.cxx | 24 +++++++++
sd/source/ui/view/outlnvs2.cxx | 2
sd/source/ui/view/outlnvsh.cxx | 25 ++++++++++
14 files changed, 112 insertions(+), 5 deletions(-)
New commits:
commit 84b4b7b931b194fc4d1980d2fa9c7fd6e0c9134c
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date: Sun Feb 2 22:35:39 2014 +0000
fdo#51525 Add Paste Unformatted Text to Impress.
Change-Id: I4eff66ee2990fd7bf6a9be6b9f0801e7a70206e9
Reviewed-on: https://gerrit.libreoffice.org/7783
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
index 272278c..624bcdf 100644
--- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu
@@ -2927,6 +2927,12 @@
<value xml:lang="en-US">.uno:PasteSpecial</value>
</prop>
</node>
+ <node oor:name="V_SHIFT_MOD1_MOD2" oor:op="replace">
+ <prop oor:name="Command">
+ <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
+ <value xml:lang="en-US">.uno:PasteUnformatted</value>
+ </prop>
+ </node>
<node oor:name="X_MOD1" oor:op="replace">
<prop oor:name="Command">
<value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index a16b900..e174849 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -3425,6 +3425,11 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:PasteUnformatted" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Paste Unformatted Text</value>
+ </prop>
+ </node>
<node oor:name=".uno:Delete" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Delete C~ontents...</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 4ed20add..3cb9be4 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -1081,11 +1081,6 @@
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:PasteUnformatted" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Paste Unformatted Text</value>
- </prop>
- </node>
<node oor:name=".uno:PasteSpecial" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Paste ~Special...</value>
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 857b30e..5e3373e 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -96,6 +96,11 @@ interface DrawView
ExecMethod = FuSupport ;
StateMethod = GetMenuState ;
]
+ SID_PASTE_UNFORMATTED
+ [
+ ExecMethod = FuSupport ;
+ StateMethod = GetMenuState ;
+ ]
SID_CLIPBOARD_FORMAT_ITEMS
[
ExecMethod = FuSupport ;
diff --git a/sd/sdi/outlnvsh.sdi b/sd/sdi/outlnvsh.sdi
index 7216934..dae93d6 100644
--- a/sd/sdi/outlnvsh.sdi
+++ b/sd/sdi/outlnvsh.sdi
@@ -36,6 +36,11 @@ interface OutlineView
ExecMethod = FuSupport ;
StateMethod = GetMenuState ;
]
+ SID_PASTE_UNFORMATTED // ole : no, status : ?
+ [
+ ExecMethod = FuSupport ;
+ StateMethod = GetMenuState ;
+ ]
SID_DELETE // ole : no, status : ?
[
ExecMethod = FuSupport ;
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index f7a27c0..1863c75 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -262,6 +262,7 @@ void SdDLL::RegisterControllers()
svx::FormatPaintBrushToolBoxControl::RegisterControl(SID_FORMATPAINTBRUSH, pMod );
SvxClipBoardControl::RegisterControl( SID_PASTE, pMod );
+ SvxClipBoardControl::RegisterControl( SID_PASTE_UNFORMATTED, pMod );
svx::ExtrusionColorControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
svx::FontWorkShapeTypeControl::RegisterControl( SID_FONTWORK_SHAPE_TYPE, pMod );
diff --git a/sd/source/ui/func/fuoltext.cxx b/sd/source/ui/func/fuoltext.cxx
index 22836070..09ee7d3 100644
--- a/sd/source/ui/func/fuoltext.cxx
+++ b/sd/source/ui/func/fuoltext.cxx
@@ -278,6 +278,21 @@ void FuOutlineText::DoPaste()
pOutlineView->GetViewByWindow(mpWindow)->PasteSpecial();
}
+/**
+ * Paste object as unformatted text from clipboard
+ */
+void FuOutlineText::DoPasteUnformatted()
+{
+ TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( mpViewShell->GetActiveWindow() ) );
+ if (aDataHelper.GetTransferable().is())
+ {
+ OUString aText;
+ if (aDataHelper.GetString(FORMAT_STRING, aText))
+ pOutlineView->GetViewByWindow(mpWindow)->InsertText(aText);
+ }
+}
+
+
} // end of namespace sd
diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx
index f681b23..e405536 100644
--- a/sd/source/ui/func/fupoor.cxx
+++ b/sd/source/ui/func/fupoor.cxx
@@ -938,6 +938,24 @@ void FuPoor::DoPaste()
}
/**
+ * Paste unformatted text from clipboard
+ */
+void FuPoor::DoPasteUnformatted()
+{
+ if (mpView)
+ {
+ sal_Int8 nAction = DND_ACTION_COPY;
+ TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( mpViewShell->GetActiveWindow() ) );
+ if (aDataHelper.GetTransferable().is())
+ {
+ mpView->InsertData( aDataHelper,
+ mpWindow->PixelToLogic( Rectangle( Point(), mpWindow->GetOutputSizePixel() ).Center() ),
+ nAction, sal_False, FORMAT_STRING);
+ }
+ }
+}
+
+/**
* Timer handler for Drag&Drop
*/
IMPL_LINK_NOARG(FuPoor, DragHdl)
diff --git a/sd/source/ui/inc/fuoltext.hxx b/sd/source/ui/inc/fuoltext.hxx
index c98ea09..7aea47b 100644
--- a/sd/source/ui/inc/fuoltext.hxx
+++ b/sd/source/ui/inc/fuoltext.hxx
@@ -50,6 +50,7 @@ public:
virtual void DoCut();
virtual void DoCopy();
virtual void DoPaste();
+ virtual void DoPasteUnformatted();
virtual void Activate(); // Function aktivieren
virtual void Deactivate(); // Function deaktivieren
diff --git a/sd/source/ui/inc/fupoor.hxx b/sd/source/ui/inc/fupoor.hxx
index a633eba..a41464d 100644
--- a/sd/source/ui/inc/fupoor.hxx
+++ b/sd/source/ui/inc/fupoor.hxx
@@ -63,6 +63,7 @@ public:
virtual void DoCut();
virtual void DoCopy();
virtual void DoPaste();
+ virtual void DoPasteUnformatted();
// Mouse- & Key-Events; Returnwert=sal_True: Event wurde bearbeitet
virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 59819b0..2ee3388 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -198,6 +198,7 @@ IMPL_LINK( DrawViewShell, ClipboardChanged, TransferableDataHelper*, pDataHelper
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL );
+ rBindings.Invalidate( SID_PASTE_UNFORMATTED );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
return 0;
@@ -601,6 +602,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
// clipboard (paste)
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PASTE ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PASTE_SPECIAL ) ||
+ SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_PASTE_UNFORMATTED ) ||
SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) )
{
if ( !mpClipEvtLstnr )
@@ -627,6 +629,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
{
rSet.DisableItem( SID_PASTE );
rSet.DisableItem( SID_PASTE_SPECIAL );
+ rSet.DisableItem( SID_PASTE_UNFORMATTED );
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
}
else if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CLIPBOARD_FORMAT_ITEMS ) )
@@ -1062,6 +1065,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
{
rSet.DisableItem( SID_PASTE );
rSet.DisableItem( SID_PASTE_SPECIAL );
+ rSet.DisableItem( SID_PASTE_UNFORMATTED );
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
rSet.DisableItem( SID_INSERT_FLD_DATE_FIX );
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 0c83d6c..9ef7de8 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -798,6 +798,30 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
}
break;
+ case SID_PASTE_UNFORMATTED:
+ {
+ WaitObject aWait( (Window*)GetActiveWindow() );
+
+ if(HasCurrentFunction())
+ {
+ GetCurrentFunction()->DoPasteUnformatted();
+ }
+ else if(mpDrawView)
+ {
+ sal_Int8 nAction = DND_ACTION_COPY;
+ TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) );
+ if (aDataHelper.GetTransferable().is())
+ {
+ mpDrawView->InsertData( aDataHelper,
+ GetActiveWindow()->PixelToLogic( Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ),
+ nAction, sal_False, FORMAT_STRING);
+ }
+ }
+
+ rReq.Ignore ();
+ }
+ break;
+
case SID_CLIPBOARD_FORMAT_ITEMS:
{
WaitObject aWait( (Window*)GetActiveWindow() );
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 1f2370a..8d1703c 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -331,6 +331,7 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
Invalidate(SID_CUT);
Invalidate(SID_COPY);
Invalidate(SID_PASTE);
+ Invalidate(SID_PASTE_UNFORMATTED);
}
void OutlineViewShell::ShowSlideShow(SfxRequest& rReq)
@@ -628,6 +629,7 @@ void OutlineViewShell::FuTemporaryModify(SfxRequest &rReq)
Invalidate(SID_CUT);
Invalidate(SID_COPY);
Invalidate(SID_PASTE);
+ Invalidate(SID_PASTE_UNFORMATTED);
}
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index c0e7ecd..cfdbfc7 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -475,6 +475,7 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
(nSlot == SID_TRANSLITERATE_KATAGANA) ||
(nSlot == SID_CUT) ||
(nSlot == SID_PASTE) ||
+ (nSlot == SID_PASTE_UNFORMATTED) ||
(nSlot == SID_DELETE)))
{
aGuard.reset( new OutlineViewModelChangeGuard( *pOlView ) );
@@ -529,6 +530,29 @@ void OutlineViewShell::FuSupport(SfxRequest &rReq)
}
break;
+ case SID_PASTE_UNFORMATTED:
+ {
+ OutlineViewPageChangesGuard aGuard2(pOlView);
+
+ if(HasCurrentFunction())
+ {
+ GetCurrentFunction()->DoPasteUnformatted();
+ }
+ else if(pOlView)
+ {
+ sal_Int8 nAction = DND_ACTION_COPY;
+ TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( GetActiveWindow() ) );
+ if (aDataHelper.GetTransferable().is())
+ {
+ pOlView->InsertData( aDataHelper,
+ GetActiveWindow()->PixelToLogic( Rectangle( Point(), GetActiveWindow()->GetOutputSizePixel() ).Center() ),
+ nAction, sal_False, FORMAT_STRING);
+ }
+ }
+
+ rReq.Ignore ();
+ }
+ break;
case SID_DELETE:
{
if( pOlView )
@@ -735,6 +759,7 @@ IMPL_LINK( OutlineViewShell, ClipboardChanged, TransferableDataHelper*, pDataHel
SfxBindings& rBindings = GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_PASTE );
rBindings.Invalidate( SID_PASTE_SPECIAL );
+ rBindings.Invalidate( SID_PASTE_UNFORMATTED );
rBindings.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
}
return 0;
More information about the Libreoffice-commits
mailing list