2000-09-18 23:16:46 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
2005-09-09 02:11:36 +00:00
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:11:36 +00:00
|
|
|
|
* $RCSfile: drawdoc4.cxx,v $
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2007-05-10 14:22:32 +00:00
|
|
|
|
* $Revision: 1.53 $
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2007-05-10 14:22:32 +00:00
|
|
|
|
* last change: $Author: kz $ $Date: 2007-05-10 15:22:32 $
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:11:36 +00:00
|
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
|
|
|
|
*
|
2005-09-09 02:11:36 +00:00
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
|
* =============================================
|
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:11:36 +00:00
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:11:36 +00:00
|
|
|
|
* This library 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 for more details.
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
2005-09-09 02:11:36 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 23:16:46 +00:00
|
|
|
|
*
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
2006-09-16 17:14:49 +00:00
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
|
2002-08-01 10:30:12 +00:00
|
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
|
#include <sfx2/docfile.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#ifndef _SFXDISPATCH_HXX //autogen
|
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
|
#endif
|
2004-01-20 09:27:03 +00:00
|
|
|
|
#ifndef SD_OUTLINER_HXX
|
|
|
|
|
#include "Outliner.hxx"
|
|
|
|
|
#endif
|
2000-11-17 09:56:37 +00:00
|
|
|
|
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
|
|
|
|
|
#include <comphelper/processfactory.hxx>
|
2006-12-12 15:32:15 +00:00
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#ifndef _OUTLINER_HXX //autogen wg. Outliner
|
|
|
|
|
#include <svx/outliner.hxx>
|
|
|
|
|
#endif
|
2004-01-20 09:27:03 +00:00
|
|
|
|
#ifndef SD_DRAW_DOC_SHELL_HXX
|
2001-09-04 10:38:51 +00:00
|
|
|
|
#ifdef MAC
|
2004-01-20 09:27:03 +00:00
|
|
|
|
#include "::ui:inc:DrawDocShell.hxx"
|
2001-09-04 10:38:51 +00:00
|
|
|
|
#else
|
|
|
|
|
#ifdef UNX
|
2004-01-20 09:27:03 +00:00
|
|
|
|
#include "../ui/inc/DrawDocShell.hxx"
|
2001-09-04 10:38:51 +00:00
|
|
|
|
#else
|
2004-01-20 09:27:03 +00:00
|
|
|
|
#include "..\ui\inc\DrawDocShell.hxx"
|
|
|
|
|
#endif
|
2001-09-04 10:38:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
#ifndef _EEITEM_HXX //autogen
|
|
|
|
|
#include <svx/eeitem.hxx>
|
|
|
|
|
#endif
|
2006-05-02 14:01:31 +00:00
|
|
|
|
#include <vcl/svapp.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#include <eetext.hxx>
|
|
|
|
|
|
2006-12-19 11:57:00 +00:00
|
|
|
|
#include <svx/akrnitem.hxx>
|
|
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#include <svx/svxids.hrc>
|
2006-08-29 13:18:07 +00:00
|
|
|
|
#ifndef _SFX_SRCHITEM_HXX
|
|
|
|
|
#include <sfx2/srchitem.hxx>
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#include <svx/lrspitem.hxx>
|
|
|
|
|
#include <svx/ulspitem.hxx>
|
|
|
|
|
#include <svx/lspcitem.hxx>
|
|
|
|
|
#include <svx/adjitem.hxx>
|
|
|
|
|
#include <svx/dialogs.hrc>
|
|
|
|
|
#include <svx/dialmgr.hxx> // SVX_RESSTR
|
|
|
|
|
#include <svx/bulitem.hxx>
|
|
|
|
|
#include <svx/xtable.hxx>
|
2006-12-12 14:52:14 +00:00
|
|
|
|
#include <svx/sxmsuitm.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#ifndef _SVX_XIT_HXX //autogen
|
|
|
|
|
#include <svx/xit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XLINEIT0_HXX //autogen
|
|
|
|
|
#include <svx/xlineit0.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SDSHITM_HXX //autogen
|
|
|
|
|
#include <svx/sdshitm.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVDOTEXT_HXX //autogen
|
|
|
|
|
#include <svx/svdotext.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef SVX_XFILLIT0_HXX //autogen
|
|
|
|
|
#include <svx/xfillit0.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SDSHCITM_HXX //autogen
|
|
|
|
|
#include <svx/sdshcitm.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _EDITSTAT_HXX //autogen
|
|
|
|
|
#include <svx/editstat.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_COLRITEM_HXX //autogen
|
|
|
|
|
#include <svx/colritem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_FHGTITEM_HXX //autogen
|
|
|
|
|
#include <svx/fhgtitem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_WGHTITEM_HXX //autogen
|
|
|
|
|
#include <svx/wghtitem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_POSTITEM_HXX //autogen
|
|
|
|
|
#include <svx/postitem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_CRSDITEM_HXX //autogen
|
|
|
|
|
#include <svx/crsditem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_UDLNITEM_HXX //autogen
|
|
|
|
|
#include <svx/udlnitem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_ITEM_HXX //autogen
|
|
|
|
|
#include <svx/cntritem.hxx>
|
|
|
|
|
#endif
|
2001-05-16 07:15:59 +00:00
|
|
|
|
#ifndef _SVX_EMPHITEM_HXX
|
|
|
|
|
#include <svx/emphitem.hxx>
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#ifndef _SVX_FONTITEM_HXX //autogen
|
|
|
|
|
#include <svx/fontitem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_SHDDITEM_HXX //autogen
|
|
|
|
|
#include <svx/shdditem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XBTMPIT_HXX //autogen
|
|
|
|
|
#include <svx/xbtmpit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XFLHTIT_HXX //autogen
|
|
|
|
|
#include <svx/xflhtit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XFLGRIT_HXX //autogen
|
|
|
|
|
#include <svx/xflgrit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XFLCLIT_HXX //autogen
|
|
|
|
|
#include <svx/xflclit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XLNEDCIT_HXX //autogen
|
|
|
|
|
#include <svx/xlnedcit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XLNSTCIT_HXX //autogen
|
|
|
|
|
#include <svx/xlnstcit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XLNEDWIT_HXX //autogen
|
|
|
|
|
#include <svx/xlnedwit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XLNSTWIT_HXX //autogen
|
|
|
|
|
#include <svx/xlnstwit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XLNEDIT_HXX //autogen
|
|
|
|
|
#include <svx/xlnedit.hxx>
|
|
|
|
|
#endif
|
2001-05-16 07:15:59 +00:00
|
|
|
|
#ifndef _SVX_CHARRELIEFITEM_HXX
|
|
|
|
|
#include <svx/charreliefitem.hxx>
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#ifndef _SVX_XLNSTIT_HXX //autogen
|
|
|
|
|
#include <svx/xlnstit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XLNDSIT_HXX //autogen
|
|
|
|
|
#include <svx/xlndsit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XLNWTIT_HXX //autogen
|
|
|
|
|
#include <svx/xlnwtit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_XLNCLIT_HXX //autogen
|
|
|
|
|
#include <svx/xlnclit.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVDITER_HXX //autogen
|
|
|
|
|
#include <svx/svditer.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVDOGRP_HXX //autogen
|
|
|
|
|
#include <svx/svdogrp.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SHL_HXX //autogen
|
|
|
|
|
#include <tools/shl.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_NUMITEM_HXX
|
|
|
|
|
#include <svx/numitem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _MyEDITENG_HXX //autogen
|
|
|
|
|
#include <svx/editeng.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _UNO_LINGU_HXX
|
|
|
|
|
#include <svx/unolingu.hxx>
|
|
|
|
|
#endif
|
2000-10-25 09:34:04 +00:00
|
|
|
|
#ifndef _COM_SUN_STAR_LINGUISTIC2_XHYPHENATOR_HPP_
|
|
|
|
|
#include <com/sun/star/linguistic2/XHyphenator.hpp>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
|
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
2000-09-18 23:16:46 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SFXITEMPOOL_HXX
|
|
|
|
|
#include <svtools/itempool.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _OUTLOBJ_HXX
|
|
|
|
|
#include <svx/outlobj.hxx>
|
|
|
|
|
#endif
|
2000-09-21 15:12:50 +00:00
|
|
|
|
#ifndef _SFXVIEWFRM_HXX
|
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
|
#endif
|
2000-11-16 12:55:39 +00:00
|
|
|
|
#ifndef _SVX_LANGITEM_HXX
|
|
|
|
|
#include <svx/langitem.hxx>
|
|
|
|
|
#endif
|
2002-08-15 06:25:49 +00:00
|
|
|
|
#ifndef _SVX_FRMDIRITEM_HXX
|
|
|
|
|
#include <svx/frmdiritem.hxx>
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
#include "sdresid.hxx"
|
|
|
|
|
#include "drawdoc.hxx"
|
|
|
|
|
#include "sdpage.hxx"
|
|
|
|
|
#include "glob.hrc"
|
|
|
|
|
#include "glob.hxx"
|
|
|
|
|
#include "stlpool.hxx"
|
|
|
|
|
#include "helpids.h"
|
|
|
|
|
#include "sdiocmpt.hxx"
|
2006-11-01 13:14:43 +00:00
|
|
|
|
#ifndef _SHAPELIST_HXX
|
|
|
|
|
#include "shapelist.hxx"
|
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-11-14 13:21:38 +00:00
|
|
|
|
#ifndef _BGFX_POINT_B2DPOINT_HXX
|
|
|
|
|
#include <basegfx/point/b2dpoint.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef _BGFX_POLYGON_B2DPOLYGON_HXX
|
|
|
|
|
#include <basegfx/polygon/b2dpolygon.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-12-14 15:51:54 +00:00
|
|
|
|
using ::rtl::OUString;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
using namespace ::com::sun::star;
|
2000-10-25 09:34:04 +00:00
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
|
using namespace ::com::sun::star::linguistic2;
|
2005-05-03 13:02:34 +00:00
|
|
|
|
using namespace ::sd;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* CreateLayoutTemplates, Layoutvorlagen erzeugen
|
|
|
|
|
|*
|
|
|
|
|
|* Z.Zt. (31.03.95) speichert der StyleSheetPool nur diejenigen Sheets, die
|
|
|
|
|
|* ein ItemSet haben. Damit alle Sheets gespeichert werden, wird die ItemSet-
|
|
|
|
|
|* Erzeugung mit einem GetItemSet-Aufruf erzwungen.
|
|
|
|
|
|* Dies kann entfallen, sobald der Pool auch Sheets ohne ItemSet speichert.
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdDrawDocument::CreateLayoutTemplates()
|
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
SdStyleSheetPool* pSSPool = (SdStyleSheetPool*)GetStyleSheetPool();
|
2002-08-01 10:30:12 +00:00
|
|
|
|
SfxStyleSheetBase* pSheet = NULL;
|
|
|
|
|
String aHelpFile;
|
|
|
|
|
String aStdName = String(SdResId(STR_STANDARD_STYLESHEET_NAME));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
// ---- Standardvorlage -----------------------------------------------
|
|
|
|
|
|
|
|
|
|
// nicht benutzt, nicht benutzerdefiniert
|
|
|
|
|
// SB hatte wahrscheinlich Probleme mit SFXSTYLEBIT_AUTO, da dann gar nichts
|
|
|
|
|
// mehr im Gestalter angezeigt wird. Dieses Problem ist zu 364 j behoben worden
|
|
|
|
|
// USHORT nMask = SFXSTYLEBIT_ALL & ~(SFXSTYLEBIT_USED | SFXSTYLEBIT_USERDEF);
|
|
|
|
|
USHORT nMask = SFXSTYLEBIT_AUTO;
|
|
|
|
|
|
|
|
|
|
String aName(aStdName);
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_STANDARD_STYLESHEET_NAME );
|
|
|
|
|
SfxItemSet& rISet = pSheet->GetItemSet();
|
2000-10-12 10:45:25 +00:00
|
|
|
|
SfxItemPool* pPool = rISet.GetPool();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
String aNullStr;
|
|
|
|
|
|
2006-11-14 13:21:38 +00:00
|
|
|
|
::basegfx::B2DPolyPolygon aNullPolyPolygon;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
Color aNullCol(RGB_Color(COL_BLACK));
|
|
|
|
|
|
|
|
|
|
XDash aNullDash;
|
|
|
|
|
XGradient aNullGrad(aNullCol,RGB_Color(COL_WHITE));
|
|
|
|
|
aNullGrad.SetStartIntens( 100 );
|
|
|
|
|
aNullGrad.SetEndIntens( 100 );
|
|
|
|
|
XHatch aNullHatch(aNullCol);
|
|
|
|
|
|
|
|
|
|
// Linienattribute (Extended OutputDevice)
|
|
|
|
|
rISet.Put(XLineStyleItem(XLINE_SOLID));
|
|
|
|
|
rISet.Put(XLineColorItem(String(), RGB_Color(COL_BLACK)));
|
|
|
|
|
rISet.Put(XLineWidthItem(0));
|
2000-10-12 10:45:25 +00:00
|
|
|
|
rISet.Put(XLineDashItem(pPool,aNullDash));
|
2006-11-14 13:21:38 +00:00
|
|
|
|
rISet.Put(XLineStartItem(pPool,aNullPolyPolygon));
|
|
|
|
|
rISet.Put(XLineEndItem(pPool,aNullPolyPolygon));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
rISet.Put(XLineStartWidthItem(300));
|
|
|
|
|
rISet.Put(XLineEndWidthItem(300));
|
|
|
|
|
rISet.Put(XLineStartCenterItem());
|
|
|
|
|
rISet.Put(XLineEndCenterItem());
|
|
|
|
|
|
|
|
|
|
// Fuellattribute (Extended OutputDevice)
|
|
|
|
|
rISet.Put(XFillStyleItem(XFILL_SOLID));
|
2005-01-28 14:37:54 +00:00
|
|
|
|
rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING))); // "Blue 8"
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2000-10-12 10:45:25 +00:00
|
|
|
|
rISet.Put(XFillGradientItem(pPool,aNullGrad));
|
|
|
|
|
rISet.Put(XFillHatchItem(pPool,aNullHatch));
|
2002-07-18 12:04:59 +00:00
|
|
|
|
Size aNullSize( 32, 32 );
|
|
|
|
|
Color aNullColor( COL_WHITE );
|
|
|
|
|
Bitmap aNullBmp( aNullSize, 8 );
|
|
|
|
|
aNullBmp.Erase( aNullColor );
|
2000-10-12 10:45:25 +00:00
|
|
|
|
rISet.Put(XFillBitmapItem(pPool,aNullBmp));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
// Schattenattribute (Drawing Engine)
|
|
|
|
|
rISet.Put(SdrShadowItem(FALSE));
|
|
|
|
|
rISet.Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
|
|
|
|
|
rISet.Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz
|
|
|
|
|
rISet.Put(SdrShadowYDistItem(300));
|
|
|
|
|
|
2003-06-26 10:11:39 +00:00
|
|
|
|
Font aLatinFont, aCJKFont, aCTLFont;
|
|
|
|
|
|
|
|
|
|
getDefaultFonts( aLatinFont, aCJKFont, aCTLFont );
|
|
|
|
|
|
2001-06-25 10:50:53 +00:00
|
|
|
|
SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(),
|
|
|
|
|
aLatinFont.GetCharSet(), EE_CHAR_FONTINFO );
|
|
|
|
|
|
|
|
|
|
SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(),
|
|
|
|
|
aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK );
|
|
|
|
|
|
|
|
|
|
SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(),
|
|
|
|
|
aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL );
|
|
|
|
|
|
2000-11-28 06:25:39 +00:00
|
|
|
|
rISet.Put( aSvxFontItem );
|
|
|
|
|
rISet.Put( aSvxFontItemCJK );
|
|
|
|
|
rISet.Put( aSvxFontItemCTL );
|
2000-11-16 12:55:39 +00:00
|
|
|
|
|
2004-10-12 12:08:37 +00:00
|
|
|
|
rISet.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT ) ); // sj: (i33745) changed default from 24 to 18 pt
|
|
|
|
|
rISet.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT_CJK ) ); // 18 pt
|
2006-04-26 19:45:22 +00:00
|
|
|
|
rISet.Put( SvxFontHeightItem( convertFontHeightToCTL( 635 ), 100, EE_CHAR_FONTHEIGHT_CTL ) ); // 18 pt
|
2000-11-16 12:55:39 +00:00
|
|
|
|
|
|
|
|
|
rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
|
|
|
|
|
rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ) );
|
|
|
|
|
rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ) );
|
|
|
|
|
|
|
|
|
|
rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ) );
|
|
|
|
|
rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ) );
|
|
|
|
|
rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ) );
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
rISet.Put(SvxContourItem(FALSE, EE_CHAR_OUTLINE ));
|
|
|
|
|
rISet.Put(SvxShadowedItem(FALSE, EE_CHAR_SHADOW ));
|
|
|
|
|
rISet.Put(SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE));
|
|
|
|
|
rISet.Put(SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ));
|
|
|
|
|
rISet.Put(SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK));
|
|
|
|
|
rISet.Put(SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF));
|
|
|
|
|
rISet.Put(SvxColorItem(Color(COL_AUTO), EE_CHAR_COLOR ));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2002-08-01 10:30:12 +00:00
|
|
|
|
// Absatzattribute (Edit Engine)
|
2007-05-10 14:22:32 +00:00
|
|
|
|
rISet.Put(SvxLRSpaceItem(EE_PARA_LRSPACE));
|
|
|
|
|
rISet.Put(SvxULSpaceItem(EE_PARA_ULSPACE));
|
2002-08-01 10:30:12 +00:00
|
|
|
|
|
|
|
|
|
// only change paragraph text direction,
|
|
|
|
|
// if this is a new document and
|
|
|
|
|
// text direction is set explicitly to RTL
|
2002-09-12 14:28:56 +00:00
|
|
|
|
/*
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if( mpDocSh &&
|
|
|
|
|
mpDocSh->IsNewDocument() &&
|
2002-08-01 10:30:12 +00:00
|
|
|
|
SD_MOD()->GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB )
|
|
|
|
|
{
|
2002-08-15 06:25:49 +00:00
|
|
|
|
SvxAdjustItem aAdjust( SVX_ADJUST_RIGHT );
|
|
|
|
|
SvxFrameDirectionItem aFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR );
|
2002-08-01 10:30:12 +00:00
|
|
|
|
|
|
|
|
|
rISet.Put( aAdjust );
|
2002-08-15 06:25:49 +00:00
|
|
|
|
rISet.Put( aFrameDirectionItem );
|
2002-08-01 10:30:12 +00:00
|
|
|
|
|
|
|
|
|
pItemPool->SetPoolDefaultItem( aAdjust );
|
2002-08-15 06:25:49 +00:00
|
|
|
|
pItemPool->SetPoolDefaultItem( aFrameDirectionItem );
|
2002-08-01 10:30:12 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
rISet.Put( SvxAdjustItem() );
|
2002-09-12 14:28:56 +00:00
|
|
|
|
*/
|
2004-10-12 12:08:37 +00:00
|
|
|
|
rISet.Put( SdrTextLeftDistItem( 250 ) ); // sj: (i33745) using text frame distances seems to be a better default
|
|
|
|
|
rISet.Put( SdrTextRightDistItem( 250 ) );
|
|
|
|
|
rISet.Put( SdrTextUpperDistItem( 125 ) );
|
|
|
|
|
rISet.Put( SdrTextLowerDistItem( 125 ) );
|
2002-08-01 10:30:12 +00:00
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
rISet.Put( SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ) );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-12-19 11:57:00 +00:00
|
|
|
|
// #i16874# enable kerning by default but only for new documents
|
|
|
|
|
rISet.Put( SvxAutoKernItem( TRUE, EE_CHAR_PAIRKERNING ) );
|
|
|
|
|
|
2002-08-01 10:30:12 +00:00
|
|
|
|
// Bullet
|
2000-09-18 23:16:46 +00:00
|
|
|
|
// BulletItem und BulletFont fuer Titel und Gliederung
|
|
|
|
|
SvxBulletItem aBulletItem(EE_PARA_BULLET);
|
|
|
|
|
// die sind in allen Ebenen identisch
|
|
|
|
|
aBulletItem.SetStyle(BS_BULLET);
|
|
|
|
|
aBulletItem.SetStart(1);
|
|
|
|
|
aBulletItem.SetScale(45); // in Prozent
|
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
Font aBulletFont( pSSPool->GetBulletFont() );
|
2004-10-12 12:08:37 +00:00
|
|
|
|
|
|
|
|
|
aBulletFont.SetSize(Size(0,635)); // sj: (i33745) changed default from 24 to 18 pt
|
|
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
|
aBulletItem.SetFont(aBulletFont);
|
2001-06-25 11:13:52 +00:00
|
|
|
|
aBulletItem.SetSymbol( 0x25CF ); // Punkt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
rISet.Put(aBulletItem);
|
|
|
|
|
|
|
|
|
|
SfxUInt16Item aBulletStateItem(EE_PARA_BULLETSTATE, 0); // Bullets nicht sichtbar
|
|
|
|
|
rISet.Put(aBulletStateItem);
|
|
|
|
|
|
|
|
|
|
// Neues BulletItem
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSSPool->PutNumBulletItem( pSheet, aBulletFont );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
SfxItemSet* pISet = NULL;
|
|
|
|
|
|
|
|
|
|
// ---- Objekt mit Pfeilspitze ----------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_OBJWITHARROW));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJWITHARROW );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_SOLID));
|
|
|
|
|
pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK)));
|
|
|
|
|
pISet->Put(XLineWidthItem(150));
|
|
|
|
|
|
2006-11-14 13:21:38 +00:00
|
|
|
|
::basegfx::B2DPolygon aArrow;
|
|
|
|
|
aArrow.append(::basegfx::B2DPoint(10.0, 0.0));
|
|
|
|
|
aArrow.append(::basegfx::B2DPoint(0.0, 30.0));
|
|
|
|
|
aArrow.append(::basegfx::B2DPoint(20.0, 30.0));
|
|
|
|
|
aArrow.setClosed(true);
|
|
|
|
|
pISet->Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow)));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStartWidthItem(700));
|
2001-10-16 14:35:52 +00:00
|
|
|
|
pISet->Put(XLineEndWidthItem(300));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pISet->Put(XLineStartCenterItem(TRUE));
|
|
|
|
|
|
|
|
|
|
// ---- Objekt mit Schatten -------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_OBJWITHSHADOW));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJWITHSHADOW );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(SdrShadowItem(TRUE));
|
|
|
|
|
pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
|
|
|
|
|
pISet->Put(SdrShadowXDistItem(300)); // 3 mm Schattendistanz
|
|
|
|
|
pISet->Put(SdrShadowYDistItem(300));
|
|
|
|
|
|
|
|
|
|
// ---- Objekt ohne F<>llung -------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_OBJWITHOUTFILL));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJWITHOUTFILL );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
|
|
|
|
// ---- Text ----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_TEXT));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXT );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_NONE));
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
|
|
|
|
// ---- Textk<74>rper ----------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_TEXTBODY));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXTBODY );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_NONE));
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxFontHeightItem(564, 100, EE_CHAR_FONTHEIGHT)); // 16 pt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
// ---- Textk<74>rper mit Blocksatz --------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_TEXTBODY_JUSTIFY));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXTBODY_JUSTIFY );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_NONE));
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST ));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
// ---- Textkoerper mit Einzug -----------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_TEXTBODY_INDENT));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXTBODY_INDENT );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_NONE));
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
aLRSpaceItem.SetTxtFirstLineOfst(600); // Erstzeileneinzug 6mm, rechts 0
|
|
|
|
|
pISet->Put(aLRSpaceItem);
|
|
|
|
|
|
|
|
|
|
// SvxLRSpaceItem hart gesetzt: NumBulletItem anpassen
|
|
|
|
|
SvxNumBulletItem aNumBullet( (const SvxNumBulletItem&) pISet->Get(EE_PARA_NUMBULLET) );
|
|
|
|
|
EditEngine::ImportBulletItem( aNumBullet, 0, NULL, &aLRSpaceItem );
|
|
|
|
|
pISet->Put( aNumBullet );
|
|
|
|
|
|
|
|
|
|
// ---- Titel ---------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_TITLE));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TITLE );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_NONE));
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxFontHeightItem(1551, 100, EE_CHAR_FONTHEIGHT )); // 44 pt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
// ---- Titel1 --------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_TITLE1));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TITLE1 );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_NONE));
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_SOLID));
|
|
|
|
|
pISet->Put(XFillColorItem(String(), RGB_Color(COL_CYAN)));
|
|
|
|
|
|
|
|
|
|
pISet->Put(SdrShadowItem(TRUE));
|
|
|
|
|
pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
|
|
|
|
|
pISet->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz
|
|
|
|
|
pISet->Put(SdrShadowYDistItem(200));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT )); // 24 pt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST ));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
// ---- Titel2 --------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_TITLE2));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TITLE2 );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineWidthItem(50));
|
|
|
|
|
|
|
|
|
|
// Farbe nicht aus der Farbtabelle holen, denn da kann diese Farbe
|
|
|
|
|
// geloescht oder veraendert sein
|
|
|
|
|
Color aOrange4(255, 204, 153);
|
|
|
|
|
pISet->Put(XFillColorItem(String(), aOrange4));
|
|
|
|
|
|
|
|
|
|
pISet->Put(SdrShadowItem(TRUE));
|
|
|
|
|
pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
|
|
|
|
|
pISet->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz
|
|
|
|
|
pISet->Put(SdrShadowYDistItem(200));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxFontHeightItem(1270, 100, EE_CHAR_FONTHEIGHT )); // 36 pt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
SvxLRSpaceItem aLRSpItem( 200, 200, 0, 0, EE_PARA_LRSPACE);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pISet->Put( aLRSpItem ); // Erstzeileneinzug 0 mm, links und rechts 2 mm
|
|
|
|
|
// SvxLRSpaceItem hart gesetzt: NumBulletItem anpassen
|
|
|
|
|
SvxNumBulletItem aNmBullet( (const SvxNumBulletItem&) pISet->Get(EE_PARA_NUMBULLET) );
|
|
|
|
|
EditEngine::ImportBulletItem( aNmBullet, 0, NULL, &aLRSpItem );
|
|
|
|
|
pISet->Put( aNmBullet );
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxULSpaceItem(100, 100, EE_PARA_ULSPACE )); // Absatzrand oben/unten 1 mm
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST ));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
// ---- Ueberschrift ---------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_HEADLINE));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_HEADLINE );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_NONE));
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT )); // 24 pt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Absatzrand oben 4,2 mm,
|
2000-09-18 23:16:46 +00:00
|
|
|
|
// unten 2,1 mm
|
|
|
|
|
|
|
|
|
|
// ---- Ueberschrift1 --------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_HEADLINE1));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_HEADLINE1 );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_NONE));
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT ));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxFontHeightItem(635, 100, EE_CHAR_FONTHEIGHT )); // 18 pt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Absatzrand oben 4,2 mm,
|
2000-09-18 23:16:46 +00:00
|
|
|
|
// unten 2,1 mm
|
|
|
|
|
|
|
|
|
|
// ---- Ueberschrift2 --------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_HEADLINE2));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_HEADLINE2 );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_NONE));
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxPostureItem(ITALIC_NORMAL, EE_CHAR_ITALIC ));
|
|
|
|
|
pISet->Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxFontHeightItem(494, 0, EE_CHAR_FONTHEIGHT )); // 14 pt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Absatzrand oben 4,2 mm,
|
2000-09-18 23:16:46 +00:00
|
|
|
|
// unten 2,1 mm
|
|
|
|
|
|
|
|
|
|
// ---- Bemassung --------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_POOLSHEET_MEASURE));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pSheet->SetParent(aStdName);
|
|
|
|
|
pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_MEASURE );
|
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
|
|
|
|
|
pISet->Put(XFillStyleItem(XFILL_NONE));
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
pISet->Put(SvxFontHeightItem(423, 100, EE_CHAR_FONTHEIGHT )); // 12 pt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-11-14 13:21:38 +00:00
|
|
|
|
pISet->Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow)));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pISet->Put(XLineStartWidthItem(200));
|
2006-11-14 13:21:38 +00:00
|
|
|
|
pISet->Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow)));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pISet->Put(XLineEndWidthItem(200));
|
|
|
|
|
pISet->Put(XLineStyleItem(XLINE_SOLID));
|
2006-12-12 14:52:14 +00:00
|
|
|
|
pISet->Put(SdrMeasureShowUnitItem(true));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
invalidierte Items koennen nicht gespeichert werden;
|
|
|
|
|
da muessen wir uns was anderes ueberlegen
|
|
|
|
|
|
|
|
|
|
// ---- leere Vorlage --------------------------------------------------
|
|
|
|
|
|
|
|
|
|
aName = String(SdResId(STR_EMPTY_STYLESHEET_NAME));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSheet = &(pSSPool->Make(aName, SFX_STYLE_FAMILY_PARA, nMask));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pISet = &pSheet->GetItemSet();
|
|
|
|
|
pISet->InvalidateAllItems(); // alle auf DONTCARE setzen
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Praesentationsvorlagen fuer das Standardlayout erzeugen
|
|
|
|
|
String aPrefix = String(SdResId(STR_LAYOUT_DEFAULT_NAME));
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pSSPool->CreateLayoutStyleSheets(aPrefix);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Anzahl der Seiten, die eine masterPage referenzieren
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
USHORT SdDrawDocument::GetMasterPageUserCount(SdrPage* pMaster) const
|
|
|
|
|
{
|
|
|
|
|
USHORT nResult = 0;
|
|
|
|
|
USHORT nPage;
|
|
|
|
|
USHORT nPageCount = GetPageCount();
|
|
|
|
|
|
|
|
|
|
for (nPage = 0; nPage < nPageCount; nPage++)
|
|
|
|
|
{
|
|
|
|
|
const SdrPage* pPage = GetPage(nPage);
|
2004-07-12 13:55:57 +00:00
|
|
|
|
|
|
|
|
|
if(pPage->TRG_HasMasterPage())
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2004-07-12 13:55:57 +00:00
|
|
|
|
if(&(pPage->TRG_GetMasterPage()) == pMaster)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
nResult++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nResult;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* OnlineSpelling im Hintergrund beenden
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdDrawDocument::StopOnlineSpelling()
|
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if (mpOnlineSpellingTimer && mpOnlineSpellingTimer->IsActive())
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mpOnlineSpellingTimer->Stop();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
delete mpOnlineSpellingTimer;
|
|
|
|
|
mpOnlineSpellingTimer = NULL;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
delete mpOnlineSpellingList;
|
|
|
|
|
mpOnlineSpellingList = NULL;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* OnlineSpelling im Hintergrund starten
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdDrawDocument::StartOnlineSpelling(BOOL bForceSpelling)
|
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if (mbOnlineSpell && (bForceSpelling || mbInitialOnlineSpellingEnabled) &&
|
|
|
|
|
mpDocSh && !mpDocSh->IsReadOnly() )
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
StopOnlineSpelling();
|
|
|
|
|
|
2004-01-20 09:27:03 +00:00
|
|
|
|
::sd::Outliner* pOutl = GetInternalOutliner(TRUE);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2002-02-20 10:05:16 +00:00
|
|
|
|
Reference< XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() );
|
|
|
|
|
if ( xSpellChecker.is() )
|
|
|
|
|
pOutl->SetSpeller( xSpellChecker );
|
2000-10-25 09:34:04 +00:00
|
|
|
|
|
2002-02-20 10:05:16 +00:00
|
|
|
|
Reference< XHyphenator > xHyphenator( LinguMgr::GetHyphenator() );
|
|
|
|
|
if( xHyphenator.is() )
|
|
|
|
|
pOutl->SetHyphenator( xHyphenator );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pOutl->SetDefaultLanguage( meLanguage );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mpOnlineSpellingList = new ShapeList;
|
2003-12-01 16:43:09 +00:00
|
|
|
|
USHORT nPage;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2003-12-01 16:43:09 +00:00
|
|
|
|
for ( nPage = 0; nPage < GetPageCount(); nPage++ )
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
// Alle Pages durchsuchen
|
|
|
|
|
FillOnlineSpellingList((SdPage*) GetPage(nPage));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (nPage = 0; nPage < GetMasterPageCount(); nPage++)
|
|
|
|
|
{
|
|
|
|
|
// Alle MasterPages durchsuchen
|
|
|
|
|
FillOnlineSpellingList((SdPage*) GetMasterPage(nPage));
|
|
|
|
|
}
|
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mpOnlineSpellingList->seekShape(0);
|
|
|
|
|
mpOnlineSpellingTimer = new Timer();
|
|
|
|
|
mpOnlineSpellingTimer->SetTimeoutHdl( LINK(this, SdDrawDocument, OnlineSpellingHdl) );
|
|
|
|
|
mpOnlineSpellingTimer->SetTimeout(250);
|
|
|
|
|
mpOnlineSpellingTimer->Start();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* OnlineSpelling-Liste fuellen
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdDrawDocument::FillOnlineSpellingList(SdPage* pPage)
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pObj = NULL;
|
|
|
|
|
SdrObjListIter aIter(*pPage, IM_FLAT);
|
|
|
|
|
|
|
|
|
|
while (aIter.IsMore())
|
|
|
|
|
{
|
|
|
|
|
pObj = aIter.Next();
|
|
|
|
|
|
2006-11-01 13:14:43 +00:00
|
|
|
|
if( !pObj )
|
|
|
|
|
continue;
|
|
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
|
if (pObj->GetOutlinerParaObject())
|
|
|
|
|
{
|
|
|
|
|
// Textobjekt gefunden
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mpOnlineSpellingList->addShape(*pObj);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
else if (pObj->GetObjIdentifier() == OBJ_GRUP)
|
|
|
|
|
{
|
|
|
|
|
// Gruppenobjekt gefunden
|
|
|
|
|
SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(),
|
|
|
|
|
IM_DEEPNOGROUPS);
|
|
|
|
|
|
|
|
|
|
BOOL bSubTextObjFound = FALSE;
|
|
|
|
|
|
|
|
|
|
while (aGroupIter.IsMore() && !bSubTextObjFound)
|
|
|
|
|
{
|
|
|
|
|
if (aGroupIter.Next()->GetOutlinerParaObject())
|
|
|
|
|
{
|
|
|
|
|
// Textobjekt im Gruppenobjekt gefunden
|
|
|
|
|
bSubTextObjFound = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bSubTextObjFound)
|
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mpOnlineSpellingList->addShape(*pObj);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* OnlineSpelling im Hintergrund
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
IMPL_LINK(SdDrawDocument, OnlineSpellingHdl, Timer*, EMPTYARG )
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if (mpOnlineSpellingList!=NULL
|
|
|
|
|
&& ( !mbOnlineSpell || mpOnlineSpellingList->hasMore()))
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
/**********************************************************************
|
|
|
|
|
* Naechstes Objekt spellen
|
|
|
|
|
**********************************************************************/
|
2006-12-12 15:32:15 +00:00
|
|
|
|
SdrObject* pObj = mpOnlineSpellingList->getNextShape();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
if (pObj)
|
|
|
|
|
{
|
|
|
|
|
if (pObj->GetOutlinerParaObject() && pObj->ISA(SdrTextObj))
|
|
|
|
|
{
|
|
|
|
|
// Textobjekt spellen
|
|
|
|
|
SpellObject((SdrTextObj*) pObj);
|
|
|
|
|
}
|
|
|
|
|
else if (pObj->GetObjIdentifier() == OBJ_GRUP)
|
|
|
|
|
{
|
|
|
|
|
// Gruppenobjekt gefunden
|
|
|
|
|
SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(),
|
|
|
|
|
IM_DEEPNOGROUPS);
|
|
|
|
|
|
|
|
|
|
SdrObject* pSubObj = NULL;
|
|
|
|
|
|
|
|
|
|
while (aGroupIter.IsMore())
|
|
|
|
|
{
|
|
|
|
|
pSubObj = aGroupIter.Next();
|
|
|
|
|
|
|
|
|
|
if (pSubObj->GetOutlinerParaObject() && pSubObj->ISA(SdrTextObj))
|
|
|
|
|
{
|
|
|
|
|
// Textobjekt im Gruppenobjekt gefunden
|
|
|
|
|
SpellObject((SdrTextObj*) pSubObj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Weitersuchen
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mpOnlineSpellingTimer->Start();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Spelling wurde initial durchgefuehrt
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mbInitialOnlineSpellingEnabled = FALSE;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
// Suche beenden
|
|
|
|
|
StopOnlineSpelling();
|
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
delete mpOnlineSearchItem;
|
|
|
|
|
mpOnlineSearchItem = NULL;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Objekt spellen (fuer OnlineSpelling)
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdDrawDocument::SpellObject(SdrTextObj* pObj)
|
|
|
|
|
{
|
|
|
|
|
if (pObj && pObj->GetOutlinerParaObject() /* && pObj != pView->GetTextEditObject() */)
|
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mbHasOnlineSpellErrors = FALSE;
|
2004-01-20 09:27:03 +00:00
|
|
|
|
::sd::Outliner* pOutl = GetInternalOutliner(TRUE);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pOutl->SetUpdateMode(TRUE);
|
|
|
|
|
Link aEvtHdl = pOutl->GetStatusEventHdl();
|
|
|
|
|
pOutl->SetStatusEventHdl(LINK(this, SdDrawDocument, OnlineSpellEventHdl));
|
|
|
|
|
|
|
|
|
|
USHORT nOldOutlMode = pOutl->GetMode();
|
|
|
|
|
USHORT nOutlMode = OUTLINERMODE_TEXTOBJECT;
|
|
|
|
|
if (((SdrTextObj*) pObj)->GetObjInventor() == SdrInventor &&
|
|
|
|
|
((SdrTextObj*) pObj)->GetObjIdentifier() == OBJ_OUTLINETEXT)
|
|
|
|
|
{
|
|
|
|
|
nOutlMode = OUTLINERMODE_OUTLINEOBJECT;
|
|
|
|
|
pOutl->SetMinDepth(1);
|
|
|
|
|
}
|
|
|
|
|
pOutl->Init( nOutlMode );
|
|
|
|
|
|
|
|
|
|
// Text in den Outliner setzen
|
|
|
|
|
pOutl->SetText(*((SdrTextObj*) pObj)->GetOutlinerParaObject());
|
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if (!mpOnlineSearchItem || pOutl->HasText(*mpOnlineSearchItem))
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
// Spelling
|
|
|
|
|
pOutl->CompleteOnlineSpelling();
|
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if (mbHasOnlineSpellErrors)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2005-05-03 13:02:34 +00:00
|
|
|
|
sd::ModifyGuard aGuard( this );
|
|
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
|
// Text aus Outliner holen
|
|
|
|
|
((SdrTextObj*) pObj)->SetOutlinerParaObject( pOutl->CreateParaObject() );
|
2005-05-03 13:02:34 +00:00
|
|
|
|
|
2003-11-24 16:08:03 +00:00
|
|
|
|
pObj->BroadcastObjectChange();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pOutl->SetStatusEventHdl(aEvtHdl);
|
|
|
|
|
pOutl->SetUpdateMode(FALSE);
|
|
|
|
|
pOutl->Init( nOldOutlMode );
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mbHasOnlineSpellErrors = FALSE;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Objekt wurde ins Model eingefuegt
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
2006-12-12 15:32:15 +00:00
|
|
|
|
void SdDrawDocument::InsertObject(SdrObject* pObj, SdPage* /*pPage*/)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if(mpOnlineSpellingList && pObj)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-11-01 13:14:43 +00:00
|
|
|
|
if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP))
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
// Objekt in OnlineSpelling-Liste aufnehmen
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mpOnlineSpellingList->addShape(*pObj);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Objekt wurde aus dem Model entfernt
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
2006-12-12 15:32:15 +00:00
|
|
|
|
void SdDrawDocument::RemoveObject(SdrObject* pObj, SdPage* /*pPage*/)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if(mpOnlineSpellingList && pObj)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-11-01 13:14:43 +00:00
|
|
|
|
if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP))
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
// Objekt in OnlineSpelling-Liste durch NULL-Pointer ersetzt
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mpOnlineSpellingList->removeShape(*pObj);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Callback fuer ExecuteSpellPopup()
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
IMPL_LINK(SdDrawDocument, OnlineSpellEventHdl, EditStatus*, pEditStat)
|
|
|
|
|
{
|
|
|
|
|
ULONG nStat = pEditStat->GetStatusWord();
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mbHasOnlineSpellErrors = (nStat & EE_STAT_WRONGWORDCHANGED) != 0;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Callback fuer ExecuteSpellPopup()
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2001-09-27 09:30:57 +00:00
|
|
|
|
// #91457# removed link and replaced with Imp method
|
|
|
|
|
void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* pObj, SdrOutliner* pOutl)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
delete mpOnlineSearchItem;
|
|
|
|
|
mpOnlineSearchItem = NULL;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
|
|
USHORT nCommand = pInfo->nCommand;
|
|
|
|
|
|
2001-08-27 14:30:08 +00:00
|
|
|
|
if (nCommand == SPELLCMD_IGNOREWORD
|
|
|
|
|
// #91457# restart when add to dictionary takes place, too.
|
|
|
|
|
|| nCommand == SPELLCMD_ADDTODICTIONARY)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2001-09-27 09:30:57 +00:00
|
|
|
|
if(pObj && pOutl && pObj->ISA(SdrTextObj))
|
|
|
|
|
{
|
|
|
|
|
BOOL bModified(IsChanged());
|
|
|
|
|
((SdrTextObj*)pObj)->SetOutlinerParaObject(pOutl->CreateParaObject());
|
|
|
|
|
SetChanged(bModified);
|
2003-11-24 16:08:03 +00:00
|
|
|
|
pObj->BroadcastObjectChange();
|
2001-09-27 09:30:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
mpOnlineSearchItem = new SvxSearchItem( SID_SEARCH_ITEM );
|
2006-12-12 15:32:15 +00:00
|
|
|
|
mpOnlineSearchItem->SetSearchString(pInfo->aWord);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
StartOnlineSpelling();
|
|
|
|
|
}
|
|
|
|
|
else if (nCommand == SPELLCMD_STARTSPELLDLG)
|
|
|
|
|
{
|
2004-09-17 12:46:25 +00:00
|
|
|
|
SfxViewFrame::Current()->GetDispatcher()->Execute( SID_SPELL_DIALOG,
|
|
|
|
|
SFX_CALLMODE_ASYNCHRON );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Sprachabhaengige Namen der StandardLayer durch eindeutigen Namen ersetzen
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdDrawDocument::MakeUniqueLayerNames()
|
|
|
|
|
{
|
|
|
|
|
String aLayerLayout(SdResId(STR_LAYER_LAYOUT));
|
|
|
|
|
String aLayerBckgrnd(SdResId(STR_LAYER_BCKGRND));
|
|
|
|
|
String aLayerBckgrndObj(SdResId(STR_LAYER_BCKGRNDOBJ));
|
|
|
|
|
String aLayerControls(SdResId(STR_LAYER_CONTROLS));
|
|
|
|
|
String aLayerMeasurelines(SdResId(STR_LAYER_MEASURELINES));
|
|
|
|
|
SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
|
|
|
|
|
USHORT nStandardLayer = 5;
|
|
|
|
|
USHORT nLayerCount = Min(rLayerAdmin.GetLayerCount(), nStandardLayer);
|
|
|
|
|
|
|
|
|
|
for (USHORT nLayer = 0; nLayer < nLayerCount; nLayer++)
|
|
|
|
|
{
|
|
|
|
|
// Die sprachabhaengigen Namen der Default-Layer werden nicht mehr
|
|
|
|
|
// gespeichert. Es werden stattdessen eindeutige Namen verwendet.
|
|
|
|
|
SdrLayer* pLayer = rLayerAdmin.GetLayer(nLayer);
|
|
|
|
|
|
|
|
|
|
if (pLayer)
|
|
|
|
|
{
|
|
|
|
|
String aLayerName(pLayer->GetName());
|
|
|
|
|
|
|
|
|
|
if (aLayerName == aLayerLayout)
|
|
|
|
|
{
|
|
|
|
|
pLayer->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "LAYER_LAYOUT" )));
|
|
|
|
|
}
|
|
|
|
|
else if (aLayerName == aLayerBckgrnd)
|
|
|
|
|
{
|
|
|
|
|
pLayer->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "LAYER_BCKGRND" )));
|
|
|
|
|
}
|
|
|
|
|
else if (aLayerName == aLayerBckgrndObj)
|
|
|
|
|
{
|
|
|
|
|
pLayer->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "LAYER_BACKGRNDOBJ" )));
|
|
|
|
|
}
|
|
|
|
|
else if (aLayerName == aLayerControls)
|
|
|
|
|
{
|
|
|
|
|
pLayer->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "LAYER_CONTROLS" )));
|
|
|
|
|
}
|
|
|
|
|
else if (aLayerName == aLayerMeasurelines)
|
|
|
|
|
{
|
|
|
|
|
pLayer->SetName( String( RTL_CONSTASCII_USTRINGPARAM( "LAYER_MEASURELINES" )));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Eindeutige Namen der StandardLayer durch sprachabhaengige Namen ersetzen
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
void SdDrawDocument::RestoreLayerNames()
|
|
|
|
|
{
|
|
|
|
|
SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
|
|
|
|
|
USHORT nLayerCount = rLayerAdmin.GetLayerCount();
|
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
for (USHORT nLayer = 0; nLayer < nLayerCount; nLayer++)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
SdrLayer* pLayer = rLayerAdmin.GetLayer(nLayer);
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if (pLayer)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
String aLayerName(pLayer->GetName());
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
if (aLayerName.EqualsAscii( "LAYER_LAYOUT" ))
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pLayer->SetName(String(SdResId(STR_LAYER_LAYOUT)));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
2006-12-12 15:32:15 +00:00
|
|
|
|
else if (aLayerName.EqualsAscii( "LAYER_BCKGRND" ))
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
2006-12-12 15:32:15 +00:00
|
|
|
|
pLayer->SetName(String(SdResId(STR_LAYER_BCKGRND)));
|
|
|
|
|
}
|
|
|
|
|
else if (aLayerName.EqualsAscii( "LAYER_BACKGRNDOBJ" ))
|
|
|
|
|
{
|
|
|
|
|
pLayer->SetName(String(SdResId(STR_LAYER_BCKGRNDOBJ)));
|
|
|
|
|
}
|
|
|
|
|
else if (aLayerName.EqualsAscii( "LAYER_CONTROLS" ))
|
|
|
|
|
{
|
|
|
|
|
pLayer->SetName(String(SdResId(STR_LAYER_CONTROLS)));
|
|
|
|
|
}
|
|
|
|
|
else if (aLayerName.EqualsAscii( "LAYER_MEASURELINES" ))
|
|
|
|
|
{
|
|
|
|
|
pLayer->SetName(String(SdResId(STR_LAYER_MEASURELINES)));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Formatierte Seitennummer zurueckgeben (1, I, i, a, usw.)
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
String SdDrawDocument::CreatePageNumValue(USHORT nNum) const
|
|
|
|
|
{
|
|
|
|
|
String aPageNumValue;
|
|
|
|
|
BOOL bUpper = FALSE;
|
|
|
|
|
|
2006-12-12 15:32:15 +00:00
|
|
|
|
switch (mePageNumType)
|
2000-09-18 23:16:46 +00:00
|
|
|
|
{
|
|
|
|
|
case SVX_CHARS_UPPER_LETTER:
|
|
|
|
|
aPageNumValue += (sal_Unicode)(char)((nNum - 1) % 26 + 'A');
|
|
|
|
|
break;
|
|
|
|
|
case SVX_CHARS_LOWER_LETTER:
|
|
|
|
|
aPageNumValue += (sal_Unicode)(char)((nNum - 1) % 26 + 'a');
|
|
|
|
|
break;
|
|
|
|
|
case SVX_ROMAN_UPPER:
|
|
|
|
|
bUpper = TRUE;
|
|
|
|
|
case SVX_ROMAN_LOWER:
|
|
|
|
|
aPageNumValue += SvxNumberFormat::CreateRomanString(nNum, bUpper);
|
|
|
|
|
break;
|
|
|
|
|
case SVX_NUMBER_NONE:
|
|
|
|
|
aPageNumValue.Erase();
|
|
|
|
|
aPageNumValue += sal_Unicode(' ');
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
aPageNumValue += String::CreateFromInt32( (sal_Int32)nNum );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return(aPageNumValue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Layout-Template umbenennen
|
|
|
|
|
|* Zu beachten ist, das rOldLayoutName im Gegensatz zu rNewName den
|
|
|
|
|
|* kompletten Layout(!)-Namen enthaelt (inkl. ~LT~)!
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const String& rNewName)
|
|
|
|
|
{
|
|
|
|
|
String aOldName(rOldLayoutName);
|
|
|
|
|
USHORT nPos = aOldName.SearchAscii( SD_LT_SEPARATOR );
|
2002-01-22 15:25:23 +00:00
|
|
|
|
|
|
|
|
|
// erase everything after '~LT~'
|
|
|
|
|
aOldName.Erase(nPos + sizeof(SD_LT_SEPARATOR) - 1 );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
USHORT nLen = aOldName.Len();
|
|
|
|
|
|
|
|
|
|
List aReplList;
|
|
|
|
|
SfxStyleSheetIterator aIter(pStyleSheetPool, SD_LT_FAMILY);
|
|
|
|
|
SfxStyleSheetBase* pSheet = aIter.First();
|
|
|
|
|
|
|
|
|
|
while (pSheet)
|
|
|
|
|
{
|
|
|
|
|
String aSheetName = pSheet->GetName();
|
|
|
|
|
|
2002-01-22 15:25:23 +00:00
|
|
|
|
// if the sheetname starts with aOldName + "~LT~"
|
2000-09-18 23:16:46 +00:00
|
|
|
|
if (aSheetName.Match(aOldName) == nLen)
|
|
|
|
|
{
|
2002-01-22 15:25:23 +00:00
|
|
|
|
aSheetName.Erase(0, nLen - sizeof(SD_LT_SEPARATOR) + 1 );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
aSheetName.Insert(rNewName, 0);
|
|
|
|
|
|
|
|
|
|
StyleReplaceData* pReplData = new StyleReplaceData;
|
|
|
|
|
pReplData->nFamily = pSheet->GetFamily();
|
|
|
|
|
pReplData->nNewFamily = pSheet->GetFamily();
|
|
|
|
|
pReplData->aName = pSheet->GetName();
|
|
|
|
|
pReplData->aNewName = aSheetName;
|
|
|
|
|
aReplList.Insert(pReplData, LIST_APPEND);
|
|
|
|
|
|
|
|
|
|
pSheet->SetName(aSheetName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pSheet = aIter.Next();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// jetzt noch den Layoutnamen der Zeichen- und der Notizseite
|
|
|
|
|
// sowie ihrer Masterpages setzen
|
|
|
|
|
String aPageLayoutName(rNewName);
|
|
|
|
|
aPageLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
|
|
|
|
|
aPageLayoutName += String(SdResId(STR_LAYOUT_OUTLINE));
|
|
|
|
|
|
|
|
|
|
// an allen Seiten, die das jetzt umbeannte Layout benutzen, die
|
|
|
|
|
// Textobjekte von der Aenderung unterrichten und Layoutnamen setzen
|
|
|
|
|
USHORT nPage;
|
|
|
|
|
for (nPage = 0; nPage < GetPageCount(); nPage++)
|
|
|
|
|
{
|
|
|
|
|
SdPage* pPage = (SdPage*) GetPage(nPage);
|
|
|
|
|
String aTemp(pPage->GetLayoutName());
|
|
|
|
|
|
|
|
|
|
if (aTemp == rOldLayoutName)
|
|
|
|
|
{
|
|
|
|
|
pPage->SetLayoutName(aPageLayoutName);
|
|
|
|
|
|
|
|
|
|
for (ULONG nObj = 0; nObj < pPage->GetObjCount(); nObj++)
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pObj = pPage->GetObj(nObj);
|
|
|
|
|
|
|
|
|
|
if (pObj->GetObjInventor() == SdrInventor)
|
|
|
|
|
{
|
|
|
|
|
switch( pObj->GetObjIdentifier() )
|
|
|
|
|
{
|
|
|
|
|
case OBJ_TEXT:
|
|
|
|
|
case OBJ_OUTLINETEXT:
|
|
|
|
|
case OBJ_TITLETEXT:
|
|
|
|
|
{
|
|
|
|
|
OutlinerParaObject* pOPO = ((SdrTextObj*) pObj)->GetOutlinerParaObject();
|
|
|
|
|
|
|
|
|
|
if (pOPO)
|
|
|
|
|
{
|
|
|
|
|
StyleReplaceData* pReplData = (StyleReplaceData*) aReplList.First();
|
|
|
|
|
|
|
|
|
|
while( pReplData )
|
|
|
|
|
{
|
|
|
|
|
pOPO->ChangeStyleSheets( pReplData->aName, pReplData->nFamily, pReplData->aNewName, pReplData->nNewFamily );
|
|
|
|
|
pReplData = (StyleReplaceData*) aReplList.Next();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// und nochmal fuer die Masterpages
|
|
|
|
|
// die betroffenen Masterpages erhalten als Seitennamen den Namen
|
|
|
|
|
// des Layouts
|
|
|
|
|
for (nPage = 0; nPage < GetMasterPageCount(); nPage++)
|
|
|
|
|
{
|
|
|
|
|
SdPage* pPage = (SdPage*) GetMasterPage(nPage);
|
|
|
|
|
String aTemp(pPage->GetLayoutName());
|
|
|
|
|
|
|
|
|
|
if (aTemp == rOldLayoutName)
|
|
|
|
|
{
|
|
|
|
|
pPage->SetLayoutName(aPageLayoutName);
|
|
|
|
|
pPage->SetName(rNewName);
|
|
|
|
|
|
|
|
|
|
for (ULONG nObj = 0; nObj < pPage->GetObjCount(); nObj++)
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pObj = pPage->GetObj(nObj);
|
|
|
|
|
|
|
|
|
|
if (pObj->GetObjInventor() == SdrInventor)
|
|
|
|
|
{
|
|
|
|
|
switch(pObj->GetObjIdentifier())
|
|
|
|
|
{
|
|
|
|
|
case OBJ_TEXT:
|
|
|
|
|
case OBJ_OUTLINETEXT:
|
|
|
|
|
case OBJ_TITLETEXT:
|
|
|
|
|
{
|
|
|
|
|
OutlinerParaObject* pOPO = ((SdrTextObj*)pObj)->GetOutlinerParaObject();
|
|
|
|
|
|
|
|
|
|
if (pOPO)
|
|
|
|
|
{
|
|
|
|
|
StyleReplaceData* pReplData = (StyleReplaceData*) aReplList.First();
|
|
|
|
|
|
|
|
|
|
while( pReplData )
|
|
|
|
|
{
|
|
|
|
|
pOPO->ChangeStyleSheets( pReplData->aName, pReplData->nFamily, pReplData->aNewName, pReplData->nNewFamily );
|
|
|
|
|
pReplData = (StyleReplaceData*) aReplList.Next();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Outliner-Defaults setzen (Pool-Defaults)
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
void SdDrawDocument::SetTextDefaults() const
|
|
|
|
|
{
|
|
|
|
|
// BulletItem und BulletFont fuer Titel und Gliederung
|
|
|
|
|
SvxBulletItem aBulletItem(EE_PARA_BULLET);
|
|
|
|
|
Font aBulletFont( ((SdStyleSheetPool*) pStyleSheetPool)->GetBulletFont() );
|
|
|
|
|
aBulletFont.SetSize(Size(0,846)); // 24 pt
|
|
|
|
|
aBulletItem.SetFont(aBulletFont);
|
|
|
|
|
aBulletItem.SetStyle(BS_BULLET);
|
|
|
|
|
aBulletItem.SetStart(1);
|
|
|
|
|
aBulletItem.SetScale(45); // in Prozent
|
2001-06-25 11:13:52 +00:00
|
|
|
|
aBulletItem.SetSymbol( 0x25CF ); // Punkt
|
2000-09-18 23:16:46 +00:00
|
|
|
|
pItemPool->SetPoolDefaultItem( aBulletItem );
|
|
|
|
|
|
|
|
|
|
// Bullets nicht sichtbar
|
|
|
|
|
SfxUInt16Item aBulletStateItem(EE_PARA_BULLETSTATE, 0);
|
|
|
|
|
pItemPool->SetPoolDefaultItem( aBulletStateItem );
|
|
|
|
|
|
|
|
|
|
// Neues BulletItem
|
|
|
|
|
SvxNumberFormat aNumberFormat(SVX_NUM_CHAR_SPECIAL);
|
|
|
|
|
aNumberFormat.SetBulletFont(&aBulletFont);
|
2001-06-25 11:13:52 +00:00
|
|
|
|
aNumberFormat.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34
|
2000-09-18 23:16:46 +00:00
|
|
|
|
aNumberFormat.SetBulletRelSize(45);
|
2002-02-26 10:03:18 +00:00
|
|
|
|
aNumberFormat.SetBulletColor(Color(COL_AUTO));
|
2000-09-18 23:16:46 +00:00
|
|
|
|
aNumberFormat.SetStart(1);
|
|
|
|
|
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
|
|
|
|
|
|
|
|
|
|
SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , FALSE);
|
|
|
|
|
|
2001-03-21 15:24:40 +00:00
|
|
|
|
aNumberFormat.SetLSpace( 0 );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
aNumberFormat.SetAbsLSpace( 0 );
|
|
|
|
|
aNumberFormat.SetFirstLineOffset( 0 );
|
|
|
|
|
aNumRule.SetLevel( 0, aNumberFormat );
|
|
|
|
|
|
|
|
|
|
for( USHORT i = 1; i < 10; i++ )
|
|
|
|
|
{
|
|
|
|
|
const short nLSpace = (i + 1) * 600;
|
|
|
|
|
aNumberFormat.SetLSpace(nLSpace);
|
|
|
|
|
aNumberFormat.SetAbsLSpace(nLSpace);
|
|
|
|
|
aNumberFormat.SetFirstLineOffset(-600);
|
|
|
|
|
aNumRule.SetLevel( i, aNumberFormat );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SvxNumBulletItem aNumBulletItem( aNumRule, EE_PARA_NUMBULLET );
|
|
|
|
|
pItemPool->SetPoolDefaultItem( aNumBulletItem );
|
|
|
|
|
}
|
2002-08-01 10:30:12 +00:00
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|*
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
::com::sun::star::text::WritingMode SdDrawDocument::GetDefaultWritingMode() const
|
|
|
|
|
{
|
2002-08-15 06:25:49 +00:00
|
|
|
|
const SfxPoolItem* pItem = ( pItemPool ? pItemPool->GetPoolDefaultItem( EE_PARA_WRITINGDIR ) : NULL );
|
|
|
|
|
::com::sun::star::text::WritingMode eRet = ::com::sun::star::text::WritingMode_LR_TB;
|
|
|
|
|
|
|
|
|
|
if( pItem )
|
|
|
|
|
{
|
|
|
|
|
switch( ( (SvxFrameDirectionItem&)( *pItem ) ).GetValue() )
|
|
|
|
|
{
|
|
|
|
|
case( FRMDIR_HORI_LEFT_TOP ): eRet = ::com::sun::star::text::WritingMode_LR_TB; break;
|
|
|
|
|
case( FRMDIR_HORI_RIGHT_TOP ): eRet = ::com::sun::star::text::WritingMode_RL_TB; break;
|
|
|
|
|
case( FRMDIR_VERT_TOP_RIGHT ): eRet = ::com::sun::star::text::WritingMode_TB_RL; break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
DBG_ERROR( "Frame direction not supported yet" );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-08-01 10:30:12 +00:00
|
|
|
|
|
2002-08-15 06:25:49 +00:00
|
|
|
|
return eRet;
|
2002-08-01 10:30:12 +00:00
|
|
|
|
}
|
2002-09-12 14:28:56 +00:00
|
|
|
|
|
|
|
|
|
void SdDrawDocument::SetDefaultWritingMode(::com::sun::star::text::WritingMode eMode )
|
|
|
|
|
{
|
|
|
|
|
if( pItemPool )
|
|
|
|
|
{
|
|
|
|
|
SvxFrameDirection nVal;
|
|
|
|
|
switch( eMode )
|
|
|
|
|
{
|
|
|
|
|
case ::com::sun::star::text::WritingMode_LR_TB: nVal = FRMDIR_HORI_LEFT_TOP; break;
|
|
|
|
|
case ::com::sun::star::text::WritingMode_RL_TB: nVal = FRMDIR_HORI_RIGHT_TOP; break;
|
|
|
|
|
case ::com::sun::star::text::WritingMode_TB_RL: nVal = FRMDIR_VERT_TOP_RIGHT; break;
|
|
|
|
|
default:
|
|
|
|
|
DBG_ERROR( "Frame direction not supported yet" );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SvxFrameDirectionItem aModeItem( nVal, EE_PARA_WRITINGDIR );
|
|
|
|
|
pItemPool->SetPoolDefaultItem( aModeItem );
|
|
|
|
|
|
2007-05-10 14:22:32 +00:00
|
|
|
|
SvxAdjustItem aAdjust( SVX_ADJUST_LEFT, EE_PARA_JUST );
|
2002-09-12 14:28:56 +00:00
|
|
|
|
|
|
|
|
|
if( eMode == ::com::sun::star::text::WritingMode_RL_TB )
|
|
|
|
|
aAdjust.SetEnumValue( SVX_ADJUST_RIGHT );
|
|
|
|
|
|
|
|
|
|
pItemPool->SetPoolDefaultItem( aAdjust );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-06-26 10:11:39 +00:00
|
|
|
|
|
|
|
|
|
void SdDrawDocument::getDefaultFonts( Font& rLatinFont, Font& rCJKFont, Font& rCTLFont )
|
|
|
|
|
{
|
|
|
|
|
LanguageType eLatin = GetLanguage( EE_CHAR_LANGUAGE );
|
|
|
|
|
|
|
|
|
|
// #108374# / #107782#: If the UI language is Korean, the default Latin font has to
|
|
|
|
|
// be queried for Korean, too (the Latin language from the document can't be Korean).
|
|
|
|
|
// This is the same logic as in SwDocShell::InitNew.
|
|
|
|
|
LanguageType eUiLanguage = Application::GetSettings().GetUILanguage();
|
|
|
|
|
switch( eUiLanguage )
|
|
|
|
|
{
|
|
|
|
|
case LANGUAGE_KOREAN:
|
|
|
|
|
case LANGUAGE_KOREAN_JOHAB:
|
|
|
|
|
eLatin = eUiLanguage;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rLatinFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_PRESENTATION, eLatin, DEFAULTFONT_FLAGS_ONLYONE );
|
|
|
|
|
rCJKFont = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_PRESENTATION, GetLanguage( EE_CHAR_LANGUAGE_CJK ), DEFAULTFONT_FLAGS_ONLYONE );
|
|
|
|
|
rCTLFont = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_PRESENTATION, GetLanguage( EE_CHAR_LANGUAGE_CTL ), DEFAULTFONT_FLAGS_ONLYONE ) ;
|
|
|
|
|
}
|
2005-05-03 13:02:34 +00:00
|
|
|
|
|
2006-04-26 19:45:22 +00:00
|
|
|
|
/* converts the given western font height to a corresponding ctl font height, deppending on the system language */
|
|
|
|
|
sal_uInt32 SdDrawDocument::convertFontHeightToCTL( sal_uInt32 nWesternFontHeight )
|
|
|
|
|
{
|
|
|
|
|
LanguageType eRealCTLLanguage = Application::GetSettings().GetLanguage();
|
|
|
|
|
if( LANGUAGE_THAI == eRealCTLLanguage )
|
|
|
|
|
{
|
|
|
|
|
// http://specs.openoffice.org/g11n/font_sizes/42775_42725_Individual_configurable_font_size_for_default_fonts.odt
|
|
|
|
|
double fTemp = double(nWesternFontHeight) * 1.333;
|
|
|
|
|
nWesternFontHeight = (sal_uInt32)fTemp;
|
|
|
|
|
// make some nice values for UI that displays PT instead of 1/100th mm
|
|
|
|
|
nWesternFontHeight = ((nWesternFontHeight * 72) + 1270) / 2540L;
|
|
|
|
|
nWesternFontHeight = ((nWesternFontHeight * 2540L) + 36) / 72;
|
|
|
|
|
}
|
|
|
|
|
return nWesternFontHeight;
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-03 13:02:34 +00:00
|
|
|
|
ModifyGuard::ModifyGuard( DrawDocShell* pDocShell )
|
|
|
|
|
: mpDocShell( pDocShell ), mpDoc( 0 )
|
|
|
|
|
{
|
|
|
|
|
init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ModifyGuard::ModifyGuard( SdDrawDocument* pDoc )
|
|
|
|
|
: mpDocShell( 0 ), mpDoc( pDoc )
|
|
|
|
|
{
|
|
|
|
|
init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ModifyGuard::init()
|
|
|
|
|
{
|
|
|
|
|
if( mpDocShell )
|
|
|
|
|
{
|
|
|
|
|
mpDoc = mpDocShell->GetDoc();
|
|
|
|
|
}
|
|
|
|
|
else if( mpDoc )
|
|
|
|
|
{
|
|
|
|
|
mpDocShell = mpDoc->GetDocSh();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mbIsEnableSetModified = mpDocShell ? mpDocShell->IsEnableSetModified() : FALSE;
|
|
|
|
|
mbIsDocumentChanged = mpDoc ? mpDoc->IsChanged() : FALSE;
|
|
|
|
|
|
|
|
|
|
if( mbIsEnableSetModified )
|
|
|
|
|
mpDocShell->EnableSetModified( FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ModifyGuard::~ModifyGuard()
|
|
|
|
|
{
|
|
|
|
|
if( mbIsEnableSetModified )
|
|
|
|
|
mpDocShell->EnableSetModified( TRUE );
|
|
|
|
|
|
|
|
|
|
if( mpDoc && (mpDoc->IsChanged() != mbIsDocumentChanged) )
|
|
|
|
|
mpDoc->SetChanged(mbIsDocumentChanged);
|
|
|
|
|
}
|