Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2d4e9abc
Kaydet (Commit)
2d4e9abc
authored
Mar 18, 2016
tarafından
Maxim Monastirsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#93837 chart2: Convert shape context menus to xml
Change-Id: Ie0589c576b26dd74b9bc16d78a37a01c9bb2985e
üst
56cbb379
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
95 additions
and
241 deletions
+95
-241
AllLangResTarget_chartcontroller.mk
chart2/AllLangResTarget_chartcontroller.mk
+0
-2
UIConfig_chart2.mk
chart2/UIConfig_chart2.mk
+5
-0
MenuResIds.hrc
chart2/source/controller/inc/MenuResIds.hrc
+0
-31
ChartController_Window.cxx
chart2/source/controller/main/ChartController_Window.cxx
+31
-18
ShapeContextMenu.src
chart2/source/controller/menus/ShapeContextMenu.src
+0
-117
ShapeEditContextMenu.src
chart2/source/controller/menus/ShapeEditContextMenu.src
+0
-58
draw.xml
chart2/uiconfig/popupmenu/draw.xml
+31
-0
drawtext.xml
chart2/uiconfig/popupmenu/drawtext.xml
+17
-0
contextmenuhelper.hxx
include/svtools/contextmenuhelper.hxx
+1
-2
ChartWindowState.xcu
...gistry/data/org/openoffice/Office/UI/ChartWindowState.xcu
+10
-0
contextmenuhelper.cxx
svtools/source/uno/contextmenuhelper.cxx
+0
-13
No files found.
chart2/AllLangResTarget_chartcontroller.mk
Dosyayı görüntüle @
2d4e9abc
...
...
@@ -35,8 +35,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\
$(eval $(call gb_SrsTarget_add_nonlocalizable_files,chart2/res,\
chart2/source/controller/dialogs/Bitmaps.src \
chart2/source/controller/menus/ShapeContextMenu.src \
chart2/source/controller/menus/ShapeEditContextMenu.src \
))
# vim: set noet sw=4 ts=4:
chart2/UIConfig_chart2.mk
Dosyayı görüntüle @
2d4e9abc
...
...
@@ -13,6 +13,11 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/schart,\
chart2/uiconfig/menubar/menubar \
))
$(eval $(call gb_UIConfig_add_popupmenufiles,modules/schart,\
chart2/uiconfig/popupmenu/draw \
chart2/uiconfig/popupmenu/drawtext \
))
$(eval $(call gb_UIConfig_add_statusbarfiles,modules/schart,\
chart2/uiconfig/statusbar/statusbar \
))
...
...
chart2/source/controller/inc/MenuResIds.hrc
deleted
100644 → 0
Dosyayı görüntüle @
56cbb379
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef CHART_MENURESIDS_HRC
#define CHART_MENURESIDS_HRC
#include <svl/solar.hrc>
// context menus
#define RID_CONTEXTMENU_SHAPE (RID_APP_START + 1)
#define RID_CONTEXTMENU_SHAPEEDIT (RID_APP_START + 2)
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
chart2/source/controller/main/ChartController_Window.cxx
Dosyayı görüntüle @
2d4e9abc
...
...
@@ -44,18 +44,20 @@
#include "AxisHelper.hxx"
#include "LegendHelper.hxx"
#include "servicenames_charttypes.hxx"
#include "MenuResIds.hrc"
#include "DrawCommandDispatch.hxx"
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
#include <com/sun/star/awt/PopupMenuDirection.hpp>
#include <com/sun/star/frame/DispatchHelper.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
#include <comphelper/InlineContainer.hxx>
#include <comphelper/propertysequence.hxx>
#include <comphelper/propertyvalue.hxx>
#include <svtools/contextmenuhelper.hxx>
#include <toolkit/awt/vclxmenu.hxx>
...
...
@@ -950,12 +952,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if
(
m_aSelection
.
isSelectionDifferentFromBeforeMouseDown
()
)
impl_notifySelectionChangeListeners
();
if
(
isShapeContext
()
)
{
// #i12587# support for shapes in chart
PopupMenu
aContextMenu
(
SchResId
(
m_pDrawViewWrapper
->
IsTextEdit
()
?
RID_CONTEXTMENU_SHAPEEDIT
:
RID_CONTEXTMENU_SHAPE
)
);
::
svt
::
ContextMenuHelper
aContextMenuHelper
(
m_xFrame
);
css
::
uno
::
Reference
<
css
::
awt
::
XPopupMenu
>
xPopupMenu
(
m_xCC
->
getServiceManager
()
->
createInstanceWithContext
(
"com.sun.star.awt.PopupMenu"
,
m_xCC
),
css
::
uno
::
UNO_QUERY
);
Point
aPos
(
rCEvt
.
GetMousePosPixel
()
);
if
(
!
rCEvt
.
IsMouseEvent
()
)
{
...
...
@@ -963,14 +962,35 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
if
(
m_pChartWindow
)
aPos
=
m_pChartWindow
->
GetPointerState
().
maPos
;
}
aContextMenuHelper
.
completeAndExecute
(
aPos
,
aContextMenu
);
if
(
isShapeContext
()
)
{
// #i12587# support for shapes in chart
OUString
aMenuName
=
m_pDrawViewWrapper
->
IsTextEdit
()
?
OUString
(
"drawtext"
)
:
OUString
(
"draw"
);
css
::
uno
::
Sequence
<
css
::
uno
::
Any
>
aArgs
(
3
);
aArgs
[
0
]
<<=
comphelper
::
makePropertyValue
(
"Value"
,
aMenuName
);
aArgs
[
1
]
<<=
comphelper
::
makePropertyValue
(
"Frame"
,
m_xFrame
);
aArgs
[
2
]
<<=
comphelper
::
makePropertyValue
(
"IsContextMenu"
,
true
);
css
::
uno
::
Reference
<
css
::
frame
::
XPopupMenuController
>
xPopupController
(
m_xCC
->
getServiceManager
()
->
createInstanceWithArgumentsAndContext
(
"com.sun.star.comp.framework.ResourceMenuController"
,
aArgs
,
m_xCC
),
css
::
uno
::
UNO_QUERY
);
if
(
!
xPopupController
.
is
()
||
!
xPopupMenu
.
is
()
)
return
;
xPopupController
->
setPopupMenu
(
xPopupMenu
);
xPopupMenu
->
execute
(
css
::
uno
::
Reference
<
css
::
awt
::
XWindowPeer
>
(
m_xFrame
->
getContainerWindow
(),
css
::
uno
::
UNO_QUERY
),
css
::
awt
::
Rectangle
(
aPos
.
X
(),
aPos
.
Y
(),
0
,
0
),
css
::
awt
::
PopupMenuDirection
::
EXECUTE_DEFAULT
);
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
xComponent
(
xPopupController
,
css
::
uno
::
UNO_QUERY
);
if
(
xComponent
.
is
()
)
xComponent
->
dispose
();
}
else
{
// todo: the context menu should be specified by an xml file in uiconfig
uno
::
Reference
<
awt
::
XPopupMenu
>
xPopupMenu
(
m_xCC
->
getServiceManager
()
->
createInstanceWithContext
(
"com.sun.star.awt.PopupMenu"
,
m_xCC
),
uno
::
UNO_QUERY
);
if
(
xPopupMenu
.
is
())
{
sal_Int16
nUniqueId
=
1
;
...
...
@@ -1218,13 +1238,6 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
lcl_insertMenuCommand
(
xPopupMenu
,
nUniqueId
++
,
".uno:Paste"
);
::
svt
::
ContextMenuHelper
aContextMenuHelper
(
m_xFrame
);
Point
aPos
(
rCEvt
.
GetMousePosPixel
()
);
if
(
!
rCEvt
.
IsMouseEvent
()
)
{
SolarMutexGuard
aGuard
;
if
(
m_pChartWindow
)
aPos
=
m_pChartWindow
->
GetPointerState
().
maPos
;
}
aContextMenuHelper
.
completeAndExecute
(
aPos
,
xPopupMenu
);
}
}
...
...
chart2/source/controller/menus/ShapeContextMenu.src
deleted
100644 → 0
Dosyayı görüntüle @
56cbb379
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "MenuResIds.hrc"
#include "ShapeController.hrc"
Menu RID_CONTEXTMENU_SHAPE
{
ItemList =
{
MenuItem
{
Identifier = COMMAND_ID_FORMAT_LINE;
Command = ".uno:FormatLine";
};
MenuItem
{
Identifier = COMMAND_ID_FORMAT_AREA;
Command = ".uno:FormatArea";
};
MenuItem
{
Identifier = COMMAND_ID_TEXT_ATTRIBUTES;
Command = ".uno:TextAttributes";
};
MenuItem
{
Identifier = COMMAND_ID_TRANSFORM_DIALOG;
Command = ".uno:TransformDialog";
};
MenuItem
{
Separator = TRUE;
};
MenuItem
{
Identifier = COMMAND_ID_OBJECT_TITLE_DESCRIPTION;
Command = ".uno:ObjectTitleDescription";
};
MenuItem
{
Identifier = COMMAND_ID_RENAME_OBJECT;
Command = ".uno:RenameObject";
};
MenuItem
{
Separator = TRUE;
};
MenuItem
{
Identifier = COMMAND_ID_ARRANGE_ROW;
Command = ".uno:ArrangeRow";
SubMenu = Menu
{
ItemList =
{
MenuItem
{
Identifier = COMMAND_ID_BRING_TO_FRONT;
Command = ".uno:BringToFront";
};
MenuItem
{
Identifier = COMMAND_ID_FORWARD;
Command = ".uno:Forward";
};
MenuItem
{
Identifier = COMMAND_ID_BACKWARD;
Command = ".uno:Backward";
};
MenuItem
{
Identifier = COMMAND_ID_SEND_TO_BACK;
Command = ".uno:SendToBack";
};
};
};
};
MenuItem
{
Separator = TRUE;
};
MenuItem
{
Identifier = COMMAND_ID_CUT;
Command = ".uno:Cut";
};
MenuItem
{
Identifier = COMMAND_ID_COPY;
Command = ".uno:Copy";
};
MenuItem
{
Identifier = COMMAND_ID_PASTE;
Command = ".uno:Paste";
};
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
chart2/source/controller/menus/ShapeEditContextMenu.src
deleted
100644 → 0
Dosyayı görüntüle @
56cbb379
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "MenuResIds.hrc"
#include "ShapeController.hrc"
Menu RID_CONTEXTMENU_SHAPEEDIT
{
ItemList =
{
MenuItem
{
Identifier = COMMAND_ID_FONT_DIALOG;
Command = ".uno:FontDialog";
};
MenuItem
{
Identifier = COMMAND_ID_PARAGRAPH_DIALOG;
Command = ".uno:ParagraphDialog";
};
MenuItem
{
Separator = TRUE;
};
MenuItem
{
Identifier = COMMAND_ID_CUT;
Command = ".uno:Cut";
};
MenuItem
{
Identifier = COMMAND_ID_COPY;
Command = ".uno:Copy";
};
MenuItem
{
Identifier = COMMAND_ID_PASTE;
Command = ".uno:Paste";
};
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
chart2/uiconfig/popupmenu/draw.xml
0 → 100644
Dosyayı görüntüle @
2d4e9abc
<?xml version="1.0" encoding="UTF-8"?>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
<menu:menupopup
xmlns:menu=
"http://openoffice.org/2001/menu"
>
<menu:menuitem
menu:id=
".uno:Cut"
/>
<menu:menuitem
menu:id=
".uno:Copy"
/>
<menu:menuitem
menu:id=
".uno:Paste"
/>
<menu:menuseparator/>
<menu:menuitem
menu:id=
".uno:FormatLine"
/>
<menu:menuitem
menu:id=
".uno:FormatArea"
/>
<menu:menuitem
menu:id=
".uno:TextAttributes"
/>
<menu:menuitem
menu:id=
".uno:TransformDialog"
/>
<menu:menuseparator/>
<menu:menuitem
menu:id=
".uno:ObjectTitleDescription"
/>
<menu:menuitem
menu:id=
".uno:RenameObject"
/>
<menu:menuseparator/>
<menu:menu
menu:id=
".uno:ArrangeRow"
>
<menu:menupopup>
<menu:menuitem
menu:id=
".uno:BringToFront"
/>
<menu:menuitem
menu:id=
".uno:Forward"
/>
<menu:menuitem
menu:id=
".uno:Backward"
/>
<menu:menuitem
menu:id=
".uno:SendToBack"
/>
</menu:menupopup>
</menu:menu>
</menu:menupopup>
chart2/uiconfig/popupmenu/drawtext.xml
0 → 100644
Dosyayı görüntüle @
2d4e9abc
<?xml version="1.0" encoding="UTF-8"?>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
<menu:menupopup
xmlns:menu=
"http://openoffice.org/2001/menu"
>
<menu:menuitem
menu:id=
".uno:Cut"
/>
<menu:menuitem
menu:id=
".uno:Copy"
/>
<menu:menuitem
menu:id=
".uno:Paste"
/>
<menu:menuseparator/>
<menu:menuitem
menu:id=
".uno:FontDialog"
/>
<menu:menuitem
menu:id=
".uno:ParagraphDialog"
/>
</menu:menupopup>
include/svtools/contextmenuhelper.hxx
Dosyayı görüntüle @
2d4e9abc
...
...
@@ -55,9 +55,8 @@ class SVT_DLLPUBLIC ContextMenuHelper
ContextMenuHelper
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
xFrame
);
~
ContextMenuHelper
();
// method
s
to complete a popup menu (set images, labels, enable/disable states)
// method to complete a popup menu (set images, labels, enable/disable states)
// ATTENTION: The item ID's must be unique for the whole popup (inclusive the sub menus!)
void
completeAndExecute
(
const
Point
&
aPos
,
PopupMenu
&
aPopupMenu
);
void
completeAndExecute
(
const
Point
&
aPos
,
const
css
::
uno
::
Reference
<
css
::
awt
::
XPopupMenu
>&
xPopupMenu
);
private
:
...
...
officecfg/registry/data/org/openoffice/Office/UI/ChartWindowState.xcu
Dosyayı görüntüle @
2d4e9abc
...
...
@@ -20,6 +20,16 @@
<oor:component-data
xmlns:install=
"http://openoffice.org/2004/installation"
xmlns:oor=
"http://openoffice.org/2001/registry"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
oor:name=
"ChartWindowState"
oor:package=
"org.openoffice.Office.UI"
>
<node
oor:name=
"UIElements"
>
<node
oor:name=
"States"
>
<node
oor:name=
"private:resource/popupmenu/draw"
oor:op=
"replace"
>
<prop
oor:name=
"UIName"
oor:type=
"xs:string"
>
<value
xml:lang=
"en-US"
>
Shape
</value>
</prop>
</node>
<node
oor:name=
"private:resource/popupmenu/drawtext"
oor:op=
"replace"
>
<prop
oor:name=
"UIName"
oor:type=
"xs:string"
>
<value
xml:lang=
"en-US"
>
Shape Text
</value>
</prop>
</node>
<node
oor:name=
"private:resource/toolbar/standardbar"
oor:op=
"replace"
>
<prop
oor:name=
"Docked"
oor:type=
"xs:boolean"
>
<value>
true
</value>
...
...
svtools/source/uno/contextmenuhelper.cxx
Dosyayı görüntüle @
2d4e9abc
...
...
@@ -263,19 +263,6 @@ ContextMenuHelper::~ContextMenuHelper()
{
}
void
ContextMenuHelper
::
completeAndExecute
(
const
Point
&
aPos
,
PopupMenu
&
rPopupMenu
)
{
SolarMutexGuard
aSolarGuard
;
associateUIConfigurationManagers
();
completeMenuProperties
(
&
rPopupMenu
);
executePopupMenu
(
aPos
,
&
rPopupMenu
);
resetAssociations
();
}
void
ContextMenuHelper
::
completeAndExecute
(
const
Point
&
aPos
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment