2000-09-18 16:15:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: usrpref.cxx,v $
|
|
|
|
*
|
2002-08-13 14:00:05 +00:00
|
|
|
* $Revision: 1.21 $
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
2002-08-13 14:00:05 +00:00
|
|
|
* last change: $Author: os $ $Date: 2002-08-13 15:00:05 $
|
2000-09-18 16:15:01 +00:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (the "License"); You may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of the
|
|
|
|
* License at http://www.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifdef PRECOMPILED
|
|
|
|
#include "ui_pch.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#pragma hdrstop
|
|
|
|
|
|
|
|
#ifndef _STREAM_HXX //autogen
|
|
|
|
#include <tools/stream.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include "swtypes.hxx"
|
|
|
|
#include "hintids.hxx"
|
|
|
|
#include "uitool.hxx"
|
|
|
|
#include "usrpref.hxx"
|
|
|
|
#include "crstate.hxx"
|
|
|
|
#ifndef _OFA_OSPLCFG_HXX
|
|
|
|
#include <offmgr/osplcfg.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _OFF_APP_HXX //autogen
|
|
|
|
#include <offmgr/app.hxx>
|
|
|
|
#endif
|
|
|
|
|
2000-11-19 10:41:10 +00:00
|
|
|
#ifndef _LINGUISTIC_LNGPROPS_HHX_
|
|
|
|
#include <linguistic/lngprops.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertySet.hpp>
|
|
|
|
#endif
|
2000-09-28 14:25:03 +00:00
|
|
|
#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
|
|
|
|
#include <com/sun/star/uno/Any.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
#endif
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
using namespace utl;
|
|
|
|
using namespace rtl;
|
2000-09-18 16:15:01 +00:00
|
|
|
using namespace ::com::sun::star;
|
2000-09-28 14:25:03 +00:00
|
|
|
using namespace com::sun::star::uno;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#define C2U(cChar) OUString::createFromAscii(cChar)
|
|
|
|
#define C2S(cChar) String::CreateFromAscii(cChar)
|
|
|
|
|
|
|
|
void SwMasterUsrPref::SetUsrPref(const SwViewOption &rCopy)
|
|
|
|
{
|
|
|
|
*((SwViewOption*)this) = rCopy;
|
|
|
|
}
|
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
SwMasterUsrPref::SwMasterUsrPref(BOOL bWeb) :
|
|
|
|
aContentConfig(bWeb, *this),
|
2001-01-19 11:45:03 +00:00
|
|
|
aLayoutConfig(bWeb, *this),
|
2001-01-24 10:14:45 +00:00
|
|
|
aGridConfig(bWeb, *this),
|
2001-01-24 15:08:03 +00:00
|
|
|
aCursorConfig(*this),
|
2001-02-13 08:52:11 +00:00
|
|
|
pWebColorConfig(bWeb ? new SwWebColorConfig(*this) : 0),
|
2001-01-24 10:14:45 +00:00
|
|
|
nFldUpdateFlags(0),
|
2001-04-09 08:46:35 +00:00
|
|
|
nLinkUpdateMode(0),
|
|
|
|
eHScrollMetric(FUNIT_CM),
|
|
|
|
eVScrollMetric(FUNIT_CM),
|
|
|
|
bIsHScrollMetricSet(sal_False),
|
|
|
|
bIsVScrollMetricSet(sal_False)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2000-09-28 14:25:03 +00:00
|
|
|
aContentConfig.Load();
|
|
|
|
aLayoutConfig.Load();
|
2001-01-19 11:45:03 +00:00
|
|
|
aGridConfig.Load();
|
2001-01-24 15:08:03 +00:00
|
|
|
aCursorConfig.Load();
|
2001-02-13 08:52:11 +00:00
|
|
|
if(pWebColorConfig)
|
|
|
|
pWebColorConfig->Load();
|
|
|
|
}
|
|
|
|
/* -----------------------------13.02.01 09:48--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
SwMasterUsrPref::~SwMasterUsrPref()
|
|
|
|
{
|
|
|
|
delete pWebColorConfig;
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:32---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Sequence<OUString> SwContentViewConfig::GetPropertyNames()
|
|
|
|
{
|
|
|
|
static const char* aPropNames[] =
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2000-09-28 14:25:03 +00:00
|
|
|
"Display/GraphicObject", // 0
|
|
|
|
"Display/Table", // 1
|
|
|
|
"Display/DrawingControl", // 2
|
|
|
|
"Display/FieldCode", // 3
|
|
|
|
"Display/Note", // 4
|
2001-09-20 11:49:29 +00:00
|
|
|
"Display/PreventTips", // 5
|
2002-04-25 13:00:16 +00:00
|
|
|
"NonprintingCharacter/MetaCharacters", // 6
|
|
|
|
"NonprintingCharacter/ParagraphEnd", // 7
|
|
|
|
"NonprintingCharacter/OptionalHyphen", // 8
|
|
|
|
"NonprintingCharacter/Space", // 9
|
2002-05-14 12:17:46 +00:00
|
|
|
"NonprintingCharacter/Break", // 10
|
|
|
|
"NonprintingCharacter/ProtectedSpace", // 11
|
|
|
|
"NonprintingCharacter/Tab", // 12 //not in Writer/Web
|
2002-04-25 13:00:16 +00:00
|
|
|
"NonprintingCharacter/HiddenText", // 13
|
|
|
|
"NonprintingCharacter/HiddenParagraph", // 14
|
|
|
|
"Update/Link", // 15
|
|
|
|
"Update/Field", // 16
|
|
|
|
"Update/Chart" // 17
|
2001-01-24 10:14:45 +00:00
|
|
|
|
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
};
|
2002-05-14 12:17:46 +00:00
|
|
|
const int nCount = bWeb ? 12 : 18;
|
2000-09-28 14:25:03 +00:00
|
|
|
Sequence<OUString> aNames(nCount);
|
|
|
|
OUString* pNames = aNames.getArray();
|
|
|
|
for(int i = 0; i < nCount; i++)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2000-09-28 14:25:03 +00:00
|
|
|
pNames[i] = OUString::createFromAscii(aPropNames[i]);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2000-09-28 14:25:03 +00:00
|
|
|
return aNames;
|
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:33---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwContentViewConfig::SwContentViewConfig(BOOL bIsWeb, SwMasterUsrPref& rPar) :
|
2001-06-25 13:46:04 +00:00
|
|
|
ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Content") : C2U("Office.Writer/Content"),
|
|
|
|
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
|
2000-09-28 14:25:03 +00:00
|
|
|
rParent(rPar),
|
|
|
|
bWeb(bIsWeb)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:33---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwContentViewConfig::~SwContentViewConfig()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:33---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void SwContentViewConfig::Commit()
|
|
|
|
{
|
|
|
|
Sequence<OUString> aNames = GetPropertyNames();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
Sequence<Any> aValues(aNames.getLength());
|
|
|
|
Any* pValues = aValues.getArray();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
const Type& rType = ::getBooleanCppuType();
|
|
|
|
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
sal_Bool bVal = FALSE;
|
|
|
|
switch(nProp)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2000-09-28 14:25:03 +00:00
|
|
|
case 0: bVal = rParent.IsGraphic(); break;// "Display/GraphicObject",
|
|
|
|
case 1: bVal = rParent.IsTable(); break;// "Display/Table",
|
|
|
|
case 2: bVal = rParent.IsDraw(); break;// "Display/DrawingControl",
|
|
|
|
case 3: bVal = rParent.IsFldName(); break;// "Display/FieldCode",
|
|
|
|
case 4: bVal = rParent.IsPostIts(); break;// "Display/Note",
|
2001-09-20 11:49:29 +00:00
|
|
|
case 5: bVal = rParent.IsPreventTips(); break; // "Display/PreventTips"
|
2002-04-25 13:00:16 +00:00
|
|
|
case 6: bVal = rParent.IsViewMetaChars(); break; //"NonprintingCharacter/MetaCharacters"
|
|
|
|
case 7: bVal = rParent.IsParagraph(); break;// "NonprintingCharacter/ParagraphEnd",
|
|
|
|
case 8: bVal = rParent.IsSoftHyph(); break;// "NonprintingCharacter/OptionalHyphen",
|
|
|
|
case 9: bVal = rParent.IsBlank(); break;// "NonprintingCharacter/Space",
|
2002-05-14 12:17:46 +00:00
|
|
|
case 10: bVal = rParent.IsLineBreak();break;// "NonprintingCharacter/Break",
|
|
|
|
case 11: bVal = rParent.IsHardBlank(); break;// "NonprintingCharacter/ProtectedSpace",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 12: bVal = rParent.IsTab(); break;// "NonprintingCharacter/Tab",
|
|
|
|
case 13: bVal = rParent.IsHidden(); break;// "NonprintingCharacter/HiddenText",
|
|
|
|
case 14: bVal = rParent.IsShowHiddenPara(); break;// "NonprintingCharacter/HiddenParagraph",
|
|
|
|
case 15: pValues[nProp] <<= rParent.GetUpdateLinkMode(); break;// "Update/Link",
|
|
|
|
case 16: bVal = rParent.IsUpdateFields(); break;// "Update/Field",
|
|
|
|
case 17: bVal = rParent.IsUpdateCharts(); break;// "Update/Chart"
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2002-04-25 13:00:16 +00:00
|
|
|
if(nProp != 15)
|
2000-09-28 14:25:03 +00:00
|
|
|
pValues[nProp].setValue(&bVal, ::getBooleanCppuType());
|
|
|
|
}
|
|
|
|
PutProperties(aNames, aValues);
|
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:34---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void SwContentViewConfig::Load()
|
|
|
|
{
|
|
|
|
Sequence<OUString> aNames = GetPropertyNames();
|
|
|
|
Sequence<Any> aValues = GetProperties(aNames);
|
|
|
|
const Any* pValues = aValues.getConstArray();
|
|
|
|
DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed")
|
|
|
|
if(aValues.getLength() == aNames.getLength())
|
|
|
|
{
|
|
|
|
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2000-09-28 14:25:03 +00:00
|
|
|
if(pValues[nProp].hasValue())
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2002-04-25 13:00:16 +00:00
|
|
|
sal_Bool bSet = nProp != 15 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False;
|
2000-09-28 14:25:03 +00:00
|
|
|
switch(nProp)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2000-09-28 14:25:03 +00:00
|
|
|
case 0: rParent.SetGraphic(bSet); break;// "Display/GraphicObject",
|
|
|
|
case 1: rParent.SetTable(bSet); break;// "Display/Table",
|
|
|
|
case 2: rParent.SetDraw(bSet); break;// "Display/DrawingControl",
|
|
|
|
case 3: rParent.SetFldName(bSet); break;// "Display/FieldCode",
|
|
|
|
case 4: rParent.SetPostIts(bSet); break;// "Display/Note",
|
2001-09-20 11:49:29 +00:00
|
|
|
case 5: rParent.SetPreventTips(bSet); break;// "Display/PreventTips",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 6: rParent.SetViewMetaChars(bSet); break; //"NonprintingCharacter/MetaCharacters"
|
|
|
|
case 7: rParent.SetParagraph(bSet); break;// "NonprintingCharacter/ParagraphEnd",
|
|
|
|
case 8: rParent.SetSoftHyph(bSet); break;// "NonprintingCharacter/OptionalHyphen",
|
|
|
|
case 9: rParent.SetBlank(bSet); break;// "NonprintingCharacter/Space",
|
2002-05-14 12:17:46 +00:00
|
|
|
case 10: rParent.SetLineBreak(bSet);break;// "NonprintingCharacter/Break",
|
|
|
|
case 11: rParent.SetHardBlank(bSet); break;// "NonprintingCharacter/ProtectedSpace",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 12: rParent.SetTab(bSet); break;// "NonprintingCharacter/Tab",
|
|
|
|
case 13: rParent.SetHidden(bSet); break;// "NonprintingCharacter/HiddenText",
|
|
|
|
case 14: rParent.SetShowHiddenPara(bSet); break;// "NonprintingCharacter/HiddenParagraph",
|
|
|
|
case 15:
|
2000-09-28 14:25:03 +00:00
|
|
|
{
|
|
|
|
sal_Int32 nSet; pValues[nProp] >>= nSet;
|
2001-06-25 13:46:04 +00:00
|
|
|
rParent.SetUpdateLinkMode(nSet, TRUE);
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
break;// "Update/Link",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 16: rParent.SetUpdateFields(bSet, TRUE); break;// "Update/Field",
|
|
|
|
case 17: rParent.SetUpdateCharts(bSet, TRUE); break;// "Update/Chart"
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:34---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
Sequence<OUString> SwLayoutViewConfig::GetPropertyNames()
|
|
|
|
{
|
|
|
|
static const char* aPropNames[] =
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2002-04-25 13:00:16 +00:00
|
|
|
"Line/Guide", // 0
|
|
|
|
"Line/SimpleControlPoint", // 1
|
|
|
|
"Line/LargeControlPoint", // 2
|
|
|
|
"Window/HorizontalScroll", // 3
|
|
|
|
"Window/VerticalScroll", // 4
|
|
|
|
"Window/HorizontalRuler", // 5
|
|
|
|
"Window/VerticalRuler", // 6
|
|
|
|
"Window/HorizontalRulerUnit", // 7
|
|
|
|
"Window/VerticalRulerUnit", // 8
|
|
|
|
"Window/SmoothScroll", // 9
|
|
|
|
"Zoom/Value", //10
|
|
|
|
"Zoom/Type", //11
|
|
|
|
"Other/MeasureUnit", //12
|
|
|
|
"Other/TabStop", //13
|
|
|
|
"Window/IsVerticalRulerRight" //14
|
2000-09-28 14:25:03 +00:00
|
|
|
};
|
2002-04-25 13:00:16 +00:00
|
|
|
const int nCount = bWeb ? 13 : 15;
|
2000-09-28 14:25:03 +00:00
|
|
|
Sequence<OUString> aNames(nCount);
|
|
|
|
OUString* pNames = aNames.getArray();
|
|
|
|
for(int i = 0; i < nCount; i++)
|
|
|
|
{
|
|
|
|
pNames[i] = OUString::createFromAscii(aPropNames[i]);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2000-09-28 14:25:03 +00:00
|
|
|
return aNames;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2000-09-28 14:25:03 +00:00
|
|
|
/*-- 28.09.00 09:55:34---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwLayoutViewConfig::SwLayoutViewConfig(BOOL bIsWeb, SwMasterUsrPref& rPar) :
|
2001-06-25 13:46:04 +00:00
|
|
|
ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Layout") : C2U("Office.Writer/Layout"),
|
|
|
|
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
|
2000-09-28 14:25:03 +00:00
|
|
|
rParent(rPar),
|
|
|
|
bWeb(bIsWeb)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
}
|
2000-09-28 14:25:03 +00:00
|
|
|
/*-- 28.09.00 09:55:35---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwLayoutViewConfig::~SwLayoutViewConfig()
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
}
|
2000-09-28 14:25:03 +00:00
|
|
|
/*-- 28.09.00 09:55:36---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void SwLayoutViewConfig::Commit()
|
|
|
|
{
|
|
|
|
Sequence<OUString> aNames = GetPropertyNames();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
Sequence<Any> aValues(aNames.getLength());
|
|
|
|
Any* pValues = aValues.getArray();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
const Type& rType = ::getBooleanCppuType();
|
|
|
|
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
sal_Bool bSet;
|
|
|
|
switch(nProp)
|
|
|
|
{
|
2002-04-25 13:00:16 +00:00
|
|
|
case 0: bSet = rParent.IsCrossHair(); break;// "Line/Guide",
|
|
|
|
case 1: bSet = rParent.IsSolidMarkHdl(); break;// "Line/SimpleControlPoint",
|
|
|
|
case 2: bSet = rParent.IsBigMarkHdl(); break;// "Line/LargeControlPoint",
|
|
|
|
case 3: bSet = rParent.IsViewHScrollBar(); break;// "Window/HorizontalScroll",
|
|
|
|
case 4: bSet = rParent.IsViewVScrollBar(); break;// "Window/VerticalScroll",
|
|
|
|
case 5: bSet = rParent.IsViewTabwin(); break;// "Window/HorizontalRuler",
|
|
|
|
case 6: bSet = rParent.IsViewVLin(); break;// "Window/VerticalRuler",
|
|
|
|
case 7:
|
2001-04-09 08:46:35 +00:00
|
|
|
if(rParent.bIsHScrollMetricSet)
|
|
|
|
pValues[nProp] <<= (sal_Int32)rParent.eHScrollMetric; // "Window/HorizontalRulerUnit"
|
|
|
|
break;
|
2002-04-25 13:00:16 +00:00
|
|
|
case 8:
|
2001-04-09 08:46:35 +00:00
|
|
|
if(rParent.bIsVScrollMetricSet)
|
|
|
|
pValues[nProp] <<= (sal_Int32)rParent.eVScrollMetric; // "Window/VerticalRulerUnit"
|
|
|
|
break;
|
2002-04-25 13:00:16 +00:00
|
|
|
case 9: bSet = rParent.IsSmoothScroll(); break;// "Window/SmoothScroll",
|
|
|
|
case 10: pValues[nProp] <<= (sal_Int32)rParent.GetZoom(); break;// "Zoom/Value",
|
|
|
|
case 11: pValues[nProp] <<= (sal_Int32)rParent.GetZoomType(); break;// "Zoom/Type",
|
|
|
|
case 12: pValues[nProp] <<= (sal_Int32)rParent.GetMetric(); break;// "Other/MeasureUnit",
|
2002-08-13 14:00:05 +00:00
|
|
|
case 13: pValues[nProp] <<= TWIP_TO_MM100(rParent.GetDefTab()); break;// "Other/TabStop",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 14: bSet = rParent.IsVRulerRight(); break;// "Window/IsVerticalRulerRight",
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
2002-04-25 13:00:16 +00:00
|
|
|
if(nProp < 7 || nProp == 9)
|
2000-09-28 14:25:03 +00:00
|
|
|
pValues[nProp].setValue(&bSet, ::getBooleanCppuType());
|
|
|
|
}
|
|
|
|
PutProperties(aNames, aValues);
|
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:36---------------------------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2000-09-28 14:25:03 +00:00
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void SwLayoutViewConfig::Load()
|
|
|
|
{
|
|
|
|
Sequence<OUString> aNames = GetPropertyNames();
|
|
|
|
Sequence<Any> aValues = GetProperties(aNames);
|
|
|
|
const Any* pValues = aValues.getConstArray();
|
|
|
|
DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed")
|
|
|
|
if(aValues.getLength() == aNames.getLength())
|
|
|
|
{
|
|
|
|
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
if(pValues[nProp].hasValue())
|
|
|
|
{
|
2002-04-25 13:00:16 +00:00
|
|
|
sal_Bool bSet = nProp < 7 || nProp == 9 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False;
|
2000-09-28 14:25:03 +00:00
|
|
|
switch(nProp)
|
|
|
|
{
|
2002-04-25 13:00:16 +00:00
|
|
|
case 0: rParent.SetCrossHair(bSet); break;// "Line/Guide",
|
|
|
|
case 1: rParent.SetSolidMarkHdl(bSet); break;// "Line/SimpleControlPoint",
|
|
|
|
case 2: rParent.SetBigMarkHdl(bSet); break;// "Line/LargeControlPoint",
|
|
|
|
case 3: rParent.SetViewHScrollBar(bSet); break;// "Window/HorizontalScroll",
|
|
|
|
case 4: rParent.SetViewVScrollBar(bSet); break;// "Window/VerticalScroll",
|
|
|
|
case 5: rParent.SetViewTabwin(bSet); break;// "Window/HorizontalRuler",
|
|
|
|
case 6: rParent.SetViewVLin(bSet); break;// "Window/VerticalRuler",
|
|
|
|
case 7:
|
2001-04-09 08:46:35 +00:00
|
|
|
{
|
|
|
|
rParent.bIsHScrollMetricSet = sal_True;
|
|
|
|
sal_Int32 nUnit; pValues[nProp] >>= nUnit;
|
|
|
|
rParent.eHScrollMetric = ((FieldUnit)nUnit); // "Window/HorizontalRulerUnit"
|
|
|
|
}
|
|
|
|
break;
|
2002-04-25 13:00:16 +00:00
|
|
|
case 8:
|
2001-04-09 08:46:35 +00:00
|
|
|
{
|
|
|
|
rParent.bIsVScrollMetricSet = sal_True;
|
|
|
|
sal_Int32 nUnit; pValues[nProp] >>= nUnit;
|
|
|
|
rParent.eVScrollMetric = ((FieldUnit)nUnit); // "Window/VerticalRulerUnit"
|
|
|
|
}
|
|
|
|
break;
|
2002-04-25 13:00:16 +00:00
|
|
|
case 9: rParent.SetSmoothScroll(bSet); break;// "Window/SmoothScroll",
|
|
|
|
case 10:
|
2001-10-29 12:48:02 +00:00
|
|
|
{
|
|
|
|
sal_Int32 nVal; pValues[nProp] >>= nVal;
|
|
|
|
rParent.SetZoom(nVal);
|
|
|
|
}
|
|
|
|
break;// "Zoom/Value",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 11:
|
2001-10-29 12:48:02 +00:00
|
|
|
{
|
|
|
|
sal_Int32 nVal; pValues[nProp] >>= nVal;
|
|
|
|
rParent.SetZoomType((BYTE)nVal);
|
|
|
|
}
|
|
|
|
break;// "Zoom/Type",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 12:
|
2000-09-28 14:25:03 +00:00
|
|
|
{
|
|
|
|
sal_Int32 nUnit; pValues[nProp] >>= nUnit;
|
2001-06-25 13:46:04 +00:00
|
|
|
rParent.SetMetric((FieldUnit)nUnit, TRUE);
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
break;// "Other/MeasureUnit",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 13:
|
2000-09-28 14:25:03 +00:00
|
|
|
{
|
|
|
|
sal_Int32 nTab; pValues[nProp] >>= nTab;
|
2002-08-13 14:00:05 +00:00
|
|
|
rParent.SetDefTab(MM100_TO_TWIP(nTab), TRUE);
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
break;// "Other/TabStop",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 14: rParent.SetVRulerRight(bSet); break;// "Window/IsVerticalRulerRight",
|
2000-09-28 14:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-01-19 11:45:03 +00:00
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
Sequence<OUString> SwGridConfig::GetPropertyNames()
|
|
|
|
{
|
|
|
|
static const char* aPropNames[] =
|
|
|
|
{
|
|
|
|
"Option/SnapToGrid", // 0
|
|
|
|
"Option/VisibleGrid", // 1
|
|
|
|
"Option/Synchronize", // 2
|
|
|
|
"Resolution/XAxis", // 3
|
|
|
|
"Resolution/YAxis", // 4
|
|
|
|
"Subdivision/XAxis", // 5
|
|
|
|
"Subdivision/YAxis" // 6
|
|
|
|
};
|
|
|
|
const int nCount = 7;
|
|
|
|
Sequence<OUString> aNames(nCount);
|
|
|
|
OUString* pNames = aNames.getArray();
|
|
|
|
for(int i = 0; i < nCount; i++)
|
|
|
|
{
|
|
|
|
pNames[i] = OUString::createFromAscii(aPropNames[i]);
|
|
|
|
}
|
|
|
|
return aNames;
|
|
|
|
}
|
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
SwGridConfig::SwGridConfig(BOOL bIsWeb, SwMasterUsrPref& rPar) :
|
2001-06-25 13:46:04 +00:00
|
|
|
ConfigItem(bIsWeb ? C2U("Office.WriterWeb/Grid") : C2U("Office.Writer/Grid"),
|
|
|
|
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
|
2001-01-19 11:45:03 +00:00
|
|
|
rParent(rPar),
|
|
|
|
bWeb(bIsWeb)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
SwGridConfig::~SwGridConfig()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
void SwGridConfig::Commit()
|
|
|
|
{
|
|
|
|
Sequence<OUString> aNames = GetPropertyNames();
|
|
|
|
|
|
|
|
Sequence<Any> aValues(aNames.getLength());
|
|
|
|
Any* pValues = aValues.getArray();
|
|
|
|
|
|
|
|
const Type& rType = ::getBooleanCppuType();
|
|
|
|
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
sal_Bool bSet;
|
|
|
|
switch(nProp)
|
|
|
|
{
|
|
|
|
case 0: bSet = rParent.IsSnap(); break;// "Option/SnapToGrid",
|
|
|
|
case 1: bSet = rParent.IsGridVisible(); break;//"Option/VisibleGrid",
|
|
|
|
case 2: bSet = rParent.IsSynchronize(); break;// "Option/Synchronize",
|
|
|
|
case 3: pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100(rParent.GetSnapSize().Width()); break;// "Resolution/XAxis",
|
|
|
|
case 4: pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100(rParent.GetSnapSize().Height()); break;// "Resolution/YAxis",
|
|
|
|
case 5: pValues[nProp] <<= (sal_Int16)rParent.GetDivisionX(); break;// "Subdivision/XAxis",
|
|
|
|
case 6: pValues[nProp] <<= (sal_Int16)rParent.GetDivisionY(); break;// "Subdivision/YAxis"
|
|
|
|
}
|
|
|
|
if(nProp < 3)
|
|
|
|
pValues[nProp].setValue(&bSet, ::getBooleanCppuType());
|
|
|
|
}
|
|
|
|
PutProperties(aNames, aValues);
|
|
|
|
}
|
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
void SwGridConfig::Load()
|
|
|
|
{
|
|
|
|
Sequence<OUString> aNames = GetPropertyNames();
|
|
|
|
Sequence<Any> aValues = GetProperties(aNames);
|
|
|
|
const Any* pValues = aValues.getConstArray();
|
|
|
|
DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed")
|
|
|
|
if(aValues.getLength() == aNames.getLength())
|
|
|
|
{
|
|
|
|
Size aSnap(rParent.GetSnapSize());
|
|
|
|
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
if(pValues[nProp].hasValue())
|
|
|
|
{
|
|
|
|
sal_Bool bSet = nProp < 3 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False;
|
|
|
|
sal_Int32 nSet;
|
|
|
|
if(nProp >= 3)
|
|
|
|
pValues[nProp] >>= nSet;
|
|
|
|
switch(nProp)
|
|
|
|
{
|
|
|
|
case 0: rParent.SetSnap(bSet); break;// "Option/SnapToGrid",
|
|
|
|
case 1: rParent.SetGridVisible(bSet); break;//"Option/VisibleGrid",
|
|
|
|
case 2: rParent.SetSynchronize(bSet); break;// "Option/Synchronize",
|
|
|
|
case 3: aSnap.Width() = MM100_TO_TWIP(nSet); break;// "Resolution/XAxis",
|
|
|
|
case 4: aSnap.Height() = MM100_TO_TWIP(nSet); break;// "Resolution/YAxis",
|
|
|
|
case 5: rParent.SetDivisionX(nSet); break;// "Subdivision/XAxis",
|
|
|
|
case 6: rParent.SetDivisionY(nSet); break;// "Subdivision/YAxis"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rParent.SetSnapSize(aSnap);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-01-24 15:08:03 +00:00
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
Sequence<OUString> SwCursorConfig::GetPropertyNames()
|
|
|
|
{
|
|
|
|
static const char* aPropNames[] =
|
|
|
|
{
|
|
|
|
"DirectCursor/UseDirectCursor", // 0
|
|
|
|
"DirectCursor/Insert", // 1
|
2002-04-25 13:00:16 +00:00
|
|
|
"Option/ProtectedArea" // 2
|
2001-01-24 15:08:03 +00:00
|
|
|
};
|
2002-04-25 13:00:16 +00:00
|
|
|
const int nCount = 3;
|
2001-01-24 15:08:03 +00:00
|
|
|
Sequence<OUString> aNames(nCount);
|
|
|
|
OUString* pNames = aNames.getArray();
|
|
|
|
for(int i = 0; i < nCount; i++)
|
|
|
|
pNames[i] = C2U(aPropNames[i]);
|
|
|
|
return aNames;
|
|
|
|
}
|
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
SwCursorConfig::SwCursorConfig(SwMasterUsrPref& rPar) :
|
2001-06-25 13:46:04 +00:00
|
|
|
ConfigItem(C2U("Office.Writer/Cursor"),
|
|
|
|
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
|
2001-01-24 15:08:03 +00:00
|
|
|
rParent(rPar)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
SwCursorConfig::~SwCursorConfig()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
void SwCursorConfig::Commit()
|
|
|
|
{
|
|
|
|
Sequence<OUString> aNames = GetPropertyNames();
|
|
|
|
|
|
|
|
Sequence<Any> aValues(aNames.getLength());
|
|
|
|
Any* pValues = aValues.getArray();
|
|
|
|
|
|
|
|
const Type& rType = ::getBooleanCppuType();
|
|
|
|
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
sal_Bool bSet;
|
|
|
|
switch(nProp)
|
|
|
|
{
|
|
|
|
case 0: bSet = rParent.IsShadowCursor(); break;// "DirectCursor/UseDirectCursor",
|
2001-02-28 10:51:43 +00:00
|
|
|
case 1: pValues[nProp] <<= (sal_Int32)rParent.GetShdwCrsrFillMode(); break;// "DirectCursor/Insert",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 2: bSet = rParent.IsCursorInProtectedArea(); break;// "Option/ProtectedArea"
|
2001-01-24 15:08:03 +00:00
|
|
|
}
|
2002-04-25 13:00:16 +00:00
|
|
|
if(nProp != 1 )
|
2001-01-24 15:08:03 +00:00
|
|
|
pValues[nProp].setValue(&bSet, ::getBooleanCppuType());
|
|
|
|
}
|
|
|
|
PutProperties(aNames, aValues);
|
|
|
|
}
|
|
|
|
/* -----------------------------19.01.01 13:07--------------------------------
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
void SwCursorConfig::Load()
|
|
|
|
{
|
|
|
|
Sequence<OUString> aNames = GetPropertyNames();
|
|
|
|
Sequence<Any> aValues = GetProperties(aNames);
|
|
|
|
const Any* pValues = aValues.getConstArray();
|
|
|
|
DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed")
|
|
|
|
if(aValues.getLength() == aNames.getLength())
|
|
|
|
{
|
2001-02-28 10:51:43 +00:00
|
|
|
|
2001-01-24 15:08:03 +00:00
|
|
|
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
if(pValues[nProp].hasValue())
|
|
|
|
{
|
|
|
|
sal_Bool bSet;
|
|
|
|
sal_Int32 nSet;
|
2002-04-25 13:00:16 +00:00
|
|
|
if(nProp != 1 )
|
2001-01-24 15:08:03 +00:00
|
|
|
bSet = *(sal_Bool*)pValues[nProp].getValue();
|
|
|
|
else
|
|
|
|
pValues[nProp] >>= nSet;
|
|
|
|
switch(nProp)
|
|
|
|
{
|
|
|
|
case 0: rParent.SetShadowCursor(bSet); break;// "DirectCursor/UseDirectCursor",
|
2002-04-25 13:00:16 +00:00
|
|
|
case 1: rParent.SetShdwCrsrFillMode((BYTE)nSet); break;// "DirectCursor/Insert",
|
|
|
|
case 2: rParent.SetCursorInProtectedArea(bSet); break;// "Option/ProtectedArea"
|
2001-01-24 15:08:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-02-28 10:51:43 +00:00
|
|
|
|
2001-01-24 15:08:03 +00:00
|
|
|
}
|
|
|
|
}
|
2001-02-13 08:52:11 +00:00
|
|
|
/*-- 28.09.00 09:55:33---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwWebColorConfig::SwWebColorConfig(SwMasterUsrPref& rPar) :
|
2001-06-25 13:46:04 +00:00
|
|
|
ConfigItem(C2U("Office.WriterWeb/Background"),
|
|
|
|
CONFIG_MODE_DELAYED_UPDATE|CONFIG_MODE_RELEASE_TREE),
|
2001-02-13 08:52:11 +00:00
|
|
|
rParent(rPar),
|
|
|
|
aPropNames(1)
|
|
|
|
{
|
|
|
|
aPropNames.getArray()[0] = C2U("Color");
|
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:33---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
SwWebColorConfig::~SwWebColorConfig()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:33---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void SwWebColorConfig::Commit()
|
|
|
|
{
|
|
|
|
Sequence<Any> aValues(aPropNames.getLength());
|
|
|
|
Any* pValues = aValues.getArray();
|
|
|
|
for(int nProp = 0; nProp < aPropNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
switch(nProp)
|
|
|
|
{
|
|
|
|
case 0: pValues[nProp] <<= (sal_Int32)rParent.GetRetoucheColor().GetColor(); break;// "Color",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
PutProperties(aPropNames, aValues);
|
|
|
|
}
|
|
|
|
/*-- 28.09.00 09:55:34---------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------*/
|
|
|
|
void SwWebColorConfig::Load()
|
|
|
|
{
|
|
|
|
Sequence<Any> aValues = GetProperties(aPropNames);
|
|
|
|
const Any* pValues = aValues.getConstArray();
|
|
|
|
DBG_ASSERT(aValues.getLength() == aPropNames.getLength(), "GetProperties failed")
|
|
|
|
if(aValues.getLength() == aPropNames.getLength())
|
|
|
|
{
|
|
|
|
for(int nProp = 0; nProp < aPropNames.getLength(); nProp++)
|
|
|
|
{
|
|
|
|
if(pValues[nProp].hasValue())
|
|
|
|
{
|
|
|
|
switch(nProp)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sal_Int32 nSet; pValues[nProp] >>= nSet; rParent.SetRetoucheColor(nSet);
|
|
|
|
break;// "Color",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-01-24 15:08:03 +00:00
|
|
|
|
|
|
|
|