2004-07-13 08:33:23 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 02:49:40 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-07-13 08:33:23 -05:00
|
|
|
*
|
2008-04-11 02:49:40 -05:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2004-07-13 08:33:23 -05:00
|
|
|
*
|
2008-04-11 02:49:40 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-07-13 08:33:23 -05:00
|
|
|
*
|
2008-04-11 02:49:40 -05:00
|
|
|
* $RCSfile: LayoutMenu.cxx,v $
|
2008-07-14 03:53:35 -05:00
|
|
|
* $Revision: 1.27 $
|
2004-07-13 08:33:23 -05:00
|
|
|
*
|
2008-04-11 02:49:40 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-07-13 08:33:23 -05:00
|
|
|
*
|
2008-04-11 02:49:40 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-07-13 08:33:23 -05:00
|
|
|
*
|
2008-04-11 02:49:40 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-07-13 08:33:23 -05:00
|
|
|
*
|
2008-04-11 02:49:40 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-07-13 08:33:23 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2005-03-18 09:54:57 -06:00
|
|
|
|
2006-09-16 13:13:00 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2004-07-13 08:33:23 -05:00
|
|
|
#include "LayoutMenu.hxx"
|
|
|
|
|
|
|
|
#include "TaskPaneShellManager.hxx"
|
|
|
|
#include "pres.hxx"
|
|
|
|
#include "drawdoc.hxx"
|
|
|
|
#include "DrawDocShell.hxx"
|
|
|
|
#include "sdpage.hxx"
|
|
|
|
#include "glob.hxx"
|
|
|
|
#include "glob.hrc"
|
|
|
|
#include "app.hrc"
|
2005-03-18 09:54:57 -06:00
|
|
|
#include "helpids.h"
|
2004-07-13 08:33:23 -05:00
|
|
|
#include "res_bmp.hrc"
|
|
|
|
#include "strings.hrc"
|
|
|
|
#include "ViewShellBase.hxx"
|
2004-10-28 07:31:30 -05:00
|
|
|
#include "DrawViewShell.hxx"
|
2004-07-13 08:33:23 -05:00
|
|
|
#include "SlideSorterViewShell.hxx"
|
2005-01-25 08:35:07 -06:00
|
|
|
#include "controller/SlideSorterController.hxx"
|
|
|
|
#include "controller/SlsPageSelector.hxx"
|
2005-03-18 09:54:57 -06:00
|
|
|
#include "taskpane/TaskPaneControlFactory.hxx"
|
|
|
|
#include "taskpane/ScrollPanel.hxx"
|
|
|
|
#include "tools/SlotStateListener.hxx"
|
2005-05-06 03:28:08 -05:00
|
|
|
#include "EventMultiplexer.hxx"
|
2007-04-03 10:19:55 -05:00
|
|
|
#include "DrawController.hxx"
|
|
|
|
#include "framework/FrameworkHelper.hxx"
|
2005-01-25 08:35:07 -06:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <memory>
|
2004-10-04 12:38:48 -05:00
|
|
|
#include <sfx2/objface.hxx>
|
2004-07-13 08:33:23 -05:00
|
|
|
#include "sdresid.hxx"
|
|
|
|
#include <vcl/image.hxx>
|
|
|
|
#include <svtools/languageoptions.hxx>
|
|
|
|
#include <sfx2/app.hxx>
|
2009-11-03 11:12:19 -06:00
|
|
|
#include "taskpane/TitledControl.hxx"
|
2004-07-13 08:33:23 -05:00
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
2007-04-03 10:19:55 -05:00
|
|
|
#include <comphelper/processfactory.hxx>
|
2007-05-10 08:07:44 -05:00
|
|
|
#include <sfx2/viewfrm.hxx>
|
2004-07-13 08:33:23 -05:00
|
|
|
|
2005-03-18 09:54:57 -06:00
|
|
|
#include <com/sun/star/frame/XController.hpp>
|
2007-04-03 10:19:55 -05:00
|
|
|
#include <com/sun/star/drawing/framework/XControllerManager.hpp>
|
|
|
|
#include <com/sun/star/drawing/framework/XView.hpp>
|
|
|
|
#include <com/sun/star/drawing/framework/ResourceId.hpp>
|
2005-03-18 09:54:57 -06:00
|
|
|
|
2004-07-13 08:33:23 -05:00
|
|
|
using namespace ::sd::toolpanel;
|
|
|
|
#define LayoutMenu
|
|
|
|
#include "sdslots.hxx"
|
|
|
|
|
2007-04-03 10:19:55 -05:00
|
|
|
using namespace ::com::sun::star;
|
2004-07-13 08:33:23 -05:00
|
|
|
using namespace ::com::sun::star::text;
|
2005-03-18 09:54:57 -06:00
|
|
|
using namespace ::com::sun::star::uno;
|
2007-04-03 10:19:55 -05:00
|
|
|
using namespace ::com::sun::star::drawing::framework;
|
2004-07-13 08:33:23 -05:00
|
|
|
using namespace ::sd::slidesorter;
|
2008-04-03 08:46:08 -05:00
|
|
|
using ::sd::framework::FrameworkHelper;
|
2004-07-13 08:33:23 -05:00
|
|
|
|
|
|
|
namespace sd { namespace toolpanel {
|
|
|
|
|
2005-03-18 09:54:57 -06:00
|
|
|
/** This factory class stores references to ViewShellBase and DrawDocShell
|
|
|
|
and passes them to new LayoutMenu objects.
|
|
|
|
*/
|
|
|
|
class LayoutMenuFactory
|
|
|
|
: public ControlFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
LayoutMenuFactory (ViewShellBase& rBase, DrawDocShell& rDocShell)
|
|
|
|
: mrBase(rBase),
|
|
|
|
mrDocShell(rDocShell)
|
|
|
|
{}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual TreeNode* InternalCreateControl (TreeNode* pTreeNode)
|
|
|
|
{
|
|
|
|
ScrollPanel* pScrollPanel = new ScrollPanel (pTreeNode);
|
|
|
|
::std::auto_ptr<TreeNode> pMenu (
|
|
|
|
new LayoutMenu (
|
|
|
|
pScrollPanel,
|
|
|
|
mrDocShell,
|
|
|
|
mrBase,
|
|
|
|
false));
|
|
|
|
pScrollPanel->AddControl(pMenu);
|
|
|
|
return pScrollPanel;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
ViewShellBase& mrBase;
|
|
|
|
DrawDocShell& mrDocShell;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 08:33:23 -05:00
|
|
|
SFX_IMPL_INTERFACE(LayoutMenu, SfxShell,
|
|
|
|
SdResId(STR_TASKPANELAYOUTMENU))
|
|
|
|
{
|
|
|
|
SFX_POPUPMENU_REGISTRATION(SdResId(RID_TASKPANE_LAYOUTMENU_POPUP));
|
|
|
|
}
|
|
|
|
|
|
|
|
TYPEINIT1(LayoutMenu, SfxShell);
|
|
|
|
|
|
|
|
struct snewfoil_value_info
|
|
|
|
{
|
|
|
|
USHORT mnBmpResId;
|
|
|
|
USHORT mnHCBmpResId;
|
|
|
|
USHORT mnStrResId;
|
|
|
|
WritingMode meWritingMode;
|
|
|
|
AutoLayout maAutoLayout;
|
|
|
|
};
|
|
|
|
|
|
|
|
static snewfoil_value_info notes[] =
|
|
|
|
{
|
|
|
|
{BMP_FOILN_01, BMP_FOILN_01_H, STR_AUTOLAYOUT_NOTES, WritingMode_LR_TB,
|
|
|
|
AUTOLAYOUT_NOTES},
|
|
|
|
{0, 0, 0, WritingMode_LR_TB, AUTOLAYOUT_NONE},
|
|
|
|
};
|
|
|
|
|
|
|
|
static snewfoil_value_info handout[] =
|
|
|
|
{
|
|
|
|
{BMP_FOILH_01, BMP_FOILH_01_H, STR_AUTOLAYOUT_HANDOUT1, WritingMode_LR_TB,
|
|
|
|
AUTOLAYOUT_HANDOUT1},
|
|
|
|
{BMP_FOILH_02, BMP_FOILH_02_H, STR_AUTOLAYOUT_HANDOUT2, WritingMode_LR_TB,
|
|
|
|
AUTOLAYOUT_HANDOUT2},
|
|
|
|
{BMP_FOILH_03, BMP_FOILH_03_H, STR_AUTOLAYOUT_HANDOUT3, WritingMode_LR_TB,
|
|
|
|
AUTOLAYOUT_HANDOUT3},
|
|
|
|
{BMP_FOILH_04, BMP_FOILH_04_H, STR_AUTOLAYOUT_HANDOUT4, WritingMode_LR_TB,
|
|
|
|
AUTOLAYOUT_HANDOUT4},
|
|
|
|
{BMP_FOILH_06, BMP_FOILH_06_H, STR_AUTOLAYOUT_HANDOUT6, WritingMode_LR_TB,
|
|
|
|
AUTOLAYOUT_HANDOUT6},
|
2008-03-06 09:38:20 -06:00
|
|
|
{BMP_FOILH_09, BMP_FOILH_09_H, STR_AUTOLAYOUT_HANDOUT9, WritingMode_LR_TB,
|
|
|
|
AUTOLAYOUT_HANDOUT9},
|
2004-07-13 08:33:23 -05:00
|
|
|
{0, 0, 0, WritingMode_LR_TB, AUTOLAYOUT_NONE},
|
|
|
|
};
|
|
|
|
|
|
|
|
static snewfoil_value_info standard[] =
|
|
|
|
{
|
2009-12-02 03:19:06 -06:00
|
|
|
{BMP_FOIL_20, BMP_FOIL_20_H, STR_AUTOLAYOUT_NONE, WritingMode_LR_TB, AUTOLAYOUT_NONE},
|
|
|
|
{BMP_FOIL_00, BMP_FOIL_00_H, STR_AUTOLAYOUT_TITLE, WritingMode_LR_TB, AUTOLAYOUT_TITLE},
|
|
|
|
{BMP_FOIL_01, BMP_FOIL_01_H, STR_AUTOLAYOUT_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_ENUM},
|
|
|
|
{BMP_FOIL_03, BMP_FOIL_03_H, STR_AUTOLAYOUT_2CONTENT, WritingMode_LR_TB, AUTOLAYOUT_2TEXT},
|
|
|
|
{BMP_FOIL_19, BMP_FOIL_19_H, STR_AUTOLAYOUT_ONLY_TITLE, WritingMode_LR_TB, AUTOLAYOUT_ONLY_TITLE},
|
|
|
|
{BMP_FOIL_25, BMP_FOIL_25_H, STR_AUTOLAYOUT_ONLY_TEXT, WritingMode_LR_TB, AUTOLAYOUT_ONLY_TEXT},
|
|
|
|
{BMP_FOIL_12, BMP_FOIL_12_H, STR_AUTOLAYOUT_CONTENT_2CONTENT, WritingMode_LR_TB, AUTOLAYOUT_TEXT2OBJ},
|
|
|
|
{BMP_FOIL_15, BMP_FOIL_15_H, STR_AUTOLAYOUT_2CONTENT_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_2OBJTEXT},
|
|
|
|
//STR_AUTOLAYOUT_CONTENT_OVER_2CONTENT
|
|
|
|
{BMP_FOIL_16, BMP_FOIL_16_H, STR_AUTOLAYOUT_2CONTENT_OVER_CONTENT,WritingMode_LR_TB, AUTOLAYOUT_2OBJOVERTEXT},
|
|
|
|
{BMP_FOIL_14, BMP_FOIL_14_H, STR_AUTOLAYOUT_CONTENT_OVER_CONTENT, WritingMode_LR_TB, AUTOLAYOUT_OBJOVERTEXT},
|
|
|
|
{BMP_FOIL_18, BMP_FOIL_18_H, STR_AUTOLAYOUT_4CONTENT, WritingMode_LR_TB, AUTOLAYOUT_4OBJ},
|
|
|
|
{BMP_FOIL_27, BMP_FOIL_27_H, STR_AUTOLAYOUT_6CONTENT, WritingMode_LR_TB, AUTOLAYOUT_6CLIPART},
|
|
|
|
/*
|
|
|
|
{BMP_FOIL_11, BMP_FOIL_11_H, STR_AUTOLAYOUT_OBJ, WritingMode_LR_TB, AUTOLAYOUT_OBJ},
|
|
|
|
{BMP_FOIL_02, BMP_FOIL_02_H, STR_AUTOLAYOUT_CHART, WritingMode_LR_TB, AUTOLAYOUT_CHART},
|
|
|
|
{BMP_FOIL_08, BMP_FOIL_08_H, STR_AUTOLAYOUT_TAB, WritingMode_LR_TB, AUTOLAYOUT_TAB},
|
|
|
|
{BMP_FOIL_09, BMP_FOIL_09_H, STR_AUTOLAYOUT_CLIPTEXT, WritingMode_LR_TB, AUTOLAYOUT_CLIPTEXT},
|
|
|
|
{BMP_FOIL_04, BMP_FOIL_04_H, STR_AUTOLAYOUT_TEXTCHART, WritingMode_LR_TB, AUTOLAYOUT_TEXTCHART},
|
|
|
|
{BMP_FOIL_06, BMP_FOIL_06_H, STR_AUTOLAYOUT_TEXTCLIP, WritingMode_LR_TB, AUTOLAYOUT_TEXTCLIP},
|
|
|
|
{BMP_FOIL_07, BMP_FOIL_07_H, STR_AUTOLAYOUT_CHARTTEXT, WritingMode_LR_TB, AUTOLAYOUT_CHARTTEXT},
|
|
|
|
{BMP_FOIL_10, BMP_FOIL_10_H, STR_AUTOLAYOUT_TEXTOBJ, WritingMode_LR_TB, AUTOLAYOUT_TEXTOBJ},
|
|
|
|
{BMP_FOIL_13, BMP_FOIL_13_H, STR_AUTOLAYOUT_OBJTEXT, WritingMode_LR_TB, AUTOLAYOUT_OBJTEXT},
|
|
|
|
{BMP_FOIL_17, BMP_FOIL_17_H, STR_AUTOLAYOUT_TEXTOVEROBJ, WritingMode_LR_TB, AUTOLAYOUT_TEXTOVEROBJ},
|
|
|
|
{BMP_FOIL_26, BMP_FOIL_26_H, STR_AUTOLAYOUT_4CLIPART, WritingMode_LR_TB, AUTOLAYOUT_4CLIPART},
|
|
|
|
*/
|
2004-07-13 08:33:23 -05:00
|
|
|
// vertical
|
2009-12-02 03:19:06 -06:00
|
|
|
{BMP_FOIL_21, BMP_FOIL_21_H, STR_AL_VERT_TITLE_TEXT_CHART, WritingMode_TB_RL,AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART},
|
|
|
|
{BMP_FOIL_22, BMP_FOIL_22_H, STR_AL_VERT_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE},
|
|
|
|
{BMP_FOIL_23, BMP_FOIL_23_H, STR_AL_TITLE_VERT_OUTLINE, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VERTICAL_OUTLINE},
|
|
|
|
{BMP_FOIL_24, BMP_FOIL_24_H, STR_AL_TITLE_VERT_OUTLINE_CLIPART, WritingMode_TB_RL, AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART},
|
2004-07-13 08:33:23 -05:00
|
|
|
|
|
|
|
{0, 0, 0, WritingMode_LR_TB, AUTOLAYOUT_NONE}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-18 09:54:57 -06:00
|
|
|
|
2004-07-13 08:33:23 -05:00
|
|
|
LayoutMenu::LayoutMenu (
|
|
|
|
TreeNode* pParent,
|
|
|
|
DrawDocShell& rDocumentShell,
|
|
|
|
ViewShellBase& rViewShellBase,
|
|
|
|
bool bUseOwnScrollBar)
|
|
|
|
: ValueSet (pParent->GetWindow()),
|
|
|
|
TreeNode(pParent),
|
|
|
|
DragSourceHelper(this),
|
|
|
|
DropTargetHelper(this),
|
|
|
|
mrBase (rViewShellBase),
|
|
|
|
mbUseOwnScrollBar (bUseOwnScrollBar),
|
2005-03-18 09:54:57 -06:00
|
|
|
mnPreferredColumnCount(3),
|
2005-05-06 03:28:08 -05:00
|
|
|
mxListener(NULL),
|
2008-04-03 08:46:08 -05:00
|
|
|
mbSelectionUpdatePending(true),
|
|
|
|
mbIsMainViewChangePending(false)
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
|
|
|
SetStyle (
|
CWS-TOOLING: integrate CWS impress172
2009-07-30 15:29:39 +0200 cl r274492 : #i102921# remove reference to inssrc.obj which was moved to svx
2009-07-29 11:40:35 +0200 wg r274445 : i103869
2009-07-22 14:39:13 +0200 sj r274241 : #i102713# fixed cloud shape
2009-07-07 15:28:04 +0200 sj r273800 : fixed build problem
2009-07-07 13:27:13 +0200 cl r273792 : #i102921# moved insert col/rows dialog to svx
2009-07-07 10:36:05 +0200 cl r273782 : fixed compiler warnings
2009-07-02 10:40:21 +0200 sj r273626 : fixed build problem
2009-07-02 10:27:56 +0200 cl r273624 : fixed merge problem
2009-07-02 10:27:19 +0200 cl r273623 : fixed compiler warning
2009-07-01 10:04:58 +0200 cl r273550 : CWS-TOOLING: rebase CWS impress172 to trunk@273468 (milestone: DEV300:m51)
2009-06-30 16:22:02 +0200 cl r273518 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:46 +0200 cl r273517 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:28 +0200 cl r273516 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:49 +0200 cl r273515 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:28 +0200 cl r273514 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:17:38 +0200 cl r273513 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:45:44 +0200 cl r273511 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:37:16 +0200 cl r273510 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:33:47 +0200 cl r273509 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:32:10 +0200 cl r273508 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:30:05 +0200 cl r273507 : #i102921# added insert table row/col dialog for impress tables
2009-06-29 12:32:42 +0200 sj r273465 : #158632# fixed textrange hyperlinks to specific pages, added slide names
2009-06-24 15:17:59 +0200 sj r273349 : #158636# fixed text range hyperlink to first/last slide
2009-06-22 13:18:30 +0200 sj r273224 : #158651# fixed header footer import
2009-06-19 15:18:24 +0200 sj r273160 : #158614# default text of presentation objects now cleared
2009-06-16 15:54:19 +0200 sj r273023 : #i101545# fixed crash - bracketing of graphic links has been done twice leading to a broken graphic state stack
2009-06-15 16:26:26 +0200 sj r272998 : #158635# importing bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-15 16:25:26 +0200 sj r272997 : #158635# added bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-12 13:17:32 +0200 sj r272915 : #i102713# fixed cloud shape
2009-06-10 18:36:58 +0200 sj r272833 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-08 19:52:28 +0200 sj r272746 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-04 15:28:32 +0200 cl r272640 : #i102358# applied patch to remove warnings
2009-06-04 14:39:45 +0200 cl r272630 : #i99423# applied path to change impress wizard create button to open when opening exisitng documents
2009-06-03 18:21:26 +0200 sj r272601 : #158635# now using the correct paragraph bottom spacing. using font independent linespacing for impress text objects
2009-06-03 15:47:27 +0200 cl r272583 : #i101817# added color collection based on scribus
2009-06-03 14:43:59 +0200 cl r272580 : #i102163# use weak ref to SdrObject instead of listening to the model
2009-06-03 12:39:29 +0200 cl r272556 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 12:27:00 +0200 cl r272555 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 11:33:44 +0200 cl r272553 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:59 +0200 cl r272552 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:22 +0200 cl r272551 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-02 18:41:07 +0200 sj r272527 : #i28358# applied patch (better conversion of dotted lines)
2009-06-02 11:52:13 +0200 cl r272491 : #i98668# applied patch to fix possible endless loop if exception occours
2009-05-28 17:02:55 +0200 sj r272416 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:25 +0200 sj r272415 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:10 +0200 sj r272414 : #i102336# retaining graphic file names unchanged
2009-05-25 12:43:58 +0200 sj r272232 : #i102069# added patch from thb (fixed rotated group objects)
2009-08-05 12:01:07 -05:00
|
|
|
( GetStyle() & ~(WB_ITEMBORDER) )
|
2004-07-13 08:33:23 -05:00
|
|
|
| WB_TABSTOP
|
2005-07-14 04:19:46 -05:00
|
|
|
| WB_NO_DIRECTSELECT
|
2004-07-13 08:33:23 -05:00
|
|
|
);
|
|
|
|
if (mbUseOwnScrollBar)
|
|
|
|
SetStyle (GetStyle() | WB_VSCROLL);
|
|
|
|
SetExtraSpacing(2);
|
|
|
|
SetSelectHdl (LINK(this, LayoutMenu, ClickHandler));
|
|
|
|
SetPool (&rDocumentShell.GetDoc()->GetPool());
|
2006-03-21 10:31:37 -06:00
|
|
|
SetName(String(RTL_CONSTASCII_USTRINGPARAM("LayoutMenu")));
|
2005-05-06 03:28:08 -05:00
|
|
|
InvalidateContent();
|
2004-07-13 08:33:23 -05:00
|
|
|
|
2005-05-06 03:28:08 -05:00
|
|
|
Link aEventListenerLink (LINK(this,LayoutMenu,EventMultiplexerListener));
|
2008-04-03 08:46:08 -05:00
|
|
|
mrBase.GetEventMultiplexer()->AddEventListener(aEventListenerLink,
|
2006-03-21 10:31:37 -06:00
|
|
|
::sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE
|
|
|
|
| ::sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION
|
|
|
|
| ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED
|
2008-04-03 08:46:08 -05:00
|
|
|
| ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED
|
2009-09-09 04:19:53 -05:00
|
|
|
| ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED
|
|
|
|
| ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL
|
|
|
|
| ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER);
|
2005-03-18 09:54:57 -06:00
|
|
|
|
|
|
|
SetSmartHelpId(SmartId(HID_SD_TASK_PANE_PREVIEW_LAYOUTS));
|
2005-07-14 04:19:46 -05:00
|
|
|
SetAccessibleName(SdResId(STR_TASKPANEL_LAYOUT_MENU_TITLE));
|
2005-03-18 09:54:57 -06:00
|
|
|
|
2005-05-06 03:28:08 -05:00
|
|
|
Link aStateChangeLink (LINK(this,LayoutMenu,StateChangeHandler));
|
2005-03-18 09:54:57 -06:00
|
|
|
mxListener = new ::sd::tools::SlotStateListener(
|
2005-05-06 03:28:08 -05:00
|
|
|
aStateChangeLink,
|
2007-04-03 10:19:55 -05:00
|
|
|
Reference<frame::XDispatchProvider>(mrBase.GetController()->getFrame(), UNO_QUERY),
|
2005-03-18 09:54:57 -06:00
|
|
|
::rtl::OUString::createFromAscii(".uno:VerticalTextState"));
|
2006-03-21 10:31:37 -06:00
|
|
|
|
|
|
|
// Add this new object as shell to the shell factory.
|
|
|
|
GetShellManager()->AddSubShell(HID_SD_TASK_PANE_PREVIEW_LAYOUTS,this,this);
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LayoutMenu::~LayoutMenu (void)
|
|
|
|
{
|
2006-03-21 10:31:37 -06:00
|
|
|
// Tell the shell factory that this object is no longer available.
|
|
|
|
if (GetShellManager() != NULL)
|
|
|
|
GetShellManager()->RemoveSubShell(this);
|
|
|
|
|
2005-03-18 09:54:57 -06:00
|
|
|
Reference<lang::XComponent> xComponent (mxListener, UNO_QUERY);
|
|
|
|
if (xComponent.is())
|
|
|
|
xComponent->dispose();
|
|
|
|
|
2004-07-13 08:33:23 -05:00
|
|
|
Clear();
|
2005-05-06 03:28:08 -05:00
|
|
|
Link aLink (LINK(this,LayoutMenu,EventMultiplexerListener));
|
2008-04-03 08:46:08 -05:00
|
|
|
mrBase.GetEventMultiplexer()->RemoveEventListener (aLink);
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-18 09:54:57 -06:00
|
|
|
::std::auto_ptr<ControlFactory> LayoutMenu::CreateControlFactory (
|
|
|
|
ViewShellBase& rBase,
|
|
|
|
DrawDocShell& rDocShell)
|
|
|
|
{
|
|
|
|
return ::std::auto_ptr<ControlFactory>(new LayoutMenuFactory(rBase, rDocShell));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 08:33:23 -05:00
|
|
|
String LayoutMenu::GetSelectedLayoutName (void)
|
|
|
|
{
|
|
|
|
return GetItemText (GetSelectItemId());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AutoLayout LayoutMenu::GetSelectedAutoLayout (void)
|
|
|
|
{
|
2005-11-08 02:05:10 -06:00
|
|
|
AutoLayout aResult = AUTOLAYOUT_NONE;
|
|
|
|
|
|
|
|
if ( ! IsNoSelection() && GetSelectItemId()!=0)
|
|
|
|
{
|
|
|
|
AutoLayout* pLayout = static_cast<AutoLayout*>(GetItemData(GetSelectItemId()));
|
|
|
|
if (pLayout != NULL)
|
|
|
|
aResult = *pLayout;
|
|
|
|
}
|
|
|
|
|
|
|
|
return aResult;
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** The preferred size depends on the preferred number of columns, the
|
|
|
|
number of items, and the size of the items.
|
|
|
|
*/
|
|
|
|
Size LayoutMenu::GetPreferredSize (void)
|
|
|
|
{
|
|
|
|
Size aItemSize = CalcItemSizePixel (Size());
|
|
|
|
Size aPreferredWindowSize = CalcWindowSizePixel (
|
|
|
|
aItemSize,
|
2006-12-12 11:40:07 -06:00
|
|
|
(USHORT)mnPreferredColumnCount,
|
|
|
|
(USHORT)CalculateRowCount (aItemSize,mnPreferredColumnCount));
|
2004-07-13 08:33:23 -05:00
|
|
|
return aPreferredWindowSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sal_Int32 LayoutMenu::GetPreferredWidth (sal_Int32 nHeight)
|
|
|
|
{
|
|
|
|
sal_Int32 nPreferredWidth = 100;
|
|
|
|
if (GetItemCount() > 0)
|
|
|
|
{
|
|
|
|
Image aImage = GetItemImage(GetItemId(0));
|
|
|
|
Size aItemSize = CalcItemSizePixel (aImage.GetSizePixel());
|
|
|
|
if (nHeight>0 && aItemSize.Height()>0)
|
|
|
|
{
|
|
|
|
int nRowCount = nHeight / aItemSize.Height();
|
|
|
|
if (nRowCount <= 0)
|
|
|
|
nRowCount = 1;
|
|
|
|
int nColumnCount = (GetItemCount() + nRowCount-1) / nRowCount;
|
|
|
|
nPreferredWidth = nColumnCount * aItemSize.Width();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nPreferredWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sal_Int32 LayoutMenu::GetPreferredHeight (sal_Int32 nWidth)
|
|
|
|
{
|
|
|
|
sal_Int32 nPreferredHeight = 200;
|
|
|
|
if ( ! mbUseOwnScrollBar && GetItemCount()>0)
|
|
|
|
{
|
|
|
|
Image aImage = GetItemImage(GetItemId(0));
|
|
|
|
Size aItemSize = CalcItemSizePixel (aImage.GetSizePixel());
|
|
|
|
if (nWidth>0 && aItemSize.Width()>0)
|
|
|
|
{
|
|
|
|
aItemSize.Width() += 8;
|
|
|
|
aItemSize.Height() += 8;
|
|
|
|
int nColumnCount = nWidth / aItemSize.Width();
|
|
|
|
if (nColumnCount <= 0)
|
|
|
|
nColumnCount = 1;
|
|
|
|
else if (nColumnCount > 4)
|
|
|
|
nColumnCount = 4;
|
|
|
|
int nRowCount = (GetItemCount() + nColumnCount-1) / nColumnCount;
|
|
|
|
nPreferredHeight = nRowCount * aItemSize.Height();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nPreferredHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sal_Int32 LayoutMenu::GetMinimumWidth (void)
|
|
|
|
{
|
|
|
|
sal_Int32 nMinimumWidth = 0;
|
|
|
|
if (GetItemCount()>0)
|
|
|
|
{
|
|
|
|
Image aImage = GetItemImage(GetItemId(0));
|
|
|
|
Size aItemSize = CalcItemSizePixel (aImage.GetSizePixel());
|
|
|
|
nMinimumWidth = aItemSize.Width();
|
|
|
|
}
|
|
|
|
return nMinimumWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool LayoutMenu::IsResizable (void)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-09 04:19:53 -05:00
|
|
|
void LayoutMenu::UpdateEnabledState (const MasterMode eMode)
|
|
|
|
{
|
|
|
|
bool bIsEnabled (false);
|
|
|
|
|
|
|
|
::boost::shared_ptr<ViewShell> pMainViewShell (mrBase.GetMainViewShell());
|
|
|
|
if (pMainViewShell)
|
|
|
|
{
|
|
|
|
switch (pMainViewShell->GetShellType())
|
|
|
|
{
|
|
|
|
case ViewShell::ST_NONE:
|
|
|
|
case ViewShell::ST_OUTLINE:
|
|
|
|
case ViewShell::ST_PRESENTATION:
|
|
|
|
case ViewShell::ST_TASK_PANE:
|
|
|
|
// The complete task pane is disabled for these values or
|
|
|
|
// not even visible. Disabling the LayoutMenu would be
|
|
|
|
// logical but unnecessary. The main disadvantage is that
|
|
|
|
// after re-enabling it (typically) another panel is
|
|
|
|
// expanded.
|
|
|
|
bIsEnabled = true;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ViewShell::ST_DRAW:
|
|
|
|
case ViewShell::ST_IMPRESS:
|
|
|
|
{
|
|
|
|
switch (eMode)
|
|
|
|
{
|
|
|
|
case MM_UNKNOWN:
|
|
|
|
{
|
|
|
|
::boost::shared_ptr<DrawViewShell> pDrawViewShell (
|
|
|
|
::boost::dynamic_pointer_cast<DrawViewShell>(pMainViewShell));
|
|
|
|
if (pDrawViewShell)
|
|
|
|
bIsEnabled = pDrawViewShell->GetEditMode() != EM_MASTERPAGE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case MM_NORMAL:
|
|
|
|
bIsEnabled = true;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case MM_MASTER:
|
|
|
|
bIsEnabled = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case ViewShell::ST_HANDOUT:
|
|
|
|
case ViewShell::ST_NOTES:
|
|
|
|
case ViewShell::ST_SLIDE_SORTER:
|
|
|
|
default:
|
|
|
|
bIsEnabled = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
TreeNode* pParentNode = GetParentNode();
|
|
|
|
if (pParentNode != NULL)
|
|
|
|
{
|
|
|
|
TitledControl* pGrandParentNode
|
|
|
|
= dynamic_cast<TitledControl*>(pParentNode->GetParentNode());
|
|
|
|
if (pGrandParentNode != NULL)
|
|
|
|
pGrandParentNode->SetEnabledState(bIsEnabled);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 08:33:23 -05:00
|
|
|
::Window* LayoutMenu::GetWindow (void)
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LayoutMenu::Paint (const Rectangle& rRect)
|
|
|
|
{
|
|
|
|
SetBackground (GetSettings().GetStyleSettings().GetWindowColor());
|
|
|
|
|
2005-05-06 03:28:08 -05:00
|
|
|
if (mbSelectionUpdatePending)
|
|
|
|
{
|
|
|
|
mbSelectionUpdatePending = false;
|
|
|
|
UpdateSelection();
|
|
|
|
}
|
2004-07-13 08:33:23 -05:00
|
|
|
ValueSet::Paint (rRect);
|
|
|
|
|
|
|
|
SetBackground (Wallpaper());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LayoutMenu::Resize (void)
|
|
|
|
{
|
|
|
|
Size aWindowSize = GetOutputSizePixel();
|
|
|
|
if (IsVisible() && aWindowSize.Width() > 0)
|
|
|
|
{
|
|
|
|
// Calculate the number of rows and columns.
|
|
|
|
if (GetItemCount() > 0)
|
|
|
|
{
|
|
|
|
Image aImage = GetItemImage(GetItemId(0));
|
|
|
|
Size aItemSize = CalcItemSizePixel (
|
|
|
|
aImage.GetSizePixel());
|
|
|
|
aItemSize.Width() += 8;
|
|
|
|
aItemSize.Height() += 8;
|
|
|
|
int nColumnCount = aWindowSize.Width() / aItemSize.Width();
|
|
|
|
if (nColumnCount < 1)
|
|
|
|
nColumnCount = 1;
|
|
|
|
else if (nColumnCount > 4)
|
|
|
|
nColumnCount = 4;
|
|
|
|
|
|
|
|
int nRowCount = CalculateRowCount (aItemSize, nColumnCount);
|
|
|
|
|
2006-12-12 11:40:07 -06:00
|
|
|
SetColCount ((USHORT)nColumnCount);
|
|
|
|
SetLineCount ((USHORT)nRowCount);
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ValueSet::Resize ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LayoutMenu::MouseButtonDown (const MouseEvent& rEvent)
|
|
|
|
{
|
2005-07-14 04:19:46 -05:00
|
|
|
// As a preparation for the context menu the item under the mouse is
|
|
|
|
// selected.
|
2004-07-13 08:33:23 -05:00
|
|
|
if (rEvent.IsRight())
|
|
|
|
{
|
|
|
|
ReleaseMouse();
|
2005-07-14 04:19:46 -05:00
|
|
|
USHORT nIndex = GetItemId (rEvent.GetPosPixel());
|
|
|
|
if (nIndex > 0)
|
|
|
|
SelectItem(nIndex);
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
2005-07-14 04:19:46 -05:00
|
|
|
|
|
|
|
ValueSet::MouseButtonDown (rEvent);
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LayoutMenu::Execute (SfxRequest& rRequest)
|
|
|
|
{
|
|
|
|
switch (rRequest.GetSlot())
|
|
|
|
{
|
|
|
|
case SID_TP_APPLY_TO_SELECTED_SLIDES:
|
2007-05-10 08:07:44 -05:00
|
|
|
AssignLayoutToSelectedSlides(GetSelectedAutoLayout());
|
2004-07-13 08:33:23 -05:00
|
|
|
rRequest.Done();
|
|
|
|
break;
|
|
|
|
|
2007-05-10 08:07:44 -05:00
|
|
|
case SID_INSERTPAGE_LAYOUT_MENU:
|
|
|
|
// Add arguments to this slot and forward it to the main view
|
|
|
|
// shell.
|
|
|
|
InsertPageWithLayout(GetSelectedAutoLayout());
|
2004-07-13 08:33:23 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-18 09:54:57 -06:00
|
|
|
void LayoutMenu::GetState (SfxItemSet& rItemSet)
|
|
|
|
{
|
2005-07-14 04:19:46 -05:00
|
|
|
// Cut and paste is not supported. The SID_(CUT,COPY,PASTE) entries
|
|
|
|
// therefore must not show up in the context menu.
|
|
|
|
rItemSet.DisableItem (SID_CUT);
|
|
|
|
rItemSet.DisableItem (SID_COPY);
|
|
|
|
rItemSet.DisableItem (SID_PASTE);
|
2008-07-01 17:01:43 -05:00
|
|
|
|
|
|
|
// The SID_INSERTPAGE_LAYOUT_MENU slot depends on the SID_INSERTPAGE
|
|
|
|
// slot being supported elsewhere.
|
|
|
|
const SfxPoolItem* pItem = NULL;
|
|
|
|
const SfxItemState aState (
|
|
|
|
mrBase.GetViewFrame()->GetDispatcher()->QueryState(SID_INSERTPAGE, pItem));
|
|
|
|
if (aState == SFX_ITEM_DISABLED)
|
|
|
|
rItemSet.DisableItem(SID_INSERTPAGE_LAYOUT_MENU);
|
2005-03-18 09:54:57 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 08:33:23 -05:00
|
|
|
void LayoutMenu::InsertPageWithLayout (AutoLayout aLayout)
|
|
|
|
{
|
2007-04-03 10:19:55 -05:00
|
|
|
ViewShell* pViewShell = mrBase.GetMainViewShell().get();
|
2008-07-01 17:01:43 -05:00
|
|
|
if (pViewShell == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
|
|
|
|
if (pViewFrame == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
|
|
|
|
if (pDispatcher == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// Call SID_INSERTPAGE with the right arguments. This is because
|
|
|
|
// the popup menu can not call this slot with arguments directly.
|
|
|
|
SfxRequest aRequest (CreateRequest(SID_INSERTPAGE, aLayout));
|
2008-07-14 03:53:35 -05:00
|
|
|
if (aRequest.GetArgs() != NULL)
|
|
|
|
{
|
|
|
|
pDispatcher->Execute(
|
2007-05-10 08:07:44 -05:00
|
|
|
SID_INSERTPAGE,
|
|
|
|
SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
|
2008-07-14 03:53:35 -05:00
|
|
|
*aRequest.GetArgs());
|
|
|
|
}
|
2008-07-01 17:01:43 -05:00
|
|
|
UpdateSelection();
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-18 09:54:57 -06:00
|
|
|
void LayoutMenu::InvalidateContent (void)
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
2005-03-18 09:54:57 -06:00
|
|
|
// The number of items may have changed. Request a resize so that the
|
|
|
|
// vertical size of this control can be adapted.
|
|
|
|
RequestResize();
|
2005-05-06 03:28:08 -05:00
|
|
|
|
|
|
|
// Throw away the current set and fill the menu anew according to the
|
|
|
|
// current settings (this includes the support for vertical writing.)
|
|
|
|
Fill();
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-12 11:40:07 -06:00
|
|
|
int LayoutMenu::CalculateRowCount (const Size&, int nColumnCount)
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
|
|
|
int nRowCount = 0;
|
|
|
|
|
2005-03-18 09:54:57 -06:00
|
|
|
if (GetItemCount() > 0 && nColumnCount > 0)
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
2005-03-18 09:54:57 -06:00
|
|
|
nRowCount = (GetItemCount() + nColumnCount - 1) / nColumnCount;
|
|
|
|
// nRowCount = GetOutputSizePixel().Height() / rItemSize.Height();
|
2004-07-13 08:33:23 -05:00
|
|
|
if (nRowCount < 1)
|
|
|
|
nRowCount = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nRowCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-12 11:40:07 -06:00
|
|
|
IMPL_LINK(LayoutMenu, ClickHandler, ValueSet*, EMPTYARG)
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
|
|
|
AssignLayoutToSelectedSlides (GetSelectedAutoLayout());
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** The specified layout is assigned to the current page of the view shell
|
|
|
|
in the center pane.
|
|
|
|
*/
|
|
|
|
void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout)
|
|
|
|
{
|
2005-01-25 08:35:07 -06:00
|
|
|
using namespace ::sd::slidesorter;
|
|
|
|
using namespace ::sd::slidesorter::controller;
|
|
|
|
|
2005-01-21 09:35:58 -06:00
|
|
|
do
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
2005-01-21 09:35:58 -06:00
|
|
|
// The view shell in the center pane has to be present.
|
2007-04-03 10:19:55 -05:00
|
|
|
ViewShell* pMainViewShell = mrBase.GetMainViewShell().get();
|
2005-03-23 07:02:41 -06:00
|
|
|
if (pMainViewShell == NULL)
|
2005-01-21 09:35:58 -06:00
|
|
|
break;
|
|
|
|
|
2005-01-25 08:35:07 -06:00
|
|
|
// Determine if the current view is in an invalid master page mode.
|
|
|
|
// The handout view is always in master page mode and therefore not
|
|
|
|
// invalid.
|
|
|
|
bool bMasterPageMode (false);
|
2005-03-23 07:02:41 -06:00
|
|
|
switch (pMainViewShell->GetShellType())
|
2005-01-25 08:35:07 -06:00
|
|
|
{
|
|
|
|
case ViewShell::ST_NOTES:
|
|
|
|
case ViewShell::ST_IMPRESS:
|
|
|
|
{
|
2005-03-23 07:02:41 -06:00
|
|
|
DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell);
|
2005-01-25 08:35:07 -06:00
|
|
|
if (pDrawViewShell != NULL)
|
|
|
|
if (pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
|
|
|
|
bMasterPageMode = true;
|
|
|
|
}
|
2006-12-12 11:40:07 -06:00
|
|
|
default:
|
|
|
|
break;
|
2005-01-25 08:35:07 -06:00
|
|
|
}
|
|
|
|
if (bMasterPageMode)
|
|
|
|
break;
|
|
|
|
|
|
|
|
// Get a list of all selected slides and call the SID_MODIFYPAGE
|
|
|
|
// slot for all of them.
|
2008-04-03 08:46:08 -05:00
|
|
|
::sd::slidesorter::SharedPageSelection pPageSelection;
|
2005-01-25 08:35:07 -06:00
|
|
|
|
2005-03-23 07:02:41 -06:00
|
|
|
// Get a list of selected pages.
|
|
|
|
// First we try to obtain this list from a slide sorter. This is
|
|
|
|
// possible only some of the view shells in the center pane. When
|
|
|
|
// no valid slide sorter is available then ask the main view shell
|
|
|
|
// for its current page.
|
|
|
|
SlideSorterViewShell* pSlideSorter = NULL;
|
|
|
|
switch (pMainViewShell->GetShellType())
|
|
|
|
{
|
|
|
|
case ViewShell::ST_IMPRESS:
|
|
|
|
case ViewShell::ST_NOTES:
|
|
|
|
case ViewShell::ST_SLIDE_SORTER:
|
|
|
|
pSlideSorter = SlideSorterViewShell::GetSlideSorter(mrBase);
|
|
|
|
break;
|
2006-12-12 11:40:07 -06:00
|
|
|
default:
|
|
|
|
break;
|
2005-03-23 07:02:41 -06:00
|
|
|
}
|
2005-01-25 08:35:07 -06:00
|
|
|
if (pSlideSorter != NULL)
|
|
|
|
{
|
|
|
|
// There is a slide sorter visible so get the list of selected pages from it.
|
2008-04-03 08:46:08 -05:00
|
|
|
pPageSelection = pSlideSorter->GetPageSelection();
|
2005-01-25 08:35:07 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-04-03 08:46:08 -05:00
|
|
|
// No valid slide sorter available. Ask the main view shell for
|
|
|
|
// its current page.
|
|
|
|
pPageSelection.reset(new ::sd::slidesorter::SlideSorterViewShell::PageSelection());
|
|
|
|
pPageSelection->push_back(pMainViewShell->GetActualPage());
|
2005-01-25 08:35:07 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-04-03 08:46:08 -05:00
|
|
|
if (pPageSelection->empty())
|
2005-01-25 08:35:07 -06:00
|
|
|
break;
|
|
|
|
|
|
|
|
::std::vector<SdPage*>::iterator iPage;
|
2008-04-03 08:46:08 -05:00
|
|
|
for (iPage=pPageSelection->begin(); iPage!=pPageSelection->end(); ++iPage)
|
2005-01-25 08:35:07 -06:00
|
|
|
{
|
|
|
|
if ((*iPage) == NULL)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
// Call the SID_ASSIGN_LAYOUT slot with all the necessary parameters.
|
|
|
|
SfxRequest aRequest (mrBase.GetViewFrame(), SID_ASSIGN_LAYOUT);
|
|
|
|
aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATPAGE, ((*iPage)->GetPageNum()-1)/2));
|
|
|
|
aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, aLayout));
|
2005-03-23 07:02:41 -06:00
|
|
|
pMainViewShell->ExecuteSlot (aRequest, BOOL(FALSE));
|
2005-01-25 08:35:07 -06:00
|
|
|
}
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
2005-01-21 09:35:58 -06:00
|
|
|
while(false);
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SfxRequest LayoutMenu::CreateRequest (
|
|
|
|
USHORT nSlotId,
|
|
|
|
AutoLayout aLayout)
|
|
|
|
{
|
|
|
|
SfxRequest aRequest (mrBase.GetViewFrame(), nSlotId);
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
SdrLayerAdmin& rLayerAdmin (mrBase.GetDocument()->GetLayerAdmin());
|
|
|
|
BYTE aBackground (rLayerAdmin.GetLayerID(
|
|
|
|
String(SdResId(STR_LAYER_BCKGRND)), FALSE));
|
|
|
|
BYTE aBackgroundObject (rLayerAdmin.GetLayerID(
|
|
|
|
String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE));
|
2007-04-03 10:19:55 -05:00
|
|
|
ViewShell* pViewShell = mrBase.GetMainViewShell().get();
|
2004-07-13 08:33:23 -05:00
|
|
|
if (pViewShell == NULL)
|
|
|
|
break;
|
|
|
|
SdPage* pPage = pViewShell->GetActualPage();
|
|
|
|
if (pPage == NULL)
|
|
|
|
break;
|
|
|
|
|
2004-07-15 03:00:36 -05:00
|
|
|
SetOfByte aVisibleLayers (pPage->TRG_GetMasterPageVisibleLayers());
|
2004-07-13 08:33:23 -05:00
|
|
|
|
|
|
|
aRequest.AppendItem(
|
2005-09-23 05:31:32 -05:00
|
|
|
SfxStringItem (ID_VAL_PAGENAME, String()));//pPage->GetName()));
|
2004-07-13 08:33:23 -05:00
|
|
|
aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, aLayout));
|
|
|
|
aRequest.AppendItem(
|
|
|
|
SfxBoolItem(ID_VAL_ISPAGEBACK, aVisibleLayers.IsSet(aBackground)));
|
|
|
|
aRequest.AppendItem(
|
|
|
|
SfxBoolItem(
|
|
|
|
ID_VAL_ISPAGEOBJ,
|
|
|
|
aVisibleLayers.IsSet(aBackgroundObject)));
|
|
|
|
}
|
|
|
|
while (false);
|
|
|
|
|
|
|
|
return aRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LayoutMenu::Fill (void)
|
|
|
|
{
|
2009-11-03 11:12:19 -06:00
|
|
|
const bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
|
2004-07-13 08:33:23 -05:00
|
|
|
SvtLanguageOptions aLanguageOptions;
|
|
|
|
sal_Bool bVertical = aLanguageOptions.IsVerticalTextEnabled();
|
|
|
|
SdDrawDocument* pDocument = mrBase.GetDocument();
|
|
|
|
sal_Bool bRightToLeft = (pDocument!=NULL
|
|
|
|
&& pDocument->GetDefaultWritingMode() == WritingMode_RL_TB);
|
|
|
|
|
2008-04-03 08:46:08 -05:00
|
|
|
// Get URL of the view in the center pane.
|
2007-04-03 10:19:55 -05:00
|
|
|
::rtl::OUString sCenterPaneViewName;
|
|
|
|
try
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
2007-04-03 10:19:55 -05:00
|
|
|
Reference<XControllerManager> xControllerManager (
|
|
|
|
Reference<XWeak>(&mrBase.GetDrawController()), UNO_QUERY_THROW);
|
2008-04-03 08:46:08 -05:00
|
|
|
Reference<XResourceId> xPaneId (ResourceId::create(
|
CWS-TOOLING: integrate CWS odfmetadata2
2009-06-22 11:48:36 +0200 mst r273206 : - connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx:
+ add "include ustrbuf.hxx" to work around warning caused by
solaris <sys/kstat.h> declaring a global "long l ;"
2009-06-19 14:25:25 +0200 mst r273159 : - scp2/source/ooo/file_library_ooo.scp:
+ fix MinGW build
2009-06-08 12:52:33 +0200 mst r272727 : - redland/raptor-1.4.18.patch.mingw, redland/raptor/makefile.mk:
+ disable parsers that do not build on MinGW (thanks for patch by tono)
2009-05-15 17:31:07 +0200 mst r271957 : fix typos
2009-05-15 17:28:57 +0200 mst r271956 : #i101965#
- offapi/com/sun/star/text/TextPortion:
+ add missing properties:
SoftPageBreak, DocumentIndexMark, ReferenceMark, Footnote, TextField
+ fix read-only status of properties: Bookmark, IsStart, IsCollapsed
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
2009-05-07 14:41:38 +0200 mst r271669 : - sw/inc/{fmtftn.hxx,unocoll.hxx,doc.hxx,editsh.hxx,ftninfo.hxx},
sw/source/core/layout/{flowfrm.cxx,ftnfrm.cxx},
sw/source/core/doc/docftn.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/txtnode/atrftn.cxx, sw/source/core/unocore/unocoll.cxx,
sw/source/ui/fldui/fldref.cxx:
+ fix warning ... the hard way
+ also fix signature of SwDoc::SetCurFtn
2009-05-05 19:52:55 +0200 mst r271556 : - sw/inc/undobj.hxx:
+ make some members const
2009-05-05 19:34:40 +0200 mst r271555 : - sw/inc/rolbck.hxx, sw/source/core/undo/rolbck.cxx:
+ make some members const
2009-05-05 19:13:14 +0200 mst r271553 : - sw/inc/{undobj.hxx,rolbck.hxx},
sw/source/core/undo/{unbkmk.cxx,rolbck.cxx}:
+ fix rebase merge error
+ rename SwHstryBookmark to SwHistoryBookmark
+ clean up SwUndoBookmark
2009-05-05 19:05:53 +0200 mst r271552 : - sw/source/core/unocore/unoportenum.cxx:
+ fix annoying assertion
2009-05-05 15:34:48 +0200 mst r271522 : CWS-TOOLING: rebase CWS odfmetadata2 to trunk@271427 (milestone: DEV300:m47)
2009-05-04 12:37:01 +0200 mst r271444 : trivial
2009-04-22 13:30:37 +0200 mst r271102 : - sfx2/inc/sfx2/dinfdlg.hxx:
+ trivial change
2009-04-21 16:46:58 +0200 mst r271043 : - sw/inc/hintids.hxx:
+ introduce some predicates for the various hints, and use them
2009-04-21 16:19:03 +0200 mst r271041 : - sw/inc/undobj.hxx,
sw/source/core/doc/{docfly.cxx,docfmt.cxx,docftn.cxx,doctxm.cxx},
sw/source/core/undo/{unattr.cxx,unins.cxx}:
+ clean up unattr.cxx:
remove/fix casts, prefix members, use auto_ptr, etc.
2009-04-21 15:34:23 +0200 mst r271039 : - sw/inc/{rolbck.hxx,undobj.hxx},
sw/source/core/doc/docfmt.cxx,
sw/source/core/txtnode/{thints.cxx,txtedt.cxx},
sw/source/core/undo/{rolbck.cxx,undel.cxx,undobj.cxx,unins.cxx,unmove.cxx,
unovwr.cxx,unsect.cxx,unspnd.cxx,untbl.cxx,untblk.cxx,unattr.cxx}:
+ clean up SwHistory, SwRegHistory and SwHistoryHint etc.:
remove/fix casts, prefix members, remove wrong const annotations,
use auto_ptr, remove unused members, etc.
2009-04-20 19:17:36 +0200 mst r271013 : - sw/inc/ndhints.hxx,
sw/source/core/text/{itrtxt.cxx,txtftn.cxx,itratr.cxx,porfly.cxx,
txtfrm.cxx,txtdrop.cxx,frmform.cxx},
sw/source/core/txtnode/{ndtxt.cxx,ndhints.cxx,thints.cxx,txtedt.cxx},
sw/source/core/edit/acorrect.cxx,
sw/source/core/doc/{docedt.cxx,docfmt.cxx},
sw/source/filter/html/swhtml.cxx:
+ clean up SwHintsArray and its subclasses: remove/fix casts, prefix members
2009-04-20 18:42:07 +0200 mst r271007 : - sw/source/core/text/txtio.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/undo/rolbck.cxx:
+ remove JP_NEWCORE dead code
2009-04-20 18:38:09 +0200 mst r271006 : - sw/source/core/unocore/unochart.cxx:
+ silence unxlngi warning (debug=t)
2009-04-20 16:36:13 +0200 mst r270991 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx, sw/source/ui/fldui/flddinf.hxx:
+ trivial cleanups
2009-04-20 15:28:52 +0200 mst r270990 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx:
+ fix bug: replaying a macro with a DocumentInfoItem removes all
user-defined properties
2009-03-10 15:08:20 +0100 mst r269273 : - sfx2/source/doc/Metadatable.cxx:
+ add missing SolarMutex guards
2009-03-10 14:46:29 +0100 mst r269272 : - unoxml/source/rdf/librdf_repository.cxx:
+ never free rdf_world because that would call libxm2 xmlCleanupParser
(and, to add insult to injury, other libxml2 functions later...)
2009-03-06 19:02:44 +0100 mst r269041 : argh! undo...
2009-03-06 19:00:58 +0100 mst r269040 : fix #i99931#
- sw/source/ui/uno/unomod.cxx:
+ SwXViewSettings::_getSingleValue returns uninitialized memory
for the ZoomType property if the value is PAGE_WIDTH_EXACT
2009-03-06 18:59:28 +0100 mst r269039 : - sw/inc/ndtxt.hxx, sw/source/core/txtnode/ndtxt.cxx,
sw/source/core/unocore/unoportenum.cxx:
+ fix some more wntmsci12 warnings...
2009-03-06 18:56:46 +0100 mst r269038 : - sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx:
+ work around spurious warning on unxsoli4 debug=t
2009-03-05 14:02:01 +0100 mst r268902 : - sw/inc/txatbase.hxx:
+ back to c-style casts, they also compile on wntmsci12...
2009-03-05 10:23:25 +0100 mst r268882 : - comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ revert change of return type of comphelper_getProcessComponentContext
to Reference: does not build on wntmsci12
2009-03-04 19:08:09 +0100 mst r268861 : - sw/source/core/txtnode/{atrtox.cxx,ndtxt.cxx}:
+ fix initialization
2009-03-04 14:37:30 +0100 mst r268831 : - solenv/inc/target.mk:
+ fix CLASSPATH so complex tests run (fix by sb)
2009-03-04 14:36:30 +0100 mst r268830 : - sw/inc/unoobj.hxx,
sw/source/core/unocore/{unoparagraph.cxx,unoobj.cxx,unoobj2.cxx}:
+ SwXParaFrameEnumeration constructor now takes SwPaM, not SwUnoCrsr
+ move SwParaSelection into unoparagraph.cxx, as it is only used there
+ bugfix: replace SwUnoCrsrs on stack with SwCursors
2009-03-04 14:34:46 +0100 mst r268829 : - sw/inc/pam.hxx, sw/source/core/crsr/pam.cxx,
sw/source/core/edit/eddel.cxx, sw/source/core/doc/docredln.cxx,
sw/source/core/undo/{untbl.cxx,undel.cxx}, sw/source/filter/rtf/swparrtf.cxx:
+ clean up SwPaM: prefix members
+ new constructor SwPosition(SwCntntNode&, xub_StrLen)
+ fix several broken SwPosition and SwPaM constructors
+ SwPam::DeleteMark now actually resets the unused position to default
2009-03-02 12:07:09 +0100 mst r268646 : - sw/inc/fmtcol.hxx:
+ fix annoying warning (gcc 4)
2009-03-02 12:06:27 +0100 mst r268645 : - odk/util/check.pl, odk/examples/DevelopersGuide/Text/TextDocuments.java:
+ rename module from FieldMaster to fieldmaster
2009-02-27 19:49:56 +0100 mst r268614 : - sfx2/inc/sfx2/Metadatable.hxx, sfx2/prj/d.lst,
sfx2/source/doc/{Metadatable.cxx,makefile.mk},
sw/inc/{SwMetadatable.hxx,unoobj.hxx,undobj.hxx,ndtxt.hxx},
sw/source/core/doc/{SwMetadatable.cxx,makefile.mk,docnew.cxx},
sw/source/core/undo/{untbl.cxx,unins.cxx},
sw/source/core/unocore/unoparagraph.cxx, sw/source/ui/app/docsh.cxx:
+ move Metadatable implementation from sw to sfx2
2009-02-27 17:58:55 +0100 mst r268608 : - sw/inc/{SwMetadatable.hxx,undobj.hxx}, sw/source/core/doc/SwMetadatable.cxx,
sw/source/core/undo/{untbl.cxx,unins.cxx,undel.cxx}:
+ CreateUndo now returns an opaque MetadatableUndo object
2009-02-27 13:15:44 +0100 mst r268587 : - sw/inc/ndtxt.hxx, sw/source/core/doc/docfmt.cxx,
sw/source/core/text/{itratr.cxx,porlay.cxx},
sw/source/core/txtnode/{txtedt.cxx,ndtxt.cxx,thints.cxx}:
+ clean up SwTxtNode: fix casts, prefix members
+ factor out inline function SwTxtNode::TryDeleteSwpHints()
2009-02-27 13:14:30 +0100 mst r268586 : - svx/inc/svx/emphitem.hxx:
+ fix borken header guard
2009-02-27 13:13:56 +0100 mst r268585 : - sfx2/source/bastyp/progress.cxx:
+ fix use of compiler specific macro
2009-02-27 11:00:32 +0100 mst r268564 : - sw/inc/{txatbase.hxx,txtatr.hxx,txtinet.hxx,txtfld.hxx,txtftn.hxx,
txtflcnt.hxx,txttxmrk.hxx,txtrfmrk.hxx},
sw/source/core/txtnode/{atrtox.cxx,atrref.cxx,atrflyin.cxx,atrftn.cxx,
txtatr2.cxx,txatbase.cxx,atrfld.cxx,txtedt.cxx},
sw/source/core/text/atrstck.cxx, sw/source/core/access/acchyperlink.cxx,
sw/source/core/doc/visiturl.cxx, sw/source/ui/wrtsh/wrtsh2.cxx:
+ clean up SwTxtAttr and its subclasses: remove/fix casts, prefix members
+ SwTxtINetFmt: remove unused member bColor
- sw/source/core/text/txtfld.cxx:
+ move SwTxtFld methods to atrfld.cxx
2009-02-27 10:58:44 +0100 mst r268563 : - sfx2/inc/sfx2/sfxbasemodel.hxx:
+ don't privately inherit BaseMutex, ScModelObj wants to access it
2009-02-27 10:58:02 +0100 mst r268562 : - xmloff/source/core/{RDFaExportHelper.cxx,RDFaImportHelper.cxx}:
+ arrrgh!!! someone thought it would be a good idea to have 2 different
versions of boost in external! and they're NOT compatible!!!
insert an ugly fragile hack that maybe works with both...
2009-02-26 17:42:26 +0100 mst r268544 : - comphelper/inc/comphelper/storagehelper.hxx.
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ someone made IsValidZipEntryFileName a static method and didn't tell me
2009-02-26 15:52:56 +0100 mst r268529 : redland: split up patches
2009-02-26 13:17:56 +0100 mst r268509 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
#i95863#
- sw/inc/segdefs{,_}.hxx:
+ remove obsolete files
- sw/source/ui/inc/itemdef.hxx:
+ remove itemdef.hxx
- sw/source/ui/app/[apphdl.cxx,docsh.cxx}, sw/source/ui/misc/glshell.cxx,
sw/source/ui/shells/*.cxx, sw/source/ui/uiview/*.cxx, sw/source/ui/web/*.cxx:
+ use sfx2/msg.hxx instead of itemdef.hxx
- sw/source/core/edit/eddel.cxx:
+ @ JP: SwEditShell::Replace:
you're right, deleting the text to be replaced first, and then inserting
a space, and then replacing that space is unnecessary.
whew, i'm so happy that we finally answered that question after 11 years.
- sw/inc/edimp.hxx:
+ remove FOREACHCURSOR_START, FOREACHCURSOR_END
- sw/inc/{swcrsr.hxx,unocrsr.hxx,viscrs.hxx},
sw/source/core/crsr/{crsrsh.cxx,swcrsr.cxx,trvlreg.cxx,trvltbl.cxx,
unocrsr.cxx,viscrs.cxx},
sw/source/core/doc/{docbm.cxx,doccorr.cxx},
sw/source/core/docnode/{ndtbl.cxx,ndtbl1.cxx},
sw/source/core/edit/editsh.cxx,
sw/source/core/frmedt/{fefly1.cxx,fetab.cxx,tblsel.cxx},
sw/source/core/layout/trvlfrm.cxx,
sw/source/core/unocore/{unochart.cxx,unoobj2.cxx,unoparagraph.cxx,
unoportenum.cxx,unotbl.cxx},
sw/source/core/view/vprint.cxx:
+ remove the hideous virtual operator SwFooCursor*
+ make SwCursor::IsReadOnlyAvailable() virtual
+ make SwUnoCrsr::Clone() virtual
+ refactor SwCursor methods IsSelOver(), LeftRight(), UpDown(), GotoTable():
replace dynamic_cast<...>(this) with new virtual methods
2009-02-26 13:14:58 +0100 mst r268508 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
- sw/source/filter/xml/swxml.cxx:
+ XMLReader::Read: load RDF metadata of the ODF document
- sw/source/filter/xml/wrtxml.cxx:
+ SwXMLWriter::_Write: write RDF metadata of the ODF document if ODF >= 1.2
#i90620#: import xml:id in text tables (does not actually work yet)
- sw/source/filter/xml/xmltbli{.hxx,.cxx}:
+ SwXMLTableCellAttrTokens,aTableCellAttrTokenMap: add XML_TOK_TABLE_XMLID
+ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl: attribute xml:id
+ SwXMLTableCellContext_Impl::CreateChildContext: attribute xml:id
+ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl: attribute xml:id
+ SwXMLTableContext::SwXMLTableContext: attribute xml:id
fix #i98530#
- sw/inc/unoport.hxx, sw/source/core/unocore/unoport.cxx:
+ SwXTextPortion: make constructor params const&
- sw/source/core/unocore/unoportenum.cxx:
+ refactor to remove some code duplication
+ fix bug: paragraph w/out hints: bookmark before frame gets lost
#i97274# handle invalid tables
- sw/source/core/layout/tabfrm.cxx, sw/source/filter/xml/xmltbli.cxx:
+ SwXMLTableContext::MakeTable():
check that the table actually contains cells,
and abort (removing the inserted table nodes) if not
2009-02-26 13:11:48 +0100 mst r268507 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
refactor SwXTextRange and SwXParagraph
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoobj2.cxx:
+ remove 3 constructors of SwXTextRange
+ new method SwXTextRange::CreateParentXText
+ refactor SwXTextRange::CreateTextRangeFromPosition and
SwXTextRange::getText
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph no longer uses a cursor; it registers directly at SwTxtNode
+ replace SwXParagraph::GetCrsr with SwXParagraph::GetTxtNode
- sw/source/core/unocore/unotext.cxx, sw/source/ui/uno/unotxvw.cxx:
+ adapt to new SwXParagraph
#i90620#
- sw/inc/SwMetadatable.hxx,
sw/source/core/doc/SwMetadatable.cxx:
+ new files: base classes sw::Metadatable and sw::MetadatableMixin;
also, 2 implementations of IXmlIdRegistry:
sw::XmlIdRegistryDocument and sw::XmlIdRegistryClipboard
+ setMetadataReference: handle empty stream name as auto-detect
- sw/source/core/doc/makefile.mk:
+ add SwMetadatable
add a XmlIdRegistry to SwDoc
- sw/inc/doc.hxx:
+ SwDoc: add member m_pXmlIdRegistry, method GetXmlIdRegistry()
- sw/source/core/doc/docnew.cxx:
+ initialize XmlIdRegistry in SwDoc::GetXmlIdRegistry, not in constructor,
because the constructor is not told whether the SwDoc is a clipboard
- sw/inc/docsh.hxx, sw/source/ui/app/docsh.cxx:
+ SwDocShell: override GetXmlIdRegistry()
#i91563#: make the SwTxtNode metadatable
- sw/inc/ndtxt.hxx
+ SwTxtNode inherits sw::Metadatable
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph inherits sw::MetadatableMixin
#i91563#: handle SwTxtNode's metadata for delete
- sw/source/core/txtnode/ndtxt.cxx:
+ SwTxtNode::SplitCntntNode: handle XmlId
+ SwTxtNode::JoinNext: merge XmlIds
- sw/source/core/doc/docedt.cxx:
+ lcl_GetJoinFlags: document postcondition
+ SwDoc::Delete: remove XmlId only if SwTxtNode _becomes_ empty
#i91563#: handle SwTxtNode's metadata for delete with undo
- sw/inc/undobj.hxx
+ SwUndoDelete: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
- sw/source/core/undo/undel.cxx:
+ SwUndoDelete::SaveCntnt: save XmlIds for start and end SwTxtNode
+ SwUndoDelete::SaveCntnt: remove XmlId only if SwTxtNode _becomes_ empty
+ SwUndoDelete::Undo: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndcopy.cxx:
+ SwTxtNode::MakeCopy: register copy at XmlIdRegistry
#i91563#: handle SwTxtNode's metadata for find/replace with undo
- sw/source/core/undo/unins.cxx:
+ _UnReplaceData: rename members: add prefix m_
+ _UnReplaceData: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ _UnReplaceData::_UnReplaceData: save XmlIds for start and end SwTxtNode
+ _UnReplaceData::Undo: restore saved XmlIds for start and end SwTxtNode
#i91563#: handle SwTxtNode's metadata for table-to-text with undo
- sw/source/core/undo/untbl.cxx:
+ SwTblToTxtSave: rename members: add prefix m_
+ SwTblToTxtSave: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ SwTblToTxtSave::SwTblToTxtSave: save XmlIds for start and end SwTxtNode
+ SwTblToTxtSave::SwTblToTxtSave, SwNodes::UndoTableToText:
always store the index of the first SwTxtNode in the cell, instead of
the index of the first SwTxtNode in case of the first cell in a row,
and the cell start node in other cases
+ SwNodes::UndoTableToText: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndtbl.cxx:
+ lcl_DelBox: simplify for refactored start index handling in SwTblToTxtSave
2009-02-26 13:02:28 +0100 mst r268505 : migration of cws odfmetadata2 from CVS (resync to m42): module sd
- sd/source/ui/table/tableobjectbar.cxx,sd/source/ui/view/*.cxx:
+ remove invocations of SFX_DECL_TYPE
- sd/source/ui/slideshow/SlideShowRestarter.cxx,
sd/source/ui/toolpanel/LayoutMenu.cxx,
sd/source/ui/unoidl/DrawController.cxx,
sd/source/ui/view/{ViewShellBase.cxx,ViewTabBar.cxx,frmview.cxx}:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
2009-02-26 13:01:24 +0100 mst r268504 : migration of cws odfmetadata2 from CVS (resync to m42): module starmath
- starmath/source/document.cxx:
+ don't touch SfxObjectShell's privates
2009-02-26 13:00:37 +0100 mst r268503 : migration of cws odfmetadata2 from CVS (resync to m42): module sfx2
#i90620#
- sfx2/inc/sfx2/XmlIdRegistry.hxx:
+ new file: interfaces sfx2::IXmlIdRegistry and sfx2::IXmlIdRegistrySupplier
and a couple of utility functions
- sfx2/inc/sfx2/DocumentMetadataAccess.hxx,
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ new class sfx2::DocumentMetadataAccess, implements XDocumentMetadataAccess
+ the URI of the DocumentMetadataAccess is now the URI from which the
document was loaded; for a new document, use a vnd.sun.star.tdoc URI
+ add new function sfx2::createBaseURI()
+ prevent using reserved file names
+ try not to recurse into embedded subdocuments
- sfx2/source/doc/makefile.mk:
+ add DocumentMetadataAccess
- sfx2/util/makefile.mk:
+ link libsfx2 against libxml2 (needed for xmlValidateNCName)
- sfx2/source/doc/makefile.mk:
+ add LIBXML_CFLAGS to CFLAGS
- sfx2/prj/build.lst:
+ add dependence on libxml2
- sfx2/prj/d.lst:
+ add XmlIdRegistry.hxx, DocumentMetadataAccess.hxx
- sfx2/inc/sfx2/objsh.hxx, sfx2/source/doc/objxtor.cxx:
+ make SfxObjectShell's members private
+ new method SfxObjectShell::GetAutoStyleFilterIndex
+ SfxObjectShell inherits sfx2::IXmlIdRegistrySupplier
- sfx2/source/dialog/templdlg.cxx, sfx2/source/doc/sfxbasemodel.cxx:
+ don't touch SfxObjectShell's privates
- sfx2/inc/sfx2/sfxbasemodel.hxx, sfx2/source/doc/sfxbasemodel.cxx:
+ SfxBaseModel inherits BaseMutex instead of IMPL_SfxBaseModel_MutexContainer
+ SfxBaseModel implements additional interface XDocumentMetadataAccess
+ IMPL_SfxBaseModel_DataContainer has new member:
a sfx2::DocumentMetadataAccess
+ implementation of XDocumentMetadataAccess forwards to
the sfx2::DocumentMetadataAccess member
- sfx2/qa/complex/DocumentMetadataAccessTest.java,
sfx2/qa/complex/{tests.sce,makefile.mk},
sfx2/qa/complex/testdocuments/TESTRDFA.odt:
+ add complex test: DocumentMetadataAccessTest
+ add RDFa test document
#i95863#
- sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx:
+ refactor SfxDocumentItem so it no longer requires a XDocumentInfo
+ move struct CustomProperty to implementation file
+ remove class SfxDocumentUserPage
+ QueryValue,PutValue: remove MID_DOCINFO_FIELD*
- sfx2/source/doc/objserv.cxx:
+ adapt to SfxDocumentItem change
- sfx2/inc/sfx2/sfx.hrc, sfx2/sdi/sfxslots.sdi, sfx2/inc/sfx2/msg.hxx:
+ remove MID_DOCINFO_FIELD*
+ put all invocations of SFX_DECL_TYPE in msg.hxx, and undef SFX_DECL_TYPE
- sfx2/source/doc/objxtor.cxx:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
- sfx2/source/doc/docfile.cxx:
+ SfxMedium::SfxMedium: don't dereference NULL, throw exception instead
- sfx2/source/doc/objstor.cxx:
+ SfxObjectShell::DoLoad: fix bug: DocumentBaseURI is not initialized
2009-02-26 12:58:07 +0100 mst r268502 : migration of cws odfmetadata2 from CVS (resync to m42): module xmloff
#i90620#: implement RDFa import (interface change)
- xmloff/inc/xmloff/xmlimp.hxx. xmloff/source/core/xmlimp.cxx:
+ make SvXMLImport::GetAbsoluteReference() const
+ add SvXMLImport::GetComponentContext()
+ SvXMLImport::_InitCtor(): add RDFa namespace
+ add SvXMLImport::AddRDFa()
+ SvXMLImport::endDocument() inserts RDFa into document repository
- xmloff/inc/xmloff/xmltoken.hxx, xmloff/source/core/xmltoken.cxx:
+ new tokens for RDFa: XML_ABOUT, XML_DATATYPE
- xmloff/inc/RDFaImportHelper.hxx, xmloff/source/core/RDFaImportHelper.cxx:
+ new class RDFaImportHelper
+ adapt the code to the bleak reality of broken C++ implementations
+ handle empty xhtml:about attributes properly, which are actually
valid relative URIs
+ work around broken SvXMLImport::GetAbsoluteReference
- xmloff/source/core/makefile.mk:
+ add RDFaImportHelper.cxx
#i90620#: implement RDFa export
- xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ add SvXMLExport::EnsureNamespace(), and a stack of namespace maps
+ add SvXMLExport::GetComponentContext()
+ add SvXMLExport::AddAttributesRDFa()
- xmloff/inc/RDFaExportHelper.hxx, xmloff/source/core/RDFaExportHelper.cxx:
+ new class RDFaExportHelper
+ don't use std::map::data_type, which is actually called
std::map::mapped_type by libstdc++
- xmloff/source/core/makefile.mk:
+ add RDFaExportHelper.cxx
#i91563#
- xmloff/inc/xmloff/txtimp.hxx, xmloff/source/text/txtimp.cxx:
+ XMLTextPAttrTokens: add RDFa tokens
- xmloff/source/text/txtparai{.hxx,.cxx}:
+ import RDFa for text:p
- xmloff/source/text/txtparae.cxx:
+ export RDFa for text:p
interface change: use XHTML namespace instead of RDFA
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlimp.cxx,xmlexp.cxx,RDFaExportHelper.cxx},
xmloff/source/text/txtimp.cxx:
+ use XHTML namespace instead of RDFA
#i91565#, #i91566#: (preliminary) import for text:meta, text:meta-field
- xmloff/source/text/txtparai.cxx:
+ new class XMLMetaImportContextBase with subclasses to import
text:meta and text:meta-field
- xmloff/source/text/XMLTextMarkImportContext.cxx:
+ change XMLTextMarkImportContext::CreateAndInsertMark to handle marks
with no name (text:meta)
#i91565#, #i91566#: (preliminary) export for text:meta, text:meta-field
- xmloff/inc/txtflde.hxx, xmloff/source/text/txtflde.cxx:
+ add FIELD_ID_META to FieldIdEnum
+ new method XMLTextFieldExport::ExportMetaField()
+ change XMLTextFieldExport::ExportField{,AutoStyle,Helper}
to take additional parameter for progress bar
- xmloff/inc/xmloff/txtparae.hxx, xmloff/source/text/txtparae.cxx:
+ make XMLTextParagraphExport::exportTextRangeEnumeration() public
+ new method XMLTextParagraphExport::exportMeta()
#i90620#
- xmloff/inc/xmloff/xmlimp.hxx, xmloff/source/core/xmlimp.cxx,
xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ rename SvXML{Im,Ex}port::GetStreamPath() to GetStreamName()
+ fix xml:id {im,ex}port for embedded documents and non-packages
+ adapt to API change: XMetadatable
#i90620# GRDDL
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlexp.cxx}:
+ add GRDDL namespace
+ add token XML_TRANSFORMATION
+ add grddl:transformation attribute to root elements for meta.xml,
content.xml and styles.xml
2009-02-26 12:54:40 +0100 mst r268501 : migration of cws odfmetadata2 from CVS (resync to m42): module unoxml
#i90620#
- unoxml/source/rdf/librdf_repository.cxx:
+ librdf_Repository::importGraph: allocate buffer sized length of stream
+ switch from one librdf_world per repository to a single static world
because redland has global variables with a brain-damaged life-cycle...
+ exportGraph: use new raptor 1.4.18 feature to disable writing
an xml:base attribute in RDF/XML files
- unoxml/source/rdf/librdf_repository.cxx:
unoxml/qa/complex/RDFRepositoryTest.java:
+ adapt to predicate is URI change
+ adapt to RDFa API change
+ adapt to API change: RDFa has multiple predicates...
+ adapt to API change: XMetadatable derives from XURI
+ allow xhtml:datatype without xhtml:content
+ adapt to API change: attribute MetadataReference is StringPair
- unoxml/source/rdf/CURI.cxx:
+ add some more URI constants
2009-02-26 12:53:32 +0100 mst r268500 : migration of cws odfmetadata2 from CVS (resync to m42): module package
- package/inc/ImplValidCharacters.hxx:
+ remove (moved to comphelper)
2009-02-26 12:52:49 +0100 mst r268499 : migration of cws odfmetadata2 from CVS (resync to m42): module comphelper
- comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ add getProcessComponentContext()
+ change return type of comphelper_getProcessComponentContext to Reference
- comphelper/inc/comphelper/stl_types.hxx:
+ add OUStringBufferAppender
+ add algorithm intersperse
- comphelper/source/misc/string.cxx:
+ rewrite convertCommaSeparated with intersperse and OUStringBufferAppender
- comphelper/inc/comphelper/stlunosequence.hxx:
+ fix bug: begin() on empty sequence != end()
2009-02-26 12:50:47 +0100 mst r268498 : migration of cws odfmetadata2 from CVS (resync to m42): module offapi
#i96209#
- offapi/com/sun/star/text/fieldmaster/*.idl:
+ rename module from FieldMaster to fieldmaster
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
#i90620#
- offapi/com/sun/star/rdf/{XMetadatable.idl,XDocumentMetadataAccess.idl}:
+ API change: XMetadatable derives from XURI
+ API change: replace XmlId (string) with MetadataReference (StringPair)
- offapi/com/sun/star/rdf/{Statement.idl,XDocumentRepository.idl,
XNamedGraph.idl,XRepository.idl}:
+ the predicate of a statement is a URI, not a Resource
- offapi/com/sun/star/rdf/XDocumentMetadataAccess.idl:
+ rename: s/Package/Document/
+ remove uuid
+ remove everything related to mapping
+ graph names are now generated from base URI and file names
+ load methods: improve error handling with XInteractionHandler
- offapi/com/sun/star/rdf/XDocumentRepository.idl:
+ change: RDFa permits using multiple predicates in one attribute
+ setStatementRDFa: subject is now XResource, object is now XMetadatable
- offapi/com/sun/star/rdf/URIs.idl:
+ add some more URI constants
- offapi/com/sun/star/rdf:
+ fix @since tags and replace <method> with <member>
2009-02-26 12:47:24 +0100 mst r268497 : migration of cws odfmetadata2 from CVS (resync to m42): module redland
fix #i93768#
- redland/raptor-1.4.17.patch, redland/raptor/makefile.mk:
+ disable GRDDL parser to prevent call to libxslt
xsltSetDefaultSecurityPrefs, which breaks xmlhelp
- redland/raptor/makefile.mk, redland/raptor-1.4.17.patch,
redland/raptor-1.4.18.patch:
+ upgrade raptor to 1.4.18
+ deactivate serializer for RSS/Atom (does not build)
- redland/rasqal/makefile.mk, redland/rasqal-0.9.15.patch,
redland/rasqal-0.9.16.patch,
+ upgrade rasqal to 0.9.16
- redland/redland/makefile.mk, redland/redland-1.0.7.patch,
redland/redland-1.0.8.patch:
+ upgrade redland to 1.0.8
- redland/redlandversion.mk:
+ the librasqal SONAME has changed
2009-07-02 04:05:03 -05:00
|
|
|
::comphelper::getProcessComponentContext(),
|
2008-04-03 08:46:08 -05:00
|
|
|
FrameworkHelper::msCenterPaneURL));
|
|
|
|
Reference<XView> xView (FrameworkHelper::Instance(mrBase)->GetView(xPaneId));
|
|
|
|
if (xView.is())
|
|
|
|
sCenterPaneViewName = xView->getResourceId()->getResourceURL();
|
2007-04-03 10:19:55 -05:00
|
|
|
}
|
|
|
|
catch (RuntimeException&)
|
|
|
|
{}
|
2004-07-13 08:33:23 -05:00
|
|
|
|
2007-04-03 10:19:55 -05:00
|
|
|
snewfoil_value_info* pInfo = NULL;
|
|
|
|
if (sCenterPaneViewName.equals(framework::FrameworkHelper::msNotesViewURL))
|
|
|
|
{
|
|
|
|
pInfo = notes;
|
|
|
|
}
|
|
|
|
else if (sCenterPaneViewName.equals(framework::FrameworkHelper::msHandoutViewURL))
|
|
|
|
{
|
|
|
|
pInfo = handout;
|
|
|
|
}
|
|
|
|
else if (sCenterPaneViewName.equals(framework::FrameworkHelper::msImpressViewURL)
|
|
|
|
|| sCenterPaneViewName.equals(framework::FrameworkHelper::msSlideSorterURL))
|
|
|
|
{
|
|
|
|
pInfo = standard;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pInfo = NULL;
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
Clear();
|
2005-03-18 09:54:57 -06:00
|
|
|
int n = 0;
|
2004-07-13 08:33:23 -05:00
|
|
|
for (sal_uInt16 i=1; pInfo!=NULL&&pInfo->mnBmpResId!=0; i++,pInfo++)
|
|
|
|
{
|
|
|
|
if ((WritingMode_TB_RL != pInfo->meWritingMode) || bVertical)
|
|
|
|
{
|
2009-01-21 08:22:27 -06:00
|
|
|
BitmapEx aBmp (SdResId (bHighContrast
|
2004-07-13 08:33:23 -05:00
|
|
|
? pInfo->mnHCBmpResId
|
|
|
|
: pInfo->mnBmpResId));
|
|
|
|
|
|
|
|
if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
|
|
|
|
aBmp.Mirror (BMP_MIRROR_HORZ);
|
|
|
|
|
|
|
|
InsertItem (i, aBmp, String (SdResId (pInfo->mnStrResId)));
|
|
|
|
SetItemData (i, new AutoLayout(pInfo->maAutoLayout));
|
2005-03-18 09:54:57 -06:00
|
|
|
n++;
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
}
|
2005-05-06 03:28:08 -05:00
|
|
|
|
|
|
|
mbSelectionUpdatePending = true;
|
2004-07-13 08:33:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LayoutMenu::Clear (void)
|
|
|
|
{
|
|
|
|
for (USHORT nId=1; nId<=GetItemCount(); nId++)
|
|
|
|
delete static_cast<AutoLayout*>(GetItemData(nId));
|
|
|
|
ValueSet::Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-12 11:40:07 -06:00
|
|
|
void LayoutMenu::StartDrag (sal_Int8 , const Point& )
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-12 11:40:07 -06:00
|
|
|
sal_Int8 LayoutMenu::AcceptDrop (const AcceptDropEvent& )
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-12 11:40:07 -06:00
|
|
|
sal_Int8 LayoutMenu::ExecuteDrop (const ExecuteDropEvent& )
|
2004-07-13 08:33:23 -05:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-03-18 09:54:57 -06:00
|
|
|
|
2005-07-14 04:19:46 -05:00
|
|
|
void LayoutMenu::Command (const CommandEvent& rEvent)
|
|
|
|
{
|
|
|
|
switch (rEvent.GetCommand())
|
|
|
|
{
|
|
|
|
case COMMAND_CONTEXTMENU:
|
|
|
|
if ( ! SD_MOD()->GetWaterCan())
|
|
|
|
{
|
|
|
|
if (GetShellManager() != NULL)
|
|
|
|
GetShellManager()->MoveToTop(this);
|
|
|
|
if (rEvent.IsMouseEvent())
|
2009-10-27 10:01:25 -05:00
|
|
|
{
|
|
|
|
// Do not show the context menu when the mouse was not
|
|
|
|
// pressed over an item.
|
|
|
|
if (GetItemId(rEvent.GetMousePosPixel()) > 0)
|
|
|
|
mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
|
|
|
|
SdResId(RID_TASKPANE_LAYOUTMENU_POPUP));
|
|
|
|
}
|
2005-07-14 04:19:46 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// When the command event was not caused by a mouse
|
|
|
|
// event (for example a key press instead) then show the
|
|
|
|
// popup menu at the center of the current item.
|
2006-12-12 11:40:07 -06:00
|
|
|
if (GetSelectItemId() != (USHORT)-1)
|
2005-07-14 04:19:46 -05:00
|
|
|
{
|
|
|
|
Rectangle aBBox (GetItemRect(GetSelectItemId()));
|
|
|
|
Point aPosition (aBBox.Center());
|
|
|
|
mrBase.GetViewFrame()->GetDispatcher()->ExecutePopup(
|
|
|
|
SdResId(RID_TASKPANE_LAYOUTMENU_POPUP),
|
|
|
|
this,
|
|
|
|
&aPosition);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
ValueSet::Command(rEvent);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-12 11:40:07 -06:00
|
|
|
IMPL_LINK(LayoutMenu, StateChangeHandler, ::rtl::OUString*, EMPTYARG)
|
2005-03-18 09:54:57 -06:00
|
|
|
{
|
|
|
|
InvalidateContent();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-05-06 03:28:08 -05:00
|
|
|
|
|
|
|
void LayoutMenu::UpdateSelection (void)
|
|
|
|
{
|
|
|
|
bool bItemSelected = false;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
// Get current page of main view.
|
2007-04-03 10:19:55 -05:00
|
|
|
ViewShell* pViewShell = mrBase.GetMainViewShell().get();
|
2005-05-06 03:28:08 -05:00
|
|
|
if (pViewShell == NULL)
|
|
|
|
break;
|
|
|
|
|
|
|
|
SdPage* pCurrentPage = pViewShell->getCurrentPage();
|
|
|
|
if (pCurrentPage == NULL)
|
|
|
|
break;
|
|
|
|
|
|
|
|
// Get layout of current page.
|
|
|
|
AutoLayout aLayout (pCurrentPage->GetAutoLayout());
|
|
|
|
if (aLayout<AUTOLAYOUT__START || aLayout>AUTOLAYOUT__END)
|
|
|
|
break;
|
|
|
|
|
|
|
|
// Find the entry of the menu for to the layout.
|
|
|
|
USHORT nItemCount (GetItemCount());
|
|
|
|
for (USHORT nId=1; nId<=nItemCount; nId++)
|
2009-09-09 04:19:53 -05:00
|
|
|
{
|
2005-05-06 03:28:08 -05:00
|
|
|
if (*static_cast<AutoLayout*>(GetItemData(nId)) == aLayout)
|
|
|
|
{
|
|
|
|
SelectItem(nId);
|
|
|
|
bItemSelected = true;
|
|
|
|
break;
|
|
|
|
}
|
2009-09-09 04:19:53 -05:00
|
|
|
}
|
2005-05-06 03:28:08 -05:00
|
|
|
}
|
|
|
|
while (false);
|
|
|
|
|
|
|
|
if ( ! bItemSelected)
|
|
|
|
SetNoSelection();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPL_LINK(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiplexerEvent*, pEvent)
|
|
|
|
{
|
|
|
|
switch (pEvent->meEventId)
|
|
|
|
{
|
|
|
|
case ::sd::tools::EventMultiplexerEvent::EID_CURRENT_PAGE:
|
|
|
|
case ::sd::tools::EventMultiplexerEvent::EID_SLIDE_SORTER_SELECTION:
|
|
|
|
if ( ! mbSelectionUpdatePending)
|
|
|
|
UpdateSelection();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_ADDED:
|
2008-04-03 08:46:08 -05:00
|
|
|
mbIsMainViewChangePending = true;
|
2009-09-09 04:19:53 -05:00
|
|
|
UpdateEnabledState(MM_UNKNOWN);
|
2005-05-06 03:28:08 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ::sd::tools::EventMultiplexerEvent::EID_MAIN_VIEW_REMOVED:
|
|
|
|
HideFocus();
|
|
|
|
break;
|
|
|
|
|
2008-04-03 08:46:08 -05:00
|
|
|
case ::sd::tools::EventMultiplexerEvent::EID_CONFIGURATION_UPDATED:
|
|
|
|
if (mbIsMainViewChangePending)
|
|
|
|
{
|
|
|
|
mbIsMainViewChangePending = false;
|
|
|
|
InvalidateContent();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-09-09 04:19:53 -05:00
|
|
|
case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_NORMAL:
|
|
|
|
UpdateEnabledState(MM_NORMAL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ::sd::tools::EventMultiplexerEvent::EID_EDIT_MODE_MASTER:
|
|
|
|
UpdateEnabledState(MM_MASTER);
|
|
|
|
break;
|
|
|
|
|
2005-05-06 03:28:08 -05:00
|
|
|
default:
|
|
|
|
/* Ignored */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-04-28 08:59:23 -05:00
|
|
|
void LayoutMenu::DataChanged (const DataChangedEvent& rEvent)
|
|
|
|
{
|
|
|
|
Fill();
|
|
|
|
ValueSet::DataChanged(rEvent);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-07-13 08:33:23 -05:00
|
|
|
} } // end of namespace ::sd::toolpanel
|