summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-02-19 13:22:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-02-26 17:24:59 +0100
commit42f281c56e0c06327fa382c0984ecf2e8c21e414 (patch)
treee6b7a627d8d2ed88b43cf4d624efd47da6f3b36d /sd
parent96513a30a8c5782444ffb5691bbed13bd61114d9 (diff)
weld impress navigator
complicated by the effort to keep the non-standard behaviour of commit f3c68cdf8f6a0273c62b493552f78af0138a44e8 Date: Wed Feb 21 17:27:53 2018 +0100 tdf#115873 sd navigator: allow selecting but not focusing on objects and the self-dnd code Change-Id: I29c224739463d1d44690f30ed29db3fe2b16b4a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89045 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/inc/helpids.h11
-rw-r--r--sd/inc/pch/precompiled_sd.hxx7
-rw-r--r--sd/inc/pch/precompiled_sdui.hxx12
-rw-r--r--sd/inc/strings.hrc6
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx21
-rw-r--r--sd/source/ui/dlg/navigatr.cxx411
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx1262
-rw-r--r--sd/source/ui/dlg/tpaction.cxx4
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx1
-rw-r--r--sd/source/ui/inc/navigatr.hxx25
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx383
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx10
-rw-r--r--sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx4
-rw-r--r--sd/source/ui/view/drviews4.cxx13
-rw-r--r--sd/source/ui/view/sdview2.cxx6
-rw-r--r--sd/source/ui/view/tabcontr.cxx2
-rw-r--r--sd/uiconfig/simpress/ui/navigatorpanel.ui134
17 files changed, 785 insertions, 1527 deletions
diff --git a/sd/inc/helpids.h b/sd/inc/helpids.h
index 0b2622f4c4c3..25b4625d06e6 100644
--- a/sd/inc/helpids.h
+++ b/sd/inc/helpids.h
@@ -24,13 +24,8 @@
#define HID_SDGRAPHICVIEWSHELL "SD_HID_SDGRAPHICVIEWSHELL"
#define HID_SDOUTLINEVIEWSHELL "SD_HID_SDOUTLINEVIEWSHELL"
-#define HID_SD_NAVIGATOR_MENU1 "SD_HID_SD_NAVIGATOR_MENU1"
-#define HID_SD_NAVIGATOR_MENU2 "SD_HID_SD_NAVIGATOR_MENU2"
-#define HID_SD_NAVIGATOR_MENU3 "SD_HID_SD_NAVIGATOR_MENU3"
-
#define HID_SD_WIN_PRESENTATION "SD_HID_SD_WIN_PRESENTATION"
-
#define HID_SD_HTMLEXPORT_PAGE1 "SD_HID_SD_HTMLEXPORT_PAGE1"
#define HID_SD_HTMLEXPORT_PAGE2 "SD_HID_SD_HTMLEXPORT_PAGE2"
#define HID_SD_HTMLEXPORT_PAGE3 "SD_HID_SD_HTMLEXPORT_PAGE3"
@@ -38,19 +33,13 @@
#define HID_SD_HTMLEXPORT_PAGE5 "SD_HID_SD_HTMLEXPORT_PAGE5"
#define HID_SD_HTMLEXPORT_PAGE6 "SD_HID_SD_HTMLEXPORT_PAGE6"
-
-
#define HID_SD_TABBAR_PAGES "SD_HID_SD_TABBAR_PAGES"
#define HID_SD_TABBAR_LAYERS "SD_HID_SD_TABBAR_LAYERS"
-
#define HID_SD_NAMEDIALOG_OBJECT "SD_HID_SD_NAMEDIALOG_OBJECT"
#define HID_SD_NAMEDIALOG_PAGE "SD_HID_SD_NAMEDIALOG_PAGE"
#define HID_SD_NAMEDIALOG_LINEEND "SD_HID_SD_NAMEDIALOG_LINEEND"
-
-
-
#define HID_SD_TASK_PANE_PREVIEW_CURRENT "SD_HID_SD_TASK_PANE_PREVIEW_CURRENT"
#define HID_SD_TASK_PANE_PREVIEW_RECENT "SD_HID_SD_TASK_PANE_PREVIEW_RECENT"
#define HID_SD_TASK_PANE_PREVIEW_ALL "SD_HID_SD_TASK_PANE_PREVIEW_ALL"
diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx
index d352ebae06e3..739759515976 100644
--- a/sd/inc/pch/precompiled_sd.hxx
+++ b/sd/inc/pch/precompiled_sd.hxx
@@ -13,7 +13,7 @@
manual changes will be rewritten by the next run of update_pch.sh (which presumably
also fixes all possible problems, so it's usually better to use it).
- Generated on 2020-02-13 21:37:42 using:
+ Generated on 2020-02-25 20:28:15 using:
./bin/update_pch sd sd --cutoff=4 --exclude:system --exclude:module --include:local
If after updating build fails, use the following command to locate conflicting headers:
@@ -32,6 +32,7 @@
#include <map>
#include <memory>
#include <new>
+#include <optional>
#include <ostream>
#include <set>
#include <stddef.h>
@@ -72,7 +73,7 @@
#include <sal/typesizes.h>
#include <vcl/EnumContext.hxx>
#include <vcl/bitmapex.hxx>
-#include <vcl/builderfactory.hxx>
+#include <vcl/builder.hxx>
#include <vcl/commandevent.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <vcl/ctrl.hxx>
@@ -166,6 +167,7 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
+#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/framework/ResourceId.hpp>
#include <com/sun/star/drawing/framework/XConfiguration.hpp>
#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
@@ -294,7 +296,6 @@
#include <model/SlsPageEnumerationProvider.hxx>
#include <o3tl/cow_wrapper.hxx>
#include <o3tl/deleter.hxx>
-#include <optional>
#include <o3tl/safeint.hxx>
#include <o3tl/strong_int.hxx>
#include <o3tl/typed_flags_set.hxx>
diff --git a/sd/inc/pch/precompiled_sdui.hxx b/sd/inc/pch/precompiled_sdui.hxx
index d8fec6e26373..0dad26f2c9dc 100644
--- a/sd/inc/pch/precompiled_sdui.hxx
+++ b/sd/inc/pch/precompiled_sdui.hxx
@@ -13,7 +13,7 @@
manual changes will be rewritten by the next run of update_pch.sh (which presumably
also fixes all possible problems, so it's usually better to use it).
- Generated on 2020-02-01 11:00:25 using:
+ Generated on 2020-02-25 20:28:19 using:
./bin/update_pch sd sdui --cutoff=4 --exclude:system --include:module --include:local
If after updating build fails, use the following command to locate conflicting headers:
@@ -39,6 +39,7 @@
#include <math.h>
#include <memory>
#include <new>
+#include <optional>
#include <ostream>
#include <set>
#include <sstream>
@@ -100,7 +101,6 @@
#include <vcl/ITiledRenderable.hxx>
#include <vcl/NotebookBarAddonsMerger.hxx>
#include <vcl/Scanline.hxx>
-#include <vcl/accel.hxx>
#include <vcl/alpha.hxx>
#include <vcl/animate/Animation.hxx>
#include <vcl/animate/AnimationBitmap.hxx>
@@ -133,12 +133,10 @@
#include <vcl/menu.hxx>
#include <vcl/metaactiontypes.hxx>
#include <vcl/metric.hxx>
-#include <vcl/mnemonicengine.hxx>
#include <vcl/outdev.hxx>
#include <vcl/outdevmap.hxx>
#include <vcl/outdevstate.hxx>
#include <vcl/ptrstyle.hxx>
-#include <vcl/quickselectionengine.hxx>
#include <vcl/region.hxx>
#include <vcl/salgtype.hxx>
#include <vcl/salnativewidgets.hxx>
@@ -150,8 +148,6 @@
#include <vcl/textfilter.hxx>
#include <vcl/timer.hxx>
#include <vcl/transfer.hxx>
-#include <vcl/treelist.hxx>
-#include <vcl/treelistentries.hxx>
#include <vcl/uitest/factory.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/vclevent.hxx>
@@ -327,14 +323,11 @@
#include <editeng/paragraphdata.hxx>
#include <editeng/svxenum.hxx>
#include <editeng/svxfont.hxx>
-#include <helper/simplereferencecomponent.hxx>
#include <i18nlangtag/i18nlangtagdllapi.h>
#include <i18nlangtag/lang.h>
-#include <i18nlangtag/languagetag.hxx>
#include <o3tl/cow_wrapper.hxx>
#include <o3tl/deleter.hxx>
#include <o3tl/enumarray.hxx>
-#include <optional>
#include <o3tl/safeint.hxx>
#include <o3tl/sorted_vector.hxx>
#include <o3tl/strong_int.hxx>
@@ -429,7 +422,6 @@
#include <svx/xpoly.hxx>
#include <svx/xtable.hxx>
#include <tools/color.hxx>
-#include <tools/contnr.hxx>
#include <tools/date.hxx>
#include <tools/datetime.hxx>
#include <tools/debug.hxx>
diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 400b8ec22b00..08481d170398 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -157,9 +157,6 @@
// Strings for animation effects
#define STR_INSERT_TEXT NC_("STR_INSERT_TEXT", "Insert Text")
#define STR_LOAD_PRESENTATION_LAYOUT NC_("STR_LOAD_PRESENTATION_LAYOUT", "Load Master Slide")
-#define STR_DRAGTYPE_URL NC_("STR_DRAGTYPE_URL", "Insert as Hyperlink")
-#define STR_DRAGTYPE_EMBEDDED NC_("STR_DRAGTYPE_EMBEDDED", "Insert as Copy")
-#define STR_DRAGTYPE_LINK NC_("STR_DRAGTYPE_LINK", "Insert as Link")
#define STR_GLUE_ESCDIR_SMART NC_("STR_GLUE_ESCDIR_SMART", "Smart")
#define STR_GLUE_ESCDIR_LEFT NC_("STR_GLUE_ESCDIR_LEFT", "Left")
#define STR_GLUE_ESCDIR_RIGHT NC_("STR_GLUE_ESCDIR_RIGHT", "Right")
@@ -263,8 +260,6 @@
#define STR_GRAPHICS_STYLE_FAMILY NC_("STR_GRAPHICS_STYLE_FAMILY", "Drawing Styles")
#define STR_PRESENTATIONS_STYLE_FAMILY NC_("STR_PRESENTATIONS_STYLE_FAMILY", "Presentation Styles")
#define STR_CELL_STYLE_FAMILY NC_("STR_CELL_STYLE_FAMILY", "Cell Styles")
-#define STR_NAVIGATOR_SHOW_NAMED_SHAPES NC_("STR_NAVIGATOR_SHOW_NAMED_SHAPES", "Named shapes")
-#define STR_NAVIGATOR_SHOW_ALL_SHAPES NC_("STR_NAVIGATOR_SHOW_ALL_SHAPES", "All shapes")
#define STR_NAVIGATOR_SHAPE_BASE_NAME NC_("STR_NAVIGATOR_SHAPE_BASE_NAME", "Shape %1")
#define STR_SET_BACKGROUND_PICTURE NC_("STR_SET_BACKGROUND_PICTURE", "Set Background Image" )
#define RID_ANNOTATIONS_START NC_("RID_ANNOTATIONS_START", "Comments")
@@ -277,7 +272,6 @@
#define STRING_DRAG_AND_DROP_SLIDES NC_("STRING_DRAG_AND_DROP_SLIDES", "Drag and Drop Slides" )
#define STR_PHOTO_ALBUM_EMPTY_WARNING NC_("STR_PHOTO_ALBUM_EMPTY_WARNING", "Please add Images to the Album." )
#define STR_PHOTO_ALBUM_TEXTBOX NC_("STR_PHOTO_ALBUM_TEXTBOX", "Text Slide")
-#define STR_OBJECTS_TREE NC_("STR_OBJECTS_TREE", "Page Tree")
#define STR_OVERWRITE_WARNING NC_("STR_OVERWRITE_WARNING", "The local target directory '%FILENAME' is not empty. Some files might be overwritten. Do you want to continue?")
#define STR_LAYER_BCKGRND NC_("STR_LAYER_BCKGRND", "Background" )
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 2fe192f66de9..3f374b0fa051 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2114,8 +2114,9 @@ void SdTiledRenderingTest::testTdf115873()
ScopedVclPtrInstance<SdNavigatorWin> pNavigator(nullptr, &rBindings);
pNavigator->InitTreeLB(pXImpressDocument->GetDoc());
pNavigator->Show();
- VclPtr<SdPageObjsTLB> pObjects = pNavigator->GetObjects();
- pObjects->Select(pObjects->GetEntry(0));
+ SdPageObjsTLV& rObjects = pNavigator->GetObjects();
+ rObjects.SelectEntry("Slide 1");
+ rObjects.Select();
sd::ViewShell* pSdViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
SdrView* pSdrView = pSdViewShell->GetView();
pSdrView->UnmarkAllObj(pSdrView->GetSdrPageView());
@@ -2126,13 +2127,11 @@ void SdTiledRenderingTest::testTdf115873()
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), rMarkList.GetMarkCount());
// Single-click with the mouse.
- short nHeight = pObjects->GetEntryHeight();
- // Position of the center of the 2nd entry (first is the slide, second is
- // the shape).
- Point aPoint(pObjects->GetOutputWidthPixel() / 2, nHeight * 1.5);
- MouseEvent aMouseEvent(aPoint, /*nClicks=*/1, MouseEventModifiers::NONE, MOUSE_LEFT);
- pObjects->MouseButtonDown(aMouseEvent);
- pObjects->MouseButtonUp(aMouseEvent);
+ MouseEvent aMouseEvent(Point(0, 0), /*nClicks=*/1, MouseEventModifiers::NONE, MOUSE_LEFT);
+ rObjects.MousePressHdl(aMouseEvent);
+ rObjects.SelectEntry("Rectangle");
+ rObjects.Select();
+ rObjects.MouseReleaseHdl(aMouseEvent);
Scheduler::ProcessEventsToIdle();
// This failed, single-click did not result in a shape selection (only
// double-click did).
@@ -2148,10 +2147,10 @@ void SdTiledRenderingTest::testTdf115873Group()
SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
ScopedVclPtrInstance<SdNavigatorWin> pNavigator(nullptr, &rBindings);
pNavigator->InitTreeLB(pXImpressDocument->GetDoc());
- VclPtr<SdPageObjsTLB> pObjects = pNavigator->GetObjects();
+ SdPageObjsTLV& rObjects = pNavigator->GetObjects();
// This failed, Fill() and IsEqualToDoc() were out of sync for group
// shapes.
- CPPUNIT_ASSERT(pObjects->IsEqualToDoc(pXImpressDocument->GetDoc()));
+ CPPUNIT_ASSERT(rObjects.IsEqualToDoc(pXImpressDocument->GetDoc()));
}
void SdTiledRenderingTest::testCutSelectionChange()
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index b5b0d608b4da..18fe916f0050 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -49,52 +49,46 @@
#include <helpids.h>
#include <Window.hxx>
-namespace {
-static const sal_uInt16 nShowNamedShapesFilter=1;
-static const sal_uInt16 nShowAllShapesFilter=2;
-}
-
/**
* SdNavigatorWin - FloatingWindow
*/
SdNavigatorWin::SdNavigatorWin(vcl::Window* pParent, SfxBindings* pInBindings)
- : PanelLayout(pParent, "NavigatorPanel", "modules/simpress/ui/navigatorpanel.ui", nullptr)
+ : PanelLayout(pParent, "NavigatorPanel", "modules/simpress/ui/navigatorpanel.ui", nullptr, true)
+ , mxToolbox(m_xBuilder->weld_toolbar("toolbox"))
+ , mxTlbObjects(new SdPageObjsTLV(m_xBuilder->weld_tree_view("tree")))
+ , mxLbDocs(m_xBuilder->weld_combo_box("documents"))
+ , mxDragModeMenu(m_xBuilder->weld_menu("dragmodemenu"))
+ , mxShapeMenu(m_xBuilder->weld_menu("shapemenu"))
, mbDocImported ( false )
// On changes of the DragType: adjust SelectionMode of TLB!
, meDragType ( NAVIGATOR_DRAGTYPE_EMBEDDED )
, mpBindings ( pInBindings )
{
- get(maToolbox, "toolbox");
- get(maTlbObjects, "tree");
- Size aSize(maTlbObjects->LogicToPixel(Size(97, 67), MapMode(MapUnit::MapAppFont)));
- maTlbObjects->set_height_request(aSize.Width());
- maTlbObjects->set_width_request(aSize.Height());
- get(maLbDocs, "documents");
+ Size aSize(LogicToPixel(Size(97, 67), MapMode(MapUnit::MapAppFont)));
+ mxTlbObjects->set_size_request(aSize.Width(), aSize.Height());
+ mxTlbObjects->SetViewFrame( mpBindings->GetDispatcher()->GetFrame() );
- maTlbObjects->SetViewFrame( mpBindings->GetDispatcher()->GetFrame() );
+ mxTlbObjects->connect_row_activated(LINK(this, SdNavigatorWin, ClickObjectHdl));
+ mxTlbObjects->set_selection_mode(SelectionMode::Single);
- maTlbObjects->SetAccessibleName(SdResId(STR_OBJECTS_TREE));
+ mxToolbox->connect_clicked(LINK(this, SdNavigatorWin, SelectToolboxHdl));
+ mxToolbox->connect_menu_toggled(LINK(this, SdNavigatorWin, DropdownClickToolBoxHdl));
- maTlbObjects->SetDoubleClickHdl(LINK(this, SdNavigatorWin, ClickObjectHdl));
- maTlbObjects->SetSelectionMode(SelectionMode::Single);
-
- maToolbox->SetSelectHdl( LINK( this, SdNavigatorWin, SelectToolboxHdl ) );
- maToolbox->SetDropdownClickHdl( LINK(this, SdNavigatorWin, DropdownClickToolBoxHdl) );
- const sal_uInt16 nDragTypeId = maToolbox->GetItemId("dragmode");
- maToolbox->SetItemBits(nDragTypeId, maToolbox->GetItemBits(nDragTypeId) | ToolBoxItemBits::DROPDOWNONLY);
+ mxToolbox->set_item_menu("dragmode", mxDragModeMenu.get());
+ mxDragModeMenu->connect_activate(LINK(this, SdNavigatorWin, MenuSelectHdl));
// Shape filter drop down menu.
- const sal_uInt16 nShapeId = maToolbox->GetItemId("shapes");
- maToolbox->SetItemBits(nShapeId, maToolbox->GetItemBits(nShapeId) | ToolBoxItemBits::DROPDOWNONLY);
+ mxToolbox->set_item_menu("shapes", mxShapeMenu.get());
+ mxShapeMenu->connect_activate(LINK(this, SdNavigatorWin, ShapeFilterCallback));
// set focus to listbox, otherwise it is in the toolbox which is only useful
// for keyboard navigation
- maTlbObjects->GrabFocus();
- maTlbObjects->SetSdNavigator(this);
+ mxTlbObjects->grab_focus();
+ mxTlbObjects->SetSdNavigator(this);
// DragTypeListBox
- maLbDocs->setMaxWidthChars(20);
- maLbDocs->SetSelectHdl( LINK( this, SdNavigatorWin, SelectDocumentHdl ) );
+ mxLbDocs->set_size_request(42, -1); // set a nominal width so it takes width of surroundings
+ mxLbDocs->connect_changed(LINK(this, SdNavigatorWin, SelectDocumentHdl));
SetDragImage();
}
@@ -118,9 +112,11 @@ void SdNavigatorWin::dispose()
{
mpNavigatorCtrlItem.reset();
mpPageNameCtrlItem.reset();
- maToolbox.clear();
- maTlbObjects.clear();
- maLbDocs.clear();
+ mxDragModeMenu.reset();
+ mxShapeMenu.reset();
+ mxToolbox.reset();
+ mxTlbObjects.reset();
+ mxLbDocs.reset();
PanelLayout::dispose();
}
@@ -131,17 +127,9 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc )
sd::DrawDocShell* pDocShell = pNonConstDoc->GetDocSh();
const OUString& aDocShName( pDocShell->GetName() );
OUString aDocName = pDocShell->GetMedium()->GetName();
- maTlbObjects->SetSaveTreeItemStateFlag(true); //Added by yanjun for sym2_6385
- maTlbObjects->Clear();
- maTlbObjects->Fill( pDoc, false, aDocName ); // Only normal pages
- maTlbObjects->SetSaveTreeItemStateFlag(false); //Added by yanjun for sym2_6385
+ mxTlbObjects->Fill( pDoc, false, aDocName ); // Only normal pages
RefreshDocumentLB();
- maLbDocs->SelectEntry( aDocShName );
-}
-
-void SdNavigatorWin::FreshEntry( )
-{
- maTlbObjects->Invalidate();
+ mxLbDocs->set_active_text(aDocShName);
}
void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
@@ -157,36 +145,35 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
{
::sd::FrameView* pFrameView = pViewShell->GetFrameView();
if (pFrameView != nullptr)
- maTlbObjects->SetShowAllShapes(pFrameView->IsNavigatorShowingAllShapes(), false);
+ mxTlbObjects->SetShowAllShapes(pFrameView->IsNavigatorShowingAllShapes(), false);
}
// Disable the shape filter drop down menu when there is a running slide
// show.
- const sal_uInt16 nShapeId = maToolbox->GetItemId("shapes");
if (pViewShell!=nullptr && sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ))
- maToolbox->EnableItem(nShapeId, false);
+ mxToolbox->set_item_sensitive("shapes", false);
else
- maToolbox->EnableItem(nShapeId);
+ mxToolbox->set_item_sensitive("shapes", true);
- if( !maTlbObjects->IsEqualToDoc( pDoc ) )
+ if( !mxTlbObjects->IsEqualToDoc( pDoc ) )
{
OUString aDocName = pDocShell->GetMedium()->GetName();
- maTlbObjects->Clear();
- maTlbObjects->Fill( pDoc, false, aDocName ); // only normal pages
+ mxTlbObjects->clear();
+ mxTlbObjects->Fill( pDoc, false, aDocName ); // only normal pages
RefreshDocumentLB();
- maLbDocs->SelectEntry( aDocShName );
+ mxLbDocs->set_active_text(aDocShName);
}
else
{
- maLbDocs->SetNoSelection();
- maLbDocs->SelectEntry( aDocShName );
+ mxLbDocs->set_active(-1);
+ mxLbDocs->set_active_text(aDocShName);
// commented in order to fix 30246
-// if( maLbDocs->GetSelectedEntryCount() == 0 )
+// if( mxLbDocs->get_active() == -1 )
{
RefreshDocumentLB();
- maLbDocs->SelectEntry( aDocShName );
+ mxLbDocs->set_active_text(aDocShName);
}
}
@@ -204,45 +191,33 @@ NavigatorDragType SdNavigatorWin::GetNavigatorDragType()
NavigatorDragType eDT = meDragType;
NavDocInfo* pInfo = GetDocInfo();
- if( ( eDT == NAVIGATOR_DRAGTYPE_LINK ) && ( ( pInfo && !pInfo->HasName() ) || !maTlbObjects->IsLinkableSelected() ) )
+ if( ( eDT == NAVIGATOR_DRAGTYPE_LINK ) && ( ( pInfo && !pInfo->HasName() ) || !mxTlbObjects->IsLinkableSelected() ) )
eDT = NAVIGATOR_DRAGTYPE_NONE;
return eDT;
}
-VclPtr<SdPageObjsTLB> const & SdNavigatorWin::GetObjects() const
+SdPageObjsTLV& SdNavigatorWin::GetObjects()
{
- return maTlbObjects;
+ return *mxTlbObjects;
}
-IMPL_LINK_NOARG(SdNavigatorWin, SelectToolboxHdl, ToolBox *, void)
+IMPL_LINK(SdNavigatorWin, SelectToolboxHdl, const OString&, rCommand, void)
{
- sal_uInt16 nId = maToolbox->GetCurItemId();
- const OUString sCommand = maToolbox->GetItemCommand(nId);
PageJump ePage = PAGE_NONE;
- if (sCommand == "first")
- {
+ if (rCommand == "first")
ePage = PAGE_FIRST;
- maTlbObjects->Select( maTlbObjects->GetFirstEntryInView() );
- }
- else if (sCommand == "previous")
- {
+ else if (rCommand == "previous")
ePage = PAGE_PREVIOUS;
- if( maTlbObjects->GetPrevEntryInView( maTlbObjects->GetCurEntry() ) != nullptr )
- maTlbObjects->Select( maTlbObjects->GetPrevEntryInView( maTlbObjects->GetCurEntry() ) );
- }
- else if (sCommand == "next")
- {
+ else if (rCommand == "next")
ePage = PAGE_NEXT;
- if( maTlbObjects->GetNextEntryInView( maTlbObjects->GetCurEntry() ) != nullptr )
- maTlbObjects->Select( maTlbObjects->GetNextEntryInView( maTlbObjects->GetCurEntry() ) );
- }
- else if (sCommand == "last")
- {
+ else if (rCommand == "last")
ePage = PAGE_LAST;
- maTlbObjects->Select( maTlbObjects->GetLastEntryInView() );
- }
+ else if (rCommand == "dragmode")
+ mxToolbox->set_menu_item_active("dragmode", !mxToolbox->get_menu_item_active("dragmode"));
+ else if (rCommand == "shapes")
+ mxToolbox->set_menu_item_active("shapes", !mxToolbox->get_menu_item_active("shapes"));
if (ePage != PAGE_NONE)
{
@@ -252,84 +227,41 @@ IMPL_LINK_NOARG(SdNavigatorWin, SelectToolboxHdl, ToolBox *, void)
}
}
-IMPL_LINK( SdNavigatorWin, DropdownClickToolBoxHdl, ToolBox*, pBox, void )
+IMPL_LINK(SdNavigatorWin, DropdownClickToolBoxHdl, const OString&, rCommand, void)
{
- sal_uInt16 nId = maToolbox->GetCurItemId();
- const OUString sCommand = maToolbox->GetItemCommand(nId);
+ if (!mxToolbox->get_menu_item_active(rCommand))
+ return;
- if (sCommand == "dragmode")
+ if (rCommand == "dragmode")
{
- // Popup menu is created depending if the document is saved or not
- ScopedVclPtrInstance<PopupMenu> pMenu;
-
- static const char* aHIDs[] =
- {
- HID_SD_NAVIGATOR_MENU1,
- HID_SD_NAVIGATOR_MENU2,
- HID_SD_NAVIGATOR_MENU3,
- nullptr
- };
-
- for (sal_uInt16 nID = NAVIGATOR_DRAGTYPE_URL; nID < NAVIGATOR_DRAGTYPE_COUNT; ++nID)
- {
- const char* pRId = GetDragTypeSdStrId(static_cast<NavigatorDragType>(nID));
- if (pRId)
- {
- DBG_ASSERT(aHIDs[nID-NAVIGATOR_DRAGTYPE_URL],"HelpId not added!");
- pMenu->InsertItem(nID, SdResId(pRId), MenuItemBits::RADIOCHECK);
- pMenu->SetHelpId(nID, aHIDs[nID - NAVIGATOR_DRAGTYPE_URL]);
- }
-
- }
NavDocInfo* pInfo = GetDocInfo();
-
- if( ( pInfo && !pInfo->HasName() ) || !maTlbObjects->IsLinkableSelected() )
+ if( ( pInfo && !pInfo->HasName() ) || !mxTlbObjects->IsLinkableSelected() )
{
- pMenu->EnableItem( NAVIGATOR_DRAGTYPE_LINK, false );
- pMenu->EnableItem( NAVIGATOR_DRAGTYPE_URL, false );
+ mxDragModeMenu->set_sensitive(OString::number(NAVIGATOR_DRAGTYPE_LINK), false);
+ mxDragModeMenu->set_sensitive(OString::number(NAVIGATOR_DRAGTYPE_URL), false);
meDragType = NAVIGATOR_DRAGTYPE_EMBEDDED;
}
- pMenu->CheckItem( static_cast<sal_uInt16>(meDragType) );
- pMenu->SetSelectHdl( LINK( this, SdNavigatorWin, MenuSelectHdl ) );
-
- pMenu->Execute( this, maToolbox->GetItemRect( nId ), PopupMenuFlags::ExecuteDown );
- pBox->EndSelection();
+ mxDragModeMenu->set_active(OString::number(meDragType), true);
}
- else if (sCommand == "shapes")
+ else if (rCommand == "shapes")
{
- ScopedVclPtrInstance<PopupMenu> pMenu;
-
- pMenu->InsertItem(
- nShowNamedShapesFilter,
- SdResId(STR_NAVIGATOR_SHOW_NAMED_SHAPES),
- MenuItemBits::RADIOCHECK);
- pMenu->InsertItem(
- nShowAllShapesFilter,
- SdResId(STR_NAVIGATOR_SHOW_ALL_SHAPES),
- MenuItemBits::RADIOCHECK);
-
- if (maTlbObjects->GetShowAllShapes())
- pMenu->CheckItem(nShowAllShapesFilter);
- else
- pMenu->CheckItem(nShowNamedShapesFilter);
- pMenu->SetSelectHdl( LINK( this, SdNavigatorWin, ShapeFilterCallback ) );
-
- pMenu->Execute( this, maToolbox->GetItemRect( nId ), PopupMenuFlags::ExecuteDown );
- pBox->EndSelection();
+ bool bAll = mxTlbObjects->GetShowAllShapes();
+ mxShapeMenu->set_active("named", !bAll);
+ mxShapeMenu->set_active("all", bAll);
}
}
-IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl, SvTreeListBox*, bool)
+IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl, weld::TreeView&, bool)
{
- if( !mbDocImported || maLbDocs->GetSelectedEntryPos() != 0 )
+ if( !mbDocImported || mxLbDocs->get_active() != 0 )
{
NavDocInfo* pInfo = GetDocInfo();
// if it is the active window, we jump to the page
if( pInfo && pInfo->IsActive() )
{
- OUString aStr( maTlbObjects->GetSelectedEntry() );
+ OUString aStr(mxTlbObjects->get_selected_text());
if( !aStr.isEmpty() )
{
@@ -337,8 +269,6 @@ IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl, SvTreeListBox*, bool)
mpBindings->GetDispatcher()->ExecuteList(
SID_NAVIGATOR_OBJECT,
SfxCallMode::SLOT | SfxCallMode::RECORD, { &aItem });
- //set sign variable
- maTlbObjects->Invalidate();
// moved here from SetGetFocusHdl. Reset the
// focus only if something has been selected in the
@@ -368,20 +298,20 @@ IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl, SvTreeListBox*, bool)
}
}
- if (!maTlbObjects->IsNavigationGrabsFocus())
+ if (!mxTlbObjects->IsNavigationGrabsFocus())
// This is the case when keyboard navigation inside the
// navigator should continue to work.
- maTlbObjects->GrabFocus();
+ mxTlbObjects->grab_focus();
}
}
}
return false;
}
-IMPL_LINK_NOARG(SdNavigatorWin, SelectDocumentHdl, ListBox&, void)
+IMPL_LINK_NOARG(SdNavigatorWin, SelectDocumentHdl, weld::ComboBox&, void)
{
- OUString aStrLb = maLbDocs->GetSelectedEntry();
- long nPos = maLbDocs->GetSelectedEntryPos();
+ OUString aStrLb = mxLbDocs->get_active_text();
+ long nPos = mxLbDocs->get_active();
bool bFound = false;
::sd::DrawDocShell* pDocShell = nullptr;
NavDocInfo* pInfo = GetDocInfo();
@@ -402,18 +332,18 @@ IMPL_LINK_NOARG(SdNavigatorWin, SelectDocumentHdl, ListBox&, void)
if( bFound )
{
SdDrawDocument* pDoc = pDocShell->GetDoc();
- if( !maTlbObjects->IsEqualToDoc( pDoc ) )
+ if( !mxTlbObjects->IsEqualToDoc( pDoc ) )
{
SdDrawDocument* pNonConstDoc = pDoc; // const as const can...
::sd::DrawDocShell* pNCDocShell = pNonConstDoc->GetDocSh();
OUString aDocName = pNCDocShell->GetMedium()->GetName();
- maTlbObjects->Clear();
- maTlbObjects->Fill( pDoc, false, aDocName ); // only normal pages
+ mxTlbObjects->clear();
+ mxTlbObjects->Fill( pDoc, false, aDocName ); // only normal pages
}
}
// check if link or url is possible
- if( ( pInfo && !pInfo->HasName() ) || !maTlbObjects->IsLinkableSelected() || ( meDragType != NAVIGATOR_DRAGTYPE_EMBEDDED ) )
+ if( ( pInfo && !pInfo->HasName() ) || !mxTlbObjects->IsLinkableSelected() || ( meDragType != NAVIGATOR_DRAGTYPE_EMBEDDED ) )
{
meDragType = NAVIGATOR_DRAGTYPE_EMBEDDED;
SetDragImage();
@@ -422,84 +352,60 @@ IMPL_LINK_NOARG(SdNavigatorWin, SelectDocumentHdl, ListBox&, void)
/**
* Set DrageType and set image accordingly to it.
- * If the handler is called with NULL, the default (URL) is set.
*/
-IMPL_LINK( SdNavigatorWin, MenuSelectHdl, Menu *, pMenu, bool )
+IMPL_LINK(SdNavigatorWin, MenuSelectHdl, const OString&, rIdent, void)
{
- sal_uInt16 nMenuId;
- if( pMenu )
- nMenuId = pMenu->GetCurItemId();
- else
- nMenuId = NAVIGATOR_DRAGTYPE_URL;
+ sal_uInt32 nMenuId = rIdent.toUInt32();
- if( nMenuId != USHRT_MAX ) // Necessary ?
+ NavigatorDragType eDT = static_cast<NavigatorDragType>(nMenuId);
+ if( meDragType != eDT )
{
- NavigatorDragType eDT = static_cast<NavigatorDragType>(nMenuId);
- if( meDragType != eDT )
- {
- meDragType = eDT;
- SetDragImage();
+ meDragType = eDT;
+ SetDragImage();
- if( meDragType == NAVIGATOR_DRAGTYPE_URL )
- {
- // patch, prevents endless loop
- if( maTlbObjects->GetSelectionCount() > 1 )
- maTlbObjects->SelectAll( false );
+ if( meDragType == NAVIGATOR_DRAGTYPE_URL )
+ {
+ // patch, prevents endless loop
+ if (mxTlbObjects->count_selected_rows() > 1)
+ mxTlbObjects->unselect_all();
- maTlbObjects->SetSelectionMode( SelectionMode::Single );
- }
- else
- maTlbObjects->SetSelectionMode( SelectionMode::Multiple );
+ mxTlbObjects->set_selection_mode(SelectionMode::Single);
}
+ else
+ mxTlbObjects->set_selection_mode(SelectionMode::Multiple);
}
- return false;
}
-IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, Menu *, pMenu, bool )
+IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, const OString&, rIdent, void )
{
- if (pMenu != nullptr)
- {
- bool bShowAllShapes (maTlbObjects->GetShowAllShapes());
- sal_uInt16 nMenuId (pMenu->GetCurItemId());
- switch (nMenuId)
- {
- case nShowNamedShapesFilter:
- bShowAllShapes = false;
- break;
-
- case nShowAllShapesFilter:
- bShowAllShapes = true;
- break;
-
- default:
- OSL_FAIL(
- "SdNavigatorWin::ShapeFilterCallback called for unknown menu entry");
- break;
- }
+ bool bShowAllShapes(mxTlbObjects->GetShowAllShapes());
+ if (rIdent == "named")
+ bShowAllShapes = false;
+ else if (rIdent == "all")
+ bShowAllShapes = true;
+ else
+ OSL_FAIL("SdNavigatorWin::ShapeFilterCallback called for unknown menu entry");
- maTlbObjects->SetShowAllShapes(bShowAllShapes, true);
+ mxTlbObjects->SetShowAllShapes(bShowAllShapes, true);
- // Remember the selection in the FrameView.
- NavDocInfo* pInfo = GetDocInfo();
- if (pInfo != nullptr)
+ // Remember the selection in the FrameView.
+ NavDocInfo* pInfo = GetDocInfo();
+ if (pInfo != nullptr)
+ {
+ ::sd::DrawDocShell* pDocShell = pInfo->mpDocShell;
+ if (pDocShell != nullptr)
{
- ::sd::DrawDocShell* pDocShell = pInfo->mpDocShell;
- if (pDocShell != nullptr)
+ ::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
+ if (pViewShell != nullptr)
{
- ::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
- if (pViewShell != nullptr)
+ ::sd::FrameView* pFrameView = pViewShell->GetFrameView();
+ if (pFrameView != nullptr)
{
- ::sd::FrameView* pFrameView = pViewShell->GetFrameView();
- if (pFrameView != nullptr)
- {
- pFrameView->SetIsNavigatorShowingAllShapes(bShowAllShapes);
- }
+ pFrameView->SetIsNavigatorShowingAllShapes(bShowAllShapes);
}
}
}
}
-
- return false;
}
bool SdNavigatorWin::InsertFile(const OUString& rFileName)
@@ -545,19 +451,19 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName)
if (xMedium->IsStorage())
{
// Now depending on mode:
- // maTlbObjects->SetSelectionMode(SelectionMode::Multiple);
+ // mxTlbObjects->set_selection_mode(SelectionMode::Multiple);
// handover of ownership of xMedium;
- SdDrawDocument* pDropDoc = maTlbObjects->GetBookmarkDoc(xMedium.release());
+ SdDrawDocument* pDropDoc = mxTlbObjects->GetBookmarkDoc(xMedium.release());
if (pDropDoc)
{
- maTlbObjects->Clear();
+ mxTlbObjects->clear();
maDropFileName = aFileName;
- if( !maTlbObjects->IsEqualToDoc( pDropDoc ) )
+ if( !mxTlbObjects->IsEqualToDoc( pDropDoc ) )
{
// only normal pages
- maTlbObjects->Fill(pDropDoc, false, maDropFileName);
+ mxTlbObjects->Fill(pDropDoc, false, maDropFileName);
RefreshDocumentLB( &maDropFileName );
}
}
@@ -583,28 +489,28 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName )
if( pDocName )
{
if( mbDocImported )
- maLbDocs->RemoveEntry( 0 );
+ mxLbDocs->remove(0);
- maLbDocs->InsertEntry( *pDocName, 0 );
+ mxLbDocs->insert_text(0, *pDocName);
mbDocImported = true;
}
else
{
- nPos = maLbDocs->GetSelectedEntryPos();
- if( nPos == LISTBOX_ENTRY_NOTFOUND )
+ nPos = mxLbDocs->get_active();
+ if (nPos == -1)
nPos = 0;
OUString aStr;
if( mbDocImported )
- aStr = maLbDocs->GetEntry( 0 );
+ aStr = mxLbDocs->get_text(0);
- maLbDocs->Clear();
+ mxLbDocs->clear();
// delete list of DocInfos
maDocList.clear();
if( mbDocImported )
- maLbDocs->InsertEntry( aStr, 0 );
+ mxLbDocs->insert_text(0, aStr);
::sd::DrawDocShell* pCurrentDocShell =
dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() );
@@ -628,7 +534,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName )
// is shown in url notation!
aStr = pDocShell->GetName();
- maLbDocs->InsertEntry( aStr );
+ mxLbDocs->append_text(aStr);
if( pDocShell == pCurrentDocShell )
aInfo.SetActive( true );
@@ -640,24 +546,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName )
pSfxDocShell = SfxObjectShell::GetNext( *pSfxDocShell, [](const SfxObjectShell*){return true;}, false );
}
}
- maLbDocs->SelectEntryPos( nPos );
-}
-
-const char* SdNavigatorWin::GetDragTypeSdStrId(NavigatorDragType eDT)
-{
- switch( eDT )
- {
- case NAVIGATOR_DRAGTYPE_NONE:
- return STR_SD_NONE;
- case NAVIGATOR_DRAGTYPE_URL:
- return STR_DRAGTYPE_URL;
- case NAVIGATOR_DRAGTYPE_EMBEDDED:
- return STR_DRAGTYPE_EMBEDDED;
- case NAVIGATOR_DRAGTYPE_LINK:
- return STR_DRAGTYPE_LINK;
- default: OSL_FAIL( "No resource for DragType available!" );
- }
- return nullptr;
+ mxLbDocs->set_active(nPos);
}
OUString SdNavigatorWin::GetDragTypeSdBmpId(NavigatorDragType eDT)
@@ -679,7 +568,7 @@ OUString SdNavigatorWin::GetDragTypeSdBmpId(NavigatorDragType eDT)
NavDocInfo* SdNavigatorWin::GetDocInfo()
{
- sal_uInt32 nPos = maLbDocs->GetSelectedEntryPos();
+ sal_uInt32 nPos = mxLbDocs->get_active();
if( mbDocImported )
{
@@ -705,7 +594,7 @@ bool SdNavigatorWin::EventNotify(NotifyEvent& rNEvt)
{
if( KEY_ESCAPE == pKEvt->GetKeyCode().GetCode() )
{
- if( SdPageObjsTLB::IsInDrag() )
+ if( SdPageObjsTLV::IsInDrag() )
{
// during drag'n'drop we just stop the drag but do not close the navigator
bOK = true;
@@ -741,7 +630,7 @@ void SdNavigatorWin::KeyInput( const KeyEvent& rKEvt )
if (rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE)
{
- if( SdPageObjsTLB::IsInDrag() )
+ if( SdPageObjsTLV::IsInDrag() )
{
// during drag'n'drop we just stop the drag but do not close the navigator
bOK = true;
@@ -764,8 +653,7 @@ void SdNavigatorWin::KeyInput( const KeyEvent& rKEvt )
void SdNavigatorWin::SetDragImage()
{
- const sal_uInt16 nDragTypeId = maToolbox->GetItemId("dragmode");
- maToolbox->SetItemImage(nDragTypeId, Image(StockImage::Yes, GetDragTypeSdBmpId(meDragType)));
+ mxToolbox->set_item_icon_name("dragmode", GetDragTypeSdBmpId(meDragType));
}
/**
@@ -796,42 +684,37 @@ void SdNavigatorControllerItem::StateChanged( sal_uInt16 nSId,
if( !(pInfo && pInfo->IsActive()) )
return;
- sal_uInt16 nFirstId = pNavigatorWin->maToolbox->GetItemId("first");
- sal_uInt16 nPrevId = pNavigatorWin->maToolbox->GetItemId("previous");
- sal_uInt16 nLastId = pNavigatorWin->maToolbox->GetItemId("last");
- sal_uInt16 nNextId = pNavigatorWin->maToolbox->GetItemId("next");
-
// First
if (nState & NavState::BtnFirstEnabled &&
- !pNavigatorWin->maToolbox->IsItemEnabled(nFirstId))
- pNavigatorWin->maToolbox->EnableItem(nFirstId);
+ !pNavigatorWin->mxToolbox->get_item_sensitive("first"))
+ pNavigatorWin->mxToolbox->set_item_sensitive("first", true);
if (nState & NavState::BtnFirstDisabled &&
- pNavigatorWin->maToolbox->IsItemEnabled(nFirstId))
- pNavigatorWin->maToolbox->EnableItem(nFirstId, false);
+ pNavigatorWin->mxToolbox->get_item_sensitive("first"))
+ pNavigatorWin->mxToolbox->set_item_sensitive("first", false);
// Prev
if (nState & NavState::BtnPrevEnabled &&
- !pNavigatorWin->maToolbox->IsItemEnabled(nPrevId))
- pNavigatorWin->maToolbox->EnableItem(nPrevId);
+ !pNavigatorWin->mxToolbox->get_item_sensitive("previous"))
+ pNavigatorWin->mxToolbox->set_item_sensitive("previous", true);
if (nState & NavState::BtnPrevDisabled &&
- pNavigatorWin->maToolbox->IsItemEnabled(nPrevId))
- pNavigatorWin->maToolbox->EnableItem(nPrevId, false);
+ pNavigatorWin->mxToolbox->get_item_sensitive("previous"))
+ pNavigatorWin->mxToolbox->set_item_sensitive("previous", false);
// Last
if (nState & NavState::BtnLastEnabled &&
- !pNavigatorWin->maToolbox->IsItemEnabled(nLastId))
- pNavigatorWin->maToolbox->EnableItem(nLastId);
+ !pNavigatorWin->mxToolbox->get_item_sensitive("last"))
+ pNavigatorWin->mxToolbox->set_item_sensitive("last", true);
if (nState & NavState::BtnLastDisabled &&
- pNavigatorWin->maToolbox->IsItemEnabled(nLastId))
- pNavigatorWin->maToolbox->EnableItem(nLastId, false);
+ pNavigatorWin->mxToolbox->get_item_sensitive("last"))
+ pNavigatorWin->mxToolbox->set_item_sensitive("last", false);
// Next
if (nState & NavState::BtnNextEnabled &&
- !pNavigatorWin->maToolbox->IsItemEnabled(nNextId))
- pNavigatorWin->maToolbox->EnableItem(nNextId);
+ !pNavigatorWin->mxToolbox->get_item_sensitive("next"))
+ pNavigatorWin->mxToolbox->set_item_sensitive("next", true);
if (nState & NavState::BtnNextDisabled &&
- pNavigatorWin->maToolbox->IsItemEnabled(nNextId))
- pNavigatorWin->maToolbox->EnableItem(nNextId, false);
+ pNavigatorWin->mxToolbox->get_item_sensitive("next"))
+ pNavigatorWin->mxToolbox->set_item_sensitive("next", false);
if (nState & NavState::TableUpdate)
{
@@ -867,14 +750,14 @@ void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId,
const SfxStringItem& rStateItem = dynamic_cast<const SfxStringItem&>(*pItem);
const OUString& aPageName = rStateItem.GetValue();
- if( !pNavigatorWin->maTlbObjects->HasSelectedChildren( aPageName ) )
+ if( !pNavigatorWin->mxTlbObjects->HasSelectedChildren( aPageName ) )
{
- if( pNavigatorWin->maTlbObjects->GetSelectionMode() == SelectionMode::Multiple )
+ if (pNavigatorWin->mxTlbObjects->get_selection_mode() == SelectionMode::Multiple)
{
// because otherwise it is always additional select
- pNavigatorWin->maTlbObjects->SelectAll( false );
+ pNavigatorWin->mxTlbObjects->unselect_all();
}
- pNavigatorWin->maTlbObjects->SelectEntry( aPageName );
+ pNavigatorWin->mxTlbObjects->SelectEntry( aPageName );
}
}
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index b149354506b5..b27f8800932c 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -25,7 +25,6 @@
#include <sfx2/docfile.hxx>
#include <svx/svdoole2.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/builderfactory.hxx>
#include <cusshow.hxx>
#include <sfx2/viewfrm.hxx>
@@ -49,8 +48,6 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <svtools/acceleratorexecute.hxx>
#include <svtools/embedtransfer.hxx>
-#include <vcl/svlbitm.hxx>
-#include <vcl/treelistentry.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/processfactory.hxx>
#include <tools/diagnose_ex.h>
@@ -59,58 +56,38 @@
using namespace com::sun::star;
-class SdPageObjsTLB::IconProvider
-{
-public:
- IconProvider();
-
- // Regular icons.
- Image const maImgPage;
- Image const maImgPageExcl;
- Image const maImgPageObjsExcl;
- Image const maImgPageObjs;
- Image const maImgObjects;
- Image const maImgGroup;
-};
-
-bool SdPageObjsTLB::bIsInDrag = false;
+bool SdPageObjsTLV::bIsInDrag = false;
-bool SdPageObjsTLB::IsInDrag()
+bool SdPageObjsTLV::IsInDrag()
{
return bIsInDrag;
}
-SotClipboardFormatId SdPageObjsTLB::SdPageObjsTransferable::mnListBoxDropFormatId = static_cast<SotClipboardFormatId>(SAL_MAX_UINT32);
+SotClipboardFormatId SdPageObjsTLV::SdPageObjsTransferable::mnListBoxDropFormatId = static_cast<SotClipboardFormatId>(SAL_MAX_UINT32);
-
-SdPageObjsTLB::SdPageObjsTransferable::SdPageObjsTransferable(
- SdPageObjsTLB& rParent,
+SdPageObjsTLV::SdPageObjsTransferable::SdPageObjsTransferable(
const INetBookmark& rBookmark,
::sd::DrawDocShell& rDocShell,
NavigatorDragType eDragType)
: SdTransferable(rDocShell.GetDoc(), nullptr, true),
- mrParent( rParent ),
maBookmark( rBookmark ),
mrDocShell( rDocShell ),
meDragType( eDragType )
{
- rParent.SetupDragOrigin();
}
-VCL_BUILDER_FACTORY_CONSTRUCTOR(SdPageObjsTLB, WB_TABSTOP)
-
-SdPageObjsTLB::SdPageObjsTransferable::~SdPageObjsTransferable()
+SdPageObjsTLV::SdPageObjsTransferable::~SdPageObjsTransferable()
{
}
-void SdPageObjsTLB::SdPageObjsTransferable::AddSupportedFormats()
+void SdPageObjsTLV::SdPageObjsTransferable::AddSupportedFormats()
{
AddFormat(SotClipboardFormatId::NETSCAPE_BOOKMARK);
AddFormat(SotClipboardFormatId::TREELISTBOX);
AddFormat(GetListBoxDropFormatId());
}
-bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
+bool SdPageObjsTLV::SdPageObjsTransferable::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
{
SotClipboardFormatId nFormatId = SotExchange::GetFormat( rFlavor );
switch (nFormatId)
@@ -131,17 +108,17 @@ bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const css::datatransfer::Da
}
}
-void SdPageObjsTLB::SdPageObjsTransferable::DragFinished( sal_Int8 nDropAction )
+void SdPageObjsTLV::SdPageObjsTransferable::DragFinished( sal_Int8 nDropAction )
{
- mrParent.OnDragFinished();
+ SdPageObjsTLV::OnDragFinished();
SdTransferable::DragFinished(nDropAction);
}
-sal_Int64 SAL_CALL SdPageObjsTLB::SdPageObjsTransferable::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
+sal_Int64 SAL_CALL SdPageObjsTLV::SdPageObjsTransferable::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
sal_Int64 nRet;
- if( isUnoTunnelId<SdPageObjsTLB::SdPageObjsTransferable>(rId) )
+ if (isUnoTunnelId<SdPageObjsTLV::SdPageObjsTransferable>(rId))
{
nRet = static_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(this));
}
@@ -156,21 +133,21 @@ namespace
class theSdPageObjsTLBUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSdPageObjsTLBUnoTunnelId > {};
}
-const css::uno::Sequence< sal_Int8 >& SdPageObjsTLB::SdPageObjsTransferable::getUnoTunnelId()
+const css::uno::Sequence<sal_Int8>& SdPageObjsTLV::SdPageObjsTransferable::getUnoTunnelId()
{
return theSdPageObjsTLBUnoTunnelId::get().getSeq();
}
-SdPageObjsTLB::SdPageObjsTransferable* SdPageObjsTLB::SdPageObjsTransferable::getImplementation( const css::uno::Reference< css::uno::XInterface >& rxData )
+SdPageObjsTLV::SdPageObjsTransferable* SdPageObjsTLV::SdPageObjsTransferable::getImplementation( const css::uno::Reference< css::uno::XInterface >& rxData )
throw()
{
try
{
css::uno::Reference< css::lang::XUnoTunnel > xUnoTunnel( rxData, css::uno::UNO_QUERY_THROW );
- return reinterpret_cast<SdPageObjsTLB::SdPageObjsTransferable*>(
+ return reinterpret_cast<SdPageObjsTLV::SdPageObjsTransferable*>(
sal::static_int_cast<sal_uIntPtr>(
- xUnoTunnel->getSomething( SdPageObjsTLB::SdPageObjsTransferable::getUnoTunnelId()) ) );
+ xUnoTunnel->getSomething( SdPageObjsTLV::SdPageObjsTransferable::getUnoTunnelId()) ) );
}
catch( const css::uno::Exception& )
{
@@ -178,455 +155,77 @@ SdPageObjsTLB::SdPageObjsTransferable* SdPageObjsTLB::SdPageObjsTransferable::ge
return nullptr;
}
-SotClipboardFormatId SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormatId()
+SotClipboardFormatId SdPageObjsTLV::SdPageObjsTransferable::GetListBoxDropFormatId()
{
if (mnListBoxDropFormatId == static_cast<SotClipboardFormatId>(SAL_MAX_UINT32))
mnListBoxDropFormatId = SotExchange::RegisterFormatMimeType("application/x-openoffice-treelistbox-moveonly;windows_formatname=\"SV_LBOX_DD_FORMAT_MOVE\"");
return mnListBoxDropFormatId;
}
-SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle )
-: SvTreeListBox ( pParentWin, nStyle )
-, mpDoc ( nullptr )
-, mpBookmarkDoc ( nullptr )
-, mpMedium ( nullptr )
-, mpOwnMedium ( nullptr )
-, maImgOle ( StockImage::Yes, BMP_OLE )
-, maImgGraphic ( StockImage::Yes, BMP_GRAPHIC )
-, mbLinkableSelected ( false )
-, mbSaveTreeItemState ( false )
-, mbShowAllShapes ( false )
-, mbShowAllPages ( false )
-, mbSelectionHandlerNavigates(false)
-, mbNavigationGrabsFocus(true)
-{
- // add lines to Tree-ListBox
- SetStyle( GetStyle() | WB_TABSTOP | WB_BORDER | WB_HASLINES |
- WB_HASBUTTONS | // WB_HASLINESATROOT |
- WB_HSCROLL |
- WB_HASBUTTONSATROOT );
- SetQuickSearch(true); /* i31275 */;
- SetNodeBitmaps(Image(StockImage::Yes, BMP_EXPAND), Image(StockImage::Yes, BMP_COLLAPSE));
-
- SetDragDropMode(
- DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY |
- DragDropMode::APP_MOVE | DragDropMode::APP_COPY | DragDropMode::APP_DROP );
-
- m_pAccel = ::svt::AcceleratorExecute::createAcceleratorHelper();
-}
-
-void SdPageObjsTLB::SetSdNavigator(SdNavigatorWin* pNavigator)
-{
- mpNavigator = pNavigator;
-}
-
-void SdPageObjsTLB::SetViewFrame( const SfxViewFrame* pViewFrame )
-{
- sd::ViewShellBase* pBase = sd::ViewShellBase::GetViewShellBase(pViewFrame);
- const css::uno::Reference< css::frame::XFrame > xFrame = pBase->GetMainViewShell()->GetViewFrame()->GetFrame().GetFrameInterface();
- m_pAccel->init(::comphelper::getProcessComponentContext(), xFrame);
-}
-
-
-SdPageObjsTLB::~SdPageObjsTLB()
-{
- disposeOnce();
-}
-
-void SdPageObjsTLB::dispose()
-{
- if ( mpBookmarkDoc )
- CloseBookmarkDoc();
- else
- // no document was created from mpMedium, so this object is still the owner of it
- delete mpMedium;
- mpNavigator.clear();
- m_pAccel.reset();
- SvTreeListBox::dispose();
-}
-
-// helper function for GetEntryAltText and GetEntryLongDescription
-OUString SdPageObjsTLB::getAltLongDescText(SvTreeListEntry* pEntry , bool isAltText) const
-{
- sal_uInt16 maxPages = mpDoc->GetPageCount();
- sal_uInt16 pageNo;
- SdrObject* pObj = nullptr;
-
- OUString ParentName = GetEntryText( GetRootLevelParent( pEntry ) );
-
- for( pageNo = 0; pageNo < maxPages; pageNo++ )
- {
- const SdPage* pPage = static_cast<const SdPage*>( mpDoc->GetPage( pageNo ) );
- if( pPage->GetPageKind() != PageKind::Standard ) continue;
- if( pPage->GetName() != ParentName ) continue;
- SdrObjListIter aIter( pPage, SdrIterMode::Flat );
- while( aIter.IsMore() )
- {
- pObj = aIter.Next();
- if( GetEntryText(pEntry) == GetObjectName( pObj ) )
- {
- if( isAltText )
- return pObj->GetTitle();
- else
- return pObj->GetDescription();
- }
- }
- }
- return OUString();
-
-}
-
-OUString SdPageObjsTLB::GetEntryAltText( SvTreeListEntry* pEntry ) const
-{
- return getAltLongDescText( pEntry, true );
-}
-
-OUString SdPageObjsTLB::GetEntryLongDescription( SvTreeListEntry* pEntry ) const
-{
- return getAltLongDescText( pEntry, false);
-}
-
-void SdPageObjsTLB::InitEntry(SvTreeListEntry* pEntry,
- const OUString& rStr, const Image& rImg1, const Image& rImg2)
-{
- sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2"
- SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2 );
- SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nColToHilite ));
- pEntry->ReplaceItem(std::make_unique<SvLBoxString>(rCol.GetText()), nColToHilite );
-}
-
-void SdPageObjsTLB::SaveExpandedTreeItemState(SvTreeListEntry* pEntry, std::vector<OUString>& vectTreeItem)
-{
- if (!pEntry)
- return;
-
- SvTreeListEntry* pListEntry = pEntry;
- while (pListEntry)
- {
- if (pListEntry->HasChildren())
- {
- if (IsExpanded(pListEntry))
- vectTreeItem.push_back(GetEntryText(pListEntry));
- SvTreeListEntry* pChildEntry = FirstChild(pListEntry);
- SaveExpandedTreeItemState(pChildEntry, vectTreeItem);
- }
- pListEntry = pListEntry->NextSibling();
- }
-}
-void SdPageObjsTLB::Clear()
-{
- //Save the expanded tree item
- if (mbSaveTreeItemState)
- {
- maSelectionEntryText.clear();
- maTreeItem.clear();
- if (GetCurEntry())
- maSelectionEntryText = GetSelectedEntry();
- SvTreeListEntry* pEntry = FirstChild(nullptr);
- SaveExpandedTreeItemState(pEntry, maTreeItem);
- }
- return SvTreeListBox::Clear();
-}
-
-OUString SdPageObjsTLB::GetObjectName(
- const SdrObject* pObject,
- const bool bCreate) const
-{
- OUString aRet;
-
- if ( pObject )
- {
- aRet = pObject->GetName();
-
- if (aRet.isEmpty() && dynamic_cast<const SdrOle2Obj* >(pObject) != nullptr)
- aRet = static_cast< const SdrOle2Obj* >( pObject )->GetPersistName();
- }
-
- if (bCreate
- && mbShowAllShapes
- && aRet.isEmpty()
- && pObject!=nullptr)
- {
- aRet = SdResId(STR_NAVIGATOR_SHAPE_BASE_NAME);
- aRet = aRet.replaceFirst("%1", OUString::number(pObject->GetOrdNum() + 1));
- }
-
- return aRet;
-}
-
-/**
- * select an entry in TreeLB
- */
-bool SdPageObjsTLB::SelectEntry( const OUString& rName )
-{
- bool bFound = false;
-
- if( !rName.isEmpty() )
- {
- SvTreeListEntry* pEntry = nullptr;
- OUString aTmp;
-
- for( pEntry = First(); pEntry && !bFound; pEntry = Next( pEntry ) )
- {
- aTmp = GetEntryText( pEntry );
- if( aTmp == rName )
- {
- bFound = true;
- SetCurEntry( pEntry );
- }
- }
- }
- return bFound;
-}
-
/**
* @return true if children of the specified string are selected
*/
-bool SdPageObjsTLB::HasSelectedChildren( const OUString& rName )
+bool SdPageObjsTLV::HasSelectedChildren( const OUString& rName )
{
bool bChildren = false;
if( !rName.isEmpty() )
{
- bool bFound = false;
- SvTreeListEntry* pEntry = nullptr;
+ std::unique_ptr<weld::TreeIter> xEntry(m_xTreeView->make_iterator());
OUString aTmp;
- for( pEntry = First(); pEntry && !bFound; pEntry = Next( pEntry ) )
+ if (m_xTreeView->get_iter_first(*xEntry))
{
- aTmp = GetEntryText( pEntry );
- if( aTmp == rName )
+ do
{
- bFound = true;
- bool bExpanded = IsExpanded( pEntry );
- long nCount = GetChildSelectionCount( pEntry );
- if( bExpanded && nCount > 0 )
- bChildren = true;
- }
- }
- }
- return bChildren;
-}
-
-/**
- * Fill TreeLB with pages and objects
- */
-void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, bool bAllPages,
- const OUString& rDocName)
-{
- OUString aSelection;
- if( GetSelectionCount() > 0 )
- {
- aSelection = GetSelectedEntry();
- Clear();
- }
-
- mpDoc = pInDoc;
- maDocName = rDocName;
- mbShowAllPages = bAllPages;
- mpMedium = nullptr;
-
- IconProvider aIconProvider;
-
- // first insert all pages including objects
- sal_uInt16 nPage = 0;
- const sal_uInt16 nMaxPages = mpDoc->GetPageCount();
-
- while( nPage < nMaxPages )
- {
- const SdPage* pPage = static_cast<const SdPage*>( mpDoc->GetPage( nPage ) );
- if( (mbShowAllPages || pPage->GetPageKind() == PageKind::Standard)
- && (pPage->GetPageKind() != PageKind::Handout) ) //#94954# never list the normal handout page ( handout-masterpage is used instead )
- {
- bool bPageExluded = pPage->IsExcluded();
-
- bool bPageBelongsToShow = PageBelongsToCurrentShow (pPage);
- bPageExluded |= !bPageBelongsToShow;
-
- AddShapeList(*pPage, nullptr, pPage->GetName(), bPageExluded, nullptr, aIconProvider);
- }
- nPage++;
- }
-
- // then insert all master pages including objects
- if( mbShowAllPages )
- {
- nPage = 0;
- const sal_uInt16 nMaxMasterPages = mpDoc->GetMasterPageCount();
-
- while( nPage < nMaxMasterPages )
- {
- const SdPage* pPage = static_cast<const SdPage*>( mpDoc->GetMasterPage( nPage ) );
- AddShapeList(*pPage, nullptr, pPage->GetName(), false, nullptr, aIconProvider);
- nPage++;
- }
- }
- if( !aSelection.isEmpty() )
- SelectEntry( aSelection );
- else if (mbSaveTreeItemState && !maSelectionEntryText.isEmpty())
- {
- SelectEntry(maSelectionEntryText);
- }
-}
-
-/**
- * We insert only the first entry. Children are created on demand.
- */
-void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, SfxMedium* pInMedium,
- const OUString& rDocName )
-{
- mpDoc = pInDoc;
-
- // this object now owns the Medium
- mpMedium = pInMedium;
- maDocName = rDocName;
-
- Image aImgDocOpen(StockImage::Yes, BMP_DOC_OPEN);
- Image aImgDocClosed(StockImage::Yes, BMP_DOC_CLOSED);
-
- // insert document name
- InsertEntry( maDocName, aImgDocOpen, aImgDocClosed, nullptr, true, TREELIST_APPEND,
- reinterpret_cast< void* >( 1 )
- );
-}
-
-void SdPageObjsTLB::AddShapeList (
- const SdrObjList& rList,
- SdrObject* pShape,
- const OUString& rsName,
- const bool bIsExcluded,
- SvTreeListEntry* pParentEntry,
- const IconProvider& rIconProvider)
-{
- Image aIcon (rIconProvider.maImgPage);
- if (bIsExcluded)
- aIcon = rIconProvider.maImgPageExcl;
- else if (pShape != nullptr)
- aIcon = rIconProvider.maImgGroup;
-
- void* pUserData (reinterpret_cast<void*>(1));
- if (pShape != nullptr)
- pUserData = pShape;
-
- SvTreeListEntry* pEntry = InsertEntry(
- rsName,
- aIcon,
- aIcon,
- pParentEntry,
- false,
- TREELIST_APPEND,
- pUserData);
-
- SdrObjListIter aIter(
- &rList,
- !rList.HasObjectNavigationOrder() /* use navigation order, if available */,
- SdrIterMode::Flat);
-
- while( aIter.IsMore() )
- {
- SdrObject* pObj = aIter.Next();
- OSL_ASSERT(pObj!=nullptr);
+ aTmp = m_xTreeView->get_text(*xEntry);
+ if (aTmp == rName)
+ {
- // Get the shape name.
- OUString aStr (GetObjectName( pObj ) );
+ // see if any of the selected nodes are subchildren of this node
+ m_xTreeView->selected_foreach([this, &bChildren, &xEntry](weld::TreeIter& rEntry){
+ std::unique_ptr<weld::TreeIter> xParent(m_xTreeView->make_iterator(&rEntry));
+ while (!bChildren && m_xTreeView->iter_parent(*xParent))
+ bChildren = m_xTreeView->iter_compare(*xParent, *xEntry) == 0;
+ return bChildren;
+ });
- if( !aStr.isEmpty() )
- {
- if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_OLE2 )
- {
- InsertEntry(
- aStr,
- maImgOle,
- maImgOle,
- pEntry,
- false,
- TREELIST_APPEND,
- pObj
- );
- }
- else if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_GRAF )
- {
- InsertEntry(
- aStr,
- maImgGraphic,
- maImgGraphic,
- pEntry,
- false,
- TREELIST_APPEND,
- pObj
- );
- }
- else if (pObj->IsGroupObject())
- {
- AddShapeList(
- *pObj->GetSubList(),
- pObj,
- aStr,
- false,
- pEntry,
- rIconProvider
- );
- }
- else
- {
- InsertEntry(
- aStr,
- rIconProvider.maImgObjects,
- rIconProvider.maImgObjects,
- pEntry,
- false,
- TREELIST_APPEND,
- pObj
- );
+ break;
+ }
}
+ while (m_xTreeView->iter_next(*xEntry));
}
}
- if( !pEntry->HasChildren() )
- return;
-
- SetExpandedEntryBmp(
- pEntry,
- bIsExcluded ? rIconProvider.maImgPageObjsExcl : rIconProvider.maImgPageObjs);
- SetCollapsedEntryBmp(
- pEntry,
- bIsExcluded ? rIconProvider.maImgPageObjsExcl : rIconProvider.maImgPageObjs);
- if (mbSaveTreeItemState)
- {
- OUString strEntry = GetEntryText(pEntry);
- auto it = std::find(maTreeItem.begin(), maTreeItem.end(), strEntry);
- if (it != maTreeItem.end())
- Expand( pEntry );
- }
- else
- Expand( pEntry );
+ return bChildren;
}
-void SdPageObjsTLB::SetShowAllShapes (
+void SdPageObjsTLV::SetShowAllShapes (
const bool bShowAllShapes,
const bool bFillList)
{
- mbShowAllShapes = bShowAllShapes;
+ m_bShowAllShapes = bShowAllShapes;
if (bFillList)
{
- if (mpMedium == nullptr)
- Fill(mpDoc, mbShowAllPages, maDocName);
+ if (m_pMedium == nullptr)
+ Fill(m_pDoc, m_bShowAllPages, m_aDocName);
else
- Fill(mpDoc, mpMedium, maDocName);
+ Fill(m_pDoc, m_pMedium, m_aDocName);
}
}
-bool SdPageObjsTLB::IsEqualToShapeList(SvTreeListEntry*& pEntry, const SdrObjList& rList,
+bool SdPageObjsTLV::IsEqualToShapeList(std::unique_ptr<weld::TreeIter>& rEntry, const SdrObjList& rList,
const OUString& rListName)
{
- if (!pEntry)
+ if (!rEntry)
return false;
- OUString aName = GetEntryText(pEntry);
+ OUString aName = m_xTreeView->get_text(*rEntry);
if (rListName != aName)
return false;
- pEntry = Next(pEntry);
+ if (!m_xTreeView->iter_next(*rEntry))
+ rEntry.reset();
SdrObjListIter aIter(&rList,
!rList.HasObjectNavigationOrder() /* use navigation order, if available */,
@@ -640,22 +239,25 @@ bool SdPageObjsTLB::IsEqualToShapeList(SvTreeListEntry*& pEntry, const SdrObjLis
if (!aObjectName.isEmpty())
{
- if (!pEntry)
+ if (!rEntry)
return false;
- aName = GetEntryText(pEntry);
+ aName = m_xTreeView->get_text(*rEntry);
if (aObjectName != aName)
return false;
if (pObj->IsGroupObject())
{
- bool bRet = IsEqualToShapeList(pEntry, *pObj->GetSubList(), aObjectName);
+ bool bRet = IsEqualToShapeList(rEntry, *pObj->GetSubList(), aObjectName);
if (!bRet)
return false;
}
else
- pEntry = Next(pEntry);
+ {
+ if (!m_xTreeView->iter_next(*rEntry))
+ rEntry.reset();
+ }
}
}
@@ -668,26 +270,28 @@ bool SdPageObjsTLB::IsEqualToShapeList(SvTreeListEntry*& pEntry, const SdrObjLis
* If a doc is provided, this will be the used doc (important by more than
* one document).
*/
-bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc )
+bool SdPageObjsTLV::IsEqualToDoc( const SdDrawDocument* pInDoc )
{
if( pInDoc )
- mpDoc = pInDoc;
+ m_pDoc = pInDoc;
- if( !mpDoc )
+ if( !m_pDoc )
return false;
- SvTreeListEntry* pEntry = First();
+ std::unique_ptr<weld::TreeIter> xEntry(m_xTreeView->make_iterator());
+ if (!m_xTreeView->get_iter_first(*xEntry))
+ xEntry.reset();
// compare all pages including the objects
sal_uInt16 nPage = 0;
- const sal_uInt16 nMaxPages = mpDoc->GetPageCount();
+ const sal_uInt16 nMaxPages = m_pDoc->GetPageCount();
while( nPage < nMaxPages )
{
- const SdPage* pPage = static_cast<const SdPage*>( mpDoc->GetPage( nPage ) );
+ const SdPage* pPage = static_cast<const SdPage*>( m_pDoc->GetPage( nPage ) );
if( pPage->GetPageKind() == PageKind::Standard )
{
- bool bRet = IsEqualToShapeList(pEntry, *pPage, pPage->GetName());
+ bool bRet = IsEqualToShapeList(xEntry, *pPage, pPage->GetName());
if (!bRet)
return false;
}
@@ -695,345 +299,124 @@ bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc )
}
// If there are still entries in the listbox,
// then objects (with names) or pages were deleted
- return !pEntry;
+ return !xEntry;
}
-/**
- * @return selected string
- */
-OUString SdPageObjsTLB::GetSelectedEntry() const
+IMPL_LINK(SdPageObjsTLV, KeyInputHdl, const KeyEvent&, rKEvt, bool)
{
- return GetEntryText( GetCurEntry() );
-}
-
-/**
- * Entries are inserted only by request (double click)
- */
-void SdPageObjsTLB::RequestingChildren( SvTreeListEntry* pFileEntry )
-{
- if( !pFileEntry->HasChildren() )
+ const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode();
+ if (m_xAccel->execute(rKeyCode))
{
- if( GetBookmarkDoc() )
- {
- SdrObject* pObj = nullptr;
- SvTreeListEntry* pPageEntry = nullptr;
-
- Image aImgPage(StockImage::Yes, BMP_PAGE);
- Image aImgPageObjs(StockImage::Yes, BMP_PAGEOBJS);
- Image aImgObjects(StockImage::Yes, BMP_OBJECTS);
-
- // document name already inserted
-
- // only insert all "normal" ? slides with objects
- sal_uInt16 nPage = 0;
- const sal_uInt16 nMaxPages = mpBookmarkDoc->GetPageCount();
-
- while( nPage < nMaxPages )
- {
- SdPage* pPage = static_cast<SdPage*>( mpBookmarkDoc->GetPage( nPage ) );
- if( pPage->GetPageKind() == PageKind::Standard )
- {
- pPageEntry = InsertEntry( pPage->GetName(),
- aImgPage,
- aImgPage,
- pFileEntry,
- false,
- TREELIST_APPEND,
- reinterpret_cast< void* >( 1 ) );
-
- SdrObjListIter aIter( pPage, SdrIterMode::DeepWithGroups );
-
- while( aIter.IsMore() )
- {
- pObj = aIter.Next();
- OUString aStr( GetObjectName( pObj ) );
- if( !aStr.isEmpty() )
- {
- if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_OLE2 )
- {
- InsertEntry(aStr, maImgOle, maImgOle, pPageEntry);
- }
- else if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_GRAF )
- {
- InsertEntry(aStr, maImgGraphic, maImgGraphic, pPageEntry);
- }
- else
- {
- InsertEntry(aStr, aImgObjects, aImgObjects, pPageEntry);
- }
- }
- }
- if( pPageEntry->HasChildren() )
- {
- SetExpandedEntryBmp( pPageEntry, aImgPageObjs );
- SetCollapsedEntryBmp( pPageEntry, aImgPageObjs );
- }
- }
- nPage++;
- }
- }
+ // the accelerator consumed the event
+ return true;
}
- else
- SvTreeListBox::RequestingChildren( pFileEntry );
-}
-
-/**
- * Checks if it is a draw file and opens the BookmarkDoc depending of
- * the provided Docs
- */
-SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
-{
- if (
- !mpBookmarkDoc ||
- (pMed && (!mpOwnMedium || mpOwnMedium->GetName() != pMed->GetName()))
- )
+ if (rKeyCode.GetCode() == KEY_RETURN)
{
- // create a new BookmarkDoc if now one exists or if a new Medium is provided
- if (mpOwnMedium != pMed)
- {
- CloseBookmarkDoc();
- }
-
- if (pMed)
- {
- // it looks that it is undefined if a Medium was set by Fill() already
- DBG_ASSERT( !mpMedium, "SfxMedium confusion!" );
- delete mpMedium;
- mpMedium = nullptr;
-
- // take over this Medium (currently used only be Navigator)
- mpOwnMedium = pMed;
- }
-
- DBG_ASSERT( mpMedium || pMed, "No SfxMedium provided!" );
-
- if( pMed )
+ std::unique_ptr<weld::TreeIter> xCursor(m_xTreeView->make_iterator());
+ if (m_xTreeView->get_cursor(xCursor.get()))
{
- // in this mode the document is also owned and controlled by this instance
- mxBookmarkDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::STANDARD, true, DocumentType::Impress);
- if (mxBookmarkDocShRef->DoLoad(pMed))
- mpBookmarkDoc = mxBookmarkDocShRef->GetDoc();
+ if (m_xTreeView->get_row_expanded(*xCursor))
+ m_xTreeView->collapse_row(*xCursor);
else
- mpBookmarkDoc = nullptr;
- }
- else if ( mpMedium )
- // in this mode the document is owned and controlled by the SdDrawDocument
- // it can be released by calling the corresponding CloseBookmarkDoc method
- // successful creation of a document makes this the owner of the medium
- mpBookmarkDoc = const_cast<SdDrawDocument*>(mpDoc)->OpenBookmarkDoc(mpMedium);
-
- if ( !mpBookmarkDoc )
- {
- std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetFrameWeld(),
- VclMessageType::Warning, VclButtonsType::Ok, SdResId(STR_READ_DATA_ERROR)));
- xErrorBox->run();
- mpMedium = nullptr; //On failure the SfxMedium is invalid
+ m_xTreeView->expand_row(*xCursor);
}
+ m_aRowActivatedHdl.Call(*m_xTreeView);
+ return true;
}
-
- return mpBookmarkDoc;
+ return false;
}
-/**
- * Close and delete bookmark document
- */
-void SdPageObjsTLB::CloseBookmarkDoc()
+IMPL_LINK(SdPageObjsTLV, MousePressHdl, const MouseEvent&, rMEvt, bool)
{
- if (mxBookmarkDocShRef.is())
- {
- mxBookmarkDocShRef->DoClose();
- mxBookmarkDocShRef.clear();
-
- // Medium is owned by document, so it's destroyed already
- mpOwnMedium = nullptr;
- }
- else if ( mpBookmarkDoc )
- {
- DBG_ASSERT( !mpOwnMedium, "SfxMedium confusion!" );
- if ( mpDoc )
- {
- // The document owns the Medium, so the Medium will be invalid after closing the document
- const_cast<SdDrawDocument*>(mpDoc)->CloseBookmarkDoc();
- mpMedium = nullptr;
- }
- }
- else
- {
- // perhaps mpOwnMedium provided, but no successful creation of BookmarkDoc
- delete mpOwnMedium;
- mpOwnMedium = nullptr;
- }
-
- mpBookmarkDoc = nullptr;
+ m_bSelectionHandlerNavigates = rMEvt.GetClicks() == 1;
+ m_bNavigationGrabsFocus = rMEvt.GetClicks() != 1;
+ return false;
}
-void SdPageObjsTLB::SelectHdl()
+IMPL_LINK_NOARG(SdPageObjsTLV, MouseReleaseHdl, const MouseEvent&, bool)
{
- SvTreeListEntry* pEntry = FirstSelected();
+ m_bSelectionHandlerNavigates = false;
+ m_bNavigationGrabsFocus = true;
+ return false;
+}
- mbLinkableSelected = true;
+IMPL_LINK_NOARG(SdPageObjsTLV, DragBeginHdl, weld::TreeView&, bool)
+{
+ return StartDrag();
+}
- while( pEntry && mbLinkableSelected )
+namespace
+{
+ bool CanDragSource(weld::TreeView& rTreeView)
{
- if( nullptr == pEntry->GetUserData() )
- mbLinkableSelected = false;
+ std::unique_ptr<weld::TreeIter> xSource(rTreeView.make_iterator());
+ if (!rTreeView.get_selected(xSource.get()))
+ return false;
- pEntry = NextSelected( pEntry );
- }
+ std::unique_ptr<weld::TreeIter> xSourceParent(rTreeView.make_iterator(xSource.get()));
+ bool bSourceHasParent = rTreeView.iter_parent(*xSourceParent);
+ // level 1 objects only
+ if (!bSourceHasParent || rTreeView.get_iter_depth(*xSourceParent))
+ return false;
- SvTreeListBox::SelectHdl();
+ SdrObject* pSourceObject = reinterpret_cast<SdrObject*>(rTreeView.get_id(*xSource).toInt64());
+ if (pSourceObject == reinterpret_cast<SdrObject*>(1))
+ pSourceObject = nullptr;
- if (mbSelectionHandlerNavigates)
- DoubleClickHdl();
-}
+ if (!pSourceObject)
+ return false;
-/**
- * Overloads RETURN with the functionality of DoubleClick
- */
-void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt )
-{
- const vcl::KeyCode& aKeyCode = rKEvt.GetKeyCode();
- if ( m_pAccel->execute( aKeyCode ) )
- // the accelerator consumed the event
- return;
- if( rKEvt.GetKeyCode().GetCode() == KEY_RETURN )
- {
- // commented code from svtools/source/contnr/svimpbox.cxx
- SvTreeListEntry* pCursor = GetCurEntry();
- if (!pCursor)
- return;
- if( pCursor->HasChildren() || pCursor->HasChildrenOnDemand() )
- {
- if( IsExpanded( pCursor ) )
- Collapse( pCursor );
- else
- Expand( pCursor );
- }
+ SdrPage* pObjectList = pSourceObject->getSdrPageFromSdrObject();
+ if (!pObjectList)
+ return false;
- DoubleClickHdl();
+ return true;
}
- else if (rKEvt.GetKeyCode().GetCode() == KEY_SPACE)
- {
- if (mpNavigator)
- {
- SvTreeListEntry* pNewEntry = GetCurEntry();
- if (!pNewEntry)
- return;
- SvTreeListEntry* pParentEntry = GetParent(pNewEntry);
- if (!pParentEntry)
- return;
- Invalidate();
- }
- }
- else
- SvTreeListBox::KeyInput( rKEvt );
-}
-
-void SdPageObjsTLB::MouseButtonDown(const MouseEvent& rMEvt)
-{
- mbSelectionHandlerNavigates = rMEvt.GetClicks() == 1;
- comphelper::ScopeGuard aNavigationGuard([this]() { this->mbSelectionHandlerNavigates = false; });
- mbNavigationGrabsFocus = rMEvt.GetClicks() != 1;
- comphelper::ScopeGuard aGrabGuard([this]() { this->mbNavigationGrabsFocus = true; });
-
- SvTreeListBox::MouseButtonDown(rMEvt);
}
/**
* StartDrag-Request
*/
-void SdPageObjsTLB::StartDrag( sal_Int8, const Point& rPosPixel)
+bool SdPageObjsTLV::StartDrag()
{
- SvTreeListEntry* pEntry = GetEntry(rPosPixel);
-
- if (!(pEntry && mpNavigator && mpNavigator->GetNavigatorDragType() != NAVIGATOR_DRAGTYPE_NONE))
- return;
-
- // Mark only the children of the page under the mouse as drop
- // targets. This prevents moving shapes from one page to another.
-
- // Select all entries and disable them as drop targets.
- SetSelectionMode(SelectionMode::Multiple);
- SetCursor(static_cast<SvTreeListEntry*>(nullptr));
- SelectAll(true, false);
- EnableSelectionAsDropTarget(false);
-
- // Enable only the entries as drop targets that are children of the
- // page under the mouse.
- SvTreeListEntry* pParent = GetRootLevelParent(pEntry);
- if (pParent != nullptr)
- {
- SelectAll(false, false);
- Select(pParent);
- // for (SvTreeListEntry*pChild=FirstChild(pParent); pChild!=NULL; pChild=NextSibling(pChild))
- // Select(pChild, sal_True);
- EnableSelectionAsDropTarget();//sal_False);
- }
-
- // Set selection back to the entry under the mouse.
- SelectAll(false, false);
- SetSelectionMode(SelectionMode::Single);
- Select(pEntry);
-
- // We can delete the Navigator from ExecuteDrag (when switching to
- // another document type), but that would kill the StarView MouseMove
- // Handler which is calling Command().
- // For this reason, Drag&Drop is asynchronous.
- Application::PostUserEvent( LINK( this, SdPageObjsTLB, ExecDragHdl ), nullptr, true );
+ return !CanDragSource(*m_xTreeView) || DoDrag();
}
/**
* Begin drag
*/
-void SdPageObjsTLB::DoDrag()
+bool SdPageObjsTLV::DoDrag()
{
- if (!mpNavigator)
- return;
-
- ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
- OUString aURL = INetURLObject( pDocShell->GetMedium()->GetPhysicalName(), INetProtocol::File ).GetMainURL( INetURLObject::DecodeMechanism::NONE );
- NavigatorDragType eDragType = mpNavigator->GetNavigatorDragType();
+ if (!m_xNavigator)
+ return true;
- aURL += "#" + GetSelectedEntry();
-
- INetBookmark aBookmark( aURL, GetSelectedEntry() );
- sal_Int8 nDNDActions = DND_ACTION_COPYMOVE;
-
- if( eDragType == NAVIGATOR_DRAGTYPE_LINK )
- nDNDActions = DND_ACTION_LINK; // Either COPY *or* LINK, never both!
- else if (mpDoc->GetSdPageCount(PageKind::Standard) == 1)
- {
- // Can not move away the last slide in a document.
- nDNDActions = DND_ACTION_COPY;
- }
-
- SvTreeListBox::ReleaseMouse();
-
- bIsInDrag = true;
+ if (!m_xHelper)
+ return true;
// Get the view.
+ ::sd::DrawDocShell* pDocShell = m_pDoc->GetDocSh();
::sd::ViewShell* pViewShell = GetViewShellForDocShell(*pDocShell);
if (pViewShell == nullptr)
{
OSL_ASSERT(pViewShell!=nullptr);
- return;
+ return true;
}
sd::View* pView = pViewShell->GetView();
if (pView == nullptr)
{
OSL_ASSERT(pView!=nullptr);
- return;
+ return true;
}
- // object is destroyed by internal reference mechanism
- SdTransferable* pTransferable =
- new SdPageObjsTLB::SdPageObjsTransferable(
- *this, aBookmark, *pDocShell, eDragType);
+ bIsInDrag = true;
+
+ std::unique_ptr<weld::TreeIter> xEntry = m_xTreeView->make_iterator();
+ bool bUserData = m_xTreeView->get_cursor(xEntry.get());
SdrObject* pObject = nullptr;
- void* pUserData = GetCurEntry()->GetUserData();
- if (pUserData != nullptr && pUserData != reinterpret_cast<void*>(1))
- pObject = static_cast<SdrObject*>(pUserData);
+ sal_Int64 nUserData = bUserData ? m_xTreeView->get_id(*xEntry).toInt64() : 0;
+ if (nUserData != 1)
+ pObject = reinterpret_cast<SdrObject*>(nUserData);
if (pObject != nullptr)
{
// For shapes without a user supplied name (the automatically
@@ -1041,9 +424,9 @@ void SdPageObjsTLB::DoDrag()
// is used.
if (GetObjectName(pObject, false).isEmpty())
{
- AddShapeToTransferable(*pTransferable, *pObject);
- pTransferable->SetView(pView);
- SD_MOD()->pTransferDrag = pTransferable;
+ AddShapeToTransferable(*m_xHelper, *pObject);
+ m_xHelper->SetView(pView);
+ SD_MOD()->pTransferDrag = m_xHelper.get();
}
// Unnamed shapes have to be selected to be recognized by the
@@ -1056,122 +439,78 @@ void SdPageObjsTLB::DoDrag()
}
else
{
- pTransferable->SetView(pView);
- SD_MOD()->pTransferDrag = pTransferable;
+ m_xHelper->SetView(pView);
+ SD_MOD()->pTransferDrag = m_xHelper.get();
}
- pTransferable->StartDrag( this, nDNDActions );
+ return false;
}
-void SdPageObjsTLB::OnDragFinished()
+void SdPageObjsTLV::OnDragFinished()
{
- if (mpNavigator)
- {
- MouseEvent aMEvt(mpNavigator->GetPointerPosPixel());
- SvTreeListBox::MouseButtonUp(aMEvt);
- }
-
bIsInDrag = false;
}
+SdPageObjsTLVDropTarget::SdPageObjsTLVDropTarget(weld::TreeView& rTreeView)
+ : DropTargetHelper(rTreeView.get_drop_target())
+ , m_rTreeView(rTreeView)
+{
+}
+
/**
* AcceptDrop-Event
*/
-sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent)
+sal_Int8 SdPageObjsTLVDropTarget::AcceptDrop(const AcceptDropEvent& rEvt)
{
- sal_Int8 nResult (DND_ACTION_NONE);
+ weld::TreeView* pSource = m_rTreeView.get_drag_source();
+ // only dragging within the same widget allowed
+ if (!pSource || pSource != &m_rTreeView)
+ return DND_ACTION_NONE;
- SvTreeListEntry* pEntry = GetDropTarget(rEvent.maPosPixel);
- if (rEvent.mbLeaving || !CheckDragAndDropMode( this, rEvent.mnAction ))
- {
- ImplShowTargetEmphasis( pTargetEntry, false );
- }
- else if( GetDragDropMode() == DragDropMode::NONE )
- {
- SAL_WARN( "sc.ui", "SdPageObjsTLB::AcceptDrop(): no target" );
- }
- else if (IsDropAllowed(pEntry))
- {
- nResult = DND_ACTION_MOVE;
+ std::unique_ptr<weld::TreeIter> xTarget(m_rTreeView.make_iterator());
+ if (!m_rTreeView.get_dest_row_at_pos(rEvt.maPosPixel, xTarget.get()))
+ return DND_ACTION_NONE;
- // Draw emphasis.
- if (pEntry != pTargetEntry || !(nImpFlags & SvTreeListBoxFlags::TARGEMPH_VIS))
- {
- ImplShowTargetEmphasis( pTargetEntry, false );
- pTargetEntry = pEntry;
- ImplShowTargetEmphasis( pTargetEntry, true );
- }
- }
+ std::unique_ptr<weld::TreeIter> xSource(m_rTreeView.make_iterator());
+ if (!m_rTreeView.get_selected(xSource.get()))
+ return DND_ACTION_NONE;
- // Hide emphasis when there is no valid drop action.
- if (nResult == DND_ACTION_NONE)
- ImplShowTargetEmphasis(pTargetEntry, false);
+ std::unique_ptr<weld::TreeIter> xTargetParent(m_rTreeView.make_iterator(xTarget.get()));
+ while (m_rTreeView.get_iter_depth(*xTargetParent))
+ m_rTreeView.iter_parent(*xTargetParent);
- return nResult;
-}
+ std::unique_ptr<weld::TreeIter> xSourceParent(m_rTreeView.make_iterator(xSource.get()));
+ while (m_rTreeView.get_iter_depth(*xSourceParent))
+ m_rTreeView.iter_parent(*xSourceParent);
-/**
- * ExecuteDrop-Event
- */
-sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt )
-{
- SvTreeListBox::ExecuteDrop(rEvt, this);
- return DND_ACTION_NONE;
+ // can only drop within the same page
+ if (m_rTreeView.iter_compare(*xTargetParent, *xSourceParent) != 0)
+ return DND_ACTION_NONE;
+
+ return DND_ACTION_MOVE;
}
/**
- * Handler for Dragging
+ * ExecuteDrop-Event
*/
-IMPL_LINK_NOARG(SdPageObjsTLB, ExecDragHdl, void*, void)
-{
- // as link, then it is allowed to asynchronous, without ImpMouseMoveMsg on
- // the stack, delete the Navigator
- DoDrag();
-}
-
-bool SdPageObjsTLB::PageBelongsToCurrentShow (const SdPage* pPage) const
+sal_Int8 SdPageObjsTLVDropTarget::ExecuteDrop( const ExecuteDropEvent& rEvt )
{
- // Return <TRUE/> as default when there is no custom show or when none
- // is used. The page does then belong to the standard show.
- bool bBelongsToShow = true;
+ weld::TreeView* pSource = m_rTreeView.get_drag_source();
+ // only dragging within the same widget allowed
+ if (!pSource || pSource != &m_rTreeView)
+ return DND_ACTION_NONE;
- if (mpDoc->getPresentationSettings().mbCustomShow)
- {
- // Get the current custom show.
- SdCustomShow* pCustomShow = nullptr;
- SdCustomShowList* pShowList = const_cast<SdDrawDocument*>(mpDoc)->GetCustomShowList();
- if (pShowList != nullptr)
- {
- sal_uLong nCurrentShowIndex = pShowList->GetCurPos();
- pCustomShow = (*pShowList)[nCurrentShowIndex].get();
- }
-
- // Check whether the given page is part of that custom show.
- if (pCustomShow != nullptr)
- {
- bBelongsToShow = false;
- size_t nPageCount = pCustomShow->PagesVector().size();
- for (size_t i=0; i<nPageCount && !bBelongsToShow; i++)
- if (pPage == pCustomShow->PagesVector()[i])
- bBelongsToShow = true;
- }
- }
+ std::unique_ptr<weld::TreeIter> xSource(m_rTreeView.make_iterator());
+ if (!m_rTreeView.get_selected(xSource.get()))
+ return DND_ACTION_NONE;
- return bBelongsToShow;
-}
+ std::unique_ptr<weld::TreeIter> xTarget(m_rTreeView.make_iterator());
+ if (!m_rTreeView.get_dest_row_at_pos(rEvt.maPosPixel, xTarget.get()))
+ return DND_ACTION_NONE;
+ int nTargetPos = m_rTreeView.get_iter_index_in_parent(*xTarget) + 1;
-TriState SdPageObjsTLB::NotifyMoving(
- SvTreeListEntry* pTarget,
- SvTreeListEntry* pEntry,
- SvTreeListEntry*& rpNewParent,
- sal_uLong& rNewChildPos)
-{
- SvTreeListEntry* pDestination = pTarget;
- while (GetParent(pDestination) != nullptr && GetParent(GetParent(pDestination)) != nullptr)
- pDestination = GetParent(pDestination);
-
- SdrObject* pTargetObject = static_cast<SdrObject*>(pDestination->GetUserData());
- SdrObject* pSourceObject = static_cast<SdrObject*>(pEntry->GetUserData());
+ SdrObject* pTargetObject = reinterpret_cast<SdrObject*>(m_rTreeView.get_id(*xTarget).toInt64());
+ SdrObject* pSourceObject = reinterpret_cast<SdrObject*>(m_rTreeView.get_id(*xSource).toInt64());
if (pSourceObject == reinterpret_cast<SdrObject*>(1))
pSourceObject = nullptr;
@@ -1182,80 +521,25 @@ TriState SdPageObjsTLB::NotifyMoving(
{
sal_uInt32 nNewPosition;
if (pTargetObject == reinterpret_cast<SdrObject*>(1))
+ {
nNewPosition = 0;
+ nTargetPos = 0;
+ }
else
nNewPosition = pTargetObject->GetNavigationPosition() + 1;
pObjectList->SetObjectNavigationPosition(*pSourceObject, nNewPosition);
}
- // Update the tree list.
- if (GetParent(pDestination) == nullptr)
- {
- rpNewParent = pDestination;
- rNewChildPos = 0;
- }
- else
- {
- rpNewParent = GetParent(pDestination);
- rNewChildPos = SvTreeList::GetRelPos(pDestination) + 1;
- rNewChildPos += nCurEntrySelPos;
- nCurEntrySelPos++;
- }
- return TRISTATE_TRUE;
- }
- else
- return TRISTATE_FALSE;
-}
-
-SvTreeListEntry* SdPageObjsTLB::GetDropTarget (const Point& rLocation)
-{
- SvTreeListEntry* pEntry = SvTreeListBox::GetDropTarget(rLocation);
- if (pEntry == nullptr)
- return nullptr;
+ std::unique_ptr<weld::TreeIter> xSourceParent(m_rTreeView.make_iterator(xSource.get()));
+ m_rTreeView.iter_parent(*xSourceParent);
- if (GetParent(pEntry) == nullptr)
- {
- // Use page entry as insertion position.
+ m_rTreeView.move_subtree(*xSource, xSourceParent.get(), nTargetPos);
}
- else
- {
- // Go to second hierarchy level, i.e. top level shapes,
- // i.e. children of pages.
- while (GetParent(pEntry) != nullptr && GetParent(GetParent(pEntry)) != nullptr)
- pEntry = GetParent(pEntry);
-
- // Advance to next sibling.
- SvTreeListEntry* pNext;
- sal_uInt16 nDepth (0);
- do
- {
- pNext = NextVisible(pEntry, &nDepth);
- if (pNext != nullptr && nDepth > 0 && nDepth!=0xffff)
- pEntry = pNext;
- else
- break;
- }
- while (pEntry != nullptr);
- }
-
- return pEntry;
-}
-
-bool SdPageObjsTLB::IsDropAllowed (SvTreeListEntry const * pEntry)
-{
- if (pEntry == nullptr)
- return false;
-
- if ( ! IsDropFormatSupported(SdPageObjsTransferable::GetListBoxDropFormatId()))
- return false;
-
- if (pEntry->GetFlags() & SvTLEntryFlags::DISABLE_DROP)
- return false;
- return true;
+ return DND_ACTION_NONE;
}
-void SdPageObjsTLB::AddShapeToTransferable (
+void SdPageObjsTLV::AddShapeToTransferable (
SdTransferable& rTransferable,
SdrObject& rObject) const
{
@@ -1284,16 +568,14 @@ void SdPageObjsTLB::AddShapeToTransferable (
}
}
- ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh();
+ ::sd::DrawDocShell* pDocShell = m_pDoc->GetDocSh();
if (bIsDescriptorFillingPending && pDocShell!=nullptr)
{
pDocShell->FillTransferableObjectDescriptor(*pObjectDescriptor);
}
Point aDragPos (rObject.GetCurrentBoundRect().Center());
- //Point aDragPos (0,0);
pObjectDescriptor->maDragStartPos = aDragPos;
- // aObjectDescriptor.maSize = GetAllMarkedRect().GetSize();
if (pDocShell != nullptr)
pObjectDescriptor->maDisplayName = pDocShell->GetMedium()->GetURLObject().GetURLNoPass();
else
@@ -1303,7 +585,7 @@ void SdPageObjsTLB::AddShapeToTransferable (
rTransferable.SetObjectDescriptor( std::move(pObjectDescriptor) );
}
-::sd::ViewShell* SdPageObjsTLB::GetViewShellForDocShell (::sd::DrawDocShell& rDocShell)
+::sd::ViewShell* SdPageObjsTLV::GetViewShellForDocShell (::sd::DrawDocShell& rDocShell)
{
{
::sd::ViewShell* pViewShell = rDocShell.GetViewShell();
@@ -1353,33 +635,57 @@ void SdPageObjsTLB::AddShapeToTransferable (
return nullptr;
}
-//===== IconProvider ==========================================================
-
-SdPageObjsTLB::IconProvider::IconProvider()
- : maImgPage(StockImage::Yes, BMP_PAGE),
- maImgPageExcl(StockImage::Yes, BMP_PAGE_EXCLUDED),
- maImgPageObjsExcl(StockImage::Yes, BMP_PAGEOBJS_EXCLUDED),
- maImgPageObjs(StockImage::Yes, BMP_PAGEOBJS),
- maImgObjects(StockImage::Yes, BMP_OBJECTS),
- maImgGroup(StockImage::Yes, BMP_GROUP)
-{
-}
-
SdPageObjsTLV::SdPageObjsTLV(std::unique_ptr<weld::TreeView> xTreeView)
: m_xTreeView(std::move(xTreeView))
+ , m_xDropTargetHelper(new SdPageObjsTLVDropTarget(*m_xTreeView))
, m_xAccel(::svt::AcceleratorExecute::createAcceleratorHelper())
, m_pDoc(nullptr)
, m_pBookmarkDoc(nullptr)
, m_pMedium(nullptr)
+ , m_pOwnMedium(nullptr)
, m_bLinkableSelected(false)
, m_bShowAllPages(false)
+ , m_bSelectionHandlerNavigates(false)
+ , m_bNavigationGrabsFocus(true)
+ , m_eSelectionMode(SelectionMode::Single)
+ , m_nSelectEventId(nullptr)
+ , m_nRowActivateEventId(nullptr)
{
m_xTreeView->connect_expanding(LINK(this, SdPageObjsTLV, RequestingChildrenHdl));
m_xTreeView->connect_changed(LINK(this, SdPageObjsTLV, SelectHdl));
+ m_xTreeView->connect_row_activated(LINK(this, SdPageObjsTLV, RowActivatedHdl));
+ m_xTreeView->connect_drag_begin(LINK(this, SdPageObjsTLV, DragBeginHdl));
+ m_xTreeView->connect_key_press(LINK(this, SdPageObjsTLV, KeyInputHdl));
+ m_xTreeView->connect_mouse_press(LINK(this, SdPageObjsTLV, MousePressHdl));
+ m_xTreeView->connect_mouse_release(LINK(this, SdPageObjsTLV, MouseReleaseHdl));
}
IMPL_LINK_NOARG(SdPageObjsTLV, SelectHdl, weld::TreeView&, void)
{
+ if (m_nSelectEventId)
+ Application::RemoveUserEvent(m_nSelectEventId);
+ // post the event to process select event after mouse press event
+ m_nSelectEventId = Application::PostUserEvent(LINK(this, SdPageObjsTLV, AsyncSelectHdl));
+}
+
+IMPL_LINK_NOARG(SdPageObjsTLV, RowActivatedHdl, weld::TreeView&, bool)
+{
+ if (m_nRowActivateEventId)
+ Application::RemoveUserEvent(m_nRowActivateEventId);
+ // post the event to process row activate after mouse press event
+ m_nRowActivateEventId = Application::PostUserEvent(LINK(this, SdPageObjsTLV, AsyncRowActivatedHdl));
+ return true;
+}
+
+IMPL_LINK_NOARG(SdPageObjsTLV, AsyncSelectHdl, void*, void)
+{
+ Select();
+}
+
+void SdPageObjsTLV::Select()
+{
+ m_nSelectEventId = nullptr;
+
m_bLinkableSelected = true;
m_xTreeView->selected_foreach([this](weld::TreeIter& rEntry){
@@ -1389,19 +695,68 @@ IMPL_LINK_NOARG(SdPageObjsTLV, SelectHdl, weld::TreeView&, void)
});
m_aChangeHdl.Call(*m_xTreeView);
+
+ if (m_bSelectionHandlerNavigates)
+ m_aRowActivatedHdl.Call(*m_xTreeView);
+
+ if (!m_xNavigator)
+ {
+ m_xHelper.clear();
+ return;
+ }
+
+ ::sd::DrawDocShell* pDocShell = m_pDoc->GetDocSh();
+ OUString aURL = INetURLObject(pDocShell->GetMedium()->GetPhysicalName(), INetProtocol::File).GetMainURL(INetURLObject::DecodeMechanism::NONE);
+ NavigatorDragType eDragType = m_xNavigator->GetNavigatorDragType();
+
+ OUString sSelectedEntry = m_xTreeView->get_selected_text();
+ aURL += "#" + sSelectedEntry;
+
+ INetBookmark aBookmark(aURL, sSelectedEntry);
+ sal_Int8 nDNDActions = DND_ACTION_COPYMOVE;
+
+ if( eDragType == NAVIGATOR_DRAGTYPE_LINK )
+ nDNDActions = DND_ACTION_LINK; // Either COPY *or* LINK, never both!
+ else if (m_pDoc->GetSdPageCount(PageKind::Standard) == 1)
+ {
+ // Can not move away the last slide in a document.
+ nDNDActions = DND_ACTION_COPY;
+ }
+
+ // object is destroyed by internal reference mechanism
+ m_xHelper.set(new SdPageObjsTLV::SdPageObjsTransferable(aBookmark, *pDocShell, eDragType));
+ rtl::Reference<TransferDataContainer> xHelper(m_xHelper.get());
+ m_xTreeView->enable_drag_source(xHelper, nDNDActions);
}
-OUString SdPageObjsTLV::GetObjectName(const SdrObject* pObject)
+IMPL_LINK_NOARG(SdPageObjsTLV, AsyncRowActivatedHdl, void*, void)
{
- if ( !pObject )
- return OUString();
+ m_nRowActivateEventId = nullptr;
+ m_aRowActivatedHdl.Call(*m_xTreeView);
+}
- OUString aRet = pObject->GetName();
- if (!aRet.isEmpty())
- return aRet;
+OUString SdPageObjsTLV::GetObjectName(
+ const SdrObject* pObject,
+ const bool bCreate) const
+{
+ OUString aRet;
- if (auto pOle = dynamic_cast<const SdrOle2Obj* >(pObject))
- aRet = pOle->GetPersistName();
+ if ( pObject )
+ {
+ aRet = pObject->GetName();
+
+ if (aRet.isEmpty() && dynamic_cast<const SdrOle2Obj* >(pObject) != nullptr)
+ aRet = static_cast< const SdrOle2Obj* >( pObject )->GetPersistName();
+ }
+
+ if (bCreate
+ && m_bShowAllShapes
+ && aRet.isEmpty()
+ && pObject!=nullptr)
+ {
+ aRet = SdResId(STR_NAVIGATOR_SHAPE_BASE_NAME);
+ aRet = aRet.replaceFirst("%1", OUString::number(pObject->GetOrdNum() + 1));
+ }
return aRet;
}
@@ -1424,13 +779,42 @@ std::vector<OUString> SdPageObjsTLV::GetSelectEntryList(const int nDepth) const
* Checks if it is a draw file and opens the BookmarkDoc depending of
* the provided Docs
*/
-SdDrawDocument* SdPageObjsTLV::GetBookmarkDoc()
+SdDrawDocument* SdPageObjsTLV::GetBookmarkDoc(SfxMedium* pMed)
{
- if (!m_pBookmarkDoc)
+ if (
+ !m_pBookmarkDoc ||
+ (pMed && (!m_pOwnMedium || m_pOwnMedium->GetName() != pMed->GetName()))
+ )
{
- DBG_ASSERT( m_pMedium, "No SfxMedium provided!" );
+ // create a new BookmarkDoc if now one exists or if a new Medium is provided
+ if (m_pOwnMedium != pMed)
+ {
+ CloseBookmarkDoc();
+ }
+
+ if (pMed)
+ {
+ // it looks that it is undefined if a Medium was set by Fill() already
+ DBG_ASSERT( !m_pMedium, "SfxMedium confusion!" );
+ delete m_pMedium;
+ m_pMedium = nullptr;
+
+ // take over this Medium (currently used only be Navigator)
+ m_pOwnMedium = pMed;
+ }
- if ( m_pMedium )
+ DBG_ASSERT( m_pMedium || pMed, "No SfxMedium provided!" );
+
+ if( pMed )
+ {
+ // in this mode the document is also owned and controlled by this instance
+ m_xBookmarkDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::STANDARD, true, DocumentType::Impress);
+ if (m_xBookmarkDocShRef->DoLoad(pMed))
+ m_pBookmarkDoc = m_xBookmarkDocShRef->GetDoc();
+ else
+ m_pBookmarkDoc = nullptr;
+ }
+ else if ( m_pMedium )
// in this mode the document is owned and controlled by the SdDrawDocument
// it can be released by calling the corresponding CloseBookmarkDoc method
// successful creation of a document makes this the owner of the medium
@@ -1526,6 +910,11 @@ IMPL_LINK(SdPageObjsTLV, RequestingChildrenHdl, const weld::TreeIter&, rFileEntr
return true;
}
+void SdPageObjsTLV::SetSdNavigator(SdNavigatorWin* pNavigator)
+{
+ m_xNavigator = pNavigator;
+}
+
void SdPageObjsTLV::SetViewFrame(const SfxViewFrame* pViewFrame)
{
sd::ViewShellBase* pBase = sd::ViewShellBase::GetViewShellBase(pViewFrame);
@@ -1542,9 +931,13 @@ void SdPageObjsTLV::CloseBookmarkDoc()
{
m_xBookmarkDocShRef->DoClose();
m_xBookmarkDocShRef.clear();
+
+ // Medium is owned by document, so it's destroyed already
+ m_pOwnMedium = nullptr;
}
else if (m_pBookmarkDoc)
{
+ DBG_ASSERT(!m_pOwnMedium, "SfxMedium confusion!");
if (m_pDoc)
{
// The document owns the Medium, so the Medium will be invalid after closing the document
@@ -1552,6 +945,12 @@ void SdPageObjsTLV::CloseBookmarkDoc()
m_pMedium = nullptr;
}
}
+ else
+ {
+ // perhaps mpOwnMedium provided, but no successful creation of BookmarkDoc
+ delete m_pOwnMedium;
+ m_pOwnMedium = nullptr;
+ }
m_pBookmarkDoc = nullptr;
}
@@ -1660,14 +1059,14 @@ void SdPageObjsTLV::AddShapeList (
/**
* Fill TreeLB with pages and objects
*/
-void SdPageObjsTLV::Fill(const SdDrawDocument* pInDoc, const OUString& rDocName)
+void SdPageObjsTLV::Fill(const SdDrawDocument* pInDoc, bool bAllPages, const OUString& rDocName)
{
OUString aSelection = m_xTreeView->get_selected_text();
clear();
m_pDoc = pInDoc;
m_aDocName = rDocName;
- m_bShowAllPages = true;
+ m_bShowAllPages = bAllPages;
m_pMedium = nullptr;
// first insert all pages including objects
@@ -1760,6 +1159,11 @@ bool SdPageObjsTLV::SelectEntry( const OUString& rName )
SdPageObjsTLV::~SdPageObjsTLV()
{
+ if (m_nSelectEventId)
+ Application::RemoveUserEvent(m_nSelectEventId);
+ if (m_nRowActivateEventId)
+ Application::RemoveUserEvent(m_nRowActivateEventId);
+
if (m_pBookmarkDoc)
CloseBookmarkDoc();
else
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 4eadc2a50279..5d75a1fa93bc 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -350,7 +350,7 @@ void SdTPAction::UpdateTree()
{
if( !bTreeUpdated && mpDoc && mpDoc->GetDocSh() && mpDoc->GetDocSh()->GetMedium() )
{
- m_xLbTree->Fill( mpDoc, mpDoc->GetDocSh()->GetMedium()->GetName() );
+ m_xLbTree->Fill( mpDoc, true, mpDoc->GetDocSh()->GetMedium()->GetName() );
bTreeUpdated = true;
}
}
@@ -645,7 +645,7 @@ IMPL_LINK_NOARG(SdTPAction, CheckFileHdl, weld::Widget&, void)
aLastFile = aFile;
m_xLbTreeDocument->clear();
- m_xLbTreeDocument->Fill(pBookmarkDoc, aFile);
+ m_xLbTreeDocument->Fill(pBookmarkDoc, true, aFile);
mpDoc->CloseBookmarkDoc();
m_xLbTreeDocument->show();
bHideTreeDocument = false;
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index a96f3ec15e22..02c8918747c7 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -259,7 +259,6 @@ public:
//Realize multi-selection of objects, If object is marked, the
//corresponding entry is set true, else the corresponding entry is set
//false.
- void FreshNavigatrEntry();
void FreshNavigatrTree();
void MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rWin);
diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx
index b01bbe12aa9f..b67f3e4303d1 100644
--- a/sd/source/ui/inc/navigatr.hxx
+++ b/sd/source/ui/inc/navigatr.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_SD_SOURCE_UI_INC_NAVIGATR_HXX
#define INCLUDED_SD_SOURCE_UI_INC_NAVIGATR_HXX
-#include <vcl/lstbox.hxx>
#include <vcl/toolbox.hxx>
#include <sfx2/ctrlitem.hxx>
#include <svx/sidebar/PanelLayout.hxx>
@@ -102,7 +101,7 @@ public:
bool InsertFile(const OUString& rFileName);
NavigatorDragType GetNavigatorDragType();
- VclPtr<SdPageObjsTLB> const & GetObjects() const;
+ SdPageObjsTLV& GetObjects();
protected:
virtual bool EventNotify(NotifyEvent& rNEvt) override;
@@ -112,9 +111,11 @@ private:
friend class SdNavigatorControllerItem;
friend class SdPageNameControllerItem;
- VclPtr<ToolBox> maToolbox;
- VclPtr<SdPageObjsTLB> maTlbObjects;
- VclPtr<ListBox> maLbDocs;
+ std::unique_ptr<weld::Toolbar> mxToolbox;
+ std::unique_ptr<SdPageObjsTLV> mxTlbObjects;
+ std::unique_ptr<weld::ComboBox> mxLbDocs;
+ std::unique_ptr<weld::Menu> mxDragModeMenu;
+ std::unique_ptr<weld::Menu> mxShapeMenu;
bool mbDocImported;
OUString maDropFileName;
@@ -129,23 +130,21 @@ private:
*/
// bool mbShowAllShapes;
- static const char* GetDragTypeSdStrId(NavigatorDragType eDT);
static OUString GetDragTypeSdBmpId(NavigatorDragType eDT);
NavDocInfo* GetDocInfo();
- DECL_LINK( SelectToolboxHdl, ToolBox *, void );
- DECL_LINK( DropdownClickToolBoxHdl, ToolBox *, void );
- DECL_LINK( ClickObjectHdl, SvTreeListBox*, bool );
- DECL_LINK( SelectDocumentHdl, ListBox&, void );
- DECL_LINK( MenuSelectHdl, Menu *, bool );
- DECL_LINK( ShapeFilterCallback, Menu *, bool );
+ DECL_LINK( SelectToolboxHdl, const OString&, void );
+ DECL_LINK( DropdownClickToolBoxHdl, const OString&, void );
+ DECL_LINK( ClickObjectHdl, weld::TreeView&, bool );
+ DECL_LINK( SelectDocumentHdl, weld::ComboBox&, void );
+ DECL_LINK( MenuSelectHdl, const OString&, void );
+ DECL_LINK( ShapeFilterCallback, const OString&, void );
void SetDragImage();
public:
//when object is marked , fresh the corresponding entry tree .
void FreshTree ( const SdDrawDocument* pDoc );
- void FreshEntry( );
};
/**
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index dce6c27e11a2..c2b3e96cd681 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -22,7 +22,6 @@
#include <pres.hxx>
#include <sddllapi.h>
-#include <vcl/treelistbox.hxx>
#include <vcl/weld.hxx>
#include <svl/urlbmk.hxx>
#include <tools/ref.hxx>
@@ -52,260 +51,59 @@ namespace svt {
class AcceleratorExecute;
}
-/**
- * Effect-Tab-Dialog
- */
-class SD_DLLPUBLIC SdPageObjsTLB final : public SvTreeListBox
+class SdPageObjsTLVDropTarget : public DropTargetHelper
{
- static bool SAL_DLLPRIVATE bIsInDrag; ///< static, in the case the navigator is deleted in ExecuteDrag
-
- ::std::unique_ptr< ::svt::AcceleratorExecute> m_pAccel;
-
-public:
-
- // nested class to implement the TransferableHelper
- class SAL_DLLPRIVATE SdPageObjsTransferable : public SdTransferable
- {
- public:
- SdPageObjsTransferable(
- SdPageObjsTLB& rParent,
- const INetBookmark& rBookmark,
- ::sd::DrawDocShell& rDocShell,
- NavigatorDragType eDragType );
- ::sd::DrawDocShell& GetDocShell() const { return mrDocShell;}
- NavigatorDragType GetDragType() const { return meDragType;}
-
- static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
- static SdPageObjsTransferable* getImplementation( const css::uno::Reference< css::uno::XInterface >& rxData ) throw();
- /** Return a temporary transferable data flavor that is used
- internally in the navigator for reordering entries. Its
- lifetime ends with the office application.
- */
- static SotClipboardFormatId GetListBoxDropFormatId();
-
- private:
- /** Temporary drop flavor id that is used internally in the
- navigator.
- */
- static SotClipboardFormatId mnListBoxDropFormatId;
-
- SdPageObjsTLB& mrParent;
- INetBookmark const maBookmark;
- ::sd::DrawDocShell& mrDocShell;
- NavigatorDragType const meDragType;
- virtual ~SdPageObjsTransferable() override;
-
- virtual void AddSupportedFormats() override;
- virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
- virtual void DragFinished( sal_Int8 nDropAction ) override;
-
- virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override;
- };
-
- friend class SdPageObjsTLB::SdPageObjsTransferable;
-
- /** Determine whether the specified page belongs to the current show
- which is either the standard show or a custom show.
- @param pPage
- Pointer to the page for which to check whether it belongs to the
- show.
- @return
- Returns <FALSE/> if there is no custom show or if the current
- show does not contain the specified page at least once.
- */
- bool PageBelongsToCurrentShow (const SdPage* pPage) const;
-
private:
+ weld::TreeView& m_rTreeView;
- VclPtr<SdNavigatorWin> mpNavigator;
- const SdDrawDocument* mpDoc;
- SdDrawDocument* mpBookmarkDoc;
- SfxMedium* mpMedium;
- SfxMedium* mpOwnMedium;
- Image const maImgOle;
- Image const maImgGraphic;
- bool mbLinkableSelected;
- OUString maDocName;
- ::sd::DrawDocShellRef mxBookmarkDocShRef; ///< for the loading of bookmarks
- std::vector<OUString> maTreeItem;
- bool mbSaveTreeItemState;
- OUString maSelectionEntryText;
-
- // DragSourceHelper
- virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override;
-
- // DropTargetHelper
- virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
- virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
-
- virtual void RequestingChildren( SvTreeListEntry* pParent ) override;
-
- void DoDrag();
- void OnDragFinished();
-
- /** Return the name of the object. When the object has no user supplied
- name and the bCreate flag is <TRUE/> then a name is created
- automatically. Additionally the mbShowAllShapes flag is taken into
- account when there is no user supplied name. When this flag is
- <FALSE/> then no name is created.
- @param pObject
- When this is NULL then an empty string is returned, regardless
- of the value of bCreate.
- @param bCreate
- This flag controls for objects without user supplied name
- whether a name is created. When a name is created then this
- name is not stored in the object.
- */
- OUString GetObjectName (
- const SdrObject* pObject,
- const bool bCreate = true) const;
- void CloseBookmarkDoc();
- DECL_LINK(ExecDragHdl, void*, void);
-
- /** Handle the reordering of entries in the navigator. This method
- reorders both the involved shapes in their page as well as the
- associated list box entries.
- */
- virtual TriState NotifyMoving(
- SvTreeListEntry* pTarget,
- SvTreeListEntry* pEntry,
- SvTreeListEntry*& rpNewParent,
- sal_uLong& rNewChildPos) override;
-
- using Window::GetDropTarget;
- virtual SvTreeListEntry* GetDropTarget (const Point& rLocation) override;
- virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&) override;
+ virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
+ virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
public:
+ SdPageObjsTLVDropTarget(weld::TreeView& rTreeView);
+};
- SdPageObjsTLB(vcl::Window* pParent, WinBits nStyle);
- virtual ~SdPageObjsTLB() override;
- virtual void dispose() override;
-
- // helper function for GetEntryAltText and GetEntryLongDescription
- OUString getAltLongDescText( SvTreeListEntry* pEntry , bool isAltText) const;
- OUString GetEntryAltText( SvTreeListEntry* pEntry ) const override;
- OUString GetEntryLongDescription( SvTreeListEntry* pEntry ) const override;
- virtual void SelectHdl() override;
- virtual void KeyInput( const KeyEvent& rKEvt ) override;
- void MouseButtonDown(const MouseEvent& rMEvt) override;
-
- void SetViewFrame( const SfxViewFrame* pViewFrame );
-
- void Fill( const SdDrawDocument*, bool bAllPages, const OUString& rDocName );
- void Fill( const SdDrawDocument*, SfxMedium* pSfxMedium, const OUString& rDocName );
- void SetShowAllShapes (const bool bShowAllShapes, const bool bFill);
- bool GetShowAllShapes() const { return mbShowAllShapes;}
- bool IsNavigationGrabsFocus() const { return mbNavigationGrabsFocus; }
- bool IsEqualToDoc( const SdDrawDocument* pInDoc );
- /// Visits rList recursively and tries to advance pEntry accordingly.
- bool IsEqualToShapeList(SvTreeListEntry*& pEntry, const SdrObjList& rList,
- const OUString& rListName);
- bool HasSelectedChildren( const OUString& rName );
- bool SelectEntry( const OUString& rName );
- OUString GetSelectedEntry() const;
-
- //Mark Current Entry
- void SetSdNavigator(SdNavigatorWin* pNavigator);
-
- void Clear();
- void SetSaveTreeItemStateFlag(bool bState){mbSaveTreeItemState = bState;}
- void SaveExpandedTreeItemState(SvTreeListEntry* pEntry, std::vector<OUString>& vectTreeItem);
-
- SdDrawDocument* GetBookmarkDoc(SfxMedium* pMedium = nullptr);
-
- bool IsLinkableSelected() const { return mbLinkableSelected; }
-
- static bool IsInDrag();
- using SvTreeListBox::ExecuteDrop;
-
- using SvTreeListBox::SelectEntry;
+class SD_DLLPUBLIC SdPageObjsTLV
+{
+private:
+ static bool SAL_DLLPRIVATE bIsInDrag; ///< static, in the case the navigator is deleted in ExecuteDrag
- /** Return the view shell that is linked to the given doc shell.
- Call this method when the there is a chance that the doc shell
- has been disconnected from the view shell (but not the other
- way round.)
- @return
- May return <NULL/> when the link between view shell and
- doc shell has been severed.
- */
- static ::sd::ViewShell* GetViewShellForDocShell (::sd::DrawDocShell &rDocShell);
+ std::unique_ptr<weld::TreeView> m_xTreeView;
+ std::unique_ptr<SdPageObjsTLVDropTarget> m_xDropTargetHelper;
+ std::unique_ptr<::svt::AcceleratorExecute> m_xAccel;
+ VclPtr<SdNavigatorWin> m_xNavigator;
+ const SdDrawDocument* m_pDoc;
+ SdDrawDocument* m_pBookmarkDoc;
+ SfxMedium* m_pMedium;
+ SfxMedium* m_pOwnMedium;
+ bool m_bLinkableSelected;
+ bool m_bShowAllShapes;
-private:
- /** This flag controls whether all shapes are shown as children of pages
- and group shapes or only the named shapes.
- */
- bool mbShowAllShapes;
/** This flag controls whether to show all pages.
*/
- bool mbShowAllPages;
+ bool m_bShowAllPages;
+
/**
* If changing the selection should also result in navigating to the
* relevant shape.
*/
- bool mbSelectionHandlerNavigates;
+ bool m_bSelectionHandlerNavigates;
+
/**
* If navigation should not only select the relevant shape but also change
* focus to it.
*/
- bool mbNavigationGrabsFocus;
+ bool m_bNavigationGrabsFocus;
- /** Return <TRUE/> when the current transferable may be dropped at the
- given list box entry.
- */
- bool IsDropAllowed (SvTreeListEntry const * pEntry);
+ SelectionMode m_eSelectionMode;
- /** This inner class is defined in sdtreelb.cxx and is basically a
- container for the icons used in the list box for the entries.
- */
- class SAL_DLLPRIVATE IconProvider;
+ ImplSVEvent* m_nSelectEventId;
+ ImplSVEvent* m_nRowActivateEventId;
- /** Add one list box entry for the parent of the given shapes and one child entry for
- each of the given shapes.
- @param rList
- The container of shapes that are to be inserted.
- @param pShape
- The parent shape or NULL when the parent is a page.
- @param rsName
- The name to be displayed for the new parent node.
- @param bIsExcluded
- Some pages can be excluded (from the show?).
- @param pParentEntry
- The parent entry of the new parent entry.
- @param rIconProvider
- Icons used to visualize the different shape and page types.
- */
- void AddShapeList (
- const SdrObjList& rList,
- SdrObject* pShape,
- const OUString& rsName,
- const bool bIsExcluded,
- SvTreeListEntry* pParentEntry,
- const IconProvider& rIconProvider);
-
- /** Add the given object to a transferable object so that the object can
- be dragged and dropped without having a name.
- */
- void AddShapeToTransferable (
- SdTransferable& rTransferable,
- SdrObject& rObject) const;
-};
-
-class SD_DLLPUBLIC SdPageObjsTLV
-{
-private:
- std::unique_ptr<weld::TreeView> m_xTreeView;
- std::unique_ptr<::svt::AcceleratorExecute> m_xAccel;
- const SdDrawDocument* m_pDoc;
- SdDrawDocument* m_pBookmarkDoc;
- SfxMedium* m_pMedium;
- bool m_bLinkableSelected;
- /** This flag controls whether to show all pages.
- */
- bool m_bShowAllPages;
OUString m_aDocName;
::sd::DrawDocShellRef m_xBookmarkDocShRef; ///< for the loading of bookmarks
Link<weld::TreeView&, void> m_aChangeHdl;
+ Link<weld::TreeView&, bool> m_aRowActivatedHdl;
/** Return the name of the object. When the object has no user supplied
name and the bCreate flag is <TRUE/> then a name is created
@@ -315,13 +113,24 @@ private:
@param pObject
When this is NULL then an empty string is returned, regardless
of the value of bCreate.
+ @param bCreate
+ This flag controls for objects without user supplied name
+ whether a name is created. When a name is created then this
+ name is not stored in the object.
*/
- static OUString GetObjectName (const SdrObject* pObject);
+ OUString GetObjectName (
+ const SdrObject* pObject,
+ const bool bCreate = true) const;
void CloseBookmarkDoc();
DECL_LINK(RequestingChildrenHdl, const weld::TreeIter&, bool);
DECL_LINK(SelectHdl, weld::TreeView&, void);
+ DECL_LINK(AsyncSelectHdl, void*, void);
+ DECL_LINK(RowActivatedHdl, weld::TreeView&, bool);
+ DECL_LINK(AsyncRowActivatedHdl, void*, void);
+ DECL_LINK(DragBeginHdl, weld::TreeView&, bool);
+ DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
/** Determine whether the specified page belongs to the current show
which is either the standard show or a custom show.
@@ -334,6 +143,12 @@ private:
*/
bool PageBelongsToCurrentShow (const SdPage* pPage) const;
+ bool DoDrag();
+ static void OnDragFinished();
+
+ // DragSourceHelper
+ bool StartDrag();
+
public:
SdPageObjsTLV(std::unique_ptr<weld::TreeView> xTreeview);
@@ -349,6 +164,11 @@ public:
m_xTreeView->show();
}
+ void grab_focus()
+ {
+ m_xTreeView->grab_focus();
+ }
+
void set_size_request(int nWidth, int nHeight)
{
m_xTreeView->set_size_request(nWidth, nHeight);
@@ -359,6 +179,11 @@ public:
return m_xTreeView->get_approximate_digit_width();
}
+ DECL_LINK(MousePressHdl, const MouseEvent&, bool);
+ DECL_LINK(MouseReleaseHdl, const MouseEvent&, bool);
+
+ void Select();
+
int get_height_rows(int nRows) const
{
return m_xTreeView->get_height_rows(nRows);
@@ -366,9 +191,21 @@ public:
void set_selection_mode(SelectionMode eMode)
{
+ m_eSelectionMode = eMode;
m_xTreeView->set_selection_mode(eMode);
}
+ SelectionMode get_selection_mode() const
+ {
+ return m_eSelectionMode;
+ }
+
+ void connect_row_activated(const Link<weld::TreeView&, bool>& rLink)
+ {
+ m_aRowActivatedHdl = rLink;
+ }
+
+ bool HasSelectedChildren(const OUString& rName);
bool SelectEntry(const OUString& rName);
OUString get_selected_text() const
@@ -381,6 +218,11 @@ public:
return m_xTreeView->get_selected(nullptr);
}
+ int count_selected_rows() const
+ {
+ return m_xTreeView->count_selected_rows();
+ }
+
void connect_changed(const Link<weld::TreeView&, void>& rLink)
{
m_aChangeHdl = rLink;
@@ -413,9 +255,30 @@ public:
void SetViewFrame(const SfxViewFrame* pViewFrame);
- void Fill(const SdDrawDocument*, const OUString& rDocName);
+ void Fill(const SdDrawDocument*, bool bAllPages, const OUString& rDocName);
void Fill(const SdDrawDocument*, SfxMedium* pSfxMedium, const OUString& rDocName);
+ void SetShowAllShapes (const bool bShowAllShapes, const bool bFill);
+ bool GetShowAllShapes() const { return m_bShowAllShapes; }
+
+ bool IsNavigationGrabsFocus() const { return m_bNavigationGrabsFocus; }
+ bool IsEqualToDoc(const SdDrawDocument* pInDoc);
+ /// Visits rList recursively and tries to advance rEntry accordingly.
+ bool IsEqualToShapeList(std::unique_ptr<weld::TreeIter>& rEntry, const SdrObjList& rList,
+ const OUString& rListName);
+
+ static bool IsInDrag();
+
+ /** Return the view shell that is linked to the given doc shell.
+ Call this method when the there is a chance that the doc shell
+ has been disconnected from the view shell (but not the other
+ way round.)
+ @return
+ May return <NULL/> when the link between view shell and
+ doc shell has been severed.
+ */
+ static ::sd::ViewShell* GetViewShellForDocShell (::sd::DrawDocShell &rDocShell);
+
/** Add one list box entry for the parent of the given shapes and one child entry for
each of the given shapes.
@param rList
@@ -436,13 +299,20 @@ public:
const bool bIsExcluded,
const weld::TreeIter* pParentEntry);
+ /** Add the given object to a transferable object so that the object can
+ be dragged and dropped without having a name.
+ */
+ void AddShapeToTransferable (
+ SdTransferable& rTransferable,
+ SdrObject& rObject) const;
+
/** return selected entries
nDepth == 0 -> pages
nDepth == 1 -> objects */
std::vector<OUString> GetSelectEntryList(const int nDepth) const;
- SdDrawDocument* GetBookmarkDoc();
+ SdDrawDocument* GetBookmarkDoc(SfxMedium* pMedium = nullptr);
bool IsLinkableSelected() const { return m_bLinkableSelected; }
@@ -456,10 +326,55 @@ public:
m_xTreeView->insert(pParent, -1, &rName, &rId, nullptr, nullptr, &rExpander, false, pEntry);
}
+ //Mark Current Entry
+ void SetSdNavigator(SdNavigatorWin* pNavigator);
+
void clear()
{
m_xTreeView->clear();
}
+
+ // nested class to implement the TransferableHelper
+ class SAL_DLLPRIVATE SdPageObjsTransferable : public SdTransferable
+ {
+ public:
+ SdPageObjsTransferable(
+ const INetBookmark& rBookmark,
+ ::sd::DrawDocShell& rDocShell,
+ NavigatorDragType eDragType );
+ ::sd::DrawDocShell& GetDocShell() const { return mrDocShell;}
+ NavigatorDragType GetDragType() const { return meDragType;}
+
+ static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
+ static SdPageObjsTransferable* getImplementation( const css::uno::Reference< css::uno::XInterface >& rxData ) throw();
+ /** Return a temporary transferable data flavor that is used
+ internally in the navigator for reordering entries. Its
+ lifetime ends with the office application.
+ */
+ static SotClipboardFormatId GetListBoxDropFormatId();
+
+ private:
+ /** Temporary drop flavor id that is used internally in the
+ navigator.
+ */
+ static SotClipboardFormatId mnListBoxDropFormatId;
+
+ INetBookmark const maBookmark;
+ ::sd::DrawDocShell& mrDocShell;
+ NavigatorDragType const meDragType;
+ virtual ~SdPageObjsTransferable() override;
+
+ virtual void AddSupportedFormats() override;
+ virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
+ virtual void DragFinished( sal_Int8 nDropAction ) override;
+
+ virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override;
+ };
+
+ friend class SdPageObjsTLV::SdPageObjsTransferable;
+
+private:
+ rtl::Reference<SdPageObjsTransferable> m_xHelper;
};
#endif // INCLUDED_SD_SOURCE_UI_INC_SDTREELB_HXX
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index 872ee4c21dc5..7b08dd24b1ff 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -481,14 +481,14 @@ std::shared_ptr<SdTransferable::UserData> Clipboard::CreateTransferableUserData
{
do
{
- SdPageObjsTLB::SdPageObjsTransferable* pTreeListBoxTransferable
- = dynamic_cast<SdPageObjsTLB::SdPageObjsTransferable*>(pTransferable);
+ SdPageObjsTLV::SdPageObjsTransferable* pTreeListBoxTransferable
+ = dynamic_cast<SdPageObjsTLV::SdPageObjsTransferable*>(pTransferable);
if (pTreeListBoxTransferable == nullptr)
break;
// Find view shell for the document of the transferable.
::sd::ViewShell* pViewShell
- = SdPageObjsTLB::GetViewShellForDocShell(pTreeListBoxTransferable->GetDocShell());
+ = SdPageObjsTLV::GetViewShellForDocShell(pTreeListBoxTransferable->GetDocShell());
if (pViewShell == nullptr)
break;
@@ -844,8 +844,8 @@ Clipboard::DropType Clipboard::IsDropAccepted() const
return DT_NONE;
}
- const SdPageObjsTLB::SdPageObjsTransferable* pPageObjsTransferable
- = dynamic_cast<const SdPageObjsTLB::SdPageObjsTransferable*>(pDragTransferable);
+ const SdPageObjsTLV::SdPageObjsTransferable* pPageObjsTransferable
+ = dynamic_cast<const SdPageObjsTLV::SdPageObjsTransferable*>(pDragTransferable);
if (pPageObjsTransferable != nullptr)
return DT_PAGE_FROM_NAVIGATOR;
diff --git a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
index de9eabaa589a..f447c565639e 100644
--- a/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsDragAndDropContext.cxx
@@ -45,8 +45,8 @@ DragAndDropContext::DragAndDropContext (SlideSorter& rSlideSorter)
// need additional information. For this a user data object is
// created that contains the necessary information.
SdTransferable* pTransferable = SD_MOD()->pTransferDrag;
- SdPageObjsTLB::SdPageObjsTransferable* pTreeListBoxTransferable
- = dynamic_cast<SdPageObjsTLB::SdPageObjsTransferable*>(pTransferable);
+ SdPageObjsTLV::SdPageObjsTransferable* pTreeListBoxTransferable
+ = dynamic_cast<SdPageObjsTLV::SdPageObjsTransferable*>(pTransferable);
if (pTreeListBoxTransferable!=nullptr && !TransferableData::GetFromTransferable(pTransferable))
{
pTransferable->AddUserData(
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 78c4635f279e..6163ce3dce61 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -248,19 +248,6 @@ void DrawViewShell::StartRulerDrag (
}
}
-//If object is marked , the corresponding entry is set true ,
-//else the corresponding entry is set false .
-void DrawViewShell::FreshNavigatrEntry()
-{
- SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( SID_NAVIGATOR );
- if( pWindow )
- {
- SdNavigatorWin* pNavWin = static_cast<SdNavigatorWin*>( pWindow->GetContextWindow( SD_MOD() ) );
- if( pNavWin )
- pNavWin->FreshEntry();
- }
-}
-
void DrawViewShell::FreshNavigatrTree()
{
SfxChildWindow* pWindow = GetViewFrame()->GetChildWindow( SID_NAVIGATOR );
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 825094382c98..87fc2eb40ebe 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -581,7 +581,7 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge
// For entries from the navigator, change action copy.
if (bBookmark
&& rTargetHelper.IsDropFormatSupported(
- SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormatId())
+ SdPageObjsTLV::SdPageObjsTransferable::GetListBoxDropFormatId())
&& (nDropAction & DND_ACTION_MOVE)!=0)
{
nRet = DND_ACTION_COPY;
@@ -697,7 +697,7 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt,
if( aDataHelper.HasFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK ) &&
aDataHelper.GetINetBookmark( SotClipboardFormatId::NETSCAPE_BOOKMARK, aINetBookmark ) )
{
- SdPageObjsTLB::SdPageObjsTransferable* pPageObjsTransferable = SdPageObjsTLB::SdPageObjsTransferable::getImplementation( aDataHelper.GetXTransferable() );
+ SdPageObjsTLV::SdPageObjsTransferable* pPageObjsTransferable = SdPageObjsTLV::SdPageObjsTransferable::getImplementation( aDataHelper.GetXTransferable() );
if( pPageObjsTransferable &&
( NAVIGATOR_DRAGTYPE_LINK == pPageObjsTransferable->GetDragType() ||
@@ -793,7 +793,7 @@ IMPL_LINK( View, ExecuteNavigatorDrop, void*, p, void )
{
SdNavigatorDropEvent* pSdNavigatorDropEvent = static_cast<SdNavigatorDropEvent*>(p);
TransferableDataHelper aDataHelper( pSdNavigatorDropEvent->maDropEvent.Transferable );
- SdPageObjsTLB::SdPageObjsTransferable* pPageObjsTransferable = SdPageObjsTLB::SdPageObjsTransferable::getImplementation( aDataHelper.GetXTransferable() );
+ SdPageObjsTLV::SdPageObjsTransferable* pPageObjsTransferable = SdPageObjsTLV::SdPageObjsTransferable::getImplementation( aDataHelper.GetXTransferable() );
INetBookmark aINetBookmark;
if( pPageObjsTransferable && aDataHelper.GetINetBookmark( SotClipboardFormatId::NETSCAPE_BOOKMARK, aINetBookmark ) )
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index 839c697bb010..e4502b8eef47 100644
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
@@ -98,8 +98,6 @@ void TabControl::MouseButtonDown(const MouseEvent& rMEvt)
sal_uInt16 aPageId = GetPageId(aPos);
//initialize
- if(RrePageID!=aPageId)
- pDrViewSh->FreshNavigatrEntry();
RrePageID=aPageId;
if (aPageId == 0)
{
diff --git a/sd/uiconfig/simpress/ui/navigatorpanel.ui b/sd/uiconfig/simpress/ui/navigatorpanel.ui
index 13c080797db7..6c91d9d313b1 100644
--- a/sd/uiconfig/simpress/ui/navigatorpanel.ui
+++ b/sd/uiconfig/simpress/ui/navigatorpanel.ui
@@ -1,10 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="sd">
<requires lib="gtk+" version="3.18"/>
+ <object class="GtkMenu" id="dragmodemenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkRadioMenuItem" id="1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="navigatorpanelSTR_DRAGTYPE_URL">Insert as Hyperlink</property>
+ <property name="draw_as_radio">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioMenuItem" id="2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="navigatorpanel|STR_DRAGTYPE_LINK">Insert as Link</property>
+ <property name="draw_as_radio">True</property>
+ <property name="group">1</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioMenuItem" id="3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="navigatorpanel|STR_DRAGTYPE_EMBEDDED">Insert as Copy</property>
+ <property name="draw_as_radio">True</property>
+ <property name="group">1</property>
+ </object>
+ </child>
+ </object>
+ <object class="GtkTreeStore" id="liststore2">
+ <columns>
+ <!-- column-name expander -->
+ <column type="GdkPixbuf"/>
+ <!-- column-name text -->
+ <column type="gchararray"/>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<object class="GtkGrid" id="NavigatorPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
<property name="border_width">6</property>
<child>
<object class="GtkGrid">
@@ -16,7 +58,7 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
- <object class="GtkComboBox" id="documents">
+ <object class="GtkComboBoxText" id="documents">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="navigatorpanel|documents|tooltip_text">Document</property>
@@ -32,13 +74,51 @@
</packing>
</child>
<child>
- <object class="sdlo-SdPageObjsTLB" id="tree:border">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
- <child internal-child="selection">
- <object class="GtkTreeSelection" id="SdPageObjsTLB-selection1"/>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="tree">
+ <property name="width_request">-1</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore2</property>
+ <property name="headers_visible">False</property>
+ <property name="reorderable">True</property>
+ <property name="search_column">1</property>
+ <property name="enable_tree_lines">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="Macro Library List-selection11"/>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn21">
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCellRendererPixbuf" id="cellrenderertext44"/>
+ <attributes>
+ <attribute name="pixbuf">0</attribute>
+ </attributes>
+ </child>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext22"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="tree-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes" context="navigatorpanel|STR_OBJECTS_TREE">Page Tree</property>
+ </object>
+ </child>
+ </object>
</child>
</object>
<packing>
@@ -51,17 +131,17 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="toolbar_style">icons</property>
+ <property name="icon_size">2</property>
<child>
<object class="GtkToolButton" id="first">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="navigatorpanel|first|tooltip_text">First Slide</property>
- <property name="action_name">first</property>
<property name="icon_name">sd/res/nv03.png</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">False</property>
</packing>
</child>
<child>
@@ -69,12 +149,11 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="navigatorpanel|previous|tooltip_text">Previous Slide</property>
- <property name="action_name">previous</property>
<property name="icon_name">sd/res/nv04.png</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">False</property>
</packing>
</child>
<child>
@@ -82,12 +161,11 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="navigatorpanel|next|tooltip_text">Next Slide</property>
- <property name="action_name">next</property>
<property name="icon_name">sd/res/nv05.png</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">False</property>
</packing>
</child>
<child>
@@ -95,12 +173,11 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="navigatorpanel|last|tooltip_text">Last Slide</property>
- <property name="action_name">last</property>
<property name="icon_name">sd/res/nv06.png</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">False</property>
</packing>
</child>
<child>
@@ -110,7 +187,7 @@
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">False</property>
</packing>
</child>
<child>
@@ -118,12 +195,11 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="navigatorpanel|dragmode|tooltip_text">Drag Mode</property>
- <property name="action_name">dragmode</property>
<property name="icon_name">sd/res/nv09.png</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">False</property>
</packing>
</child>
<child>
@@ -131,12 +207,11 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes" context="navigatorpanel|shapes|tooltip_text">Show Shapes</property>
- <property name="action_name">shapes</property>
<property name="icon_name">sd/res/graphic.png</property>
</object>
<packing>
<property name="expand">False</property>
- <property name="homogeneous">True</property>
+ <property name="homogeneous">False</property>
</packing>
</child>
</object>
@@ -152,4 +227,27 @@
</packing>
</child>
</object>
+ <object class="GtkMenu" id="shapemenu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkRadioMenuItem" id="named">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="navigatorpanel|STR_NAVIGATOR_SHOW_NAMED_SHAPES">Named shapes</property>
+ <property name="use_underline">True</property>
+ <property name="draw_as_radio">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkRadioMenuItem" id="all">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="navigatorpanel|STR_NAVIGATOR_SHOW_ALL_SHAPES">All shapes</property>
+ <property name="use_underline">True</property>
+ <property name="draw_as_radio">True</property>
+ <property name="group">named</property>
+ </object>
+ </child>
+ </object>
</interface>