2000-09-18 16:15:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 17:18:21 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:18:21 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:18:21 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:18:21 +00:00
|
|
|
* $RCSfile: viewopt.cxx,v $
|
2008-07-01 13:36:21 +00:00
|
|
|
* $Revision: 1.34 $
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:18:21 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:18:21 +00: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.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:18:21 +00: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).
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2008-04-10 17:18:21 +00: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.
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 21:42:27 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#include <svx/htmlmode.hxx>
|
2004-02-03 15:36:59 +00:00
|
|
|
#include <svx/htmlcfg.hxx>
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
#ifndef _SVX_SVXIDS_HRC //autogen
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#endif
|
|
|
|
#include <svx/svxenum.hxx>
|
|
|
|
#include <svx/svxacorr.hxx>
|
2000-11-20 08:07:00 +00:00
|
|
|
#include <unotools/localedatawrapper.hxx>
|
2001-07-05 12:48:54 +00:00
|
|
|
#ifndef _REGION_HXX //autogen
|
|
|
|
#include <vcl/region.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _OUTDEV_HXX //autogen
|
|
|
|
#include <vcl/outdev.hxx>
|
|
|
|
#endif
|
|
|
|
#include <vcl/window.hxx>
|
2002-04-12 09:39:11 +00:00
|
|
|
#include <swmodule.hxx>
|
2000-11-20 08:07:00 +00:00
|
|
|
#include <swtypes.hxx>
|
|
|
|
#include <viewopt.hxx>
|
|
|
|
#ifndef _WDOCSH_HXX
|
|
|
|
#include <wdocsh.hxx>
|
|
|
|
#endif
|
|
|
|
#include <swrect.hxx>
|
|
|
|
#include <crstate.hxx>
|
2003-03-27 14:45:43 +00:00
|
|
|
#include <svtools/colorcfg.hxx>
|
2002-08-28 11:24:07 +00:00
|
|
|
#include <svtools/accessibilityoptions.hxx>
|
2009-09-08 04:57:32 +00:00
|
|
|
#include <svtools/syslocale.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-02-03 15:36:59 +00:00
|
|
|
#include <svx/acorrcfg.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-07-10 14:03:42 +02:00
|
|
|
#ifdef DBG_UTIL
|
2000-09-18 16:15:01 +00:00
|
|
|
BOOL SwViewOption::bTest9 = FALSE; //DrawingLayerNotLoading
|
|
|
|
#endif
|
2002-04-25 13:00:16 +00:00
|
|
|
Color SwViewOption::aDocBoundColor(COL_LIGHTGRAY);
|
|
|
|
Color SwViewOption::aObjectBoundColor(COL_LIGHTGRAY);
|
|
|
|
Color SwViewOption::aDocColor(COL_LIGHTGRAY);
|
|
|
|
Color SwViewOption::aAppBackgroundColor(COL_LIGHTGRAY);
|
|
|
|
Color SwViewOption::aTableBoundColor(COL_LIGHTGRAY);
|
|
|
|
Color SwViewOption::aIndexShadingsColor(COL_LIGHTGRAY);
|
|
|
|
Color SwViewOption::aLinksColor(COL_BLUE);
|
|
|
|
Color SwViewOption::aVisitedLinksColor(COL_RED);
|
|
|
|
Color SwViewOption::aDirectCursorColor(COL_BLUE);
|
|
|
|
Color SwViewOption::aTextGridColor(COL_LIGHTGRAY);
|
2002-04-12 09:39:11 +00:00
|
|
|
Color SwViewOption::aSpellColor(COL_LIGHTRED);
|
2007-06-27 12:23:39 +00:00
|
|
|
Color SwViewOption::aSmarttagColor(COL_LIGHTMAGENTA);
|
2002-12-05 09:06:50 +00:00
|
|
|
Color SwViewOption::aFontColor(COL_BLACK);
|
2002-04-25 13:00:16 +00:00
|
|
|
Color SwViewOption::aFieldShadingsColor(COL_LIGHTGRAY);
|
|
|
|
Color SwViewOption::aSectionBoundColor(COL_LIGHTGRAY);
|
2002-07-31 11:53:43 +00:00
|
|
|
Color SwViewOption::aPageBreakColor(COL_BLUE);
|
2002-04-25 13:00:16 +00:00
|
|
|
Color SwViewOption::aScriptIndicatorColor(COL_GREEN);
|
2002-04-12 09:39:11 +00:00
|
|
|
|
2002-04-25 13:00:16 +00:00
|
|
|
sal_Int32 SwViewOption::nAppearanceFlags = VIEWOPT_DOC_BOUNDARIES|VIEWOPT_OBJECT_BOUNDARIES;
|
2000-09-18 16:15:01 +00:00
|
|
|
USHORT SwViewOption::nPixelTwips = 0; //ein Pixel auf dem Bildschirm
|
|
|
|
|
|
|
|
|
|
|
|
#define LINEBREAK_SIZE 12, 8
|
|
|
|
#define TAB_SIZE 12, 6
|
|
|
|
|
|
|
|
#define MIN_BLANKWIDTH 40
|
|
|
|
#define MIN_BLANKHEIGHT 40
|
|
|
|
#define MIN_TABWIDTH 120
|
|
|
|
#define MIN_TABHEIGHT 200
|
|
|
|
|
|
|
|
static const char __FAR_DATA aPostItStr[] = " ";
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwViewOption::IsEqualFlags()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
BOOL SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const
|
|
|
|
{
|
|
|
|
return nCoreOptions == rOpt.nCoreOptions
|
|
|
|
&& nCore2Options == rOpt.nCore2Options
|
|
|
|
&& aSnapSize == rOpt.aSnapSize
|
2008-03-07 14:03:19 +00:00
|
|
|
&& mnViewLayoutColumns == rOpt.mnViewLayoutColumns
|
2000-09-18 16:15:01 +00:00
|
|
|
&& nDivisionX == rOpt.GetDivisionX()
|
|
|
|
&& nDivisionY == rOpt.GetDivisionY()
|
|
|
|
&& nPagePrevRow == rOpt.GetPagePrevRow()
|
|
|
|
&& nPagePrevCol == rOpt.GetPagePrevCol()
|
|
|
|
&& aRetoucheColor == rOpt.GetRetoucheColor()
|
2004-11-16 09:25:31 +00:00
|
|
|
&& bFormView == rOpt.IsFormView()
|
2008-03-07 14:03:19 +00:00
|
|
|
&& mbViewLayoutBookMode == rOpt.mbViewLayoutBookMode
|
2009-02-13 11:19:56 +00:00
|
|
|
&& bShowPlaceHolderFields == rOpt.bShowPlaceHolderFields
|
2009-07-10 14:03:42 +02:00
|
|
|
#ifdef DBG_UTIL
|
2000-09-18 16:15:01 +00:00
|
|
|
// korrespondieren zu den Angaben in ui/config/cfgvw.src
|
|
|
|
&& bTest1 == rOpt.IsTest1()
|
|
|
|
&& bTest2 == rOpt.IsTest2()
|
|
|
|
&& bTest3 == rOpt.IsTest3()
|
|
|
|
&& bTest4 == rOpt.IsTest4()
|
|
|
|
&& bTest5 == rOpt.IsTest5()
|
|
|
|
&& bTest6 == rOpt.IsTest6()
|
|
|
|
&& bTest7 == rOpt.IsTest7()
|
|
|
|
&& bTest8 == rOpt.IsTest8()
|
|
|
|
&& bTest10 == rOpt.IsTest10()
|
|
|
|
#endif
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwViewOption::DrawRect()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwViewOption::DrawRect( OutputDevice *pOut,
|
|
|
|
const SwRect &rRect, long nCol ) const
|
|
|
|
{
|
|
|
|
if ( pOut->GetOutDevType() != OUTDEV_PRINTER )
|
|
|
|
{
|
|
|
|
const Color aCol( nCol );
|
|
|
|
const Color aOldColor( pOut->GetFillColor() );
|
|
|
|
pOut->SetFillColor( aCol );
|
|
|
|
pOut->DrawRect( rRect.SVRect() );
|
|
|
|
pOut->SetFillColor( aOldColor );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
DrawRectPrinter( pOut, rRect );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwViewOption::DrawRectPrinter()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
void SwViewOption::DrawRectPrinter( OutputDevice *pOut,
|
|
|
|
const SwRect &rRect ) const
|
|
|
|
{
|
|
|
|
Color aOldColor(pOut->GetLineColor());
|
|
|
|
Color aOldFillColor( pOut->GetFillColor() );
|
|
|
|
pOut->SetLineColor( Color(COL_BLACK) );
|
|
|
|
pOut->SetFillColor( Color(COL_TRANSPARENT ));
|
|
|
|
pOut->DrawRect( rRect.SVRect() );
|
|
|
|
pOut->SetFillColor( aOldFillColor );
|
|
|
|
pOut->SetLineColor( aOldColor );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwViewOption::GetPostItsWidth()
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
USHORT SwViewOption::GetPostItsWidth( const OutputDevice *pOut ) const
|
|
|
|
{
|
|
|
|
ASSERT( pOut, "no Outdev" );
|
|
|
|
return USHORT(pOut->GetTextWidth( String::CreateFromAscii(aPostItStr )));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* SwViewOption::PaintPostIts()
|
|
|
|
*************************************************************************/
|
|
|
|
|
2008-02-19 12:53:43 +00:00
|
|
|
void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect, sal_Bool bIsScript ) const
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2008-03-18 15:49:01 +00:00
|
|
|
if( pOut && bIsScript )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2008-03-18 15:49:01 +00:00
|
|
|
Color aOldLineColor( pOut->GetLineColor() );
|
2000-09-18 16:15:01 +00:00
|
|
|
pOut->SetLineColor( Color(COL_GRAY ) );
|
|
|
|
// Wir ziehen ueberall zwei Pixel ab, damit es schick aussieht
|
|
|
|
USHORT nPix = GetPixelTwips() * 2;
|
|
|
|
if( rRect.Width() <= 2 * nPix || rRect.Height() <= 2 * nPix )
|
|
|
|
nPix = 0;
|
|
|
|
const Point aTopLeft( rRect.Left() + nPix, rRect.Top() + nPix );
|
|
|
|
const Point aBotRight( rRect.Right() - nPix, rRect.Bottom() - nPix );
|
|
|
|
const SwRect aRect( aTopLeft, aBotRight );
|
2008-02-19 12:53:43 +00:00
|
|
|
DrawRect( pOut, aRect, aScriptIndicatorColor.GetColor() );
|
2008-03-18 15:49:01 +00:00
|
|
|
pOut->SetLineColor( aOldLineColor );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* ViewOption::ViewOption()
|
|
|
|
|*
|
|
|
|
|* Letzte Aenderung MA 04. Aug. 93
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
SwViewOption::SwViewOption() :
|
2007-09-27 10:29:40 +00:00
|
|
|
aRetoucheColor( COL_TRANSPARENT ),
|
2008-03-07 14:03:19 +00:00
|
|
|
mnViewLayoutColumns( 0 ),
|
2000-09-18 16:15:01 +00:00
|
|
|
nPagePrevRow( 1 ),
|
|
|
|
nPagePrevCol( 2 ),
|
2007-09-27 10:29:40 +00:00
|
|
|
nShdwCrsrFillMode( FILL_TAB ),
|
2000-09-18 16:15:01 +00:00
|
|
|
bReadonly(FALSE),
|
2007-09-27 10:29:40 +00:00
|
|
|
bStarOneSetting(FALSE),
|
|
|
|
bIsPagePreview(FALSE),
|
2002-08-01 13:13:38 +00:00
|
|
|
bSelectionInReadonly(FALSE),
|
2004-11-16 09:25:31 +00:00
|
|
|
// --> FME 2004-06-29 #114856# Formular view
|
|
|
|
bFormView(FALSE),
|
|
|
|
// <--
|
2007-09-27 10:29:40 +00:00
|
|
|
bBookview(FALSE),
|
2008-03-07 14:03:19 +00:00
|
|
|
mbViewLayoutBookMode(FALSE),
|
2007-11-26 16:33:44 +00:00
|
|
|
bShowPlaceHolderFields( sal_True ),
|
2007-09-27 10:29:40 +00:00
|
|
|
|
|
|
|
nZoom( 100 ),
|
|
|
|
eZoom( SVX_ZOOM_PERCENT ),
|
|
|
|
nTblDest(TBL_DEST_CELL)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
// Initialisierung ist jetzt etwas einfacher
|
|
|
|
// alle Bits auf 0
|
|
|
|
nCoreOptions = VIEWOPT_1_IDLE | VIEWOPT_1_HARDBLANK | VIEWOPT_1_SOFTHYPH |
|
2002-04-25 13:00:16 +00:00
|
|
|
VIEWOPT_1_REF |
|
|
|
|
VIEWOPT_1_GRAPHIC |
|
2000-09-18 16:15:01 +00:00
|
|
|
VIEWOPT_1_TABLE | VIEWOPT_1_DRAW | VIEWOPT_1_CONTROL |
|
2002-04-25 13:00:16 +00:00
|
|
|
VIEWOPT_1_PAGEBACK |
|
2000-09-18 16:15:01 +00:00
|
|
|
VIEWOPT_1_SOLIDMARKHDL | VIEWOPT_1_POSTITS;
|
2002-05-02 10:14:55 +00:00
|
|
|
nCore2Options = VIEWOPT_CORE2_BLACKFONT | VIEWOPT_CORE2_HIDDENPARA;
|
2007-06-27 12:23:39 +00:00
|
|
|
nUIOptions = VIEWOPT_2_MODIFIED | VIEWOPT_2_GRFKEEPZOOM |VIEWOPT_2_ANY_RULER;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-09-08 04:57:32 +00:00
|
|
|
if(MEASURE_METRIC != SvtSysLocale().GetLocaleData().getMeasurementSystemEnum())
|
2000-09-18 16:15:01 +00:00
|
|
|
aSnapSize.Width() = aSnapSize.Height() = 720; // 1/2"
|
|
|
|
else
|
|
|
|
aSnapSize.Width() = aSnapSize.Height() = 567; // 1 cm
|
|
|
|
nDivisionX = nDivisionY = 1;
|
|
|
|
|
2002-08-28 11:24:07 +00:00
|
|
|
bSelectionInReadonly = SW_MOD()->GetAccessibilityOptions().IsSelectionInReadonly();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-07-10 14:03:42 +02:00
|
|
|
#ifdef DBG_UTIL
|
2000-09-18 16:15:01 +00:00
|
|
|
// korrespondieren zu den Angaben in ui/config/cfgvw.src
|
|
|
|
bTest1 = bTest2 = bTest3 = bTest4 =
|
|
|
|
bTest5 = bTest6 = bTest7 = bTest8 = bTest10 = FALSE;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
SwViewOption::SwViewOption(const SwViewOption& rVOpt)
|
|
|
|
{
|
|
|
|
bReadonly = FALSE;
|
2002-08-01 13:13:38 +00:00
|
|
|
bSelectionInReadonly = FALSE;
|
2004-11-16 09:25:31 +00:00
|
|
|
// --> FME 2004-06-29 #114856# Formular view
|
|
|
|
bFormView = rVOpt.bFormView;
|
|
|
|
// <--
|
2000-09-18 16:15:01 +00:00
|
|
|
nZoom = rVOpt.nZoom ;
|
|
|
|
aSnapSize = rVOpt.aSnapSize ;
|
2008-03-07 14:03:19 +00:00
|
|
|
mnViewLayoutColumns = rVOpt.mnViewLayoutColumns ;
|
2000-09-18 16:15:01 +00:00
|
|
|
nDivisionX = rVOpt.nDivisionX ;
|
|
|
|
nDivisionY = rVOpt.nDivisionY ;
|
|
|
|
nPagePrevRow = rVOpt.nPagePrevRow;
|
|
|
|
nPagePrevCol = rVOpt.nPagePrevCol;
|
2002-05-07 09:57:47 +00:00
|
|
|
bIsPagePreview = rVOpt.bIsPagePreview;
|
2000-09-18 16:15:01 +00:00
|
|
|
eZoom = rVOpt.eZoom ;
|
|
|
|
nTblDest = rVOpt.nTblDest ;
|
|
|
|
nUIOptions = rVOpt.nUIOptions ;
|
|
|
|
nCoreOptions = rVOpt.nCoreOptions ;
|
|
|
|
nCore2Options = rVOpt.nCore2Options ;
|
|
|
|
aRetoucheColor = rVOpt.GetRetoucheColor();
|
|
|
|
sSymbolFont = rVOpt.sSymbolFont;
|
|
|
|
nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode;
|
|
|
|
bStarOneSetting = rVOpt.bStarOneSetting;
|
2004-04-21 08:41:08 +00:00
|
|
|
bBookview = rVOpt.bBookview;
|
2008-03-07 14:03:19 +00:00
|
|
|
mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode;
|
2007-11-26 16:33:44 +00:00
|
|
|
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-07-10 14:03:42 +02:00
|
|
|
#ifdef DBG_UTIL
|
2000-09-18 16:15:01 +00:00
|
|
|
bTest1 = rVOpt.bTest1 ;
|
|
|
|
bTest2 = rVOpt.bTest2 ;
|
|
|
|
bTest3 = rVOpt.bTest3 ;
|
|
|
|
bTest4 = rVOpt.bTest4 ;
|
|
|
|
bTest5 = rVOpt.bTest5 ;
|
|
|
|
bTest6 = rVOpt.bTest6 ;
|
|
|
|
bTest7 = rVOpt.bTest7 ;
|
|
|
|
bTest8 = rVOpt.bTest8 ;
|
|
|
|
bTest10 = rVOpt.bTest10 ;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt )
|
|
|
|
{
|
2004-11-16 09:25:31 +00:00
|
|
|
// --> DVO FME 2004-06-29 #114856# Formular view
|
|
|
|
bFormView = rVOpt.bFormView ;
|
|
|
|
// <--
|
2000-09-18 16:15:01 +00:00
|
|
|
nZoom = rVOpt.nZoom ;
|
|
|
|
aSnapSize = rVOpt.aSnapSize ;
|
2008-03-07 14:03:19 +00:00
|
|
|
mnViewLayoutColumns = rVOpt.mnViewLayoutColumns ;
|
2000-09-18 16:15:01 +00:00
|
|
|
nDivisionX = rVOpt.nDivisionX ;
|
|
|
|
nDivisionY = rVOpt.nDivisionY ;
|
|
|
|
nPagePrevRow = rVOpt.nPagePrevRow;
|
|
|
|
nPagePrevCol = rVOpt.nPagePrevCol;
|
2002-05-06 11:11:40 +00:00
|
|
|
bIsPagePreview = rVOpt.bIsPagePreview;
|
2000-09-18 16:15:01 +00:00
|
|
|
eZoom = rVOpt.eZoom ;
|
|
|
|
nTblDest = rVOpt.nTblDest ;
|
|
|
|
nUIOptions = rVOpt.nUIOptions ;
|
|
|
|
nCoreOptions = rVOpt.nCoreOptions;
|
|
|
|
nCore2Options = rVOpt.nCore2Options;
|
|
|
|
aRetoucheColor = rVOpt.GetRetoucheColor();
|
|
|
|
sSymbolFont = rVOpt.sSymbolFont;
|
|
|
|
nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode;
|
|
|
|
bStarOneSetting = rVOpt.bStarOneSetting;
|
2004-04-21 08:41:08 +00:00
|
|
|
bBookview = rVOpt.bBookview;
|
2008-03-07 14:03:19 +00:00
|
|
|
mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode;
|
2007-11-26 16:33:44 +00:00
|
|
|
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2009-07-10 14:03:42 +02:00
|
|
|
#ifdef DBG_UTIL
|
2000-09-18 16:15:01 +00:00
|
|
|
bTest1 = rVOpt.bTest1 ;
|
|
|
|
bTest2 = rVOpt.bTest2 ;
|
|
|
|
bTest3 = rVOpt.bTest3 ;
|
|
|
|
bTest4 = rVOpt.bTest4 ;
|
|
|
|
bTest5 = rVOpt.bTest5 ;
|
|
|
|
bTest6 = rVOpt.bTest6 ;
|
|
|
|
bTest7 = rVOpt.bTest7 ;
|
|
|
|
bTest8 = rVOpt.bTest8 ;
|
|
|
|
bTest10 = rVOpt.bTest10 ;
|
|
|
|
#endif
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SwViewOption::~SwViewOption()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* ViewOption::Init()
|
|
|
|
|*
|
|
|
|
|* Letzte Aenderung MA 04. Aug. 93
|
|
|
|
|*
|
|
|
|
|*************************************************************************/
|
|
|
|
|
|
|
|
void SwViewOption::Init( Window *pWin )
|
|
|
|
{
|
|
|
|
if( !nPixelTwips && pWin )
|
|
|
|
{
|
|
|
|
nPixelTwips = (USHORT)pWin->PixelToLogic( Size(1,1) ).Height();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL SwViewOption::IsAutoCompleteWords() const
|
|
|
|
{
|
2004-02-03 15:36:59 +00:00
|
|
|
const SvxSwAutoFmtFlags& rFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
|
2000-09-18 16:15:01 +00:00
|
|
|
return /*rFlags.bAutoCompleteWords &&*/ rFlags.bAutoCmpltCollectWords;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************/
|
2007-09-27 10:29:40 +00:00
|
|
|
/* */
|
2000-09-18 16:15:01 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
AuthorCharAttr::AuthorCharAttr() :
|
|
|
|
nItemId (SID_ATTR_CHAR_UNDERLINE),
|
|
|
|
nAttr (UNDERLINE_SINGLE),
|
|
|
|
nColor (COL_TRANSPARENT)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-----------------07.01.97 13.50-------------------
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
|
|
|
|
USHORT GetHtmlMode(const SwDocShell* pShell)
|
|
|
|
{
|
|
|
|
USHORT nRet = 0;
|
|
|
|
if(!pShell || PTR_CAST(SwWebDocShell, pShell))
|
|
|
|
{
|
|
|
|
nRet = HTMLMODE_ON;
|
2004-02-03 15:36:59 +00:00
|
|
|
SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
|
2000-09-18 16:15:01 +00:00
|
|
|
switch ( pHtmlOpt->GetExportMode() )
|
|
|
|
{
|
|
|
|
case HTML_CFG_MSIE_40:
|
|
|
|
nRet |= HTMLMODE_PARA_BORDER|HTMLMODE_SMALL_CAPS|
|
|
|
|
HTMLMODE_SOME_STYLES|
|
|
|
|
HTMLMODE_FULL_STYLES|HTMLMODE_GRAPH_POS|
|
|
|
|
HTMLMODE_FULL_ABS_POS|HTMLMODE_SOME_ABS_POS;
|
|
|
|
break;
|
|
|
|
case HTML_CFG_NS40:
|
|
|
|
nRet |= HTMLMODE_PARA_BORDER|HTMLMODE_SOME_STYLES|
|
|
|
|
HTMLMODE_FRM_COLUMNS|HTMLMODE_BLINK|HTMLMODE_GRAPH_POS|
|
|
|
|
HTMLMODE_SOME_ABS_POS;
|
|
|
|
break;
|
|
|
|
case HTML_CFG_WRITER:
|
|
|
|
nRet |= HTMLMODE_PARA_BORDER|HTMLMODE_SMALL_CAPS|
|
|
|
|
HTMLMODE_SOME_STYLES|
|
|
|
|
HTMLMODE_FRM_COLUMNS|HTMLMODE_FULL_STYLES|
|
|
|
|
HTMLMODE_BLINK|HTMLMODE_DROPCAPS|HTMLMODE_GRAPH_POS|
|
|
|
|
HTMLMODE_FULL_ABS_POS|HTMLMODE_SOME_ABS_POS;
|
|
|
|
break;
|
|
|
|
case HTML_CFG_HTML32:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nRet;
|
|
|
|
}
|
2002-04-25 13:00:16 +00:00
|
|
|
/* -----------------------------24.04.2002 10:20------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2002-04-12 09:39:11 +00:00
|
|
|
---------------------------------------------------------------------------*/
|
2002-04-25 13:00:16 +00:00
|
|
|
Color& SwViewOption::GetDocColor()
|
|
|
|
{
|
|
|
|
return aDocColor;
|
|
|
|
}
|
|
|
|
/* -----------------------------23.04.2002 17:18------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetDocBoundariesColor()
|
|
|
|
{
|
|
|
|
return aDocBoundColor;
|
|
|
|
}
|
|
|
|
/* -----------------------------23.04.2002 17:53------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetObjectBoundariesColor()
|
|
|
|
{
|
|
|
|
return aObjectBoundColor;
|
|
|
|
}
|
|
|
|
/* -----------------------------24.04.2002 10:41------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetAppBackgroundColor()
|
|
|
|
{
|
|
|
|
return aAppBackgroundColor;
|
|
|
|
}
|
|
|
|
/*-- 24.04.2002 10:50:11---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetTableBoundariesColor()
|
|
|
|
{
|
|
|
|
return aTableBoundColor;
|
|
|
|
}
|
|
|
|
/*-- 24.04.2002 10:50:12---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetIndexShadingsColor()
|
|
|
|
{
|
|
|
|
return aIndexShadingsColor;
|
|
|
|
}
|
|
|
|
/*-- 24.04.2002 10:50:12---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetLinksColor()
|
|
|
|
{
|
|
|
|
return aLinksColor;
|
|
|
|
}
|
|
|
|
/*-- 24.04.2002 10:50:13---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetVisitedLinksColor()
|
|
|
|
{
|
|
|
|
return aVisitedLinksColor;
|
|
|
|
}
|
|
|
|
/*-- 24.04.2002 10:50:13---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetDirectCursorColor()
|
|
|
|
{
|
|
|
|
return aDirectCursorColor;
|
|
|
|
}
|
|
|
|
/*-- 24.04.2002 10:50:14---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetTextGridColor()
|
|
|
|
{
|
|
|
|
return aTextGridColor;
|
|
|
|
}
|
|
|
|
/*-- 24.04.2002 10:50:14---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
2002-04-12 09:39:11 +00:00
|
|
|
Color& SwViewOption::GetSpellColor()
|
|
|
|
{
|
|
|
|
return aSpellColor;
|
|
|
|
}
|
2007-06-27 12:23:39 +00:00
|
|
|
/*-- 24.04.2007 10:50:14---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetSmarttagColor()
|
|
|
|
{
|
|
|
|
return aSmarttagColor;
|
|
|
|
}
|
2002-12-05 09:06:50 +00:00
|
|
|
/*-- 06.12.2002 10:50:11---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetFontColor()
|
|
|
|
{
|
|
|
|
return aFontColor;
|
|
|
|
}
|
2002-04-25 13:00:16 +00:00
|
|
|
/*-- 24.04.2002 10:50:15---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetFieldShadingsColor()
|
|
|
|
{
|
|
|
|
return aFieldShadingsColor;
|
|
|
|
}
|
|
|
|
/*-- 24.04.2002 10:50:15---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetSectionBoundColor()
|
|
|
|
{
|
|
|
|
return aSectionBoundColor;
|
|
|
|
}
|
2002-07-31 11:53:43 +00:00
|
|
|
/* -----------------------------2002/07/31 14:00------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
Color& SwViewOption::GetPageBreakColor()
|
|
|
|
{
|
|
|
|
return aPageBreakColor;
|
|
|
|
}
|
2002-04-25 13:00:16 +00:00
|
|
|
|
|
|
|
/* -----------------------------23.04.2002 17:41------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
2003-03-27 14:45:43 +00:00
|
|
|
void SwViewOption::ApplyColorConfigValues(const svtools::ColorConfig& rConfig )
|
2002-04-25 13:00:16 +00:00
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
aDocColor.SetColor(rConfig.GetColorValue(svtools::DOCCOLOR).nColor);
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
svtools::ColorConfigValue aValue = rConfig.GetColorValue(svtools::DOCBOUNDARIES);
|
2002-04-25 13:00:16 +00:00
|
|
|
aDocBoundColor.SetColor(aValue.nColor);
|
|
|
|
nAppearanceFlags = 0;
|
|
|
|
if(aValue.bIsVisible)
|
|
|
|
nAppearanceFlags |= VIEWOPT_DOC_BOUNDARIES;
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aAppBackgroundColor.SetColor(rConfig.GetColorValue(svtools::APPBACKGROUND).nColor);
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aValue = rConfig.GetColorValue(svtools::OBJECTBOUNDARIES);
|
2002-04-25 13:00:16 +00:00
|
|
|
aObjectBoundColor.SetColor(aValue.nColor);
|
|
|
|
if(aValue.bIsVisible)
|
|
|
|
nAppearanceFlags |= VIEWOPT_OBJECT_BOUNDARIES;
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aValue = rConfig.GetColorValue(svtools::TABLEBOUNDARIES);
|
2002-04-25 13:00:16 +00:00
|
|
|
aTableBoundColor.SetColor(aValue.nColor);
|
|
|
|
if(aValue.bIsVisible)
|
|
|
|
nAppearanceFlags |= VIEWOPT_TABLE_BOUNDARIES;
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aValue = rConfig.GetColorValue(svtools::WRITERIDXSHADINGS);
|
2002-04-25 13:00:16 +00:00
|
|
|
aIndexShadingsColor.SetColor(aValue.nColor);
|
|
|
|
if(aValue.bIsVisible)
|
|
|
|
nAppearanceFlags |= VIEWOPT_INDEX_SHADINGS;
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aValue = rConfig.GetColorValue(svtools::LINKS);
|
2002-04-25 13:00:16 +00:00
|
|
|
aLinksColor.SetColor(aValue.nColor);
|
|
|
|
if(aValue.bIsVisible)
|
|
|
|
nAppearanceFlags |= VIEWOPT_LINKS;
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aValue = rConfig.GetColorValue(svtools::LINKSVISITED);
|
2002-04-25 13:00:16 +00:00
|
|
|
aVisitedLinksColor.SetColor(aValue.nColor);
|
|
|
|
if(aValue.bIsVisible)
|
|
|
|
nAppearanceFlags |= VIEWOPT_VISITED_LINKS;
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aDirectCursorColor.SetColor(rConfig.GetColorValue(svtools::WRITERDIRECTCURSOR).nColor);
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aTextGridColor.SetColor(rConfig.GetColorValue(svtools::WRITERTEXTGRID).nColor);
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aSpellColor.SetColor(rConfig.GetColorValue(svtools::SPELL).nColor);
|
2002-04-25 13:00:16 +00:00
|
|
|
|
2007-06-27 12:23:39 +00:00
|
|
|
aSmarttagColor.SetColor(rConfig.GetColorValue(svtools::SMARTTAGS).nColor);
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aFontColor.SetColor(rConfig.GetColorValue(svtools::FONTCOLOR).nColor);
|
2002-12-05 09:06:50 +00:00
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aValue = rConfig.GetColorValue(svtools::WRITERFIELDSHADINGS);
|
2002-04-25 13:00:16 +00:00
|
|
|
aFieldShadingsColor.SetColor(aValue.nColor);
|
|
|
|
if(aValue.bIsVisible)
|
|
|
|
nAppearanceFlags |= VIEWOPT_FIELD_SHADINGS;
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aValue = rConfig.GetColorValue(svtools::WRITERSECTIONBOUNDARIES);
|
2002-04-25 13:00:16 +00:00
|
|
|
aSectionBoundColor.SetColor(aValue.nColor);
|
|
|
|
if(aValue.bIsVisible)
|
|
|
|
nAppearanceFlags |= VIEWOPT_SECTION_BOUNDARIES;
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aValue = rConfig.GetColorValue(svtools::WRITERPAGEBREAKS);
|
2002-07-31 11:53:43 +00:00
|
|
|
aPageBreakColor.SetColor(aValue.nColor);
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
aScriptIndicatorColor.SetColor(rConfig.GetColorValue(svtools::WRITERSCRIPTINDICATOR).nColor);
|
2002-04-25 13:00:16 +00:00
|
|
|
}
|
|
|
|
/* -----------------------------23.04.2002 17:48------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
void SwViewOption::SetAppearanceFlag(sal_Int32 nFlag, BOOL bSet, BOOL bSaveInConfig )
|
|
|
|
{
|
|
|
|
if(bSet)
|
|
|
|
nAppearanceFlags |= nFlag;
|
|
|
|
else
|
|
|
|
nAppearanceFlags &= ~nFlag;
|
|
|
|
if(bSaveInConfig)
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
//create an editable svtools::ColorConfig and store the change
|
|
|
|
svtools::EditableColorConfig aEditableConfig;
|
2002-04-25 13:00:16 +00:00
|
|
|
struct FlagToConfig_Impl
|
|
|
|
{
|
|
|
|
sal_Int32 nFlag;
|
2003-03-27 14:45:43 +00:00
|
|
|
svtools::ColorConfigEntry eEntry;
|
2002-04-25 13:00:16 +00:00
|
|
|
};
|
|
|
|
static const FlagToConfig_Impl aFlags[] =
|
|
|
|
{
|
2007-09-27 10:29:40 +00:00
|
|
|
{ VIEWOPT_DOC_BOUNDARIES , svtools::DOCBOUNDARIES },
|
|
|
|
{ VIEWOPT_OBJECT_BOUNDARIES , svtools::OBJECTBOUNDARIES },
|
|
|
|
{ VIEWOPT_TABLE_BOUNDARIES , svtools::TABLEBOUNDARIES },
|
|
|
|
{ VIEWOPT_INDEX_SHADINGS , svtools::WRITERIDXSHADINGS },
|
|
|
|
{ VIEWOPT_LINKS , svtools::LINKS },
|
|
|
|
{ VIEWOPT_VISITED_LINKS , svtools::LINKSVISITED },
|
|
|
|
{ VIEWOPT_FIELD_SHADINGS , svtools::WRITERFIELDSHADINGS },
|
|
|
|
{ VIEWOPT_SECTION_BOUNDARIES , svtools::WRITERSECTIONBOUNDARIES },
|
|
|
|
{ 0 , svtools::ColorConfigEntryCount }
|
2002-04-25 13:00:16 +00:00
|
|
|
};
|
|
|
|
sal_uInt16 nPos = 0;
|
|
|
|
while(aFlags[nPos].nFlag)
|
|
|
|
{
|
|
|
|
if(0 != (nFlag&aFlags[nPos].nFlag))
|
|
|
|
{
|
2003-03-27 14:45:43 +00:00
|
|
|
svtools::ColorConfigValue aValue = aEditableConfig.GetColorValue(aFlags[nPos].eEntry);
|
2002-04-25 13:00:16 +00:00
|
|
|
aValue.bIsVisible = bSet;
|
|
|
|
aEditableConfig.SetColorValue(aFlags[nPos].eEntry, aValue);
|
|
|
|
}
|
|
|
|
nPos++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* -----------------------------24.04.2002 10:42------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2002-04-12 09:39:11 +00:00
|
|
|
---------------------------------------------------------------------------*/
|
2002-04-25 13:00:16 +00:00
|
|
|
BOOL SwViewOption::IsAppearanceFlag(sal_Int32 nFlag)
|
2002-04-12 09:39:11 +00:00
|
|
|
{
|
2002-04-25 13:00:16 +00:00
|
|
|
return 0 != (nAppearanceFlags & nFlag);
|
2002-04-12 09:39:11 +00:00
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|