diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-01-28 20:52:45 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-01-28 20:52:45 +0100 |
commit | 2e626373db2412ac22e8c5c27a60d11cd29e875b (patch) | |
tree | 9e9f67205cd5b72f1031721273e1534a3a1e5b0f /cui/source/tabpages | |
parent | f7ee7bbd5174b084f018c2ec94d8c70c98ee04da (diff) |
replace obsolete "master" branch with README that points at new repoHEADmaster-deletedmaster
Diffstat (limited to 'cui/source/tabpages')
84 files changed, 0 insertions, 54917 deletions
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx deleted file mode 100644 index f90f57d1c..000000000 --- a/cui/source/tabpages/align.cxx +++ /dev/null @@ -1,401 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- - -#include "align.hxx" - -#include <editeng/svxenum.hxx> -#include <svx/dialogs.hrc> -#include <cuires.hrc> -#include "align.hrc" -#include <svx/rotmodit.hxx> - -#include <svx/algitem.hxx> -#include <editeng/frmdiritem.hxx> -#include <editeng/justifyitem.hxx> -#include <dialmgr.hxx> -#include <svx/dlgutil.hxx> -#include <tools/shl.hxx> -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <sfx2/itemconnect.hxx> -#include <svl/cjkoptions.hxx> -#include <svl/languageoptions.hxx> -#include <svtools/localresaccess.hxx> -#include <svx/flagsdef.hxx> -#include <svl/intitem.hxx> -#include <sfx2/request.hxx> - -namespace svx { - -// item connections =========================================================== - -// horizontal alignment ------------------------------------------------------- - -typedef sfx::ValueItemWrapper< SvxHorJustifyItem, SvxCellHorJustify, sal_uInt16 > HorJustItemWrapper; -typedef sfx::ListBoxConnection< HorJustItemWrapper > HorJustConnection; - -static const HorJustConnection::MapEntryType s_pHorJustMap[] = -{ - { ALIGNDLG_HORALIGN_STD, SVX_HOR_JUSTIFY_STANDARD }, - { ALIGNDLG_HORALIGN_LEFT, SVX_HOR_JUSTIFY_LEFT }, - { ALIGNDLG_HORALIGN_CENTER, SVX_HOR_JUSTIFY_CENTER }, - { ALIGNDLG_HORALIGN_RIGHT, SVX_HOR_JUSTIFY_RIGHT }, - { ALIGNDLG_HORALIGN_BLOCK, SVX_HOR_JUSTIFY_BLOCK }, - { ALIGNDLG_HORALIGN_FILL, SVX_HOR_JUSTIFY_REPEAT }, - { ALIGNDLG_HORALIGN_DISTRIBUTED, SVX_HOR_JUSTIFY_BLOCK }, - { LISTBOX_ENTRY_NOTFOUND, SVX_HOR_JUSTIFY_STANDARD } -}; - -// vertical alignment --------------------------------------------------------- - -typedef sfx::ValueItemWrapper< SvxVerJustifyItem, SvxCellVerJustify, sal_uInt16 > VerJustItemWrapper; -typedef sfx::ListBoxConnection< VerJustItemWrapper > VerJustConnection; - -static const VerJustConnection::MapEntryType s_pVerJustMap[] = -{ - { ALIGNDLG_VERALIGN_STD, SVX_VER_JUSTIFY_STANDARD }, - { ALIGNDLG_VERALIGN_TOP, SVX_VER_JUSTIFY_TOP }, - { ALIGNDLG_VERALIGN_MID, SVX_VER_JUSTIFY_CENTER }, - { ALIGNDLG_VERALIGN_BOTTOM, SVX_VER_JUSTIFY_BOTTOM }, - { ALIGNDLG_VERALIGN_BLOCK, SVX_VER_JUSTIFY_BLOCK }, - { ALIGNDLG_VERALIGN_DISTRIBUTED, SVX_VER_JUSTIFY_BLOCK }, - { LISTBOX_ENTRY_NOTFOUND, SVX_VER_JUSTIFY_STANDARD } -}; - -// cell rotate mode ----------------------------------------------------------- - -typedef sfx::ValueItemWrapper< SvxRotateModeItem, SvxRotateMode, sal_uInt16 > RotateModeItemWrapper; -typedef sfx::ValueSetConnection< RotateModeItemWrapper > RotateModeConnection; - -static const RotateModeConnection::MapEntryType s_pRotateModeMap[] = -{ - { IID_BOTTOMLOCK, SVX_ROTATE_MODE_BOTTOM }, - { IID_TOPLOCK, SVX_ROTATE_MODE_TOP }, - { IID_CELLLOCK, SVX_ROTATE_MODE_STANDARD }, - { VALUESET_ITEM_NOTFOUND, SVX_ROTATE_MODE_STANDARD } -}; - -// ============================================================================ - -static sal_uInt16 s_pRanges[] = -{ - SID_ATTR_ALIGN_HOR_JUSTIFY,SID_ATTR_ALIGN_VER_JUSTIFY, - SID_ATTR_ALIGN_STACKED,SID_ATTR_ALIGN_LINEBREAK, - SID_ATTR_ALIGN_INDENT,SID_ATTR_ALIGN_INDENT, - SID_ATTR_ALIGN_DEGREES,SID_ATTR_ALIGN_DEGREES, - SID_ATTR_ALIGN_LOCKPOS,SID_ATTR_ALIGN_LOCKPOS, - SID_ATTR_ALIGN_HYPHENATION,SID_ATTR_ALIGN_HYPHENATION, - SID_ATTR_ALIGN_ASIANVERTICAL,SID_ATTR_ALIGN_ASIANVERTICAL, - SID_ATTR_FRAMEDIRECTION,SID_ATTR_FRAMEDIRECTION, - SID_ATTR_ALIGN_SHRINKTOFIT,SID_ATTR_ALIGN_SHRINKTOFIT, - 0 -}; - -// ============================================================================ - -namespace { - -template<typename _JustContainerType, typename _JustEnumType> -void lcl_MaybeResetAlignToDistro( - ListBox& rLB, sal_uInt16 nListPos, const SfxItemSet& rCoreAttrs, sal_uInt16 nWhichAlign, sal_uInt16 nWhichJM, _JustEnumType eBlock) -{ - const SfxPoolItem* pItem; - if (rCoreAttrs.GetItemState(nWhichAlign, sal_True, &pItem) != SFX_ITEM_SET) - // alignment not set. - return; - - const SfxEnumItem* p = static_cast<const SfxEnumItem*>(pItem); - _JustContainerType eVal = static_cast<_JustContainerType>(p->GetEnumValue()); - if (eVal != eBlock) - // alignment is not 'justify'. No need to go further. - return; - - if (rCoreAttrs.GetItemState(nWhichJM, sal_True, &pItem) != SFX_ITEM_SET) - // justification method is not set. - return; - - p = static_cast<const SfxEnumItem*>(pItem); - SvxCellJustifyMethod eMethod = static_cast<SvxCellJustifyMethod>(p->GetEnumValue()); - if (eMethod == SVX_JUSTIFY_METHOD_DISTRIBUTE) - // Select the 'distribute' entry in the specified list box. - rLB.SelectEntryPos(nListPos); -} - -void lcl_SetJustifyMethodToItemSet(SfxItemSet& rSet, sal_uInt16 nWhichJM, const ListBox& rLB, sal_uInt16 nListPos) -{ - SvxCellJustifyMethod eJM = SVX_JUSTIFY_METHOD_AUTO; - if (rLB.GetSelectEntryPos() == nListPos) - eJM = SVX_JUSTIFY_METHOD_DISTRIBUTE; - - SvxJustifyMethodItem aItem(eJM, nWhichJM); - rSet.Put(aItem); -} - -} - -// ============================================================================ - -AlignmentTabPage::AlignmentTabPage( Window* pParent, const SfxItemSet& rCoreAttrs ) : - - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_ALIGNMENT ), rCoreAttrs ), - - maFlAlignment ( this, CUI_RES( FL_ALIGNMENT ) ), - maFtHorAlign ( this, CUI_RES( FT_HORALIGN ) ), - maLbHorAlign ( this, CUI_RES( LB_HORALIGN ) ), - maFtIndent ( this, CUI_RES( FT_INDENT ) ), - maEdIndent ( this, CUI_RES( ED_INDENT ) ), - maFtVerAlign ( this, CUI_RES( FT_VERALIGN ) ), - maLbVerAlign ( this, CUI_RES( LB_VERALIGN ) ), - - maFlOrient ( this, CUI_RES( FL_ORIENTATION ) ), - maCtrlDial ( this, CUI_RES( CTR_DIAL ) ), - maFtRotate ( this, CUI_RES( FT_DEGREES ) ), - maNfRotate ( this, CUI_RES( NF_DEGREES ) ), - maFtRefEdge ( this, CUI_RES( FT_BORDER_LOCK ) ), - maVsRefEdge ( this, CUI_RES( CTR_BORDER_LOCK ) ), - maCbStacked ( this, CUI_RES( BTN_TXTSTACKED ) ), - maCbAsianMode ( this, CUI_RES( BTN_ASIAN_VERTICAL ) ), - maOrientHlp ( maCtrlDial, maNfRotate, maCbStacked ), - - maFlProperties ( this, CUI_RES( FL_WRAP ) ), - maBtnWrap ( this, CUI_RES( BTN_WRAP ) ), - maBtnHyphen ( this, CUI_RES( BTN_HYPH ) ), - maBtnShrink ( this, CUI_RES( BTN_SHRINK ) ), - maFtFrameDir ( this, CUI_RES( FT_TEXTFLOW ) ), - maLbFrameDir ( this, CUI_RES( LB_FRAMEDIR ) ) -{ - InitVsRefEgde(); - - // windows to be disabled, if stacked text is turned ON - maOrientHlp.AddDependentWindow( maFtRotate, STATE_CHECK ); - maOrientHlp.AddDependentWindow( maFtRefEdge, STATE_CHECK ); - maOrientHlp.AddDependentWindow( maVsRefEdge, STATE_CHECK ); - // windows to be disabled, if stacked text is turned OFF - maOrientHlp.AddDependentWindow( maCbAsianMode, STATE_NOCHECK ); - - Link aLink = LINK( this, AlignmentTabPage, UpdateEnableHdl ); - - maLbHorAlign.SetSelectHdl( aLink ); - maBtnWrap.SetClickHdl( aLink ); - - // Asian vertical mode - maCbAsianMode.Show( SvtCJKOptions().IsVerticalTextEnabled() ); - - // CTL frame direction - maLbFrameDir.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP ); - maLbFrameDir.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP ); - maLbFrameDir.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT ); - if( !SvtLanguageOptions().IsCTLFontEnabled() ) - { - maFtFrameDir.Hide(); - maLbFrameDir.Hide(); - } - - // This page needs ExchangeSupport. - SetExchangeSupport(); - - FreeResource(); - - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_HOR_JUSTIFY, maFtHorAlign, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new HorJustConnection( SID_ATTR_ALIGN_HOR_JUSTIFY, maLbHorAlign, s_pHorJustMap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_INDENT, maFtIndent, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::UInt16MetricConnection( SID_ATTR_ALIGN_INDENT, maEdIndent, FUNIT_TWIP, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_VER_JUSTIFY, maFtVerAlign, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new VerJustConnection( SID_ATTR_ALIGN_VER_JUSTIFY, maLbVerAlign, s_pVerJustMap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new DialControlConnection( SID_ATTR_ALIGN_DEGREES, maCtrlDial, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_DEGREES, maFtRotate, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_LOCKPOS, maFtRefEdge, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new RotateModeConnection( SID_ATTR_ALIGN_LOCKPOS, maVsRefEdge, s_pRotateModeMap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new OrientStackedConnection( SID_ATTR_ALIGN_STACKED, maOrientHlp ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_ALIGN_STACKED, maCbStacked, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_ASIANVERTICAL, maCbAsianMode, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_LINEBREAK, maBtnWrap, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_HYPHENATION, maBtnHyphen, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_ALIGN_SHRINKTOFIT, maBtnShrink, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new sfx::DummyItemConnection( SID_ATTR_FRAMEDIRECTION, maFtFrameDir, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - AddItemConnection( new FrameDirListBoxConnection( SID_ATTR_FRAMEDIRECTION, maLbFrameDir, sfx::ITEMCONN_HIDE_UNKNOWN ) ); - - maLbHorAlign.SetAccessibleRelationMemberOf( &maFlAlignment ); - maEdIndent.SetAccessibleRelationMemberOf( &maFlAlignment ); - maLbVerAlign.SetAccessibleRelationMemberOf( &maFlAlignment ); -} - -AlignmentTabPage::~AlignmentTabPage() -{ -} - -SfxTabPage* AlignmentTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) -{ - return new AlignmentTabPage( pParent, rAttrSet ); -} - -sal_uInt16* AlignmentTabPage::GetRanges() -{ - return s_pRanges; -} - -sal_Bool AlignmentTabPage::FillItemSet( SfxItemSet& rSet ) -{ - bool bChanged = SfxTabPage::FillItemSet(rSet); - - // Special treatment for distributed alignment; we need to set the justify - // method to 'distribute' to distinguish from the normal justification. - - sal_uInt16 nWhichHorJM = GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD); - lcl_SetJustifyMethodToItemSet(rSet, nWhichHorJM, maLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED); - if (!bChanged) - bChanged = HasAlignmentChanged(rSet, nWhichHorJM); - - sal_uInt16 nWhichVerJM = GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY_METHOD); - lcl_SetJustifyMethodToItemSet(rSet, nWhichVerJM, maLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED); - if (!bChanged) - bChanged = HasAlignmentChanged(rSet, nWhichVerJM); - - return bChanged; -} - -void AlignmentTabPage::Reset( const SfxItemSet& rCoreAttrs ) -{ - SfxTabPage::Reset( rCoreAttrs ); - - // Special treatment for distributed alignment; we need to set the justify - // method to 'distribute' to distinguish from the normal justification. - - lcl_MaybeResetAlignToDistro<SvxCellHorJustify, SvxCellHorJustify>( - maLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED, rCoreAttrs, - GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY), GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD), - SVX_HOR_JUSTIFY_BLOCK); - - lcl_MaybeResetAlignToDistro<SvxCellVerJustify, SvxCellVerJustify>( - maLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED, rCoreAttrs, - GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY), GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY_METHOD), - SVX_VER_JUSTIFY_BLOCK); - - UpdateEnableControls(); -} - -int AlignmentTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -void AlignmentTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxTabPage::DataChanged( rDCEvt ); - if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - { - svt::OLocalResourceAccess aLocalResAcc( CUI_RES( RID_SVXPAGE_ALIGNMENT ), RSC_TABPAGE ); - InitVsRefEgde(); - } -} - -void AlignmentTabPage::InitVsRefEgde() -{ - // remember selection - is deleted in call to ValueSet::Clear() - sal_uInt16 nSel = maVsRefEdge.GetSelectItemId(); - - ResId aResId( IL_LOCK_BMPS, CUI_MGR() ); - ImageList aImageList( aResId ); - Size aItemSize( aImageList.GetImage( IID_BOTTOMLOCK ).GetSizePixel() ); - - maVsRefEdge.Clear(); - maVsRefEdge.SetStyle( maVsRefEdge.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER ); - - maVsRefEdge.SetColCount( 3 ); - maVsRefEdge.InsertItem( IID_BOTTOMLOCK, aImageList.GetImage( IID_BOTTOMLOCK ), String( CUI_RES( STR_BOTTOMLOCK ) ) ); - maVsRefEdge.InsertItem( IID_TOPLOCK, aImageList.GetImage( IID_TOPLOCK ), String( CUI_RES( STR_TOPLOCK ) ) ); - maVsRefEdge.InsertItem( IID_CELLLOCK, aImageList.GetImage( IID_CELLLOCK ), String( CUI_RES( STR_CELLLOCK ) ) ); - - maVsRefEdge.SetSizePixel( maVsRefEdge.CalcWindowSizePixel( aItemSize ) ); - - maVsRefEdge.SelectItem( nSel ); -} - -void AlignmentTabPage::UpdateEnableControls() -{ - sal_uInt16 nHorAlign = maLbHorAlign.GetSelectEntryPos(); - bool bHorLeft = (nHorAlign == ALIGNDLG_HORALIGN_LEFT); - bool bHorBlock = (nHorAlign == ALIGNDLG_HORALIGN_BLOCK); - bool bHorFill = (nHorAlign == ALIGNDLG_HORALIGN_FILL); - bool bHorDist = (nHorAlign == ALIGNDLG_HORALIGN_DISTRIBUTED); - - // indent edit field only for left alignment - maFtIndent.Enable( bHorLeft ); - maEdIndent.Enable( bHorLeft ); - - // rotation/stacked disabled for fill alignment - maOrientHlp.Enable( !bHorFill ); - - // hyphenation only for automatic line breaks or for block alignment - maBtnHyphen.Enable( maBtnWrap.IsChecked() || bHorBlock ); - - // shrink only without automatic line break, and not for block, fill or distribute. - maBtnShrink.Enable( (maBtnWrap.GetState() == STATE_NOCHECK) && !bHorBlock && !bHorFill && !bHorDist ); - - // visibility of fixed lines - maFlAlignment.Show( maLbHorAlign.IsVisible() || maEdIndent.IsVisible() || maLbVerAlign.IsVisible() ); - maFlOrient.Show( maCtrlDial.IsVisible() || maVsRefEdge.IsVisible() || maCbStacked.IsVisible() || maCbAsianMode.IsVisible() ); - maFlProperties.Show( maBtnWrap.IsVisible() || maBtnHyphen.IsVisible() || maBtnShrink.IsVisible() || maLbFrameDir.IsVisible() ); -} - -bool AlignmentTabPage::HasAlignmentChanged( const SfxItemSet& rNew, sal_uInt16 nWhich ) const -{ - const SfxItemSet& rOld = GetItemSet(); - const SfxPoolItem* pItem; - SvxCellJustifyMethod eMethodOld = SVX_JUSTIFY_METHOD_AUTO; - SvxCellJustifyMethod eMethodNew = SVX_JUSTIFY_METHOD_AUTO; - if (rOld.GetItemState(nWhich, sal_True, &pItem) == SFX_ITEM_SET) - { - const SfxEnumItem* p = static_cast<const SfxEnumItem*>(pItem); - eMethodOld = static_cast<SvxCellJustifyMethod>(p->GetEnumValue()); - } - - if (rNew.GetItemState(nWhich, sal_True, &pItem) == SFX_ITEM_SET) - { - const SfxEnumItem* p = static_cast<const SfxEnumItem*>(pItem); - eMethodNew = static_cast<SvxCellJustifyMethod>(p->GetEnumValue()); - } - - return eMethodOld != eMethodNew; -} - -IMPL_LINK( AlignmentTabPage, UpdateEnableHdl, void*, EMPTYARG ) -{ - UpdateEnableControls(); - return 0; -} - -// ============================================================================ - -} // namespace svx - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/align.hrc b/cui/source/tabpages/align.hrc deleted file mode 100644 index baae1be9d..000000000 --- a/cui/source/tabpages/align.hrc +++ /dev/null @@ -1,86 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_ALIGN_HRC -#define _SVX_ALIGN_HRC - -// defines ------------------------------------------------------------------ - -// resource id's -#define FL_ALIGNMENT 10 -#define FT_HORALIGN 11 -#define LB_HORALIGN 12 -#define FT_INDENT 13 -#define ED_INDENT 14 -#define FT_VERALIGN 15 -#define LB_VERALIGN 16 - -#define FL_ORIENTATION 20 -#define BTN_TXTSTACKED 21 -#define CTR_DIAL 22 -#define FT_DEGREES 23 -#define NF_DEGREES 24 -#define FT_BORDER_LOCK 25 -#define CTR_BORDER_LOCK 26 -#define BTN_ASIAN_VERTICAL 27 - -#define FL_WRAP 40 -#define BTN_WRAP 41 -#define BTN_HYPH 42 -#define FT_TEXTFLOW 43 -#define LB_FRAMEDIR 44 -#define BTN_SHRINK 45 - -//#define ED_INDENT1 100 - -// list box indexes -#define ALIGNDLG_HORALIGN_STD 0 -#define ALIGNDLG_HORALIGN_LEFT 1 -#define ALIGNDLG_HORALIGN_CENTER 2 -#define ALIGNDLG_HORALIGN_RIGHT 3 -#define ALIGNDLG_HORALIGN_BLOCK 4 -#define ALIGNDLG_HORALIGN_FILL 5 -#define ALIGNDLG_HORALIGN_DISTRIBUTED 6 - -#define ALIGNDLG_VERALIGN_STD 0 -#define ALIGNDLG_VERALIGN_TOP 1 -#define ALIGNDLG_VERALIGN_MID 2 -#define ALIGNDLG_VERALIGN_BOTTOM 3 -#define ALIGNDLG_VERALIGN_BLOCK 4 -#define ALIGNDLG_VERALIGN_DISTRIBUTED 5 - -// image list for ValueSets: -#define IL_LOCK_BMPS 1100 -#define IID_BOTTOMLOCK 1 -#define IID_TOPLOCK 2 -#define IID_CELLLOCK 3 - -#define STR_BOTTOMLOCK 1 -#define STR_TOPLOCK 2 -#define STR_CELLLOCK 3 - -#endif - diff --git a/cui/source/tabpages/align.src b/cui/source/tabpages/align.src deleted file mode 100644 index f4e966f39..000000000 --- a/cui/source/tabpages/align.src +++ /dev/null @@ -1,249 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <cuires.hrc> -#include "helpid.hrc" -#include "align.hrc" -#include <svx/dialogs.hrc> - -#define MASKCOLOR \ - MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; } - - // define --------------------------------------------------------------- -#define IL_LOCK_MCOL Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; } - // RID_SVXPAGE_ALIGNMENT ------------------------------------------------- -TabPage RID_SVXPAGE_ALIGNMENT -{ - HelpId = HID_ALIGNMENT ; - Hide = TRUE ; - Text [ en-US ] = "Alignment" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - SVLook = TRUE ; - FixedLine FL_ALIGNMENT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Text alignment"; - }; - FixedText FT_HORALIGN - { - Pos = MAP_APPFONT ( 12 ,14 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text [ en-US ] = "Hori~zontal"; - }; - ListBox LB_HORALIGN - { - HelpID = "cui:ListBox:RID_SVXPAGE_ALIGNMENT:LB_HORALIGN"; - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 25 ); - Size = MAP_APPFONT ( 100 , 60 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "Default" ; ALIGNDLG_HORALIGN_STD ; > ; - < "Left" ; ALIGNDLG_HORALIGN_LEFT ; > ; - < "Center" ; ALIGNDLG_HORALIGN_CENTER ; > ; - < "Right" ; ALIGNDLG_HORALIGN_RIGHT ; > ; - < "Justified" ; ALIGNDLG_HORALIGN_BLOCK ; > ; - < "Filled" ; ALIGNDLG_HORALIGN_FILL ; > ; - < "Distributed" ; ALIGNDLG_HORALIGN_DISTRIBUTED ; > ; - }; - }; - FixedText FT_INDENT - { - Pos = MAP_APPFONT ( 118 , 14 ) ; - Size = MAP_APPFONT ( 40 , 8 ) ; - Text [ en-US ] = "I~ndent" ; - }; - MetricField ED_INDENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_ALIGNMENT:ED_INDENT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 118 , 25 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 990 ; - SpinSize = 10 ; - Unit = FUNIT_POINT ; - }; - FixedText FT_VERALIGN - { - Pos = MAP_APPFONT ( 160 , 14 ) ; - Size = MAP_APPFONT ( 88 , 8 ) ; - Text [ en-US ] = "~Vertical"; - }; - ListBox LB_VERALIGN - { - HelpID = "cui:ListBox:RID_SVXPAGE_ALIGNMENT:LB_VERALIGN"; - Border = TRUE; - Pos = MAP_APPFONT ( 160 , 25 ); - Size = MAP_APPFONT ( 88 , 60 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "Default" ; ALIGNDLG_VERALIGN_STD ; > ; - < "Top" ; ALIGNDLG_VERALIGN_TOP ; > ; - < "Middle" ; ALIGNDLG_VERALIGN_MID ; > ; - < "Bottom" ; ALIGNDLG_VERALIGN_BOTTOM ; > ; - < "Justified" ; ALIGNDLG_VERALIGN_BLOCK ; > ; - < "Distributed" ; ALIGNDLG_VERALIGN_DISTRIBUTED ; > ; - }; - }; - FixedLine FL_ORIENTATION - { - Pos = MAP_APPFONT ( 6 , 43 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Text orientation" ; - }; - TriStateBox BTN_TXTSTACKED - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_TXTSTACKED"; - Pos = MAP_APPFONT ( 133 , 54 ) ; - Size = MAP_APPFONT ( 115 , 10 ) ; - TabStop = TRUE ; - Text[ en-US ] = "Ve~rtically stacked"; - }; - Control CTR_DIAL - { - HelpId = HID_ALIGNMENT_CTR_DIAL ; - Pos = MAP_APPFONT ( 12 , 60 ) ; - Size = MAP_APPFONT ( 42 , 43 ) ; - Text = "ABCD" ; - }; - FixedText FT_DEGREES - { - Pos = MAP_APPFONT ( 72 , 54 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "De~grees"; - }; - NumericField NF_DEGREES - { - HelpID = "cui:NumericField:RID_SVXPAGE_ALIGNMENT:NF_DEGREES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 65 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 359 ; - SpinSize = 5 ; - StrictFormat = TRUE ; - }; - FixedText FT_BORDER_LOCK - { - Pos = MAP_APPFONT ( 72 , 83 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; - Text [ en-US ] = "Re~ference edge" ; - }; - Control CTR_BORDER_LOCK - { - HelpId = HID_ALIGNMENT_CTR_BORDER_LOCK ; - Pos = MAP_APPFONT ( 72 , 94 ) ; - Size = MAP_APPFONT ( 50 , 15 ) ; - TabStop = TRUE ; - }; - TriStateBox BTN_ASIAN_VERTICAL - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_ASIAN_VERTICAL"; - Pos = MAP_APPFONT ( 143 , 68 ) ; - Size = MAP_APPFONT ( 105 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Asian layout ~mode" ; - }; - FixedLine FL_WRAP - { - Pos = MAP_APPFONT ( 6 , 115 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Properties" ; - }; - TriStateBox BTN_WRAP - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_WRAP"; - Pos = MAP_APPFONT ( 12 , 126 ) ; - Size = MAP_APPFONT ( 236 , 10 ) ; - Text [ en-US ] = "~Wrap text automatically" ; - }; - TriStateBox BTN_HYPH - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_HYPH"; - Pos = MAP_APPFONT ( 22 , 139 ) ; - Size = MAP_APPFONT ( 226 , 10 ) ; - Text [ en-US ] = "Hyphenation ~active"; - }; - TriStateBox BTN_SHRINK - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_ALIGNMENT:BTN_SHRINK"; - Pos = MAP_APPFONT( 12, 152 ); - Size = MAP_APPFONT( 236, 10 ); - Text [ en-US ] = "~Shrink to fit cell size"; - }; - FixedText FT_TEXTFLOW - { - Pos = MAP_APPFONT( 12 , 170 ); - Size = MAP_APPFONT( 64 , 8 ); - Text [ en-US ] = "Te~xt direction"; - }; - ListBox LB_FRAMEDIR - { - HelpID = "cui:ListBox:RID_SVXPAGE_ALIGNMENT:LB_FRAMEDIR"; - Pos = MAP_APPFONT( 78 , 168 ); - Size = MAP_APPFONT( 170 , 50 ); - Border = TRUE; - DropDown = TRUE; - }; - ImageList IL_LOCK_BMPS - { - Prefix = "lo"; - MaskColor = IL_LOCK_MCOL ; - IdList = - { - IID_BOTTOMLOCK ; - IID_TOPLOCK ; - IID_CELLLOCK ; - }; - IdCount = { 3 ; }; - }; - String STR_BOTTOMLOCK - { - Text [ en-US ] = "Text Extension From Lower Cell Border" ; - }; - String STR_TOPLOCK - { - Text [ en-US ] = "Text Extension From Upper Cell Border" ; - }; - String STR_CELLLOCK - { - Text [ en-US ] = "Text Extension Inside Cell" ; - }; -}; - // ********************************************************************** EOF - diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx deleted file mode 100644 index 3383a0b27..000000000 --- a/cui/source/tabpages/autocdlg.cxx +++ /dev/null @@ -1,2741 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#define _SVSTDARR_STRINGSISORTDTOR -#define _SVSTDARR_STRINGSDTOR - -#include <svl/svstdarr.hxx> -#include <vcl/msgbox.hxx> -#include <vcl/field.hxx> -#include <vcl/keycodes.hxx> -#include <sot/exchange.hxx> -#include <svtools/transfer.hxx> -#include <unotools/syslocale.hxx> -#include <sfx2/objsh.hxx> -#include <sfx2/viewsh.hxx> -#include <unotools/charclass.hxx> -#include <unotools/collatorwrapper.hxx> -#include <com/sun/star/i18n/CollatorOptions.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <comphelper/processfactory.hxx> -#include <vcl/svapp.hxx> -#include <sfx2/module.hxx> -#include <sfx2/request.hxx> -#include <sfx2/sfxsids.hrc> -#include <svl/eitem.hxx> -#include <svl/languageoptions.hxx> -#include <svx/SmartTagMgr.hxx> -#include <com/sun/star/smarttags/XSmartTagRecognizer.hpp> -#include <com/sun/star/smarttags/XSmartTagAction.hpp> - -#define _OFA_AUTOCDLG_CXX -#include "autocdlg.hxx" -#include "autocdlg.hrc" -#include "helpid.hrc" -#include <editeng/acorrcfg.hxx> -#include <editeng/svxacorr.hxx> -#include "cuicharmap.hxx" -#include <editeng/unolingu.hxx> -#include <dialmgr.hxx> -#include <svx/svxids.hrc> // SID_OPEN_SMARTTAGSOPTIONS - -static LanguageType eLastDialogLanguage = LANGUAGE_SYSTEM; - -using namespace ::com::sun::star::util; -using namespace ::com::sun::star; -using namespace ::rtl; - -static ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& GetProcessFact() -{ - static ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory > xMSF = - ::comphelper::getProcessServiceFactory(); - return xMSF; -} - -OfaAutoCorrDlg::OfaAutoCorrDlg(Window* pParent, const SfxItemSet* _pSet ) : - SfxTabDialog(pParent, CUI_RES( RID_OFA_AUTOCORR_DLG ), _pSet), - aLanguageFT( this, CUI_RES(FT_LANG )), - aLanguageLB( this, CUI_RES(LB_LANG )) -{ - sal_Bool bShowSWOptions = sal_False; - sal_Bool bOpenSmartTagOptions = sal_False; - - if ( _pSet ) - { - SFX_ITEMSET_ARG( _pSet, pItem, SfxBoolItem, SID_AUTO_CORRECT_DLG, sal_False ); - if ( pItem && pItem->GetValue() ) - bShowSWOptions = sal_True; - - SFX_ITEMSET_ARG( _pSet, pItem2, SfxBoolItem, SID_OPEN_SMARTTAGOPTIONS, sal_False ); - if ( pItem2 && pItem2->GetValue() ) - bOpenSmartTagOptions = sal_True; - } - - aLanguageFT.SetZOrder(0, WINDOW_ZORDER_FIRST); - aLanguageLB.SetZOrder(&aLanguageFT, WINDOW_ZORDER_BEHIND); - aLanguageLB.SetHelpId(HID_AUTOCORR_LANGUAGE); - FreeResource(); - - AddTabPage(RID_OFAPAGE_AUTOCORR_OPTIONS, OfaAutocorrOptionsPage::Create, 0); - AddTabPage(RID_OFAPAGE_AUTOFMT_APPLY, OfaSwAutoFmtOptionsPage::Create, 0); - AddTabPage(RID_OFAPAGE_AUTOCOMPLETE_OPTIONS, OfaAutoCompleteTabPage::Create, 0); - AddTabPage(RID_OFAPAGE_SMARTTAG_OPTIONS, OfaSmartTagOptionsTabPage::Create, 0); - - if (!bShowSWOptions) - { - RemoveTabPage(RID_OFAPAGE_AUTOFMT_APPLY); - RemoveTabPage(RID_OFAPAGE_AUTOCOMPLETE_OPTIONS); - RemoveTabPage(RID_OFAPAGE_SMARTTAG_OPTIONS); - } - else - { - // remove smart tag tab page if no extensions are installed - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); - if ( !pOpt || !pOpt->pSmartTagMgr || 0 == pOpt->pSmartTagMgr->NumberOfRecognizers() ) - RemoveTabPage(RID_OFAPAGE_SMARTTAG_OPTIONS); - - RemoveTabPage(RID_OFAPAGE_AUTOCORR_OPTIONS); - } - - AddTabPage(RID_OFAPAGE_AUTOCORR_REPLACE, OfaAutocorrReplacePage::Create, 0); - AddTabPage(RID_OFAPAGE_AUTOCORR_EXCEPT, OfaAutocorrExceptPage::Create, 0); - AddTabPage(RID_OFAPAGE_AUTOCORR_QUOTE, OfaQuoteTabPage::Create, 0); - - // initialize languages - //! LANGUAGE_NONE is displayed as '[All]' and the LanguageType - //! will be set to LANGUAGE_DONTKNOW - sal_Int16 nLangList = LANG_LIST_WESTERN; - - if( SvtLanguageOptions().IsCTLFontEnabled() ) - nLangList |= LANG_LIST_CTL; - aLanguageLB.SetLanguageList( nLangList, sal_True, sal_True ); - aLanguageLB.SelectLanguage( LANGUAGE_NONE ); - sal_uInt16 nPos = aLanguageLB.GetSelectEntryPos(); - DBG_ASSERT( LISTBOX_ENTRY_NOTFOUND != nPos, "listbox entry missing" ); - aLanguageLB.SetEntryData( nPos, (void*)(long) LANGUAGE_DONTKNOW ); - - // Initialisierung funktionier fuer static nicht unter Linux - deswegen hier - if( LANGUAGE_SYSTEM == eLastDialogLanguage ) - eLastDialogLanguage = Application::GetSettings().GetLanguage(); - - LanguageType nSelectLang = LANGUAGE_DONTKNOW; - nPos = aLanguageLB.GetEntryPos( (void*)(long) eLastDialogLanguage ); - if (LISTBOX_ENTRY_NOTFOUND != nPos) - nSelectLang = eLastDialogLanguage; - aLanguageLB.SelectLanguage( nSelectLang ); - - aLanguageLB.SetSelectHdl(LINK(this, OfaAutoCorrDlg, SelectLanguageHdl)); - - Size aMinSize(aLanguageFT.CalcMinimumSize()); - //reserve some extra space for CJK accelerators that are possible inserted - //later (like '(A)') - aLanguageFT.SetPosSizePixel( 0, 0, aMinSize.Width() + 20, 0, WINDOW_POSSIZE_WIDTH ); - - if ( bOpenSmartTagOptions ) - SetCurPageId( RID_OFAPAGE_SMARTTAG_OPTIONS ); -} - -sal_Bool lcl_FindEntry( ListBox& rLB, const String& rEntry, - CollatorWrapper& rCmpClass ) -{ - sal_uInt16 nCount = rLB.GetEntryCount(); - sal_uInt16 nSelPos = rLB.GetSelectEntryPos(); - sal_uInt16 i; - for(i = 0; i < nCount; i++) - { - if( 0 == rCmpClass.compareString(rEntry, rLB.GetEntry(i) )) - { - rLB.SelectEntryPos(i, sal_True); - return sal_True; - } - } - if(LISTBOX_ENTRY_NOTFOUND != nSelPos) - rLB.SelectEntryPos(nSelPos, sal_False); - return sal_False; -} - -IMPL_LINK(OfaAutoCorrDlg, SelectLanguageHdl, ListBox*, pBox) -{ - sal_uInt16 nPos = pBox->GetSelectEntryPos(); - void* pVoid = pBox->GetEntryData(nPos); - LanguageType eNewLang = (LanguageType)(long)pVoid; - //alte Einstellungen speichern und neu fuellen - if(eNewLang != eLastDialogLanguage) - { - sal_uInt16 nPageId = GetCurPageId(); - if(RID_OFAPAGE_AUTOCORR_REPLACE == nPageId) - ((OfaAutocorrReplacePage*)GetTabPage( nPageId ))->SetLanguage(eNewLang); - else if(RID_OFAPAGE_AUTOCORR_EXCEPT == nPageId) - ((OfaAutocorrExceptPage*)GetTabPage( nPageId ))->SetLanguage(eNewLang); - } - return 0; -} - -OfaAutocorrOptionsPage::OfaAutocorrOptionsPage( Window* pParent, - const SfxItemSet& rSet ) : - SfxTabPage(pParent, CUI_RES( RID_OFAPAGE_AUTOCORR_OPTIONS ), rSet), - aCheckLB (this, CUI_RES(CLB_SETTINGS )), - - sInput (CUI_RES(ST_USE_REPLACE )), - sDoubleCaps (CUI_RES(ST_CPTL_STT_WORD )), - sStartCap (CUI_RES(ST_CPTL_STT_SENT )), - sBoldUnderline (CUI_RES(ST_BOLD_UNDER )), - sURL (CUI_RES(ST_DETECT_URL )), - sNoDblSpaces (CUI_RES(STR_NO_DBL_SPACES )), - sDash (CUI_RES(ST_DASH )), - sAccidentalCaps (CUI_RES(ST_CORRECT_ACCIDENTAL_CAPS_LOCK)) -{ - FreeResource(); - - aCheckLB.SetHelpId(HID_OFAPAGE_AUTOCORR_CLB); -} - -OfaAutocorrOptionsPage::~OfaAutocorrOptionsPage() -{ -} - -SfxTabPage* OfaAutocorrOptionsPage::Create( Window* pParent, - const SfxItemSet& rSet) -{ - return new OfaAutocorrOptionsPage(pParent, rSet); -} - -sal_Bool OfaAutocorrOptionsPage::FillItemSet( SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - long nFlags = pAutoCorrect->GetFlags(); - - sal_uInt16 nPos = 0; - pAutoCorrect->SetAutoCorrFlag(Autocorrect, aCheckLB.IsChecked(nPos++)); - pAutoCorrect->SetAutoCorrFlag(CptlSttWrd, aCheckLB.IsChecked(nPos++)); - pAutoCorrect->SetAutoCorrFlag(CptlSttSntnc, aCheckLB.IsChecked(nPos++)); - pAutoCorrect->SetAutoCorrFlag(ChgWeightUnderl, aCheckLB.IsChecked(nPos++)); - pAutoCorrect->SetAutoCorrFlag(SetINetAttr, aCheckLB.IsChecked(nPos++)); - pAutoCorrect->SetAutoCorrFlag(ChgToEnEmDash, aCheckLB.IsChecked(nPos++)); - pAutoCorrect->SetAutoCorrFlag(IgnoreDoubleSpace, aCheckLB.IsChecked(nPos++)); - pAutoCorrect->SetAutoCorrFlag(CorrectCapsLock, aCheckLB.IsChecked(nPos++)); - - sal_Bool bReturn = nFlags != pAutoCorrect->GetFlags(); - if(bReturn ) - { - SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get(); - rCfg.SetModified(); - rCfg.Commit(); - } - return bReturn; -} - -void OfaAutocorrOptionsPage::ActivatePage( const SfxItemSet& ) -{ - ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(sal_False); -} - -void OfaAutocorrOptionsPage::Reset( const SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - const long nFlags = pAutoCorrect->GetFlags(); - - aCheckLB.SetUpdateMode(sal_False); - aCheckLB.Clear(); - - aCheckLB.InsertEntry(sInput); - aCheckLB.InsertEntry(sDoubleCaps); - aCheckLB.InsertEntry(sStartCap); - aCheckLB.InsertEntry(sBoldUnderline); - aCheckLB.InsertEntry(sURL); - aCheckLB.InsertEntry(sDash); - aCheckLB.InsertEntry(sNoDblSpaces); - aCheckLB.InsertEntry(sAccidentalCaps); - - sal_uInt16 nPos = 0; - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & Autocorrect) ); - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CptlSttWrd) ); - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CptlSttSntnc) ); - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgWeightUnderl) ); - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & SetINetAttr) ); - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgToEnEmDash) ); - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & IgnoreDoubleSpace) ); - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & CorrectCapsLock) ); - - aCheckLB.SetUpdateMode(sal_True); -} - -/*********************************************************************/ -/* */ -/* Hilfs-struct fuer dUserDaten der Checklistbox */ -/* */ -/*********************************************************************/ - -struct ImpUserData -{ - String *pString; - Font* pFont; - - ImpUserData(String* pText, Font* pFnt) - { pString = pText; pFont = pFnt;} -}; - - -/*********************************************************************/ -/* */ -/* Dialog fuer Prozenteinstellung */ -/* */ -/*********************************************************************/ - -class OfaAutoFmtPrcntSet : public ModalDialog -{ - OKButton aOKPB; - CancelButton aCancelPB; - FixedLine aPrcntFL; - MetricField aPrcntMF; - - public: - OfaAutoFmtPrcntSet(Window* pParent) : - ModalDialog(pParent, CUI_RES(RID_OFADLG_PRCNT_SET)), - aOKPB(this, CUI_RES(BT_OK)), - aCancelPB(this, CUI_RES(BT_CANCEL)), - aPrcntFL(this, CUI_RES(FL_PRCNT)), - aPrcntMF(this, CUI_RES(ED_RIGHT_MARGIN)) - { - FreeResource(); - } - MetricField& GetPrcntFld(){return aPrcntMF;} -}; - - -/*********************************************************************/ -/* */ -/* veraenderter LBoxString */ -/* */ -/*********************************************************************/ - -class OfaImpBrwString : public SvLBoxString -{ -public: - - OfaImpBrwString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, - const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr){} - - virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, - SvLBoxEntry* pEntry); -}; - -/*********************************************************************/ -/* */ -/*********************************************************************/ - - -void OfaImpBrwString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, - SvLBoxEntry* pEntry ) -{ - rDev.DrawText( rPos, GetText() ); - if(pEntry->GetUserData()) - { - ImpUserData* pUserData = (ImpUserData* )pEntry->GetUserData(); - Point aNewPos(rPos); - aNewPos.X() += rDev.GetTextWidth(GetText()); - Font aOldFont( rDev.GetFont()); - Font aFont( aOldFont ); - if(pUserData->pFont) - { - aFont = *pUserData->pFont; - aFont.SetColor(aOldFont.GetColor()); - aFont.SetSize(aOldFont.GetSize()); - } - aFont.SetWeight( WEIGHT_BOLD ); - - sal_Bool bFett = sal_True; - sal_uInt16 nPos = 0; - do { - String sTxt( pUserData->pString->GetToken( 0, 1, nPos )); - - if( bFett ) - rDev.SetFont( aFont ); - - rDev.DrawText( aNewPos, sTxt ); - - if( STRING_NOTFOUND != nPos ) - aNewPos.X() += rDev.GetTextWidth( sTxt ); - - if( bFett ) - rDev.SetFont( aOldFont ); - - bFett = !bFett; - } while( STRING_NOTFOUND != nPos ); - } -} - -/*********************************************************************/ -/* */ -/* TabPage Autoformat anwenden */ -/* */ -/*********************************************************************/ - -#define CBCOL_FIRST 0 -#define CBCOL_SECOND 1 -#define CBCOL_BOTH 2 - -enum OfaAutoFmtOptions -{ - USE_REPLACE_TABLE, - CORR_UPPER, - BEGIN_UPPER, - BOLD_UNDERLINE, - DETECT_URL, - REPLACE_DASHES, - DEL_SPACES_AT_STT_END, - DEL_SPACES_BETWEEN_LINES, - IGNORE_DBLSPACE, - CORRECT_CAPS_LOCK, - APPLY_NUMBERING, - INSERT_BORDER, - CREATE_TABLE, - REPLACE_STYLES, - DEL_EMPTY_NODE, - REPLACE_USER_COLL, - REPLACE_BULLETS, - MERGE_SINGLE_LINE_PARA -}; - -OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( Window* pParent, - const SfxItemSet& rSet ) : - SfxTabPage(pParent, CUI_RES(RID_OFAPAGE_AUTOFMT_APPLY), rSet), - m_aCheckLBContainer(this, CUI_RES(CLB_SETTINGS)), - aCheckLB(m_aCheckLBContainer), - aEditPB (this, CUI_RES(PB_EDIT)), - aHeader1Expl (this, CUI_RES(FT_HEADER1_EXPLANATION)), - aHeader2Expl (this, CUI_RES(FT_HEADER2_EXPLANATION)), - sHeader1 (CUI_RES( STR_HEADER1 )), - sHeader2 (CUI_RES( STR_HEADER2 )), - sDeleteEmptyPara (CUI_RES( ST_DEL_EMPTY_PARA)), - sUseReplaceTbl (CUI_RES( ST_USE_REPLACE )), - sCptlSttWord (CUI_RES( ST_CPTL_STT_WORD)), - sCptlSttSent (CUI_RES( ST_CPTL_STT_SENT)), - sUserStyle (CUI_RES( ST_USER_STYLE )), - sBullet (CUI_RES( ST_BULLET )), - sBoldUnder (CUI_RES( ST_BOLD_UNDER )), - sNoDblSpaces (CUI_RES( STR_NO_DBL_SPACES)), - sCorrectCapsLock (CUI_RES( ST_CORRECT_ACCIDENTAL_CAPS_LOCK)), - sDetectURL (CUI_RES( ST_DETECT_URL )), - sDash (CUI_RES( ST_DASH )), - sRightMargin (CUI_RES( ST_RIGHT_MARGIN )), - sNum (CUI_RES( STR_NUM )), - sBorder (CUI_RES( STR_BORDER )), - sTable (CUI_RES( STR_TABLE )), - sReplaceTemplates (CUI_RES( STR_REPLACE_TEMPLATES)), - sDelSpaceAtSttEnd (CUI_RES( STR_DEL_SPACES_AT_STT_END)), - sDelSpaceBetweenLines(CUI_RES(STR_DEL_SPACES_BETWEEN_LINES)), - - nPercent ( 50 ), - pCheckButtonData( NULL ) - -{ - FreeResource(); - - //typ. Anfuehrungszeichen einsetzen - SvtSysLocale aSysLcl; - - aCheckLB.SetHelpId(HID_OFAPAGE_AUTOFORMAT_CLB); - aCheckLB.SetStyle(aCheckLB.GetStyle()|WB_HSCROLL| WB_VSCROLL); - - aCheckLB.SetSelectHdl(LINK(this, OfaSwAutoFmtOptionsPage, SelectHdl)); - aCheckLB.SetDoubleClickHdl(LINK(this, OfaSwAutoFmtOptionsPage, EditHdl)); - - static long aStaticTabs[]= - { - 3, 0, 20, 40 - }; - - aCheckLB.SvxSimpleTable::SetTabs(aStaticTabs); - String sHeader( sHeader1 ); - sHeader += '\t'; - sHeader += sHeader2; - sHeader += '\t'; - aCheckLB.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, - HIB_CENTER | HIB_VCENTER | HIB_FIXEDPOS | HIB_FIXED); - - aEditPB.SetClickHdl(LINK(this, OfaSwAutoFmtOptionsPage, EditHdl)); -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -SvLBoxEntry* OfaSwAutoFmtOptionsPage::CreateEntry(String& rTxt, sal_uInt16 nCol) -{ - SvLBoxEntry* pEntry = new SvLBoxEntry; - - if ( !pCheckButtonData ) - { - pCheckButtonData = new SvLBoxButtonData( &aCheckLB ); - aCheckLB.SetCheckButtonData( pCheckButtonData ); - } - - pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0)); // Sonst Puff! - - String sEmpty; - if (nCol == CBCOL_SECOND) - pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // Leerspalte - else - pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) ); - - if (nCol == CBCOL_FIRST) - pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // Leerspalte - else - pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) ); - pEntry->AddItem( new OfaImpBrwString( pEntry, 0, rTxt ) ); - - return pEntry; -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - - -OfaSwAutoFmtOptionsPage::~OfaSwAutoFmtOptionsPage() -{ - delete (ImpUserData*) aCheckLB.GetUserData( REPLACE_BULLETS ); - delete (ImpUserData*) aCheckLB.GetUserData( APPLY_NUMBERING ); - delete (ImpUserData*) aCheckLB.GetUserData( MERGE_SINGLE_LINE_PARA ); - delete pCheckButtonData; -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -SfxTabPage* OfaSwAutoFmtOptionsPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new OfaSwAutoFmtOptionsPage(pParent, rAttrSet); -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -sal_Bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet& ) -{ - sal_Bool bModified = sal_False; - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); - long nFlags = pAutoCorrect->GetFlags(); - - sal_Bool bCheck = aCheckLB.IsChecked(USE_REPLACE_TABLE, CBCOL_FIRST); - bModified |= pOpt->bAutoCorrect != bCheck; - pOpt->bAutoCorrect = bCheck; - pAutoCorrect->SetAutoCorrFlag(Autocorrect, - aCheckLB.IsChecked(USE_REPLACE_TABLE, CBCOL_SECOND)); - - bCheck = aCheckLB.IsChecked(CORR_UPPER, CBCOL_FIRST); - bModified |= pOpt->bCptlSttWrd != bCheck; - pOpt->bCptlSttWrd = bCheck; - pAutoCorrect->SetAutoCorrFlag(CptlSttWrd, - aCheckLB.IsChecked(CORR_UPPER, CBCOL_SECOND)); - - bCheck = aCheckLB.IsChecked(BEGIN_UPPER, CBCOL_FIRST); - bModified |= pOpt->bCptlSttSntnc != bCheck; - pOpt->bCptlSttSntnc = bCheck; - pAutoCorrect->SetAutoCorrFlag(CptlSttSntnc, - aCheckLB.IsChecked(BEGIN_UPPER, CBCOL_SECOND)); - - bCheck = aCheckLB.IsChecked(BOLD_UNDERLINE, CBCOL_FIRST); - bModified |= pOpt->bChgWeightUnderl != bCheck; - pOpt->bChgWeightUnderl = bCheck; - pAutoCorrect->SetAutoCorrFlag(ChgWeightUnderl, - aCheckLB.IsChecked(BOLD_UNDERLINE, CBCOL_SECOND)); - - pAutoCorrect->SetAutoCorrFlag(IgnoreDoubleSpace, - aCheckLB.IsChecked(IGNORE_DBLSPACE, CBCOL_SECOND)); - - pAutoCorrect->SetAutoCorrFlag(CorrectCapsLock, - aCheckLB.IsChecked(CORRECT_CAPS_LOCK, CBCOL_SECOND)); - - bCheck = aCheckLB.IsChecked(DETECT_URL, CBCOL_FIRST); - bModified |= pOpt->bSetINetAttr != bCheck; - pOpt->bSetINetAttr = bCheck; - pAutoCorrect->SetAutoCorrFlag(SetINetAttr, - aCheckLB.IsChecked(DETECT_URL, CBCOL_SECOND)); - - bCheck = aCheckLB.IsChecked(DEL_EMPTY_NODE, CBCOL_FIRST); - bModified |= pOpt->bDelEmptyNode != bCheck; - pOpt->bDelEmptyNode = bCheck; - - bCheck = aCheckLB.IsChecked(REPLACE_USER_COLL, CBCOL_FIRST); - bModified |= pOpt->bChgUserColl != bCheck; - pOpt->bChgUserColl = bCheck; - - bCheck = aCheckLB.IsChecked(REPLACE_BULLETS, CBCOL_FIRST); - bModified |= pOpt->bChgEnumNum != bCheck; - pOpt->bChgEnumNum = bCheck; - bModified |= aBulletFont != pOpt->aBulletFont; - pOpt->aBulletFont = aBulletFont; - bModified |= String(pOpt->cBullet) != sBulletChar; - pOpt->cBullet = sBulletChar.GetChar(0); - - bModified |= aByInputBulletFont != pOpt->aByInputBulletFont; - bModified |= String(pOpt->cByInputBullet) != sByInputBulletChar; - pOpt->aByInputBulletFont = aByInputBulletFont; - pOpt->cByInputBullet = sByInputBulletChar.GetChar(0); - - bCheck = aCheckLB.IsChecked(MERGE_SINGLE_LINE_PARA, CBCOL_FIRST); - bModified |= pOpt->bRightMargin != bCheck; - pOpt->bRightMargin = bCheck; - bModified |= nPercent != pOpt->nRightMargin; - pOpt->nRightMargin = (sal_uInt8)nPercent; - - bCheck = aCheckLB.IsChecked(APPLY_NUMBERING, CBCOL_SECOND); - bModified |= pOpt->bSetNumRule != bCheck; - pOpt->bSetNumRule = bCheck; - - bCheck = aCheckLB.IsChecked(INSERT_BORDER, CBCOL_SECOND); - bModified |= pOpt->bSetBorder != bCheck; - pOpt->bSetBorder = bCheck; - - bCheck = aCheckLB.IsChecked(CREATE_TABLE, CBCOL_SECOND); - bModified |= pOpt->bCreateTable != bCheck; - pOpt->bCreateTable = bCheck; - - bCheck = aCheckLB.IsChecked(REPLACE_STYLES, CBCOL_SECOND); - bModified |= pOpt->bReplaceStyles != bCheck; - pOpt->bReplaceStyles = bCheck; - - bCheck = aCheckLB.IsChecked(REPLACE_DASHES, CBCOL_FIRST); - bModified |= pOpt->bChgToEnEmDash != bCheck; - pOpt->bChgToEnEmDash = bCheck; - pAutoCorrect->SetAutoCorrFlag(ChgToEnEmDash, - aCheckLB.IsChecked(REPLACE_DASHES, CBCOL_SECOND)); - - bCheck = aCheckLB.IsChecked(DEL_SPACES_AT_STT_END, CBCOL_FIRST); - bModified |= pOpt->bAFmtDelSpacesAtSttEnd != bCheck; - pOpt->bAFmtDelSpacesAtSttEnd = bCheck; - bCheck = aCheckLB.IsChecked(DEL_SPACES_AT_STT_END, CBCOL_SECOND); - bModified |= pOpt->bAFmtByInpDelSpacesAtSttEnd != bCheck; - pOpt->bAFmtByInpDelSpacesAtSttEnd = bCheck; - - bCheck = aCheckLB.IsChecked(DEL_SPACES_BETWEEN_LINES, CBCOL_FIRST); - bModified |= pOpt->bAFmtDelSpacesBetweenLines != bCheck; - pOpt->bAFmtDelSpacesBetweenLines = bCheck; - bCheck = aCheckLB.IsChecked(DEL_SPACES_BETWEEN_LINES, CBCOL_SECOND); - bModified |= pOpt->bAFmtByInpDelSpacesBetweenLines != bCheck; - pOpt->bAFmtByInpDelSpacesBetweenLines = bCheck; - - if(bModified || nFlags != pAutoCorrect->GetFlags()) - { - SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get(); - rCfg.SetModified(); - rCfg.Commit(); - } - - return sal_True; -} - -void OfaSwAutoFmtOptionsPage::ActivatePage( const SfxItemSet& ) -{ - ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(sal_False); -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - - -void OfaSwAutoFmtOptionsPage::Reset( const SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); - const long nFlags = pAutoCorrect->GetFlags(); - - aCheckLB.SetUpdateMode(sal_False); - aCheckLB.Clear(); - - // Die folgenden Eintraege muessen in der selben Reihenfolge, wie im - // OfaAutoFmtOptions-enum eingefuegt werden! - aCheckLB.GetModel()->Insert(CreateEntry(sUseReplaceTbl, CBCOL_BOTH )); - aCheckLB.GetModel()->Insert(CreateEntry(sCptlSttWord, CBCOL_BOTH )); - aCheckLB.GetModel()->Insert(CreateEntry(sCptlSttSent, CBCOL_BOTH )); - aCheckLB.GetModel()->Insert(CreateEntry(sBoldUnder, CBCOL_BOTH )); - aCheckLB.GetModel()->Insert(CreateEntry(sDetectURL, CBCOL_BOTH )); - aCheckLB.GetModel()->Insert(CreateEntry(sDash, CBCOL_BOTH )); - aCheckLB.GetModel()->Insert(CreateEntry(sDelSpaceAtSttEnd, CBCOL_BOTH )); - aCheckLB.GetModel()->Insert(CreateEntry(sDelSpaceBetweenLines, CBCOL_BOTH )); - - aCheckLB.GetModel()->Insert(CreateEntry(sNoDblSpaces, CBCOL_SECOND)); - aCheckLB.GetModel()->Insert(CreateEntry(sCorrectCapsLock, CBCOL_SECOND)); - aCheckLB.GetModel()->Insert(CreateEntry(sNum, CBCOL_SECOND)); - aCheckLB.GetModel()->Insert(CreateEntry(sBorder, CBCOL_SECOND)); - aCheckLB.GetModel()->Insert(CreateEntry(sTable, CBCOL_SECOND)); - aCheckLB.GetModel()->Insert(CreateEntry(sReplaceTemplates, CBCOL_SECOND)); - aCheckLB.GetModel()->Insert(CreateEntry(sDeleteEmptyPara, CBCOL_FIRST )); - aCheckLB.GetModel()->Insert(CreateEntry(sUserStyle, CBCOL_FIRST )); - aCheckLB.GetModel()->Insert(CreateEntry(sBullet, CBCOL_FIRST )); - aCheckLB.GetModel()->Insert(CreateEntry(sRightMargin, CBCOL_FIRST )); - - aCheckLB.CheckEntryPos( USE_REPLACE_TABLE, CBCOL_FIRST, pOpt->bAutoCorrect ); - aCheckLB.CheckEntryPos( USE_REPLACE_TABLE, CBCOL_SECOND, 0 != (nFlags & Autocorrect)); - aCheckLB.CheckEntryPos( CORR_UPPER, CBCOL_FIRST, pOpt->bCptlSttWrd ); - aCheckLB.CheckEntryPos( CORR_UPPER, CBCOL_SECOND, 0 != (nFlags & CptlSttWrd) ); - aCheckLB.CheckEntryPos( BEGIN_UPPER, CBCOL_FIRST, pOpt->bCptlSttSntnc ); - aCheckLB.CheckEntryPos( BEGIN_UPPER, CBCOL_SECOND, 0 != (nFlags & CptlSttSntnc) ); - aCheckLB.CheckEntryPos( BOLD_UNDERLINE, CBCOL_FIRST, pOpt->bChgWeightUnderl ); - aCheckLB.CheckEntryPos( BOLD_UNDERLINE, CBCOL_SECOND, 0 != (nFlags & ChgWeightUnderl) ); - aCheckLB.CheckEntryPos( IGNORE_DBLSPACE, CBCOL_SECOND, 0 != (nFlags & IgnoreDoubleSpace) ); - aCheckLB.CheckEntryPos( CORRECT_CAPS_LOCK, CBCOL_SECOND, 0 != (nFlags & CorrectCapsLock) ); - aCheckLB.CheckEntryPos( DETECT_URL, CBCOL_FIRST, pOpt->bSetINetAttr ); - aCheckLB.CheckEntryPos( DETECT_URL, CBCOL_SECOND, 0 != (nFlags & SetINetAttr) ); - aCheckLB.CheckEntryPos( REPLACE_DASHES, CBCOL_FIRST, pOpt->bChgToEnEmDash ); - aCheckLB.CheckEntryPos( REPLACE_DASHES, CBCOL_SECOND, 0 != (nFlags & ChgToEnEmDash) ); - aCheckLB.CheckEntryPos( DEL_SPACES_AT_STT_END, CBCOL_FIRST, pOpt->bAFmtDelSpacesAtSttEnd ); - aCheckLB.CheckEntryPos( DEL_SPACES_AT_STT_END, CBCOL_SECOND, pOpt->bAFmtByInpDelSpacesAtSttEnd ); - aCheckLB.CheckEntryPos( DEL_SPACES_BETWEEN_LINES, CBCOL_FIRST, pOpt->bAFmtDelSpacesBetweenLines ); - aCheckLB.CheckEntryPos( DEL_SPACES_BETWEEN_LINES, CBCOL_SECOND, pOpt->bAFmtByInpDelSpacesBetweenLines ); - aCheckLB.CheckEntryPos( DEL_EMPTY_NODE, CBCOL_FIRST, pOpt->bDelEmptyNode ); - aCheckLB.CheckEntryPos( REPLACE_USER_COLL, CBCOL_FIRST, pOpt->bChgUserColl ); - aCheckLB.CheckEntryPos( REPLACE_BULLETS, CBCOL_FIRST, pOpt->bChgEnumNum ); - - aBulletFont = pOpt->aBulletFont; - sBulletChar = pOpt->cBullet; - ImpUserData* pUserData = new ImpUserData(&sBulletChar, &aBulletFont); - aCheckLB.SetUserData( REPLACE_BULLETS, pUserData ); - - nPercent = pOpt->nRightMargin; - sMargin = ' '; - sMargin += String::CreateFromInt32( nPercent ); - sMargin += '%'; - pUserData = new ImpUserData(&sMargin, 0); - aCheckLB.SetUserData( MERGE_SINGLE_LINE_PARA, pUserData ); - - aCheckLB.CheckEntryPos( APPLY_NUMBERING, CBCOL_SECOND, pOpt->bSetNumRule ); - - aByInputBulletFont = pOpt->aByInputBulletFont; - sByInputBulletChar = pOpt->cByInputBullet; - ImpUserData* pUserData2 = new ImpUserData(&sByInputBulletChar, &aByInputBulletFont); - aCheckLB.SetUserData( APPLY_NUMBERING , pUserData2 ); - - aCheckLB.CheckEntryPos( MERGE_SINGLE_LINE_PARA, CBCOL_FIRST, pOpt->bRightMargin ); - aCheckLB.CheckEntryPos( INSERT_BORDER, CBCOL_SECOND, pOpt->bSetBorder ); - aCheckLB.CheckEntryPos( CREATE_TABLE, CBCOL_SECOND, pOpt->bCreateTable ); - aCheckLB.CheckEntryPos( REPLACE_STYLES, CBCOL_SECOND, pOpt->bReplaceStyles ); - - aCheckLB.SetUpdateMode(sal_True); -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -IMPL_LINK(OfaSwAutoFmtOptionsPage, SelectHdl, OfaACorrCheckListBox*, pBox) -{ - aEditPB.Enable(0 != pBox->FirstSelected()->GetUserData()); - return 0; -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -IMPL_LINK(OfaSwAutoFmtOptionsPage, EditHdl, PushButton*, EMPTYARG) -{ - sal_uLong nSelEntryPos = aCheckLB.GetSelectEntryPos(); - if( nSelEntryPos == REPLACE_BULLETS || - nSelEntryPos == APPLY_NUMBERING) - { - SvxCharacterMap *pMapDlg = new SvxCharacterMap(this); - ImpUserData* pUserData = (ImpUserData*)aCheckLB.FirstSelected()->GetUserData(); - pMapDlg->SetCharFont(*pUserData->pFont); - pMapDlg->SetChar( pUserData->pString->GetChar(0) ); - if(RET_OK == pMapDlg->Execute()) - { - Font aFont(pMapDlg->GetCharFont()); - *pUserData->pFont = aFont; - sal_UCS4 aChar = pMapDlg->GetChar(); - // using the UCS4 constructor - rtl::OUString aOUStr( &aChar, 1 ); - *pUserData->pString = aOUStr; - } - delete pMapDlg; - } - else if( MERGE_SINGLE_LINE_PARA == nSelEntryPos ) - { - // Dialog fuer Prozenteinstellung - OfaAutoFmtPrcntSet aDlg(this); - aDlg.GetPrcntFld().SetValue(nPercent); - if(RET_OK == aDlg.Execute()) - { - nPercent = (sal_uInt16)aDlg.GetPrcntFld().GetValue(); - sMargin = ' '; - sMargin += String::CreateFromInt32( nPercent ); - sMargin += '%'; - } - } - aCheckLB.Invalidate(); - return 0; -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -void OfaACorrCheckListBox::SetTabs() -{ - SvxSimpleTable::SetTabs(); - sal_uInt16 nAdjust = SV_LBOXTAB_ADJUST_RIGHT|SV_LBOXTAB_ADJUST_LEFT|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_ADJUST_NUMERIC|SV_LBOXTAB_FORCE; - - if( aTabs.Count() > 1 ) - { - SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(1); - pTab->nFlags &= ~nAdjust; - pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE; - } - if( aTabs.Count() > 2 ) - { - SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(2); - pTab->nFlags &= ~nAdjust; - pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE; - } -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -void OfaACorrCheckListBox::CheckEntryPos(sal_uLong nPos, sal_uInt16 nCol, sal_Bool bChecked) -{ - if ( nPos < GetEntryCount() ) - SetCheckButtonState( - GetEntry(nPos), - nCol, - bChecked ? SvButtonState( SV_BUTTON_CHECKED ) : - SvButtonState( SV_BUTTON_UNCHECKED ) ); -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -sal_Bool OfaACorrCheckListBox::IsChecked(sal_uLong nPos, sal_uInt16 nCol) -{ - return GetCheckButtonState( GetEntry(nPos), nCol ) == SV_BUTTON_CHECKED; -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -void OfaACorrCheckListBox::SetCheckButtonState( SvLBoxEntry* pEntry, sal_uInt16 nCol, SvButtonState eState) -{ - SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1)); - - DBG_ASSERT(pItem,"SetCheckButton:Item not found"); - if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON) - { - switch( eState ) - { - case SV_BUTTON_CHECKED: - pItem->SetStateChecked(); - break; - - case SV_BUTTON_UNCHECKED: - pItem->SetStateUnchecked(); - break; - - case SV_BUTTON_TRISTATE: - pItem->SetStateTristate(); - break; - } - InvalidateEntry( pEntry ); - } -} - -/*********************************************************************/ -/* */ -/*********************************************************************/ - -SvButtonState OfaACorrCheckListBox::GetCheckButtonState( SvLBoxEntry* pEntry, sal_uInt16 nCol ) const -{ - SvButtonState eState = SV_BUTTON_UNCHECKED; - SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetItem(nCol + 1)); - DBG_ASSERT(pItem,"GetChButnState:Item not found"); - - if (((SvLBoxItem*)pItem)->IsA() == SV_ITEM_ID_LBOXBUTTON) - { - sal_uInt16 nButtonFlags = pItem->GetButtonFlags(); - eState = pCheckButtonData->ConvertToButtonState( nButtonFlags ); - } - - return eState; -} - -void OfaACorrCheckListBox::HBarClick() -{ - // Sortierung durch diese Ueberladung abgeklemmt -} - -void OfaACorrCheckListBox::KeyInput( const KeyEvent& rKEvt ) -{ - if(!rKEvt.GetKeyCode().GetModifier() && - KEY_SPACE == rKEvt.GetKeyCode().GetCode()) - { - sal_uLong nSelPos = GetSelectEntryPos(); - sal_uInt16 nCol = GetCurrentTabPos() - 1; - if ( nCol < 2 ) - { - CheckEntryPos( nSelPos, nCol, !IsChecked( nSelPos, nCol ) ); - CallImplEventListeners( VCLEVENT_CHECKBOX_TOGGLE, (void*)GetEntry( nSelPos ) ); - } - else - { - sal_uInt16 nCheck = IsChecked(nSelPos, 1) ? 1 : 0; - if(IsChecked(nSelPos, 0)) - nCheck += 2; - nCheck--; - nCheck &= 3; - CheckEntryPos(nSelPos, 1, 0 != (nCheck & 1)); - CheckEntryPos(nSelPos, 0, 0 != (nCheck & 2)); - } - } - else - SvxSimpleTable::KeyInput(rKEvt); -} - -struct DoubleString -{ - String sShort; - String sLong; - void* pUserData; // CheckBox -> form. Text Bool -> Selektionstext -}; -typedef DoubleString* DoubleStringPtr; -SV_DECL_PTRARR_DEL(DoubleStringArray, DoubleStringPtr, 4, 4) -SV_IMPL_PTRARR(DoubleStringArray, DoubleStringPtr); - -void lcl_ClearTable(DoubleStringTable& rTable) -{ - DoubleStringArrayPtr pArray = rTable.Last(); - while(pArray) - { - pArray->DeleteAndDestroy(0, pArray->Count()); - delete pArray; - pArray = rTable.Prev(); - } - rTable.Clear(); -} - -OfaAutocorrReplacePage::OfaAutocorrReplacePage( Window* pParent, - const SfxItemSet& rSet ) : - SfxTabPage(pParent, CUI_RES( RID_OFAPAGE_AUTOCORR_REPLACE ), rSet), - aTextOnlyCB( this, CUI_RES(CB_TEXT_ONLY )), - aShortFT ( this, CUI_RES(FT_SHORT )), - aShortED ( this, CUI_RES(ED_SHORT )), - aReplaceFT( this, CUI_RES(FT_REPLACE )), - aReplaceED( this, CUI_RES(ED_REPLACE )), - aReplaceTLB( this, CUI_RES(TLB_REPLACE )), - aNewReplacePB( this, CUI_RES(PB_NEW_REPLACE )), - aDeleteReplacePB(this,CUI_RES(PB_DELETE_REPLACE )), - sModify(CUI_RES(STR_MODIFY)), - sNew(aNewReplacePB.GetText()), - pFormatText(0), - eLang(eLastDialogLanguage), - bHasSelectionText(sal_False), - bFirstSelect(sal_True), - bReplaceEditChanged(sal_False), - bSWriter(sal_True) -{ - FreeResource(); - SfxModule *pMod = *(SfxModule**)GetAppData(SHL_WRITER); - bSWriter = pMod == SfxModule::GetActiveModule(); - - ::com::sun::star::lang::Locale aLcl( SvxCreateLocale(eLastDialogLanguage )); - pCompareClass = new CollatorWrapper( GetProcessFact() ); - pCompareClass->loadDefaultCollator( aLcl, 0 ); - pCharClass = new CharClass( aLcl ); - - static long nTabs[] = { 2 /* Tab-Count */, 1, 61 }; - aReplaceTLB.SetTabs( &nTabs[0], MAP_APPFONT ); - - aReplaceTLB.SetStyle(aReplaceTLB.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN); - aReplaceTLB.SetSelectHdl(LINK(this, OfaAutocorrReplacePage, SelectHdl)); - aNewReplacePB.SetClickHdl( LINK(this, OfaAutocorrReplacePage, NewDelHdl)); - aDeleteReplacePB.SetClickHdl(LINK(this, OfaAutocorrReplacePage, NewDelHdl)); - aShortED.SetModifyHdl(LINK(this, OfaAutocorrReplacePage, ModifyHdl)); - aReplaceED.SetModifyHdl(LINK(this, OfaAutocorrReplacePage, ModifyHdl)); - aShortED.SetActionHdl(LINK(this, OfaAutocorrReplacePage, NewDelHdl)); - aReplaceED.SetActionHdl(LINK(this, OfaAutocorrReplacePage, NewDelHdl)); - - aReplaceED.SetSpaces(sal_True); - aShortED.SetSpaces(sal_True); - aShortED.SetMaxTextLen(30); -} - -OfaAutocorrReplacePage::~OfaAutocorrReplacePage() -{ - delete pFormatText; - lcl_ClearTable(aDoubleStringTable); - delete pCompareClass; - delete pCharClass; -} - -SfxTabPage* OfaAutocorrReplacePage::Create( Window* pParent, - const SfxItemSet& rSet) -{ - return new OfaAutocorrReplacePage(pParent, rSet); -} - -void OfaAutocorrReplacePage::ActivatePage( const SfxItemSet& ) -{ - if(eLang != eLastDialogLanguage) - SetLanguage(eLastDialogLanguage); - ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(sal_True); -} - -int OfaAutocorrReplacePage::DeactivatePage( SfxItemSet* ) -{ - return LEAVE_PAGE; -} - -sal_Bool OfaAutocorrReplacePage::FillItemSet( SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - DoubleStringArrayPtr pDoubleStringArray = aDoubleStringTable.Last(); - while(pDoubleStringArray) - { - LanguageType eCurLang = (LanguageType)aDoubleStringTable.GetCurKey(); - if(eCurLang != eLang) // die aktuelle Sprache wird weiter hinten behandelt - { - SvxAutocorrWordList* pWordList = pAutoCorrect->LoadAutocorrWordList(eCurLang); - sal_uInt16 nWordListCount = pWordList->Count(); - sal_uInt16 nDoubleStringArrayCount = pDoubleStringArray->Count(); - sal_uInt16 nPos = nDoubleStringArrayCount; - sal_uInt16 nLastPos = nPos; - // 1. Durchlauf: Eintraege loeschen oder veraendern: - - - for( sal_uInt16 nWordListPos = nWordListCount; nWordListPos; nWordListPos-- ) - { - SvxAutocorrWordPtr pWordPtr = pWordList->GetObject(nWordListPos - 1); - String sEntry(pWordPtr->GetShort()); - // formatierter Text steht nur im Writer - sal_Bool bFound = !bSWriter && !pWordPtr->IsTextOnly(); - while(!bFound && nPos) - { - DoubleString* pDouble = pDoubleStringArray->GetObject( nPos - 1); - - if( 0 == pCompareClass->compareString( - sEntry, pDouble->sShort )) - { - nLastPos = nPos - 1; - bFound = sal_True; - if( !(pWordPtr->IsTextOnly() == (0 == pDouble->pUserData) - && 0 == pCompareClass->compareString( - pWordPtr->GetLong(), pDouble->sLong ) ) ) - { - pAutoCorrect->PutText(sEntry, pDouble->sLong, eCurLang); - } - pDoubleStringArray->DeleteAndDestroy(nPos - 1, 1); - break; - } - nPos--; - } - nPos = nLastPos; - if(!bFound) - { - pAutoCorrect->DeleteText(sEntry, eCurLang); - } - } - nDoubleStringArrayCount = pDoubleStringArray->Count(); - for(sal_uInt16 nDoubleStringArrayPos = 0; nDoubleStringArrayPos < nDoubleStringArrayCount; nDoubleStringArrayPos++ ) - { - //jetzt sollte es nur noch neue Eintraege geben - DoubleString* pDouble = pDoubleStringArray->GetObject( nDoubleStringArrayPos ); - if(pDouble->pUserData == &bHasSelectionText) - pAutoCorrect->PutText( pDouble->sShort, - *SfxObjectShell::Current(), eCurLang ); - else - { - pAutoCorrect->PutText( pDouble->sShort, pDouble->sLong, - eCurLang); - } - } - } - pDoubleStringArray->DeleteAndDestroy(0, pDoubleStringArray->Count()); - delete pDoubleStringArray; - pDoubleStringArray = aDoubleStringTable.Prev(); - } - aDoubleStringTable.Clear(); - // jetzt noch die aktuelle Selektion - SvxAutocorrWordList* pWordList = pAutoCorrect->LoadAutocorrWordList(eLang); - sal_uInt16 nWordListCount = pWordList->Count(); - sal_uInt16 nListBoxCount = (sal_uInt16)aReplaceTLB.GetEntryCount(); - - aReplaceTLB.SetUpdateMode(sal_False); - sal_uInt16 nListBoxPos = nListBoxCount; - sal_uInt16 nLastListBoxPos = nListBoxPos; - // 1. Durchlauf: Eintraege loeschen oder veraendern: - - sal_uInt16 i; - for( i = nWordListCount; i; i-- ) - { - SvxAutocorrWordPtr pWordPtr = pWordList->GetObject(i- 1); - String sEntry(pWordPtr->GetShort()); - // formatierter Text steht nur im Writer - sal_Bool bFound = !bSWriter && !pWordPtr->IsTextOnly(); - while(!bFound && nListBoxPos) - { - SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( nListBoxPos - 1); - if( 0 == pCompareClass->compareString( sEntry, - aReplaceTLB.GetEntryText(pEntry, 0))) - { - nLastListBoxPos = nListBoxPos - 1; - bFound = sal_True; - String sLong = aReplaceTLB.GetEntryText(pEntry, 1); - if( !(pWordPtr->IsTextOnly() == (0 == pEntry->GetUserData()) - && 0 == pCompareClass->compareString( - pWordPtr->GetLong(), sLong ))) - { - pAutoCorrect->PutText(sEntry, sLong, eLang); - } - aReplaceTLB.GetModel()->Remove(pEntry); - break; - - } - nListBoxPos --; - } - nListBoxPos = nLastListBoxPos; - if(!bFound) - { - pAutoCorrect->DeleteText(sEntry, eLang); - } - - } - nListBoxCount = (sal_uInt16)aReplaceTLB.GetEntryCount(); - for(i = 0; i < nListBoxCount; i++ ) - { - //jetzt sollte es nur noch neue Eintraege geben - SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( i ); - String sShort = aReplaceTLB.GetEntryText(pEntry, 0); - if(pEntry->GetUserData() == &bHasSelectionText) - pAutoCorrect->PutText(sShort, *SfxObjectShell::Current(), eLang); - else - { - String sLong = aReplaceTLB.GetEntryText(pEntry, 1); - pAutoCorrect->PutText(sShort, sLong, eLang); - } - } - - return sal_False; -} - -void OfaAutocorrReplacePage::RefillReplaceBox(sal_Bool bFromReset, - LanguageType eOldLanguage, - LanguageType eNewLanguage) -{ - eLang = eNewLanguage; - if(bFromReset) - lcl_ClearTable(aDoubleStringTable); - else - { - DoubleStringArray* pArray = 0; - if(aDoubleStringTable.IsKeyValid(eOldLanguage)) - { - pArray = aDoubleStringTable.Seek(sal_uLong(eOldLanguage)); - pArray->DeleteAndDestroy(0, pArray->Count()); - } - else - { - pArray = new DoubleStringArray; - aDoubleStringTable.Insert(sal_uLong(eOldLanguage), pArray); - } - - sal_uInt16 nListBoxCount = (sal_uInt16)aReplaceTLB.GetEntryCount(); - sal_uInt16 i; - for(i = 0; i < nListBoxCount; i++) - { - DoubleString* pDouble = new DoubleString(); - SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( i ); - pDouble->sShort = aReplaceTLB.GetEntryText(pEntry, 0); - pDouble->sLong = aReplaceTLB.GetEntryText(pEntry, 1); - pDouble->pUserData = pEntry->GetUserData(); - pArray->Insert(pDouble, i); - } - } - - aReplaceTLB.Clear(); - if(!bSWriter) - { - if(pFormatText) - pFormatText->DeleteAndDestroy(0, pFormatText->Count()); - else - pFormatText = new SvStringsISortDtor(); - } - - if(aDoubleStringTable.IsKeyValid(eLang)) - { - DoubleStringArray* pArray = aDoubleStringTable.Seek(sal_uLong(eNewLanguage)); - for(sal_uInt16 i = 0; i < pArray->Count(); i++) - { - DoubleString* pDouble = pArray->GetObject(i); - sal_Bool bTextOnly = 0 == pDouble->pUserData; - // formatierter Text wird nur im Writer angeboten - if(bSWriter || bTextOnly) - { - String sEntry(pDouble->sShort); - sEntry += '\t'; - sEntry += pDouble->sLong; - SvLBoxEntry* pEntry = aReplaceTLB.InsertEntry(sEntry); - aTextOnlyCB.Check(bTextOnly); - if(!bTextOnly) - pEntry->SetUserData(pDouble->pUserData); // Das heisst: mit Formatinfo oder sogar mit Selektionstext - } - else - { - pFormatText->Insert(new String(pDouble->sShort)); - } - } - } - else - { - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - SvxAutocorrWordList* pWordList = pAutoCorrect->LoadAutocorrWordList(eLang); - - for(sal_uInt16 i = 0; i < pWordList->Count(); i++) - { - SvxAutocorrWordPtr pWordPtr = pWordList->GetObject(i); - sal_Bool bTextOnly = pWordPtr->IsTextOnly(); - // formatierter Text wird nur im Writer angeboten - if(bSWriter || bTextOnly) - { - String sEntry(pWordPtr->GetShort()); - sEntry += '\t'; - sEntry += pWordPtr->GetLong(); - SvLBoxEntry* pEntry = aReplaceTLB.InsertEntry(sEntry); - aTextOnlyCB.Check(pWordPtr->IsTextOnly()); - if(!bTextOnly) - pEntry->SetUserData(&aTextOnlyCB); // Das heisst: mit Formatinfo - } - else - { - pFormatText->Insert(new String(pWordPtr->GetShort())); - } - } - aNewReplacePB.Enable(sal_False); - aDeleteReplacePB.Enable(sal_False); - - } - - SfxViewShell* pViewShell = SfxViewShell::Current(); - if( pViewShell && pViewShell->HasSelection( sal_True ) ) - { - bHasSelectionText = sal_True; - const String sSelection( pViewShell->GetSelectionText() ); - aReplaceED.SetText( sSelection ); - aTextOnlyCB.Check( !bSWriter ); - aTextOnlyCB.Enable( bSWriter && sSelection.Len() ); - } - else - aTextOnlyCB.Enable( sal_False ); -} - -void OfaAutocorrReplacePage::Reset( const SfxItemSet& ) -{ - RefillReplaceBox(sal_True, eLang, eLang); - aShortED.GrabFocus(); -} - -void OfaAutocorrReplacePage::SetLanguage(LanguageType eSet) -{ - //save old settings an refill - if(eSet != eLang) - { - RefillReplaceBox(sal_False, eLang, eSet); - eLastDialogLanguage = eSet; - delete pCompareClass; - delete pCharClass; - - ::com::sun::star::lang::Locale aLcl( SvxCreateLocale(eLastDialogLanguage )); - pCompareClass = new CollatorWrapper( GetProcessFact() ); - pCompareClass->loadDefaultCollator( aLcl, 0 ); - pCharClass = new CharClass( aLcl ); - ModifyHdl(&aShortED); - } -} - -IMPL_LINK(OfaAutocorrReplacePage, SelectHdl, SvTabListBox*, pBox) -{ - if(!bFirstSelect || !bHasSelectionText) - { - SvLBoxEntry* pEntry = pBox->FirstSelected(); - String sTmpShort(pBox->GetEntryText(pEntry, 0)); - // wird der Text ueber den ModifyHdl gesetzt, dann steht der Cursor sonst immer am Wortanfang, - // obwohl man gerade hier editiert - sal_Bool bSameContent = 0 == pCompareClass->compareString( - sTmpShort, aShortED.GetText() ); - Selection aSel = aShortED.GetSelection(); - if(aShortED.GetText() != sTmpShort) - { - aShortED.SetText(sTmpShort); - //war es nur eine andere Schreibweise, dann muss die Selektion auch wieder gesetzt werden - if(bSameContent) - aShortED.SetSelection(aSel); - } - aReplaceED.SetText(pBox->GetEntryText(pEntry, 1)); - // mit UserData gibt es eine Formatinfo - aTextOnlyCB.Check(0 == pEntry->GetUserData()); - } - else - bFirstSelect = sal_False; - - aNewReplacePB.Enable(sal_False); - aDeleteReplacePB.Enable(); - return 0; -}; - -IMPL_LINK(OfaAutocorrReplacePage, NewDelHdl, PushButton*, pBtn) -{ - SvLBoxEntry* _pEntry = aReplaceTLB.FirstSelected(); - if(pBtn == &aDeleteReplacePB) - { - DBG_ASSERT(_pEntry, "keine Eintrag selektiert"); - if(_pEntry) - { - aReplaceTLB.GetModel()->Remove(_pEntry); - ModifyHdl(&aShortED); - return 0; - } - } - if(pBtn == &aNewReplacePB || aNewReplacePB.IsEnabled()) - { - SvLBoxEntry* _pNewEntry = aReplaceTLB.FirstSelected(); - String sEntry(aShortED.GetText()); - if(sEntry.Len() && ( aReplaceED.GetText().Len() || - ( bHasSelectionText && bSWriter ) )) - { - aReplaceTLB.SetUpdateMode(sal_False); - sal_uInt16 nPos = USHRT_MAX; - sEntry += '\t'; - sEntry += aReplaceED.GetText(); - if(_pNewEntry) - { - nPos = (sal_uInt16)aReplaceTLB.GetModel()->GetAbsPos(_pNewEntry); - aReplaceTLB.GetModel()->Remove(_pNewEntry); - } - else - { - sal_uInt16 j; - for( j = 0; j < aReplaceTLB.GetEntryCount(); j++ ) - { - SvLBoxEntry* pReplaceEntry = aReplaceTLB.GetEntry(j); - if( 0 >= pCompareClass->compareString(sEntry, - aReplaceTLB.GetEntryText(pReplaceEntry, 0) ) ) - break; - } - nPos = j; - } - SvLBoxEntry* pInsEntry = - aReplaceTLB.InsertEntry( - sEntry, static_cast< SvLBoxEntry * >(NULL), false, - nPos == USHRT_MAX ? LIST_APPEND : nPos); - if( !bReplaceEditChanged && !aTextOnlyCB.IsChecked()) - pInsEntry->SetUserData(&bHasSelectionText); // neuer formatierter Text - - aReplaceTLB.MakeVisible( pInsEntry ); - aReplaceTLB.SetUpdateMode(sal_True); - // falls der Request aus dem ReplaceEdit kam, dann Focus in das ShortEdit setzen - if(aReplaceED.HasFocus()) - aShortED.GrabFocus(); - - } - } - else - { - // das kann nur ein Enter in einem der beiden Edit-Felder sein und das - // bedeutet EndDialog() - muss im KeyInput ausgewertet werden - return 0; - } - ModifyHdl(&aShortED); - return 1; -} - -IMPL_LINK(OfaAutocorrReplacePage, ModifyHdl, Edit*, pEdt) -{ - SvLBoxEntry* pFirstSel = aReplaceTLB.FirstSelected(); - sal_Bool bShort = pEdt == &aShortED; - const String rEntry = pEdt->GetText(); - const String rRepString = aReplaceED.GetText(); - String aWordStr( pCharClass->lower( rEntry )); - - if(bShort) - { - if(rEntry.Len()) - { - sal_Bool bFound = sal_False; - sal_Bool bTmpSelEntry=sal_False; - - for(sal_uInt16 i = 0; i < aReplaceTLB.GetEntryCount(); i++) - { - SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( i ); - String aTestStr=aReplaceTLB.GetEntryText(pEntry, 0); - if( 0 == pCompareClass->compareString(rEntry, aTestStr )) - { - if(rRepString.Len()) - bFirstSelect = sal_True; - aReplaceTLB.SetCurEntry(pEntry); - pFirstSel = pEntry; - aNewReplacePB.SetText(sModify); - bFound= sal_True; - break; - } - else - { - pCharClass->toLower( aTestStr ); - if(aTestStr.Search(aWordStr)==0 && !bTmpSelEntry) - { - aReplaceTLB.MakeVisible(pEntry); - bTmpSelEntry=sal_True; - } - } - } - if(!bFound) - { - aReplaceTLB.SelectAll(sal_False); - pFirstSel = 0; - aNewReplacePB.SetText(sNew); - if(bReplaceEditChanged) - aTextOnlyCB.Enable(sal_False); - } - aDeleteReplacePB.Enable(bFound); - } - else if(aReplaceTLB.GetEntryCount()>0) - { - SvLBoxEntry* pEntry = aReplaceTLB.GetEntry( 0 ); - aReplaceTLB.MakeVisible(pEntry); - } - - } - else if(!bShort) - { - bReplaceEditChanged = sal_True; - if(pFirstSel) - { - aNewReplacePB.SetText(sModify); - } - } - - const String& rShortTxt = aShortED.GetText(); - sal_Bool bEnableNew = rShortTxt.Len() && - ( rRepString.Len() || - ( bHasSelectionText && bSWriter )) && - ( !pFirstSel || rRepString != - aReplaceTLB.GetEntryText( pFirstSel, 1 ) ); - if(bEnableNew && pFormatText) - { - for(sal_uInt16 i = 0; i < pFormatText->Count(); i++) - if(*pFormatText->GetObject(i) == rShortTxt) - { - bEnableNew = sal_False; - break; - } - } - aNewReplacePB.Enable(bEnableNew); - - return 0; -} - -struct StringsArrays -{ - - SvStringsDtor aAbbrevStrings; - SvStringsDtor aDoubleCapsStrings; - - StringsArrays() : - aAbbrevStrings(5,5), aDoubleCapsStrings(5,5) {} -}; -typedef StringsArrays* StringsArraysPtr; - -sal_Bool lcl_FindInArray(SvStringsDtor& rStrings, const String& rString) -{ - for(sal_uInt16 i = 0; i < rStrings.Count(); i++) - if(rString == *rStrings.GetObject(i)) - return sal_True; - return sal_False; -} - -void lcl_ClearTable(StringsTable& rTable) -{ - StringsArraysPtr pArrays = rTable.Last(); - while(pArrays) - { - delete pArrays; - pArrays = rTable.Prev(); - } - rTable.Clear(); -} - -OfaAutocorrExceptPage::OfaAutocorrExceptPage( Window* pParent, - const SfxItemSet& rSet ) : - SfxTabPage(pParent, CUI_RES( RID_OFAPAGE_AUTOCORR_EXCEPT ), rSet), - aAbbrevFL (this, CUI_RES(FL_ABBREV )), - aAbbrevED (this, CUI_RES(ED_ABBREV )), - aAbbrevLB (this, CUI_RES(LB_ABBREV )), - aNewAbbrevPB (this, CUI_RES(PB_NEWABBREV )), - aDelAbbrevPB (this, CUI_RES(PB_DELABBREV )), - aAutoAbbrevCB (this, CUI_RES(CB_AUTOABBREV )), - aDoubleCapsFL (this, CUI_RES(FL_DOUBLECAPS )), - aDoubleCapsED (this, CUI_RES(ED_DOUBLE_CAPS )), - aDoubleCapsLB (this, CUI_RES(LB_DOUBLE_CAPS )), - aNewDoublePB (this, CUI_RES(PB_NEWDOUBLECAPS)), - aDelDoublePB (this, CUI_RES(PB_DELDOUBLECAPS)), - aAutoCapsCB (this, CUI_RES(CB_AUTOCAPS )), - eLang(eLastDialogLanguage) -{ - aNewAbbrevPB.SetAccessibleName(String(CUI_RES(STR_PB_NEWABBREV) ) ); - aDelAbbrevPB.SetAccessibleName(String(CUI_RES(STR_PB_DELABBREV) ) ); - aNewDoublePB.SetAccessibleName(String(CUI_RES(STR_PB_NEWDOUBLECAPS) ) ); - aDelDoublePB.SetAccessibleName(String(CUI_RES(STR_PB_DELDOUBLECAPS) ) ); - - FreeResource(); - - ::com::sun::star::lang::Locale aLcl( SvxCreateLocale(eLastDialogLanguage )); - pCompareClass = new CollatorWrapper( GetProcessFact() ); - pCompareClass->loadDefaultCollator( aLcl, ::com::sun::star::i18n:: - CollatorOptions::CollatorOptions_IGNORE_CASE ); - - aNewAbbrevPB.SetClickHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl)); - aDelAbbrevPB.SetClickHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl)); - aNewDoublePB.SetClickHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl)); - aDelDoublePB.SetClickHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl)); - - aAbbrevLB.SetSelectHdl(LINK(this, OfaAutocorrExceptPage, SelectHdl)); - aDoubleCapsLB.SetSelectHdl(LINK(this, OfaAutocorrExceptPage, SelectHdl)); - aAbbrevED.SetModifyHdl(LINK(this, OfaAutocorrExceptPage, ModifyHdl)); - aDoubleCapsED.SetModifyHdl(LINK(this, OfaAutocorrExceptPage, ModifyHdl)); - - aAbbrevED.SetActionHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl)); - aDoubleCapsED.SetActionHdl(LINK(this, OfaAutocorrExceptPage, NewDelHdl)); - - aNewAbbrevPB.SetAccessibleRelationMemberOf(&aAbbrevFL); - aDelAbbrevPB.SetAccessibleRelationMemberOf(&aAbbrevFL); - aNewDoublePB.SetAccessibleRelationMemberOf(&aDoubleCapsFL); - aDelDoublePB.SetAccessibleRelationMemberOf(&aDoubleCapsFL); -} - -OfaAutocorrExceptPage::~OfaAutocorrExceptPage() -{ - lcl_ClearTable(aStringsTable); - delete pCompareClass; -} - -SfxTabPage* OfaAutocorrExceptPage::Create( Window* pParent, - const SfxItemSet& rSet) -{ - return new OfaAutocorrExceptPage(pParent, rSet); -} - -void OfaAutocorrExceptPage::ActivatePage( const SfxItemSet& ) -{ - if(eLang != eLastDialogLanguage) - SetLanguage(eLastDialogLanguage); - ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(sal_True); -} - -int OfaAutocorrExceptPage::DeactivatePage( SfxItemSet* ) -{ - return LEAVE_PAGE; -} - -sal_Bool OfaAutocorrExceptPage::FillItemSet( SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - StringsArraysPtr pArrays = aStringsTable.Last(); - while(pArrays) - { - LanguageType eCurLang = (LanguageType)aStringsTable.GetCurKey(); - if(eCurLang != eLang) // die aktuelle Sprache wird weiter hinten behandelt - { - SvStringsISortDtor* pWrdList = pAutoCorrect->LoadWrdSttExceptList(eCurLang); - - if(pWrdList) - { - sal_uInt16 nCount = pWrdList->Count(); - sal_uInt16 i; - for( i = nCount; i; ) - { - String* pString = pWrdList->GetObject( --i ); - //Eintrag finden u. gfs entfernen - if( !lcl_FindInArray(pArrays->aDoubleCapsStrings, *pString)) - pWrdList->DeleteAndDestroy( i ); - } - nCount = pArrays->aDoubleCapsStrings.Count(); - for( i = 0; i < nCount; ++i ) - { - String* pEntry = new String( *pArrays->aDoubleCapsStrings.GetObject( i ) ); - if( !pWrdList->Insert( pEntry )) - delete pEntry; - } - pAutoCorrect->SaveWrdSttExceptList(eCurLang); - } - - SvStringsISortDtor* pCplList = pAutoCorrect->LoadCplSttExceptList(eCurLang); - - if(pCplList) - { - sal_uInt16 nCount = pCplList->Count(); - sal_uInt16 i; - for( i = nCount; i; ) - { - String* pString = pCplList->GetObject( --i ); - if( !lcl_FindInArray(pArrays->aAbbrevStrings, *pString)) - pCplList->DeleteAndDestroy( i ); - } - nCount = pArrays->aAbbrevStrings.Count(); - for( i = 0; i < nCount; ++i ) - { - String* pEntry = new String( *pArrays->aAbbrevStrings.GetObject(i) ); - if( !pCplList->Insert( pEntry )) - delete pEntry; - } - pAutoCorrect->SaveCplSttExceptList(eCurLang); - } - } - pArrays = aStringsTable.Prev(); - } - aStringsTable.Clear(); - - SvStringsISortDtor* pWrdList = pAutoCorrect->LoadWrdSttExceptList(eLang); - - if(pWrdList) - { - sal_uInt16 nCount = pWrdList->Count(); - sal_uInt16 i; - for( i = nCount; i; ) - { - String* pString = pWrdList->GetObject( --i ); - if( USHRT_MAX == aDoubleCapsLB.GetEntryPos(*pString) ) - pWrdList->DeleteAndDestroy( i ); - } - nCount = aDoubleCapsLB.GetEntryCount(); - for( i = 0; i < nCount; ++i ) - { - String* pEntry = new String( aDoubleCapsLB.GetEntry( i ) ); - if( !pWrdList->Insert( pEntry )) - delete pEntry; - } - pAutoCorrect->SaveWrdSttExceptList(eLang); - } - - SvStringsISortDtor* pCplList = pAutoCorrect->LoadCplSttExceptList(eLang); - - if(pCplList) - { - sal_uInt16 nCount = pCplList->Count(); - sal_uInt16 i; - for( i = nCount; i; ) - { - String* pString = pCplList->GetObject( --i ); - if( USHRT_MAX == aAbbrevLB.GetEntryPos(*pString) ) - pCplList->DeleteAndDestroy( i ); - } - nCount = aAbbrevLB.GetEntryCount(); - for( i = 0; i < nCount; ++i ) - { - String* pEntry = new String( aAbbrevLB.GetEntry( i ) ); - if( !pCplList->Insert( pEntry )) - delete pEntry; - } - pAutoCorrect->SaveCplSttExceptList(eLang); - } - if(aAutoAbbrevCB.IsChecked() != aAutoAbbrevCB.GetSavedValue()) - pAutoCorrect->SetAutoCorrFlag( SaveWordCplSttLst, aAutoAbbrevCB.IsChecked()); - if(aAutoCapsCB.IsChecked() != aAutoCapsCB.GetSavedValue()) - pAutoCorrect->SetAutoCorrFlag( SaveWordWrdSttLst, aAutoCapsCB.IsChecked()); - return sal_False; -} - -void OfaAutocorrExceptPage::SetLanguage(LanguageType eSet) -{ - if(eLang != eSet) - { - //alte Einstellungen speichern und neu fuellen - RefillReplaceBoxes(sal_False, eLang, eSet); - eLastDialogLanguage = eSet; - delete pCompareClass; - pCompareClass = new CollatorWrapper( GetProcessFact() ); - pCompareClass->loadDefaultCollator( SvxCreateLocale( eLastDialogLanguage ), - ::com::sun::star::i18n:: - CollatorOptions::CollatorOptions_IGNORE_CASE ); - ModifyHdl(&aAbbrevED); - ModifyHdl(&aDoubleCapsED); - } -} - -void OfaAutocorrExceptPage::RefillReplaceBoxes(sal_Bool bFromReset, - LanguageType eOldLanguage, - LanguageType eNewLanguage) -{ - eLang = eNewLanguage; - if(bFromReset) - lcl_ClearTable(aStringsTable); - else - { - StringsArraysPtr pArrays = 0; - if(aStringsTable.IsKeyValid(eOldLanguage)) - { - pArrays = aStringsTable.Seek(sal_uLong(eOldLanguage)); - pArrays->aAbbrevStrings.DeleteAndDestroy( - 0, pArrays->aAbbrevStrings.Count()); - pArrays->aDoubleCapsStrings.DeleteAndDestroy( - 0, pArrays->aDoubleCapsStrings.Count()); - } - else - { - pArrays = new StringsArrays; - aStringsTable.Insert(sal_uLong(eOldLanguage), pArrays); - } - - sal_uInt16 i; - for(i = 0; i < aAbbrevLB.GetEntryCount(); i++) - { - pArrays->aAbbrevStrings.Insert( - new String(aAbbrevLB.GetEntry(i)), i); - - } - for(i = 0; i < aDoubleCapsLB.GetEntryCount(); i++) - { - pArrays->aDoubleCapsStrings.Insert( - new String(aDoubleCapsLB.GetEntry(i)), i); - } - } - aDoubleCapsLB.Clear(); - aAbbrevLB.Clear(); - String sTemp; - aAbbrevED.SetText(sTemp); - aDoubleCapsED.SetText(sTemp); - - if(aStringsTable.IsKeyValid(eLang)) - { - StringsArraysPtr pArrays = aStringsTable.Seek(sal_uLong(eLang)); - sal_uInt16 i; - for(i = 0; i < pArrays->aAbbrevStrings.Count(); i++ ) - { - aAbbrevLB.InsertEntry(*pArrays->aAbbrevStrings.GetObject(i)); - } - for( i = 0; i < pArrays->aDoubleCapsStrings.Count(); i++ ) - { - aDoubleCapsLB.InsertEntry(*pArrays->aDoubleCapsStrings.GetObject(i)); - } - } - else - { - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - const SvStringsISortDtor* pCplList = pAutoCorrect->GetCplSttExceptList(eLang); - const SvStringsISortDtor* pWrdList = pAutoCorrect->GetWrdSttExceptList(eLang); - sal_uInt16 i; - for( i = 0; i < pCplList->Count(); i++ ) - { - aAbbrevLB.InsertEntry(*pCplList->GetObject(i)); - } - for( i = 0; i < pWrdList->Count(); i++ ) - { - aDoubleCapsLB.InsertEntry(*pWrdList->GetObject(i)); - } - } -} - -void OfaAutocorrExceptPage::Reset( const SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - RefillReplaceBoxes(sal_True, eLang, eLang); - aAutoAbbrevCB. Check( pAutoCorrect->IsAutoCorrFlag( SaveWordCplSttLst )); - aAutoCapsCB. Check( pAutoCorrect->IsAutoCorrFlag( SaveWordWrdSttLst )); - aAutoAbbrevCB.SaveValue(); - aAutoCapsCB.SaveValue(); -} - -IMPL_LINK(OfaAutocorrExceptPage, NewDelHdl, PushButton*, pBtn) -{ - if((pBtn == &aNewAbbrevPB || pBtn == (PushButton*)&aAbbrevED ) - && aAbbrevED.GetText().Len()) - { - aAbbrevLB.InsertEntry(aAbbrevED.GetText()); - ModifyHdl(&aAbbrevED); - } - else if(pBtn == &aDelAbbrevPB) - { - aAbbrevLB.RemoveEntry(aAbbrevED.GetText()); - ModifyHdl(&aAbbrevED); - } - else if((pBtn == &aNewDoublePB || pBtn == (PushButton*)&aDoubleCapsED ) - && aDoubleCapsED.GetText().Len()) - { - aDoubleCapsLB.InsertEntry(aDoubleCapsED.GetText()); - ModifyHdl(&aDoubleCapsED); - } - else if(pBtn == &aDelDoublePB) - { - aDoubleCapsLB.RemoveEntry(aDoubleCapsED.GetText()); - ModifyHdl(&aDoubleCapsED); - } - return 0; -} - -IMPL_LINK(OfaAutocorrExceptPage, SelectHdl, ListBox*, pBox) -{ - if(pBox == &aAbbrevLB) - { - aAbbrevED.SetText(pBox->GetSelectEntry()); - aNewAbbrevPB.Enable(sal_False); - aDelAbbrevPB.Enable(); - } - else - { - aDoubleCapsED.SetText(pBox->GetSelectEntry()); - aNewDoublePB.Enable(sal_False); - aDelDoublePB.Enable(); - } - return 0; -} - -IMPL_LINK(OfaAutocorrExceptPage, ModifyHdl, Edit*, pEdt) -{ -// sal_Bool bSame = pEdt->GetText() == ->GetSelectEntry(); - const String& sEntry = pEdt->GetText(); - sal_Bool bEntryLen = 0!= sEntry.Len(); - if(pEdt == &aAbbrevED) - { - sal_Bool bSame = lcl_FindEntry(aAbbrevLB, sEntry, *pCompareClass); - if(bSame && sEntry != aAbbrevLB.GetSelectEntry()) - pEdt->SetText(aAbbrevLB.GetSelectEntry()); - aNewAbbrevPB.Enable(!bSame && bEntryLen); - aDelAbbrevPB.Enable(bSame && bEntryLen); - } - else - { - sal_Bool bSame = lcl_FindEntry(aDoubleCapsLB, sEntry, *pCompareClass); - if(bSame && sEntry != aDoubleCapsLB.GetSelectEntry()) - pEdt->SetText(aDoubleCapsLB.GetSelectEntry()); - aNewDoublePB.Enable(!bSame && bEntryLen); - aDelDoublePB.Enable(bSame && bEntryLen); - } - return 0; -} - -void AutoCorrEdit::KeyInput( const KeyEvent& rKEvt ) -{ - const KeyCode aKeyCode = rKEvt.GetKeyCode(); - const sal_uInt16 nModifier = aKeyCode.GetModifier(); - if( aKeyCode.GetCode() == KEY_RETURN ) - { - //wird bei Enter nichts getan, dann doch die Basisklasse rufen - // um den Dialog zu schliessen - if(!nModifier && !aActionLink.Call(this)) - Edit::KeyInput(rKEvt); - } - else if(bSpaces || aKeyCode.GetCode() != KEY_SPACE) - Edit::KeyInput(rKEvt); -} - -enum OfaQuoteOptions -{ - ADD_NONBRK_SPACE, - REPLACE_1ST -}; - -SvLBoxEntry* OfaQuoteTabPage::CreateEntry(String& rTxt, sal_uInt16 nCol) -{ - SvLBoxEntry* pEntry = new SvLBoxEntry; - - if ( !pCheckButtonData ) - { - pCheckButtonData = new SvLBoxButtonData( &aSwCheckLB ); - aSwCheckLB.SetCheckButtonData( pCheckButtonData ); - } - - pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0)); // Sonst Puff! - - String sEmpty; - if (nCol == CBCOL_SECOND) - pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // Leerspalte - else - pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) ); - - if (nCol == CBCOL_FIRST) - pEntry->AddItem( new SvLBoxString( pEntry, 0, sEmpty) ); // Leerspalte - else - pEntry->AddItem( new SvLBoxButton( pEntry, SvLBoxButtonKind_enabledCheckbox, 0, pCheckButtonData ) ); - - pEntry->AddItem( new OfaImpBrwString( pEntry, 0, rTxt ) ); - - return pEntry; -} - -OfaQuoteTabPage::OfaQuoteTabPage( Window* pParent, const SfxItemSet& rSet ) : - SfxTabPage(pParent, CUI_RES( RID_OFAPAGE_AUTOCORR_QUOTE ), rSet), - aCheckLB (this, CUI_RES(CLB_SETTINGS )), - m_aSwCheckLBContainer(this, CUI_RES(CLB_SETTINGS)), - aSwCheckLB(m_aSwCheckLBContainer), - sHeader1 (CUI_RES( STR_HEADER1 )), - sHeader2 (CUI_RES( STR_HEADER2 )), - sNonBrkSpace (CUI_RES( ST_NON_BREAK_SPACE )), - sOrdinal (CUI_RES( ST_ORDINAL )), - pCheckButtonData ( NULL ), - - aSingleFL (this, CUI_RES(FL_SINGLE )), - aSingleTypoCB (this, CUI_RES(CB_SGL_TYPO )), - aSglStartQuoteFT (this, CUI_RES(FT_SGL_STARTQUOTE )), - aSglStartQuotePB (this, CUI_RES(PB_SGL_STARTQUOTE )), - aSglStartExFT (this, CUI_RES(FT_SGSTEX )), - aSglEndQuoteFT (this, CUI_RES(FT_SGL_ENDQUOTE )), - aSglEndQuotePB (this, CUI_RES(PB_SGL_ENDQUOTE )), - aSglEndExFT (this, CUI_RES(FT_SGENEX )), - aSglStandardPB (this, CUI_RES(PB_SGL_STD )), - - aDoubleFL (this, CUI_RES(FL_DOUBLE )), - aTypoCB (this, CUI_RES(CB_TYPO )), - aStartQuoteFT (this, CUI_RES(FT_STARTQUOTE )), - aStartQuotePB (this, CUI_RES(PB_STARTQUOTE )), - aDblStartExFT (this, CUI_RES(FT_DBSTEX )), - aEndQuoteFT (this, CUI_RES(FT_ENDQUOTE )), - aEndQuotePB (this, CUI_RES(PB_ENDQUOTE )), - aDblEndExFT (this, CUI_RES(FT_DBECEX )), - aDblStandardPB (this, CUI_RES(PB_DBL_STD )), - - sStartQuoteDlg (CUI_RES(STR_CHANGE_START)), - sEndQuoteDlg (CUI_RES(STR_CHANGE_END)), - - sStandard(CUI_RES(ST_STANDARD)) -{ - aSglStandardPB.SetAccessibleName(String(CUI_RES(STR_PB_SGL_STD) ) ); - aDblStandardPB.SetAccessibleName(String(CUI_RES(STR_PB_DBL_STD) ) ); - aStartQuotePB.SetAccessibleName( String(CUI_RES(STR_PB_DBL_START) )); - aEndQuotePB.SetAccessibleName(String(CUI_RES(STR_PB_DBL_END) )); - aSglStartQuotePB.SetAccessibleName(String(CUI_RES(STR_PB_SGL_START) )); - aSglEndQuotePB.SetAccessibleName(String(CUI_RES(STR_PB_SGL_END) ) ); - - FreeResource(); - - sal_Bool bShowSWOptions = sal_False; - - aCheckLB.SetHelpId( HID_OFAPAGE_QUOTE_CLB ); - aSwCheckLB.SetHelpId( HID_OFAPAGE_QUOTE_SW_CLB ); - - SFX_ITEMSET_ARG( &rSet, pItem, SfxBoolItem, SID_AUTO_CORRECT_DLG, sal_False ); - if ( pItem && pItem->GetValue() ) - bShowSWOptions = sal_True; - - if ( bShowSWOptions ) - { - static long aStaticTabs[]= - { - 3, 0, 20, 40 - }; - - aSwCheckLB.SetStyle(aSwCheckLB.GetStyle() | WB_HSCROLL| WB_VSCROLL); - - aSwCheckLB.SvxSimpleTable::SetTabs(aStaticTabs); - String sHeader( sHeader1 ); - sHeader += '\t'; - sHeader += sHeader2; - sHeader += '\t'; - aSwCheckLB.InsertHeaderEntry( sHeader, HEADERBAR_APPEND, - HIB_CENTER | HIB_VCENTER | HIB_FIXEDPOS | HIB_FIXED); - aCheckLB.Hide( sal_True ); - } - else - { - aSwCheckLB.HideTable( ); - } - - aStartQuotePB.SetClickHdl(LINK(this, OfaQuoteTabPage, QuoteHdl)); - aEndQuotePB.SetClickHdl(LINK(this, OfaQuoteTabPage, QuoteHdl)); - aSglStartQuotePB.SetClickHdl(LINK(this, OfaQuoteTabPage, QuoteHdl)); - aSglEndQuotePB.SetClickHdl(LINK(this, OfaQuoteTabPage, QuoteHdl)); - aDblStandardPB.SetClickHdl(LINK(this, OfaQuoteTabPage, StdQuoteHdl)); - aSglStandardPB.SetClickHdl(LINK(this, OfaQuoteTabPage, StdQuoteHdl)); - - aSglStartQuotePB.SetAccessibleRelationLabeledBy( &aSglStartQuoteFT ); - aSglEndQuotePB.SetAccessibleRelationLabeledBy( &aSglEndQuoteFT ); - aSglStartQuotePB.SetAccessibleRelationMemberOf( &aSingleFL ); - aSglEndQuotePB.SetAccessibleRelationMemberOf( &aSingleFL ); - aStartQuotePB.SetAccessibleRelationLabeledBy( &aStartQuoteFT ); - aEndQuotePB.SetAccessibleRelationLabeledBy( &aEndQuoteFT ); - aStartQuotePB.SetAccessibleRelationMemberOf( &aDoubleFL ); - aEndQuotePB.SetAccessibleRelationMemberOf( &aDoubleFL ); - aSglStandardPB.SetAccessibleRelationMemberOf(&aSingleFL); - aDblStandardPB.SetAccessibleRelationMemberOf(&aDoubleFL); -} - -OfaQuoteTabPage::~OfaQuoteTabPage() -{ - delete( pCheckButtonData ); -} - -SfxTabPage* OfaQuoteTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new OfaQuoteTabPage(pParent, rAttrSet); -} - -sal_Bool OfaQuoteTabPage::FillItemSet( SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - - long nFlags = pAutoCorrect->GetFlags(); - - if ( aCheckLB.IsVisible( ) ) - { - sal_uInt16 nPos = 0; - pAutoCorrect->SetAutoCorrFlag(AddNonBrkSpace, aCheckLB.IsChecked(nPos++)); - pAutoCorrect->SetAutoCorrFlag(ChgOrdinalNumber, aCheckLB.IsChecked(nPos++)); - } - - sal_Bool bModified = sal_False; - if ( aSwCheckLB.IsVisible( ) ) - { - SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); - - sal_Bool bCheck = aSwCheckLB.IsChecked(ADD_NONBRK_SPACE, CBCOL_FIRST); - bModified |= pOpt->bAddNonBrkSpace != bCheck; - pOpt->bAddNonBrkSpace = bCheck; - pAutoCorrect->SetAutoCorrFlag(AddNonBrkSpace, - aSwCheckLB.IsChecked(ADD_NONBRK_SPACE, CBCOL_SECOND)); - - bCheck = aSwCheckLB.IsChecked(REPLACE_1ST, CBCOL_FIRST); - bModified |= pOpt->bChgOrdinalNumber != bCheck; - pOpt->bChgOrdinalNumber = bCheck; - pAutoCorrect->SetAutoCorrFlag(ChgOrdinalNumber, - aSwCheckLB.IsChecked(REPLACE_1ST, CBCOL_SECOND)); - } - - pAutoCorrect->SetAutoCorrFlag(ChgQuotes, aTypoCB.IsChecked()); - pAutoCorrect->SetAutoCorrFlag(ChgSglQuotes, aSingleTypoCB.IsChecked()); - sal_Bool bReturn = nFlags != pAutoCorrect->GetFlags(); - if(cStartQuote != pAutoCorrect->GetStartDoubleQuote()) - { - bReturn = sal_True; - sal_Unicode cUCS2 = static_cast<sal_Unicode>(cStartQuote); //TODO - pAutoCorrect->SetStartDoubleQuote(cUCS2); - } - if(cEndQuote != pAutoCorrect->GetEndDoubleQuote()) - { - bReturn = sal_True; - sal_Unicode cUCS2 = static_cast<sal_Unicode>(cEndQuote); //TODO - pAutoCorrect->SetEndDoubleQuote(cUCS2); - } - if(cSglStartQuote != pAutoCorrect->GetStartSingleQuote()) - { - bReturn = sal_True; - sal_Unicode cUCS2 = static_cast<sal_Unicode>(cSglStartQuote); //TODO - pAutoCorrect->SetStartSingleQuote(cUCS2); - } - if(cSglEndQuote != pAutoCorrect->GetEndSingleQuote()) - { - bReturn = sal_True; - sal_Unicode cUCS2 = static_cast<sal_Unicode>(cSglEndQuote); //TODO - pAutoCorrect->SetEndSingleQuote(cUCS2); - } - - if( bModified || bReturn ) - { - SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get(); - rCfg.SetModified(); - rCfg.Commit(); - } - return bReturn; -} - -void OfaQuoteTabPage::ActivatePage( const SfxItemSet& ) -{ - ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage(sal_False); -} - -void OfaQuoteTabPage::Reset( const SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - const long nFlags = pAutoCorrect->GetFlags(); - - // Initialize the Sw options - if ( aSwCheckLB.IsVisible( ) ) - { - SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); - - aSwCheckLB.SetUpdateMode( sal_False ); - aSwCheckLB.Clear(); - - aSwCheckLB.GetModel()->Insert(CreateEntry(sNonBrkSpace, CBCOL_BOTH )); - aSwCheckLB.GetModel()->Insert(CreateEntry(sOrdinal, CBCOL_BOTH )); - - aSwCheckLB.CheckEntryPos( ADD_NONBRK_SPACE, CBCOL_FIRST, pOpt->bAddNonBrkSpace ); - aSwCheckLB.CheckEntryPos( ADD_NONBRK_SPACE, CBCOL_SECOND, 0 != (nFlags & AddNonBrkSpace) ); - aSwCheckLB.CheckEntryPos( REPLACE_1ST, CBCOL_FIRST, pOpt->bChgOrdinalNumber ); - aSwCheckLB.CheckEntryPos( REPLACE_1ST, CBCOL_SECOND, 0 != (nFlags & ChgOrdinalNumber) ); - - aSwCheckLB.SetUpdateMode( sal_True ); - } - - // Initialize the non Sw options - if ( aCheckLB.IsVisible( ) ) - { - aCheckLB.SetUpdateMode( sal_False ); - aCheckLB.Clear( ); - - aCheckLB.InsertEntry( sNonBrkSpace ); - aCheckLB.InsertEntry( sOrdinal ); - - sal_uInt16 nPos = 0; - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & AddNonBrkSpace) ); - aCheckLB.CheckEntryPos( nPos++, 0 != (nFlags & ChgOrdinalNumber) ); - - aCheckLB.SetUpdateMode( sal_True ); - } - - // Initialize the quote stuffs - aTypoCB .Check(0 != (nFlags & ChgQuotes)); - aSingleTypoCB .Check(0 != (nFlags & ChgSglQuotes)); - aTypoCB .SaveValue(); - aSingleTypoCB .SaveValue(); - - cStartQuote = pAutoCorrect->GetStartDoubleQuote(); - cEndQuote = pAutoCorrect->GetEndDoubleQuote(); - cSglStartQuote = pAutoCorrect->GetStartSingleQuote(); - cSglEndQuote = pAutoCorrect->GetEndSingleQuote(); - - aSglStartExFT .SetText(ChangeStringExt_Impl(cSglStartQuote)); - aSglEndExFT .SetText(ChangeStringExt_Impl(cSglEndQuote)); - aDblStartExFT .SetText(ChangeStringExt_Impl(cStartQuote)); - aDblEndExFT .SetText(ChangeStringExt_Impl(cEndQuote)); -} - -#define SGL_START 0 -#define DBL_START 1 -#define SGL_END 2 -#define DBL_END 3 - - -IMPL_LINK( OfaQuoteTabPage, QuoteHdl, PushButton*, pBtn ) -{ - sal_uInt16 nMode = SGL_START; - if(pBtn == &aSglEndQuotePB) - nMode = SGL_END; - else if(pBtn == &aStartQuotePB) - nMode = DBL_START; - else if(pBtn == &aEndQuotePB) - nMode = DBL_END; - // Zeichenauswahl-Dialog starten - SvxCharacterMap* pMap = new SvxCharacterMap( this, sal_True ); - pMap->SetCharFont( OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT, - LANGUAGE_ENGLISH_US, DEFAULTFONT_FLAGS_ONLYONE, 0 )); - pMap->SetText(nMode < SGL_END ? sStartQuoteDlg : sEndQuoteDlg ); - sal_UCS4 cDlg; - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - LanguageType eLang = Application::GetSettings().GetLanguage(); - switch( nMode ) - { - case SGL_START: - cDlg = cSglStartQuote; - if(cDlg == 0) - cDlg = pAutoCorrect->GetQuote('\'', sal_True, eLang); - break; - case SGL_END: - cDlg = cSglEndQuote; - if(cDlg == 0) - cDlg = pAutoCorrect->GetQuote('\'', sal_False, eLang); - break; - case DBL_START: - cDlg = cStartQuote; - if(cDlg == 0) - cDlg = pAutoCorrect->GetQuote('\"', sal_True, eLang); - break; - case DBL_END: - cDlg = cEndQuote; - if(cDlg == 0) - cDlg = pAutoCorrect->GetQuote('\"', sal_False, eLang); - break; - default: - OSL_FAIL("svx::OfaQuoteTabPage::QuoteHdl(), how to initialize cDlg?" ); - cDlg = 0; - break; - - } - pMap->SetChar( cDlg ); - pMap->DisableFontSelection(); - if(pMap->Execute() == RET_OK) - { - sal_UCS4 cNewChar = pMap->GetChar(); - switch( nMode ) - { - case SGL_START: - cSglStartQuote = cNewChar; - aSglStartExFT.SetText(ChangeStringExt_Impl(cNewChar)); - break; - case SGL_END: - cSglEndQuote = cNewChar; - aSglEndExFT.SetText(ChangeStringExt_Impl(cNewChar)); - break; - case DBL_START: - cStartQuote = cNewChar; - aDblStartExFT.SetText(ChangeStringExt_Impl(cNewChar)); - break; - case DBL_END: - cEndQuote = cNewChar; - aDblEndExFT.SetText(ChangeStringExt_Impl(cNewChar)); - break; - } - } - delete pMap; - - return 0; -} - -IMPL_LINK( OfaQuoteTabPage, StdQuoteHdl, PushButton*, pBtn ) -{ - if(pBtn == &aDblStandardPB) - { - cStartQuote = 0; - aDblStartExFT.SetText(ChangeStringExt_Impl(0)); - cEndQuote = 0; - aDblEndExFT.SetText(ChangeStringExt_Impl(0)); - - } - else - { - cSglStartQuote = 0; - aSglStartExFT.SetText(ChangeStringExt_Impl(0)); - cSglEndQuote = 0; - aSglEndExFT.SetText(ChangeStringExt_Impl(0)); - } - return 0; -} - -// -------------------------------------------------- - -String OfaQuoteTabPage::ChangeStringExt_Impl( sal_UCS4 cChar ) -{ - if( !cChar ) - return sStandard; - - // convert codepoint value to unicode-hex string - sal_UCS4 aStrCodes[32] = { 0, ' ', '(', 'U', '+', '0' }; - aStrCodes[0] = cChar; - int nFullLen = 5; - int nHexLen = 4; - while( (cChar >> (4*nHexLen)) != 0 ) - ++nHexLen; - for( int i = nHexLen; --i >= 0;) - { - sal_UCS4 cHexDigit = ((cChar >> (4*i)) & 0x0f) + '0'; - if( cHexDigit > '9' ) - cHexDigit += 'A' - ('9' + 1); - aStrCodes[ nFullLen++ ] = cHexDigit; - } - aStrCodes[ nFullLen++ ] = ')'; - // using the new UCS4 constructor - rtl::OUString aOUStr( aStrCodes, nFullLen ); - return aOUStr; -} - -OfaAutoCompleteTabPage::OfaAutoCompleteTabPage( Window* pParent, - const SfxItemSet& rSet ) - : SfxTabPage(pParent, CUI_RES( RID_OFAPAGE_AUTOCOMPLETE_OPTIONS ), rSet), - aCBActiv (this, CUI_RES(CB_ACTIV)), - aCBAppendSpace (this, CUI_RES(CB_APPEND_SPACE)), - aCBAsTip (this, CUI_RES(CB_AS_TIP)), - aCBCollect (this, CUI_RES(CB_COLLECT)), - aCBRemoveList (this, CUI_RES(CB_REMOVE_LIST)), - aFTExpandKey (this, CUI_RES(FT_EXPAND_KEY)), - aDCBExpandKey (this, CUI_RES(DCB_EXPAND_KEY)), - aFTMinWordlen (this, CUI_RES(FT_MIN_WORDLEN)), - aNFMinWordlen (this, CUI_RES(NF_MIN_WORDLEN)), - aFTMaxEntries (this, CUI_RES(FT_MAX_ENTRIES)), - aNFMaxEntries (this, CUI_RES(NF_MAX_ENTRIES)), - aLBEntries (*this, CUI_RES(LB_ENTRIES)), - aPBEntries (this, CUI_RES(PB_ENTRIES)), - pAutoCmpltList( 0 ), - nAutoCmpltListCnt( 0 ) -{ - FreeResource(); - - // the defined KEYs - static const sal_uInt16 aKeyCodes[] = { - KEY_END, - KEY_RETURN, - KEY_SPACE, - KEY_RIGHT, - KEY_TAB, - 0 - }; - - for( const sal_uInt16* pKeys = aKeyCodes; *pKeys; ++pKeys ) - { - KeyCode aKCode( *pKeys ); - sal_uInt16 nPos = aDCBExpandKey.InsertEntry( aKCode.GetName() ); - aDCBExpandKey.SetEntryData( nPos, (void*)(sal_uLong)*pKeys ); - if( KEY_RETURN == *pKeys ) // default to RETURN - aDCBExpandKey.SelectEntryPos( nPos ); - } - - aPBEntries.SetClickHdl(LINK(this, OfaAutoCompleteTabPage, DeleteHdl)); - aCBActiv.SetToggleHdl(LINK(this, OfaAutoCompleteTabPage, CheckHdl)); - aCBCollect.SetToggleHdl(LINK(this, OfaAutoCompleteTabPage, CheckHdl)); - aLBEntries.SetAccessibleRelationLabeledBy(&aLBEntries); -} - -OfaAutoCompleteTabPage::~OfaAutoCompleteTabPage() -{ -} - -SfxTabPage* OfaAutoCompleteTabPage::Create( Window* pParent, - const SfxItemSet& rSet) -{ - return new OfaAutoCompleteTabPage( pParent, rSet ); -} - -sal_Bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet& ) -{ - sal_Bool bModified = sal_False, bCheck; - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); - sal_uInt16 nVal; - - bCheck = aCBActiv.IsChecked(); - bModified |= pOpt->bAutoCompleteWords != bCheck; - pOpt->bAutoCompleteWords = bCheck; - bCheck = aCBCollect.IsChecked(); - bModified |= pOpt->bAutoCmpltCollectWords != bCheck; - pOpt->bAutoCmpltCollectWords = bCheck; - bCheck = !aCBRemoveList.IsChecked(); // inverted value! - bModified |= pOpt->bAutoCmpltKeepList != bCheck; - pOpt->bAutoCmpltKeepList = bCheck; - bCheck = aCBAppendSpace.IsChecked(); - bModified |= pOpt->bAutoCmpltAppendBlanc != bCheck; - pOpt->bAutoCmpltAppendBlanc = bCheck; - bCheck = aCBAsTip.IsChecked(); - bModified |= pOpt->bAutoCmpltShowAsTip != bCheck; - pOpt->bAutoCmpltShowAsTip = bCheck; - - nVal = (sal_uInt16)aNFMinWordlen.GetValue(); - bModified |= nVal != pOpt->nAutoCmpltWordLen; - pOpt->nAutoCmpltWordLen = nVal; - - nVal = (sal_uInt16)aNFMaxEntries.GetValue(); - bModified |= nVal != pOpt->nAutoCmpltListLen; - pOpt->nAutoCmpltListLen = nVal; - - nVal = aDCBExpandKey.GetSelectEntryPos(); - if( nVal < aDCBExpandKey.GetEntryCount() ) - { - sal_uLong nKey = (sal_uLong)aDCBExpandKey.GetEntryData( nVal ); - bModified |= nKey != pOpt->nAutoCmpltExpandKey; - pOpt->nAutoCmpltExpandKey = (sal_uInt16)nKey; - } - - if( pAutoCmpltList && nAutoCmpltListCnt != aLBEntries.GetEntryCount() ) - { - bModified = sal_True; - pOpt->pAutoCmpltList = pAutoCmpltList; - } - if( bModified ) - { - SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get(); - rCfg.SetModified(); - rCfg.Commit(); - } - return sal_True; -} - -void OfaAutoCompleteTabPage::Reset( const SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); - - aCBActiv.Check( 0 != pOpt->bAutoCompleteWords ); - aCBCollect.Check( 0 != pOpt->bAutoCmpltCollectWords ); - aCBRemoveList.Check( !pOpt->bAutoCmpltKeepList ); //inverted value! - aCBAppendSpace.Check( 0 != pOpt->bAutoCmpltAppendBlanc ); - aCBAsTip.Check( 0 != pOpt->bAutoCmpltShowAsTip ); - - aNFMinWordlen.SetValue( pOpt->nAutoCmpltWordLen ); - aNFMaxEntries.SetValue( pOpt->nAutoCmpltListLen ); - - // select the specific KeyCode: - { - sal_uLong nKey = pOpt->nAutoCmpltExpandKey; - for( sal_uInt16 n = 0, nCnt = aDCBExpandKey.GetEntryCount(); n < nCnt; ++n ) - if( nKey == (sal_uLong)aDCBExpandKey.GetEntryData( n )) - { - aDCBExpandKey.SelectEntryPos( n ); - break; - } - } - - if( pOpt->pAutoCmpltList && pOpt->pAutoCmpltList->Count() ) - { - pAutoCmpltList = (SvStringsISortDtor*)pOpt->pAutoCmpltList; - pOpt->pAutoCmpltList = 0; - nAutoCmpltListCnt = pAutoCmpltList->Count(); - for( sal_uInt16 n = 0; n < nAutoCmpltListCnt; ++n ) - { - const StringPtr pStr = pAutoCmpltList->GetObject( n ); - sal_uInt16 nPos = aLBEntries.InsertEntry( *pStr ); - aLBEntries.SetEntryData( nPos, (void*)pStr ); - } - } - else - { - aLBEntries.Disable(); - aPBEntries.Disable(); - } - - CheckHdl( &aCBActiv ); - CheckHdl( &aCBCollect ); -} - -void OfaAutoCompleteTabPage::ActivatePage( const SfxItemSet& ) -{ - ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage( sal_False ); -} - -IMPL_LINK( OfaAutoCompleteTabPage, DeleteHdl, PushButton*, EMPTYARG ) -{ - sal_uInt16 nSelCnt = pAutoCmpltList ? aLBEntries.GetSelectEntryCount() : 0; - while( nSelCnt ) - { - sal_uInt16 nPos = aLBEntries.GetSelectEntryPos( --nSelCnt ); - const StringPtr pStr = (StringPtr)aLBEntries.GetEntryData( nPos ); - aLBEntries.RemoveEntry( nPos ); - nPos = pAutoCmpltList->GetPos( pStr ); - if( USHRT_MAX != nPos ) - pAutoCmpltList->Remove( nPos ); - } - return 0; -} - -IMPL_LINK( OfaAutoCompleteTabPage, CheckHdl, CheckBox*, pBox ) -{ - sal_Bool bEnable = pBox->IsChecked(); - if( pBox == &aCBActiv ) - { - aCBAppendSpace.Enable( bEnable ); - aCBAppendSpace.Enable( bEnable ); - aCBAsTip.Enable( bEnable ); - aDCBExpandKey.Enable( bEnable ); - } - else if(&aCBCollect == pBox) - aCBRemoveList.Enable( bEnable ); - return 0; -} - -void OfaAutoCompleteTabPage::CopyToClipboard() const -{ - sal_uInt16 nSelCnt = aLBEntries.GetSelectEntryCount(); - if( pAutoCmpltList && nSelCnt ) - { - TransferDataContainer* pCntnr = new TransferDataContainer; - ::com::sun::star::uno::Reference< - ::com::sun::star::datatransfer::XTransferable > xRef( pCntnr ); - - ByteString sData; - const sal_Char* pLineEnd = -#if defined(UNX) - "\012"; -#else - "\015\012"; -#endif - - rtl_TextEncoding nEncode = gsl_getSystemTextEncoding(); - - for( sal_uInt16 n = 0; n < nSelCnt; ++n ) - { - sData += ByteString( aLBEntries.GetSelectEntry( n ), nEncode ); - sData += pLineEnd; - } - pCntnr->CopyByteString( SOT_FORMAT_STRING, sData ); - pCntnr->CopyToClipboard( (Window*)this ); - } -} - -long OfaAutoCompleteTabPage::AutoCompleteMultiListBox::PreNotify( - NotifyEvent& rNEvt ) -{ - long nHandled = MultiListBox::PreNotify( rNEvt ); - - if( !nHandled && EVENT_KEYUP == rNEvt.GetType() ) - { - const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode(); - switch( rKeyCode.GetModifier() | rKeyCode.GetCode() ) - { - case KEY_DELETE: - rPage.DeleteHdl( 0 ); - nHandled = 1; - break; - - default: - if( KEYFUNC_COPY == rKeyCode.GetFunction() ) - { - rPage.CopyToClipboard(); - nHandled = 1; - } - break; - } - } - return nHandled; -} - -// class OfaSmartTagOptionsTabPage --------------------------------------------- - -OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage( Window* pParent, - const SfxItemSet& rSet ) - : SfxTabPage(pParent, CUI_RES( RID_OFAPAGE_SMARTTAG_OPTIONS ), rSet), - m_aMainCB( this, CUI_RES(CB_SMARTTAGS) ), - m_aSmartTagTypesLB( this, CUI_RES(LB_SMARTTAGS) ), - m_aPropertiesPB( this, CUI_RES(PB_SMARTTAGS) ), - m_aTitleFT( this, CUI_RES(FT_SMARTTAGS) ) -{ - FreeResource(); - - // some options for the list box: - m_aSmartTagTypesLB.SetStyle( m_aSmartTagTypesLB.GetStyle() | WB_HSCROLL | WB_HIDESELECTION ); - m_aSmartTagTypesLB.SetHighlightRange(); - - // set the handlers: - m_aMainCB.SetToggleHdl(LINK(this, OfaSmartTagOptionsTabPage, CheckHdl)); - m_aPropertiesPB.SetClickHdl(LINK(this, OfaSmartTagOptionsTabPage, ClickHdl)); - m_aSmartTagTypesLB.SetSelectHdl(LINK(this, OfaSmartTagOptionsTabPage, SelectHdl)); -} - -OfaSmartTagOptionsTabPage::~OfaSmartTagOptionsTabPage() -{ - -} - -SfxTabPage* OfaSmartTagOptionsTabPage::Create( Window* pParent, const SfxItemSet& rSet) -{ - return new OfaSmartTagOptionsTabPage( pParent, rSet ); -} - -/** This struct is used to associate list box entries with smart tag data -*/ -struct ImplSmartTagLBUserData -{ - rtl::OUString maSmartTagType; - uno::Reference< smarttags::XSmartTagRecognizer > mxRec; - sal_Int32 mnSmartTagIdx; - - ImplSmartTagLBUserData( const rtl::OUString& rSmartTagType, - uno::Reference< smarttags::XSmartTagRecognizer > xRec, - sal_Int32 nSmartTagIdx ) : - maSmartTagType( rSmartTagType ), - mxRec( xRec ), - mnSmartTagIdx( nSmartTagIdx ) {} -}; - -/** Clears m_aSmartTagTypesLB -*/ -void OfaSmartTagOptionsTabPage::ClearListBox() -{ - const sal_uLong nCount = m_aSmartTagTypesLB.GetEntryCount(); - for ( sal_uInt16 i = 0; i < nCount; ++i ) - { - const SvLBoxEntry* pEntry = m_aSmartTagTypesLB.GetEntry(i); - const ImplSmartTagLBUserData* pUserData = static_cast< ImplSmartTagLBUserData* >(pEntry->GetUserData()); - delete pUserData; - } - - m_aSmartTagTypesLB.Clear(); -} - -/** Inserts items into m_aSmartTagTypesLB -*/ -void OfaSmartTagOptionsTabPage::FillListBox( const SmartTagMgr& rSmartTagMgr ) -{ - // first we have to clear the list box: - ClearListBox(); - - // fill list box: - const sal_uInt32 nNumberOfRecognizers = rSmartTagMgr.NumberOfRecognizers(); - const lang::Locale aLocale( SvxCreateLocale( eLastDialogLanguage ) ); - std::vector< ActionReference > aActionReferences; - - for ( sal_uInt32 i = 0; i < nNumberOfRecognizers; ++i ) - { - uno::Reference< smarttags::XSmartTagRecognizer > xRec = rSmartTagMgr.GetRecognizer(i); - - const rtl::OUString aName = xRec->getName( aLocale ); - const rtl::OUString aDesc = xRec->getDescription( aLocale ); - const sal_Int32 nNumberOfSupportedSmartTags = xRec->getSmartTagCount(); - - for ( sal_Int32 j = 0; j < nNumberOfSupportedSmartTags; ++j ) - { - const rtl::OUString aSmartTagType = xRec->getSmartTagName(j); - rtl::OUString aSmartTagCaption = rSmartTagMgr.GetSmartTagCaption( aSmartTagType, aLocale ); - - if ( !aSmartTagCaption.getLength() ) - aSmartTagCaption = aSmartTagType; - - const rtl::OUString aLBEntry = aSmartTagCaption + - OUString(RTL_CONSTASCII_USTRINGPARAM(" (")) + - aName + - OUString(RTL_CONSTASCII_USTRINGPARAM(")")); - - SvLBoxEntry* pEntry = m_aSmartTagTypesLB.SvTreeListBox::InsertEntry( aLBEntry ); - if ( pEntry ) - { - const bool bCheck = rSmartTagMgr.IsSmartTagTypeEnabled( aSmartTagType ); - m_aSmartTagTypesLB.SetCheckButtonState( pEntry, bCheck ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED ); - pEntry->SetUserData(static_cast<void*>(new ImplSmartTagLBUserData( aSmartTagType, xRec, j ) ) ); - } - } - } -} - -/** Handler for the push button -*/ -IMPL_LINK( OfaSmartTagOptionsTabPage, ClickHdl, PushButton*, EMPTYARG ) -{ - const sal_uInt16 nPos = m_aSmartTagTypesLB.GetSelectEntryPos(); - const SvLBoxEntry* pEntry = m_aSmartTagTypesLB.GetEntry(nPos); - const ImplSmartTagLBUserData* pUserData = static_cast< ImplSmartTagLBUserData* >(pEntry->GetUserData()); - uno::Reference< smarttags::XSmartTagRecognizer > xRec = pUserData->mxRec; - const sal_Int32 nSmartTagIdx = pUserData->mnSmartTagIdx; - - const lang::Locale aLocale( SvxCreateLocale( eLastDialogLanguage ) ); - if ( xRec->hasPropertyPage( nSmartTagIdx, aLocale ) ) - xRec->displayPropertyPage( nSmartTagIdx, aLocale ); - - return 0; -} - -/** Handler for the check box -*/ -IMPL_LINK( OfaSmartTagOptionsTabPage, CheckHdl, CheckBox*, EMPTYARG ) -{ - const sal_Bool bEnable = m_aMainCB.IsChecked(); - m_aSmartTagTypesLB.Enable( bEnable ); - m_aSmartTagTypesLB.Invalidate(); - m_aPropertiesPB.Enable( false ); - - // if the controls are currently enabled, we still have to check - // if the properties button should be disabled because the currently - // seleted smart tag type does not have a properties dialog. - // We do this by calling SelectHdl: - if ( bEnable ) - SelectHdl( &m_aSmartTagTypesLB ); - - return 0; -} - -/** Handler for the list box -*/ -IMPL_LINK(OfaSmartTagOptionsTabPage, SelectHdl, SvxCheckListBox*, EMPTYARG) -{ - if ( m_aSmartTagTypesLB.GetEntryCount() < 1 ) - return 0; - - const sal_uInt16 nPos = m_aSmartTagTypesLB.GetSelectEntryPos(); - const SvLBoxEntry* pEntry = m_aSmartTagTypesLB.GetEntry(nPos); - const ImplSmartTagLBUserData* pUserData = static_cast< ImplSmartTagLBUserData* >(pEntry->GetUserData()); - uno::Reference< smarttags::XSmartTagRecognizer > xRec = pUserData->mxRec; - const sal_Int32 nSmartTagIdx = pUserData->mnSmartTagIdx; - - const lang::Locale aLocale( SvxCreateLocale( eLastDialogLanguage ) ); - if ( xRec->hasPropertyPage( nSmartTagIdx, aLocale ) ) - m_aPropertiesPB.Enable( sal_True ); - else - m_aPropertiesPB.Enable( sal_False ); - - return 0; -} - -/** Propagates the current settings to the smart tag manager. -*/ -sal_Bool OfaSmartTagOptionsTabPage::FillItemSet( SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); - SmartTagMgr* pSmartTagMgr = pOpt->pSmartTagMgr; - - // robust! - if ( !pSmartTagMgr ) - return sal_False; - - sal_Bool bModifiedSmartTagTypes = sal_False; - std::vector< rtl::OUString > aDisabledSmartTagTypes; - - const sal_uLong nCount = m_aSmartTagTypesLB.GetEntryCount(); - - for ( sal_uInt16 i = 0; i < nCount; ++i ) - { - const SvLBoxEntry* pEntry = m_aSmartTagTypesLB.GetEntry(i); - const ImplSmartTagLBUserData* pUserData = static_cast< ImplSmartTagLBUserData* >(pEntry->GetUserData()); - const sal_Bool bChecked = m_aSmartTagTypesLB.IsChecked(i); - const sal_Bool bIsCurrentlyEnabled = pSmartTagMgr->IsSmartTagTypeEnabled( pUserData->maSmartTagType ); - - bModifiedSmartTagTypes = bModifiedSmartTagTypes || ( !bChecked != !bIsCurrentlyEnabled ); - - if ( !bChecked ) - aDisabledSmartTagTypes.push_back( pUserData->maSmartTagType ); - - delete pUserData; - } - - const sal_Bool bModifiedRecognize = ( !m_aMainCB.IsChecked() != !pSmartTagMgr->IsLabelTextWithSmartTags() ); - if ( bModifiedSmartTagTypes || bModifiedRecognize ) - { - bool bLabelTextWithSmartTags = m_aMainCB.IsChecked() ? true : false; - pSmartTagMgr->WriteConfiguration( bModifiedRecognize ? &bLabelTextWithSmartTags : 0, - bModifiedSmartTagTypes ? &aDisabledSmartTagTypes : 0 ); - } - - return sal_True; -} - -/** Sets the controls based on the current settings at SmartTagMgr. -*/ -void OfaSmartTagOptionsTabPage::Reset( const SfxItemSet& ) -{ - SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); - SvxSwAutoFmtFlags *pOpt = &pAutoCorrect->GetSwFlags(); - const SmartTagMgr* pSmartTagMgr = pOpt->pSmartTagMgr; - - // robust, should not happen! - if ( !pSmartTagMgr ) - return; - - FillListBox( *pSmartTagMgr ); - m_aSmartTagTypesLB.SelectEntryPos( 0 ); - m_aMainCB.Check( pSmartTagMgr->IsLabelTextWithSmartTags() ); - CheckHdl( &m_aMainCB ); -} - -void OfaSmartTagOptionsTabPage::ActivatePage( const SfxItemSet& ) -{ - ((OfaAutoCorrDlg*)GetTabDialog())->EnableLanguage( sal_False ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/autocdlg.hrc b/cui/source/tabpages/autocdlg.hrc deleted file mode 100644 index d58f65b1a..000000000 --- a/cui/source/tabpages/autocdlg.hrc +++ /dev/null @@ -1,172 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_AUTOCDLG_HRC -#define _SVX_AUTOCDLG_HRC - -#include <cuires.hrc> - -// defines ------------------------------------------------------------------ - -#define CLB_SETTINGS 1 -/* -#define STR_DOUBLECAPS 3 -#define STR_STARTCAPS 4 -#define STR_FIRST 5 -#define STR_HALF 6 -#define STR_DASH 7 -#define STR_BOLDUNDERLINE 8 -#define STR_URL 9 -*/ - -#define CB_TYPO 11 -#define FT_STARTQUOTE 12 -#define PB_STARTQUOTE 13 -#define FT_ENDQUOTE 14 -#define PB_ENDQUOTE 15 - -#define FL_ABBREV 16 -#define ED_ABBREV 17 -#define LB_ABBREV 18 -#define PB_NEWABBREV 19 -#define PB_DELABBREV 20 -#define FL_DOUBLECAPS 21 -#define ED_DOUBLE_CAPS 22 -#define LB_DOUBLE_CAPS 23 -#define PB_NEWDOUBLECAPS 24 -#define PB_DELDOUBLECAPS 25 - -#define ED_SHORT 31 -#define ED_REPLACE 32 -#define TLB_REPLACE 33 -#define CB_TEXT_ONLY 34 -#define PB_NEW_REPLACE 35 -#define PB_DELETE_REPLACE 36 -#define STR_MODIFY 37 -#define STR_CLOSE_AUTOCORR 38 -#define FT_SHORT 39 -#define FT_REPLACE 40 -#define STR_CHANGE_START 41 -#define STR_CHANGE_END 42 -#define CB_AUTOABBREV 43 -#define CB_AUTOCAPS 44 - -#define FT_SGL_STARTQUOTE 45 -#define PB_SGL_STARTQUOTE 46 -#define FT_SGL_ENDQUOTE 47 -#define PB_SGL_ENDQUOTE 48 -#define PB_SGL_STD 49 -#define PB_DBL_STD 50 -#define FL_SINGLE 51 -#define FL_DOUBLE 52 -#define FT_SGSTEX 53 -#define FT_SGENEX 54 -#define FT_DBSTEX 55 -#define FT_DBECEX 56 -#define CB_SGL_TYPO 57 -#define ST_STANDARD 58 - -#define PB_EDIT 61 -#define ST_DEL_EMPTY_PARA 62 -#define ST_TYPO 66 -#define ST_USER_STYLE 67 -#define ST_BULLET 68 -#define STR_DEL_SPACES_AT_STT_END 69 -#define STR_DEL_SPACES_BETWEEN_LINES 70 - -#define ST_RIGHT_MARGIN 74 -#define STR_NUM 75 -#define STR_BORDER 76 -#define STR_TABLE 77 -#define STR_REPLACE_TEMPLATES 78 -#define FL_PRCNT 79 - -#define STR_HEADER 90 -#define FT_HEADER_EXPLANATION 91 -#define STR_HEADER1 92 -#define STR_HEADER2 93 -#define FT_HEADER1_EXPLANATION 94 -#define FT_HEADER2_EXPLANATION 95 - -#define ED_RIGHT_MARGIN 100 -#define BT_OK 101 -#define BT_CANCEL 102 - -#define BT_AWCP_OK 110 -#define BT_AWCP_CANCEL 111 -#define GB_AWCP_VALUE 112 -#define ED_AWCP_WORD_LEN 113 -#define ED_AWCP_LIST_LEN 114 -#define FT_AWCP_WORD_LEN 115 -#define FT_AWCP_LIST_LEN 116 - -#define CB_ACTIV 121 -#define CB_COLLECT 122 -#define CB_APPEND_SPACE 123 -#define CB_REMOVE_LIST 124 -#define CB_AS_TIP 125 -#define FT_MIN_WORDLEN 126 -#define FT_MAX_ENTRIES 127 -#define NF_MIN_WORDLEN 128 -#define NF_MAX_ENTRIES 129 -#define FT_EXPAND_KEY 130 -#define DCB_EXPAND_KEY 131 -#define LB_ENTRIES 132 -#define PB_ENTRIES 133 - - -#define ST_USE_REPLACE 200 -#define ST_CPTL_STT_WORD 201 -#define ST_CPTL_STT_SENT 202 -#define ST_BOLD_UNDER 203 -#define STR_NO_DBL_SPACES 204 -#define ST_DETECT_URL 205 -#define ST_ORDINAL 206 -#define ST_NON_BREAK_SPACE 207 -#define ST_DASH 208 -#define FT_LANG 209 -#define LB_LANG 210 -#define ST_CORRECT_ACCIDENTAL_CAPS_LOCK 211 - -#define CB_SMARTTAGS 220 -#define FT_SMARTTAGS 221 -#define LB_SMARTTAGS 222 -#define PB_SMARTTAGS 223 -//IAccessibility2 Implementation 2009----- -#define STR_PB_NEWABBREV 224 -#define STR_PB_DELABBREV 225 -#define STR_PB_NEWDOUBLECAPS 226 -#define STR_PB_DELDOUBLECAPS 227 -#define STR_PB_SGL_STD 228 -#define STR_PB_DBL_STD 229 -#define STR_PB_SGL_START 230 -#define STR_PB_DBL_START 231 -#define STR_PB_SGL_END 232 -#define STR_PB_DBL_END 233 -//-----IAccessibility2 Implementation 2009 - -#endif - diff --git a/cui/source/tabpages/autocdlg.src b/cui/source/tabpages/autocdlg.src deleted file mode 100644 index 3076af0e8..000000000 --- a/cui/source/tabpages/autocdlg.src +++ /dev/null @@ -1,941 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include ------------------------------------------------------------------ -#include "autocdlg.hrc" -#include <cuires.hrc> -#include "helpid.hrc" -#include <svx/svxids.hrc> // SID_AUTOFORMAT - - // pragma ------------------------------------------------------------------- -/**************************************************************************/ -/* */ -/* TabDialog RID_OFA_AUTOCORR_DLG */ -/* */ -/**************************************************************************/ -TabDialog RID_OFA_AUTOCORR_DLG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Text [ en-US ] = "AutoCorrect" ; - Moveable = TRUE ; - TabControl 1 - { - SVLook = TRUE ; - PageList = - { - PageItem - { - Identifier = RID_OFAPAGE_AUTOCORR_REPLACE ; - Text [ en-US ] = "Replace" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOCORR_EXCEPT ; - Text [ en-US ] = "Exceptions" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOCORR_OPTIONS ; - Text [ en-US ] = "Options" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOFMT_APPLY ; - Text [ en-US ] = "Options" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOCORR_QUOTE ; - Text [ en-US ] = "Localized Options" ; - }; - PageItem - { - Identifier = RID_OFAPAGE_AUTOCOMPLETE_OPTIONS ; - Text [ en-US ] = "Word Completion"; - }; - PageItem - { - Identifier = RID_OFAPAGE_SMARTTAG_OPTIONS ; - Text [ en-US ] = "Smart Tags"; - }; - }; - }; - FixedText FT_LANG - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 140 , 8 ) ; - - Left = TRUE ; - Text [ en-US ] = "Replacements and exceptions for language:"; - }; - ListBox LB_LANG - { - Pos = MAP_APPFONT ( 150 , 3 ) ; - Size = MAP_APPFONT ( 60 , 100 ) ; - DropDown = TRUE; - TabStop = TRUE ; - Border = TRUE ; - }; -}; -#define COMMON_CLB_ENTRIES \ - String ST_USE_REPLACE \ - { \ - Text [ en-US ] = "Use replacement table" ; \ - }; \ - String ST_CPTL_STT_WORD \ - { \ - Text [ en-US ] = "Correct TWo INitial CApitals" ; \ - }; \ - String ST_CPTL_STT_SENT \ - { \ - Text [ en-US ] = "Capitalize first letter of every sentence" ; \ - }; \ - String ST_BOLD_UNDER \ - { \ - Text [ en-US ] = "Automatic *bold* and _underline_" ; \ - }; \ - String STR_NO_DBL_SPACES \ - { \ - Text [ en-US ] = "Ignore double spaces" ; \ - }; \ - String ST_DETECT_URL \ - { \ - Text [ en-US ] = "URL Recognition" ; \ - }; \ - String ST_DASH \ - { \ - Text [ en-US ] = "Replace dashes" ; \ - }; \ - String ST_CORRECT_ACCIDENTAL_CAPS_LOCK \ - { \ - Text [ en-US ] = "Correct accidental use of cAPS LOCK key" ; \ - }; - -/**************************************************************************/ -/* */ -/* Beschreibung: Autokorrektur-Optionen */ -/* */ -/**************************************************************************/ -TabPage RID_OFAPAGE_AUTOCORR_OPTIONS -{ - HelpId = HID_OFAPAGE_AUTOCORR_OPTIONS ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE ; - SVLook = TRUE ; - Text [ en-US ] = "Settings" ; - Control CLB_SETTINGS - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 248 , 173 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - COMMON_CLB_ENTRIES -}; -/**************************************************************************/ -/* */ -/* */ -/* */ -/**************************************************************************/ -TabPage RID_OFAPAGE_AUTOFMT_APPLY -{ - HelpID = HID_OFAPAGE_AUTOFMT_OPTIONS ; - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Control CLB_SETTINGS - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 248 , 149 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - PushButton PB_EDIT - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOFMT_APPLY:PB_EDIT"; - Pos = MAP_APPFONT ( 6 , 162 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Edit..." ; - TabStop = TRUE ; - }; - String STR_HEADER1 - { - Text [ en-US ] = "[M]" ; - }; - String STR_HEADER2 - { - Text [ en-US ] = "[T]" ; - }; - FixedText FT_HEADER1_EXPLANATION - { - Pos = MAP_APPFONT ( 80 , 159 ) ; - Size = MAP_APPFONT ( 174 , 8 ) ; - Text [ en-US ] = "[M]: Replace while modifying existing text" ; - }; - FixedText FT_HEADER2_EXPLANATION - { - Pos = MAP_APPFONT ( 80 , 171 ) ; - Size = MAP_APPFONT ( 174 , 8 ) ; - Text [ en-US ] = "[T]: AutoFormat/AutoCorrect while typing" ; - }; - COMMON_CLB_ENTRIES - String ST_DEL_EMPTY_PARA - { - Text [ en-US ] = "Remove blank paragraphs" ; - }; - String ST_USER_STYLE - { - Text [ en-US ] = "Replace Custom Styles" ; - }; - String ST_BULLET - { - Text [ en-US ] = "Replace bullets with: " ; - }; - String ST_RIGHT_MARGIN - { - // Text [ norwegian_wrong ] = "+++Combine single line paragraphs at" ; - // Text [ swedish_wrong ] = ~Kombinera enradiga stycken B738vid " ; - Text [ en-US ] = "Combine single line paragraphs if length greater than" ; - }; - String STR_NUM - { - Text [ en-US ] = "Apply numbering - symbol: " ; - }; - String STR_BORDER - { - Text [ en-US ] = "Apply border" ; - }; - String STR_TABLE - { - Text [ en-US ] = "Create table" ; - }; - String STR_REPLACE_TEMPLATES - { - Text [ en-US ] = "Apply Styles" ; - }; - String STR_DEL_SPACES_AT_STT_END - { - Text [ en-US ] = "Delete spaces and tabs at beginning and end of paragraph"; - }; - String STR_DEL_SPACES_BETWEEN_LINES - { - Text [ en-US ] = "Delete spaces and tabs at end and start of line"; - }; -}; - -ModalDialog RID_OFADLG_PRCNT_SET -{ - HelpID = CMD_SID_AUTOFORMAT ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 155 , 43 ) ; - Moveable = TRUE ; - FixedLine FL_PRCNT - { - Pos = MAP_APPFONT ( 4 , 3 ) ; - Size = MAP_APPFONT ( 87 , 8 ) ; - Text [ en-US ] = "Minimum size" ; - }; - OKButton BT_OK - { - Pos = MAP_APPFONT ( 99 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BT_CANCEL - { - Pos = MAP_APPFONT ( 99 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - MetricField ED_RIGHT_MARGIN - { - HelpID = "cui:MetricField:RID_OFADLG_PRCNT_SET:ED_RIGHT_MARGIN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 7 , 14 ) ; - Size = MAP_APPFONT ( 31 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - Value = 77 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - First = 10 ; - Last = 100 ; - SpinSize = 5 ; - }; - Text [ en-US ] = "Combine" ; -}; - -/**************************************************************************/ -/* */ -/* Beschreibung: Ersetzungstabelle */ -/* */ -/**************************************************************************/ -TabPage RID_OFAPAGE_AUTOCORR_REPLACE -{ - HelpId = HID_OFAPAGE_AUTOCORR_REPLACE ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - SVLook = TRUE ; - Hide = TRUE ; - FixedText FT_SHORT - { - Pos = MAP_APPFONT ( 7 , 3 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "Repla~ce" ; - Left = TRUE ; - }; - Edit ED_SHORT - { - HelpID = "cui:Edit:RID_OFAPAGE_AUTOCORR_REPLACE:ED_SHORT"; - Pos = MAP_APPFONT ( 7 , 13 ) ; - Size = MAP_APPFONT ( 60 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_REPLACE - { - Pos = MAP_APPFONT ( 71 , 3 ) ; - Size = MAP_APPFONT ( 64 , 8 ) ; - Text [ en-US ] = "~With:" ; - Left = TRUE ; - }; - Edit ED_REPLACE - { - HelpID = "cui:Edit:RID_OFAPAGE_AUTOCORR_REPLACE:ED_REPLACE"; - Pos = MAP_APPFONT ( 71 , 13 ) ; - Size = MAP_APPFONT ( 123 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - CheckBox CB_TEXT_ONLY - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCORR_REPLACE:CB_TEXT_ONLY"; - Pos = MAP_APPFONT ( 140 , 3 ) ; - Size = MAP_APPFONT ( 108 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Text only" ; - }; - PushButton PB_NEW_REPLACE - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_REPLACE:PB_NEW_REPLACE"; - Pos = MAP_APPFONT ( 198 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~New" ; - }; - PushButton PB_DELETE_REPLACE - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_REPLACE:PB_DELETE_REPLACE"; - Pos = MAP_APPFONT ( 198 , 32 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Delete" ; - }; - Control TLB_REPLACE - { - HelpId = HID_OFACTL_AUTOCORR_REPLACE ; - Pos = MAP_APPFONT ( 7 , 29 ) ; - Size = MAP_APPFONT ( 187 , 150 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - String STR_MODIFY - { - Text [ en-US ] = "~Replace" ; - }; -}; -/**************************************************************************/ -/* */ -/* Beschreibung: Ausnahmelisten */ -/* */ -/**************************************************************************/ -TabPage RID_OFAPAGE_AUTOCORR_EXCEPT -{ - HelpId = HID_OFAPAGE_AUTOCORR_EXCEPT ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - SVLook = TRUE ; - Hide = TRUE ; - FixedLine FL_ABBREV - { - Pos = MAP_APPFONT ( 4 , 3 ) ; - Size = MAP_APPFONT ( 252 , 8 ) ; - Text [ en-US ] = "Abbreviations (no subsequent capital)" ; - }; - Edit ED_ABBREV - { - HelpID = "cui:Edit:RID_OFAPAGE_AUTOCORR_EXCEPT:ED_ABBREV"; - Pos = MAP_APPFONT ( 7 , 14 ) ; - Size = MAP_APPFONT ( 123 , 12 ) ; - TabStop = TRUE ; - Border = TRUE ; - }; - ListBox LB_ABBREV - { - HelpID = "cui:ListBox:RID_OFAPAGE_AUTOCORR_EXCEPT:LB_ABBREV"; - Pos = MAP_APPFONT ( 7 , 30 ) ; - Size = MAP_APPFONT ( 123 , 58 ) ; - TabStop = TRUE ; - AutoHScroll = TRUE ; - SORT = TRUE ; - Border = TRUE ; - }; - PushButton PB_NEWABBREV - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_EXCEPT:PB_NEWABBREV"; - Pos = MAP_APPFONT ( 198 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Disable = TRUE ; - Text [ en-US ] = "~New" ; - }; - PushButton PB_DELABBREV - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_EXCEPT:PB_DELABBREV"; - Pos = MAP_APPFONT ( 198 , 31 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Disable = TRUE ; - Text [ en-US ] = "~Delete" ; - }; - CheckBox CB_AUTOABBREV - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCORR_EXCEPT:CB_AUTOABBREV"; - Pos = MAP_APPFONT ( 137 , 78 ) ; - Size = MAP_APPFONT ( 111 , 10 ) ; - Text [ en-US ] = "~AutoInclude"; - TabStop = TRUE ; - }; - FixedLine FL_DOUBLECAPS - { - Pos = MAP_APPFONT ( 4 , 94 ) ; - Size = MAP_APPFONT ( 252 , 8 ) ; - Text [ en-US ] = "Words with TWo INitial CApitals" ; - }; - Edit ED_DOUBLE_CAPS - { - HelpID = "cui:Edit:RID_OFAPAGE_AUTOCORR_EXCEPT:ED_DOUBLE_CAPS"; - Pos = MAP_APPFONT ( 7 , 105 ) ; - Size = MAP_APPFONT ( 123 , 12 ) ; - TabStop = TRUE ; - Border = TRUE ; - }; - ListBox LB_DOUBLE_CAPS - { - HelpID = "cui:ListBox:RID_OFAPAGE_AUTOCORR_EXCEPT:LB_DOUBLE_CAPS"; - Pos = MAP_APPFONT ( 7 , 120 ) ; - Size = MAP_APPFONT ( 123 , 59 ) ; - TabStop = TRUE ; - AutoHScroll = TRUE ; - SORT = TRUE ; - Border = TRUE ; - }; - PushButton PB_NEWDOUBLECAPS - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_EXCEPT:PB_NEWDOUBLECAPS"; - Pos = MAP_APPFONT ( 198 , 105 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Disable = TRUE ; - Text [ en-US ] = "Ne~w" ; - }; - PushButton PB_DELDOUBLECAPS - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_EXCEPT:PB_DELDOUBLECAPS"; - Pos = MAP_APPFONT ( 198 , 122 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Disable = TRUE ; - Text [ en-US ] = "Dele~te" ; - }; - CheckBox CB_AUTOCAPS - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCORR_EXCEPT:CB_AUTOCAPS"; - Pos = MAP_APPFONT ( 137 , 169 ) ; - Size = MAP_APPFONT ( 111 , 10 ) ; - Text [ en-US ] = "A~utoInclude"; - }; - String STR_PB_NEWABBREV - { - Text [ en-US ] = "New abbreviations" ; - }; - String STR_PB_DELABBREV - { - Text [ en-US ] = "Delete abbreviations" ; - }; - String STR_PB_NEWDOUBLECAPS - { - Text [ en-US ] = "New words with two initial capitals" ; - }; - String STR_PB_DELDOUBLECAPS - { - Text [ en-US ] = "Delete words with two initial capitals" ; - }; - String STR_PB_SGL_STD - { - Text [ en-US ] = "Single quotes default" ; - }; - String STR_PB_DBL_STD - { - Text [ en-US ] = "Double quotes default" ; - }; - String STR_PB_SGL_START - { - Text [ en-US ] = "Start quote of single quotes" ; - }; - String STR_PB_DBL_START - { - Text [ en-US ] = "Start quote of double quotes" ; - }; - String STR_PB_SGL_END - { - Text [ en-US ] = "End quote of single quotes" ; - }; - String STR_PB_DBL_END - { - Text [ en-US ] = "End quote of double quotes" ; - }; -}; -/**************************************************************************/ -/* */ -/* Beschreibung: Typografische Anfuehrungszeichen */ -/* */ -/**************************************************************************/ -TabPage RID_OFAPAGE_AUTOCORR_QUOTE -{ - HelpId = HID_OFAPAGE_AUTOCORR_QUOTE ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - SVLook = TRUE ; - Hide = TRUE ; - Text [ en-US ] = "Localized Options" ; - Control CLB_SETTINGS - { - Pos = MAP_APPFONT ( 4 , 3 ) ; - Size = MAP_APPFONT ( 252 , 85 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - String STR_HEADER1 - { - Text [ en-US ] = "[M]" ; - }; - String STR_HEADER2 - { - Text [ en-US ] = "[T]" ; - }; - String ST_NON_BREAK_SPACE - { - Text [ en-US ] = "Add non breaking space before specific punctuation marks in french text" ; - }; - String ST_ORDINAL - { - Text [ en-US ] = "Format ordinal numbers suffixes (1st -> 1^st)" ; - }; - FixedLine FL_SINGLE - { - Pos = MAP_APPFONT ( 4 , 90 ) ; - Size = MAP_APPFONT ( 122 , 8 ) ; - Text [ en-US ] = "Single quotes" ; - }; - CheckBox CB_SGL_TYPO - { - HelpId = "cui:CheckBox:RID_OFAPAGE_AUTOCORR_QUOTE:CB_SGL_TYPO"; - Pos = MAP_APPFONT ( 7 , 101 ) ; - Size = MAP_APPFONT ( 86 , 10 ) ; - Text [ en-US ] = "Repla~ce" ; - }; - FixedText FT_SGL_STARTQUOTE - { - Pos = MAP_APPFONT ( 7 , 114 ) ; - Size = MAP_APPFONT ( 86 , 8 ) ; - Text [ en-US ] = "~Start quote:" ; - }; - PushButton PB_SGL_STARTQUOTE - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_QUOTE:PB_SGL_STARTQUOTE"; - Pos = MAP_APPFONT ( 10 , 125 ) ; - Size = MAP_APPFONT ( 12 , 12 ) ; - Text = "\'" ; - TabStop = TRUE ; - }; - FixedText FT_SGSTEX - { - Pos = MAP_APPFONT ( 26 , 127 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - }; - FixedText FT_SGL_ENDQUOTE - { - Pos = MAP_APPFONT ( 7 , 139 ) ; - Size = MAP_APPFONT ( 86 , 8 ) ; - Text [ en-US ] = "~End quote:" ; - }; - PushButton PB_SGL_ENDQUOTE - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_QUOTE:PB_SGL_ENDQUOTE"; - Pos = MAP_APPFONT ( 10 , 151 ) ; - Size = MAP_APPFONT ( 12 , 12 ) ; - Text = "\'" ; - TabStop = TRUE ; - }; - FixedText FT_SGENEX - { - Pos = MAP_APPFONT ( 26 , 153 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - }; - PushButton PB_SGL_STD - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_QUOTE:PB_SGL_STD"; - Pos = MAP_APPFONT ( 7 , 167 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Default" ; - }; - FixedLine FL_DOUBLE - { - Pos = MAP_APPFONT ( 134 , 90 ) ; - Size = MAP_APPFONT ( 122 , 8 ) ; - Text [ en-US ] = "Double quotes" ; - }; - CheckBox CB_TYPO - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCORR_QUOTE:CB_TYPO"; - Pos = MAP_APPFONT ( 137 , 101 ) ; - Size = MAP_APPFONT ( 86 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Repl~ace" ; - }; - FixedText FT_STARTQUOTE - { - Pos = MAP_APPFONT ( 137 , 114 ) ; - Size = MAP_APPFONT ( 86 , 8 ) ; - Text [ en-US ] = "Start q~uote:" ; - }; - PushButton PB_STARTQUOTE - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_QUOTE:PB_STARTQUOTE"; - Pos = MAP_APPFONT ( 140 , 125 ) ; - Size = MAP_APPFONT ( 12 , 12 ) ; - Text = "\"" ; - TabStop = TRUE ; - }; - FixedText FT_DBSTEX - { - Pos = MAP_APPFONT ( 156 , 127 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - }; - FixedText FT_ENDQUOTE - { - Pos = MAP_APPFONT ( 137 , 139 ) ; - Size = MAP_APPFONT ( 86 , 10 ) ; - Text [ en-US ] = "E~nd quote:" ; - }; - PushButton PB_ENDQUOTE - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_QUOTE:PB_ENDQUOTE"; - Pos = MAP_APPFONT ( 140 , 151 ) ; - Size = MAP_APPFONT ( 12 , 12 ) ; - Text = "\"" ; - TabStop = TRUE ; - }; - FixedText FT_DBECEX - { - Pos = MAP_APPFONT ( 156 , 153 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - }; - PushButton PB_DBL_STD - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCORR_QUOTE:PB_DBL_STD"; - Pos = MAP_APPFONT ( 137 , 167 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "De~fault" ; - }; - String STR_CHANGE_START - { - Text [ en-US ] = "Start quote" ; - }; - String STR_CHANGE_END - { - Text [ en-US ] = "End quote" ; - }; - String ST_STANDARD - { - Text [ en-US ] = "Default" ; - }; -}; - -/**************************************************************************/ -/* */ -/* Beschreibung: automatische Wortergänzung */ -/* */ -/**************************************************************************/ -TabPage RID_OFAPAGE_AUTOCOMPLETE_OPTIONS -{ - HelpId = HID_OFAPAGE_AUTOCOMPLETE_OPTIONS ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - SVLook = TRUE ; - Hide = TRUE ; - CheckBox CB_ACTIV - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:CB_ACTIV"; - Pos = MAP_APPFONT( 4, 3 ); - Size = MAP_APPFONT( 116, 10 ); - Text [ en-US ] = "Enable word ~completion"; - }; - CheckBox CB_APPEND_SPACE - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:CB_APPEND_SPACE"; - Pos = MAP_APPFONT( 10, 17 ); - Size = MAP_APPFONT( 110, 10 ); - Text [ en-US ] = "~Append space"; - }; - CheckBox CB_AS_TIP - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:CB_AS_TIP"; - Pos = MAP_APPFONT( 10, 31 ); - Size = MAP_APPFONT( 110, 10 ); - Text [ en-US ] = "~Show as tip"; - }; - CheckBox CB_COLLECT - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:CB_COLLECT"; - Pos = MAP_APPFONT( 4, 45 ); - Size = MAP_APPFONT( 116, 10 ); - Text [ en-US ] = "C~ollect words"; - }; - CheckBox CB_REMOVE_LIST - { - HelpID = "cui:CheckBox:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:CB_REMOVE_LIST"; - Pos = MAP_APPFONT( 10, 59 ); - Size = MAP_APPFONT( 110, 40 ); - WordBreak = TRUE; - Text [ en-US ] = "~When closing a document, remove the words collected from it from the list"; - }; - FixedText FT_EXPAND_KEY - { - Pos = MAP_APPFONT( 4, 102 ); - Size = MAP_APPFONT( 116, 8 ); - Text [ en-US ] = "Acc~ept with"; - }; - ListBox DCB_EXPAND_KEY - { - HelpID = "cui:ListBox:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:DCB_EXPAND_KEY"; - Pos = MAP_APPFONT( 4, 113 ); - Size = MAP_APPFONT( 116, 60 ); - TabStop = TRUE; - DropDown = TRUE; - Group = TRUE; - Sort = FALSE; - }; - FixedText FT_MIN_WORDLEN - { - Pos = MAP_APPFONT( 4, 129 ); - Size = MAP_APPFONT( 116, 8 ); - Text [ en-US ] = "Mi~n. word length"; - }; - NumericField NF_MIN_WORDLEN - { - HelpID = "cui:NumericField:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:NF_MIN_WORDLEN"; - Border = TRUE; - Pos = MAP_APPFONT( 4, 140 ); - Size = MAP_APPFONT( 30, 12 ); - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Value = 10 ; - Minimum = 5 ; - First = 5 ; - Last = 100 ; - Maximum = 100 ; - SpinSize = 1 ; - }; - FixedText FT_MAX_ENTRIES - { - Pos = MAP_APPFONT( 4, 156 ); - Size = MAP_APPFONT( 116, 8 ); - Text [ en-US ] = "~Max. entries"; - }; - NumericField NF_MAX_ENTRIES - { - HelpID = "cui:NumericField:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:NF_MAX_ENTRIES"; - Border = TRUE; - Pos = MAP_APPFONT( 4, 167 ); - Size = MAP_APPFONT( 30, 12 ); - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Value = 500 ; - Maximum = 10000; - Last = 10000 ; - First = 50 ; - Minimum = 50; - SpinSize = 25 ; - }; - MultiListBox LB_ENTRIES - { - HelpID = "cui:MultiListBox:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:LB_ENTRIES"; - Pos = MAP_APPFONT( 127, 3 ); - Size = MAP_APPFONT( 121, 158 ); - TabStop = TRUE; - DropDown = FALSE; - Group = TRUE; - Border = TRUE; - Sort = TRUE; - }; - PushButton PB_ENTRIES - { - HelpID = "cui:PushButton:RID_OFAPAGE_AUTOCOMPLETE_OPTIONS:PB_ENTRIES"; - Pos = MAP_APPFONT( 127, 165 ); - Size = MAP_APPFONT( 121, 14 ); - TabStop = TRUE ; - Text [ en-US ] = "~Delete Entry"; - }; - Text [ en-US ] = "Word Completion"; -}; - - -/**************************************************************************/ -/* */ -/* Beschreibung: Smart Tag Options */ -/* */ -/**************************************************************************/ -TabPage RID_OFAPAGE_SMARTTAG_OPTIONS -{ - HelpId = HID_OFAPAGE_SMARTTAG_OPTIONS ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - SVLook = TRUE ; - Hide = TRUE ; - Text [ en-US ] = "Smart Tags"; - - CheckBox CB_SMARTTAGS - { - HelpID = "cui:CheckBox:RID_OFAPAGE_SMARTTAG_OPTIONS:CB_SMARTTAGS"; - Pos = MAP_APPFONT( 4, 3 ); - Size = MAP_APPFONT( 116, 10 ); - Text [ en-US ] = "Label text with smart tags"; - }; - - FixedText FT_SMARTTAGS - { - Pos = MAP_APPFONT( 12, 15 ); - Size = MAP_APPFONT( 116, 8 ); - Text [ en-US ] = "Currently installed smart tags"; - }; - - Control LB_SMARTTAGS - { - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 172 , 154 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - - PushButton PB_SMARTTAGS - { - HelpID = "cui:PushButton:RID_OFAPAGE_SMARTTAG_OPTIONS:PB_SMARTTAGS"; - Pos = MAP_APPFONT ( 188 , 25 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "Properties..."; - }; - -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx deleted file mode 100644 index aa603154b..000000000 --- a/cui/source/tabpages/backgrnd.cxx +++ /dev/null @@ -1,1893 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <unotools/pathoptions.hxx> -#include <vcl/msgbox.hxx> -#include <tools/urlobj.hxx> -#include <sfx2/objsh.hxx> -#include <sfx2/docfile.hxx> -#include <svtools/wallitem.hxx> -#include <svl/cntwall.hxx> -#include <sfx2/cntids.hrc> -#include <svx/dialogs.hrc> - -#define _SVX_BACKGRND_CXX - -#include <cuires.hrc> -#include "backgrnd.hrc" -#include <svx/dialmgr.hxx> -#include <editeng/memberids.hrc> -#include <editeng/editrids.hrc> -#include <editeng/eerdll.hxx> - -// Tabellenhintergrund -#define TBL_DEST_CELL 0 -#define TBL_DEST_ROW 1 -#define TBL_DEST_TBL 2 - -#include <editeng/brshitem.hxx> -#include "backgrnd.hxx" - -#include <svx/xtable.hxx> -#include <sfx2/opengrf.hxx> -#include <svx/svxerr.hxx> -#include <svx/drawitem.hxx> -#include <dialmgr.hxx> -#include <svx/htmlmode.hxx> -#include <svtools/controldims.hrc> -#include <svx/flagsdef.hxx> -#include <svl/intitem.hxx> -#include <sfx2/request.hxx> -using namespace ::com::sun::star; -// static ---------------------------------------------------------------- - -static sal_uInt16 pRanges[] = -{ - SID_VIEW_FLD_PIC, SID_VIEW_FLD_PIC, - SID_ATTR_BRUSH, SID_ATTR_BRUSH, - SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR, - 0 -}; - -struct SvxBackgroundTable_Impl -{ - SvxBrushItem* pCellBrush; - SvxBrushItem* pRowBrush; - SvxBrushItem* pTableBrush; - sal_uInt16 nCellWhich; - sal_uInt16 nRowWhich; - sal_uInt16 nTableWhich; - sal_uInt16 nActPos; - - SvxBackgroundTable_Impl() : - pCellBrush(NULL), pRowBrush(NULL), pTableBrush(NULL), - nCellWhich(0), nRowWhich(0), nTableWhich(0) {} -}; - -struct SvxBackgroundPara_Impl -{ - SvxBrushItem* pParaBrush; - SvxBrushItem* pCharBrush; - - sal_uInt16 nActPos; - - SvxBackgroundPara_Impl() : - pParaBrush(NULL), pCharBrush(NULL) {} -}; - -struct SvxBackgroundPage_Impl -{ - Timer* pLoadTimer; - sal_Bool bIsImportDlgInExecute; - - SvxBackgroundPage_Impl() : - pLoadTimer(NULL), bIsImportDlgInExecute(sal_False) {} -}; - -inline sal_uInt8 lcl_PercentToTransparency(long nPercent) -{ - //0xff must not be returned! - return sal_uInt8(nPercent ? (50 + 0xfe * nPercent) / 100 : 0); -} -inline sal_uInt8 lcl_TransparencyToPercent(sal_uInt8 nTrans) -{ - return (nTrans * 100 + 127) / 254; -} -void lcl_SetTransparency(SvxBrushItem& rBrush, long nTransparency) -{ - uno::Any aTransparency; - aTransparency <<= (sal_Int8)nTransparency; - rBrush.PutValue(aTransparency, MID_GRAPHIC_TRANSPARENCY); -} -//------------------------------------------------------------------------- - -sal_uInt16 GetItemId_Impl( ValueSet& rValueSet, const Color& rCol ) -{ - sal_Bool bFound = sal_False; - sal_uInt16 nCount = rValueSet.GetItemCount(); - sal_uInt16 n = 1; - - while ( !bFound && n <= nCount ) - { - Color aValCol = rValueSet.GetItemColor(n); - - bFound = ( aValCol.GetRed() == rCol.GetRed() - && aValCol.GetGreen() == rCol.GetGreen() - && aValCol.GetBlue() == rCol.GetBlue() ); - - if ( !bFound ) - n++; - } - return bFound ? n : 0; -} - -// class BackgroundPreview ----------------------------------------------- - -/* [Beschreibung] - - Vorschaufenster f"ur Brush oder Bitmap -*/ - -class BackgroundPreviewImpl : public Window -{ -public: - BackgroundPreviewImpl( Window* pParent, - const ResId& rResId, sal_Bool bIsBmpPreview ); - ~BackgroundPreviewImpl(); - - void NotifyChange( const Color& rColor ); - void NotifyChange( const Bitmap* pBitmap ); - -protected: - virtual void Paint( const Rectangle& rRect ); - virtual void DataChanged( const DataChangedEvent& rDCEvt ); - -private: - const sal_Bool bIsBmp; - Bitmap* pBitmap; - Point aDrawPos; - Size aDrawSize; - Rectangle aDrawRect; - sal_uInt8 nTransparency; -}; - -//----------------------------------------------------------------------- - -BackgroundPreviewImpl::BackgroundPreviewImpl -( - Window* pParent, - const ResId& rResId, - sal_Bool bIsBmpPreview -) : - - Window( pParent, rResId ), - - bIsBmp ( bIsBmpPreview ), - pBitmap ( NULL ), - aDrawRect( Point(0,0), GetOutputSizePixel() ), - nTransparency(0) - -{ - SetBorderStyle(WINDOW_BORDER_MONO); - Paint( aDrawRect ); -} - -//----------------------------------------------------------------------- - -BackgroundPreviewImpl::~BackgroundPreviewImpl() -{ - delete pBitmap; -} - -//----------------------------------------------------------------------- -void BackgroundPreviewImpl::NotifyChange( const Color& rColor ) -{ - if ( !bIsBmp ) - { - const static Color aTranspCol( COL_TRANSPARENT ); - - nTransparency = lcl_TransparencyToPercent( rColor.GetTransparency() ); - - SetFillColor( rColor == aTranspCol ? GetSettings().GetStyleSettings().GetFieldColor() : (Color) rColor.GetRGBColor() ); - Paint( aDrawRect ); - } -} - -//----------------------------------------------------------------------- - -void BackgroundPreviewImpl::NotifyChange( const Bitmap* pNewBitmap ) -{ - if ( bIsBmp && (pNewBitmap || pBitmap) ) - { - if ( pNewBitmap && pBitmap ) - *pBitmap = *pNewBitmap; - else if ( pNewBitmap && !pBitmap ) - pBitmap = new Bitmap( *pNewBitmap ); - else if ( !pNewBitmap ) - DELETEZ( pBitmap ); - - if ( pBitmap ) - { - Size aSize = GetOutputSizePixel(); - // InnerSize == Size without one pixel border - Size aInnerSize = aSize; - aInnerSize.Width() -= 2; - aInnerSize.Height() -= 2; - aDrawSize = pBitmap->GetSizePixel(); - - // bitmap bigger than preview window? - if ( aDrawSize.Width() > aInnerSize.Width() ) - { - aDrawSize.Height() = aDrawSize.Height() * aInnerSize.Width() / aDrawSize.Width(); - if ( aDrawSize.Height() > aInnerSize.Height() ) - { - aDrawSize.Width() = aDrawSize.Height(); - aDrawSize.Height() = aInnerSize.Height(); - } - else - aDrawSize.Width() = aInnerSize.Width(); - } - else if ( aDrawSize.Height() > aInnerSize.Height() ) - { - aDrawSize.Width() = aDrawSize.Width() * aInnerSize.Height() / aDrawSize.Height(); - if ( aDrawSize.Width() > aInnerSize.Width() ) - { - aDrawSize.Height() = aDrawSize.Width(); - aDrawSize.Width() = aInnerSize.Width(); - } - else - aDrawSize.Height() = aInnerSize.Height(); - } - - aDrawPos.X() = (aSize.Width() - aDrawSize.Width()) / 2; - aDrawPos.Y() = (aSize.Height() - aDrawSize.Height()) / 2; - } - Invalidate( aDrawRect ); - Update(); - } -} - -//----------------------------------------------------------------------- - -void BackgroundPreviewImpl::Paint( const Rectangle& ) -{ - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - SetBackground(Wallpaper(rStyleSettings.GetWindowColor())); - SetLineColor(); - if(bIsBmp) - SetFillColor( Color(COL_TRANSPARENT) ); - DrawRect( aDrawRect ); - if ( bIsBmp ) - { - if ( pBitmap ) - DrawBitmap( aDrawPos, aDrawSize, *pBitmap ); - else - { - Size aSize = GetOutputSizePixel(); - DrawLine( Point(0,0), Point(aSize.Width(),aSize.Height()) ); - DrawLine( Point(0,aSize.Height()), Point(aSize.Width(),0) ); - } - } -} - -void BackgroundPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt ) -{ - if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && - (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - { - Invalidate(); - } - Window::DataChanged( rDCEvt ); -} - -// class SvxBackgroundTabPage -------------------------------------------- - -#define HDL(hdl) LINK(this,SvxBackgroundTabPage,hdl) - -SvxBackgroundTabPage::SvxBackgroundTabPage( Window* pParent, - const SfxItemSet& rCoreSet ) : - - SvxTabPage( pParent, CUI_RES( RID_SVXPAGE_BACKGROUND ), rCoreSet ), - - aSelectTxt ( this, CUI_RES( FT_SELECTOR ) ), - aLbSelect ( this, CUI_RES( LB_SELECTOR ) ), - aStrBrowse ( CUI_RES( STR_BROWSE ) ), - aStrUnlinked ( CUI_RES( STR_UNLINKED ) ), - aTblDesc ( this, CUI_RES( FT_TBL_DESC ) ), - aTblLBox ( this, CUI_RES( LB_TBL_BOX ) ), - aParaLBox ( this, CUI_RES( LB_PARA_BOX ) ), - - aBorderWin ( this, CUI_RES(CT_BORDER) ), - aBackgroundColorSet ( &aBorderWin, CUI_RES( SET_BGDCOLOR ) ), - aBackgroundColorBox ( this, CUI_RES( GB_BGDCOLOR ) ), - pPreviewWin1 ( new BackgroundPreviewImpl( this, CUI_RES( WIN_PREVIEW1 ), sal_False ) ), - - aColTransFT ( this, CUI_RES( FT_COL_TRANS ) ), - aColTransMF ( this, CUI_RES( MF_COL_TRANS ) ), - aBtnPreview ( this, CUI_RES( BTN_PREVIEW ) ), - aGbFile ( this, CUI_RES( GB_FILE ) ), - aBtnBrowse ( this, CUI_RES( BTN_BROWSE ) ), - aBtnLink ( this, CUI_RES( BTN_LINK ) ), - aGbPosition ( this, CUI_RES( GB_POSITION ) ), - aBtnPosition ( this, CUI_RES( BTN_POSITION ) ), - aBtnArea ( this, CUI_RES( BTN_AREA ) ), - aBtnTile ( this, CUI_RES( BTN_TILE ) ), - aWndPosition ( this, CUI_RES( WND_POSITION ), RP_MM ), - aFtFile ( this, CUI_RES( FT_FILE ) ), - aGraphTransFL ( this, CUI_RES( FL_GRAPH_TRANS ) ), - aGraphTransMF ( this, CUI_RES( MF_GRAPH_TRANS ) ), - pPreviewWin2 ( new BackgroundPreviewImpl( - this, CUI_RES( WIN_PREVIEW2 ), sal_True ) ), - - nHtmlMode ( 0 ), - bAllowShowSelector ( sal_True ), - bIsGraphicValid ( sal_False ), - bLinkOnly ( sal_False ), - bResized ( sal_False ), - bColTransparency ( sal_False ), - bGraphTransparency ( sal_False ), - - pPageImpl ( new SvxBackgroundPage_Impl ), - pImportDlg ( NULL ), - pTableBck_Impl ( NULL ), - pParaBck_Impl ( NULL ) - -{ - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - const SfxPoolItem* pItem; - SfxObjectShell* pShell; - - if ( SFX_ITEM_SET == rCoreSet.GetItemState( SID_HTML_MODE, sal_False, &pItem ) - || ( 0 != ( pShell = SfxObjectShell::Current()) && - 0 != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) ) - { - nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue(); - } - - FillColorValueSets_Impl(); - - aBackgroundColorSet.SetSelectHdl( HDL(BackgroundColorHdl_Impl) ); - FreeResource(); - - aBtnBrowse.SetAccessibleRelationMemberOf(&aGbFile); - aWndPosition.SetAccessibleRelationMemberOf(&aGbPosition); - aWndPosition.SetAccessibleRelationLabeledBy(&aBtnPosition); - aBackgroundColorSet.SetAccessibleRelationLabeledBy(&aBackgroundColorBox); -} - -//------------------------------------------------------------------------ - -SvxBackgroundTabPage::~SvxBackgroundTabPage() -{ - delete pPreviewWin1; - delete pPreviewWin2; - delete pPageImpl->pLoadTimer; - delete pPageImpl; - delete pImportDlg; - - if( pTableBck_Impl) - { - delete pTableBck_Impl->pCellBrush; - delete pTableBck_Impl->pRowBrush; - delete pTableBck_Impl->pTableBrush; - delete pTableBck_Impl; - } - - if(pParaBck_Impl) - { - delete pParaBck_Impl->pParaBrush; - delete pParaBck_Impl->pCharBrush; - delete pParaBck_Impl; - } -} - -//------------------------------------------------------------------------ - -sal_uInt16* SvxBackgroundTabPage::GetRanges() - -/* [Beschreibung] - - gibt den Bereich der Which-Werte zur"uck -*/ - -{ - return pRanges; -} - -//------------------------------------------------------------------------ - -SfxTabPage* SvxBackgroundTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet ) - -/* [Beschreibung] - - Create-Methode f"ur den TabDialog -*/ - -{ - return ( new SvxBackgroundTabPage( pParent, rAttrSet ) ); -} - -//------------------------------------------------------------------------ - -void SvxBackgroundTabPage::Reset( const SfxItemSet& rSet ) -{ -// os: So ein Unsinn! Irgendwo laesst sich so ein Item immer finden, -// es muss aber im rSet vorhanden sein! -// const SfxPoolItem* pX = GetOldItem( rSet, SID_VIEW_FLD_PIC ); -// if( pX && pX->ISA(SfxWallpaperItem)) - if(SFX_ITEM_AVAILABLE <= rSet.GetItemState(GetWhich(SID_VIEW_FLD_PIC), sal_False)) - { - ResetFromWallpaperItem( rSet ); - return; - } - - // Zustand des Vorschau-Buttons durch UserData persistent - String aUserData = GetUserData(); - aBtnPreview.Check( aUserData.Len() && sal_Unicode('1') == aUserData.GetChar( 0 ) ); - - // nach Reset kein ShowSelector() mehr aufrufen d"urfen - bAllowShowSelector = sal_False; - - - // Input-BrushItem besorgen und auswerten - const SvxBrushItem* pBgdAttr = NULL; - sal_uInt16 nSlot = SID_ATTR_BRUSH; - const SfxPoolItem* pItem; - sal_uInt16 nDestValue = USHRT_MAX; - - if ( SFX_ITEM_SET == rSet.GetItemState( SID_BACKGRND_DESTINATION, - sal_False, &pItem ) ) - { - nDestValue = ((const SfxUInt16Item*)pItem)->GetValue(); - aTblLBox.SelectEntryPos(nDestValue); - - switch ( nDestValue ) - { - case TBL_DEST_CELL: - nSlot = SID_ATTR_BRUSH; - break; - case TBL_DEST_ROW: - nSlot = SID_ATTR_BRUSH_ROW; - break; - case TBL_DEST_TBL: - nSlot = SID_ATTR_BRUSH_TABLE; - break; - } - } - else if( SFX_ITEM_SET == rSet.GetItemState( - SID_PARA_BACKGRND_DESTINATION, sal_False, &pItem ) ) - { - nDestValue = ((const SfxUInt16Item*)pItem)->GetValue(); - // ist gerade Zeichen aktiviert? - sal_uInt16 nParaSel = aParaLBox.GetSelectEntryPos(); - if(1 == nParaSel) - { - // dann war das ein "Standard" - Aufruf - nDestValue = nParaSel; - } - aParaLBox.SelectEntryPos(nDestValue); - - switch ( nDestValue ) - { - case PARA_DEST_PARA: - nSlot = SID_ATTR_BRUSH; - break; - case PARA_DEST_CHAR: - nSlot = SID_ATTR_BRUSH_CHAR; - break; - } - } - //#111173# the destination item is missing when the parent style has been changed - if(USHRT_MAX == nDestValue && (aParaLBox.IsVisible()||aTblLBox.IsVisible())) - nDestValue = 0; - sal_uInt16 nWhich = GetWhich( nSlot ); - - if ( rSet.GetItemState( nWhich, sal_False ) >= SFX_ITEM_AVAILABLE ) - pBgdAttr = (const SvxBrushItem*)&( rSet.Get( nWhich ) ); - - aBtnTile.Check(); - - if ( pBgdAttr ) - { - FillControls_Impl(*pBgdAttr, aUserData); - aBgdColor = ( (SvxBrushItem*)pBgdAttr )->GetColor(); - } - else - { - aSelectTxt.Hide(); - aLbSelect.Hide(); - aLbSelect.SelectEntryPos( 0 ); - ShowColorUI_Impl(); - - const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_BRUSH ); - - if ( pOld ) - aBgdColor = ( (SvxBrushItem*)pOld )->GetColor(); - } - - if ( nDestValue != USHRT_MAX ) - { - if(aTblLBox.IsVisible()) - { - sal_uInt16 nValue = aTblLBox.GetSelectEntryPos(); - - if ( pTableBck_Impl ) - { - DELETEZ( pTableBck_Impl->pCellBrush); - DELETEZ( pTableBck_Impl->pRowBrush); - DELETEZ( pTableBck_Impl->pTableBrush); - } - else - pTableBck_Impl = new SvxBackgroundTable_Impl(); - - pTableBck_Impl->nActPos = nValue; - - nWhich = GetWhich( SID_ATTR_BRUSH ); - if ( rSet.GetItemState( nWhich, sal_False ) >= SFX_ITEM_AVAILABLE ) - { - pBgdAttr = (const SvxBrushItem*)&( rSet.Get( nWhich ) ); - pTableBck_Impl->pCellBrush = new SvxBrushItem(*pBgdAttr); - } - pTableBck_Impl->nCellWhich = nWhich; - - if ( rSet.GetItemState( SID_ATTR_BRUSH_ROW, sal_False ) >= SFX_ITEM_AVAILABLE ) - { - pBgdAttr = (const SvxBrushItem*)&( rSet.Get( SID_ATTR_BRUSH_ROW ) ); - pTableBck_Impl->pRowBrush = new SvxBrushItem(*pBgdAttr); - } - pTableBck_Impl->nRowWhich = SID_ATTR_BRUSH_ROW; - - if ( rSet.GetItemState( SID_ATTR_BRUSH_TABLE, sal_False ) >= SFX_ITEM_AVAILABLE ) - { - pBgdAttr = (const SvxBrushItem*)&( rSet.Get( SID_ATTR_BRUSH_TABLE ) ); - pTableBck_Impl->pTableBrush = new SvxBrushItem(*pBgdAttr); - } - pTableBck_Impl->nTableWhich = SID_ATTR_BRUSH_TABLE; - - TblDestinationHdl_Impl(&aTblLBox); - aTblLBox.SaveValue(); - } - else - { - sal_uInt16 nValue = aParaLBox.GetSelectEntryPos(); - - if ( pParaBck_Impl ) - { - delete pParaBck_Impl->pParaBrush; - delete pParaBck_Impl->pCharBrush; - } - else - pParaBck_Impl = new SvxBackgroundPara_Impl(); - - pParaBck_Impl->nActPos = nValue; - - nWhich = GetWhich( SID_ATTR_BRUSH ); - if ( rSet.GetItemState( nWhich, sal_False ) >= SFX_ITEM_AVAILABLE ) - { - pBgdAttr = (const SvxBrushItem*)&( rSet.Get( nWhich ) ); - pParaBck_Impl->pParaBrush = new SvxBrushItem(*pBgdAttr); - } - - nWhich = GetWhich( SID_ATTR_BRUSH_CHAR ); - rSet.GetItemState( nWhich, sal_True ); - rSet.GetItemState( nWhich, sal_False ); - if ( rSet.GetItemState( nWhich, sal_True ) > SFX_ITEM_AVAILABLE ) - { - pBgdAttr = (const SvxBrushItem*)&( rSet.Get( nWhich ) ); - pParaBck_Impl->pCharBrush = new SvxBrushItem(*pBgdAttr); - } - else - pParaBck_Impl->pCharBrush = new SvxBrushItem(SID_ATTR_BRUSH_CHAR); - - ParaDestinationHdl_Impl(&aParaLBox); - aParaLBox.SaveValue(); - } - } - if(!bResized) - { - if(!aLbSelect.IsVisible() && !aTblLBox.IsVisible() && !aParaLBox.IsVisible()) - { - long nY(LogicToPixel(Point(11,14), MAP_APPFONT).X()); - long nX(LogicToPixel(Point(11,14), MAP_APPFONT).Y()); - Point aPos(aBorderWin.GetPosPixel()); - aPos.X() = nX; - aPos.Y() = nY; - aBorderWin.SetPosPixel(aPos); - aPos = pPreviewWin1->GetPosPixel(); - aPos.Y() = nY; - pPreviewWin1->SetPosPixel(aPos); - aBackgroundColorBox.Hide(); - aBackgroundColorSet.SetAccessibleRelationLabeledBy(&aBackgroundColorSet); - } - } -} - -void SvxBackgroundTabPage::ResetFromWallpaperItem( const SfxItemSet& rSet ) -{ - ShowSelector(); - - // Zustand des Vorschau-Buttons durch UserData persistent - String aUserData = GetUserData(); - aBtnPreview.Check( aUserData.Len() && sal_Unicode('1') == aUserData.GetChar( 0 ) ); - - // Input-BrushItem besorgen und auswerten - const SvxBrushItem* pBgdAttr = NULL; - sal_uInt16 nSlot = SID_VIEW_FLD_PIC; - sal_uInt16 nWhich = GetWhich( nSlot ); - SvxBrushItem* pTemp = 0; - const CntWallpaperItem* pItem = 0; - - if ( rSet.GetItemState( nWhich, sal_False ) >= SFX_ITEM_AVAILABLE ) - { - pItem = (const CntWallpaperItem*)&rSet.Get( nWhich ); - pTemp = new SvxBrushItem( *pItem, nWhich ); - pBgdAttr = pTemp; - } - - aBtnTile.Check(); - - if ( pBgdAttr ) - { - FillControls_Impl(*pBgdAttr, aUserData); - // Auch bei Anzeige der Grafik, soll die Brush erhalten bleiben - if( aBgdColor != pBgdAttr->GetColor() ) - { - aBgdColor = pBgdAttr->GetColor(); - sal_uInt16 nCol = GetItemId_Impl( aBackgroundColorSet, aBgdColor ); - aBackgroundColorSet.SelectItem( nCol ); - pPreviewWin1->NotifyChange( aBgdColor ); - } - } - else - { - aLbSelect.SelectEntryPos( 0 ); - ShowColorUI_Impl(); - - const SfxPoolItem* pOld = GetOldItem( rSet, SID_VIEW_FLD_PIC ); - if ( pOld ) - aBgdColor = Color( ((CntWallpaperItem*)pOld)->GetColor() ); - } - - // We now have always a link to the background - bLinkOnly = sal_True; - aBtnLink.Check( sal_True ); - aBtnLink.Show( sal_False ); -// if( !pItem || !pItem->GetWallpaper(sal_False).IsBitmap() ) -// aBtnLink.Check(); - - delete pTemp; -} - - - -//------------------------------------------------------------------------ - -void SvxBackgroundTabPage::FillUserData() - -/* [Beschreibung] - - Beim Destruieren einer SfxTabPage wird diese virtuelle Methode gerufen, - damit die TabPage interne Informationen sichern kann. - - In diesem Fall wird der Zustand des Vorschau-Buttons gesichert. -*/ - -{ - SetUserData( String( aBtnPreview.IsChecked() ? sal_Unicode('1') : sal_Unicode('0') ) ); -} - -//------------------------------------------------------------------------ - -sal_Bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet ) -{ - if ( pPageImpl->pLoadTimer && pPageImpl->pLoadTimer->IsActive() ) - { - pPageImpl->pLoadTimer->Stop(); - LoadTimerHdl_Impl( pPageImpl->pLoadTimer ); - } -// os: So ein Unsinn! Irgendwo laesst sich so ein Item immer finden, -// es muss aber im rSet vorhanden sein! - -// const SfxPoolItem* pX = GetOldItem( rCoreSet, SID_VIEW_FLD_PIC ); -// if( pX && pX->ISA(SfxWallpaperItem)) - if(SFX_ITEM_AVAILABLE <= rCoreSet.GetItemState(GetWhich(SID_VIEW_FLD_PIC), sal_False)) - return FillItemSetWithWallpaperItem( rCoreSet, SID_VIEW_FLD_PIC ); - - sal_Bool bModified = sal_False; - sal_uInt16 nSlot = SID_ATTR_BRUSH; - - if ( aTblLBox.IsVisible() ) - { - switch( aTblLBox.GetSelectEntryPos() ) - { - case TBL_DEST_CELL: - nSlot = SID_ATTR_BRUSH; - break; - case TBL_DEST_ROW: - nSlot = SID_ATTR_BRUSH_ROW; - break; - case TBL_DEST_TBL: - nSlot = SID_ATTR_BRUSH_TABLE; - break; - } - } - else if(aParaLBox.GetData() == &aParaLBox) - { - switch(aParaLBox.GetSelectEntryPos()) - { - case PARA_DEST_PARA: - nSlot = SID_ATTR_BRUSH; - break; - case PARA_DEST_CHAR: - nSlot = SID_ATTR_BRUSH_CHAR; - break; - } - } - sal_uInt16 nWhich = GetWhich( nSlot ); - - const SfxPoolItem* pOld = GetOldItem( rCoreSet, nSlot ); - SfxItemState eOldItemState = rCoreSet.GetItemState(nSlot, sal_False); - const SfxItemSet& rOldSet = GetItemSet(); - - sal_Bool bGraphTransparencyChanged = bGraphTransparency && (aGraphTransMF.GetText() != aGraphTransMF.GetSavedValue()); - if ( pOld ) - { - const SvxBrushItem& rOldItem = (const SvxBrushItem&)*pOld; - SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos(); - const sal_Bool bIsBrush = ( 0 == aLbSelect.GetSelectEntryPos() ); - - // transparency has to be set if enabled, the color not already set to "No fill" and - if( bColTransparency && - aBgdColor.GetTransparency() < 0xff) - { - aBgdColor.SetTransparency(lcl_PercentToTransparency(static_cast<long>(aColTransMF.GetValue()))); - } - if ( ( (GPOS_NONE == eOldPos) && bIsBrush ) - || ( (GPOS_NONE != eOldPos) && !bIsBrush ) ) // Brush <-> Bitmap gewechselt? - { - // Hintergrund-Art wurde nicht gewechselt: - - if ( (GPOS_NONE == eOldPos) || !aLbSelect.IsVisible() ) - { - // Brush-Behandlung: - if ( rOldItem.GetColor() != aBgdColor || - (SFX_ITEM_AVAILABLE >= eOldItemState && !aBackgroundColorSet.IsNoSelection())) - { - bModified = sal_True; - rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) ); - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - rCoreSet.ClearItem( nWhich ); - } - else - { - // Bitmap-Behandlung: - - SvxGraphicPosition eNewPos = GetGraphicPosition_Impl(); - const sal_Bool bIsLink = aBtnLink.IsChecked(); - const sal_Bool bWasLink = (NULL != rOldItem.GetGraphicLink() ); - - - if ( !bIsLink && !bIsGraphicValid ) - bIsGraphicValid = LoadLinkedGraphic_Impl(); - - if ( bGraphTransparencyChanged || - eNewPos != eOldPos - || bIsLink != bWasLink - || ( bWasLink && *rOldItem.GetGraphicLink() - != aBgdGraphicPath ) - || ( !bWasLink && rOldItem.GetGraphic()->GetBitmap() - != aBgdGraphic.GetBitmap() ) - ) - { - bModified = sal_True; - - SvxBrushItem aTmpBrush(nWhich); - if ( bIsLink ) - { - aTmpBrush = SvxBrushItem( aBgdGraphicPath, - aBgdGraphicFilter, - eNewPos, - nWhich ); - } - else - aTmpBrush = SvxBrushItem( aBgdGraphic, - eNewPos, - nWhich ); - lcl_SetTransparency(aTmpBrush, static_cast<long>(aGraphTransMF.GetValue())); - - rCoreSet.Put(aTmpBrush); - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - rCoreSet.ClearItem( nWhich ); - } - } - else // Brush <-> Bitmap gewechselt! - { - if ( bIsBrush ) - rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) ); - else - { - SvxBrushItem* pTmpBrush = 0; - if ( aBtnLink.IsChecked() ) - { - pTmpBrush = new SvxBrushItem( aBgdGraphicPath, - aBgdGraphicFilter, - GetGraphicPosition_Impl(), - nWhich ); - } - else - { - if ( !bIsGraphicValid ) - bIsGraphicValid = LoadLinkedGraphic_Impl(); - - if ( bIsGraphicValid ) - pTmpBrush = new SvxBrushItem( aBgdGraphic, - GetGraphicPosition_Impl(), - nWhich ); - } - if(pTmpBrush) - { - lcl_SetTransparency(*pTmpBrush, static_cast<long>(aGraphTransMF.GetValue())); - rCoreSet.Put(*pTmpBrush); - delete pTmpBrush; - } - } - bModified = ( bIsBrush || aBtnLink.IsChecked() || bIsGraphicValid ); - } - } - else if ( SID_ATTR_BRUSH_CHAR == nSlot && aBgdColor != Color( COL_WHITE ) ) - { - rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) ); - bModified = sal_True; - } - - if( aTblLBox.IsVisible() ) - { - // Der aktuelle Zustand wurde bereits geputtet - if( nSlot != SID_ATTR_BRUSH && pTableBck_Impl->pCellBrush) - { - const SfxPoolItem* pOldCell = - GetOldItem( rCoreSet, SID_ATTR_BRUSH ); - - if ( *pTableBck_Impl->pCellBrush != *pOldCell ) - { - rCoreSet.Put( *pTableBck_Impl->pCellBrush ); - bModified |= sal_True; - } - } - - if( nSlot != SID_ATTR_BRUSH_ROW && pTableBck_Impl->pRowBrush) - { - const SfxPoolItem* pOldRow = - GetOldItem( rCoreSet, SID_ATTR_BRUSH_ROW ); - - if ( *pTableBck_Impl->pRowBrush != *pOldRow ) - { - rCoreSet.Put( *pTableBck_Impl->pRowBrush ); - bModified |= sal_True; - } - } - - if( nSlot != SID_ATTR_BRUSH_TABLE && pTableBck_Impl->pTableBrush) - { - const SfxPoolItem* pOldTable = - GetOldItem( rCoreSet, SID_ATTR_BRUSH_TABLE ); - - if ( *pTableBck_Impl->pTableBrush != *pOldTable ) - { - rCoreSet.Put( *pTableBck_Impl->pTableBrush ); - bModified |= sal_True; - } - } - - if( aTblLBox.GetSavedValue() != aTblLBox.GetSelectEntryPos() ) - { - rCoreSet.Put( SfxUInt16Item( SID_BACKGRND_DESTINATION, - aTblLBox.GetSelectEntryPos() ) ); - bModified |= sal_True; - } - } - else if(aParaLBox.GetData() == &aParaLBox) - { - // Der aktuelle Zustand wurde bereits geputtet - if( nSlot != SID_ATTR_BRUSH && aParaLBox.IsVisible()) // nicht im Suchen-Format-Dialog - { - const SfxPoolItem* pOldPara = - GetOldItem( rCoreSet, SID_ATTR_BRUSH ); - - if ( *pParaBck_Impl->pParaBrush != *pOldPara ) - { - rCoreSet.Put( *pParaBck_Impl->pParaBrush ); - bModified |= sal_True; - } - } - - if( nSlot != SID_ATTR_BRUSH_CHAR ) - { - const SfxPoolItem* pOldChar = - GetOldItem( rCoreSet, SID_ATTR_BRUSH_CHAR ); - DBG_ASSERT(pParaBck_Impl, "pParaBck_Impl == NULL ?"); - if ( pOldChar && - //#111173# crash report shows that pParaBck_Impl can be NULL, the cause is unknown - pParaBck_Impl && - (*pParaBck_Impl->pCharBrush != *pOldChar || - *pParaBck_Impl->pCharBrush != SvxBrushItem(SID_ATTR_BRUSH_CHAR))) - { - rCoreSet.Put( *pParaBck_Impl->pCharBrush ); - bModified |= sal_True; - } - } - - if( aParaLBox.GetSavedValue() != aParaLBox.GetSelectEntryPos() ) - { - rCoreSet.Put( SfxUInt16Item( SID_BACKGRND_DESTINATION, - aParaLBox.GetSelectEntryPos() ) ); - bModified |= sal_True; - } - } - return bModified; -} - -sal_Bool SvxBackgroundTabPage::FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, sal_uInt16 nSlot) -{ - sal_uInt16 nWhich = GetWhich( nSlot ); - const SfxPoolItem* pOld = GetOldItem( rCoreSet, nSlot ); - const SfxItemSet& rOldSet = GetItemSet(); - DBG_ASSERT(pOld,"FillItemSetWithWallpaperItem: Item not found"); - - SvxBrushItem rOldItem( (const CntWallpaperItem&)*pOld, nWhich ); - SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos(); - const sal_Bool bIsBrush = ( 0 == aLbSelect.GetSelectEntryPos() ); - sal_Bool bModified = sal_False; - - if ( ( (GPOS_NONE == eOldPos) && bIsBrush ) - || ( (GPOS_NONE != eOldPos) && !bIsBrush ) ) // Brush <-> Bitmap gewechselt? - { - // Hintergrund-Art wurde nicht gewechselt: - - if ( (GPOS_NONE == eOldPos) || !aLbSelect.IsVisible() ) - { - // Brush-Behandlung: - if ( rOldItem.GetColor() != aBgdColor ) - { - bModified = sal_True; - CntWallpaperItem aItem( nWhich ); - aItem.SetColor( aBgdColor ); - rCoreSet.Put( aItem ); - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - rCoreSet.ClearItem( nWhich ); - } - else - { - // Bitmap-Behandlung: - SvxGraphicPosition eNewPos = GetGraphicPosition_Impl(); - - int bBitmapChanged = ( ( eNewPos != eOldPos ) || - ( *rOldItem.GetGraphicLink() != aBgdGraphicPath ) ); - int bBrushChanged = ( rOldItem.GetColor() != aBgdColor ); - if( bBitmapChanged || bBrushChanged ) - { - bModified = sal_True; - - CntWallpaperItem aItem( nWhich ); - WallpaperStyle eWallStyle = SvxBrushItem::GraphicPos2WallpaperStyle(eNewPos); - aItem.SetStyle( sal::static_int_cast< sal_uInt16 >( eWallStyle ) ); - aItem.SetColor( aBgdColor ); - aItem.SetBitmapURL( aBgdGraphicPath ); - rCoreSet.Put( aItem ); - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - rCoreSet.ClearItem( nWhich ); - } - } - else // Brush <-> Bitmap gewechselt! - { - CntWallpaperItem aItem( nWhich ); - if ( bIsBrush ) - { - aItem.SetColor( aBgdColor ); - rCoreSet.Put( aItem ); - } - else - { - WallpaperStyle eWallStyle = - SvxBrushItem::GraphicPos2WallpaperStyle( GetGraphicPosition_Impl() ); - aItem.SetStyle( sal::static_int_cast< sal_uInt16 >( eWallStyle ) ); - aItem.SetColor( aBgdColor ); - aItem.SetBitmapURL( aBgdGraphicPath ); - rCoreSet.Put( aItem ); - } - - bModified = sal_True; - } - return bModified; -} - -//----------------------------------------------------------------------- - -int SvxBackgroundTabPage::DeactivatePage( SfxItemSet* _pSet ) - -/* [Beschreibung] - - virtuelle Methode, wird beim Deaktivieren gerufen -*/ - -{ - if ( pPageImpl->bIsImportDlgInExecute ) - return KEEP_PAGE; - - if ( _pSet ) - FillItemSet( *_pSet ); - - return LEAVE_PAGE; -} - -//----------------------------------------------------------------------- - -void SvxBackgroundTabPage::PointChanged( Window* , RECT_POINT ) -{ - // muss implementiert werden, damit Position-Control funktioniert -} - -//----------------------------------------------------------------------- - -void SvxBackgroundTabPage::ShowSelector() -{ - if( bAllowShowSelector) - { - aSelectTxt.Show(); - aLbSelect.Show(); - aLbSelect.SetSelectHdl( HDL(SelectHdl_Impl) ); - aBtnLink.SetClickHdl( HDL(FileClickHdl_Impl) ); - aBtnPreview.SetClickHdl( HDL(FileClickHdl_Impl) ); - aBtnBrowse.SetClickHdl( HDL(BrowseHdl_Impl) ); - aBtnArea.SetClickHdl( HDL(RadioClickHdl_Impl) ); - aBtnTile.SetClickHdl( HDL(RadioClickHdl_Impl) ); - aBtnPosition.SetClickHdl( HDL(RadioClickHdl_Impl) ); - - // Verz"ogertes Laden "uber Timer (wg. UI-Update) - pPageImpl->pLoadTimer = new Timer; - pPageImpl->pLoadTimer->SetTimeout( 500 ); // 500ms verz"ogern - pPageImpl->pLoadTimer->SetTimeoutHdl( - LINK( this, SvxBackgroundTabPage, LoadTimerHdl_Impl ) ); - - bAllowShowSelector = sal_False; - - if(nHtmlMode & HTMLMODE_ON) - { - if(!(nHtmlMode & HTMLMODE_GRAPH_POS)) - aBtnPosition.Enable(sal_False); - aBtnArea.Enable(sal_False); - } - } -} - -//------------------------------------------------------------------------ - - -void SvxBackgroundTabPage::RaiseLoadError_Impl() -{ - SfxErrorContext aContext( ERRCTX_SVX_BACKGROUND, - String(), - this, - RID_SVXERRCTX, - &CUI_MGR() ); - - ErrorHandler::HandleError( - *new StringErrorInfo( ERRCODE_SVX_GRAPHIC_NOTREADABLE, - aBgdGraphicPath ) ); -} - -//------------------------------------------------------------------------ - -sal_Bool SvxBackgroundTabPage::LoadLinkedGraphic_Impl() -{ - sal_Bool bResult = ( aBgdGraphicPath.Len() > 0 ) && - ( GRFILTER_OK == GraphicFilter::LoadGraphic( aBgdGraphicPath, - aBgdGraphicFilter, - aBgdGraphic ) ); - return bResult; -} - -//------------------------------------------------------------------------ - - -void SvxBackgroundTabPage::FillColorValueSets_Impl() - -/* [Beschreibung] - - F"ullen des Farb-Sets -*/ - -{ - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - const SfxPoolItem* pItem = NULL; - XColorTable* pColorTable = NULL; - const Size aSize15x15 = Size( 15, 15 ); - bool bOwn = false; - - if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) ) - pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); - - if ( !pColorTable ) - { - bOwn = true; - pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() ); - } - - if ( pColorTable ) - { - short i = 0; - long nCount = pColorTable->Count(); - XColorEntry* pEntry = NULL; - Color aColWhite( COL_WHITE ); - String aStrWhite( EditResId( RID_SVXITEMS_COLOR_WHITE ) ); - WinBits nBits = ( aBackgroundColorSet.GetStyle() | WB_ITEMBORDER | WB_NAMEFIELD | WB_NONEFIELD ); - aBackgroundColorSet.SetText( SVX_RESSTR( RID_SVXSTR_TRANSPARENT ) ); - aBackgroundColorSet.SetStyle( nBits ); - aBackgroundColorSet.SetAccessibleName(aBackgroundColorBox.GetText()); - for ( i = 0; i < nCount; i++ ) - { - pEntry = pColorTable->GetColor(i); - aBackgroundColorSet.InsertItem( i + 1, pEntry->GetColor(), pEntry->GetName() ); - } - - while ( i < 104 ) - { - aBackgroundColorSet.InsertItem( i + 1, aColWhite, aStrWhite ); - i++; - } - - if ( nCount > 104 ) - { - aBackgroundColorSet.SetStyle( nBits | WB_VSCROLL ); - } - } - - if ( bOwn ) - delete pColorTable; - - aBackgroundColorSet.SetColCount( 8 ); - aBackgroundColorSet.SetLineCount( 13 ); - aBackgroundColorSet.CalcWindowSizePixel( aSize15x15 ); - -} - -//------------------------------------------------------------------------ - - - -//------------------------------------------------------------------------ - -void SvxBackgroundTabPage::ShowColorUI_Impl() - -/* [Beschreibung] - - Die Controls f"ur das Einstellen der Grafik ausblenden und die - Controls f"ur die Farbeinstellung einblenden. -*/ - -{ - if( !aBackgroundColorSet.IsVisible() ) - { - aBackgroundColorSet.Show(); - aBackgroundColorBox.Show(); - aBorderWin.Show(); - pPreviewWin1->Show(); - aBtnBrowse.Hide(); - aFtFile.Hide(); - aBtnLink.Hide(); - aBtnPreview.Hide(); - aGbFile.Hide(); - aBtnPosition.Hide(); - aBtnArea.Hide(); - aBtnTile.Hide(); - aWndPosition.Hide(); - aGbPosition.Hide(); - pPreviewWin2->Hide(); - aGraphTransFL.Show(sal_False); - aGraphTransMF.Show(sal_False); - if(bColTransparency) - { - aColTransFT.Show(); - aColTransMF.Show(); - } - } -} - -//------------------------------------------------------------------------ - -void SvxBackgroundTabPage::ShowBitmapUI_Impl() - -/* [Beschreibung] - - Die Controls f"ur die Farbeinstellung ausblenden und die - Controls f"ur das Einstellen der Grafik einblenden. -*/ - -{ - if ( aLbSelect.IsVisible() && - ( - aBackgroundColorSet.IsVisible() - || !aBtnBrowse.IsVisible() ) ) - { - aBackgroundColorSet.Hide(); - aBackgroundColorBox.Hide(); - aBorderWin.Hide(); - pPreviewWin1->Hide(); - aBtnBrowse.Show(); - aFtFile.Show(); - - if ( !bLinkOnly && ! nHtmlMode & HTMLMODE_ON ) - aBtnLink.Show(); - aBtnPreview.Show(); - aGbFile.Show(); - aBtnPosition.Show(); - aBtnArea.Show(); - aBtnTile.Show(); - aWndPosition.Show(); - aGbPosition.Show(); - pPreviewWin2->Show(); - if(bGraphTransparency) - { - aGraphTransFL.Show(); - aGraphTransMF.Show(); - } - aColTransFT.Show(sal_False); - aColTransMF.Show(sal_False); - } -} - -//------------------------------------------------------------------------ - -void SvxBackgroundTabPage::SetGraphicPosition_Impl( SvxGraphicPosition ePos ) - -/* [Beschreibung] - - Die Controls f"ur die Grafikposition einstellen. -*/ - -{ - switch ( ePos ) - { - case GPOS_AREA: - { - aBtnArea.Check(); - aWndPosition.Disable(); - } - break; - - case GPOS_TILED: - { - aBtnTile.Check(); - aWndPosition.Disable(); - } - break; - - default: - { - aBtnPosition.Check(); - aWndPosition.Enable(); - RECT_POINT eNewPos = RP_MM; - - switch ( ePos ) - { - case GPOS_MM: break; - case GPOS_LT: eNewPos = RP_LT; break; - case GPOS_MT: eNewPos = RP_MT; break; - case GPOS_RT: eNewPos = RP_RT; break; - case GPOS_LM: eNewPos = RP_LM; break; - case GPOS_RM: eNewPos = RP_RM; break; - case GPOS_LB: eNewPos = RP_LB; break; - case GPOS_MB: eNewPos = RP_MB; break; - case GPOS_RB: eNewPos = RP_RB; break; - default: ;//prevent warning - } - aWndPosition.SetActualRP( eNewPos ); - } - break; - } - aWndPosition.Invalidate(); -} - -//------------------------------------------------------------------------ - -SvxGraphicPosition SvxBackgroundTabPage::GetGraphicPosition_Impl() - -/* [Beschreibung] - - Die Position der Grafik zur"uckgeben. -*/ - -{ - if ( aBtnTile.IsChecked() ) - return GPOS_TILED; - else if ( aBtnArea.IsChecked() ) - return GPOS_AREA; - else - { - switch ( aWndPosition.GetActualRP() ) - { - case RP_LT: return GPOS_LT; - case RP_MT: return GPOS_MT; - case RP_RT: return GPOS_RT; - case RP_LM: return GPOS_LM; - case RP_MM: return GPOS_MM; - case RP_RM: return GPOS_RM; - case RP_LB: return GPOS_LB; - case RP_MB: return GPOS_MB; - case RP_RB: return GPOS_RB; - } - } - return GPOS_MM; -} - -//----------------------------------------------------------------------- -// Handler -//----------------------------------------------------------------------- - -IMPL_LINK( SvxBackgroundTabPage, BackgroundColorHdl_Impl, ValueSet*, EMPTYARG ) -/* - Handler, called when color selection is changed -*/ -{ - sal_uInt16 nItemId = aBackgroundColorSet.GetSelectItemId(); - Color aColor = nItemId ? ( aBackgroundColorSet.GetItemColor( nItemId ) ) : Color( COL_TRANSPARENT ); - aBgdColor = aColor; - pPreviewWin1->NotifyChange( aBgdColor ); - sal_Bool bEnableTransp = aBgdColor.GetTransparency() < 0xff; - aColTransFT.Enable(bEnableTransp); - aColTransMF.Enable(bEnableTransp); - return 0; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBackgroundTabPage, SelectHdl_Impl, ListBox*, EMPTYARG ) -{ - if ( 0 == aLbSelect.GetSelectEntryPos() ) - { - ShowColorUI_Impl(); - aParaLBox.Enable(); // Zeichenhintergrund kann keine Bitmap sein - } - else - { - ShowBitmapUI_Impl(); - aParaLBox.Enable(sal_False);// Zeichenhintergrund kann keine Bitmap sein - } - return 0; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBackgroundTabPage, FileClickHdl_Impl, CheckBox*, pBox ) -{ - if ( &aBtnLink == pBox ) - { - if ( aBtnLink.IsChecked() ) - { - INetURLObject aObj( aBgdGraphicPath ); - String aFilePath; - if ( aObj.GetProtocol() == INET_PROT_FILE ) - aFilePath = aObj.getFSysPath( INetURLObject::FSYS_DETECT ); - else - aFilePath = aBgdGraphicPath; - aFtFile.SetText( aFilePath ); - } - else - aFtFile.SetText( aStrUnlinked ); - } - else if ( &aBtnPreview == pBox ) - { - if ( aBtnPreview.IsChecked() ) - { - if ( !bIsGraphicValid ) - bIsGraphicValid = LoadLinkedGraphic_Impl(); - - if ( bIsGraphicValid ) - { - Bitmap aBmp = aBgdGraphic.GetBitmap(); - pPreviewWin2->NotifyChange( &aBmp ); - } - else - { - if ( aBgdGraphicPath.Len() > 0 ) // nur bei gelinkter Grafik - RaiseLoadError_Impl(); // ein Fehler - pPreviewWin2->NotifyChange( NULL ); - } - } - else - pPreviewWin2->NotifyChange( NULL ); - } - return 0; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBackgroundTabPage, RadioClickHdl_Impl, RadioButton*, pBtn ) -{ - if ( pBtn == &aBtnPosition ) - { - if ( !aWndPosition.IsEnabled() ) - { - aWndPosition.Enable(); - aWndPosition.Invalidate(); - } - } - else if ( aWndPosition.IsEnabled() ) - { - aWndPosition.Disable(); - aWndPosition.Invalidate(); - } - return 0; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBackgroundTabPage, BrowseHdl_Impl, PushButton* , EMPTYARG ) - -/* [Beschreibung] - - Handler, gerufen durch das Dr"ucken des Durchsuchen-Buttons. - Grafik/Einf"ugen-Dialog erzeugen, Pfad setzen und starten. -*/ - -{ - if ( pPageImpl->pLoadTimer->IsActive() ) - return 0; - sal_Bool bHtml = 0 != ( nHtmlMode & HTMLMODE_ON ); - - pImportDlg = new SvxOpenGraphicDialog( aStrBrowse ); - if ( bHtml || bLinkOnly ) - pImportDlg->EnableLink(sal_False); - pImportDlg->SetPath( aBgdGraphicPath, aBtnLink.IsChecked() ); - - pPageImpl->bIsImportDlgInExecute = sal_True; - short nErr = pImportDlg->Execute(); - pPageImpl->bIsImportDlgInExecute = sal_False; - - if( !nErr ) - { - if ( bHtml ) - aBtnLink.Check(); - // wenn Verkn"upfen nicht gecheckt ist und die Vorschau auch nicht, - // dann die Vorschau aktivieren, damit der Anwender sieht, - // welche Grafik er ausgew"ahlt hat - if ( !aBtnLink.IsChecked() && !aBtnPreview.IsChecked() ) - aBtnPreview.Check( sal_True ); - // timer-verz"ogertes Laden der Grafik - pPageImpl->pLoadTimer->Start(); - } - else - DELETEZ( pImportDlg ); - return 0; -} - -//----------------------------------------------------------------------- - -IMPL_LINK( SvxBackgroundTabPage, LoadTimerHdl_Impl, Timer* , pTimer ) - -/* [Beschreibung] - - Verz"ogertes Laden der Grafik. - Grafik wird nur dann geladen, wenn sie unterschiedlich zur - aktuellen Grafik ist. -*/ - -{ - if ( pTimer == pPageImpl->pLoadTimer ) - { - pPageImpl->pLoadTimer->Stop(); - - if ( pImportDlg ) - { - INetURLObject aOld( aBgdGraphicPath ); - INetURLObject aNew( pImportDlg->GetPath() ); - if ( !aBgdGraphicPath.Len() || aNew != aOld ) - { - // neue Datei gew"ahlt - aBgdGraphicPath = pImportDlg->GetPath(); - aBgdGraphicFilter = pImportDlg->GetCurrentFilter(); - sal_Bool bLink = ( nHtmlMode & HTMLMODE_ON ) || bLinkOnly ? sal_True : pImportDlg->IsAsLink(); - aBtnLink.Check( bLink ); - aBtnLink.Enable(); - - if ( aBtnPreview.IsChecked() ) - { - if( !pImportDlg->GetGraphic(aBgdGraphic) ) - { - bIsGraphicValid = sal_True; - } - else - { - aBgdGraphicFilter.Erase(); - aBgdGraphicPath.Erase(); - bIsGraphicValid = sal_False; - } - } - else - bIsGraphicValid = sal_False; // Grafik erst beim Preview-Click laden - - if ( aBtnPreview.IsChecked() && bIsGraphicValid ) - { - Bitmap aBmp = aBgdGraphic.GetBitmap(); - pPreviewWin2->NotifyChange( &aBmp ); - } - else - pPreviewWin2->NotifyChange( NULL ); - } - - FileClickHdl_Impl( &aBtnLink ); - DELETEZ( pImportDlg ); - } - } - return 0; -} - -//----------------------------------------------------------------------- - -void SvxBackgroundTabPage::ShowTblControl() -{ - aTblLBox .SetSelectHdl( HDL(TblDestinationHdl_Impl) ); - aTblLBox .SelectEntryPos(0); - aTblDesc.Show(); - aTblLBox.Show(); -} - -//----------------------------------------------------------------------- - -void SvxBackgroundTabPage::ShowParaControl(sal_Bool bCharOnly) -{ - aParaLBox.SetSelectHdl(HDL(ParaDestinationHdl_Impl)); - aParaLBox.SelectEntryPos(0); - if(!bCharOnly) - { - aTblDesc.Show(); - aParaLBox.Show(); - } - aParaLBox.SetData(&aParaLBox); // hier erkennt man, dass dieser Mode eingeschaltet ist -} -//----------------------------------------------------------------------- - -IMPL_LINK( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox*, pBox ) -{ - sal_uInt16 nSelPos = pBox->GetSelectEntryPos(); - if( pTableBck_Impl && pTableBck_Impl->nActPos != nSelPos) - { - SvxBrushItem** pActItem = new (SvxBrushItem*); - sal_uInt16 nWhich = 0; - switch(pTableBck_Impl->nActPos) - { - case TBL_DEST_CELL: - *pActItem = pTableBck_Impl->pCellBrush; - nWhich = pTableBck_Impl->nCellWhich; - break; - case TBL_DEST_ROW: - *pActItem = pTableBck_Impl->pRowBrush; - nWhich = pTableBck_Impl->nRowWhich; - break; - case TBL_DEST_TBL: - *pActItem = pTableBck_Impl->pTableBrush; - nWhich = pTableBck_Impl->nTableWhich; - break; - } - pTableBck_Impl->nActPos = nSelPos; - if(!*pActItem) - *pActItem = new SvxBrushItem(nWhich); - if(0 == aLbSelect.GetSelectEntryPos()) // Brush ausgewaehlt - { - **pActItem = SvxBrushItem( aBgdColor, nWhich ); - } - else - { - SvxGraphicPosition eNewPos = GetGraphicPosition_Impl(); - const sal_Bool bIsLink = aBtnLink.IsChecked(); - - if ( !bIsLink && !bIsGraphicValid ) - bIsGraphicValid = LoadLinkedGraphic_Impl(); - - if ( bIsLink ) - **pActItem = SvxBrushItem( aBgdGraphicPath, - aBgdGraphicFilter, - eNewPos, - (*pActItem)->Which() ); - else - **pActItem = SvxBrushItem( aBgdGraphic, - eNewPos, - (*pActItem)->Which() ); - } - switch(nSelPos) - { - case TBL_DEST_CELL: - *pActItem = pTableBck_Impl->pCellBrush; - aLbSelect.Enable(); - nWhich = pTableBck_Impl->nCellWhich; - break; - case TBL_DEST_ROW: - { - if((nHtmlMode & HTMLMODE_ON) && !(nHtmlMode & HTMLMODE_SOME_STYLES)) - aLbSelect.Disable(); - *pActItem = pTableBck_Impl->pRowBrush; - nWhich = pTableBck_Impl->nRowWhich; - } - break; - case TBL_DEST_TBL: - *pActItem = pTableBck_Impl->pTableBrush; - aLbSelect.Enable(); - nWhich = pTableBck_Impl->nTableWhich; - break; - } - String aUserData = GetUserData(); - if(!*pActItem) - *pActItem = new SvxBrushItem(nWhich); - FillControls_Impl(**pActItem, aUserData); - delete pActItem; - } - return 0; -} - -//----------------------------------------------------------------------- - -IMPL_LINK( SvxBackgroundTabPage, ParaDestinationHdl_Impl, ListBox*, pBox ) -{ - sal_uInt16 nSelPos = pBox->GetSelectEntryPos(); - if( pParaBck_Impl && pParaBck_Impl->nActPos != nSelPos) - { - SvxBrushItem** pActItem = new (SvxBrushItem*); - switch(pParaBck_Impl->nActPos) - { - case PARA_DEST_PARA: - *pActItem = pParaBck_Impl->pParaBrush; - break; - case PARA_DEST_CHAR: - *pActItem = pParaBck_Impl->pCharBrush; - break; - } - pParaBck_Impl->nActPos = nSelPos; - if(0 == aLbSelect.GetSelectEntryPos()) // Brush ausgewaehlt - { - sal_uInt16 nWhich = (*pActItem)->Which(); - **pActItem = SvxBrushItem( aBgdColor, nWhich ); - } - else - { - SvxGraphicPosition eNewPos = GetGraphicPosition_Impl(); - const sal_Bool bIsLink = aBtnLink.IsChecked(); - - if ( !bIsLink && !bIsGraphicValid ) - bIsGraphicValid = LoadLinkedGraphic_Impl(); - - if ( bIsLink ) - **pActItem = SvxBrushItem( aBgdGraphicPath, - aBgdGraphicFilter, - eNewPos, - (*pActItem)->Which() ); - else - **pActItem = SvxBrushItem( aBgdGraphic, - eNewPos, - (*pActItem)->Which() ); - } - switch(nSelPos) - { - case PARA_DEST_PARA: - *pActItem = pParaBck_Impl->pParaBrush; - aLbSelect.Enable(); - break; - case PARA_DEST_CHAR: - { - *pActItem = pParaBck_Impl->pCharBrush; - aLbSelect.Enable(sal_False); - } - break; - } - String aUserData = GetUserData(); - FillControls_Impl(**pActItem, aUserData); - delete pActItem; - } - return 0; -} - -//----------------------------------------------------------------------- - -void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr, - const String& rUserData ) -{ - SvxGraphicPosition ePos = rBgdAttr.GetGraphicPos(); - const Color& rColor = rBgdAttr.GetColor(); - if(bColTransparency) - { - aColTransMF.SetValue(lcl_TransparencyToPercent(rColor.GetTransparency())); - aColTransMF.SaveValue(); - sal_Bool bEnableTransp = rColor.GetTransparency() < 0xff; - aColTransFT.Enable(bEnableTransp); - aColTransMF.Enable(bEnableTransp); - //the default setting should be "no transparency" - if(!bEnableTransp) - aColTransMF.SetValue(0); - } - - if ( GPOS_NONE == ePos || !aLbSelect.IsVisible() ) - { - aLbSelect.SelectEntryPos( 0 ); - ShowColorUI_Impl(); - Color aTrColor( COL_TRANSPARENT ); - aBgdColor = rColor; - - sal_uInt16 nCol = ( aTrColor != aBgdColor ) ? - GetItemId_Impl( aBackgroundColorSet, aBgdColor ) : 0; - - if( aTrColor != aBgdColor && nCol == 0) - { - aBackgroundColorSet.SetNoSelection(); - } - else - { - aBackgroundColorSet.SelectItem( nCol ); - } - - pPreviewWin1->NotifyChange( aBgdColor ); - if ( aLbSelect.IsVisible() ) // Grafikteil initialisieren - { - aBgdGraphicFilter.Erase(); - aBgdGraphicPath.Erase(); - - if ( !rUserData.Len() ) - aBtnPreview.Check( sal_False ); - aBtnLink.Check( sal_False ); - aBtnLink.Disable(); - pPreviewWin2->NotifyChange( NULL ); - SetGraphicPosition_Impl( GPOS_TILED ); // Kacheln als Default - } - } - else - { - const String* pStrLink = rBgdAttr.GetGraphicLink(); - const String* pStrFilter = rBgdAttr.GetGraphicFilter(); - - aLbSelect.SelectEntryPos( 1 ); - ShowBitmapUI_Impl(); - - if ( pStrLink ) - { -#ifdef DBG_UTIL - INetURLObject aObj( *pStrLink ); - DBG_ASSERT( aObj.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL!" ); -#endif - aBgdGraphicPath = *pStrLink; - aBtnLink.Check( sal_True ); - aBtnLink.Enable(); - } - else - { - aBgdGraphicPath.Erase(); - aBtnLink.Check( sal_False ); - aBtnLink.Disable(); - } - - if(bGraphTransparency) - { - const GraphicObject* pObject = rBgdAttr.GetGraphicObject(); - if(pObject) - aGraphTransMF.SetValue(lcl_TransparencyToPercent(pObject->GetAttr().GetTransparency())); - else - aGraphTransMF.SetValue(0); - aGraphTransMF.SaveValue(); - } - - FileClickHdl_Impl( &aBtnLink ); - - if ( pStrFilter ) - aBgdGraphicFilter = *pStrFilter; - else - aBgdGraphicFilter.Erase(); - - if ( !pStrLink || aBtnPreview.IsChecked() ) - { - // Grafik ist im Item vorhanden und muss nicht - // geladen werden: - - const Graphic* pGraphic = rBgdAttr.GetGraphic(); - - if ( !pGraphic && aBtnPreview.IsChecked() ) - bIsGraphicValid = LoadLinkedGraphic_Impl(); - else if ( pGraphic ) - { - aBgdGraphic = *pGraphic; - bIsGraphicValid = sal_True; - - if ( !rUserData.Len() ) - aBtnPreview.Check(); - } - else - { - RaiseLoadError_Impl(); - bIsGraphicValid = sal_False; - - if ( !rUserData.Len() ) - aBtnPreview.Check( sal_False ); - } - } - - if ( aBtnPreview.IsChecked() && bIsGraphicValid ) - { - Bitmap aBmp = aBgdGraphic.GetBitmap(); - pPreviewWin2->NotifyChange( &aBmp ); - } - else - pPreviewWin2->NotifyChange( NULL ); - - SetGraphicPosition_Impl( ePos ); - } -} - -void SvxBackgroundTabPage::EnableTransparency(sal_Bool bColor, sal_Bool bGraphic) -{ - bColTransparency = bColor; - bGraphTransparency = bGraphic; - if(bColor) - { - aColTransFT.Show(); - aColTransMF.Show(); - } - if(bGraphic) - { - Size aRectSize(aWndPosition.GetSizePixel()); - Point aRectPos(aWndPosition.GetPosPixel()); - Point aFLPos(aGraphTransFL.GetPosPixel()); - Size aTmp(LogicToPixel(Size(RSC_SP_FLGR_SPACE_Y, RSC_SP_FLGR_SPACE_Y), MAP_APPFONT)); - long nRectHeight = aFLPos.Y() - aRectPos.Y() - aTmp.Height(); - aRectSize.Height() = nRectHeight; - aWndPosition.SetSizePixel(aRectSize); - aWndPosition.Invalidate(); - } -} - -void SvxBackgroundTabPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False); - if (pFlagItem) - { - sal_uInt32 nFlags=pFlagItem->GetValue(); - if ( ( nFlags & SVX_SHOW_TBLCTL ) == SVX_SHOW_TBLCTL ) - ShowTblControl(); - if ( ( nFlags & SVX_SHOW_PARACTL ) == SVX_SHOW_PARACTL ) - ShowParaControl(); - if ( ( nFlags & SVX_SHOW_SELECTOR ) == SVX_SHOW_SELECTOR ) - ShowSelector(); - if ( ( nFlags & SVX_ENABLE_TRANSPARENCY ) == SVX_ENABLE_TRANSPARENCY ) - EnableTransparency(sal_True, sal_True); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/backgrnd.hrc b/cui/source/tabpages/backgrnd.hrc deleted file mode 100644 index dcd161ce8..000000000 --- a/cui/source/tabpages/backgrnd.hrc +++ /dev/null @@ -1,70 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_BACKGRND_HRC -#define _SVX_BACKGRND_HRC - -// defines ------------------------------------------------------------------ - -#define FT_SELECTOR 1 -#define LB_SELECTOR 1 - -#define SET_BGDCOLOR 10 -#define GB_BGDCOLOR 11 -#define SET_PATTERN 12 -#define GB_COL_PREVIEW 13 -#define SET_PATCOLOR 14 -#define GB_PATCOLOR 15 -#define CT_BORDER 16 -#define FT_PREVIEW 20 -#define WIN_PREVIEW1 21 - -#define BTN_BROWSE 20 -#define FT_FILE 21 -#define BTN_LINK 22 -#define BTN_PREVIEW 23 -#define GB_FILE 24 -#define BTN_AREA 25 -#define BTN_TILE 26 -#define BTN_POSITION 27 -#define WND_POSITION 28 -#define GB_POSITION 29 -#define WIN_PREVIEW2 30 -#define GB_PREVIEW 31 -#define LB_TBL_BOX 32 -#define FT_TBL_DESC 33 -#define LB_PARA_BOX 34 -#define FT_COL_TRANS 35 -#define MF_COL_TRANS 36 -#define FL_GRAPH_TRANS 37 -#define MF_GRAPH_TRANS 38 - -#define STR_BROWSE 1 -#define STR_UNLINKED 2 - - -#endif - diff --git a/cui/source/tabpages/backgrnd.src b/cui/source/tabpages/backgrnd.src deleted file mode 100644 index 5e670d295..000000000 --- a/cui/source/tabpages/backgrnd.src +++ /dev/null @@ -1,315 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <svtools/controldims.hrc> -#include "helpid.hrc" -#include <cuires.hrc> -#include "backgrnd.hrc" -#include <svx/dialogs.hrc> - - // define ---------------------------------------------------------------- -#define UNLINKED_IMAGE \ - Text [ en-US ] = "Unlinked graphic" ; \ - - // pragma ---------------------------------------------------------------- - - // RID_SVXPAGE_BACKGROUND ------------------------------------------------ -TabPage RID_SVXPAGE_BACKGROUND -{ - HelpId = HID_BACKGROUND ; - Hide = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Text [ en-US ] = "Background" ; - FixedText FT_SELECTOR - { - Pos = MAP_APPFONT ( 6 , 4 ) ; - Size = MAP_APPFONT ( 24 , 10 ) ; - Hide = TRUE ; - LeftLabel = TRUE ; - Text [ en-US ] = "A~s" ; - }; - ListBox LB_SELECTOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_BACKGROUND:LB_SELECTOR"; - Hide = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 33 , 3 ) ; - Size = MAP_APPFONT ( 82 , 48 ) ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Color" ; Default ; > ; - < "Graphic" ; Default ; > ; - }; - }; - FixedText FT_TBL_DESC - { - Pos = MAP_APPFONT ( 145 , 5 ) ; - Size = MAP_APPFONT ( 24 , 10 ) ; - Hide = TRUE ; - LeftLabel = TRUE ; - Text [ en-US ] = "F~or" ; - }; - ListBox LB_TBL_BOX - { - HelpID = "cui:ListBox:RID_SVXPAGE_BACKGROUND:LB_TBL_BOX"; - Hide = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 172 , 3 ) ; - Size = MAP_APPFONT ( 82 , 48 ) ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Cell" ; > ; - < "Row" ; > ; - < "Table" ; > ; - }; - }; - ListBox LB_PARA_BOX - { - HelpID = "cui:ListBox:RID_SVXPAGE_BACKGROUND:LB_PARA_BOX"; - Hide = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 172 , 3 ) ; - Size = MAP_APPFONT ( 82 , 48 ) ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Paragraph" ; > ; - < "Character" ; > ; - }; - }; - // Hintergrund-Brush ---------------------------------------------------- - Control CT_BORDER - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 116+2 , 145+2 ) ; - DialogControl = TRUE; - }; - Control SET_BGDCOLOR - { - HelpId = HID_BACKGROUND_CTL_BGDCOLORSET ; - Hide = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 116 , 145 ) ; - TabStop = TRUE ; - }; - FixedLine GB_BGDCOLOR - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 6 , 21 ) ; - Size = MAP_APPFONT ( 248 , 8) ; - Text [ en-US ] = "Background color" ; - }; - Window WIN_PREVIEW1 - { - Hide = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 166 , 34 ) ; - Size = MAP_APPFONT ( 82 , 40 ) ; - }; - FixedText FT_COL_TRANS - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 166, 74 + RSC_SP_CTRL_Y + 2 ) ; - Size = MAP_APPFONT ( 50 , 8) ; - Text [ en-US ] = "~Transparency" ; - }; - MetricField MF_COL_TRANS - { - HelpID = "cui:MetricField:RID_SVXPAGE_BACKGROUND:MF_COL_TRANS"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 218 , 74 + RSC_SP_CTRL_Y ) ; - Size = MAP_APPFONT ( 30 , 12) ; - Border = TRUE ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - SpinSize = 5 ; - Minimum = 0; - Maximum = 100; - }; - - // Hintergrund-Bitmap ---------------------------------------------------- - FixedLine GB_FILE - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 6 , 23 ) ; - Size = MAP_APPFONT ( 153 , 8 ) ; - Text [ en-US ] = "File" ; - }; - PushButton BTN_BROWSE - { - HelpID = "cui:PushButton:RID_SVXPAGE_BACKGROUND:BTN_BROWSE"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 6 + RSC_SP_FLGR_INNERBORDER_LEFT , 23 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "~Browse..." ; - }; - CheckBox BTN_LINK - { - HelpID = "cui:CheckBox:RID_SVXPAGE_BACKGROUND:BTN_LINK"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 6 + RSC_SP_FLGR_INNERBORDER_LEFT + 60 + 2*RSC_SP_CTRL_X, 23 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + 3 ) ; - Size = MAP_APPFONT ( 78 , 10 ) ; - Text [ en-US ] = "~Link" ; - }; - FixedText FT_FILE - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 6 + RSC_SP_FLGR_INNERBORDER_LEFT , 23 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + RSC_CD_PUSHBUTTON_HEIGHT + RSC_SP_CTRL_Y ) ; - Size = MAP_APPFONT ( 141 , 8 ) ; - UNLINKED_IMAGE - }; - FixedLine GB_POSITION - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 6 , 78 ) ; - Size = MAP_APPFONT ( 153 , 8 ) ; - Text [ en-US ] = "Type" ; - }; - RadioButton BTN_POSITION - { - HelpID = "cui:RadioButton:RID_SVXPAGE_BACKGROUND:BTN_POSITION"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 12 , 89 ) ; - Size = MAP_APPFONT ( 49 , 10 ) ; - Text [ en-US ] = "~Position" ; - }; - RadioButton BTN_AREA - { - HelpID = "cui:RadioButton:RID_SVXPAGE_BACKGROUND:BTN_AREA"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 12 , 103 ) ; - Size = MAP_APPFONT ( 49 , 10 ) ; - Text [ en-US ] = "Ar~ea" ; - }; - RadioButton BTN_TILE - { - HelpID = "cui:RadioButton:RID_SVXPAGE_BACKGROUND:BTN_TILE"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 12 , 117 ) ; - Size = MAP_APPFONT ( 49 , 10 ) ; - Text [ en-US ] = "~Tile" ; - }; - Control WND_POSITION - { - HelpId = HID_BACKGROUND_CTL_POSITION ; - Hide = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 64 , 89 ) ; - Size = MAP_APPFONT ( 90 , 87 ) ; - TabStop = TRUE ; - }; - FixedLine FL_GRAPH_TRANS - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 6 , 157 ) ; - Size = MAP_APPFONT ( 153 , 8) ; - Text [ en-US ] = "Transparency" ; - }; - MetricField MF_GRAPH_TRANS - { - HelpID = "cui:MetricField:RID_SVXPAGE_BACKGROUND:MF_GRAPH_TRANS"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 12 , 168 ) ; - Size = MAP_APPFONT ( 30 , 12) ; - Border = TRUE ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - SpinSize = 5 ; - Minimum = 0; - Maximum = 100; - }; - Window WIN_PREVIEW2 - { - Hide = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 170 , 23 + 4 ) ; - Size = MAP_APPFONT ( 81 , 139 ) ; - }; - CheckBox BTN_PREVIEW - { - HelpID = "cui:CheckBox:RID_SVXPAGE_BACKGROUND:BTN_PREVIEW"; - Pos = MAP_APPFONT ( 170 , 23 + 4 + 139 + RSC_SP_CTRL_GROUP_Y ) ; - Size = MAP_APPFONT ( 141 , 10 ) ; - Text [ en-US ] = "Pre~view" ; - }; - String STR_BROWSE - { - Text [ en-US ] = "Find graphics" ; - }; - String STR_UNLINKED - { - UNLINKED_IMAGE - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/bbdlg.cxx b/cui/source/tabpages/bbdlg.cxx deleted file mode 100644 index 3133b2fb7..000000000 --- a/cui/source/tabpages/bbdlg.cxx +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <tools/shl.hxx> -#include <svx/dialogs.hrc> -#include <cuires.hrc> -#include "page.hrc" - -#include "bbdlg.hxx" -#include "border.hxx" -#include "backgrnd.hxx" -#include <dialmgr.hxx> - -// class SvxBorderBackgroundDlg ------------------------------------------ - -SvxBorderBackgroundDlg::SvxBorderBackgroundDlg( Window *pParent, - const SfxItemSet& rCoreSet, - sal_Bool bEnableSelector ) : - - SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_BBDLG ), &rCoreSet ), - bEnableBackgroundSelector( bEnableSelector ) -{ - FreeResource(); - AddTabPage( RID_SVXPAGE_BORDER, SvxBorderTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_BACKGROUND, SvxBackgroundTabPage::Create, 0 ); -} - -// ----------------------------------------------------------------------- - -SvxBorderBackgroundDlg::~SvxBorderBackgroundDlg() -{ -} - -// ----------------------------------------------------------------------- - -void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) -{ - // Umschalten zwischen Farbe/Grafik ermoeglichen: - - if ( bEnableBackgroundSelector && (RID_SVXPAGE_BACKGROUND == nPageId) ) - ((SvxBackgroundTabPage&)rTabPage).ShowSelector( ); -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/bbdlg.src b/cui/source/tabpages/bbdlg.src deleted file mode 100644 index 0b4089801..000000000 --- a/cui/source/tabpages/bbdlg.src +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <cuires.hrc> -#include <svx/dialogs.hrc> - - // RID_SVXDLG_BBDLG ------------------------------------------------------ -TabDialog RID_SVXDLG_BBDLG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 328 , 155 ) ; - Text [ en-US ] = "Border / Background" ; - Moveable = TRUE ; - // Closeable = TRUE; hat ja einen OKButton - TabControl 1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 2 , 10 ) ; - Size = MAP_APPFONT ( 260 , 135 ) ; - PageList = - { - PageItem - { - Identifier = RID_SVXPAGE_BORDER ; - Text [ en-US ] = "Borders" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_BACKGROUND ; - Text [ en-US ] = "Background" ; - }; - }; - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx deleted file mode 100644 index a13cb4958..000000000 --- a/cui/source/tabpages/border.cxx +++ /dev/null @@ -1,1224 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <sfx2/app.hxx> -#include <sfx2/objsh.hxx> -#include <sfx2/module.hxx> -#include <svx/dialogs.hrc> -#include <svx/dialmgr.hxx> -#define _SVX_BORDER_CXX - -#include <cuires.hrc> -#include "border.hrc" -#include "helpid.hrc" - -#define LINESTYLE_HTML_MAX 5 - -#include <svx/xtable.hxx> // XColorTable -#include <svx/drawitem.hxx> -#include <editeng/boxitem.hxx> -#include <editeng/shaditem.hxx> -#include "border.hxx" -#include <svx/dlgutil.hxx> -#include <dialmgr.hxx> -#include "svx/htmlmode.hxx" -#include <vcl/msgbox.hxx> -#include "svx/flagsdef.hxx" -#include <sfx2/request.hxx> -#include <svl/intitem.hxx> -#include <sfx2/itemconnect.hxx> -#include <sal/macros.h> -#include "borderconn.hxx" - -using namespace ::editeng; - -// ----------------------------------------------------------------------- - -/* - * [Beschreibung:] - * TabPage zum Einstellen der Rahmen-Attribute. - * Benoetigt - * ein SvxShadowItem: Schatten - * ein SvxBoxItem: Linien links,rechts,oben,unten ), - * ein SvxBoxInfo: Linien vertikal,horizontal, Abstaende, Flags ) - * - * Linien koennen drei Zustaende haben. - * 1. Show ( -> gueltige Werte ) - * 2. Hide ( -> NULL-Pointer ) - * 3. DontCare ( -> gesonderte Valid-Flags im InfoItem ) - */ - -// static ---------------------------------------------------------------- - -static sal_uInt16 pRanges[] = -{ - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW, - SID_ATTR_ALIGN_MARGIN, SID_ATTR_ALIGN_MARGIN, - SID_ATTR_BORDER_CONNECT, SID_ATTR_BORDER_CONNECT, - SID_SW_COLLAPSING_BORDERS, SID_SW_COLLAPSING_BORDERS, - SID_ATTR_BORDER_DIAG_TLBR, SID_ATTR_BORDER_DIAG_BLTR, - 0 -}; - -sal_Bool SvxBorderTabPage::bSync = sal_True; - -// ----------------------------------------------------------------------- -void lcl_SetDecimalDigitsTo1(MetricField& rField) -{ - sal_Int64 nMin = rField.Denormalize( rField.GetMin( FUNIT_TWIP ) ); - rField.SetDecimalDigits(1); - rField.SetMin( rField.Normalize( nMin ), FUNIT_TWIP ); -} -// ----------------------------------------------------------------------- - -SvxBorderTabPage::SvxBorderTabPage( Window* pParent, - const SfxItemSet& rCoreAttrs ) - - : SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_BORDER ), rCoreAttrs ), - - aFlBorder ( this, CUI_RES( FL_BORDER ) ), - aDefaultFT ( this, CUI_RES( FT_DEFAULT ) ), - aWndPresets ( this, CUI_RES( WIN_PRESETS ) ), - aUserDefFT ( this, CUI_RES( FT_USERDEF ) ), - aFrameSel ( this, CUI_RES( WIN_FRAMESEL ) ), - - aFlSep1 ( this, CUI_RES( FL_SEPARATOR1 ) ), - aFlLine ( this, CUI_RES( FL_LINE ) ), - aStyleFT ( this, CUI_RES( FT_STYLE ) ), - aLbLineStyle ( this, CUI_RES( LB_LINESTYLE ) ), - aColorFT ( this, CUI_RES( FT_COLOR ) ), - aLbLineColor ( this, CUI_RES( LB_LINECOLOR ) ), - aWidthFT ( this, CUI_RES( FT_WIDTH ) ), - aLineWidthMF ( this, CUI_RES( MF_LINEWIDTH ) ), - - aFlSep2 ( this, CUI_RES( FL_SEPARATOR2 ) ), - aDistanceFL ( this, CUI_RES( FL_DISTANCE ) ), - aLeftFT ( this, CUI_RES( FT_LEFT ) ), - aLeftMF ( this, CUI_RES( MF_LEFT ) ), - aRightFT ( this, CUI_RES( FT_RIGHT ) ), - aRightMF ( this, CUI_RES( MF_RIGHT ) ), - aTopFT ( this, CUI_RES( FT_TOP ) ), - aTopMF ( this, CUI_RES( MF_TOP ) ), - aBottomFT ( this, CUI_RES( FT_BOTTOM ) ), - aBottomMF ( this, CUI_RES( MF_BOTTOM ) ), - aSynchronizeCB ( this, CUI_RES( CB_SYNC ) ), - - aFlShadow ( this, CUI_RES( FL_SHADOW ) ), - aFtShadowPos ( this, CUI_RES( FT_SHADOWPOS ) ), - aWndShadows ( this, CUI_RES( WIN_SHADOWS ) ), - aFtShadowSize ( this, CUI_RES( FT_SHADOWSIZE ) ), - aEdShadowSize ( this, CUI_RES( ED_SHADOWSIZE ) ), - aFtShadowColor ( this, CUI_RES( FT_SHADOWCOLOR ) ), - aLbShadowColor ( this, CUI_RES( LB_SHADOWCOLOR ) ), - aPropertiesFL ( this, CUI_RES( FL_PROPERTIES ) ), - aMergeWithNextCB( this, CUI_RES( CB_MERGEWITHNEXT ) ), - aMergeAdjacentBordersCB( this, CUI_RES( CB_MERGEADJACENTBORDERS ) ), - aShadowImgLst( CUI_RES(IL_SDW_BITMAPS)), - aBorderImgLst( CUI_RES(IL_PRE_BITMAPS)), - nMinValue(0), - nSWMode(0), - mbHorEnabled( false ), - mbVerEnabled( false ), - mbTLBREnabled( false ), - mbBLTREnabled( false ), - mbUseMarginItem( false ) - -{ - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - /* Use SvxMarginItem instead of margins from SvxBoxItem, if present. - -> Remember this state in mbUseMarginItem, because other special handling - is needed across various functions... */ - mbUseMarginItem = rCoreAttrs.GetItemState(GetWhich(SID_ATTR_ALIGN_MARGIN),sal_True) != SFX_ITEM_UNKNOWN; - - // Metrik einstellen - FieldUnit eFUnit = GetModuleFieldUnit( rCoreAttrs ); - - if( mbUseMarginItem ) - { - // copied from SvxAlignmentTabPage - switch ( eFUnit ) - { - // #103396# the default value (1pt) can't be accurately represented in - // inches or pica with two decimals, so point is used instead. - case FUNIT_PICA: - case FUNIT_INCH: - case FUNIT_FOOT: - case FUNIT_MILE: - eFUnit = FUNIT_POINT; - break; - - case FUNIT_CM: - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; - break; - default: ;//prevent warning - } - } - else - { - switch ( eFUnit ) - { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; - break; - default: ; //prevent warning - } - } - - SetFieldUnit( aEdShadowSize, eFUnit ); - - sal_uInt16 nWhich = GetWhich( SID_ATTR_BORDER_INNER, sal_False ); - sal_Bool bIsDontCare = sal_True; - - if ( rCoreAttrs.GetItemState( nWhich, sal_True ) >= SFX_ITEM_AVAILABLE ) - { - // Absatz oder Tabelle - const SvxBoxInfoItem* pBoxInfo = - (const SvxBoxInfoItem*)&( rCoreAttrs.Get( nWhich ) ); - - mbHorEnabled = pBoxInfo->IsHorEnabled(); - mbVerEnabled = pBoxInfo->IsVerEnabled(); - mbTLBREnabled = sfx::ItemWrapperHelper::IsKnownItem( rCoreAttrs, SID_ATTR_BORDER_DIAG_TLBR ); - mbBLTREnabled = sfx::ItemWrapperHelper::IsKnownItem( rCoreAttrs, SID_ATTR_BORDER_DIAG_BLTR ); - - if(pBoxInfo->IsDist()) - { - SetFieldUnit(aLeftMF, eFUnit); - SetFieldUnit(aRightMF, eFUnit); - SetFieldUnit(aTopMF, eFUnit); - SetFieldUnit(aBottomMF, eFUnit); - aSynchronizeCB.Check(bSync); - aSynchronizeCB.SetClickHdl(LINK(this, SvxBorderTabPage, SyncHdl_Impl)); - aLeftMF.SetModifyHdl(LINK(this, SvxBorderTabPage, ModifyDistanceHdl_Impl)); - aRightMF.SetModifyHdl(LINK(this, SvxBorderTabPage, ModifyDistanceHdl_Impl)); - aTopMF.SetModifyHdl(LINK(this, SvxBorderTabPage, ModifyDistanceHdl_Impl)); - aBottomMF.SetModifyHdl(LINK(this, SvxBorderTabPage, ModifyDistanceHdl_Impl)); - } - else - { - aFlSep2.Hide(); - aDistanceFL.Hide(); - aLeftFT.Hide(); - aLeftMF.Hide(); - aRightFT.Hide(); - aRightMF.Hide(); - aTopFT.Hide(); - aTopMF.Hide(); - aBottomFT.Hide(); - aBottomMF.Hide(); - aSynchronizeCB.Hide(); - } - bIsDontCare = !pBoxInfo->IsValid( VALID_DISABLE ); - } - if(!mbUseMarginItem && eFUnit == FUNIT_MM && SFX_MAPUNIT_TWIP == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) )) - { - //#i91548# changing the number of decimal digits changes the minimum values, too - lcl_SetDecimalDigitsTo1(aLeftMF); - lcl_SetDecimalDigitsTo1(aRightMF); - lcl_SetDecimalDigitsTo1(aTopMF); - lcl_SetDecimalDigitsTo1(aBottomMF); - lcl_SetDecimalDigitsTo1(aEdShadowSize); - } - - svx::FrameSelFlags nFlags = svx::FRAMESEL_OUTER; - if( mbHorEnabled ) - nFlags |= svx::FRAMESEL_INNER_HOR; - if( mbVerEnabled ) - nFlags |= svx::FRAMESEL_INNER_VER; - if( mbTLBREnabled ) - nFlags |= svx::FRAMESEL_DIAG_TLBR; - if( mbBLTREnabled ) - nFlags |= svx::FRAMESEL_DIAG_BLTR; - if( bIsDontCare ) - nFlags |= svx::FRAMESEL_DONTCARE; - aFrameSel.Initialize( nFlags ); - - aFrameSel.SetSelectHdl(LINK(this, SvxBorderTabPage, LinesChanged_Impl)); - aLbLineStyle.SetSelectHdl( LINK( this, SvxBorderTabPage, SelStyleHdl_Impl ) ); - aLbLineColor.SetSelectHdl( LINK( this, SvxBorderTabPage, SelColHdl_Impl ) ); - aLineWidthMF.SetModifyHdl( LINK( this, SvxBorderTabPage, ModifyWidthHdl_Impl ) ); - aLbShadowColor.SetSelectHdl( LINK( this, SvxBorderTabPage, SelColHdl_Impl ) ); - aWndPresets.SetSelectHdl( LINK( this, SvxBorderTabPage, SelPreHdl_Impl ) ); - aWndShadows.SetSelectHdl( LINK( this, SvxBorderTabPage, SelSdwHdl_Impl ) ); - - FillValueSets(); - FillLineListBox_Impl(); - - // ColorBox aus der XColorTable fuellen. - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - const SfxPoolItem* pItem = NULL; - XColorTable* pColorTable = NULL; - - DBG_ASSERT( pDocSh, "DocShell not found!" ); - - if ( pDocSh ) - { - pItem = pDocSh->GetItem( SID_COLOR_TABLE ); - if ( pItem != NULL ) - pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); - } - - DBG_ASSERT( pColorTable, "ColorTable not found!" ); - - if ( pColorTable ) - { - // fuellen der Linienfarben-Box - aLbLineColor.SetUpdateMode( sal_False ); - - for ( long i = 0; i < pColorTable->Count(); ++i ) - { - XColorEntry* pEntry = pColorTable->GetColor(i); - aLbLineColor.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - } - aLbLineColor.SetUpdateMode( sal_True ); - // dann nur noch in die Schattenfarben-Box kopieren - aLbShadowColor.CopyEntries( aLbLineColor ); - } - FreeResource(); - - // connections - - bool bSupportsShadow = !SfxItemPool::IsSlot( GetWhich( SID_ATTR_BORDER_SHADOW ) ); - if( bSupportsShadow ) - AddItemConnection( svx::CreateShadowConnection( rCoreAttrs, aWndShadows, aEdShadowSize, aLbShadowColor ) ); - else - HideShadowControls(); - - if( mbUseMarginItem ) - AddItemConnection( svx::CreateMarginConnection( rCoreAttrs, aLeftMF, aRightMF, aTopMF, aBottomMF ) ); - if( aFrameSel.IsBorderEnabled( svx::FRAMEBORDER_TLBR ) ) - AddItemConnection( svx::CreateFrameLineConnection( SID_ATTR_BORDER_DIAG_TLBR, aFrameSel, svx::FRAMEBORDER_TLBR ) ); - if( aFrameSel.IsBorderEnabled( svx::FRAMEBORDER_BLTR ) ) - AddItemConnection( svx::CreateFrameLineConnection( SID_ATTR_BORDER_DIAG_BLTR, aFrameSel, svx::FRAMEBORDER_BLTR ) ); - // #i43593# - item connection doesn't work for Writer, - // because the Writer item sets contain these items - // checkbox "Merge with next paragraph" only visible for Writer dialog format.paragraph - AddItemConnection( new sfx::CheckBoxConnection( SID_ATTR_BORDER_CONNECT, aMergeWithNextCB, sfx::ITEMCONN_DEFAULT ) ); - aMergeWithNextCB.Hide(); - // checkbox "Merge adjacent line styles" only visible for Writer dialog format.table - AddItemConnection( new sfx::CheckBoxConnection( SID_SW_COLLAPSING_BORDERS, aMergeAdjacentBordersCB, sfx::ITEMCONN_DEFAULT ) ); - aMergeAdjacentBordersCB.Hide(); -} - -// ----------------------------------------------------------------------- - -SvxBorderTabPage::~SvxBorderTabPage() -{ -} - -// ----------------------------------------------------------------------- - -sal_uInt16* SvxBorderTabPage::GetRanges() -{ - return pRanges; -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxBorderTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet ) -{ - return ( new SvxBorderTabPage( pParent, rAttrSet ) ); -} - -// ----------------------------------------------------------------------- - -void SvxBorderTabPage::ResetFrameLine_Impl( svx::FrameBorderType eBorder, const SvxBorderLine* pCoreLine, bool bValid ) -{ - if( aFrameSel.IsBorderEnabled( eBorder ) ) - { - if( bValid ) - aFrameSel.ShowBorder( eBorder, pCoreLine ); - else - aFrameSel.SetBorderDontCare( eBorder ); - } -} - -// ----------------------------------------------------------------------- - -void SvxBorderTabPage::Reset( const SfxItemSet& rSet ) -{ - SfxTabPage::Reset( rSet ); - - const SvxBoxItem* pBoxItem; - const SvxBoxInfoItem* pBoxInfoItem; - sal_uInt16 nWhichBox = GetWhich(SID_ATTR_BORDER_OUTER); - SfxMapUnit eCoreUnit; - - pBoxItem = (const SvxBoxItem*)GetItem( rSet, SID_ATTR_BORDER_OUTER ); - - pBoxInfoItem = (const SvxBoxInfoItem*)GetItem( rSet, SID_ATTR_BORDER_INNER, sal_False ); - - eCoreUnit = rSet.GetPool()->GetMetric( nWhichBox ); - - if ( pBoxItem && pBoxInfoItem ) // -> Don't Care - { - ResetFrameLine_Impl( svx::FRAMEBORDER_LEFT, pBoxItem->GetLeft(), pBoxInfoItem->IsValid( VALID_LEFT ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_RIGHT, pBoxItem->GetRight(), pBoxInfoItem->IsValid( VALID_RIGHT ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_TOP, pBoxItem->GetTop(), pBoxInfoItem->IsValid( VALID_TOP ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_BOTTOM, pBoxItem->GetBottom(), pBoxInfoItem->IsValid( VALID_BOTTOM ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_VER, pBoxInfoItem->GetVert(), pBoxInfoItem->IsValid( VALID_VERT ) ); - ResetFrameLine_Impl( svx::FRAMEBORDER_HOR, pBoxInfoItem->GetHori(), pBoxInfoItem->IsValid( VALID_HORI ) ); - - //------------------- - // Abstand nach innen - //------------------- - if( !mbUseMarginItem ) - { - if ( aLeftMF.IsVisible() ) - { - SetMetricValue( aLeftMF, pBoxInfoItem->GetDefDist(), eCoreUnit ); - SetMetricValue( aRightMF, pBoxInfoItem->GetDefDist(), eCoreUnit ); - SetMetricValue( aTopMF, pBoxInfoItem->GetDefDist(), eCoreUnit ); - SetMetricValue( aBottomMF, pBoxInfoItem->GetDefDist(), eCoreUnit ); - - nMinValue = static_cast<long>(aLeftMF.GetValue()); - - if ( pBoxInfoItem->IsMinDist() ) - { - aLeftMF.SetFirst( nMinValue ); - aRightMF.SetFirst( nMinValue ); - aTopMF.SetFirst( nMinValue ); - aBottomMF.SetFirst( nMinValue ); - } - - if ( pBoxInfoItem->IsDist() ) - { - if( rSet.GetItemState( nWhichBox, sal_True ) >= SFX_ITEM_DEFAULT ) - { - sal_Bool bIsAnyBorderVisible = aFrameSel.IsAnyBorderVisible(); - if( !bIsAnyBorderVisible || !pBoxInfoItem->IsMinDist() ) - { - aLeftMF.SetMin( 0 ); - aLeftMF.SetFirst( 0 ); - aRightMF.SetMin( 0 ); - aRightMF.SetFirst( 0 ); - aTopMF.SetMin( 0 ); - aTopMF.SetFirst( 0 ); - aBottomMF.SetMin( 0 ); - aBottomMF.SetFirst( 0 ); - } - long nLeftDist = pBoxItem->GetDistance( BOX_LINE_LEFT); - SetMetricValue( aLeftMF, nLeftDist, eCoreUnit ); - long nRightDist = pBoxItem->GetDistance( BOX_LINE_RIGHT); - SetMetricValue( aRightMF, nRightDist, eCoreUnit ); - long nTopDist = pBoxItem->GetDistance( BOX_LINE_TOP); - SetMetricValue( aTopMF, nTopDist, eCoreUnit ); - long nBottomDist = pBoxItem->GetDistance( BOX_LINE_BOTTOM); - SetMetricValue( aBottomMF, nBottomDist, eCoreUnit ); - - // ist der Abstand auf nicht-default gesetzt, - // dann soll der Wert auch nicht - // mehr autom. veraendert werden - - // if the distance is set with no active border line - // or it is null with an active border line - // no automatic changes should be made - const long nDefDist = bIsAnyBorderVisible ? pBoxInfoItem->GetDefDist() : 0; - sal_Bool bDiffDist = (nDefDist != nLeftDist || - nDefDist != nRightDist || - nDefDist != nTopDist || - nDefDist != nBottomDist); - if((pBoxItem->GetDistance() || - bIsAnyBorderVisible) && bDiffDist ) - { - aLeftMF.SetModifyFlag(); - aRightMF.SetModifyFlag(); - aTopMF.SetModifyFlag(); - aBottomMF.SetModifyFlag(); - } - } - else - { - // #106224# different margins -> do not fill the edits - aLeftMF.SetText( String() ); - aRightMF.SetText( String() ); - aTopMF.SetText( String() ); - aBottomMF.SetText( String() ); - } - } - aLeftMF.SaveValue(); - aRightMF.SaveValue(); - aTopMF.SaveValue(); - aBottomMF.SaveValue(); - } - } - } - else - { - // ResetFrameLine-Aufrufe einsparen: - aFrameSel.HideAllBorders(); - } - - //------------------------------------------------------------- - // Linie/Linienfarbe in Controllern darstellen, wenn eindeutig: - //------------------------------------------------------------- - { - // Do all visible lines show the same line widths? - long nWidth; - SvxBorderStyle nStyle; - bool bWidthEq = aFrameSel.GetVisibleWidth( nWidth, nStyle ); - if( bWidthEq ) - { - // Determine the width first as some styles can be missing depending on it - sal_Int64 nWidthPt = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( - sal_Int64( nWidth ), aLineWidthMF.GetDecimalDigits( ), - MAP_TWIP,aLineWidthMF.GetUnit() )); - aLineWidthMF.SetValue( nWidthPt ); - aLbLineStyle.SetWidth( nWidth ); - - // then set the style - aLbLineStyle.SelectEntry( nStyle ); - } - else - aLbLineStyle.SelectEntryPos( 1 ); - - // Do all visible lines show the same line color? - Color aColor; - bool bColorEq = aFrameSel.GetVisibleColor( aColor ); - if( !bColorEq ) - aColor.SetColor( COL_BLACK ); - - sal_uInt16 nSelPos = aLbLineColor.GetEntryPos( aColor ); - if( nSelPos == LISTBOX_ENTRY_NOTFOUND ) - nSelPos = aLbLineColor.InsertEntry( aColor, SVX_RESSTR( RID_SVXSTR_COLOR_USER ) ); - - aLbLineColor.SelectEntryPos( nSelPos ); - aLbLineStyle.SetColor( aColor ); - - // Select all visible lines, if they are all equal. - if( bWidthEq && bColorEq ) - aFrameSel.SelectAllVisibleBorders(); - - // set the current style and color (caches style in control even if nothing is selected) - SelStyleHdl_Impl( &aLbLineStyle ); - SelColHdl_Impl( &aLbLineColor ); - } - - sal_Bool bEnable = aWndShadows.GetSelectItemId() > 1 ; - aFtShadowSize.Enable(bEnable); - aEdShadowSize.Enable(bEnable); - aFtShadowColor.Enable(bEnable); - aLbShadowColor.Enable(bEnable); - - aWndPresets.SetNoSelection(); - - // - keine Line - sollte nicht selektiert sein - - if ( aLbLineStyle.GetSelectEntryPos() == 0 ) - { - aLbLineStyle.SelectEntryPos( 1 ); - SelStyleHdl_Impl( &aLbLineStyle ); - } - - const SfxPoolItem* pItem; - SfxObjectShell* pShell; - if(SFX_ITEM_SET == rSet.GetItemState(SID_HTML_MODE, sal_False, &pItem) || - ( 0 != (pShell = SfxObjectShell::Current()) && - 0 != (pItem = pShell->GetItem(SID_HTML_MODE)))) - { - sal_uInt16 nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue(); - if(nHtmlMode & HTMLMODE_ON) - { - //Im Html-Mode gibt es keinen Schatten und nur komplette Umrandungen - aFtShadowPos .Disable(); - aWndShadows .Disable(); - aFtShadowSize .Disable(); - aEdShadowSize .Disable(); - aFtShadowColor.Disable(); - aLbShadowColor.Disable(); - aFlShadow .Disable(); - - sal_uInt16 nLBCount = aLbLineStyle.GetEntryCount(); - // ist es ein Absatzdialog, dann alle Linien fuer - // Sw-Export, sonst ist die Page nicht da - if(!(mbHorEnabled || mbVerEnabled) - && 0 == (nHtmlMode & HTMLMODE_FULL_ABS_POS) && - SFX_ITEM_AVAILABLE > rSet.GetItemState(GetWhich( SID_ATTR_PARA_LINESPACE ))) - { - for( sal_uInt16 i = nLBCount - 1; i > LINESTYLE_HTML_MAX; --i) - aLbLineStyle.RemoveEntry(i); - } - - if( !(nSWMode & SW_BORDER_MODE_TABLE) ) - { - aUserDefFT.Disable(); - aFrameSel.Disable(); - aWndPresets.RemoveItem(3); - aWndPresets.RemoveItem(4); - aWndPresets.RemoveItem(5); - } - } - } - - LinesChanged_Impl( 0 ); -} - -// ----------------------------------------------------------------------- - -int SvxBorderTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -#define IS_DONT_CARE(a) ((a).GetState() == svx::FRAMESTATE_DONTCARE ) - -sal_Bool SvxBorderTabPage::FillItemSet( SfxItemSet& rCoreAttrs ) -{ - bool bAttrsChanged = SfxTabPage::FillItemSet( rCoreAttrs ); - - sal_Bool bPut = sal_True; - sal_uInt16 nBoxWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - sal_uInt16 nBoxInfoWhich = rCoreAttrs.GetPool()->GetWhich( SID_ATTR_BORDER_INNER, sal_False ); - const SfxItemSet& rOldSet = GetItemSet(); - SvxBoxItem aBoxItem ( nBoxWhich ); - SvxBoxInfoItem aBoxInfoItem ( nBoxInfoWhich ); - SvxBoxItem* pOldBoxItem = (SvxBoxItem*)GetOldItem( rCoreAttrs, SID_ATTR_BORDER_OUTER ); - - SfxMapUnit eCoreUnit = rOldSet.GetPool()->GetMetric( nBoxWhich ); - const SfxPoolItem* pOld = 0; - - //------------------ - // Umrandung aussen: - //------------------ - typedef ::std::pair<svx::FrameBorderType,sal_uInt16> TBorderPair; - TBorderPair eTypes1[] = { - TBorderPair(svx::FRAMEBORDER_TOP,BOX_LINE_TOP), - TBorderPair(svx::FRAMEBORDER_BOTTOM,BOX_LINE_BOTTOM), - TBorderPair(svx::FRAMEBORDER_LEFT,BOX_LINE_LEFT), - TBorderPair(svx::FRAMEBORDER_RIGHT,BOX_LINE_RIGHT), - }; - - for (sal_uInt32 i=0; i < SAL_N_ELEMENTS(eTypes1); ++i) - aBoxItem.SetLine( aFrameSel.GetFrameBorderStyle( eTypes1[i].first ), eTypes1[i].second ); - - //-------------------------------- - // Umrandung hor/ver und TableFlag - //-------------------------------- - TBorderPair eTypes2[] = { - TBorderPair(svx::FRAMEBORDER_HOR,BOXINFO_LINE_HORI), - TBorderPair(svx::FRAMEBORDER_VER,BOXINFO_LINE_VERT) - }; - for (sal_uInt32 j=0; j < SAL_N_ELEMENTS(eTypes2); ++j) - aBoxInfoItem.SetLine( aFrameSel.GetFrameBorderStyle( eTypes2[j].first ), eTypes2[j].second ); - - aBoxInfoItem.EnableHor( mbHorEnabled ); - aBoxInfoItem.EnableVer( mbVerEnabled ); - - //------------------- - // Abstand nach Innen - //------------------- - if( aLeftMF.IsVisible() ) - { - // #i40405# enable distance controls for next dialog call - aBoxInfoItem.SetDist( sal_True ); - - if( !mbUseMarginItem ) - { - // #106224# all edits empty: do nothing - if( aLeftMF.GetText().Len() || aRightMF.GetText().Len() || - aTopMF.GetText().Len() || aBottomMF.GetText().Len() ) - { - if ( ((mbHorEnabled || mbVerEnabled || (nSWMode & SW_BORDER_MODE_TABLE)) && - (aLeftMF.IsModified()||aRightMF.IsModified()|| - aTopMF.IsModified()||aBottomMF.IsModified()) )|| - aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_TOP ) != svx::FRAMESTATE_HIDE - || aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_BOTTOM ) != svx::FRAMESTATE_HIDE - || aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_LEFT ) != svx::FRAMESTATE_HIDE - || aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) != svx::FRAMESTATE_HIDE ) - { - SvxBoxInfoItem* pOldBoxInfoItem = (SvxBoxInfoItem*)GetOldItem( - rCoreAttrs, SID_ATTR_BORDER_INNER ); - if ( - !pOldBoxItem || - aLeftMF .GetText() != aLeftMF .GetSavedValue() || - aRightMF .GetText() != aRightMF .GetSavedValue() || - aTopMF .GetText() != aTopMF .GetSavedValue() || - aBottomMF.GetText() != aBottomMF.GetSavedValue() || - nMinValue == aLeftMF .GetValue() || - nMinValue == aRightMF .GetValue() || - nMinValue == aTopMF .GetValue() || - nMinValue == aBottomMF.GetValue() || - (pOldBoxInfoItem && !pOldBoxInfoItem->IsValid(VALID_DISTANCE)) - ) - { - aBoxItem.SetDistance( (sal_uInt16)GetCoreValue( aLeftMF, eCoreUnit ), BOX_LINE_LEFT ); - aBoxItem.SetDistance( (sal_uInt16)GetCoreValue( aRightMF, eCoreUnit ), BOX_LINE_RIGHT ); - aBoxItem.SetDistance( (sal_uInt16)GetCoreValue( aTopMF, eCoreUnit ), BOX_LINE_TOP ); - aBoxItem.SetDistance( (sal_uInt16)GetCoreValue( aBottomMF, eCoreUnit ), BOX_LINE_BOTTOM); - } - else - { - aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_LEFT ), BOX_LINE_LEFT); - aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_RIGHT), BOX_LINE_RIGHT); - aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_TOP ), BOX_LINE_TOP); - aBoxItem.SetDistance(pOldBoxItem->GetDistance(BOX_LINE_BOTTOM), BOX_LINE_BOTTOM); - } - aBoxInfoItem.SetValid( VALID_DISTANCE, sal_True ); - } - else - aBoxInfoItem.SetValid( VALID_DISTANCE, sal_False ); - } - } - } - - //------------------------------------------ - // Don't Care Status im Info-Item vermerken: - //------------------------------------------ - aBoxInfoItem.SetValid( VALID_TOP, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_TOP ) != svx::FRAMESTATE_DONTCARE ); - aBoxInfoItem.SetValid( VALID_BOTTOM, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_BOTTOM ) != svx::FRAMESTATE_DONTCARE ); - aBoxInfoItem.SetValid( VALID_LEFT, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_LEFT ) != svx::FRAMESTATE_DONTCARE ); - aBoxInfoItem.SetValid( VALID_RIGHT, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) != svx::FRAMESTATE_DONTCARE ); - aBoxInfoItem.SetValid( VALID_HORI, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_HOR ) != svx::FRAMESTATE_DONTCARE ); - aBoxInfoItem.SetValid( VALID_VERT, aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_VER ) != svx::FRAMESTATE_DONTCARE ); - - // - // Put oder Clear der Umrandung? - // - bPut = sal_True; - - if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nBoxWhich, sal_False )) - { - bPut = aBoxItem != (const SvxBoxItem&)(rOldSet.Get(nBoxWhich)) ? sal_True : sal_False; - } - if( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nBoxInfoWhich, sal_False ) ) - { - const SvxBoxInfoItem& rOldBoxInfo = (const SvxBoxInfoItem&) - rOldSet.Get(nBoxInfoWhich); - - aBoxInfoItem.SetMinDist( rOldBoxInfo.IsMinDist() ); - aBoxInfoItem.SetDefDist( rOldBoxInfo.GetDefDist() ); - bPut |= (aBoxInfoItem != rOldBoxInfo ); - } - - if ( bPut ) - { - if ( !pOldBoxItem || !( *pOldBoxItem == aBoxItem ) ) - { - rCoreAttrs.Put( aBoxItem ); - bAttrsChanged |= sal_True; - } - pOld = GetOldItem( rCoreAttrs, SID_ATTR_BORDER_INNER, sal_False ); - - if ( !pOld || !( *(const SvxBoxInfoItem*)pOld == aBoxInfoItem ) ) - { - rCoreAttrs.Put( aBoxInfoItem ); - bAttrsChanged |= sal_True; - } - } - else - { - rCoreAttrs.ClearItem( nBoxWhich ); - rCoreAttrs.ClearItem( nBoxInfoWhich ); - } - - return bAttrsChanged; -} - -// ----------------------------------------------------------------------- - -void SvxBorderTabPage::HideShadowControls() -{ - aFtShadowPos.Hide(); - aWndShadows.Hide(); - aFtShadowSize.Hide(); - aEdShadowSize.Hide(); - aFtShadowColor.Hide(); - aLbShadowColor.Hide(); - aFlShadow.Hide(); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxBorderTabPage, SelPreHdl_Impl, void *, EMPTYARG ) -{ - const svx::FrameBorderState SHOW = svx::FRAMESTATE_SHOW; - const svx::FrameBorderState HIDE = svx::FRAMESTATE_HIDE; - const svx::FrameBorderState DONT = svx::FRAMESTATE_DONTCARE; - - static const svx::FrameBorderState ppeStates[][ svx::FRAMEBORDERTYPE_COUNT ] = - { /* Left Right Top Bot Hor Ver TLBR BLTR */ -/* ---------------------+--------------------------------------------------- */ -/* IID_PRE_CELL_NONE */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_CELL_ALL */ { SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_CELL_LR */ { SHOW, SHOW, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_CELL_TB */ { HIDE, HIDE, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_CELL_L */ { SHOW, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_CELL_DIAG */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, SHOW, SHOW }, -/* IID_PRE_HOR_NONE */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_HOR_OUTER */ { SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_HOR_HOR */ { HIDE, HIDE, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE }, -/* IID_PRE_HOR_ALL */ { SHOW, SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE }, -/* IID_PRE_HOR_OUTER2 */ { SHOW, SHOW, SHOW, SHOW, DONT, HIDE, HIDE, HIDE }, -/* IID_PRE_VER_NONE */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_VER_OUTER */ { SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_VER_VER */ { SHOW, SHOW, HIDE, HIDE, HIDE, SHOW, HIDE, HIDE }, -/* IID_PRE_VER_ALL */ { SHOW, SHOW, SHOW, SHOW, HIDE, SHOW, HIDE, HIDE }, -/* IID_PRE_VER_OUTER2 */ { SHOW, SHOW, SHOW, SHOW, HIDE, DONT, HIDE, HIDE }, -/* IID_PRE_TABLE_NONE */ { HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_TABLE_OUTER */ { SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE, HIDE }, -/* IID_PRE_TABLE_OUTERH */ { SHOW, SHOW, SHOW, SHOW, SHOW, HIDE, HIDE, HIDE }, -/* IID_PRE_TABLE_ALL */ { SHOW, SHOW, SHOW, SHOW, SHOW, SHOW, HIDE, HIDE }, -/* IID_PRE_TABLE_OUTER2 */ { SHOW, SHOW, SHOW, SHOW, DONT, DONT, HIDE, HIDE } - }; - - // first hide and deselect all frame borders - aFrameSel.HideAllBorders(); - aFrameSel.DeselectAllBorders(); - - // Using image ID to find correct line in table above. - sal_uInt16 nLine = GetPresetImageId( aWndPresets.GetSelectItemId() ) - 1; - - // Apply all styles from the table - for( int nBorder = 0; nBorder < svx::FRAMEBORDERTYPE_COUNT; ++nBorder ) - { - svx::FrameBorderType eBorder = svx::GetFrameBorderTypeFromIndex( nBorder ); - switch( ppeStates[ nLine ][ nBorder ] ) - { - case SHOW: aFrameSel.SelectBorder( eBorder ); break; - case HIDE: /* nothing to do */ break; - case DONT: aFrameSel.SetBorderDontCare( eBorder ); break; - } - } - - // Show all lines that have been selected above - if( aFrameSel.IsAnyBorderSelected() ) - { - // any visible style, but "no-line" in line list box? -> use hair-line - if( (aLbLineStyle.GetSelectEntryPos() == 0) || (aLbLineStyle.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND) ) - aLbLineStyle.SelectEntryPos( 1 ); - - // set current style to all previously selected lines - SelStyleHdl_Impl( &aLbLineStyle ); - SelColHdl_Impl( &aLbLineColor ); - } - - // Presets ValueSet does not show a selection (used as push buttons). - aWndPresets.SetNoSelection(); - - LinesChanged_Impl( 0 ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxBorderTabPage, SelSdwHdl_Impl, void *, EMPTYARG ) -{ - sal_Bool bEnable = aWndShadows.GetSelectItemId() > 1; - aFtShadowSize.Enable(bEnable); - aEdShadowSize.Enable(bEnable); - aFtShadowColor.Enable(bEnable); - aLbShadowColor.Enable(bEnable); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxBorderTabPage, SelColHdl_Impl, ListBox *, pLb ) -{ - ColorListBox* pColLb = (ColorListBox*)pLb; - - if ( pLb == &aLbLineColor ) - { - aFrameSel.SetColorToSelection( pColLb->GetSelectEntryColor() ); - aLbLineStyle.SetColor( pColLb->GetSelectEntryColor() ); - } - - return 0; -} - -IMPL_LINK( SvxBorderTabPage, ModifyWidthHdl_Impl, void *, EMPTYARG ) -{ - sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( - aLineWidthMF.GetValue( ), - aLineWidthMF.GetDecimalDigits( ), - aLineWidthMF.GetUnit(), MAP_TWIP )); - aLbLineStyle.SetWidth( nVal ); - - aFrameSel.SetStyleToSelection( nVal, - SvxBorderStyle( aLbLineStyle.GetSelectEntryStyle() ) ); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox *, pLb ) -{ - if ( pLb == &aLbLineStyle ) - { - sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( - aLineWidthMF.GetValue( ), - aLineWidthMF.GetDecimalDigits( ), - aLineWidthMF.GetUnit(), MAP_TWIP )); - aFrameSel.SetStyleToSelection ( nVal, - SvxBorderStyle( aLbLineStyle.GetSelectEntryStyle() ) ); - } - - return 0; -} - -// ============================================================================ -// ValueSet handling -// ============================================================================ - -// number of preset images to show -const sal_uInt16 SVX_BORDER_PRESET_COUNT = 5; - -// number of shadow images to show -const sal_uInt16 SVX_BORDER_SHADOW_COUNT = 5; - -// ---------------------------------------------------------------------------- - -sal_uInt16 SvxBorderTabPage::GetPresetImageId( sal_uInt16 nValueSetIdx ) const -{ - // table with all sets of predefined border styles - static const sal_uInt16 ppnImgIds[][ SVX_BORDER_PRESET_COUNT ] = - { - // simple cell without diagonal frame borders - { IID_PRE_CELL_NONE, IID_PRE_CELL_ALL, IID_PRE_CELL_LR, IID_PRE_CELL_TB, IID_PRE_CELL_L }, - // simple cell with diagonal frame borders - { IID_PRE_CELL_NONE, IID_PRE_CELL_ALL, IID_PRE_CELL_LR, IID_PRE_CELL_TB, IID_PRE_CELL_DIAG }, - // with horizontal inner frame border - { IID_PRE_HOR_NONE, IID_PRE_HOR_OUTER, IID_PRE_HOR_HOR, IID_PRE_HOR_ALL, IID_PRE_HOR_OUTER2 }, - // with vertical inner frame border - { IID_PRE_VER_NONE, IID_PRE_VER_OUTER, IID_PRE_VER_VER, IID_PRE_VER_ALL, IID_PRE_VER_OUTER2 }, - // with horizontal and vertical inner frame borders - { IID_PRE_TABLE_NONE, IID_PRE_TABLE_OUTER, IID_PRE_TABLE_OUTERH, IID_PRE_TABLE_ALL, IID_PRE_TABLE_OUTER2 } - }; - - // find correct set of presets - int nLine = 0; - if( !mbHorEnabled && !mbVerEnabled ) - nLine = (mbTLBREnabled || mbBLTREnabled) ? 1 : 0; - else if( mbHorEnabled && !mbVerEnabled ) - nLine = 2; - else if( !mbHorEnabled && mbVerEnabled ) - nLine = 3; - else - nLine = 4; - - DBG_ASSERT( (1 <= nValueSetIdx) && (nValueSetIdx <= SVX_BORDER_PRESET_COUNT), - "SvxBorderTabPage::GetPresetImageId - wrong index" ); - return ppnImgIds[ nLine ][ nValueSetIdx - 1 ]; -} - -sal_uInt16 SvxBorderTabPage::GetPresetStringId( sal_uInt16 nValueSetIdx ) const -{ - // string resource IDs for each image (in order of the IID_PRE_* image IDs) - static const sal_uInt16 pnStrIds[] = - { - RID_SVXSTR_TABLE_PRESET_NONE, - RID_SVXSTR_PARA_PRESET_ALL, - RID_SVXSTR_PARA_PRESET_LEFTRIGHT, - RID_SVXSTR_PARA_PRESET_TOPBOTTOM, - RID_SVXSTR_PARA_PRESET_ONLYLEFT, - RID_SVXSTR_PARA_PRESET_DIAGONAL, - - RID_SVXSTR_TABLE_PRESET_NONE, - RID_SVXSTR_TABLE_PRESET_ONLYOUTER, - RID_SVXSTR_HOR_PRESET_ONLYHOR, - RID_SVXSTR_TABLE_PRESET_OUTERALL, - RID_SVXSTR_TABLE_PRESET_OUTERINNER, - - RID_SVXSTR_TABLE_PRESET_NONE, - RID_SVXSTR_TABLE_PRESET_ONLYOUTER, - RID_SVXSTR_VER_PRESET_ONLYVER, - RID_SVXSTR_TABLE_PRESET_OUTERALL, - RID_SVXSTR_TABLE_PRESET_OUTERINNER, - - RID_SVXSTR_TABLE_PRESET_NONE, - RID_SVXSTR_TABLE_PRESET_ONLYOUTER, - RID_SVXSTR_TABLE_PRESET_OUTERHORI, - RID_SVXSTR_TABLE_PRESET_OUTERALL, - RID_SVXSTR_TABLE_PRESET_OUTERINNER - }; - return pnStrIds[ GetPresetImageId( nValueSetIdx ) - 1 ]; -} - -// ---------------------------------------------------------------------------- - -void SvxBorderTabPage::FillPresetVS() -{ - ImageList& rImgList = aBorderImgLst; - Size aImgSize( rImgList.GetImage( IID_PRE_CELL_NONE ).GetSizePixel() ); - - // basic initialization of the ValueSet - aWndPresets.SetColCount( SVX_BORDER_PRESET_COUNT ); - aWndPresets.SetStyle( aWndPresets.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER ); - aWndPresets.SetSizePixel( aWndPresets.CalcWindowSizePixel( aImgSize ) ); - - // insert images and help texts - for( sal_uInt16 nVSIdx = 1; nVSIdx <= SVX_BORDER_PRESET_COUNT; ++nVSIdx ) - { - aWndPresets.InsertItem( nVSIdx ); - aWndPresets.SetItemImage( nVSIdx, rImgList.GetImage( GetPresetImageId( nVSIdx ) ) ); - aWndPresets.SetItemText( nVSIdx, CUI_RESSTR( GetPresetStringId( nVSIdx ) ) ); - } - - // show the control - aWndPresets.SetNoSelection(); - aWndPresets.Show(); -} - -// ---------------------------------------------------------------------------- - -void SvxBorderTabPage::FillShadowVS() -{ - ImageList& rImgList = aShadowImgLst; - Size aImgSize( rImgList.GetImage( IID_SHADOWNONE ).GetSizePixel() ); - - // basic initialization of the ValueSet - aWndShadows.SetColCount( SVX_BORDER_SHADOW_COUNT ); - aWndShadows.SetStyle( aWndShadows.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER ); - aWndShadows.SetSizePixel( aWndShadows.CalcWindowSizePixel( aImgSize ) ); - - // image resource IDs - static const sal_uInt16 pnImgIds[ SVX_BORDER_SHADOW_COUNT ] = - { IID_SHADOWNONE, IID_SHADOW_BOT_RIGHT, IID_SHADOW_TOP_RIGHT, IID_SHADOW_BOT_LEFT, IID_SHADOW_TOP_LEFT }; - // string resource IDs for each image - static const sal_uInt16 pnStrIds[ SVX_BORDER_SHADOW_COUNT ] = - { RID_SVXSTR_SHADOW_STYLE_NONE, RID_SVXSTR_SHADOW_STYLE_BOTTOMRIGHT, RID_SVXSTR_SHADOW_STYLE_TOPRIGHT, RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT, RID_SVXSTR_SHADOW_STYLE_TOPLEFT }; - - // insert images and help texts - for( sal_uInt16 nVSIdx = 1; nVSIdx <= SVX_BORDER_SHADOW_COUNT; ++nVSIdx ) - { - aWndShadows.InsertItem( nVSIdx ); - aWndShadows.SetItemImage( nVSIdx, rImgList.GetImage( pnImgIds[ nVSIdx - 1 ] ) ); - aWndShadows.SetItemText( nVSIdx, CUI_RESSTR( pnStrIds[ nVSIdx - 1 ] ) ); - } - - // show the control - aWndShadows.SelectItem( 1 ); - aWndShadows.Show(); -} - -// ---------------------------------------------------------------------------- - -void SvxBorderTabPage::FillValueSets() -{ - FillPresetVS(); - FillShadowVS(); -} - -// ============================================================================ -Color lcl_mediumColor( Color aMain, Color /*aDefault*/ ) -{ - return SvxBorderLine::threeDMediumColor( aMain ); -} - -void SvxBorderTabPage::FillLineListBox_Impl() -{ - aLbLineStyle.SetSourceUnit( FUNIT_TWIP ); - - aLbLineStyle.SetNone( SVX_RESSTR( RID_SVXSTR_NONE ) ); - - // Simple lines - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( SOLID ), SOLID ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( DOTTED ), DOTTED ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( DASHED ), DASHED ); - - // Double lines - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( DOUBLE ), DOUBLE ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THINTHICK_SMALLGAP ), THINTHICK_SMALLGAP, 20 ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THINTHICK_MEDIUMGAP ), THINTHICK_MEDIUMGAP ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THINTHICK_LARGEGAP ), THINTHICK_LARGEGAP ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THICKTHIN_SMALLGAP ), THICKTHIN_SMALLGAP, 20 ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THICKTHIN_MEDIUMGAP ), THICKTHIN_MEDIUMGAP ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( THICKTHIN_LARGEGAP ), THICKTHIN_LARGEGAP ); - - // Engraved / Embossed - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( EMBOSSED ), EMBOSSED, 15, - &SvxBorderLine::threeDLightColor, &SvxBorderLine::threeDDarkColor, - &lcl_mediumColor ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( ENGRAVED ), ENGRAVED, 15, - &SvxBorderLine::threeDDarkColor, &SvxBorderLine::threeDLightColor, - &lcl_mediumColor ); - - // Inset / Outset - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( OUTSET ), OUTSET, 10, - &SvxBorderLine::lightColor, &SvxBorderLine::darkColor ); - aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( INSET ), INSET, 10, - &SvxBorderLine::darkColor, &SvxBorderLine::lightColor ); - - sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( - aLineWidthMF.GetValue( ), - aLineWidthMF.GetDecimalDigits( ), - aLineWidthMF.GetUnit(), MAP_TWIP )); - aLbLineStyle.SetWidth( nVal ); -} - -// ----------------------------------------------------------------------- -IMPL_LINK( SvxBorderTabPage, LinesChanged_Impl, void*, EMPTYARG ) -{ - if(!mbUseMarginItem && aLeftMF.IsVisible()) - { - sal_Bool bLineSet = aFrameSel.IsAnyBorderVisible(); - sal_Bool bMinAllowed = 0 != (nSWMode & (SW_BORDER_MODE_FRAME|SW_BORDER_MODE_TABLE)); - sal_Bool bSpaceModified = aLeftMF .IsModified()|| - aRightMF .IsModified()|| - aTopMF .IsModified()|| - aBottomMF.IsModified(); - - if(bLineSet) - { - if(!bMinAllowed) - { - aLeftMF .SetFirst(nMinValue); - aRightMF .SetFirst(nMinValue); - aTopMF .SetFirst(nMinValue); - aBottomMF.SetFirst(nMinValue); - } - if(!bSpaceModified) - { - aLeftMF .SetValue(nMinValue); - aRightMF .SetValue(nMinValue); - aTopMF .SetValue(nMinValue); - aBottomMF.SetValue(nMinValue); - } - } - else - { - aLeftMF .SetMin(0); - aRightMF .SetMin(0); - aTopMF .SetMin(0); - aBottomMF.SetMin(0); - aLeftMF .SetFirst(0); - aRightMF .SetFirst(0); - aTopMF .SetFirst(0); - aBottomMF.SetFirst(0); - if(!bSpaceModified) - { - aLeftMF .SetValue(0); - aRightMF .SetValue(0); - aTopMF .SetValue(0); - aBottomMF.SetValue(0); - } - } - //fuer Tabellen ist alles erlaubt - sal_uInt16 nValid = VALID_TOP|VALID_BOTTOM|VALID_LEFT|VALID_RIGHT; - - //fuer Rahmen und Absatz wird das Edit disabled, wenn keine Border gesetzt ist - if(nSWMode & (SW_BORDER_MODE_FRAME|SW_BORDER_MODE_PARA)) - { - if(bLineSet) - { - nValid = (aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_TOP) == svx::FRAMESTATE_SHOW) ? VALID_TOP : 0; - nValid |= (aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_BOTTOM) == svx::FRAMESTATE_SHOW) ? VALID_BOTTOM : 0; - nValid |= (aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_LEFT) == svx::FRAMESTATE_SHOW) ? VALID_LEFT : 0; - nValid |= (aFrameSel.GetFrameBorderState( svx::FRAMEBORDER_RIGHT ) == svx::FRAMESTATE_SHOW) ? VALID_RIGHT : 0; - } - else - nValid = 0; - } - aLeftFT.Enable(0 != (nValid&VALID_LEFT)); - aRightFT.Enable(0 != (nValid&VALID_RIGHT)); - aTopFT.Enable(0 != (nValid&VALID_TOP)); - aBottomFT.Enable(0 != (nValid&VALID_BOTTOM)); - aLeftMF.Enable(0 != (nValid&VALID_LEFT)); - aRightMF.Enable(0 != (nValid&VALID_RIGHT)); - aTopMF.Enable(0 != (nValid&VALID_TOP)); - aBottomMF.Enable(0 != (nValid&VALID_BOTTOM)); - aSynchronizeCB.Enable( aRightMF.IsEnabled() || aTopMF.IsEnabled() || - aBottomMF.IsEnabled() || aLeftMF.IsEnabled() ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxBorderTabPage, ModifyDistanceHdl_Impl, MetricField*, pField) -{ - if ( bSync ) - { - sal_Int64 nVal = pField->GetValue(); - if(pField != &aLeftMF) - aLeftMF.SetValue(nVal); - if(pField != &aRightMF) - aRightMF.SetValue(nVal); - if(pField != &aTopMF) - aTopMF.SetValue(nVal); - if(pField != &aBottomMF) - aBottomMF.SetValue(nVal); - } - return 0; -} - -IMPL_LINK( SvxBorderTabPage, SyncHdl_Impl, CheckBox*, pBox) -{ - bSync = pBox->IsChecked(); - return 0; -} - -void SvxBorderTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - FillValueSets(); - - SfxTabPage::DataChanged( rDCEvt ); -} - -void SvxBorderTabPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pSWModeItem,SfxUInt16Item,SID_SWMODE_TYPE,sal_False); - SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False); - if (pSWModeItem) - { - nSWMode = pSWModeItem->GetValue(); - // #i43593# - // show checkbox <aMergeWithNextCB> for format.paragraph - if ( nSWMode == SW_BORDER_MODE_PARA ) - { - aMergeWithNextCB.Show(); - aPropertiesFL.Show(); - } - // show checkbox <aMergeAdjacentBordersCB> for format.paragraph - else if ( nSWMode == SW_BORDER_MODE_TABLE ) - { - aMergeAdjacentBordersCB.Show(); - aPropertiesFL.Show(); - } - } - if (pFlagItem) - if ( ( pFlagItem->GetValue() & SVX_HIDESHADOWCTL ) == SVX_HIDESHADOWCTL ) - HideShadowControls(); -} - -// ============================================================================ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/border.hrc b/cui/source/tabpages/border.hrc deleted file mode 100644 index 4dcfbf171..000000000 --- a/cui/source/tabpages/border.hrc +++ /dev/null @@ -1,106 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_BORDER_HRC -#define _SVX_BORDER_HRC - -// defines ------------------------------------------------------------------ - -#define FL_BORDER 10 -#define WIN_PRESETS 11 -#define WIN_FRAMESEL 12 - -#define FL_SEPARATOR1 19 -#define FL_LINE 20 -#define LB_LINESTYLE 21 -#define LB_LINECOLOR 22 -#define MF_LINEWIDTH 23 - -#define FL_SEPARATOR2 29 -#define FL_SHADOW 30 -#define FT_SHADOWPOS 31 -#define WIN_SHADOWS 32 -#define FT_SHADOWSIZE 33 -#define ED_SHADOWSIZE 34 -#define FT_SHADOWCOLOR 35 -#define LB_SHADOWCOLOR 36 - -#define FT_XSPACE 41 -#define ED_XSPACE 42 - -#define FL_DISTANCE 50 -#define FT_LEFT 51 -#define MF_LEFT 52 -#define FT_RIGHT 53 -#define MF_RIGHT 54 -#define FT_TOP 55 -#define MF_TOP 56 -#define FT_BOTTOM 57 -#define MF_BOTTOM 58 -#define CB_SYNC 59 -#define FT_DEFAULT 60 -#define FT_USERDEF 61 -#define FT_STYLE 62 -#define FT_COLOR 63 -#define FL_PROPERTIES 64 -#define CB_MERGEWITHNEXT 65 -#define CB_MERGEADJACENTBORDERS 66 -#define FT_WIDTH 67 - -// ImageListe fuer ValueSets: -#define IL_PRE_BITMAPS 1400 -#define IID_PRE_CELL_NONE 1 -#define IID_PRE_CELL_ALL 2 -#define IID_PRE_CELL_LR 3 -#define IID_PRE_CELL_TB 4 -#define IID_PRE_CELL_L 5 -#define IID_PRE_CELL_DIAG 6 -#define IID_PRE_HOR_NONE 7 -#define IID_PRE_HOR_OUTER 8 -#define IID_PRE_HOR_HOR 9 -#define IID_PRE_HOR_ALL 10 -#define IID_PRE_HOR_OUTER2 11 -#define IID_PRE_VER_NONE 12 -#define IID_PRE_VER_OUTER 13 -#define IID_PRE_VER_VER 14 -#define IID_PRE_VER_ALL 15 -#define IID_PRE_VER_OUTER2 16 -#define IID_PRE_TABLE_NONE 17 -#define IID_PRE_TABLE_OUTER 18 -#define IID_PRE_TABLE_OUTERH 19 -#define IID_PRE_TABLE_ALL 20 -#define IID_PRE_TABLE_OUTER2 21 - -#define IL_SDW_BITMAPS 1500 -#define IID_SHADOWNONE 1 -#define IID_SHADOW_BOT_RIGHT 2 -#define IID_SHADOW_BOT_LEFT 3 -#define IID_SHADOW_TOP_RIGHT 4 -#define IID_SHADOW_TOP_LEFT 5 - - -#endif - diff --git a/cui/source/tabpages/border.src b/cui/source/tabpages/border.src deleted file mode 100644 index 10599d5e8..000000000 --- a/cui/source/tabpages/border.src +++ /dev/null @@ -1,449 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include "helpid.hrc" -#include <cuires.hrc> -#include "border.hrc" -#include <svx/dialogs.hrc> - - // define --------------------------------------------------------------- -#define STD_MASKCOLOR Color { Red=0xFFFF; Green=0x0000; Blue=0xFFFF; } - // RID_SVXPAGE_BORDER --------------------------------------------------- -TabPage RID_SVXPAGE_BORDER -{ - Size = MAP_APPFONT ( 260 , 185 ) ; - Helpid = HID_BORDER ; - Hide = TRUE ; - Text [ en-US ] = "Borders" ; - FixedLine FL_BORDER - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; - Text [ en-US ] = "Line arrangement" ; - }; - FixedText FT_DEFAULT - { - Pos = MAP_APPFONT ( 12, 14) ; - Size = MAP_APPFONT ( 64, 8) ; - Text [ en-US ] = "~Default"; - }; - Control WIN_PRESETS - { - HelpId = HID_BORDER_CTL_PRESETS ; - Hide = TRUE ; - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 61 , 12 ) ; - TabStop = TRUE ; - }; - FixedText FT_USERDEF - { - Pos = MAP_APPFONT (12 , 41) ; - Size = MAP_APPFONT ( 64, 8) ; - Text [ en-US ] = "~User-defined"; - }; - Control WIN_FRAMESEL - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 53 ) ; - Size = MAP_APPFONT ( 61 , 65 ) ; - TabStop = TRUE ; - Text = "Border control"; - }; - FixedLine FL_SEPARATOR1 - { - Pos = MAP_APPFONT ( 77 , 14 ) ; - Size = MAP_APPFONT ( 4 , 104 ) ; - Vert = TRUE ; - }; - FixedLine FL_LINE - { - Pos = MAP_APPFONT ( 82 , 3 ) ; - Size = MAP_APPFONT ( 83 , 8 ) ; - Text [ en-US ] = "Line" ; - }; - FixedText FT_STYLE - { - Pos = MAP_APPFONT ( 88, 14) ; - Size = MAP_APPFONT ( 77, 8) ; - Text [ en-US ] = "St~yle"; - }; - ListBox LB_LINESTYLE - { - HelpID = "cui:ListBox:RID_SVXPAGE_BORDER:LB_LINESTYLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 88 , 25 ) ; - Size = MAP_APPFONT ( 74 , 66 ) ; - DropDown = TRUE ; - }; - FixedText FT_WIDTH - { - Pos = MAP_APPFONT ( 88, 39 ) ; - Size = MAP_APPFONT ( 77, 8 ) ; - Text [ en-US ] = "~Width"; - }; - MetricField MF_LINEWIDTH - { - Border = TRUE ; - Pos = MAP_APPFONT ( 88 , 50 ) ; - Size = MAP_APPFONT ( 74 , 12 ) ; - Spin = TRUE ; - Repeat = TRUE ; - SpinSize = 25 ; - First = 25 ; - Last = 900 ; - Maximum = 900 ; - Minimum = 25 ; - DecimalDigits = 2 ; - Unit = FUNIT_POINT ; - }; - FixedText FT_COLOR - { - Pos = MAP_APPFONT ( 88, 64 ) ; - Size = MAP_APPFONT ( 77, 8 ) ; - Text [ en-US ] = "~Color"; - }; - ListBox LB_LINECOLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_BORDER:LB_LINECOLOR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 88 , 75 ) ; - Size = MAP_APPFONT ( 74 , 68 ) ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - FixedLine FL_SEPARATOR2 - { - Pos = MAP_APPFONT ( 166 , 14 ) ; - Size = MAP_APPFONT ( 4 , 104 ) ; - Vert = TRUE ; - }; - FixedText FT_LEFT - { - Pos = MAP_APPFONT ( 177 , 16 ) ; - Size = MAP_APPFONT ( 34 , 8 ) ; - Text [ en-US ] = "~Left"; - }; - MetricField MF_LEFT - { - HelpID = "cui:MetricField:RID_SVXPAGE_BORDER:MF_LEFT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 213 , 14 ) ; - Size = MAP_APPFONT ( 38 , 12 ) ; - Spin = TRUE ; - Repeat = TRUE ; - SpinSize = 10 ; - First = 100 ; - Last = 5000 ; - Maximum = 5000 ; - Minimum = 0 ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - }; - FixedText FT_RIGHT - { - Pos = MAP_APPFONT ( 177 , 32 ) ; - Size = MAP_APPFONT ( 34 , 8 ) ; - Text [ en-US ] = "Right"; - }; - MetricField MF_RIGHT - { - HelpID = "cui:MetricField:RID_SVXPAGE_BORDER:MF_RIGHT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 213 , 30 ) ; - Size = MAP_APPFONT ( 38 , 12 ) ; - Spin = TRUE ; - Repeat = TRUE ; - SpinSize = 10 ; - First = 100 ; - Last = 5000 ; - Maximum = 5000 ; - Minimum = 0 ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - }; - FixedText FT_TOP - { - Pos = MAP_APPFONT ( 177 , 48 ) ; - Size = MAP_APPFONT ( 34 , 8 ) ; - Text [ en-US ] = "~Top"; - }; - MetricField MF_TOP - { - HelpID = "cui:MetricField:RID_SVXPAGE_BORDER:MF_TOP"; - Border = TRUE ; - Pos = MAP_APPFONT ( 213 , 46 ) ; - Size = MAP_APPFONT ( 38 , 12 ) ; - Spin = TRUE ; - Repeat = TRUE ; - SpinSize = 10 ; - First = 100 ; - Last = 5000 ; - Maximum = 5000 ; - Minimum = 0 ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - }; - FixedText FT_BOTTOM - { - Pos = MAP_APPFONT ( 177 , 64 ) ; - Size = MAP_APPFONT ( 34 , 8 ) ; - Text [ en-US ] = "~Bottom"; - }; - MetricField MF_BOTTOM - { - HelpID = "cui:MetricField:RID_SVXPAGE_BORDER:MF_BOTTOM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 213 , 62 ) ; - Size = MAP_APPFONT ( 38 , 12 ) ; - Spin = TRUE ; - Repeat = TRUE ; - SpinSize = 10 ; - First = 100 ; - Last = 5000 ; - Maximum = 5000 ; - Minimum = 0 ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - }; - CheckBox CB_SYNC - { - HelpID = "cui:CheckBox:RID_SVXPAGE_BORDER:CB_SYNC"; - Pos = MAP_APPFONT ( 177 , 78 ) ; - Size = MAP_APPFONT ( 74 , 10 ) ; - Text [ en-US ] = "Synchronize"; - }; - FixedLine FL_DISTANCE - { - Pos = MAP_APPFONT ( 171 , 3 ) ; - Size = MAP_APPFONT ( 83 , 8 ) ; - Text [ en-US ] = "Spacing to contents"; - }; - - FixedText FT_SHADOWPOS - { - Pos = MAP_APPFONT ( 12 , 133 ) ; - Size = MAP_APPFONT ( 74 , 8 ) ; - Text [ en-US ] = "~Position" ; - }; - Control WIN_SHADOWS - { - HelpId = HID_BORDER_CTL_SHADOWS ; - Hide = TRUE ; - Pos = MAP_APPFONT ( 12 , 144 ) ; - Size = MAP_APPFONT ( 74 , 12 ) ; - TabStop = TRUE ; - }; - FixedText FT_SHADOWSIZE - { - Pos = MAP_APPFONT ( 88 , 133 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "Distan~ce"; - }; - MetricField ED_SHADOWSIZE - { - HelpID = "cui:MetricField:RID_SVXPAGE_BORDER:ED_SHADOWSIZE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 88 , 144 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Spin = TRUE ; - Repeat = TRUE ; - SpinSize = 10 ; - First = 100 ; - Last = 5000 ; - Maximum = 5000 ; - Minimum = 50 ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - }; - FixedText FT_SHADOWCOLOR - { - Pos = MAP_APPFONT ( 177 , 133 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "C~olor" ; - }; - ListBox LB_SHADOWCOLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_BORDER:LB_SHADOWCOLOR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 177 , 144 ) ; - Size = MAP_APPFONT ( 74 , 68 ) ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - FixedLine FL_SHADOW - { - Pos = MAP_APPFONT ( 6 , 123 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Shadow style" ; - }; - FixedLine FL_PROPERTIES - { - Pos = MAP_APPFONT ( 6 , 162 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Hide = TRUE; - Text [ en-US ] = "Properties" ; - }; - CheckBox CB_MERGEWITHNEXT - { - HelpID = "cui:CheckBox:RID_SVXPAGE_BORDER:CB_MERGEWITHNEXT"; - Pos = MAP_APPFONT ( 12 , 173 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Hide = TRUE; - Text [ en-US ] = "~Merge with next paragraph" ; - }; - CheckBox CB_MERGEADJACENTBORDERS - { - HelpID = "cui:CheckBox:RID_SVXPAGE_BORDER:CB_MERGEADJACENTBORDERS"; - Pos = MAP_APPFONT ( 12 , 173 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Hide = TRUE; - Text [ en-US ] = "~Merge adjacent line styles" ; - }; - -#define _PREVIEW_IDLIST_ \ - IdList = \ - { \ - IID_PRE_CELL_NONE ; \ - IID_PRE_CELL_ALL ; \ - IID_PRE_CELL_LR ; \ - IID_PRE_CELL_TB ; \ - IID_PRE_CELL_L ; \ - IID_PRE_CELL_DIAG ; \ - IID_PRE_HOR_NONE ; \ - IID_PRE_HOR_OUTER ; \ - IID_PRE_HOR_HOR ; \ - IID_PRE_HOR_ALL ; \ - IID_PRE_HOR_OUTER2 ; \ - IID_PRE_VER_NONE ; \ - IID_PRE_VER_OUTER ; \ - IID_PRE_VER_VER ; \ - IID_PRE_VER_ALL ; \ - IID_PRE_VER_OUTER2 ; \ - IID_PRE_TABLE_NONE ; \ - IID_PRE_TABLE_OUTER ; \ - IID_PRE_TABLE_OUTERH ; \ - IID_PRE_TABLE_ALL ; \ - IID_PRE_TABLE_OUTER2 ; \ - }; \ - IdCount = { 21 ; }; - - ImageList IL_PRE_BITMAPS - { - Prefix = "pr"; - MaskColor = STD_MASKCOLOR ; - _PREVIEW_IDLIST_ - }; - -#define _SHADOW_IDLIST_ \ - IdList = \ - { \ - IID_SHADOWNONE ; \ - IID_SHADOW_BOT_RIGHT ; \ - IID_SHADOW_BOT_LEFT ; \ - IID_SHADOW_TOP_RIGHT ; \ - IID_SHADOW_TOP_LEFT ; \ - }; \ - IdCount = { 5 ; }; - - ImageList IL_SDW_BITMAPS - { - Prefix = "sh"; - MaskColor = STD_MASKCOLOR ; - _SHADOW_IDLIST_ - }; -}; - -String RID_SVXSTR_TABLE_PRESET_NONE -{ - Text [ en-US ] = "Set No Borders" ; -}; -String RID_SVXSTR_TABLE_PRESET_ONLYOUTER -{ - Text [ en-US ] = "Set Outer Border Only" ; -}; -String RID_SVXSTR_TABLE_PRESET_OUTERHORI -{ - Text [ en-US ] = "Set Outer Border and Horizontal Lines" ; -}; -String RID_SVXSTR_TABLE_PRESET_OUTERALL -{ - Text [ en-US ] = "Set Outer Border and All Inner Lines" ; -}; -String RID_SVXSTR_TABLE_PRESET_OUTERINNER -{ - Text [ en-US ] = "Set Outer Border Without Changing Inner Lines" ; -}; -String RID_SVXSTR_PARA_PRESET_DIAGONAL -{ - Text [ en-US ] = "Set Diagonal Lines Only" ; -}; -String RID_SVXSTR_PARA_PRESET_ALL -{ - Text [ en-US ] = "Set All Four Borders" ; -}; -String RID_SVXSTR_PARA_PRESET_LEFTRIGHT -{ - Text [ en-US ] = "Set Left and Right Borders Only" ; -}; -String RID_SVXSTR_PARA_PRESET_TOPBOTTOM -{ - Text [ en-US ] = "Set Top and Bottom Borders Only" ; -}; -String RID_SVXSTR_PARA_PRESET_ONLYLEFT -{ - Text [ en-US ] = "Set Left Border Only" ; -}; -String RID_SVXSTR_HOR_PRESET_ONLYHOR -{ - Text [ en-US ] = "Set Top and Bottom Borders, and All Inner Lines"; -}; -String RID_SVXSTR_VER_PRESET_ONLYVER -{ - Text [ en-US ] = "Set Left and Right Borders, and All Inner Lines"; -}; -String RID_SVXSTR_SHADOW_STYLE_NONE -{ - Text [ en-US ] = "No Shadow" ; -}; -String RID_SVXSTR_SHADOW_STYLE_BOTTOMRIGHT -{ - Text [ en-US ] = "Cast Shadow to Bottom Right" ; -}; -String RID_SVXSTR_SHADOW_STYLE_TOPRIGHT -{ - Text [ en-US ] = "Cast Shadow to Top Right" ; -}; -String RID_SVXSTR_SHADOW_STYLE_BOTTOMLEFT -{ - Text [ en-US ] = "Cast Shadow to Bottom Left" ; -}; -String RID_SVXSTR_SHADOW_STYLE_TOPLEFT -{ - Text [ en-US ] = "Cast Shadow to Top Left" ; -}; - -// ********************************************************************** diff --git a/cui/source/tabpages/borderconn.cxx b/cui/source/tabpages/borderconn.cxx deleted file mode 100644 index 263eb95c4..000000000 --- a/cui/source/tabpages/borderconn.cxx +++ /dev/null @@ -1,303 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include "borderconn.hxx" -#include <svx/frmsel.hxx> -#include "editeng/bolnitem.hxx" -#include <editeng/boxitem.hxx> -#include <svx/algitem.hxx> -#include <editeng/shaditem.hxx> - -namespace svx { - -/* ============================================================================ -SvxLineItem connection ----------------------- -Connects an SvxLineItem (that contains the style of one line of a cell border) -with one frame border from a svx::FrameSelector control. If this connection is -used, no additional code is needed in the Reset() and FillItemSet() functions -of the tab page. -============================================================================ */ - -// 1st: item wrappers --------------------------------------------------------- - -class LineItemWrapper : public sfx::SingleItemWrapper< SvxLineItem, const editeng::SvxBorderLine* > -{ -public: - inline explicit LineItemWrapper( sal_uInt16 nSlot ) : SingleItemWrapperType( nSlot ) {} - - virtual const editeng::SvxBorderLine* GetItemValue( const SvxLineItem& rItem ) const - { return rItem.GetLine(); } - virtual void SetItemValue( SvxLineItem& rItem, const editeng::SvxBorderLine* pLine ) const - { rItem.SetLine( pLine ); } -}; - -// 2nd: control wrappers ------------------------------------------------------ - -class FrameSelectorWrapper : public sfx::SingleControlWrapper< FrameSelector, const editeng::SvxBorderLine* > -{ -public: - inline explicit FrameSelectorWrapper( FrameSelector& rFrameSel, FrameBorderType eBorder ) : - SingleControlWrapperType( rFrameSel ), meBorder( eBorder ) {} - - virtual bool IsControlDontKnow() const; - virtual void SetControlDontKnow( bool bSet ); - - virtual const editeng::SvxBorderLine* GetControlValue() const; - virtual void SetControlValue( const editeng::SvxBorderLine* pLine ); - -private: - FrameBorderType meBorder; /// The line this wrapper works with. -}; - -bool FrameSelectorWrapper::IsControlDontKnow() const -{ - return GetControl().GetFrameBorderState( meBorder ) == FRAMESTATE_DONTCARE; -} - -void FrameSelectorWrapper::SetControlDontKnow( bool bSet ) -{ - if( bSet ) - GetControl().SetBorderDontCare( meBorder ); -} - -const editeng::SvxBorderLine* FrameSelectorWrapper::GetControlValue() const -{ - return GetControl().GetFrameBorderStyle( meBorder ); -} - -void FrameSelectorWrapper::SetControlValue( const editeng::SvxBorderLine* pLine ) -{ - GetControl().ShowBorder( meBorder, pLine ); -} - -// 3rd: connection ------------------------------------------------------------ - -typedef sfx::ItemControlConnection< LineItemWrapper, FrameSelectorWrapper > FrameLineConnection; - -/* ============================================================================ -SvxMarginItem connection ------------------------- -Connects an SvxMarginItem (that contains the inner margin of all cell borders) -with the numerical edit controls of the SvxBorderTabPage. If this connection is -used, no additional code is needed in the Reset() and FillItemSet() functions -of the tab page. -============================================================================ */ - -// 1st: item wrappers --------------------------------------------------------- - -typedef sfx::IdentItemWrapper< SvxMarginItem > MarginItemWrapper; - -// 2nd: control wrappers ------------------------------------------------------ - -class MarginControlsWrapper : public sfx::MultiControlWrapper< SvxMarginItem > -{ -public: - explicit MarginControlsWrapper( - MetricField& rMfLeft, MetricField& rMfRight, - MetricField& rMfTop, MetricField& rMfBottom ); - - virtual SvxMarginItem GetControlValue() const; - virtual void SetControlValue( SvxMarginItem aItem ); - -private: - sfx::Int16MetricFieldWrapper maLeftWrp; - sfx::Int16MetricFieldWrapper maRightWrp; - sfx::Int16MetricFieldWrapper maTopWrp; - sfx::Int16MetricFieldWrapper maBottomWrp; -}; - -MarginControlsWrapper::MarginControlsWrapper( - MetricField& rMfLeft, MetricField& rMfRight, MetricField& rMfTop, MetricField& rMfBottom ) : - maLeftWrp( rMfLeft, FUNIT_TWIP ), - maRightWrp( rMfRight, FUNIT_TWIP ), - maTopWrp( rMfTop, FUNIT_TWIP ), - maBottomWrp( rMfBottom, FUNIT_TWIP ) -{ - RegisterControlWrapper( maLeftWrp ); - RegisterControlWrapper( maRightWrp ); - RegisterControlWrapper( maTopWrp ); - RegisterControlWrapper( maBottomWrp ); -} - -SvxMarginItem MarginControlsWrapper::GetControlValue() const -{ - SvxMarginItem aItem( GetDefaultValue() ); - if( !maLeftWrp.IsControlDontKnow() ) - aItem.SetLeftMargin( maLeftWrp.GetControlValue() ); - if( !maRightWrp.IsControlDontKnow() ) - aItem.SetRightMargin( maRightWrp.GetControlValue() ); - if( !maTopWrp.IsControlDontKnow() ) - aItem.SetTopMargin( maTopWrp.GetControlValue() ); - if( !maBottomWrp.IsControlDontKnow() ) - aItem.SetBottomMargin( maBottomWrp.GetControlValue() ); - return aItem; -} - -void MarginControlsWrapper::SetControlValue( SvxMarginItem aItem ) -{ - maLeftWrp.SetControlValue( aItem.GetLeftMargin() ); - maRightWrp.SetControlValue( aItem.GetRightMargin() ); - maTopWrp.SetControlValue( aItem.GetTopMargin() ); - maBottomWrp.SetControlValue( aItem.GetBottomMargin() ); -} - -// 3rd: connection ------------------------------------------------------------ - -class MarginConnection : public sfx::ItemControlConnection< MarginItemWrapper, MarginControlsWrapper > -{ -public: - explicit MarginConnection( const SfxItemSet& rItemSet, - MetricField& rMfLeft, MetricField& rMfRight, - MetricField& rMfTop, MetricField& rMfBottom, - sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT ); -}; - -MarginConnection::MarginConnection( const SfxItemSet& rItemSet, - MetricField& rMfLeft, MetricField& rMfRight, MetricField& rMfTop, MetricField& rMfBottom, - sfx::ItemConnFlags nFlags ) : - ItemControlConnectionType( SID_ATTR_ALIGN_MARGIN, new MarginControlsWrapper( rMfLeft, rMfRight, rMfTop, rMfBottom ), nFlags ) -{ - mxCtrlWrp->SetDefaultValue( maItemWrp.GetDefaultItem( rItemSet ) ); -} - -/* ============================================================================ -SvxShadowItem connection ------------------------- -Connects an SvxShadowItem (that contains shadow position, size, and color) with -the controls of the SvxBorderTabPage. If this connection is used, no additional -code is needed in the Reset() and FillItemSet() functions of the tab page. -============================================================================ */ - -// 1st: item wrappers --------------------------------------------------------- - -typedef sfx::IdentItemWrapper< SvxShadowItem > ShadowItemWrapper; - -// 2nd: control wrappers ------------------------------------------------------ - -typedef sfx::ValueSetWrapper< SvxShadowLocation > ShadowPosWrapper; -static const ShadowPosWrapper::MapEntryType s_pShadowPosMap[] = -{ - { 1, SVX_SHADOW_NONE }, - { 2, SVX_SHADOW_BOTTOMRIGHT }, - { 3, SVX_SHADOW_TOPRIGHT }, - { 4, SVX_SHADOW_BOTTOMLEFT }, - { 5, SVX_SHADOW_TOPLEFT }, - { VALUESET_ITEM_NOTFOUND, SVX_SHADOW_NONE } -}; - -class ShadowControlsWrapper : public sfx::MultiControlWrapper< SvxShadowItem > -{ -public: - explicit ShadowControlsWrapper( ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor ); - - virtual SvxShadowItem GetControlValue() const; - virtual void SetControlValue( SvxShadowItem aItem ); - -private: - ShadowPosWrapper maPosWrp; - sfx::UShortMetricFieldWrapper maSizeWrp; - sfx::ColorListBoxWrapper maColorWrp; -}; - -ShadowControlsWrapper::ShadowControlsWrapper( - ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor ) : - maPosWrp( rVsPos, s_pShadowPosMap ), - maSizeWrp( rMfSize, FUNIT_TWIP ), - maColorWrp( rLbColor ) -{ - RegisterControlWrapper( maPosWrp ); - RegisterControlWrapper( maSizeWrp ); - RegisterControlWrapper( maColorWrp ); -} - -SvxShadowItem ShadowControlsWrapper::GetControlValue() const -{ - SvxShadowItem aItem( GetDefaultValue() ); - if( !maPosWrp.IsControlDontKnow() ) - aItem.SetLocation( maPosWrp.GetControlValue() ); - if( !maSizeWrp.IsControlDontKnow() ) - aItem.SetWidth( maSizeWrp.GetControlValue() ); - if( !maColorWrp.IsControlDontKnow() ) - aItem.SetColor( maColorWrp.GetControlValue() ); - return aItem; -} - -void ShadowControlsWrapper::SetControlValue( SvxShadowItem aItem ) -{ - maPosWrp.SetControlValue( aItem.GetLocation() ); - maSizeWrp.SetControlValue( aItem.GetWidth() ); - maColorWrp.SetControlValue( aItem.GetColor() ); -} - -// 3rd: connection ------------------------------------------------------------ - -class ShadowConnection : public sfx::ItemControlConnection< ShadowItemWrapper, ShadowControlsWrapper > -{ -public: - explicit ShadowConnection( const SfxItemSet& rItemSet, - ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor, - sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT ); -}; - -ShadowConnection::ShadowConnection( const SfxItemSet& rItemSet, - ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor, sfx::ItemConnFlags nFlags ) : - ItemControlConnectionType( SID_ATTR_BORDER_SHADOW, new ShadowControlsWrapper( rVsPos, rMfSize, rLbColor ), nFlags ) -{ - mxCtrlWrp->SetDefaultValue( maItemWrp.GetDefaultItem( rItemSet ) ); -} - -// ============================================================================ -// ============================================================================ - -sfx::ItemConnectionBase* CreateFrameLineConnection( sal_uInt16 nSlot, - FrameSelector& rFrameSel, FrameBorderType eBorder, sfx::ItemConnFlags nFlags ) -{ - return new FrameLineConnection( nSlot, new FrameSelectorWrapper( rFrameSel, eBorder ), nFlags ); -} - -sfx::ItemConnectionBase* CreateMarginConnection( const SfxItemSet& rItemSet, - MetricField& rMfLeft, MetricField& rMfRight, - MetricField& rMfTop, MetricField& rMfBottom, - sfx::ItemConnFlags nFlags ) -{ - return new MarginConnection( rItemSet, rMfLeft, rMfRight, rMfTop, rMfBottom, nFlags ); -} - -sfx::ItemConnectionBase* CreateShadowConnection( const SfxItemSet& rItemSet, - ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor, - sfx::ItemConnFlags nFlags ) -{ - return new ShadowConnection( rItemSet, rVsPos, rMfSize, rLbColor, nFlags ); -} - -// ============================================================================ - -} // namespace svx - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/borderconn.hxx b/cui/source/tabpages/borderconn.hxx deleted file mode 100644 index 1993787f8..000000000 --- a/cui/source/tabpages/borderconn.hxx +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#ifndef SVX_BORDERCONN_HXX -#define SVX_BORDERCONN_HXX - -#include <sfx2/itemconnect.hxx> -#include <svx/framebordertype.hxx> - -class SfxItemSet; -class MetricField; -class ValueSet; -class ColorListBox; - -namespace svx { - -class FrameSelector; - -// ============================================================================ - -/** Creates an item connection object that connects an SvxLineItem with an - svx::FrameSelector control. */ -sfx::ItemConnectionBase* CreateFrameLineConnection( sal_uInt16 nSlot, - FrameSelector& rFrameSel, FrameBorderType eBorder, - sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT ); - -/** Creates an item connection object that connects an SvxMarginItem with the - controls of the SvxBorderTabPage. */ -sfx::ItemConnectionBase* CreateMarginConnection( const SfxItemSet& rItemSet, - MetricField& rMfLeft, MetricField& rMfRight, - MetricField& rMfTop, MetricField& rMfBottom, - sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT ); - -/** Creates an item connection object that connects an SvxShadowItem with the - controls of the SvxBorderTabPage. */ -sfx::ItemConnectionBase* CreateShadowConnection( const SfxItemSet& rItemSet, - ValueSet& rVsPos, MetricField& rMfSize, ColorListBox& rLbColor, - sfx::ItemConnFlags nFlags = sfx::ITEMCONN_DEFAULT ); - -// ============================================================================ - -} // namespace svx - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx deleted file mode 100644 index daf8b6d6d..000000000 --- a/cui/source/tabpages/chardlg.cxx +++ /dev/null @@ -1,3754 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <editeng/unolingu.hxx> -#include <vcl/svapp.hxx> -#include <unotools/pathoptions.hxx> -#include <svtools/ctrltool.hxx> -#include <svl/sfontitm.hxx> -#include <sfx2/printer.hxx> -#include <sfx2/objsh.hxx> -#include <sfx2/viewsh.hxx> -#include <sfx2/bindings.hxx> -#include <sfx2/viewfrm.hxx> -#include <vcl/msgbox.hxx> -#include <svx/dialmgr.hxx> -#include <svx/dialogs.hrc> -#include <svtools/unitconv.hxx> - -#define _SVX_CHARDLG_CXX -#include <svl/languageoptions.hxx> - -#include "chardlg.hrc" - -#include <svx/xtable.hxx> // XColorTable -#include "chardlg.hxx" -#include "editeng/fontitem.hxx" -#include <editeng/postitem.hxx> -#include <editeng/udlnitem.hxx> -#include <editeng/crsditem.hxx> -#include <editeng/cntritem.hxx> -#include <editeng/langitem.hxx> -#include <editeng/wghtitem.hxx> -#include <editeng/fhgtitem.hxx> -#include <editeng/shdditem.hxx> -#include <editeng/escpitem.hxx> -#include <editeng/prszitem.hxx> -#include <editeng/wrlmitem.hxx> -#include <editeng/cmapitem.hxx> -#include <editeng/kernitem.hxx> -#include <editeng/blnkitem.hxx> -#include "editeng/flstitem.hxx" -#include <editeng/akrnitem.hxx> -#include <editeng/brshitem.hxx> -#include <editeng/colritem.hxx> -#include "svx/drawitem.hxx" -#include "svx/dlgutil.hxx" -#include <dialmgr.hxx> -#include "svx/htmlmode.hxx" -#include "cuicharmap.hxx" -#include "chardlg.h" -#include <editeng/emphitem.hxx> -#include <editeng/charreliefitem.hxx> -#include <editeng/twolinesitem.hxx> -#include <editeng/charhiddenitem.hxx> -#include <svl/stritem.hxx> -#include <editeng/charscaleitem.hxx> -#include <editeng/charrotateitem.hxx> -#include <svx/svxdlg.hxx> -#include <cuires.hrc> -#include <svl/intitem.hxx> -#include <sfx2/request.hxx> -#include "svx/flagsdef.hxx" - -using namespace ::com::sun::star; - -// define ---------------------------------------------------------------- - -#define ISITEMSET rSet.GetItemState(nWhich)>=SFX_ITEM_DEFAULT - -#define CLEARTITEM rSet.InvalidateItem(nWhich) - -#define LW_NORMAL 0 -#define LW_GESPERRT 1 -#define LW_SCHMAL 2 - -// static ---------------------------------------------------------------- - -static sal_uInt16 pNameRanges[] = -{ - SID_ATTR_CHAR_FONT, - SID_ATTR_CHAR_WEIGHT, - SID_ATTR_CHAR_FONTHEIGHT, - SID_ATTR_CHAR_FONTHEIGHT, - SID_ATTR_CHAR_COLOR, - SID_ATTR_CHAR_COLOR, - SID_ATTR_CHAR_LANGUAGE, - SID_ATTR_CHAR_LANGUAGE, - SID_ATTR_CHAR_CJK_FONT, - SID_ATTR_CHAR_CJK_WEIGHT, - SID_ATTR_CHAR_CTL_FONT, - SID_ATTR_CHAR_CTL_WEIGHT, - 0 -}; - -static sal_uInt16 pEffectsRanges[] = -{ - SID_ATTR_CHAR_SHADOWED, - SID_ATTR_CHAR_UNDERLINE, - SID_ATTR_CHAR_COLOR, - SID_ATTR_CHAR_COLOR, - SID_ATTR_CHAR_CASEMAP, - SID_ATTR_CHAR_CASEMAP, - SID_ATTR_FLASH, - SID_ATTR_FLASH, - SID_ATTR_CHAR_EMPHASISMARK, - SID_ATTR_CHAR_EMPHASISMARK, - SID_ATTR_CHAR_RELIEF, - SID_ATTR_CHAR_RELIEF, - SID_ATTR_CHAR_HIDDEN, - SID_ATTR_CHAR_HIDDEN, - SID_ATTR_CHAR_OVERLINE, - SID_ATTR_CHAR_OVERLINE, - 0 -}; - -static sal_uInt16 pPositionRanges[] = -{ - SID_ATTR_CHAR_KERNING, - SID_ATTR_CHAR_KERNING, - SID_ATTR_CHAR_ESCAPEMENT, - SID_ATTR_CHAR_ESCAPEMENT, - SID_ATTR_CHAR_AUTOKERN, - SID_ATTR_CHAR_AUTOKERN, - SID_ATTR_CHAR_ROTATED, - SID_ATTR_CHAR_SCALEWIDTH, - SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, - SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, - 0 -}; - -static sal_uInt16 pTwoLinesRanges[] = -{ - SID_ATTR_CHAR_TWO_LINES, - SID_ATTR_CHAR_TWO_LINES, - 0 -}; - -// C-Funktion ------------------------------------------------------------ - -inline sal_Bool StateToAttr( TriState aState ) -{ - return ( STATE_CHECK == aState ); -} - -// class SvxCharBasePage ------------------------------------------------- - -inline SvxFont& SvxCharBasePage::GetPreviewFont() -{ - return m_aPreviewWin.GetFont(); -} - -// ----------------------------------------------------------------------- - -inline SvxFont& SvxCharBasePage::GetPreviewCJKFont() -{ - return m_aPreviewWin.GetCJKFont(); -} -// ----------------------------------------------------------------------- - -inline SvxFont& SvxCharBasePage::GetPreviewCTLFont() -{ - return m_aPreviewWin.GetCTLFont(); -} - -// ----------------------------------------------------------------------- - -SvxCharBasePage::SvxCharBasePage( Window* pParent, const ResId& rResId, const SfxItemSet& rItemset, - sal_uInt16 nResIdPrewievWin, sal_uInt16 nResIdFontTypeFT ): - SfxTabPage( pParent, rResId, rItemset ), - m_aPreviewWin( this, ResId( nResIdPrewievWin, *rResId.GetResMgr() ) ), - m_aFontTypeFT( this, ResId( nResIdFontTypeFT, *rResId.GetResMgr() ) ), - m_bPreviewBackgroundToCharacter( sal_False ) -{ -} - -// ----------------------------------------------------------------------- - -SvxCharBasePage::~SvxCharBasePage() -{ -} - -// ----------------------------------------------------------------------- - -void SvxCharBasePage::ActivatePage( const SfxItemSet& rSet ) -{ - m_aPreviewWin.SetFromItemSet( rSet, m_bPreviewBackgroundToCharacter ); -} - - -// ----------------------------------------------------------------------- - -void SvxCharBasePage::SetPrevFontWidthScale( const SfxItemSet& rSet ) -{ - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH ); - if( ISITEMSET ) - { - const SvxCharScaleWidthItem &rItem = ( SvxCharScaleWidthItem& ) rSet.Get( nWhich ); - m_aPreviewWin.SetFontWidthScale( rItem.GetValue() ); - } -} - -// ----------------------------------------------------------------------- -namespace -{ - // ----------------------------------------------------------------------- - void setPrevFontEscapement(SvxFont& _rFont,sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc ) - { - _rFont.SetPropr( nProp ); - _rFont.SetProprRel( nEscProp ); - _rFont.SetEscapement( nEsc ); - } - // ----------------------------------------------------------------------- - // ----------------------------------------------------------------------- -} -// ----------------------------------------------------------------------- - -void SvxCharBasePage::SetPrevFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc ) -{ - setPrevFontEscapement(GetPreviewFont(),nProp,nEscProp,nEsc); - setPrevFontEscapement(GetPreviewCJKFont(),nProp,nEscProp,nEsc); - setPrevFontEscapement(GetPreviewCTLFont(),nProp,nEscProp,nEsc); - m_aPreviewWin.Invalidate(); -} - -// SvxCharNamePage_Impl -------------------------------------------------- - -struct SvxCharNamePage_Impl -{ - Timer m_aUpdateTimer; - String m_aNoStyleText; - String m_aTransparentText; - const FontList* m_pFontList; - sal_uInt16 m_nExtraEntryPos; - sal_Bool m_bMustDelete; - sal_Bool m_bInSearchMode; - - SvxCharNamePage_Impl() : - - m_pFontList ( NULL ), - m_nExtraEntryPos( LISTBOX_ENTRY_NOTFOUND ), - m_bMustDelete ( sal_False ), - m_bInSearchMode ( sal_False ) - - { - m_aUpdateTimer.SetTimeout( 350 ); - } - - ~SvxCharNamePage_Impl() - { - if ( m_bMustDelete ) - delete m_pFontList; - } -}; - -// class SvxCharNamePage ------------------------------------------------- - -SvxCharNamePage::SvxCharNamePage( Window* pParent, const SfxItemSet& rInSet ) : - - SvxCharBasePage( pParent, CUI_RES( RID_SVXPAGE_CHAR_NAME ), rInSet, WIN_CHAR_PREVIEW, FT_CHAR_FONTTYPE ), - m_pImpl ( new SvxCharNamePage_Impl ) -{ - m_pImpl->m_aNoStyleText = String( CUI_RES( STR_CHARNAME_NOSTYLE ) ); - m_pImpl->m_aTransparentText = String( CUI_RES( STR_CHARNAME_TRANSPARENT ) ); - - SvtLanguageOptions aLanguageOptions; - sal_Bool bCJK = ( aLanguageOptions.IsCJKFontEnabled() || aLanguageOptions.IsCTLFontEnabled() ); - - m_pWestLine = new FixedLine( this, CUI_RES( FL_WEST ) ); - m_pWestFontNameFT = new FixedText( this, CUI_RES( bCJK ? FT_WEST_NAME : FT_WEST_NAME_NOCJK ) ); - m_pWestFontNameLB = new FontNameBox( this, CUI_RES( bCJK ? LB_WEST_NAME : LB_WEST_NAME_NOCJK ) ); - m_pWestFontStyleFT = new FixedText( this, CUI_RES( bCJK ? FT_WEST_STYLE : FT_WEST_STYLE_NOCJK ) ); - m_pWestFontStyleLB = new FontStyleBox( this, CUI_RES( bCJK ? LB_WEST_STYLE : LB_WEST_STYLE_NOCJK ) ); - m_pWestFontSizeFT = new FixedText( this, CUI_RES( bCJK ? FT_WEST_SIZE : FT_WEST_SIZE_NOCJK ) ); - m_pWestFontSizeLB = new FontSizeBox( this, CUI_RES( bCJK ? LB_WEST_SIZE : LB_WEST_SIZE_NOCJK ) ); - - if( !bCJK ) - { - m_pColorFL = new FixedLine( this, CUI_RES( FL_COLOR2 ) ); - m_pColorFT = new FixedText( this, CUI_RES( FT_COLOR2 ) ); - m_pColorLB = new ColorListBox( this, CUI_RES( LB_COLOR2 ) ); - } - - m_pWestFontLanguageFT = new FixedText( this, CUI_RES( bCJK ? FT_WEST_LANG : FT_WEST_LANG_NOCJK ) ); - m_pWestFontLanguageLB = new SvxLanguageBox( this, CUI_RES( bCJK ? LB_WEST_LANG : LB_WEST_LANG_NOCJK ) ); - - m_pEastLine = new FixedLine( this, CUI_RES( FL_EAST ) ); - m_pEastFontNameFT = new FixedText( this, CUI_RES( FT_EAST_NAME ) ); - m_pEastFontNameLB = new FontNameBox( this, CUI_RES( LB_EAST_NAME ) ); - m_pEastFontStyleFT = new FixedText( this, CUI_RES( FT_EAST_STYLE ) ); - m_pEastFontStyleLB = new FontStyleBox( this, CUI_RES( LB_EAST_STYLE ) ); - m_pEastFontSizeFT = new FixedText( this, CUI_RES( FT_EAST_SIZE ) ); - m_pEastFontSizeLB = new FontSizeBox( this, CUI_RES( LB_EAST_SIZE ) ); - m_pEastFontLanguageFT = new FixedText( this, CUI_RES( FT_EAST_LANG ) ); - m_pEastFontLanguageLB = new SvxLanguageBox( this, CUI_RES( LB_EAST_LANG ) ); - - m_pCTLLine = new FixedLine( this, CUI_RES( FL_CTL ) ); - m_pCTLFontNameFT = new FixedText( this, CUI_RES( FT_CTL_NAME ) ); - m_pCTLFontNameLB = new FontNameBox( this, CUI_RES( LB_CTL_NAME ) ); - m_pCTLFontStyleFT = new FixedText( this, CUI_RES( FT_CTL_STYLE ) ); - m_pCTLFontStyleLB = new FontStyleBox( this, CUI_RES( LB_CTL_STYLE ) ); - m_pCTLFontSizeFT = new FixedText( this, CUI_RES( FT_CTL_SIZE ) ); - m_pCTLFontSizeLB = new FontSizeBox( this, CUI_RES( LB_CTL_SIZE ) ); - m_pCTLFontLanguageFT = new FixedText( this, CUI_RES( FT_CTL_LANG ) ); - m_pCTLFontLanguageLB = new SvxLanguageBox( this, CUI_RES( LB_CTL_LANG ) ); - - if( bCJK ) - { - m_pColorFL = new FixedLine( this, CUI_RES( FL_COLOR2 ) ); - m_pColorFT = new FixedText( this, CUI_RES( FT_COLOR2 ) ); - m_pColorLB = new ColorListBox( this, CUI_RES( LB_COLOR2 ) ); - } - - //In MacOSX the standard dialogs name font-name, font-style as - //Family, Typeface - //In GNOME the standard dialogs name font-name, font-style as - //Family, Style - //In Windows the standard dialogs name font-name, font-style as - //Font, Style -#ifdef WNT - String sFontFamilyString(CUI_RES(STR_CHARNAME_FONT)); -#else - String sFontFamilyString(CUI_RES(STR_CHARNAME_FAMILY)); -#endif - m_pWestFontNameFT->SetText(sFontFamilyString); - m_pEastFontNameFT->SetText(sFontFamilyString); - m_pCTLFontNameFT->SetText(sFontFamilyString); - -#ifdef MACOSX - String sFontStyleString(CUI_RES(STR_CHARNAME_TYPEFACE)); -#else - String sFontStyleString(CUI_RES(STR_CHARNAME_STYLE)); -#endif - m_pWestFontStyleFT->SetText(sFontStyleString); - m_pEastFontStyleFT->SetText(sFontStyleString); - m_pCTLFontStyleFT->SetText(sFontStyleString); - - m_pWestLine ->Show( bCJK ); - m_pColorFL ->Show( bCJK ); - - bCJK = aLanguageOptions.IsCJKFontEnabled(); - m_pEastLine ->Show( bCJK ); - m_pEastFontNameFT ->Show( bCJK ); - m_pEastFontNameLB ->Show( bCJK ); - m_pEastFontStyleFT ->Show( bCJK ); - m_pEastFontStyleLB ->Show( bCJK ); - m_pEastFontSizeFT ->Show( bCJK ); - m_pEastFontSizeLB ->Show( bCJK ); - m_pEastFontLanguageFT ->Show( bCJK ); - m_pEastFontLanguageLB ->Show( bCJK ); - - sal_Bool bShowCTL = aLanguageOptions.IsCTLFontEnabled(); - if ( bShowCTL && !bCJK ) - { - // move CTL controls to the places of the CJK controls, if these controls aren't visible - m_pCTLLine ->SetPosPixel( m_pEastLine->GetPosPixel() ); - m_pCTLFontNameFT ->SetPosPixel( m_pEastFontNameFT->GetPosPixel() ); - m_pCTLFontNameLB ->SetPosPixel( m_pEastFontNameLB->GetPosPixel() ); - m_pCTLFontStyleFT ->SetPosPixel( m_pEastFontStyleFT->GetPosPixel() ); - m_pCTLFontStyleLB ->SetPosPixel( m_pEastFontStyleLB->GetPosPixel() ); - m_pCTLFontSizeFT ->SetPosPixel( m_pEastFontSizeFT->GetPosPixel() ); - m_pCTLFontSizeLB ->SetPosPixel( m_pEastFontSizeLB->GetPosPixel() ); - m_pCTLFontLanguageFT ->SetPosPixel( m_pEastFontLanguageFT->GetPosPixel() ); - m_pCTLFontLanguageLB ->SetPosPixel( m_pEastFontLanguageLB->GetPosPixel() ); - } - m_pCTLLine ->Show( bShowCTL ); - m_pCTLFontNameFT ->Show( bShowCTL ); - m_pCTLFontNameLB ->Show( bShowCTL ); - m_pCTLFontStyleFT ->Show( bShowCTL ); - m_pCTLFontStyleLB ->Show( bShowCTL ); - m_pCTLFontSizeFT ->Show( bShowCTL ); - m_pCTLFontSizeLB ->Show( bShowCTL ); - m_pCTLFontLanguageFT ->Show( bShowCTL ); - m_pCTLFontLanguageLB ->Show( bShowCTL ); - - FreeResource(); - - m_pWestFontLanguageLB->SetLanguageList( LANG_LIST_WESTERN, sal_True, sal_False, sal_True ); - m_pEastFontLanguageLB->SetLanguageList( LANG_LIST_CJK, sal_True, sal_False, sal_True ); - m_pCTLFontLanguageLB->SetLanguageList( LANG_LIST_CTL, sal_True, sal_False, sal_True ); - - Initialize(); -} - -// ----------------------------------------------------------------------- - -SvxCharNamePage::~SvxCharNamePage() -{ - delete m_pImpl; - - delete m_pWestLine; - delete m_pWestFontNameFT; - delete m_pWestFontNameLB; - delete m_pWestFontStyleFT; - delete m_pWestFontStyleLB; - delete m_pWestFontSizeFT; - delete m_pWestFontSizeLB; - delete m_pWestFontLanguageFT; - delete m_pWestFontLanguageLB; - - delete m_pEastLine; - delete m_pEastFontNameFT; - delete m_pEastFontNameLB; - delete m_pEastFontStyleFT; - delete m_pEastFontStyleLB; - delete m_pEastFontSizeFT; - delete m_pEastFontSizeLB; - delete m_pEastFontLanguageFT; - delete m_pEastFontLanguageLB; - - delete m_pCTLLine; - delete m_pCTLFontNameFT; - delete m_pCTLFontNameLB; - delete m_pCTLFontStyleFT; - delete m_pCTLFontStyleLB; - delete m_pCTLFontSizeFT; - delete m_pCTLFontSizeLB; - delete m_pCTLFontLanguageFT; - delete m_pCTLFontLanguageLB; - - delete m_pColorFL; - delete m_pColorFT; - delete m_pColorLB; -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::Initialize() -{ - // to handle the changes of the other pages - SetExchangeSupport(); - - // fill the color box - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - //DBG_ASSERT( pDocSh, "DocShell not found!" ); - XColorTable* pColorTable = NULL; - bool bKillTable = false; - const SfxPoolItem* pItem = NULL; - - if ( pDocSh ) - { - pItem = pDocSh->GetItem( SID_COLOR_TABLE ); - if ( pItem != NULL ) - pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); - } - - if ( !pColorTable ) - { - pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() ); - bKillTable = true; - } - - m_pColorLB->SetUpdateMode( sal_False ); - - { - SfxPoolItem* pDummy; - SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh ); - if( !pFrame || SFX_ITEM_DEFAULT > pFrame->GetBindings().QueryState( - SID_ATTR_AUTO_COLOR_INVALID, pDummy )) - m_pColorLB->InsertEntry( Color( COL_AUTO ), - SVX_RESSTR( RID_SVXSTR_AUTOMATIC )); - } - for ( long i = 0; i < pColorTable->Count(); i++ ) - { - XColorEntry* pEntry = pColorTable->GetColor(i); - m_pColorLB->InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - } - - m_pColorLB->SetUpdateMode( sal_True ); - - if ( bKillTable ) - delete pColorTable; - - m_pColorLB->SetSelectHdl( LINK( this, SvxCharNamePage, ColorBoxSelectHdl_Impl ) ); - - Link aLink = LINK( this, SvxCharNamePage, FontModifyHdl_Impl ); - m_pWestFontNameLB->SetModifyHdl( aLink ); - m_pWestFontStyleLB->SetModifyHdl( aLink ); - m_pWestFontSizeLB->SetModifyHdl( aLink ); - m_pEastFontNameLB->SetModifyHdl( aLink ); - m_pEastFontStyleLB->SetModifyHdl( aLink ); - m_pEastFontSizeLB->SetModifyHdl( aLink ); - m_pCTLFontNameLB->SetModifyHdl( aLink ); - m_pCTLFontStyleLB->SetModifyHdl( aLink ); - m_pCTLFontSizeLB->SetModifyHdl( aLink ); - - m_pImpl->m_aUpdateTimer.SetTimeoutHdl( LINK( this, SvxCharNamePage, UpdateHdl_Impl ) ); - - m_pColorFL->Hide(); - m_pColorFT->Hide(); - m_pColorLB->Hide(); -} - -// ----------------------------------------------------------------------- - -const FontList* SvxCharNamePage::GetFontList() const -{ - if ( !m_pImpl->m_pFontList ) - { - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - const SfxPoolItem* pItem; - - /* #110771# SvxFontListItem::GetFontList can return NULL */ - if ( pDocSh ) - { - pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); - if ( pItem != NULL ) - { - DBG_ASSERT(NULL != ( (SvxFontListItem*)pItem )->GetFontList(), - "Where is the font list?"); - m_pImpl->m_pFontList = static_cast<const SvxFontListItem*>(pItem )->GetFontList()->Clone(); - m_pImpl->m_bMustDelete = sal_True; - } - } - if(!m_pImpl->m_pFontList) - { - m_pImpl->m_pFontList = - new FontList( Application::GetDefaultDevice() ); - m_pImpl->m_bMustDelete = sal_True; - } - } - - return m_pImpl->m_pFontList; -} - -// ----------------------------------------------------------------------------- -namespace -{ - FontInfo calcFontInfo( SvxFont& _rFont, - SvxCharNamePage* _pPage, - const FontNameBox* _pFontNameLB, - const FontStyleBox* _pFontStyleLB, - const FontSizeBox* _pFontSizeLB, - const FontList* _pFontList, - sal_uInt16 _nFontWhich, - sal_uInt16 _nFontHeightWhich) - { - Size aSize = _rFont.GetSize(); - aSize.Width() = 0; - FontInfo aFontInfo; - String sFontName(_pFontNameLB->GetText()); - sal_Bool bFontAvailable = _pFontList->IsAvailable( sFontName ); - if(bFontAvailable || _pFontNameLB->GetSavedValue() != sFontName) - aFontInfo = _pFontList->Get( sFontName, _pFontStyleLB->GetText() ); - else - { - //get the font from itemset - SfxItemState eState = _pPage->GetItemSet().GetItemState( _nFontWhich ); - if ( eState >= SFX_ITEM_DEFAULT ) - { - const SvxFontItem* pFontItem = (const SvxFontItem*)&( _pPage->GetItemSet().Get( _nFontWhich ) ); - aFontInfo.SetName(pFontItem->GetFamilyName()); - aFontInfo.SetStyleName(pFontItem->GetStyleName()); - aFontInfo.SetFamily(pFontItem->GetFamily()); - aFontInfo.SetPitch(pFontItem->GetPitch()); - aFontInfo.SetCharSet(pFontItem->GetCharSet()); - } - } - if ( _pFontSizeLB->IsRelative() ) - { - DBG_ASSERT( _pPage->GetItemSet().GetParent(), "No parent set" ); - const SvxFontHeightItem& rOldItem = (SvxFontHeightItem&)_pPage->GetItemSet().GetParent()->Get( _nFontHeightWhich ); - - // alter Wert, skaliert - long nHeight; - if ( _pFontSizeLB->IsPtRelative() ) - nHeight = rOldItem.GetHeight() + PointToTwips( static_cast<long>(_pFontSizeLB->GetValue() / 10) ); - else - nHeight = static_cast<long>(rOldItem.GetHeight() * _pFontSizeLB->GetValue() / 100); - - // Umrechnung in twips fuer das Beispiel-Window - aSize.Height() = - ItemToControl( nHeight, _pPage->GetItemSet().GetPool()->GetMetric( _nFontHeightWhich ), SFX_FUNIT_TWIP ); - } - else if ( _pFontSizeLB->GetText().Len() ) - aSize.Height() = PointToTwips( static_cast<long>(_pFontSizeLB->GetValue() / 10) ); - else - aSize.Height() = 200; // default 10pt - aFontInfo.SetSize( aSize ); - - _rFont.SetFamily( aFontInfo.GetFamily() ); - _rFont.SetName( aFontInfo.GetName() ); - _rFont.SetStyleName( aFontInfo.GetStyleName() ); - _rFont.SetPitch( aFontInfo.GetPitch() ); - _rFont.SetCharSet( aFontInfo.GetCharSet() ); - _rFont.SetWeight( aFontInfo.GetWeight() ); - _rFont.SetItalic( aFontInfo.GetItalic() ); - _rFont.SetSize( aFontInfo.GetSize() ); - - return aFontInfo; - } -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::UpdatePreview_Impl() -{ - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - // Size - Size aSize = rFont.GetSize(); - aSize.Width() = 0; - Size aCJKSize = rCJKFont.GetSize(); - aCJKSize.Width() = 0; - Size aCTLSize = rCTLFont.GetSize(); - aCTLSize.Width() = 0; - // Font - const FontList* pFontList = GetFontList(); - FontInfo aFontInfo = - calcFontInfo(rFont,this,m_pWestFontNameLB,m_pWestFontStyleLB,m_pWestFontSizeLB,pFontList,GetWhich( SID_ATTR_CHAR_FONT ),GetWhich( SID_ATTR_CHAR_FONTHEIGHT )); - - calcFontInfo(rCJKFont,this,m_pEastFontNameLB,m_pEastFontStyleLB,m_pEastFontSizeLB,pFontList,GetWhich( SID_ATTR_CHAR_CJK_FONT ),GetWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT )); - - calcFontInfo(rCTLFont,this,m_pCTLFontNameLB,m_pCTLFontStyleLB,m_pCTLFontSizeLB,pFontList,GetWhich( SID_ATTR_CHAR_CTL_FONT ),GetWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT )); - - m_aPreviewWin.Invalidate(); - m_aFontTypeFT.SetText( pFontList->GetFontMapText( aFontInfo ) ); -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::FillStyleBox_Impl( const FontNameBox* pNameBox ) -{ - const FontList* pFontList = GetFontList(); - DBG_ASSERT( pFontList, "no fontlist" ); - - FontStyleBox* pStyleBox = NULL; - - if ( m_pWestFontNameLB == pNameBox ) - pStyleBox = m_pWestFontStyleLB; - else if ( m_pEastFontNameLB == pNameBox ) - pStyleBox = m_pEastFontStyleLB; - else if ( m_pCTLFontNameLB == pNameBox ) - pStyleBox = m_pCTLFontStyleLB; - else - { - DBG_ERRORFILE( "invalid font name box" ); - return; - } - - pStyleBox->Fill( pNameBox->GetText(), pFontList ); - - if ( m_pImpl->m_bInSearchMode ) - { - // Bei der Suche zus"atzliche Eintr"age: - // "Nicht Fett" und "Nicht Kursiv" - String aEntry = m_pImpl->m_aNoStyleText; - const sal_Char sS[] = "%1"; - aEntry.SearchAndReplaceAscii( sS, pFontList->GetBoldStr() ); - m_pImpl->m_nExtraEntryPos = pStyleBox->InsertEntry( aEntry ); - aEntry = m_pImpl->m_aNoStyleText; - aEntry.SearchAndReplaceAscii( sS, pFontList->GetItalicStr() ); - pStyleBox->InsertEntry( aEntry ); - } -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::FillSizeBox_Impl( const FontNameBox* pNameBox ) -{ - const FontList* pFontList = GetFontList(); - DBG_ASSERT( pFontList, "no fontlist" ); - - FontStyleBox* pStyleBox = NULL; - FontSizeBox* pSizeBox = NULL; - - if ( m_pWestFontNameLB == pNameBox ) - { - pStyleBox = m_pWestFontStyleLB; - pSizeBox = m_pWestFontSizeLB; - } - else if ( m_pEastFontNameLB == pNameBox ) - { - pStyleBox = m_pEastFontStyleLB; - pSizeBox = m_pEastFontSizeLB; - } - else if ( m_pCTLFontNameLB == pNameBox ) - { - pStyleBox = m_pCTLFontStyleLB; - pSizeBox = m_pCTLFontSizeLB; - } - else - { - DBG_ERRORFILE( "invalid font name box" ); - return; - } - - FontInfo _aFontInfo( pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ); - pSizeBox->Fill( &_aFontInfo, pFontList ); -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::Reset_Impl( const SfxItemSet& rSet, LanguageGroup eLangGrp ) -{ - FontNameBox* pNameBox = NULL; - FixedText* pStyleLabel = NULL; - FontStyleBox* pStyleBox = NULL; - FixedText* pSizeLabel = NULL; - FontSizeBox* pSizeBox = NULL; - FixedText* pLangFT = NULL; - SvxLanguageBox* pLangBox = NULL; - sal_uInt16 nWhich = 0; - - switch ( eLangGrp ) - { - case Western : - pNameBox = m_pWestFontNameLB; - pStyleLabel = m_pWestFontStyleFT; - pStyleBox = m_pWestFontStyleLB; - pSizeLabel = m_pWestFontSizeFT; - pSizeBox = m_pWestFontSizeLB; - pLangFT = m_pWestFontLanguageFT; - pLangBox = m_pWestFontLanguageLB; - nWhich = GetWhich( SID_ATTR_CHAR_FONT ); - break; - - case Asian : - pNameBox = m_pEastFontNameLB; - pStyleLabel = m_pEastFontStyleFT; - pStyleBox = m_pEastFontStyleLB; - pSizeLabel = m_pEastFontSizeFT; - pSizeBox = m_pEastFontSizeLB; - pLangFT = m_pEastFontLanguageFT; - pLangBox = m_pEastFontLanguageLB; - nWhich = GetWhich( SID_ATTR_CHAR_CJK_FONT ); - break; - - case Ctl : - pNameBox = m_pCTLFontNameLB; - pStyleLabel = m_pCTLFontStyleFT; - pStyleBox = m_pCTLFontStyleLB; - pSizeLabel = m_pCTLFontSizeFT; - pSizeBox = m_pCTLFontSizeLB; - pLangFT = m_pCTLFontLanguageFT; - pLangBox = m_pCTLFontLanguageLB; - nWhich = GetWhich( SID_ATTR_CHAR_CTL_FONT ); - break; - } - - // die FontListBox fuellen - const FontList* pFontList = GetFontList(); - pNameBox->Fill( pFontList ); - - // Font ermitteln - const SvxFontItem* pFontItem = NULL; - SfxItemState eState = rSet.GetItemState( nWhich ); - - if ( eState >= SFX_ITEM_DEFAULT ) - { - pFontItem = (const SvxFontItem*)&( rSet.Get( nWhich ) ); - pNameBox->SetText( pFontItem->GetFamilyName() ); - } - else - { - pNameBox->SetText( String() ); - } - - FillStyleBox_Impl( pNameBox ); - - bool bStyle = false; - bool bStyleAvailable = true; - FontItalic eItalic = ITALIC_NONE; - FontWeight eWeight = WEIGHT_NORMAL; - switch ( eLangGrp ) - { - case Western : nWhich = GetWhich( SID_ATTR_CHAR_POSTURE ); break; - case Asian : nWhich = GetWhich( SID_ATTR_CHAR_CJK_POSTURE ); break; - case Ctl : nWhich = GetWhich( SID_ATTR_CHAR_CTL_POSTURE ); break; - } - eState = rSet.GetItemState( nWhich ); - - if ( eState >= SFX_ITEM_DEFAULT ) - { - const SvxPostureItem& rItem = (SvxPostureItem&)rSet.Get( nWhich ); - eItalic = (FontItalic)rItem.GetValue(); - bStyle = true; - } - bStyleAvailable = bStyleAvailable && (eState >= SFX_ITEM_DONTCARE); - - switch ( eLangGrp ) - { - case Western : nWhich = GetWhich( SID_ATTR_CHAR_WEIGHT ); break; - case Asian : nWhich = GetWhich( SID_ATTR_CHAR_CJK_WEIGHT ); break; - case Ctl : nWhich = GetWhich( SID_ATTR_CHAR_CTL_WEIGHT ); break; - } - eState = rSet.GetItemState( nWhich ); - - if ( eState >= SFX_ITEM_DEFAULT ) - { - SvxWeightItem& rItem = (SvxWeightItem&)rSet.Get( nWhich ); - eWeight = (FontWeight)rItem.GetValue(); - } - else - bStyle = false; - bStyleAvailable = bStyleAvailable && (eState >= SFX_ITEM_DONTCARE); - - // Aktuell eingestellter Font - if ( bStyle && pFontItem ) - { - FontInfo aInfo = pFontList->Get( pFontItem->GetFamilyName(), eWeight, eItalic ); - pStyleBox->SetText( pFontList->GetStyleName( aInfo ) ); - } - else if ( !m_pImpl->m_bInSearchMode || !bStyle ) - { - pStyleBox->SetText( String() ); - } - else if ( bStyle ) - { - FontInfo aInfo = pFontList->Get( String(), eWeight, eItalic ); - pStyleBox->SetText( pFontList->GetStyleName( aInfo ) ); - } - if (!bStyleAvailable) - { - pStyleBox->Disable( ); - pStyleLabel->Disable( ); - } - - // SizeBox fuellen - FillSizeBox_Impl( pNameBox ); - switch ( eLangGrp ) - { - case Western : nWhich = GetWhich( SID_ATTR_CHAR_FONTHEIGHT ); break; - case Asian : nWhich = GetWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT ); break; - case Ctl : nWhich = GetWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT ); break; - } - eState = rSet.GetItemState( nWhich ); - - if ( pSizeBox->IsRelativeMode() ) - { - SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich ); - const SvxFontHeightItem& rItem = (SvxFontHeightItem&)rSet.Get( nWhich ); - - if( rItem.GetProp() != 100 || SFX_MAPUNIT_RELATIVE != rItem.GetPropUnit() ) - { - sal_Bool bPtRel = SFX_MAPUNIT_POINT == rItem.GetPropUnit(); - pSizeBox->SetPtRelative( bPtRel ); - pSizeBox->SetValue( bPtRel ? ((short)rItem.GetProp()) * 10 : rItem.GetProp() ); - } - else - { - pSizeBox->SetRelative(); - pSizeBox->SetValue( (long)CalcToPoint( rItem.GetHeight(), eUnit, 10 ) ); - } - } - else if ( eState >= SFX_ITEM_DEFAULT ) - { - SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich ); - const SvxFontHeightItem& rItem = (SvxFontHeightItem&)rSet.Get( nWhich ); - pSizeBox->SetValue( (long)CalcToPoint( rItem.GetHeight(), eUnit, 10 ) ); - } - else - { - pSizeBox->SetText( String() ); - if ( eState <= SFX_ITEM_READONLY ) - { - pSizeBox->Disable( ); - pSizeLabel->Disable( ); - } - } - - switch ( eLangGrp ) - { - case Western : nWhich = GetWhich( SID_ATTR_CHAR_LANGUAGE ); break; - case Asian : nWhich = GetWhich( SID_ATTR_CHAR_CJK_LANGUAGE ); break; - case Ctl : nWhich = GetWhich( SID_ATTR_CHAR_CTL_LANGUAGE ); break; - } - pLangBox->SetNoSelection(); - eState = rSet.GetItemState( nWhich ); - - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - pLangFT->Hide(); - pLangBox->Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - pLangFT->Disable(); - pLangBox->Disable(); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - const SvxLanguageItem& rItem = (SvxLanguageItem&)rSet.Get( nWhich ); - LanguageType eLangType = (LanguageType)rItem.GetValue(); - DBG_ASSERT( eLangType != LANGUAGE_SYSTEM, "LANGUAGE_SYSTEM not allowed" ); - if ( eLangType != LANGUAGE_DONTKNOW ) - pLangBox->SelectLanguage( eLangType ); - break; - } - } - - if ( Western == eLangGrp ) - m_aFontTypeFT.SetText( pFontList->GetFontMapText( - pFontList->Get( pNameBox->GetText(), pStyleBox->GetText() ) ) ); - - // save these settings - pNameBox->SaveValue(); - pStyleBox->SaveValue(); - pSizeBox->SaveValue(); - pLangBox->SaveValue(); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, LanguageGroup eLangGrp ) -{ - sal_Bool bModified = sal_False; - - FontNameBox* pNameBox = NULL; - FontStyleBox* pStyleBox = NULL; - FontSizeBox* pSizeBox = NULL; - SvxLanguageBox* pLangBox = NULL; - sal_uInt16 nWhich = 0; - sal_uInt16 nSlot = 0; - - switch ( eLangGrp ) - { - case Western : - pNameBox = m_pWestFontNameLB; - pStyleBox = m_pWestFontStyleLB; - pSizeBox = m_pWestFontSizeLB; - pLangBox = m_pWestFontLanguageLB; - nSlot = SID_ATTR_CHAR_FONT; - break; - - case Asian : - pNameBox = m_pEastFontNameLB; - pStyleBox = m_pEastFontStyleLB; - pSizeBox = m_pEastFontSizeLB; - pLangBox = m_pEastFontLanguageLB; - nSlot = SID_ATTR_CHAR_CJK_FONT; - break; - - case Ctl : - pNameBox = m_pCTLFontNameLB; - pStyleBox = m_pCTLFontStyleLB; - pSizeBox = m_pCTLFontSizeLB; - pLangBox = m_pCTLFontLanguageLB; - nSlot = SID_ATTR_CHAR_CTL_FONT; - break; - } - - nWhich = GetWhich( nSlot ); - const SfxPoolItem* pItem = NULL; - const SfxItemSet& rOldSet = GetItemSet(); - const SfxPoolItem* pOld = NULL; - - const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL; - - bool bChanged = true; - const String& rFontName = pNameBox->GetText(); - const FontList* pFontList = GetFontList(); - String aStyleBoxText =pStyleBox->GetText(); - sal_uInt16 nEntryPos = pStyleBox->GetEntryPos( aStyleBoxText ); - if ( nEntryPos >= m_pImpl->m_nExtraEntryPos ) - aStyleBoxText.Erase(); - FontInfo aInfo( pFontList->Get( rFontName, aStyleBoxText ) ); - SvxFontItem aFontItem( aInfo.GetFamily(), aInfo.GetName(), aInfo.GetStyleName(), - aInfo.GetPitch(), aInfo.GetCharSet(), nWhich ); - pOld = GetOldItem( rSet, nSlot ); - - if ( pOld ) - { - const SvxFontItem& rItem = *( (const SvxFontItem*)pOld ); - - if ( rItem.GetFamilyName() == aFontItem.GetFamilyName() ) - bChanged = false; - } - - if ( !bChanged ) - bChanged = !pNameBox->GetSavedValue().Len(); - - if ( !bChanged && pExampleSet && - pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET && - ( (SvxFontItem*)pItem )->GetFamilyName() != aFontItem.GetFamilyName() ) - bChanged = true; - - if ( bChanged && rFontName.Len() ) - { - rSet.Put( aFontItem ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - rSet.ClearItem( nWhich ); - - - bChanged = sal_True; - switch ( eLangGrp ) - { - case Western : nSlot = SID_ATTR_CHAR_WEIGHT; break; - case Asian : nSlot = SID_ATTR_CHAR_CJK_WEIGHT; break; - case Ctl : nSlot = SID_ATTR_CHAR_CTL_WEIGHT; break; - } - nWhich = GetWhich( nSlot ); - FontWeight eWeight = aInfo.GetWeight(); - if ( nEntryPos >= m_pImpl->m_nExtraEntryPos ) - eWeight = WEIGHT_NORMAL; - SvxWeightItem aWeightItem( eWeight, nWhich ); - pOld = GetOldItem( rSet, nSlot ); - - if ( pOld ) - { - const SvxWeightItem& rItem = *( (const SvxWeightItem*)pOld ); - - if ( rItem.GetValue() == aWeightItem.GetValue() ) - bChanged = false; - } - - if ( !bChanged ) - { - bChanged = !pStyleBox->GetSavedValue().Len(); - - if ( m_pImpl->m_bInSearchMode && bChanged && - aInfo.GetWeight() == WEIGHT_NORMAL && aInfo.GetItalic() != ITALIC_NONE ) - bChanged = true; - } - - if ( !bChanged && pExampleSet && - pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET && - ( (SvxWeightItem*)pItem )->GetValue() != aWeightItem.GetValue() ) - bChanged = true; - - if ( nEntryPos >= m_pImpl->m_nExtraEntryPos ) - bChanged = ( nEntryPos == m_pImpl->m_nExtraEntryPos ); - - String aText( pStyleBox->GetText() ); // Tristate, dann Text leer - - if ( bChanged && aText.Len() ) - { - rSet.Put( aWeightItem ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - switch ( eLangGrp ) - { - case Western : nSlot = SID_ATTR_CHAR_POSTURE; break; - case Asian : nSlot = SID_ATTR_CHAR_CJK_POSTURE; break; - case Ctl : nSlot = SID_ATTR_CHAR_CTL_POSTURE; break; - } - nWhich = GetWhich( nSlot ); - FontItalic eItalic = aInfo.GetItalic(); - if ( nEntryPos >= m_pImpl->m_nExtraEntryPos ) - eItalic = ITALIC_NONE; - SvxPostureItem aPostureItem( eItalic, nWhich ); - pOld = GetOldItem( rSet, nSlot ); - - if ( pOld ) - { - const SvxPostureItem& rItem = *( (const SvxPostureItem*)pOld ); - - if ( rItem.GetValue() == aPostureItem.GetValue() ) - bChanged = false; - } - - if ( !bChanged ) - { - bChanged = !pStyleBox->GetSavedValue().Len(); - - if ( m_pImpl->m_bInSearchMode && bChanged && - aInfo.GetItalic() == ITALIC_NONE && aInfo.GetWeight() != WEIGHT_NORMAL ) - bChanged = false; - } - - if ( !bChanged && pExampleSet && - pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET && - ( (SvxPostureItem*)pItem )->GetValue() != aPostureItem.GetValue() ) - bChanged = true; - - if ( nEntryPos >= m_pImpl->m_nExtraEntryPos ) - bChanged = ( nEntryPos == ( m_pImpl->m_nExtraEntryPos + 1 ) ); - - if ( bChanged && aText.Len() ) - { - rSet.Put( aPostureItem ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - // FontSize - long nSize = static_cast<long>(pSizeBox->GetValue()); - - if ( !pSizeBox->GetText().Len() ) // GetValue() gibt dann Min-Wert zurueck - nSize = 0; - long nSavedSize = pSizeBox->GetSavedValue().ToInt32(); - bool bRel = true; - - if ( !pSizeBox->IsRelative() ) - { - nSavedSize *= 10; - bRel = false; - } - - switch ( eLangGrp ) - { - case Western : nSlot = SID_ATTR_CHAR_FONTHEIGHT; break; - case Asian : nSlot = SID_ATTR_CHAR_CJK_FONTHEIGHT; break; - case Ctl : nSlot = SID_ATTR_CHAR_CTL_FONTHEIGHT; break; - } - nWhich = GetWhich( nSlot ); - const SvxFontHeightItem* pOldHeight = (const SvxFontHeightItem*)GetOldItem( rSet, nSlot ); - bChanged = ( nSize != nSavedSize ); - - if ( !bChanged && pExampleSet && - pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET ) - { - float fSize = (float)nSize / 10; - long nVal = CalcToUnit( fSize, rSet.GetPool()->GetMetric( nWhich ) ); - if ( ( (SvxFontHeightItem*)pItem )->GetHeight() != (sal_uInt32)nVal ) - bChanged = true; - } - - if ( bChanged || !pOldHeight || - bRel != ( SFX_MAPUNIT_RELATIVE != pOldHeight->GetPropUnit() || 100 != pOldHeight->GetProp() ) ) - { - SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich ); - if ( pSizeBox->IsRelative() ) - { - DBG_ASSERT( GetItemSet().GetParent(), "No parent set" ); - const SvxFontHeightItem& rOldItem = - (const SvxFontHeightItem&)GetItemSet().GetParent()->Get( nWhich ); - - SvxFontHeightItem aHeight( 240, 100, nWhich ); - if ( pSizeBox->IsPtRelative() ) - aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)( nSize / 10 ), SFX_MAPUNIT_POINT, eUnit ); - else - aHeight.SetHeight( rOldItem.GetHeight(), (sal_uInt16)nSize, SFX_MAPUNIT_RELATIVE ); - rSet.Put( aHeight ); - } - else - { - float fSize = (float)nSize / 10; - rSet.Put( SvxFontHeightItem( CalcToUnit( fSize, eUnit ), 100, nWhich ) ); - } - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - switch ( eLangGrp ) - { - case Western : nSlot = SID_ATTR_CHAR_LANGUAGE; break; - case Asian : nSlot = SID_ATTR_CHAR_CJK_LANGUAGE; break; - case Ctl : nSlot = SID_ATTR_CHAR_CTL_LANGUAGE; break; - } - nWhich = GetWhich( nSlot ); - pOld = GetOldItem( rSet, nSlot ); - sal_uInt16 nLangPos = pLangBox->GetSelectEntryPos(); - LanguageType eLangType = (LanguageType)(sal_uLong)pLangBox->GetEntryData( nLangPos ); - - if ( pOld ) - { - const SvxLanguageItem& rItem = *( (const SvxLanguageItem*)pOld ); - - if ( nLangPos == LISTBOX_ENTRY_NOTFOUND || eLangType == (LanguageType)rItem.GetValue() ) - bChanged = false; - } - - if ( !bChanged ) - bChanged = ( pLangBox->GetSavedValue() == LISTBOX_ENTRY_NOTFOUND ); - - if ( bChanged && nLangPos != LISTBOX_ENTRY_NOTFOUND ) - { - rSet.Put( SvxLanguageItem( eLangType, nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - return bModified; -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::ResetColor_Impl( const SfxItemSet& rSet ) -{ - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR ); - SfxItemState eState = rSet.GetItemState( nWhich ); - - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - m_pColorLB->Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - m_pColorLB->Disable(); - break; - - case SFX_ITEM_DONTCARE: - m_pColorLB->SetNoSelection(); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - const SvxColorItem& rItem = (SvxColorItem&)rSet.Get( nWhich ); - Color aColor = rItem.GetValue(); - rFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor ); - rCJKFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor ); - rCTLFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor ); - m_aPreviewWin.Invalidate(); - sal_uInt16 nSelPos = m_pColorLB->GetEntryPos( aColor ); - if ( nSelPos == LISTBOX_ENTRY_NOTFOUND && aColor == Color( COL_TRANSPARENT ) ) - nSelPos = m_pColorLB->GetEntryPos( m_pImpl->m_aTransparentText ); - - if ( LISTBOX_ENTRY_NOTFOUND != nSelPos ) - m_pColorLB->SelectEntryPos( nSelPos ); - else - { - nSelPos = m_pColorLB->GetEntryPos( aColor ); - if ( LISTBOX_ENTRY_NOTFOUND != nSelPos ) - m_pColorLB->SelectEntryPos( nSelPos ); - else - m_pColorLB->SelectEntryPos( - m_pColorLB->InsertEntry( aColor, String( SVX_RES( RID_SVXSTR_COLOR_USER ) ) ) ); - } - break; - } - } -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharNamePage, UpdateHdl_Impl, Timer*, EMPTYARG ) -{ - UpdatePreview_Impl(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharNamePage, FontModifyHdl_Impl, void*, pNameBox ) -{ - m_pImpl->m_aUpdateTimer.Start(); - - if ( m_pWestFontNameLB == pNameBox || m_pEastFontNameLB == pNameBox || m_pCTLFontNameLB == pNameBox ) - { - FillStyleBox_Impl( (FontNameBox*)pNameBox ); - FillSizeBox_Impl( (FontNameBox*)pNameBox ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharNamePage, ColorBoxSelectHdl_Impl, ColorListBox*, pBox ) -{ - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - Color aSelectedColor; - if ( pBox->GetSelectEntry() == m_pImpl->m_aTransparentText ) - aSelectedColor = Color( COL_TRANSPARENT ); - else - aSelectedColor = pBox->GetSelectEntryColor(); - rFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor ); - rCJKFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor ); - rCTLFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor ); - m_aPreviewWin.Invalidate(); - return 0; -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::ActivatePage( const SfxItemSet& rSet ) -{ - SvxCharBasePage::ActivatePage( rSet ); - - UpdatePreview_Impl(); // instead of asynchronous calling in ctor -} - -// ----------------------------------------------------------------------- - -int SvxCharNamePage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxCharNamePage::Create( Window* pParent, const SfxItemSet& rSet ) -{ - return new SvxCharNamePage( pParent, rSet ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16* SvxCharNamePage::GetRanges() -{ - return pNameRanges; -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::Reset( const SfxItemSet& rSet ) -{ - Reset_Impl( rSet, Western ); - Reset_Impl( rSet, Asian ); - Reset_Impl( rSet, Ctl ); - ResetColor_Impl( rSet ); - m_pColorLB->SaveValue(); - - SetPrevFontWidthScale( rSet ); - UpdatePreview_Impl(); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxCharNamePage::FillItemSet( SfxItemSet& rSet ) -{ - sal_Bool bModified = FillItemSet_Impl( rSet, Western ); - bModified |= FillItemSet_Impl( rSet, Asian ); - bModified |= FillItemSet_Impl( rSet, Ctl ); - return bModified; -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::SetFontList( const SvxFontListItem& rItem ) -{ - if ( m_pImpl->m_bMustDelete ) - { - delete m_pImpl->m_pFontList; - } - m_pImpl->m_pFontList = rItem.GetFontList()->Clone(); - m_pImpl->m_bMustDelete = sal_True; -} - -// ----------------------------------------------------------------------- -namespace -{ - void enableRelativeMode( SvxCharNamePage* _pPage, FontSizeBox* _pFontSizeLB, sal_uInt16 _nHeightWhich ) - { - _pFontSizeLB->EnableRelativeMode( 5, 995, 5 ); // min 5%, max 995%, step 5 - - const SvxFontHeightItem& rHeightItem = - (SvxFontHeightItem&)_pPage->GetItemSet().GetParent()->Get( _nHeightWhich ); - SfxMapUnit eUnit = _pPage->GetItemSet().GetPool()->GetMetric( _nHeightWhich ); - short nCurHeight = - static_cast< short >( CalcToPoint( rHeightItem.GetHeight(), eUnit, 1 ) * 10 ); - - // ausgehend von der akt. Hoehe: - // - negativ bis minimal 2 pt - // - positiv bis maximal 999 pt - _pFontSizeLB->EnablePtRelativeMode( sal::static_int_cast< short >(-(nCurHeight - 20)), (9999 - nCurHeight), 10 ); - } -} -// ----------------------------------------------------------------------------- - -void SvxCharNamePage::EnableRelativeMode() -{ - DBG_ASSERT( GetItemSet().GetParent(), "RelativeMode, but no ParentSet!" ); - enableRelativeMode(this,m_pWestFontSizeLB,GetWhich( SID_ATTR_CHAR_FONTHEIGHT )); - enableRelativeMode(this,m_pEastFontSizeLB,GetWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT )); - enableRelativeMode(this,m_pCTLFontSizeLB,GetWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT )); -} - -// ----------------------------------------------------------------------- - -void SvxCharNamePage::EnableSearchMode() -{ - m_pImpl->m_bInSearchMode = sal_True; -} -// ----------------------------------------------------------------------- -void SvxCharNamePage::DisableControls( sal_uInt16 nDisable ) -{ - if ( DISABLE_LANGUAGE & nDisable ) - { - if ( m_pWestFontLanguageFT ) m_pWestFontLanguageFT->Disable(); - if ( m_pWestFontLanguageLB ) m_pWestFontLanguageLB->Disable(); - if ( m_pEastFontLanguageFT ) m_pEastFontLanguageFT->Disable(); - if ( m_pEastFontLanguageLB ) m_pEastFontLanguageLB->Disable(); - if ( m_pCTLFontLanguageFT ) m_pCTLFontLanguageFT->Disable(); - if ( m_pCTLFontLanguageLB ) m_pCTLFontLanguageLB->Disable(); - } - - if ( DISABLE_HIDE_LANGUAGE & nDisable ) - { - if ( m_pWestFontLanguageFT ) m_pWestFontLanguageFT->Hide(); - if ( m_pWestFontLanguageLB ) m_pWestFontLanguageLB->Hide(); - if ( m_pEastFontLanguageFT ) m_pEastFontLanguageFT->Hide(); - if ( m_pEastFontLanguageLB ) m_pEastFontLanguageLB->Hide(); - if ( m_pCTLFontLanguageFT ) m_pCTLFontLanguageFT->Hide(); - if ( m_pCTLFontLanguageLB ) m_pCTLFontLanguageLB->Hide(); - } -} - -// ----------------------------------------------------------------------- -void SvxCharNamePage::SetPreviewBackgroundToCharacter() -{ - m_bPreviewBackgroundToCharacter = sal_True; -} - -// ----------------------------------------------------------------------- -void SvxCharNamePage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pFontListItem,SvxFontListItem,SID_ATTR_CHAR_FONTLIST,sal_False); - SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False); - SFX_ITEMSET_ARG (&aSet,pDisalbeItem,SfxUInt16Item,SID_DISABLE_CTL,sal_False); - if (pFontListItem) - SetFontList(*pFontListItem); - - if (pFlagItem) - { - sal_uInt32 nFlags=pFlagItem->GetValue(); - if ( ( nFlags & SVX_RELATIVE_MODE ) == SVX_RELATIVE_MODE ) - EnableRelativeMode(); - if ( ( nFlags & SVX_PREVIEW_CHARACTER ) == SVX_PREVIEW_CHARACTER ) - SetPreviewBackgroundToCharacter(); - } - if (pDisalbeItem) - DisableControls(pDisalbeItem->GetValue()); -} -// class SvxCharEffectsPage ---------------------------------------------- - -SvxCharEffectsPage::SvxCharEffectsPage( Window* pParent, const SfxItemSet& rInSet ) : - - SvxCharBasePage( pParent, CUI_RES( RID_SVXPAGE_CHAR_EFFECTS ), rInSet, WIN_EFFECTS_PREVIEW, FT_EFFECTS_FONTTYPE ), - - m_aFontColorFT ( this, CUI_RES( FT_FONTCOLOR ) ), - m_aFontColorLB ( this, CUI_RES( LB_FONTCOLOR ) ), - - m_aEffectsFT ( this, CUI_RES( FT_EFFECTS ) ), - m_aEffectsLB ( this, 0 ), - - m_aEffects2LB ( this, CUI_RES( LB_EFFECTS2 ) ), - - m_aReliefFT ( this, CUI_RES( FT_RELIEF ) ), - m_aReliefLB ( this, CUI_RES( LB_RELIEF ) ), - - m_aOutlineBtn ( this, CUI_RES( CB_OUTLINE ) ), - m_aShadowBtn ( this, CUI_RES( CB_SHADOW ) ), - m_aBlinkingBtn ( this, CUI_RES( CB_BLINKING ) ), - m_aHiddenBtn ( this, CUI_RES( CB_CHARHIDDEN ) ), - - m_aVerticalLine ( this, CUI_RES( FL_EFFECTS_VERTICAL ) ), - - m_aOverlineFT ( this, CUI_RES( FT_OVERLINE ) ), - m_aOverlineLB ( this, CUI_RES( LB_OVERLINE ) ), - m_aOverlineColorFT ( this, CUI_RES( FT_OVERLINE_COLOR ) ), - m_aOverlineColorLB ( this, CUI_RES( LB_OVERLINE_COLOR ) ), - m_aStrikeoutFT ( this, CUI_RES( FT_STRIKEOUT ) ), - m_aStrikeoutLB ( this, CUI_RES( LB_STRIKEOUT ) ), - m_aUnderlineFT ( this, CUI_RES( FT_UNDERLINE ) ), - m_aUnderlineLB ( this, CUI_RES( LB_UNDERLINE ) ), - m_aUnderlineColorFT ( this, CUI_RES( FT_UNDERLINE_COLOR ) ), - m_aUnderlineColorLB ( this, CUI_RES( LB_UNDERLINE_COLOR ) ), - m_aIndividualWordsBtn ( this, CUI_RES( CB_INDIVIDUALWORDS ) ), - - m_aAsianLine ( this, CUI_RES( FL_EFFECTS_ASIAN ) ), - - m_aEmphasisFT ( this, CUI_RES( FT_EMPHASIS ) ), - m_aEmphasisLB ( this, CUI_RES( LB_EMPHASIS ) ), - m_aPositionFT ( this, CUI_RES( FT_POSITION ) ), - m_aPositionLB ( this, CUI_RES( LB_POSITION ) ), - - m_aTransparentColorName ( CUI_RES( STR_CHARNAME_TRANSPARENT ) ) - -{ - m_aEffectsLB.Hide(); - FreeResource(); - Initialize(); -} - -// ----------------------------------------------------------------------- - -void SvxCharEffectsPage::Initialize() -{ - // to handle the changes of the other pages - SetExchangeSupport(); - - // HTML-Mode - const SfxPoolItem* pItem; - SfxObjectShell* pShell; - if ( SFX_ITEM_SET == GetItemSet().GetItemState( SID_HTML_MODE, sal_False, &pItem ) || - ( NULL != ( pShell = SfxObjectShell::Current() ) && - NULL != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) ) - { - m_nHtmlMode = ( (const SfxUInt16Item*)pItem )->GetValue(); - if ( ( m_nHtmlMode & HTMLMODE_ON ) == HTMLMODE_ON ) - { - //!!! hide some controls please - } - } - - // fill the color box - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - DBG_ASSERT( pDocSh, "DocShell not found!" ); - XColorTable* pColorTable = NULL; - bool bKillTable = false; - - if ( pDocSh ) - { - pItem = pDocSh->GetItem( SID_COLOR_TABLE ); - if ( pItem != NULL ) - pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); - } - - if ( !pColorTable ) - { - pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() ); - bKillTable = true; - } - - m_aUnderlineColorLB.SetUpdateMode( sal_False ); - m_aOverlineColorLB.SetUpdateMode( sal_False ); - m_aFontColorLB.SetUpdateMode( sal_False ); - - { - SfxPoolItem* pDummy; - SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh ); - if ( !pFrame || - SFX_ITEM_DEFAULT > pFrame->GetBindings().QueryState( SID_ATTR_AUTO_COLOR_INVALID, pDummy ) ) - { - m_aUnderlineColorLB.InsertAutomaticEntryColor( Color( COL_AUTO ) ); - m_aOverlineColorLB.InsertAutomaticEntryColor( Color( COL_AUTO ) ); - m_aFontColorLB.InsertAutomaticEntryColor( Color( COL_AUTO ) ); - } - } - for ( long i = 0; i < pColorTable->Count(); i++ ) - { - XColorEntry* pEntry = pColorTable->GetColor(i); - m_aUnderlineColorLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - m_aOverlineColorLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - m_aFontColorLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - } - - m_aUnderlineColorLB.SetUpdateMode( sal_True ); - m_aOverlineColorLB.SetUpdateMode( sal_True ); - m_aFontColorLB.SetUpdateMode( sal_True ); - m_aFontColorLB.SetSelectHdl( LINK( this, SvxCharEffectsPage, ColorBoxSelectHdl_Impl ) ); - - if ( bKillTable ) - delete pColorTable; - - // handler - Link aLink = LINK( this, SvxCharEffectsPage, SelectHdl_Impl ); - m_aUnderlineLB.SetSelectHdl( aLink ); - m_aUnderlineColorLB.SetSelectHdl( aLink ); - m_aOverlineLB.SetSelectHdl( aLink ); - m_aOverlineColorLB.SetSelectHdl( aLink ); - m_aStrikeoutLB.SetSelectHdl( aLink ); - m_aEmphasisLB.SetSelectHdl( aLink ); - m_aPositionLB.SetSelectHdl( aLink ); - m_aEffects2LB.SetSelectHdl( aLink ); - m_aReliefLB.SetSelectHdl( aLink ); - - m_aUnderlineLB.SelectEntryPos( 0 ); - m_aUnderlineColorLB.SelectEntryPos( 0 ); - m_aOverlineLB.SelectEntryPos( 0 ); - m_aOverlineColorLB.SelectEntryPos( 0 ); - m_aStrikeoutLB.SelectEntryPos( 0 ); - m_aEmphasisLB.SelectEntryPos( 0 ); - m_aPositionLB.SelectEntryPos( 0 ); - SelectHdl_Impl( NULL ); - SelectHdl_Impl( &m_aEmphasisLB ); - - m_aEffects2LB.SelectEntryPos( 0 ); - - m_aIndividualWordsBtn.SetClickHdl( LINK( this, SvxCharEffectsPage, CbClickHdl_Impl ) ); - aLink = LINK( this, SvxCharEffectsPage, TristClickHdl_Impl ); - m_aOutlineBtn.SetClickHdl( aLink ); - m_aShadowBtn.SetClickHdl( aLink ); - - if ( !SvtLanguageOptions().IsAsianTypographyEnabled() ) - { - m_aAsianLine.Hide(); - m_aEmphasisFT.Hide(); - m_aEmphasisLB.Hide(); - m_aPositionFT.Hide(); - m_aPositionLB.Hide(); - } -} -// ----------------------------------------------------------------------- - -void SvxCharEffectsPage::UpdatePreview_Impl() -{ - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - - sal_uInt16 nPos = m_aUnderlineLB.GetSelectEntryPos(); - FontUnderline eUnderline = (FontUnderline)(sal_uLong)m_aUnderlineLB.GetEntryData( nPos ); - nPos = m_aOverlineLB.GetSelectEntryPos(); - FontUnderline eOverline = (FontUnderline)(sal_uLong)m_aOverlineLB.GetEntryData( nPos ); - nPos = m_aStrikeoutLB.GetSelectEntryPos(); - FontStrikeout eStrikeout = (FontStrikeout)(sal_uLong)m_aStrikeoutLB.GetEntryData( nPos ); - rFont.SetUnderline( eUnderline ); - rCJKFont.SetUnderline( eUnderline ); - rCTLFont.SetUnderline( eUnderline ); - m_aPreviewWin.SetTextLineColor( m_aUnderlineColorLB.GetSelectEntryColor() ); - rFont.SetOverline( eOverline ); - rCJKFont.SetOverline( eOverline ); - rCTLFont.SetOverline( eOverline ); - m_aPreviewWin.SetOverlineColor( m_aOverlineColorLB.GetSelectEntryColor() ); - rFont.SetStrikeout( eStrikeout ); - rCJKFont.SetStrikeout( eStrikeout ); - rCTLFont.SetStrikeout( eStrikeout ); - - nPos = m_aPositionLB.GetSelectEntryPos(); - sal_Bool bUnder = ( CHRDLG_POSITION_UNDER == (sal_uLong)m_aPositionLB.GetEntryData( nPos ) ); - FontEmphasisMark eMark = (FontEmphasisMark)m_aEmphasisLB.GetSelectEntryPos(); - eMark |= bUnder ? EMPHASISMARK_POS_BELOW : EMPHASISMARK_POS_ABOVE; - rFont.SetEmphasisMark( eMark ); - rCJKFont.SetEmphasisMark( eMark ); - rCTLFont.SetEmphasisMark( eMark ); - - sal_uInt16 nRelief = m_aReliefLB.GetSelectEntryPos(); - if(LISTBOX_ENTRY_NOTFOUND != nRelief) - { - rFont.SetRelief( (FontRelief)nRelief ); - rCJKFont.SetRelief( (FontRelief)nRelief ); - rCTLFont.SetRelief( (FontRelief)nRelief ); - } - - rFont.SetOutline( StateToAttr( m_aOutlineBtn.GetState() ) ); - rCJKFont.SetOutline( rFont.IsOutline() ); - rCTLFont.SetOutline( rFont.IsOutline() ); - - rFont.SetShadow( StateToAttr( m_aShadowBtn.GetState() ) ); - rCJKFont.SetShadow( rFont.IsShadow() ); - rCTLFont.SetShadow( rFont.IsShadow() ); - - sal_uInt16 nCapsPos = m_aEffects2LB.GetSelectEntryPos(); - if ( nCapsPos != LISTBOX_ENTRY_NOTFOUND ) - { - rFont.SetCaseMap( (SvxCaseMap)nCapsPos ); - rCJKFont.SetCaseMap( (SvxCaseMap)nCapsPos ); - // #i78474# small caps do not exist in CTL fonts - rCTLFont.SetCaseMap( static_cast<SvxCaseMap>( nCapsPos == SVX_CASEMAP_KAPITAELCHEN ? SVX_CASEMAP_NOT_MAPPED : (SvxCaseMap)nCapsPos) ); - } - - sal_Bool bWordLine = m_aIndividualWordsBtn.IsChecked(); - rFont.SetWordLineMode( bWordLine ); - rCJKFont.SetWordLineMode( bWordLine ); - rCTLFont.SetWordLineMode( bWordLine ); - - m_aPreviewWin.Invalidate(); -} - -// ----------------------------------------------------------------------- - -void SvxCharEffectsPage::SetCaseMap_Impl( SvxCaseMap eCaseMap ) -{ - if ( SVX_CASEMAP_END > eCaseMap ) - m_aEffects2LB.SelectEntryPos( - sal::static_int_cast< sal_uInt16 >( eCaseMap ) ); - else - { - m_aEffects2LB.SetNoSelection(); - eCaseMap = SVX_CASEMAP_NOT_MAPPED; - } - - UpdatePreview_Impl(); -} - -// ----------------------------------------------------------------------- - -void SvxCharEffectsPage::ResetColor_Impl( const SfxItemSet& rSet ) -{ - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR ); - SfxItemState eState = rSet.GetItemState( nWhich ); - - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - m_aFontColorFT.Hide(); - m_aFontColorLB.Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - m_aFontColorFT.Disable(); - m_aFontColorLB.Disable(); - break; - - case SFX_ITEM_DONTCARE: - m_aFontColorLB.SetNoSelection(); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - - const SvxColorItem& rItem = (SvxColorItem&)rSet.Get( nWhich ); - Color aColor = rItem.GetValue(); - rFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor ); - rCJKFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor ); - rCTLFont.SetColor( aColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aColor ); - - m_aPreviewWin.Invalidate(); - sal_uInt16 nSelPos = m_aFontColorLB.GetEntryPos( aColor ); - if ( nSelPos == LISTBOX_ENTRY_NOTFOUND && aColor == Color( COL_TRANSPARENT ) ) - nSelPos = m_aFontColorLB.GetEntryPos( m_aTransparentColorName ); - - if ( LISTBOX_ENTRY_NOTFOUND != nSelPos ) - m_aFontColorLB.SelectEntryPos( nSelPos ); - else - { - nSelPos = m_aFontColorLB.GetEntryPos( aColor ); - if ( LISTBOX_ENTRY_NOTFOUND != nSelPos ) - m_aFontColorLB.SelectEntryPos( nSelPos ); - else - m_aFontColorLB.SelectEntryPos( - m_aFontColorLB.InsertEntry( aColor, String( SVX_RES( RID_SVXSTR_COLOR_USER ) ) ) ); - } - break; - } - } -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet ) -{ - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_COLOR ); - const SvxColorItem* pOld = (const SvxColorItem*)GetOldItem( rSet, SID_ATTR_CHAR_COLOR ); - const SvxColorItem* pItem = NULL; - sal_Bool bChanged = sal_True; - const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL; - const SfxItemSet& rOldSet = GetItemSet(); - - Color aSelectedColor; - if ( m_aFontColorLB.GetSelectEntry() == m_aTransparentColorName ) - aSelectedColor = Color( COL_TRANSPARENT ); - else - aSelectedColor = m_aFontColorLB.GetSelectEntryColor(); - - if ( pOld && pOld->GetValue() == aSelectedColor ) - bChanged = sal_False; - - if ( !bChanged ) - bChanged = ( m_aFontColorLB.GetSavedValue() == LISTBOX_ENTRY_NOTFOUND ); - - if ( !bChanged && pExampleSet && - pExampleSet->GetItemState( nWhich, sal_False, (const SfxPoolItem**)&pItem ) == SFX_ITEM_SET && - ( (SvxColorItem*)pItem )->GetValue() != aSelectedColor ) - bChanged = sal_True; - - sal_Bool bModified = sal_False; - - if ( bChanged && m_aFontColorLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ) - { - rSet.Put( SvxColorItem( aSelectedColor, nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - return bModified; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharEffectsPage, SelectHdl_Impl, ListBox*, pBox ) -{ - if ( &m_aEmphasisLB == pBox ) - { - sal_uInt16 nEPos = m_aEmphasisLB.GetSelectEntryPos(); - sal_Bool bEnable = ( nEPos > 0 && nEPos != LISTBOX_ENTRY_NOTFOUND ); - m_aPositionFT.Enable( bEnable ); - m_aPositionLB.Enable( bEnable ); - } - else if( &m_aReliefLB == pBox) - { - sal_Bool bEnable = ( pBox->GetSelectEntryPos() == 0 ); - m_aOutlineBtn.Enable( bEnable ); - m_aShadowBtn.Enable( bEnable ); - } - else if ( &m_aPositionLB != pBox ) - { - sal_uInt16 nUPos = m_aUnderlineLB.GetSelectEntryPos(), - nOPos = m_aOverlineLB.GetSelectEntryPos(), - nSPos = m_aStrikeoutLB.GetSelectEntryPos(); - sal_Bool bUEnable = ( nUPos > 0 && nUPos != LISTBOX_ENTRY_NOTFOUND ); - sal_Bool bOEnable = ( nOPos > 0 && nOPos != LISTBOX_ENTRY_NOTFOUND ); - m_aUnderlineColorFT.Enable( bUEnable ); - m_aUnderlineColorLB.Enable( bUEnable ); - m_aOverlineColorFT.Enable( bOEnable ); - m_aOverlineColorLB.Enable( bOEnable ); - m_aIndividualWordsBtn.Enable( bUEnable || bOEnable || ( nSPos > 0 && nSPos != LISTBOX_ENTRY_NOTFOUND ) ); - } - UpdatePreview_Impl(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharEffectsPage, UpdatePreview_Impl, ListBox*, EMPTYARG ) -{ - bool bEnable = ( ( m_aUnderlineLB.GetSelectEntryPos() > 0 ) || - ( m_aOverlineLB.GetSelectEntryPos() > 0 ) || - ( m_aStrikeoutLB.GetSelectEntryPos() > 0 ) ); - m_aIndividualWordsBtn.Enable( bEnable ); - - UpdatePreview_Impl(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharEffectsPage, CbClickHdl_Impl, CheckBox*, EMPTYARG ) -{ - UpdatePreview_Impl(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharEffectsPage, TristClickHdl_Impl, TriStateBox*, EMPTYARG ) -{ - UpdatePreview_Impl(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharEffectsPage, ColorBoxSelectHdl_Impl, ColorListBox*, pBox ) -{ - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - - Color aSelectedColor; - if ( pBox->GetSelectEntry() == m_aTransparentColorName ) - aSelectedColor = Color( COL_TRANSPARENT ); - else - aSelectedColor = pBox->GetSelectEntryColor(); - rFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor ); - rCJKFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor ); - rCTLFont.SetColor( aSelectedColor.GetColor() == COL_AUTO ? Color(COL_BLACK) : aSelectedColor ); - - m_aPreviewWin.Invalidate(); - return 0; -} -// ----------------------------------------------------------------------- - -int SvxCharEffectsPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxCharEffectsPage::Create( Window* pParent, const SfxItemSet& rSet ) -{ - return new SvxCharEffectsPage( pParent, rSet ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16* SvxCharEffectsPage::GetRanges() -{ - return pEffectsRanges; -} - -// ----------------------------------------------------------------------- - -void SvxCharEffectsPage::Reset( const SfxItemSet& rSet ) -{ - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - - sal_Bool bEnable = sal_False; - - // Underline - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_UNDERLINE ); - rFont.SetUnderline( UNDERLINE_NONE ); - rCJKFont.SetUnderline( UNDERLINE_NONE ); - rCTLFont.SetUnderline( UNDERLINE_NONE ); - - m_aUnderlineLB.SelectEntryPos( 0 ); - SfxItemState eState = rSet.GetItemState( nWhich ); - - if ( eState >= SFX_ITEM_DONTCARE ) - { - if ( eState == SFX_ITEM_DONTCARE ) - m_aUnderlineLB.SetNoSelection(); - else - { - const SvxUnderlineItem& rItem = (SvxUnderlineItem&)rSet.Get( nWhich ); - FontUnderline eUnderline = (FontUnderline)rItem.GetValue(); - rFont.SetUnderline( eUnderline ); - rCJKFont.SetUnderline( eUnderline ); - rCTLFont.SetUnderline( eUnderline ); - - if ( eUnderline != UNDERLINE_NONE ) - { - for ( sal_uInt16 i = 0; i < m_aUnderlineLB.GetEntryCount(); ++i ) - { - if ( (FontUnderline)(sal_uLong)m_aUnderlineLB.GetEntryData(i) == eUnderline ) - { - m_aUnderlineLB.SelectEntryPos(i); - bEnable = sal_True; - break; - } - } - - Color aColor = rItem.GetColor(); - sal_uInt16 nPos = m_aUnderlineColorLB.GetEntryPos( aColor ); - - if ( LISTBOX_ENTRY_NOTFOUND != nPos ) - m_aUnderlineColorLB.SelectEntryPos( nPos ); - else - { - nPos = m_aUnderlineColorLB.GetEntryPos( aColor ); - if ( LISTBOX_ENTRY_NOTFOUND != nPos ) - m_aUnderlineColorLB.SelectEntryPos( nPos ); - else - m_aUnderlineColorLB.SelectEntryPos( - m_aUnderlineColorLB.InsertEntry( aColor, - String( SVX_RES( RID_SVXSTR_COLOR_USER ) ) ) ); - } - } - else - { - m_aUnderlineColorLB.SelectEntry( Color( COL_AUTO )); - m_aUnderlineColorLB.Disable(); - } - } - } - - // Overline - nWhich = GetWhich( SID_ATTR_CHAR_OVERLINE ); - rFont.SetOverline( UNDERLINE_NONE ); - rCJKFont.SetOverline( UNDERLINE_NONE ); - rCTLFont.SetOverline( UNDERLINE_NONE ); - - m_aOverlineLB.SelectEntryPos( 0 ); - eState = rSet.GetItemState( nWhich ); - - if ( eState >= SFX_ITEM_DONTCARE ) - { - if ( eState == SFX_ITEM_DONTCARE ) - m_aOverlineLB.SetNoSelection(); - else - { - const SvxOverlineItem& rItem = (SvxOverlineItem&)rSet.Get( nWhich ); - FontUnderline eOverline = (FontUnderline)rItem.GetValue(); - rFont.SetOverline( eOverline ); - rCJKFont.SetOverline( eOverline ); - rCTLFont.SetOverline( eOverline ); - - if ( eOverline != UNDERLINE_NONE ) - { - for ( sal_uInt16 i = 0; i < m_aOverlineLB.GetEntryCount(); ++i ) - { - if ( (FontUnderline)(sal_uLong)m_aOverlineLB.GetEntryData(i) == eOverline ) - { - m_aOverlineLB.SelectEntryPos(i); - bEnable = sal_True; - break; - } - } - - Color aColor = rItem.GetColor(); - sal_uInt16 nPos = m_aOverlineColorLB.GetEntryPos( aColor ); - - if ( LISTBOX_ENTRY_NOTFOUND != nPos ) - m_aOverlineColorLB.SelectEntryPos( nPos ); - else - { - nPos = m_aOverlineColorLB.GetEntryPos( aColor ); - if ( LISTBOX_ENTRY_NOTFOUND != nPos ) - m_aOverlineColorLB.SelectEntryPos( nPos ); - else - m_aOverlineColorLB.SelectEntryPos( - m_aOverlineColorLB.InsertEntry( aColor, - String( SVX_RES( RID_SVXSTR_COLOR_USER ) ) ) ); - } - } - else - { - m_aOverlineColorLB.SelectEntry( Color( COL_AUTO )); - m_aOverlineColorLB.Disable(); - } - } - } - - // Strikeout - nWhich = GetWhich( SID_ATTR_CHAR_STRIKEOUT ); - rFont.SetStrikeout( STRIKEOUT_NONE ); - rCJKFont.SetStrikeout( STRIKEOUT_NONE ); - rCTLFont.SetStrikeout( STRIKEOUT_NONE ); - - m_aStrikeoutLB.SelectEntryPos( 0 ); - eState = rSet.GetItemState( nWhich ); - - if ( eState >= SFX_ITEM_DONTCARE ) - { - if ( eState == SFX_ITEM_DONTCARE ) - m_aStrikeoutLB.SetNoSelection(); - else - { - const SvxCrossedOutItem& rItem = (SvxCrossedOutItem&)rSet.Get( nWhich ); - FontStrikeout eStrikeout = (FontStrikeout)rItem.GetValue(); - rFont.SetStrikeout( eStrikeout ); - rCJKFont.SetStrikeout( eStrikeout ); - rCTLFont.SetStrikeout( eStrikeout ); - - if ( eStrikeout != STRIKEOUT_NONE ) - { - for ( sal_uInt16 i = 0; i < m_aStrikeoutLB.GetEntryCount(); ++i ) - { - if ( (FontStrikeout)(sal_uLong)m_aStrikeoutLB.GetEntryData(i) == eStrikeout ) - { - m_aStrikeoutLB.SelectEntryPos(i); - bEnable = sal_True; - break; - } - } - } - } - } - - // WordLineMode - nWhich = GetWhich( SID_ATTR_CHAR_WORDLINEMODE ); - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - m_aIndividualWordsBtn.Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - m_aIndividualWordsBtn.Disable(); - break; - - case SFX_ITEM_DONTCARE: - m_aIndividualWordsBtn.SetState( STATE_DONTKNOW ); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - const SvxWordLineModeItem& rItem = (SvxWordLineModeItem&)rSet.Get( nWhich ); - rFont.SetWordLineMode( rItem.GetValue() ); - rCJKFont.SetWordLineMode( rItem.GetValue() ); - rCTLFont.SetWordLineMode( rItem.GetValue() ); - - m_aIndividualWordsBtn.Check( rItem.GetValue() ); - m_aIndividualWordsBtn.Enable( bEnable ); - break; - } - } - - // Emphasis - nWhich = GetWhich( SID_ATTR_CHAR_EMPHASISMARK ); - eState = rSet.GetItemState( nWhich ); - - if ( eState >= SFX_ITEM_DEFAULT ) - { - const SvxEmphasisMarkItem& rItem = (SvxEmphasisMarkItem&)rSet.Get( nWhich ); - FontEmphasisMark eMark = rItem.GetEmphasisMark(); - rFont.SetEmphasisMark( eMark ); - rCJKFont.SetEmphasisMark( eMark ); - rCTLFont.SetEmphasisMark( eMark ); - - m_aEmphasisLB.SelectEntryPos( (sal_uInt16)( eMark & EMPHASISMARK_STYLE ) ); - eMark &= ~EMPHASISMARK_STYLE; - sal_uLong nEntryData = ( eMark == EMPHASISMARK_POS_ABOVE ) - ? CHRDLG_POSITION_OVER - : ( eMark == EMPHASISMARK_POS_BELOW ) ? CHRDLG_POSITION_UNDER : 0; - - for ( sal_uInt16 i = 0; i < m_aPositionLB.GetEntryCount(); i++ ) - { - if ( nEntryData == (sal_uLong)m_aPositionLB.GetEntryData(i) ) - { - m_aPositionLB.SelectEntryPos(i); - break; - } - } - } - else if ( eState == SFX_ITEM_DONTCARE ) - m_aEmphasisLB.SetNoSelection( ); - else if ( eState == SFX_ITEM_UNKNOWN ) - { - m_aEmphasisFT.Hide(); - m_aEmphasisLB.Hide(); - } - else // SFX_ITEM_DISABLED or SFX_ITEM_READONLY - { - m_aEmphasisFT.Disable(); - m_aEmphasisLB.Disable(); - } - - // the select handler for the underline/overline/strikeout list boxes -// SelectHdl_Impl( NULL ); - DBG_ASSERT(m_aUnderlineLB.GetSelectHdl() == m_aOverlineLB.GetSelectHdl(), - "SvxCharEffectsPage::Reset: inconsistence (1)!"); - DBG_ASSERT(m_aUnderlineLB.GetSelectHdl() == m_aStrikeoutLB.GetSelectHdl(), - "SvxCharEffectsPage::Reset: inconsistence (1)!"); - m_aUnderlineLB.GetSelectHdl().Call(NULL); - // don't call SelectHdl_Impl directly! - // in DisableControls, we may have re-reouted the select handler - - // the select handler for the emphasis listbox -// SelectHdl_Impl( &m_aEmphasisLB ); - DBG_ASSERT(m_aEmphasisLB.GetSelectHdl() == LINK(this, SvxCharEffectsPage, SelectHdl_Impl), - "SvxCharEffectsPage::Reset: inconsistence (2)!"); - m_aEmphasisLB.GetSelectHdl().Call( &m_aEmphasisLB ); - // this is for consistency only. Here it would be allowed to call SelectHdl_Impl directly ... - - // Effects - SvxCaseMap eCaseMap = SVX_CASEMAP_END; - nWhich = GetWhich( SID_ATTR_CHAR_CASEMAP ); - eState = rSet.GetItemState( nWhich ); - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - m_aEffectsFT.Hide(); - m_aEffects2LB.Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - m_aEffectsFT.Disable(); - m_aEffects2LB.Disable(); - break; - - case SFX_ITEM_DONTCARE: - m_aEffects2LB.SetNoSelection(); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - const SvxCaseMapItem& rItem = (const SvxCaseMapItem&)rSet.Get( nWhich ); - eCaseMap = (SvxCaseMap)rItem.GetValue(); - break; - } - } - SetCaseMap_Impl( eCaseMap ); - - //Relief - nWhich = GetWhich(SID_ATTR_CHAR_RELIEF); - eState = rSet.GetItemState( nWhich ); - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - m_aReliefFT.Hide(); - m_aReliefLB.Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - m_aReliefFT.Disable(); - m_aReliefLB.Disable(); - break; - - case SFX_ITEM_DONTCARE: - m_aReliefLB.SetNoSelection(); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - const SvxCharReliefItem& rItem = (const SvxCharReliefItem&)rSet.Get( nWhich ); - m_aReliefLB.SelectEntryPos(rItem.GetValue()); - SelectHdl_Impl(&m_aReliefLB); - break; - } - } - - // Outline - nWhich = GetWhich( SID_ATTR_CHAR_CONTOUR ); - eState = rSet.GetItemState( nWhich ); - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - m_aOutlineBtn.Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - m_aOutlineBtn.Disable(); - break; - - case SFX_ITEM_DONTCARE: - m_aOutlineBtn.SetState( STATE_DONTKNOW ); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - const SvxContourItem& rItem = (SvxContourItem&)rSet.Get( nWhich ); - m_aOutlineBtn.SetState( (TriState)rItem.GetValue() ); - m_aOutlineBtn.EnableTriState( sal_False ); - break; - } - } - - // Shadow - nWhich = GetWhich( SID_ATTR_CHAR_SHADOWED ); - eState = rSet.GetItemState( nWhich ); - - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - m_aShadowBtn.Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - m_aShadowBtn.Disable(); - break; - - case SFX_ITEM_DONTCARE: - m_aShadowBtn.SetState( STATE_DONTKNOW ); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - const SvxShadowedItem& rItem = (SvxShadowedItem&)rSet.Get( nWhich ); - m_aShadowBtn.SetState( (TriState)rItem.GetValue() ); - m_aShadowBtn.EnableTriState( sal_False ); - break; - } - } - - // Blinking - nWhich = GetWhich( SID_ATTR_FLASH ); - eState = rSet.GetItemState( nWhich ); - - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - m_aBlinkingBtn.Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - m_aBlinkingBtn.Disable(); - break; - - case SFX_ITEM_DONTCARE: - m_aBlinkingBtn.SetState( STATE_DONTKNOW ); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - const SvxBlinkItem& rItem = (SvxBlinkItem&)rSet.Get( nWhich ); - m_aBlinkingBtn.SetState( (TriState)rItem.GetValue() ); - m_aBlinkingBtn.EnableTriState( sal_False ); - break; - } - } - // Hidden - nWhich = GetWhich( SID_ATTR_CHAR_HIDDEN ); - eState = rSet.GetItemState( nWhich ); - - switch ( eState ) - { - case SFX_ITEM_UNKNOWN: - m_aHiddenBtn.Hide(); - break; - - case SFX_ITEM_DISABLED: - case SFX_ITEM_READONLY: - m_aHiddenBtn.Disable(); - break; - - case SFX_ITEM_DONTCARE: - m_aHiddenBtn.SetState( STATE_DONTKNOW ); - break; - - case SFX_ITEM_DEFAULT: - case SFX_ITEM_SET: - { - const SvxCharHiddenItem& rItem = (SvxCharHiddenItem&)rSet.Get( nWhich ); - m_aHiddenBtn.SetState( (TriState)rItem.GetValue() ); - m_aHiddenBtn.EnableTriState( sal_False ); - break; - } - } - - SetPrevFontWidthScale( rSet ); - ResetColor_Impl( rSet ); - - // preview update - m_aPreviewWin.Invalidate(); - - // save this settings - m_aUnderlineLB.SaveValue(); - m_aUnderlineColorLB.SaveValue(); - m_aOverlineLB.SaveValue(); - m_aOverlineColorLB.SaveValue(); - m_aStrikeoutLB.SaveValue(); - m_aIndividualWordsBtn.SaveValue(); - m_aEmphasisLB.SaveValue(); - m_aPositionLB.SaveValue(); - m_aEffects2LB.SaveValue(); - m_aReliefLB.SaveValue(); - m_aOutlineBtn.SaveValue(); - m_aShadowBtn.SaveValue(); - m_aBlinkingBtn.SaveValue(); - m_aHiddenBtn.SaveValue(); - m_aFontColorLB.SaveValue(); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet ) -{ - const SfxPoolItem* pOld = 0; - const SfxItemSet& rOldSet = GetItemSet(); - sal_Bool bModified = sal_False; - bool bChanged = true; - - // Underline - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_UNDERLINE ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_UNDERLINE ); - sal_uInt16 nPos = m_aUnderlineLB.GetSelectEntryPos(); - FontUnderline eUnder = (FontUnderline)(sal_uLong)m_aUnderlineLB.GetEntryData( nPos ); - - if ( pOld ) - { - //! if there are different underline styles in the selection the - //! item-state in the 'rOldSet' will be invalid. In this case - //! changing the underline style will be allowed if a style is - //! selected in the listbox. - sal_Bool bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos && - SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, sal_True ); - - const SvxUnderlineItem& rItem = *( (const SvxUnderlineItem*)pOld ); - if ( (FontUnderline)rItem.GetValue() == eUnder && - ( UNDERLINE_NONE == eUnder || rItem.GetColor() == m_aUnderlineColorLB.GetSelectEntryColor() ) && - ! bAllowChg ) - bChanged = false; - } - - if ( bChanged ) - { - SvxUnderlineItem aNewItem( eUnder, nWhich ); - aNewItem.SetColor( m_aUnderlineColorLB.GetSelectEntryColor() ); - rSet.Put( aNewItem ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - - // Overline - nWhich = GetWhich( SID_ATTR_CHAR_OVERLINE ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_OVERLINE ); - nPos = m_aOverlineLB.GetSelectEntryPos(); - FontUnderline eOver = (FontUnderline)(sal_uLong)m_aOverlineLB.GetEntryData( nPos ); - - if ( pOld ) - { - //! if there are different underline styles in the selection the - //! item-state in the 'rOldSet' will be invalid. In this case - //! changing the underline style will be allowed if a style is - //! selected in the listbox. - sal_Bool bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos && - SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, sal_True ); - - const SvxOverlineItem& rItem = *( (const SvxOverlineItem*)pOld ); - if ( (FontUnderline)rItem.GetValue() == eOver && - ( UNDERLINE_NONE == eOver || rItem.GetColor() == m_aOverlineColorLB.GetSelectEntryColor() ) && - ! bAllowChg ) - bChanged = false; - } - - if ( bChanged ) - { - SvxOverlineItem aNewItem( eOver, nWhich ); - aNewItem.SetColor( m_aOverlineColorLB.GetSelectEntryColor() ); - rSet.Put( aNewItem ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - - // Strikeout - nWhich = GetWhich( SID_ATTR_CHAR_STRIKEOUT ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_STRIKEOUT ); - nPos = m_aStrikeoutLB.GetSelectEntryPos(); - FontStrikeout eStrike = (FontStrikeout)(sal_uLong)m_aStrikeoutLB.GetEntryData( nPos ); - - if ( pOld ) - { - //! if there are different strikeout styles in the selection the - //! item-state in the 'rOldSet' will be invalid. In this case - //! changing the strikeout style will be allowed if a style is - //! selected in the listbox. - sal_Bool bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos && - SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, sal_True ); - - const SvxCrossedOutItem& rItem = *( (const SvxCrossedOutItem*)pOld ); - if ( !m_aStrikeoutLB.IsEnabled() - || ((FontStrikeout)rItem.GetValue() == eStrike && !bAllowChg) ) - bChanged = false; - } - - if ( bChanged ) - { - rSet.Put( SvxCrossedOutItem( eStrike, nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - - // Individual words - nWhich = GetWhich( SID_ATTR_CHAR_WORDLINEMODE ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_WORDLINEMODE ); - - if ( pOld ) - { - const SvxWordLineModeItem& rItem = *( (const SvxWordLineModeItem*)pOld ); - if ( rItem.GetValue() == m_aIndividualWordsBtn.IsChecked() ) - bChanged = false; - } - - if ( rOldSet.GetItemState( nWhich ) == SFX_ITEM_DONTCARE && - m_aIndividualWordsBtn.IsChecked() == m_aIndividualWordsBtn.GetSavedValue() ) - bChanged = false; - - if ( bChanged ) - { - rSet.Put( SvxWordLineModeItem( m_aIndividualWordsBtn.IsChecked(), nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - - // Emphasis - nWhich = GetWhich( SID_ATTR_CHAR_EMPHASISMARK ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_EMPHASISMARK ); - sal_uInt16 nMarkPos = m_aEmphasisLB.GetSelectEntryPos(); - sal_uInt16 nPosPos = m_aPositionLB.GetSelectEntryPos(); - FontEmphasisMark eMark = (FontEmphasisMark)nMarkPos; - if ( m_aPositionLB.IsEnabled() ) - { - eMark |= ( CHRDLG_POSITION_UNDER == (sal_uLong)m_aPositionLB.GetEntryData( nPosPos ) ) - ? EMPHASISMARK_POS_BELOW : EMPHASISMARK_POS_ABOVE; - } - - if ( pOld ) - { - if( rOldSet.GetItemState( nWhich ) != SFX_ITEM_DONTCARE ) - { - const SvxEmphasisMarkItem& rItem = *( (const SvxEmphasisMarkItem*)pOld ); - if ( rItem.GetEmphasisMark() == eMark ) - bChanged = false; - } - } - - if ( rOldSet.GetItemState( nWhich ) == SFX_ITEM_DONTCARE && - m_aEmphasisLB.GetSavedValue() == nMarkPos && m_aPositionLB.GetSavedValue() == nPosPos ) - bChanged = false; - - if ( bChanged ) - { - rSet.Put( SvxEmphasisMarkItem( eMark, nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - - // Effects - nWhich = GetWhich( SID_ATTR_CHAR_CASEMAP ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_CASEMAP ); - SvxCaseMap eCaseMap = SVX_CASEMAP_NOT_MAPPED; - bool bChecked = false; - sal_uInt16 nCapsPos = m_aEffects2LB.GetSelectEntryPos(); - if ( nCapsPos != LISTBOX_ENTRY_NOTFOUND ) - { - eCaseMap = (SvxCaseMap)nCapsPos; - bChecked = true; - } - - if ( pOld ) - { - //! if there are different effect styles in the selection the - //! item-state in the 'rOldSet' will be invalid. In this case - //! changing the effect style will be allowed if a style is - //! selected in the listbox. - sal_Bool bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos && - SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, sal_True ); - - const SvxCaseMapItem& rItem = *( (const SvxCaseMapItem*)pOld ); - if ( (SvxCaseMap)rItem.GetValue() == eCaseMap && !bAllowChg ) - bChanged = false; - } - - if ( bChanged && bChecked ) - { - rSet.Put( SvxCaseMapItem( eCaseMap, nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - - //Relief - nWhich = GetWhich(SID_ATTR_CHAR_RELIEF); - if(m_aReliefLB.GetSelectEntryPos() != m_aReliefLB.GetSavedValue()) - { - m_aReliefLB.SaveValue(); - SvxCharReliefItem aRelief((FontRelief)m_aReliefLB.GetSelectEntryPos(), nWhich); - rSet.Put(aRelief); - } - - // Outline - const SfxItemSet* pExampleSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL; - nWhich = GetWhich( SID_ATTR_CHAR_CONTOUR ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_CONTOUR ); - TriState eState = m_aOutlineBtn.GetState(); - const SfxPoolItem* pItem; - - if ( pOld ) - { - const SvxContourItem& rItem = *( (const SvxContourItem*)pOld ); - if ( rItem.GetValue() == StateToAttr( eState ) && m_aOutlineBtn.GetSavedValue() == eState ) - bChanged = false; - } - - if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET && - !StateToAttr( eState ) && ( (SvxContourItem*)pItem )->GetValue() ) - bChanged = true; - - if ( bChanged && eState != STATE_DONTKNOW ) - { - rSet.Put( SvxContourItem( StateToAttr( eState ), nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - - // Shadow - nWhich = GetWhich( SID_ATTR_CHAR_SHADOWED ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_SHADOWED ); - eState = m_aShadowBtn.GetState(); - - if ( pOld ) - { - const SvxShadowedItem& rItem = *( (const SvxShadowedItem*)pOld ); - if ( rItem.GetValue() == StateToAttr( eState ) && m_aShadowBtn.GetSavedValue() == eState ) - bChanged = false; - } - - if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET && - !StateToAttr( eState ) && ( (SvxShadowedItem*)pItem )->GetValue() ) - bChanged = true; - - if ( bChanged && eState != STATE_DONTKNOW ) - { - rSet.Put( SvxShadowedItem( StateToAttr( eState ), nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = true; - - // Blinking - nWhich = GetWhich( SID_ATTR_FLASH ); - pOld = GetOldItem( rSet, SID_ATTR_FLASH ); - eState = m_aBlinkingBtn.GetState(); - - if ( pOld ) - { - const SvxBlinkItem& rItem = *( (const SvxBlinkItem*)pOld ); - if ( rItem.GetValue() == StateToAttr( eState ) && m_aBlinkingBtn.GetSavedValue() == eState ) - bChanged = false; - } - - if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET && - !StateToAttr( eState ) && ( (SvxBlinkItem*)pItem )->GetValue() ) - bChanged = true; - - if ( bChanged && eState != STATE_DONTKNOW ) - { - rSet.Put( SvxBlinkItem( StateToAttr( eState ), nWhich ) ); - bModified = true; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - // Hidden - nWhich = GetWhich( SID_ATTR_CHAR_HIDDEN ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_HIDDEN ); - eState = m_aHiddenBtn.GetState(); - bChanged = true; - - if ( pOld ) - { - const SvxCharHiddenItem& rItem = *( (const SvxCharHiddenItem*)pOld ); - if ( rItem.GetValue() == StateToAttr( eState ) && m_aHiddenBtn.GetSavedValue() == eState ) - bChanged = false; - } - - if ( !bChanged && pExampleSet && pExampleSet->GetItemState( nWhich, sal_False, &pItem ) == SFX_ITEM_SET && - !StateToAttr( eState ) && ( (SvxCharHiddenItem*)pItem )->GetValue() ) - bChanged = true; - - if ( bChanged && eState != STATE_DONTKNOW ) - { - rSet.Put( SvxCharHiddenItem( StateToAttr( eState ), nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bModified |= FillItemSetColor_Impl( rSet ); - - return bModified; -} - -void SvxCharEffectsPage::DisableControls( sal_uInt16 nDisable ) -{ - if ( ( DISABLE_CASEMAP & nDisable ) == DISABLE_CASEMAP ) - { - m_aEffectsFT.Disable(); - m_aEffects2LB.Disable(); - } - - if ( ( DISABLE_WORDLINE & nDisable ) == DISABLE_WORDLINE ) - m_aIndividualWordsBtn.Disable(); - - if ( ( DISABLE_BLINK & nDisable ) == DISABLE_BLINK ) - m_aBlinkingBtn.Disable(); - - if ( ( DISABLE_UNDERLINE_COLOR & nDisable ) == DISABLE_UNDERLINE_COLOR ) - { - // disable the controls - m_aUnderlineColorFT.Disable( ); - m_aUnderlineColorLB.Disable( ); - // and reroute the selection handler of the controls which normally would affect the color box dis-/enabling - m_aUnderlineLB.SetSelectHdl(LINK(this, SvxCharEffectsPage, UpdatePreview_Impl)); - m_aStrikeoutLB.SetSelectHdl(LINK(this, SvxCharEffectsPage, UpdatePreview_Impl)); - } -} - -void SvxCharEffectsPage::EnableFlash() -{ - if ( !( ( m_nHtmlMode & HTMLMODE_ON ) && !( m_nHtmlMode & HTMLMODE_BLINK ) ) ) - m_aBlinkingBtn.Show(); -} - -// ----------------------------------------------------------------------- -void SvxCharEffectsPage::SetPreviewBackgroundToCharacter() -{ - m_bPreviewBackgroundToCharacter = sal_True; -} - -// ----------------------------------------------------------------------- -void SvxCharEffectsPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pDisableCtlItem,SfxUInt16Item,SID_DISABLE_CTL,sal_False); - SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False); - if (pDisableCtlItem) - DisableControls(pDisableCtlItem->GetValue()); - - if (pFlagItem) - { - sal_uInt32 nFlags=pFlagItem->GetValue(); - if ( ( nFlags & SVX_ENABLE_FLASH ) == SVX_ENABLE_FLASH ) - EnableFlash(); - if ( ( nFlags & SVX_PREVIEW_CHARACTER ) == SVX_PREVIEW_CHARACTER ) - SetPreviewBackgroundToCharacter(); - } -} - -// class SvxCharPositionPage --------------------------------------------- - -SvxCharPositionPage::SvxCharPositionPage( Window* pParent, const SfxItemSet& rInSet ) : - - SvxCharBasePage( pParent, CUI_RES( RID_SVXPAGE_CHAR_POSITION ), rInSet, WIN_POS_PREVIEW, FT_POS_FONTTYPE ), - - m_aPositionLine ( this, CUI_RES( FL_POSITION ) ), - m_aHighPosBtn ( this, CUI_RES( RB_HIGHPOS ) ), - m_aNormalPosBtn ( this, CUI_RES( RB_NORMALPOS ) ), - m_aLowPosBtn ( this, CUI_RES( RB_LOWPOS ) ), - m_aHighLowFT ( this, CUI_RES( FT_HIGHLOW ) ), - m_aHighLowEdit ( this, CUI_RES( ED_HIGHLOW ) ), - m_aHighLowRB ( this, CUI_RES( CB_HIGHLOW ) ), - m_aFontSizeFT ( this, CUI_RES( FT_FONTSIZE ) ), - m_aFontSizeEdit ( this, CUI_RES( ED_FONTSIZE ) ), - m_aRotationScalingFL( this, CUI_RES( FL_ROTATION_SCALING ) ), - m_aScalingFL ( this, CUI_RES( FL_SCALING ) ), - m_a0degRB ( this, CUI_RES( RB_0_DEG ) ), - m_a90degRB ( this, CUI_RES( RB_90_DEG ) ), - m_a270degRB ( this, CUI_RES( RB_270_DEG ) ), - m_aFitToLineCB ( this, CUI_RES( CB_FIT_TO_LINE ) ), - m_aScaleWidthFT ( this, CUI_RES( FT_SCALE_WIDTH ) ), - m_aScaleWidthMF ( this, CUI_RES( MF_SCALE_WIDTH ) ), - - m_aKerningLine ( this, CUI_RES( FL_KERNING2 ) ), - m_aKerningLB ( this, CUI_RES( LB_KERNING2 ) ), - m_aKerningFT ( this, CUI_RES( FT_KERNING2 ) ), - m_aKerningEdit ( this, CUI_RES( ED_KERNING2 ) ), - m_aPairKerningBtn ( this, CUI_RES( CB_PAIRKERNING ) ), - - m_nSuperEsc ( (short)DFLT_ESC_SUPER ), - m_nSubEsc ( (short)DFLT_ESC_SUB ), - m_nScaleWidthItemSetVal ( 100 ), - m_nScaleWidthInitialVal ( 100 ), - m_nSuperProp ( (sal_uInt8)DFLT_ESC_PROP ), - m_nSubProp ( (sal_uInt8)DFLT_ESC_PROP ) -{ - FreeResource(); - Initialize(); -} - -// ----------------------------------------------------------------------- - -void SvxCharPositionPage::Initialize() -{ - // to handle the changes of the other pages - SetExchangeSupport(); - - GetPreviewFont().SetSize( Size( 0, 240 ) ); - GetPreviewCJKFont().SetSize( Size( 0, 240 ) ); - GetPreviewCTLFont().SetSize( Size( 0, 240 ) ); - - m_aNormalPosBtn.Check(); - PositionHdl_Impl( &m_aNormalPosBtn ); - m_aKerningLB.SelectEntryPos( 0 ); - KerningSelectHdl_Impl( NULL ); - - Link aLink = LINK( this, SvxCharPositionPage, PositionHdl_Impl ); - m_aHighPosBtn.SetClickHdl( aLink ); - m_aNormalPosBtn.SetClickHdl( aLink ); - m_aLowPosBtn.SetClickHdl( aLink ); - - aLink = LINK( this, SvxCharPositionPage, RotationHdl_Impl ); - m_a0degRB .SetClickHdl( aLink ); - m_a90degRB .SetClickHdl( aLink ); - m_a270degRB.SetClickHdl( aLink ); - - aLink = LINK( this, SvxCharPositionPage, FontModifyHdl_Impl ); - m_aHighLowEdit.SetModifyHdl( aLink ); - m_aFontSizeEdit.SetModifyHdl( aLink ); - - aLink = LINK( this, SvxCharPositionPage, LoseFocusHdl_Impl ); - m_aHighLowEdit.SetLoseFocusHdl( aLink ); - m_aFontSizeEdit.SetLoseFocusHdl( aLink ); - - m_aHighLowRB.SetClickHdl( LINK( this, SvxCharPositionPage, AutoPositionHdl_Impl ) ); - m_aFitToLineCB.SetClickHdl( LINK( this, SvxCharPositionPage, FitToLineHdl_Impl ) ); - m_aKerningLB.SetSelectHdl( LINK( this, SvxCharPositionPage, KerningSelectHdl_Impl ) ); - m_aKerningEdit.SetModifyHdl( LINK( this, SvxCharPositionPage, KerningModifyHdl_Impl ) ); - m_aPairKerningBtn.SetClickHdl( LINK( this, SvxCharPositionPage, PairKerningHdl_Impl ) ); - m_aScaleWidthMF.SetModifyHdl( LINK( this, SvxCharPositionPage, ScaleWidthModifyHdl_Impl ) ); -} - -// ----------------------------------------------------------------------- - -void SvxCharPositionPage::UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc ) -{ - SetPrevFontEscapement( nProp, nEscProp, nEsc ); -} - -// ----------------------------------------------------------------------- - -void SvxCharPositionPage::SetEscapement_Impl( sal_uInt16 nEsc ) -{ - SvxEscapementItem aEscItm( (SvxEscapement)nEsc, SID_ATTR_CHAR_ESCAPEMENT ); - - if ( SVX_ESCAPEMENT_SUPERSCRIPT == nEsc ) - { - aEscItm.GetEsc() = m_nSuperEsc; - aEscItm.GetProp() = m_nSuperProp; - } - else if ( SVX_ESCAPEMENT_SUBSCRIPT == nEsc ) - { - aEscItm.GetEsc() = m_nSubEsc; - aEscItm.GetProp() = m_nSubProp; - } - - short nFac = aEscItm.GetEsc() < 0 ? -1 : 1; - - m_aHighLowEdit.SetValue( aEscItm.GetEsc() * nFac ); - m_aFontSizeEdit.SetValue( aEscItm.GetProp() ); - - if ( SVX_ESCAPEMENT_OFF == nEsc ) - { - m_aHighLowFT.Disable(); - m_aHighLowEdit.Disable(); - m_aFontSizeFT.Disable(); - m_aFontSizeEdit.Disable(); - m_aHighLowRB.Disable(); - } - else - { - m_aFontSizeFT.Enable(); - m_aFontSizeEdit.Enable(); - m_aHighLowRB.Enable(); - - if ( !m_aHighLowRB.IsChecked() ) - { - m_aHighLowFT.Enable(); - m_aHighLowEdit.Enable(); - } - else - AutoPositionHdl_Impl( &m_aHighLowRB ); - } - - UpdatePreview_Impl( 100, aEscItm.GetProp(), aEscItm.GetEsc() ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, PositionHdl_Impl, RadioButton*, pBtn ) -{ - sal_uInt16 nEsc = SVX_ESCAPEMENT_OFF; // also when pBtn == NULL - - if ( &m_aHighPosBtn == pBtn ) - nEsc = SVX_ESCAPEMENT_SUPERSCRIPT; - else if ( &m_aLowPosBtn == pBtn ) - nEsc = SVX_ESCAPEMENT_SUBSCRIPT; - - SetEscapement_Impl( nEsc ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, RotationHdl_Impl, RadioButton*, pBtn ) -{ - sal_Bool bEnable = sal_False; - if (&m_a90degRB == pBtn || &m_a270degRB == pBtn) - bEnable = sal_True; - else - OSL_ENSURE( &m_a0degRB == pBtn, "unexpected button" ); - m_aFitToLineCB.Enable( bEnable ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, FontModifyHdl_Impl, MetricField*, EMPTYARG ) -{ - sal_uInt8 nEscProp = (sal_uInt8)m_aFontSizeEdit.GetValue(); - short nEsc = (short)m_aHighLowEdit.GetValue(); - nEsc *= m_aLowPosBtn.IsChecked() ? -1 : 1; - UpdatePreview_Impl( 100, nEscProp, nEsc ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, AutoPositionHdl_Impl, CheckBox*, pBox ) -{ - if ( pBox->IsChecked() ) - { - m_aHighLowFT.Disable(); - m_aHighLowEdit.Disable(); - } - else - PositionHdl_Impl( m_aHighPosBtn.IsChecked() ? &m_aHighPosBtn - : m_aLowPosBtn.IsChecked() ? &m_aLowPosBtn - : &m_aNormalPosBtn ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, FitToLineHdl_Impl, CheckBox*, pBox ) -{ - if ( &m_aFitToLineCB == pBox) - { - sal_uInt16 nVal = m_nScaleWidthInitialVal; - if (m_aFitToLineCB.IsChecked()) - nVal = m_nScaleWidthItemSetVal; - m_aScaleWidthMF.SetValue( nVal ); - - m_aPreviewWin.SetFontWidthScale( nVal ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, KerningSelectHdl_Impl, ListBox*, EMPTYARG ) -{ - if ( m_aKerningLB.GetSelectEntryPos() > 0 ) - { - m_aKerningFT.Enable(); - m_aKerningEdit.Enable(); - - if ( m_aKerningLB.GetSelectEntryPos() == 2 ) - { - // Condensed -> max value == 1/6 of the current font height - SvxFont& rFont = GetPreviewFont(); - long nMax = rFont.GetSize().Height() / 6; - m_aKerningEdit.SetMax( m_aKerningEdit.Normalize( nMax ), FUNIT_TWIP ); - m_aKerningEdit.SetLast( m_aKerningEdit.GetMax( m_aKerningEdit.GetUnit() ) ); - } - else - { - m_aKerningEdit.SetMax( 9999 ); - m_aKerningEdit.SetLast( 9999 ); - } - } - else - { - m_aKerningEdit.SetValue( 0 ); - m_aKerningFT.Disable(); - m_aKerningEdit.Disable(); - } - - KerningModifyHdl_Impl( NULL ); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, KerningModifyHdl_Impl, MetricField*, EMPTYARG ) -{ - long nVal = static_cast<long>(m_aKerningEdit.GetValue()); - nVal = LogicToLogic( nVal, MAP_POINT, MAP_TWIP ); - long nKern = (short)m_aKerningEdit.Denormalize( nVal ); - - // Condensed? -> then negative - if ( m_aKerningLB.GetSelectEntryPos() == 2 ) - nKern *= -1; - - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - - rFont.SetFixKerning( (short)nKern ); - rCJKFont.SetFixKerning( (short)nKern ); - rCTLFont.SetFixKerning( (short)nKern ); - m_aPreviewWin.Invalidate(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, PairKerningHdl_Impl, CheckBox*, EMPTYARG ) -{ - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, LoseFocusHdl_Impl, MetricField*, pField ) -{ -#ifdef DBG_UTIL - sal_Bool bHigh = m_aHighPosBtn.IsChecked(); -#endif - sal_Bool bLow = m_aLowPosBtn.IsChecked(); - DBG_ASSERT( bHigh || bLow, "normal position is not valid" ); - - if ( &m_aHighLowEdit == pField ) - { - if ( bLow ) - m_nSubEsc = (short)m_aHighLowEdit.GetValue() * -1; - else - m_nSuperEsc = (short)m_aHighLowEdit.GetValue(); - } - else if ( &m_aFontSizeEdit == pField ) - { - if ( bLow ) - m_nSubProp = (sal_uInt8)m_aFontSizeEdit.GetValue(); - else - m_nSuperProp = (sal_uInt8)m_aFontSizeEdit.GetValue(); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharPositionPage, ScaleWidthModifyHdl_Impl, MetricField*, EMPTYARG ) -{ - m_aPreviewWin.SetFontWidthScale( sal_uInt16( m_aScaleWidthMF.GetValue() ) ); - - return 0; -} - -void SvxCharPositionPage::ActivatePage( const SfxItemSet& rSet ) -{ - //update the preview - SvxCharBasePage::ActivatePage( rSet ); - - //the only thing that has to be checked is the max. allowed value for the - //condense edit field - if ( m_aKerningLB.GetSelectEntryPos() == 2 ) - { - // Condensed -> max value == 1/6 of the current font height - SvxFont& rFont = GetPreviewFont(); - long nMax = rFont.GetSize().Height() / 6; - long nKern = (short)m_aKerningEdit.Denormalize( LogicToLogic( static_cast<long>(m_aKerningEdit.GetValue()), MAP_POINT, MAP_TWIP ) ); - m_aKerningEdit.SetMax( m_aKerningEdit.Normalize( nKern > nMax ? nKern : nMax ), FUNIT_TWIP ); - m_aKerningEdit.SetLast( m_aKerningEdit.GetMax( m_aKerningEdit.GetUnit() ) ); - } -} - -// ----------------------------------------------------------------------- - -int SvxCharPositionPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxCharPositionPage::Create( Window* pParent, const SfxItemSet& rSet ) -{ - return new SvxCharPositionPage( pParent, rSet ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16* SvxCharPositionPage::GetRanges() -{ - return pPositionRanges; -} - -// ----------------------------------------------------------------------- -void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) -{ - String sUser = GetUserData(); - - if ( sUser.Len() ) - { - m_nSuperEsc = (short)sUser.GetToken( 0 ).ToInt32(); - m_nSubEsc = (short)sUser.GetToken( 1 ).ToInt32(); - m_nSuperProp = (sal_uInt8)sUser.GetToken( 2 ).ToInt32(); - m_nSubProp = (sal_uInt8)sUser.GetToken( 3 ).ToInt32(); - } - - short nEsc = 0; - sal_uInt8 nEscProp = 100; - sal_uInt8 nProp = 100; - - m_aHighLowFT.Disable(); - m_aHighLowEdit.Disable(); - m_aFontSizeFT.Disable(); - m_aFontSizeEdit.Disable(); - - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_ESCAPEMENT ); - - if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT ) - { - const SvxEscapementItem& rItem = (SvxEscapementItem&)rSet.Get( nWhich ); - nEsc = rItem.GetEsc(); - nEscProp = rItem.GetProp(); - - if ( nEsc != 0 ) - { - m_aHighLowFT.Enable(); - m_aHighLowEdit.Enable(); - m_aFontSizeFT.Enable(); - m_aFontSizeEdit.Enable(); - - short nFac; - sal_Bool bAutomatic(sal_False); - - if ( nEsc > 0 ) - { - nFac = 1; - m_aHighPosBtn.Check( sal_True ); - if ( nEsc == DFLT_ESC_AUTO_SUPER ) - { - nEsc = DFLT_ESC_SUPER; - bAutomatic = sal_True; - } - } - else - { - nFac = -1; - m_aLowPosBtn.Check( sal_True ); - if ( nEsc == DFLT_ESC_AUTO_SUB ) - { - nEsc = DFLT_ESC_SUB; - bAutomatic = sal_True; - } - } - if (!m_aHighLowRB.IsEnabled()) - { - m_aHighLowRB.Enable(); - } - m_aHighLowRB.Check(bAutomatic); - - if ( m_aHighLowRB.IsChecked() ) - { - m_aHighLowFT.Disable(); - m_aHighLowEdit.Disable(); - } - m_aHighLowEdit.SetValue( m_aHighLowEdit.Normalize( nFac * nEsc ) ); - } - else - { - m_aNormalPosBtn.Check( sal_True ); - m_aHighLowRB.Check( sal_True ); - PositionHdl_Impl( NULL ); - } - //the height has to be set after the handler is called to keep the value also if the escapement is zero - m_aFontSizeEdit.SetValue( m_aFontSizeEdit.Normalize( nEscProp ) ); - } - else - { - m_aHighPosBtn.Check( sal_False ); - m_aNormalPosBtn.Check( sal_False ); - m_aLowPosBtn.Check( sal_False ); - } - - // BspFont setzen - SetPrevFontEscapement( nProp, nEscProp, nEsc ); - - // Kerning - nWhich = GetWhich( SID_ATTR_CHAR_KERNING ); - - if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT ) - { - const SvxKerningItem& rItem = (SvxKerningItem&)rSet.Get( nWhich ); - SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich ); - MapUnit eOrgUnit = (MapUnit)eUnit; - MapUnit ePntUnit( MAP_POINT ); - long nBig = static_cast<long>(m_aKerningEdit.Normalize( static_cast<long>(rItem.GetValue()) )); - long nKerning = LogicToLogic( nBig, eOrgUnit, ePntUnit ); - - // Kerning am Font setzen, vorher in Twips umrechnen - long nKern = LogicToLogic( rItem.GetValue(), (MapUnit)eUnit, MAP_TWIP ); - rFont.SetFixKerning( (short)nKern ); - rCJKFont.SetFixKerning( (short)nKern ); - rCTLFont.SetFixKerning( (short)nKern ); - - if ( nKerning > 0 ) - { - m_aKerningLB.SelectEntryPos( LW_GESPERRT ); - } - else if ( nKerning < 0 ) - { - m_aKerningLB.SelectEntryPos( LW_SCHMAL ); - nKerning = -nKerning; - } - else - { - nKerning = 0; - m_aKerningLB.SelectEntryPos( LW_NORMAL ); - } - //enable/disable and set min/max of the Edit - KerningSelectHdl_Impl(&m_aKerningLB); - //the attribute value must be displayed also if it's above the maximum allowed value - long nVal = static_cast<long>(m_aKerningEdit.GetMax()); - if(nVal < nKerning) - m_aKerningEdit.SetMax( nKerning ); - m_aKerningEdit.SetValue( nKerning ); - } - else - m_aKerningEdit.SetText( String() ); - - // Pair kerning - nWhich = GetWhich( SID_ATTR_CHAR_AUTOKERN ); - - if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT ) - { - const SvxAutoKernItem& rItem = (SvxAutoKernItem&)rSet.Get( nWhich ); - m_aPairKerningBtn.Check( rItem.GetValue() ); - } - else - m_aPairKerningBtn.Check( sal_False ); - - // Scale Width - nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH ); - if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT ) - { - const SvxCharScaleWidthItem& rItem = ( SvxCharScaleWidthItem& ) rSet.Get( nWhich ); - m_nScaleWidthInitialVal = rItem.GetValue(); - m_aScaleWidthMF.SetValue( m_nScaleWidthInitialVal ); - } - else - m_aScaleWidthMF.SetValue( 100 ); - - nWhich = GetWhich( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ); - if ( rSet.GetItemState( nWhich ) >= SFX_ITEM_DEFAULT ) - m_nScaleWidthItemSetVal = ((SfxUInt16Item&) rSet.Get( nWhich )).GetValue(); - - // Rotation - nWhich = GetWhich( SID_ATTR_CHAR_ROTATED ); - SfxItemState eState = rSet.GetItemState( nWhich ); - if( SFX_ITEM_UNKNOWN == eState ) - { - m_aRotationScalingFL.Hide(); - m_aScalingFL.Show(); - m_a0degRB.Hide(); - m_a90degRB.Hide(); - m_a270degRB.Hide(); - m_aFitToLineCB.Hide(); - m_aFitToLineCB .Hide(); - - - // move the following controls upwards - Window* aCntrlArr[] = { - &m_aScaleWidthFT, &m_aScaleWidthMF, &m_aKerningLine, - &m_aKerningLB, &m_aKerningFT, &m_aKerningEdit, &m_aPairKerningBtn, - 0 }; - - long nDiff = m_aScaleWidthMF.GetPosPixel().Y() - - m_a0degRB.GetPosPixel().Y(); - - for( Window** ppW = aCntrlArr; *ppW; ++ppW ) - { - Point aPnt( (*ppW)->GetPosPixel() ); - aPnt.Y() -= nDiff; - (*ppW)->SetPosPixel( aPnt ); - } - } - else - { - m_aScalingFL.Hide(); - - Link aOldLink( m_aFitToLineCB.GetClickHdl() ); - m_aFitToLineCB.SetClickHdl( Link() ); - if( eState >= SFX_ITEM_DEFAULT ) - { - const SvxCharRotateItem& rItem = - (SvxCharRotateItem&) rSet.Get( nWhich ); - if (rItem.IsBottomToTop()) - m_a90degRB.Check( sal_True ); - else if (rItem.IsTopToBotton()) - m_a270degRB.Check( sal_True ); - else - { - DBG_ASSERT( 0 == rItem.GetValue(), "incorrect value" ); - m_a0degRB.Check( sal_True ); - } - m_aFitToLineCB.Check( rItem.IsFitToLine() ); - } - else - { - if( eState == SFX_ITEM_DONTCARE ) - { - m_a0degRB.Check( sal_False ); - m_a90degRB.Check( sal_False ); - m_a270degRB.Check( sal_False ); - } - else - m_a0degRB.Check( sal_True ); - - m_aFitToLineCB.Check( sal_False ); - } - m_aFitToLineCB.SetClickHdl( aOldLink ); - m_aFitToLineCB.Enable( !m_a0degRB.IsChecked() ); - - // is this value set? - if( SFX_ITEM_UNKNOWN == rSet.GetItemState( GetWhich( - SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ) )) - m_aFitToLineCB.Hide(); - } - - m_aHighPosBtn.SaveValue(); - m_aNormalPosBtn.SaveValue(); - m_aLowPosBtn.SaveValue(); - m_a0degRB.SaveValue(); - m_a90degRB.SaveValue(); - m_a270degRB.SaveValue(); - m_aFitToLineCB.SaveValue(); - m_aScaleWidthMF.SaveValue(); - m_aKerningLB.SaveValue(); - m_aKerningEdit.SaveValue(); - m_aPairKerningBtn.SaveValue(); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxCharPositionPage::FillItemSet( SfxItemSet& rSet ) -{ - // Position (hoch, normal oder tief) - const SfxItemSet& rOldSet = GetItemSet(); - sal_Bool bModified = sal_False, bChanged = sal_True; - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_ESCAPEMENT ); - const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_CHAR_ESCAPEMENT ); - const bool bHigh = m_aHighPosBtn.IsChecked(); - short nEsc; - sal_uInt8 nEscProp; - - if ( bHigh || m_aLowPosBtn.IsChecked() ) - { - if ( m_aHighLowRB.IsChecked() ) - nEsc = bHigh ? DFLT_ESC_AUTO_SUPER : DFLT_ESC_AUTO_SUB; - else - { - nEsc = (short)m_aHighLowEdit.Denormalize( m_aHighLowEdit.GetValue() ); - nEsc *= (bHigh ? 1 : -1); - } - nEscProp = (sal_uInt8)m_aFontSizeEdit.Denormalize( m_aFontSizeEdit.GetValue() ); - } - else - { - nEsc = 0; - nEscProp = 100; - } - - if ( pOld ) - { - const SvxEscapementItem& rItem = *( (const SvxEscapementItem*)pOld ); - if ( rItem.GetEsc() == nEsc && rItem.GetProp() == nEscProp ) - bChanged = sal_False; - } - - if ( !bChanged && !m_aHighPosBtn.GetSavedValue() && - !m_aNormalPosBtn.GetSavedValue() && !m_aLowPosBtn.GetSavedValue() ) - bChanged = sal_True; - - if ( bChanged && - ( m_aHighPosBtn.IsChecked() || m_aNormalPosBtn.IsChecked() || m_aLowPosBtn.IsChecked() ) ) - { - rSet.Put( SvxEscapementItem( nEsc, nEscProp, nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = sal_True; - - // Kerning - nWhich = GetWhich( SID_ATTR_CHAR_KERNING ); - pOld = GetOldItem( rSet, SID_ATTR_CHAR_KERNING ); - sal_uInt16 nPos = m_aKerningLB.GetSelectEntryPos(); - short nKerning = 0; - SfxMapUnit eUnit = rSet.GetPool()->GetMetric( nWhich ); - - if ( nPos == LW_GESPERRT || nPos == LW_SCHMAL ) - { - long nTmp = static_cast<long>(m_aKerningEdit.GetValue()); - long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit ); - nKerning = (short)m_aKerningEdit.Denormalize( nVal ); - - if ( nPos == LW_SCHMAL ) - nKerning *= - 1; - } - - if ( pOld ) - { - const SvxKerningItem& rItem = *( (const SvxKerningItem*)pOld ); - if ( rItem.GetValue() == nKerning ) - bChanged = sal_False; - } - - if ( !bChanged && - ( m_aKerningLB.GetSavedValue() == LISTBOX_ENTRY_NOTFOUND || - ( !m_aKerningEdit.GetSavedValue().Len() && m_aKerningEdit.IsEnabled() ) ) ) - bChanged = sal_True; - - if ( bChanged && nPos != LISTBOX_ENTRY_NOTFOUND ) - { - rSet.Put( SvxKerningItem( nKerning, nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - bChanged = sal_True; - - // Pair-Kerning - nWhich = GetWhich( SID_ATTR_CHAR_AUTOKERN ); - - if ( m_aPairKerningBtn.IsChecked() != m_aPairKerningBtn.GetSavedValue() ) - { - rSet.Put( SvxAutoKernItem( m_aPairKerningBtn.IsChecked(), nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - // Scale Width - nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH ); - if ( m_aScaleWidthMF.GetText() != m_aScaleWidthMF.GetSavedValue() ) - { - rSet.Put( SvxCharScaleWidthItem( (sal_uInt16)m_aScaleWidthMF.GetValue(), nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - // Rotation - nWhich = GetWhich( SID_ATTR_CHAR_ROTATED ); - if ( m_a0degRB .IsChecked() != m_a0degRB .GetSavedValue() || - m_a90degRB .IsChecked() != m_a90degRB .GetSavedValue() || - m_a270degRB .IsChecked() != m_a270degRB .GetSavedValue() || - m_aFitToLineCB.IsChecked() != m_aFitToLineCB.GetSavedValue() ) - { - SvxCharRotateItem aItem( 0, m_aFitToLineCB.IsChecked(), nWhich ); - if (m_a90degRB.IsChecked()) - aItem.SetBottomToTop(); - else if (m_a270degRB.IsChecked()) - aItem.SetTopToBotton(); - rSet.Put( aItem ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - return bModified; -} - -// ----------------------------------------------------------------------- - -void SvxCharPositionPage::FillUserData() -{ - const sal_Unicode cTok = ';'; - - String sUser( UniString::CreateFromInt32( m_nSuperEsc ) ); - sUser.Append( cTok ); - sUser.Append( UniString::CreateFromInt32( m_nSubEsc ) ); - sUser.Append( cTok ); - sUser.Append( UniString::CreateFromInt32( m_nSuperProp ) ); - sUser.Append( cTok ); - sUser.Append( UniString::CreateFromInt32( m_nSubProp ) ); - SetUserData( sUser ); -} - -// ----------------------------------------------------------------------- -void SvxCharPositionPage::SetPreviewBackgroundToCharacter() -{ - m_bPreviewBackgroundToCharacter = sal_True; -} -// ----------------------------------------------------------------------- -void SvxCharPositionPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False); - if (pFlagItem) - { - sal_uInt32 nFlags=pFlagItem->GetValue(); - if ( ( nFlags & SVX_PREVIEW_CHARACTER ) == SVX_PREVIEW_CHARACTER ) - SetPreviewBackgroundToCharacter(); - } -} -// class SvxCharTwoLinesPage ------------------------------------------------ - -SvxCharTwoLinesPage::SvxCharTwoLinesPage( Window* pParent, const SfxItemSet& rInSet ) : - - SvxCharBasePage( pParent, CUI_RES( RID_SVXPAGE_CHAR_TWOLINES ), rInSet, WIN_TWOLINES_PREVIEW, FT_TWOLINES_FONTTYPE ), - - m_aSwitchOnLine ( this, CUI_RES( FL_SWITCHON ) ), - m_aTwoLinesBtn ( this, CUI_RES( CB_TWOLINES ) ), - - m_aEncloseLine ( this, CUI_RES( FL_ENCLOSE ) ), - m_aStartBracketFT ( this, CUI_RES( FT_STARTBRACKET ) ), - m_aStartBracketLB ( this, CUI_RES( ED_STARTBRACKET ) ), - m_aEndBracketFT ( this, CUI_RES( FT_ENDBRACKET ) ), - m_aEndBracketLB ( this, CUI_RES( ED_ENDBRACKET ) ), - m_nStartBracketPosition( 0 ), - m_nEndBracketPosition( 0 ) -{ - FreeResource(); - Initialize(); -} - -// ----------------------------------------------------------------------- - -void SvxCharTwoLinesPage::Initialize() -{ - Size aSize = m_aStartBracketLB.GetSizePixel(); - aSize.Height() = m_aStartBracketLB.CalcSize( 1, 6 ).Height(); - m_aStartBracketLB.SetSizePixel( aSize ); - aSize = m_aEndBracketLB.GetSizePixel(); - aSize.Height() = m_aEndBracketLB.CalcSize( 1, 6 ).Height(); - m_aEndBracketLB.SetSizePixel( aSize ); - - m_aTwoLinesBtn.Check( sal_False ); - TwoLinesHdl_Impl( NULL ); - - m_aTwoLinesBtn.SetClickHdl( LINK( this, SvxCharTwoLinesPage, TwoLinesHdl_Impl ) ); - - Link aLink = LINK( this, SvxCharTwoLinesPage, CharacterMapHdl_Impl ); - m_aStartBracketLB.SetSelectHdl( aLink ); - m_aEndBracketLB.SetSelectHdl( aLink ); - - SvxFont& rFont = GetPreviewFont(); - SvxFont& rCJKFont = GetPreviewCJKFont(); - SvxFont& rCTLFont = GetPreviewCTLFont(); - rFont.SetSize( Size( 0, 220 ) ); - rCJKFont.SetSize( Size( 0, 220 ) ); - rCTLFont.SetSize( Size( 0, 220 ) ); -} - -// ----------------------------------------------------------------------- - -void SvxCharTwoLinesPage::SelectCharacter( ListBox* pBox ) -{ - - bool bStart = pBox == &m_aStartBracketLB; - //SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - //if(pFact) - { - //AbstractSvxCharacterMap* aDlg = pFact->CreateSvxCharacterMap( this, RID_SVXDLG_CHARMAP ); - SvxCharacterMap* aDlg = new SvxCharacterMap( this ); - aDlg->DisableFontSelection(); - - if ( aDlg->Execute() == RET_OK ) - { - sal_Unicode cChar = (sal_Unicode) aDlg->GetChar(); - SetBracket( cChar, bStart ); - } - else - { - pBox->SelectEntryPos( bStart ? m_nStartBracketPosition : m_nEndBracketPosition ); - } - delete aDlg; - } -} - -// ----------------------------------------------------------------------- - -void SvxCharTwoLinesPage::SetBracket( sal_Unicode cBracket, sal_Bool bStart ) -{ - sal_uInt16 nEntryPos = 0; - ListBox* pBox = bStart ? &m_aStartBracketLB : &m_aEndBracketLB; - if ( 0 == cBracket ) - pBox->SelectEntryPos(0); - else - { - bool bFound = false; - for ( sal_uInt16 i = 1; i < pBox->GetEntryCount(); ++i ) - { - if ( (sal_uLong)pBox->GetEntryData(i) != CHRDLG_ENCLOSE_SPECIAL_CHAR ) - { - const sal_Unicode cChar = pBox->GetEntry(i).GetChar(0); - if ( cChar == cBracket ) - { - pBox->SelectEntryPos(i); - nEntryPos = i; - bFound = true; - break; - } - } - } - - if ( !bFound ) - { - nEntryPos = pBox->InsertEntry( String( cBracket ) ); - pBox->SelectEntryPos( nEntryPos ); - } - } - if( bStart ) - m_nStartBracketPosition = nEntryPos; - else - m_nEndBracketPosition = nEntryPos; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharTwoLinesPage, TwoLinesHdl_Impl, CheckBox*, EMPTYARG ) -{ - sal_Bool bChecked = m_aTwoLinesBtn.IsChecked(); - m_aStartBracketFT.Enable( bChecked ); - m_aStartBracketLB.Enable( bChecked ); - m_aEndBracketFT.Enable( bChecked ); - m_aEndBracketLB.Enable( bChecked ); - - UpdatePreview_Impl(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxCharTwoLinesPage, CharacterMapHdl_Impl, ListBox*, pBox ) -{ - sal_uInt16 nPos = pBox->GetSelectEntryPos(); - if ( CHRDLG_ENCLOSE_SPECIAL_CHAR == (sal_uLong)pBox->GetEntryData( nPos ) ) - SelectCharacter( pBox ); - else - { - bool bStart = pBox == &m_aStartBracketLB; - if( bStart ) - m_nStartBracketPosition = nPos; - else - m_nEndBracketPosition = nPos; - } - UpdatePreview_Impl(); - return 0; -} - -// ----------------------------------------------------------------------- - -void SvxCharTwoLinesPage::ActivatePage( const SfxItemSet& rSet ) -{ - SvxCharBasePage::ActivatePage( rSet ); -} - -// ----------------------------------------------------------------------- - -int SvxCharTwoLinesPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxCharTwoLinesPage::Create( Window* pParent, const SfxItemSet& rSet ) -{ - return new SvxCharTwoLinesPage( pParent, rSet ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16* SvxCharTwoLinesPage::GetRanges() -{ - return pTwoLinesRanges; -} - -// ----------------------------------------------------------------------- - -void SvxCharTwoLinesPage::Reset( const SfxItemSet& rSet ) -{ - m_aTwoLinesBtn.Check( sal_False ); - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_TWO_LINES ); - SfxItemState eState = rSet.GetItemState( nWhich ); - - if ( eState >= SFX_ITEM_DONTCARE ) - { - const SvxTwoLinesItem& rItem = (SvxTwoLinesItem&)rSet.Get( nWhich ); - m_aTwoLinesBtn.Check( rItem.GetValue() ); - - if ( rItem.GetValue() ) - { - SetBracket( rItem.GetStartBracket(), sal_True ); - SetBracket( rItem.GetEndBracket(), sal_False ); - } - } - TwoLinesHdl_Impl( NULL ); - - SetPrevFontWidthScale( rSet ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxCharTwoLinesPage::FillItemSet( SfxItemSet& rSet ) -{ - const SfxItemSet& rOldSet = GetItemSet(); - sal_Bool bModified = sal_False, bChanged = sal_True; - sal_uInt16 nWhich = GetWhich( SID_ATTR_CHAR_TWO_LINES ); - const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_CHAR_TWO_LINES ); - sal_Bool bOn = m_aTwoLinesBtn.IsChecked(); - sal_Unicode cStart = ( bOn && m_aStartBracketLB.GetSelectEntryPos() > 0 ) - ? m_aStartBracketLB.GetSelectEntry().GetChar(0) : 0; - sal_Unicode cEnd = ( bOn && m_aEndBracketLB.GetSelectEntryPos() > 0 ) - ? m_aEndBracketLB.GetSelectEntry().GetChar(0) : 0; - - if ( pOld ) - { - const SvxTwoLinesItem& rItem = *( (const SvxTwoLinesItem*)pOld ); - if ( rItem.GetValue() == bOn && - ( !bOn || ( rItem.GetStartBracket() == cStart && rItem.GetEndBracket() == cEnd ) ) ) - bChanged = sal_False; - } - - if ( bChanged ) - { - rSet.Put( SvxTwoLinesItem( bOn, cStart, cEnd, nWhich ) ); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, sal_False ) ) - CLEARTITEM; - - return bModified; -} - -void SvxCharTwoLinesPage::UpdatePreview_Impl() -{ - sal_Unicode cStart = m_aStartBracketLB.GetSelectEntryPos() > 0 - ? m_aStartBracketLB.GetSelectEntry().GetChar(0) : 0; - sal_Unicode cEnd = m_aEndBracketLB.GetSelectEntryPos() > 0 - ? m_aEndBracketLB.GetSelectEntry().GetChar(0) : 0; - m_aPreviewWin.SetBrackets(cStart, cEnd); - m_aPreviewWin.SetTwoLines(m_aTwoLinesBtn.IsChecked()); - m_aPreviewWin.Invalidate(); -} -// ----------------------------------------------------------------------- -void SvxCharTwoLinesPage::SetPreviewBackgroundToCharacter() -{ - m_bPreviewBackgroundToCharacter = sal_True; -} - -// ----------------------------------------------------------------------- -void SvxCharTwoLinesPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,sal_False); - if (pFlagItem) - { - sal_uInt32 nFlags=pFlagItem->GetValue(); - if ( ( nFlags & SVX_PREVIEW_CHARACTER ) == SVX_PREVIEW_CHARACTER ) - SetPreviewBackgroundToCharacter(); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/chardlg.h b/cui/source/tabpages/chardlg.h deleted file mode 100644 index f597a9bee..000000000 --- a/cui/source/tabpages/chardlg.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_CHARDLG_H -#define _SVX_CHARDLG_H - -// define ---------------------------------------------------------------- - -#define CHRDLG_UNDERLINE_NONE 0 -#define CHRDLG_UNDERLINE_SINGLE 1 -#define CHRDLG_UNDERLINE_DOUBLE 2 -#define CHRDLG_UNDERLINE_DOTTED 3 -#define CHRDLG_UNDERLINE_DONTKNOW 4 -#define CHRDLG_UNDERLINE_DASH 5 -#define CHRDLG_UNDERLINE_LONGDASH 6 -#define CHRDLG_UNDERLINE_DASHDOT 7 -#define CHRDLG_UNDERLINE_DASHDOTDOT 8 -#define CHRDLG_UNDERLINE_SMALLWAVE 9 -#define CHRDLG_UNDERLINE_WAVE 10 -#define CHRDLG_UNDERLINE_DOUBLEWAVE 11 -#define CHRDLG_UNDERLINE_BOLD 12 -#define CHRDLG_UNDERLINE_BOLDDOTTED 13 -#define CHRDLG_UNDERLINE_BOLDDASH 14 -#define CHRDLG_UNDERLINE_BOLDLONGDASH 15 -#define CHRDLG_UNDERLINE_BOLDDASHDOT 16 -#define CHRDLG_UNDERLINE_BOLDDASHDOTDOT 17 -#define CHRDLG_UNDERLINE_BOLDWAVE 18 - -#define CHRDLG_STRIKEOUT_NONE 0 -#define CHRDLG_STRIKEOUT_SINGLE 1 -#define CHRDLG_STRIKEOUT_DOUBLE 2 -#define CHRDLG_STRIKEOUT_DONTKNOW 3 -#define CHRDLG_STRIKEOUT_BOLD 4 -#define CHRDLG_STRIKEOUT_SLASH 5 -#define CHRDLG_STRIKEOUT_X 6 - -#define CHRDLG_ENCLOSE_NONE 0 -#define CHRDLG_ENCLOSE_ROUND 1 -#define CHRDLG_ENCLOSE_SQUARE 2 -#define CHRDLG_ENCLOSE_POINTED 3 -#define CHRDLG_ENCLOSE_CURVED 4 -#define CHRDLG_ENCLOSE_SPECIAL_CHAR 5 - -#define CHRDLG_POSITION_OVER 0 -#define CHRDLG_POSITION_UNDER 1 - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/chardlg.hrc b/cui/source/tabpages/chardlg.hrc deleted file mode 100644 index 259611da1..000000000 --- a/cui/source/tabpages/chardlg.hrc +++ /dev/null @@ -1,185 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_CHARDLG_HRC -#define _SVX_CHARDLG_HRC - -// defines ------------------------------------------------------------------ - -// NamePage ----------------------------------------------------------------- - -#define FL_WEST 100 -#define FT_WEST_NAME 101 -#define LB_WEST_NAME 102 -#define FT_WEST_STYLE 103 -#define LB_WEST_STYLE 104 -#define FT_WEST_SIZE 105 -#define LB_WEST_SIZE 106 -#define FT_WEST_LANG 107 -#define LB_WEST_LANG 108 - -#define FL_EAST 110 -#define FT_EAST_NAME 111 -#define LB_EAST_NAME 112 -#define FT_EAST_STYLE 113 -#define LB_EAST_STYLE 114 -#define FT_EAST_SIZE 115 -#define LB_EAST_SIZE 116 -#define FT_EAST_LANG 117 -#define LB_EAST_LANG 118 - -#define FL_CTL 120 -#define FT_CTL_NAME 121 -#define LB_CTL_NAME 122 -#define FT_CTL_STYLE 123 -#define LB_CTL_STYLE 124 -#define FT_CTL_SIZE 125 -#define LB_CTL_SIZE 126 -#define FT_CTL_LANG 127 -#define LB_CTL_LANG 128 - -#define WIN_CHAR_PREVIEW 131 -#define FT_CHAR_FONTTYPE 132 - -#define FL_COLOR2 140 -#define FT_COLOR2 141 -#define LB_COLOR2 142 - -#define STR_CHARNAME_NOSTYLE 150 -#define STR_CHARNAME_TRANSPARENT 151 -#define STR_CHARNAME_FAMILY 152 -#define STR_CHARNAME_FONT 153 -#define STR_CHARNAME_STYLE 154 -#define STR_CHARNAME_TYPEFACE 155 - -// EffectsPage -------------------------------------------------------------- - -#define FT_FONTCOLOR 201 -#define LB_FONTCOLOR 202 - -#define FT_EFFECTS 203 -#define LB_EFFECTS 204 -#define LB_EFFECTS2 205 - -#define FT_RELIEF 206 -#define LB_RELIEF 207 - -#define CB_OUTLINE 208 -#define CB_SHADOW 209 -#define CB_BLINKING 210 -#define CB_CHARHIDDEN 211 - -#define FL_EFFECTS_VERTICAL 220 - -#define FT_OVERLINE 221 -#define LB_OVERLINE 222 -#define FT_OVERLINE_COLOR 223 -#define LB_OVERLINE_COLOR 224 - -#define FT_STRIKEOUT 225 -#define LB_STRIKEOUT 226 - -#define FT_UNDERLINE 227 -#define LB_UNDERLINE 228 -#define FT_UNDERLINE_COLOR 229 -#define LB_UNDERLINE_COLOR 230 - -#define CB_INDIVIDUALWORDS 231 - -#define FL_EFFECTS_ASIAN 240 - -#define FT_EMPHASIS 241 -#define LB_EMPHASIS 242 -#define FT_POSITION 243 -#define LB_POSITION 244 - -#define WIN_EFFECTS_PREVIEW 251 -#define FT_EFFECTS_FONTTYPE 252 - -#define STR_EFFECTS_TRANSPARENT 260 -#define STR_EFFECTS_CAPITALS 261 -#define STR_EFFECTS_LOWERCASE 262 -#define STR_EFFECTS_TITLE 263 -#define STR_EFFECTS_SMALL 264 -#define STR_EFFECTS_OUTLINE 265 -#define STR_EFFECTS_SHADOW 266 -#define STR_EFFECTS_BLINKING 267 - -// PositionPage ------------------------------------------------------------- - -#define FL_POSITION 300 -#define RB_HIGHPOS 301 -#define RB_NORMALPOS 302 -#define RB_LOWPOS 303 -#define FT_HIGHLOW 304 -#define ED_HIGHLOW 305 -#define CB_HIGHLOW 306 -#define FT_FONTSIZE 307 -#define ED_FONTSIZE 308 -#define FL_ROTATION_SCALING 309 -#define FL_SCALING 310 -#define RB_0_DEG 311 -#define RB_90_DEG 312 -#define RB_270_DEG 313 -#define CB_FIT_TO_LINE 314 -#define FT_SCALE_WIDTH 315 -#define MF_SCALE_WIDTH 316 - -#define FL_KERNING2 320 -#define LB_KERNING2 321 -#define FT_KERNING2 322 -#define ED_KERNING2 323 -#define CB_PAIRKERNING 324 - -#define WIN_POS_PREVIEW 331 -#define FT_POS_FONTTYPE 332 - -// TwoLinesPage ------------------------------------------------------------- - -#define FL_SWITCHON 400 -#define CB_TWOLINES 401 - -#define FL_ENCLOSE 410 -#define FT_STARTBRACKET 411 -#define ED_STARTBRACKET 412 -#define FT_ENDBRACKET 413 -#define ED_ENDBRACKET 414 - -#define FL_TWOLINES_PREVIEW 420 -#define WIN_TWOLINES_PREVIEW 421 -#define FT_TWOLINES_FONTTYPE 422 - -#define FT_WEST_NAME_NOCJK 423 -#define LB_WEST_NAME_NOCJK 424 -#define FT_WEST_STYLE_NOCJK 425 -#define LB_WEST_STYLE_NOCJK 426 -#define FT_WEST_SIZE_NOCJK 427 -#define LB_WEST_SIZE_NOCJK 428 -#define FT_WEST_LANG_NOCJK 429 -#define LB_WEST_LANG_NOCJK 430 - -#endif - diff --git a/cui/source/tabpages/chardlg.src b/cui/source/tabpages/chardlg.src deleted file mode 100644 index d1b1fc02e..000000000 --- a/cui/source/tabpages/chardlg.src +++ /dev/null @@ -1,1182 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include "helpid.hrc" -#include <cuires.hrc> -#include "chardlg.hrc" -#include "chardlg.h" -#include <svx/dialogs.hrc> - -// RID_SVXPAGE_CHAR_NAME ---------------------------------------------------- - -TabPage RID_SVXPAGE_CHAR_NAME -{ - HelpId = HID_SVXPAGE_CHAR_NAME ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE ; - FixedLine FL_WEST - { - Pos = MAP_APPFONT ( 6 , 3 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Western text font"; - }; - FixedText FT_WEST_NAME - { - Pos = MAP_APPFONT ( 12 , 14 ); - Size = MAP_APPFONT ( 80 , 8 ); - }; - FixedText FT_WEST_NAME_NOCJK - { - Pos = MAP_APPFONT ( 12 , 6 ); - Size = MAP_APPFONT ( 112 , 8 ); - }; - ComboBox LB_WEST_NAME - { - HelpID = "cui:ComboBox:RID_SVXPAGE_CHAR_NAME:LB_WEST_NAME"; - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 25 ); - Size = MAP_APPFONT ( 80 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - }; - ComboBox LB_WEST_NAME_NOCJK - { - HelpID = "cui:ComboBox:RID_SVXPAGE_CHAR_NAME:LB_WEST_NAME_NOCJK"; - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 17 ); - Size = MAP_APPFONT ( 112 , 71 ); - TabStop = TRUE; - DropDown = FALSE; - }; - FixedText FT_WEST_STYLE - { - Pos = MAP_APPFONT ( 96 , 14 ); - Size = MAP_APPFONT ( 40 , 8 ); - }; - FixedText FT_WEST_STYLE_NOCJK - { - Pos = MAP_APPFONT ( 130 , 6 ); - Size = MAP_APPFONT ( 72 , 8 ); - }; - ComboBox LB_WEST_STYLE - { - HelpID = "cui:ComboBox:RID_SVXPAGE_CHAR_NAME:LB_WEST_STYLE"; - Border = TRUE; - Pos = MAP_APPFONT ( 96 , 25 ); - Size = MAP_APPFONT ( 40 , 48 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "Normal" ; - "Italic" ; - "Bold" ; - "Bold italic" ; - }; - }; - ComboBox LB_WEST_STYLE_NOCJK - { - HelpID = "cui:ComboBox:RID_SVXPAGE_CHAR_NAME:LB_WEST_STYLE_NOCJK"; - Border = TRUE; - Pos = MAP_APPFONT ( 130 , 17 ); - Size = MAP_APPFONT ( 72 , 71 ); - TabStop = TRUE; - DropDown = FALSE; - StringList [ en-US ] = - { - "Normal" ; - "Italic" ; - "Bold" ; - "Bold italic" ; - }; - }; - FixedText FT_WEST_SIZE - { - Pos = MAP_APPFONT ( 140 , 14 ); - Size = MAP_APPFONT ( 38 , 8 ); - Text [ en-US ] = "Size"; - }; - FixedText FT_WEST_SIZE_NOCJK - { - Pos = MAP_APPFONT ( 208 , 6 ); - Size = MAP_APPFONT ( 40 , 8 ); - Text [ en-US ] = "Size"; - }; - MetricBox LB_WEST_SIZE - { - HelpID = "cui:MetricBox:RID_SVXPAGE_CHAR_NAME:LB_WEST_SIZE"; - Border = TRUE; - Pos = MAP_APPFONT ( 140 , 25 ); - Size = MAP_APPFONT ( 38 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - }; - MetricBox LB_WEST_SIZE_NOCJK - { - HelpID = "cui:MetricBox:RID_SVXPAGE_CHAR_NAME:LB_WEST_SIZE_NOCJK"; - Border = TRUE; - Pos = MAP_APPFONT ( 208 , 17 ); - Size = MAP_APPFONT ( 40 , 71 ); - TabStop = TRUE; - DropDown = FALSE; - }; - FixedText FT_WEST_LANG - { - Pos = MAP_APPFONT ( 182 , 14 ); - Size = MAP_APPFONT ( 66 , 8 ); - Text [ en-US ] = "Language"; - }; - FixedText FT_WEST_LANG_NOCJK - { - Pos = MAP_APPFONT ( 130 , 94 ); - Size = MAP_APPFONT ( 72 , 8 ); - Text [ en-US ] = "~Language"; - }; - ListBox LB_WEST_LANG - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_NAME:LB_WEST_LANG"; - Border = TRUE; - Pos = MAP_APPFONT ( 182 , 25 ); - Size = MAP_APPFONT ( 66 , 72 ); - TabStop = TRUE; - Sort = TRUE ; - DropDown = TRUE; - }; - ListBox LB_WEST_LANG_NOCJK - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_NAME:LB_WEST_LANG_NOCJK"; - Border = TRUE; - Pos = MAP_APPFONT ( 130 , 105 ); - Size = MAP_APPFONT ( 72 , 72 ); - TabStop = TRUE; - Sort = TRUE ; - DropDown = TRUE; - }; - FixedLine FL_EAST - { - Pos = MAP_APPFONT ( 6 , 43 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Asian text font"; - }; - FixedText FT_EAST_NAME - { - Pos = MAP_APPFONT ( 12 , 54 ); - Size = MAP_APPFONT ( 80 , 8 ); - }; - ComboBox LB_EAST_NAME - { - HelpID = "cui:ComboBox:RID_SVXPAGE_CHAR_NAME:LB_EAST_NAME"; - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 65 ); - Size = MAP_APPFONT ( 80 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - }; - FixedText FT_EAST_STYLE - { - Pos = MAP_APPFONT ( 96 , 54 ); - Size = MAP_APPFONT ( 40 , 8 ); - }; - ComboBox LB_EAST_STYLE - { - HelpID = "cui:ComboBox:RID_SVXPAGE_CHAR_NAME:LB_EAST_STYLE"; - Border = TRUE; - Pos = MAP_APPFONT ( 96 , 65 ); - Size = MAP_APPFONT ( 40 , 48 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "Normal" ; - "Italic" ; - "Bold" ; - "Bold italic" ; - }; - }; - FixedText FT_EAST_SIZE - { - Pos = MAP_APPFONT ( 140 , 54 ); - Size = MAP_APPFONT ( 38 , 8 ); - Text [ en-US ] = "Size"; - }; - MetricBox LB_EAST_SIZE - { - HelpID = "cui:MetricBox:RID_SVXPAGE_CHAR_NAME:LB_EAST_SIZE"; - Border = TRUE; - Pos = MAP_APPFONT ( 140 , 65 ); - Size = MAP_APPFONT ( 38 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - }; - FixedText FT_EAST_LANG - { - Pos = MAP_APPFONT ( 182 , 54 ); - Size = MAP_APPFONT ( 66 , 8 ); - Text [ en-US ] = "Language"; - }; - ListBox LB_EAST_LANG - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_NAME:LB_EAST_LANG"; - Border = TRUE; - Pos = MAP_APPFONT ( 182 , 65 ); - Size = MAP_APPFONT ( 66 , 72 ); - TabStop = TRUE; - Sort = TRUE ; - DropDown = TRUE; - }; - FixedLine FL_CTL - { - Pos = MAP_APPFONT ( 6 , 83 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "CTL font"; - }; - FixedText FT_CTL_NAME - { - Pos = MAP_APPFONT ( 12 , 94 ); - Size = MAP_APPFONT ( 80 , 8 ); - }; - ComboBox LB_CTL_NAME - { - HelpID = "cui:ComboBox:RID_SVXPAGE_CHAR_NAME:LB_CTL_NAME"; - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 105 ); - Size = MAP_APPFONT ( 80 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - }; - FixedText FT_CTL_STYLE - { - Pos = MAP_APPFONT ( 96 , 94 ); - Size = MAP_APPFONT ( 40 , 8 ); - }; - ComboBox LB_CTL_STYLE - { - HelpID = "cui:ComboBox:RID_SVXPAGE_CHAR_NAME:LB_CTL_STYLE"; - Border = TRUE; - Pos = MAP_APPFONT ( 96 , 105 ); - Size = MAP_APPFONT ( 40 , 48 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "Normal" ; - "Italic" ; - "Bold" ; - "Bold italic" ; - }; - }; - FixedText FT_CTL_SIZE - { - Pos = MAP_APPFONT ( 140 , 94 ); - Size = MAP_APPFONT ( 38 , 8 ); - Text [ en-US ] = "Size"; - }; - MetricBox LB_CTL_SIZE - { - HelpID = "cui:MetricBox:RID_SVXPAGE_CHAR_NAME:LB_CTL_SIZE"; - Border = TRUE; - Pos = MAP_APPFONT ( 140 , 105 ); - Size = MAP_APPFONT ( 38 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - }; - FixedText FT_CTL_LANG - { - Pos = MAP_APPFONT ( 182 , 94 ); - Size = MAP_APPFONT ( 66 , 8 ); - Text [ en-US ] = "Language"; - }; - ListBox LB_CTL_LANG - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_NAME:LB_CTL_LANG"; - Border = TRUE; - Pos = MAP_APPFONT ( 182 , 105 ); - Size = MAP_APPFONT ( 66 , 72 ); - TabStop = TRUE; - Sort = TRUE ; - DropDown = TRUE; - }; - Window WIN_CHAR_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 149 ) ; - Size = MAP_APPFONT ( 248 , 37 ) ; - Text [ en-US ] = "Example"; - }; - FixedText FT_CHAR_FONTTYPE - { - Pos = MAP_APPFONT ( 6 , 129 ) ; - Size = MAP_APPFONT ( 248 , 16 ) ; - WordBreak = TRUE ; - }; - FixedLine FL_COLOR2 - { - Pos = MAP_APPFONT ( 6 , 83 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Color" ; - }; - FixedText FT_COLOR2 - { - Pos = MAP_APPFONT ( 12 , 94 ); - Size = MAP_APPFONT ( 58 , 8 ); - Text [ en-US ] = "Font ~color" ; - }; - ListBox LB_COLOR2 - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_NAME:LB_COLOR2"; - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 105 ); - Size = MAP_APPFONT ( 58 , 100 ); - TabStop = TRUE; - DropDown = TRUE; - }; - String STR_CHARNAME_NOSTYLE - { - Text [ en-US ] = "No %1"; - }; - String STR_CHARNAME_TRANSPARENT - { - Text [ en-US ] = "Transparent"; - }; - String STR_CHARNAME_FAMILY - { - Text [ en-US ] = "Family"; - }; - String STR_CHARNAME_FONT - { - Text [ en-US ] = "Font"; - }; - String STR_CHARNAME_STYLE - { - Text [ en-US ] = "Style"; - }; - String STR_CHARNAME_TYPEFACE - { - Text [ en-US ] = "Typeface"; - }; -}; - -// RID_SVXPAGE_CHAR_EFFECTS --------------------------------------------------- - -TabPage RID_SVXPAGE_CHAR_EFFECTS -{ - HelpId = HID_SVXPAGE_CHAR_EFFECTS ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE ; - FixedText FT_FONTCOLOR - { - Pos = MAP_APPFONT ( 10 , 4 ); - Size = MAP_APPFONT ( 82 , 8 ); - Text [ en-US ] = "Font ~color" ; - }; - ListBox LB_FONTCOLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_FONTCOLOR"; - Border = TRUE; - Pos = MAP_APPFONT ( 10 , 15 ); - Size = MAP_APPFONT ( 82 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - }; - FixedText FT_EFFECTS - { - Pos = MAP_APPFONT( 10 , 33 ); - Size = MAP_APPFONT( 82 , 8 ); - Text [ en-US ] = "~Effects" ; - }; - ListBox LB_EFFECTS2 - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_EFFECTS2"; - Pos = MAP_APPFONT ( 10 , 44 ) ; - Size = MAP_APPFONT ( 82 , 56 ) ; - DropDown = TRUE; - StringList [ en-US ] = - { - < "(Without)" ; Default ; > ; - < "Capitals" ; Default ; > ; - < "Lowercase" ; Default ; > ; - < "Title" ; Default ; > ; - < "Small capitals" ; Default ; > ; - }; - }; - FixedText FT_RELIEF - { - Pos = MAP_APPFONT ( 10 , 62 ); - Size = MAP_APPFONT ( 82 , 8 ); - Text [ en-US ] = "~Relief"; - }; - ListBox LB_RELIEF - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_RELIEF"; - Pos = MAP_APPFONT ( 10 , 73 ) ; - Size = MAP_APPFONT ( 82 , 56 ) ; - DropDown = TRUE; - StringList [ en-US ] = - { - < "(Without)" ; Default ; > ; - < "Embossed" ; Default ; > ; - < "Engraved" ; Default ; > ; - }; - }; - TriStateBox CB_OUTLINE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_CHAR_EFFECTS:CB_OUTLINE"; - Pos = MAP_APPFONT ( 10 , 93 ) ; - Size = MAP_APPFONT ( 82 , 10 ) ; - Text [ en-US ] = "Out~line" ; - }; - TriStateBox CB_SHADOW - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_CHAR_EFFECTS:CB_SHADOW"; - Pos = MAP_APPFONT ( 10 , 107 ) ; - Size = MAP_APPFONT ( 82 , 10 ) ; - Text [ en-US ] = "Sha~dow" ; - }; - TriStateBox CB_BLINKING - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_CHAR_EFFECTS:CB_BLINKING"; - Pos = MAP_APPFONT ( 10 , 121 ) ; - Size = MAP_APPFONT ( 82 , 10 ) ; - Hide = TRUE; - Text [ en-US ] = "~Blinking" ; - }; - TriStateBox CB_CHARHIDDEN - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_CHAR_EFFECTS:CB_CHARHIDDEN"; - Pos = MAP_APPFONT ( 10 , 135 ) ; - Size = MAP_APPFONT ( 82 , 10 ) ; - Text [ en-US ] = "H~idden" ; - }; - FixedLine FL_EFFECTS_VERTICAL - { - Pos = MAP_APPFONT ( 100 , 4 ) ; - Size = MAP_APPFONT ( 4 , 142 ) ; - Vert = TRUE; - }; - FixedText FT_OVERLINE - { - Pos = MAP_APPFONT( 110 , 4 ); - Size = MAP_APPFONT( 68 , 8 ); - Text [ en-US ] = "~Overlining" ; - }; - ListBox LB_OVERLINE - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_OVERLINE"; - Border = TRUE; - Pos = MAP_APPFONT ( 110 , 15 ); - Size = MAP_APPFONT ( 68 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "(Without)" ; CHRDLG_UNDERLINE_NONE ; > ; - < "Single" ; CHRDLG_UNDERLINE_SINGLE ; > ; - < "Double" ; CHRDLG_UNDERLINE_DOUBLE ; > ; - < "Bold"; CHRDLG_UNDERLINE_BOLD; > ; - < "Dotted" ; CHRDLG_UNDERLINE_DOTTED ; > ; - < "Dotted (Bold)" ; CHRDLG_UNDERLINE_BOLDDOTTED; > ; - < "Dash"; CHRDLG_UNDERLINE_DASH; > ; - < "Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASH; > ; - < "Long Dash"; CHRDLG_UNDERLINE_LONGDASH; > ; - < "Long Dash (Bold)"; CHRDLG_UNDERLINE_BOLDLONGDASH; > ; - < "Dot Dash"; CHRDLG_UNDERLINE_DASHDOT; > ; - < "Dot Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASHDOT; > ; - < "Dot Dot Dash"; CHRDLG_UNDERLINE_DASHDOTDOT; > ; - < "Dot Dot Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASHDOTDOT; > ; - < "Wave"; CHRDLG_UNDERLINE_WAVE; > ; - < "Wave (Bold)"; CHRDLG_UNDERLINE_BOLDWAVE; > ; - < "Double Wave"; CHRDLG_UNDERLINE_DOUBLEWAVE; > ; - }; - }; - FixedText FT_OVERLINE_COLOR - { - Pos = MAP_APPFONT ( 184 , 4 ); - Size = MAP_APPFONT ( 68 , 8 ); - Text [ en-US ] = "O~verline color"; - }; - ListBox LB_OVERLINE_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_OVERLINE_COLOR"; - Border = TRUE; - Pos = MAP_APPFONT ( 184 , 15 ); - Size = MAP_APPFONT ( 68 , 100 ); - TabStop = TRUE; - DropDown = TRUE; - }; - FixedText FT_STRIKEOUT - { - Pos = MAP_APPFONT ( 110 , 33 ); - Size = MAP_APPFONT ( 68 , 8 ); - Text [ en-US ] = "~Strikethrough" ; - }; - ListBox LB_STRIKEOUT - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_STRIKEOUT"; - Border = TRUE; - Pos = MAP_APPFONT ( 110 , 44 ); - Size = MAP_APPFONT ( 68 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "(Without)" ; CHRDLG_STRIKEOUT_NONE ; > ; - < "Single" ; CHRDLG_STRIKEOUT_SINGLE ; > ; - < "Double" ; CHRDLG_STRIKEOUT_DOUBLE ; > ; - < "Bold" ; CHRDLG_STRIKEOUT_BOLD ; > ; - < "With /" ; CHRDLG_STRIKEOUT_SLASH ; > ; - < "With X" ; CHRDLG_STRIKEOUT_X ; > ; - }; - }; - FixedText FT_UNDERLINE - { - Pos = MAP_APPFONT( 110 , 62 ); - Size = MAP_APPFONT( 68 , 8 ); - Text [ en-US ] = "~Underlining" ; - }; - ListBox LB_UNDERLINE - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_UNDERLINE"; - Border = TRUE; - Pos = MAP_APPFONT ( 110 , 73 ); - Size = MAP_APPFONT ( 68 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "(Without)" ; CHRDLG_UNDERLINE_NONE ; > ; - < "Single" ; CHRDLG_UNDERLINE_SINGLE ; > ; - < "Double" ; CHRDLG_UNDERLINE_DOUBLE ; > ; - < "Bold"; CHRDLG_UNDERLINE_BOLD; > ; - < "Dotted" ; CHRDLG_UNDERLINE_DOTTED ; > ; - < "Dotted (Bold)" ; CHRDLG_UNDERLINE_BOLDDOTTED; > ; - < "Dash"; CHRDLG_UNDERLINE_DASH; > ; - < "Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASH; > ; - < "Long Dash"; CHRDLG_UNDERLINE_LONGDASH; > ; - < "Long Dash (Bold)"; CHRDLG_UNDERLINE_BOLDLONGDASH; > ; - < "Dot Dash"; CHRDLG_UNDERLINE_DASHDOT; > ; - < "Dot Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASHDOT; > ; - < "Dot Dot Dash"; CHRDLG_UNDERLINE_DASHDOTDOT; > ; - < "Dot Dot Dash (Bold)"; CHRDLG_UNDERLINE_BOLDDASHDOTDOT; > ; - < "Wave"; CHRDLG_UNDERLINE_WAVE; > ; - < "Wave (Bold)"; CHRDLG_UNDERLINE_BOLDWAVE; > ; - < "Double Wave"; CHRDLG_UNDERLINE_DOUBLEWAVE; > ; - }; - }; - FixedText FT_UNDERLINE_COLOR - { - Pos = MAP_APPFONT ( 184 , 62 ); - Size = MAP_APPFONT ( 68 , 8 ); - Text [ en-US ] = "U~nderline color"; - }; - ListBox LB_UNDERLINE_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_UNDERLINE_COLOR"; - Border = TRUE; - Pos = MAP_APPFONT ( 184 , 73 ); - Size = MAP_APPFONT ( 68 , 100 ); - TabStop = TRUE; - DropDown = TRUE; - }; - CheckBox CB_INDIVIDUALWORDS - { - HelpID = "cui:CheckBox:RID_SVXPAGE_CHAR_EFFECTS:CB_INDIVIDUALWORDS"; - Pos = MAP_APPFONT ( 110 , 93 ); - Size = MAP_APPFONT ( 68 , 10 ); - TabStop = TRUE; - Text [ en-US ] = "Individual ~words" ; - }; - FixedLine FL_EFFECTS_ASIAN - { - Pos = MAP_APPFONT ( 106 , 110 ) ; - Size = MAP_APPFONT ( 148 , 4 ) ; - }; - FixedText FT_EMPHASIS - { - Pos = MAP_APPFONT ( 110 , 117 ); - Size = MAP_APPFONT ( 68 , 8 ); - Text [ en-US ] = "Emp~hasis mark" ; - }; - ListBox LB_EMPHASIS - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_EMPHASIS"; - Border = TRUE; - Pos = MAP_APPFONT ( 110 , 128 ); - Size = MAP_APPFONT ( 68 , 72 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "(Without)" ; default ; > ; - < "Dot" ; default ; > ; - < "Circle" ; default ; > ; - < "Disc" ; default ; > ; - < "Accent" ; default ; > ; - }; - }; - FixedText FT_POSITION - { - Pos = MAP_APPFONT ( 184 , 117 ); - Size = MAP_APPFONT ( 68 , 8 ); - Text [ en-US ] = "~Position" ; - }; - ListBox LB_POSITION - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_EFFECTS:LB_POSITION"; - Border = TRUE; - Pos = MAP_APPFONT ( 184 , 128 ); - Size = MAP_APPFONT ( 68 , 48 ); - TabStop = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "Above text" ; CHRDLG_POSITION_OVER ; > ; - < "Below text" ; CHRDLG_POSITION_UNDER ; > ; - }; - }; - Window WIN_EFFECTS_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 149 ) ; - Size = MAP_APPFONT ( 248 , 37 ) ; - Text [ en-US ] = "Example"; - }; - FixedText FT_EFFECTS_FONTTYPE - { - Pos = MAP_APPFONT ( 6 , 168 ) ; - Size = MAP_APPFONT ( 248 , 16 ) ; - WordBreak = TRUE ; - Hide = TRUE; - }; - String STR_EFFECTS_CAPITALS - { - Text [ en-US ] = "Capitals" ; - }; - String STR_EFFECTS_LOWERCASE - { - Text [ en-US ] = "Lowercase" ; - }; - String STR_EFFECTS_TITLE - { - Text [ en-US ] = "Title" ; - }; - String STR_EFFECTS_SMALL - { - Text [ en-US ] = "Small Capitals" ; - }; - String STR_EFFECTS_OUTLINE - { - Text [ en-US ] = "Outline" ; - }; - String STR_EFFECTS_SHADOW - { - Text [ en-US ] = "Shadow" ; - }; - String STR_EFFECTS_BLINKING - { - Text [ en-US ] = "Blinking" ; - }; - String STR_CHARNAME_TRANSPARENT - { - Text [ en-US ] = "Transparent"; - }; -}; - -// RID_SVXPAGE_CHAR_POSITION ------------------------------------------------ - -TabPage RID_SVXPAGE_CHAR_POSITION -{ - HelpId = HID_SVXPAGE_CHAR_POSITION ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE ; - FixedLine FL_POSITION - { - Pos = MAP_APPFONT ( 6 , 3 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Position" ; - }; - RadioButton RB_HIGHPOS - { - HelpID = "cui:RadioButton:RID_SVXPAGE_CHAR_POSITION:RB_HIGHPOS"; - Pos = MAP_APPFONT ( 12 , 16 ); - Size = MAP_APPFONT ( 58 , 10 ); - Text [ en-US ] = "Superscript" ; - TabStop = TRUE; - }; - RadioButton RB_NORMALPOS - { - HelpID = "cui:RadioButton:RID_SVXPAGE_CHAR_POSITION:RB_NORMALPOS"; - Pos = MAP_APPFONT ( 12 , 30 ); - Size = MAP_APPFONT ( 58 , 10 ); - Text [ en-US ] = "Normal" ; - TabStop = TRUE; - }; - RadioButton RB_LOWPOS - { - HelpID = "cui:RadioButton:RID_SVXPAGE_CHAR_POSITION:RB_LOWPOS"; - Pos = MAP_APPFONT ( 12 , 44 ); - Size = MAP_APPFONT ( 58 , 10 ); - Text [ en-US ] = "Subscript" ; - TabStop = TRUE; - }; - FixedText FT_HIGHLOW - { - Pos = MAP_APPFONT ( 74 , 16 ); - Size = MAP_APPFONT ( 58 , 8 ); - Text [ en-US ] = "~Raise/lower by" ; - }; - MetricField ED_HIGHLOW - { - HelpID = "cui:MetricField:RID_SVXPAGE_CHAR_POSITION:ED_HIGHLOW"; - Border = TRUE; - Pos = MAP_APPFONT ( 136 , 14 ); - Size = MAP_APPFONT ( 30 , 12 ); - TabStop = TRUE; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 100 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - First = 1 ; - Last = 100 ; - SpinSize = 1 ; - }; - CheckBox CB_HIGHLOW - { - HelpID = "cui:CheckBox:RID_SVXPAGE_CHAR_POSITION:CB_HIGHLOW"; - Pos = MAP_APPFONT ( 172 , 16 ); - Size = MAP_APPFONT ( 76 , 10 ); - Text [ en-US ] = "A~utomatic" ; - TabStop = TRUE; - }; - FixedText FT_FONTSIZE - { - Pos = MAP_APPFONT ( 74 , 32 ); - Size = MAP_APPFONT ( 58 , 8 ); - Text [ en-US ] = "Relative font size" ; - }; - MetricField ED_FONTSIZE - { - HelpID = "cui:MetricField:RID_SVXPAGE_CHAR_POSITION:ED_FONTSIZE"; - Border = TRUE; - Pos = MAP_APPFONT ( 136 , 30 ); - Size = MAP_APPFONT ( 30 , 12 ); - TabStop = TRUE; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 100 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - First = 1 ; - Last = 100 ; - SpinSize = 1 ; - }; - FixedLine FL_ROTATION_SCALING - { - Pos = MAP_APPFONT ( 6 , 59 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Rotation / scaling" ; - }; - FixedLine FL_SCALING - { - Pos = MAP_APPFONT ( 6 , 59 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Scaling" ; - }; - RadioButton RB_0_DEG - { - HelpID = "cui:RadioButton:RID_SVXPAGE_CHAR_POSITION:RB_0_DEG"; - Pos = MAP_APPFONT ( 12 , 70 ); - Size = MAP_APPFONT ( 46 , 10 ); - TabStop = TRUE; - Text [ en-US ] = "~0 degrees" ; - }; - RadioButton RB_90_DEG - { - HelpID = "cui:RadioButton:RID_SVXPAGE_CHAR_POSITION:RB_90_DEG"; - Pos = MAP_APPFONT ( 62 , 70 ); - Size = MAP_APPFONT ( 46 , 10 ); - TabStop = TRUE; - Text [ en-US ] = "~90 degrees" ; - }; - RadioButton RB_270_DEG - { - HelpID = "cui:RadioButton:RID_SVXPAGE_CHAR_POSITION:RB_270_DEG"; - Pos = MAP_APPFONT ( 112 , 70 ); - Size = MAP_APPFONT ( 46 , 10 ); - TabStop = TRUE; - Text [ en-US ] = "~270 degrees" ; - }; - CheckBox CB_FIT_TO_LINE - { - HelpID = "cui:CheckBox:RID_SVXPAGE_CHAR_POSITION:CB_FIT_TO_LINE"; - Pos = MAP_APPFONT ( 162 , 70 ); - Size = MAP_APPFONT ( 86 , 10 ); - TabStop = TRUE; - Text [ en-US ] = "Fit to line" ; - }; - FixedText FT_SCALE_WIDTH - { - Pos = MAP_APPFONT ( 12 , 86 ); - Size = MAP_APPFONT ( 80 , 8 ); - Text [ en-US ] = "Scale ~width" ; - }; - MetricField MF_SCALE_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_CHAR_POSITION:MF_SCALE_WIDTH"; - Border = TRUE; - Pos = MAP_APPFONT ( 94 , 84 ); - Size = MAP_APPFONT ( 30 , 12 ); - TabStop = TRUE; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 999 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - First = 50 ; - Last = 200 ; - SpinSize = 1 ; - }; - FixedLine FL_KERNING2 - { - Pos = MAP_APPFONT ( 6 , 100 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Spacing" ; - }; - ListBox LB_KERNING2 - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_POSITION:LB_KERNING2"; - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 111 ); - Size = MAP_APPFONT ( 72 , 48 ) ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Default" ; Default ; > ; - < "Expanded" ; Default ; > ; - < "Condensed" ; Default ; > ; - }; - }; - FixedText FT_KERNING2 - { - Pos = MAP_APPFONT ( 86 , 113 ); - Size = MAP_APPFONT ( 24 , 8 ); - Center = TRUE ; - Text [ en-US ] = "b~y" ; - }; - MetricField ED_KERNING2 - { - HelpID = "cui:MetricField:RID_SVXPAGE_CHAR_POSITION:ED_KERNING2"; - Border = TRUE; - Pos = MAP_APPFONT ( 112 , 111 ); - Size = MAP_APPFONT ( 40 , 12 ); - TabStop = TRUE; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 9999 ; - DecimalDigits = 1 ; - Unit = FUNIT_POINT ; - SpinSize = 10 ; - }; - CheckBox CB_PAIRKERNING - { - HelpID = "cui:CheckBox:RID_SVXPAGE_CHAR_POSITION:CB_PAIRKERNING"; - Pos = MAP_APPFONT ( 156 , 113 ); - Size = MAP_APPFONT ( 92 , 10 ); - Text [ en-US ] = "~Pair kerning" ; - TabStop = TRUE; - }; - Window WIN_POS_PREVIEW - { - Text [ en-US ] = "Example" ; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 149 ) ; - Size = MAP_APPFONT ( 248 , 37 ) ; - }; - FixedText FT_POS_FONTTYPE - { - Pos = MAP_APPFONT ( 6 , 168 ) ; - Size = MAP_APPFONT ( 248 , 16 ) ; - WordBreak = TRUE ; - Hide = TRUE; - }; -}; - -TabPage RID_SVXPAGE_CHAR_TWOLINES -{ - HelpId = HID_SVXPAGE_CHAR_TWOLINES ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE ; - FixedLine FL_SWITCHON - { - Pos = MAP_APPFONT ( 6 , 3 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Double-lined" ; - }; - CheckBox CB_TWOLINES - { - HelpID = "cui:CheckBox:RID_SVXPAGE_CHAR_TWOLINES:CB_TWOLINES"; - Pos = MAP_APPFONT ( 12 , 14 ); - Size = MAP_APPFONT ( 236 , 10 ); - Text [ en-US ] = "~Write in double lines" ; - TabStop = TRUE; - }; - FixedLine FL_ENCLOSE - { - Pos = MAP_APPFONT ( 6 , 30 ); - Size = MAP_APPFONT ( 248 , 8 ); - Text [ en-US ] = "Enclosing character" ; - }; - FixedText FT_STARTBRACKET - { - Pos = MAP_APPFONT ( 12 , 41 ); - Size = MAP_APPFONT ( 90 , 8 ); - Text [ en-US ] = "I~nitial character" ; - }; - ListBox ED_STARTBRACKET - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_TWOLINES:ED_STARTBRACKET"; - Pos = MAP_APPFONT ( 12 , 52 ); - Size = MAP_APPFONT ( 90 , 72 ); - TabStop = TRUE; - Border = TRUE; - StringList [ en-US ] = - { - < "(None)" ; CHRDLG_ENCLOSE_NONE ; > ; - < "(" ; CHRDLG_ENCLOSE_ROUND ; > ; - < "[" ; CHRDLG_ENCLOSE_SQUARE ; > ; - < "<" ; CHRDLG_ENCLOSE_POINTED ; > ; - < "{" ; CHRDLG_ENCLOSE_CURVED ; > ; - < "Other Characters..." ; CHRDLG_ENCLOSE_SPECIAL_CHAR ; > ; - }; - }; - FixedText FT_ENDBRACKET - { - Pos = MAP_APPFONT ( 108 , 41 ); - Size = MAP_APPFONT ( 90 , 8 ); - Text [ en-US ] = "Final charact~er" ; - }; - ListBox ED_ENDBRACKET - { - HelpID = "cui:ListBox:RID_SVXPAGE_CHAR_TWOLINES:ED_ENDBRACKET"; - Pos = MAP_APPFONT ( 108 , 52 ); - Size = MAP_APPFONT ( 90 , 72 ); - TabStop = TRUE; - Border = TRUE; - StringList [ en-US ] = - { - < "(None)" ; CHRDLG_ENCLOSE_NONE ; > ; - < ")" ; CHRDLG_ENCLOSE_ROUND ; > ; - < "]" ; CHRDLG_ENCLOSE_SQUARE ; > ; - < ">" ; CHRDLG_ENCLOSE_POINTED ; > ; - < "}" ; CHRDLG_ENCLOSE_CURVED ; > ; - < "Other Characters..." ; CHRDLG_ENCLOSE_SPECIAL_CHAR ; > ; - }; - }; - Window WIN_TWOLINES_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 149 ) ; - Size = MAP_APPFONT ( 248 , 37 ) ; - Text [ en-US ] = "Example" ; - }; - FixedText FT_TWOLINES_FONTTYPE - { - Pos = MAP_APPFONT ( 6 , 168 ) ; - Size = MAP_APPFONT ( 248 , 16 ) ; - WordBreak = TRUE ; - Hide = TRUE; - }; -}; - - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx deleted file mode 100644 index c1ffd80f2..000000000 --- a/cui/source/tabpages/connect.cxx +++ /dev/null @@ -1,566 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <tools/shl.hxx> -#include "svx/ofaitem.hxx" -#include <sfx2/request.hxx> -#include <svx/dialogs.hrc> - -#define _SVX_CONNECT_CXX - -#include <svx/svdoedge.hxx> -#include <svx/svdattr.hxx> -#include <svx/svdattrx.hxx> -#include <svx/svdview.hxx> - -#include "svx/connctrl.hxx" -#include "connect.hxx" -#include "connect.hrc" -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" - -#include "paragrph.hrc" -#include <cuires.hrc> - -static sal_uInt16 pRanges[] = -{ - SDRATTR_EDGE_FIRST, - SDRATTR_EDGE_LAST, - 0 -}; - -/************************************************************************* -|* -|* Dialog zum Aendern von Konnektoren (Connectors) -|* -\************************************************************************/ - -SvxConnectionDialog::SvxConnectionDialog( Window* pParent, const SfxItemSet& rInAttrs, - const SdrView* pSdrView ) : - SfxSingleTabDialog( pParent, rInAttrs, RID_SVXPAGE_CONNECTION ) -{ - SvxConnectionPage* _pPage = new SvxConnectionPage( this, rInAttrs ); - - _pPage->SetView( pSdrView ); - _pPage->Construct(); - - SetTabPage( _pPage ); - SetText( _pPage->GetText() ); -} - -/************************************************************************* -|* -|* Dtor -|* -\************************************************************************/ - -SvxConnectionDialog::~SvxConnectionDialog() -{ -} - -/************************************************************************* -|* -|* Seite zum Aendern von Konnektoren (Connectors) -|* -\************************************************************************/ - -SvxConnectionPage::SvxConnectionPage( Window* pWindow, const SfxItemSet& rInAttrs ) : - SfxTabPage ( pWindow, CUI_RES( RID_SVXPAGE_CONNECTION ), - rInAttrs ), - - aFtType ( this, CUI_RES( FT_TYPE ) ), - aLbType ( this, CUI_RES( LB_TYPE ) ), - - aFlDelta ( this, CUI_RES( FL_DELTA ) ), - aFtLine1 ( this, CUI_RES( FT_LINE_1 ) ), - aMtrFldLine1 ( this, CUI_RES( MTR_FLD_LINE_1 ) ), - aFtLine2 ( this, CUI_RES( FT_LINE_2 ) ), - aMtrFldLine2 ( this, CUI_RES( MTR_FLD_LINE_2 ) ), - aFtLine3 ( this, CUI_RES( FT_LINE_3 ) ), - aMtrFldLine3 ( this, CUI_RES( MTR_FLD_LINE_3 ) ), - - aFlDistance ( this, CUI_RES( FL_DISTANCE ) ), - aFtHorz1 ( this, CUI_RES( FT_HORZ_1 ) ), - aMtrFldHorz1 ( this, CUI_RES( MTR_FLD_HORZ_1 ) ), - aFtVert1 ( this, CUI_RES( FT_VERT_1 ) ), - aMtrFldVert1 ( this, CUI_RES( MTR_FLD_VERT_1 ) ), - aFtHorz2 ( this, CUI_RES( FT_HORZ_2 ) ), - aMtrFldHorz2 ( this, CUI_RES( MTR_FLD_HORZ_2 ) ), - aFtVert2 ( this, CUI_RES( FT_VERT_2 ) ), - aMtrFldVert2 ( this, CUI_RES( MTR_FLD_VERT_2 ) ), - - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ), rInAttrs ), - rOutAttrs ( rInAttrs ), - aAttrSet ( *rInAttrs.GetPool() ) -{ - FreeResource(); - - aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE))); - - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - eUnit = pPool->GetMetric( SDRATTR_EDGENODE1HORZDIST ); - - FillTypeLB(); - - const FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs ); - SetFieldUnit( aMtrFldHorz1, eFUnit ); - SetFieldUnit( aMtrFldHorz2, eFUnit ); - SetFieldUnit( aMtrFldVert1, eFUnit ); - SetFieldUnit( aMtrFldVert2, eFUnit ); - SetFieldUnit( aMtrFldLine1, eFUnit ); - SetFieldUnit( aMtrFldLine2, eFUnit ); - SetFieldUnit( aMtrFldLine3, eFUnit ); - if( eFUnit == FUNIT_MM ) - { - aMtrFldHorz1.SetSpinSize( 50 ); - aMtrFldHorz2.SetSpinSize( 50 ); - aMtrFldVert1.SetSpinSize( 50 ); - aMtrFldVert2.SetSpinSize( 50 ); - aMtrFldLine1.SetSpinSize( 50 ); - aMtrFldLine2.SetSpinSize( 50 ); - aMtrFldLine3.SetSpinSize( 50 ); - } - - // disable 3D border - aCtlPreview.SetBorderStyle(WINDOW_BORDER_MONO); - - Link aLink( LINK( this, SvxConnectionPage, ChangeAttrHdl_Impl ) ); - aMtrFldHorz1.SetModifyHdl( aLink ); - aMtrFldVert1.SetModifyHdl( aLink ); - aMtrFldHorz2.SetModifyHdl( aLink ); - aMtrFldVert2.SetModifyHdl( aLink ); - aMtrFldLine1.SetModifyHdl( aLink ); - aMtrFldLine2.SetModifyHdl( aLink ); - aMtrFldLine3.SetModifyHdl( aLink ); - aLbType.SetSelectHdl( aLink ); -} - -/************************************************************************* -|* -|* Dtor -|* -\************************************************************************/ - -SvxConnectionPage::~SvxConnectionPage() -{ -} - -/************************************************************************* -|* -|* Liest uebergebenen Item-Set -|* -\************************************************************************/ - -void SvxConnectionPage::Reset( const SfxItemSet& rAttrs ) -{ - const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_EDGENODE1HORZDIST ); - const SfxItemPool* pPool = rAttrs.GetPool(); - - // SdrEdgeNode1HorzDistItem - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE1HORZDIST ); - if( pItem ) - { - long nValue = ( ( const SdrEdgeNode1HorzDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHorz1, nValue, eUnit ); - } - else - aMtrFldHorz1.SetEmptyFieldValue(); - - aMtrFldHorz1.SaveValue(); - - // SdrEdgeNode2HorzDistItem - pItem = GetItem( rAttrs, SDRATTR_EDGENODE2HORZDIST ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE2HORZDIST ); - if( pItem ) - { - long nValue = ( ( const SdrEdgeNode2HorzDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHorz2, nValue, eUnit ); - } - else - aMtrFldHorz2.SetEmptyFieldValue(); - - aMtrFldHorz2.SaveValue(); - - // SdrEdgeNode1VertDistItem - pItem = GetItem( rAttrs, SDRATTR_EDGENODE1VERTDIST ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE1VERTDIST ); - if( pItem ) - { - long nValue = ( ( const SdrEdgeNode1VertDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldVert1, nValue, eUnit ); - } - else - aMtrFldVert1.SetEmptyFieldValue(); - - aMtrFldVert1.SaveValue(); - - // SdrEdgeNode2VertDistItem - pItem = GetItem( rAttrs, SDRATTR_EDGENODE2VERTDIST ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGENODE2VERTDIST ); - if( pItem ) - { - long nValue = ( ( const SdrEdgeNode2VertDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldVert2, nValue, eUnit ); - } - else - aMtrFldVert2.SetEmptyFieldValue(); - - aMtrFldVert2.SaveValue(); - - // SdrEdgeLine1DeltaItem - pItem = GetItem( rAttrs, SDRATTR_EDGELINE1DELTA ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE1DELTA ); - if( pItem ) - { - long nValue = ( ( const SdrEdgeLine1DeltaItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldLine1, nValue, eUnit ); - } - else - aMtrFldLine1.SetEmptyFieldValue(); - - aMtrFldLine1.SaveValue(); - - // SdrEdgeLine2DeltaItem - pItem = GetItem( rAttrs, SDRATTR_EDGELINE2DELTA ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE2DELTA ); - if( pItem ) - { - long nValue = ( ( const SdrEdgeLine2DeltaItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldLine2, nValue, eUnit ); - } - else - aMtrFldLine2.SetEmptyFieldValue(); - - aMtrFldLine2.SaveValue(); - - // SdrEdgeLine3DeltaItem - pItem = GetItem( rAttrs, SDRATTR_EDGELINE3DELTA ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINE3DELTA ); - if( pItem ) - { - long nValue = ( ( const SdrEdgeLine3DeltaItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldLine3, nValue, eUnit ); - } - else - aMtrFldLine3.SetEmptyFieldValue(); - - aMtrFldLine3.SaveValue(); - - // SdrEdgeLineDeltaAnzItem - pItem = GetItem( rAttrs, SDRATTR_EDGELINEDELTAANZ ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGELINEDELTAANZ ); - if( pItem ) - { - sal_uInt16 nValue = ( ( const SdrEdgeLineDeltaAnzItem* )pItem )->GetValue(); - if( nValue <= 2 ) - { - aFtLine3.Enable( sal_False ); - aMtrFldLine3.Enable( sal_False ); - aMtrFldLine3.SetEmptyFieldValue(); - } - if( nValue <= 1 ) - { - aFtLine2.Enable( sal_False ); - aMtrFldLine2.Enable( sal_False ); - aMtrFldLine2.SetEmptyFieldValue(); - } - if( nValue == 0 ) - { - aFtLine1.Enable( sal_False ); - aMtrFldLine1.Enable( sal_False ); - aMtrFldLine1.SetEmptyFieldValue(); - } - } - - // SdrEdgeKindItem - pItem = GetItem( rAttrs, SDRATTR_EDGEKIND ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND ); - if( pItem ) - { - SdrEdgeKind nValue = ( ( const SdrEdgeKindItem* )pItem )->GetValue(); - aLbType.SelectEntryPos( sal::static_int_cast< sal_uInt16 >(nValue) ); - } - else - aLbType.SetNoSelection(); - aLbType.SaveValue(); -} - -/************************************************************************* -|* -|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen -|* -\************************************************************************/ - -sal_Bool SvxConnectionPage::FillItemSet( SfxItemSet& rAttrs) -{ - sal_Bool bModified = sal_False; - sal_Int32 nValue; - - if( aMtrFldHorz1.GetText() != aMtrFldHorz1.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldHorz1, eUnit ); - rAttrs.Put( SdrEdgeNode1HorzDistItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldHorz2.GetText() != aMtrFldHorz2.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldHorz2, eUnit ); - rAttrs.Put( SdrEdgeNode2HorzDistItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldVert1.GetText() != aMtrFldVert1.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldVert1, eUnit ); - rAttrs.Put( SdrEdgeNode1VertDistItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldVert2.GetText() != aMtrFldVert2.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldVert2, eUnit ); - rAttrs.Put( SdrEdgeNode2VertDistItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldLine1.GetText() != aMtrFldLine1.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldLine1, eUnit ); - rAttrs.Put( SdrEdgeLine1DeltaItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldLine2.GetText() != aMtrFldLine2.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldLine2, eUnit ); - rAttrs.Put( SdrEdgeLine2DeltaItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldLine3.GetText() != aMtrFldLine3.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldLine3, eUnit ); - rAttrs.Put( SdrEdgeLine3DeltaItem( nValue ) ); - bModified = sal_True; - } - - - sal_uInt16 nPos = aLbType.GetSelectEntryPos(); - if( nPos != aLbType.GetSavedValue() ) - { - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - rAttrs.Put( SdrEdgeKindItem( (SdrEdgeKind) nPos ) ); - bModified = sal_True; - } - } - - return( bModified ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -void SvxConnectionPage::Construct() -{ - DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" ); - - aCtlPreview.SetView( pView ); - aCtlPreview.Construct(); -} - -/************************************************************************* -|* -|* Erzeugt die Seite -|* -\************************************************************************/ - -SfxTabPage* SvxConnectionPage::Create( Window* pWindow, - const SfxItemSet& rAttrs ) -{ - return( new SvxConnectionPage( pWindow, rAttrs ) ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -sal_uInt16* SvxConnectionPage::GetRanges() -{ - return( pRanges ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -IMPL_LINK( SvxConnectionPage, ChangeAttrHdl_Impl, void *, p ) -{ - if( p == &aMtrFldHorz1 ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldHorz1, eUnit ); - aAttrSet.Put( SdrEdgeNode1HorzDistItem( nValue ) ); - } - - if( p == &aMtrFldHorz2 ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldHorz2, eUnit ); - aAttrSet.Put( SdrEdgeNode2HorzDistItem( nValue ) ); - } - - if( p == &aMtrFldVert1 ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldVert1, eUnit ); - aAttrSet.Put( SdrEdgeNode1VertDistItem( nValue ) ); - } - - if( p == &aMtrFldVert2 ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldVert2, eUnit ); - aAttrSet.Put( SdrEdgeNode2VertDistItem( nValue ) ); - } - - if( p == &aMtrFldLine1 ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldLine1, eUnit ); - aAttrSet.Put( SdrEdgeLine1DeltaItem( nValue ) ); - } - - if( p == &aMtrFldLine2 ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldLine2, eUnit ); - aAttrSet.Put( SdrEdgeLine2DeltaItem( nValue ) ); - } - - if( p == &aMtrFldLine3 ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldLine3, eUnit ); - aAttrSet.Put( SdrEdgeLine3DeltaItem( nValue ) ); - } - - - if( p == &aLbType ) - { - sal_uInt16 nPos = aLbType.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - aAttrSet.Put( SdrEdgeKindItem( (SdrEdgeKind) nPos ) ); - } - } - - aCtlPreview.SetAttributes( aAttrSet ); - - if( p == &aLbType ) - { - // Anzahl der Linienversaetze ermitteln - sal_uInt16 nCount = aCtlPreview.GetLineDeltaAnz(); - - aFtLine3.Enable( nCount > 2 ); - aMtrFldLine3.Enable( nCount > 2 ); - if( nCount > 2 ) - aMtrFldLine3.SetValue( aMtrFldLine3.GetValue() ); - else - aMtrFldLine3.SetEmptyFieldValue(); - - aFtLine2.Enable( nCount > 1 ); - aMtrFldLine2.Enable( nCount > 1 ); - if( nCount > 1 ) - aMtrFldLine2.SetValue( aMtrFldLine2.GetValue() ); - else - aMtrFldLine2.SetEmptyFieldValue(); - - aFtLine1.Enable( nCount > 0 ); - aMtrFldLine1.Enable( nCount > 0 ); - if( nCount > 0 ) - aMtrFldLine1.SetValue( aMtrFldLine1.GetValue() ); - else - aMtrFldLine1.SetEmptyFieldValue(); - - } - - return( 0L ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -void SvxConnectionPage::FillTypeLB() -{ - // ListBox mit Verbindernamen fuellen - const SfxPoolItem* pItem = GetItem( rOutAttrs, SDRATTR_EDGEKIND ); - const SfxItemPool* pPool = rOutAttrs.GetPool(); - - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_EDGEKIND ); - if( pItem ) - { - const SdrEdgeKindItem* pEdgeKindItem = (const SdrEdgeKindItem*) pItem; - sal_uInt16 nCount = pEdgeKindItem->GetValueCount(); - String aStr; - - for( sal_uInt16 i = 0; i < nCount; i++ ) - { - aStr = pEdgeKindItem->GetValueTextByPos( i ); - aLbType.InsertEntry( aStr ); - } - } -} -void SvxConnectionPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG(&aSet,pOfaPtrItem,OfaPtrItem,SID_OBJECT_LIST,sal_False); - if (pOfaPtrItem) - SetView( static_cast<SdrView *>(pOfaPtrItem->GetValue()) ); - - Construct(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/connect.hrc b/cui/source/tabpages/connect.hrc deleted file mode 100644 index 263972a1d..000000000 --- a/cui/source/tabpages/connect.hrc +++ /dev/null @@ -1,45 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#define FL_DISTANCE 1 -#define FL_DELTA 2 -#define FT_LINE_1 1 -#define FT_LINE_2 2 -#define FT_LINE_3 3 -#define MTR_FLD_LINE_1 1 -#define MTR_FLD_LINE_2 2 -#define MTR_FLD_LINE_3 3 -#define FT_HORZ_1 4 -#define FT_HORZ_2 5 -#define MTR_FLD_HORZ_1 4 -#define MTR_FLD_HORZ_2 5 -#define MTR_FLD_VERT_1 6 -#define MTR_FLD_VERT_2 7 -#define FT_VERT_2 7 -#define FT_VERT_1 6 -#define FT_TYPE 8 -#define LB_TYPE 1 -#define CTL_PREVIEW 1 diff --git a/cui/source/tabpages/connect.src b/cui/source/tabpages/connect.src deleted file mode 100644 index 3031be2c5..000000000 --- a/cui/source/tabpages/connect.src +++ /dev/null @@ -1,275 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // pragma ---------------------------------------------------------------- - - // include --------------------------------------------------------------- -#include <svtools/controldims.hrc> -#include "connect.hrc" -#include <cuires.hrc> -#include "helpid.hrc" -#include <svx/dialogs.hrc> - - // RID_SVXPAGE_CONNECTION ------------------------------------------------ -TabPage RID_SVXPAGE_CONNECTION -{ - HelpId = HID_PAGE_CONNECTION ; - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Text [ en-US ] = "Connector" ; - FixedText FT_TYPE - { - Pos = MAP_APPFONT ( 6 , 8 ) ; - Size = MAP_APPFONT ( 25 , 8 ) ; - Text [ en-US ] = "~Type" ; - }; - ListBox LB_TYPE - { - HelpID = "cui:ListBox:RID_SVXPAGE_CONNECTION:LB_TYPE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 37 , 6 ) ; - Size = MAP_APPFONT ( 83 , 54 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedLine FL_DELTA - { - Pos = MAP_APPFONT ( 6 , 24 ) ; - Size = MAP_APPFONT ( 120 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Line skew" ; - }; - FixedText FT_LINE_1 - { - Pos = MAP_APPFONT ( 12 , 37 ) ; - Size = MAP_APPFONT ( 66 , 8 ) ; - Text [ en-US ] = "Line ~1" ; - }; - MetricField MTR_FLD_LINE_1 - { - HelpID = "cui:MetricField:RID_SVXPAGE_CONNECTION:MTR_FLD_LINE_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 79 , 35 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Repeat = TRUE ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - Unit = FUNIT_CM ; - }; - FixedText FT_LINE_2 - { - Pos = MAP_APPFONT ( 12 , 53 ) ; - Size = MAP_APPFONT ( 66 , 8 ) ; - Text [ en-US ] = "Line ~2" ; - }; - MetricField MTR_FLD_LINE_2 - { - HelpID = "cui:MetricField:RID_SVXPAGE_CONNECTION:MTR_FLD_LINE_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 79 , 51 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Repeat = TRUE ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - Unit = FUNIT_CM ; - }; - FixedText FT_LINE_3 - { - Pos = MAP_APPFONT ( 12 , 69 ) ; - Size = MAP_APPFONT ( 66 , 8 ) ; - Text [ en-US ] = "Line ~3" ; - }; - MetricField MTR_FLD_LINE_3 - { - HelpID = "cui:MetricField:RID_SVXPAGE_CONNECTION:MTR_FLD_LINE_3"; - Border = TRUE ; - Pos = MAP_APPFONT ( 79 , 67 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Repeat = TRUE ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - Unit = FUNIT_CM ; - }; - FixedLine FL_DISTANCE - { - Pos = MAP_APPFONT ( 6 , 85 ) ; - Size = MAP_APPFONT ( 120 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Line spacing" ; - }; - FixedText FT_HORZ_1 - { - Pos = MAP_APPFONT ( 12 , 98 ) ; - Size = MAP_APPFONT ( 66 , 8 ) ; - Text [ en-US ] = "~Begin horizontal" ; - }; - MetricField MTR_FLD_HORZ_1 - { - HelpID = "cui:MetricField:RID_SVXPAGE_CONNECTION:MTR_FLD_HORZ_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 79 , 96 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Repeat = TRUE ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - Unit = FUNIT_CM ; - }; - FixedText FT_HORZ_2 - { - Pos = MAP_APPFONT ( 12 , 130 ) ; - Size = MAP_APPFONT ( 66 , 8 ) ; - Text [ en-US ] = "End ~horizontal" ; - }; - MetricField MTR_FLD_HORZ_2 - { - HelpID = "cui:MetricField:RID_SVXPAGE_CONNECTION:MTR_FLD_HORZ_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 79 , 128 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Repeat = TRUE ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - Unit = FUNIT_CM ; - }; - FixedText FT_VERT_1 - { - Pos = MAP_APPFONT ( 12 , 114 ) ; - Size = MAP_APPFONT ( 66 , 8 ) ; - Text [ en-US ] = "Begin ~vertical" ; - }; - MetricField MTR_FLD_VERT_1 - { - HelpID = "cui:MetricField:RID_SVXPAGE_CONNECTION:MTR_FLD_VERT_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 79 , 112 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Repeat = TRUE ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - Unit = FUNIT_CM ; - }; - FixedText FT_VERT_2 - { - Pos = MAP_APPFONT ( 12 , 146 ) ; - Size = MAP_APPFONT ( 66 , 8 ) ; - Text [ en-US ] = "~End vertical" ; - }; - MetricField MTR_FLD_VERT_2 - { - HelpID = "cui:MetricField:RID_SVXPAGE_CONNECTION:MTR_FLD_VERT_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 79 , 144 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - Spin = TRUE ; - Repeat = TRUE ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - Unit = FUNIT_CM ; - }; - Control CTL_PREVIEW - { - HelpId = HID_PAGE_CONNECTION_CTL_PREVIEW ; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 + 120 + RSC_SP_FLGR_SPACE_Y + RSC_SP_FLGR_INNERBORDER_LEFT , 35 ) ; - Size = MAP_APPFONT ( 118 , 121 ) ; - QuickHelpText [ en-US ] = "Preview"; - }; -}; - // ******************************************************************* EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/dstribut.cxx b/cui/source/tabpages/dstribut.cxx deleted file mode 100644 index 08f37dc50..000000000 --- a/cui/source/tabpages/dstribut.cxx +++ /dev/null @@ -1,234 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <sfx2/basedlgs.hxx> -#include <cuires.hrc> -#include "dstribut.hxx" -#include "dstribut.hrc" -#include <svx/dialogs.hrc> -#include <svx/svddef.hxx> -#include <dialmgr.hxx> -#include <tools/shl.hxx> - -static sal_uInt16 pRanges[] = -{ - SDRATTR_MEASURE_FIRST, - SDRATTR_MEASURE_LAST, - 0 -}; - -/************************************************************************* -|* -|* Dialog -|* -\************************************************************************/ - -SvxDistributeDialog::SvxDistributeDialog( - Window* pParent, - const SfxItemSet& rInAttrs, - SvxDistributeHorizontal eHor, - SvxDistributeVertical eVer) -: SfxSingleTabDialog(pParent, rInAttrs, RID_SVXPAGE_DISTRIBUTE ), - mpPage(0L) -{ - mpPage = new SvxDistributePage(this, rInAttrs, eHor, eVer); - SetTabPage(mpPage); - SetText(mpPage->GetText()); -} - -/************************************************************************* -|* -|* Dtor -|* -\************************************************************************/ - -SvxDistributeDialog::~SvxDistributeDialog() -{ -} - -/************************************************************************* -|* -|* Tabpage -|* -\************************************************************************/ - -SvxDistributePage::SvxDistributePage( - Window* pWindow, - const SfxItemSet& rInAttrs, - SvxDistributeHorizontal eHor, - SvxDistributeVertical eVer) -: SvxTabPage(pWindow, CUI_RES(RID_SVXPAGE_DISTRIBUTE), rInAttrs), - meDistributeHor(eHor), - meDistributeVer(eVer), - maFlHorizontal (this, CUI_RES(FL_HORIZONTAL )), - maBtnHorNone (this, CUI_RES(BTN_HOR_NONE )), - maBtnHorLeft (this, CUI_RES(BTN_HOR_LEFT )), - maBtnHorCenter (this, CUI_RES(BTN_HOR_CENTER )), - maBtnHorDistance (this, CUI_RES(BTN_HOR_DISTANCE )), - maBtnHorRight (this, CUI_RES(BTN_HOR_RIGHT )), - maHorLow (this, CUI_RES(IMG_HOR_LOW )), - maHorCenter (this, CUI_RES(IMG_HOR_CENTER )), - maHorDistance (this, CUI_RES(IMG_HOR_DISTANCE )), - maHorHigh (this, CUI_RES(IMG_HOR_HIGH )), - maFlVertical (this, CUI_RES(FL_VERTICAL )), - maBtnVerNone (this, CUI_RES(BTN_VER_NONE )), - maBtnVerTop (this, CUI_RES(BTN_VER_TOP )), - maBtnVerCenter (this, CUI_RES(BTN_VER_CENTER )), - maBtnVerDistance (this, CUI_RES(BTN_VER_DISTANCE )), - maBtnVerBottom (this, CUI_RES(BTN_VER_BOTTOM )), - maVerLow (this, CUI_RES(IMG_VER_LOW )), - maVerCenter (this, CUI_RES(IMG_VER_CENTER )), - maVerDistance (this, CUI_RES(IMG_VER_DISTANCE )), - maVerHigh (this, CUI_RES(IMG_VER_HIGH )) -{ - FreeResource(); -} - -/************************************************************************* -|* -|* Dtor -|* -\************************************************************************/ - -SvxDistributePage::~SvxDistributePage() -{ -} - -/************************************************************************* -|* -|* create the tabpage -|* -\************************************************************************/ - -SfxTabPage* SvxDistributePage::Create(Window* pWindow, const SfxItemSet& rAttrs, - SvxDistributeHorizontal eHor, SvxDistributeVertical eVer) -{ - return(new SvxDistributePage(pWindow, rAttrs, eHor, eVer)); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -sal_uInt16* SvxDistributePage::GetRanges() -{ - return(pRanges); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -void SvxDistributePage::PointChanged(Window* /*pWindow*/, RECT_POINT /*eRP*/) -{ -} - -/************************************************************************* -|* -|* read the delivered Item-Set -|* -\************************************************************************/ - -void SvxDistributePage::Reset(const SfxItemSet& ) -{ - maBtnHorNone.SetState(sal_False); - maBtnHorLeft.SetState(sal_False); - maBtnHorCenter.SetState(sal_False); - maBtnHorDistance.SetState(sal_False); - maBtnHorRight.SetState(sal_False); - - switch(meDistributeHor) - { - case SvxDistributeHorizontalNone : maBtnHorNone.SetState(sal_True); break; - case SvxDistributeHorizontalLeft : maBtnHorLeft.SetState(sal_True); break; - case SvxDistributeHorizontalCenter : maBtnHorCenter.SetState(sal_True); break; - case SvxDistributeHorizontalDistance : maBtnHorDistance.SetState(sal_True); break; - case SvxDistributeHorizontalRight : maBtnHorRight.SetState(sal_True); break; - } - - maBtnVerNone.SetState(sal_False); - maBtnVerTop.SetState(sal_False); - maBtnVerCenter.SetState(sal_False); - maBtnVerDistance.SetState(sal_False); - maBtnVerBottom.SetState(sal_False); - - switch(meDistributeVer) - { - case SvxDistributeVerticalNone : maBtnVerNone.SetState(sal_True); break; - case SvxDistributeVerticalTop : maBtnVerTop.SetState(sal_True); break; - case SvxDistributeVerticalCenter : maBtnVerCenter.SetState(sal_True); break; - case SvxDistributeVerticalDistance : maBtnVerDistance.SetState(sal_True); break; - case SvxDistributeVerticalBottom : maBtnVerBottom.SetState(sal_True); break; - } -} - -/************************************************************************* -|* -|* Fill the delivered Item-Set with dialogbox-attributes -|* -\************************************************************************/ - -sal_Bool SvxDistributePage::FillItemSet( SfxItemSet& ) -{ - SvxDistributeHorizontal eDistributeHor(SvxDistributeHorizontalNone); - SvxDistributeVertical eDistributeVer(SvxDistributeVerticalNone); - - if(maBtnHorLeft.IsChecked()) - eDistributeHor = SvxDistributeHorizontalLeft; - else if(maBtnHorCenter.IsChecked()) - eDistributeHor = SvxDistributeHorizontalCenter; - else if(maBtnHorDistance.IsChecked()) - eDistributeHor = SvxDistributeHorizontalDistance; - else if(maBtnHorRight.IsChecked()) - eDistributeHor = SvxDistributeHorizontalRight; - - if(maBtnVerTop.IsChecked()) - eDistributeVer = SvxDistributeVerticalTop; - else if(maBtnVerCenter.IsChecked()) - eDistributeVer = SvxDistributeVerticalCenter; - else if(maBtnVerDistance.IsChecked()) - eDistributeVer = SvxDistributeVerticalDistance; - else if(maBtnVerBottom.IsChecked()) - eDistributeVer = SvxDistributeVerticalBottom; - - if(eDistributeHor != meDistributeHor || eDistributeVer != meDistributeVer) - { - meDistributeHor = eDistributeHor; - meDistributeVer = eDistributeVer; - return sal_True; - } - - return sal_False; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/dstribut.hrc b/cui/source/tabpages/dstribut.hrc deleted file mode 100644 index b277da50f..000000000 --- a/cui/source/tabpages/dstribut.hrc +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#define FL_HORIZONTAL 1 -#define BTN_HOR_NONE 2 -#define BTN_HOR_LEFT 3 -#define BTN_HOR_CENTER 4 -#define BTN_HOR_DISTANCE 5 -#define BTN_HOR_RIGHT 6 -#define FL_VERTICAL 7 -#define BTN_VER_NONE 8 -#define BTN_VER_TOP 9 -#define BTN_VER_CENTER 10 -#define BTN_VER_DISTANCE 11 -#define BTN_VER_BOTTOM 12 -#define IMG_HOR_LOW 14 -#define IMG_HOR_CENTER 15 -#define IMG_HOR_DISTANCE 16 -#define IMG_HOR_HIGH 17 -#define IMG_VER_LOW 18 -#define IMG_VER_CENTER 19 -#define IMG_VER_DISTANCE 20 -#define IMG_VER_HIGH 21 diff --git a/cui/source/tabpages/dstribut.src b/cui/source/tabpages/dstribut.src deleted file mode 100644 index ed5108c90..000000000 --- a/cui/source/tabpages/dstribut.src +++ /dev/null @@ -1,219 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <cuires.hrc> -#include "dstribut.hrc" -#include "helpid.hrc" -#include <svx/dialogs.hrc> - -// RID_SVXPAGE_DISTRIBUTE --------------------------------------------------- -#define STD_MASKCOLOR Color { Red=0xffff; Green=0x0000; Blue=0xffff; } -TabPage RID_SVXPAGE_DISTRIBUTE -{ - HelpId = HID_PAGE_DISTRIBUTE ; - Hide = TRUE ; - Size = MAP_APPFONT ( 260 , 81 ) ; - Text [ en-US ] = "Distribution" ; - - FixedLine FL_HORIZONTAL - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Horizontal" ; - }; - - RadioButton BTN_HOR_NONE - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_HOR_NONE"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 48 , 10 ) ; - Text [ en-US ] = "~None" ; - }; - - RadioButton BTN_HOR_LEFT - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_HOR_LEFT"; - Pos = MAP_APPFONT ( 56 , 26 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "~Left" ; - }; - - RadioButton BTN_HOR_CENTER - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_HOR_CENTER"; - Pos = MAP_APPFONT ( 105 , 26 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "~Center" ; - }; - - RadioButton BTN_HOR_DISTANCE - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_HOR_DISTANCE"; - Pos = MAP_APPFONT ( 154 , 26 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "~Spacing" ; - }; - - RadioButton BTN_HOR_RIGHT - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_HOR_RIGHT"; - Pos = MAP_APPFONT ( 203 , 26 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "~Right" ; - }; - - FixedImage IMG_HOR_LOW { - Pos = MAP_APPFONT ( 65 , 10 ); - Size = MAP_APPFONT ( 15 , 16 ); - Hide = FALSE; - Fixed = Image { - ImageBitmap = Bitmap { File = "dsth_low.bmp"; }; - MaskColor = STD_MASKCOLOR; - }; - }; - - FixedImage IMG_HOR_CENTER { - Pos = MAP_APPFONT ( 114 , 10 ); - Size = MAP_APPFONT ( 15 , 16 ); - Hide = FALSE; - Fixed = Image { - ImageBitmap = Bitmap { File = "dsth_cen.bmp"; }; - MaskColor = STD_MASKCOLOR; - }; - }; - - FixedImage IMG_HOR_DISTANCE { - Pos = MAP_APPFONT ( 163 , 10 ); - Size = MAP_APPFONT ( 15 , 16 ); - Hide = FALSE; - Fixed = Image { - ImageBitmap = Bitmap { File = "dsth_dst.bmp"; }; - MaskColor = STD_MASKCOLOR; - }; - }; - - FixedImage IMG_HOR_HIGH { - Pos = MAP_APPFONT ( 212 , 10 ); - Size = MAP_APPFONT ( 15 , 16 ); - Hide = FALSE; - Fixed = Image { - ImageBitmap = Bitmap { File = "dsth_hig.bmp"; }; - MaskColor = STD_MASKCOLOR; - }; - }; - - FixedLine FL_VERTICAL - { - Pos = MAP_APPFONT ( 6 , 42 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Vertical" ; - }; - - RadioButton BTN_VER_NONE - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_VER_NONE"; - Pos = MAP_APPFONT ( 12 , 53 ) ; - Size = MAP_APPFONT ( 46 , 10 ) ; - Text [ en-US ] = "N~one" ; - }; - - RadioButton BTN_VER_TOP - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_VER_TOP"; - Pos = MAP_APPFONT ( 56 , 65 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "~Top" ; - }; - - RadioButton BTN_VER_CENTER - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_VER_CENTER"; - Pos = MAP_APPFONT ( 105 , 65 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "C~enter" ; - }; - - RadioButton BTN_VER_DISTANCE - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_VER_DISTANCE"; - Pos = MAP_APPFONT ( 154 , 65 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "S~pacing" ; - }; - - RadioButton BTN_VER_BOTTOM - { - HelpID = "cui:RadioButton:RID_SVXPAGE_DISTRIBUTE:BTN_VER_BOTTOM"; - Pos = MAP_APPFONT ( 203 , 65 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Text [ en-US ] = "~Bottom" ; - }; - - FixedImage IMG_VER_HIGH { - Pos = MAP_APPFONT ( 65 , 49 ); - Size = MAP_APPFONT ( 15 , 16 ); - Hide = FALSE; - Fixed = Image { - ImageBitmap = Bitmap { File = "dstv_hig.bmp"; }; - MaskColor = STD_MASKCOLOR; - }; - }; - - FixedImage IMG_VER_CENTER { - Pos = MAP_APPFONT ( 114 , 49 ); - Size = MAP_APPFONT ( 15 , 16 ); - Hide = FALSE; - Fixed = Image { - ImageBitmap = Bitmap { File = "dstv_cen.bmp"; }; - MaskColor = STD_MASKCOLOR; - }; - }; - - FixedImage IMG_VER_DISTANCE { - Pos = MAP_APPFONT ( 163 , 49 ); - Size = MAP_APPFONT ( 15 , 16 ); - Hide = FALSE; - Fixed = Image { - ImageBitmap = Bitmap { File = "dstv_dst.bmp"; }; - MaskColor = STD_MASKCOLOR; - }; - }; - - FixedImage IMG_VER_LOW { - Pos = MAP_APPFONT ( 212 , 49 ); - Size = MAP_APPFONT ( 15 , 16 ); - Hide = FALSE; - Fixed = Image { - ImageBitmap = Bitmap { File = "dstv_low.bmp"; }; - MaskColor = STD_MASKCOLOR; - }; - }; - -}; - -// ********************************************************************** EOF diff --git a/cui/source/tabpages/frmdirlbox.src b/cui/source/tabpages/frmdirlbox.src deleted file mode 100644 index 518defe0c..000000000 --- a/cui/source/tabpages/frmdirlbox.src +++ /dev/null @@ -1,93 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <cuires.hrc> - -// frame direction ------------------------------------------------------------ - -String RID_SVXSTR_FRAMEDIR_LTR -{ - Text [ en-US ] = "Left-to-right"; -}; - -String RID_SVXSTR_FRAMEDIR_RTL -{ - Text [ en-US ] = "Right-to-left"; -}; - -String RID_SVXSTR_FRAMEDIR_SUPER -{ - Text [ en-US ] = "Use superordinate object settings"; -}; - -// page direction ------------------------------------------------------------- - -String RID_SVXSTR_PAGEDIR_LTR_HORI -{ - Text [ en-US ] = "Left-to-right (horizontal)"; -}; - -String RID_SVXSTR_PAGEDIR_RTL_HORI -{ - Text [ en-US ] = "Right-to-left (horizontal)"; -}; - -String RID_SVXSTR_PAGEDIR_RTL_VERT -{ - Text [ en-US ] = "Right-to-left (vertical)"; -}; - -String RID_SVXSTR_PAGEDIR_LTR_VERT -{ - Text [ en-US ] = "Left-to-right (vertical)"; -}; - -// ---------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx deleted file mode 100644 index 167280ca8..000000000 --- a/cui/source/tabpages/grfpage.cxx +++ /dev/null @@ -1,792 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <tools/shl.hxx> -#include <svl/eitem.hxx> -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <sfx2/sfxsids.hrc> -#include <dialmgr.hxx> -#include <svx/dlgutil.hxx> -#include <editeng/sizeitem.hxx> -#include <editeng/brshitem.hxx> -#include <grfpage.hxx> -#include <svx/grfcrop.hxx> -#include <grfpage.hrc> -#include <cuires.hrc> -#include <svx/dialogs.hrc> // for RID_SVXPAGE_GRFCROP - -#define CM_1_TO_TWIP 567 - - -inline long lcl_GetValue( MetricField& rMetric, FieldUnit eUnit ) -{ - return static_cast<long>(rMetric.Denormalize( rMetric.GetValue( eUnit ))); -} - -/*-------------------------------------------------------------------- - Beschreibung: Grafik zuschneiden - --------------------------------------------------------------------*/ - -SvxGrfCropPage::SvxGrfCropPage ( Window *pParent, const SfxItemSet &rSet ) - : SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_GRFCROP ), rSet ), - aCropFL( this, CUI_RES( FL_CROP )), - aZoomConstRB( this, CUI_RES( RB_ZOOMCONST)), - aSizeConstRB( this, CUI_RES( RB_SIZECONST)), - aLeftFT( this, CUI_RES( FT_LEFT )), - aLeftMF( this, CUI_RES( MF_LEFT )), - aRightFT( this, CUI_RES( FT_RIGHT )), - aRightMF( this, CUI_RES( MF_RIGHT )), - aTopFT( this, CUI_RES( FT_TOP )), - aTopMF( this, CUI_RES( MF_TOP )), - aBottomFT( this, CUI_RES( FT_BOTTOM )), - aBottomMF( this, CUI_RES( MF_BOTTOM )), - aZoomFL( this, CUI_RES( FL_ZOOM )), - aWidthZoomFT( this, CUI_RES( FT_WIDTHZOOM )), - aWidthZoomMF( this, CUI_RES( MF_WIDTHZOOM )), - aHeightZoomFT( this, CUI_RES( FT_HEIGHTZOOM)), - aHeightZoomMF( this, CUI_RES( MF_HEIGHTZOOM)), - aSizeFL( this, CUI_RES( FL_SIZE )), - aWidthFT( this, CUI_RES( FT_WIDTH )), - aWidthMF( this, CUI_RES( MF_WIDTH )), - aHeightFT( this, CUI_RES( FT_HEIGHT )), - aHeightMF( this, CUI_RES( MF_HEIGHT )), - aOrigSizeFT( this, CUI_RES(FT_ORIG_SIZE)), - aOrigSizePB( this, CUI_RES( PB_ORGSIZE )), - aExampleWN( this, CUI_RES( WN_BSP )), - pLastCropField(0), - bInitialized(sal_False), - bSetOrigSize(sal_False) -{ - FreeResource(); - - SetExchangeSupport(); - - // set the correct metric - const FieldUnit eMetric = GetModuleFieldUnit( rSet ); - - SetFieldUnit( aWidthMF, eMetric ); - SetFieldUnit( aHeightMF, eMetric ); - SetFieldUnit( aLeftMF, eMetric ); - SetFieldUnit( aRightMF, eMetric ); - SetFieldUnit( aTopMF , eMetric ); - SetFieldUnit( aBottomMF, eMetric ); - - Link aLk = LINK(this, SvxGrfCropPage, SizeHdl); - aWidthMF.SetModifyHdl( aLk ); - aHeightMF.SetModifyHdl( aLk ); - - aLk = LINK(this, SvxGrfCropPage, ZoomHdl); - aWidthZoomMF.SetModifyHdl( aLk ); - aHeightZoomMF.SetModifyHdl( aLk ); - - aLk = LINK(this, SvxGrfCropPage, CropHdl); - aLeftMF.SetDownHdl( aLk ); - aRightMF.SetDownHdl( aLk ); - aTopMF.SetDownHdl( aLk ); - aBottomMF.SetDownHdl( aLk ); - aLeftMF.SetUpHdl( aLk ); - aRightMF.SetUpHdl( aLk ); - aTopMF.SetUpHdl( aLk ); - aBottomMF.SetUpHdl( aLk ); - - aLk = LINK(this, SvxGrfCropPage, CropModifyHdl); - aLeftMF.SetModifyHdl( aLk ); - aRightMF.SetModifyHdl( aLk ); - aTopMF.SetModifyHdl( aLk ); - aBottomMF.SetModifyHdl( aLk ); - - aLk = LINK(this, SvxGrfCropPage, CropLoseFocusHdl); - aLeftMF.SetLoseFocusHdl( aLk ); - aRightMF.SetLoseFocusHdl( aLk ); - aTopMF.SetLoseFocusHdl( aLk ); - aBottomMF.SetLoseFocusHdl( aLk ); - - aLk = LINK(this, SvxGrfCropPage, OrigSizeHdl); - aOrigSizePB.SetClickHdl( aLk ); - - aTimer.SetTimeoutHdl(LINK(this, SvxGrfCropPage, Timeout)); - aTimer.SetTimeout( 1500 ); - - aOrigSizePB.SetAccessibleRelationLabeledBy( &aOrigSizeFT ); -} - -SvxGrfCropPage::~SvxGrfCropPage() -{ - aTimer.Stop(); -} - -SfxTabPage* SvxGrfCropPage::Create(Window *pParent, const SfxItemSet &rSet) -{ - return new SvxGrfCropPage( pParent, rSet ); -} - -void SvxGrfCropPage::Reset( const SfxItemSet &rSet ) -{ - const SfxPoolItem* pItem; - const SfxItemPool& rPool = *rSet.GetPool(); - - if(SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( - SID_ATTR_GRAF_KEEP_ZOOM ), sal_True, &pItem )) - { - if( ((const SfxBoolItem*)pItem)->GetValue() ) - aZoomConstRB.Check(); - else - aSizeConstRB.Check(); - aZoomConstRB.SaveValue(); - } - - sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_CROP ); - if( SFX_ITEM_SET == rSet.GetItemState( nW, sal_True, &pItem)) - { - FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW )); - - SvxGrfCrop* pCrop = (SvxGrfCrop*)pItem; - - aExampleWN.SetLeft( pCrop->GetLeft()); - aExampleWN.SetRight( pCrop->GetRight()); - aExampleWN.SetTop( pCrop->GetTop()); - aExampleWN.SetBottom( pCrop->GetBottom()); - - aLeftMF.SetValue( aLeftMF.Normalize( pCrop->GetLeft()), eUnit ); - aRightMF.SetValue( aRightMF.Normalize( pCrop->GetRight()), eUnit ); - aTopMF.SetValue( aTopMF.Normalize( pCrop->GetTop()), eUnit ); - aBottomMF.SetValue( aBottomMF.Normalize( pCrop->GetBottom()), eUnit ); - } - else - { - aLeftMF.SetValue( 0 ); - aRightMF.SetValue( 0 ); - aTopMF.SetValue( 0 ); - aBottomMF.SetValue( 0 ); - } - - nW = rPool.GetWhich( SID_ATTR_PAGE_SIZE ); - if ( SFX_ITEM_SET == rSet.GetItemState( nW, sal_False, &pItem ) ) - { - // Orientation und Size aus dem PageItem - FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW )); - - aPageSize = ((const SvxSizeItem*)pItem)->GetSize(); - - sal_Int64 nTmp = aHeightMF.Normalize(aPageSize.Height()); - aHeightMF.SetMax( nTmp, eUnit ); - nTmp = aWidthMF.Normalize(aPageSize.Width()); - aWidthMF.SetMax( nTmp, eUnit ); - nTmp = aWidthMF.Normalize( 23 ); - aHeightMF.SetMin( nTmp, eUnit ); - aWidthMF.SetMin( nTmp, eUnit ); - } - else - { - aPageSize = OutputDevice::LogicToLogic( - Size( CM_1_TO_TWIP, CM_1_TO_TWIP ), - MapMode( MAP_TWIP ), - MapMode( (MapUnit)rSet.GetPool()->GetMetric( nW ) ) ); - } - - sal_Bool bFound = sal_False; - if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, sal_False, &pItem ) ) - { - const Graphic* pGrf = ((SvxBrushItem*)pItem)->GetGraphic(); - if( pGrf ) - aOrigSize = GetGrfOrigSize( *pGrf ); - - if( aOrigSize.Width() && aOrigSize.Height() ) - { - CalcMinMaxBorder(); - aExampleWN.SetGraphic( *pGrf ); - aExampleWN.SetFrameSize( aOrigSize ); - - bFound = sal_True; - if( ((SvxBrushItem*)pItem)->GetGraphicLink() ) - aGraphicName = *((SvxBrushItem*)pItem)->GetGraphicLink(); - } - } - - GraphicHasChanged( bFound ); - bReset = sal_True; - ActivatePage( rSet ); - bReset = sal_False; -} - -sal_Bool SvxGrfCropPage::FillItemSet(SfxItemSet &rSet) -{ - const SfxItemPool& rPool = *rSet.GetPool(); - sal_Bool bModified = sal_False; - if( aWidthMF.GetSavedValue() != aWidthMF.GetText() || - aHeightMF.GetSavedValue() != aHeightMF.GetText() ) - { - sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_FRMSIZE ); - FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW )); - - SvxSizeItem aSz( nW ); - - // die Groesse koennte schon von einer anderen Page gesetzt worden sein - // #44204# - const SfxItemSet* pExSet = GetTabDialog() ? GetTabDialog()->GetExampleSet() : NULL; - const SfxPoolItem* pItem = 0; - if( pExSet && SFX_ITEM_SET == - pExSet->GetItemState( nW, sal_False, &pItem ) ) - aSz = *(const SvxSizeItem*)pItem; - else - aSz = (const SvxSizeItem&)GetItemSet().Get( nW ); - - Size aTmpSz( aSz.GetSize() ); - if( aWidthMF.GetText() != aWidthMF.GetSavedValue() ) - aTmpSz.Width() = lcl_GetValue( aWidthMF, eUnit ); - if( aHeightMF.GetText() != aHeightMF.GetSavedValue() ) - aTmpSz.Height() = lcl_GetValue( aHeightMF, eUnit ); - aSz.SetSize( aTmpSz ); - aWidthMF.SaveValue(); - aHeightMF.SaveValue(); - - bModified |= 0 != rSet.Put( aSz ); - - if( bSetOrigSize ) - { - bModified |= 0 != rSet.Put( SvxSizeItem( rPool.GetWhich( - SID_ATTR_GRAF_FRMSIZE_PERCENT ), Size( 0, 0 )) ); - } - } - if( aLeftMF.IsModified() || aRightMF.IsModified() || - aTopMF.IsModified() || aBottomMF.IsModified() ) - { - sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_CROP ); - FieldUnit eUnit = MapToFieldUnit( rSet.GetPool()->GetMetric( nW )); - SvxGrfCrop* pNew = (SvxGrfCrop*)rSet.Get( nW ).Clone(); - - pNew->SetLeft( lcl_GetValue( aLeftMF, eUnit ) ); - pNew->SetRight( lcl_GetValue( aRightMF, eUnit ) ); - pNew->SetTop( lcl_GetValue( aTopMF, eUnit ) ); - pNew->SetBottom( lcl_GetValue( aBottomMF, eUnit ) ); - bModified |= 0 != rSet.Put( *pNew ); - delete pNew; - } - - if( aZoomConstRB.GetSavedValue() != aZoomConstRB.IsChecked() ) - { - bModified |= 0 != rSet.Put( SfxBoolItem( rPool.GetWhich( - SID_ATTR_GRAF_KEEP_ZOOM), aZoomConstRB.IsChecked() ) ); - } - - bInitialized = sal_False; - - return bModified; -} - -void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet) -{ -#ifdef DBG_UTIL - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); -#endif - - bSetOrigSize = sal_False; - - // Size - Size aSize; - const SfxPoolItem* pItem; - if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRAF_FRMSIZE, sal_False, &pItem ) ) - aSize = ((const SvxSizeItem*)pItem)->GetSize(); - - nOldWidth = aSize.Width(); - nOldHeight = aSize.Height(); - - sal_Int64 nWidth = aWidthMF.Normalize(nOldWidth); - sal_Int64 nHeight = aHeightMF.Normalize(nOldHeight); - - if (nWidth != aWidthMF.GetValue(FUNIT_TWIP)) - { - if(!bReset) - { - // Wert wurde von Umlauf-Tabpage geaendert und muss - // mit Modify-Flag gesetzt werden - aWidthMF.SetUserValue(nWidth, FUNIT_TWIP); - } - else - aWidthMF.SetValue(nWidth, FUNIT_TWIP); - } - aWidthMF.SaveValue(); - - if (nHeight != aHeightMF.GetValue(FUNIT_TWIP)) - { - if (!bReset) - { - // Wert wurde von Umlauf-Tabpage geaendert und muss - // mit Modify-Flag gesetzt werden - aHeightMF.SetUserValue(nHeight, FUNIT_TWIP); - } - else - aHeightMF.SetValue(nHeight, FUNIT_TWIP); - } - aHeightMF.SaveValue(); - bInitialized = sal_True; - - if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, sal_False, &pItem ) ) - { - const SvxBrushItem& rBrush = *(SvxBrushItem*)pItem; - if( rBrush.GetGraphicLink() && - aGraphicName != *rBrush.GetGraphicLink() ) - aGraphicName = *rBrush.GetGraphicLink(); - - const Graphic* pGrf = rBrush.GetGraphic(); - if( pGrf ) - { - aExampleWN.SetGraphic( *pGrf ); - aOrigSize = GetGrfOrigSize( *pGrf ); - aExampleWN.SetFrameSize(aOrigSize); - GraphicHasChanged( aOrigSize.Width() && aOrigSize.Height() ); - CalcMinMaxBorder(); - } - else - GraphicHasChanged( sal_False ); - } - - CalcZoom(); -} - -int SvxGrfCropPage::DeactivatePage(SfxItemSet *_pSet) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - return sal_True; -} - -/*-------------------------------------------------------------------- - Beschreibung: Massstab geaendert, Groesse anpassen - --------------------------------------------------------------------*/ - -IMPL_LINK( SvxGrfCropPage, ZoomHdl, MetricField *, pField ) -{ - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( - SID_ATTR_GRAF_CROP ) ) ); - - if( pField == &aWidthZoomMF ) - { - long nLRBorders = lcl_GetValue(aLeftMF, eUnit) - +lcl_GetValue(aRightMF, eUnit); - aWidthMF.SetValue( aWidthMF.Normalize( - ((aOrigSize.Width() - nLRBorders) * pField->GetValue())/100L), - eUnit); - } - else - { - long nULBorders = lcl_GetValue(aTopMF, eUnit) - +lcl_GetValue(aBottomMF, eUnit); - aHeightMF.SetValue( aHeightMF.Normalize( - ((aOrigSize.Height() - nULBorders ) * pField->GetValue())/100L) , - eUnit ); - } - - return 0; -} - -/*-------------------------------------------------------------------- - Beschreibung: Groesse aendern, Massstab anpassen - --------------------------------------------------------------------*/ - -IMPL_LINK( SvxGrfCropPage, SizeHdl, MetricField *, pField ) -{ - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( - SID_ATTR_GRAF_CROP ) ) ); - - Size aSize( lcl_GetValue(aWidthMF, eUnit), - lcl_GetValue(aHeightMF, eUnit) ); - - if(pField == &aWidthMF) - { - long nWidth = aOrigSize.Width() - - ( lcl_GetValue(aLeftMF, eUnit) + - lcl_GetValue(aRightMF, eUnit) ); - if(!nWidth) - nWidth++; - sal_uInt16 nZoom = (sal_uInt16)( aSize.Width() * 100L / nWidth); - aWidthZoomMF.SetValue(nZoom); - } - else - { - long nHeight = aOrigSize.Height() - - ( lcl_GetValue(aTopMF, eUnit) + - lcl_GetValue(aBottomMF, eUnit)); - if(!nHeight) - nHeight++; - sal_uInt16 nZoom = (sal_uInt16)( aSize.Height() * 100L/ nHeight); - aHeightZoomMF.SetValue(nZoom); - } - - return 0; -} - -/*-------------------------------------------------------------------- - Beschreibung: Raender auswerten - --------------------------------------------------------------------*/ - -IMPL_LINK( SvxGrfCropPage, CropHdl, const MetricField *, pField ) -{ - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( - SID_ATTR_GRAF_CROP ) ) ); - - sal_Bool bZoom = aZoomConstRB.IsChecked(); - if( pField == &aLeftMF || pField == &aRightMF ) - { - long nLeft = lcl_GetValue( aLeftMF, eUnit ); - long nRight = lcl_GetValue( aRightMF, eUnit ); - long nWidthZoom = static_cast<long>(aWidthZoomMF.GetValue()); - if(bZoom && ( ( ( aOrigSize.Width() - (nLeft + nRight )) * nWidthZoom ) - / 100 >= aPageSize.Width() ) ) - { - if(pField == &aLeftMF) - { - nLeft = aOrigSize.Width() - - ( aPageSize.Width() * 100 / nWidthZoom + nRight ); - aLeftMF.SetValue( aLeftMF.Normalize( nLeft ), eUnit ); - } - else - { - nRight = aOrigSize.Width() - - ( aPageSize.Width() * 100 / nWidthZoom + nLeft ); - aRightMF.SetValue( aRightMF.Normalize( nRight ), eUnit ); - } - } - aExampleWN.SetLeft(nLeft); - aExampleWN.SetRight(nRight); - if(bZoom) - { - //Massstab bleibt -> Breite neu berechnen - ZoomHdl(&aWidthZoomMF); - } - } - else - { - long nTop = lcl_GetValue( aTopMF, eUnit ); - long nBottom = lcl_GetValue( aBottomMF, eUnit ); - long nHeightZoom = static_cast<long>(aHeightZoomMF.GetValue()); - if(bZoom && ( ( ( aOrigSize.Height() - (nTop + nBottom )) * nHeightZoom) - / 100 >= aPageSize.Height())) - { - if(pField == &aTopMF) - { - nTop = aOrigSize.Height() - - ( aPageSize.Height() * 100 / nHeightZoom + nBottom); - aTopMF.SetValue( aWidthMF.Normalize( nTop ), eUnit ); - } - else - { - nBottom = aOrigSize.Height() - - ( aPageSize.Height() * 100 / nHeightZoom + nTop); - aBottomMF.SetValue( aWidthMF.Normalize( nBottom ), eUnit ); - } - } - aExampleWN.SetTop( nTop ); - aExampleWN.SetBottom( nBottom ); - if(bZoom) - { - //Massstab bleibt -> Hoehe neu berechnen - ZoomHdl(&aHeightZoomMF); - } - } - aExampleWN.Invalidate(); - //Groesse und Raender veraendert -> Massstab neu berechnen - if(!bZoom) - CalcZoom(); - CalcMinMaxBorder(); - return 0; -} -/*-------------------------------------------------------------------- - Beschreibung: Originalgroesse einstellen - --------------------------------------------------------------------*/ - -IMPL_LINK( SvxGrfCropPage, OrigSizeHdl, PushButton *, EMPTYARG ) -{ - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( - SID_ATTR_GRAF_CROP ) ) ); - - long nWidth = aOrigSize.Width() - - lcl_GetValue( aLeftMF, eUnit ) - - lcl_GetValue( aRightMF, eUnit ); - aWidthMF.SetValue( aWidthMF.Normalize( nWidth ), eUnit ); - long nHeight = aOrigSize.Height() - - lcl_GetValue( aTopMF, eUnit ) - - lcl_GetValue( aBottomMF, eUnit ); - aHeightMF.SetValue( aHeightMF.Normalize( nHeight ), eUnit ); - aWidthZoomMF.SetValue(100); - aHeightZoomMF.SetValue(100); - bSetOrigSize = sal_True; - return 0; -} -/*-------------------------------------------------------------------- - Beschreibung: Massstab berechnen - --------------------------------------------------------------------*/ - -void SvxGrfCropPage::CalcZoom() -{ - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( - SID_ATTR_GRAF_CROP ) ) ); - - long nWidth = lcl_GetValue( aWidthMF, eUnit ); - long nHeight = lcl_GetValue( aHeightMF, eUnit ); - long nLRBorders = lcl_GetValue( aLeftMF, eUnit ) + - lcl_GetValue( aRightMF, eUnit ); - long nULBorders = lcl_GetValue( aTopMF, eUnit ) + - lcl_GetValue( aBottomMF, eUnit ); - sal_uInt16 nZoom = 0; - long nDen; - if( (nDen = aOrigSize.Width() - nLRBorders) > 0) - nZoom = (sal_uInt16)((( nWidth * 1000L / nDen )+5)/10); - aWidthZoomMF.SetValue(nZoom); - if( (nDen = aOrigSize.Height() - nULBorders) > 0) - nZoom = (sal_uInt16)((( nHeight * 1000L / nDen )+5)/10); - else - nZoom = 0; - aHeightZoomMF.SetValue(nZoom); -} - -/*-------------------------------------------------------------------- - Beschreibung: Minimal-/Maximalwerte fuer die Raender setzen - --------------------------------------------------------------------*/ - -void SvxGrfCropPage::CalcMinMaxBorder() -{ - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( - SID_ATTR_GRAF_CROP ) ) ); - long nR = lcl_GetValue(aRightMF, eUnit ); - long nMinWidth = (aOrigSize.Width() * 10) /11; - long nMin = nMinWidth - (nR >= 0 ? nR : 0); - aLeftMF.SetMax( aLeftMF.Normalize(nMin), eUnit ); - - long nL = lcl_GetValue(aLeftMF, eUnit ); - nMin = nMinWidth - (nL >= 0 ? nL : 0); - aRightMF.SetMax( aRightMF.Normalize(nMin), eUnit ); - - long nUp = lcl_GetValue( aTopMF, eUnit ); - long nMinHeight = (aOrigSize.Height() * 10) /11; - nMin = nMinHeight - (nUp >= 0 ? nUp : 0); - aBottomMF.SetMax( aBottomMF.Normalize(nMin), eUnit ); - - long nLow = lcl_GetValue(aBottomMF, eUnit ); - nMin = nMinHeight - (nLow >= 0 ? nLow : 0); - aTopMF.SetMax( aTopMF.Normalize(nMin), eUnit ); -} -/*-------------------------------------------------------------------- - Beschreibung: Spinsize auf 1/20 der Originalgroesse setzen, - FixedText mit der Originalgroesse fuellen - --------------------------------------------------------------------*/ - -void SvxGrfCropPage::GraphicHasChanged( sal_Bool bFound ) -{ - if( bFound ) - { - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich( - SID_ATTR_GRAF_CROP ) )); - - sal_Int64 nSpin = aLeftMF.Normalize(aOrigSize.Width()) / 20; - nSpin = MetricField::ConvertValue( nSpin, aOrigSize.Width(), 0, - eUnit, aLeftMF.GetUnit()); - - // Ist der Rand zu gross, wird er auf beiden Seiten auf 1/3 eingestellt. - long nR = lcl_GetValue( aRightMF, eUnit ); - long nL = lcl_GetValue( aLeftMF, eUnit ); - if((nL + nR) < - aOrigSize.Width()) - { - long nVal = aOrigSize.Width() / -3; - aRightMF.SetValue( aRightMF.Normalize( nVal ), eUnit ); - aLeftMF.SetValue( aLeftMF.Normalize( nVal ), eUnit ); - aExampleWN.SetLeft(nVal); - aExampleWN.SetRight(nVal); - } - long nUp = lcl_GetValue(aTopMF, eUnit ); - long nLow = lcl_GetValue(aBottomMF, eUnit ); - if((nUp + nLow) < - aOrigSize.Height()) - { - long nVal = aOrigSize.Height() / -3; - aTopMF.SetValue( aTopMF.Normalize( nVal ), eUnit ); - aBottomMF.SetValue( aBottomMF.Normalize( nVal ), eUnit ); - aExampleWN.SetTop(nVal); - aExampleWN.SetBottom(nVal); - } - - aLeftMF.SetSpinSize(nSpin); - aRightMF.SetSpinSize(nSpin); - nSpin = aTopMF.Normalize(aOrigSize.Height()) / 20; - nSpin = MetricField::ConvertValue( nSpin, aOrigSize.Width(), 0, - eUnit, aLeftMF.GetUnit() ); - aTopMF.SetSpinSize(nSpin); - aBottomMF.SetSpinSize(nSpin); - - //Originalgroesse anzeigen - const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() ); - - MetricField aFld(this, WB_HIDE); - SetFieldUnit( aFld, eMetric ); - aFld.SetDecimalDigits( aWidthMF.GetDecimalDigits() ); - aFld.SetMax( LONG_MAX - 1 ); - - aFld.SetValue( aFld.Normalize( aOrigSize.Width() ), eUnit ); - String sTemp = aFld.GetText(); - aFld.SetValue( aFld.Normalize( aOrigSize.Height() ), eUnit ); - sTemp += UniString::CreateFromAscii(" x "); - sTemp += aFld.GetText(); - aOrigSizeFT.SetText(sTemp); - } - aLeftFT .Enable(bFound); - aLeftMF .Enable(bFound); - aRightFT .Enable(bFound); - aRightMF .Enable(bFound); - aTopFT .Enable(bFound); - aTopMF .Enable(bFound); - aBottomFT .Enable(bFound); - aBottomMF .Enable(bFound); - aSizeConstRB .Enable(bFound); - aZoomConstRB .Enable(bFound); - aWidthFT .Enable(bFound); - aWidthMF .Enable(bFound); - aHeightFT .Enable(bFound); - aHeightMF .Enable(bFound); - aWidthZoomFT .Enable(bFound); - aWidthZoomMF .Enable(bFound); - aHeightZoomFT .Enable(bFound); - aHeightZoomMF .Enable(bFound); - aExampleWN .Enable(bFound); - aOrigSizePB .Enable(bFound); - aOrigSizeFT .Enable(bFound); -} - -IMPL_LINK( SvxGrfCropPage, Timeout, Timer *, EMPTYARG ) -{ - DBG_ASSERT(pLastCropField,"Timeout ohne Feld?"); - CropHdl(pLastCropField); - pLastCropField = 0; - return 0; -} - - -IMPL_LINK( SvxGrfCropPage, CropLoseFocusHdl, MetricField*, pField ) -{ - aTimer.Stop(); - CropHdl(pField); - pLastCropField = 0; - return 0; -} - - -IMPL_LINK( SvxGrfCropPage, CropModifyHdl, MetricField *, pField ) -{ - aTimer.Start(); - pLastCropField = pField; - return 0; -} - -Size SvxGrfCropPage::GetGrfOrigSize( const Graphic& rGrf ) const -{ - const MapMode aMapTwip( MAP_TWIP ); - Size aSize( rGrf.GetPrefSize() ); - if( MAP_PIXEL == rGrf.GetPrefMapMode().GetMapUnit() ) - aSize = PixelToLogic( aSize, aMapTwip ); - else - aSize = OutputDevice::LogicToLogic( aSize, - rGrf.GetPrefMapMode(), aMapTwip ); - return aSize; -} - -/*****************************************************************/ - -SvxGrfCropPage::SvxCropExample::SvxCropExample( Window* pPar, - const ResId& rResId ) - : Window( pPar, rResId ), - aFrameSize( OutputDevice::LogicToLogic( - Size( CM_1_TO_TWIP / 2, CM_1_TO_TWIP / 2 ), - MapMode( MAP_TWIP ), GetMapMode() )), - aTopLeft(0,0), aBottomRight(0,0) -{ - SetBorderStyle( WINDOW_BORDER_MONO ); -} - -void SvxGrfCropPage::SvxCropExample::Paint( const Rectangle& ) -{ - Size aWinSize( PixelToLogic(GetOutputSizePixel() )); - SetLineColor(); - SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() ); - SetRasterOp( ROP_OVERPAINT ); - DrawRect( Rectangle( Point(), aWinSize ) ); - - SetLineColor( Color( COL_WHITE ) ); - Rectangle aRect(Point((aWinSize.Width() - aFrameSize.Width())/2, - (aWinSize.Height() - aFrameSize.Height())/2), - aFrameSize ); - aGrf.Draw( this, aRect.TopLeft(), aRect.GetSize() ); - - Size aSz( 2, 0 ); - aSz = PixelToLogic( aSz ); - SetFillColor( Color( COL_TRANSPARENT ) ); - SetRasterOp( ROP_INVERT ); - aRect.Left() += aTopLeft.Y(); - aRect.Top() += aTopLeft.X(); - aRect.Right() -= aBottomRight.Y(); - aRect.Bottom() -= aBottomRight.X(); - DrawRect( aRect ); -} - -void SvxGrfCropPage::SvxCropExample::SetFrameSize( const Size& rSz ) -{ - aFrameSize = rSz; - if(!aFrameSize.Width()) - aFrameSize.Width() = 1; - if(!aFrameSize.Height()) - aFrameSize.Height() = 1; - Size aWinSize( GetOutputSizePixel() ); - Fraction aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 ); - Fraction aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 ); - - if( aYScale < aXScale ) - aXScale = aYScale; - - MapMode aMapMode( GetMapMode() ); - - aMapMode.SetScaleX( aXScale ); - aMapMode.SetScaleY( aXScale ); - - SetMapMode( aMapMode ); - Invalidate(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/grfpage.hrc b/cui/source/tabpages/grfpage.hrc deleted file mode 100644 index 72b288d8f..000000000 --- a/cui/source/tabpages/grfpage.hrc +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#define FT_BOTTOM 1 -#define FT_HEIGHT 2 -#define FT_HEIGHTZOOM 3 -#define FT_LEFT 4 -#define FT_ORIG_SIZE 5 -#define FT_RIGHT 6 -#define FT_TOP 7 -#define FT_WIDTH 8 -#define FT_WIDTHZOOM 9 -#define FL_CROP 10 -#define FL_SIZE 12 -#define FL_ZOOM 13 -#define MF_BOTTOM 14 -#define MF_HEIGHT 15 -#define MF_HEIGHTZOOM 16 -#define MF_LEFT 17 -#define MF_RIGHT 18 -#define MF_TOP 19 -#define MF_WIDTH 20 -#define MF_WIDTHZOOM 21 -#define PB_ORGSIZE 22 -#define RB_SIZECONST 23 -#define RB_ZOOMCONST 24 -#define WN_BSP 25 - - diff --git a/cui/source/tabpages/grfpage.src b/cui/source/tabpages/grfpage.src deleted file mode 100644 index a6733903f..000000000 --- a/cui/source/tabpages/grfpage.src +++ /dev/null @@ -1,343 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <cuires.hrc> -#include "helpid.hrc" -#include "grfpage.hrc" -#include <svx/dialogs.hrc> - -/************************************************************/ -/* */ -/* */ -/* Crop-Page */ -/* */ -/* */ -/************************************************************/ -TabPage RID_SVXPAGE_GRFCROP -{ - Hide = TRUE ; - HelpID = HID_SVXPAGE_GRFCROP; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_CROP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 164 , 8 ) ; - Text [ en-US ] = "Crop" ; - }; - FixedText FT_LEFT - { - Pos = MAP_APPFONT ( 12 , 44 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Text [ en-US ] = "~Left" ; - }; - MetricField MF_LEFT - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_LEFT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 42 , 42 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Text = "12,99" ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -9999 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_RIGHT - { - Pos = MAP_APPFONT ( 12 , 60 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Right" ; - }; - MetricField MF_RIGHT - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_RIGHT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 42 , 58 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -9999 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_TOP - { - Pos = MAP_APPFONT ( 94 , 44 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Text [ en-US ] = "~Top" ; - }; - MetricField MF_TOP - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_TOP"; - Border = TRUE ; - Pos = MAP_APPFONT ( 124 , 42 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Text = "12,99" ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -9999 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_BOTTOM - { - Pos = MAP_APPFONT ( 94 , 60 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Bottom" ; - }; - MetricField MF_BOTTOM - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_BOTTOM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 124 , 58 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -9999 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 9999 ; - SpinSize = 10 ; - }; - RadioButton RB_SIZECONST - { - HelpID = "cui:RadioButton:RID_SVXPAGE_GRFCROP:RB_SIZECONST"; - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 152 , 10 ) ; - Text [ en-US ] = "Keep image si~ze" ; - }; - RadioButton RB_ZOOMCONST - { - HelpID = "cui:RadioButton:RID_SVXPAGE_GRFCROP:RB_ZOOMCONST"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 152 , 10 ) ; - Check = TRUE ; - Text [ en-US ] = "Keep ~scale" ; - }; - Window WN_BSP - { - Pos = MAP_APPFONT ( 176 , 6 ) ; - Size = MAP_APPFONT ( 78 , 78 ) ; - Border = TRUE ; - }; - FixedLine FL_ZOOM - { - Pos = MAP_APPFONT ( 6, 76 ) ; - Size = MAP_APPFONT ( 164 , 8 ) ; - Text [ en-US ] = "Scale" ; - }; - FixedText FT_WIDTHZOOM - { - Left = TRUE ; - Pos = MAP_APPFONT ( 12 , 89 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Text [ en-US ] = "~Width" ; - }; - MetricField MF_WIDTHZOOM - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_WIDTHZOOM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 42 , 87 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Text = "12,99" ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 9999 ; - First = 5 ; - Last = 1000 ; - Maximum = 9999 ; - Value = 100 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - SpinSize = 10 ; - }; - FixedText FT_HEIGHTZOOM - { - Pos = MAP_APPFONT ( 12 , 105 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Text [ en-US ] = "H~eight" ; - Left = TRUE ; - }; - MetricField MF_HEIGHTZOOM - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_HEIGHTZOOM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 42 , 103 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 9999 ; - First = 5 ; - Last = 1000 ; - Maximum = 9999 ; - Value = 100 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - SpinSize = 10 ; - }; - FixedLine FL_SIZE - { - Pos = MAP_APPFONT ( 6 , 121 ) ; - Size = MAP_APPFONT ( 164 , 8 ) ; - Text [ en-US ] = "Image size" ; - }; - FixedText FT_WIDTH - { - Pos = MAP_APPFONT ( 12 , 134 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Width" ; - }; - MetricField MF_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_WIDTH"; - Border = TRUE ; - Pos = MAP_APPFONT ( 42 , 132 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Text = "12,99" ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 5 ; - Maximum = 20000 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 5 ; - Last = 20000 ; - SpinSize = 10 ; - }; - FixedText FT_HEIGHT - { - Pos = MAP_APPFONT ( 12 , 150 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "H~eight" ; - }; - MetricField MF_HEIGHT - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRFCROP:MF_HEIGHT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 42 , 148 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 5 ; - Maximum = 20000 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 5 ; - Last = 20000 ; - SpinSize = 10 ; - }; - FixedText FT_ORIG_SIZE - { - Pos = MAP_APPFONT ( 176 , 132 ) ; - Size = MAP_APPFONT ( 74 , 8 ) ; - }; - PushButton PB_ORGSIZE - { - HelpID = "cui:PushButton:RID_SVXPAGE_GRFCROP:PB_ORGSIZE"; - Pos = MAP_APPFONT ( 176 , 143 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Original Size" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx deleted file mode 100644 index 3f04a3a07..000000000 --- a/cui/source/tabpages/labdlg.cxx +++ /dev/null @@ -1,639 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <tools/shl.hxx> -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <swpossizetabpage.hxx> -#include <svx/dialogs.hrc> -#define _SVX_LABDLG_CXX - -#include <svx/svdattrx.hxx> -#include <cuires.hrc> -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include "transfrm.hxx" - -#include "labdlg.hrc" -#include "labdlg.hxx" - -// define ---------------------------------------------------------------- - -#define AZ_OPTIMAL 0 -#define AZ_VON_OBEN 1 -#define AZ_VON_LINKS 2 -#define AZ_HORIZONTAL 3 -#define AZ_VERTIKAL 4 - -#define AT_OBEN 0 -#define AT_MITTE 1 -#define AT_UNTEN 2 - -#define WK_OPTIMAL 0 -#define WK_30 1 -#define WK_45 2 -#define WK_60 3 -#define WK_90 4 - -// static ---------------------------------------------------------------- - -static sal_uInt16 pCaptionRanges[] = -{ - SDRATTR_CAPTIONTYPE, - SDRATTR_CAPTIONFIXEDANGLE, - SDRATTR_CAPTIONANGLE, - SDRATTR_CAPTIONGAP, - SDRATTR_CAPTIONESCDIR, - SDRATTR_CAPTIONESCISREL, - SDRATTR_CAPTIONESCREL, - SDRATTR_CAPTIONESCABS, - SDRATTR_CAPTIONLINELEN, - SDRATTR_CAPTIONFITLINELEN, - 0 -}; - -// ----------------------------------------------------------------------- - -SvxCaptionTabPage::SvxCaptionTabPage(Window* pParent, const SfxItemSet& rInAttrs) - : SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_CAPTION ), rInAttrs ), - - aCT_CAPTTYPE( this, CUI_RES( CT_CAPTTYPE ) ), - aFT_ABSTAND( this, CUI_RES( FT_ABSTAND ) ), - aMF_ABSTAND( this, CUI_RES( MF_ABSTAND ) ), - aFT_WINKEL( this, CUI_RES( FT_WINKEL ) ), - aLB_WINKEL( this, CUI_RES( LB_WINKEL ) ), - aFT_ANSATZ( this, CUI_RES( FT_ANSATZ ) ), - aLB_ANSATZ( this, CUI_RES( LB_ANSATZ ) ), - aFT_UM( this, CUI_RES( FT_UM ) ), - aMF_ANSATZ( this, CUI_RES( MF_ANSATZ ) ), - aFT_ANSATZ_REL( this, CUI_RES( FT_ANSATZ_REL ) ), - aLB_ANSATZ_REL( this, CUI_RES( LB_ANSATZ_REL ) ), - aFT_LAENGE( this, CUI_RES( FT_LAENGE ) ), - aMF_LAENGE( this, CUI_RES( MF_LAENGE ) ), - aCB_LAENGE( this, CUI_RES( CB_LAENGE ) ), - - aStrHorzList( CUI_RES(STR_HORZ_LIST) ), - aStrVertList( CUI_RES(STR_VERT_LIST) ), - - rOutAttrs ( rInAttrs ) -{ - //------------NYI------------------------------------------- - aFT_WINKEL.Hide(); - aLB_WINKEL.Hide(); - - //------------Positionen korrigieren------------------------- - aFT_ANSATZ_REL.SetPosPixel( aFT_UM.GetPosPixel() ); - aLB_ANSATZ_REL.SetPosPixel( - Point( - aFT_ANSATZ_REL.GetPosPixel().X()+aFT_ANSATZ_REL.GetSizePixel().Width()+6, - aLB_ANSATZ.GetPosPixel().Y() ) - ); - - aMF_ANSATZ.SetPosPixel( - Point( - aFT_UM.GetPosPixel().X()+aFT_UM.GetSizePixel().Width()+6, - aLB_ANSATZ.GetPosPixel().Y() ) - ); - - sal_uInt16 nBitmap; - for( nBitmap = 0; nBitmap < CAPTYPE_BITMAPS_COUNT; nBitmap++ ) - mpBmpCapTypes[nBitmap] = new Image(Bitmap(CUI_RES(BMP_CAPTTYPE_1 + nBitmap)), COL_LIGHTMAGENTA ); - - //------------ValueSet installieren-------------------------- - aCT_CAPTTYPE.SetStyle( aCT_CAPTTYPE.GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER | WB_NAMEFIELD ); - aCT_CAPTTYPE.SetColCount(5);//XXX - aCT_CAPTTYPE.SetLineCount(1); - aCT_CAPTTYPE.SetSelectHdl(LINK( this, SvxCaptionTabPage, SelectCaptTypeHdl_Impl)); - - Image aImage; - aCT_CAPTTYPE.InsertItem(BMP_CAPTTYPE_1, aImage, String(CUI_RES(STR_CAPTTYPE_1))); - aCT_CAPTTYPE.InsertItem(BMP_CAPTTYPE_2, aImage, String(CUI_RES(STR_CAPTTYPE_2))); - aCT_CAPTTYPE.InsertItem(BMP_CAPTTYPE_3, aImage, String(CUI_RES(STR_CAPTTYPE_3))); - - FillValueSet(); - - aLB_ANSATZ.SetSelectHdl(LINK(this,SvxCaptionTabPage,AnsatzSelectHdl_Impl)); - aLB_ANSATZ_REL.SetSelectHdl(LINK(this,SvxCaptionTabPage,AnsatzRelSelectHdl_Impl)); - aCB_LAENGE.SetClickHdl(LINK(this,SvxCaptionTabPage,LineOptHdl_Impl)); - - FreeResource(); -} - -// ----------------------------------------------------------------------- - -SvxCaptionTabPage::~SvxCaptionTabPage() -{ - sal_uInt16 nBitmap; - for( nBitmap = 0; nBitmap < CAPTYPE_BITMAPS_COUNT; nBitmap++ ) - delete mpBmpCapTypes[nBitmap]; -} - -// ----------------------------------------------------------------------- - -void SvxCaptionTabPage::Construct() -{ - // Setzen des Rechtecks und der Workingarea - DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxCaptionTabPage::FillItemSet( SfxItemSet& _rOutAttrs) -{ - SfxItemPool* pPool = _rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - - SfxMapUnit eUnit; - - nCaptionType = aCT_CAPTTYPE.GetSelectItemId()-1; - - _rOutAttrs.Put( SdrCaptionTypeItem( (SdrCaptionType) nCaptionType ) ); - - if( aMF_ABSTAND.IsValueModified() ) - { - eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONGAP ) ); - _rOutAttrs.Put( SdrCaptionGapItem( GetCoreValue(aMF_ABSTAND, eUnit ) ) ); - } - - // Sonderbehandlung!!! XXX - if( nCaptionType==SDRCAPT_TYPE1 ) - { - switch( nEscDir ) - { - case SDRCAPT_ESCHORIZONTAL: nEscDir=SDRCAPT_ESCVERTICAL;break; - case SDRCAPT_ESCVERTICAL: nEscDir=SDRCAPT_ESCHORIZONTAL;break; - } - } - - _rOutAttrs.Put( SdrCaptionEscDirItem( (SdrCaptionEscDir)nEscDir ) ); - - bEscRel = aLB_ANSATZ_REL.IsVisible(); - _rOutAttrs.Put( SdrCaptionEscIsRelItem( bEscRel ) ); - - if( bEscRel ) - { - long nVal = 0; - - switch( aLB_ANSATZ_REL.GetSelectEntryPos() ) - { - case AT_OBEN: nVal=0;break; - case AT_MITTE: nVal=5000;break; - case AT_UNTEN: nVal=10000;break; - } - _rOutAttrs.Put( SdrCaptionEscRelItem( nVal ) ); - } - else - { - if( aMF_ANSATZ.IsValueModified() ) - { - eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONESCABS ) ); - _rOutAttrs.Put( SdrCaptionEscAbsItem( GetCoreValue(aMF_ANSATZ, eUnit ) ) ); - } - } - - bFitLineLen = aCB_LAENGE.IsChecked(); - _rOutAttrs.Put( SdrCaptionFitLineLenItem( bFitLineLen ) ); - - if( ! bFitLineLen ) - { - if( aMF_LAENGE.IsValueModified() ) - { - eUnit = pPool->GetMetric( GetWhich( SDRATTR_CAPTIONLINELEN ) ); - _rOutAttrs.Put( SdrCaptionLineLenItem( GetCoreValue(aMF_LAENGE, eUnit ) ) ); - } - } - -//NYI-------------die Winkel muessen noch hier rein!!! XXX---------------------- - - return( sal_True ); -} - -// ----------------------------------------------------------------------- - -void SvxCaptionTabPage::Reset( const SfxItemSet& ) -{ - - //------------Metrik einstellen----------------------------- - - FieldUnit eFUnit = GetModuleFieldUnit( rOutAttrs ); - - switch ( eFUnit ) - { - case FUNIT_CM: - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; - break; - default: ;//prevent warning - } - SetFieldUnit( aMF_ABSTAND, eFUnit ); - SetFieldUnit( aMF_ANSATZ, eFUnit ); - SetFieldUnit( aMF_LAENGE, eFUnit ); - - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - - sal_uInt16 nWhich; - SfxMapUnit eUnit; - - //------- Winkel ---------- - nWhich = GetWhich( SDRATTR_CAPTIONANGLE ); - nFixedAngle = ( ( const SdrCaptionAngleItem& ) rOutAttrs.Get( nWhich ) ).GetValue(); - - //------- absolute Ansatzentfernung ---------- - nWhich = GetWhich( SDRATTR_CAPTIONESCABS ); - eUnit = pPool->GetMetric( nWhich ); - nEscAbs = ( ( const SdrCaptionEscAbsItem& ) rOutAttrs.Get( nWhich ) ).GetValue(); - SetMetricValue( aMF_ANSATZ, nEscAbs, eUnit ); - nEscAbs = static_cast<long>(aMF_ANSATZ.GetValue()); - - //------- relative Ansatzentfernung ---------- - nWhich = GetWhich( SDRATTR_CAPTIONESCREL ); - nEscRel = (long)( ( const SdrCaptionEscRelItem& ) rOutAttrs.Get( nWhich ) ).GetValue(); - - //------- Linienlaenge ---------- - nWhich = GetWhich( SDRATTR_CAPTIONLINELEN ); - eUnit = pPool->GetMetric( nWhich ); - nLineLen = ( ( const SdrCaptionLineLenItem& ) rOutAttrs.Get( nWhich ) ).GetValue(); - SetMetricValue( aMF_LAENGE, nLineLen, eUnit ); - nLineLen = static_cast<long>(aMF_LAENGE.GetValue()); - - //------- Abstand zur Box ---------- - nWhich = GetWhich( SDRATTR_CAPTIONGAP ); - eUnit = pPool->GetMetric( nWhich ); - nGap = ( ( const SdrCaptionGapItem& ) rOutAttrs.Get( nWhich ) ).GetValue(); - SetMetricValue( aMF_ABSTAND, nGap, eUnit ); - nGap = static_cast<long>(aMF_ABSTAND.GetValue()); - - nCaptionType = (short)( ( const SdrCaptionTypeItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue(); - bFixedAngle = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFIXEDANGLE ) ) ).GetValue(); - bFitLineLen = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue(); - nEscDir = (short)( ( const SdrCaptionEscDirItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue(); - bEscRel = ( ( const SfxBoolItem& ) rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue(); - - // Sonderbehandlung!!! XXX - if( nCaptionType==SDRCAPT_TYPE1 ) - { - switch( nEscDir ) - { - case SDRCAPT_ESCHORIZONTAL: nEscDir=SDRCAPT_ESCVERTICAL;break; - case SDRCAPT_ESCVERTICAL: nEscDir=SDRCAPT_ESCHORIZONTAL;break; - } - } - - nAnsatzRelPos=AT_MITTE; - nAnsatzTypePos=AZ_OPTIMAL; - nWinkelTypePos=WK_OPTIMAL; - - aMF_ABSTAND.SetValue( nGap ); - - if( nEscDir == SDRCAPT_ESCHORIZONTAL ) - { - if( bEscRel ) - { - if( nEscRel < 3333 ) - nAnsatzRelPos = AT_OBEN; - if( nEscRel > 6666 ) - nAnsatzRelPos = AT_UNTEN; - nAnsatzTypePos = AZ_HORIZONTAL; - } - else - { - nAnsatzTypePos = AZ_VON_OBEN; - aMF_ANSATZ.SetValue( nEscAbs ); - } - } - else if( nEscDir == SDRCAPT_ESCVERTICAL ) - { - if( bEscRel ) - { - if( nEscRel < 3333 ) - nAnsatzRelPos = AT_OBEN; - if( nEscRel > 6666 ) - nAnsatzRelPos = AT_UNTEN; - nAnsatzTypePos = AZ_VERTIKAL; - } - else - { - nAnsatzTypePos = AZ_VON_LINKS; - aMF_ANSATZ.SetValue( nEscAbs ); - } - } - else if( nEscDir == SDRCAPT_ESCBESTFIT ) - { - nAnsatzTypePos = AZ_OPTIMAL; - } - - if( bFixedAngle ) - { - if( nFixedAngle <= 3000 ) - nWinkelTypePos=WK_30; - else if( nFixedAngle <= 4500 ) - nWinkelTypePos=WK_45; - else if( nFixedAngle <= 6000 ) - nWinkelTypePos=WK_60; - else - nWinkelTypePos=WK_90; - } - - aCB_LAENGE.Check( bFitLineLen ); - aMF_LAENGE.SetValue( nLineLen ); - - aLB_ANSATZ.SelectEntryPos( nAnsatzTypePos ); - aLB_WINKEL.SelectEntryPos( nWinkelTypePos ); - - SetupAnsatz_Impl( nAnsatzTypePos ); - aCT_CAPTTYPE.SelectItem( nCaptionType+1 );// Enum beginnt bei 0! - SetupType_Impl( nCaptionType+1 ); -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxCaptionTabPage::Create( Window* pWindow, - const SfxItemSet& rOutAttrs ) -{ - return( new SvxCaptionTabPage( pWindow, rOutAttrs ) ); -} - -//------------------------------------------------------------------------ - -sal_uInt16* SvxCaptionTabPage::GetRanges() -{ - return( pCaptionRanges ); -} - -//------------------------------------------------------------------------ - -void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType ) -{ - xub_StrLen nCnt=0, nIdx=0; - - switch( nType ) - { - case AZ_OPTIMAL: -// aMF_ANSATZ.Hide(); //XXX auch bei OPTIMAL werden Abswerte genommen -// aFT_UM.Hide(); - aMF_ANSATZ.Show(); - aFT_UM.Show(); - aFT_ANSATZ_REL.Hide(); - aLB_ANSATZ_REL.Hide(); - nEscDir = SDRCAPT_ESCBESTFIT; - break; - - case AZ_VON_OBEN: - aMF_ANSATZ.Show(); - aFT_UM.Show(); - aFT_ANSATZ_REL.Hide(); - aLB_ANSATZ_REL.Hide(); - nEscDir = SDRCAPT_ESCHORIZONTAL; - break; - - case AZ_VON_LINKS: - aMF_ANSATZ.Show(); - aFT_UM.Show(); - aFT_ANSATZ_REL.Hide(); - aLB_ANSATZ_REL.Hide(); - nEscDir = SDRCAPT_ESCVERTICAL; - break; - - case AZ_HORIZONTAL: - aLB_ANSATZ_REL.Clear(); - nCnt = aStrHorzList.GetTokenCount(); - for( nIdx=0 ; nIdx<nCnt ; nIdx++ ) - aLB_ANSATZ_REL.InsertEntry( aStrHorzList.GetToken(nIdx) ); - aLB_ANSATZ_REL.SelectEntryPos( nAnsatzRelPos ); - - aMF_ANSATZ.Hide(); - aFT_UM.Hide(); - aFT_ANSATZ_REL.Show(); - aLB_ANSATZ_REL.Show(); - nEscDir = SDRCAPT_ESCHORIZONTAL; - break; - - case AZ_VERTIKAL: - aLB_ANSATZ_REL.Clear(); - nCnt = aStrVertList.GetTokenCount(); - for( nIdx=0 ; nIdx<nCnt ; nIdx++ ) - aLB_ANSATZ_REL.InsertEntry( aStrVertList.GetToken(nIdx) ); - aLB_ANSATZ_REL.SelectEntryPos( nAnsatzRelPos ); - - aMF_ANSATZ.Hide(); - aFT_UM.Hide(); - aFT_ANSATZ_REL.Show(); - aLB_ANSATZ_REL.Show(); - nEscDir = SDRCAPT_ESCVERTICAL; - break; - } -} - -//------------------------------------------------------------------------ - -IMPL_LINK_INLINE_START( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox *, pListBox ) -{ - if( pListBox == &aLB_ANSATZ ) - { - SetupAnsatz_Impl( aLB_ANSATZ.GetSelectEntryPos() ); - } - return 0; -} -IMPL_LINK_INLINE_END( SvxCaptionTabPage, AnsatzSelectHdl_Impl, ListBox *, pListBox ) - -//------------------------------------------------------------------------ - -IMPL_LINK_INLINE_START( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox *, pListBox ) -{ - if( pListBox == &aLB_ANSATZ_REL ) - { - nAnsatzRelPos = aLB_ANSATZ_REL.GetSelectEntryPos(); - } - return 0; -} -IMPL_LINK_INLINE_END( SvxCaptionTabPage, AnsatzRelSelectHdl_Impl, ListBox *, pListBox ) - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxCaptionTabPage, LineOptHdl_Impl, Button *, pButton ) -{ - if( pButton == &aCB_LAENGE ) - { - if( aCB_LAENGE.IsChecked() || ! aCB_LAENGE.IsEnabled() ) - { - aFT_LAENGE.Disable(); - aMF_LAENGE.Disable(); - } - else - { - aFT_LAENGE.Enable(); - aMF_LAENGE.Enable(); - } - } - return 0; -} - -//------------------------------------------------------------------------ - -IMPL_LINK_INLINE_START( SvxCaptionTabPage, SelectCaptTypeHdl_Impl, void *, EMPTYARG ) -{ - SetupType_Impl( aCT_CAPTTYPE.GetSelectItemId() ); - return 0; -} -IMPL_LINK_INLINE_END( SvxCaptionTabPage, SelectCaptTypeHdl_Impl, void *, EMPTYARG ) - -//------------------------------------------------------------------------ - -void SvxCaptionTabPage::SetupType_Impl( sal_uInt16 nType ) -{ - switch( nType-1 ) - { - case SDRCAPT_TYPE1: - aFT_WINKEL.Disable(); - aLB_WINKEL.Disable(); - aFT_LAENGE.Disable(); - aCB_LAENGE.Disable(); - LineOptHdl_Impl( &aCB_LAENGE ); - break; - - case SDRCAPT_TYPE2: - aFT_WINKEL.Enable(); - aLB_WINKEL.Enable(); - aFT_LAENGE.Disable(); - aCB_LAENGE.Disable(); - LineOptHdl_Impl( &aCB_LAENGE ); - break; - - case SDRCAPT_TYPE3: - aFT_WINKEL.Enable(); - aLB_WINKEL.Enable(); - aFT_LAENGE.Enable(); - aCB_LAENGE.Enable(); - LineOptHdl_Impl( &aCB_LAENGE ); - break; - - case SDRCAPT_TYPE4: - aFT_WINKEL.Enable(); - aLB_WINKEL.Enable(); - aFT_LAENGE.Enable(); - aCB_LAENGE.Enable(); - LineOptHdl_Impl( &aCB_LAENGE ); - break; - } -} - -// ----------------------------------------------------------------------- - -void SvxCaptionTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxTabPage::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - FillValueSet(); -} - -// ----------------------------------------------------------------------- - -void SvxCaptionTabPage::FillValueSet() -{ - Image** ppBitmaps = mpBmpCapTypes; - aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_1, *(ppBitmaps[0]) ); - aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_2, *(ppBitmaps[1]) ); - aCT_CAPTTYPE.SetItemImage(BMP_CAPTTYPE_3, *(ppBitmaps[2]) ); -} - -//======================================================================== - - -SvxCaptionTabDialog::SvxCaptionTabDialog(Window* pParent, const SdrView* pSdrView, sal_uInt16 nAnchorTypes) - : SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_CAPTION ) ), - pView ( pSdrView ), - nAnchorCtrls(nAnchorTypes) -{ - FreeResource(); - - DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" ); - - //different positioning page in Writer - if(nAnchorCtrls & 0x00ff ) - { - AddTabPage( RID_SVXPAGE_SWPOSSIZE, SvxSwPosSizeTabPage::Create, - SvxSwPosSizeTabPage::GetRanges ); - RemoveTabPage( RID_SVXPAGE_POSITION_SIZE); - } - else - { - AddTabPage( RID_SVXPAGE_POSITION_SIZE, SvxPositionSizeTabPage::Create, - SvxPositionSizeTabPage::GetRanges ); - RemoveTabPage( RID_SVXPAGE_SWPOSSIZE ); - } - AddTabPage( RID_SVXPAGE_CAPTION, SvxCaptionTabPage::Create, - SvxCaptionTabPage::GetRanges ); -} - -// ----------------------------------------------------------------------- - -SvxCaptionTabDialog::~SvxCaptionTabDialog() -{ -} - -// ----------------------------------------------------------------------- - -void SvxCaptionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) -{ - switch( nId ) - { - case RID_SVXPAGE_POSITION_SIZE: - ( (SvxPositionSizeTabPage&) rPage ).SetView( pView ); - ( (SvxPositionSizeTabPage&) rPage ).Construct(); - if( nAnchorCtrls & SVX_OBJ_NORESIZE ) - ( (SvxPositionSizeTabPage&) rPage ).DisableResize(); - - if( nAnchorCtrls & SVX_OBJ_NOPROTECT ) - ( (SvxPositionSizeTabPage&) rPage ).DisableProtect(); - break; - case RID_SVXPAGE_SWPOSSIZE : - { - SvxSwPosSizeTabPage& rSwPage = static_cast<SvxSwPosSizeTabPage&>(rPage); - rSwPage.EnableAnchorTypes(nAnchorCtrls); - rSwPage.SetValidateFramePosLink( aValidateLink ); - } - break; - - case RID_SVXPAGE_CAPTION: - ( (SvxCaptionTabPage&) rPage ).SetView( pView ); - ( (SvxCaptionTabPage&) rPage ).Construct(); - break; - } -} - -void SvxCaptionTabDialog::SetValidateFramePosLink( const Link& rLink ) -{ - aValidateLink = rLink; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/labdlg.hrc b/cui/source/tabpages/labdlg.hrc deleted file mode 100644 index 7991be093..000000000 --- a/cui/source/tabpages/labdlg.hrc +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#include <cuires.hrc> -//#define RID_SVXPAGE_CAPTION 1000 -//#define RID_SVXDLG_CAPTION 1001 - -#define TAB_CONTROL 1 -#define BTN_OK 1 -#define BTN_CANCEL 1 -#define BTN_HELP 1 - -#define FT_ABSTAND 1 -#define FT_WINKEL 2 -#define FT_ANSATZ 3 -#define FT_LAENGE 4 -#define FT_UM 5 -#define FT_ANSATZ_REL 6 - -#define CT_CAPTTYPE 1 - -#define MF_ABSTAND 1 -#define MF_ANSATZ 2 -#define MF_LAENGE 3 - -#define CB_LAENGE 1 - -#define CM_LAENGE 1 - -#define LB_WINKEL 1 -#define LB_ANSATZ 2 -#define LB_ANSATZ_REL 3 - -#define STR_CAPTTYPE_1 1 -#define STR_CAPTTYPE_2 2 -#define STR_CAPTTYPE_3 3 -#define STR_CAPTTYPE_4 4 -#define STR_HORZ_LIST 10 -#define STR_VERT_LIST 11 - -#define BMP_CAPTTYPE_1 1 -#define BMP_CAPTTYPE_2 2 -#define BMP_CAPTTYPE_3 3 -#define BMP_CAPTTYPE_4 4 - -#define SHOW_HORZ 1 -#define SHOW_VERT 2 -#define SHOW_ABS 3 -#define SHOW_NONE 4 diff --git a/cui/source/tabpages/labdlg.src b/cui/source/tabpages/labdlg.src deleted file mode 100644 index 802bcec08..000000000 --- a/cui/source/tabpages/labdlg.src +++ /dev/null @@ -1,287 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include "helpid.hrc" -#include "labdlg.hrc" -#include <svx/dialogs.hrc> - - // RID_SVXPAGE_CAPTION --------------------------------------------------- -TabPage RID_SVXPAGE_CAPTION -{ - HelpId = HID_CAPTION ; - Hide = TRUE ; - //Size = MAP_APPFONT ( 189 , 97 ) ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Text [ en-US ] = "Callouts" ; - Control CT_CAPTTYPE - { - HelpId = HID_CAPTION_CTL_TYPE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 187 , 38 ) ; - TabStop = TRUE ; - }; - FixedText FT_ABSTAND - { - Pos = MAP_APPFONT ( 6 , 53 ) ; - Size = MAP_APPFONT ( 42 , 8 ) ; - Text [ en-US ] = "~Spacing" ; - }; - MetricField MF_ABSTAND - { - HelpID = "cui:MetricField:RID_SVXPAGE_CAPTION:MF_ABSTAND"; - Border = TRUE ; - Pos = MAP_APPFONT ( 50 , 51 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 240000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 50 ; - }; - FixedText FT_WINKEL - { - Pos = MAP_APPFONT ( 106 , 53 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "~Angle" ; - }; - ListBox LB_WINKEL - { - HelpID = "cui:ListBox:RID_SVXPAGE_CAPTION:LB_WINKEL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 143 , 51 ) ; - Size = MAP_APPFONT ( 50 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - CurPos = 0 ; - StringList [ en-US ] = - { - < "Free" ; 1 ; > ; - < "30 Degrees" ; 3000 ; > ; - < "45 Degrees" ; 4500 ; > ; - < "60 Degrees" ; 6000 ; > ; - < "90 Degrees" ; 9000 ; > ; - }; - }; - FixedText FT_ANSATZ - { - Pos = MAP_APPFONT ( 6 , 69 ) ; - Size = MAP_APPFONT ( 42 , 8 ) ; - Text [ en-US ] = "~Extension" ; - }; - ListBox LB_ANSATZ - { - HelpID = "cui:ListBox:RID_SVXPAGE_CAPTION:LB_ANSATZ"; - Border = TRUE ; - Pos = MAP_APPFONT ( 50 , 67 ) ; - Size = MAP_APPFONT ( 50 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - CurPos = 0 ; - StringList [ en-US ] = - { - < "Optimal" ; 4 ; > ; - < "From top" ; 3 ; > ; - < "From left" ; 3 ; > ; - < "Horizontal" ; 1 ; > ; - < "Vertical" ; 2 ; > ; - }; - }; - FixedText FT_UM - { - Pos = MAP_APPFONT ( 106 , 69 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "~By" ; - }; - MetricField MF_ANSATZ - { - HelpID = "cui:MetricField:RID_SVXPAGE_CAPTION:MF_ANSATZ"; - Border = TRUE ; - Pos = MAP_APPFONT ( 143 , 67 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 240000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 50 ; - }; - FixedText FT_ANSATZ_REL - { - Pos = MAP_APPFONT ( 106 , 69 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "~Position" ; - }; - ListBox LB_ANSATZ_REL - { - HelpID = "cui:ListBox:RID_SVXPAGE_CAPTION:LB_ANSATZ_REL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 143 , 67 ) ; - Size = MAP_APPFONT ( 50 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedText FT_LAENGE - { - Pos = MAP_APPFONT ( 6 , 85 ) ; - Size = MAP_APPFONT ( 42 , 8 ) ; - Text [ en-US ] = "~Length" ; - }; - MetricField MF_LAENGE - { - HelpID = "cui:MetricField:RID_SVXPAGE_CAPTION:MF_LAENGE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 50 , 83 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 240000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 50 ; - }; - CheckBox CB_LAENGE - { - HelpID = "cui:CheckBox:RID_SVXPAGE_CAPTION:CB_LAENGE"; - Pos = MAP_APPFONT ( 106 , 84 ) ; - Size = MAP_APPFONT ( 50 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Optimal" ; - }; - String STR_CAPTTYPE_1 - { - Text [ en-US ] = "Straight Line" ; - }; - String STR_CAPTTYPE_2 - { - Text [ en-US ] = "Angled Line" ; - }; - String STR_CAPTTYPE_3 - { - Text [ en-US ] = "Angled Connector Line" ; - }; - String STR_CAPTTYPE_4 - { - Text [ en-US ] = "Double-angled line" ; - }; - String STR_HORZ_LIST - { - Text [ en-US ] = "Top;Middle;Bottom" ; - }; - String STR_VERT_LIST - { - Text [ en-US ] = "Left;Middle;Right" ; - }; - Bitmap BMP_CAPTTYPE_1 - { - File = "legtyp1.bmp" ; - }; - Bitmap BMP_CAPTTYPE_2 - { - File = "legtyp2.bmp" ; - }; - Bitmap BMP_CAPTTYPE_3 - { - File = "legtyp3.bmp" ; - }; - Bitmap BMP_CAPTTYPE_4 - { - File = "legtyp4.bmp" ; - }; -}; - // RID_SVXDLG_CAPTION ---------------------------------------------------- - -#define _POS_SIZE_TEXT \ - Text [ en-US ] = "Position and Size" ; \ - -TabDialog RID_SVXDLG_CAPTION\ -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 237 , 161 ) ; - Text [ en-US ] = "Callouts" ;\ - Moveable = TRUE ; - TabControl TAB_CONTROL\ - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( 189 , 97 ) ; - PageList = - { - PageItem\ - { - Identifier = RID_SVXPAGE_POSITION_SIZE ; - PageResID = RID_SVXPAGE_POSITION_SIZE ; - _POS_SIZE_TEXT - }; - PageItem - { - Identifier = RID_SVXPAGE_SWPOSSIZE; - PageResID = RID_SVXPAGE_SWPOSSIZE; - _POS_SIZE_TEXT - }; - PageItem - { - Identifier = RID_SVXPAGE_CAPTION ; - PageResID = RID_SVXPAGE_CAPTION ; - Text [ en-US ] = "Callout" ; - }; - }; - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx deleted file mode 100644 index fb33590d8..000000000 --- a/cui/source/tabpages/macroass.cxx +++ /dev/null @@ -1,501 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#define ITEMID_MACRO 0 -#include <svl/macitem.hxx> -#undef ITEMID_MACRO - -#include "macroass.hxx" - -#include <basic/basmgr.hxx> -#include <dialmgr.hxx> -#include <svx/dialogs.hrc> -#define _SVSTDARR_STRINGSDTOR -#include <svl/svstdarr.hxx> - -#include <svtools/svmedit.hxx> -#include "cfgutil.hxx" -#include <sfx2/app.hxx> -#include <sfx2/evntconf.hxx> -#include <sfx2/objsh.hxx> -#include "macroass.hrc" -#include "cuires.hrc" -#include <vcl/fixed.hxx> -#include "headertablistbox.hxx" - -using ::com::sun::star::uno::Reference; -using ::com::sun::star::frame::XFrame; - -class _SfxMacroTabPage_Impl -{ -public: - _SfxMacroTabPage_Impl( void ); - ~_SfxMacroTabPage_Impl(); - - String maStaticMacroLBLabel; - PushButton* pAssignPB; - PushButton* pDeletePB; - String* pStrEvent; - String* pAssignedMacro; - _HeaderTabListBox* pEventLB; - SfxConfigGroupListBox_Impl* pGroupLB; - FixedText* pFT_MacroLBLabel; - SfxConfigFunctionListBox_Impl* pMacroLB; - - FixedText* pMacroFT; - String* pMacroStr; - - sal_Bool bReadOnly; - Timer maFillGroupTimer; - sal_Bool bGotEvents; -}; - -_SfxMacroTabPage_Impl::_SfxMacroTabPage_Impl( void ) : - pAssignPB( NULL ), - pDeletePB( NULL ), - pStrEvent( NULL ), - pAssignedMacro( NULL ), - pEventLB( NULL ), - pGroupLB( NULL ), - pFT_MacroLBLabel( NULL ), - pMacroLB( NULL ), - pMacroFT( NULL ), - pMacroStr( NULL ), - bReadOnly( sal_False ), - bGotEvents( sal_False ) -{ -} - -_SfxMacroTabPage_Impl::~_SfxMacroTabPage_Impl() -{ - delete pAssignPB; - delete pDeletePB; - delete pStrEvent; - delete pAssignedMacro; - delete pEventLB; - delete pGroupLB; - delete pMacroLB; - delete pFT_MacroLBLabel; - delete pMacroFT; - delete pMacroStr; -} - - -static sal_uInt16 aPageRg[] = { - SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, - 0 -}; - -// Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert -static long nTabs[] = - { - 2, // Number of Tabs - 0, 90 - }; - -#define TAB_WIDTH_MIN 10 - -// IDs for items in HeaderBar of EventLB -#define ITEMID_EVENT 1 -#define ITMEID_ASSMACRO 2 - - -#define LB_EVENTS_ITEMPOS 1 -#define LB_MACROS_ITEMPOS 2 - -String ConvertToUIName_Impl( SvxMacro *pMacro ) -{ - String aName( pMacro->GetMacName() ); - String aEntry; - if ( ! pMacro->GetLanguage().EqualsAscii("JavaScript") ) - { - sal_uInt16 nCount = aName.GetTokenCount('.'); - aEntry = aName.GetToken( nCount-1, '.' ); - if ( nCount > 2 ) - { - aEntry += '('; - aEntry += aName.GetToken( 0, '.' ); - aEntry += '.'; - aEntry += aName.GetToken( nCount-2, '.' ); - aEntry += ')'; - } - return aEntry; - } - else - return aName; -} - -void _SfxMacroTabPage::EnableButtons() -{ - // Solange die Eventbox leer ist, nichts tun - const SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().FirstSelected(); - if ( pE ) - { - // Gebundenes Macro holen - const SvxMacro* pM = aTbl.Get( (sal_uInt16)(sal_uLong) pE->GetUserData() ); - mpImpl->pDeletePB->Enable( 0 != pM && !mpImpl->bReadOnly ); - - String sEventMacro; - sEventMacro = ((SvLBoxString*)pE->GetItem( LB_MACROS_ITEMPOS ))->GetText(); - - String sScriptURI = mpImpl->pMacroLB->GetSelectedScriptURI(); - mpImpl->pAssignPB->Enable( !mpImpl->bReadOnly && !sScriptURI.EqualsIgnoreCaseAscii( sEventMacro ) ); - } - else - mpImpl->pAssignPB->Enable( sal_False ); -} - -_SfxMacroTabPage::_SfxMacroTabPage( Window* pParent, const ResId& rResId, const SfxItemSet& rAttrSet ) - : SfxTabPage( pParent, rResId, rAttrSet ) - -{ - mpImpl = new _SfxMacroTabPage_Impl; -} - -_SfxMacroTabPage::~_SfxMacroTabPage() -{ - DELETEZ( mpImpl ); -} - -void _SfxMacroTabPage::AddEvent( const String & rEventName, sal_uInt16 nEventId ) -{ - String sTmp( rEventName ); - sTmp += '\t'; - - // falls die Tabelle schon gueltig ist - SvxMacro* pM = aTbl.Get( nEventId ); - if( pM ) - { - String sNew( ConvertToUIName_Impl( pM ) ); - sTmp += sNew; - } - - SvLBoxEntry* pE = mpImpl->pEventLB->GetListBox().InsertEntry( sTmp ); - pE->SetUserData( reinterpret_cast< void* >( sal::static_int_cast< sal_IntPtr >( nEventId )) ); -} - -void _SfxMacroTabPage::ScriptChanged() -{ - // neue Bereiche und deren Funktionen besorgen - { - mpImpl->pGroupLB->Show(); - mpImpl->pMacroLB->Show(); - mpImpl->pMacroFT->SetText( *mpImpl->pMacroStr ); - } - - EnableButtons(); -} - -sal_Bool _SfxMacroTabPage::FillItemSet( SfxItemSet& rSet ) -{ - SvxMacroItem aItem( GetWhich( aPageRg[0] ) ); - ((SvxMacroTableDtor&)aItem.GetMacroTable()) = aTbl; - - const SfxPoolItem* pItem; - if( SFX_ITEM_SET != GetItemSet().GetItemState( aItem.Which(), sal_True, &pItem ) - || aItem != *(SvxMacroItem*)pItem ) - { - rSet.Put( aItem ); - return sal_True; - } - return sal_False; -} - -void _SfxMacroTabPage::PageCreated (SfxAllItemSet aSet) -{ - const SfxPoolItem* pEventsItem; - if( !mpImpl->bGotEvents && SFX_ITEM_SET == aSet.GetItemState( SID_EVENTCONFIG, sal_True, &pEventsItem ) ) - { - mpImpl->bGotEvents = sal_True; - const SfxEventNamesList& rList = ((SfxEventNamesItem*)pEventsItem)->GetEvents(); - for ( size_t nNo = 0, nCnt = rList.size(); nNo < nCnt; ++nNo ) - { - const SfxEventName *pOwn = rList.at(nNo); - AddEvent( pOwn->maUIName, pOwn->mnId ); - } - } -} - -void _SfxMacroTabPage::Reset( const SfxItemSet& rSet ) -{ - const SfxPoolItem* pItem; - if( SFX_ITEM_SET == rSet.GetItemState( GetWhich( aPageRg[0] ), sal_True, &pItem )) - aTbl = ((SvxMacroItem*)pItem)->GetMacroTable(); - - const SfxPoolItem* pEventsItem; - if( !mpImpl->bGotEvents && SFX_ITEM_SET == rSet.GetItemState( SID_EVENTCONFIG, sal_True, &pEventsItem ) ) - { - mpImpl->bGotEvents = sal_True; - const SfxEventNamesList& rList = ((SfxEventNamesItem*)pEventsItem)->GetEvents(); - for ( size_t nNo = 0, nCnt = rList.size(); nNo < nCnt; ++nNo ) - { - const SfxEventName *pOwn = rList.at(nNo); - AddEvent( pOwn->maUIName, pOwn->mnId ); - } - } - - FillEvents(); - - SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - SvLBoxEntry* pE = rListBox.GetEntry( 0 ); - if( pE ) - rListBox.SetCurEntry( pE ); -} - -sal_Bool _SfxMacroTabPage::IsReadOnly() const -{ - return mpImpl->bReadOnly; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG ) -{ - _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl; - SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox(); - SvLBoxEntry* pE = rListBox.FirstSelected(); - sal_uLong nPos; - if( !pE || LISTBOX_ENTRY_NOTFOUND == - ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) ) - { - DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" ); - return 0; - } - - pThis->ScriptChanged(); - pThis->EnableButtons(); - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox*, EMPTYARG ) -{ - _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl; - String sSel( pImpl->pGroupLB->GetGroup() ); - pImpl->pGroupLB->GroupSelected(); - const String sScriptURI = pImpl->pMacroLB->GetSelectedScriptURI(); - String aLabelText; - if( sScriptURI.Len() > 0 ) - aLabelText = pImpl->maStaticMacroLBLabel; - pImpl->pFT_MacroLBLabel->SetText( aLabelText ); - - pThis->EnableButtons(); - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox*, EMPTYARG ) -{ - _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl; - pImpl->pMacroLB->FunctionSelected(); - pThis->EnableButtons(); - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn ) -{ - _SfxMacroTabPage_Impl* pImpl = pThis->mpImpl; - SvHeaderTabListBox& rListBox = pImpl->pEventLB->GetListBox(); - SvLBoxEntry* pE = rListBox.FirstSelected(); - sal_uLong nPos; - if( !pE || LISTBOX_ENTRY_NOTFOUND == - ( nPos = rListBox.GetModel()->GetAbsPos( pE ) ) ) - { - DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" ); - return 0; - } - - const sal_Bool bAssEnabled = pBtn != pImpl->pDeletePB && pImpl->pAssignPB->IsEnabled(); - - // aus der Tabelle entfernen - sal_uInt16 nEvent = (sal_uInt16)(sal_uLong)pE->GetUserData(); - SvxMacro *pRemoveMacro = pThis->aTbl.Remove( nEvent ); - delete pRemoveMacro; - - String sScriptURI; - if( bAssEnabled ) - { - sScriptURI = pImpl->pMacroLB->GetSelectedScriptURI(); - if( sScriptURI.CompareToAscii( "vnd.sun.star.script:", 20 ) == COMPARE_EQUAL ) - { - pThis->aTbl.Insert( - nEvent, new SvxMacro( sScriptURI, String::CreateFromAscii( SVX_MACRO_LANGUAGE_SF ) ) ); - } - else - { - OSL_ENSURE( false, "_SfxMacroTabPage::AssignDeleteHdl_Impl: this branch is *not* dead? (out of interest: tell fs, please!)" ); - pThis->aTbl.Insert( - nEvent, new SvxMacro( sScriptURI, String::CreateFromAscii( SVX_MACRO_LANGUAGE_STARBASIC ) ) ); - } - } - - pImpl->pEventLB->SetUpdateMode( sal_False ); - pE->ReplaceItem( new SvLBoxString( pE, 0, sScriptURI ), LB_MACROS_ITEMPOS ); - rListBox.GetModel()->InvalidateEntry( pE ); - rListBox.Select( pE ); - rListBox.MakeVisible( pE ); - rListBox.SetUpdateMode( sal_True ); - - pThis->EnableButtons(); - return 0; -} - -IMPL_STATIC_LINK( _SfxMacroTabPage, TimeOut_Impl, Timer*, EMPTYARG ) -{ - // FillMacroList() can take a long time -> show wait cursor and disable input - SfxTabDialog* pTabDlg = pThis->GetTabDialog(); - // perhaps the tabpage is part of a SingleTabDialog then pTabDlg == NULL - if ( pTabDlg ) - { - pTabDlg->EnterWait(); - pTabDlg->EnableInput( sal_False ); - } - pThis->FillMacroList(); - if ( pTabDlg ) - { - pTabDlg->EnableInput( sal_True ); - pTabDlg->LeaveWait(); - } - return 0; -} - -void _SfxMacroTabPage::InitAndSetHandler() -{ - // Handler installieren - SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - HeaderBar& rHeaderBar = mpImpl->pEventLB->GetHeaderBar(); - Link aLnk(STATIC_LINK(this, _SfxMacroTabPage, AssignDeleteHdl_Impl )); - mpImpl->pMacroLB->SetDoubleClickHdl( aLnk ); - mpImpl->pDeletePB->SetClickHdl( aLnk ); - mpImpl->pAssignPB->SetClickHdl( aLnk ); - rListBox.SetDoubleClickHdl( aLnk ); - - rListBox.SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectEvent_Impl )); - mpImpl->pGroupLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectGroup_Impl )); - mpImpl->pMacroLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectMacro_Impl )); - - rListBox.SetSelectionMode( SINGLE_SELECTION ); - rListBox.SetTabs( &nTabs[0], MAP_APPFONT ); - Size aSize( nTabs[ 2 ], 0 ); - rHeaderBar.InsertItem( ITEMID_EVENT, *mpImpl->pStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); - aSize.Width() = 1764; // don't know what, so 42^2 is best to use... - rHeaderBar.InsertItem( ITMEID_ASSMACRO, *mpImpl->pAssignedMacro, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); - rListBox.SetSpaceBetweenEntries( 0 ); - - mpImpl->pEventLB->Show(); - mpImpl->pEventLB->ConnectElements(); - - mpImpl->pEventLB->Enable( sal_True ); - mpImpl->pGroupLB->Enable( sal_True ); - mpImpl->pMacroLB->Enable( sal_True ); - - mpImpl->pGroupLB->SetFunctionListBox( mpImpl->pMacroLB ); - - mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) ); - mpImpl->maFillGroupTimer.SetTimeout( 0 ); - mpImpl->maFillGroupTimer.Start(); -} - -void _SfxMacroTabPage::FillMacroList() -{ - mpImpl->pGroupLB->Init( - ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >(), - GetFrame(), - ::rtl::OUString() ); -} - -void _SfxMacroTabPage::FillEvents() -{ - SvHeaderTabListBox& rListBox = mpImpl->pEventLB->GetListBox(); - - sal_uLong nEntryCnt = rListBox.GetEntryCount(); - - // Events aus der Tabelle holen und die EventListBox entsprechen fuellen - for( sal_uLong n = 0 ; n < nEntryCnt ; ++n ) - { - SvLBoxEntry* pE = rListBox.GetEntry( n ); - if( pE ) - { - SvLBoxString* pLItem = ( SvLBoxString* ) pE->GetItem( LB_MACROS_ITEMPOS ); - DBG_ASSERT( pLItem && SV_ITEM_ID_LBOXSTRING == pLItem->IsA(), "_SfxMacroTabPage::FillEvents(): no LBoxString" ); - - String sOld( pLItem->GetText() ); - String sNew; - sal_uInt16 nEventId = ( sal_uInt16 ) ( sal_uLong ) pE->GetUserData(); - if( aTbl.IsKeyValid( nEventId ) ) - sNew = ConvertToUIName_Impl( aTbl.Get( nEventId ) ); - - if( sOld != sNew ) - { - pE->ReplaceItem( new SvLBoxString( pE, 0, sNew ), LB_MACROS_ITEMPOS ); - rListBox.GetModel()->InvalidateEntry( pE ); - } - } - } -} - -SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet ) - : _SfxMacroTabPage( pParent, rResId, rSet ) -{ - mpImpl->pStrEvent = new String( CUI_RES( STR_EVENT ) ); - mpImpl->pAssignedMacro = new String( CUI_RES( STR_ASSMACRO ) ); - mpImpl->pEventLB = new _HeaderTabListBox( this, CUI_RES( LB_EVENT ) ); - mpImpl->pAssignPB = new PushButton( this, CUI_RES( PB_ASSIGN ) ); - mpImpl->pDeletePB = new PushButton( this, CUI_RES( PB_DELETE ) ); - mpImpl->pMacroFT = new FixedText( this, CUI_RES( FT_MACRO ) ); - mpImpl->pGroupLB = new SfxConfigGroupListBox_Impl( this, CUI_RES( LB_GROUP ) ); - mpImpl->pFT_MacroLBLabel = new FixedText( this, CUI_RES( FT_LABEL4LB_MACROS ) ); - mpImpl->maStaticMacroLBLabel= mpImpl->pFT_MacroLBLabel->GetText(); - mpImpl->pMacroLB = new SfxConfigFunctionListBox_Impl( this, CUI_RES( LB_MACROS ) ); - mpImpl->pMacroStr = new String( CUI_RES( STR_MACROS ) ); - - FreeResource(); - - SetFrame( rxDocumentFrame ); - - InitAndSetHandler(); - - ScriptChanged(); -} - -SfxTabPage* SfxMacroTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) -{ - return new SfxMacroTabPage( pParent, CUI_RES( RID_SVXPAGE_EVENTASSIGN ), NULL, rAttrSet ); -} - -SfxMacroAssignDlg::SfxMacroAssignDlg( Window* pParent, const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet ) - : SfxSingleTabDialog( pParent, rSet, 0 ) -{ - SfxTabPage* pPage = SfxMacroTabPage::Create( this, rSet ); - pPage->SetFrame( rxDocumentFrame ); - SetTabPage( pPage ); -} - -SfxMacroAssignDlg::~SfxMacroAssignDlg() -{ -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/macroass.hrc b/cui/source/tabpages/macroass.hrc deleted file mode 100644 index 997bb6cf9..000000000 --- a/cui/source/tabpages/macroass.hrc +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#ifndef _MACROASS_HRC -#define _MACROASS_HRC - -#ifndef _SVT_CONTROLDIMS_HRC_ -#include <svtools/controldims.hrc> -#endif - -#define LB_EVENT 2 -#define PB_ASSIGN 3 -#define PB_DELETE 4 -#define FT_MACRO 5 -#define LB_GROUP 6 -#define LB_MACROS 7 - // FREE -#define FT_LABEL4LB_MACROS 9 -#define STR_JAVASCRIPT 10 -#define STR_MACROS 11 -#define ED_JAVASCRIPT 12 -#define STR_EVENT 13 -#define STR_ASSMACRO 14 - - -// COL0<---------------WIDTH_1_2--------------->COL3<->COL4<----WIDTH4---->COL5 -// <--WIDTH1-->COL1<-SPACE1->COL2<--WIDTH2-> - -#define WIDTH_TP 260 // of whole tabpage -#define COL5 (WIDTH_TP-RSC_SP_DLG_INNERBORDER_RIGHT) -#define COL4 (COL5-RSC_CD_PUSHBUTTON_WIDTH) -#define COL3 (COL4-RSC_SP_CTRL_X) -#define COL0 (RSC_SP_TBPG_INNERBORDER_LEFT) -#define WIDTH1_2 (COL3-COL0) // width of upper listbox -#define SPACE1 4 // space between lower listboxes -#define WIDTH1 ((WIDTH1_2-SPACE1)/2) // width of lower left listbox -#define WIDTH2 (WIDTH1_2-WIDTH1-SPACE1) // width of lower right listbox -#define COL1 (COL0+WIDTH1) -#define COL2 (COL1+SPACE1) - -#define HEIGHT_TP 185 // of whole tabpage -#define HEIGHT0 62 // of upper listbox -#define ROW0 6 // more than RSC_SP_FLGR_INNERBORDER_TOP cause of bad design -#define ROW1 (ROW0+RSC_CD_PUSHBUTTON_HEIGHT) // Assign button -#define ROW2 (ROW1+RSC_SP_CTRL_GROUP_Y) -#define ROW3 (ROW2+RSC_CD_PUSHBUTTON_HEIGHT) // Remove button -#define ROW4 (ROW3+RSC_SP_CTRL_GROUP_Y) -#define ROW5 (ROW4+RSC_CD_DROPDOWN_HEIGHT) // script type listbox (hidden) -#define ROW6 (ROW0+HEIGHT0) -#define ROW7 (ROW6+RSC_SP_CTRL_Y) -#define HEIGHT_EXTRA7 (RSC_CD_FIXEDTEXT_HEIGHT) // additional height for FT_LABEL4LB_MACROS -#define ROW7A (ROW7+HEIGHT_EXTRA7) -#define ROW8 (ROW7+RSC_CD_FIXEDTEXT_HEIGHT+HEIGHT_EXTRA7)// label for lower listboxes (2 lines!) -#define ROW9 (HEIGHT_TP-RSC_SP_TBPG_INNERBORDER_BOTTOM) -#define HEIGHT8 (ROW9-ROW8) // of lower listboxes - -#endif - diff --git a/cui/source/tabpages/macroass.src b/cui/source/tabpages/macroass.src deleted file mode 100644 index 0db9825a5..000000000 --- a/cui/source/tabpages/macroass.src +++ /dev/null @@ -1,134 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include "macroass.hrc" -#include "cuires.hrc" -#include "helpid.hrc" -#include <svx/dialogs.hrc> - -TabPage RID_SVXPAGE_EVENTASSIGN -{ - HelpID = "cui:TabPage:RID_SVXPAGE_EVENTASSIGN"; - Hide = TRUE ; - SVLook = TRUE ; - DialogControl = TRUE ; - Size = MAP_APPFONT ( WIDTH_TP , HEIGHT_TP ) ; - Text [ en-US ] = "Assign Macro" ; - String STR_EVENT - { - Text [ en-US ] = "Event" ; - }; - String STR_ASSMACRO - { - Text [ en-US ] = "Assigned macro"; - }; - Control LB_EVENT - { - Border = TRUE ; - Pos = MAP_APPFONT ( COL0 , ROW0 ) ; - Size = MAP_APPFONT ( WIDTH1_2 , HEIGHT0 ) ; - TabStop = TRUE ; - DialogControl = TRUE ; - ClipChildren = TRUE ; - Disable = TRUE ; - Group = TRUE ; - HelpID = HID_MACRO_LB_EVENT ; - }; - FixedText FT_MACRO - { - Pos = MAP_APPFONT ( COL0 , ROW7A ) ; - Size = MAP_APPFONT ( WIDTH1 , RSC_CD_FIXEDTEXT_HEIGHT ) ; - Group = TRUE ; - }; - Control LB_GROUP - { - Border = TRUE ; - Pos = MAP_APPFONT ( COL0 , ROW8 ) ; - Size = MAP_APPFONT ( WIDTH1 , HEIGHT8 ) ; - TabStop = TRUE ; - Group = TRUE ; - HelpId = HID_MACRO_GROUP ; - }; - FixedText FT_LABEL4LB_MACROS - { - Pos = MAP_APPFONT ( COL2 , ROW7 ) ; - Size = MAP_APPFONT ( WIDTH1 , RSC_CD_FIXEDTEXT_HEIGHT + HEIGHT_EXTRA7 ) ; - WordBreak = TRUE; - Text [ en-US ] = "~Existing macros\n" ; - }; - Control LB_MACROS - { - Border = TRUE ; - Pos = MAP_APPFONT ( COL2 , ROW8 ) ; - Size = MAP_APPFONT ( WIDTH2 , HEIGHT8 ) ; - TabStop = TRUE ; - HelpId = HID_MACRO_MACROS ; - }; - PushButton PB_ASSIGN - { - HelpID = "cui:PushButton:RID_SVXPAGE_EVENTASSIGN:PB_ASSIGN"; - Pos = MAP_APPFONT ( COL4 , ROW0 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - Disable = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "~Assign" ; - }; - PushButton PB_DELETE - { - HelpID = "cui:PushButton:RID_SVXPAGE_EVENTASSIGN:PB_DELETE"; - Pos = MAP_APPFONT ( COL4 , ROW2 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - Disable = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "~Remove" ; - }; - String STR_MACROS - { - Text [ en-US ] = "Macros" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx deleted file mode 100644 index 55632dfda..000000000 --- a/cui/source/tabpages/measure.cxx +++ /dev/null @@ -1,874 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <tools/shl.hxx> - -#include <cuires.hrc> - -#define _SVX_MEASURE_CXX - -#include <svx/svdomeas.hxx> -#include <svx/svdattr.hxx> -#include <svx/svdattrx.hxx> -#include <svx/svdview.hxx> -#include <svx/dialogs.hrc> -#include <svx/dialmgr.hxx> -#include "svx/measctrl.hxx" -#include "measure.hxx" -#include "measure.hrc" -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include <svx/strarray.hxx> -#include <sfx2/request.hxx> -#include "svx/ofaitem.hxx" - -static sal_uInt16 pRanges[] = -{ - SDRATTR_MEASURE_FIRST, - SDRATTR_MEASURE_LAST, - 0 -}; - -/************************************************************************* -|* -|* Dialog to change measure-attributes -|* -\************************************************************************/ - -SvxMeasureDialog::SvxMeasureDialog( Window* pParent, const SfxItemSet& rInAttrs, - const SdrView* pSdrView ) : - SfxSingleTabDialog( pParent, rInAttrs, RID_SVXPAGE_MEASURE ) -{ - SvxMeasurePage* _pPage = new SvxMeasurePage( this, rInAttrs ); - - _pPage->SetView( pSdrView ); - _pPage->Construct(); - - SetTabPage( _pPage ); - SetText( _pPage->GetText() ); -} - -/************************************************************************* -|* -|* Dtor -|* -\************************************************************************/ - -SvxMeasureDialog::~SvxMeasureDialog() -{ -} - -/************************************************************************* -|* -|* Tabpage for changing measure-attributes -|* -\************************************************************************/ - -SvxMeasurePage::SvxMeasurePage( Window* pWindow, const SfxItemSet& rInAttrs ) : - SvxTabPage ( pWindow, CUI_RES( RID_SVXPAGE_MEASURE ), - rInAttrs ), - - aFlLine ( this, CUI_RES( FL_LINE ) ), - aFtLineDist ( this, CUI_RES( FT_LINE_DIST ) ), - aMtrFldLineDist ( this, CUI_RES( MTR_LINE_DIST ) ), - aFtHelplineOverhang ( this, CUI_RES( FT_HELPLINE_OVERHANG ) ), - aMtrFldHelplineOverhang ( this, CUI_RES( MTR_FLD_HELPLINE_OVERHANG ) ), - aFtHelplineDist ( this, CUI_RES( FT_HELPLINE_DIST ) ), - aMtrFldHelplineDist ( this, CUI_RES( MTR_FLD_HELPLINE_DIST ) ), - aFtHelpline1Len ( this, CUI_RES( FT_HELPLINE1_LEN ) ), - aMtrFldHelpline1Len ( this, CUI_RES( MTR_FLD_HELPLINE1_LEN ) ), - aFtHelpline2Len ( this, CUI_RES( FT_HELPLINE2_LEN ) ), - aMtrFldHelpline2Len ( this, CUI_RES( MTR_FLD_HELPLINE2_LEN ) ), - aTsbBelowRefEdge ( this, CUI_RES( TSB_BELOW_REF_EDGE ) ), - aFtDecimalPlaces ( this, CUI_RES( FT_DECIMALPLACES ) ), - aMtrFldDecimalPlaces ( this, CUI_RES( MTR_FLD_DECIMALPLACES ) ), - - aFlLabel ( this, CUI_RES( FL_LABEL ) ), - aFtPosition ( this, CUI_RES( FT_POSITION ) ), - aCtlPosition ( this, CUI_RES( CTL_POSITION ) ), - aTsbAutoPosV ( this, CUI_RES( TSB_AUTOPOSV ) ), - aTsbAutoPosH ( this, CUI_RES( TSB_AUTOPOSH ) ), - aTsbShowUnit ( this, CUI_RES( TSB_SHOW_UNIT ) ), - aLbUnit ( this, CUI_RES( LB_UNIT ) ), - aTsbParallel ( this, CUI_RES( TSB_PARALLEL ) ), - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ), rInAttrs ), - - aFlVert ( this, CUI_RES( FL_VERT ) ), - rOutAttrs ( rInAttrs ), - aAttrSet ( *rInAttrs.GetPool() ), - pView( 0 ), - - bPositionModified ( sal_False ) -{ - aCtlPreview.SetAccessibleName(aCtlPreview.GetHelpText()); - FillUnitLB(); - - FreeResource(); - - const FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs ); - SetFieldUnit( aMtrFldLineDist, eFUnit ); - SetFieldUnit( aMtrFldHelplineOverhang, eFUnit ); - SetFieldUnit( aMtrFldHelplineDist, eFUnit ); - SetFieldUnit( aMtrFldHelpline1Len, eFUnit ); - SetFieldUnit( aMtrFldHelpline2Len, eFUnit ); - if( eFUnit == FUNIT_MM ) - { - aMtrFldLineDist.SetSpinSize( 50 ); - aMtrFldHelplineOverhang.SetSpinSize( 50 ); - aMtrFldHelplineDist.SetSpinSize( 50 ); - aMtrFldHelpline1Len.SetSpinSize( 50 ); - aMtrFldHelpline2Len.SetSpinSize( 50 ); - } - - aTsbAutoPosV.SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) ); - aTsbAutoPosH.SetClickHdl( LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl ) ); - - // set background and border of iconchoicectrl - const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); - aCtlPreview.SetBackground ( rStyles.GetWindowColor() ); - aCtlPreview.SetBorderStyle(WINDOW_BORDER_MONO); - - Link aLink( LINK( this, SvxMeasurePage, ChangeAttrHdl_Impl ) ); - aMtrFldLineDist.SetModifyHdl( aLink ); - aMtrFldHelplineOverhang.SetModifyHdl( aLink ); - aMtrFldHelplineDist.SetModifyHdl( aLink ); - aMtrFldHelpline1Len.SetModifyHdl( aLink ); - aMtrFldHelpline2Len.SetModifyHdl( aLink ); - aMtrFldDecimalPlaces.SetModifyHdl( aLink ); - aTsbBelowRefEdge.SetClickHdl( aLink ); - aTsbParallel.SetClickHdl( aLink ); - aTsbShowUnit.SetClickHdl( aLink ); - aLbUnit.SetSelectHdl( aLink ); - aLbUnit.SetAccessibleName(GetNonMnemonicString(aTsbShowUnit.GetText())); - aCtlPosition.SetAccessibleRelationMemberOf( &aFlLabel ); - aLbUnit.SetAccessibleRelationLabeledBy( &aTsbShowUnit ); -} - -/************************************************************************* -|* -|* Dtor -|* -\************************************************************************/ - -SvxMeasurePage::~SvxMeasurePage() -{ -} - -/************************************************************************* -|* -|* read the delivered Item-Set -|* -\************************************************************************/ - -void SvxMeasurePage::Reset( const SfxItemSet& rAttrs ) -{ - SfxItemPool* pPool = rAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - eUnit = pPool->GetMetric( SDRATTR_MEASURELINEDIST ); - - const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_MEASURELINEDIST ); - - // SdrMeasureLineDistItem - if( pItem == NULL ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASURELINEDIST ); - if( pItem ) - { - long nValue = ( ( const SdrMeasureLineDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldLineDist, nValue, eUnit ); - } - else - { - aMtrFldLineDist.SetText( String() ); - } - aMtrFldLineDist.SaveValue(); - - // SdrMeasureHelplineOverhangItem - pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEOVERHANG ); - if( pItem == NULL ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEOVERHANG ); - if( pItem ) - { - long nValue = ( ( const SdrMeasureHelplineOverhangItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHelplineOverhang, nValue, eUnit ); - } - else - { - aMtrFldHelplineOverhang.SetText( String() ); - } - aMtrFldHelplineOverhang.SaveValue(); - - // SdrMeasureHelplineDistItem - pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINEDIST ); - if( pItem == NULL ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINEDIST ); - if( pItem ) - { - long nValue = ( ( const SdrMeasureHelplineDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHelplineDist, nValue, eUnit ); - } - else - { - aMtrFldHelplineDist.SetText( String() ); - } - aMtrFldHelplineDist.SaveValue(); - - // SdrMeasureHelpline1LenItem - pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE1LEN ); - if( pItem == NULL ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE1LEN ); - if( pItem ) - { - long nValue = ( ( const SdrMeasureHelpline1LenItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHelpline1Len, nValue, eUnit ); - } - else - { - aMtrFldHelpline1Len.SetText( String() ); - } - aMtrFldHelpline1Len.SaveValue(); - - // SdrMeasureHelpline2LenItem - pItem = GetItem( rAttrs, SDRATTR_MEASUREHELPLINE2LEN ); - if( pItem == NULL ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREHELPLINE2LEN ); - if( pItem ) - { - long nValue = ( ( const SdrMeasureHelpline2LenItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldHelpline2Len, nValue, eUnit ); - } - else - { - aMtrFldHelpline2Len.SetText( String() ); - } - aMtrFldHelpline2Len.SaveValue(); - - // SdrMeasureBelowRefEdgeItem - if( rAttrs.GetItemState( SDRATTR_MEASUREBELOWREFEDGE ) != SFX_ITEM_DONTCARE ) - { - aTsbBelowRefEdge.SetState( ( ( const SdrMeasureBelowRefEdgeItem& )rAttrs.Get( SDRATTR_MEASUREBELOWREFEDGE ) ). - GetValue() ? STATE_CHECK : STATE_NOCHECK ); - aTsbBelowRefEdge.EnableTriState( sal_False ); - } - else - { - aTsbBelowRefEdge.SetState( STATE_DONTKNOW ); - } - aTsbBelowRefEdge.SaveValue(); - - // SdrMeasureDecimalPlacesItem - pItem = GetItem( rAttrs, SDRATTR_MEASUREDECIMALPLACES ); - if( pItem == NULL ) - pItem = &pPool->GetDefaultItem( SDRATTR_MEASUREDECIMALPLACES ); - if( pItem ) - { - sal_Int16 nValue = ( ( const SdrMeasureDecimalPlacesItem* )pItem )->GetValue(); - aMtrFldDecimalPlaces.SetValue( nValue ); - } - else - { - aMtrFldDecimalPlaces.SetText( String() ); - } - aMtrFldDecimalPlaces.SaveValue(); - - // SdrMeasureTextRota90Item - // Attention: negate ! - if( rAttrs.GetItemState( SDRATTR_MEASURETEXTROTA90 ) != SFX_ITEM_DONTCARE ) - { - aTsbParallel.SetState( ( ( const SdrMeasureTextRota90Item& )rAttrs.Get( SDRATTR_MEASURETEXTROTA90 ) ). - GetValue() ? STATE_NOCHECK : STATE_CHECK ); - aTsbParallel.EnableTriState( sal_False ); - } - else - { - aTsbParallel.SetState( STATE_DONTKNOW ); - } - aTsbParallel.SaveValue(); - - // SdrMeasureShowUnitItem - if( rAttrs.GetItemState( SDRATTR_MEASURESHOWUNIT ) != SFX_ITEM_DONTCARE ) - { - aTsbShowUnit.SetState( ( ( const SdrMeasureShowUnitItem& )rAttrs.Get( SDRATTR_MEASURESHOWUNIT ) ). - GetValue() ? STATE_CHECK : STATE_NOCHECK ); - aTsbShowUnit.EnableTriState( sal_False ); - } - else - { - aTsbShowUnit.SetState( STATE_DONTKNOW ); - } - aTsbShowUnit.SaveValue(); - - // SdrMeasureUnitItem - if( rAttrs.GetItemState( SDRATTR_MEASUREUNIT ) != SFX_ITEM_DONTCARE ) - { - long nFieldUnit = (long) ( ( const SdrMeasureUnitItem& )rAttrs. - Get( SDRATTR_MEASUREUNIT ) ).GetValue(); - - for( sal_uInt16 i = 0; i < aLbUnit.GetEntryCount(); ++i ) - { - if ( (long)aLbUnit.GetEntryData( i ) == nFieldUnit ) - { - aLbUnit.SelectEntryPos( i ); - break; - } - } - } - else - { - aLbUnit.SetNoSelection(); - } - aLbUnit.SaveValue(); - - // Position - if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE ) - { - SdrMeasureTextVPos eVPos = (SdrMeasureTextVPos) - ( ( const SdrMeasureTextVPosItem& )rAttrs.Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue(); - { - if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTHPOS ) != SFX_ITEM_DONTCARE ) - { - aTsbAutoPosV.EnableTriState( sal_False ); - aTsbAutoPosH.EnableTriState( sal_False ); - - SdrMeasureTextHPos eHPos = (SdrMeasureTextHPos) - ( ( const SdrMeasureTextHPosItem& )rAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue(); - RECT_POINT eRP = RP_MM; - switch( eVPos ) - { - case SDRMEASURE_ABOVE: - switch( eHPos ) - { - case SDRMEASURE_TEXTLEFTOUTSIDE: eRP = RP_LT; break; - case SDRMEASURE_TEXTINSIDE: eRP = RP_MT; break; - case SDRMEASURE_TEXTRIGHTOUTSIDE: eRP = RP_RT; break; - case SDRMEASURE_TEXTHAUTO: eRP = RP_MT; break; - } - break; - case SDRMEASURETEXT_VERTICALCENTERED: - switch( eHPos ) - { - case SDRMEASURE_TEXTLEFTOUTSIDE: eRP = RP_LM; break; - case SDRMEASURE_TEXTINSIDE: eRP = RP_MM; break; - case SDRMEASURE_TEXTRIGHTOUTSIDE: eRP = RP_RM; break; - case SDRMEASURE_TEXTHAUTO: eRP = RP_MM; break; - } - break; - case SDRMEASURE_BELOW: - switch( eHPos ) - { - case SDRMEASURE_TEXTLEFTOUTSIDE: eRP = RP_LB; break; - case SDRMEASURE_TEXTINSIDE: eRP = RP_MB; break; - case SDRMEASURE_TEXTRIGHTOUTSIDE: eRP = RP_RB; break; - case SDRMEASURE_TEXTHAUTO: eRP = RP_MB; break; - } - break; - case SDRMEASURE_TEXTVAUTO: - switch( eHPos ) - { - case SDRMEASURE_TEXTLEFTOUTSIDE: eRP = RP_LM; break; - case SDRMEASURE_TEXTINSIDE: eRP = RP_MM; break; - case SDRMEASURE_TEXTRIGHTOUTSIDE: eRP = RP_RM; break; - case SDRMEASURE_TEXTHAUTO: eRP = RP_MM; break; - } - break; - default: ;//prevent warning - } - - CTL_STATE nState = 0; - - if( eHPos == SDRMEASURE_TEXTHAUTO ) - { - aTsbAutoPosH.SetState( STATE_CHECK ); - nState = CS_NOHORZ; - } - - if( eVPos == SDRMEASURE_TEXTVAUTO ) - { - aTsbAutoPosV.SetState( STATE_CHECK ); - nState |= CS_NOVERT; - } - - aCtlPosition.SetState( nState ); - aCtlPosition.SetActualRP( eRP ); - } - } - } - else - { - aCtlPosition.Reset(); - aTsbAutoPosV.SetState( STATE_DONTKNOW ); - aTsbAutoPosH.SetState( STATE_DONTKNOW ); - } - - // put the attributes to the preview-control, - // otherwise the control don't know about - // the settings of the dialog (#67930) - ChangeAttrHdl_Impl( &aTsbShowUnit ); - aCtlPreview.SetAttributes( rAttrs ); - - bPositionModified = sal_False; -} - -/************************************************************************* -|* -|* Fill the delivered Item-Set with dialogbox-attributes -|* -\************************************************************************/ - -sal_Bool SvxMeasurePage::FillItemSet( SfxItemSet& rAttrs) -{ - sal_Bool bModified = sal_False; - sal_Int32 nValue; - TriState eState; - - if( aMtrFldLineDist.GetText() != aMtrFldLineDist.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldLineDist, eUnit ); - rAttrs.Put( SdrMeasureLineDistItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldHelplineOverhang.GetText() != aMtrFldHelplineOverhang.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldHelplineOverhang, eUnit ); - rAttrs.Put( SdrMeasureHelplineOverhangItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldHelplineDist.GetText() != aMtrFldHelplineDist.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldHelplineDist, eUnit ); - rAttrs.Put( SdrMeasureHelplineDistItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldHelpline1Len.GetText() != aMtrFldHelpline1Len.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldHelpline1Len, eUnit ); - rAttrs.Put( SdrMeasureHelpline1LenItem( nValue ) ); - bModified = sal_True; - } - - if( aMtrFldHelpline2Len.GetText() != aMtrFldHelpline2Len.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldHelpline2Len, eUnit ); - rAttrs.Put( SdrMeasureHelpline2LenItem( nValue ) ); - bModified = sal_True; - } - - eState = aTsbBelowRefEdge.GetState(); - if( eState != aTsbBelowRefEdge.GetSavedValue() ) - { - rAttrs.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) ); - bModified = sal_True; - } - - if( aMtrFldDecimalPlaces.GetText() != aMtrFldDecimalPlaces.GetSavedValue() ) - { - nValue = static_cast<sal_Int32>(aMtrFldDecimalPlaces.GetValue()); - rAttrs.Put( - SdrMeasureDecimalPlacesItem( - sal::static_int_cast< sal_Int16 >( nValue ) ) ); - bModified = sal_True; - } - - eState = aTsbParallel.GetState(); - if( eState != aTsbParallel.GetSavedValue() ) - { - rAttrs.Put( SdrMeasureTextRota90Item( (sal_Bool) STATE_NOCHECK == eState ) ); - bModified = sal_True; - } - - eState = aTsbShowUnit.GetState(); - if( eState != aTsbShowUnit.GetSavedValue() ) - { - rAttrs.Put( SdrMeasureShowUnitItem( (sal_Bool) STATE_CHECK == eState ) ); - bModified = sal_True; - } - - sal_uInt16 nPos = aLbUnit.GetSelectEntryPos(); - if( nPos != aLbUnit.GetSavedValue() ) - { - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - sal_uInt16 nFieldUnit = (sal_uInt16)(long)aLbUnit.GetEntryData( nPos ); - FieldUnit _eUnit = (FieldUnit) nFieldUnit; - rAttrs.Put( SdrMeasureUnitItem( _eUnit ) ); - bModified = sal_True; - } - } - - if( bPositionModified ) - { - // Position - SdrMeasureTextVPos eVPos, eOldVPos; - SdrMeasureTextHPos eHPos, eOldHPos; - - RECT_POINT eRP = aCtlPosition.GetActualRP(); - switch( eRP ) - { - default: - case RP_LT: eVPos = SDRMEASURE_ABOVE; - eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break; - case RP_LM: eVPos = SDRMEASURETEXT_VERTICALCENTERED; - eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break; - case RP_LB: eVPos = SDRMEASURE_BELOW; - eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break; - case RP_MT: eVPos = SDRMEASURE_ABOVE; - eHPos = SDRMEASURE_TEXTINSIDE; break; - case RP_MM: eVPos = SDRMEASURETEXT_VERTICALCENTERED; - eHPos = SDRMEASURE_TEXTINSIDE; break; - case RP_MB: eVPos = SDRMEASURE_BELOW; - eHPos = SDRMEASURE_TEXTINSIDE; break; - case RP_RT: eVPos = SDRMEASURE_ABOVE; - eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break; - case RP_RM: eVPos = SDRMEASURETEXT_VERTICALCENTERED; - eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break; - case RP_RB: eVPos = SDRMEASURE_BELOW; - eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break; - } - if( aTsbAutoPosH.GetState() == STATE_CHECK ) - eHPos = SDRMEASURE_TEXTHAUTO; - - if( aTsbAutoPosV.GetState() == STATE_CHECK ) - eVPos = SDRMEASURE_TEXTVAUTO; - - if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTVPOS ) != SFX_ITEM_DONTCARE ) - { - eOldVPos = (SdrMeasureTextVPos) - ( ( const SdrMeasureTextVPosItem& )rOutAttrs.Get( SDRATTR_MEASURETEXTVPOS ) ).GetValue(); - if( eOldVPos != eVPos ) - { - rAttrs.Put( SdrMeasureTextVPosItem( eVPos ) ); - bModified = sal_True; - } - } - else - { - rAttrs.Put( SdrMeasureTextVPosItem( eVPos ) ); - bModified = sal_True; - } - - if ( rAttrs.GetItemState( SDRATTR_MEASURETEXTHPOS ) != SFX_ITEM_DONTCARE ) - { - eOldHPos = (SdrMeasureTextHPos) - ( ( const SdrMeasureTextHPosItem& )rOutAttrs.Get( SDRATTR_MEASURETEXTHPOS ) ).GetValue(); - if( eOldHPos != eHPos ) - { - rAttrs.Put( SdrMeasureTextHPosItem( eHPos ) ); - bModified = sal_True; - } - } - else - { - rAttrs.Put( SdrMeasureTextHPosItem( eHPos ) ); - bModified = sal_True; - } - } - - return( bModified ); -} - -/************************************************************************* -|* -|* The View have to set at the measure-object to be able to notify -|* unit and floatingpoint-values -|* -\************************************************************************/ - -void SvxMeasurePage::Construct() -{ - DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" ); - - aCtlPreview.pMeasureObj->SetModel( pView->GetModel() ); - aCtlPreview.Invalidate(); -} - -/************************************************************************* -|* -|* create the tabpage -|* -\************************************************************************/ - -SfxTabPage* SvxMeasurePage::Create( Window* pWindow, - const SfxItemSet& rAttrs ) -{ - return( new SvxMeasurePage( pWindow, rAttrs ) ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -sal_uInt16* SvxMeasurePage::GetRanges() -{ - return( pRanges ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -void SvxMeasurePage::PointChanged( Window* pWindow, RECT_POINT /*eRP*/ ) -{ - ChangeAttrHdl_Impl( pWindow ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -IMPL_LINK( SvxMeasurePage, ClickAutoPosHdl_Impl, void *, p ) -{ - if( aTsbAutoPosH.GetState() == STATE_CHECK ) - { - switch( aCtlPosition.GetActualRP() ) - { - case RP_LT: - case RP_RT: - aCtlPosition.SetActualRP( RP_MT ); - break; - - case RP_LM: - case RP_RM: - aCtlPosition.SetActualRP( RP_MM ); - break; - - case RP_LB: - case RP_RB: - aCtlPosition.SetActualRP( RP_MB ); - break; - default: ;//prevent warning - } - } - if( aTsbAutoPosV.GetState() == STATE_CHECK ) - { - switch( aCtlPosition.GetActualRP() ) - { - case RP_LT: - case RP_LB: - aCtlPosition.SetActualRP( RP_LM ); - break; - - case RP_MT: - case RP_MB: - aCtlPosition.SetActualRP( RP_MM ); - break; - - case RP_RT: - case RP_RB: - aCtlPosition.SetActualRP( RP_RM ); - break; - default: ;//prevent warning - } - } - ChangeAttrHdl_Impl( p ); - - return( 0L ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p ) -{ - - if( p == &aMtrFldLineDist ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldLineDist, eUnit ); - aAttrSet.Put( SdrMeasureLineDistItem( nValue ) ); - } - - if( p == &aMtrFldHelplineOverhang ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldHelplineOverhang, eUnit ); - aAttrSet.Put( SdrMeasureHelplineOverhangItem( nValue) ); - } - - if( p == &aMtrFldHelplineDist ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldHelplineDist, eUnit ); - aAttrSet.Put( SdrMeasureHelplineDistItem( nValue) ); - } - - if( p == &aMtrFldHelpline1Len ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldHelpline1Len, eUnit ); - aAttrSet.Put( SdrMeasureHelpline1LenItem( nValue ) ); - } - - if( p == &aMtrFldHelpline2Len ) - { - sal_Int32 nValue = GetCoreValue( aMtrFldHelpline2Len, eUnit ); - aAttrSet.Put( SdrMeasureHelpline2LenItem( nValue ) ); - } - - if( p == &aTsbBelowRefEdge ) - { - TriState eState = aTsbBelowRefEdge.GetState(); - if( eState != STATE_DONTKNOW ) - aAttrSet.Put( SdrMeasureBelowRefEdgeItem( (sal_Bool) STATE_CHECK == eState ) ); - } - - if( p == &aMtrFldDecimalPlaces ) - { - sal_Int16 nValue = sal::static_int_cast< sal_Int16 >( - aMtrFldDecimalPlaces.GetValue() ); - aAttrSet.Put( SdrMeasureDecimalPlacesItem( nValue ) ); - } - - if( p == &aTsbParallel ) - { - TriState eState = aTsbParallel.GetState(); - if( eState != STATE_DONTKNOW ) - aAttrSet.Put( SdrMeasureTextRota90Item( (sal_Bool) !STATE_CHECK == eState ) ); - } - - if( p == &aTsbShowUnit ) - { - TriState eState = aTsbShowUnit.GetState(); - if( eState != STATE_DONTKNOW ) - aAttrSet.Put( SdrMeasureShowUnitItem( (sal_Bool) STATE_CHECK == eState ) ); - } - - if( p == &aLbUnit ) - { - sal_uInt16 nPos = aLbUnit.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - sal_uInt16 nFieldUnit = (sal_uInt16)(long)aLbUnit.GetEntryData( nPos ); - FieldUnit _eUnit = (FieldUnit) nFieldUnit; - aAttrSet.Put( SdrMeasureUnitItem( _eUnit ) ); - } - } - - if( p == &aTsbAutoPosV || p == &aTsbAutoPosH || p == &aCtlPosition ) - { - bPositionModified = sal_True; - - // Position - RECT_POINT eRP = aCtlPosition.GetActualRP(); - SdrMeasureTextVPos eVPos; - SdrMeasureTextHPos eHPos; - - switch( eRP ) - { - default: - case RP_LT: eVPos = SDRMEASURE_ABOVE; - eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break; - case RP_LM: eVPos = SDRMEASURETEXT_VERTICALCENTERED; - eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break; - case RP_LB: eVPos = SDRMEASURE_BELOW; - eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break; - case RP_MT: eVPos = SDRMEASURE_ABOVE; - eHPos = SDRMEASURE_TEXTINSIDE; break; - case RP_MM: eVPos = SDRMEASURETEXT_VERTICALCENTERED; - eHPos = SDRMEASURE_TEXTINSIDE; break; - case RP_MB: eVPos = SDRMEASURE_BELOW; - eHPos = SDRMEASURE_TEXTINSIDE; break; - case RP_RT: eVPos = SDRMEASURE_ABOVE; - eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break; - case RP_RM: eVPos = SDRMEASURETEXT_VERTICALCENTERED; - eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break; - case RP_RB: eVPos = SDRMEASURE_BELOW; - eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break; - } - - CTL_STATE nState = 0; - - if( aTsbAutoPosH.GetState() == STATE_CHECK ) - { - eHPos = SDRMEASURE_TEXTHAUTO; - nState = CS_NOHORZ; - } - - if( aTsbAutoPosV.GetState() == STATE_CHECK ) - { - eVPos = SDRMEASURE_TEXTVAUTO; - nState |= CS_NOVERT; - } - - if( p == &aTsbAutoPosV || p == &aTsbAutoPosH ) - aCtlPosition.SetState( nState ); - - aAttrSet.Put( SdrMeasureTextVPosItem( eVPos ) ); - aAttrSet.Put( SdrMeasureTextHPosItem( eHPos ) ); - } - - aCtlPreview.SetAttributes( aAttrSet ); - aCtlPreview.Invalidate(); - - return( 0L ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -void SvxMeasurePage::FillUnitLB() -{ - // fill ListBox with metrics - SvxStringArray aMetricArr( SVX_RES( RID_SVXSTR_FIELDUNIT_TABLE ) ); - - long nUnit = FUNIT_NONE; - String aStrMetric( CUI_RES( STR_MEASURE_AUTOMATIC ) ); - sal_uInt16 nPos = aLbUnit.InsertEntry( aStrMetric ); - aLbUnit.SetEntryData( nPos, (void*)nUnit ); - - for( sal_uInt16 i = 0; i < aMetricArr.Count(); ++i ) - { - aStrMetric = aMetricArr.GetStringByPos( i ); - nUnit = aMetricArr.GetValue( i ); - nPos = aLbUnit.InsertEntry( aStrMetric ); - aLbUnit.SetEntryData( nPos, (void*)nUnit ); - } -} -void SvxMeasurePage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pOfaPtrItem,OfaPtrItem,SID_OBJECT_LIST,sal_False); - - if (pOfaPtrItem) - SetView( static_cast<SdrView *>(pOfaPtrItem->GetValue())); - - Construct(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/measure.hrc b/cui/source/tabpages/measure.hrc deleted file mode 100644 index 0229ca775..000000000 --- a/cui/source/tabpages/measure.hrc +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#define FL_LINE 1 -#define FL_LABEL 2 -#define FL_VERT 3 - -#define FT_LINE_DIST 1 -#define FT_HELPLINE_OVERHANG 2 -#define FT_HELPLINE_DIST 3 -#define FT_HELPLINE1_LEN 4 -#define FT_HELPLINE2_LEN 5 -#define FT_POSITION 6 -#define FT_DECIMALPLACES 7 -#define MTR_LINE_DIST 1 -#define MTR_FLD_HELPLINE_OVERHANG 2 -#define MTR_FLD_HELPLINE_DIST 3 -#define MTR_FLD_HELPLINE1_LEN 4 -#define MTR_FLD_HELPLINE2_LEN 5 -#define MTR_FLD_DECIMALPLACES 6 -#define TSB_BELOW_REF_EDGE 1 -#define TSB_SHOW_UNIT 2 -#define TSB_AUTOPOSV 3 -#define TSB_AUTOPOSH 4 -#define TSB_PARALLEL 5 -#define CTL_POSITION 1 -#define CTL_PREVIEW 2 -#define LB_UNIT 1 - -#define STR_MEASURE_AUTOMATIC 1 diff --git a/cui/source/tabpages/measure.src b/cui/source/tabpages/measure.src deleted file mode 100644 index 52bf76a58..000000000 --- a/cui/source/tabpages/measure.src +++ /dev/null @@ -1,321 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <cuires.hrc> -#include "measure.hrc" -#include "helpid.hrc" -#include <svx/dialogs.hrc> - -#define DELTA 20 - // pragma ---------------------------------------------------------------- - - // RID_SVXPAGE_MEASURE --------------------------------------------------- -TabPage RID_SVXPAGE_MEASURE -{ - HelpId = HID_PAGE_MEASURE ; - Hide = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Text [ en-US ] = "Dimensioning" ; - - FixedLine FL_LINE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "Line"; - }; - FixedText FT_LINE_DIST - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "Line ~distance" ; - }; - MetricField MTR_LINE_DIST - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_LINE_DIST"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 14 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedText FT_HELPLINE_OVERHANG - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "Guide ~overhang" ; - }; - MetricField MTR_FLD_HELPLINE_OVERHANG - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_HELPLINE_OVERHANG"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 30 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedText FT_HELPLINE_DIST - { - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "~Guide distance" ; - }; - MetricField MTR_FLD_HELPLINE_DIST - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_HELPLINE_DIST"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 46 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedText FT_HELPLINE1_LEN - { - Pos = MAP_APPFONT ( 12 , 64 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "~Left guide" ; - }; - MetricField MTR_FLD_HELPLINE1_LEN - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_HELPLINE1_LEN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 62 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedText FT_HELPLINE2_LEN - { - Pos = MAP_APPFONT ( 12 , 80 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - Text [ en-US ] = "~Right guide" ; - }; - MetricField MTR_FLD_HELPLINE2_LEN - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_HELPLINE2_LEN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 78 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_MM ; - DecimalDigits = 2 ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - TriStateBox TSB_BELOW_REF_EDGE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_BELOW_REF_EDGE"; - Pos = MAP_APPFONT ( 12 , 96 ) ; - Size = MAP_APPFONT ( 108 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Measure ~below object"; - }; - FixedText FT_DECIMALPLACES - { - Pos = MAP_APPFONT ( 12 , 112 ) ; - Size = MAP_APPFONT ( 65 , 8 ) ; - - Text [ en-US ] = "Decimal places" ; - }; - MetricField MTR_FLD_DECIMALPLACES - { - HelpID = "cui:MetricField:RID_SVXPAGE_MEASURE:MTR_FLD_DECIMALPLACES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 78 , 110 ) ; - Size = MAP_APPFONT ( 42 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 99 ; - StrictFormat = TRUE ; - Last = 99 ; - SpinSize = 1 ; - }; - FixedLine FL_VERT - { - Pos = MAP_APPFONT ( 127 , 14 ) ; - Size = MAP_APPFONT ( 4 , 108 ) ; - Vert = TRUE ; - }; - FixedLine FL_LABEL - { - Pos = MAP_APPFONT ( 132 , 3 ) ; - Size = MAP_APPFONT ( 122 , 8 ) ; - Text [ en-US ] = "Legend"; - }; - FixedText FT_POSITION - { - Pos = MAP_APPFONT ( 138 , 14 ) ; - Size = MAP_APPFONT ( 110 , 8 ) ; - Text [ en-US ] = "~Text position" ; - }; - Control CTL_POSITION - { - HelpId = HID_MEASURE_CTL_POSITION ; - Border = TRUE ; - Pos = MAP_APPFONT ( 154 , 25 ) ; - Size = MAP_APPFONT ( 60 , 24 ) ; - TabStop = TRUE ; - }; - TriStateBox TSB_AUTOPOSV - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_AUTOPOSV"; - Pos = MAP_APPFONT ( 154 , 54 ) ; - Size = MAP_APPFONT ( 101 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~AutoVertical" ; - }; - TriStateBox TSB_AUTOPOSH - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_AUTOPOSH"; - Pos = MAP_APPFONT ( 154 , 68 ) ; - Size = MAP_APPFONT ( 101 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "A~utoHorizontal" ; - }; - TriStateBox TSB_PARALLEL - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_PARALLEL"; - Pos = MAP_APPFONT ( 138 , 82 ) ; - Size = MAP_APPFONT ( 110 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Parallel to line"; - }; - TriStateBox TSB_SHOW_UNIT - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_MEASURE:TSB_SHOW_UNIT"; - Pos = MAP_APPFONT ( 138 , 96 ) ; - Size = MAP_APPFONT ( 64+40 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Show ~meas. units" ; - }; - ListBox LB_UNIT - { - HelpID = "cui:ListBox:RID_SVXPAGE_MEASURE:LB_UNIT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 154 , 110 ) ; - Size = MAP_APPFONT ( 60 , 80+35 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - Control CTL_PREVIEW - { - HelpId = HID_MEASURE_CTL_PREVIEW ; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 132 ) ; - Size = MAP_APPFONT ( 248 , 47 ) ; - }; - String STR_MEASURE_AUTOMATIC - { - Text [ en-US ] = "Automatic" ; - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx deleted file mode 100644 index b92831e41..000000000 --- a/cui/source/tabpages/numfmt.cxx +++ /dev/null @@ -1,1849 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <svl/eitem.hxx> -#include <svl/intitem.hxx> -#include <sfx2/objsh.hxx> -#include <vcl/svapp.hxx> -#include <unotools/localedatawrapper.hxx> -#include <i18npool/lang.h> -#include <svx/dialogs.hrc> -#define _SVSTDARR_STRINGS -#define _SVSTDARR_STRINGSDTOR -#include <svl/svstdarr.hxx> -#include <svtools/colorcfg.hxx> - -#define _SVX_NUMFMT_CXX - -#include <cuires.hrc> -#include "numfmt.hrc" - -#include <svx/numinf.hxx> - -#include "numfmt.hxx" -#include <svx/numfmtsh.hxx> -#include <dialmgr.hxx> -#include <sfx2/request.hxx> -#include <sfx2/app.hxx> -#include <sfx2/basedlgs.hxx> -#include "svx/flagsdef.hxx" - -#define NUMKEY_UNDEFINED SAL_MAX_UINT32 - -// static ---------------------------------------------------------------- - -static sal_uInt16 pRanges[] = -{ - SID_ATTR_NUMBERFORMAT_VALUE, - SID_ATTR_NUMBERFORMAT_INFO, - SID_ATTR_NUMBERFORMAT_NOLANGUAGE, - SID_ATTR_NUMBERFORMAT_NOLANGUAGE, - SID_ATTR_NUMBERFORMAT_ONE_AREA, - SID_ATTR_NUMBERFORMAT_ONE_AREA, - SID_ATTR_NUMBERFORMAT_SOURCE, - SID_ATTR_NUMBERFORMAT_SOURCE, - 0 -}; - -/************************************************************************* -#* Methode: SvxNumberPreviewImpl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberPreview -#* Funktion: Konstruktor der Klasse SvxNumberPreviewImpl -#* Input: Fenster, Resource-ID -#* Output: --- -#* -#************************************************************************/ - -SvxNumberPreviewImpl::SvxNumberPreviewImpl( Window* pParent, const ResId& rResId ) : - - Window( pParent, rResId ) - -{ - Font aFont( GetFont() ); - aFont.SetTransparent( sal_True ); - aFont.SetColor( Application::GetSettings().GetStyleSettings().GetFieldColor() ); - SetFont( aFont ); - InitSettings( sal_True, sal_True ); - SetBorderStyle( WINDOW_BORDER_MONO ); -} - -/************************************************************************* -#* Methode: SvxNumberPreviewImpl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberPreview -#* Funktion: Destruktor der Klasse SvxNumberPreviewImpl -#* Input: --- -#* Output: --- -#* -#************************************************************************/ - -SvxNumberPreviewImpl::~SvxNumberPreviewImpl() -{ -} - -/************************************************************************* -#* Methode: NotifyChange -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberPreviewImpl -#* Funktion: Funktion fuer das Aendern des Preview- Strings -#* Input: String, Farbe -#* Output: --- -#* -#************************************************************************/ - -void SvxNumberPreviewImpl::NotifyChange( const String& rPrevStr, - const Color* pColor ) -{ - aPrevStr = rPrevStr; - svtools::ColorConfig aColorConfig; - Color aWindowTextColor( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor ); - aPrevCol = pColor ? *pColor : aWindowTextColor; - Invalidate(); - Update(); -} - -/************************************************************************* -#* Methode: Paint -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberPreviewImpl -#* Funktion: Funktion fuer das neu zeichnen des Fensters. -#* Input: --- -#* Output: --- -#* -#************************************************************************/ - -void SvxNumberPreviewImpl::Paint( const Rectangle& ) -{ - Font aDrawFont = GetFont(); - Size aSzWnd = GetOutputSizePixel(); - Point aPosText = Point( (aSzWnd.Width() - GetTextWidth( aPrevStr )) /2, - (aSzWnd.Height() - GetTextHeight())/2 ); - - aDrawFont.SetColor( aPrevCol ); - SetFont( aDrawFont ); - DrawText( aPosText, aPrevStr ); -} - -// ----------------------------------------------------------------------- - -void SvxNumberPreviewImpl::InitSettings( sal_Bool bForeground, sal_Bool bBackground ) -{ - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - - if ( bForeground ) - { - svtools::ColorConfig aColorConfig; - Color aTextColor( aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor ); - - if ( IsControlForeground() ) - aTextColor = GetControlForeground(); - SetTextColor( aTextColor ); - } - - if ( bBackground ) - { - if ( IsControlBackground() ) - SetBackground( GetControlBackground() ); - else - SetBackground( rStyleSettings.GetWindowColor() ); - } - Invalidate(); -} - -// ----------------------------------------------------------------------- - -void SvxNumberPreviewImpl::StateChanged( StateChangedType nType ) -{ - if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) - InitSettings( sal_True, sal_False ); - else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) - InitSettings( sal_False, sal_True ); - - Window::StateChanged( nType ); -} - -// ----------------------------------------------------------------------- - -void SvxNumberPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt ) -{ - Window::DataChanged( rDCEvt ); - - if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) ) - InitSettings( sal_True, sal_True ); -} - -// class SvxNumberFormatTabPage ------------------------------------------ - -#define REMOVE_DONTKNOW() \ - if ( !aFtLanguage.IsEnabled() ) \ - { \ - aFtLanguage .Enable(); \ - aLbLanguage .Enable(); \ - aLbLanguage .SelectLanguage( pNumFmtShell->GetCurLanguage() ); \ - } - -#define HDL(hdl) LINK( this, SvxNumberFormatTabPage, hdl ) - -#include <layout/layout-pre.hxx> - -#if ENABLE_LAYOUT -#undef CUI_RES -#define CUI_RES(x) #x -#define CUI_RES_PLAIN(x) ResId (x, CUI_MGR ()) -#define THIS_CUI_RES(x) this, #x -#undef SfxTabPage -#define SfxTabPage( parent, id, args ) SfxTabPage( parent, "number-format.xml", id, &args ) -#else /* !ENABLE_LAYOUT */ -#define CUI_RES_PLAIN CUI_RES -#define THIS_CUI_RES CUI_RES -#endif /* !ENABLE_LAYOUT */ - -SvxNumberFormatTabPage::SvxNumberFormatTabPage( Window* pParent, - const SfxItemSet& rCoreAttrs ) - - : SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_NUMBERFORMAT ), rCoreAttrs ), - - aFtCategory ( this, CUI_RES( FT_CATEGORY ) ), - aLbCategory ( this, CUI_RES( LB_CATEGORY ) ), - aFtFormat ( this, CUI_RES( FT_FORMAT ) ), - aLbCurrency ( this, CUI_RES( LB_CURRENCY) ), - aLbFormat ( this, CUI_RES( LB_FORMAT ) ), - aFtLanguage ( this, CUI_RES( FT_LANGUAGE ) ), - aLbLanguage ( this, CUI_RES( LB_LANGUAGE ), sal_False ), - aCbSourceFormat ( this, CUI_RES( CB_SOURCEFORMAT ) ), -#if ENABLE_LAYOUT - aWndPreview ( LAYOUT_THIS_WINDOW(this), CUI_RES_PLAIN( WND_NUMBER_PREVIEW ) ), -#else - aWndPreview ( this, CUI_RES_PLAIN( WND_NUMBER_PREVIEW ) ), -#endif - aFlOptions ( this, CUI_RES( FL_OPTIONS ) ), - aFtDecimals ( this, CUI_RES( FT_DECIMALS ) ), - aEdDecimals ( this, CUI_RES( ED_DECIMALS ) ), - aBtnNegRed ( this, CUI_RES( BTN_NEGRED ) ), - aFtLeadZeroes ( this, CUI_RES( FT_LEADZEROES ) ), - aEdLeadZeroes ( this, CUI_RES( ED_LEADZEROES ) ), - aBtnThousand ( this, CUI_RES( BTN_THOUSAND ) ), - - aFtEdFormat ( this, CUI_RES( FT_EDFORMAT ) ), - aEdFormat ( this, CUI_RES( ED_FORMAT ) ), - aIbAdd ( this, CUI_RES( IB_ADD ) ), - aIbInfo ( this, CUI_RES( IB_INFO ) ), - aIbRemove ( this, CUI_RES( IB_REMOVE ) ), - aFtComment ( this, CUI_RES( FT_COMMENT ) ), - aEdComment ( this, CUI_RES( ED_COMMENT ) ), - - pNumItem ( NULL ), - pNumFmtShell ( NULL ), - nInitFormat ( ULONG_MAX ), - - sAutomaticEntry ( THIS_CUI_RES( STR_AUTO_ENTRY)), - pLastActivWindow( NULL ) -{ -#if ENABLE_LAYOUT - aLbFormat.Clear (); -#endif /* ENABLE_LAYOUT */ - - Init_Impl(); - SetExchangeSupport(); // diese Page braucht ExchangeSupport - FreeResource(); - nFixedCategory=-1; -} - -SvxNumberFormatTabPage::~SvxNumberFormatTabPage() -{ - delete pNumFmtShell; - delete pNumItem; -} - -void SvxNumberFormatTabPage::Init_Impl() -{ - ImageList aIconList( CUI_RES_PLAIN ( IL_ICON ) ); - - bNumItemFlag=sal_True; - bOneAreaFlag=sal_False; - - nCatHeight=aLbCategory.GetSizePixel().Height(); - - nCurFormatY =aLbFormat.GetPosPixel().Y(); - nCurFormatHeight=aLbFormat.GetSizePixel().Height(); - nStdFormatY =aLbCurrency.GetPosPixel().Y(); - nStdFormatHeight=nCurFormatY-nStdFormatY+nCurFormatHeight; - - aIbAdd. SetModeImage( aIconList.GetImage( IID_ADD ) ); - aIbRemove. SetModeImage( aIconList.GetImage( IID_REMOVE ) ); - aIbInfo. SetModeImage( aIconList.GetImage( IID_INFO ) ); - - aIbAdd.Enable(sal_False ); - aIbRemove.Enable(sal_False ); - aIbInfo.Enable(sal_False ); - - aEdComment.SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert - //holen - aEdComment.Hide(); - - aCbSourceFormat.Check( sal_False ); - aCbSourceFormat.Disable(); - aCbSourceFormat.Hide(); - -// Handler verbinden - Link aLink = LINK( this, SvxNumberFormatTabPage, SelFormatHdl_Impl ); - - aLbCategory .SetSelectHdl( aLink ); - aLbFormat .SetSelectHdl( aLink ); - aLbLanguage .SetSelectHdl( aLink ); - aLbCurrency .SetSelectHdl( aLink ); - aCbSourceFormat .SetClickHdl( aLink ); - - aLink = LINK( this, SvxNumberFormatTabPage, OptHdl_Impl ); - - aEdDecimals .SetModifyHdl( aLink ); - aEdLeadZeroes .SetModifyHdl( aLink ); - aBtnNegRed .SetClickHdl( aLink ); - aBtnThousand .SetClickHdl( aLink ); - aLbFormat .SetDoubleClickHdl( HDL( DoubleClickHdl_Impl ) ); - aEdFormat .SetModifyHdl( HDL( EditHdl_Impl ) ); - aIbAdd.SetClickHdl( HDL( ClickHdl_Impl ) ); - aIbRemove.SetClickHdl( HDL( ClickHdl_Impl ) ); - aIbInfo.SetClickHdl( HDL( ClickHdl_Impl ) ); - - aLink = LINK( this, SvxNumberFormatTabPage, LostFocusHdl_Impl); - - aEdComment .SetLoseFocusHdl( aLink); - aResetWinTimer .SetTimeoutHdl(LINK( this, SvxNumberFormatTabPage, TimeHdl_Impl)); - aResetWinTimer .SetTimeout( 10); - - // Sprachen-ListBox initialisieren - - aLbLanguage.InsertLanguage( LANGUAGE_SYSTEM ); - // Don't list ambiguous locales where we won't be able to convert the - // LanguageType back to an identical Language_Country name and therefore - // couldn't load the i18n LocaleData. Show DebugMsg in non-PRODUCT version. - ::com::sun::star::uno::Sequence< sal_uInt16 > xLang = - LocaleDataWrapper::getInstalledLanguageTypes(); - sal_Int32 nCount = xLang.getLength(); - for ( sal_Int32 i=0; i<nCount; i++ ) - { - aLbLanguage.InsertLanguage( xLang[i] ); - } - - aIbAdd.SetAccessibleRelationLabeledBy( &aFtEdFormat ); - aIbInfo.SetAccessibleRelationLabeledBy( &aFtEdFormat ); - aIbRemove.SetAccessibleRelationLabeledBy( &aFtEdFormat ); - aIbAdd.SetAccessibleRelationMemberOf( &aIbAdd ); - aIbInfo.SetAccessibleRelationMemberOf( &aIbInfo ); - aIbRemove.SetAccessibleRelationMemberOf( &aIbRemove ); -} - -/************************************************************************* -#* Methode: GetRanges -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Liefert Bereichsangaben zurueck. -#* Input: --- -#* Output: Bereich -#* -#************************************************************************/ - -sal_uInt16* SvxNumberFormatTabPage::GetRanges() -{ - return pRanges; -} - - -/************************************************************************* -#* Methode: Create -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Erzeugt eine neue Zahlenformat- Seite. -#* Input: Fenster, SfxItemSet -#* Output: neue TabPage -#* -#************************************************************************/ - -SfxTabPage* SvxNumberFormatTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet ) -{ - return ( new SvxNumberFormatTabPage( pParent, rAttrSet ) ); -} - - -/************************************************************************* -#* Methode: Reset -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Die Attribute des Dialogs werden mit Hilfe -#* des Itemsets neu eingestellt. -#* Input: SfxItemSet -#* Output: --- -#* -#************************************************************************/ - -void SvxNumberFormatTabPage::Reset( const SfxItemSet& rSet ) -{ - const SfxUInt32Item* pValFmtAttr = NULL; - const SfxPoolItem* pItem = NULL; - const SfxBoolItem* pAutoEntryAttr = NULL; - - sal_uInt16 nCatLbSelPos = 0; - sal_uInt16 nFmtLbSelPos = 0; - LanguageType eLangType = LANGUAGE_DONTKNOW; - SvxDelStrgs aFmtEntryList; - SvxNumberValueType eValType = SVX_VALUE_TYPE_UNDEFINED; - double nValDouble = 0; - String aValString; - SfxItemState eState = SFX_ITEM_DONTCARE; - - - eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_NOLANGUAGE ),sal_True,&pItem); - - if(eState==SFX_ITEM_SET) - { - const SfxBoolItem* pBoolLangItem = (const SfxBoolItem*) - GetItem( rSet, SID_ATTR_NUMBERFORMAT_NOLANGUAGE); - - if(pBoolLangItem!=NULL && pBoolLangItem->GetValue()) - { - HideLanguage(); - } - else - { - HideLanguage(sal_False); - } - - } - - eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_INFO ),sal_True,&pItem); - - if(eState==SFX_ITEM_SET) - { - if(pNumItem==NULL) - { - bNumItemFlag=sal_True; - pNumItem= (SvxNumberInfoItem *) pItem->Clone(); - } - else - { - bNumItemFlag=sal_False; - } - } - else - { - bNumItemFlag=sal_False; - } - - - eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_ONE_AREA )); - - if(eState==SFX_ITEM_SET) - { - const SfxBoolItem* pBoolItem = (const SfxBoolItem*) - GetItem( rSet, SID_ATTR_NUMBERFORMAT_ONE_AREA); - - if(pBoolItem!=NULL) - { - bOneAreaFlag= pBoolItem->GetValue(); - } - } - - eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_SOURCE ) ); - - if ( eState == SFX_ITEM_SET ) - { - const SfxBoolItem* pBoolItem = (const SfxBoolItem*) - GetItem( rSet, SID_ATTR_NUMBERFORMAT_SOURCE ); - if ( pBoolItem ) - aCbSourceFormat.Check( pBoolItem->GetValue() ); - else - aCbSourceFormat.Check( sal_False ); - aCbSourceFormat.Enable(); - aCbSourceFormat.Show(); - } - else - { - sal_Bool bInit = sal_False; // set to sal_True for debug test - aCbSourceFormat.Check( bInit ); - aCbSourceFormat.Enable( bInit ); - aCbSourceFormat.Show( bInit ); - } - - // pNumItem muss von aussen gesetzt worden sein! - DBG_ASSERT( pNumItem, "No NumberInfo, no NumberFormatter, good bye.CRASH. :-(" ); - - // aktuellen Zahlenformat-Tabellenindex holen - eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_VALUE ) ); - - if ( SFX_ITEM_DONTCARE != eState ) - pValFmtAttr = (const SfxUInt32Item*) - GetItem( rSet, SID_ATTR_NUMBERFORMAT_VALUE ); - - eValType = pNumItem->GetValueType(); - - switch ( eValType ) - { - case SVX_VALUE_TYPE_STRING: - aValString = pNumItem->GetValueString(); - break; - case SVX_VALUE_TYPE_NUMBER: - // #50441# string may be set in addition to the value - aValString = pNumItem->GetValueString(); - nValDouble = pNumItem->GetValueDouble(); - break; - case SVX_VALUE_TYPE_UNDEFINED: - default: - break; - } - - // nun sind alle Informationen fuer die Formatierer-Shell beisammen: - - if ( pNumFmtShell ) - delete pNumFmtShell; // ggF. alte Shell loeschen (==Reset) - - nInitFormat = ( pValFmtAttr ) // Init-Key merken - ? pValFmtAttr->GetValue() // (fuer FillItemSet()) - : ULONG_MAX; // == DONT_KNOW - - - if ( eValType == SVX_VALUE_TYPE_STRING ) - pNumFmtShell =SvxNumberFormatShell::Create( - pNumItem->GetNumberFormatter(), - (pValFmtAttr) ? nInitFormat : 0L, - eValType, - aValString ); - else - pNumFmtShell =SvxNumberFormatShell::Create( - pNumItem->GetNumberFormatter(), - (pValFmtAttr) ? nInitFormat : 0L, - eValType, - nValDouble, - &aValString ); - - FillCurrencyBox(); - - String aPrevString; - Color* pDummy = NULL; - pNumFmtShell->GetInitSettings( nCatLbSelPos, eLangType, nFmtLbSelPos, - aFmtEntryList, aPrevString, pDummy ); - - aLbCurrency.SelectEntryPos((sal_uInt16)pNumFmtShell->GetCurrencySymbol()); - - nFixedCategory=nCatLbSelPos; - if(bOneAreaFlag) - { - String sFixedCategory=aLbCategory.GetEntry(nFixedCategory); - aLbCategory.Clear(); - aLbCategory.InsertEntry(sFixedCategory); - SetCategory(0); - } - else - { - SetCategory(nCatLbSelPos ); - } - eState = rSet.GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_ADD_AUTO ) ); - if(SFX_ITEM_SET == eState) - pAutoEntryAttr = (const SfxBoolItem*) - GetItem( rSet, SID_ATTR_NUMBERFORMAT_ADD_AUTO ); - // no_NO is an alias for nb_NO and normally isn't listed, we need it for - // backwards compatibility, but only if the format passed is of - // LanguageType no_NO. - if ( eLangType == LANGUAGE_NORWEGIAN ) - { - aLbLanguage.RemoveLanguage( eLangType ); // in case we're already called - aLbLanguage.InsertLanguage( eLangType ); - } - aLbLanguage.SelectLanguage( eLangType ); - if(pAutoEntryAttr) - AddAutomaticLanguage_Impl(eLangType, pAutoEntryAttr->GetValue()); - UpdateFormatListBox_Impl(sal_False,sal_True); - -//! This spoils everything because it rematches currency formats based on -//! the selected aLbCurrency entry instead of the current format. -//! Besides that everything seems to be initialized by now, so why call it? -// SelFormatHdl_Impl( &aLbCategory ); - - if ( pValFmtAttr ) - { - EditHdl_Impl( &aEdFormat ); // UpdateOptions_Impl() als Seiteneffekt - } - else // DONT_KNOW - { - // Kategoriewechsel und direkte Eingabe sind moeglich, sonst nix: - Obstructing(); - } - - if ( aCbSourceFormat.IsChecked() ) - { - // everything disabled except SourceFormat checkbox - EnableBySourceFormat_Impl(); - } - - DeleteEntryList_Impl(aFmtEntryList); -} - -/************************************************************************* -#* Methode: Obstructing -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Sperren der Controls mit Ausnahme von Kategoriewechsel -#* und direkter Eingabe. -#* Input: --- -#* Output: --- -#* -#************************************************************************/ -void SvxNumberFormatTabPage::Obstructing() -{ - aLbFormat .SetNoSelection(); - aLbLanguage .SetNoSelection(); - aFtLanguage .Disable(); - aLbLanguage .Disable(); - - aIbAdd.Enable(sal_False ); - aIbRemove.Enable(sal_False ); - aIbInfo.Enable(sal_False ); - - aBtnNegRed .Disable(); - aBtnThousand .Disable(); - aFtLeadZeroes .Disable(); - aFtDecimals .Disable(); - aEdLeadZeroes .Disable(); - aEdDecimals .Disable(); - aFlOptions .Disable(); - aEdDecimals .SetText( String() ); - aEdLeadZeroes .SetText( String() ); - aBtnNegRed .Check( sal_False ); - aBtnThousand .Check( sal_False ); - aWndPreview .NotifyChange( String() ); - - aLbCategory .SelectEntryPos( 0 ); - aEdFormat .SetText( String() ); - aFtComment .SetText( String() ); - aEdComment .SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert - //holen - - aEdFormat .GrabFocus(); -} - - -/************************************************************************* -#* Enable/Disable dialog parts depending on the value of the SourceFormat -#* checkbox. -#************************************************************************/ -void SvxNumberFormatTabPage::EnableBySourceFormat_Impl() -{ - sal_Bool bEnable = !aCbSourceFormat.IsChecked(); - if ( !bEnable ) - aCbSourceFormat.GrabFocus(); - aFtCategory .Enable( bEnable ); - aLbCategory .Enable( bEnable ); - aFtFormat .Enable( bEnable ); - aLbCurrency .Enable( bEnable ); - aLbFormat .Enable( bEnable ); - aFtLanguage .Enable( bEnable ); - aLbLanguage .Enable( bEnable ); - aFtDecimals .Enable( bEnable ); - aEdDecimals .Enable( bEnable ); - aFtLeadZeroes .Enable( bEnable ); - aEdLeadZeroes .Enable( bEnable ); - aBtnNegRed .Enable( bEnable ); - aBtnThousand .Enable( bEnable ); - aFlOptions .Enable( bEnable ); - aFtEdFormat .Enable( bEnable ); - aEdFormat .Enable( bEnable ); - aIbAdd .Enable( bEnable ); - aIbRemove .Enable( bEnable ); - aIbInfo .Enable( bEnable ); - aFtComment .Enable( bEnable ); - aEdComment .Enable( bEnable ); - aLbFormat.Invalidate(); // #i43322# -} - - -/************************************************************************* -#* Methode: HideLanguage -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Versteckt die Spracheinstellung: -#* Input: sal_Bool nFlag -#* Output: --- -#* -#************************************************************************/ - -void SvxNumberFormatTabPage::HideLanguage(sal_Bool nFlag) -{ - Size aSize=aLbCategory.GetSizePixel(); - - if(nFlag) - { - aSize.Height()=aLbFormat.GetSizePixel().Height(); - } - else - { - aSize.Height()=nCatHeight; - } - - aLbCategory.SetSizePixel(aSize); - - aFtLanguage.Show(!nFlag); - aLbLanguage.Show(!nFlag); -} - -/************************************************************************* -#* Methode: FillItemSet -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Stellt die Attribute im ItemSet ein, -#* sowie in der DocShell den numItem, wenn -#* bNumItemFlag nicht gesetzt ist. -#* Input: SfxItemSet -#* Output: --- -#* -#************************************************************************/ - -sal_Bool SvxNumberFormatTabPage::FillItemSet( SfxItemSet& rCoreAttrs ) -{ - sal_Bool bDataChanged = aFtLanguage.IsEnabled() || aCbSourceFormat.IsEnabled(); - if ( bDataChanged ) - { - const SfxItemSet& rMyItemSet = GetItemSet(); - sal_uInt16 nWhich = GetWhich( SID_ATTR_NUMBERFORMAT_VALUE ); - SfxItemState eItemState = rMyItemSet.GetItemState( nWhich, sal_False ); - - // OK chosen - Is format code input entered already taken over? - // If not, simulate Add. Upon syntax error ignore input and prevent Put. - String aFormat = aEdFormat.GetText(); - sal_uInt32 nCurKey = pNumFmtShell->GetCurNumFmtKey(); - - if ( aIbAdd.IsEnabled() || pNumFmtShell->IsTmpCurrencyFormat(aFormat) ) - { // #79599# It is not sufficient to just add the format code (or - // delete it in case of bOneAreaFlag and resulting category change). - // Upon switching tab pages we need all settings to be consistent - // in case this page will be redisplayed later. - bDataChanged = (ClickHdl_Impl( &aIbAdd ) != 0); - nCurKey = pNumFmtShell->GetCurNumFmtKey(); - } - else if(nCurKey == NUMKEY_UNDEFINED) - { // something went wrong, e.g. in Writer #70281# - pNumFmtShell->FindEntry(aFormat, &nCurKey); - } - - //--------------------------------------------------------------- - // Chosen format: - // -------------- - if ( bDataChanged ) - { - bDataChanged = ( nInitFormat != nCurKey ); - - if (bDataChanged) - { - rCoreAttrs.Put( SfxUInt32Item( nWhich, nCurKey ) ); - } - else if(SFX_ITEM_DEFAULT == eItemState) - { - rCoreAttrs.ClearItem( nWhich ); - } - } - - // -------------------------------------------------------------- - // List of changed user defined formats: - // ------------------------------------- - const sal_uInt32 nDelCount = pNumFmtShell->GetUpdateDataCount(); - - if ( nDelCount > 0 ) - { - sal_uInt32* pDelArr = new sal_uInt32[nDelCount]; - - pNumFmtShell->GetUpdateData( pDelArr, nDelCount ); - pNumItem->SetDelFormatArray( pDelArr, nDelCount ); - - if(bNumItemFlag==sal_True) - { - rCoreAttrs.Put( *pNumItem ); - } - else - { - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - - DBG_ASSERT( pDocSh, "DocShell not found!" ); - - - if ( pDocSh ) - pDocSh->PutItem( *pNumItem ); - } - delete [] pDelArr; - } - - //--------------------------------------------------------------- - // Whether source format is to be taken or not: - // -------------------------------------------- - if ( aCbSourceFormat.IsEnabled() ) - { - sal_uInt16 _nWhich = GetWhich( SID_ATTR_NUMBERFORMAT_SOURCE ); - SfxItemState _eItemState = rMyItemSet.GetItemState( _nWhich, sal_False ); - const SfxBoolItem* pBoolItem = (const SfxBoolItem*) - GetItem( rMyItemSet, SID_ATTR_NUMBERFORMAT_SOURCE ); - sal_Bool bOld = (pBoolItem ? pBoolItem->GetValue() : sal_False); - rCoreAttrs.Put( SfxBoolItem( _nWhich, aCbSourceFormat.IsChecked() ) ); - if ( !bDataChanged ) - bDataChanged = (bOld != (sal_Bool) aCbSourceFormat.IsChecked() || - _eItemState != SFX_ITEM_SET); - } - - // FillItemSet is only called on OK, here we can notify the - // NumberFormatShell that all new user defined formats are valid. - pNumFmtShell->ValidateNewEntries(); - if(aLbLanguage.IsVisible() && - LISTBOX_ENTRY_NOTFOUND != aLbLanguage.GetEntryPos(sAutomaticEntry)) - rCoreAttrs.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ADD_AUTO, - aLbLanguage.GetSelectEntry() == sAutomaticEntry)); - } - - return bDataChanged; -} - - -int SvxNumberFormatTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -void SvxNumberFormatTabPage::SetInfoItem( const SvxNumberInfoItem& rItem ) -{ - if(pNumItem==NULL) - { - pNumItem = (SvxNumberInfoItem*)rItem.Clone(); - } -} - -void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries ) -{ - String* pEntry; - String aTmpString; - String aTmpCatString; - Font aFont=aLbCategory.GetFont(); - sal_uInt16 i = 0; - short nTmpCatPos; - short aPrivCat; - - aLbFormat.Clear(); - aLbFormat.SetUpdateMode( sal_False ); - - sal_uInt16 nCount = rEntries.Count(); - - if(nCount<1) return; - - if(bOneAreaFlag) - { - nTmpCatPos=nFixedCategory; - } - else - { - nTmpCatPos=aLbCategory.GetSelectEntryPos(); - } - - switch (nTmpCatPos) - { - case CAT_ALL: - case CAT_TEXT: - case CAT_NUMBER: i=1; - pEntry=rEntries[0]; - if(pEntry!=NULL) - { - if (nTmpCatPos == CAT_TEXT) - aTmpString=*pEntry; - else - aTmpString = pNumFmtShell->GetStandardName(); - aPrivCat=pNumFmtShell->GetCategory4Entry(0); - aLbFormat.InsertFontEntry( aTmpString, aFont ); - } - break; - - default: break; - } - - if(pNumFmtShell!=NULL) - { - for ( ; i < nCount; ++i ) - { - pEntry = rEntries[i]; - aPrivCat=pNumFmtShell->GetCategory4Entry(i); - if(aPrivCat!=CAT_TEXT) - { - Color* pPreviewColor = NULL; - String aPreviewString( GetExpColorString( pPreviewColor, *pEntry, aPrivCat ) ); - Font aEntryFont( aLbFormat.GetFont() ); - aLbFormat.InsertFontEntry( aPreviewString, aEntryFont, pPreviewColor ); - } - else - { - aLbFormat.InsertFontEntry(*pEntry,aFont); - } - } - } - aLbFormat.SetUpdateMode( sal_True ); - DeleteEntryList_Impl(rEntries); -} - - -/************************************************************************* -#* Methode: DeleteEntryList_Impl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Loescht eine SvStrings- Liste -#* Input: String-liste -#* Output: --- -#* -#************************************************************************/ - -void SvxNumberFormatTabPage::DeleteEntryList_Impl( SvxDelStrgs& rEntries ) -{ - sal_uInt16 nCount = rEntries.Count(); - rEntries.DeleteAndDestroy(0,nCount); -} - - -/************************************************************************* -#* Methode: UpdateOptions_Impl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Stellt je nach eingestelltem Format die Options- -#* attribute neu ein. -#* Input: Flag, ob sich die Kategorie geaendert hat. -#* Output: --- -#* -#************************************************************************/ - -void SvxNumberFormatTabPage::UpdateOptions_Impl( sal_Bool bCheckCatChange /*= sal_False*/ ) -{ - SvxDelStrgs aEntryList; - String theFormat = aEdFormat.GetText(); - sal_uInt16 nCurCategory = aLbCategory.GetSelectEntryPos(); - sal_uInt16 nCategory = nCurCategory; - sal_uInt16 nDecimals = 0; - sal_uInt16 nZeroes = 0; - sal_Bool bNegRed = sal_False; - sal_Bool bThousand = sal_False; - sal_uInt16 nCurrencyPos =aLbCurrency.GetSelectEntryPos(); - - if(bOneAreaFlag) - nCurCategory=nFixedCategory; - - - pNumFmtShell->GetOptions( theFormat, - bThousand, bNegRed, - nDecimals, nZeroes, - nCategory ); - sal_Bool bDoIt=sal_False; - if(nCategory==CAT_CURRENCY) - { - sal_uInt16 nTstPos=pNumFmtShell->FindCurrencyFormat(theFormat); - if(nCurrencyPos!=nTstPos && nTstPos!=(sal_uInt16)-1) - { - aLbCurrency.SelectEntryPos(nTstPos); - pNumFmtShell->SetCurrencySymbol(nTstPos); - bDoIt=sal_True; - } - } - - - - if ( nCategory != nCurCategory || bDoIt) - { - if ( bCheckCatChange ) - { - if(bOneAreaFlag) - SetCategory(0); - else - SetCategory(nCategory ); - - UpdateFormatListBox_Impl( sal_True, sal_False ); - } - } - else if ( aLbFormat.GetEntryCount() > 0 ) - { - sal_uInt32 nCurEntryKey=NUMKEY_UNDEFINED; - if(!pNumFmtShell->FindEntry( aEdFormat.GetText(),&nCurEntryKey)) - { - aLbFormat.SetNoSelection(); - } - } - if(bOneAreaFlag) - { - nCategory=nFixedCategory; - } - - switch ( nCategory ) - { - case CAT_NUMBER: - case CAT_PERCENT: - case CAT_CURRENCY: - aFlOptions.Enable(); - aFtDecimals.Enable(); - aEdDecimals.Enable(); - aFtLeadZeroes.Enable(); - aEdLeadZeroes.Enable(); - aBtnNegRed.Enable(); - aBtnThousand.Enable(); - aEdDecimals .SetText( UniString::CreateFromInt32( nDecimals ) ); - aEdLeadZeroes.SetText( UniString::CreateFromInt32( nZeroes ) ); - aBtnNegRed .Check( bNegRed ); - aBtnThousand .Check( bThousand ); - break; - - case CAT_ALL: - case CAT_USERDEFINED: - case CAT_TEXT: - case CAT_DATE: - case CAT_TIME: - case CAT_BOOLEAN: - case CAT_SCIENTIFIC: - case CAT_FRACTION: - default: - aFlOptions .Disable(); - aFtDecimals .Disable(); - aEdDecimals .Disable(); - aFtLeadZeroes .Disable(); - aEdLeadZeroes .Disable(); - aBtnNegRed .Disable(); - aBtnThousand .Disable(); - aEdDecimals .SetText( UniString::CreateFromInt32( 0 ) ); - aEdLeadZeroes .SetText( UniString::CreateFromInt32( 0 ) ); - aBtnNegRed .Check( sal_False ); - aBtnThousand .Check( sal_False ); - } -} - - -/************************************************************************* -#* Methode: UpdateFormatListBox_Impl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Aktualisiert die Format- Listbox und zusaetzlich -#* wird abhaengig vom bUpdateEdit- Flag der String -#* in der Editbox geaendert. -#* Input: Flags fuer Kategorie und Editbox -#* Output: --- -#* -#************************************************************************/ - -void SvxNumberFormatTabPage::UpdateFormatListBox_Impl - ( - sal_uInt16 bCat, // Category oder Land/Sprache ListBox? - sal_Bool bUpdateEdit // Format-Edit aktualisieren? - ) -{ - SvxDelStrgs aEntryList; - short nFmtLbSelPos = 0; - short nTmpCatPos; - - if(bOneAreaFlag) - { - nTmpCatPos=nFixedCategory; - } - else - { - nTmpCatPos=aLbCategory.GetSelectEntryPos(); - } - - - if ( bCat ) - { - Point aPos=aLbFormat.GetPosPixel(); - Size aSize=aLbFormat.GetSizePixel(); - - if(nTmpCatPos!=CAT_CURRENCY) - { - aPos.Y()=nStdFormatY; - aSize.Height()=nStdFormatHeight; - aLbFormat.SetPosSizePixel(aPos,aSize); -#if ENABLE_LAYOUT - aLbCurrency.Disable(); -#else /* !ENABLE_LAYOUT */ - aLbCurrency.Hide(); -#endif /* !ENABLE_LAYOUT */ - } - else - { - aPos.Y()=nCurFormatY; - aSize.Height()=nCurFormatHeight; - aLbFormat.SetPosSizePixel(aPos,aSize); -#if ENABLE_LAYOUT - aLbCurrency.Enable(); -#else /* !ENABLE_LAYOUT */ - aLbCurrency.Show(); -#endif /* !ENABLE_LAYOUT */ - } - - pNumFmtShell->CategoryChanged( nTmpCatPos,nFmtLbSelPos, aEntryList ); - } - else - pNumFmtShell->LanguageChanged( aLbLanguage.GetSelectLanguage(), - nFmtLbSelPos,aEntryList ); - - REMOVE_DONTKNOW() // ggF. UI-Enable - - - if ( (aEntryList.Count() > 0) && (nFmtLbSelPos != SELPOS_NONE) ) - { - if(bUpdateEdit) - { - String aFormat=*aEntryList[nFmtLbSelPos]; - aEdFormat.SetText(aFormat); - aFtComment.SetText(pNumFmtShell->GetComment4Entry(nFmtLbSelPos)); - } - - if(!bOneAreaFlag || !bCat) - { - FillFormatListBox_Impl( aEntryList ); - aLbFormat.SelectEntryPos( nFmtLbSelPos ); - - aFtComment.SetText(pNumFmtShell->GetComment4Entry(nFmtLbSelPos)); - if(pNumFmtShell->GetUserDefined4Entry(nFmtLbSelPos)) - { - if(pNumFmtShell->GetComment4Entry(nFmtLbSelPos).Len()==0) - { - aFtComment.SetText(aLbCategory.GetEntry(1)); - } - } - ChangePreviewText( (sal_uInt16)nFmtLbSelPos ); - } - - } - else - { - FillFormatListBox_Impl( aEntryList ); - if(nFmtLbSelPos != SELPOS_NONE) - { - aLbFormat.SelectEntryPos( (sal_uInt16)nFmtLbSelPos ); - - aFtComment.SetText(pNumFmtShell->GetComment4Entry(nFmtLbSelPos)); - if(pNumFmtShell->GetUserDefined4Entry(nFmtLbSelPos)) - { - if(pNumFmtShell->GetComment4Entry(nFmtLbSelPos).Len()==0) - { - aFtComment.SetText(aLbCategory.GetEntry(1)); - } - } - } - else - { - aLbFormat.SetNoSelection(); - } - - if ( bUpdateEdit ) - { - aEdFormat.SetText( String() ); - aWndPreview.NotifyChange( String() ); - } - } -} - - -/************************************************************************* -#* Handle: DoubleClickHdl_Impl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Bei einem Doppelklick in die Format- Listbox -#* wird der Wert uebernommen und der OK-Button -#* ausgeloest -#* Input: Pointer auf Listbox -#* Output: --- -#* -#************************************************************************/ - -IMPL_LINK( SvxNumberFormatTabPage, DoubleClickHdl_Impl, SvxFontListBox*, pLb ) -{ - if ( pLb == &aLbFormat ) - { - SelFormatHdl_Impl( pLb ); - - if ( fnOkHdl.IsSet() ) - { // Uebergangsloesung, sollte von SfxTabPage angeboten werden - fnOkHdl.Call( NULL ); - } - else - { - SfxSingleTabDialog* pParent = dynamic_cast< SfxSingleTabDialog* >( GetParent() ); - OKButton* pOKButton = pParent ? pParent->GetOKButton() : NULL; - if ( pOKButton ) - pOKButton->Click(); - } - } - return 0; -} - - -/************************************************************************* -#* Methode: SelFormatHdl_Impl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Wird aufgerufen, wenn sich die Sprache, die Kategorie -#* oder das Format aendert. Dem entsprechend werden die -#* Einstellungen geaendert. -#* Input: Pointer auf Listbox -#* Output: --- -#* -#************************************************************************/ - -IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) -{ - if ( (CheckBox*)pLb == &aCbSourceFormat ) - { - EnableBySourceFormat_Impl(); // enable/disable everything else - if ( aCbSourceFormat.IsChecked() ) - return 0; // just disabled everything else - - // Reinit options enable/disable for current selection. - -#if ENABLE_LAYOUT - if (aLbFormat.GetSelectEntryPos () == LISTBOX_ENTRY_NOTFOUND) -#else /* !ENABLE_LAYOUT */ - // Current category may be UserDefined with no format entries defined. - // And yes, aLbFormat is a SvxFontListBox with sal_uLong list positions, - // implementation returns a LIST_APPEND if empty, comparison with - // sal_uInt16 LISTBOX_ENTRY_NOTFOUND wouldn't match. - if ( aLbFormat.GetSelectEntryPos() == LIST_APPEND ) -#endif /* !ENABLE_LAYOUT */ - pLb = &aLbCategory; // continue with the current category selected - else - pLb = &aLbFormat; // continue with the current format selected - } - - short nTmpCatPos; - - if(bOneAreaFlag) - { - nTmpCatPos=nFixedCategory; - } - else - { - nTmpCatPos=aLbCategory.GetSelectEntryPos(); - } - - sal_uInt16 nCurrencyPos=LISTBOX_ENTRY_NOTFOUND ; - - if(nTmpCatPos==CAT_CURRENCY && (ListBox *)pLb == &aLbCurrency ) - { - nCurrencyPos=aLbCurrency.GetSelectEntryPos(); - pNumFmtShell->SetCurrencySymbol(nCurrencyPos); - } - - //-------------------------------------------------------------------- - // Format-ListBox ---------------------------------------------------- - if ( (SvxFontListBox *)pLb == &aLbFormat ) - { - sal_uInt16 nSelPos = (sal_uInt16) aLbFormat.GetSelectEntryPos(); - String aFormat = aLbFormat.GetSelectEntry(); - String aComment; - SvxDelStrgs aEntryList; - - short nFmtLbSelPos = nSelPos; - - aFormat=pNumFmtShell->GetFormat4Entry(nSelPos); - aComment=pNumFmtShell->GetComment4Entry(nSelPos); - if(pNumFmtShell->GetUserDefined4Entry(nFmtLbSelPos)) - { - if(pNumFmtShell->GetComment4Entry(nFmtLbSelPos).Len()==0) - { - aComment=aLbCategory.GetEntry(1); - } - } - - if ( aFormat.Len() > 0 ) - { - if(!aEdFormat.HasFocus()) aEdFormat.SetText( aFormat ); - aFtComment.SetText(aComment); - ChangePreviewText( nSelPos ); - } - - REMOVE_DONTKNOW() // ggF. UI-Enable - - if ( pNumFmtShell->FindEntry( aFormat) ) - { - aIbAdd.Enable(sal_False ); - sal_Bool bIsUserDef=pNumFmtShell->IsUserDefined( aFormat ); - aIbRemove.Enable(bIsUserDef); - aIbInfo.Enable(bIsUserDef); - - } - else - { - aIbAdd.Enable(sal_True ); - aIbInfo.Enable(sal_True ); - aIbRemove.Enable(sal_False ); - aFtComment.SetText(aEdComment.GetText()); - - } - UpdateOptions_Impl( sal_False ); - - return 0; - } - - //-------------------------------------------------------------------- - // Kategorie-ListBox ------------------------------------------------- - if ( pLb == &aLbCategory || pLb == &aLbCurrency) - { - UpdateFormatListBox_Impl( sal_True, sal_True ); - EditHdl_Impl( NULL ); - UpdateOptions_Impl( sal_False ); - - return 0; - } - - //-------------------------------------------------------------------- - // Sprache/Land-ListBox ---------------------------------------------- - if ( pLb == &aLbLanguage ) - { - UpdateFormatListBox_Impl( sal_False, sal_True ); - EditHdl_Impl( &aEdFormat ); - - return 0; - } - return 0; -} - - -/************************************************************************* -#* Methode: ClickHdl_Impl, ImageButton* pIB -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Wenn, der Hinzufuegen- oder Entfernen- Button -#* wird diese Funktion aufgerufen und die Zahlenformat- -#* Liste den entsprechend geaendert. -#* Input: Toolbox- Button -#* Output: --- -#* -#************************************************************************/ - -IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) -{ - sal_Bool bAdded = sal_False; - sal_Bool bDeleted = sal_False; - sal_uLong nReturn = 0; - const sal_uLong nReturnChanged = 0x1; // THE boolean return value - const sal_uLong nReturnAdded = 0x2; // temp: format added - const sal_uLong nReturnOneArea = 0x4; // temp: one area but category changed => ignored - - if(pIB==&aIbAdd) - { // Also called from FillItemSet() if a temporary currency format has - // to be added, not only if the Add button is enabled. - String aFormat = aEdFormat.GetText(); - SvxDelStrgs aEntryList; - SvxDelStrgs a2EntryList; - sal_uInt16 nCatLbSelPos = 0; - short nFmtLbSelPos = SELPOS_NONE; - xub_StrLen nErrPos=0; - - pNumFmtShell->SetCurCurrencyEntry(NULL); - bAdded = pNumFmtShell->AddFormat( aFormat, nErrPos, - nCatLbSelPos, nFmtLbSelPos, - aEntryList); - if ( bAdded ) - nReturn |= nReturnChanged | nReturnAdded; - - if(pLastActivWindow== (Window *) &aEdComment) - { - aEdFormat.GrabFocus(); - aEdComment.Hide(); - aFtComment.Show(); - aFtComment.SetText(aEdComment.GetText()); - } - - if ( !nErrPos ) // Syntax ok? - { - // May be sorted under a different locale if LCID was parsed. - if (bAdded) - aLbLanguage.SelectLanguage( pNumFmtShell->GetCurLanguage() ); - - if(nCatLbSelPos==CAT_CURRENCY) - { - aLbCurrency.SelectEntryPos((sal_uInt16)pNumFmtShell->GetCurrencySymbol()); - } - - if(bOneAreaFlag && (nFixedCategory!=nCatLbSelPos)) - { - if(bAdded) DeleteEntryList_Impl(aEntryList); - bDeleted = pNumFmtShell->RemoveFormat( aFormat, - nCatLbSelPos, - nFmtLbSelPos, - a2EntryList); - if(bDeleted) DeleteEntryList_Impl(a2EntryList); - aEdFormat.GrabFocus(); - aEdFormat.SetSelection( Selection( (short)nErrPos, SELECTION_MAX ) ); - nReturn |= nReturnOneArea; - } - else - { - if ( bAdded && (nFmtLbSelPos != SELPOS_NONE) ) - { - // Alles klar - if(bOneAreaFlag) //@@ ??? - SetCategory(0); - else - SetCategory(nCatLbSelPos ); - - FillFormatListBox_Impl( aEntryList ); - if(aEdComment.GetText()!=aLbCategory.GetEntry(1)) - { - pNumFmtShell->SetComment4Entry(nFmtLbSelPos, - aEdComment.GetText()); - } - else - { - pNumFmtShell->SetComment4Entry(nFmtLbSelPos, - String()); - } - aLbFormat.SelectEntryPos( (sal_uInt16)nFmtLbSelPos ); - aEdFormat.SetText( aFormat ); - - aEdComment.SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert - //holen - ChangePreviewText( (sal_uInt16)nFmtLbSelPos ); - } - } - } - else // Syntaxfehler - { - aEdFormat.GrabFocus(); - aEdFormat.SetSelection( Selection( (short)nErrPos, SELECTION_MAX ) ); - } - EditHdl_Impl( &aEdFormat ); - nReturn = ((nReturn & nReturnOneArea) ? 0 : (nReturn & nReturnChanged)); - } - else if(pIB==&aIbRemove) - { - String aFormat = aEdFormat.GetText(); - SvxDelStrgs aEntryList; - sal_uInt16 nCatLbSelPos = 0; - short nFmtLbSelPos = SELPOS_NONE; - - bDeleted = pNumFmtShell->RemoveFormat( aFormat, - nCatLbSelPos, - nFmtLbSelPos, - aEntryList ); - - aEdComment.SetText(aLbCategory.GetEntry(1)); - if ( bDeleted ) - { - if(nFmtLbSelPos>=0 && nFmtLbSelPos<aEntryList.Count()) - { - aFormat = *aEntryList[nFmtLbSelPos]; - } - - FillFormatListBox_Impl( aEntryList ); - - if ( nFmtLbSelPos != SELPOS_NONE ) - { - if(bOneAreaFlag) //@@ ??? - SetCategory(0); - else - SetCategory(nCatLbSelPos ); - - aLbFormat.SelectEntryPos( (sal_uInt16)nFmtLbSelPos ); - aEdFormat.SetText( aFormat ); - ChangePreviewText( (sal_uInt16)nFmtLbSelPos ); - } - else - { - // auf "Alle/Standard" setzen - SetCategory(0 ); - SelFormatHdl_Impl( &aLbCategory ); - } - } - EditHdl_Impl( &aEdFormat ); - } - else if(pIB==&aIbInfo) - { - if(!(pLastActivWindow== (Window *) &aEdComment)) - { - aEdComment.SetText(aFtComment.GetText()); - aEdComment.Show(); - aFtComment.Hide(); - aEdComment.GrabFocus(); - } - else - { - aEdFormat.GrabFocus(); - aEdComment.Hide(); - aFtComment.Show(); - } - } - - return nReturn; -} - - -/************************************************************************* -#* Methode: EditHdl_Impl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Wenn der Eintrag im Eingabefeld geaendert wird, -#* so wird die Vorschau aktualisiert und -#* Input: Pointer auf Editbox -#* Output: --- -#* -#************************************************************************/ - -IMPL_LINK( SvxNumberFormatTabPage, EditHdl_Impl, Edit*, pEdFormat ) -{ - sal_uInt32 nCurKey = NUMKEY_UNDEFINED; - - if ( aEdFormat.GetText().Len() == 0 ) - { - aIbAdd.Enable(sal_False ); - aIbRemove.Enable(sal_False ); - aIbInfo.Enable(sal_False ); - aFtComment.SetText(String()); - } - else - { - String aFormat = aEdFormat.GetText(); - MakePreviewText( aFormat ); - - if ( pNumFmtShell->FindEntry( aFormat, &nCurKey ) ) - { - aIbAdd.Enable(sal_False ); - sal_Bool bUserDef=pNumFmtShell->IsUserDefined( aFormat ); - - aIbRemove.Enable(bUserDef); - aIbInfo.Enable(bUserDef); - - if(bUserDef) - { - sal_uInt16 nTmpCurPos=pNumFmtShell->FindCurrencyFormat(aFormat ); - - if(nTmpCurPos!=(sal_uInt16)-1) - aLbCurrency.SelectEntryPos(nTmpCurPos); - } - short nPosi=pNumFmtShell->GetListPos4Entry(aFormat); - if(nPosi>=0) - aLbFormat.SelectEntryPos( (sal_uInt16)nPosi); - - } - else - { - - aIbAdd.Enable(sal_True ); - aIbInfo.Enable(sal_True); - aIbRemove.Enable(sal_False ); - - aFtComment.SetText(aEdComment.GetText()); - - } - } - - if ( pEdFormat ) - { - pNumFmtShell->SetCurNumFmtKey( nCurKey ); - UpdateOptions_Impl( sal_True ); - } - - return 0; -} - - -/************************************************************************* -#* Methode: NotifyChange -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Fuehrt Aenderungen in den Zahlen- Attributen durch. -#* Input: Options- Controls -#* Output: --- -#* -#************************************************************************/ - -IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl ) -{ - if ( ((NumericField*)pOptCtrl == &aEdLeadZeroes) - || ((NumericField*)pOptCtrl == &aEdDecimals) - || ((CheckBox*) pOptCtrl == &aBtnNegRed) - || ((CheckBox*) pOptCtrl == &aBtnThousand) ) - { - String aFormat; - sal_Bool bThousand = aBtnThousand.IsEnabled() - && aBtnThousand.IsChecked(); - sal_Bool bNegRed = aBtnNegRed.IsEnabled() - && aBtnNegRed.IsChecked(); - sal_uInt16 nPrecision = (aEdDecimals.IsEnabled()) - ? (sal_uInt16)aEdDecimals.GetValue() - : (sal_uInt16)0; - sal_uInt16 nLeadZeroes = (aEdLeadZeroes.IsEnabled()) - ? (sal_uInt16)aEdLeadZeroes.GetValue() - : (sal_uInt16)0; - - pNumFmtShell->MakeFormat( aFormat, - bThousand, bNegRed, - nPrecision, nLeadZeroes, - (sal_uInt16)aLbFormat.GetSelectEntryPos() ); - - aEdFormat.SetText( aFormat ); - MakePreviewText( aFormat ); - - if ( pNumFmtShell->FindEntry( aFormat ) ) - { - aIbAdd.Enable(sal_False ); - sal_Bool bUserDef=pNumFmtShell->IsUserDefined( aFormat ); - aIbRemove.Enable(bUserDef); - aIbInfo.Enable(bUserDef); - EditHdl_Impl( &aEdFormat); - - } - else - { - EditHdl_Impl( NULL ); - aLbFormat.SetNoSelection(); - } - } - return 0; -} - -IMPL_LINK( SvxNumberFormatTabPage, TimeHdl_Impl, Timer*, EMPTYARG) -{ - pLastActivWindow=NULL; - return 0; -} - - -/************************************************************************* -#* Methode: LostFocusHdl_Impl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Fuehrt Aenderungen in den Zahlen- Attributen durch. -#* Input: Options- Controls -#* Output: --- -#* -#************************************************************************/ - -IMPL_LINK( SvxNumberFormatTabPage, LostFocusHdl_Impl, Edit *, pEd) -{ - if (pEd==&aEdComment) - { - aResetWinTimer.Start(); - aFtComment.SetText(aEdComment.GetText()); - aEdComment.Hide(); - aFtComment.Show(); - if(!aIbAdd.IsEnabled()) - { - sal_uInt16 nSelPos = (sal_uInt16) aLbFormat.GetSelectEntryPos(); - pNumFmtShell->SetComment4Entry(nSelPos, - aEdComment.GetText()); - aEdComment.SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert - //holen - } - } - return 0; -} - -/************************************************************************* -#* Methode: NotifyChange -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Fuehrt Aenderungen in den Zahlen- Attributen durch. -#* Input: Options- Controls -#* Output: --- -#* -#************************************************************************/ - -String SvxNumberFormatTabPage::GetExpColorString( - Color*& rpPreviewColor, const String& rFormatStr, short nTmpCatPos) -{ - double nVal = 0; - switch (nTmpCatPos) - { - case CAT_CURRENCY: nVal=SVX_NUMVAL_CURRENCY; break; - - case CAT_SCIENTIFIC: - case CAT_FRACTION: - case CAT_NUMBER: nVal=SVX_NUMVAL_STANDARD; break; - - case CAT_PERCENT: nVal=SVX_NUMVAL_PERCENT; break; - - case CAT_ALL: nVal=SVX_NUMVAL_STANDARD; break; - - case CAT_TIME: nVal=SVX_NUMVAL_TIME; break; - case CAT_DATE: nVal=SVX_NUMVAL_DATE; break; - - case CAT_BOOLEAN: nVal=SVX_NUMVAL_BOOLEAN; break; - - case CAT_USERDEFINED: - case CAT_TEXT: - default: nVal=0;break; - } - - String aPreviewString; - pNumFmtShell->MakePrevStringFromVal( rFormatStr, aPreviewString, rpPreviewColor, nVal ); - return aPreviewString; -} - -void SvxNumberFormatTabPage::MakePreviewText( const String& rFormat ) -{ - String aPreviewString; - Color* pPreviewColor = NULL; - pNumFmtShell->MakePreviewString( rFormat, aPreviewString, pPreviewColor ); - aWndPreview.NotifyChange( aPreviewString, pPreviewColor ); -} - -void SvxNumberFormatTabPage::ChangePreviewText( sal_uInt16 nPos ) -{ - String aPreviewString; - Color* pPreviewColor = NULL; - pNumFmtShell->FormatChanged( nPos, aPreviewString, pPreviewColor ); - aWndPreview.NotifyChange( aPreviewString, pPreviewColor ); -} - -long SvxNumberFormatTabPage::PreNotify( NotifyEvent& rNEvt ) -{ - if(rNEvt.GetType()==EVENT_LOSEFOCUS) - { - if ( rNEvt.GetWindow() == dynamic_cast< Window* >( &aEdComment ) && !aEdComment.IsVisible() ) - { - pLastActivWindow = NULL; - } - else - { - pLastActivWindow = rNEvt.GetWindow(); - } - } - - return SfxTabPage::PreNotify( rNEvt ); -} -/************************************************************************* -#* Methode: SetOkHdl -#*------------------------------------------------------------------------ -#* -#* Klasse: SvxNumberFormatTabPage -#* Funktion: Setzt den OkHandler neu. -#* Input: Neuer OkHandler -#* Output: --- -#* -#************************************************************************/ - -void SvxNumberFormatTabPage::SetOkHdl( const Link& rOkHandler ) -{ - fnOkHdl = rOkHandler; -} - -void SvxNumberFormatTabPage::FillCurrencyBox() -{ - SvStringsDtor aList; - NfShCurrencyEntries rEntries; - XubString* pEntry = NULL; - sal_uInt16 nSelPos=0; - - pNumFmtShell->GetCurrencySymbols( aList, &nSelPos); - - for(sal_uInt16 i=1;i<aList.Count();i++) - { - pEntry=aList[i]; - aLbCurrency.InsertEntry( *pEntry); - } - aLbCurrency.SelectEntryPos(nSelPos); -} - -void SvxNumberFormatTabPage::SetCategory(sal_uInt16 nPos) -{ - sal_uInt16 nCurCategory = aLbCategory.GetSelectEntryPos(); - Point aPos=aLbFormat.GetPosPixel(); - Size aSize=aLbFormat.GetSizePixel(); - sal_uInt16 nTmpCatPos; - - if(bOneAreaFlag) - { - nTmpCatPos=nFixedCategory; - } - else - { - nTmpCatPos=nPos; - } - - if(aLbCategory.GetEntryCount()==1 || nCurCategory!=nPos) - { - if(nTmpCatPos!=CAT_CURRENCY) - { - aPos.Y()=nStdFormatY; - aSize.Height()=nStdFormatHeight; - aLbFormat.SetPosSizePixel(aPos,aSize); - aLbCurrency.Hide(); - } - else - { - aPos.Y()=nCurFormatY; - aSize.Height()=nCurFormatHeight; - aLbFormat.SetPosSizePixel(aPos,aSize); - aLbCurrency.Show(); - } - } - aLbCategory.SelectEntryPos(nPos); -} -/* to support Writer text field language handling an - additional entry needs to be inserted into the ListBox - which marks a certain language as automatically detected - Additionally the "Default" language is removed -*/ -void SvxNumberFormatTabPage::AddAutomaticLanguage_Impl(LanguageType eAutoLang, sal_Bool bSelect) -{ - aLbLanguage.RemoveLanguage(LANGUAGE_SYSTEM); - sal_uInt16 nPos = aLbLanguage.InsertEntry(sAutomaticEntry); - aLbLanguage.SetEntryData(nPos, (void*)(sal_uLong)eAutoLang); - if(bSelect) - aLbLanguage.SelectEntryPos(nPos); -} - -void SvxNumberFormatTabPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pNumberInfoItem,SvxNumberInfoItem,SID_ATTR_NUMBERFORMAT_INFO,sal_False); - SFX_ITEMSET_ARG (&aSet,pLinkItem,SfxLinkItem,SID_LINK_TYPE,sal_False); - if (pNumberInfoItem) - SetNumberFormatList(*pNumberInfoItem); - if (pLinkItem) - SetOkHdl(pLinkItem->GetValue()); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/numfmt.hrc b/cui/source/tabpages/numfmt.hrc deleted file mode 100644 index 907b25656..000000000 --- a/cui/source/tabpages/numfmt.hrc +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_NUMFMT_HRC -#define _SVX_NUMFMT_HRC - -// defines ------------------------------------------------------------------ - -//================================================ -// Zahlen-TabPage: -#define WND_NUMBER_PREVIEW 2 -#define FT_CATEGORY 3 -#define FT_FORMAT 4 -#define FT_OPTIONS 5 -#define FT_EDFORMAT 6 -#define LB_CATEGORY 9 -#define LB_FORMAT 10 -#define FL_OPTIONS 11 -#define FT_LANGUAGE 12 -#define LB_LANGUAGE 13 -#define ED_FORMAT 14 -#define BTN_ADD 15 -#define BTN_REMOVE 16 -#define BMP_CHECK 17 -#define BMP_DCHECK 18 -#define BMP_CROSS 19 -#define BMP_DCROSS 20 -#define FT_DECIMALS 21 -#define ED_DECIMALS 22 -#define FT_LEADZEROES 23 -#define ED_LEADZEROES 24 -#define BTN_NEGRED 25 -#define BTN_THOUSAND 26 -#define FT_COMMENT 27 -#define ED_COMMENT 28 -#define IB_ADD 29 -#define IB_REMOVE 30 -#define IB_INFO 31 -#define IL_ICON 32 -#define LB_CURRENCY 33 -#define CB_SOURCEFORMAT 34 -#define STR_AUTO_ENTRY 36 - -#define TBX_ADDREMOVE 1 -#define IID_ADD 1 -#define IID_REMOVE 2 -#define IID_INFO 3 - -#endif - diff --git a/cui/source/tabpages/numfmt.src b/cui/source/tabpages/numfmt.src deleted file mode 100644 index 867f93c7e..000000000 --- a/cui/source/tabpages/numfmt.src +++ /dev/null @@ -1,291 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <cuires.hrc> -#include "helpid.hrc" -#include "numfmt.hrc" -#include <svx/dialogs.hrc> - - // RID_SVXPAGE_NUMBERFORMAT ---------------------------------------------- -TabPage RID_SVXPAGE_NUMBERFORMAT -{ - HelpId = HID_NUMBERFORMAT ; - Hide = TRUE ; - Text [ en-US ] = "Number Format" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedText FT_CATEGORY - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; - Text [ en-US ] = "~Category" ; - }; - ListBox LB_CATEGORY - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUMBERFORMAT:LB_CATEGORY"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 14 ) ; - Size = MAP_APPFONT ( 70 , 71 ) ; - AutoHScroll = TRUE ; - StringList [ en-US ] = - { - < "All" ; Default ; > ; - < "User-defined" ; Default ; > ; - < "Number" ; Default ; > ; - < "Percent" ; Default ; > ; - < "Currency" ; Default ; > ; - < "Date" ; Default ; > ; - < "Time" ; Default ; > ; - < "Scientific" ; Default ; > ; - < "Fraction" ; Default ; > ; - < "Boolean Value" ; Default ; > ; - < "Text" ; Default ; > ; - }; - }; - FixedText FT_EDFORMAT - { - Pos = MAP_APPFONT ( 6 , 136 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "~Format code" ; - }; - Edit ED_FORMAT - { - HelpID = "cui:Edit:RID_SVXPAGE_NUMBERFORMAT:ED_FORMAT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 147 ) ; - Size = MAP_APPFONT ( 200 , 12 ) ; - }; - FixedText FT_COMMENT - { - Pos = MAP_APPFONT ( 6 , 163 ) ; - Size = MAP_APPFONT ( 248 , 16 ) ; - WordBreak = TRUE ; - NoLabel = TRUE ; - }; - Edit ED_COMMENT - { - HelpID = "cui:Edit:RID_SVXPAGE_NUMBERFORMAT:ED_COMMENT"; - Hide = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 163 ) ; - Size = MAP_APPFONT ( 248 , 12 ) ; - }; - FixedText FT_FORMAT - { - Pos = MAP_APPFONT ( 82 , 3 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "F~ormat" ; - }; - - ListBox LB_CURRENCY - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUMBERFORMAT:LB_CURRENCY"; - Border = TRUE ; - Pos = MAP_APPFONT ( 82 , 14 ) ; - Size = MAP_APPFONT ( 90 , 71 ) ; - DropDown = TRUE ; - TabStop = TRUE ; - StringList [ en-US ] = - { - < "Automatically" ; Default ; > ; - }; - }; - - Control LB_FORMAT - { - HelpId = HID_NUMBERFORMAT_LB_FORMAT ; - Border = TRUE ; - Pos = MAP_APPFONT ( 82 , 27 ) ; - Size = MAP_APPFONT ( 90 , 58 ) ; - TabStop = TRUE ; - }; - - FixedText FT_DECIMALS - { - Pos = MAP_APPFONT ( 12 , 104 ) ; - Size = MAP_APPFONT ( 69 , 8 ) ; - Text [ en-US ] = "~Decimal places" ; - }; - NumericField ED_DECIMALS - { - HelpID = "cui:NumericField:RID_SVXPAGE_NUMBERFORMAT:ED_DECIMALS"; - Border = TRUE ; - Pos = MAP_APPFONT ( 84 , 102 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Spin = TRUE ; - Maximum = 20 ; - Last = 15 ; - First = 0 ; - StrictFormat = TRUE ; - SpinSize = 1 ; - Repeat = TRUE ; - }; - FixedText FT_LEADZEROES - { - Pos = MAP_APPFONT ( 12 , 120 ) ; - Size = MAP_APPFONT ( 69 , 8 ) ; - Text [ en-US ] = "Leading ~zeroes" ; - }; - NumericField ED_LEADZEROES - { - HelpID = "cui:NumericField:RID_SVXPAGE_NUMBERFORMAT:ED_LEADZEROES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 84 , 118 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Spin = TRUE ; - Maximum = 20 ; - Last = 15 ; - First = 0 ; - StrictFormat = TRUE ; - SpinSize = 1 ; - Repeat = TRUE ; - }; - CheckBox BTN_NEGRED - { - HelpID = "cui:CheckBox:RID_SVXPAGE_NUMBERFORMAT:BTN_NEGRED"; - Pos = MAP_APPFONT ( 133 , 104 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - Text [ en-US ] = "~Negative numbers red" ; - }; - CheckBox BTN_THOUSAND - { - HelpID = "cui:CheckBox:RID_SVXPAGE_NUMBERFORMAT:BTN_THOUSAND"; - Pos = MAP_APPFONT ( 133 , 120 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - Text [ en-US ] = "~Thousands separator" ; - }; - FixedLine FL_OPTIONS - { - Pos = MAP_APPFONT ( 6 , 91 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Options" ; - }; - FixedText FT_LANGUAGE - { - Pos = MAP_APPFONT ( 178 , 3 ) ; - Size = MAP_APPFONT ( 76 , 8 ) ; - Text [ en-US ] = "~Language" ; - }; - ListBox LB_LANGUAGE - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUMBERFORMAT:LB_LANGUAGE"; - Border = TRUE ; - Sort = TRUE ; - Pos = MAP_APPFONT ( 178 , 14 ) ; - Size = MAP_APPFONT ( 76 , 71 ) ; - DropDown = TRUE ; - }; - CheckBox CB_SOURCEFORMAT - { - HelpID = "cui:CheckBox:RID_SVXPAGE_NUMBERFORMAT:CB_SOURCEFORMAT"; - Pos = MAP_APPFONT ( 178 , 42 ) ; - Size = MAP_APPFONT ( 76 , 10 ) ; - Text [ en-US ] = "So~urce format" ; - }; - Window WND_NUMBER_PREVIEW - { - Border = TRUE ; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 178 , 67 ) ; - Size = MAP_APPFONT ( 76 , 18 ) ; - HelpId = HID_NUMBERFORMAT_WND_NUMBER_PREVIEW ; - }; - ImageButton IB_ADD - { - SVLook = TRUE ; - Pos = MAP_APPFONT ( 208 , 146 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - HelpId = HID_NUMBERFORMAT_TBI_ADD ; - QuickHelpText [ en-US ] = "Add" ; - }; - ImageButton IB_REMOVE - { - SVLook = TRUE ; - Pos = MAP_APPFONT ( 240 , 146 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - HelpId = HID_NUMBERFORMAT_TBI_REMOVE ; - QuickHelpText [ en-US ] = "Remove" ; - }; - ImageButton IB_INFO - { - SVLook = TRUE ; - Pos = MAP_APPFONT ( 224 , 146 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - HelpId = HID_NUMBERFORMAT_TBI_INFO ; - QuickHelpText [ en-US ] = "Edit Comment" ; - }; - ImageList IL_ICON - { - Prefix = "nu"; - MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; }; - IdList = - { - IID_ADD ; - IID_REMOVE ; - IID_INFO ; - }; - IdCount = { 3 ; }; - }; - - String STR_AUTO_ENTRY - { - Text [ en-US ] = "Automatic"; - }; - -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx deleted file mode 100644 index 21dbb6f88..000000000 --- a/cui/source/tabpages/numpages.cxx +++ /dev/null @@ -1,3606 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <com/sun/star/text/HoriOrientation.hpp> -#include <com/sun/star/text/VertOrientation.hpp> -#include <com/sun/star/text/RelOrientation.hpp> - -#include <numpages.hxx> -#include <numpages.hrc> -#include <dialmgr.hxx> -#include <tools/shl.hxx> -#include <i18npool/mslangid.hxx> -#include <svtools/valueset.hxx> -#include <helpid.hrc> -#include <editeng/numitem.hxx> -#include <svl/eitem.hxx> -#include <vcl/svapp.hxx> -#include <svx/gallery.hxx> -#include <svl/urihelper.hxx> -#include <editeng/brshitem.hxx> -#include <svl/intitem.hxx> -#include <sfx2/objsh.hxx> -#include <vcl/graph.hxx> -#include <vcl/msgbox.hxx> -#include "cuicharmap.hxx" -#include <editeng/flstitem.hxx> -#include <svx/dlgutil.hxx> -#include <svx/xtable.hxx> -#include <svx/drawitem.hxx> -#include <svx/numvset.hxx> -#include <svx/htmlmode.hxx> -#include <unotools/pathoptions.hxx> -#include <svtools/ctrltool.hxx> -#include <editeng/unolingu.hxx> -#include <com/sun/star/style/NumberingType.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/container/XIndexAccess.hpp> -#include <com/sun/star/text/XDefaultNumberingProvider.hpp> -#include <com/sun/star/text/XNumberingFormatter.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <comphelper/processfactory.hxx> -#include <com/sun/star/text/XNumberingTypeInfo.hpp> -#include <svx/dialmgr.hxx> -#include <svx/dialogs.hrc> - -#include <algorithm> -#include <vector> -#include "sfx2/opengrf.hxx" - -#include <cuires.hrc> -#include <sfx2/request.hxx> -#include <svl/aeitem.hxx> -#include <svl/stritem.hxx> -#include <svl/slstitm.hxx> - -using namespace com::sun::star; -using namespace com::sun::star::uno; -using namespace com::sun::star::beans; -using namespace com::sun::star::lang; -using namespace com::sun::star::i18n; -using namespace com::sun::star::text; -using namespace com::sun::star::container; -using namespace com::sun::star::style; -using rtl::OUString; - -SV_IMPL_PTRARR(SvxNumSettingsArr_Impl,SvxNumSettings_ImplPtr); - -#define NUM_PAGETYPE_BULLET 0 -#define NUM_PAGETYPE_SINGLENUM 1 -#define NUM_PAGETYPE_NUM 2 -#define NUM_PAGETYPE_BMP 3 -#define PAGETYPE_USER_START 10 - -#define SHOW_NUMBERING 0 -#define SHOW_BULLET 1 -#define SHOW_BITMAP 2 - -#define MAX_BMP_WIDTH 16 -#define MAX_BMP_HEIGHT 16 - -static sal_Bool bLastRelative = sal_False; -static const sal_Char cNumberingType[] = "NumberingType"; -static const sal_Char cValue[] = "Value"; -static const sal_Char cParentNumbering[] = "ParentNumbering"; -static const sal_Char cPrefix[] = "Prefix"; -static const sal_Char cSuffix[] = "Suffix"; -static const sal_Char cBulletChar[] = "BulletChar"; -static const sal_Char cBulletFontName[] = "BulletFontName"; - -Reference<XDefaultNumberingProvider> lcl_GetNumberingProvider() -{ - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - Reference < XInterface > xI = xMSF->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.DefaultNumberingProvider" )) ); - Reference<XDefaultNumberingProvider> xRet(xI, UNO_QUERY); - DBG_ASSERT(xRet.is(), "service missing: \"com.sun.star.text.DefaultNumberingProvider\""); - - return xRet; -} - -SvxNumSettings_ImplPtr lcl_CreateNumSettingsPtr(const Sequence<PropertyValue>& rLevelProps) -{ - const PropertyValue* pValues = rLevelProps.getConstArray(); - SvxNumSettings_ImplPtr pNew = new SvxNumSettings_Impl; - for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++) - { - if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cNumberingType))) - pValues[j].Value >>= pNew->nNumberType; - else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cPrefix))) - pValues[j].Value >>= pNew->sPrefix; - else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cSuffix))) - pValues[j].Value >>= pNew->sSuffix; - else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cParentNumbering))) - pValues[j].Value >>= pNew->nParentNumbering; - else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cBulletChar))) - pValues[j].Value >>= pNew->sBulletChar; - else if(pValues[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(cBulletFontName))) - pValues[j].Value >>= pNew->sBulletFont; - } - return pNew; -} - -// Die Auswahl an Bullets aus den StarSymbol -static const sal_Unicode aBulletTypes[] = -{ - 0x2022, - 0x25cf, - 0xe00c, - 0xe00a, - 0x2794, - 0x27a2, - 0x2717, - 0x2714 -}; - -static sal_Char const aNumChar[] = -{ - 'A', //CHARS_UPPER_LETTER - 'a', //CHARS_LOWER_LETTER - 'I', //ROMAN_UPPER - 'i', //ROMAN_LOWER - '1', //ARABIC - ' ' -}; - -// Ist eins der maskierten Formate gesetzt? -sal_Bool lcl_IsNumFmtSet(SvxNumRule* pNum, sal_uInt16 nLevelMask) -{ - sal_Bool bRet = sal_False; - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < SVX_MAX_NUM && !bRet; i++ ) - { - if(nLevelMask & nMask) - bRet |= 0 != pNum->Get( i ); - nMask <<= 1 ; - } - return bRet; -} - -Font& lcl_GetDefaultBulletFont() -{ - static sal_Bool bInit = 0; - static Font aDefBulletFont( UniString::CreateFromAscii( - RTL_CONSTASCII_STRINGPARAM( "StarSymbol" ) ), - String(), Size( 0, 14 ) ); - if(!bInit) - { - aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL ); - aDefBulletFont.SetFamily( FAMILY_DONTKNOW ); - aDefBulletFont.SetPitch( PITCH_DONTKNOW ); - aDefBulletFont.SetWeight( WEIGHT_DONTKNOW ); - aDefBulletFont.SetTransparent( sal_True ); - bInit = sal_True; - } - return aDefBulletFont; -} - - -/**************************************************************************/ -/* */ -/* */ -/**************************************************************************/ - - -SvxSingleNumPickTabPage::SvxSingleNumPickTabPage(Window* pParent, - const SfxItemSet& rSet) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_PICK_SINGLE_NUM ), rSet ), - aValuesFL( this, CUI_RES(FL_VALUES) ), - pExamplesVS( new SvxNumValueSet(this, CUI_RES(VS_VALUES), NUM_PAGETYPE_SINGLENUM )), - pActNum(0), - pSaveNum(0), - nActNumLvl( USHRT_MAX ), - bModified(sal_False), - bPreset(sal_False), - nNumItemId(SID_ATTR_NUMBERING_RULE) -{ - FreeResource(); - SetExchangeSupport(); - pExamplesVS->SetSelectHdl(LINK(this, SvxSingleNumPickTabPage, NumSelectHdl_Impl)); - pExamplesVS->SetDoubleClickHdl(LINK(this, SvxSingleNumPickTabPage, DoubleClickHdl_Impl)); - pExamplesVS->SetHelpId(HID_VALUESET_SINGLENUM ); - - Reference<XDefaultNumberingProvider> xDefNum = lcl_GetNumberingProvider(); - if(xDefNum.is()) - { - Sequence< Sequence< PropertyValue > > aNumberings; - LanguageType eLang = Application::GetSettings().GetLanguage(); - Locale aLocale = SvxCreateLocale(eLang); - try - { - aNumberings = - xDefNum->getDefaultContinuousNumberingLevels( aLocale ); - - - sal_Int32 nLength = aNumberings.getLength() > NUM_VALUSET_COUNT ? NUM_VALUSET_COUNT :aNumberings.getLength(); - - const Sequence<PropertyValue>* pValuesArr = aNumberings.getConstArray(); - for(sal_Int32 i = 0; i < nLength; i++) - { - SvxNumSettings_ImplPtr pNew = lcl_CreateNumSettingsPtr(pValuesArr[i]); - aNumSettingsArr.Insert(pNew, aNumSettingsArr.Count()); - } - } - catch(Exception&) - { - } - Reference<XNumberingFormatter> xFormat(xDefNum, UNO_QUERY); - pExamplesVS->SetNumberingSettings(aNumberings, xFormat, aLocale); - } -} - - SvxSingleNumPickTabPage::~SvxSingleNumPickTabPage() -{ - delete pActNum; - delete pExamplesVS; - delete pSaveNum; - aNumSettingsArr.DeleteAndDestroy(0, aNumSettingsArr.Count()); -} - -SfxTabPage* SvxSingleNumPickTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new SvxSingleNumPickTabPage(pParent, rAttrSet); -} - -sal_Bool SvxSingleNumPickTabPage::FillItemSet( SfxItemSet& rSet ) -{ - if( (bPreset || bModified) && pSaveNum) - { - *pSaveNum = *pActNum; - rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId); - rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset)); - } - - return bModified; -} - -void SvxSingleNumPickTabPage::ActivatePage(const SfxItemSet& rSet) -{ - const SfxPoolItem* pItem; - bPreset = sal_False; - sal_Bool bIsPreset = sal_False; - const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet(); - if(pExampleSet) - { - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, sal_False, &pItem)) - bIsPreset = ((const SfxBoolItem*)pItem)->GetValue(); - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, sal_False, &pItem)) - nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue(); - } - if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, sal_False, &pItem)) - { - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - } - if(*pSaveNum != *pActNum) - { - *pActNum = *pSaveNum; - pExamplesVS->SetNoSelection(); - } - // ersten Eintrag vorselektieren - if(pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset)) - { - pExamplesVS->SelectItem(1); - NumSelectHdl_Impl(pExamplesVS); - bPreset = sal_True; - } - bPreset |= bIsPreset; - - bModified = sal_False; -} - -int SvxSingleNumPickTabPage::DeactivatePage(SfxItemSet *_pSet) -{ - if(_pSet) - FillItemSet(*_pSet); - return sal_True; -} - -void SvxSingleNumPickTabPage::Reset( const SfxItemSet& rSet ) -{ - const SfxPoolItem* pItem; - - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, sal_False, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, sal_False, &pItem); - - if( eState != SFX_ITEM_SET ) - { - pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, sal_True ) ); - eState = SFX_ITEM_SET; - } - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - - if(!pActNum) - pActNum = new SvxNumRule(*pSaveNum); - else if(*pSaveNum != *pActNum) - *pActNum = *pSaveNum; -} - -IMPL_LINK(SvxSingleNumPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG) -{ - if(pActNum) - { - bPreset = sal_False; - bModified = sal_True; - sal_uInt16 nIdx = pExamplesVS->GetSelectItemId() - 1; - DBG_ASSERT(aNumSettingsArr.Count() > nIdx, "wrong index"); - if(aNumSettingsArr.Count() <= nIdx) - return 0; - SvxNumSettings_ImplPtr _pSet = aNumSettingsArr.GetObject(nIdx); - sal_Int16 eNewType = _pSet->nNumberType; - const sal_Unicode cLocalPrefix = _pSet->sPrefix.getLength() ? _pSet->sPrefix.getStr()[0] : 0; - const sal_Unicode cLocalSuffix = _pSet->sSuffix.getLength() ? _pSet->sSuffix.getStr()[0] : 0; - - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aFmt(pActNum->GetLevel(i)); - aFmt.SetNumberingType(eNewType); - String aEmptyStr; - if(cLocalPrefix == ' ') - aFmt.SetPrefix( aEmptyStr ); - else - aFmt.SetPrefix(_pSet->sPrefix); - if(cLocalSuffix == ' ') - aFmt.SetSuffix( aEmptyStr ); - else - aFmt.SetSuffix(_pSet->sSuffix); - aFmt.SetCharFmtName(sNumCharFmtName); - // #62069# // #92724# - aFmt.SetBulletRelSize(100); - pActNum->SetLevel(i, aFmt); - } - nMask <<= 1 ; - } - } - return 0; -} - -IMPL_LINK(SvxSingleNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG) -{ - NumSelectHdl_Impl(pExamplesVS); - OKButton& rOk = GetTabDialog()->GetOKButton(); - rOk.GetClickHdl().Call(&rOk); - return 0; -} - - -SvxBulletPickTabPage::SvxBulletPickTabPage(Window* pParent, - const SfxItemSet& rSet) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_PICK_BULLET ), rSet ), - aValuesFL( this, CUI_RES(FL_VALUES) ), - pExamplesVS( new SvxNumValueSet(this, CUI_RES(VS_VALUES), NUM_PAGETYPE_BULLET )), - pActNum(0), - pSaveNum(0), - nActNumLvl( USHRT_MAX ), - bModified(sal_False), - bPreset(sal_False), - nNumItemId(SID_ATTR_NUMBERING_RULE) -{ - FreeResource(); - SetExchangeSupport(); - pExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl)); - pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl)); - pExamplesVS->SetHelpId(HID_VALUESET_BULLET ); - -} - - SvxBulletPickTabPage::~SvxBulletPickTabPage() -{ - delete pActNum; - delete pExamplesVS; - delete pSaveNum; -} - -SfxTabPage* SvxBulletPickTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new SvxBulletPickTabPage(pParent, rAttrSet); -} - -sal_Bool SvxBulletPickTabPage::FillItemSet( SfxItemSet& rSet ) -{ - if( (bPreset || bModified) && pActNum) - { - *pSaveNum = *pActNum; - rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId); - rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset)); - } - return bModified; -} - -void SvxBulletPickTabPage::ActivatePage(const SfxItemSet& rSet) -{ - const SfxPoolItem* pItem; - bPreset = sal_False; - sal_Bool bIsPreset = sal_False; - const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet(); - if(pExampleSet) - { - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, sal_False, &pItem)) - bIsPreset = ((const SfxBoolItem*)pItem)->GetValue(); - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, sal_False, &pItem)) - nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue(); - } - if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, sal_False, &pItem)) - { - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - } - if(*pSaveNum != *pActNum) - { - *pActNum = *pSaveNum; - pExamplesVS->SetNoSelection(); - } - // ersten Eintrag vorselektieren - if(pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset)) - { - pExamplesVS->SelectItem(1); - NumSelectHdl_Impl(pExamplesVS); - bPreset = sal_True; - } - bPreset |= bIsPreset; - bModified = sal_False; -} - -int SvxBulletPickTabPage::DeactivatePage(SfxItemSet *_pSet) -{ - if(_pSet) - FillItemSet(*_pSet); - return sal_True; -} - -void SvxBulletPickTabPage::Reset( const SfxItemSet& rSet ) -{ - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, sal_False, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, sal_False, &pItem); - - if( eState != SFX_ITEM_SET ) - { - pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, sal_True ) ); - eState = SFX_ITEM_SET; - } - - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - - if(!pActNum) - pActNum = new SvxNumRule(*pSaveNum); - else if(*pSaveNum != *pActNum) - *pActNum = *pSaveNum; -} - -IMPL_LINK(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG) -{ - if(pActNum) - { - bPreset = sal_False; - bModified = sal_True; - sal_Unicode cChar = aBulletTypes[pExamplesVS->GetSelectItemId() - 1]; - Font& rActBulletFont = lcl_GetDefaultBulletFont(); - - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aFmt(pActNum->GetLevel(i)); - aFmt.SetNumberingType( SVX_NUM_CHAR_SPECIAL ); - // #i93908# clear suffix for bullet lists - aFmt.SetPrefix(::rtl::OUString()); - aFmt.SetSuffix(::rtl::OUString()); - aFmt.SetBulletFont(&rActBulletFont); - aFmt.SetBulletChar(cChar ); - aFmt.SetCharFmtName(sBulletCharFmtName); - // #62069# // #92724# - aFmt.SetBulletRelSize(45); - pActNum->SetLevel(i, aFmt); - } - nMask <<= 1; - } - } - - return 0; -} - - -IMPL_LINK(SvxBulletPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG) -{ - NumSelectHdl_Impl(pExamplesVS); - OKButton& rOk = GetTabDialog()->GetOKButton(); - rOk.GetClickHdl().Call(&rOk); - return 0; -} - - -void SvxBulletPickTabPage::PageCreated(SfxAllItemSet aSet) -{ - - SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False); - - if (pBulletCharFmt) - SetCharFmtName( pBulletCharFmt->GetValue()); - - -} - - -SvxNumPickTabPage::SvxNumPickTabPage(Window* pParent, - const SfxItemSet& rSet) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_PICK_NUM ), rSet ), - aValuesFL( this, CUI_RES(FL_VALUES) ), - pExamplesVS( new SvxNumValueSet(this, CUI_RES(VS_VALUES), NUM_PAGETYPE_NUM )), - pActNum(0), - pSaveNum(0), - nActNumLvl( USHRT_MAX ), - nNumItemId(SID_ATTR_NUMBERING_RULE), - bModified(sal_False), - bPreset(sal_False) -{ - - FreeResource(); - - SetExchangeSupport(); - - pExamplesVS->SetSelectHdl(LINK(this, SvxNumPickTabPage, NumSelectHdl_Impl)); - pExamplesVS->SetDoubleClickHdl(LINK(this, SvxNumPickTabPage, DoubleClickHdl_Impl)); - pExamplesVS->SetHelpId(HID_VALUESET_NUM ); - - Reference<XDefaultNumberingProvider> xDefNum = lcl_GetNumberingProvider(); - if(xDefNum.is()) - { - Sequence<Reference<XIndexAccess> > aOutlineAccess; - LanguageType eLang = Application::GetSettings().GetLanguage(); - Locale aLocale = SvxCreateLocale(eLang); - try - { - aOutlineAccess = xDefNum->getDefaultOutlineNumberings( aLocale ); - - for(sal_Int32 nItem = 0; - nItem < aOutlineAccess.getLength() && nItem < NUM_VALUSET_COUNT; - nItem++ ) - { - SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[ nItem ]; - - Reference<XIndexAccess> xLevel = aOutlineAccess.getConstArray()[nItem]; - for(sal_Int32 nLevel = 0; nLevel < xLevel->getCount() && nLevel < 5; nLevel++) - { - Any aValueAny = xLevel->getByIndex(nLevel); - Sequence<PropertyValue> aLevelProps; - aValueAny >>= aLevelProps; - SvxNumSettings_ImplPtr pNew = lcl_CreateNumSettingsPtr(aLevelProps); - rItemArr.Insert( pNew, rItemArr.Count() ); - } - } - } - catch(Exception&) - { - } - Reference<XNumberingFormatter> xFormat(xDefNum, UNO_QUERY); - pExamplesVS->SetOutlineNumberingSettings(aOutlineAccess, xFormat, aLocale); - } -} - - SvxNumPickTabPage::~SvxNumPickTabPage() -{ - delete pActNum; - delete pExamplesVS; - delete pSaveNum; -} - -SfxTabPage* SvxNumPickTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new SvxNumPickTabPage(pParent, rAttrSet); -} - -sal_Bool SvxNumPickTabPage::FillItemSet( SfxItemSet& rSet ) -{ - if( (bPreset || bModified) && pActNum) - { - *pSaveNum = *pActNum; - rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId); - rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset)); - } - return bModified; -} - -void SvxNumPickTabPage::ActivatePage(const SfxItemSet& rSet) -{ - const SfxPoolItem* pItem; - bPreset = sal_False; - sal_Bool bIsPreset = sal_False; - const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet(); - if(pExampleSet) - { - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, sal_False, &pItem)) - bIsPreset = ((const SfxBoolItem*)pItem)->GetValue(); - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, sal_False, &pItem)) - nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue(); - } - if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, sal_False, &pItem)) - { - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - } - if(*pSaveNum != *pActNum) - { - *pActNum = *pSaveNum; - pExamplesVS->SetNoSelection(); - } - // ersten Eintrag vorselektieren - if(pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset)) - { - pExamplesVS->SelectItem(1); - NumSelectHdl_Impl(pExamplesVS); - bPreset = sal_True; - } - bPreset |= bIsPreset; - bModified = sal_False; -} - -int SvxNumPickTabPage::DeactivatePage(SfxItemSet *_pSet) -{ - if(_pSet) - FillItemSet(*_pSet); - return sal_True; -} - -void SvxNumPickTabPage::Reset( const SfxItemSet& rSet ) -{ - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, sal_False, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, sal_False, &pItem); - - if( eState != SFX_ITEM_SET ) - { - pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, sal_True ) ); - eState = SFX_ITEM_SET; - } - - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - - if(!pActNum) - pActNum = new SvxNumRule(*pSaveNum); - else if(*pSaveNum != *pActNum) - *pActNum = *pSaveNum; - -} - -// Hier werden alle Ebenen veraendert -IMPL_LINK(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG) -{ - if(pActNum) - { - bPreset = sal_False; - bModified = sal_True; - - const FontList* pList = 0; - - SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[pExamplesVS->GetSelectItemId() - 1]; - - Font& rActBulletFont = lcl_GetDefaultBulletFont(); - SvxNumSettings_ImplPtr pLevelSettings = 0; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(rItemArr.Count() > i) - pLevelSettings = rItemArr[i]; - if(!pLevelSettings) - break; - SvxNumberFormat aFmt(pActNum->GetLevel(i)); - aFmt.SetNumberingType( pLevelSettings->nNumberType ); - sal_uInt16 nUpperLevelOrChar = (sal_uInt16)pLevelSettings->nParentNumbering; - if(aFmt.GetNumberingType() == SVX_NUM_CHAR_SPECIAL) - { - // #i93908# clear suffix for bullet lists - aFmt.SetPrefix(::rtl::OUString()); - aFmt.SetSuffix(::rtl::OUString()); - if( pLevelSettings->sBulletFont.getLength() && - pLevelSettings->sBulletFont.compareTo( - rActBulletFont.GetName())) - { - //search for the font - if(!pList) - { - SfxObjectShell* pCurDocShell = SfxObjectShell::Current(); - const SvxFontListItem* pFontListItem = - (const SvxFontListItem* )pCurDocShell - ->GetItem( SID_ATTR_CHAR_FONTLIST ); - pList = pFontListItem ? pFontListItem->GetFontList() : 0; - } - if(pList && pList->IsAvailable( pLevelSettings->sBulletFont ) ) - { - FontInfo aInfo = pList->Get( - pLevelSettings->sBulletFont,WEIGHT_NORMAL, ITALIC_NONE); - Font aFont(aInfo); - aFmt.SetBulletFont(&aFont); - } - else - { - //if it cannot be found then create a new one - Font aCreateFont( pLevelSettings->sBulletFont, - String(), Size( 0, 14 ) ); - aCreateFont.SetCharSet( RTL_TEXTENCODING_DONTKNOW ); - aCreateFont.SetFamily( FAMILY_DONTKNOW ); - aCreateFont.SetPitch( PITCH_DONTKNOW ); - aCreateFont.SetWeight( WEIGHT_DONTKNOW ); - aCreateFont.SetTransparent( sal_True ); - aFmt.SetBulletFont( &aCreateFont ); - } - } - else - aFmt.SetBulletFont( &rActBulletFont ); - - aFmt.SetBulletChar( pLevelSettings->sBulletChar.getLength() - ? pLevelSettings->sBulletChar.getStr()[0] - : 0 ); - aFmt.SetCharFmtName( sBulletCharFmtName ); - // #62069# // #92724# - aFmt.SetBulletRelSize(45); - } - else - { - aFmt.SetIncludeUpperLevels(sal::static_int_cast< sal_uInt8 >(0 != nUpperLevelOrChar ? pActNum->GetLevelCount() : 0)); - aFmt.SetCharFmtName(sNumCharFmtName); - // #62069# // #92724# - aFmt.SetBulletRelSize(100); - // #i93908# - aFmt.SetPrefix(pLevelSettings->sPrefix); - aFmt.SetSuffix(pLevelSettings->sSuffix); - } - pActNum->SetLevel(i, aFmt); - } - } - return 0; -} - -IMPL_LINK(SvxNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG) -{ - NumSelectHdl_Impl(pExamplesVS); - OKButton& rOk = GetTabDialog()->GetOKButton(); - rOk.GetClickHdl().Call(&rOk); - return 0; -} - -void SvxNumPickTabPage::PageCreated(SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pNumCharFmt,SfxStringItem,SID_NUM_CHAR_FMT,sal_False); - SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False); - - - if (pNumCharFmt &&pBulletCharFmt) - SetCharFmtNames( pNumCharFmt->GetValue(),pBulletCharFmt->GetValue()); -} - - -SvxBitmapPickTabPage::SvxBitmapPickTabPage(Window* pParent, - const SfxItemSet& rSet) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_PICK_BMP ), rSet ), - aValuesFL( this, CUI_RES(FL_VALUES) ), - pExamplesVS( new SvxBmpNumValueSet(this, CUI_RES(VS_VALUES)/*, aGrfNames*/ )), - aErrorText( this, CUI_RES(FT_ERROR)), - aLinkedCB( this, CUI_RES(CB_LINKED)), - pActNum(0), - pSaveNum(0), - nActNumLvl( USHRT_MAX ), - nNumItemId(SID_ATTR_NUMBERING_RULE), - bModified(sal_False), - bPreset(sal_False) -{ - FreeResource(); - SetExchangeSupport(); - eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE)); - pExamplesVS->SetSelectHdl(LINK(this, SvxBitmapPickTabPage, NumSelectHdl_Impl)); - pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBitmapPickTabPage, DoubleClickHdl_Impl)); - aLinkedCB.SetClickHdl(LINK(this, SvxBitmapPickTabPage, LinkBmpHdl_Impl)); - - // Grafiknamen ermitteln - GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames); - pExamplesVS->SetHelpId(HID_VALUESET_NUMBMP ); - - sal_uInt16 i = 0; - for(std::vector<String>::iterator it = aGrfNames.begin(); it != aGrfNames.end(); ++it, ++i) - { - pExamplesVS->InsertItem( i + 1, i); - - INetURLObject aObj(*it); - if(aObj.GetProtocol() == INET_PROT_FILE) - *it = aObj.PathToFileName(); - - pExamplesVS->SetItemText( i + 1, *it ); - } - - if(aGrfNames.empty()) - { - aErrorText.Show(); - } - else - { - pExamplesVS->Show(); - pExamplesVS->Format(); - } - - pExamplesVS->SetAccessibleRelationMemberOf( &aValuesFL ); -} - -SvxBitmapPickTabPage::~SvxBitmapPickTabPage() -{ - delete pExamplesVS; - delete pActNum; - delete pSaveNum; -} - -SfxTabPage* SvxBitmapPickTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new SvxBitmapPickTabPage(pParent, rAttrSet); -} - -void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet) -{ - const SfxPoolItem* pItem; - bPreset = sal_False; - sal_Bool bIsPreset = sal_False; - const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet(); - if(pExampleSet) - { - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, sal_False, &pItem)) - bIsPreset = ((const SfxBoolItem*)pItem)->GetValue(); - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, sal_False, &pItem)) - nActNumLvl = ((const SfxUInt16Item*)pItem)->GetValue(); - } - if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, sal_False, &pItem)) - { - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - } - if(*pSaveNum != *pActNum) - { - *pActNum = *pSaveNum; - pExamplesVS->SetNoSelection(); - } - // ersten Eintrag vorselektieren - if(!aGrfNames.empty() && - (pActNum && (!lcl_IsNumFmtSet(pActNum, nActNumLvl) || bIsPreset))) - { - pExamplesVS->SelectItem(1); - NumSelectHdl_Impl(pExamplesVS); - bPreset = sal_True; - } - bPreset |= bIsPreset; - bModified = sal_False; -} - -int SvxBitmapPickTabPage::DeactivatePage(SfxItemSet *_pSet) -{ - if(_pSet) - FillItemSet(*_pSet); - return sal_True; -} - -sal_Bool SvxBitmapPickTabPage::FillItemSet( SfxItemSet& rSet ) -{ - if ( aGrfNames.empty() ) - { - return sal_False; - } - if( (bPreset || bModified) && pActNum) - { - *pSaveNum = *pActNum; - rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId); - rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, bPreset)); - } - - return bModified; -} - -void SvxBitmapPickTabPage::Reset( const SfxItemSet& rSet ) -{ - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, sal_False, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, sal_False, &pItem); - - if( eState != SFX_ITEM_SET ) - { - pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, sal_True ) ); - eState = SFX_ITEM_SET; - } - - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - - if(!pActNum) - pActNum = new SvxNumRule(*pSaveNum); - else if(*pSaveNum != *pActNum) - *pActNum = *pSaveNum; - if(!pActNum->IsFeatureSupported(NUM_ENABLE_LINKED_BMP)) - { - aLinkedCB.Check(sal_False); - aLinkedCB.Enable(sal_False); - } - else if(!pActNum->IsFeatureSupported(NUM_ENABLE_EMBEDDED_BMP)) - { - aLinkedCB.Check(sal_True); - aLinkedCB.Enable(sal_False); - } -} - -IMPL_LINK(SvxBitmapPickTabPage, NumSelectHdl_Impl, ValueSet*, EMPTYARG) -{ - if(pActNum) - { - bPreset = sal_False; - bModified = sal_True; - sal_uInt16 nIdx = pExamplesVS->GetSelectItemId() - 1; - - sal_uInt16 nMask = 1; - String aEmptyStr; - sal_uInt16 nSetNumberingType = SVX_NUM_BITMAP; - if(aLinkedCB.IsChecked()) - nSetNumberingType |= LINK_TOKEN; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aFmt(pActNum->GetLevel(i)); - aFmt.SetNumberingType(nSetNumberingType); - aFmt.SetPrefix( aEmptyStr ); - aFmt.SetSuffix( aEmptyStr ); - aFmt.SetCharFmtName( sNumCharFmtName ); - - Graphic aGraphic; - if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, nIdx, &aGraphic)) - { - Size aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic); - sal_Int16 eOrient = text::VertOrientation::LINE_CENTER; - aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)eCoreUnit); - SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH ); - aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient ); - } - else if(aGrfNames.size() > nIdx) - aFmt.SetGraphic( aGrfNames[nIdx] ); - pActNum->SetLevel(i, aFmt); - } - nMask <<= 1 ; - } - } - - return 0; -} - -IMPL_LINK(SvxBitmapPickTabPage, DoubleClickHdl_Impl, ValueSet*, EMPTYARG) -{ - NumSelectHdl_Impl(pExamplesVS); - OKButton& rOk = GetTabDialog()->GetOKButton(); - rOk.GetClickHdl().Call(&rOk); - return 0; -} - -IMPL_LINK(SvxBitmapPickTabPage, LinkBmpHdl_Impl, CheckBox*, EMPTYARG ) -{ - if(!pExamplesVS->IsNoSelection()) - { - NumSelectHdl_Impl(pExamplesVS); - } - return 0; -} - -// Tabpage Numerierungsoptionen -#define NUM_NO_GRAPHIC 1000 -SvxNumOptionsTabPage::SvxNumOptionsTabPage(Window* pParent, - const SfxItemSet& rSet) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_NUM_OPTIONS ), rSet ), - - aFormatFL( this, CUI_RES(FL_FORMAT )), - aLevelFT( this, CUI_RES(FT_LEVEL )), - aLevelLB( this, CUI_RES(LB_LEVEL )), - aFmtFT( this, CUI_RES(FT_FMT )), - aFmtLB( this, CUI_RES(LB_FMT )), - aPrefixFT( this, CUI_RES(FT_PREFIX )), - aPrefixED( this, CUI_RES(ED_PREFIX )), - aSuffixFT( this, CUI_RES(FT_SUFFIX )), - aSuffixED( this, CUI_RES(ED_SUFFIX )), - aCharFmtFT( this, CUI_RES(FT_CHARFMT )), - aCharFmtLB( this, CUI_RES(LB_CHARFMT )), - aBulColorFT( this, CUI_RES(FT_BUL_COLOR)), - aBulColLB( this, CUI_RES(LB_BUL_COLOR)), - aBulRelSizeFT( this, CUI_RES(FT_BUL_REL_SIZE)), - aBulRelSizeMF( this, CUI_RES(MF_BUL_REL_SIZE)), - aAllLevelFT( this, CUI_RES(FT_ALL_LEVEL)), - aAllLevelNF( this, CUI_RES(NF_ALL_LEVEL)), - aStartFT( this, CUI_RES(FT_START )), - aStartED( this, CUI_RES(ED_START )), - aBulletPB( this, CUI_RES(PB_BULLET )), - aAlignFT( this, CUI_RES(FT_ALIGN )), - aAlignLB( this, CUI_RES(LB_ALIGN )), - aBitmapFT( this, CUI_RES(FT_BITMAP )), - aBitmapMB( this, CUI_RES(MB_BITMAP )), - aSizeFT( this, CUI_RES(FT_SIZE )), - aWidthMF( this, CUI_RES(MF_WIDTH )), - aMultFT( this, CUI_RES(FT_MULT )), - aHeightMF( this, CUI_RES(MF_HEIGHT )), - aRatioCB( this, CUI_RES(CB_RATIO )), - aOrientFT( this, CUI_RES(FT_ORIENT )), - aOrientLB( this, CUI_RES(LB_ORIENT )), - aSameLevelFL( this, CUI_RES(FL_SAME_LEVEL)), - aSameLevelCB( this, CUI_RES(CB_SAME_LEVEL)), - pPreviewWIN( new SvxNumberingPreview(this, CUI_RES(WIN_PREVIEW ))), - pActNum(0), - pSaveNum(0), - bLastWidthModified(sal_False), - bModified(sal_False), - bPreset(sal_False), - bAutomaticCharStyles(sal_True), - bHTMLMode(sal_False), - bMenuButtonInitialized(sal_False), - sBullet(CUI_RES(STR_BULLET)), - nBullet(0xff), - nActNumLvl(USHRT_MAX), - nNumItemId(SID_ATTR_NUMBERING_RULE) -{ - sStartWith = aStartFT.GetText(); - pPreviewWIN->SetBackground(Wallpaper(Color(COL_TRANSPARENT))); - SetExchangeSupport(); - aActBulletFont = lcl_GetDefaultBulletFont(); - - aBulletPB.SetClickHdl(LINK(this, SvxNumOptionsTabPage, BulletHdl_Impl)); - aFmtLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl)); - aBitmapMB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, GraphicHdl_Impl)); - aLevelLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, LevelHdl_Impl)); - aCharFmtLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, CharFmtHdl_Impl)); - aWidthMF.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl)); - aHeightMF.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, SizeHdl_Impl)); - aRatioCB.SetClickHdl(LINK(this, SvxNumOptionsTabPage, RatioHdl_Impl)); - aStartED.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl)); - aPrefixED.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl)); - aSuffixED.SetModifyHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl)); - aAllLevelNF.SetModifyHdl(LINK(this,SvxNumOptionsTabPage, AllLevelHdl_Impl)); - aOrientLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, OrientHdl_Impl)); - aSameLevelCB.SetClickHdl(LINK(this, SvxNumOptionsTabPage, SameLevelHdl_Impl)); - aBulRelSizeMF.SetModifyHdl(LINK(this,SvxNumOptionsTabPage, BulRelSizeHdl_Impl)); - aBulColLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, BulColorHdl_Impl)); - aInvalidateTimer.SetTimeoutHdl(LINK(this, SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl)); - aInvalidateTimer.SetTimeout(50); - - aBitmapMB.GetPopupMenu()->SetHighlightHdl(LINK(this, SvxNumOptionsTabPage, PopupActivateHdl_Impl)); - PopupMenu* pPopup = new PopupMenu; - aBitmapMB.GetPopupMenu()->SetPopupMenu( MN_GALLERY, pPopup ); - - pPopup->InsertItem( NUM_NO_GRAPHIC, String(CUI_RES(ST_POPUP_EMPTY_ENTRY)) ); - pPopup->EnableItem( NUM_NO_GRAPHIC, sal_False ); - - eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE)); - - aBitmapMB.SetAccessibleRelationLabeledBy( &aBitmapFT ); - - FreeResource(); - - //get advanced numbering types from the component - Reference<XDefaultNumberingProvider> xDefNum = lcl_GetNumberingProvider(); - Reference<XNumberingTypeInfo> xInfo(xDefNum, UNO_QUERY); - - // Extended numbering schemes present in the resource but not offered by - // the i18n framework per configuration must be removed from the listbox. - // Watch out for the ugly 0x88/*SVX_NUM_BITMAP|0x80*/ to not remove that. - const sal_uInt16 nDontRemove = 0xffff; - ::std::vector< sal_uInt16> aRemove( aFmtLB.GetEntryCount(), nDontRemove); - for (size_t i=0; i<aRemove.size(); ++i) - { - sal_uInt16 nEntryData = (sal_uInt16)(sal_uLong)aFmtLB.GetEntryData( - sal::static_int_cast< sal_uInt16 >(i)); - if (nEntryData > NumberingType::CHARS_LOWER_LETTER_N && - nEntryData != (SVX_NUM_BITMAP | 0x80)) - aRemove[i] = nEntryData; - } - if(xInfo.is()) - { - Sequence<sal_Int16> aTypes = xInfo->getSupportedNumberingTypes( ); - const sal_Int16* pTypes = aTypes.getConstArray(); - for(sal_Int32 nType = 0; nType < aTypes.getLength(); nType++) - { - sal_Int16 nCurrent = pTypes[nType]; - if(nCurrent > NumberingType::CHARS_LOWER_LETTER_N) - { - sal_Bool bInsert = sal_True; - for(sal_uInt16 nEntry = 0; nEntry < aFmtLB.GetEntryCount(); nEntry++) - { - sal_uInt16 nEntryData = (sal_uInt16)(sal_uLong)aFmtLB.GetEntryData(nEntry); - if(nEntryData == (sal_uInt16) nCurrent) - { - bInsert = sal_False; - aRemove[nEntry] = nDontRemove; - break; - } - } - if(bInsert) - { - OUString aIdent = xInfo->getNumberingIdentifier( nCurrent ); - sal_uInt16 nPos = aFmtLB.InsertEntry(aIdent); - aFmtLB.SetEntryData(nPos,(void*)(sal_uLong)nCurrent); - } - } - } - } - for (size_t i=0; i<aRemove.size(); ++i) - { - if (aRemove[i] != nDontRemove) - { - sal_uInt16 nPos = aFmtLB.GetEntryPos( (void*)(sal_uLong)aRemove[i]); - aFmtLB.RemoveEntry( nPos); - } - } - - aBulletPB.SetAccessibleRelationMemberOf(&aFormatFL); - aBulletPB.SetAccessibleRelationLabeledBy(&aStartFT); - aBulletPB.SetAccessibleName(aStartFT.GetText()); -} - -SvxNumOptionsTabPage::~SvxNumOptionsTabPage() -{ - delete aBitmapMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY ); - delete pActNum; - delete pPreviewWIN; - delete pSaveNum; -} - -void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric) -{ - if(eMetric == FUNIT_MM) - { - aWidthMF .SetDecimalDigits(1); - aHeightMF .SetDecimalDigits(1); - } - aWidthMF .SetUnit( eMetric ); - aHeightMF .SetUnit( eMetric ); -} - -SfxTabPage* SvxNumOptionsTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new SvxNumOptionsTabPage(pParent, rAttrSet); -}; - -void SvxNumOptionsTabPage::ActivatePage(const SfxItemSet& rSet) -{ - const SfxPoolItem* pItem; - const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet(); - sal_uInt16 nTmpNumLvl = USHRT_MAX; - if(pExampleSet) - { - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, sal_False, &pItem)) - bPreset = ((const SfxBoolItem*)pItem)->GetValue(); - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, sal_False, &pItem)) - nTmpNumLvl = ((const SfxUInt16Item*)pItem)->GetValue(); - } - if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, sal_False, &pItem)) - { - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - } - // - bModified = (!pActNum->Get( 0 ) || bPreset); - if(*pActNum != *pSaveNum || - nActNumLvl != nTmpNumLvl) - { - nActNumLvl = nTmpNumLvl; - sal_uInt16 nMask = 1; - aLevelLB.SetUpdateMode(sal_False); - aLevelLB.SetNoSelection(); - aLevelLB.SelectEntryPos( pActNum->GetLevelCount(), nActNumLvl == USHRT_MAX); - if(nActNumLvl != USHRT_MAX) - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - aLevelLB.SelectEntryPos( i, sal_True); - nMask <<= 1 ; - } - aLevelLB.SetUpdateMode(sal_True); - *pActNum = *pSaveNum; - InitControls(); - } - -} - -int SvxNumOptionsTabPage::DeactivatePage(SfxItemSet * _pSet) -{ - if(_pSet) - FillItemSet(*_pSet); - return sal_True; -} - -sal_Bool SvxNumOptionsTabPage::FillItemSet( SfxItemSet& rSet ) -{ - rSet.Put(SfxUInt16Item(SID_PARAM_CUR_NUM_LEVEL, nActNumLvl)); - if(bModified && pActNum) - { - *pSaveNum = *pActNum; - rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId); - rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, sal_False)); - } - return bModified; -}; - -void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet ) -{ - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, sal_False, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, sal_False, &pItem); - - if( eState != SFX_ITEM_SET ) - { - pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, sal_True ) ); - eState = SFX_ITEM_SET; - } - - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - - // Ebenen einfuegen - if(!aLevelLB.GetEntryCount()) - { - for(sal_uInt16 i = 1; i <= pSaveNum->GetLevelCount(); i++) - aLevelLB.InsertEntry( UniString::CreateFromInt32(i)); - if(pSaveNum->GetLevelCount() > 1) - { - String sEntry( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "1 - " ) ) ); - sEntry += UniString::CreateFromInt32( pSaveNum->GetLevelCount() ); - aLevelLB.InsertEntry(sEntry); - aLevelLB.SelectEntry(sEntry); - } - else - aLevelLB.SelectEntryPos(0); - } - else - aLevelLB.SelectEntryPos(aLevelLB.GetEntryCount() - 1); - - sal_uInt16 nMask = 1; - aLevelLB.SetUpdateMode(sal_False); - aLevelLB.SetNoSelection(); - if(nActNumLvl == USHRT_MAX) - { - aLevelLB.SelectEntryPos( pSaveNum->GetLevelCount(), sal_True); - } - else - for(sal_uInt16 i = 0; i < pSaveNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - aLevelLB.SelectEntryPos( i, sal_True); - nMask <<= 1 ; - } - aLevelLB.SetUpdateMode(sal_True); - - if(!pActNum) - pActNum = new SvxNumRule(*pSaveNum); - else if(*pSaveNum != *pActNum) - *pActNum = *pSaveNum; - pPreviewWIN->SetNumRule(pActNum); - aSameLevelCB.Check(pActNum->IsContinuousNumbering()); - - //ColorListBox bei Bedarf fuellen - if ( pActNum->IsFeatureSupported( NUM_BULLET_COLOR ) ) - { - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - DBG_ASSERT( pDocSh, "DocShell not found!" ); - XColorTable* pColorTable = NULL; - bool bKillTable = false; - if ( pDocSh ) - { - pItem = pDocSh->GetItem( SID_COLOR_TABLE ); - if ( pItem ) - pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable(); - } - - if ( !pColorTable ) - { - pColorTable = new XColorTable( SvtPathOptions().GetPalettePath() ); - bKillTable = true; - } - - aBulColLB.InsertEntry( Color( COL_AUTO ), SVX_RESSTR( RID_SVXSTR_AUTOMATIC )); - - for ( long i = 0; i < pColorTable->Count(); i++ ) - { - XColorEntry* pEntry = pColorTable->GetColor(i); - aBulColLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - } - - if ( bKillTable ) - delete pColorTable; - } - - SfxObjectShell* pShell; - if ( SFX_ITEM_SET == rSet.GetItemState( SID_HTML_MODE, sal_False, &pItem ) - || ( 0 != ( pShell = SfxObjectShell::Current()) && - 0 != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) ) - { - sal_uInt16 nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue(); - bHTMLMode = 0 != (nHtmlMode&HTMLMODE_ON); - } - - sal_Bool bCharFmt = pActNum->IsFeatureSupported(NUM_CHAR_STYLE); - aCharFmtFT.Show(bCharFmt); - aCharFmtLB.Show(bCharFmt); - - sal_Bool bContinuous = pActNum->IsFeatureSupported(NUM_CONTINUOUS); - - sal_Bool bAllLevel = bContinuous && !bHTMLMode; - aAllLevelFT.Show(bAllLevel); - aAllLevelNF.Show(bAllLevel); - - aSameLevelFL.Show(bContinuous); - aSameLevelCB.Show(bContinuous); - //wieder Missbrauch: im Draw gibt es die Numerierung nur bis zum Bitmap - // without SVX_NUM_NUMBER_NONE - //remove types that are unsupported by Draw/Impress - if(!bContinuous) - { - sal_uInt16 nFmtCount = aFmtLB.GetEntryCount(); - for(sal_uInt16 i = nFmtCount; i; i--) - { - sal_uInt16 nEntryData = (sal_uInt16)(sal_uLong)aFmtLB.GetEntryData(i - 1); - if(/*SVX_NUM_NUMBER_NONE == nEntryData ||*/ - ((SVX_NUM_BITMAP|LINK_TOKEN) == nEntryData)) - aFmtLB.RemoveEntry(i - 1); - } - } - //one must be enabled - if(!pActNum->IsFeatureSupported(NUM_ENABLE_LINKED_BMP)) - { - long nData = SVX_NUM_BITMAP|LINK_TOKEN; - sal_uInt16 nPos = aFmtLB.GetEntryPos((void*)nData); - if(LISTBOX_ENTRY_NOTFOUND != nPos) - aFmtLB.RemoveEntry(nPos); - } - else if(!pActNum->IsFeatureSupported(NUM_ENABLE_EMBEDDED_BMP)) - { - long nData = SVX_NUM_BITMAP; - sal_uInt16 nPos = aFmtLB.GetEntryPos((void*)nData); - if(LISTBOX_ENTRY_NOTFOUND != nPos) - aFmtLB.RemoveEntry(nPos); - } - if(pActNum->IsFeatureSupported(NUM_SYMBOL_ALIGNMENT)) - { - aAlignFT.Show(); - aAlignLB.Show(); - Size aSz(aFormatFL.GetSizePixel()); - aSz.Height() = aLevelFT.GetSizePixel().Height(); - aFormatFL.SetSizePixel(aSz); - aAlignLB.SetSelectHdl(LINK(this, SvxNumOptionsTabPage, EditModifyHdl_Impl)); - } - - //MegaHack: Aufgrund eines nicht fixbaren 'designfehlers' im Impress - //Alle arten der numerischen Aufzaehlungen loeschen - if(pActNum->IsFeatureSupported(NUM_NO_NUMBERS)) - { - sal_uInt16 nFmtCount = aFmtLB.GetEntryCount(); - for(sal_uInt16 i = nFmtCount; i; i--) - { - sal_uInt16 nEntryData = (sal_uInt16)(sal_uLong)aFmtLB.GetEntryData(i - 1); - if( /*nEntryData >= SVX_NUM_CHARS_UPPER_LETTER &&*/ nEntryData <= SVX_NUM_NUMBER_NONE) - aFmtLB.RemoveEntry(i - 1); - } - } - - InitControls(); - bModified = sal_False; - -} - -void SvxNumOptionsTabPage::InitControls() -{ - sal_Bool bShowBullet = sal_True; - sal_Bool bShowBitmap = sal_True; - sal_Bool bSameType = sal_True; - sal_Bool bSameStart = sal_True; - sal_Bool bSamePrefix = sal_True; - sal_Bool bSameSuffix = sal_True; - sal_Bool bAllLevel = sal_True; - sal_Bool bSameCharFmt = sal_True; - sal_Bool bSameVOrient = sal_True; - sal_Bool bSameSize = sal_True; - sal_Bool bSameBulColor = sal_True; - sal_Bool bSameBulRelSize= sal_True; - sal_Bool bSameAdjust = sal_True; - - const SvxNumberFormat* aNumFmtArr[SVX_MAX_NUM]; - String sFirstCharFmt; - sal_Int16 eFirstOrient = text::VertOrientation::NONE; - Size aFirstSize(0,0); - sal_uInt16 nMask = 1; - sal_uInt16 nLvl = USHRT_MAX; - sal_uInt16 nHighestLevel = 0; - String aEmptyStr; - - sal_Bool bBullColor = pActNum->IsFeatureSupported(NUM_BULLET_COLOR); - sal_Bool bBullRelSize = pActNum->IsFeatureSupported(NUM_BULLET_REL_SIZE); - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - aNumFmtArr[i] = &pActNum->GetLevel(i); - bShowBullet &= aNumFmtArr[i]->GetNumberingType() == SVX_NUM_CHAR_SPECIAL; - bShowBitmap &= (aNumFmtArr[i]->GetNumberingType()&(~LINK_TOKEN)) == SVX_NUM_BITMAP; - if(USHRT_MAX == nLvl) - { - nLvl = i; - sFirstCharFmt = aNumFmtArr[i]->GetCharFmtName(); - eFirstOrient = aNumFmtArr[i]->GetVertOrient(); - if(bShowBitmap) - aFirstSize = aNumFmtArr[i]->GetGraphicSize(); - } - if( i > nLvl) - { - bSameType &= aNumFmtArr[i]->GetNumberingType() == aNumFmtArr[nLvl]->GetNumberingType(); - bSameStart = aNumFmtArr[i]->GetStart() == aNumFmtArr[nLvl]->GetStart(); - - bSamePrefix = aNumFmtArr[i]->GetPrefix() == aNumFmtArr[nLvl]->GetPrefix(); - bSameSuffix = aNumFmtArr[i]->GetSuffix() == aNumFmtArr[nLvl]->GetSuffix(); - bAllLevel &= aNumFmtArr[i]->GetIncludeUpperLevels() == aNumFmtArr[nLvl]->GetIncludeUpperLevels(); - bSameCharFmt &= sFirstCharFmt == aNumFmtArr[i]->GetCharFmtName(); - bSameVOrient &= eFirstOrient == aNumFmtArr[i]->GetVertOrient(); - if(bShowBitmap && bSameSize) - bSameSize &= aNumFmtArr[i]->GetGraphicSize() == aFirstSize; - bSameBulColor &= aNumFmtArr[i]->GetBulletColor() == aNumFmtArr[nLvl]->GetBulletColor(); - bSameBulRelSize &= aNumFmtArr[i]->GetBulletRelSize() == aNumFmtArr[nLvl]->GetBulletRelSize(); - bSameAdjust &= aNumFmtArr[i]->GetNumAdjust() == aNumFmtArr[nLvl]->GetNumAdjust(); - } - nHighestLevel = i; - } - else - aNumFmtArr[i] = 0; - - nMask <<= 1 ; - - } - SwitchNumberType(bShowBullet ? 1 : bShowBitmap ? 2 : 0); - CheckForStartValue_Impl(aNumFmtArr[nLvl]->GetNumberingType()); - if(bShowBitmap) - { - if(!bSameVOrient || eFirstOrient == text::VertOrientation::NONE) - aOrientLB.SetNoSelection(); - else - aOrientLB.SelectEntryPos( - sal::static_int_cast< sal_uInt16 >(eFirstOrient - 1)); - // kein text::VertOrientation::NONE - - if(bSameSize) - { - SetMetricValue(aHeightMF, aFirstSize.Height(), eCoreUnit); - SetMetricValue(aWidthMF, aFirstSize.Width(), eCoreUnit); - } - else - { - aHeightMF.SetText(aEmptyStr); - aWidthMF.SetText(aEmptyStr); - } - } - - if(bSameType) - { - sal_uInt16 nLBData = (sal_uInt16) aNumFmtArr[nLvl]->GetNumberingType(); - aFmtLB.SelectEntryPos(aFmtLB.GetEntryPos( (void*)sal::static_int_cast<sal_uIntPtr>( nLBData ) )); - } - else - aFmtLB.SetNoSelection(); - - aAllLevelNF.Enable(nHighestLevel > 0 && !aSameLevelCB.IsChecked()); - aAllLevelNF.SetMax(nHighestLevel + 1); - if(bAllLevel) - { - aAllLevelNF.SetValue(aNumFmtArr[nLvl]->GetIncludeUpperLevels()); - } - else - { - aAllLevelNF.SetText(aEmptyStr); - } - if(bSameAdjust) - { - sal_uInt16 nPos = 1; // zentriert - if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT) - nPos = 0; - else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT) - nPos = 2; - aAlignLB.SelectEntryPos(nPos); - } - else - { - aAlignLB.SetNoSelection(); - } - - if(bBullRelSize) - { - if(bSameBulRelSize) - aBulRelSizeMF.SetValue(aNumFmtArr[nLvl]->GetBulletRelSize()); - else - aBulRelSizeMF.SetText(aEmptyStr); - } - if(bBullColor) - { - if(bSameBulColor) - aBulColLB.SelectEntry(aNumFmtArr[nLvl]->GetBulletColor()); - else - aBulColLB.SetNoSelection(); - } - switch(nBullet) - { - case SHOW_NUMBERING: - if(bSameStart) - { - aStartED.SetValue(aNumFmtArr[nLvl]->GetStart()); - } - else - aStartED.SetText(aEmptyStr); - break; - case SHOW_BULLET: - break; - case SHOW_BITMAP: - break; - } - - if(bSamePrefix) - aPrefixED.SetText(aNumFmtArr[nLvl]->GetPrefix()); - else - aPrefixED.SetText(aEmptyStr); - if(bSameSuffix) - aSuffixED.SetText(aNumFmtArr[nLvl]->GetSuffix()); - else - aSuffixED.SetText(aEmptyStr); - - if(bSameCharFmt) - { - if(sFirstCharFmt.Len()) - aCharFmtLB.SelectEntry(sFirstCharFmt); - else - aCharFmtLB.SelectEntryPos( 0 ); - } - else - aCharFmtLB.SetNoSelection(); - - pPreviewWIN->SetLevel(nActNumLvl); - pPreviewWIN->Invalidate(); -} - -// 0 - Nummer; 1 - Bullet; 2 - Bitmap -void SvxNumOptionsTabPage::SwitchNumberType( sal_uInt8 nType, sal_Bool ) -{ - if(nBullet == nType) - return; - nBullet = nType; - sal_Bool bBitmap = sal_False; - sal_Bool bBullet = sal_False; - sal_Bool bEnableBitmap = sal_False; - if(nType == SHOW_NUMBERING) - { - // Label umschalten, alten Text merken - aStartFT.SetText(sStartWith); - - } - else if(nType == SHOW_BULLET) - { - // Label umschalten, alten Text merken - aStartFT.SetText(sBullet); - bBullet = sal_True; - } - else - { - bBitmap = sal_True; - bEnableBitmap = sal_True; - } - sal_Bool bNumeric = !(bBitmap||bBullet); - aPrefixFT.Show(bNumeric); - aPrefixED.Show(bNumeric); - aSuffixFT.Show(bNumeric); - aSuffixED.Show(bNumeric); - - sal_Bool bCharFmt = pActNum->IsFeatureSupported(NUM_CHAR_STYLE); - aCharFmtFT.Show(!bBitmap && bCharFmt); - aCharFmtLB.Show(!bBitmap && bCharFmt); - - // das ist eigentlich Missbrauch, da fuer die vollst. Numerierung kein - // eigenes Flag existiert - sal_Bool bAllLevelFeature = pActNum->IsFeatureSupported(NUM_CONTINUOUS); - sal_Bool bAllLevel = bNumeric && bAllLevelFeature && !bHTMLMode; - aAllLevelFT.Show(bAllLevel); - aAllLevelNF.Show(bAllLevel); - - aStartFT.Show(!bBitmap); - aStartED.Show(!(bBullet||bBitmap)); - - aBulletPB.Show(bBullet); - sal_Bool bBullColor = pActNum->IsFeatureSupported(NUM_BULLET_COLOR); - aBulColorFT.Show( !bBitmap && bBullColor ); - aBulColLB.Show( !bBitmap && bBullColor ); - sal_Bool bBullResSize = pActNum->IsFeatureSupported(NUM_BULLET_REL_SIZE); - aBulRelSizeFT.Show( !bBitmap && bBullResSize ); - aBulRelSizeMF.Show( !bBitmap && bBullResSize ); - - aBitmapFT .Show(bBitmap); - aBitmapMB .Show(bBitmap); - - aSizeFT .Show(bBitmap); - aWidthMF .Show(bBitmap); - aMultFT .Show(bBitmap); - aHeightMF .Show(bBitmap); - aRatioCB .Show(bBitmap); - - aOrientFT .Show(bBitmap && bAllLevelFeature); - aOrientLB .Show(bBitmap && bAllLevelFeature); - - aSizeFT .Enable(bEnableBitmap); - aWidthMF .Enable(bEnableBitmap); - aMultFT .Enable(bEnableBitmap); - aHeightMF .Enable(bEnableBitmap); - aRatioCB .Enable(bEnableBitmap); - aOrientFT .Enable(bEnableBitmap); - aOrientLB .Enable(bEnableBitmap); - -} - -IMPL_LINK( SvxNumOptionsTabPage, LevelHdl_Impl, ListBox *, pBox ) -{ - sal_uInt16 nSaveNumLvl = nActNumLvl; - nActNumLvl = 0; - if(pBox->IsEntryPosSelected( pActNum->GetLevelCount() ) && - (pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) - { - nActNumLvl = 0xFFFF; - pBox->SetUpdateMode(sal_False); - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - pBox->SelectEntryPos( i, sal_False ); - pBox->SetUpdateMode(sal_True); - } - else if(pBox->GetSelectEntryCount()) - { - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - { - if(pBox->IsEntryPosSelected( i )) - nActNumLvl |= nMask; - nMask <<= 1; - } - pBox->SelectEntryPos( pActNum->GetLevelCount(), sal_False ); - } - else - { - nActNumLvl = nSaveNumLvl; - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - { - if(nActNumLvl & nMask) - { - pBox->SelectEntryPos(i); - break; - } - nMask <<=1; - } - } - InitControls(); - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, PreviewInvalidateHdl_Impl, Timer*, EMPTYARG ) -{ - pPreviewWIN->Invalidate(); - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, AllLevelHdl_Impl, NumericField*, pBox ) -{ - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - sal_uInt16 nMask = 1; - for(sal_uInt16 e = 0; e < pActNum->GetLevelCount(); e++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(e)); - aNumFmt.SetIncludeUpperLevels((sal_uInt8) std::min(pBox->GetValue(), sal_Int64(e + 1)) ); - pActNum->SetLevel(e, aNumFmt); - } - nMask <<= 1; - } - } - SetModified(); - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox ) -{ - String sSelectStyle; - sal_Bool bShowOrient = sal_False; - sal_Bool bBmp = sal_False; - String aEmptyStr; - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - // PAGEDESC gibt es nicht - sal_uInt16 nNumType = (sal_uInt16)(sal_uLong)pBox->GetEntryData(pBox->GetSelectEntryPos()); - aNumFmt.SetNumberingType((sal_Int16)nNumType); - sal_uInt16 nNumberingType = aNumFmt.GetNumberingType(); - if(SVX_NUM_BITMAP == (nNumberingType&(~LINK_TOKEN))) - { - bBmp |= 0 != aNumFmt.GetBrush(); - aNumFmt.SetIncludeUpperLevels( sal_False ); - aNumFmt.SetSuffix( aEmptyStr ); - aNumFmt.SetPrefix( aEmptyStr ); - if(!bBmp) - aNumFmt.SetGraphic(aEmptyStr); - pActNum->SetLevel(i, aNumFmt); - SwitchNumberType(SHOW_BITMAP, bBmp ); - bShowOrient = sal_True; - } - else if( SVX_NUM_CHAR_SPECIAL == nNumberingType ) - { - aNumFmt.SetIncludeUpperLevels( sal_False ); - aNumFmt.SetSuffix( aEmptyStr ); - aNumFmt.SetPrefix( aEmptyStr ); - if( !aNumFmt.GetBulletFont() ) - aNumFmt.SetBulletFont(&aActBulletFont); - if( !aNumFmt.GetBulletChar() ) - aNumFmt.SetBulletChar( SVX_DEF_BULLET ); - pActNum->SetLevel(i, aNumFmt); - SwitchNumberType(SHOW_BULLET); - // Zuweisung der Zeichenvorlage automatisch - if(bAutomaticCharStyles) - { - sSelectStyle = sBulletCharFmtName; - } - } - else - { - aNumFmt.SetPrefix( aPrefixED.GetText() ); - aNumFmt.SetSuffix( aSuffixED.GetText() ); - SwitchNumberType(SHOW_NUMBERING); - pActNum->SetLevel(i, aNumFmt); - CheckForStartValue_Impl(nNumberingType); - - // Zuweisung der Zeichenvorlage automatisch - if(bAutomaticCharStyles) - { - sSelectStyle = sNumCharFmtName; - } - } - } - nMask <<= 1; - } - sal_Bool bAllLevelFeature = pActNum->IsFeatureSupported(NUM_CONTINUOUS); - if(bShowOrient && bAllLevelFeature) - { - aOrientFT.Show(); - aOrientLB.Show(); - } - else - { - aOrientFT.Hide(); - aOrientLB.Hide(); - } - SetModified(); - if(sSelectStyle.Len()) - { - aCharFmtLB.SelectEntry(sSelectStyle); - CharFmtHdl_Impl(&aCharFmtLB); - bAutomaticCharStyles = sal_True; - } - return 0; -} - -void SvxNumOptionsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType) -{ - sal_Bool bIsNull = aStartED.GetValue() == 0; - sal_Bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC || - SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType || - SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType; - aStartED.SetMin(bNoZeroAllowed ? 1 : 0); - if(bIsNull && bNoZeroAllowed) - aStartED.GetModifyHdl().Call(&aStartED); -} - -IMPL_LINK( SvxNumOptionsTabPage, OrientHdl_Impl, ListBox *, pBox ) -{ - sal_uInt16 nPos = pBox->GetSelectEntryPos(); - nPos ++; // kein VERT_NONE - - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - if(SVX_NUM_BITMAP == (aNumFmt.GetNumberingType()&(~LINK_TOKEN))) - { - const SvxBrushItem* pBrushItem = aNumFmt.GetBrush(); - const Size& rSize = aNumFmt.GetGraphicSize(); - sal_Int16 eOrient = (sal_Int16)nPos; - aNumFmt.SetGraphicBrush( pBrushItem, &rSize, &eOrient ); - pActNum->SetLevel(i, aNumFmt); - } - } - nMask <<= 1; - } - SetModified(sal_False); - return 0; - -} - -IMPL_LINK( SvxNumOptionsTabPage, SameLevelHdl_Impl, CheckBox *, pBox ) -{ - sal_Bool bSet = pBox->IsChecked(); - pActNum->SetContinuousNumbering(bSet); - sal_Bool bRepaint = sal_False; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - if(aNumFmt.GetNumberingType() != SVX_NUM_NUMBER_NONE) - { - bRepaint = sal_True; - break; - } - } - SetModified(bRepaint); - InitControls(); - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, BulColorHdl_Impl, ColorListBox*, pBox ) -{ - Color nSetColor = pBox->GetSelectEntryColor(); - - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - aNumFmt.SetBulletColor(nSetColor); - pActNum->SetLevel(i, aNumFmt); - } - nMask <<= 1; - } - SetModified(); - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, BulRelSizeHdl_Impl, MetricField *, pField) -{ - sal_uInt16 nRelSize = (sal_uInt16)pField->GetValue(); - - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - aNumFmt.SetBulletRelSize(nRelSize); - pActNum->SetLevel(i, aNumFmt); - } - nMask <<= 1; - } - SetModified(); - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, GraphicHdl_Impl, MenuButton *, pButton ) -{ - sal_uInt16 nItemId = pButton->GetCurItemId(); - String aGrfName; - Size aSize; - sal_Bool bSucc(sal_False); - SvxOpenGraphicDialog aGrfDlg( CUI_RES(RID_STR_EDIT_GRAPHIC) ); - - if(MN_GALLERY_ENTRY <= nItemId ) - { - sal_uInt16 idx = nItemId - MN_GALLERY_ENTRY; - if (idx < aGrfNames.size()) - { - aGrfName = aGrfNames[idx]; - Graphic aGraphic; - if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, idx, &aGraphic)) - { - aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic); - bSucc = sal_True; - } - } - } - else - { - aGrfDlg.EnableLink( sal_False ); - aGrfDlg.AsLink( sal_False ); - if ( !aGrfDlg.Execute() ) - { - // ausgewaehlten Filter merken - aGrfName = aGrfDlg.GetPath(); - - Graphic aGraphic; - if( !aGrfDlg.GetGraphic(aGraphic) ) - { - aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic); - bSucc = sal_True; - } - } - } - if(bSucc) - { - aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)eCoreUnit); - - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - aNumFmt.SetCharFmtName(sNumCharFmtName); - aNumFmt.SetGraphic(aGrfName); - - // Size schon mal fuer spaeteren Groessenabgleich setzen - const SvxBrushItem* pBrushItem = aNumFmt.GetBrush(); - // initiate asynchronous loading - sal_Int16 eOrient = aNumFmt.GetVertOrient(); - aNumFmt.SetGraphicBrush( pBrushItem, &aSize, &eOrient ); - aInitSize[i] = aNumFmt.GetGraphicSize(); - - pActNum->SetLevel(i, aNumFmt); - } - nMask <<= 1; - } - aRatioCB .Enable(); - aSizeFT .Enable(); - aMultFT.Enable(); - aWidthMF .Enable(); - aHeightMF.Enable(); - SetMetricValue(aWidthMF, aSize.Width(), eCoreUnit); - SetMetricValue(aHeightMF, aSize.Height(), eCoreUnit); - aOrientFT.Enable(); - aOrientLB.Enable(); - SetModified(); - //needed due to asynchronous loading of graphics in the SvxBrushItem - aInvalidateTimer.Start(); - } - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, PopupActivateHdl_Impl, Menu *, EMPTYARG ) -{ - if(!bMenuButtonInitialized) - { - bMenuButtonInitialized = sal_True; - EnterWait(); - PopupMenu* pPopup = aBitmapMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY ); - - if(GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames)) - { - pPopup->RemoveItem( pPopup->GetItemPos( NUM_NO_GRAPHIC )); - GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS); - - Graphic aGraphic; - String sGrfName; - std::vector<String>::const_iterator it = aGrfNames.begin(); - for(sal_uInt16 i = 0; it != aGrfNames.end(); ++it, ++i) - { - sGrfName = *it; - INetURLObject aObj(sGrfName); - if(aObj.GetProtocol() == INET_PROT_FILE) - sGrfName = aObj.PathToFileName(); - - if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, i, &aGraphic)) - { - Bitmap aBitmap(aGraphic.GetBitmap()); - Size aSize(aBitmap.GetSizePixel()); - if(aSize.Width() > MAX_BMP_WIDTH || - aSize.Height() > MAX_BMP_HEIGHT) - { - sal_Bool bWidth = aSize.Width() > aSize.Height(); - double nScale = bWidth ? - (double)MAX_BMP_WIDTH / (double)aSize.Width(): - (double)MAX_BMP_HEIGHT / (double)aSize.Height(); - aBitmap.Scale(nScale, nScale); - } - Image aImage(aBitmap); - - pPopup->InsertItem(MN_GALLERY_ENTRY + i, sGrfName, aImage ); - } - else - { - Image aImage; - pPopup->InsertItem( - MN_GALLERY_ENTRY + i, sGrfName, aImage ); - } - } - GalleryExplorer::EndLocking(GALLERY_THEME_BULLETS); - } - LeaveWait(); - } - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, BulletHdl_Impl, Button *, EMPTYARG ) -{ - SvxCharacterMap* pMap = new SvxCharacterMap( this, sal_True ); - - sal_uInt16 nMask = 1; - const Font* pFmtFont = 0; - sal_Bool bSameBullet = sal_True; - sal_Unicode cBullet = 0; - sal_Bool bFirst = sal_True; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - const SvxNumberFormat& rCurFmt = pActNum->GetLevel(i); - if(bFirst) - { - cBullet = rCurFmt.GetBulletChar(); - } - else if(rCurFmt.GetBulletChar() != cBullet ) - { - bSameBullet = sal_False; - break; - } - if(!pFmtFont) - pFmtFont = rCurFmt.GetBulletFont(); - bFirst = sal_False; - } - nMask <<= 1; - - } - - if(pFmtFont) - pMap->SetCharFont(*pFmtFont); - else - pMap->SetCharFont(aActBulletFont); - if(bSameBullet) - pMap->SetChar( cBullet ); - if(pMap->Execute() == RET_OK) - { - // Font Numrules umstellen - aActBulletFont = pMap->GetCharFont(); - - sal_uInt16 _nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & _nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - aNumFmt.SetBulletFont(&aActBulletFont); ; - aNumFmt.SetBulletChar( (sal_Unicode) pMap->GetChar() ); - pActNum->SetLevel(i, aNumFmt); - } - _nMask <<= 1; - } - - SetModified(); - } - delete pMap; - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, MetricField *, pField) -{ - sal_Bool bWidth = pField == &aWidthMF; - bLastWidthModified = bWidth; - sal_Bool bRatio = aRatioCB.IsChecked(); - long nWidthVal = static_cast<long>(aWidthMF.Denormalize(aWidthMF.GetValue(FUNIT_100TH_MM))); - long nHeightVal = static_cast<long>(aHeightMF.Denormalize(aHeightMF.GetValue(FUNIT_100TH_MM))); - nWidthVal = OutputDevice::LogicToLogic( nWidthVal , - MAP_100TH_MM, (MapUnit)eCoreUnit ); - nHeightVal = OutputDevice::LogicToLogic( nHeightVal, - MAP_100TH_MM, (MapUnit)eCoreUnit); - double fSizeRatio; - - sal_Bool bRepaint = sal_False; - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - if(SVX_NUM_BITMAP == (aNumFmt.GetNumberingType()&(~LINK_TOKEN))) - { - Size aSize(aNumFmt.GetGraphicSize() ); - Size aSaveSize(aSize); - - if (aInitSize[i].Height()) - fSizeRatio = (double)aInitSize[i].Width() / (double)aInitSize[i].Height(); - else - fSizeRatio = (double)1; - - if(bWidth) - { - long nDelta = nWidthVal - aInitSize[i].Width(); - aSize.Width() = nWidthVal; - if (bRatio) - { - aSize.Height() = aInitSize[i].Height() + (long)((double)nDelta / fSizeRatio); - aHeightMF.SetUserValue(aHeightMF.Normalize( - OutputDevice::LogicToLogic( aSize.Height(), (MapUnit)eCoreUnit, MAP_100TH_MM )), - FUNIT_100TH_MM); - } - } - else - { - long nDelta = nHeightVal - aInitSize[i].Height(); - aSize.Height() = nHeightVal; - if (bRatio) - { - aSize.Width() = aInitSize[i].Width() + (long)((double)nDelta * fSizeRatio); - aWidthMF.SetUserValue(aWidthMF.Normalize( - OutputDevice::LogicToLogic( aSize.Width(), (MapUnit)eCoreUnit, MAP_100TH_MM )), - FUNIT_100TH_MM); - } - } - const SvxBrushItem* pBrushItem = aNumFmt.GetBrush(); - sal_Int16 eOrient = aNumFmt.GetVertOrient(); - if(aSize != aSaveSize) - bRepaint = sal_True; - aNumFmt.SetGraphicBrush( pBrushItem, &aSize, &eOrient ); - pActNum->SetLevel(i, aNumFmt); - } - } - nMask <<= 1; - } - SetModified(bRepaint); - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, RatioHdl_Impl, CheckBox *, pBox ) -{ - if (pBox->IsChecked()) - { - if (bLastWidthModified) - SizeHdl_Impl(&aWidthMF); - else - SizeHdl_Impl(&aHeightMF); - } - return 0; -} - -IMPL_LINK( SvxNumOptionsTabPage, CharFmtHdl_Impl, ListBox *, EMPTYARG ) -{ - bAutomaticCharStyles = sal_False; - sal_uInt16 nEntryPos = aCharFmtLB.GetSelectEntryPos(); - String sEntry = aCharFmtLB.GetSelectEntry(); - sal_uInt16 nMask = 1; - String aEmptyStr; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - if( 0 == nEntryPos ) - aNumFmt.SetCharFmtName(aEmptyStr); - else - { - if(SVX_NUM_BITMAP != (aNumFmt.GetNumberingType()&(~LINK_TOKEN))) - aNumFmt.SetCharFmtName(sEntry); - } - pActNum->SetLevel(i, aNumFmt); - } - nMask <<= 1; - } - SetModified(sal_False); - return 0; - -}; - -IMPL_LINK( SvxNumOptionsTabPage, EditModifyHdl_Impl, Edit *, pEdit ) -{ - sal_Bool bPrefix = pEdit == &aPrefixED; - sal_Bool bSuffix = pEdit == &aSuffixED; - sal_Bool bStart = pEdit == &aStartED; - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - if(bPrefix) - aNumFmt.SetPrefix( aPrefixED.GetText() ); - else if(bSuffix) - aNumFmt.SetSuffix( aSuffixED.GetText() ); - else if(bStart) - aNumFmt.SetStart( (sal_uInt16)aStartED.GetValue() ); - else //align - { - sal_uInt16 nPos = aAlignLB.GetSelectEntryPos(); - SvxAdjust eAdjust = SVX_ADJUST_CENTER; - if(nPos == 0) - eAdjust = SVX_ADJUST_LEFT; - else if(nPos == 2) - eAdjust = SVX_ADJUST_RIGHT; - aNumFmt.SetNumAdjust( eAdjust ); - } - pActNum->SetLevel(i, aNumFmt); - } - nMask <<= 1; - } - SetModified(); - - return 0; -} - -sal_uInt16 lcl_DrawGraphic(VirtualDevice* pVDev, const SvxNumberFormat &rFmt, sal_uInt16 nXStart, - sal_uInt16 nYStart, sal_uInt16 nDivision) -{ - const SvxBrushItem* pBrushItem = rFmt.GetBrush(); - sal_uInt16 nRet = 0; - if(pBrushItem) - { - const Graphic* pGrf = pBrushItem->GetGraphic(); - if(pGrf) - { - Size aGSize( rFmt.GetGraphicSize() ); - aGSize.Width() /= nDivision; - nRet = (sal_uInt16)aGSize.Width(); - aGSize.Height() /= nDivision; - pGrf->Draw( pVDev, Point(nXStart,nYStart), - pVDev->PixelToLogic( aGSize ) ); - } - } - return nRet; - -} - -sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev, - const SvxNumberFormat& rFmt, sal_uInt16 nXStart, - sal_uInt16 nYStart, const Size& rSize) -{ - Font aTmpFont(pVDev->GetFont()); - - //per Uno kann es sein, dass kein Font gesetzt ist! - Font aFont(rFmt.GetBulletFont() ? *rFmt.GetBulletFont() : aTmpFont); - Size aTmpSize(rSize); - aTmpSize.Width() *= rFmt.GetBulletRelSize(); - aTmpSize.Width() /= 100 ; - aTmpSize.Height() *= rFmt.GetBulletRelSize(); - aTmpSize.Height() /= 100 ; - // bei einer Hoehe von Null wird in Ursprungshoehe gezeichnet - if(!aTmpSize.Height()) - aTmpSize.Height() = 1; - aFont.SetSize(aTmpSize); - aFont.SetTransparent(sal_True); - Color aBulletColor = rFmt.GetBulletColor(); - if(aBulletColor.GetColor() == COL_AUTO) - aBulletColor = Color(pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK); - else if(aBulletColor == pVDev->GetFillColor()) - aBulletColor.Invert(); - aFont.SetColor(aBulletColor); - pVDev->SetFont( aFont ); - String aText(sal_Unicode(rFmt.GetBulletChar())); - long nY = nYStart; - nY -= ((aTmpSize.Height() - rSize.Height())/ 2); - pVDev->DrawText( Point(nXStart, nY), aText ); - sal_uInt16 nRet = (sal_uInt16)pVDev->GetTextWidth(aText); - - pVDev->SetFont(aTmpFont); - return nRet; -} - -// Vorschau der Numerierung painten -void SvxNumberingPreview::Paint( const Rectangle& /*rRect*/ ) -{ - Size aSize(PixelToLogic(GetOutputSizePixel())); - Rectangle aRect(Point(0,0), aSize); - - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - const Color aBackColor = rStyleSettings.GetFieldColor(); - const Color aTextColor = rStyleSettings.GetFieldTextColor(); - - VirtualDevice* pVDev = new VirtualDevice(*this); - pVDev->EnableRTL( IsRTLEnabled() ); - pVDev->SetMapMode(GetMapMode()); - pVDev->SetOutputSize( aSize ); - - Color aLineColor(COL_LIGHTGRAY); - if(aLineColor == aBackColor) - aLineColor.Invert(); - pVDev->SetLineColor(aLineColor); - pVDev->SetFillColor( aBackColor ); - pVDev->DrawRect(aRect); - - if(pActNum) - { - sal_uInt16 nWidthRelation; - if(nPageWidth) - { - nWidthRelation = sal_uInt16 (nPageWidth / aSize.Width()); - if(bPosition) - nWidthRelation = nWidthRelation * 2 / 3; - else - nWidthRelation = nWidthRelation / 4; - } - else - nWidthRelation = 30; // Kapiteldialog - - //Hoehe pro Ebene - sal_uInt16 nXStep = sal::static_int_cast< sal_uInt16 >(aSize.Width() / (3 * pActNum->GetLevelCount())); - if(pActNum->GetLevelCount() < 10) - nXStep /= 2; - sal_uInt16 nYStart = 4; - // fuer ein einziges Level darf nicht die gesamte Hoehe benutzt werden - sal_uInt16 nYStep = sal::static_int_cast< sal_uInt16 >((aSize.Height() - 6)/ (pActNum->GetLevelCount() > 1 ? pActNum->GetLevelCount() : 5)); - aStdFont = OutputDevice::GetDefaultFont( - DEFAULTFONT_UI_SANS, MsLangId::getSystemLanguage(), DEFAULTFONT_FLAGS_ONLYONE); - aStdFont.SetColor(aTextColor); - aStdFont.SetFillColor(aBackColor); - - sal_uInt16 nFontHeight = nYStep * 6 / 10; - if(bPosition) - nFontHeight = nYStep * 15 / 10; - aStdFont.SetSize(Size( 0, nFontHeight )); - - SvxNodeNum aNum( (sal_uInt8)0 ); - sal_uInt16 nPreNum = pActNum->GetLevel(0).GetStart(); - - if(bPosition) - { - sal_uInt16 nLineHeight = nFontHeight * 8 / 7; - sal_uInt8 nStart = 0; - while( !(nActLevel & (1<<nStart)) ) - { - nStart++; - } - if(nStart) - nStart--; - sal_uInt8 nEnd = std::min( (sal_uInt8)(nStart + 3), (sal_uInt8)pActNum->GetLevelCount() ); - for( sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel ) - { - const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel); - aNum.GetLevelVal()[ nLevel ] = rFmt.GetStart(); - - sal_uInt16 nXStart( 0 ); - short nTextOffset( 0 ); - sal_uInt16 nNumberXPos( 0 ); - if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) - { - nXStart = rFmt.GetAbsLSpace() / nWidthRelation; - nTextOffset = rFmt.GetCharTextDistance() / nWidthRelation; - nNumberXPos = nXStart; - sal_uInt16 nFirstLineOffset = (-rFmt.GetFirstLineOffset()) / nWidthRelation; - - if(nFirstLineOffset <= nNumberXPos) - nNumberXPos = nNumberXPos - nFirstLineOffset; - else - nNumberXPos = 0; - //im draw ist das zulaeesig - if(nTextOffset < 0) - nNumberXPos = nNumberXPos + nTextOffset; - } - else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) - { - const long nTmpNumberXPos( ( rFmt.GetIndentAt() + - rFmt.GetFirstLineIndent() ) / - nWidthRelation ); - if ( nTmpNumberXPos < 0 ) - { - nNumberXPos = 0; - } - else - { - nNumberXPos = static_cast<sal_uInt16>( nTmpNumberXPos ); - } - } - - sal_uInt16 nBulletWidth = 0; - if( SVX_NUM_BITMAP == (rFmt.GetNumberingType() &(~LINK_TOKEN))) - { - nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawGraphic(pVDev, rFmt, - nNumberXPos, - nYStart, nWidthRelation) : 0; - } - else if( SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType() ) - { - nBulletWidth = rFmt.IsShowSymbol() ? - lcl_DrawBullet(pVDev, rFmt, nNumberXPos, nYStart, aStdFont.GetSize()) : 0; - } - else - { - pVDev->SetFont(aStdFont); - aNum.SetLevel( nLevel ); - if(pActNum->IsContinuousNumbering()) - aNum.GetLevelVal()[nLevel] = nPreNum; - String aText(pActNum->MakeNumString( aNum )); - Font aSaveFont = pVDev->GetFont(); - Font aColorFont(aSaveFont); - Color aTmpBulletColor = rFmt.GetBulletColor(); - if(aTmpBulletColor.GetColor() == COL_AUTO) - aTmpBulletColor = Color(aBackColor.IsDark() ? COL_WHITE : COL_BLACK); - else if(aTmpBulletColor == aBackColor) - aTmpBulletColor.Invert(); - aColorFont.SetColor(aTmpBulletColor); - pVDev->SetFont(aColorFont); - pVDev->DrawText( Point(nNumberXPos, nYStart), aText ); - pVDev->SetFont(aSaveFont); - nBulletWidth = (sal_uInt16)pVDev->GetTextWidth(aText); - nPreNum++; - } - if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT && - rFmt.GetLabelFollowedBy() == SvxNumberFormat::SPACE ) - { - pVDev->SetFont(aStdFont); - String aText(' '); - pVDev->DrawText( Point(nNumberXPos, nYStart), aText ); - nBulletWidth = nBulletWidth + (sal_uInt16)pVDev->GetTextWidth(aText); - } - - sal_uInt16 nTextXPos( 0 ); - if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) - { - nTextXPos = nXStart; - if(nTextOffset < 0) - nTextXPos = nTextXPos + nTextOffset; - if(nNumberXPos + nBulletWidth + nTextOffset > nTextXPos ) - nTextXPos = nNumberXPos + nBulletWidth + nTextOffset; - } - else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) - { - switch ( rFmt.GetLabelFollowedBy() ) - { - case SvxNumberFormat::LISTTAB: - { - nTextXPos = static_cast<sal_uInt16>( - rFmt.GetListtabPos() / nWidthRelation ); - if ( nTextXPos < nNumberXPos + nBulletWidth ) - { - nTextXPos = nNumberXPos + nBulletWidth; - } - } - break; - case SvxNumberFormat::SPACE: - case SvxNumberFormat::NOTHING: - { - nTextXPos = nNumberXPos + nBulletWidth; - } - break; - } - - nXStart = static_cast<sal_uInt16>( rFmt.GetIndentAt() / nWidthRelation ); - } - - Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2)); - pVDev->SetFillColor( aBackColor ); - pVDev->DrawRect( aRect1 ); - - Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2 ), Size(aSize.Width() / 2, 2)); - pVDev->DrawRect( aRect2 ); - nYStart += 2 * nLineHeight; - } - } - else - { - //#i5153# painting gray or black rectangles as 'normal' numbering text - String sMsg( RTL_CONSTASCII_USTRINGPARAM( "Preview") ); - long nWidth = pVDev->GetTextWidth(sMsg); - long nTextHeight = pVDev->GetTextHeight(); - long nRectHeight = nTextHeight * 2 / 3; - long nTopOffset = nTextHeight - nRectHeight; - Color aBlackColor(COL_BLACK); - if(aBlackColor == aBackColor) - aBlackColor.Invert(); - - for( sal_uInt8 nLevel = 0; nLevel < pActNum->GetLevelCount(); - ++nLevel, nYStart = nYStart + nYStep ) - { - const SvxNumberFormat &rFmt = pActNum->GetLevel(nLevel); - aNum.GetLevelVal()[ nLevel ] = rFmt.GetStart(); - sal_uInt16 nXStart( 0 ); - if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) - { - nXStart = rFmt.GetAbsLSpace() / nWidthRelation; - } - else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) - { - const long nTmpXStart( ( rFmt.GetIndentAt() + - rFmt.GetFirstLineIndent() ) / - nWidthRelation ); - if ( nTmpXStart < 0 ) - { - nXStart = 0; - } - else - { - nXStart = static_cast<sal_uInt16>(nTmpXStart); - } - } - nXStart /= 2; - nXStart += 2; - sal_uInt16 nTextOffset = 2 * nXStep; - if( SVX_NUM_BITMAP == (rFmt.GetNumberingType()&(~LINK_TOKEN)) ) - { - if(rFmt.IsShowSymbol()) - { - nTextOffset = lcl_DrawGraphic(pVDev, rFmt, nXStart, nYStart, nWidthRelation); - nTextOffset = nTextOffset + nXStep; - } - } - else if( SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType() ) - { - if(rFmt.IsShowSymbol()) - { - nTextOffset = lcl_DrawBullet(pVDev, rFmt, nXStart, nYStart, aStdFont.GetSize()); - nTextOffset = nTextOffset + nXStep; - } - } - else - { - Font aColorFont(aStdFont); - Color aTmpBulletColor = rFmt.GetBulletColor(); - if(aTmpBulletColor.GetColor() == COL_AUTO) - aTmpBulletColor = Color(aBackColor.IsDark() ? COL_WHITE : COL_BLACK); - else if(aTmpBulletColor == aBackColor) - aTmpBulletColor.Invert(); - aColorFont.SetColor(aTmpBulletColor); - pVDev->SetFont(aColorFont); - aNum.SetLevel( nLevel ); - if(pActNum->IsContinuousNumbering()) - aNum.GetLevelVal()[nLevel] = nPreNum; - String aText(pActNum->MakeNumString( aNum )); - pVDev->DrawText( Point(nXStart, nYStart), aText ); - pVDev->SetFont(aStdFont); - nTextOffset = (sal_uInt16)pVDev->GetTextWidth(aText); - nTextOffset = nTextOffset + nXStep; - nPreNum++; - } - if(pOutlineNames) - { - //#i5153# outline numberings still use the style names as text - pVDev->SetFont(aStdFont); - sMsg = pOutlineNames[nLevel]; - pVDev->DrawText( Point(nXStart + nTextOffset, nYStart), sMsg ); - } - else - { - //#i5153# the selected rectangle(s) should be black - if( 0 != (nActLevel & (1<<nLevel))) - { - pVDev->SetFillColor( aBlackColor ); - pVDev->SetLineColor( aBlackColor ); - } - else - { - //#i5153# unselected levels are gray - pVDev->SetFillColor( aLineColor ); - pVDev->SetLineColor( aLineColor ); - } - Rectangle aRect1(Point(nXStart + nTextOffset, nYStart + nTopOffset), Size(nWidth, nRectHeight)); - pVDev->DrawRect(aRect1); - } - } - } - } - DrawOutDev( Point(0,0), aSize, - Point(0,0), aSize, - *pVDev ); - delete pVDev; - -} - -SvxNumPositionTabPage::SvxNumPositionTabPage(Window* pParent, - const SfxItemSet& rSet) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_NUM_POSITION ), rSet ), - aPositionFL( this, CUI_RES(FL_POSITION )), - aLevelFT( this, CUI_RES(FT_LEVEL )), - aLevelLB( this, CUI_RES(LB_LEVEL )), - aDistBorderFT( this, CUI_RES(FT_BORDERDIST )), - aDistBorderMF( this, CUI_RES(MF_BORDERDIST )), - aRelativeCB( this, CUI_RES(CB_RELATIVE )), - aIndentFT( this, CUI_RES(FT_INDENT )), - aIndentMF( this, CUI_RES(MF_INDENT )), - aDistNumFT( this, CUI_RES(FT_NUMDIST )), - aDistNumMF( this, CUI_RES(MF_NUMDIST )), - aAlignFT( this, CUI_RES(FT_ALIGN )), - aAlignLB( this, CUI_RES(LB_ALIGN )), - aLabelFollowedByFT( this, CUI_RES(FT_LABEL_FOLLOWED_BY) ), - aLabelFollowedByLB( this, CUI_RES(LB_LABEL_FOLLOWED_BY) ), - aListtabFT( this, CUI_RES(FT_LISTTAB) ), - aListtabMF( this, CUI_RES(MF_LISTTAB) ), - aAlign2FT( this, CUI_RES(FT_ALIGN_2) ), - aAlign2LB( this, CUI_RES(LB_ALIGN_2) ), - aAlignedAtFT( this, CUI_RES(FT_ALIGNED_AT) ), - aAlignedAtMF( this, CUI_RES(MF_ALIGNED_AT) ), - aIndentAtFT( this, CUI_RES(FT_INDENT_AT) ), - aIndentAtMF( this, CUI_RES(MF_INDENT_AT) ), - aStandardPB( this, CUI_RES(PB_STANDARD )), - pPreviewWIN( new SvxNumberingPreview(this, CUI_RES(WIN_PREVIEW ))), - pActNum(0), - pSaveNum(0), - nActNumLvl( USHRT_MAX ), - nNumItemId(SID_ATTR_NUMBERING_RULE), - bModified(false), - bPreset(false), - bInInintControl(sal_False), - bLabelAlignmentPosAndSpaceModeActive( false ) -{ - FreeResource(); - SetExchangeSupport(); - pPreviewWIN->SetBackground(Wallpaper(Color(COL_TRANSPARENT))); - - aRelativeCB.Check(); - aAlignLB.SetSelectHdl(LINK(this, SvxNumPositionTabPage, EditModifyHdl_Impl)); - aAlign2LB.SetSelectHdl(LINK(this, SvxNumPositionTabPage, EditModifyHdl_Impl)); - for ( sal_uInt16 i = 0; i < aAlignLB.GetEntryCount(); ++i ) - { - aAlign2LB.InsertEntry( aAlignLB.GetEntry( i ) ); - } - aAlign2LB.SetDropDownLineCount( aAlign2LB.GetEntryCount() ); - aAlign2FT.SetText( aAlignFT.GetText() ); - - Link aLk = LINK(this, SvxNumPositionTabPage, DistanceHdl_Impl); - - aDistBorderMF.SetUpHdl(aLk); - aDistBorderMF.SetDownHdl(aLk); - aDistBorderMF.SetLoseFocusHdl(aLk); - - aDistNumMF.SetUpHdl(aLk); - aDistNumMF.SetDownHdl(aLk); - aDistNumMF.SetLoseFocusHdl(aLk); - - aIndentMF.SetUpHdl(aLk); - aIndentMF.SetDownHdl(aLk); - aIndentMF.SetLoseFocusHdl(aLk); - - aLabelFollowedByLB.SetDropDownLineCount( aLabelFollowedByLB.GetEntryCount() ); - aLabelFollowedByLB.SetSelectHdl( LINK(this, SvxNumPositionTabPage, LabelFollowedByHdl_Impl) ); - - aLk = LINK(this, SvxNumPositionTabPage, ListtabPosHdl_Impl); - aListtabMF.SetUpHdl(aLk); - aListtabMF.SetDownHdl(aLk); - aListtabMF.SetLoseFocusHdl(aLk); - - aLk = LINK(this, SvxNumPositionTabPage, AlignAtHdl_Impl); - aAlignedAtMF.SetUpHdl(aLk); - aAlignedAtMF.SetDownHdl(aLk); - aAlignedAtMF.SetLoseFocusHdl(aLk); - - aLk = LINK(this, SvxNumPositionTabPage, IndentAtHdl_Impl); - aIndentAtMF.SetUpHdl(aLk); - aIndentAtMF.SetDownHdl(aLk); - aIndentAtMF.SetLoseFocusHdl(aLk); - - aLevelLB.SetSelectHdl(LINK(this, SvxNumPositionTabPage, LevelHdl_Impl)); - aRelativeCB.SetClickHdl(LINK(this, SvxNumPositionTabPage, RelativeHdl_Impl)); - aStandardPB.SetClickHdl(LINK(this, SvxNumPositionTabPage, StandardHdl_Impl)); - - - aRelativeCB.Check(bLastRelative); - pPreviewWIN->SetPositionMode(); - eCoreUnit = rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE)); - -#if OSL_DEBUG_LEVEL > 1 - pDebugFixedText = new FixedText(this, 0); - pDebugFixedText->Show(); - Size aSize(200, 20); - Point aPos(250,0); - - pDebugFixedText->SetPosSizePixel(aPos, aSize); - pDebugFixedText->SetText( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Das ist ein Debug-Text" ) ) ); -#endif - - aStandardPB.SetAccessibleRelationMemberOf(&aPositionFL); -} - -SvxNumPositionTabPage::~SvxNumPositionTabPage() -{ - delete pActNum; - delete pPreviewWIN; - delete pSaveNum; -#if OSL_DEBUG_LEVEL > 1 - delete pDebugFixedText; -#endif -} -/*-------------------------------------------------------*/ - -#if OSL_DEBUG_LEVEL > 1 -void lcl_PrintDebugOutput(FixedText& rFixed, const SvxNumberFormat& rNumFmt) -{ -#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) - - sal_Char const sHash[] = " # "; - if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) - { - String sDebugText( UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetAbsLSpace() ) ) ); - sDebugText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( sHash ) ); - sDebugText += UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetCharTextDistance() ) ); - sDebugText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( sHash ) ); - sDebugText += UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetFirstLineOffset() ) ); - rFixed.SetText(sDebugText); - } - else if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) - { - String sDebugText( UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetListtabPos() ) ) ); - sDebugText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( sHash ) ); - sDebugText += UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetFirstLineIndent() ) ); - sDebugText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( sHash ) ); - sDebugText += UniString::CreateFromInt32( TWIP_TO_MM100(rNumFmt.GetIndentAt() ) ); - rFixed.SetText(sDebugText); - } - -} -#endif - -void SvxNumPositionTabPage::InitControls() -{ - bInInintControl = sal_True; - const bool bRelative = !bLabelAlignmentPosAndSpaceModeActive && - aRelativeCB.IsEnabled() && aRelativeCB.IsChecked(); - const bool bSingleSelection = aLevelLB.GetSelectEntryCount() == 1 && - USHRT_MAX != nActNumLvl; - - aDistBorderMF.Enable( !bLabelAlignmentPosAndSpaceModeActive && - ( bSingleSelection || bRelative ) ); - aDistBorderFT.Enable( !bLabelAlignmentPosAndSpaceModeActive && - ( bSingleSelection || bRelative ) ); - - bool bSetDistEmpty = false; - bool bSameDistBorderNum = !bLabelAlignmentPosAndSpaceModeActive; - bool bSameDist = !bLabelAlignmentPosAndSpaceModeActive; - bool bSameIndent = !bLabelAlignmentPosAndSpaceModeActive; - bool bSameAdjust = true; - - bool bSameLabelFollowedBy = bLabelAlignmentPosAndSpaceModeActive; - bool bSameListtab = bLabelAlignmentPosAndSpaceModeActive; - bool bSameAlignAt = bLabelAlignmentPosAndSpaceModeActive; - bool bSameIndentAt = bLabelAlignmentPosAndSpaceModeActive; - - const SvxNumberFormat* aNumFmtArr[SVX_MAX_NUM]; - sal_uInt16 nMask = 1; - sal_uInt16 nLvl = USHRT_MAX; - long nFirstBorderTextRelative = -1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - aNumFmtArr[i] = &pActNum->GetLevel(i); - if(nActNumLvl & nMask) - { - if(USHRT_MAX == nLvl) - nLvl = i; - - if( i > nLvl) - { - bSameAdjust &= aNumFmtArr[i]->GetNumAdjust() == aNumFmtArr[nLvl]->GetNumAdjust(); - if ( !bLabelAlignmentPosAndSpaceModeActive ) - { - if(bRelative) - { - if(nFirstBorderTextRelative == -1) - nFirstBorderTextRelative = - (aNumFmtArr[i]->GetAbsLSpace() + aNumFmtArr[i]->GetFirstLineOffset() - - aNumFmtArr[i - 1]->GetAbsLSpace() + aNumFmtArr[i - 1]->GetFirstLineOffset()); - else - bSameDistBorderNum &= nFirstBorderTextRelative == - (aNumFmtArr[i]->GetAbsLSpace() + aNumFmtArr[i]->GetFirstLineOffset() - - aNumFmtArr[i - 1]->GetAbsLSpace() + aNumFmtArr[i - 1]->GetFirstLineOffset()); - } - else - bSameDistBorderNum &= - aNumFmtArr[i]->GetAbsLSpace() - aNumFmtArr[i]->GetFirstLineOffset() == - aNumFmtArr[i - 1]->GetAbsLSpace() - aNumFmtArr[i - 1]->GetFirstLineOffset(); - - bSameDist &= aNumFmtArr[i]->GetCharTextDistance() == aNumFmtArr[nLvl]->GetCharTextDistance(); - bSameIndent &= aNumFmtArr[i]->GetFirstLineOffset() == aNumFmtArr[nLvl]->GetFirstLineOffset(); - } - else - { - bSameLabelFollowedBy &= - aNumFmtArr[i]->GetLabelFollowedBy() == aNumFmtArr[nLvl]->GetLabelFollowedBy(); - bSameListtab &= - aNumFmtArr[i]->GetListtabPos() == aNumFmtArr[nLvl]->GetListtabPos(); - bSameAlignAt &= - ( ( aNumFmtArr[i]->GetIndentAt() + aNumFmtArr[i]->GetFirstLineIndent() ) - == ( aNumFmtArr[nLvl]->GetIndentAt() + aNumFmtArr[nLvl]->GetFirstLineIndent() ) ); - bSameIndentAt &= - aNumFmtArr[i]->GetIndentAt() == aNumFmtArr[nLvl]->GetIndentAt(); - } - } - } - nMask <<= 1; - - } - if(bSameDistBorderNum) - { - long nDistBorderNum; - if(bRelative) - { - nDistBorderNum = (long)aNumFmtArr[nLvl]->GetAbsLSpace()+ aNumFmtArr[nLvl]->GetFirstLineOffset(); - if(nLvl) - nDistBorderNum -= (long)aNumFmtArr[nLvl - 1]->GetAbsLSpace()+ aNumFmtArr[nLvl - 1]->GetFirstLineOffset(); - } - else - { - nDistBorderNum = (long)aNumFmtArr[nLvl]->GetAbsLSpace()+ aNumFmtArr[nLvl]->GetFirstLineOffset(); - } - SetMetricValue(aDistBorderMF, nDistBorderNum, eCoreUnit); - } - else - bSetDistEmpty = true; - -#if OSL_DEBUG_LEVEL > 1 - lcl_PrintDebugOutput(*pDebugFixedText, *aNumFmtArr[nLvl]); -#endif - - const String aEmptyStr; - if(bSameDist) - SetMetricValue(aDistNumMF, aNumFmtArr[nLvl]->GetCharTextDistance(), eCoreUnit); - else - aDistNumMF.SetText(aEmptyStr); - if(bSameIndent) - SetMetricValue(aIndentMF, - aNumFmtArr[nLvl]->GetFirstLineOffset(), eCoreUnit); - else - aIndentMF.SetText(aEmptyStr); - - if(bSameAdjust) - { - sal_uInt16 nPos = 1; // zentriert - if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT) - nPos = 0; - else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT) - nPos = 2; - aAlignLB.SelectEntryPos(nPos); - aAlign2LB.SelectEntryPos( nPos ); - } - else - { - aAlignLB.SetNoSelection(); - aAlign2LB.SetNoSelection(); - } - - if ( bSameLabelFollowedBy ) - { - sal_uInt16 nPos = 0; // LISTTAB - if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::SPACE ) - { - nPos = 1; - } - else if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::NOTHING ) - { - nPos = 2; - } - aLabelFollowedByLB.SelectEntryPos( nPos ); - } - else - { - aLabelFollowedByLB.SetNoSelection(); - } - - if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::LISTTAB ) - { - aListtabFT.Enable( true ); - aListtabMF.Enable( true ); - if ( bSameListtab ) - { - SetMetricValue( aListtabMF, aNumFmtArr[nLvl]->GetListtabPos(), eCoreUnit ); - } - else - { - aListtabMF.SetText(aEmptyStr); - } - } - else - { - aListtabFT.Enable( false ); - aListtabMF.Enable( false ); - aListtabMF.SetText(aEmptyStr); - } - - if ( bSameAlignAt ) - { - SetMetricValue( aAlignedAtMF, - aNumFmtArr[nLvl]->GetIndentAt() + aNumFmtArr[nLvl]->GetFirstLineIndent(), - eCoreUnit ); - } - else - { - aAlignedAtMF.SetText(aEmptyStr); - } - - if ( bSameIndentAt ) - { - SetMetricValue( aIndentAtMF, aNumFmtArr[nLvl]->GetIndentAt(), eCoreUnit ); - } - else - { - aIndentAtMF.SetText(aEmptyStr); - } - - if ( bSetDistEmpty ) - aDistBorderMF.SetText(aEmptyStr); - - bInInintControl = sal_False; -} - -void SvxNumPositionTabPage::ActivatePage(const SfxItemSet& rSet) -{ - const SfxPoolItem* pItem; - sal_uInt16 nTmpNumLvl = USHRT_MAX; - const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet(); - if(pExampleSet) - { - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, sal_False, &pItem)) - bPreset = ((const SfxBoolItem*)pItem)->GetValue(); - if(SFX_ITEM_SET == pExampleSet->GetItemState(SID_PARAM_CUR_NUM_LEVEL, sal_False, &pItem)) - nTmpNumLvl = ((const SfxUInt16Item*)pItem)->GetValue(); - } - if(SFX_ITEM_SET == rSet.GetItemState(nNumItemId, sal_False, &pItem)) - { - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - } - bModified = (!pActNum->Get( 0 ) || bPreset); - if(*pSaveNum != *pActNum || - nActNumLvl != nTmpNumLvl ) - { - *pActNum = *pSaveNum; - nActNumLvl = nTmpNumLvl; - sal_uInt16 nMask = 1; - aLevelLB.SetUpdateMode(sal_False); - aLevelLB.SetNoSelection(); - aLevelLB.SelectEntryPos( pActNum->GetLevelCount(), nActNumLvl == USHRT_MAX); - if(nActNumLvl != USHRT_MAX) - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - aLevelLB.SelectEntryPos( i, sal_True); - nMask <<= 1 ; - } - aRelativeCB.Enable(nActNumLvl != 1); - aLevelLB.SetUpdateMode(sal_True); - - InitPosAndSpaceMode(); - ShowControlsDependingOnPosAndSpaceMode(); - - InitControls(); - } - pPreviewWIN->SetLevel(nActNumLvl); - pPreviewWIN->Invalidate(); -} - -int SvxNumPositionTabPage::DeactivatePage(SfxItemSet *_pSet) -{ - if(_pSet) - FillItemSet(*_pSet); - return sal_True; -} - -sal_Bool SvxNumPositionTabPage::FillItemSet( SfxItemSet& rSet ) -{ - rSet.Put(SfxUInt16Item(SID_PARAM_CUR_NUM_LEVEL, nActNumLvl)); - - if(bModified && pActNum) - { - *pSaveNum = *pActNum; - rSet.Put(SvxNumBulletItem( *pSaveNum ), nNumItemId); - rSet.Put(SfxBoolItem(SID_PARAM_NUM_PRESET, sal_False)); - } - return bModified; -} - -void SvxNumPositionTabPage::Reset( const SfxItemSet& rSet ) -{ - const SfxPoolItem* pItem; - //im Draw gibt es das Item als WhichId, im Writer nur als SlotId - SfxItemState eState = rSet.GetItemState(SID_ATTR_NUMBERING_RULE, sal_False, &pItem); - if(eState != SFX_ITEM_SET) - { - nNumItemId = rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE); - eState = rSet.GetItemState(nNumItemId, sal_False, &pItem); - - if( eState != SFX_ITEM_SET ) - { - pItem = &static_cast< const SvxNumBulletItem& >( rSet.Get( nNumItemId, sal_True ) ); - eState = SFX_ITEM_SET; - } - - } - DBG_ASSERT(eState == SFX_ITEM_SET, "kein Item gefunden!"); - delete pSaveNum; - pSaveNum = new SvxNumRule(*((SvxNumBulletItem*)pItem)->GetNumRule()); - - // Ebenen einfuegen - if(!aLevelLB.GetEntryCount()) - { - for(sal_uInt16 i = 1; i <= pSaveNum->GetLevelCount(); i++) - aLevelLB.InsertEntry(UniString::CreateFromInt32(i)); - if(pSaveNum->GetLevelCount() > 1) - { - String sEntry( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "1 - ") ) ); - sEntry.Append( UniString::CreateFromInt32( pSaveNum->GetLevelCount() ) ); - aLevelLB.InsertEntry(sEntry); - aLevelLB.SelectEntry(sEntry); - } - else - aLevelLB.SelectEntryPos(0); - } - else - aLevelLB.SelectEntryPos(aLevelLB.GetEntryCount() - 1); - sal_uInt16 nMask = 1; - aLevelLB.SetUpdateMode(sal_False); - aLevelLB.SetNoSelection(); - if(nActNumLvl == USHRT_MAX) - { - aLevelLB.SelectEntryPos( pSaveNum->GetLevelCount(), sal_True); - } - else - for(sal_uInt16 i = 0; i < pSaveNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - aLevelLB.SelectEntryPos( i, sal_True); - nMask <<= 1; - } - aLevelLB.SetUpdateMode(sal_True); - - if(!pActNum) - pActNum = new SvxNumRule(*pSaveNum); - else if(*pSaveNum != *pActNum) - *pActNum = *pSaveNum; - pPreviewWIN->SetNumRule(pActNum); - - InitPosAndSpaceMode(); - ShowControlsDependingOnPosAndSpaceMode(); - - InitControls(); - bModified = sal_False; -} - -void SvxNumPositionTabPage::InitPosAndSpaceMode() -{ - if ( pActNum == 0 ) - { - DBG_ASSERT( false, - "<SvxNumPositionTabPage::InitPosAndSpaceMode()> - misusage of method -> <pAktNum> has to be already set!" ); - return; - } - - SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode = - SvxNumberFormat::LABEL_ALIGNMENT; - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i ) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt( pActNum->GetLevel(i) ); - ePosAndSpaceMode = aNumFmt.GetPositionAndSpaceMode(); - if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) - { - break; - } - } - nMask <<= 1; - } - - bLabelAlignmentPosAndSpaceModeActive = - ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT; -} - -void SvxNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode() -{ - aDistBorderFT.Show( !bLabelAlignmentPosAndSpaceModeActive ); - aDistBorderMF.Show( !bLabelAlignmentPosAndSpaceModeActive ); - aRelativeCB.Show( !bLabelAlignmentPosAndSpaceModeActive ); - aIndentFT.Show( !bLabelAlignmentPosAndSpaceModeActive ); - aIndentMF.Show( !bLabelAlignmentPosAndSpaceModeActive ); - aDistNumFT.Show( !bLabelAlignmentPosAndSpaceModeActive && - pActNum->IsFeatureSupported(NUM_CONTINUOUS) ); - aDistNumMF.Show( !bLabelAlignmentPosAndSpaceModeActive && - pActNum->IsFeatureSupported(NUM_CONTINUOUS)); - aAlignFT.Show( !bLabelAlignmentPosAndSpaceModeActive ); - aAlignLB.Show( !bLabelAlignmentPosAndSpaceModeActive ); - - aLabelFollowedByFT.Show( bLabelAlignmentPosAndSpaceModeActive ); - aLabelFollowedByLB.Show( bLabelAlignmentPosAndSpaceModeActive ); - aListtabFT.Show( bLabelAlignmentPosAndSpaceModeActive ); - aListtabMF.Show( bLabelAlignmentPosAndSpaceModeActive ); - aAlign2FT.Show( bLabelAlignmentPosAndSpaceModeActive ); - aAlign2LB.Show( bLabelAlignmentPosAndSpaceModeActive ); - aAlignedAtFT.Show( bLabelAlignmentPosAndSpaceModeActive ); - aAlignedAtMF.Show( bLabelAlignmentPosAndSpaceModeActive ); - aIndentAtFT.Show( bLabelAlignmentPosAndSpaceModeActive ); - aIndentAtMF.Show( bLabelAlignmentPosAndSpaceModeActive ); -} - -SfxTabPage* SvxNumPositionTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new SvxNumPositionTabPage(pParent, rAttrSet); -} - -void SvxNumPositionTabPage::SetMetric(FieldUnit eMetric) -{ - if(eMetric == FUNIT_MM) - { - aDistBorderMF .SetDecimalDigits(1); - aDistNumMF .SetDecimalDigits(1); - aIndentMF .SetDecimalDigits(1); - aListtabMF.SetDecimalDigits(1); - aAlignedAtMF.SetDecimalDigits(1); - aIndentAtMF.SetDecimalDigits(1); - } - aDistBorderMF .SetUnit( eMetric ); - aDistNumMF .SetUnit( eMetric ); - aIndentMF .SetUnit( eMetric ); - aListtabMF.SetUnit( eMetric ); - aAlignedAtMF.SetUnit( eMetric ); - aIndentAtMF.SetUnit( eMetric ); -} - -IMPL_LINK( SvxNumPositionTabPage, EditModifyHdl_Impl, Edit *, EMPTYARG ) -{ - sal_uInt16 nMask = 1; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt(pActNum->GetLevel(i)); - - const sal_uInt16 nPos = aAlignLB.IsVisible() - ? aAlignLB.GetSelectEntryPos() - : aAlign2LB.GetSelectEntryPos(); - SvxAdjust eAdjust = SVX_ADJUST_CENTER; - if(nPos == 0) - eAdjust = SVX_ADJUST_LEFT; - else if(nPos == 2) - eAdjust = SVX_ADJUST_RIGHT; - aNumFmt.SetNumAdjust( eAdjust ); - pActNum->SetLevel(i, aNumFmt); - } - nMask <<= 1; - } - SetModified(); - return 0; -} - -IMPL_LINK( SvxNumPositionTabPage, LevelHdl_Impl, ListBox *, pBox ) -{ - sal_uInt16 nSaveNumLvl = nActNumLvl; - nActNumLvl = 0; - if(pBox->IsEntryPosSelected( pActNum->GetLevelCount() ) && - (pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff)) - { - nActNumLvl = 0xFFFF; - pBox->SetUpdateMode(sal_False); - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - pBox->SelectEntryPos( i, sal_False ); - pBox->SetUpdateMode(sal_True); - } - else if(pBox->GetSelectEntryCount()) - { - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - { - if(pBox->IsEntryPosSelected( i )) - nActNumLvl |= nMask; - nMask <<= 1; - } - pBox->SelectEntryPos( pActNum->GetLevelCount(), sal_False ); - } - else - { - nActNumLvl = nSaveNumLvl; - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++ ) - { - if(nActNumLvl & nMask) - { - pBox->SelectEntryPos(i); - break; - } - nMask <<=1; - } - } - aRelativeCB.Enable(nActNumLvl != 1); - SetModified(); - InitPosAndSpaceMode(); - ShowControlsDependingOnPosAndSpaceMode(); - InitControls(); - return 0; -} - -IMPL_LINK( SvxNumPositionTabPage, DistanceHdl_Impl, MetricField *, pFld ) -{ - if(bInInintControl) - return 0; - long nValue = GetCoreValue(*pFld, eCoreUnit); - sal_uInt16 nMask = 1; -#if OSL_DEBUG_LEVEL > 1 - sal_Bool bFirst = sal_True; -#endif - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt( pActNum->GetLevel( i ) ); - if(pFld == &aDistBorderMF) - { - - if(aRelativeCB.IsChecked()) - { - if(0 == i) - { - long nTmp = aNumFmt.GetFirstLineOffset(); - aNumFmt.SetAbsLSpace( sal_uInt16(nValue - nTmp)); - } - else - { - long nTmp = pActNum->GetLevel( i - 1 ).GetAbsLSpace() + - pActNum->GetLevel( i - 1 ).GetFirstLineOffset() - - pActNum->GetLevel( i ).GetFirstLineOffset(); - - aNumFmt.SetAbsLSpace( sal_uInt16(nValue + nTmp)); - } - } - else - { - aNumFmt.SetAbsLSpace( (short)nValue - aNumFmt.GetFirstLineOffset()); - } - } - else if(pFld == &aDistNumMF) - { - aNumFmt.SetCharTextDistance( (short)nValue ); - } - else if(pFld == &aIndentMF) - { - //jetzt muss mit dem FirstLineOffset auch der AbsLSpace veraendert werden - long nDiff = nValue + aNumFmt.GetFirstLineOffset(); - long nAbsLSpace = aNumFmt.GetAbsLSpace(); - aNumFmt.SetAbsLSpace(sal_uInt16(nAbsLSpace + nDiff)); - aNumFmt.SetFirstLineOffset( -(short)nValue ); - } - -#if OSL_DEBUG_LEVEL > 1 - if(bFirst) - lcl_PrintDebugOutput(*pDebugFixedText, aNumFmt); - bFirst = sal_False; -#endif - pActNum->SetLevel( i, aNumFmt ); - } - nMask <<= 1; - } - - SetModified(); - if(!aDistBorderMF.IsEnabled()) - { - String aEmptyStr; - aDistBorderMF.SetText(aEmptyStr); - } - - return 0; -} - -IMPL_LINK( SvxNumPositionTabPage, RelativeHdl_Impl, CheckBox *, pBox ) -{ - sal_Bool bOn = pBox->IsChecked(); - sal_Bool bSingleSelection = aLevelLB.GetSelectEntryCount() == 1 && USHRT_MAX != nActNumLvl; - sal_Bool bSetValue = sal_False; - long nValue = 0; - if(bOn || bSingleSelection) - { - sal_uInt16 nMask = 1; - sal_Bool bFirst = sal_True; - bSetValue = sal_True; - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - const SvxNumberFormat &rNumFmt = pActNum->GetLevel(i); - if(bFirst) - { - nValue = rNumFmt.GetAbsLSpace() + rNumFmt.GetFirstLineOffset(); - if(bOn && i) - nValue -= (pActNum->GetLevel(i - 1).GetAbsLSpace() + pActNum->GetLevel(i - 1).GetFirstLineOffset()); - } - else - bSetValue = nValue == - (rNumFmt.GetAbsLSpace() + rNumFmt.GetFirstLineOffset()) - - (pActNum->GetLevel(i - 1).GetAbsLSpace() + pActNum->GetLevel(i - 1).GetFirstLineOffset()); - bFirst = sal_False; - } - nMask <<= 1; - } - - } - String aEmptyStr; - if(bSetValue) - SetMetricValue(aDistBorderMF, nValue, eCoreUnit); - else - aDistBorderMF.SetText(aEmptyStr); - aDistBorderMF.Enable(bOn || bSingleSelection); - aDistBorderFT.Enable(bOn || bSingleSelection); - bLastRelative = bOn; - return 0; -} - -IMPL_LINK( SvxNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox*, EMPTYARG ) -{ - // determine value to be set at the chosen list levels - SvxNumberFormat::SvxNumLabelFollowedBy eLabelFollowedBy = - SvxNumberFormat::LISTTAB; - { - const sal_uInt16 nPos = aLabelFollowedByLB.GetSelectEntryPos(); - if ( nPos == 1 ) - { - eLabelFollowedBy = SvxNumberFormat::SPACE; - } - else if ( nPos == 2 ) - { - eLabelFollowedBy = SvxNumberFormat::NOTHING; - } - } - - // set value at the chosen list levels - bool bSameListtabPos = true; - sal_uInt16 nFirstLvl = USHRT_MAX; - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i ) - { - if ( nActNumLvl & nMask ) - { - SvxNumberFormat aNumFmt( pActNum->GetLevel(i) ); - aNumFmt.SetLabelFollowedBy( eLabelFollowedBy ); - pActNum->SetLevel( i, aNumFmt ); - - if ( nFirstLvl == USHRT_MAX ) - { - nFirstLvl = i; - } - else - { - bSameListtabPos &= aNumFmt.GetListtabPos() == - pActNum->GetLevel( nFirstLvl ).GetListtabPos(); - } - } - nMask <<= 1; - } - - // enable/disable metric field for list tab stop position depending on - // selected item following the list label. - aListtabFT.Enable( eLabelFollowedBy == SvxNumberFormat::LISTTAB ); - aListtabMF.Enable( eLabelFollowedBy == SvxNumberFormat::LISTTAB ); - if ( bSameListtabPos && eLabelFollowedBy == SvxNumberFormat::LISTTAB ) - { - SetMetricValue( aListtabMF, pActNum->GetLevel( nFirstLvl ).GetListtabPos(), eCoreUnit ); - } - else - { - aListtabMF.SetText( String() ); - } - - SetModified(); - - return 0; -} - -IMPL_LINK( SvxNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld ) -{ - // determine value to be set at the chosen list levels - const long nValue = GetCoreValue( *pFld, eCoreUnit ); - - // set value at the chosen list levels - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i ) - { - if ( nActNumLvl & nMask ) - { - SvxNumberFormat aNumFmt( pActNum->GetLevel(i) ); - aNumFmt.SetListtabPos( nValue ); - pActNum->SetLevel( i, aNumFmt ); -#if OSL_DEBUG_LEVEL > 1 - lcl_PrintDebugOutput(*pDebugFixedText, aNumFmt); -#endif - } - nMask <<= 1; - } - - SetModified(); - - return 0; -} - -IMPL_LINK( SvxNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pFld ) -{ - // determine value to be set at the chosen list levels - const long nValue = GetCoreValue( *pFld, eCoreUnit ); - - // set value at the chosen list levels - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i ) - { - if ( nActNumLvl & nMask ) - { - SvxNumberFormat aNumFmt( pActNum->GetLevel(i) ); - const long nFirstLineIndent = nValue - aNumFmt.GetIndentAt(); - aNumFmt.SetFirstLineIndent( nFirstLineIndent ); - pActNum->SetLevel( i, aNumFmt ); -#if OSL_DEBUG_LEVEL > 1 - lcl_PrintDebugOutput(*pDebugFixedText, aNumFmt); -#endif - } - nMask <<= 1; - } - - SetModified(); - - return 0; -} - -IMPL_LINK( SvxNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pFld ) -{ - // determine value to be set at the chosen list levels - const long nValue = GetCoreValue( *pFld, eCoreUnit ); - - // set value at the chosen list levels - sal_uInt16 nMask = 1; - for( sal_uInt16 i = 0; i < pActNum->GetLevelCount(); ++i ) - { - if ( nActNumLvl & nMask ) - { - SvxNumberFormat aNumFmt( pActNum->GetLevel(i) ); - const long nAlignedAt = aNumFmt.GetIndentAt() + - aNumFmt.GetFirstLineIndent(); - aNumFmt.SetIndentAt( nValue ); - const long nNewFirstLineIndent = nAlignedAt - nValue; - aNumFmt.SetFirstLineIndent( nNewFirstLineIndent ); - pActNum->SetLevel( i, aNumFmt ); -#if OSL_DEBUG_LEVEL > 1 - lcl_PrintDebugOutput(*pDebugFixedText, aNumFmt); -#endif - } - nMask <<= 1; - } - - SetModified(); - - return 0; -} - -IMPL_LINK( SvxNumPositionTabPage, StandardHdl_Impl, PushButton *, EMPTYARG ) -{ - sal_uInt16 nMask = 1; - SvxNumRule aTmpNumRule( pActNum->GetFeatureFlags(), - pActNum->GetLevelCount(), - pActNum->IsContinuousNumbering(), - SVX_RULETYPE_NUMBERING, - pActNum->GetLevel( 0 ).GetPositionAndSpaceMode() ); - for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) - { - if(nActNumLvl & nMask) - { - SvxNumberFormat aNumFmt( pActNum->GetLevel( i ) ); - SvxNumberFormat aTempFmt(aTmpNumRule.GetLevel( i )); - aNumFmt.SetPositionAndSpaceMode( aTempFmt.GetPositionAndSpaceMode() ); - if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) - { - aNumFmt.SetAbsLSpace( aTempFmt.GetAbsLSpace() ); - aNumFmt.SetCharTextDistance( aTempFmt.GetCharTextDistance() ); - aNumFmt.SetFirstLineOffset( aTempFmt.GetFirstLineOffset() ); - } - else if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) - { - aNumFmt.SetNumAdjust( aTempFmt.GetNumAdjust() ); - aNumFmt.SetLabelFollowedBy( aTempFmt.GetLabelFollowedBy() ); - aNumFmt.SetListtabPos( aTempFmt.GetListtabPos() ); - aNumFmt.SetFirstLineIndent( aTempFmt.GetFirstLineIndent() ); - aNumFmt.SetIndentAt( aTempFmt.GetIndentAt() ); - } - - pActNum->SetLevel( i, aNumFmt ); - } - nMask <<= 1; - } - - InitControls(); - SetModified(); - return 0; -} - -void SvxNumPositionTabPage::SetModified(sal_Bool bRepaint) -{ - bModified = sal_True; - if(bRepaint) - { - pPreviewWIN->SetLevel(nActNumLvl); - pPreviewWIN->Invalidate(); - } -} - -void SvxNumOptionsTabPage::SetModified(sal_Bool bRepaint) -{ - bModified = sal_True; - if(bRepaint) - { - pPreviewWIN->SetLevel(nActNumLvl); - pPreviewWIN->Invalidate(); - } -} - - -void SvxNumOptionsTabPage::PageCreated(SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pListItem,SfxStringListItem,SID_CHAR_FMT_LIST_BOX,sal_False); - SFX_ITEMSET_ARG (&aSet,pNumCharFmt,SfxStringItem,SID_NUM_CHAR_FMT,sal_False); - SFX_ITEMSET_ARG (&aSet,pBulletCharFmt,SfxStringItem,SID_BULLET_CHAR_FMT,sal_False); - SFX_ITEMSET_ARG (&aSet,pMetricItem,SfxAllEnumItem,SID_METRIC_ITEM,sal_False); - - if (pNumCharFmt &&pBulletCharFmt) - SetCharFmts( pNumCharFmt->GetValue(),pBulletCharFmt->GetValue()); - - if (pListItem) - { - ListBox& myCharFmtLB = GetCharFmtListBox(); - const std::vector<String> &aList = (pListItem)->GetList(); - sal_uInt32 nCount = aList.size();; - for(sal_uInt32 i = 0; i < nCount; i++) - myCharFmtLB.InsertEntry(aList[i]); - } - if (pMetricItem) - SetMetric(static_cast<FieldUnit>(pMetricItem->GetValue())); -} - -void SvxNumPositionTabPage::PageCreated(SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pMetricItem,SfxAllEnumItem,SID_METRIC_ITEM,sal_False); - - if (pMetricItem) - SetMetric(static_cast<FieldUnit>(pMetricItem->GetValue())); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/numpages.hrc b/cui/source/tabpages/numpages.hrc deleted file mode 100644 index 1482de300..000000000 --- a/cui/source/tabpages/numpages.hrc +++ /dev/null @@ -1,132 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#define FT_ALIGN 50 -#define LB_ALIGN 51 -#define FT_DIST_BORDER 52 -#define MF_DIST_BORDER 53 -#define FT_DIST_NUM 54 -#define MF_DIST_NUM 55 -#define GB_POS 56 - -#define LB_FMT_CHAR 60 -#define FT_FMT_CHAR 61 - -#define FT_WIDTH 67 -#define FI_URL 68 -#define FT_HEIGHT 70 - - -#define MN_STD_NUMBER 120 -#define MD_DEL_NUMBER 121 -#define MN_STD_BULLET 122 -#define MN_DEL_BULLET 123 - -#define STR_BULLET 200 -//#define STR_NUMFMT_1 201 -//#define STR_NUMFMT_2 202 -//#define STR_NUMFMT_3 203 -//#define STR_NUMFMT_4 204 -//#define STR_NUMFMT_5 205 -//#define STR_NUMFMT_6 206 -//#define STR_NUMFMT_7 207 -//#define STR_NUMFMT_8 208 -//#define STR_NUMFMT_7_HTML 209 - -#define LB_FORM 210 -#define ED_FORM 211 -#define GB_FORM 212 - -#define BT_BULLET 213 - -#define FL_VALUES 220 -#define VS_VALUES 221 -#define ST_CUSTOMIZE 222 -#define FT_ERROR 223 -#define CB_LINKED 224 - -#define FT_LEVEL 151 -#define LB_LEVEL 152 -#define FL_FORMAT 153 -#define FL_POSITION 154 -#define FT_PREFIX 155 -#define ED_PREFIX 156 -#define FT_FMT 157 -#define LB_FMT 158 -#define FT_SUFFIX 159 -#define ED_SUFFIX 160 -#define FT_BORDERDIST 161 -#define MF_BORDERDIST 162 -#define FT_NUMDIST 163 -#define MF_NUMDIST 164 -#define FT_INDENT 165 -#define MF_INDENT 166 -#define FT_CHARFMT 167 -#define LB_CHARFMT 168 -#define NF_ALL_LEVEL 169 -#define FT_START 170 -#define ED_START 171 -#define FT_BULLET 172 -#define PB_BULLET 173 -#define WIN_PREVIEW 174 -#define FT_BITMAP 175 -#define PB_SEARCH 176 -#define CB_RATIO 177 -#define FT_SIZE 178 -#define MF_WIDTH 179 -#define FT_MULT 180 -#define MF_HEIGHT 181 -#define FT_ORIENT 182 -#define LB_ORIENT 183 -#define MB_BITMAP 184 -#define CB_RELATIVE 185 -#define FT_ALL_LEVEL 186 -#define PB_STANDARD 187 -#define CB_SAME_LEVEL 188 -#define FL_SAME_LEVEL 189 -#define FT_BUL_COLOR 190 -#define LB_BUL_COLOR 191 -#define FT_BUL_REL_SIZE 192 -#define MF_BUL_REL_SIZE 193 -// 194 removed -#define ST_POPUP_EMPTY_ENTRY 195 - -#define MN_GRAPHIC_DLG 1 -#define MN_GALLERY 2 -#define MN_GALLERY_ENTRY 100 - -#define FT_LABEL_FOLLOWED_BY 250 -#define LB_LABEL_FOLLOWED_BY 251 -#define FT_LISTTAB 252 -#define MF_LISTTAB 253 -#define FT_ALIGN_2 254 -#define LB_ALIGN_2 255 -#define FT_ALIGNED_AT 256 -#define MF_ALIGNED_AT 257 -#define FT_INDENT_AT 258 -#define MF_INDENT_AT 259 - diff --git a/cui/source/tabpages/numpages.src b/cui/source/tabpages/numpages.src deleted file mode 100644 index 3e8808924..000000000 --- a/cui/source/tabpages/numpages.src +++ /dev/null @@ -1,842 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <cuires.hrc> -#include <helpid.hrc> -#include "numpages.hrc" -#include <svx/dialogs.hrc> - -/**************************************************************************/ -/* */ -/* TabPage */ -/* */ -/**************************************************************************/ -TabPage RID_SVXPAGE_PICK_BULLET -{ - HelpID = HID_SVXPAGE_PICK_BULLET ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE; - FixedLine FL_VALUES - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Selection" ; - }; - Control VS_VALUES - { - Pos = MAP_APPFONT ( 9 , 14 ) ; - Size = MAP_APPFONT ( 242 , 167 ) ; - TabStop = TRUE ; - }; -}; -/**************************************************************************/ -/* */ -/* TabPage */ -/* */ -/**************************************************************************/ -TabPage RID_SVXPAGE_PICK_SINGLE_NUM -{ - HelpID = HID_SVXPAGE_PICK_SINGLE_NUM ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE; - FixedLine FL_VALUES - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Selection" ; - }; - Control VS_VALUES - { - Pos = MAP_APPFONT ( 9 , 14 ) ; - Size = MAP_APPFONT ( 242 , 167 ) ; - TabStop = TRUE ; - }; -}; -/**************************************************************************/ -/* */ -/* TabPage */ -/* */ -/**************************************************************************/ -TabPage RID_SVXPAGE_PICK_NUM -{ - HelpID = HID_SVXPAGE_PICK_NUM; - SVLook = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE; - FixedLine FL_VALUES - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Selection" ; - }; - Control VS_VALUES - { - Pos = MAP_APPFONT ( 9 , 14 ) ; - Size = MAP_APPFONT ( 242 , 167 ) ; - TabStop = TRUE ; - }; -}; -/**************************************************************************/ -/* */ -/* TabPage */ -/* */ -/**************************************************************************/ -TabPage RID_SVXPAGE_PICK_BMP -{ - HelpID = HID_SVXPAGE_PICK_BMP; - SVLook = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE; - FixedLine FL_VALUES - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Selection" ; - }; - Control VS_VALUES - { - Pos = MAP_APPFONT ( 9 , 14 ) ; - Size = MAP_APPFONT ( 242 , 152 ) ; - TabStop = TRUE ; - Hide = TRUE ; - }; - CheckBox CB_LINKED - { - HelpID = "cui:CheckBox:RID_SVXPAGE_PICK_BMP:CB_LINKED"; - Pos = MAP_APPFONT ( 9 , 169 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Link graphics"; - }; - FixedText FT_ERROR - { - Pos = MAP_APPFONT ( 9 , 14 ) ; - Size = MAP_APPFONT ( 242 , 30 ) ; - Text [ en-US ] = "The Gallery theme 'Bullets' is empty (no graphics)." ; - Hide = TRUE ; - WordBreak = TRUE ; - }; -}; -/**************************************************************************/ -/* */ -/* TabPage Numerierungsoptionen */ -/* */ -/**************************************************************************/ -TabPage RID_SVXPAGE_NUM_OPTIONS -{ - HelpID = HID_SVXPAGE_NUM_OPTIONS ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE; - FixedText FT_LEVEL - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "Level" ; - }; - MultiListBox LB_LEVEL - { - HelpID = "cui:MultiListBox:RID_SVXPAGE_NUM_OPTIONS:LB_LEVEL"; - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 26 , 154 ) ; - TabStop = TRUE ; - DropDown = FALSE ; - Border = TRUE ; - SimpleMode = TRUE ; - }; - FixedLine FL_FORMAT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Format" ; - }; - FixedText FT_FMT - { - Pos = MAP_APPFONT ( 50 , 27 ) ; - Size = MAP_APPFONT ( 50, 8 ) ; - Text [ en-US ] = "~Numbering" ; - }; - ListBox LB_FMT - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUM_OPTIONS:LB_FMT"; - Pos = MAP_APPFONT ( 103 , 25 ) ; - Size = MAP_APPFONT ( 67 , 72 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - CurPos = 0 ; - StringList [ en-US ] = - { - < "1, 2, 3, ... " ; 4/*SVX_NUM_ARABIC */; > ; - < "A, B, C, ... " ; 0/*SVX_NUM_CHARS_UPPER_LETTER */; > ; - < "a, b, c, ..." ; 1/*SVX_NUM_CHARS_LOWER_LETTER */; > ; - < "I, II, III, ... " ; 2/*SVX_NUM_ROMAN_UPPER */; > ; - < "i, ii, iii, ... " ; 3/*SVX_NUM_ROMAN_LOWER */; > ; - < "A, .., AA, .., AAA, ... " ; 9/*SVX_NUM_CHARS_UPPER_LETTER_N*/; > ; - < "a, .., aa, .., aaa, ..." ; 10/*SVX_NUM_CHARS_LOWER_LETTER_N*/; > ; - < "Bullet" ; 6/*SVX_NUM_CHAR_SPECIAL */; > ; - < "Graphics" ; 8/*SVX_NUM_BITMAP */; > ; - < "Linked graphics" ; 0x88/*SVX_NUM_BITMAP|0x80 */; > ; - < "None" ; 5/*SVX_NUM_NUMBER_NONE */; > ; - < "Native Numbering" ; 12 /*NATIVE_NUMBERING */; > ; - < "Ð, Б, .., Ðа, Ðб, ... (Bulgarian)" ; 38 /*CHARS_CYRILLIC_UPPER_LETTER_BG */; > ; - < "а, б, .., аа, аб, ... (Bulgarian)" ; 39 /*CHARS_CYRILLIC_LOWER_LETTER_BG */; > ; - < "Ð, Б, .., Ðа, Бб, ... (Bulgarian)" ; 40 /*CHARS_CYRILLIC_UPPER_LETTER_N_BG */; > ; - < "а, б, .., аа, бб, ... (Bulgarian)" ; 41 /*CHARS_CYRILLIC_LOWER_LETTER_N_BG */; > ; - < "Ð, Б, .., Ðа, Ðб, ... (Russian)" ; 42 /*CHARS_CYRILLIC_UPPER_LETTER_RU */; > ; - < "а, б, .., аа, аб, ... (Russian)" ; 43 /*CHARS_CYRILLIC_LOWER_LETTER_RU */; > ; - < "Ð, Б, .., Ðа, Бб, ... (Russian)" ; 44 /*CHARS_CYRILLIC_UPPER_LETTER_N_RU */; > ; - < "а, б, .., аа, бб, ... (Russian)" ; 45 /*CHARS_CYRILLIC_LOWER_LETTER_N_RU */; > ; - < "Ð, Б, .., Ðа, Ðб, ... (Serbian)" ; 48 /*CHARS_CYRILLIC_UPPER_LETTER_SR */; > ; - < "а, б, .., аа, аб, ... (Serbian)" ; 49 /*CHARS_CYRILLIC_LOWER_LETTER_SR */; > ; - < "Ð, Б, .., Ðа, Бб, ... (Serbian)" ; 50 /*CHARS_CYRILLIC_UPPER_LETTER_N_SR */; > ; - < "а, б, .., аа, бб, ... (Serbian)" ; 51 /*CHARS_CYRILLIC_LOWER_LETTER_N_SR */; > ; - < "Α, Î’, Γ, ... (Greek Upper Letter)"; 52 /*CHARS_GREEK_UPPER_LETTER */; > ; - < "α, β, γ, ... (Greek Lower Letter)"; 53 /*CHARS_GREEK_LOWER_LETTER */; > ; - }; - }; - FixedText FT_PREFIX - { - Pos = MAP_APPFONT ( 50 , 43 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "Before" ; - Left = TRUE ; - }; - Edit ED_PREFIX - { - HelpID = "cui:Edit:RID_SVXPAGE_NUM_OPTIONS:ED_PREFIX"; - Border = TRUE ; - Pos = MAP_APPFONT ( 103 , 41 ) ; - Size = MAP_APPFONT ( 67 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; - FixedText FT_SUFFIX - { - Pos = MAP_APPFONT ( 50 , 59 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "After" ; - Left = TRUE ; - }; - Edit ED_SUFFIX - { - HelpID = "cui:Edit:RID_SVXPAGE_NUM_OPTIONS:ED_SUFFIX"; - Border = TRUE ; - Pos = MAP_APPFONT ( 103 , 57 ) ; - Size = MAP_APPFONT ( 67 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; - FixedText FT_CHARFMT - { - Pos = MAP_APPFONT ( 50 , 75 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Character Style" ; - }; - ListBox LB_CHARFMT - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUM_OPTIONS:LB_CHARFMT"; - TabStop = TRUE ; - DropDown = TRUE ; - Pos = MAP_APPFONT ( 103 , 73 ) ; - Size = MAP_APPFONT ( 67 , 72 ) ; - }; - FixedText FT_BUL_COLOR - { - Pos = MAP_APPFONT ( 50 , 75 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Hide = TRUE; - Text [ en-US ] = "Color"; - }; - ListBox LB_BUL_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUM_OPTIONS:LB_BUL_COLOR"; - TabStop = TRUE ; - DropDown = TRUE ; - Pos = MAP_APPFONT ( 103 , 73 ) ; - Size = MAP_APPFONT ( 67 , 100 ) ; - Hide = TRUE; - }; - FixedText FT_BUL_REL_SIZE - { - Pos = MAP_APPFONT ( 50 , 91 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Hide = TRUE; - Text [ en-US ] = "~Relative size"; - }; - MetricField MF_BUL_REL_SIZE - { - HelpID = "cui:MetricField:RID_SVXPAGE_NUM_OPTIONS:MF_BUL_REL_SIZE"; - Pos = MAP_APPFONT ( 103 , 89 ) ; - Size = MAP_APPFONT ( 67 , 12 ) ; - Border = TRUE ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - SpinSize = 1 ; - Minimum = 1; - Maximum = 250; - Hide = TRUE; - }; - FixedText FT_ALL_LEVEL - { - Pos = MAP_APPFONT ( 50 , 91 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "Show sublevels" ; - }; - NumericField NF_ALL_LEVEL - { - HelpID = "cui:NumericField:RID_SVXPAGE_NUM_OPTIONS:NF_ALL_LEVEL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 103 , 89 ) ; - Size = MAP_APPFONT ( 67 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 10 ; - Value = 1 ; - First = 1 ; - Last = 10 ; - }; - FixedText FT_START - { - Pos = MAP_APPFONT ( 50 , 107 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "Start at" ; - Left = TRUE ; - }; - NumericField ED_START - { - HelpID = "cui:NumericField:RID_SVXPAGE_NUM_OPTIONS:ED_START"; - Border = TRUE ; - Pos = MAP_APPFONT ( 103 , 105 ) ; - Size = MAP_APPFONT ( 67 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 65535 ; - Value = 1 ; - First = 0 ; - Last = 65535 ; - }; - FixedText FT_ALIGN - { - Pos = MAP_APPFONT ( 50 , 135 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Alignment" ; - Hide = TRUE; - }; - ListBox LB_ALIGN - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUM_OPTIONS:LB_ALIGN"; - Pos = MAP_APPFONT ( 103 , 133 ) ; - Size = MAP_APPFONT ( 40 , 40 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Hide = TRUE; - StringList [ en-US ] = - { - < "Left" ; > ; - < "Centered" ; > ; - < "Right" ; > ; - }; - }; - String STR_BULLET - { - Text [ en-US ] = "Character" ; - }; - PushButton PB_BULLET - { - HelpID = "cui:PushButton:RID_SVXPAGE_NUM_OPTIONS:PB_BULLET"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 103 , 105 ) ; - Size = MAP_APPFONT ( 12 , 12 ) ; - Text = "..." ; - TabStop = TRUE ; - }; - FixedText FT_BITMAP - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 50 , 43 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "Graphics" ; - }; - MenuButton MB_BITMAP - { - HelpID = "cui:MenuButton:RID_SVXPAGE_NUM_OPTIONS:MB_BITMAP"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 103 , 41 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - ButtonMenu = Menu - { - ItemList = - { - MenuItem - { - Identifier = MN_GRAPHIC_DLG ; - // HelpID = HID_NUM_NAMED_NUMS ; - Text [ en-US ] = "From file..." ; - }; - MenuItem - { - Identifier = MN_GALLERY ; - Text [ en-US ] = "Gallery"; - }; - }; - }; - Text [ en-US ] = "Select..." ; - }; - FixedText FT_SIZE - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 50 , 61 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "Width" ; - }; - MetricField MF_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_NUM_OPTIONS:MF_WIDTH"; - Pos = MAP_APPFONT ( 103 , 59 ) ; - Size = MAP_APPFONT ( 67 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - Hide = TRUE ; - }; - FixedText FT_MULT - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 50 , 77 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "Height" ; - }; - MetricField MF_HEIGHT - { - HelpID = "cui:MetricField:RID_SVXPAGE_NUM_OPTIONS:MF_HEIGHT"; - Pos = MAP_APPFONT ( 103 , 75 ) ; - Size = MAP_APPFONT ( 67 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - Hide = TRUE ; - }; - CheckBox CB_RATIO - { - HelpID = "cui:CheckBox:RID_SVXPAGE_NUM_OPTIONS:CB_RATIO"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 50 , 91 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - Text [ en-US ] = "Keep ratio" ; - }; - FixedText FT_ORIENT - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 50 , 105 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "Alignment" ; - }; - ListBox LB_ORIENT - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUM_OPTIONS:LB_ORIENT"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 103 , 103 ) ; - Size = MAP_APPFONT ( 67 , 72 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - CurPos = 0 ; - StringList [ en-US ] = - { - < "Top of baseline" ; > ; - < "Center of baseline" ; > ; - < "Bottom of baseline" ; > ; - < "Top of character" ; > ; - < "Center of character" ; > ; - < "Bottom of character" ; > ; - < "Top of line" ; > ; - < "Center of line" ; > ; - < "Bottom of line" ; > ; - }; - }; - FixedLine FL_SAME_LEVEL - { - Pos = MAP_APPFONT ( 47 , 156 ) ; - Size = MAP_APPFONT ( 126 , 8 ) ; - Text [ en-US ] = "All levels" ; - }; - CheckBox CB_SAME_LEVEL - { - HelpID = "cui:CheckBox:RID_SVXPAGE_NUM_OPTIONS:CB_SAME_LEVEL"; - Pos = MAP_APPFONT ( 53 , 167 ) ; - Size = MAP_APPFONT ( 114 , 10 ) ; - Text [ en-US ] = "~Consecutive numbering" ; - }; - Window WIN_PREVIEW - { - Pos = MAP_APPFONT ( 179 , 25 ) ; - Size = MAP_APPFONT ( 69 , 154 ) ; - Border = TRUE ; - }; - String ST_POPUP_EMPTY_ENTRY - { - Text [ en-US ] = "There are no graphics in the 'Bullets' Gallery theme."; - }; - -}; -/**************************************************************************/ -/* */ -/* TabPage Positionen */ -/* */ -/**************************************************************************/ -TabPage RID_SVXPAGE_NUM_POSITION -{ - HelpID = HID_SVXPAGE_NUM_POSITION ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE; - FixedText FT_LEVEL - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 50, 8 ) ; - Text [ en-US ] = "Level" ; - }; - MultiListBox LB_LEVEL - { - HelpID = "cui:MultiListBox:RID_SVXPAGE_NUM_POSITION:LB_LEVEL"; - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 26 , 154 ) ; - TabStop = TRUE ; - DropDown = FALSE ; - Border = TRUE ; - SimpleMode = TRUE ; - }; - FixedLine FL_POSITION - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Group = TRUE ; - Text [ en-US ] = "Position and spacing" ; - }; - FixedText FT_BORDERDIST - { - Pos = MAP_APPFONT ( 50 , 27 ) ; - Size = MAP_APPFONT ( 105 , 10 ) ; - Text [ en-US ] = "Indent" ; - }; - MetricField MF_BORDERDIST - { - HelpID = "cui:MetricField:RID_SVXPAGE_NUM_POSITION:MF_BORDERDIST"; - Pos = MAP_APPFONT ( 198 , 25 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -1999 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - }; - CheckBox CB_RELATIVE - { - HelpID = "cui:CheckBox:RID_SVXPAGE_NUM_POSITION:CB_RELATIVE"; - Pos = MAP_APPFONT ( 198 , 41 ) ; - Size = MAP_APPFONT ( 52 , 10 ) ; - Text [ en-US ] = "Relati~ve" ; - }; - FixedText FT_INDENT - { - Pos = MAP_APPFONT ( 50 , 59 ) ; - Size = MAP_APPFONT ( 105 , 8 ) ; - Text [ en-US ] = "Width of numbering" ; - }; - MetricField MF_INDENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_NUM_POSITION:MF_INDENT"; - Pos = MAP_APPFONT ( 198 , 57 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - }; - FixedText FT_NUMDIST - { - Pos = MAP_APPFONT ( 50 , 75 ) ; - Size = MAP_APPFONT ( 105 , 8 ) ; - Text [ en-US ] = "Minimum space numbering <-> text" ; - }; - MetricField MF_NUMDIST - { - HelpID = "cui:MetricField:RID_SVXPAGE_NUM_POSITION:MF_NUMDIST"; - Pos = MAP_APPFONT ( 198 , 73 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - Border = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_ALIGN - { - Pos = MAP_APPFONT ( 50 , 91 ) ; - Size = MAP_APPFONT ( 105 , 8 ) ; - Text [ en-US ] = "N~umbering alignment" ; - }; - ListBox LB_ALIGN - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUM_POSITION:LB_ALIGN"; - Pos = MAP_APPFONT ( 198 , 89 ) ; - Size = MAP_APPFONT ( 40 , 40 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Left" ; > ; - < "Centered" ; > ; - < "Right" ; > ; - }; - }; - FixedText FT_LABEL_FOLLOWED_BY - { - Pos = MAP_APPFONT ( 50 , 27 ) ; - Size = MAP_APPFONT ( 105 , 10 ) ; - Text [ en-US ] = "Numbering followed by" ; - }; - ListBox LB_LABEL_FOLLOWED_BY - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUM_POSITION:LB_LABEL_FOLLOWED_BY"; - Pos = MAP_APPFONT ( 198 , 25 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Tab stop" ; > ; - < "Space" ; > ; - < "Nothing" ; > ; - }; - }; - FixedText FT_LISTTAB - { - Pos = MAP_APPFONT ( 50 , 43 ) ; - Size = MAP_APPFONT ( 143 , 10 ) ; - Right = TRUE ; - Text [ en-US ] = "at" ; - }; - MetricField MF_LISTTAB - { - HelpID = "cui:MetricField:RID_SVXPAGE_NUM_POSITION:MF_LISTTAB"; - Pos = MAP_APPFONT ( 198 , 41 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - }; - FixedText FT_ALIGN_2 - { - Pos = MAP_APPFONT ( 50 , 59 ) ; - Size = MAP_APPFONT ( 105 , 8 ) ; - }; - ListBox LB_ALIGN_2 - { - HelpID = "cui:ListBox:RID_SVXPAGE_NUM_POSITION:LB_ALIGN_2"; - Pos = MAP_APPFONT ( 198 , 57 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedText FT_ALIGNED_AT - { - Pos = MAP_APPFONT ( 50 , 75 ) ; - Size = MAP_APPFONT ( 105 , 8 ) ; - Text [ en-US ] = "Aligned at" ; - }; - MetricField MF_ALIGNED_AT - { - HelpID = "cui:MetricField:RID_SVXPAGE_NUM_POSITION:MF_ALIGNED_AT"; - Pos = MAP_APPFONT ( 198 , 73 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -1999 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - Border = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_INDENT_AT - { - Pos = MAP_APPFONT ( 50 , 91 ) ; - Size = MAP_APPFONT ( 105 , 8 ) ; - Text [ en-US ] = "Indent at" ; - }; - MetricField MF_INDENT_AT - { - HelpID = "cui:MetricField:RID_SVXPAGE_NUM_POSITION:MF_INDENT_AT"; - Pos = MAP_APPFONT ( 198 , 89 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -1999 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - Border = TRUE ; - TabStop = TRUE ; - }; - PushButton PB_STANDARD - { - HelpID = "cui:PushButton:RID_SVXPAGE_NUM_POSITION:PB_STANDARD"; - Pos = MAP_APPFONT ( 198 , 165 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "Default" ; - }; - Window WIN_PREVIEW - { - Pos = MAP_APPFONT ( 50 , 113 ) ; - Size = MAP_APPFONT ( 143 , 67 ) ; - Border = TRUE ; - }; -}; - -String RID_STR_EDIT_GRAPHIC -{ - Text [ en-US ] = "Link" ; -}; -/* -String RID_STR_FULLNUMS_1 { Text = "1.|1.1|a)|61589|61589" ; }; -String RID_STR_FULLNUMS_2 { Text = "1.|a)|61589|61589|61589" ; }; -String RID_STR_FULLNUMS_3 { Text = "1.|(a)|i.|A.|61589" ; }; -String RID_STR_FULLNUMS_4 { Text = "1.|1.|1.|1.|1." ; }; -String RID_STR_FULLNUMS_5 { Text = "I.|A.|i.|a)|61589" ; }; -String RID_STR_FULLNUMS_6 { Text = "A.|I.|a.|i.|61589" ; }; -String RID_STR_FULLNUMS_7 { Text = "1|1.1|1.1.1|1.1.1.1|1.1.1.1.1" ; }; -String RID_STR_FULLNUMS_8 { Text = "61487|61488|61485|61589|61589" ; }; -String RID_STR_FULLNUMS_7_HTML { Text = "I.|I.|I|I.|I." ; }; -*/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx deleted file mode 100644 index e3c0c6a59..000000000 --- a/cui/source/tabpages/page.cxx +++ /dev/null @@ -1,1768 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <sfx2/app.hxx> -#include <sfx2/objsh.hxx> -#include <tools/resary.hxx> -#include <vcl/graph.hxx> -#include <sfx2/viewsh.hxx> -#include <svl/itemiter.hxx> -#include <svl/languageoptions.hxx> -#include <vcl/msgbox.hxx> -#include <unotools/configitem.hxx> -#include "svx/htmlmode.hxx" -#include <sal/macros.h> - -#define _SVX_PAGE_CXX - -#include <cuires.hrc> -#include "page.hrc" -#include "helpid.hrc" -#include "page.hxx" -#include <svx/pageitem.hxx> -#include <editeng/brshitem.hxx> -#include <editeng/boxitem.hxx> -#include <editeng/shaditem.hxx> -#include <editeng/pbinitem.hxx> -#include <editeng/lrspitem.hxx> -#include <editeng/ulspitem.hxx> -#include <editeng/sizeitem.hxx> -#include <editeng/frmdiritem.hxx> -#include "svx/dlgutil.hxx" -#include <editeng/paperinf.hxx> -#include <dialmgr.hxx> -#include <sfx2/module.hxx> -#include <svl/stritem.hxx> -#include <svx/dialogs.hrc> // for RID_SVXPAGE_PAGE -#include <editeng/eerdll.hxx> -#include <editeng/editrids.hrc> // for RID_SVXSTR_PAPERBIN..., -#include <svx/svxids.hrc> - -// #i4219# -#include <svtools/optionsdrawinglayer.hxx> -#include <svl/slstitm.hxx> -#include <svl/aeitem.hxx> -#include <sfx2/request.hxx> -// configuration helper ======================================================= - -/** Helper to get a configuration setting. - @descr This is a HACK to get a configuration item directly. Normally the - OfaHtmlOptions class from 'offmgr' project would do the job, but we cannot - use it here. On the other hand, the OfaHtmlOptions cannot be moved to - 'svtools', because it uses 'svx' itself... - The correct way would be to move OfaHtmlOptions to 'svtools' anyway, and to - remove the dependency from 'svx' (a call to the static function - SvxTextEncodingBox::GetBestMimeEncoding(), which contains low level - operations that can be moved to lower projects, i.e. 'rtl'). Then this - class can be removed, and the OfaHtmlOptions can be used instead. */ -class SvxHtmlExportModeConfigItem_Impl : public utl::ConfigItem -{ -public: - explicit SvxHtmlExportModeConfigItem_Impl(); - - /** Returns the HTML export mode, as read from the configuration. */ - inline sal_Int32 GetExportMode() const { return mnExpMode; } - - /** Returns true, if the current HTML export mode is set to HTML 3.2. */ - inline bool IsExportModeHTML32() const { return mnExpMode == 0; } // 0 == HTML_CFG_HTML32, see offmgr/htmlcfg.hxx - - virtual void Commit(); - virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames); - -private: - sal_Int32 mnExpMode; -}; - -SvxHtmlExportModeConfigItem_Impl::SvxHtmlExportModeConfigItem_Impl() : - utl::ConfigItem( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/HTML/Export" ) ) ), - mnExpMode( 3 ) // default to 3 == HTML_CFG_NS40, see offmgr/htmlcfg.hxx -{ - using com::sun::star::uno::Sequence; - using com::sun::star::uno::Any; - - Sequence< rtl::OUString > aPropNames( 1 ); - aPropNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Browser" ) ); - Sequence< Any > aPropValues( GetProperties( aPropNames ) ); - if( aPropValues.getLength() == 1 ) - aPropValues[ 0 ] >>= mnExpMode; -} - -void SvxHtmlExportModeConfigItem_Impl::Commit() -{ -} - -void SvxHtmlExportModeConfigItem_Impl::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& ) -{ -} - -// static ---------------------------------------------------------------- - -static const long MINBODY = 284; // 0,5cm in twips aufgerundet -//static const long PRINT_OFFSET = 17; // 0,03cm in twips abgerundet -static const long PRINT_OFFSET = 0; // why was this ever set to 17 ? it led to wrong right and bottom margins. - -static sal_uInt16 pRanges[] = -{ - SID_ATTR_BORDER_OUTER, - SID_ATTR_BORDER_SHADOW, - SID_ATTR_LRSPACE, - SID_ATTR_PAGE_SHARED, - SID_SWREGISTER_COLLECTION, - SID_SWREGISTER_MODE, - 0 -}; - -// ------- Mapping Seitenlayout ------------------------------------------ - -sal_uInt16 aArr[] = -{ - SVX_PAGE_ALL, - SVX_PAGE_MIRROR, - SVX_PAGE_RIGHT, - SVX_PAGE_LEFT -}; - -// ----------------------------------------------------------------------- - -sal_uInt16 PageUsageToPos_Impl( sal_uInt16 nUsage ) -{ - for ( sal_uInt16 i = 0; i < SAL_N_ELEMENTS(aArr); ++i ) - if ( aArr[i] == ( nUsage & 0x000f ) ) - return i; - return SVX_PAGE_ALL; -} - -// ----------------------------------------------------------------------- - -sal_uInt16 PosToPageUsage_Impl( sal_uInt16 nPos ) -{ - if ( nPos >= SAL_N_ELEMENTS(aArr) ) - return 0; - return aArr[nPos]; -} - -// ----------------------------------------------------------------------- - -Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBox ) -{ - Size aSz; - aSz.Height() = rShadow.CalcShadowSpace( SHADOW_BOTTOM ) + rBox.CalcLineSpace( BOX_LINE_BOTTOM ); - aSz.Height() += rShadow.CalcShadowSpace( SHADOW_TOP ) + rBox.CalcLineSpace( BOX_LINE_TOP ); - aSz.Width() = rShadow.CalcShadowSpace( SHADOW_LEFT ) + rBox.CalcLineSpace( BOX_LINE_LEFT ); - aSz.Width() += rShadow.CalcShadowSpace( SHADOW_RIGHT ) + rBox.CalcLineSpace( BOX_LINE_RIGHT ); - return aSz; -} - -// ----------------------------------------------------------------------- - -long ConvertLong_Impl( const long nIn, SfxMapUnit eUnit ) -{ - return OutputDevice::LogicToLogic( nIn, (MapUnit)eUnit, MAP_TWIP ); -} - -sal_Bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize ) -{ - if ( pSize ) - { - Size aSize = pSize->GetSize(); - long nDiffW = Abs( rSize.Width () - aSize.Width () ); - long nDiffH = Abs( rSize.Height() - aSize.Height() ); - return ( nDiffW < 10 && nDiffH < 10 ); - } - else - return sal_False; -} - -// ----------------------------------------------------------------------- - -#define MARGIN_LEFT ( (MarginPosition)0x0001 ) -#define MARGIN_RIGHT ( (MarginPosition)0x0002 ) -#define MARGIN_TOP ( (MarginPosition)0x0004 ) -#define MARGIN_BOTTOM ( (MarginPosition)0x0008 ) - -struct SvxPage_Impl -{ - MarginPosition m_nPos; - Printer* mpDefPrinter; - bool mbDelPrinter; - - SvxPage_Impl() : - m_nPos( 0 ), - mpDefPrinter( 0 ), - mbDelPrinter( false ) {} - - ~SvxPage_Impl() { if ( mbDelPrinter ) delete mpDefPrinter; } -}; - -// class SvxPageDescPage -------------------------------------------------- - -// gibt den Bereich der Which-Werte zur"uck - -sal_uInt16* SvxPageDescPage::GetRanges() -{ - return pRanges; -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxPageDescPage::Create( Window* pParent, const SfxItemSet& rSet ) -{ - return new SvxPageDescPage( pParent, rSet ); -} - -// ----------------------------------------------------------------------- - -SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) : - - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_PAGE ), rAttr ), - - aPaperSizeFl ( this, CUI_RES( FL_PAPER_SIZE ) ), - aPaperFormatText ( this, CUI_RES( FT_PAPER_FORMAT ) ), - aPaperSizeBox ( this, CUI_RES( LB_PAPER_SIZE ) ), - aPaperWidthText ( this, CUI_RES( FT_PAPER_WIDTH ) ), - aPaperWidthEdit ( this, CUI_RES( ED_PAPER_WIDTH ) ), - aPaperHeightText ( this, CUI_RES( FT_PAPER_HEIGHT ) ), - aPaperHeightEdit ( this, CUI_RES( ED_PAPER_HEIGHT ) ), - aOrientationFT ( this, CUI_RES( FT_ORIENTATION ) ), - aPortraitBtn ( this, CUI_RES( RB_PORTRAIT ) ), - aLandscapeBtn ( this, CUI_RES( RB_LANDSCAPE ) ), - aBspWin ( this, CUI_RES( WN_BSP ) ), - aTextFlowLbl ( this, CUI_RES( FT_TEXT_FLOW ) ), - aTextFlowBox ( this, CUI_RES( LB_TEXT_FLOW ) ), - aPaperTrayLbl ( this, CUI_RES( FT_PAPER_TRAY ) ), - aPaperTrayBox ( this, CUI_RES( LB_PAPER_TRAY ) ), - aMarginFl ( this, CUI_RES( FL_MARGIN ) ), - aLeftMarginLbl ( this, CUI_RES( FT_LEFT_MARGIN ) ), - aLeftMarginEdit ( this, CUI_RES( ED_LEFT_MARGIN ) ), - aRightMarginLbl ( this, CUI_RES( FT_RIGHT_MARGIN ) ), - aRightMarginEdit ( this, CUI_RES( ED_RIGHT_MARGIN ) ), - aTopMarginLbl ( this, CUI_RES( FT_TOP_MARGIN ) ), - aTopMarginEdit ( this, CUI_RES( ED_TOP_MARGIN ) ), - aBottomMarginLbl ( this, CUI_RES( FT_BOTTOM_MARGIN ) ), - aBottomMarginEdit ( this, CUI_RES( ED_BOTTOM_MARGIN ) ), - aBottomSeparatorFl ( this, CUI_RES( FL_BOTTOM_SEP ) ), - aLayoutFL ( this, CUI_RES( FL_LAYOUT ) ), - aPageText ( this, CUI_RES( FT_PAGELAYOUT ) ), - aLayoutBox ( this, CUI_RES( LB_LAYOUT ) ), - aNumberFormatText ( this, CUI_RES( FT_NUMBER_FORMAT ) ), - aNumberFormatBox ( this, CUI_RES( LB_NUMBER_FORMAT ) ), - aTblAlignFT ( this, CUI_RES( FT_TBL_ALIGN ) ), - aHorzBox ( this, CUI_RES( CB_HORZ ) ), - aVertBox ( this, CUI_RES( CB_VERT ) ), - aAdaptBox ( this, CUI_RES( CB_ADAPT ) ), - aRegisterCB ( this, CUI_RES( CB_REGISTER ) ), - aRegisterFT ( this, CUI_RES( FT_REGISTER ) ), - aRegisterLB ( this, CUI_RES( LB_REGISTER ) ), - - aInsideText ( CUI_RES( STR_INSIDE ) ), - aOutsideText ( CUI_RES( STR_OUTSIDE ) ), - aPrintRangeQueryText( CUI_RES( STR_QUERY_PRINTRANGE ) ), - - bLandscape ( sal_False ), - eMode ( SVX_PAGE_MODE_STANDARD ), - ePaperStart ( PAPER_A3 ), - ePaperEnd ( PAPER_ENV_DL ), - pImpl ( new SvxPage_Impl ) - -{ - bBorderModified = sal_False; - FreeResource(); - aBspWin.EnableRTL( sal_False ); - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - SvtLanguageOptions aLangOptions; - sal_Bool bCJK = aLangOptions.IsAsianTypographyEnabled(); - sal_Bool bCTL = aLangOptions.IsCTLFontEnabled(); - sal_Bool bWeb = sal_False; - const SfxPoolItem* pItem; - - SfxObjectShell* pShell; - if(SFX_ITEM_SET == rAttr.GetItemState(SID_HTML_MODE, sal_False, &pItem) || - ( 0 != (pShell = SfxObjectShell::Current()) && - 0 != (pItem = pShell->GetItem(SID_HTML_MODE)))) - bWeb = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON); - - // #109989# get the HTML export setting from configuration. - // !! This is a hack, see comments in SvxHtmlExportModeConfigItem_Impl class above. - bool bHTML32 = SvxHtmlExportModeConfigItem_Impl().IsExportModeHTML32(); - - // fill text flow listbox with valid entries - aTextFlowBox.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_LTR_HORI ), FRMDIR_HORI_LEFT_TOP ); - if( bCTL ) - aTextFlowBox.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_RTL_HORI ), FRMDIR_HORI_RIGHT_TOP ); - // #109989# do not show vertical directions in Writer/Web - if( !bWeb ) - { - if( bCJK ) - { - aTextFlowBox.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_RTL_VERT ), FRMDIR_VERT_TOP_RIGHT ); -// aTextFlowBox.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_LTR_VERT ), FRMDIR_VERT_TOP_LEFT ); - } - } - - // #109989# show the text direction box in Writer/Web too, but only, if HTML export mode is not HTML3.2. - if( !(bWeb && bHTML32) && (bCJK || bCTL) && - SFX_ITEM_UNKNOWN < rAttr.GetItemState(GetWhich( SID_ATTR_FRAMEDIRECTION ))) - { - aTextFlowLbl.Show(); - aTextFlowBox.Show(); - aTextFlowBox.SetSelectHdl(LINK(this, SvxPageDescPage, FrameDirectionModify_Impl )); - - aBspWin.EnableFrameDirection(sal_True); - } - Init_Impl(); - - FieldUnit eFUnit = GetModuleFieldUnit( rAttr ); - SetFieldUnit( aLeftMarginEdit, eFUnit ); - SetFieldUnit( aRightMarginEdit, eFUnit ); - SetFieldUnit( aTopMarginEdit, eFUnit ); - SetFieldUnit( aBottomMarginEdit, eFUnit ); - SetFieldUnit( aPaperWidthEdit, eFUnit ); - SetFieldUnit( aPaperHeightEdit, eFUnit ); - - if ( SfxViewShell::Current() && SfxViewShell::Current()->GetPrinter() ) - pImpl->mpDefPrinter = (Printer*)SfxViewShell::Current()->GetPrinter(); - else - { - pImpl->mpDefPrinter = new Printer; - pImpl->mbDelPrinter = true; - } - - MapMode aOldMode = pImpl->mpDefPrinter->GetMapMode(); - pImpl->mpDefPrinter->SetMapMode( MAP_TWIP ); - - // First- und Last-Werte f"ur die R"ander setzen - Size aPaperSize = pImpl->mpDefPrinter->GetPaperSize(); - Size aPrintSize = pImpl->mpDefPrinter->GetOutputSize(); - /* - * einen Punkt ( 0,0 ) in logische Koordinaten zu konvertieren, - * sieht aus wie Unsinn; ist aber sinnvoll, wenn der Ursprung des - * Koordinatensystems verschoben ist. - */ - Point aPrintOffset = pImpl->mpDefPrinter->GetPageOffset() - - pImpl->mpDefPrinter->PixelToLogic( Point() ); - pImpl->mpDefPrinter->SetMapMode( aOldMode ); - - long nOffset = !aPrintOffset.X() && !aPrintOffset.Y() ? 0 : PRINT_OFFSET; - aLeftMarginEdit.SetFirst( aLeftMarginEdit.Normalize( aPrintOffset.X() ), FUNIT_TWIP ); - nFirstLeftMargin = static_cast<long>(aLeftMarginEdit.GetFirst()); - aRightMarginEdit.SetFirst( aRightMarginEdit.Normalize( - aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X() + nOffset ), FUNIT_TWIP); - nFirstRightMargin = static_cast<long>(aRightMarginEdit.GetFirst()); - aTopMarginEdit.SetFirst( aTopMarginEdit.Normalize( aPrintOffset.Y() ), FUNIT_TWIP ); - nFirstTopMargin = static_cast<long>(aTopMarginEdit.GetFirst()); - aBottomMarginEdit.SetFirst( aBottomMarginEdit.Normalize( - aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y() + nOffset ), FUNIT_TWIP ); - nFirstBottomMargin = static_cast<long>(aBottomMarginEdit.GetFirst()); - aLeftMarginEdit.SetLast( aLeftMarginEdit.Normalize( - aPrintOffset.X() + aPrintSize.Width() ), FUNIT_TWIP ); - nLastLeftMargin = static_cast<long>(aLeftMarginEdit.GetLast()); - aRightMarginEdit.SetLast( aRightMarginEdit.Normalize( - aPrintOffset.X() + aPrintSize.Width() ), FUNIT_TWIP ); - nLastRightMargin = static_cast<long>(aRightMarginEdit.GetLast()); - aTopMarginEdit.SetLast( aTopMarginEdit.Normalize( - aPrintOffset.Y() + aPrintSize.Height() ), FUNIT_TWIP ); - nLastTopMargin = static_cast<long>(aTopMarginEdit.GetLast()); - aBottomMarginEdit.SetLast( aBottomMarginEdit.Normalize( - aPrintOffset.Y() + aPrintSize.Height() ), FUNIT_TWIP ); - nLastBottomMargin = static_cast<long>(aBottomMarginEdit.GetLast()); - - // #i4219# get DrawingLayer options - const SvtOptionsDrawinglayer aDrawinglayerOpt; - - // #i4219# take Maximum now from configuration (1/100th cm) - // was: 11900 -> 119 cm ;new value 3 meters -> 300 cm -> 30000 - aPaperWidthEdit.SetMax(aPaperWidthEdit.Normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FUNIT_CM); - aPaperWidthEdit.SetLast(aPaperWidthEdit.Normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FUNIT_CM); - aPaperHeightEdit.SetMax(aPaperHeightEdit.Normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FUNIT_CM); - aPaperHeightEdit.SetLast(aPaperHeightEdit.Normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FUNIT_CM); - - // #i4219# also for margins (1/100th cm). Was: 9999, keeping. - aLeftMarginEdit.SetMax(aDrawinglayerOpt.GetMaximumPaperLeftMargin()); - aLeftMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperLeftMargin()); - aRightMarginEdit.SetMax(aDrawinglayerOpt.GetMaximumPaperRightMargin()); - aRightMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperRightMargin()); - aTopMarginEdit.SetMax(aDrawinglayerOpt.GetMaximumPaperTopMargin()); - aTopMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperTopMargin()); - aBottomMarginEdit.SetMax(aDrawinglayerOpt.GetMaximumPaperBottomMargin()); - aBottomMarginEdit.SetLast(aDrawinglayerOpt.GetMaximumPaperBottomMargin()); - - aPortraitBtn.SetAccessibleRelationMemberOf(&aOrientationFT); - aLandscapeBtn.SetAccessibleRelationMemberOf(&aOrientationFT); -} - -// ----------------------------------------------------------------------- - -SvxPageDescPage::~SvxPageDescPage() -{ - delete pImpl; -} - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::Init_Impl() -{ - aLeftText = aLeftMarginLbl.GetText(); - aRightText = aRightMarginLbl.GetText(); - - // Handler einstellen - aLayoutBox.SetSelectHdl( LINK( this, SvxPageDescPage, LayoutHdl_Impl ) ); - aPaperSizeBox.SetDropDownLineCount(10); - - aPaperTrayBox.SetGetFocusHdl( - LINK( this, SvxPageDescPage, PaperBinHdl_Impl ) ); - aPaperSizeBox.SetSelectHdl( - LINK( this, SvxPageDescPage, PaperSizeSelect_Impl ) ); - aPaperWidthEdit.SetModifyHdl( - LINK( this, SvxPageDescPage, PaperSizeModify_Impl ) ); - aPaperHeightEdit.SetModifyHdl( - LINK( this, SvxPageDescPage, PaperSizeModify_Impl ) ); - aLandscapeBtn.SetClickHdl( - LINK( this, SvxPageDescPage, SwapOrientation_Impl ) ); - aPortraitBtn.SetClickHdl( - LINK( this, SvxPageDescPage, SwapOrientation_Impl ) ); - - Link aLink = LINK( this, SvxPageDescPage, BorderModify_Impl ); - aLeftMarginEdit.SetModifyHdl( aLink ); - aRightMarginEdit.SetModifyHdl( aLink ); - aTopMarginEdit.SetModifyHdl( aLink ); - aBottomMarginEdit.SetModifyHdl( aLink ); - - aLink = LINK( this, SvxPageDescPage, RangeHdl_Impl ); - aPaperWidthEdit.SetLoseFocusHdl( aLink ); - aPaperHeightEdit.SetLoseFocusHdl( aLink ); - aLeftMarginEdit.SetLoseFocusHdl( aLink ); - aRightMarginEdit.SetLoseFocusHdl( aLink ); - aTopMarginEdit.SetLoseFocusHdl( aLink ); - aBottomMarginEdit.SetLoseFocusHdl( aLink ); - - aHorzBox.SetClickHdl( LINK( this, SvxPageDescPage, CenterHdl_Impl ) ); - aVertBox.SetClickHdl( LINK( this, SvxPageDescPage, CenterHdl_Impl ) ); - -} - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::Reset( const SfxItemSet& rSet ) -{ - SfxItemPool* pPool = rSet.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - SfxMapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ); - - // R"ander (Links/Rechts) einstellen - const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_LRSPACE ); - - if ( pItem ) - { - const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&)*pItem; - SetMetricValue( aLeftMarginEdit, rLRSpace.GetLeft(), eUnit ); - aBspWin.SetLeft( - (sal_uInt16)ConvertLong_Impl( (long)rLRSpace.GetLeft(), eUnit ) ); - SetMetricValue( aRightMarginEdit, rLRSpace.GetRight(), eUnit ); - aBspWin.SetRight( - (sal_uInt16)ConvertLong_Impl( (long)rLRSpace.GetRight(), eUnit ) ); - } - - // R"ander (Oben/Unten) einstellen - pItem = GetItem( rSet, SID_ATTR_ULSPACE ); - - if ( pItem ) - { - const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)*pItem; - SetMetricValue( aTopMarginEdit, rULSpace.GetUpper(), eUnit ); - aBspWin.SetTop( - (sal_uInt16)ConvertLong_Impl( (long)rULSpace.GetUpper(), eUnit ) ); - SetMetricValue( aBottomMarginEdit, rULSpace.GetLower(), eUnit ); - aBspWin.SetBottom( - (sal_uInt16)ConvertLong_Impl( (long)rULSpace.GetLower(), eUnit ) ); - } - - // allgemeine Seitendaten - SvxNumType eNumType = SVX_ARABIC; - bLandscape = ( pImpl->mpDefPrinter->GetOrientation() == ORIENTATION_LANDSCAPE ); - sal_uInt16 nUse = (sal_uInt16)SVX_PAGE_ALL; - pItem = GetItem( rSet, SID_ATTR_PAGE ); - - if ( pItem ) - { - const SvxPageItem& rItem = (const SvxPageItem&)*pItem; - eNumType = rItem.GetNumType(); - nUse = rItem.GetPageUsage(); - bLandscape = rItem.IsLandscape(); - } - - // Ausrichtung - aLayoutBox.SelectEntryPos( ::PageUsageToPos_Impl( nUse ) ); - aBspWin.SetUsage( nUse ); - LayoutHdl_Impl( 0 ); - - // Numerierungsart der Seitenvorlage einstellen - aNumberFormatBox.SelectEntryPos( sal::static_int_cast< sal_uInt16 >(eNumType) ); - - // Aktueller Papierschacht - aPaperTrayBox.Clear(); - sal_uInt8 nPaperBin = PAPERBIN_PRINTER_SETTINGS; - pItem = GetItem( rSet, SID_ATTR_PAGE_PAPERBIN ); - - if ( pItem ) - { - nPaperBin = ( (const SvxPaperBinItem*)pItem )->GetValue(); - - if ( nPaperBin >= pImpl->mpDefPrinter->GetPaperBinCount() ) - nPaperBin = PAPERBIN_PRINTER_SETTINGS; - } - - String aBinName; - - if ( PAPERBIN_PRINTER_SETTINGS == nPaperBin ) - aBinName = EE_RESSTR( RID_SVXSTR_PAPERBIN_SETTINGS ); - else - aBinName = pImpl->mpDefPrinter->GetPaperBinName( (sal_uInt16)nPaperBin ); - - sal_uInt16 nEntryPos = aPaperTrayBox.InsertEntry( aBinName ); - aPaperTrayBox.SetEntryData( nEntryPos, (void*)(sal_uLong)nPaperBin ); - aPaperTrayBox.SelectEntry( aBinName ); - - // Size rausholen - Size aPaperSize = SvxPaperInfo::GetPaperSize( pImpl->mpDefPrinter ); - pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE ); - - if ( pItem ) - aPaperSize = ( (const SvxSizeItem*)pItem )->GetSize(); - - bool bOrientationSupport = - pImpl->mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION ); - - if ( !bOrientationSupport && - aPaperSize.Width() > aPaperSize.Height() ) - bLandscape = sal_True; - - aLandscapeBtn.Check( bLandscape ); - aPortraitBtn.Check( !bLandscape ); - - aBspWin.SetSize( Size( ConvertLong_Impl( aPaperSize.Width(), eUnit ), - ConvertLong_Impl( aPaperSize.Height(), eUnit ) ) ); - - aPaperSize = OutputDevice::LogicToLogic(aPaperSize, (MapUnit)eUnit, MAP_100TH_MM); - if ( bLandscape ) - Swap( aPaperSize ); - - // Actual Paper Format - Paper ePaper = SvxPaperInfo::GetSvxPaper( aPaperSize, MAP_100TH_MM, sal_True ); - - if ( PAPER_USER != ePaper ) - aPaperSize = SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ); - - if ( bLandscape ) - Swap( aPaperSize ); - - // Werte in die Edits eintragen - SetMetricValue( aPaperHeightEdit, aPaperSize.Height(), SFX_MAPUNIT_100TH_MM ); - SetMetricValue( aPaperWidthEdit, aPaperSize.Width(), SFX_MAPUNIT_100TH_MM ); - aPaperSizeBox.Clear(); - - sal_uInt16 nActPos = LISTBOX_ENTRY_NOTFOUND; - sal_uInt16 nAryId = RID_SVXSTRARY_PAPERSIZE_STD; - - if ( ePaperStart != PAPER_A3 ) - nAryId = RID_SVXSTRARY_PAPERSIZE_DRAW; - ResStringArray aPaperAry( CUI_RES( nAryId ) ); - sal_uInt32 nCnt = aPaperAry.Count(); - - sal_uInt16 nUserPos = LISTBOX_ENTRY_NOTFOUND; - for ( sal_uInt32 i = 0; i < nCnt; ++i ) - { - String aStr = aPaperAry.GetString(i); - Paper eSize = (Paper)aPaperAry.GetValue(i); - sal_uInt16 nPos = aPaperSizeBox.InsertEntry( aStr ); - aPaperSizeBox.SetEntryData( nPos, (void*)(sal_uLong)eSize ); - - if ( eSize == ePaper ) - nActPos = nPos; - if( eSize == PAPER_USER ) - nUserPos = nPos; - } - // preselect current paper format - #115915#: ePaper might not be in aPaperSizeBox so use PAPER_USER instead - aPaperSizeBox.SelectEntryPos( nActPos != LISTBOX_ENTRY_NOTFOUND ? nActPos : nUserPos ); - - // Applikationsspezifisch - - switch ( eMode ) - { - case SVX_PAGE_MODE_CENTER: - { - aTblAlignFT.Show(); - aHorzBox.Show(); - aVertBox.Show(); - DisableVerticalPageDir(); - - // Horizontale Ausrichtung - pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 ); - aHorzBox.Check( pItem ? ( (const SfxBoolItem*)pItem )->GetValue() - : sal_False ); - - // Vertikale Ausrichtung - pItem = GetItem( rSet, SID_ATTR_PAGE_EXT2 ); - aVertBox.Check( pItem ? ( (const SfxBoolItem*)pItem )->GetValue() - : sal_False ); - - // Beispiel-Fenster auf Tabelle setzen - aBspWin.SetTable( sal_True ); - aBspWin.SetHorz( aHorzBox.IsChecked() ); - aBspWin.SetVert( aVertBox.IsChecked() ); - - break; - } - - case SVX_PAGE_MODE_PRESENTATION: - { - DisableVerticalPageDir(); - aAdaptBox.Show(); - pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 ); - aAdaptBox.Check( pItem ? - ( (const SfxBoolItem*)pItem )->GetValue() : sal_False ); - - //!!! hidden, weil von StarDraw nicht implementiert - aLayoutBox.Hide(); - aPageText.Hide(); - - break; - } - default: ;//prevent warning - } - - - // im Beispiel Hintergrund und Umrandung anzeigen - ResetBackground_Impl( rSet ); -//! UpdateExample_Impl(); - RangeHdl_Impl( 0 ); - - // Header Footer anzeigen - InitHeadFoot_Impl( rSet ); - - // R"ander auf Hoch/Quer updaten, dann Beispiel updaten - bBorderModified = sal_False; - SwapFirstValues_Impl( sal_False ); - UpdateExample_Impl(); - - // Alte Werte sichern - aLeftMarginEdit.SaveValue(); - aRightMarginEdit.SaveValue(); - aTopMarginEdit.SaveValue(); - aBottomMarginEdit.SaveValue(); - aLayoutBox.SaveValue(); - aNumberFormatBox.SaveValue(); - aPaperSizeBox.SaveValue(); - aPaperWidthEdit.SaveValue(); - aPaperHeightEdit.SaveValue(); - aPortraitBtn.SaveValue(); - aLandscapeBtn.SaveValue(); - aPaperTrayBox.SaveValue(); - aVertBox.SaveValue(); - aHorzBox.SaveValue(); - aAdaptBox.SaveValue(); - - CheckMarginEdits( true ); - - // Registerhaltigkeit - if(SFX_ITEM_SET == rSet.GetItemState(SID_SWREGISTER_MODE)) - { - aRegisterCB.Check(((const SfxBoolItem&)rSet.Get( - SID_SWREGISTER_MODE)).GetValue()); - aRegisterCB.SaveValue(); - RegisterModify(&aRegisterCB); - } - if(SFX_ITEM_SET == rSet.GetItemState(SID_SWREGISTER_COLLECTION)) - { - aRegisterLB.SelectEntry( - ((const SfxStringItem&)rSet.Get(SID_SWREGISTER_COLLECTION)).GetValue()); - aRegisterLB.SaveValue(); - } - - SfxItemState eState = rSet.GetItemState( GetWhich( SID_ATTR_FRAMEDIRECTION ), - sal_True, &pItem ); - if( SFX_ITEM_UNKNOWN != eState ) - { - sal_uInt32 nVal = SFX_ITEM_SET == eState - ? ((SvxFrameDirectionItem*)pItem)->GetValue() - : 0; - aTextFlowBox.SelectEntryValue( static_cast< SvxFrameDirection >( nVal ) ); - aTextFlowBox.SaveValue(); - aBspWin.SetFrameDirection(nVal); - } -} - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::FillUserData() -{ - if ( SVX_PAGE_MODE_PRESENTATION == eMode ) - SetUserData( UniString::CreateFromInt32( (sal_Int32)aAdaptBox.IsChecked() ) ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxPageDescPage::FillItemSet( SfxItemSet& rSet ) -{ - sal_Bool bModified = sal_False; - const SfxItemSet& rOldSet = GetItemSet(); - SfxItemPool* pPool = rOldSet.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - sal_uInt16 nWhich = GetWhich( SID_ATTR_LRSPACE ); - SfxMapUnit eUnit = pPool->GetMetric( nWhich ); - const SfxPoolItem* pOld = 0; - - // alten linken und rechten Rand kopieren - SvxLRSpaceItem aMargin( (const SvxLRSpaceItem&)rOldSet.Get( nWhich ) ); - - // alten oberen und unteren Rand kopieren - nWhich = GetWhich( SID_ATTR_ULSPACE ); - SvxULSpaceItem aTopMargin( (const SvxULSpaceItem&)rOldSet.Get( nWhich ) ); - - if ( aLeftMarginEdit.GetText() != aLeftMarginEdit.GetSavedValue() ) - { - aMargin.SetLeft( (sal_uInt16)GetCoreValue( aLeftMarginEdit, eUnit ) ); - bModified |= sal_True; - } - - if ( aRightMarginEdit.GetText() != aRightMarginEdit.GetSavedValue() ) - { - aMargin.SetRight( (sal_uInt16)GetCoreValue( aRightMarginEdit, eUnit ) ); - bModified |= sal_True; - } - - // Linken und rechten Rand setzen - if ( bModified ) - { - pOld = GetOldItem( rSet, SID_ATTR_LRSPACE ); - - if ( !pOld || !( *(const SvxLRSpaceItem*)pOld == aMargin ) ) - rSet.Put( aMargin ); - else - bModified = sal_False; - } - - sal_Bool bMod = sal_False; - - if ( aTopMarginEdit.GetText() != aTopMarginEdit.GetSavedValue() ) - { - aTopMargin.SetUpper( (sal_uInt16)GetCoreValue( aTopMarginEdit, eUnit ) ); - bMod |= sal_True; - } - - if ( aBottomMarginEdit.GetText() != aBottomMarginEdit.GetSavedValue() ) - { - aTopMargin.SetLower( (sal_uInt16)GetCoreValue( aBottomMarginEdit, eUnit ) ); - bMod |= sal_True; - } - - // unteren oberen Rand setzen - // - if ( bMod ) - { - pOld = GetOldItem( rSet, SID_ATTR_ULSPACE ); - - if ( !pOld || !( *(const SvxULSpaceItem*)pOld == aTopMargin ) ) - { - bModified |= sal_True; - rSet.Put( aTopMargin ); - } - } - - // Druckerschacht - nWhich = GetWhich( SID_ATTR_PAGE_PAPERBIN ); - sal_uInt16 nPos = aPaperTrayBox.GetSelectEntryPos(); - sal_uInt16 nBin = (sal_uInt16)(sal_uLong)aPaperTrayBox.GetEntryData( nPos ); - pOld = GetOldItem( rSet, SID_ATTR_PAGE_PAPERBIN ); - - if ( !pOld || ( (const SvxPaperBinItem*)pOld )->GetValue() != nBin ) - { - rSet.Put( SvxPaperBinItem( nWhich, (sal_uInt8)nBin ) ); - bModified |= sal_True; - } - - nPos = aPaperSizeBox.GetSelectEntryPos(); - Paper ePaper = (Paper)(sal_uLong)aPaperSizeBox.GetEntryData( nPos ); - const sal_uInt16 nOld = aPaperSizeBox.GetSavedValue(); - sal_Bool bChecked = aLandscapeBtn.IsChecked(); - - if ( PAPER_USER == ePaper ) - { - if ( nOld != nPos || - aPaperWidthEdit.IsValueModified() || - aPaperHeightEdit.IsValueModified() || - bChecked != aLandscapeBtn.GetSavedValue() ) - { - Size aSize( GetCoreValue( aPaperWidthEdit, eUnit ), - GetCoreValue( aPaperHeightEdit, eUnit ) ); - pOld = GetOldItem( rSet, SID_ATTR_PAGE_SIZE ); - - if ( !pOld || ( (const SvxSizeItem*)pOld )->GetSize() != aSize ) - { - rSet.Put( SvxSizeItem( GetWhich(SID_ATTR_PAGE_SIZE), aSize ) ); - bModified |= sal_True; - } - } - } - else - { - if ( nOld != nPos || bChecked != aLandscapeBtn.GetSavedValue() ) - { - Size aSize( SvxPaperInfo::GetPaperSize( ePaper, (MapUnit)eUnit ) ); - - if ( bChecked ) - Swap( aSize ); - - pOld = GetOldItem( rSet, SID_ATTR_PAGE_SIZE ); - - if ( !pOld || ( (const SvxSizeItem*)pOld )->GetSize() != aSize ) - { - rSet.Put( SvxSizeItem( GetWhich(SID_ATTR_PAGE_SIZE), aSize ) ); - bModified |= sal_True; - } - } - } - - // sonstiges Zeug der Page - nWhich = GetWhich( SID_ATTR_PAGE ); - SvxPageItem aPage( (const SvxPageItem&)rOldSet.Get( nWhich ) ); - bMod = aLayoutBox.GetSelectEntryPos() != aLayoutBox.GetSavedValue(); - - if ( bMod ) - aPage.SetPageUsage( - ::PosToPageUsage_Impl( aLayoutBox.GetSelectEntryPos() ) ); - - if ( bChecked != aLandscapeBtn.GetSavedValue() ) - { - aPage.SetLandscape(bChecked); - bMod |= sal_True; - } - - // Einstellen der Numerierungsart der Seite - nPos = aNumberFormatBox.GetSelectEntryPos(); - - if ( nPos != aNumberFormatBox.GetSavedValue() ) - { - aPage.SetNumType( (SvxNumType)nPos ); - bMod |= sal_True; - } - - if ( bMod ) - { - pOld = GetOldItem( rSet, SID_ATTR_PAGE ); - - if ( !pOld || !( *(const SvxPageItem*)pOld == aPage ) ) - { - rSet.Put( aPage ); - bModified |= sal_True; - } - } - else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich ) ) - rSet.ClearItem( nWhich ); - else - rSet.Put( rOldSet.Get( nWhich ) ); - - // Modispezifische Controls auswerten - - switch ( eMode ) - { - case SVX_PAGE_MODE_CENTER: - { - if ( aHorzBox.IsChecked() != aHorzBox.GetSavedValue() ) - { - SfxBoolItem aHorz( GetWhich( SID_ATTR_PAGE_EXT1 ), - aHorzBox.IsChecked() ); - rSet.Put( aHorz ); - bModified |= sal_True; - } - - if ( aVertBox.IsChecked() != aVertBox.GetSavedValue() ) - { - SfxBoolItem aVert( GetWhich( SID_ATTR_PAGE_EXT2 ), - aVertBox.IsChecked() ); - rSet.Put( aVert ); - bModified |= sal_True; - } - break; - } - - case SVX_PAGE_MODE_PRESENTATION: - { - // immer putten, damit Draw das auswerten kann - rSet.Put( SfxBoolItem( GetWhich( SID_ATTR_PAGE_EXT1 ), - aAdaptBox.IsChecked() ) ); - bModified |= sal_True; - break; - } - default: ;//prevent warning - - } - - if(aRegisterCB.IsVisible() && - (aRegisterCB.IsChecked() || aRegisterCB.GetSavedValue() != aRegisterCB.IsChecked())) - { - const SfxBoolItem& rRegItem = (const SfxBoolItem&)rOldSet.Get(SID_SWREGISTER_MODE); - SfxBoolItem* pRegItem = (SfxBoolItem*)rRegItem.Clone(); - sal_Bool bCheck = aRegisterCB.IsChecked(); - pRegItem->SetValue(bCheck); - rSet.Put(*pRegItem); - bModified |= sal_True; - if(bCheck) - { - bModified |= sal_True; - rSet.Put(SfxStringItem(SID_SWREGISTER_COLLECTION, - aRegisterLB.GetSelectEntry())); - } - delete pRegItem; - } - - SvxFrameDirection eDirection = aTextFlowBox.GetSelectEntryValue(); - if( aTextFlowBox.IsVisible() && (eDirection != aTextFlowBox.GetSavedValue()) ) - { - rSet.Put( SvxFrameDirectionItem( eDirection, GetWhich( SID_ATTR_FRAMEDIRECTION ) ) ); - bModified = sal_True; - } - - return bModified; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxPageDescPage, LayoutHdl_Impl, ListBox *, EMPTYARG ) -{ - // innen au\sen umschalten - const sal_uInt16 nPos = PosToPageUsage_Impl( aLayoutBox.GetSelectEntryPos() ); - - if ( nPos == SVX_PAGE_MIRROR ) - { - if ( aLeftMarginLbl.GetText() != aInsideText ) - aLeftMarginLbl.SetText( aInsideText ); - - if ( aRightMarginLbl.GetText() != aOutsideText ) - aRightMarginLbl.SetText( aOutsideText ); - } - else - { - if ( aLeftMarginLbl.GetText() != aLeftText ) - aLeftMarginLbl.SetText( aLeftText ); - - if ( aRightMarginLbl.GetText() != aRightText ) - aRightMarginLbl.SetText( aRightText ); - } - UpdateExample_Impl( true ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxPageDescPage, PaperBinHdl_Impl, ListBox *, EMPTYARG ) -{ - if ( aPaperTrayBox.GetEntryCount() > 1 ) - // schon gef"ullt - return 0; - - // Schacht-Box initialisieren - String aOldName = aPaperTrayBox.GetSelectEntry(); - aPaperTrayBox.SetUpdateMode( sal_False ); - aPaperTrayBox.Clear(); - sal_uInt16 nEntryPos = aPaperTrayBox.InsertEntry( - EE_RESSTR( RID_SVXSTR_PAPERBIN_SETTINGS ) ); - aPaperTrayBox.SetEntryData( nEntryPos, - (void*)(sal_uLong)PAPERBIN_PRINTER_SETTINGS ); - String aPaperBin( EditResId( RID_SVXSTR_PAPERBIN ) ); - sal_uInt16 nBinCount = pImpl->mpDefPrinter->GetPaperBinCount(); - - for ( sal_uInt16 i = 0; i < nBinCount; ++i ) - { - String aName = pImpl->mpDefPrinter->GetPaperBinName(i); - - if ( !aName.Len() ) - { - aName = aPaperBin; - aName.Append( sal_Unicode(' ') ); - aName.Append( UniString::CreateFromInt32( i+1 ) ); - } - nEntryPos = aPaperTrayBox.InsertEntry( aName ); - aPaperTrayBox.SetEntryData( nEntryPos, (void*)(sal_uLong)i ); - } - aPaperTrayBox.SelectEntry( aOldName ); - aPaperTrayBox.SetUpdateMode( sal_True ); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxPageDescPage, PaperSizeSelect_Impl, ListBox *, pBox ) -{ - const sal_uInt16 nPos = pBox->GetSelectEntryPos(); - Paper ePaper = (Paper)(sal_uLong)aPaperSizeBox.GetEntryData( nPos ); - - if ( ePaper != PAPER_USER ) - { - Size aSize( SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ) ); - - if ( aLandscapeBtn.IsChecked() ) - Swap( aSize ); - - if ( aSize.Height() < aPaperHeightEdit.GetMin( FUNIT_100TH_MM ) ) - aPaperHeightEdit.SetMin( - aPaperHeightEdit.Normalize( aSize.Height() ), FUNIT_100TH_MM ); - if ( aSize.Width() < aPaperWidthEdit.GetMin( FUNIT_100TH_MM ) ) - aPaperWidthEdit.SetMin( - aPaperWidthEdit.Normalize( aSize.Width() ), FUNIT_100TH_MM ); - SetMetricValue( aPaperHeightEdit, aSize.Height(), SFX_MAPUNIT_100TH_MM ); - SetMetricValue( aPaperWidthEdit, aSize.Width(), SFX_MAPUNIT_100TH_MM ); - - // R"ander ggf. neu berechnen - CalcMargin_Impl(); - - RangeHdl_Impl( 0 ); - UpdateExample_Impl( true ); - - if ( eMode == SVX_PAGE_MODE_PRESENTATION ) - { - // Draw: bei Papierformat soll der Rand 1cm betragen - long nTmp = 0; - sal_Bool bScreen = ( PAPER_SCREEN == ePaper ); - - if ( !bScreen ) - // bei Bildschirm keinen Rand - nTmp = 1; // entspr. 1cm - - // Abfragen, ob fuer Raender 0 gesetzt ist: - if ( bScreen || aRightMarginEdit.GetValue() == 0 ) - { - SetMetricValue( aRightMarginEdit, nTmp, SFX_MAPUNIT_CM ); - if ( !bScreen && - aRightMarginEdit.GetFirst() > aRightMarginEdit.GetValue() ) - aRightMarginEdit.SetValue( aRightMarginEdit.GetFirst() ); - } - if ( bScreen || aLeftMarginEdit.GetValue() == 0 ) - { - SetMetricValue( aLeftMarginEdit, nTmp, SFX_MAPUNIT_CM ); - if ( !bScreen && - aLeftMarginEdit.GetFirst() > aLeftMarginEdit.GetValue() ) - aLeftMarginEdit.SetValue( aLeftMarginEdit.GetFirst() ); - } - if ( bScreen || aBottomMarginEdit.GetValue() == 0 ) - { - SetMetricValue( aBottomMarginEdit, nTmp, SFX_MAPUNIT_CM ); - if ( !bScreen && - aBottomMarginEdit.GetFirst() > aBottomMarginEdit.GetValue() ) - aBottomMarginEdit.SetValue( aBottomMarginEdit.GetFirst() ); - } - if ( bScreen || aTopMarginEdit.GetValue() == 0 ) - { - SetMetricValue( aTopMarginEdit, nTmp, SFX_MAPUNIT_CM ); - if ( !bScreen && - aTopMarginEdit.GetFirst() > aTopMarginEdit.GetValue() ) - aTopMarginEdit.SetValue( aTopMarginEdit.GetFirst() ); - } - UpdateExample_Impl( true ); - } - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxPageDescPage, PaperSizeModify_Impl, Edit *, EMPTYARG ) -{ - sal_uInt16 nWhich = GetWhich( SID_ATTR_LRSPACE ); - SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWhich ); - Size aSize( GetCoreValue( aPaperWidthEdit, eUnit ), - GetCoreValue( aPaperHeightEdit, eUnit ) ); - Paper ePaper = SvxPaperInfo::GetSvxPaper( aSize, (MapUnit)eUnit, sal_True ); - sal_uInt16 nEntryCount = aPaperSizeBox.GetEntryCount(); - - for ( sal_uInt16 i = 0; i < nEntryCount; ++i ) - { - Paper eTmp = (Paper)(sal_uLong)aPaperSizeBox.GetEntryData(i); - - if ( eTmp == ePaper ) - { - aPaperSizeBox.SelectEntryPos(i); - break; - } - } - UpdateExample_Impl( true ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxPageDescPage, SwapOrientation_Impl, RadioButton *, pBtn ) -{ - if ( - (!bLandscape && pBtn == &aLandscapeBtn) || - (bLandscape && pBtn == &aPortraitBtn) - ) - { - bLandscape = aLandscapeBtn.IsChecked(); - - const long lWidth = GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_100TH_MM ); - const long lHeight = GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_100TH_MM ); - - // swap with and height - SetMetricValue( aPaperWidthEdit, lHeight, SFX_MAPUNIT_100TH_MM ); - SetMetricValue( aPaperHeightEdit, lWidth, SFX_MAPUNIT_100TH_MM ); - - // recalculate margins if necessary - CalcMargin_Impl(); - - PaperSizeSelect_Impl( &aPaperSizeBox ); - RangeHdl_Impl( 0 ); - SwapFirstValues_Impl( bBorderModified ); - UpdateExample_Impl( true ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::SwapFirstValues_Impl( bool bSet ) -{ - MapMode aOldMode = pImpl->mpDefPrinter->GetMapMode(); - Orientation eOri = ORIENTATION_PORTRAIT; - - if ( bLandscape ) - eOri = ORIENTATION_LANDSCAPE; - Orientation eOldOri = pImpl->mpDefPrinter->GetOrientation(); - pImpl->mpDefPrinter->SetOrientation( eOri ); - pImpl->mpDefPrinter->SetMapMode( MAP_TWIP ); - - // First- und Last-Werte f"ur die R"ander setzen - Size aPaperSize = pImpl->mpDefPrinter->GetPaperSize(); - Size aPrintSize = pImpl->mpDefPrinter->GetOutputSize(); - /* - * einen Punkt ( 0,0 ) in logische Koordinaten zu konvertieren, - * sieht aus wie Unsinn; ist aber sinnvoll, wenn der Ursprung des - * Koordinatensystems verschoben ist. - */ - Point aPrintOffset = pImpl->mpDefPrinter->GetPageOffset() - - pImpl->mpDefPrinter->PixelToLogic( Point() ); - pImpl->mpDefPrinter->SetMapMode( aOldMode ); - pImpl->mpDefPrinter->SetOrientation( eOldOri ); - - sal_Int64 nSetL = aLeftMarginEdit.Denormalize( - aLeftMarginEdit.GetValue( FUNIT_TWIP ) ); - sal_Int64 nSetR = aRightMarginEdit.Denormalize( - aRightMarginEdit.GetValue( FUNIT_TWIP ) ); - sal_Int64 nSetT = aTopMarginEdit.Denormalize( - aTopMarginEdit.GetValue( FUNIT_TWIP ) ); - sal_Int64 nSetB = aBottomMarginEdit.Denormalize( - aBottomMarginEdit.GetValue( FUNIT_TWIP ) ); - - long nOffset = !aPrintOffset.X() && !aPrintOffset.Y() ? 0 : PRINT_OFFSET; - long nNewL = aPrintOffset.X(); - long nNewR = - aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X() + nOffset; - long nNewT = aPrintOffset.Y(); - long nNewB = - aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y() + nOffset; - - aLeftMarginEdit.SetFirst( aLeftMarginEdit.Normalize( nNewL ), FUNIT_TWIP ); - nFirstLeftMargin = static_cast<long>(aLeftMarginEdit.GetFirst()); - aRightMarginEdit.SetFirst( aRightMarginEdit.Normalize( nNewR ), FUNIT_TWIP ); - nFirstRightMargin = static_cast<long>(aRightMarginEdit.GetFirst()); - aTopMarginEdit.SetFirst( aTopMarginEdit.Normalize( nNewT ), FUNIT_TWIP ); - nFirstTopMargin = static_cast<long>(aTopMarginEdit.GetFirst()); - aBottomMarginEdit.SetFirst( aBottomMarginEdit.Normalize( nNewB ), FUNIT_TWIP ); - nFirstBottomMargin = static_cast<long>(aBottomMarginEdit.GetFirst()); - - if ( bSet ) - { - // ggf. auch die Werte umsetzen, - if ( nSetL < nNewL ) - aLeftMarginEdit.SetValue( aLeftMarginEdit.Normalize( nNewL ), - FUNIT_TWIP ); - if ( nSetR < nNewR ) - aRightMarginEdit.SetValue( aRightMarginEdit.Normalize( nNewR ), - FUNIT_TWIP ); - if ( nSetT < nNewT ) - aTopMarginEdit.SetValue( aTopMarginEdit.Normalize( nNewT ), - FUNIT_TWIP ); - if ( nSetB < nNewB ) - aBottomMarginEdit.SetValue( aBottomMarginEdit.Normalize( nNewB ), - FUNIT_TWIP ); - } -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxPageDescPage, BorderModify_Impl, MetricField *, EMPTYARG ) -{ - if ( !bBorderModified ) - bBorderModified = sal_True; - UpdateExample_Impl(); - return 0; -} -IMPL_LINK_INLINE_END( SvxPageDescPage, BorderModify_Impl, MetricField *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::UpdateExample_Impl( bool bResetbackground ) -{ - // Size - Size aSize( GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_TWIP ), - GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_TWIP ) ); - - aBspWin.SetSize( aSize ); - - // R"ander - aBspWin.SetTop( GetCoreValue( aTopMarginEdit, SFX_MAPUNIT_TWIP ) ); - aBspWin.SetBottom( GetCoreValue( aBottomMarginEdit, SFX_MAPUNIT_TWIP ) ); - aBspWin.SetLeft( GetCoreValue( aLeftMarginEdit, SFX_MAPUNIT_TWIP ) ); - aBspWin.SetRight( GetCoreValue( aRightMarginEdit, SFX_MAPUNIT_TWIP ) ); - - // Layout - aBspWin.SetUsage( PosToPageUsage_Impl( aLayoutBox.GetSelectEntryPos() ) ); - if ( bResetbackground ) - aBspWin.ResetBackground(); - aBspWin.Invalidate(); -} - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::ResetBackground_Impl( const SfxItemSet& rSet ) -{ - sal_uInt16 nWhich = GetWhich( SID_ATTR_PAGE_HEADERSET ); - - if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET ) - { - const SvxSetItem& rSetItem = - (const SvxSetItem&)rSet.Get( nWhich, sal_False ); - const SfxItemSet& rTmpSet = rSetItem.GetItemSet(); - const SfxBoolItem& rOn = - (const SfxBoolItem&)rTmpSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ); - - if ( rOn.GetValue() ) - { - nWhich = GetWhich( SID_ATTR_BRUSH ); - - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) - { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rTmpSet.Get( nWhich ); - aBspWin.SetHdColor( rItem.GetColor() ); - } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) - { - const SvxBoxItem& rItem = - (const SvxBoxItem&)rTmpSet.Get( nWhich ); - aBspWin.SetHdBorder( rItem ); - } - } - } - - nWhich = GetWhich( SID_ATTR_PAGE_FOOTERSET ); - - if ( rSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_SET ) - { - const SvxSetItem& rSetItem = - (const SvxSetItem&)rSet.Get( nWhich, sal_False ); - const SfxItemSet& rTmpSet = rSetItem.GetItemSet(); - const SfxBoolItem& rOn = - (const SfxBoolItem&)rTmpSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ); - - if ( rOn.GetValue() ) - { - nWhich = GetWhich( SID_ATTR_BRUSH ); - - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) - { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rTmpSet.Get( nWhich ); - aBspWin.SetFtColor( rItem.GetColor() ); - } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - - if ( rTmpSet.GetItemState( nWhich ) == SFX_ITEM_SET ) - { - const SvxBoxItem& rItem = - (const SvxBoxItem&)rTmpSet.Get( nWhich ); - aBspWin.SetFtBorder( rItem ); - } - } - } - - const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_BRUSH ); - - if ( pItem ) - { - aBspWin.SetColor( ( (const SvxBrushItem*)pItem )->GetColor() ); - const Graphic* pGrf = ( (const SvxBrushItem*)pItem )->GetGraphic(); - - if ( pGrf ) - { - Bitmap aBitmap = pGrf->GetBitmap(); - aBspWin.SetBitmap( &aBitmap ); - } - else - aBspWin.SetBitmap( NULL ); - } - - pItem = GetItem( rSet, SID_ATTR_BORDER_OUTER ); - - if ( pItem ) - aBspWin.SetBorder( (SvxBoxItem&)*pItem ); -} - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet ) -{ - bLandscape = aLandscapeBtn.IsChecked(); - const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE ); - - if ( pItem ) - aBspWin.SetSize( ( (const SvxSizeItem*)pItem )->GetSize() ); - - const SvxSetItem* pSetItem = 0; - - // Kopfzeilen-Attribute auswerten - - if ( SFX_ITEM_SET == - rSet.GetItemState( GetWhich( SID_ATTR_PAGE_HEADERSET ), - sal_False, (const SfxPoolItem**)&pSetItem ) ) - { - const SfxItemSet& rHeaderSet = pSetItem->GetItemSet(); - const SfxBoolItem& rHeaderOn = - (const SfxBoolItem&)rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ); - - if ( rHeaderOn.GetValue() ) - { - const SvxSizeItem& rSize = (const SvxSizeItem&) - rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ); - const SvxULSpaceItem& rUL = (const SvxULSpaceItem&) - rHeaderSet.Get( GetWhich( SID_ATTR_ULSPACE ) ); - long nDist = rUL.GetLower(); - aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist ); - aBspWin.SetHdDist( nDist ); - const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&) - rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) ); - aBspWin.SetHdLeft( rLR.GetLeft() ); - aBspWin.SetHdRight( rLR.GetRight() ); - aBspWin.SetHeader( sal_True ); - } - else - aBspWin.SetHeader( sal_False ); - - // im Beispiel Hintergrund und Umrandung anzeigen - sal_uInt16 nWhich = GetWhich( SID_ATTR_BRUSH ); - - if ( rHeaderSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) - { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rHeaderSet.Get( nWhich ); - aBspWin.SetHdColor( rItem.GetColor() ); - } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - - if ( rHeaderSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) - { - const SvxBoxItem& rItem = - (const SvxBoxItem&)rHeaderSet.Get( nWhich ); - aBspWin.SetHdBorder( rItem ); - } - } - - // Fusszeilen-Attribute auswerten - - if ( SFX_ITEM_SET == - rSet.GetItemState( GetWhich( SID_ATTR_PAGE_FOOTERSET ), - sal_False, (const SfxPoolItem**)&pSetItem ) ) - { - const SfxItemSet& rFooterSet = pSetItem->GetItemSet(); - const SfxBoolItem& rFooterOn = - (const SfxBoolItem&)rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ); - - if ( rFooterOn.GetValue() ) - { - const SvxSizeItem& rSize = (const SvxSizeItem&) - rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ); - const SvxULSpaceItem& rUL = (const SvxULSpaceItem&) - rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) ); - long nDist = rUL.GetUpper(); - aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist ); - aBspWin.SetFtDist( nDist ); - const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&) - rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) ); - aBspWin.SetFtLeft( rLR.GetLeft() ); - aBspWin.SetFtRight( rLR.GetRight() ); - aBspWin.SetFooter( sal_True ); - } - else - aBspWin.SetFooter( sal_False ); - - // im Beispiel Hintergrund und Umrandung anzeigen - sal_uInt16 nWhich = GetWhich( SID_ATTR_BRUSH ); - - if ( rFooterSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) - { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rFooterSet.Get( nWhich ); - aBspWin.SetFtColor( rItem.GetColor() ); - } - nWhich = GetWhich( SID_ATTR_BORDER_OUTER ); - - if ( rFooterSet.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE ) - { - const SvxBoxItem& rItem = - (const SvxBoxItem&)rFooterSet.Get( nWhich ); - aBspWin.SetFtBorder( rItem ); - } - } -} - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::ActivatePage( const SfxItemSet& rSet ) -{ - InitHeadFoot_Impl( rSet ); - ResetBackground_Impl( rSet ); - RangeHdl_Impl( 0 ); -} - -// ----------------------------------------------------------------------- - -int SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet ) -{ - // Abfrage, ob die Seitenr"ander ausserhalb des Druckbereichs liegen - // Wenn nicht, dann den Anwender fragen, ob sie "ubernommen werden sollen. - // Wenn nicht, dann auf der TabPage bleiben. - sal_uInt16 nPos = aPaperSizeBox.GetSelectEntryPos(); - Paper ePaper = (Paper)(sal_uLong)aPaperSizeBox.GetEntryData( nPos ); - - if ( ePaper != PAPER_SCREEN && IsMarginOutOfRange() ) - { - if ( QueryBox( this, WB_YES_NO | WB_DEF_NO, aPrintRangeQueryText ).Execute() == RET_NO ) - { - MetricField* pField = NULL; - if ( IsPrinterRangeOverflow( aLeftMarginEdit, nFirstLeftMargin, nLastLeftMargin, MARGIN_LEFT ) ) - pField = &aLeftMarginEdit; - if ( IsPrinterRangeOverflow( aRightMarginEdit, nFirstRightMargin, nLastRightMargin, MARGIN_RIGHT ) - && !pField ) - pField = &aRightMarginEdit; - if ( IsPrinterRangeOverflow( aTopMarginEdit, nFirstTopMargin, nLastTopMargin, MARGIN_TOP ) - && !pField ) - pField = &aTopMarginEdit; - if ( IsPrinterRangeOverflow( aBottomMarginEdit, nFirstBottomMargin, nLastBottomMargin, MARGIN_BOTTOM ) - && !pField ) - pField = &aBottomMarginEdit; - if ( pField ) - pField->GrabFocus(); - UpdateExample_Impl(); - return KEEP_PAGE; - } - else - CheckMarginEdits( false ); - } - - if ( _pSet ) - { - FillItemSet( *_pSet ); - - // ggf. hoch/quer putten - sal_uInt16 nWh = GetWhich( SID_ATTR_PAGE_SIZE ); - SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWh ); - Size aSize( GetCoreValue( aPaperWidthEdit, eUnit ), - GetCoreValue( aPaperHeightEdit, eUnit ) ); - - // putten, wenn aktuelle Gr"o/se unterschiedlich zum Wert in _pSet - const SvxSizeItem* pSize = (const SvxSizeItem*)GetItem( *_pSet, SID_ATTR_PAGE_SIZE ); - if ( aSize.Width() && ( !pSize || !IsEqualSize_Impl( pSize, aSize ) ) ) - _pSet->Put( SvxSizeItem( nWh, aSize ) ); - } - - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxPageDescPage, RangeHdl_Impl, Edit *, EMPTYARG ) -{ - // Aktuelle Header-Breite/H"ohe aus dem Bsp - long nHHeight = aBspWin.GetHdHeight(); - long nHDist = aBspWin.GetHdDist(); - - // Aktuelle Footer-Breite/H"ohe aus dem Bsp - long nFHeight = aBspWin.GetFtHeight(); - long nFDist = aBspWin.GetFtDist(); - - // Aktuelle Header/Footer-R"ander aus dem Bsp - long nHFLeft = Max( aBspWin.GetHdLeft(), aBspWin.GetFtLeft() ); - long nHFRight = Max( aBspWin.GetHdRight(), aBspWin.GetFtRight() ); - - // Aktuelle Werte der Seitenr"ander - long nBT = static_cast<long>(aTopMarginEdit.Denormalize(aTopMarginEdit.GetValue(FUNIT_TWIP))); - long nBB = static_cast<long>(aBottomMarginEdit.Denormalize(aBottomMarginEdit.GetValue(FUNIT_TWIP))); - long nBL = static_cast<long>(aLeftMarginEdit.Denormalize(aLeftMarginEdit.GetValue(FUNIT_TWIP))); - long nBR = static_cast<long>(aRightMarginEdit.Denormalize(aRightMarginEdit.GetValue(FUNIT_TWIP))); - - // Breite Umrandung der Seite berechnen - const SfxItemSet* _pSet = &GetItemSet(); - Size aBorder; - - if ( _pSet->GetItemState( GetWhich(SID_ATTR_BORDER_SHADOW) ) >= - SFX_ITEM_AVAILABLE && - _pSet->GetItemState( GetWhich(SID_ATTR_BORDER_OUTER) ) >= - SFX_ITEM_AVAILABLE ) - { - aBorder = ( GetMinBorderSpace_Impl( - (const SvxShadowItem&)_pSet->Get(GetWhich(SID_ATTR_BORDER_SHADOW)), - (const SvxBoxItem&)_pSet->Get(GetWhich(SID_ATTR_BORDER_OUTER)))); - } - - long nH = static_cast<long>(aPaperHeightEdit.Denormalize(aPaperHeightEdit.GetValue(FUNIT_TWIP))); - long nW = static_cast<long>(aPaperWidthEdit.Denormalize(aPaperWidthEdit.GetValue(FUNIT_TWIP))); - - // Grenzen Papier - // Maximum liegt bei 54cm - // - long nMin = nHHeight + nHDist + nFDist + nFHeight + nBT + nBB + - MINBODY + aBorder.Height(); - aPaperHeightEdit.SetMin(aPaperHeightEdit.Normalize(nMin), FUNIT_TWIP); - - nMin = MINBODY + nBL + nBR + aBorder.Width(); - aPaperWidthEdit.SetMin(aPaperWidthEdit.Normalize(nMin), FUNIT_TWIP); - - // Falls sich die Papiergr"o\se ge"adert hat - nH = static_cast<long>(aPaperHeightEdit.Denormalize(aPaperHeightEdit.GetValue(FUNIT_TWIP))); - nW = static_cast<long>(aPaperWidthEdit.Denormalize(aPaperWidthEdit.GetValue(FUNIT_TWIP))); - - // Top - long nMax = nH - nBB - aBorder.Height() - MINBODY - - nFDist - nFHeight - nHDist - nHHeight; - - aTopMarginEdit.SetMax(aTopMarginEdit.Normalize(nMax), FUNIT_TWIP); - - // Bottom - nMax = nH - nBT - aBorder.Height() - MINBODY - - nFDist - nFHeight - nHDist - nHHeight; - - aBottomMarginEdit.SetMax(aTopMarginEdit.Normalize(nMax), FUNIT_TWIP); - - // Left - nMax = nW - nBR - MINBODY - aBorder.Width() - nHFLeft - nHFRight; - aLeftMarginEdit.SetMax(aLeftMarginEdit.Normalize(nMax), FUNIT_TWIP); - - // Right - nMax = nW - nBL - MINBODY - aBorder.Width() - nHFLeft - nHFRight; - aRightMarginEdit.SetMax(aRightMarginEdit.Normalize(nMax), FUNIT_TWIP); - return 0; -} - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::CalcMargin_Impl() -{ - // Aktuelle Werte der Seitenr"ander - long nBT = GetCoreValue( aTopMarginEdit, SFX_MAPUNIT_TWIP ); - long nBB = GetCoreValue( aBottomMarginEdit, SFX_MAPUNIT_TWIP ); - - long nBL = GetCoreValue( aLeftMarginEdit, SFX_MAPUNIT_TWIP ); - long nBR = GetCoreValue( aRightMarginEdit, SFX_MAPUNIT_TWIP ); - - long nH = GetCoreValue( aPaperHeightEdit, SFX_MAPUNIT_TWIP ); - long nW = GetCoreValue( aPaperWidthEdit, SFX_MAPUNIT_TWIP ); - - long nWidth = nBL + nBR + MINBODY; - long nHeight = nBT + nBB + MINBODY; - - if ( nWidth > nW || nHeight > nH ) - { - if ( nWidth > nW ) - { - long nTmp = nBL <= nBR ? nBR : nBL; - nTmp -= nWidth - nW; - - if ( nBL <= nBR ) - SetMetricValue( aRightMarginEdit, nTmp, SFX_MAPUNIT_TWIP ); - else - SetMetricValue( aLeftMarginEdit, nTmp, SFX_MAPUNIT_TWIP ); - } - - if ( nHeight > nH ) - { - long nTmp = nBT <= nBB ? nBB : nBT; - nTmp -= nHeight - nH; - - if ( nBT <= nBB ) - SetMetricValue( aBottomMarginEdit, nTmp, SFX_MAPUNIT_TWIP ); - else - SetMetricValue( aTopMarginEdit, nTmp, SFX_MAPUNIT_TWIP ); - } - } -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxPageDescPage, CenterHdl_Impl, CheckBox *, EMPTYARG ) -{ - aBspWin.SetHorz( aHorzBox.IsChecked() ); - aBspWin.SetVert( aVertBox.IsChecked() ); - UpdateExample_Impl(); - return 0; -} -IMPL_LINK_INLINE_END( SvxPageDescPage, CenterHdl_Impl, CheckBox *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -void SvxPageDescPage::SetCollectionList(const std::vector<String> &aList) -{ - OSL_ENSURE(!aList.empty(), "Empty string list"); - - sStandardRegister = aList[0]; - for( sal_uInt16 i = 1; i < aList.size(); i++ ) - aRegisterLB.InsertEntry(aList[i]); - - aRegisterCB .Show(); - aRegisterFT .Show(); - aRegisterLB.Show(); - aRegisterCB.SetClickHdl(LINK(this, SvxPageDescPage, RegisterModify)); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxPageDescPage, RegisterModify, CheckBox*, pBox ) -{ - sal_Bool bEnable = sal_False; - if(pBox->IsChecked()) - { - bEnable = sal_True; - if(USHRT_MAX == aRegisterLB.GetSelectEntryPos()) - aRegisterLB.SelectEntry(sStandardRegister); - } - aRegisterFT.Enable( bEnable ); - aRegisterLB.Enable( bEnable ); - return 0; -} - -// ---------------------------------------------------------------------------- - -void SvxPageDescPage::DisableVerticalPageDir() -{ - aTextFlowBox.RemoveEntryValue( FRMDIR_VERT_TOP_RIGHT ); - aTextFlowBox.RemoveEntryValue( FRMDIR_VERT_TOP_LEFT ); - if( aTextFlowBox.GetEntryCount() < 2 ) - { - aTextFlowLbl.Hide(); - aTextFlowBox.Hide(); - aBspWin.EnableFrameDirection( sal_False ); - } -} - -IMPL_LINK( SvxPageDescPage, FrameDirectionModify_Impl, ListBox*, EMPTYARG) -{ - aBspWin.SetFrameDirection( (sal_uInt32) aTextFlowBox.GetSelectEntryValue() ); - aBspWin.Invalidate(); - return 0; -} - -bool SvxPageDescPage::IsPrinterRangeOverflow( - MetricField& rField, long nFirstMargin, long nLastMargin, MarginPosition nPos ) -{ - bool bRet = false; - bool bCheck = ( ( pImpl->m_nPos & nPos ) == 0 ); - long nValue = static_cast<long>(rField.GetValue()); - if ( bCheck && - ( nValue < nFirstMargin || nValue > nLastMargin ) && - rField.GetText() != rField.GetSavedValue() ) - { - rField.SetValue( nValue < nFirstMargin ? nFirstMargin : nLastMargin ); - bRet = true; - } - - return bRet; -} - -/** Check if a value of a margin edit is outside the printer paper margins - and save this information. -*/ -void SvxPageDescPage::CheckMarginEdits( bool _bClear ) -{ - if ( _bClear ) - pImpl->m_nPos = 0; - - sal_Int64 nValue = aLeftMarginEdit.GetValue(); - if ( nValue < nFirstLeftMargin || nValue > nLastLeftMargin ) - pImpl->m_nPos |= MARGIN_LEFT; - nValue = aRightMarginEdit.GetValue(); - if ( nValue < nFirstRightMargin || nValue > nLastRightMargin ) - pImpl->m_nPos |= MARGIN_RIGHT; - nValue = aTopMarginEdit.GetValue(); - if ( nValue < nFirstTopMargin || nValue > nLastTopMargin ) - pImpl->m_nPos |= MARGIN_TOP; - nValue = aBottomMarginEdit.GetValue(); - if ( nValue < nFirstBottomMargin || nValue > nLastBottomMargin ) - pImpl->m_nPos |= MARGIN_BOTTOM; -} - -bool SvxPageDescPage::IsMarginOutOfRange() -{ - bool bRet = ( ( ( !( pImpl->m_nPos & MARGIN_LEFT ) && - ( aLeftMarginEdit.GetText() != aLeftMarginEdit.GetSavedValue() ) ) && - ( aLeftMarginEdit.GetValue() < nFirstLeftMargin || - aLeftMarginEdit.GetValue() > nLastLeftMargin ) ) || - ( ( !( pImpl->m_nPos & MARGIN_RIGHT ) && - ( aRightMarginEdit.GetText() != aRightMarginEdit.GetSavedValue() ) ) && - ( aRightMarginEdit.GetValue() < nFirstRightMargin || - aRightMarginEdit.GetValue() > nLastRightMargin ) ) || - ( ( !( pImpl->m_nPos & MARGIN_TOP ) && - ( aTopMarginEdit.GetText() != aTopMarginEdit.GetSavedValue() ) ) && - ( aTopMarginEdit.GetValue() < nFirstTopMargin || - aTopMarginEdit.GetValue() > nLastTopMargin ) ) || - ( ( !( pImpl->m_nPos & MARGIN_BOTTOM ) && - ( aBottomMarginEdit.GetText() != aBottomMarginEdit.GetSavedValue() ) ) && - ( aBottomMarginEdit.GetValue() < nFirstBottomMargin || - aBottomMarginEdit.GetValue() > nLastBottomMargin ) ) ); - return bRet; -} - -void SvxPageDescPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pModeItem,SfxAllEnumItem,SID_ENUM_PAGE_MODE,sal_False); - SFX_ITEMSET_ARG (&aSet,pPaperStartItem,SfxAllEnumItem,SID_PAPER_START,sal_False); - SFX_ITEMSET_ARG (&aSet,pPaperEndItem,SfxAllEnumItem,SID_PAPER_END,sal_False); - SFX_ITEMSET_ARG (&aSet,pCollectListItem,SfxStringListItem,SID_COLLECT_LIST,sal_False); - if (pModeItem) - SetMode((SvxModeType)pModeItem->GetEnumValue()); - if (pPaperStartItem && pPaperEndItem) - SetPaperFormatRanges( (Paper)pPaperStartItem->GetEnumValue(), (Paper)pPaperEndItem->GetEnumValue() ); - if (pCollectListItem) - SetCollectionList(pCollectListItem->GetList()); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/page.h b/cui/source/tabpages/page.h deleted file mode 100644 index 564077a4f..000000000 --- a/cui/source/tabpages/page.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_PAGE_H -#define _SVX_PAGE_H - -// define ---------------------------------------------------------------- - -//!! the values of the following defines must correspond to the array position -//!! of the respective paper size in the file i18npool/source/paper/paper.cxx -//!! There are enums for them in i18npool/inc/i18npool/paper.hxx but unfortunately -//!! the resource compiler does not understand enums, thus the enum values need -//!! to be duplicated here for use in the src file. -#define PAPERSIZE_A0 0 -#define PAPERSIZE_A1 1 -#define PAPERSIZE_A2 2 -#define PAPERSIZE_A3 3 -#define PAPERSIZE_A4 4 -#define PAPERSIZE_A5 5 -#define PAPERSIZE_B4_ISO 6 -#define PAPERSIZE_B5_ISO 7 -#define PAPERSIZE_LETTER 8 -#define PAPERSIZE_LEGAL 9 -#define PAPERSIZE_TABLOID 10 -#define PAPERSIZE_USER 11 -#define PAPERSIZE_B6_ISO 12 -#define PAPERSIZE_C4 13 -#define PAPERSIZE_C5 14 -#define PAPERSIZE_C6 15 -#define PAPERSIZE_C65 16 -#define PAPERSIZE_DL 17 -#define PAPERSIZE_DIA 18 -#define PAPERSIZE_SCREEN 19 -#define PAPERSIZE_C 20 -#define PAPERSIZE_D 21 -#define PAPERSIZE_E 22 -#define PAPERSIZE_EXECUTIVE 23 -#define PAPERSIZE_LEGAL2 24 -#define PAPERSIZE_MONARCH 25 -#define PAPERSIZE_COM675 26 -#define PAPERSIZE_COM9 27 -#define PAPERSIZE_COM10 28 -#define PAPERSIZE_COM11 29 -#define PAPERSIZE_COM12 30 -#define PAPERSIZE_KAI16 31 -#define PAPERSIZE_KAI32 32 -#define PAPERSIZE_KAI32BIG 33 -#define PAPERSIZE_B4_JIS 34 -#define PAPERSIZE_B5_JIS 35 -#define PAPERSIZE_B6_JIS 36 -#define PAPERSIZE_A6 56 - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/page.hrc b/cui/source/tabpages/page.hrc deleted file mode 100644 index 55ffdbd0c..000000000 --- a/cui/source/tabpages/page.hrc +++ /dev/null @@ -1,84 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_PAGE_HRC -#define _SVX_PAGE_HRC - -// defines --------------------------------------------------------------- - -#define FT_LEFT_MARGIN 10 -#define ED_LEFT_MARGIN 11 -#define FT_RIGHT_MARGIN 12 -#define ED_RIGHT_MARGIN 13 -#define FT_TOP_MARGIN 14 -#define ED_TOP_MARGIN 15 -#define FT_BOTTOM_MARGIN 16 -#define ED_BOTTOM_MARGIN 17 -#define FL_MARGIN 18 - -#define LB_LAYOUT 20 -#define FT_PAGELAYOUT 21 - -#define LB_NUMBER_FORMAT 30 -#define FL_LAYOUT 31 -#define FT_NUMBER_FORMAT 32 - -#define FT_TEXT_FLOW 35 -#define LB_TEXT_FLOW 36 - -#define WN_BSP 40 - -#define FT_ORIENTATION 48 -#define FT_PAPER_FORMAT 49 -#define LB_PAPER_SIZE 50 -#define RB_PORTRAIT 51 -#define RB_LANDSCAPE 52 -#define FT_PAPER_WIDTH 53 -#define ED_PAPER_WIDTH 54 -#define FT_PAPER_HEIGHT 55 -#define ED_PAPER_HEIGHT 56 -#define FT_PAPER_TRAY 57 -#define LB_PAPER_TRAY 58 -#define FL_PAPER_SIZE 59 - -#define CB_REGISTER 60 -#define FT_REGISTER 61 -#define LB_REGISTER 62 -#define FL_BOTTOM_SEP 64 - -#define CB_HORZ 70 -#define CB_VERT 71 -#define CB_ADAPT 72 -#define FT_TBL_ALIGN 73 - -#define PB_BACK 80 - -#define STR_INSIDE 90 -#define STR_OUTSIDE 91 -#define STR_QUERY_PRINTRANGE 92 - -#endif - diff --git a/cui/source/tabpages/page.src b/cui/source/tabpages/page.src deleted file mode 100644 index 0de093b21..000000000 --- a/cui/source/tabpages/page.src +++ /dev/null @@ -1,524 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - - // include --------------------------------------------------------------- - -#include <cuires.hrc> -#include "helpid.hrc" -#include "page.hrc" -#include "page.h" -#include <svx/dialogs.hrc> - - // RID_SVXPAGE_PAGE ------------------------------------------------------ - -TabPage RID_SVXPAGE_PAGE -{ - HelpId = HID_FORMAT_PAGE ; - Hide = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_PAPER_SIZE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 164 , 8 ) ; - Text [ en-US ] = "Paper format" ; - }; - FixedText FT_PAPER_FORMAT - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "~Format"; - }; - ListBox LB_PAPER_SIZE - { - HelpID = "cui:ListBox:RID_SVXPAGE_PAGE:LB_PAPER_SIZE"; - Pos = MAP_APPFONT ( 50 , 14 ) ; - Size = MAP_APPFONT ( 50 , 64 ) ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - FixedText FT_PAPER_WIDTH - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "~Width" ; - Left = TRUE ; - }; - MetricField ED_PAPER_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_PAGE:ED_PAPER_WIDTH"; - Border = TRUE ; - Pos = MAP_APPFONT ( 50, 30 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - // #i4219# taken from congiguration now Maximum = 11900 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - // #i4219# Last = 11900 ; - SpinSize = 10 ; - }; - FixedText FT_PAPER_HEIGHT - { - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "~Height" ; - Left = TRUE ; - }; - MetricField ED_PAPER_HEIGHT - { - HelpID = "cui:MetricField:RID_SVXPAGE_PAGE:ED_PAPER_HEIGHT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 50 , 46 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - // #i4219# taken from congiguration now Maximum = 11900 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - // #i4219# Last = 11900 ; - SpinSize = 10 ; - }; - FixedText FT_ORIENTATION - { - Pos = MAP_APPFONT ( 12 , 62 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "Orientation"; - }; - RadioButton RB_PORTRAIT - { - HelpID = "cui:RadioButton:RID_SVXPAGE_PAGE:RB_PORTRAIT"; - Pos = MAP_APPFONT ( 50 , 62 ) ; - Size = MAP_APPFONT ( 53 , 10 ) ; - Check = TRUE ; - Text [ en-US ] = "~Portrait" ; - }; - RadioButton RB_LANDSCAPE - { - HelpID = "cui:RadioButton:RID_SVXPAGE_PAGE:RB_LANDSCAPE"; - Pos = MAP_APPFONT ( 50 , 74 ) ; - Size = MAP_APPFONT ( 53 , 10 ) ; - Text [ en-US ] = "L~andscape"; - }; - Window WN_BSP - { - Pos = MAP_APPFONT ( 176 , 6 ) ; - Size = MAP_APPFONT ( 75 , 46 ) ; - }; - - FixedText FT_TEXT_FLOW - { - Pos = MAP_APPFONT ( 113 , 60 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Left = TRUE ; - Hide = TRUE ; - Text [ en-US ] = "~Text direction"; - }; - ListBox LB_TEXT_FLOW - { - HelpID = "cui:ListBox:RID_SVXPAGE_PAGE:LB_TEXT_FLOW"; - Border = TRUE ; - Pos = MAP_APPFONT ( 165 , 58 ) ; - Size = MAP_APPFONT ( 83 , 50 ) ; - DropDown = TRUE ; - Hide = TRUE ; - }; - - FixedText FT_PAPER_TRAY - { - Pos = MAP_APPFONT ( 113 , 74 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "Paper ~tray"; - }; - ListBox LB_PAPER_TRAY - { - HelpID = "cui:ListBox:RID_SVXPAGE_PAGE:LB_PAPER_TRAY"; - Pos = MAP_APPFONT ( 165 , 72 ) ; - Size = MAP_APPFONT ( 83 , 50 ) ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - FixedLine FL_MARGIN - { - Pos = MAP_APPFONT ( 6 , 90 ) ; - Size = MAP_APPFONT ( 95 , 8 ) ; - Text [ en-US ] = "Margins"; - }; - FixedText FT_LEFT_MARGIN - { - Pos = MAP_APPFONT ( 12 , 103 ) ; - Size = MAP_APPFONT ( 40 , 8 ) ; - Text [ en-US ] = "~Left" ; - Left = TRUE ; - }; - MetricField ED_LEFT_MARGIN - { - HelpID = "cui:MetricField:RID_SVXPAGE_PAGE:ED_LEFT_MARGIN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 55 , 101 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - // #i4219# taken from congiguration now Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - // #i4219# Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_RIGHT_MARGIN - { - Pos = MAP_APPFONT ( 12 , 119 ) ; - Size = MAP_APPFONT ( 40 , 8 ) ; - Text [ en-US ] = "~Right" ; - Left = TRUE ; - }; - MetricField ED_RIGHT_MARGIN - { - HelpID = "cui:MetricField:RID_SVXPAGE_PAGE:ED_RIGHT_MARGIN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 55 , 117 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - // #i4219# taken from congiguration now Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - // #i4219# Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_TOP_MARGIN - { - Pos = MAP_APPFONT ( 12 , 135 ) ; - Size = MAP_APPFONT ( 40 , 8 ) ; - Text [ en-US ] = "~Top" ; - Left = TRUE ; - }; - MetricField ED_TOP_MARGIN - { - HelpID = "cui:MetricField:RID_SVXPAGE_PAGE:ED_TOP_MARGIN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 55 , 133 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - // #i4219# taken from congiguration now Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - // #i4219# Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_BOTTOM_MARGIN - { - Pos = MAP_APPFONT ( 12 , 151 ) ; - Size = MAP_APPFONT ( 40 , 8 ) ; - Text [ en-US ] = "~Bottom" ; - Left = TRUE ; - }; - MetricField ED_BOTTOM_MARGIN - { - HelpID = "cui:MetricField:RID_SVXPAGE_PAGE:ED_BOTTOM_MARGIN"; - Border = TRUE ; - Pos = MAP_APPFONT ( 55 , 149 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - // #i4219# taken from congiguration now Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - // #i4219# Last = 9999 ; - SpinSize = 10 ; - }; - FixedLine FL_BOTTOM_SEP - { - Pos = MAP_APPFONT ( 102 , 101 ) ; - Size = MAP_APPFONT ( 4 , 68 ) ; - Vert = TRUE; - }; - FixedLine FL_LAYOUT - { - Pos = MAP_APPFONT ( 107, 90 ) ; - Size = MAP_APPFONT ( 147 , 8 ) ; - Text [ en-US ] = "Layout settings"; - }; - FixedText FT_PAGELAYOUT - { - Pos = MAP_APPFONT ( 113 , 103 ) ; - Size = MAP_APPFONT ( 54 , 8 ) ; - Text [ en-US ] = "Page layout" ; - }; - ListBox LB_LAYOUT - { - HelpID = "cui:ListBox:RID_SVXPAGE_PAGE:LB_LAYOUT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 170, 101 ) ; - Size = MAP_APPFONT ( 78 , 44 ) ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Right and left" ; Default ; > ; - < "Mirrored" ; Default ; > ; - < "Only right" ; Default ; > ; - < "Only left" ; Default ; > ; - }; - }; - FixedText FT_NUMBER_FORMAT - { - Pos = MAP_APPFONT ( 113 , 119 ) ; - Size = MAP_APPFONT ( 54 , 8 ) ; - Text [ en-US ] = "For~mat"; - }; - ListBox LB_NUMBER_FORMAT - { - HelpID = "cui:ListBox:RID_SVXPAGE_PAGE:LB_NUMBER_FORMAT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 170 , 117 ) ; - Size = MAP_APPFONT ( 78 , 64 ) ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "A, B, C, ..." ; Default ; > ; - < "a, b, c, ..." ; Default ; > ; - < "I, II, III, ..." ; Default ; > ; - < "i, ii, iii, ..." ; Default ; > ; - < "1, 2, 3, ..." ; Default ; > ; - < "None" ; Default ; > ; - }; - }; - FixedText FT_TBL_ALIGN - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 113 , 133 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "Table alignment"; - }; - CheckBox CB_HORZ - { - HelpID = "cui:CheckBox:RID_SVXPAGE_PAGE:CB_HORZ"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 175 , 133 ) ; - Size = MAP_APPFONT ( 73 , 10 ) ; - Text [ en-US ] = "Hori~zontal" ; - }; - CheckBox CB_VERT - { - HelpID = "cui:CheckBox:RID_SVXPAGE_PAGE:CB_VERT"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 175 , 147 ) ; - Size = MAP_APPFONT ( 73 , 10 ) ; - Text [ en-US ] = "~Vertical" ; - }; - CheckBox CB_ADAPT - { - HelpID = "cui:CheckBox:RID_SVXPAGE_PAGE:CB_ADAPT"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 113 , 133 ) ; - Size = MAP_APPFONT ( 135 , 10 ) ; - Text [ en-US ] = "~Fit object to paper format"; - }; - /* Registerhaltigkeit (fuer SW) */ - CheckBox CB_REGISTER - { - HelpID = "cui:CheckBox:RID_SVXPAGE_PAGE:CB_REGISTER"; - Pos = MAP_APPFONT ( 113 , 133 ) ; - Size = MAP_APPFONT ( 135 , 10 ) ; - Hide = TRUE ; - Text [ en-US ] = "Register-true" ; - }; - FixedText FT_REGISTER - { - Pos = MAP_APPFONT ( 122 , 147 ) ; - Size = MAP_APPFONT ( 126 , 8 ) ; - Text [ en-US ] = "Reference ~Style" ; - Hide = TRUE ; - }; - ListBox LB_REGISTER - { - HelpID = "cui:ListBox:RID_SVXPAGE_PAGE:LB_REGISTER"; - Pos = MAP_APPFONT ( 122 , 157 ) ; - Size = MAP_APPFONT ( 126 , 50 ) ; - DropDown = TRUE ; - Hide = TRUE ; - Sort = TRUE ; - HScroll = TRUE ; - DDExtraWidth = TRUE ; - }; - String STR_INSIDE - { - Text [ en-US ] = "I~nner" ; - }; - String STR_OUTSIDE - { - Text [ en-US ] = "O~uter" ; - }; - String STR_QUERY_PRINTRANGE - { - Text [ en-US ] = "The margin settings are out of print range.\n\nDo you still want to apply these settings?"; - }; -}; -StringArray RID_SVXSTRARY_PAPERSIZE_STD -{ - ItemList [ en-US ] = - { - < "A6" ; PAPERSIZE_A6 ; > ; - < "A5" ; PAPERSIZE_A5 ; > ; - < "A4" ; PAPERSIZE_A4 ; > ; - < "A3" ; PAPERSIZE_A3 ; > ; - < "B6 (ISO)" ; PAPERSIZE_B6_ISO ; > ; - < "B5 (ISO)" ; PAPERSIZE_B5_ISO ; > ; - < "B4 (ISO)" ; PAPERSIZE_B4_ISO ; > ; - < "Letter" ; PAPERSIZE_LETTER ; > ; - < "Legal" ; PAPERSIZE_LEGAL ; > ; - < "Long Bond" ; PAPERSIZE_LEGAL2 ; > ; - < "Tabloid" ; PAPERSIZE_TABLOID ; > ; - < "B6 (JIS)" ; PAPERSIZE_B6_JIS ; > ; - < "B5 (JIS)" ; PAPERSIZE_B5_JIS ; > ; - < "B4 (JIS)" ; PAPERSIZE_B4_JIS ; > ; - < "16 Kai" ; PAPERSIZE_KAI16; > ; - < "32 Kai" ; PAPERSIZE_KAI32; > ; - < "Big 32 Kai" ; PAPERSIZE_KAI32BIG; > ; - < "User" ; PAPERSIZE_USER ; > ; - < "DL Envelope" ; PAPERSIZE_DL ; > ; - < "C6 Envelope" ; PAPERSIZE_C6 ; > ; - < "C6/5 Envelope" ; PAPERSIZE_C65 ; > ; - < "C5 Envelope" ; PAPERSIZE_C5 ; > ; - < "C4 Envelope" ; PAPERSIZE_C4 ; > ; - < "#6 3/4 (Personal) Envelope" ; PAPERSIZE_COM675; > ; - < "#8 (Monarch) Envelope" ; PAPERSIZE_MONARCH; > ; - < "#9 Envelope" ; PAPERSIZE_COM9; > ; - < "#10 Envelope" ; PAPERSIZE_COM10; > ; - < "#11 Envelope" ; PAPERSIZE_COM11; > ; - < "#12 Envelope" ; PAPERSIZE_COM12; > ; - }; -}; -StringArray RID_SVXSTRARY_PAPERSIZE_DRAW -{ - ItemList [ en-US ] = - { - < "A6" ; PAPERSIZE_A6 ; > ; - < "A5" ; PAPERSIZE_A5 ; > ; - < "A4" ; PAPERSIZE_A4 ; > ; - < "A3" ; PAPERSIZE_A3 ; > ; - < "A2" ; PAPERSIZE_A2 ; > ; - < "A1" ; PAPERSIZE_A1 ; > ; - < "A0" ; PAPERSIZE_A0 ; > ; - < "B6 (ISO)" ; PAPERSIZE_B6_ISO ; > ; - < "B5 (ISO)" ; PAPERSIZE_B5_ISO ; > ; - < "B4 (ISO)" ; PAPERSIZE_B4_ISO ; > ; - < "Letter" ; PAPERSIZE_LETTER ; > ; - < "Legal" ; PAPERSIZE_LEGAL ; > ; - < "Long Bond" ; PAPERSIZE_LEGAL2 ; > ; - < "Tabloid" ; PAPERSIZE_TABLOID ; > ; - < "B6 (JIS)" ; PAPERSIZE_B6_JIS ; > ; - < "B5 (JIS)" ; PAPERSIZE_B5_JIS ; > ; - < "B4 (JIS)" ; PAPERSIZE_B4_JIS ; > ; - < "16 Kai" ; PAPERSIZE_KAI16; > ; - < "32 Kai" ; PAPERSIZE_KAI32; > ; - < "Big 32 Kai" ; PAPERSIZE_KAI32BIG; > ; - < "User" ; PAPERSIZE_USER ; > ; - < "DL Envelope" ; PAPERSIZE_DL ; > ; - < "C6 Envelope" ; PAPERSIZE_C6 ; > ; - < "C6/5 Envelope" ; PAPERSIZE_C65 ; > ; - < "C5 Envelope" ; PAPERSIZE_C5 ; > ; - < "C4 Envelope" ; PAPERSIZE_C4 ; > ; - < "Dia Slide" ; PAPERSIZE_DIA ; > ; - < "Screen" ; PAPERSIZE_SCREEN ; > ; - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx deleted file mode 100644 index a0c05e907..000000000 --- a/cui/source/tabpages/paragrph.cxx +++ /dev/null @@ -1,2328 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <svl/style.hxx> -#include <sfx2/app.hxx> -#include <sfx2/objsh.hxx> -#include <sfx2/module.hxx> -#include <vcl/mnemonic.hxx> -#include <svx/dialogs.hrc> - -#define _SVX_PARAGRPH_CXX 0 - -#include <svl/languageoptions.hxx> -#include <svl/cjkoptions.hxx> -#include <editeng/pgrditem.hxx> -#include <cuires.hrc> -#include "paragrph.hrc" -#include "paragrph.hxx" -#include <editeng/frmdiritem.hxx> -#include <editeng/lspcitem.hxx> -#include <editeng/adjitem.hxx> -#include <editeng/orphitem.hxx> -#include <editeng/widwitem.hxx> -#include <editeng/tstpitem.hxx> -#include <editeng/pmdlitem.hxx> -#include <editeng/spltitem.hxx> -#include <editeng/hyznitem.hxx> -#include <editeng/ulspitem.hxx> -#include <editeng/lrspitem.hxx> -#include <editeng/brkitem.hxx> -#include <editeng/keepitem.hxx> -#include "svx/dlgutil.hxx" -#include <dialmgr.hxx> -#include "svx/htmlmode.hxx" -#include <editeng/paravertalignitem.hxx> -#include <svl/eitem.hxx> -#include <sfx2/request.hxx> -#include <svl/intitem.hxx> - -// static ---------------------------------------------------------------- - -static sal_uInt16 pStdRanges[] = -{ - SID_ATTR_PARA_LINESPACE, // 10033 - SID_ATTR_PARA_LINESPACE, - SID_ATTR_LRSPACE, // 10048 - - SID_ATTR_ULSPACE, // 10049 - SID_ATTR_PARA_REGISTER, // 10413 - SID_ATTR_PARA_REGISTER, - 0 -}; - -static sal_uInt16 pAlignRanges[] = -{ - SID_ATTR_PARA_ADJUST, // 10027 - SID_ATTR_PARA_ADJUST, - 0 -}; - -static sal_uInt16 pExtRanges[] = -{ - SID_ATTR_PARA_PAGEBREAK, // 10037 - - SID_ATTR_PARA_WIDOWS, // 10041 - SID_ATTR_PARA_MODEL, // 10065 - - SID_ATTR_PARA_KEEP, // 10066 - 0 -}; - -// define ---------------------------------------------------------------- - -#define MAX_DURCH 5670 // 10 cm ist sinnvoll als maximaler Durchschuss - // laut BP -#define FIX_DIST_DEF 283 // Standard-Fix-Abstand 0,5cm - -// enum ------------------------------------------------------------------ - -enum LineSpaceList -{ - LLINESPACE_1 = 0, - LLINESPACE_15 = 1, - LLINESPACE_2 = 2, - LLINESPACE_PROP = 3, - LLINESPACE_MIN = 4, - LLINESPACE_DURCH= 5, - LLINESPACE_FIX = 6, - LLINESPACE_END -}; - -// C-Funktion ------------------------------------------------------------ - -void SetLineSpace_Impl( SvxLineSpacingItem&, int, long lValue = 0 ); - -void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace, - int eSpace, long lValue ) -{ - switch ( eSpace ) - { - case LLINESPACE_1: - rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO; - rLineSpace.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF; - break; - - case LLINESPACE_15: - rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO; - rLineSpace.SetPropLineSpace( 150 ); - break; - - case LLINESPACE_2: - rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO; - rLineSpace.SetPropLineSpace( 200 ); - break; - - case LLINESPACE_PROP: - rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO; - rLineSpace.SetPropLineSpace( (sal_uInt8)lValue ); - break; - - case LLINESPACE_MIN: - rLineSpace.SetLineHeight( (sal_uInt16)lValue ); - rLineSpace.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF; - break; - - case LLINESPACE_DURCH: - rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO; - rLineSpace.SetInterLineSpace( (sal_uInt16)lValue ); - break; - - case LLINESPACE_FIX: - rLineSpace.SetLineHeight((sal_uInt16)lValue); - rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_FIX; - rLineSpace.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF; - break; - } -} - - -sal_uInt16 GetHtmlMode_Impl(const SfxItemSet& rSet) -{ - sal_uInt16 nHtmlMode = 0; - const SfxPoolItem* pItem = 0; - SfxObjectShell* pShell; - if(SFX_ITEM_SET == rSet.GetItemState(SID_HTML_MODE, sal_False, &pItem) || - ( 0 != (pShell = SfxObjectShell::Current()) && - 0 != (pItem = pShell->GetItem(SID_HTML_MODE)))) - { - nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue(); - } - return nHtmlMode; - -} - -// class SvxStdParagraphTabPage ------------------------------------------ - -IMPL_LINK( SvxStdParagraphTabPage, ELRLoseFocusHdl, Edit *, EMPTYARG ) -{ - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - FieldUnit eUnit = - MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ) ); - - sal_Int64 nL = aLeftIndent.Denormalize( aLeftIndent.GetValue( eUnit ) ); - sal_Int64 nR = aRightIndent.Denormalize( aRightIndent.GetValue( eUnit ) ); - String aTmp = aFLineIndent.GetText(); - - // Erstzeilen Einzug - if( aLeftIndent.GetMin() < 0 ) - aFLineIndent.SetMin( -99999, FUNIT_MM ); - else - aFLineIndent.SetMin( aFLineIndent.Normalize( -nL ), eUnit ); - - // Check nur fuer konkrete Breite (Shell) - sal_Int64 nTmp = nWidth - nL - nR - MM50; - aFLineIndent.SetMax( aFLineIndent.Normalize( nTmp ), eUnit ); - - if ( !aTmp.Len() ) - aFLineIndent.SetEmptyFieldValue(); - // Maximum Links Rechts - aTmp = aLeftIndent.GetText(); - nTmp = nWidth - nR - MM50; - aLeftIndent.SetMax( aLeftIndent.Normalize( nTmp ), eUnit ); - - if ( !aTmp.Len() ) - aLeftIndent.SetEmptyFieldValue(); - aTmp = aRightIndent.GetText(); - nTmp = nWidth - nL - MM50; - aRightIndent.SetMax( aRightIndent.Normalize( nTmp ), eUnit ); - - if ( !aTmp.Len() ) - aRightIndent.SetEmptyFieldValue(); - return 0; -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxStdParagraphTabPage::Create( Window* pParent, - const SfxItemSet& rSet) -{ - return new SvxStdParagraphTabPage( pParent, rSet ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet ) -{ - SfxItemState eState = SFX_ITEM_UNKNOWN; - const SfxPoolItem* pOld = 0; - SfxItemPool* pPool = rOutSet.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - - sal_Bool bModified = sal_False; - sal_uInt16 nWhich; - sal_uInt16 nPos = aLineDist.GetSelectEntryPos(); - - if ( LISTBOX_ENTRY_NOTFOUND != nPos && - ( nPos != aLineDist.GetSavedValue() || - aLineDistAtPercentBox.IsValueModified() || - aLineDistAtMetricBox.IsValueModified() ) ) - { - nWhich = GetWhich( SID_ATTR_PARA_LINESPACE ); - SfxMapUnit eUnit = pPool->GetMetric( nWhich ); - SvxLineSpacingItem aSpacing( - (const SvxLineSpacingItem&)GetItemSet().Get( nWhich ) ); - - switch ( nPos ) - { - case LLINESPACE_1: - case LLINESPACE_15: - case LLINESPACE_2: - SetLineSpace_Impl( aSpacing, nPos ); - break; - - case LLINESPACE_PROP: - SetLineSpace_Impl( aSpacing, nPos, - static_cast<long>(aLineDistAtPercentBox.Denormalize( - aLineDistAtPercentBox.GetValue() )) ); - break; - - case LLINESPACE_MIN: - case LLINESPACE_DURCH: - case LLINESPACE_FIX: - SetLineSpace_Impl( aSpacing, nPos, - GetCoreValue( aLineDistAtMetricBox, eUnit ) ); - break; - - default: - OSL_FAIL( "unbekannter Type fuer Zeilenabstand." ); - break; - } - eState = GetItemSet().GetItemState( nWhich ); - pOld = GetOldItem( rOutSet, SID_ATTR_PARA_LINESPACE ); - - if ( !pOld || !( *(const SvxLineSpacingItem*)pOld == aSpacing ) || - SFX_ITEM_DONTCARE == eState ) - { - rOutSet.Put( aSpacing ); - bModified = sal_True; - } - } - - if ( aTopDist.IsValueModified() || aBottomDist.IsValueModified() ) - { - nWhich = GetWhich( SID_ATTR_ULSPACE ); - SfxMapUnit eUnit = pPool->GetMetric( nWhich ); - pOld = GetOldItem( rOutSet, SID_ATTR_ULSPACE ); - SvxULSpaceItem aMargin( nWhich ); - - if ( bRelativeMode ) - { - DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" ); - - const SvxULSpaceItem& rOldItem = - (const SvxULSpaceItem&)GetItemSet().GetParent()->Get( nWhich ); - - if ( aTopDist.IsRelative() ) - aMargin.SetUpper( rOldItem.GetUpper(), - (sal_uInt16)aTopDist.GetValue() ); - else - aMargin.SetUpper( (sal_uInt16)GetCoreValue( aTopDist, eUnit ) ); - - if ( aBottomDist.IsRelative() ) - aMargin.SetLower( rOldItem.GetLower(), - (sal_uInt16)aBottomDist.GetValue() ); - else - aMargin.SetLower( (sal_uInt16)GetCoreValue( aBottomDist, eUnit ) ); - - } - else - { - aMargin.SetUpper( (sal_uInt16)GetCoreValue( aTopDist, eUnit ) ); - aMargin.SetLower( (sal_uInt16)GetCoreValue( aBottomDist, eUnit ) ); - } - eState = GetItemSet().GetItemState( nWhich ); - - if ( !pOld || !( *(const SvxULSpaceItem*)pOld == aMargin ) || - SFX_ITEM_DONTCARE == eState ) - { - rOutSet.Put( aMargin ); - bModified = sal_True; - } - } - bool bNullTab = false; - - if ( aLeftIndent.IsValueModified() || - aFLineIndent.IsValueModified() || - aRightIndent.IsValueModified() - || aAutoCB.GetSavedValue() != aAutoCB.IsChecked() ) - { - nWhich = GetWhich( SID_ATTR_LRSPACE ); - SfxMapUnit eUnit = pPool->GetMetric( nWhich ); - SvxLRSpaceItem aMargin( nWhich ); - pOld = GetOldItem( rOutSet, SID_ATTR_LRSPACE ); - - if ( bRelativeMode ) - { - DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" ); - - const SvxLRSpaceItem& rOldItem = - (const SvxLRSpaceItem&)GetItemSet().GetParent()->Get( nWhich ); - - if ( aLeftIndent.IsRelative() ) - aMargin.SetTxtLeft( rOldItem.GetTxtLeft(), - (sal_uInt16)aLeftIndent.GetValue() ); - else - aMargin.SetTxtLeft( GetCoreValue( aLeftIndent, eUnit ) ); - - if ( aRightIndent.IsRelative() ) - aMargin.SetRight( rOldItem.GetRight(), - (sal_uInt16)aRightIndent.GetValue() ); - else - aMargin.SetRight( GetCoreValue( aRightIndent, eUnit ) ); - - if ( aFLineIndent.IsRelative() ) - aMargin.SetTxtFirstLineOfst( rOldItem.GetTxtFirstLineOfst(), - (sal_uInt16)aFLineIndent.GetValue() ); - else - aMargin.SetTxtFirstLineOfst( - (sal_uInt16)GetCoreValue( aFLineIndent, eUnit ) ); - } - else - { - aMargin.SetTxtLeft( GetCoreValue( aLeftIndent, eUnit ) ); - aMargin.SetRight( GetCoreValue( aRightIndent, eUnit ) ); - aMargin.SetTxtFirstLineOfst( - (sal_uInt16)GetCoreValue( aFLineIndent, eUnit ) ); - } - aMargin.SetAutoFirst(aAutoCB.IsChecked()); - if ( aMargin.GetTxtFirstLineOfst() < 0 ) - bNullTab = true; - eState = GetItemSet().GetItemState( nWhich ); - - if ( !pOld || !( *(const SvxLRSpaceItem*)pOld == aMargin ) || - SFX_ITEM_DONTCARE == eState ) - { - rOutSet.Put( aMargin ); - bModified = sal_True; - } - } - - if ( bNullTab ) - { - MapUnit eUnit = (MapUnit)pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) ); - if ( MAP_100TH_MM != eUnit ) - { - - // negativer Erstzeileneinzug -> ggf. Null Default-Tabstop setzen - sal_uInt16 _nWhich = GetWhich( SID_ATTR_TABSTOP ); - const SfxItemSet& rInSet = GetItemSet(); - - if ( rInSet.GetItemState( _nWhich ) >= SFX_ITEM_AVAILABLE ) - { - const SvxTabStopItem& rTabItem = - (const SvxTabStopItem&)rInSet.Get( _nWhich ); - SvxTabStopItem aNullTab( rTabItem ); - SvxTabStop aNull( 0, SVX_TAB_ADJUST_DEFAULT ); - aNullTab.Insert( aNull ); - rOutSet.Put( aNullTab ); - } - } - } - if( aRegisterCB.IsVisible()) - { - const SfxBoolItem* pBoolItem = (SfxBoolItem*)GetOldItem( - rOutSet, SID_ATTR_PARA_REGISTER); - SfxBoolItem* pRegItem = (SfxBoolItem*)pBoolItem->Clone(); - sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_REGISTER ); - sal_Bool bSet = pRegItem->GetValue(); - - if(aRegisterCB.IsChecked() != bSet ) - { - pRegItem->SetValue(!bSet); - rOutSet.Put(*pRegItem); - bModified = sal_True; - } - else if ( SFX_ITEM_DEFAULT == GetItemSet().GetItemState( _nWhich, sal_False ) ) - rOutSet.ClearItem(_nWhich); - delete pRegItem; - } - - return bModified; -} - -// ----------------------------------------------------------------------- - -void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) -{ - SfxItemPool* pPool = rSet.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool?" ); - String aEmpty; - - // Metrik einstellen - FieldUnit eFUnit = GetModuleFieldUnit( rSet ); - - bool bApplyCharUnit = GetApplyCharUnit( rSet ); - - SvtCJKOptions aCJKOptions; - if(aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit ) - eFUnit = FUNIT_CHAR; - - SetFieldUnit( aLeftIndent, eFUnit ); - SetFieldUnit( aRightIndent, eFUnit ); - SetFieldUnit( aFLineIndent, eFUnit ); - if ( eFUnit == FUNIT_CHAR ) - { - SetFieldUnit( aTopDist, FUNIT_LINE ); - SetFieldUnit( aBottomDist, FUNIT_LINE ); - SetFieldUnit( aLineDistAtMetricBox, FUNIT_POINT ); - } - else - { - SetFieldUnit( aTopDist, eFUnit ); - SetFieldUnit( aBottomDist, eFUnit ); - SetFieldUnit( aLineDistAtMetricBox, eFUnit ); - } - - sal_uInt16 _nWhich = GetWhich( SID_ATTR_LRSPACE ); - SfxItemState eItemState = rSet.GetItemState( _nWhich ); - - if ( eItemState >= SFX_ITEM_AVAILABLE ) - { - SfxMapUnit eUnit = pPool->GetMetric( _nWhich ); - - if ( bRelativeMode ) - { - const SvxLRSpaceItem& rOldItem = - (const SvxLRSpaceItem&)rSet.Get( _nWhich ); - - if ( rOldItem.GetPropLeft() != 100 ) - { - aLeftIndent.SetRelative( sal_True ); - aLeftIndent.SetValue( rOldItem.GetPropLeft() ); - } - else - { - aLeftIndent.SetRelative(); - SetFieldUnit( aLeftIndent, eFUnit ); - SetMetricValue( aLeftIndent, rOldItem.GetTxtLeft(), eUnit ); - } - - if ( rOldItem.GetPropRight() != 100 ) - { - aRightIndent.SetRelative( sal_True ); - aRightIndent.SetValue( rOldItem.GetPropRight() ); - } - else - { - aRightIndent.SetRelative(); - SetFieldUnit( aRightIndent, eFUnit ); - SetMetricValue( aRightIndent, rOldItem.GetRight(), eUnit ); - } - - if ( rOldItem.GetPropTxtFirstLineOfst() != 100 ) - { - aFLineIndent.SetRelative( sal_True ); - aFLineIndent.SetValue( rOldItem.GetPropTxtFirstLineOfst() ); - } - else - { - aFLineIndent.SetRelative(); - aFLineIndent.SetMin(-9999); - SetFieldUnit( aFLineIndent, eFUnit ); - SetMetricValue( aFLineIndent, rOldItem.GetTxtFirstLineOfst(), - eUnit ); - } - aAutoCB.Check(rOldItem.IsAutoFirst()); - } - else - { - const SvxLRSpaceItem& rSpace = - (const SvxLRSpaceItem&)rSet.Get( _nWhich ); - - SetMetricValue( aLeftIndent, rSpace.GetTxtLeft(), eUnit ); - SetMetricValue( aRightIndent, rSpace.GetRight(), eUnit ); - SetMetricValue( aFLineIndent, rSpace.GetTxtFirstLineOfst(), eUnit ); - aAutoCB.Check(rSpace.IsAutoFirst()); - } - AutoHdl_Impl(&aAutoCB); - } - else - { - aLeftIndent.SetEmptyFieldValue(); - aRightIndent.SetEmptyFieldValue(); - aFLineIndent.SetEmptyFieldValue(); - } - - _nWhich = GetWhich( SID_ATTR_ULSPACE ); - eItemState = rSet.GetItemState( _nWhich ); - - if ( eItemState >= SFX_ITEM_AVAILABLE ) - { - SfxMapUnit eUnit = pPool->GetMetric( _nWhich ); - - if ( bRelativeMode ) - { - const SvxULSpaceItem& rOldItem = - (const SvxULSpaceItem&)rSet.Get( _nWhich ); - - if ( rOldItem.GetPropUpper() != 100 ) - { - aTopDist.SetRelative( sal_True ); - aTopDist.SetValue( rOldItem.GetPropUpper() ); - } - else - { - aTopDist.SetRelative(); - if ( eFUnit == FUNIT_CHAR ) - SetFieldUnit( aTopDist, FUNIT_LINE ); - else - SetFieldUnit( aTopDist, eFUnit ); - SetMetricValue( aTopDist, rOldItem.GetUpper(), eUnit ); - } - - if ( rOldItem.GetPropLower() != 100 ) - { - aBottomDist.SetRelative( sal_True ); - aBottomDist.SetValue( rOldItem.GetPropLower() ); - } - else - { - aBottomDist.SetRelative(); - if ( eFUnit == FUNIT_CHAR ) - SetFieldUnit( aBottomDist, FUNIT_LINE ); - else - SetFieldUnit( aBottomDist, eFUnit ); - SetMetricValue( aBottomDist, rOldItem.GetLower(), eUnit ); - } - } - else - { - const SvxULSpaceItem& rTopMargin = - (const SvxULSpaceItem&)rSet.Get( _nWhich ); - SetMetricValue( aTopDist, rTopMargin.GetUpper(), eUnit ); - SetMetricValue( aBottomDist, rTopMargin.GetLower(), eUnit ); - } - } - else - { - aTopDist.SetEmptyFieldValue(); - aBottomDist.SetEmptyFieldValue(); - } - - _nWhich = GetWhich( SID_ATTR_PARA_LINESPACE ); - eItemState = rSet.GetItemState( _nWhich ); - - if ( eItemState >= SFX_ITEM_AVAILABLE ) - SetLineSpacing_Impl( (const SvxLineSpacingItem &)rSet.Get( _nWhich ) ); - else - aLineDist.SetNoSelection(); - - - _nWhich = GetWhich( SID_ATTR_PARA_REGISTER ); - eItemState = rSet.GetItemState( _nWhich ); - - if ( eItemState >= SFX_ITEM_AVAILABLE ) - aRegisterCB.Check( ((const SfxBoolItem &)rSet.Get( _nWhich )).GetValue()); - aRegisterCB.SaveValue(); - sal_uInt16 nHtmlMode = GetHtmlMode_Impl(rSet); - if(nHtmlMode & HTMLMODE_ON) - { - aRegisterCB.Hide(); - aRegisterFL.Hide(); - aAutoCB.Hide(); - if(!(nHtmlMode & HTMLMODE_SOME_STYLES)) // IE oder SW - { - aRightLabel.Disable(); - aRightIndent.Disable(); - aTopDist.Disable(); //HTML3.2 und NS 3.0 - aBottomDist.Disable(); - if(!(nHtmlMode & HTMLMODE_FIRSTLINE)) //NS 3.0 - { - aFLineIndent.Disable(); - aFLineLabel.Disable(); - } - } - } - - ELRLoseFocusHdl( NULL ); - aAutoCB.SaveValue(); - aLineDist.SaveValue(); -} - -// ----------------------------------------------------------------------- - -void SvxStdParagraphTabPage::EnableRelativeMode() -{ - DBG_ASSERT( GetItemSet().GetParent(), "RelativeMode, but no parent-set!" ); - - aLeftIndent.EnableRelativeMode( 0, 999 ); - aFLineIndent.EnableRelativeMode( 0, 999 ); - aRightIndent.EnableRelativeMode( 0, 999 ); - aTopDist.EnableRelativeMode( 0, 999 ); - aBottomDist.EnableRelativeMode( 0, 999 ); - bRelativeMode = sal_True; -} - -// ----------------------------------------------------------------------- - -int SvxStdParagraphTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - ELRLoseFocusHdl( NULL ); - - if ( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -SvxStdParagraphTabPage::SvxStdParagraphTabPage( Window* pParent, - const SfxItemSet& rAttr ) : - - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_STD_PARAGRAPH ), rAttr ), - - aIndentFrm ( this, CUI_RES( FL_INDENT ) ), - aLeftLabel ( this, CUI_RES( FT_LEFTINDENT ) ), - aLeftIndent ( this, CUI_RES( ED_LEFTINDENT ) ), - aRightLabel ( this, CUI_RES( FT_RIGHTINDENT ) ), - aRightIndent ( this, CUI_RES( ED_RIGHTINDENT ) ), - - aFLineLabel ( this, CUI_RES( FT_FLINEINDENT ) ), - aFLineIndent ( this, CUI_RES( ED_FLINEINDENT ) ), - aAutoCB ( this, CUI_RES( CB_AUTO ) ), - aDistFrm ( this, CUI_RES( FL_DIST ) ), - aTopLabel ( this, CUI_RES( FT_TOPDIST ) ), - aTopDist ( this, CUI_RES( ED_TOPDIST ) ), - aBottomLabel ( this, CUI_RES( FT_BOTTOMDIST ) ), - aBottomDist ( this, CUI_RES( ED_BOTTOMDIST ) ), - - aLineDistFrm ( this, CUI_RES( FL_LINEDIST ) ), - aLineDist ( this, CUI_RES( LB_LINEDIST ) ), - aLineDistAtLabel ( this, CUI_RES( FT_LINEDIST ) ), - aLineDistAtPercentBox ( this, CUI_RES( ED_LINEDISTPERCENT ) ), - aLineDistAtMetricBox ( this, CUI_RES( ED_LINEDISTMETRIC ) ), - sAbsDist ( CUI_RES(ST_LINEDIST_ABS) ), - aExampleWin ( this, CUI_RES( WN_EXAMPLE ) ), - aRegisterFL ( this, CUI_RES( FL_REGISTER ) ), - aRegisterCB ( this, CUI_RES( CB_REGISTER ) ), - pActLineDistFld ( &aLineDistAtPercentBox ), - nAbst ( MAX_DURCH ), - nWidth ( 11905 /*567 * 50*/ ), - nMinFixDist(0L), - - bRelativeMode ( sal_False ), - bNegativeIndents(sal_False) - -{ - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - aLineDistAtMetricBox.Hide(); - FreeResource(); - Init_Impl(); - aFLineIndent.SetMin(-9999); // wird default auf 0 gesetzt - - aExampleWin.SetAccessibleName(String(CUI_RES(STR_EXAMPLE))); - -} - - -// ----------------------------------------------------------------------- - -void SvxStdParagraphTabPage::EnableNegativeMode() -{ - aLeftIndent.SetMin(-9999); - aRightIndent.SetMin(-9999); - aRightIndent.EnableNegativeMode(); - aLeftIndent.EnableNegativeMode(); - bNegativeIndents = sal_True; -} - -// ----------------------------------------------------------------------- - -sal_uInt16* SvxStdParagraphTabPage::GetRanges() -{ - return pStdRanges; -} - -// ----------------------------------------------------------------------- - -void SvxStdParagraphTabPage::SetLineSpacing_Impl -( - const SvxLineSpacingItem &rAttr -) -{ - SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( rAttr.Which() ); - - switch( rAttr.GetLineSpaceRule() ) - { - case SVX_LINE_SPACE_AUTO: - { - SvxInterLineSpace eInter = rAttr.GetInterLineSpaceRule(); - - switch( eInter ) - { - // Default einzeilig - case SVX_INTER_LINE_SPACE_OFF: - aLineDist.SelectEntryPos( LLINESPACE_1 ); - break; - - // Default einzeilig - case SVX_INTER_LINE_SPACE_PROP: - if ( 100 == rAttr.GetPropLineSpace() ) - { - aLineDist.SelectEntryPos( LLINESPACE_1 ); - break; - } - // 1.5zeilig - if ( 150 == rAttr.GetPropLineSpace() ) - { - aLineDist.SelectEntryPos( LLINESPACE_15 ); - break; - } - // 2zeilig - if ( 200 == rAttr.GetPropLineSpace() ) - { - aLineDist.SelectEntryPos( LLINESPACE_2 ); - break; - } - // eingestellter Prozentwert - aLineDistAtPercentBox. - SetValue( aLineDistAtPercentBox.Normalize( - rAttr.GetPropLineSpace() ) ); - aLineDist.SelectEntryPos( LLINESPACE_PROP ); - break; - - case SVX_INTER_LINE_SPACE_FIX: - SetMetricValue( aLineDistAtMetricBox, - rAttr.GetInterLineSpace(), eUnit ); - aLineDist.SelectEntryPos( LLINESPACE_DURCH ); - break; - default: ;//prevent warning - } - } - break; - case SVX_LINE_SPACE_FIX: - SetMetricValue(aLineDistAtMetricBox, rAttr.GetLineHeight(), eUnit); - aLineDist.SelectEntryPos( LLINESPACE_FIX ); - break; - - case SVX_LINE_SPACE_MIN: - SetMetricValue(aLineDistAtMetricBox, rAttr.GetLineHeight(), eUnit); - aLineDist.SelectEntryPos( LLINESPACE_MIN ); - break; - default: ;//prevent warning - } - LineDistHdl_Impl( &aLineDist ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox *, pBox ) -{ - switch( pBox->GetSelectEntryPos() ) - { - case LLINESPACE_1: - case LLINESPACE_15: - case LLINESPACE_2: - aLineDistAtLabel.Enable(sal_False); - pActLineDistFld->Enable(sal_False); - pActLineDistFld->SetText( String() ); - break; - - case LLINESPACE_DURCH: - // Setzen eines sinnvollen Defaults? - // MS Begrenzen min(10, aPageSize) - aLineDistAtPercentBox.Hide(); - pActLineDistFld = &aLineDistAtMetricBox; - aLineDistAtMetricBox.SetMin(0); - - - if ( !aLineDistAtMetricBox.GetText().Len() ) - aLineDistAtMetricBox.SetValue( - aLineDistAtMetricBox.Normalize( 1 ) ); - aLineDistAtPercentBox.Hide(); - pActLineDistFld->Show(); - pActLineDistFld->Enable(); - aLineDistAtLabel.Enable(); - break; - - case LLINESPACE_MIN: - aLineDistAtPercentBox.Hide(); - pActLineDistFld = &aLineDistAtMetricBox; - aLineDistAtMetricBox.SetMin(0); - - if ( !aLineDistAtMetricBox.GetText().Len() ) - aLineDistAtMetricBox.SetValue( - aLineDistAtMetricBox.Normalize( 10 ), FUNIT_TWIP ); - aLineDistAtPercentBox.Hide(); - pActLineDistFld->Show(); - pActLineDistFld->Enable(); - aLineDistAtLabel.Enable(); - break; - - case LLINESPACE_PROP: - aLineDistAtMetricBox.Hide(); - pActLineDistFld = &aLineDistAtPercentBox; - - if ( !aLineDistAtPercentBox.GetText().Len() ) - aLineDistAtPercentBox.SetValue( - aLineDistAtPercentBox.Normalize( 100 ), FUNIT_TWIP ); - aLineDistAtMetricBox.Hide(); - pActLineDistFld->Show(); - pActLineDistFld->Enable(); - aLineDistAtLabel.Enable(); - break; - case LLINESPACE_FIX: - { - aLineDistAtPercentBox.Hide(); - pActLineDistFld = &aLineDistAtMetricBox; - sal_Int64 nTemp = aLineDistAtMetricBox.GetValue(); - aLineDistAtMetricBox.SetMin(aLineDistAtMetricBox.Normalize(nMinFixDist), FUNIT_TWIP); - - // wurde der Wert beim SetMin veraendert, dann ist es Zeit - // fuer den default - if ( aLineDistAtMetricBox.GetValue() != nTemp ) - SetMetricValue( aLineDistAtMetricBox, - FIX_DIST_DEF, SFX_MAPUNIT_TWIP ); // fix gibt's nur im Writer - aLineDistAtPercentBox.Hide(); - pActLineDistFld->Show(); - pActLineDistFld->Enable(); - aLineDistAtLabel.Enable(); - } - break; - } - UpdateExample_Impl( sal_True ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxStdParagraphTabPage, ModifyHdl_Impl, SvxRelativeField *, EMPTYARG ) -{ - UpdateExample_Impl(); - return 0; -} -IMPL_LINK_INLINE_END( SvxStdParagraphTabPage, ModifyHdl_Impl, SvxRelativeField *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -void SvxStdParagraphTabPage::Init_Impl() -{ - aLineDist.SetSelectHdl( - LINK( this, SvxStdParagraphTabPage, LineDistHdl_Impl ) ); - - Link aLink = LINK( this, SvxStdParagraphTabPage, ELRLoseFocusHdl ); - aFLineIndent.SetLoseFocusHdl( aLink ); - aLeftIndent.SetLoseFocusHdl( aLink ); - aRightIndent.SetLoseFocusHdl( aLink ); - - aLink = LINK( this, SvxStdParagraphTabPage, ModifyHdl_Impl ); - aFLineIndent.SetModifyHdl( aLink ); - aLeftIndent.SetModifyHdl( aLink ); - aRightIndent.SetModifyHdl( aLink ); - aTopDist.SetModifyHdl( aLink ); - aBottomDist.SetModifyHdl( aLink ); - - aAutoCB.SetClickHdl( LINK( this, SvxStdParagraphTabPage, AutoHdl_Impl )); - SfxItemPool* pPool = GetItemSet().GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - FieldUnit eUnit = - MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ) ); - - aTopDist.SetMax( aTopDist.Normalize( nAbst ), eUnit ); - aBottomDist.SetMax( aBottomDist.Normalize( nAbst ), eUnit ); - aLineDistAtMetricBox.SetMax( - aLineDistAtMetricBox.Normalize( nAbst ), eUnit ); -} - -// ----------------------------------------------------------------------- - -void SvxStdParagraphTabPage::UpdateExample_Impl( sal_Bool bAll ) -{ - aExampleWin.SetFirstLineOfst( - (short)aFLineIndent.Denormalize( aFLineIndent.GetValue( FUNIT_TWIP ) ) ); - aExampleWin.SetLeftMargin( - static_cast<long>(aLeftIndent.Denormalize( aLeftIndent.GetValue( FUNIT_TWIP ) ) ) ); - aExampleWin.SetRightMargin( - static_cast<long>(aRightIndent.Denormalize( aRightIndent.GetValue( FUNIT_TWIP ) ) ) ); - aExampleWin.SetUpper( - (sal_uInt16)aTopDist.Denormalize( aTopDist.GetValue( FUNIT_TWIP ) ) ); - aExampleWin.SetLower( - (sal_uInt16)aBottomDist.Denormalize( aBottomDist.GetValue( FUNIT_TWIP ) ) ); - - - - sal_uInt16 nPos = aLineDist.GetSelectEntryPos(); - - switch ( nPos ) - { - case LLINESPACE_1: - case LLINESPACE_15: - case LLINESPACE_2: - aExampleWin.SetLineSpace( (SvxPrevLineSpace)nPos ); - break; - - case LLINESPACE_PROP: - aExampleWin.SetLineSpace( (SvxPrevLineSpace)nPos, - (sal_uInt16)aLineDistAtPercentBox.Denormalize( - aLineDistAtPercentBox.GetValue() ) ); - break; - - case LLINESPACE_MIN: - case LLINESPACE_DURCH: - case LLINESPACE_FIX: - aExampleWin.SetLineSpace( (SvxPrevLineSpace)nPos, - (sal_uInt16)GetCoreValue( aLineDistAtMetricBox, SFX_MAPUNIT_TWIP ) ); - break; - } - aExampleWin.Draw( bAll ); -} - -// ----------------------------------------------------------------------- - -void SvxStdParagraphTabPage::EnableRegisterMode() -{ - aRegisterCB.Show(); - aRegisterFL.Show(); -} - -IMPL_LINK( SvxStdParagraphTabPage, AutoHdl_Impl, CheckBox*, pBox ) -{ - sal_Bool bEnable = !pBox->IsChecked(); - aFLineLabel .Enable(bEnable); - aFLineIndent.Enable(bEnable); - return 0; -} - -void SvxStdParagraphTabPage::SetPageWidth( sal_uInt16 nPageWidth ) -{ - nWidth = nPageWidth; -} - - -void SvxStdParagraphTabPage::EnableAutoFirstLine() -{ - aAutoCB.Show(); -} - - -void SvxStdParagraphTabPage::EnableAbsLineDist(long nMinTwip) -{ - aLineDist.InsertEntry(sAbsDist); - nMinFixDist = nMinTwip; -} - - -void SvxStdParagraphTabPage::PageCreated(SfxAllItemSet aSet) -{ - -/* different bit represent call to different method of SvxStdParagraphTabPage - 0x0001 --->EnableRelativeMode() - 0x0002 --->EnableRegisterMode() - 0x0004 --->EnableAutoFirstLine() - 0x0008 --->EnableNegativeMode() - */ - SFX_ITEMSET_ARG (&aSet,pPageWidthItem,SfxUInt16Item,SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH,sal_False); - SFX_ITEMSET_ARG (&aSet,pFlagSetItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,sal_False); - SFX_ITEMSET_ARG (&aSet,pLineDistItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,sal_False); - - if (pPageWidthItem) - SetPageWidth(pPageWidthItem->GetValue()); - - if (pFlagSetItem ) - if (( 0x0001 & pFlagSetItem->GetValue())== 0x0001 ) - EnableRelativeMode(); - - if (pFlagSetItem) - if (( 0x0002 & pFlagSetItem->GetValue())== 0x0002 ) - EnableRegisterMode(); - - if (pFlagSetItem) - if ( ( 0x0004 & pFlagSetItem->GetValue())== 0x0004 ) - EnableAutoFirstLine(); - - if(pLineDistItem) - EnableAbsLineDist(pLineDistItem->GetValue()); - - if (pFlagSetItem) - if (( 0x0008 & pFlagSetItem->GetValue()) == 0x0008 ) - EnableNegativeMode(); - -} - - -#define LASTLINEPOS_DEFAULT 0 -#define LASTLINEPOS_LEFT 1 - -#define LASTLINECOUNT_OLD 3 -#define LASTLINECOUNT_NEW 4 - -// class SvxParaAlignTabPage ------------------------------------------------ - -SvxParaAlignTabPage::SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet ) - : SfxTabPage(pParent, CUI_RES( RID_SVXPAGE_ALIGN_PARAGRAPH ),rSet), - aAlignFrm ( this, CUI_RES( FL_ALIGN ) ), - aLeft ( this, CUI_RES( BTN_LEFTALIGN ) ), - aRight ( this, CUI_RES( BTN_RIGHTALIGN ) ), - aCenter ( this, CUI_RES( BTN_CENTERALIGN ) ), - aJustify ( this, CUI_RES( BTN_JUSTIFYALIGN ) ), - aLastLineFT ( this, CUI_RES( FT_LASTLINE ) ), - aLastLineLB ( this, CUI_RES( LB_LASTLINE ) ), - aExpandCB ( this, CUI_RES( CB_EXPAND ) ), - aSnapToGridCB ( this, CUI_RES( CB_SNAP ) ), - aExampleWin ( this, CUI_RES( WN_EXAMPLE ) ), - - aVertAlignFL ( this, CUI_RES( FL_VERTALIGN ) ), - aVertAlignFT ( this, CUI_RES( FT_VERTALIGN ) ), - aVertAlignLB ( this, CUI_RES( LB_VERTALIGN ) ), - - aPropertiesFL ( this, CUI_RES( FL_PROPERTIES )), - aTextDirectionFT ( this, CUI_RES( FT_TEXTDIRECTION )), - aTextDirectionLB ( this, CUI_RES( LB_TEXTDIRECTION )) -{ - SvtLanguageOptions aLangOptions; - sal_uInt16 nLastLinePos = LASTLINEPOS_DEFAULT; - - if ( aLangOptions.IsAsianTypographyEnabled() ) - { - String sLeft(CUI_RES(ST_LEFTALIGN_ASIAN)); - aLeft.SetText(sLeft); - aRight.SetText(String(CUI_RES(ST_RIGHTALIGN_ASIAN))); - sLeft = MnemonicGenerator::EraseAllMnemonicChars( sLeft ); - - if ( aLastLineLB.GetEntryCount() == LASTLINECOUNT_OLD ) - { - aLastLineLB.RemoveEntry( 0 ); - aLastLineLB.InsertEntry( sLeft, 0 ); - } - else - nLastLinePos = LASTLINEPOS_LEFT; - } - // remove "Default" or "Left" entry, depends on CJKOptions - if ( aLastLineLB.GetEntryCount() == LASTLINECOUNT_NEW ) - aLastLineLB.RemoveEntry( nLastLinePos ); - - FreeResource(); - Link aLink = LINK( this, SvxParaAlignTabPage, AlignHdl_Impl ); - aLeft.SetClickHdl( aLink ); - aRight.SetClickHdl( aLink ); - aCenter.SetClickHdl( aLink ); - aJustify.SetClickHdl( aLink ); - aLastLineLB.SetSelectHdl( LINK( this, SvxParaAlignTabPage, LastLineHdl_Impl ) ); - aTextDirectionLB.SetSelectHdl( LINK( this, SvxParaAlignTabPage, TextDirectionHdl_Impl ) ); - - sal_uInt16 nHtmlMode = GetHtmlMode_Impl(rSet); - if(!(nHtmlMode & HTMLMODE_ON) || (0 != (nHtmlMode & HTMLMODE_SOME_STYLES)) ) - { - if( aLangOptions.IsCTLFontEnabled() ) - { - aTextDirectionLB.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP ); - aTextDirectionLB.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP ); - aTextDirectionLB.InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT ); - - aPropertiesFL.Show(); - aTextDirectionFT.Show(); - aTextDirectionLB.Show(); - } - } - - aExampleWin.SetAccessibleName(String(CUI_RES(STR_EXAMPLE))); - -} - -SvxParaAlignTabPage::~SvxParaAlignTabPage() -{ -} - -int SvxParaAlignTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -SfxTabPage* SvxParaAlignTabPage::Create( Window* pParent, const SfxItemSet& rSet ) -{ - return new SvxParaAlignTabPage(pParent, rSet); -} - -sal_uInt16* SvxParaAlignTabPage::GetRanges() -{ - return pAlignRanges; - -} - -sal_Bool SvxParaAlignTabPage::FillItemSet( SfxItemSet& rOutSet ) -{ - sal_Bool bModified = sal_False; - - bool bAdj = false, bChecked = false; - SvxAdjust eAdjust = SVX_ADJUST_LEFT; - - if ( aLeft.IsChecked() ) - { - eAdjust = SVX_ADJUST_LEFT; - bAdj = !aLeft.GetSavedValue(); - bChecked = true; - } - else if ( aRight.IsChecked() ) - { - eAdjust = SVX_ADJUST_RIGHT; - bAdj = !aRight.GetSavedValue(); - bChecked = true; - } - else if ( aCenter.IsChecked() ) - { - eAdjust = SVX_ADJUST_CENTER; - bAdj = !aCenter.GetSavedValue(); - bChecked = true; - } - else if ( aJustify.IsChecked() ) - { - eAdjust = SVX_ADJUST_BLOCK; - bAdj = !aJustify.GetSavedValue() || - aExpandCB.IsChecked() != aExpandCB.GetSavedValue() || - aLastLineLB.GetSelectEntryPos() != aLastLineLB.GetSavedValue(); - bChecked = true; - } - sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST ); - - if ( bAdj ) - { - const SvxAdjustItem* pOld = - (const SvxAdjustItem*)GetOldItem( rOutSet, SID_ATTR_PARA_ADJUST ); - SvxAdjust eOneWord = aExpandCB.IsChecked() ? SVX_ADJUST_BLOCK - : SVX_ADJUST_LEFT; - sal_uInt16 nLBPos = aLastLineLB.GetSelectEntryPos(); - SvxAdjust eLastBlock = SVX_ADJUST_LEFT; - - if ( 1 == nLBPos ) - eLastBlock = SVX_ADJUST_CENTER; - else if ( 2 == nLBPos ) - eLastBlock = SVX_ADJUST_BLOCK; - - bool bNothingWasChecked = - !aLeft.GetSavedValue() && !aRight.GetSavedValue() && - !aCenter.GetSavedValue() && !aJustify.GetSavedValue(); - - if ( !pOld || pOld->GetAdjust() != eAdjust || - pOld->GetOneWord() != eOneWord || - pOld->GetLastBlock() != eLastBlock || - ( bChecked && bNothingWasChecked ) ) - { - bModified = sal_True; - SvxAdjustItem aAdj( - (const SvxAdjustItem&)GetItemSet().Get( _nWhich ) ); - aAdj.SetAdjust( eAdjust ); - aAdj.SetOneWord( eOneWord ); - aAdj.SetLastBlock( eLastBlock ); - rOutSet.Put( aAdj ); - } - } - if(aSnapToGridCB.IsChecked() != aSnapToGridCB.GetSavedValue()) - { - rOutSet.Put(SvxParaGridItem(aSnapToGridCB.IsChecked(), GetWhich( SID_ATTR_PARA_SNAPTOGRID ))); - bModified = sal_True; - } - if(aVertAlignLB.GetSavedValue() != aVertAlignLB.GetSelectEntryPos()) - { - rOutSet.Put(SvxParaVertAlignItem(aVertAlignLB.GetSelectEntryPos(), GetWhich( SID_PARA_VERTALIGN ))); - bModified = sal_True; - } - - if( aTextDirectionLB.IsVisible() ) - { - SvxFrameDirection eDir = aTextDirectionLB.GetSelectEntryValue(); - if( eDir != aTextDirectionLB.GetSavedValue() ) - { - rOutSet.Put( SvxFrameDirectionItem( eDir, GetWhich( SID_ATTR_FRAMEDIRECTION ) ) ); - bModified = sal_True; - } - } - - return bModified; -} - -void SvxParaAlignTabPage::Reset( const SfxItemSet& rSet ) -{ - sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST ); - SfxItemState eItemState = rSet.GetItemState( _nWhich ); - - sal_uInt16 nLBSelect = 0; - if ( eItemState >= SFX_ITEM_AVAILABLE ) - { - const SvxAdjustItem& rAdj = (const SvxAdjustItem&)rSet.Get( _nWhich ); - - switch ( rAdj.GetAdjust() /*!!! VB fragen rAdj.GetLastBlock()*/ ) - { - case SVX_ADJUST_LEFT: aLeft.Check(); break; - - case SVX_ADJUST_RIGHT: aRight.Check(); break; - - case SVX_ADJUST_CENTER: aCenter.Check(); break; - - case SVX_ADJUST_BLOCK: aJustify.Check(); break; - default: ; //prevent warning - } - sal_Bool bEnable = aJustify.IsChecked(); - aLastLineFT.Enable(bEnable); - aLastLineLB.Enable(bEnable); - aExpandCB .Enable(bEnable); - - aExpandCB.Check(SVX_ADJUST_BLOCK == rAdj.GetOneWord()); - switch(rAdj.GetLastBlock()) - { - case SVX_ADJUST_LEFT: nLBSelect = 0; break; - - case SVX_ADJUST_CENTER: nLBSelect = 1; break; - - case SVX_ADJUST_BLOCK: nLBSelect = 2; break; - default: ; //prevent warning - } - } - else - { - aLeft.Check( sal_False ); - aRight.Check( sal_False ); - aCenter.Check( sal_False ); - aJustify.Check( sal_False ); - } - aLastLineLB.SelectEntryPos(nLBSelect); - - sal_uInt16 nHtmlMode = GetHtmlMode_Impl(rSet); - if(nHtmlMode & HTMLMODE_ON) - { - aLastLineLB.Hide(); - aLastLineFT.Hide(); - aExpandCB.Hide(); - if(!(nHtmlMode & (HTMLMODE_FULL_STYLES|HTMLMODE_FIRSTLINE)) ) - aJustify.Disable(); - aSnapToGridCB.Show(sal_False); - } - _nWhich = GetWhich(SID_ATTR_PARA_SNAPTOGRID); - eItemState = rSet.GetItemState( _nWhich ); - if ( eItemState >= SFX_ITEM_AVAILABLE ) - { - const SvxParaGridItem& rSnap = (const SvxParaGridItem&)rSet.Get( _nWhich ); - aSnapToGridCB.Check(rSnap.GetValue()); - } - - _nWhich = GetWhich( SID_PARA_VERTALIGN ); - eItemState = rSet.GetItemState( _nWhich ); - - if ( eItemState >= SFX_ITEM_AVAILABLE ) - { - aVertAlignLB.Show(); - aVertAlignFL.Show(); - aVertAlignFT.Show(); - - const SvxParaVertAlignItem& rAlign = (const SvxParaVertAlignItem&)rSet.Get( _nWhich ); - aVertAlignLB.SelectEntryPos(rAlign.GetValue()); - } - - _nWhich = GetWhich( SID_ATTR_FRAMEDIRECTION ); - //text direction - if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( _nWhich ) ) - { - const SvxFrameDirectionItem& rFrameDirItem = ( const SvxFrameDirectionItem& ) rSet.Get( _nWhich ); - aTextDirectionLB.SelectEntryValue( (SvxFrameDirection)rFrameDirItem.GetValue() ); - aTextDirectionLB.SaveValue(); - } - - aSnapToGridCB.SaveValue(); - aVertAlignLB.SaveValue(); - aLeft.SaveValue(); - aRight.SaveValue(); - aCenter.SaveValue(); - aJustify.SaveValue(); - aLastLineLB.SaveValue(); - aExpandCB.SaveValue(); - - UpdateExample_Impl(sal_True); -} - -IMPL_LINK( SvxParaAlignTabPage, AlignHdl_Impl, RadioButton*, EMPTYARG ) -{ - sal_Bool bJustify = aJustify.IsChecked(); - aLastLineFT.Enable(bJustify); - aLastLineLB.Enable(bJustify); - aExpandCB.Enable(bJustify); - UpdateExample_Impl(sal_False); - return 0; -} - -IMPL_LINK( SvxParaAlignTabPage, LastLineHdl_Impl, ListBox*, EMPTYARG ) -{ - UpdateExample_Impl(sal_False); - return 0; -} - -IMPL_LINK( SvxParaAlignTabPage, TextDirectionHdl_Impl, ListBox*, EMPTYARG ) -{ - SvxFrameDirection eDir = aTextDirectionLB.GetSelectEntryValue(); - switch ( eDir ) - { - // check the default alignment for this text direction - case FRMDIR_HORI_LEFT_TOP : aLeft.Check( sal_True ); break; - case FRMDIR_HORI_RIGHT_TOP : aRight.Check( sal_True ); break; - case FRMDIR_ENVIRONMENT : /* do nothing */ break; - default: - { - DBG_ERRORFILE( "SvxParaAlignTabPage::TextDirectionHdl_Impl(): other directions not supported" ); - } - } - - return 0; -} - -void SvxParaAlignTabPage::UpdateExample_Impl( sal_Bool bAll ) -{ - if ( aLeft.IsChecked() ) - aExampleWin.SetAdjust( SVX_ADJUST_LEFT ); - else if ( aRight.IsChecked() ) - aExampleWin.SetAdjust( SVX_ADJUST_RIGHT ); - else if ( aCenter.IsChecked() ) - aExampleWin.SetAdjust( SVX_ADJUST_CENTER ); - else if ( aJustify.IsChecked() ) - { - aExampleWin.SetAdjust( SVX_ADJUST_BLOCK ); - SvxAdjust eLastBlock = SVX_ADJUST_LEFT; - sal_uInt16 nLBPos = aLastLineLB.GetSelectEntryPos(); - if(nLBPos == 1) - eLastBlock = SVX_ADJUST_CENTER; - else if(nLBPos == 2) - eLastBlock = SVX_ADJUST_BLOCK; - aExampleWin.SetLastLine( eLastBlock ); - } - - aExampleWin.Draw( bAll ); -} - -// Erweiterungen fuer den Blocksatz einschalten -void SvxParaAlignTabPage::EnableJustifyExt() -{ - aLastLineFT.Show(); - aLastLineLB.Show(); - aExpandCB .Show(); - SvtLanguageOptions aCJKOptions; - if(aCJKOptions.IsAsianTypographyEnabled()) - aSnapToGridCB.Show(); - -} - -void SvxParaAlignTabPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pBoolItem,SfxBoolItem,SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_False); - if (pBoolItem) - if(pBoolItem->GetValue()) - EnableJustifyExt(); -} - -SfxTabPage* SvxExtParagraphTabPage::Create( Window* pParent, - const SfxItemSet& rSet ) -{ - return new SvxExtParagraphTabPage( pParent, rSet ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet& rOutSet ) -{ - sal_Bool bModified = sal_False; - sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE ); - const TriState eHyphenState = aHyphenBox.GetState(); - const SfxPoolItem* pOld = GetOldItem( rOutSet, SID_ATTR_PARA_HYPHENZONE ); - - if ( eHyphenState != aHyphenBox.GetSavedValue() || - aExtHyphenBeforeBox.IsValueModified() || - aExtHyphenAfterBox.IsValueModified() || - aMaxHyphenEdit.IsValueModified() ) - { - SvxHyphenZoneItem aHyphen( - (const SvxHyphenZoneItem&)GetItemSet().Get( _nWhich ) ); - aHyphen.SetHyphen( eHyphenState == STATE_CHECK ); - - if ( eHyphenState == STATE_CHECK ) - { - aHyphen.GetMinLead() = (sal_uInt8)aExtHyphenBeforeBox.GetValue(); - aHyphen.GetMinTrail() = (sal_uInt8)aExtHyphenAfterBox.GetValue(); - } - aHyphen.GetMaxHyphens() = (sal_uInt8)aMaxHyphenEdit.GetValue(); - - if ( !pOld || - !( *(SvxHyphenZoneItem*)pOld == aHyphen ) || - eHyphenState != aHyphenBox.GetSavedValue()) - { - rOutSet.Put( aHyphen ); - bModified = sal_True; - } - } - - if (aPagenumEdit.IsEnabled() && aPagenumEdit.IsValueModified()) - { - SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM, - (sal_uInt16)aPagenumEdit.GetValue() ); - - pOld = GetOldItem( rOutSet, SID_ATTR_PARA_PAGENUM ); - - if ( !pOld || ( (const SfxUInt16Item*)pOld )->GetValue() != aPageNum.GetValue() ) - { - rOutSet.Put( aPageNum ); - bModified = sal_True; - } - } - - // Seitenumbruch - - TriState eState = aApplyCollBtn.GetState(); - bool bIsPageModel = false; - - _nWhich = GetWhich( SID_ATTR_PARA_MODEL ); - String sPage; - if ( eState != aApplyCollBtn.GetSavedValue() || - ( STATE_CHECK == eState && - aApplyCollBox.GetSelectEntryPos() != aApplyCollBox.GetSavedValue() ) ) - { - if ( eState == STATE_CHECK ) - { - sPage = aApplyCollBox.GetSelectEntry(); - bIsPageModel = 0 != sPage.Len(); - } - pOld = GetOldItem( rOutSet, SID_ATTR_PARA_MODEL ); - - if ( !pOld || ( (const SvxPageModelItem*)pOld )->GetValue() != sPage ) - { - rOutSet.Put( SvxPageModelItem( sPage, sal_False, _nWhich ) ); - bModified = sal_True; - } - else - bIsPageModel = false; - } - else if(STATE_CHECK == eState && aApplyCollBtn.IsEnabled()) - bIsPageModel = true; - else - rOutSet.Put( SvxPageModelItem( sPage, sal_False, _nWhich ) ); - - _nWhich = GetWhich( SID_ATTR_PARA_PAGEBREAK ); - - if ( bIsPageModel ) - // wird PageModel eingeschaltet, dann immer PageBreak ausschalten - rOutSet.Put( SvxFmtBreakItem( SVX_BREAK_NONE, _nWhich ) ); - else - { - eState = aPageBreakBox.GetState(); - SfxItemState eModelState = GetItemSet().GetItemState(SID_ATTR_PARA_MODEL, sal_False); - - if ( (eModelState == SFX_ITEM_SET && STATE_CHECK == aPageBreakBox.GetState()) || - eState != aPageBreakBox.GetSavedValue() || - aBreakTypeLB.GetSelectEntryPos() != aBreakTypeLB.GetSavedValue() || - aBreakPositionLB.GetSelectEntryPos() != aBreakPositionLB.GetSavedValue() ) - { - const SvxFmtBreakItem rOldBreak( - (const SvxFmtBreakItem&)GetItemSet().Get( _nWhich )); - SvxFmtBreakItem aBreak(rOldBreak.GetBreak(), rOldBreak.Which()); - - switch ( eState ) - { - case STATE_CHECK: - { - sal_Bool bBefore = aBreakPositionLB.GetSelectEntryPos() == 0; - - if ( aBreakTypeLB.GetSelectEntryPos() == 0 ) - { - if ( bBefore ) - aBreak.SetValue( SVX_BREAK_PAGE_BEFORE ); - else - aBreak.SetValue( SVX_BREAK_PAGE_AFTER ); - } - else - { - if ( bBefore ) - aBreak.SetValue( SVX_BREAK_COLUMN_BEFORE ); - else - aBreak.SetValue( SVX_BREAK_COLUMN_AFTER ); - } - break; - } - - case STATE_NOCHECK: - aBreak.SetValue( SVX_BREAK_NONE ); - break; - default: ; //prevent warning - } - pOld = GetOldItem( rOutSet, SID_ATTR_PARA_PAGEBREAK ); - - if ( eState != aPageBreakBox.GetSavedValue() || - !pOld || !( *(const SvxFmtBreakItem*)pOld == aBreak ) ) - { - bModified = sal_True; - rOutSet.Put( aBreak ); - } - } - } - - - // Absatztrennung - _nWhich = GetWhich( SID_ATTR_PARA_SPLIT ); - eState = aKeepTogetherBox.GetState(); - - if ( eState != aKeepTogetherBox.GetSavedValue() ) - { - pOld = GetOldItem( rOutSet, SID_ATTR_PARA_SPLIT ); - - if ( !pOld || ( (const SvxFmtSplitItem*)pOld )->GetValue() != - ( eState == STATE_NOCHECK ) ) - { - rOutSet.Put( SvxFmtSplitItem( eState == STATE_NOCHECK, _nWhich ) ); - bModified = sal_True; - } - } - - // Absaetze zusammenhalten - _nWhich = GetWhich( SID_ATTR_PARA_KEEP ); - eState = aKeepParaBox.GetState(); - - if ( eState != aKeepParaBox.GetSavedValue() ) - { - pOld = GetOldItem( rOutSet, SID_ATTR_PARA_KEEP ); - - // hat sich der Status geaendert, muss immer geputtet werden - rOutSet.Put( SvxFmtKeepItem( eState == STATE_CHECK, _nWhich ) ); - bModified = sal_True; - } - - // Witwen und Waisen - _nWhich = GetWhich( SID_ATTR_PARA_WIDOWS ); - eState = aWidowBox.GetState(); - - if ( eState != aWidowBox.GetSavedValue() || - aWidowRowNo.IsValueModified() ) - { - SvxWidowsItem rItem( eState == STATE_CHECK ? - (sal_uInt8)aWidowRowNo.GetValue() : 0, _nWhich ); - pOld = GetOldItem( rOutSet, SID_ATTR_PARA_WIDOWS ); - - if ( eState != aWidowBox.GetSavedValue() || !pOld || !( *(const SvxWidowsItem*)pOld == rItem ) ) - { - rOutSet.Put( rItem ); - bModified = sal_True; - } - } - - _nWhich = GetWhich( SID_ATTR_PARA_ORPHANS ); - eState = aOrphanBox.GetState(); - - if ( eState != aOrphanBox.GetSavedValue() || - aOrphanRowNo.IsValueModified() ) - { - SvxOrphansItem rItem( eState == STATE_CHECK ? - (sal_uInt8)aOrphanRowNo.GetValue() : 0, _nWhich ); - pOld = GetOldItem( rOutSet, SID_ATTR_PARA_ORPHANS ); - - if ( eState != aOrphanBox.GetSavedValue() || - !pOld || - !( *(const SvxOrphansItem*)pOld == rItem ) ) - { - rOutSet.Put( rItem ); - bModified = sal_True; - } - } - - return bModified; -} - -// ----------------------------------------------------------------------- - -void SvxExtParagraphTabPage::Reset( const SfxItemSet& rSet ) -{ - sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE ); - SfxItemState eItemState = rSet.GetItemState( _nWhich ); - - sal_Bool bItemAvailable = eItemState >= SFX_ITEM_AVAILABLE; - sal_Bool bIsHyphen = sal_False; - if( !bHtmlMode && bItemAvailable ) - { - const SvxHyphenZoneItem& rHyphen = - (const SvxHyphenZoneItem&)rSet.Get( _nWhich ); - aHyphenBox.EnableTriState( sal_False ); - - bIsHyphen = rHyphen.IsHyphen(); - aHyphenBox.SetState( bIsHyphen ? STATE_CHECK : STATE_NOCHECK ); - - aExtHyphenBeforeBox.SetValue( rHyphen.GetMinLead() ); - aExtHyphenAfterBox.SetValue( rHyphen.GetMinTrail() ); - aMaxHyphenEdit.SetValue( rHyphen.GetMaxHyphens() ); - } - else - { - aHyphenBox.SetState( STATE_DONTKNOW ); - } - sal_Bool bEnable = bItemAvailable && bIsHyphen; - aExtHyphenBeforeBox.Enable(bEnable); - aExtHyphenAfterBox.Enable(bEnable); - aBeforeText.Enable(bEnable); - aAfterText.Enable(bEnable); - aMaxHyphenLabel.Enable(bEnable); - aMaxHyphenEdit.Enable(bEnable); - - _nWhich = GetWhich( SID_ATTR_PARA_PAGENUM ); - - if ( rSet.GetItemState(_nWhich) >= SFX_ITEM_AVAILABLE ) - { - const sal_uInt16 nPageNum = - ( (const SfxUInt16Item&)rSet.Get( _nWhich ) ).GetValue(); - aPagenumEdit.SetValue( nPageNum ); - } - - if ( bPageBreak ) - { - // zuerst PageModel behandeln - _nWhich = GetWhich( SID_ATTR_PARA_MODEL ); - sal_Bool bIsPageModel = sal_False; - eItemState = rSet.GetItemState( _nWhich ); - - if ( eItemState >= SFX_ITEM_SET ) - { - aApplyCollBtn.EnableTriState( sal_False ); - - const SvxPageModelItem& rModel = - (const SvxPageModelItem&)rSet.Get( _nWhich ); - String aStr( rModel.GetValue() ); - - if ( aStr.Len() && - aApplyCollBox.GetEntryPos( aStr ) != LISTBOX_ENTRY_NOTFOUND ) - { - aApplyCollBox.SelectEntry( aStr ); - aApplyCollBtn.SetState( STATE_CHECK ); - bIsPageModel = sal_True; - - aPageBreakBox.Enable(); - aPageBreakBox.EnableTriState( sal_False ); - aBreakTypeFT.Enable(); - aBreakTypeLB.Enable(); - aBreakPositionFT.Enable(); - aBreakPositionLB.Enable(); - aApplyCollBtn.Enable(); - aPageBreakBox.SetState( STATE_CHECK ); - - //select page break - aBreakTypeLB.SelectEntryPos(0); - //select break before - aBreakPositionLB.SelectEntryPos(0); - } - else - { - aApplyCollBox.SetNoSelection(); - aApplyCollBtn.SetState( STATE_NOCHECK ); - } - } - else if ( SFX_ITEM_DONTCARE == eItemState ) - { - aApplyCollBtn.EnableTriState( sal_True ); - aApplyCollBtn.SetState( STATE_DONTKNOW ); - aApplyCollBox.SetNoSelection(); - } - else - { - aApplyCollBtn.Enable(sal_False); - aApplyCollBox.Enable(sal_False); - aPagenumEdit.Enable(sal_False); - aPagenumText.Enable(sal_False); - } - - if ( !bIsPageModel ) - { - _nWhich = GetWhich( SID_ATTR_PARA_PAGEBREAK ); - eItemState = rSet.GetItemState( _nWhich ); - - if ( eItemState >= SFX_ITEM_AVAILABLE ) - { - const SvxFmtBreakItem& rPageBreak = - (const SvxFmtBreakItem&)rSet.Get( _nWhich ); - - SvxBreak eBreak = (SvxBreak)rPageBreak.GetValue(); - - // PageBreak nicht ueber CTRL-RETURN, - // dann kann CheckBox frei gegeben werden - aPageBreakBox.Enable(); - aPageBreakBox.EnableTriState( sal_False ); - aBreakTypeFT.Enable(); - aBreakTypeLB.Enable(); - aBreakPositionFT.Enable(); - aBreakPositionLB.Enable(); - - aPageBreakBox.SetState( STATE_CHECK ); - - sal_Bool _bEnable = eBreak != SVX_BREAK_NONE && - eBreak != SVX_BREAK_COLUMN_BEFORE && - eBreak != SVX_BREAK_COLUMN_AFTER; - aApplyCollBtn.Enable(_bEnable); - if(!_bEnable) - { - aApplyCollBox.Enable(_bEnable); - aPagenumEdit.Enable(_bEnable); - } - - if ( eBreak == SVX_BREAK_NONE ) - aPageBreakBox.SetState( STATE_NOCHECK ); - - sal_uInt16 nType = 0; // selection position in break type ListBox : Page - sal_uInt16 nPosition = 0; // selection position in break position ListBox : Before - switch ( eBreak ) - { - case SVX_BREAK_PAGE_BEFORE: - break; - case SVX_BREAK_PAGE_AFTER: - nPosition = 1; - break; - case SVX_BREAK_COLUMN_BEFORE: - nType = 1; - break; - case SVX_BREAK_COLUMN_AFTER: - nType = 1; - nPosition = 1; - break; - default: ;//prevent warning - } - aBreakTypeLB.SelectEntryPos(nType); - aBreakPositionLB.SelectEntryPos(nPosition); - } - else if ( SFX_ITEM_DONTCARE == eItemState ) - aPageBreakBox.SetState( STATE_DONTKNOW ); - else - { - aPageBreakBox.Enable(sal_False); - aBreakTypeFT.Enable(sal_False); - aBreakTypeLB.Enable(sal_False); - aBreakPositionFT.Enable(sal_False); - aBreakPositionLB.Enable(sal_False); - } - } - - PageBreakPosHdl_Impl( &aBreakPositionLB ); - PageBreakHdl_Impl( &aPageBreakBox ); - } - - _nWhich = GetWhich( SID_ATTR_PARA_KEEP ); - eItemState = rSet.GetItemState( _nWhich ); - - if ( eItemState >= SFX_ITEM_AVAILABLE ) - { - aKeepParaBox.EnableTriState( sal_False ); - const SvxFmtKeepItem& rKeep = - (const SvxFmtKeepItem&)rSet.Get( _nWhich ); - - if ( rKeep.GetValue() ) - aKeepParaBox.SetState( STATE_CHECK ); - else - aKeepParaBox.SetState( STATE_NOCHECK ); - } - else if ( SFX_ITEM_DONTCARE == eItemState ) - aKeepParaBox.SetState( STATE_DONTKNOW ); - else - aKeepParaBox.Enable(sal_False); - - _nWhich = GetWhich( SID_ATTR_PARA_SPLIT ); - eItemState = rSet.GetItemState( _nWhich ); - - if ( eItemState >= SFX_ITEM_AVAILABLE ) - { - const SvxFmtSplitItem& rSplit = - (const SvxFmtSplitItem&)rSet.Get( _nWhich ); - aKeepTogetherBox.EnableTriState( sal_False ); - - if ( !rSplit.GetValue() ) - aKeepTogetherBox.SetState( STATE_CHECK ); - else - { - aKeepTogetherBox.SetState( STATE_NOCHECK ); - - // Witwen und Waisen - aWidowBox.Enable(); - _nWhich = GetWhich( SID_ATTR_PARA_WIDOWS ); - SfxItemState eTmpState = rSet.GetItemState( _nWhich ); - - if ( eTmpState >= SFX_ITEM_AVAILABLE ) - { - const SvxWidowsItem& rWidow = - (const SvxWidowsItem&)rSet.Get( _nWhich ); - aWidowBox.EnableTriState( sal_False ); - const sal_uInt16 nLines = rWidow.GetValue(); - - sal_Bool _bEnable = nLines > 0; - aWidowRowNo.SetValue( aWidowRowNo.Normalize( nLines ) ); - aWidowBox.SetState( _bEnable ? STATE_CHECK : STATE_NOCHECK); - aWidowRowNo.Enable(_bEnable); - aWidowRowLabel.Enable(_bEnable); - - } - else if ( SFX_ITEM_DONTCARE == eTmpState ) - aWidowBox.SetState( STATE_DONTKNOW ); - else - aWidowBox.Enable(sal_False); - - aOrphanBox.Enable(); - _nWhich = GetWhich( SID_ATTR_PARA_ORPHANS ); - eTmpState = rSet.GetItemState( _nWhich ); - - if ( eTmpState >= SFX_ITEM_AVAILABLE ) - { - const SvxOrphansItem& rOrphan = - (const SvxOrphansItem&)rSet.Get( _nWhich ); - const sal_uInt16 nLines = rOrphan.GetValue(); - aOrphanBox.EnableTriState( sal_False ); - - sal_Bool _bEnable = nLines > 0; - aOrphanBox.SetState( _bEnable ? STATE_CHECK : STATE_NOCHECK); - aOrphanRowNo.SetValue( aOrphanRowNo.Normalize( nLines ) ); - aOrphanRowNo.Enable(_bEnable); - aOrphanRowLabel.Enable(_bEnable); - - } - else if ( SFX_ITEM_DONTCARE == eTmpState ) - aOrphanBox.SetState( STATE_DONTKNOW ); - else - aOrphanBox.Enable(sal_False); - } - } - else if ( SFX_ITEM_DONTCARE == eItemState ) - aKeepTogetherBox.SetState( STATE_DONTKNOW ); - else - aKeepTogetherBox.Enable(sal_False); - - // damit alles richt enabled wird - KeepTogetherHdl_Impl( 0 ); - WidowHdl_Impl( 0 ); - OrphanHdl_Impl( 0 ); - - aHyphenBox.SaveValue(); - aExtHyphenBeforeBox.SaveValue(); - aExtHyphenAfterBox.SaveValue(); - aMaxHyphenEdit.SaveValue(); - aPageBreakBox.SaveValue(); - aBreakPositionLB.SaveValue(); - aBreakTypeLB.SaveValue(); - aApplyCollBtn.SaveValue(); - aApplyCollBox.SaveValue(); - aPagenumEdit.SaveValue(); - aKeepTogetherBox.SaveValue(); - aKeepParaBox.SaveValue(); - aWidowBox.SaveValue(); - aOrphanBox.SaveValue(); -} - -// ----------------------------------------------------------------------- - -int SvxExtParagraphTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -void SvxExtParagraphTabPage::DisablePageBreak() -{ - bPageBreak = sal_False; - aPageBreakBox.Enable(sal_False); - aBreakTypeLB.RemoveEntry(0); - aBreakPositionFT.Enable(sal_False); - aBreakPositionLB.Enable(sal_False); - aApplyCollBtn.Enable(sal_False); - aApplyCollBox.Enable(sal_False); - aPagenumEdit.Enable(sal_False); -} - -// ----------------------------------------------------------------------- - -SvxExtParagraphTabPage::SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rAttr ) : - - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_EXT_PARAGRAPH ), rAttr ), - - aExtFL ( this, CUI_RES( FL_HYPHEN ) ), - aHyphenBox ( this, CUI_RES( BTN_HYPHEN ) ), - aBeforeText ( this, CUI_RES( FT_HYPHENBEFORE ) ), - aExtHyphenBeforeBox ( this, CUI_RES( ED_HYPHENBEFORE ) ), - aAfterText ( this, CUI_RES( FT_HYPHENAFTER ) ), - aExtHyphenAfterBox ( this, CUI_RES( ED_HYPHENAFTER ) ), - aMaxHyphenLabel ( this, CUI_RES( FT_MAXHYPH ) ), - aMaxHyphenEdit ( this, CUI_RES( ED_MAXHYPH ) ), - aBreaksFL ( this, CUI_RES( FL_BREAKS ) ), - aPageBreakBox ( this, CUI_RES( BTN_PAGEBREAK ) ), - aBreakTypeFT ( this, CUI_RES( FT_BREAKTYPE )), - aBreakTypeLB ( this, CUI_RES( LB_BREAKTYPE )), - aBreakPositionFT ( this, CUI_RES( FT_BREAKPOSITION )), - aBreakPositionLB ( this, CUI_RES( LB_BREAKPOSITION )), - aApplyCollBtn ( this, CUI_RES( BTN_PAGECOLL ) ), - aApplyCollBox ( this, CUI_RES( LB_PAGECOLL ) ), - aPagenumText ( this, CUI_RES( FT_PAGENUM ) ), - aPagenumEdit ( this, CUI_RES( ED_PAGENUM ) ), - aExtendFL ( this, CUI_RES( FL_OPTIONS ) ), - aKeepTogetherBox ( this, CUI_RES( BTN_KEEPTOGETHER ) ), - aKeepParaBox ( this, CUI_RES( CB_KEEPTOGETHER ) ), - aOrphanBox ( this, CUI_RES( BTN_ORPHANS ) ), - aOrphanRowNo ( this, CUI_RES( ED_ORPHANS ) ), - aOrphanRowLabel ( this, CUI_RES( FT_ORPHANS ) ), - aWidowBox ( this, CUI_RES( BTN_WIDOWS ) ), - aWidowRowNo ( this, CUI_RES( ED_WIDOWS ) ), - aWidowRowLabel ( this, CUI_RES( FT_WIDOWS ) ), - bPageBreak ( sal_True ), - bHtmlMode ( sal_False ), - nStdPos ( 0 ) -{ - FreeResource(); - - aApplyCollBox.SetAccessibleRelationLabeledBy(&aApplyCollBtn); - aApplyCollBox.SetAccessibleName(String(CUI_RES(STR_PAGE_STYLE))); - aOrphanRowNo.SetAccessibleRelationLabeledBy(&aOrphanBox); - aWidowRowNo.SetAccessibleRelationLabeledBy(&aWidowBox); - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - aHyphenBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, HyphenClickHdl_Impl ) ); - aPageBreakBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, PageBreakHdl_Impl ) ); - aKeepTogetherBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, KeepTogetherHdl_Impl ) ); - aWidowBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, WidowHdl_Impl ) ); - aOrphanBox.SetClickHdl( LINK( this, SvxExtParagraphTabPage, OrphanHdl_Impl ) ); - aApplyCollBtn.SetClickHdl( LINK( this, SvxExtParagraphTabPage, ApplyCollClickHdl_Impl ) ); - aBreakTypeLB.SetSelectHdl( LINK( this, SvxExtParagraphTabPage, PageBreakTypeHdl_Impl ) ); - aBreakPositionLB.SetSelectHdl( LINK( this, SvxExtParagraphTabPage, PageBreakPosHdl_Impl ) ); - - SfxObjectShell* pSh = SfxObjectShell::Current(); - if ( pSh ) - { - SfxStyleSheetBasePool* pPool = pSh->GetStyleSheetPool(); - pPool->SetSearchMask( SFX_STYLE_FAMILY_PAGE ); - SfxStyleSheetBase* pStyle = pPool->First(); - String aStdName; - - while( pStyle ) - { - if ( aStdName.Len() == 0 ) - // first style == standard style - aStdName = pStyle->GetName(); - aApplyCollBox.InsertEntry( pStyle->GetName() ); - pStyle = pPool->Next(); - } - nStdPos = aApplyCollBox.GetEntryPos( aStdName ); - } - - sal_uInt16 nHtmlMode = GetHtmlMode_Impl( rAttr ); - if ( nHtmlMode & HTMLMODE_ON ) - { - bHtmlMode = sal_True; - aHyphenBox .Enable(sal_False); - aBeforeText .Enable(sal_False); - aExtHyphenBeforeBox .Enable(sal_False); - aAfterText .Enable(sal_False); - aExtHyphenAfterBox .Enable(sal_False); - aMaxHyphenLabel .Enable(sal_False); - aMaxHyphenEdit .Enable(sal_False); - aExtFL .Enable(sal_False); - aPagenumText .Enable(sal_False); - aPagenumEdit .Enable(sal_False); - // no column break in HTML - aBreakTypeLB.RemoveEntry(1); - } -} - -// ----------------------------------------------------------------------- - -SvxExtParagraphTabPage::~SvxExtParagraphTabPage() -{ -} - -// ----------------------------------------------------------------------- - -sal_uInt16* SvxExtParagraphTabPage::GetRanges() -{ - return pExtRanges; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxExtParagraphTabPage, PageBreakHdl_Impl, TriStateBox *, EMPTYARG ) -{ - switch ( aPageBreakBox.GetState() ) - { - case STATE_CHECK: - aBreakTypeFT.Enable(); - aBreakTypeLB.Enable(); - aBreakPositionFT.Enable(); - aBreakPositionLB.Enable(); - - if ( 0 == aBreakTypeLB.GetSelectEntryPos()&& - 0 == aBreakPositionLB.GetSelectEntryPos() ) - { - aApplyCollBtn.Enable(); - - sal_Bool bEnable = STATE_CHECK == aApplyCollBtn.GetState() && - aApplyCollBox.GetEntryCount(); - aApplyCollBox.Enable(bEnable); - if(!bHtmlMode) - { - aPagenumText.Enable(bEnable); - aPagenumEdit.Enable(bEnable); - } - } - break; - - case STATE_NOCHECK: - case STATE_DONTKNOW: - aApplyCollBtn.SetState( STATE_NOCHECK ); - aApplyCollBtn.Enable(sal_False); - aApplyCollBox.Enable(sal_False); - aPagenumText.Enable(sal_False); - aPagenumEdit.Enable(sal_False); - aBreakTypeFT.Enable(sal_False); - aBreakTypeLB.Enable(sal_False); - aBreakPositionFT.Enable(sal_False); - aBreakPositionLB.Enable(sal_False); - break; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxExtParagraphTabPage, KeepTogetherHdl_Impl, TriStateBox *, EMPTYARG ) -{ - sal_Bool bEnable = aKeepTogetherBox.GetState() == STATE_NOCHECK; - aWidowBox.Enable(bEnable); - aOrphanBox.Enable(bEnable); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxExtParagraphTabPage, WidowHdl_Impl, TriStateBox *, EMPTYARG ) -{ - switch ( aWidowBox.GetState() ) - { - case STATE_CHECK: - aWidowRowNo.Enable(); - aWidowRowLabel.Enable(); - aKeepTogetherBox.Enable(sal_False); - break; - - case STATE_NOCHECK: - if ( aOrphanBox.GetState() == STATE_NOCHECK ) - aKeepTogetherBox.Enable(); - - // kein break - case STATE_DONTKNOW: - aWidowRowNo.Enable(sal_False); - aWidowRowLabel.Enable(sal_False); - break; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxExtParagraphTabPage, OrphanHdl_Impl, TriStateBox *, EMPTYARG ) -{ - switch( aOrphanBox.GetState() ) - { - case STATE_CHECK: - aOrphanRowNo.Enable(); - aOrphanRowLabel.Enable(); - aKeepTogetherBox.Enable(sal_False); - break; - - case STATE_NOCHECK: - if ( aWidowBox.GetState() == STATE_NOCHECK ) - aKeepTogetherBox.Enable(); - - // kein break - case STATE_DONTKNOW: - aOrphanRowNo.Enable(sal_False); - aOrphanRowLabel.Enable(sal_False); - break; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxExtParagraphTabPage, HyphenClickHdl_Impl, TriStateBox *, EMPTYARG ) -{ - - sal_Bool bEnable = aHyphenBox.GetState() == STATE_CHECK; - aBeforeText.Enable(bEnable); - aExtHyphenBeforeBox.Enable(bEnable); - aAfterText.Enable(bEnable); - aExtHyphenAfterBox.Enable(bEnable); - aMaxHyphenLabel.Enable(bEnable); - aMaxHyphenEdit.Enable(bEnable); - aHyphenBox.SetState( bEnable ? STATE_CHECK : STATE_NOCHECK); - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxExtParagraphTabPage, ApplyCollClickHdl_Impl, TriStateBox *, EMPTYARG ) -{ - sal_Bool bEnable = sal_False; - if ( aApplyCollBtn.GetState() == STATE_CHECK && - aApplyCollBox.GetEntryCount() ) - { - bEnable = sal_True; - aApplyCollBox.SelectEntryPos( nStdPos ); - } - else - { - aApplyCollBox.SetNoSelection(); - } - aApplyCollBox.Enable(bEnable); - if(!bHtmlMode) - { - aPagenumText.Enable(bEnable); - aPagenumEdit.Enable(bEnable); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox ) -{ - if ( 0 == pListBox->GetSelectEntryPos() ) - { - aApplyCollBtn.Enable(); - - sal_Bool bEnable = aApplyCollBtn.GetState() == STATE_CHECK && - aApplyCollBox.GetEntryCount(); - - aApplyCollBox.Enable(bEnable); - if(!bHtmlMode) - { - aPagenumText.Enable(bEnable); - aPagenumEdit.Enable(bEnable); - } - } - else if ( 1 == pListBox->GetSelectEntryPos() ) - { - aApplyCollBtn.SetState( STATE_NOCHECK ); - aApplyCollBtn.Enable(sal_False); - aApplyCollBox.Enable(sal_False); - aPagenumText.Enable(sal_False); - aPagenumEdit.Enable(sal_False); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox ) -{ - //column break or break break after - sal_uInt16 nBreakPos = aBreakPositionLB.GetSelectEntryPos(); - if ( pListBox->GetSelectEntryPos() == 1 || 1 == nBreakPos) - { - aApplyCollBtn.SetState( STATE_NOCHECK ); - aApplyCollBtn.Enable(sal_False); - aApplyCollBox.Enable(sal_False); - aPagenumText.Enable(sal_False); - aPagenumEdit.Enable(sal_False); - } - else - PageBreakPosHdl_Impl( &aBreakPositionLB ); - return 0; -} - -void SvxExtParagraphTabPage::PageCreated(SfxAllItemSet aSet) -{ - - - SFX_ITEMSET_ARG (&aSet,pDisablePageBreakItem,SfxBoolItem,SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,sal_False); - - if (pDisablePageBreakItem) - if ( pDisablePageBreakItem->GetValue()) - DisablePageBreak(); - - -} - -SvxAsianTabPage::SvxAsianTabPage( Window* pParent, const SfxItemSet& rSet ) : - SfxTabPage(pParent, CUI_RES( RID_SVXPAGE_PARA_ASIAN ), rSet), - aOptionsFL( this, CUI_RES(FL_AS_OPTIONS )), - aForbiddenRulesCB( this, CUI_RES(CB_AS_FORBIDDEN )), - aHangingPunctCB( this, CUI_RES(CB_AS_HANG_PUNC )), - aScriptSpaceCB( this, CUI_RES(CB_AS_SCRIPT_SPACE ))//, - -{ - FreeResource(); - - Link aLink = LINK( this, SvxAsianTabPage, ClickHdl_Impl ); - aHangingPunctCB.SetClickHdl( aLink ); - aScriptSpaceCB.SetClickHdl( aLink ); - aForbiddenRulesCB.SetClickHdl( aLink ); - -} - -SvxAsianTabPage::~SvxAsianTabPage() -{ -} - -SfxTabPage* SvxAsianTabPage::Create( Window* pParent, const SfxItemSet& rSet ) -{ - return new SvxAsianTabPage(pParent, rSet); -} - -sal_uInt16* SvxAsianTabPage::GetRanges() -{ - static sal_uInt16 pRanges[] = - { - SID_ATTR_PARA_SCRIPTSPACE, SID_ATTR_PARA_FORBIDDEN_RULES, - 0 - }; - return pRanges; -} - -sal_Bool SvxAsianTabPage::FillItemSet( SfxItemSet& rSet ) -{ - sal_Bool bRet = sal_False; - SfxItemPool* pPool = rSet.GetPool(); - if(aScriptSpaceCB.IsChecked() != aScriptSpaceCB.GetSavedValue()) - { - SfxBoolItem* pNewItem = (SfxBoolItem*)rSet.Get( - pPool->GetWhich(SID_ATTR_PARA_SCRIPTSPACE)).Clone(); - pNewItem->SetValue(aScriptSpaceCB.IsChecked()); - rSet.Put(*pNewItem); - delete pNewItem; - bRet = sal_True; - } - if(aHangingPunctCB.IsChecked() != aHangingPunctCB.GetSavedValue()) - { - SfxBoolItem* pNewItem = (SfxBoolItem*)rSet.Get( - pPool->GetWhich(SID_ATTR_PARA_HANGPUNCTUATION)).Clone(); - pNewItem->SetValue(aHangingPunctCB.IsChecked()); - rSet.Put(*pNewItem); - delete pNewItem; - bRet = sal_True; - } - if(aForbiddenRulesCB.IsChecked() != aForbiddenRulesCB.GetSavedValue()) - { - SfxBoolItem* pNewItem = (SfxBoolItem*)rSet.Get( - pPool->GetWhich(SID_ATTR_PARA_FORBIDDEN_RULES)).Clone(); - pNewItem->SetValue(aForbiddenRulesCB.IsChecked()); - rSet.Put(*pNewItem); - delete pNewItem; - bRet = sal_True; - } - return bRet; -} - -void lcl_SetBox(const SfxItemSet& rSet, sal_uInt16 nSlotId, TriStateBox& rBox) -{ - sal_uInt16 _nWhich = rSet.GetPool()->GetWhich(nSlotId); - SfxItemState eState = rSet.GetItemState(_nWhich, sal_True); - if(!eState || eState == SFX_ITEM_DISABLED ) - rBox.Enable(sal_False); - else if(eState >= SFX_ITEM_AVAILABLE) - { - rBox.EnableTriState( sal_False ); - rBox.Check(((const SfxBoolItem&)rSet.Get(_nWhich)).GetValue()); - } - else - rBox.SetState( STATE_DONTKNOW ); - rBox.SaveValue(); -} - - -void SvxAsianTabPage::Reset( const SfxItemSet& rSet ) -{ - lcl_SetBox(rSet, SID_ATTR_PARA_FORBIDDEN_RULES, aForbiddenRulesCB ); - lcl_SetBox(rSet, SID_ATTR_PARA_HANGPUNCTUATION, aHangingPunctCB ); - - //character distance not yet available - lcl_SetBox(rSet, SID_ATTR_PARA_SCRIPTSPACE, aScriptSpaceCB ); -} - -IMPL_LINK( SvxAsianTabPage, ClickHdl_Impl, TriStateBox*, pBox ) -{ - pBox->EnableTriState( sal_False ); - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/paragrph.hrc b/cui/source/tabpages/paragrph.hrc deleted file mode 100644 index d831d447f..000000000 --- a/cui/source/tabpages/paragrph.hrc +++ /dev/null @@ -1,125 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_PARAGRPH_HRC -#define _SVX_PARAGRPH_HRC - -// StandardTabPage ---------------------------------------------------------- - -#define FT_LEFTINDENT 10 -#define ED_LEFTINDENT 11 -#define FT_FLINEINDENT 12 -#define ED_FLINEINDENT 13 -#define FT_RIGHTINDENT 14 -#define ED_RIGHTINDENT 15 -#define FL_INDENT 16 - -#define FT_TOPDIST 20 -#define ED_TOPDIST 21 -#define FT_BOTTOMDIST 22 -#define ED_BOTTOMDIST 23 -#define FL_DIST 24 - -#define BTN_LEFTALIGN 30 -#define BTN_RIGHTALIGN 31 -#define BTN_CENTERALIGN 32 -#define BTN_JUSTIFYALIGN 33 -#define FL_ALIGN 34 -#define FL_VERTALIGN 35 -#define LB_VERTALIGN 36 -#define FL_VERTEX 37 -#define CB_SNAP 38 -#define FT_VERTALIGN 39 - - -#define LB_LINEDIST 40 -#define FT_LINEDIST 41 -#define ED_LINEDISTPERCENT 42 -#define ED_LINEDISTMETRIC 43 -#define FL_LINEDIST 44 -#define WN_EXAMPLE 46 - -#define CB_AUTO 48 -#define FT_LASTLINE 49 -#define LB_LASTLINE 50 -#define CB_EXPAND 51 -#define ST_LINEDIST_ABS 52 -#define ST_LEFTALIGN_ASIAN 53 -#define ST_RIGHTALIGN_ASIAN 54 - -// ExtendedTabPage ---------------------------------------------------------- - -#define BTN_HYPHEN 50 -#define ED_HYPHENBEFORE 52 -#define FT_HYPHENBEFORE 53 -#define ED_HYPHENAFTER 55 -#define FT_HYPHENAFTER 56 -#define FL_HYPHEN 57 - -#define BTN_PAGEBREAK 60 -#define FT_BREAKTYPE 61 -#define LB_BREAKTYPE 62 -#define FT_BREAKPOSITION 63 -#define LB_BREAKPOSITION 64 -#define BTN_PAGECOLL 65 -#define LB_PAGECOLL 66 -#define BTN_KEEPTOGETHER 67 -#define BTN_WIDOWS 68 -#define ED_WIDOWS 69 -#define FT_WIDOWS 70 -#define BTN_ORPHANS 71 -#define ED_ORPHANS 72 -#define FT_ORPHANS 73 -#define FL_OPTIONS 74 -#define FT_PAGENUM 75 -#define ED_PAGENUM 76 -#define FL_BREAKS 77 - -#define CB_KEEPTOGETHER 80 -#define FT_MAXHYPH 81 -#define ED_MAXHYPH 83 - -#define CB_REGISTER 84 -#define FL_REGISTER 85 -#define FL_PROPERTIES 90 -#define FT_TEXTDIRECTION 91 -#define LB_TEXTDIRECTION 92 - - -//asian typography -#define FL_AS_OPTIONS 1 -#define CB_AS_HANG_PUNC 2 - -#define CB_AS_FORBIDDEN 4 - -#define CB_AS_SCRIPT_SPACE 7 - -//IAccessibility2 Implementation 2009----- -#define STR_EXAMPLE 5010 -#define STR_PAGE_STYLE 5011 -//-----IAccessibility2 Implementation 2009 -#endif - diff --git a/cui/source/tabpages/paragrph.src b/cui/source/tabpages/paragrph.src deleted file mode 100644 index 46dfb5cdf..000000000 --- a/cui/source/tabpages/paragrph.src +++ /dev/null @@ -1,742 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <cuires.hrc> -#include "helpid.hrc" -#include "paragrph.hrc" -#include <svx/dialogs.hrc> - - // RID_SVXPAGE_STD_PARAGRAPH --------------------------------------------- -TabPage RID_SVXPAGE_STD_PARAGRAPH -{ - HelpId = HID_FORMAT_PARAGRAPH_STD ; - Hide = TRUE ; - Text [ en-US ] = "Indents and Spacing" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedText FT_LEFTINDENT - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "Before text" ; - }; - MetricField ED_LEFTINDENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_STD_PARAGRAPH:ED_LEFTINDENT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 135 , 14 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_RIGHTINDENT - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "After text" ; - }; - MetricField ED_RIGHTINDENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_STD_PARAGRAPH:ED_RIGHTINDENT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 135 , 30 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_FLINEINDENT - { - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "~First line" ; - Left = TRUE ; - }; - MetricField ED_FLINEINDENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_STD_PARAGRAPH:ED_FLINEINDENT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 135 , 46 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -9999 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = -9999 ; - Last = 9999 ; - SpinSize = 10 ; - }; - CheckBox CB_AUTO - { - HelpID = "cui:CheckBox:RID_SVXPAGE_STD_PARAGRAPH:CB_AUTO"; - Pos = MAP_APPFONT ( 12 , 61 ) ; - Size = MAP_APPFONT ( 120 , 10 ) ; - Hide = TRUE ; - Text [ en-US ] = "~Automatic" ; - }; - FixedLine FL_INDENT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 173 , 8 ) ; - Text [ en-US ] = "Indent" ; - }; - FixedText FT_TOPDIST - { - Pos = MAP_APPFONT ( 12 , 90 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "Ab~ove paragraph" ; - }; - MetricField ED_TOPDIST - { - HelpID = "cui:MetricField:RID_SVXPAGE_STD_PARAGRAPH:ED_TOPDIST"; - Border = TRUE ; - Pos = MAP_APPFONT ( 135 , 88 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_BOTTOMDIST - { - Pos = MAP_APPFONT ( 12 , 104 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "Below paragraph" ; - }; - MetricField ED_BOTTOMDIST - { - HelpID = "cui:MetricField:RID_SVXPAGE_STD_PARAGRAPH:ED_BOTTOMDIST"; - Border = TRUE ; - Pos = MAP_APPFONT ( 135 , 104 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedLine FL_DIST - { - Pos = MAP_APPFONT ( 6 , 77 ) ; - Size = MAP_APPFONT ( 173 , 8 ) ; - Text [ en-US ] = "Spacing" ; - }; - ListBox LB_LINEDIST - { - HelpID = "cui:ListBox:RID_SVXPAGE_STD_PARAGRAPH:LB_LINEDIST"; - Pos = MAP_APPFONT ( 12 , 133 ) ; - Size = MAP_APPFONT ( 55 , 72 ) ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Single" ; Default ; > ; - < "1.5 lines" ; Default ; > ; - < "Double" ; Default ; > ; - < "Proportional" ; Default ; > ; - < "At least" ; Default ; > ; - < "Leading" ; Default ; > ; - }; - }; - String ST_LINEDIST_ABS - { - Text [ en-US ] = "Fixed" ; - }; - FixedText FT_LINEDIST - { - Disable = TRUE ; - Pos = MAP_APPFONT ( 70 , 135 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "of" ; - Left = TRUE ; - }; - MetricField ED_LINEDISTPERCENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_STD_PARAGRAPH:ED_LINEDISTPERCENT"; - Disable = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 135 , 133 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 50 ; - Maximum = 200 ; - Value = 100 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - First = 50 ; - Last = 200 ; - SpinSize = 1 ; - }; - MetricField ED_LINEDISTMETRIC - { - HelpID = "cui:MetricField:RID_SVXPAGE_STD_PARAGRAPH:ED_LINEDISTMETRIC"; - Disable = TRUE ; - Border = TRUE ; - Hide = TRUE ; - Pos = MAP_APPFONT ( 135 , 133 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedLine FL_LINEDIST - { - Pos = MAP_APPFONT ( 6 , 122 ) ; - Size = MAP_APPFONT ( 173 , 8 ) ; - Text [ en-US ] = "Line spacing" ; - }; - Window WN_EXAMPLE - { - Border = TRUE ; - Pos = MAP_APPFONT ( 185 , 7 ) ; - Size = MAP_APPFONT ( 68 , 112 ) ; - }; - CheckBox CB_REGISTER - { - HelpID = "cui:CheckBox:RID_SVXPAGE_STD_PARAGRAPH:CB_REGISTER"; - Pos = MAP_APPFONT ( 12 , 162 ) ; - Size = MAP_APPFONT ( 120 , 10 ) ; - Hide = TRUE ; - Text [ en-US ] = "A~ctivate" ; - }; - FixedLine FL_REGISTER - { - Pos = MAP_APPFONT ( 6 , 151 ) ; - Size = MAP_APPFONT ( 173 , 8 ) ; - Hide = TRUE ; - Text [ en-US ] = "Register-true" ; - }; - -}; - // RID_SVXPAGE_ALIGN_PARAGRAPH --------------------------------------------- -TabPage RID_SVXPAGE_ALIGN_PARAGRAPH -{ - HelpId = HID_FORMAT_PARAGRAPH_ALIGN ; - Hide = TRUE ; - Text [ en-US ] = "Alignment" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_ALIGN - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 173 , 8 ) ; - Text [ en-US ] = "Options" ; - Group = TRUE ; - }; - RadioButton BTN_LEFTALIGN - { - HelpID = "cui:RadioButton:RID_SVXPAGE_ALIGN_PARAGRAPH:BTN_LEFTALIGN"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 161 , 10 ) ; - Text [ en-US ] = "~Left" ; - Group = TRUE ; - }; - RadioButton BTN_RIGHTALIGN - { - HelpID = "cui:RadioButton:RID_SVXPAGE_ALIGN_PARAGRAPH:BTN_RIGHTALIGN"; - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 161 , 10 ) ; - Text [ en-US ] = "Righ~t" ; - }; - RadioButton BTN_CENTERALIGN - { - HelpID = "cui:RadioButton:RID_SVXPAGE_ALIGN_PARAGRAPH:BTN_CENTERALIGN"; - Pos = MAP_APPFONT ( 12 , 42 ) ; - Size = MAP_APPFONT ( 161 , 10 ) ; - Text [ en-US ] = "~Center" ; - }; - RadioButton BTN_JUSTIFYALIGN - { - HelpID = "cui:RadioButton:RID_SVXPAGE_ALIGN_PARAGRAPH:BTN_JUSTIFYALIGN"; - Pos = MAP_APPFONT ( 12 , 56 ) ; - Size = MAP_APPFONT ( 161 , 10 ) ; - Text [ en-US ] = "Justified" ; - }; - String ST_LEFTALIGN_ASIAN - { - Text [ en-US ] = "~Left/Top" ; - }; - String ST_RIGHTALIGN_ASIAN - { - Text [ en-US ] = "Righ~t/Bottom" ; - }; - FixedText FT_LASTLINE - { - Pos = MAP_APPFONT ( 20 , 72 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Hide = TRUE ; - Text [ en-US ] = "~Last line" ; - }; - ListBox LB_LASTLINE - { - HelpID = "cui:ListBox:RID_SVXPAGE_ALIGN_PARAGRAPH:LB_LASTLINE"; - Pos = MAP_APPFONT ( 105 , 70 ) ; - Size = MAP_APPFONT ( 70 , 50 ) ; - DropDown = TRUE ; - Hide = TRUE ; - StringList [ en-US ] = - { - < "Default" ; Default ; > ; - < "Left" ; Default ; > ; - < "Centered" ; Default ; > ; - < "Justified"; Default; > ; - }; - }; - CheckBox CB_EXPAND - { - HelpID = "cui:CheckBox:RID_SVXPAGE_ALIGN_PARAGRAPH:CB_EXPAND"; - Pos = MAP_APPFONT ( 20 , 86 ) ; - Size = MAP_APPFONT ( 153 , 10 ) ; - Hide = TRUE ; - Text [ en-US ] = "~Expand single word" ; - }; - CheckBox CB_SNAP - { - HelpID = "cui:CheckBox:RID_SVXPAGE_ALIGN_PARAGRAPH:CB_SNAP"; - Pos = MAP_APPFONT ( 20 , 100 ) ; - Size = MAP_APPFONT ( 153 , 10 ) ; - Hide = TRUE ; - Text [ en-US ] = "Snap to text grid (if active)"; - }; - Window WN_EXAMPLE - { - Border = TRUE ; - Pos = MAP_APPFONT ( 185 , 7 ) ; - Size = MAP_APPFONT ( 68 , 112 ) ; - }; - FixedLine FL_VERTALIGN - { - Pos = MAP_APPFONT ( 6 , 122 ) ; - Size = MAP_APPFONT ( 173 , 8 ) ; - Hide = TRUE; - Text [ en-US ] = "Text-to-text"; - }; - FixedText FT_VERTALIGN - { - Pos = MAP_APPFONT ( 12 , 135 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Hide = TRUE; - Text [ en-US ] = "~Alignment"; - }; - ListBox LB_VERTALIGN - { - HelpID = "cui:ListBox:RID_SVXPAGE_ALIGN_PARAGRAPH:LB_VERTALIGN"; - Pos = MAP_APPFONT ( 105 , 133 ) ; - Size = MAP_APPFONT ( 70 , 50 ) ; - DropDown = TRUE ; - Hide = TRUE ; - StringList [ en-US ] = - { - < "Automatic" ; > ; - < "Base line" ; > ; - < "Top" ; > ; - < "Middle" ; > ; - < "Bottom" ; > ; - }; - }; - FixedLine FL_PROPERTIES - { - Pos = MAP_APPFONT ( 6 , 154 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Hide = TRUE ; - Text [ en-US ] = "Properties"; - }; - FixedText FT_TEXTDIRECTION - { - Pos = MAP_APPFONT ( 12 , 167 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Hide = TRUE ; - Text [ en-US ] = "Text ~direction"; - }; - ListBox LB_TEXTDIRECTION - { - HelpID = "cui:ListBox:RID_SVXPAGE_ALIGN_PARAGRAPH:LB_TEXTDIRECTION"; - Border = TRUE ; - Pos = MAP_APPFONT ( 105 , 165 ) ; - Size = MAP_APPFONT ( 146 , 50 ) ; - DropDown = TRUE ; - Hide = TRUE ; - }; -}; - // RID_SVXPAGE_EXT_PARAGRAPH --------------------------------------------- -TabPage RID_SVXPAGE_EXT_PARAGRAPH -{ - HelpId = HID_FORMAT_PARAGRAPH_EXT ; - Hide = TRUE ; - Text [ en-US ] = "Text Flow" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - TriStateBox BTN_HYPHEN - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_EXT_PARAGRAPH:BTN_HYPHEN"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 236 , 10 ) ; - Text [ en-US ] = "A~utomatically" ; - }; - NumericField ED_HYPHENBEFORE - { - HelpID = "cui:NumericField:RID_SVXPAGE_EXT_PARAGRAPH:ED_HYPHENBEFORE"; - Disable = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 21 , 26 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 2 ; - Maximum = 9 ; - Value = 2 ; - First = 2 ; - Last = 9 ; - }; - FixedText FT_HYPHENBEFORE - { - Disable = TRUE ; - Pos = MAP_APPFONT ( 48 , 29 ) ; - Size = MAP_APPFONT ( 200 , 8 ) ; - Text [ en-US ] = "C~haracters at line end" ; - Left = TRUE ; - }; - NumericField ED_HYPHENAFTER - { - HelpID = "cui:NumericField:RID_SVXPAGE_EXT_PARAGRAPH:ED_HYPHENAFTER"; - Disable = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 21 , 41 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 2 ; - Maximum = 9 ; - Value = 2 ; - First = 2 ; - Last = 9 ; - }; - FixedText FT_HYPHENAFTER - { - Disable = TRUE ; - Pos = MAP_APPFONT ( 48 , 43 ) ; - Size = MAP_APPFONT ( 200 , 8 ) ; - Text [ en-US ] = "Cha~racters at line begin" ; - Left = TRUE ; - }; - FixedText FT_MAXHYPH - { - Pos = MAP_APPFONT ( 48 , 57 ) ; - Size = MAP_APPFONT ( 200 , 8 ) ; - WordBreak = TRUE ; - Text [ en-US ] = "~Maximum number of consecutive hyphens" ; - }; - NumericField ED_MAXHYPH - { - HelpID = "cui:NumericField:RID_SVXPAGE_EXT_PARAGRAPH:ED_MAXHYPH"; - Border = TRUE ; - Pos = MAP_APPFONT ( 21 , 55 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 99 ; - Last = 99 ; - }; - FixedLine FL_HYPHEN - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Hyphenation" ; - }; - FixedLine FL_OPTIONS - { // is moved one section deeper to not raise unnecessary translations - Pos = MAP_APPFONT ( 6 , 116 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Options" ; - Group = TRUE ; - }; - FixedLine FL_BREAKS - { - Pos = MAP_APPFONT ( 6 , 73 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Breaks" ; - Group = TRUE ; - }; - TriStateBox BTN_PAGEBREAK - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_EXT_PARAGRAPH:BTN_PAGEBREAK"; - // Disable = TRUE; - Pos = MAP_APPFONT ( 12 , 86 ) ; - Size = MAP_APPFONT ( 61 , 10 ) ; - Text [ en-US ] = "Insert" ; - Group = TRUE ; - }; - FixedText FT_BREAKTYPE - { - Pos = MAP_APPFONT ( 75 , 86 ) ; - Size = MAP_APPFONT ( 21 , 10 ) ; - Text [ en-US ] = "~Type"; - }; - ListBox LB_BREAKTYPE - { - HelpID = "cui:ListBox:RID_SVXPAGE_EXT_PARAGRAPH:LB_BREAKTYPE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 98 , 84 ) ; - Size = MAP_APPFONT ( 61 , 50 ) ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Page" ; 0; > ; - < "Column" ; 1; > ; - }; - }; - FixedText FT_BREAKPOSITION - { - Pos = MAP_APPFONT ( 163 , 86 ) ; - Size = MAP_APPFONT ( 45 , 10 ) ; - Right = TRUE; - Text [ en-US ] = "Position"; - }; - ListBox LB_BREAKPOSITION - { - HelpID = "cui:ListBox:RID_SVXPAGE_EXT_PARAGRAPH:LB_BREAKPOSITION"; - Border = TRUE ; - Pos = MAP_APPFONT ( 211 , 84 ) ; - Size = MAP_APPFONT ( 40 , 50 ) ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Before" ; 0; > ; - < "After" ; 1; > ; - }; - }; - TriStateBox BTN_PAGECOLL - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_EXT_PARAGRAPH:BTN_PAGECOLL"; - // Disable = TRUE; - Pos = MAP_APPFONT (21 , 100 ) ; - Size = MAP_APPFONT ( 75 , 10 ) ; - Text [ en-US ] = "With Page St~yle" ; - Group = TRUE ; - }; - ListBox LB_PAGECOLL - { - HelpID = "cui:ListBox:RID_SVXPAGE_EXT_PARAGRAPH:LB_PAGECOLL"; - // Disable = TRUE; - Pos = MAP_APPFONT ( 98 , 98 ) ; - Size = MAP_APPFONT ( 61 , 50 ) ; - DropDown = TRUE ; - Sort = TRUE; - }; - FixedText FT_PAGENUM - { - Pos = MAP_APPFONT ( 163 , 100 ) ; - Size = MAP_APPFONT ( 45 , 8 ) ; - Right = TRUE ; - Text [ en-US ] = "Page ~number" ; - }; - NumericField ED_PAGENUM - { - HelpID = "cui:NumericField:RID_SVXPAGE_EXT_PARAGRAPH:ED_PAGENUM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 211 , 98 ) ; - Size = MAP_APPFONT ( 26 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 9999 ; - Value = 0 ; - First = 0 ; - Last = 9999 ; - }; - TriStateBox BTN_KEEPTOGETHER - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_EXT_PARAGRAPH:BTN_KEEPTOGETHER"; - Pos = MAP_APPFONT ( 12 , 127 ) ; - Size = MAP_APPFONT ( 236 , 10 ) ; - Text [ en-US ] = "~Do not split paragraph" ; - Group = TRUE ; - }; - TriStateBox CB_KEEPTOGETHER - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_EXT_PARAGRAPH:CB_KEEPTOGETHER"; - Pos = MAP_APPFONT ( 12, 141 ) ; - Size = MAP_APPFONT ( 236 , 10 ) ; - Text [ en-US ] = "~Keep with next paragraph" ; - }; - TriStateBox BTN_ORPHANS - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_EXT_PARAGRAPH:BTN_ORPHANS"; - Disable = TRUE ; - Pos = MAP_APPFONT ( 12 , 155 ) ; - Size = MAP_APPFONT ( 120 , 10 ) ; - Group = TRUE ; - Text [ en-US ] = "~Orphan control"; - }; - NumericField ED_ORPHANS - { - HelpID = "cui:NumericField:RID_SVXPAGE_EXT_PARAGRAPH:ED_ORPHANS"; - Disable = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 134 , 153 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 2 ; - Maximum = 9 ; - Value = 2 ; - First = 2 ; - Last = 9 ; - }; - FixedText FT_ORPHANS - { - Disable = TRUE ; - Pos = MAP_APPFONT ( 161 , 155 ) ; - Size = MAP_APPFONT ( 86 , 8 ) ; - Text [ en-US ] = "Lines" ; - Left = TRUE ; - }; - TriStateBox BTN_WIDOWS - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_EXT_PARAGRAPH:BTN_WIDOWS"; - Disable = TRUE ; - Pos = MAP_APPFONT ( 12 , 169 ) ; - Size = MAP_APPFONT ( 120 , 10 ) ; - Group = TRUE ; - Text [ en-US ] = "~Widow control"; - }; - NumericField ED_WIDOWS - { - HelpID = "cui:NumericField:RID_SVXPAGE_EXT_PARAGRAPH:ED_WIDOWS"; - Disable = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 134 , 167 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 2 ; - Maximum = 9 ; - Value = 2 ; - First = 2 ; - Last = 9 ; - }; - FixedText FT_WIDOWS - { - Disable = TRUE ; - Pos = MAP_APPFONT ( 161 , 169 ) ; - Size = MAP_APPFONT ( 86 , 8 ) ; - Text [ en-US ] = "Lines" ; - Left = TRUE ; - }; -}; - -// Asian typography -TabPage RID_SVXPAGE_PARA_ASIAN -{ - HelpId = HID_SVXPAGE_PARA_ASIAN ; - Hide = TRUE ; - Text [ en-US ] = "Asian Typography"; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_AS_OPTIONS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Line change"; - }; - TriStateBox CB_AS_FORBIDDEN - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_PARA_ASIAN:CB_AS_FORBIDDEN"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "Apply list of forbidden characters to the beginning and end of lines"; - }; - TriStateBox CB_AS_HANG_PUNC - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_PARA_ASIAN:CB_AS_HANG_PUNC"; - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "Allow hanging punctuation"; - }; - TriStateBox CB_AS_SCRIPT_SPACE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_PARA_ASIAN:CB_AS_SCRIPT_SPACE"; - Pos = MAP_APPFONT ( 12 , 42 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "Apply spacing between Asian, Latin and Complex text"; - }; -}; - -String STR_EXAMPLE -{ - Text [ en-US ] = "Example" ; -}; -String STR_PAGE_STYLE -{ - Text [ en-US ] = "Page Style" ; -}; - diff --git a/cui/source/tabpages/strings.src b/cui/source/tabpages/strings.src deleted file mode 100644 index 6c7f79d2e..000000000 --- a/cui/source/tabpages/strings.src +++ /dev/null @@ -1,134 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include ------------------------------------------------------------------ -#include <cuires.hrc> - -String RID_SVXSTR_DESC_GRADIENT -{ - Text [ en-US ] = "Please enter a name for the gradient:" ; -}; -String RID_SVXSTR_ASK_DEL_GRADIENT -{ - Text [ en-US ] = "Do you want to delete the gradient?" ; -}; -String RID_SVXSTR_ASK_CHANGE_GRADIENT -{ - Text [ en-US ] = "The gradient was modified without saving. \nModify the selected gradient or add a new gradient." ; -}; -String RID_SVXSTR_DESC_NEW_BITMAP -{ - Text [ en-US ] = "Please enter a name for the bitmap:" ; -}; -String RID_SVXSTR_DESC_EXT_BITMAP -{ - Text [ en-US ] = "Please enter a name for the external bitmap:" ; -}; -String RID_SVXSTR_ASK_DEL_BITMAP -{ - Text [ en-US ] = "Are you sure you want to delete the bitmap?" ; -}; -String RID_SVXSTR_ASK_CHANGE_BITMAP -{ - Text [ en-US ] = "The bitmap was modified without saving. \nModify the selected bitmap or add a new bitmap." ; -}; -String RID_SVXSTR_DESC_LINESTYLE -{ - Text [ en-US ] = "Please enter a name for the line style:" ; -}; -String RID_SVXSTR_ASK_DEL_LINESTYLE -{ - Text [ en-US ] = "Do you want to delete the line style?" ; -}; -String RID_SVXSTR_ASK_CHANGE_LINESTYLE -{ - Text [ en-US ] = "The line style was modified without saving. \nModify the selected line style or add a new line style." ; -}; -String RID_SVXSTR_DESC_HATCH -{ - Text [ en-US ] = "Please enter a name for the hatching:" ; -}; -String RID_SVXSTR_ASK_DEL_HATCH -{ - Text [ en-US ] = "Do you want to delete the hatching?" ; -}; -String RID_SVXSTR_ASK_CHANGE_HATCH -{ - Text [ en-US ] = "The hatching type was modified but not saved. \nModify the selected hatching type or add a new hatching type." ; -}; -String RID_SVXSTR_CHANGE -{ - Text [ en-US ] = "Modify" ; -}; -String RID_SVXSTR_ADD -{ - Text [ en-US ] = "Add" ; -}; -String RID_SVXSTR_DESC_COLOR -{ - Text [ en-US ] = "Please enter a name for the new color:" ; -}; -String RID_SVXSTR_ASK_DEL_COLOR -{ - Text [ en-US ] = "Do you want to delete the color?" ; -}; -String RID_SVXSTR_ASK_CHANGE_COLOR -{ - Text [ en-US ] = "The color was modified without saving.\nModify the selected color or add a new color." ; -}; -String RID_SVXSTR_TABLE -{ - Text [ en-US ] = "Table" ; -}; -String RID_SVXSTR_WRITE_DATA_ERROR -{ - Text [ en-US ] = "The file could not be saved!" ; -}; -String RID_SVXSTR_READ_DATA_ERROR -{ - Text [ en-US ] = "The file could not be loaded!" ; -}; -String RID_SVXSTR_WARN_TABLE_OVERWRITE -{ - Text [ en-US ] = "The list was modified without saving. Would you like to save the list now?" ; -}; -String RID_SVXSTR_WARN_NAME_DUPLICATE -{ - Text [ en-US ] = "The name you have entered already exists. \nPlease choose another name." ; -}; -String RID_SVXSTR_DESC_LINEEND -{ - Text [ en-US ] = "Please enter a name for the new arrowhead:" ; -}; -String RID_SVXSTR_ASK_DEL_LINEEND -{ - Text [ en-US ] = "Do you want to delete the arrowhead?" ; -}; -String RID_SVXSTR_ASK_CHANGE_LINEEND -{ - Text [ en-US ] = "The arrowhead was modified without saving.\nWould you like to save the arrowhead now?" ; -}; - diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx deleted file mode 100644 index 2d08dede0..000000000 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ /dev/null @@ -1,1867 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <cstddef> -#include <swpossizetabpage.hxx> -#include <dialmgr.hxx> -#include <svx/dlgutil.hxx> -#include <svx/anchorid.hxx> -#include <svl/aeitem.hxx> -#include <svx/swframevalidation.hxx> -#include <tools/debug.hxx> -#include <cuires.hrc> -#include <swpossizetabpage.hrc> -#include <svx/htmlmode.hxx> -#include <svx/svdview.hxx> -#include <svx/svdpagv.hxx> -#include <svx/rectenum.hxx> -#include <sal/macros.h> -#include <com/sun/star/text/TextContentAnchorType.hpp> -#include <com/sun/star/text/HoriOrientation.hpp> -#include <com/sun/star/text/VertOrientation.hpp> -#include <com/sun/star/text/RelOrientation.hpp> -#include <svx/dialogs.hrc> - -using namespace ::com::sun::star::text; -#define SwFPos SvxSwFramePosString - -struct FrmMap -{ - SvxSwFramePosString::StringId eStrId; - SvxSwFramePosString::StringId eMirrorStrId; - short nAlign; - sal_uLong nLBRelations; -}; - -struct RelationMap -{ - SvxSwFramePosString::StringId eStrId; - SvxSwFramePosString::StringId eMirrorStrId; - sal_uLong nLBRelation; - short nRelation; -}; -struct StringIdPair_Impl -{ - SvxSwFramePosString::StringId eHori; - SvxSwFramePosString::StringId eVert; -}; - -#define LB_FRAME 0x00000001L // paragraph text area -#define LB_PRTAREA 0x00000002L // paragraph text area + indents -#define LB_VERT_FRAME 0x00000004L // vertical paragraph text area -#define LB_VERT_PRTAREA 0x00000008L // vertical paragraph text area + indents -#define LB_REL_FRM_LEFT 0x00000010L // left paragraph margin -#define LB_REL_FRM_RIGHT 0x00000020L // right paragraph margin - -#define LB_REL_PG_LEFT 0x00000040L // left page margin -#define LB_REL_PG_RIGHT 0x00000080L // right page margin -#define LB_REL_PG_FRAME 0x00000100L // complete page -#define LB_REL_PG_PRTAREA 0x00000200L // text area of page - -#define LB_FLY_REL_PG_LEFT 0x00000400L // left frame margin -#define LB_FLY_REL_PG_RIGHT 0x00000800L // right frame margin -#define LB_FLY_REL_PG_FRAME 0x00001000L // complete frame -#define LB_FLY_REL_PG_PRTAREA 0x00002000L // frame interior - -#define LB_REL_BASE 0x00010000L // as char, relative to baseline -#define LB_REL_CHAR 0x00020000L // as char, relative to character -#define LB_REL_ROW 0x00040000L // as char, relative to line - -// #i22305# -#define LB_FLY_VERT_FRAME 0x00100000L // vertical entire frame -#define LB_FLY_VERT_PRTAREA 0x00200000L // vertical frame text area - -// #i22341# -#define LB_VERT_LINE 0x00400000L // vertical text line - -static RelationMap aRelationMap[] = -{ - {SwFPos::FRAME, SwFPos::FRAME, LB_FRAME, RelOrientation::FRAME}, - {SwFPos::PRTAREA, SwFPos::PRTAREA, LB_PRTAREA, RelOrientation::PRINT_AREA}, - {SwFPos::REL_PG_LEFT, SwFPos::MIR_REL_PG_LEFT, LB_REL_PG_LEFT, RelOrientation::PAGE_LEFT}, - {SwFPos::REL_PG_RIGHT, SwFPos::MIR_REL_PG_RIGHT, LB_REL_PG_RIGHT, RelOrientation::PAGE_RIGHT}, - {SwFPos::REL_FRM_LEFT, SwFPos::MIR_REL_FRM_LEFT, LB_REL_FRM_LEFT, RelOrientation::FRAME_LEFT}, - {SwFPos::REL_FRM_RIGHT, SwFPos::MIR_REL_FRM_RIGHT, LB_REL_FRM_RIGHT, RelOrientation::FRAME_RIGHT}, - {SwFPos::REL_PG_FRAME, SwFPos::REL_PG_FRAME, LB_REL_PG_FRAME, RelOrientation::PAGE_FRAME}, - {SwFPos::REL_PG_PRTAREA,SwFPos::REL_PG_PRTAREA, LB_REL_PG_PRTAREA, RelOrientation::PAGE_PRINT_AREA}, - {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB_REL_CHAR, RelOrientation::CHAR}, - - {SwFPos::FLY_REL_PG_LEFT, SwFPos::FLY_MIR_REL_PG_LEFT, LB_FLY_REL_PG_LEFT, RelOrientation::PAGE_LEFT}, - {SwFPos::FLY_REL_PG_RIGHT, SwFPos::FLY_MIR_REL_PG_RIGHT, LB_FLY_REL_PG_RIGHT, RelOrientation::PAGE_RIGHT}, - {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB_FLY_REL_PG_FRAME, RelOrientation::PAGE_FRAME}, - {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB_FLY_REL_PG_PRTAREA, RelOrientation::PAGE_PRINT_AREA}, - - {SwFPos::REL_BORDER, SwFPos::REL_BORDER, LB_VERT_FRAME, RelOrientation::FRAME}, - {SwFPos::REL_PRTAREA, SwFPos::REL_PRTAREA, LB_VERT_PRTAREA, RelOrientation::PRINT_AREA}, - - // #i22305# - {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB_FLY_VERT_FRAME, RelOrientation::FRAME}, - {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB_FLY_VERT_PRTAREA, RelOrientation::PRINT_AREA}, - - // #i22341# - {SwFPos::REL_LINE, SwFPos::REL_LINE, LB_VERT_LINE, RelOrientation::TEXT_LINE} -}; - -static RelationMap aAsCharRelationMap[] = -{ - {SwFPos::REL_BASE, SwFPos::REL_BASE, LB_REL_BASE, RelOrientation::FRAME}, - {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB_REL_CHAR, RelOrientation::FRAME}, - {SwFPos::REL_ROW, SwFPos::REL_ROW, LB_REL_ROW, RelOrientation::FRAME} -}; - -/*-------------------------------------------------------------------- - Anchored at page - --------------------------------------------------------------------*/ - -#define HORI_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_PG_LEFT| \ - LB_REL_PG_RIGHT) - -static FrmMap aHPageMap[] = -{ - {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_PAGE_REL}, - {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_PAGE_REL}, - {SwFPos::CENTER_HORI,SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_PAGE_REL}, - {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_PAGE_REL} -}; - -static FrmMap aHPageHtmlMap[] = -{ - {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, LB_REL_PG_FRAME} -}; - -#define VERT_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA) - -static FrmMap aVPageMap[] = -{ - {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_PAGE_REL}, - {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_PAGE_REL}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_PAGE_REL}, - {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_PAGE_REL} -}; - -static FrmMap aVPageHtmlMap[] = -{ - {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, LB_REL_PG_FRAME} -}; - -/*-------------------------------------------------------------------- - Anchored at frame - --------------------------------------------------------------------*/ - -#define HORI_FRAME_REL (LB_FLY_REL_PG_FRAME|LB_FLY_REL_PG_PRTAREA| \ - LB_FLY_REL_PG_LEFT|LB_FLY_REL_PG_RIGHT) - -static FrmMap aHFrameMap[] = -{ - {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_FRAME_REL}, - {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_FRAME_REL}, - {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_FRAME_REL}, - {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_FRAME_REL} -}; - -static FrmMap aHFlyHtmlMap[] = -{ - {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, LB_FLY_REL_PG_FRAME}, - {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, LB_FLY_REL_PG_FRAME} -}; - -// #i18732# - own vertical alignment map for to frame anchored objects -// #i22305# -#define VERT_FRAME_REL (LB_VERT_FRAME|LB_FLY_VERT_PRTAREA) - -static FrmMap aVFrameMap[] = -{ - {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_FRAME_REL}, - {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_FRAME_REL}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_FRAME_REL}, - {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_FRAME_REL} -}; - -static FrmMap aVFlyHtmlMap[] = -{ - {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_FLY_VERT_FRAME}, - {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, LB_FLY_VERT_FRAME} -}; - -static FrmMap aVMultiSelectionMap[] = -{ - {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, 0} -}; -static FrmMap aHMultiSelectionMap[] = -{ - {SwFPos::FROMLEFT, SwFPos::FROMLEFT, HoriOrientation::NONE, 0} -}; - -/*-------------------------------------------------------------------- - Anchored at paragraph - --------------------------------------------------------------------*/ - -#define HORI_PARA_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \ - LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \ - LB_REL_FRM_RIGHT) - -static FrmMap aHParaMap[] = -{ - {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_PARA_REL}, - {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_PARA_REL}, - {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_PARA_REL}, - {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_PARA_REL} -}; - -#define HTML_HORI_PARA_REL (LB_FRAME|LB_PRTAREA) - -static FrmMap aHParaHtmlMap[] = -{ - {SwFPos::LEFT, SwFPos::LEFT, HoriOrientation::LEFT, HTML_HORI_PARA_REL}, - {SwFPos::RIGHT, SwFPos::RIGHT, HoriOrientation::RIGHT, HTML_HORI_PARA_REL} -}; - -static FrmMap aHParaHtmlAbsMap[] = -{ - {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HTML_HORI_PARA_REL}, - {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HTML_HORI_PARA_REL} -}; - - -#define VERT_PARA_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \ - LB_REL_PG_FRAME|LB_REL_PG_PRTAREA) - -static FrmMap aVParaMap[] = -{ - {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_PARA_REL}, - {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_PARA_REL}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_PARA_REL}, - {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_PARA_REL} -}; - -static FrmMap aVParaHtmlMap[] = -{ - {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_VERT_PRTAREA} -}; - -/*-------------------------------------------------------------------- - Anchored at character - --------------------------------------------------------------------*/ - -#define HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \ - LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \ - LB_REL_FRM_RIGHT|LB_REL_CHAR) - -static FrmMap aHCharMap[] = -{ - {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, HORI_CHAR_REL}, - {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, HORI_CHAR_REL}, - {SwFPos::CENTER_HORI, SwFPos::CENTER_HORI, HoriOrientation::CENTER, HORI_CHAR_REL}, - {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, HORI_CHAR_REL} -}; - -#define HTML_HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_CHAR) - -static FrmMap aHCharHtmlMap[] = -{ - {SwFPos::LEFT, SwFPos::LEFT, HoriOrientation::LEFT, HTML_HORI_CHAR_REL}, - {SwFPos::RIGHT, SwFPos::RIGHT, HoriOrientation::RIGHT, HTML_HORI_CHAR_REL} -}; - -static FrmMap aHCharHtmlAbsMap[] = -{ - {SwFPos::LEFT, SwFPos::MIR_LEFT, HoriOrientation::LEFT, LB_PRTAREA|LB_REL_CHAR}, - {SwFPos::RIGHT, SwFPos::MIR_RIGHT, HoriOrientation::RIGHT, LB_PRTAREA}, - {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, HoriOrientation::NONE, LB_REL_PG_FRAME} -}; - -// #i18732# - allow vertical alignment at page areas -// #i22341# - handle <LB_REL_CHAR> on its own -#define VERT_CHAR_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \ - LB_REL_PG_FRAME|LB_REL_PG_PRTAREA) - -static FrmMap aVCharMap[] = -{ - // #i22341# - // introduce mappings for new vertical alignment at top of line <LB_VERT_LINE> - // and correct mapping for vertical alignment at character for position <FROM_BOTTOM> - // Note: Because of these adjustments the map becomes ambigous in its values - // <eStrId>/<eMirrorStrId> and <nAlign>. These ambiguities are considered - // in the methods <SwFrmPage::FillRelLB(..)>, <SwFrmPage::GetAlignment(..)> - // and <SwFrmPage::FillPosLB(..)> - {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, VERT_CHAR_REL|LB_REL_CHAR}, - {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, VERT_CHAR_REL|LB_REL_CHAR}, - {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB_REL_CHAR}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, VERT_CHAR_REL|LB_REL_CHAR}, - {SwFPos::FROMTOP, SwFPos::FROMTOP, VertOrientation::NONE, VERT_CHAR_REL}, - {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, VertOrientation::NONE, LB_REL_CHAR|LB_VERT_LINE}, - {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB_VERT_LINE}, - {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB_VERT_LINE}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::LINE_CENTER, LB_VERT_LINE} -}; - - -static FrmMap aVCharHtmlMap[] = -{ - {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB_REL_CHAR} -}; - -static FrmMap aVCharHtmlAbsMap[] = -{ - {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_REL_CHAR}, - {SwFPos::BELOW, SwFPos::BELOW, VertOrientation::CHAR_BOTTOM, LB_REL_CHAR} -}; -/*-------------------------------------------------------------------- - anchored as character - --------------------------------------------------------------------*/ - -static FrmMap aVAsCharMap[] = -{ - {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_REL_BASE}, - {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::BOTTOM, LB_REL_BASE}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, LB_REL_BASE}, - - {SwFPos::TOP, SwFPos::TOP, VertOrientation::CHAR_TOP, LB_REL_CHAR}, - {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::CHAR_BOTTOM, LB_REL_CHAR}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CHAR_CENTER, LB_REL_CHAR}, - - {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB_REL_ROW}, - {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB_REL_ROW}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::LINE_CENTER, LB_REL_ROW}, - - {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, VertOrientation::NONE, LB_REL_BASE} -}; - -static FrmMap aVAsCharHtmlMap[] = -{ - {SwFPos::TOP, SwFPos::TOP, VertOrientation::TOP, LB_REL_BASE}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::CENTER, LB_REL_BASE}, - - {SwFPos::TOP, SwFPos::TOP, VertOrientation::CHAR_TOP, LB_REL_CHAR}, - - {SwFPos::TOP, SwFPos::TOP, VertOrientation::LINE_TOP, LB_REL_ROW}, - {SwFPos::BOTTOM, SwFPos::BOTTOM, VertOrientation::LINE_BOTTOM, LB_REL_ROW}, - {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, VertOrientation::LINE_CENTER, LB_REL_ROW} -}; - -std::size_t lcl_GetFrmMapCount(const FrmMap* pMap) -{ - if( pMap ) - { - if( pMap == aVParaHtmlMap ) - return SAL_N_ELEMENTS(aVParaHtmlMap); - if( pMap == aVAsCharHtmlMap ) - return SAL_N_ELEMENTS( aVAsCharHtmlMap ); - if( pMap == aHParaHtmlMap ) - return SAL_N_ELEMENTS( aHParaHtmlMap ); - if( pMap == aHParaHtmlAbsMap ) - return SAL_N_ELEMENTS( aHParaHtmlAbsMap ); - if( pMap == aVPageMap ) - return SAL_N_ELEMENTS( aVPageMap ); - if( pMap == aVPageHtmlMap ) - return SAL_N_ELEMENTS( aVPageHtmlMap ); - if( pMap == aVAsCharMap ) - return SAL_N_ELEMENTS( aVAsCharMap ); - if( pMap == aVParaMap ) - return SAL_N_ELEMENTS( aVParaMap ); - if( pMap == aHParaMap ) - return SAL_N_ELEMENTS( aHParaMap ); - if( pMap == aHFrameMap ) - return SAL_N_ELEMENTS( aHFrameMap ); - if( pMap == aVFrameMap ) - return SAL_N_ELEMENTS( aVFrameMap ); - if( pMap == aHCharMap ) - return SAL_N_ELEMENTS( aHCharMap ); - if( pMap == aHCharHtmlMap ) - return SAL_N_ELEMENTS( aHCharHtmlMap ); - if( pMap == aHCharHtmlAbsMap ) - return SAL_N_ELEMENTS( aHCharHtmlAbsMap ); - if( pMap == aVCharMap ) - return SAL_N_ELEMENTS( aVCharMap ); - if( pMap == aVCharHtmlMap ) - return SAL_N_ELEMENTS( aVCharHtmlMap ); - if( pMap == aVCharHtmlAbsMap ) - return SAL_N_ELEMENTS( aVCharHtmlAbsMap ); - if( pMap == aHPageHtmlMap ) - return SAL_N_ELEMENTS( aHPageHtmlMap ); - if( pMap == aHFlyHtmlMap ) - return SAL_N_ELEMENTS( aHFlyHtmlMap ); - if( pMap == aVFlyHtmlMap ) - return SAL_N_ELEMENTS( aVFlyHtmlMap ); - if( pMap == aVMultiSelectionMap ) - return SAL_N_ELEMENTS( aVMultiSelectionMap ); - if( pMap == aHMultiSelectionMap ) - return SAL_N_ELEMENTS( aHMultiSelectionMap ); - return SAL_N_ELEMENTS(aHPageMap); - } - return 0; -} - -SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL( - SvxSwFramePosString::StringId eStringId, sal_Bool bVertical, sal_Bool bRTL) -{ - //special handling of STR_FROMLEFT - if(SwFPos::FROMLEFT == eStringId) - { - eStringId = bVertical ? - bRTL ? SwFPos::FROMBOTTOM : SwFPos::FROMTOP : - bRTL ? SwFPos::FROMRIGHT : SwFPos::FROMLEFT; - return eStringId; - } - if(bVertical) - { - //exchange horizontal strings with vertical strings and vice versa - static const StringIdPair_Impl aHoriIds[] = - { - {SwFPos::LEFT, SwFPos::TOP}, - {SwFPos::RIGHT, SwFPos::BOTTOM}, - {SwFPos::CENTER_HORI, SwFPos::CENTER_VERT}, - {SwFPos::FROMTOP, SwFPos::FROMRIGHT}, - {SwFPos::REL_PG_LEFT, SwFPos::REL_PG_TOP}, - {SwFPos::REL_PG_RIGHT, SwFPos::REL_PG_BOTTOM} , - {SwFPos::REL_FRM_LEFT, SwFPos::REL_FRM_TOP}, - {SwFPos::REL_FRM_RIGHT, SwFPos::REL_FRM_BOTTOM} - }; - static const StringIdPair_Impl aVertIds[] = - { - {SwFPos::TOP, SwFPos::RIGHT}, - {SwFPos::BOTTOM, SwFPos::LEFT }, - {SwFPos::CENTER_VERT, SwFPos::CENTER_HORI}, - {SwFPos::FROMTOP, SwFPos::FROMRIGHT }, - {SwFPos::REL_PG_TOP, SwFPos::REL_PG_LEFT }, - {SwFPos::REL_PG_BOTTOM, SwFPos::REL_PG_RIGHT } , - {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT }, - {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT } - }; - sal_uInt16 nIndex; - for(nIndex = 0; nIndex < SAL_N_ELEMENTS(aHoriIds); ++nIndex) - { - if(aHoriIds[nIndex].eHori == eStringId) - { - eStringId = aHoriIds[nIndex].eVert; - return eStringId; - } - } - nIndex = 0; - for(nIndex = 0; nIndex < SAL_N_ELEMENTS(aVertIds); ++nIndex) - { - if(aVertIds[nIndex].eHori == eStringId) - { - eStringId = aVertIds[nIndex].eVert; - break; - } - } - } - return eStringId; -} -// #i22341# - helper method in order to determine all possible -// listbox relations in a relation map for a given relation -sal_uLong lcl_GetLBRelationsForRelations( const sal_uInt16 _nRel ) -{ - sal_uLong nLBRelations = 0L; - - for ( sal_uInt16 nRelMapPos = 0; nRelMapPos < SAL_N_ELEMENTS(aRelationMap); ++nRelMapPos ) - { - if ( aRelationMap[nRelMapPos].nRelation == _nRel ) - { - nLBRelations |= aRelationMap[nRelMapPos].nLBRelation; - } - } - - return nLBRelations; -} - -// #i22341# - helper method on order to determine all possible -// listbox relations in a relation map for a given string ID -sal_uLong lcl_GetLBRelationsForStrID( const FrmMap* _pMap, - const SvxSwFramePosString::StringId _eStrId, - const bool _bUseMirrorStr ) -{ - sal_uLong nLBRelations = 0L; - - std::size_t nRelMapSize = lcl_GetFrmMapCount( _pMap ); - for ( std::size_t nRelMapPos = 0; nRelMapPos < nRelMapSize; ++nRelMapPos ) - { - if ( ( !_bUseMirrorStr && _pMap[nRelMapPos].eStrId == _eStrId ) || - ( _bUseMirrorStr && _pMap[nRelMapPos].eMirrorStrId == _eStrId ) ) - { - nLBRelations |= _pMap[nRelMapPos].nLBRelations; - } - } - - return nLBRelations; -} - -SvxSwPosSizeTabPage::SvxSwPosSizeTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_SWPOSSIZE ), rInAttrs ), -#ifdef _MSC_VER -#pragma warning (disable : 4355) -#endif - m_aSizeFL( this, CUI_RES( FL_SIZE ) ), - m_aWidthFT( this, CUI_RES( FT_WIDTH ) ), - m_aWidthMF( this, CUI_RES( MF_WIDTH ) ), - m_aHeightFT( this, CUI_RES( FT_HEIGHT ) ), - m_aHeightMF( this, CUI_RES( MF_HEIGHT ) ), - m_aKeepRatioCB(this,CUI_RES( CB_KEEPRATIO) ), - m_aSeparatorFL(this,CUI_RES( FL_SEPARATOR) ), - - m_aAnchorFL( this, CUI_RES( FL_ANCHOR ) ), - m_aToPageRB( this, CUI_RES( RB_TOPAGE ) ), - m_aToParaRB( this, CUI_RES( RB_TOPARA ) ), - m_aToCharRB( this, CUI_RES( RB_TOCHAR ) ), - m_aAsCharRB( this, CUI_RES( RB_ASCHAR ) ), - m_aToFrameRB( this, CUI_RES( RB_TOFRAME) ), - - m_aProtectionFL( this, CUI_RES( FL_PROTECTION ) ), - m_aPositionCB( this, CUI_RES( CB_POSITION ) ), - m_aSizeCB( this, CUI_RES( CB_SIZE ) ), - - m_aPositionFL( this, CUI_RES( FL_POSITION ) ), - m_aHoriFT( this, CUI_RES( FT_HORI ) ), - m_aHoriLB( this, CUI_RES( LB_HORI ) ), - m_aHoriByFT( this, CUI_RES( FT_HORIBY ) ), - m_aHoriByMF( this, CUI_RES( MF_HORIBY ) ), - m_aHoriToFT( this, CUI_RES( FT_HORITO ) ), - m_aHoriToLB( this, CUI_RES( LB_HORITO ) ), - - m_aHoriMirrorCB( this, CUI_RES( CB_HORIMIRROR ) ), - - m_aVertFT( this, CUI_RES( FT_VERT ) ), - m_aVertLB( this, CUI_RES( LB_VERT ) ), - m_aVertByFT( this, CUI_RES( FT_VERTBY ) ), - m_aVertByMF( this, CUI_RES( MF_VERTBY ) ), - m_aVertToFT( this, CUI_RES( FT_VERTTO ) ), - m_aVertToLB( this, CUI_RES( LB_VERTTO ) ), - - m_aFollowCB( this, CUI_RES( CB_FOLLOW ) ), - m_aExampleWN( this, CUI_RES( WN_EXAMPLE ) ), -#ifdef _MSC_VER -#pragma warning (default : 4355) -#endif - m_pVMap( 0 ), - m_pHMap( 0 ), - m_pSdrView( 0 ), - m_nOldH(HoriOrientation::CENTER), - m_nOldHRel(RelOrientation::FRAME), - m_nOldV(VertOrientation::TOP), - m_nOldVRel(RelOrientation::PRINT_AREA), - m_fWidthHeightRatio(1.0), - m_nHtmlMode(0), - m_bHtmlMode(false), - m_bAtHoriPosModified(false), - m_bAtVertPosModified(false), - m_bIsVerticalFrame(false), - m_bPositioningDisabled(false), - m_bIsMultiSelection(false), - m_bIsInRightToLeft(false) -{ - FreeResource(); - FieldUnit eDlgUnit = GetModuleFieldUnit( rInAttrs ); - SetFieldUnit( m_aHoriByMF, eDlgUnit, sal_True ); - SetFieldUnit( m_aVertByMF, eDlgUnit, sal_True ); - SetFieldUnit( m_aWidthMF , eDlgUnit, sal_True ); - SetFieldUnit( m_aHeightMF, eDlgUnit, sal_True ); - - SetExchangeSupport(); - - Link aLk = LINK(this, SvxSwPosSizeTabPage, RangeModifyHdl); - m_aWidthMF. SetLoseFocusHdl( aLk ); - m_aHeightMF. SetLoseFocusHdl( aLk ); - m_aHoriByMF.SetLoseFocusHdl( aLk ); - m_aVertByMF.SetLoseFocusHdl( aLk ); - m_aFollowCB.SetClickHdl( aLk ); - - aLk = LINK(this, SvxSwPosSizeTabPage, ModifyHdl); - m_aWidthMF. SetModifyHdl( aLk ); - m_aHeightMF. SetModifyHdl( aLk ); - m_aHoriByMF.SetModifyHdl( aLk ); - m_aVertByMF.SetModifyHdl( aLk ); - - aLk = LINK(this, SvxSwPosSizeTabPage, AnchorTypeHdl); - m_aToPageRB.SetClickHdl( aLk ); - m_aToParaRB.SetClickHdl( aLk ); - m_aToCharRB.SetClickHdl( aLk ); - m_aAsCharRB.SetClickHdl( aLk ); - m_aToFrameRB.SetClickHdl( aLk ); - - m_aHoriLB.SetSelectHdl(LINK(this, SvxSwPosSizeTabPage, PosHdl)); - m_aVertLB. SetSelectHdl(LINK(this, SvxSwPosSizeTabPage, PosHdl)); - - m_aHoriToLB.SetSelectHdl(LINK(this, SvxSwPosSizeTabPage, RelHdl)); - m_aVertToLB.SetSelectHdl(LINK(this, SvxSwPosSizeTabPage, RelHdl)); - - m_aHoriMirrorCB.SetClickHdl(LINK(this, SvxSwPosSizeTabPage, MirrorHdl)); - m_aPositionCB.SetClickHdl(LINK(this, SvxSwPosSizeTabPage, ProtectHdl)); -} - -SvxSwPosSizeTabPage::~SvxSwPosSizeTabPage() -{ -} - -SfxTabPage* SvxSwPosSizeTabPage::Create( Window* pParent, const SfxItemSet& rSet) -{ - return new SvxSwPosSizeTabPage(pParent, rSet); -} - -sal_uInt16* SvxSwPosSizeTabPage::GetRanges() -{ - static sal_uInt16 pSwPosRanges[] = - { - SID_ATTR_TRANSFORM_POS_X, - SID_ATTR_TRANSFORM_POS_Y, - SID_ATTR_TRANSFORM_PROTECT_POS, - SID_ATTR_TRANSFORM_PROTECT_POS, - SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_ANCHOR, - SID_ATTR_TRANSFORM_VERT_ORIENT, - SID_ATTR_TRANSFORM_WIDTH, - SID_ATTR_TRANSFORM_SIZE_POINT, - SID_ATTR_TRANSFORM_PROTECT_POS, - SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_AUTOWIDTH, - SID_ATTR_TRANSFORM_VERT_ORIENT, - SID_HTML_MODE, - SID_HTML_MODE, - SID_SW_FOLLOW_TEXT_FLOW, - SID_SW_FOLLOW_TEXT_FLOW, - SID_ATTR_TRANSFORM_HORI_POSITION, - SID_ATTR_TRANSFORM_VERT_POSITION, - 0 - }; - return pSwPosRanges; -} - -sal_Bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet& rSet) -{ - bool bAnchorChanged = false; - short nAnchor = GetAnchorType(&bAnchorChanged); - sal_Bool bModified = sal_False; - if(bAnchorChanged) - { - rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, nAnchor)); - bModified |= sal_True; - } - if ( m_aPositionCB.GetState() != m_aPositionCB.GetSavedValue() ) - { - if( m_aPositionCB.GetState() == STATE_DONTKNOW ) - rSet.InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_POS ); - else - rSet.Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ), - m_aPositionCB.GetState() == STATE_CHECK ? sal_True : sal_False ) ); - bModified |= sal_True; - } - - if ( m_aSizeCB.GetState() != m_aSizeCB.GetSavedValue() ) - { - if ( m_aSizeCB.GetState() == STATE_DONTKNOW ) - rSet.InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_SIZE ); - else - rSet.Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ), - m_aSizeCB.GetState() == STATE_CHECK ? sal_True : sal_False ) ); - bModified |= sal_True; - } - - const SfxItemSet& rOldSet = GetItemSet(); - - if(!m_bPositioningDisabled) - { - //on multiple selections the positioning is set via SdrView - if(m_bIsMultiSelection) - { - if( m_aHoriByMF.IsValueModified() || m_aVertByMF.IsValueModified() ) - { - long nHoriByPos = - static_cast<long>(m_aHoriByMF.Denormalize(m_aHoriByMF.GetValue(FUNIT_TWIP))); - long nVertByPos = - static_cast<long>(m_aVertByMF.Denormalize(m_aVertByMF.GetValue(FUNIT_TWIP))); - - // Altes Rechteck mit CoreUnit - m_aRect = m_pSdrView->GetAllMarkedRect(); - m_pSdrView->GetSdrPageView()->LogicToPagePos( m_aRect ); - - nHoriByPos += m_aAnchorPos.X(); - nVertByPos += m_aAnchorPos.Y(); - - rSet.Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_X ), nHoriByPos ) ); - rSet.Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_Y ), nVertByPos ) ); - - bModified |= sal_True; - } - } - else - { - if ( m_pHMap ) - { - const SfxInt16Item& rHoriOrient = - static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_ORIENT)); - const SfxInt16Item& rHoriRelation = - static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_RELATION)); - const SfxInt32Item& rHoriPosition = - static_cast<const SfxInt32Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_HORI_POSITION)) ; - - sal_uInt16 nMapPos = GetMapPos(m_pHMap, m_aHoriLB); - short nAlign = GetAlignment(m_pHMap, nMapPos, m_aHoriLB, m_aHoriToLB); - short nRel = GetRelation(m_pHMap, m_aHoriToLB); - const long nHoriByPos = - static_cast<long>(m_aHoriByMF.Denormalize(m_aHoriByMF.GetValue(FUNIT_TWIP))); - if ( - nAlign != rHoriOrient.GetValue() || - nRel != rHoriRelation.GetValue() || - (m_aHoriByMF.IsEnabled() && nHoriByPos != rHoriPosition.GetValue()) - ) - { - rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_ORIENT, nAlign)); - rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_HORI_RELATION, nRel)); - if(m_aHoriByMF.IsEnabled()) - rSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_HORI_POSITION, nHoriByPos)); - bModified |= sal_True; - } - } - if(m_aHoriMirrorCB.IsEnabled() && m_aHoriMirrorCB.IsChecked() != m_aHoriMirrorCB.GetSavedValue()) - bModified |= 0 != rSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_HORI_MIRROR, m_aHoriMirrorCB.IsChecked())); - - if ( m_pVMap ) - { - const SfxInt16Item& rVertOrient = - static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_ORIENT)); - const SfxInt16Item& rVertRelation = - static_cast<const SfxInt16Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_RELATION)); - const SfxInt32Item& rVertPosition = - static_cast<const SfxInt32Item&>(rOldSet.Get( SID_ATTR_TRANSFORM_VERT_POSITION)); - - sal_uInt16 nMapPos = GetMapPos(m_pVMap, m_aVertLB); - short nAlign = GetAlignment(m_pVMap, nMapPos, m_aVertLB, m_aVertToLB); - short nRel = GetRelation(m_pVMap, m_aVertToLB); - // #i34055# - convert vertical position for - // as-character anchored objects - long nVertByPos = - static_cast<long>(m_aVertByMF.Denormalize(m_aVertByMF.GetValue(FUNIT_TWIP))); - if ( GetAnchorType() == TextContentAnchorType_AS_CHARACTER ) - { - nVertByPos *= -1; - } - if ( nAlign != rVertOrient.GetValue() || - nRel != rVertRelation.GetValue() || - ( m_aVertByMF.IsEnabled() && - nVertByPos != rVertPosition.GetValue() ) ) - { - rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_ORIENT, nAlign)); - rSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_VERT_RELATION, nRel)); - if(m_aVertByMF.IsEnabled()) - rSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_VERT_POSITION, nVertByPos)); - bModified |= sal_True; - } - } - - // #i18732# - if(m_aFollowCB.IsChecked() != m_aFollowCB.GetSavedValue()) - { - //Writer internal type - based on SfxBoolItem - const SfxPoolItem* pItem = GetItem( rOldSet, SID_SW_FOLLOW_TEXT_FLOW); - if(pItem) - { - SfxBoolItem* pFollow = static_cast<SfxBoolItem*>(pItem->Clone()); - pFollow->SetValue(m_aFollowCB.IsChecked()); - bModified |= 0 != rSet.Put(*pFollow); - delete pFollow; - } - } - } - } - if ( m_aWidthMF.IsValueModified() || m_aHeightMF.IsValueModified() ) - { - sal_uInt32 nWidth = static_cast<sal_uInt32>(m_aWidthMF.Denormalize(m_aWidthMF.GetValue(FUNIT_TWIP))); - sal_uInt32 nHeight = static_cast<sal_uInt32>(m_aHeightMF.Denormalize(m_aHeightMF.GetValue(FUNIT_TWIP))); - rSet.Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), - (sal_uInt32) nWidth ) ); - rSet.Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), - (sal_uInt32) nHeight ) ); - //this item is required by SdrEditView::SetGeoAttrToMarked() - rSet.Put( SfxAllEnumItem( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), RP_LT ) ); - - bModified |= sal_True; - } - - return bModified; -} - -void SvxSwPosSizeTabPage::Reset( const SfxItemSet& rSet) -{ - const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_TRANSFORM_ANCHOR ); - bool bInvalidateAnchor = false; - short nAnchorType = TextContentAnchorType_AT_PARAGRAPH; - if(pItem) - { - nAnchorType = static_cast<const SfxInt16Item*>(pItem)->GetValue(); - switch(nAnchorType) - { - case TextContentAnchorType_AT_PAGE: m_aToPageRB.Check(); break; - case TextContentAnchorType_AT_PARAGRAPH: m_aToParaRB.Check(); break; - case TextContentAnchorType_AT_CHARACTER: m_aToCharRB.Check(); break; - case TextContentAnchorType_AS_CHARACTER: m_aAsCharRB.Check(); break; - case TextContentAnchorType_AT_FRAME: m_aToFrameRB.Check(); break; - default : bInvalidateAnchor = true; - } - m_aToPageRB.SaveValue(); - m_aToParaRB.SaveValue(); - m_aToCharRB.SaveValue(); - m_aAsCharRB.SaveValue(); - m_aToFrameRB.SaveValue(); - } - if(bInvalidateAnchor) - { - m_aToPageRB.Enable( sal_False ); - m_aToParaRB.Enable( sal_False ); - m_aToCharRB.Enable( sal_False ); - m_aAsCharRB.Enable( sal_False ); - m_aToFrameRB.Enable( sal_False ); - } - - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_PROTECT_POS ); - if ( pItem ) - { - sal_Bool bProtected = ( ( const SfxBoolItem* )pItem )->GetValue(); - m_aPositionCB.SetState( bProtected ? STATE_CHECK : STATE_NOCHECK ); - m_aPositionCB.EnableTriState( sal_False ); - m_aSizeCB.Enable( !bProtected ); - } - else - { - m_aPositionCB.SetState( STATE_DONTKNOW ); - } - - m_aPositionCB.SaveValue(); - - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_PROTECT_SIZE ); - - if ( pItem ) - { - m_aSizeCB.SetState( ( (const SfxBoolItem*)pItem )->GetValue() - ? STATE_CHECK : STATE_NOCHECK ); - m_aSizeCB.EnableTriState( sal_False ); - } - else - m_aSizeCB.SetState( STATE_DONTKNOW ); - m_aSizeCB.SaveValue(); - - pItem = GetItem( rSet, SID_HTML_MODE ); - if(pItem) - m_nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); - m_bHtmlMode = 0 != (m_bHtmlMode & HTMLMODE_ON); - - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT ); - if(pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue()) - { - String sHLabel = m_aHoriFT.GetText(); - m_aHoriFT.SetText(m_aVertFT.GetText()); - m_aVertFT.SetText(sHLabel); - m_bIsVerticalFrame = true; - } - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_IN_RTL_TEXT); - if(pItem) - m_bIsInRightToLeft = static_cast<const SfxBoolItem*>(pItem)->GetValue(); - - pItem = GetItem( rSet, SID_SW_FOLLOW_TEXT_FLOW); - if(pItem) - { - const bool bFollowTextFlow = - static_cast<const SfxBoolItem*>(pItem)->GetValue(); - m_aFollowCB.Check( bFollowTextFlow ); - } - m_aFollowCB.SaveValue(); - - if(m_bHtmlMode) - { - if( 0 == (m_nHtmlMode & HTMLMODE_FULL_ABS_POS)) - { - m_aHeightFT .Enable( sal_False ); - m_aHeightMF .Enable( sal_False ); - } - if( 0 == (m_nHtmlMode & HTMLMODE_SOME_ABS_POS)) - { - if(GetAnchorType() == TextContentAnchorType_AT_PAGE) - { - m_aToParaRB.Check(); - } - m_aToPageRB.Enable(sal_False); - } - m_aHoriMirrorCB.Show(sal_False); - m_aKeepRatioCB.Enable(sal_False); - // #i18732# - hide checkbox in HTML mode - m_aFollowCB.Show(sal_False); - } - else - { - // #i18732# correct enable/disable of check box 'Mirror on..' - m_aHoriMirrorCB.Enable(!m_aAsCharRB.IsChecked() && !m_bIsMultiSelection); - - // #i18732# - enable/disable check box 'Follow text flow'. - m_aFollowCB.Enable( m_aToParaRB.IsChecked() || - m_aToCharRB.IsChecked() ); - } - - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_WIDTH ); - sal_Int32 nWidth = Max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (sal_uInt32)1 ); - - m_aWidthMF.SetValue(m_aWidthMF.Normalize(nWidth), FUNIT_TWIP); - - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HEIGHT ); - sal_Int32 nHeight = Max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, (sal_uInt32)1 ); - m_aHeightMF.SetValue(m_aHeightMF.Normalize(nHeight), FUNIT_TWIP); - m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0; - - if(!m_bPositioningDisabled) - { - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HORI_ORIENT); - if(pItem) - { - short nHoriOrientation = static_cast< const SfxInt16Item*>(pItem)->GetValue(); - m_nOldH = nHoriOrientation; - } - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_VERT_ORIENT); - if(pItem) - { - short nVertOrientation = static_cast< const SfxInt16Item*>(pItem)->GetValue(); - m_nOldV = nVertOrientation; - } - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HORI_RELATION); - if(pItem) - { - m_nOldHRel = static_cast< const SfxInt16Item*>(pItem)->GetValue(); - } - - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_VERT_RELATION); - if(pItem) - { - m_nOldVRel = static_cast< const SfxInt16Item*>(pItem)->GetValue(); - } - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HORI_MIRROR); - if(pItem) - m_aHoriMirrorCB.Check(static_cast<const SfxBoolItem*>(pItem)->GetValue()); - m_aHoriMirrorCB.SaveValue(); - - sal_Int32 nHoriPos = 0; - sal_Int32 nVertPos = 0; - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_HORI_POSITION); - if(pItem) - nHoriPos = static_cast<const SfxInt32Item*>(pItem)->GetValue(); - pItem = GetItem( rSet, SID_ATTR_TRANSFORM_VERT_POSITION); - if(pItem) - nVertPos = static_cast<const SfxInt32Item*>(pItem)->GetValue(); - - InitPos(nAnchorType, m_nOldH, m_nOldHRel, m_nOldV, m_nOldVRel, nHoriPos, nVertPos); - - m_aVertByMF.SaveValue(); - m_aHoriByMF.SaveValue(); - // #i18732# - m_aFollowCB.SaveValue(); - - RangeModifyHdl(&m_aWidthMF); // initially set maximum values - } -} - -int SvxSwPosSizeTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if( _pSet ) - FillItemSet( *_pSet ); - return( LEAVE_PAGE ); -} - -void SvxSwPosSizeTabPage::EnableAnchorTypes(sal_uInt16 nAnchorEnable) -{ - if((nAnchorEnable & SVX_OBJ_AT_FLY)) - m_aToFrameRB.Show(); - if(!(nAnchorEnable & SVX_OBJ_PAGE)) - m_aToPageRB.Enable(sal_False); -} - -short SvxSwPosSizeTabPage::GetAnchorType(bool* pbHasChanged) -{ - short nRet = -1; - RadioButton* pCheckedButton = 0; - if(m_aToParaRB.IsEnabled()) - { - if(m_aToPageRB.IsChecked()) - { - nRet = TextContentAnchorType_AT_PAGE; - pCheckedButton = &m_aToPageRB; - } - else if(m_aToParaRB.IsChecked()) - { - nRet = TextContentAnchorType_AT_PARAGRAPH; - pCheckedButton = &m_aToParaRB; - } - else if(m_aToCharRB.IsChecked()) - { - nRet = TextContentAnchorType_AT_CHARACTER; - pCheckedButton = &m_aToCharRB; - } - else if(m_aAsCharRB.IsChecked()) - { - nRet = TextContentAnchorType_AS_CHARACTER; - pCheckedButton = &m_aAsCharRB; - } - else if(m_aToFrameRB.IsChecked()) - { - nRet = TextContentAnchorType_AT_FRAME; - pCheckedButton = &m_aToFrameRB; - } - } - if(pbHasChanged) - { - if(pCheckedButton) - *pbHasChanged = pCheckedButton->IsChecked() != pCheckedButton->GetSavedValue(); - else - *pbHasChanged = false; - } - return nRet; -} - -IMPL_LINK( SvxSwPosSizeTabPage, RangeModifyHdl, Edit *, EMPTYARG ) -{ - if(m_bPositioningDisabled) - return 0; - SvxSwFrameValidation aVal; - - aVal.nAnchorType = GetAnchorType(); - aVal.bAutoHeight = false; - aVal.bAutoWidth = false; - aVal.bMirror = m_aHoriMirrorCB.IsChecked(); - // #i18732# - aVal.bFollowTextFlow = m_aFollowCB.IsChecked(); - - if ( m_pHMap ) - { - // Ausrichtung Horizontal - sal_uInt16 nMapPos = GetMapPos(m_pHMap, m_aHoriToLB); - sal_uInt16 nAlign = GetAlignment(m_pHMap, nMapPos, m_aHoriLB, m_aHoriToLB); - sal_uInt16 nRel = GetRelation(m_pHMap, m_aHoriToLB); - - aVal.nHoriOrient = (short)nAlign; - aVal.nHRelOrient = (short)nRel; - } - else - aVal.nHoriOrient = HoriOrientation::NONE; - - if ( m_pVMap ) - { - // Ausrichtung Vertikal - sal_uInt16 nMapPos = GetMapPos(m_pVMap, m_aVertLB); - sal_uInt16 nAlign = GetAlignment(m_pVMap, nMapPos, m_aVertLB, m_aVertToLB); - sal_uInt16 nRel = GetRelation(m_pVMap, m_aVertToLB); - - aVal.nVertOrient = (short)nAlign; - aVal.nVRelOrient = (short)nRel; - } - else - aVal.nVertOrient = VertOrientation::NONE; - - const long nAtHorzPosVal = - static_cast<long>(m_aHoriByMF.Denormalize(m_aHoriByMF.GetValue(FUNIT_TWIP))); - const long nAtVertPosVal = - static_cast<long>(m_aVertByMF.Denormalize(m_aVertByMF.GetValue(FUNIT_TWIP))); - - aVal.nHPos = nAtHorzPosVal; - aVal.nVPos = nAtVertPosVal; - - sal_Int32 nWidth = static_cast<sal_uInt32>(m_aWidthMF. Denormalize(m_aWidthMF.GetValue(FUNIT_TWIP))); - sal_Int32 nHeight = static_cast<sal_uInt32>(m_aHeightMF.Denormalize(m_aHeightMF.GetValue(FUNIT_TWIP))); - aVal.nWidth = nWidth; - aVal.nHeight = nHeight; - - if(m_aValidateLink.IsSet()) - m_aValidateLink.Call(&aVal); - - nWidth = aVal.nWidth; - nHeight = aVal.nHeight; - - // Mindestbreite auch fuer Vorlage - m_aHeightMF.SetMin(m_aHeightMF.Normalize(aVal.nMinHeight), FUNIT_TWIP); - m_aWidthMF. SetMin(m_aWidthMF.Normalize(aVal.nMinWidth), FUNIT_TWIP); - - sal_Int32 nMaxWidth(aVal.nMaxWidth); - sal_Int32 nMaxHeight(aVal.nMaxHeight); - - sal_Int64 nTmp = m_aHeightMF.Normalize(nMaxHeight); - m_aHeightMF.SetMax(nTmp, FUNIT_TWIP); - - nTmp = m_aWidthMF.Normalize(nMaxWidth); - m_aWidthMF.SetMax(nTmp, FUNIT_TWIP); - - m_aHoriByMF.SetMin(m_aHoriByMF.Normalize(aVal.nMinHPos), FUNIT_TWIP); - m_aHoriByMF.SetMax(m_aHoriByMF.Normalize(aVal.nMaxHPos), FUNIT_TWIP); - if ( aVal.nHPos != nAtHorzPosVal ) - m_aHoriByMF.SetValue(m_aHoriByMF.Normalize(aVal.nHPos), FUNIT_TWIP); - - m_aVertByMF.SetMin(m_aVertByMF.Normalize(aVal.nMinVPos ), FUNIT_TWIP); - m_aVertByMF.SetMax(m_aVertByMF.Normalize(aVal.nMaxVPos), FUNIT_TWIP); - if ( aVal.nVPos != nAtVertPosVal ) - m_aVertByMF.SetValue(m_aVertByMF.Normalize(aVal.nVPos), FUNIT_TWIP); - - return 0; -} - -IMPL_LINK( SvxSwPosSizeTabPage, AnchorTypeHdl, RadioButton *, EMPTYARG ) -{ - m_aHoriMirrorCB.Enable(!m_aAsCharRB.IsChecked() && !m_bIsMultiSelection); - - // #i18732# - enable check box 'Follow text flow' for anchor - // type to-paragraph' and to-character - m_aFollowCB.Enable( m_aToParaRB.IsChecked() || m_aToCharRB.IsChecked() ); - - short nId = GetAnchorType(); - - InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX); - RangeModifyHdl(0); - - if(m_bHtmlMode) - { - PosHdl(&m_aHoriLB); - PosHdl(&m_aVertLB); - } - return 0; -} - -IMPL_LINK( SvxSwPosSizeTabPage, MirrorHdl, CheckBox *, EMPTYARG ) -{ - short nId = GetAnchorType(); - InitPos( nId, USHRT_MAX, 0, USHRT_MAX, 0, LONG_MAX, LONG_MAX); - - return 0; -} - -IMPL_LINK( SvxSwPosSizeTabPage, RelHdl, ListBox *, pLB ) -{ - sal_Bool bHori = pLB == &m_aHoriToLB; - - UpdateExample(); - - if (bHori) - m_bAtHoriPosModified = sal_True; - else - m_bAtVertPosModified = sal_True; - - if(m_bHtmlMode && TextContentAnchorType_AT_CHARACTER == GetAnchorType()) // wieder Sonderbehandlung - { - if(bHori) - { - sal_uInt16 nRel = GetRelation(m_pHMap, m_aHoriToLB); - if(RelOrientation::PRINT_AREA == nRel && 0 == m_aVertLB.GetSelectEntryPos()) - { - m_aVertLB.SelectEntryPos(1); - } - else if(RelOrientation::CHAR == nRel && 1 == m_aVertLB.GetSelectEntryPos()) - { - m_aVertLB.SelectEntryPos(0); - } - } - } - if (pLB) // Nur wenn Handler durch Aenderung des Controllers gerufen wurde - RangeModifyHdl(0); - - return 0; - -} - -IMPL_LINK( SvxSwPosSizeTabPage, PosHdl, ListBox *, pLB ) -{ - sal_Bool bHori = pLB == &m_aHoriLB; - ListBox *pRelLB = bHori ? &m_aHoriToLB : &m_aVertToLB; - FixedText *pRelFT = bHori ? &m_aHoriToFT : &m_aVertToFT; - FrmMap *pMap = bHori ? m_pHMap : m_pVMap; - - - sal_uInt16 nMapPos = GetMapPos(pMap, *pLB); - sal_uInt16 nAlign = GetAlignment(pMap, nMapPos, *pLB, *pRelLB); - - if (bHori) - { - sal_Bool bEnable = HoriOrientation::NONE == nAlign; - m_aHoriByMF.Enable( bEnable ); - m_aHoriByFT.Enable( bEnable ); - } - else - { - sal_Bool bEnable = VertOrientation::NONE == nAlign; - m_aVertByMF.Enable( bEnable ); - m_aVertByFT.Enable( bEnable ); - } - - if (pLB) // Nur wenn Handler durch Aenderung des Controllers gerufen wurde - RangeModifyHdl( 0 ); - - short nRel = 0; - if (pLB->GetSelectEntryCount()) - { - - if (pRelLB->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) - nRel = ((RelationMap *)pRelLB->GetEntryData(pRelLB->GetSelectEntryPos()))->nRelation; - - FillRelLB(pMap, nMapPos, nAlign, nRel, *pRelLB, *pRelFT); - } - else - pRelLB->Clear(); - - UpdateExample(); - - if (bHori) - m_bAtHoriPosModified = sal_True; - else - m_bAtVertPosModified = sal_True; - - // Sonderbehandlung fuer HTML-Mode mit horz-vert-Abhaengigkeiten - if(m_bHtmlMode && m_nHtmlMode & HTMLMODE_SOME_ABS_POS && - TextContentAnchorType_AT_CHARACTER == GetAnchorType()) - { - sal_Bool bSet = sal_False; - if(bHori) - { - // rechts ist nur unterhalb erlaubt - von links nur oben - // von links am Zeichen -> unterhalb - if((HoriOrientation::LEFT == nAlign || HoriOrientation::RIGHT == nAlign) && - 0 == m_aVertLB.GetSelectEntryPos()) - { - if(RelOrientation::FRAME == nRel) - m_aVertLB.SelectEntryPos(1); - else - m_aVertLB.SelectEntryPos(0); - bSet = sal_True; - } - else if(HoriOrientation::LEFT == nAlign && 1 == m_aVertLB.GetSelectEntryPos()) - { - m_aVertLB.SelectEntryPos(0); - bSet = sal_True; - } - else if(HoriOrientation::NONE == nAlign && 1 == m_aVertLB.GetSelectEntryPos()) - { - m_aVertLB.SelectEntryPos(0); - bSet = sal_True; - } - if(bSet) - PosHdl(&m_aVertLB); - } - else - { - if(VertOrientation::TOP == nAlign) - { - if(1 == m_aHoriLB.GetSelectEntryPos()) - { - m_aHoriLB.SelectEntryPos(0); - bSet = sal_True; - } - m_aHoriToLB.SelectEntryPos(1); - } - else if(VertOrientation::CHAR_BOTTOM == nAlign) - { - if(2 == m_aHoriLB.GetSelectEntryPos()) - { - m_aHoriLB.SelectEntryPos(0); - bSet = sal_True; - } - m_aHoriToLB.SelectEntryPos(0) ; - } - if(bSet) - PosHdl(&m_aHoriLB); - } - - } - return 0; -} - -IMPL_LINK( SvxSwPosSizeTabPage, ModifyHdl, Edit *, pEdit ) -{ - sal_Int64 nWidth = m_aWidthMF.Denormalize(m_aWidthMF.GetValue(FUNIT_TWIP)); - sal_Int64 nHeight = m_aHeightMF.Denormalize(m_aHeightMF.GetValue(FUNIT_TWIP)); - if ( m_aKeepRatioCB.IsChecked() ) - { - if ( pEdit == &m_aWidthMF ) - { - nHeight = sal_Int64((double)nWidth / m_fWidthHeightRatio); - m_aHeightMF.SetValue(m_aHeightMF.Normalize(nHeight), FUNIT_TWIP); - } - else if(pEdit == &m_aHeightMF) - { - nWidth = sal_Int64((double)nHeight * m_fWidthHeightRatio); - m_aWidthMF.SetValue(m_aWidthMF.Normalize(nWidth), FUNIT_TWIP); - } - } - m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0; - UpdateExample(); - return 0; -} - -IMPL_LINK( SvxSwPosSizeTabPage, ProtectHdl, TriStateBox *, EMPTYARG) -{ - m_aSizeCB.Enable(m_aPositionCB.IsEnabled() && !m_aPositionCB.IsChecked()); - return 0; -} - -short SvxSwPosSizeTabPage::GetRelation(FrmMap *, ListBox &rRelationLB) -{ - short nRel = 0; - sal_uInt16 nPos = rRelationLB.GetSelectEntryPos(); - - if (nPos != LISTBOX_ENTRY_NOTFOUND) - { - RelationMap *pEntry = (RelationMap *)rRelationLB.GetEntryData(nPos); - nRel = pEntry->nRelation; - } - - return nRel; -} - -short SvxSwPosSizeTabPage::GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &/*rAlignLB*/, ListBox &rRelationLB) -{ - short nAlign = 0; - - // #i22341# - special handling also for map <aVCharMap>, - // because it contains ambigous items for alignment - if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap || - pMap == aVCharMap ) - { - if (rRelationLB.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) - { - sal_uLong nRel = ((RelationMap *)rRelationLB.GetEntryData(rRelationLB.GetSelectEntryPos()))->nLBRelation; - std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap); - SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId; - - for (std::size_t i = 0; i < nMapCount; i++) - { - if (pMap[i].eStrId == eStrId) - { - sal_uLong nLBRelations = pMap[i].nLBRelations; - if (nLBRelations & nRel) - { - nAlign = pMap[i].nAlign; - break; - } - } - } - } - } - else if (pMap) - nAlign = pMap[nMapPos].nAlign; - - return nAlign; -} - -sal_uInt16 SvxSwPosSizeTabPage::GetMapPos(FrmMap *pMap, ListBox &rAlignLB) -{ - sal_uInt16 nMapPos = 0; - sal_uInt16 nLBSelPos = rAlignLB.GetSelectEntryPos(); - - if (nLBSelPos != LISTBOX_ENTRY_NOTFOUND) - { - if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap) - { - std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap); - String sSelEntry(rAlignLB.GetSelectEntry()); - - for (std::size_t i = 0; i < nMapCount; i++) - { - SvxSwFramePosString::StringId eResId = pMap[i].eStrId; - - String sEntry = m_aFramePosString.GetString(eResId); - - if (sEntry == sSelEntry) - { - nMapPos = sal::static_int_cast< sal_uInt16 >(i); - break; - } - } - } - else - nMapPos = nLBSelPos; - } - - return nMapPos; -} - -void SvxSwPosSizeTabPage::InitPos(short nAnchor, - sal_uInt16 nH, - sal_uInt16 nHRel, - sal_uInt16 nV, - sal_uInt16 nVRel, - long nX, - long nY) -{ - sal_uInt16 nPos = m_aVertLB.GetSelectEntryPos(); - if ( nPos != LISTBOX_ENTRY_NOTFOUND && m_pVMap ) - { - m_nOldV = m_pVMap[nPos].nAlign; - nPos = m_aVertToLB.GetSelectEntryPos(); - if (nPos != LISTBOX_ENTRY_NOTFOUND) - m_nOldVRel = ((RelationMap *)m_aVertToLB.GetEntryData(nPos))->nRelation; - } - - nPos = m_aHoriLB.GetSelectEntryPos(); - if ( nPos != LISTBOX_ENTRY_NOTFOUND && m_pHMap ) - { - m_nOldH = m_pHMap[nPos].nAlign; - - nPos = m_aHoriToLB.GetSelectEntryPos(); - if (nPos != LISTBOX_ENTRY_NOTFOUND) - m_nOldHRel = ((RelationMap *)m_aHoriToLB.GetEntryData(nPos))->nRelation; - } - - sal_Bool bEnable = sal_True; - if( m_bIsMultiSelection ) - { - m_pVMap = aVMultiSelectionMap; - m_pHMap = aHMultiSelectionMap; - } - else if( nAnchor == TextContentAnchorType_AT_PAGE ) - { - m_pVMap = m_bHtmlMode ? aVPageHtmlMap : aVPageMap; - m_pHMap = m_bHtmlMode ? aHPageHtmlMap : aHPageMap; - } - else if ( nAnchor == TextContentAnchorType_AT_FRAME ) - { - // #i18732# - own vertical alignment map for to frame - // anchored objects. - m_pVMap = m_bHtmlMode ? aVFlyHtmlMap : aVFrameMap; - m_pHMap = m_bHtmlMode ? aHFlyHtmlMap : aHFrameMap; - } - else if ( nAnchor == TextContentAnchorType_AT_PARAGRAPH ) - { - if(m_bHtmlMode) - { - m_pVMap = aVParaHtmlMap; - m_pHMap = m_nHtmlMode & HTMLMODE_SOME_ABS_POS ? aHParaHtmlAbsMap : aHParaHtmlMap; - } - else - { - m_pVMap = aVParaMap; - m_pHMap = aHParaMap; - } - } - else if ( nAnchor == TextContentAnchorType_AT_CHARACTER ) - { - if(m_bHtmlMode) - { - m_pVMap = m_nHtmlMode & HTMLMODE_SOME_ABS_POS ? aVCharHtmlAbsMap : aVCharHtmlMap; - m_pHMap = m_nHtmlMode & HTMLMODE_SOME_ABS_POS ? aHCharHtmlAbsMap : aHCharHtmlMap; - } - else - { - m_pVMap = aVCharMap; - m_pHMap = aHCharMap; - } - } - else if ( nAnchor == TextContentAnchorType_AS_CHARACTER ) - { - m_pVMap = m_bHtmlMode ? aVAsCharHtmlMap : aVAsCharMap; - m_pHMap = 0; - bEnable = sal_False; - } - m_aHoriLB.Enable( bEnable ); - m_aHoriFT.Enable( bEnable ); - - // aktuelle Pos selektieren - // Horizontal - if ( nH == USHRT_MAX ) - { - nH = m_nOldH; - nHRel = m_nOldHRel; - } - // #i22341# - pass <nHRel> as 3rd parameter to method <FillPosLB> - sal_uInt16 nMapPos = FillPosLB(m_pHMap, nH, nHRel, m_aHoriLB); - FillRelLB(m_pHMap, nMapPos, nH, nHRel, m_aHoriToLB, m_aHoriToFT); - - // Vertikal - if ( nV == USHRT_MAX ) - { - nV = m_nOldV; - nVRel = m_nOldVRel; - } - // #i22341# - pass <nVRel> as 3rd parameter to method <FillPosLB> - nMapPos = FillPosLB(m_pVMap, nV, nVRel, m_aVertLB); - FillRelLB(m_pVMap, nMapPos, nV, nVRel, m_aVertToLB, m_aVertToFT); - - // Edits init - bEnable = nH == HoriOrientation::NONE && - nAnchor != TextContentAnchorType_AS_CHARACTER;//#61359# warum nicht in Formaten&& !bFormat; - if (!bEnable) - { - m_aHoriByMF.SetValue( 0, FUNIT_TWIP ); - if (nX != LONG_MAX && m_bHtmlMode) - m_aHoriByMF.SetModifyFlag(); - } - else if(m_bIsMultiSelection) - { - m_aHoriByMF.SetValue( m_aHoriByMF.Normalize(m_aRect.Left()), FUNIT_TWIP ); - } - else - { - if (nX != LONG_MAX) - m_aHoriByMF.SetValue( m_aHoriByMF.Normalize(nX), FUNIT_TWIP ); - } - m_aHoriByFT.Enable( bEnable ); - m_aHoriByMF.Enable( bEnable ); - - bEnable = nV == VertOrientation::NONE; - if ( !bEnable ) - { - m_aVertByMF.SetValue( 0, FUNIT_TWIP ); - if(nY != LONG_MAX && m_bHtmlMode) - m_aVertByMF.SetModifyFlag(); - } - else if(m_bIsMultiSelection) - { - m_aVertByMF.SetValue( m_aVertByMF.Normalize(m_aRect.Top()), FUNIT_TWIP ); - } - else - { - if ( nAnchor == TextContentAnchorType_AS_CHARACTER ) - { - if ( nY == LONG_MAX ) - nY = 0; - else - nY *= -1; - } - if ( nY != LONG_MAX ) - m_aVertByMF.SetValue( m_aVertByMF.Normalize(nY), FUNIT_TWIP ); - } - m_aVertByFT.Enable( bEnable ); - m_aVertByMF.Enable( bEnable ); - UpdateExample(); -} - -void SvxSwPosSizeTabPage::UpdateExample() -{ - sal_uInt16 nPos = m_aHoriLB.GetSelectEntryPos(); - if ( m_pHMap && nPos != LISTBOX_ENTRY_NOTFOUND ) - { - sal_uInt16 nMapPos = GetMapPos(m_pHMap, m_aHoriLB); - short nAlign = GetAlignment(m_pHMap, nMapPos, m_aHoriLB, m_aHoriToLB); - short nRel = GetRelation(m_pHMap, m_aHoriToLB); - - m_aExampleWN.SetHAlign(nAlign); - m_aExampleWN.SetHoriRel(nRel); - } - - nPos = m_aVertLB.GetSelectEntryPos(); - if ( m_pVMap && nPos != LISTBOX_ENTRY_NOTFOUND ) - { - sal_uInt16 nMapPos = GetMapPos(m_pVMap, m_aVertLB); - sal_uInt16 nAlign = GetAlignment(m_pVMap, nMapPos, m_aVertLB, m_aVertToLB); - sal_uInt16 nRel = GetRelation(m_pVMap, m_aVertToLB); - - m_aExampleWN.SetVAlign(nAlign); - m_aExampleWN.SetVertRel(nRel); - } - - // Size - long nXPos = static_cast<long>(m_aHoriByMF.Denormalize(m_aHoriByMF.GetValue(FUNIT_TWIP))); - long nYPos = static_cast<long>(m_aVertByMF.Denormalize(m_aVertByMF.GetValue(FUNIT_TWIP))); - m_aExampleWN.SetRelPos(Point(nXPos, nYPos)); - - m_aExampleWN.SetAnchor( GetAnchorType() ); - m_aExampleWN.Invalidate(); -} - -sal_uLong SvxSwPosSizeTabPage::FillRelLB(FrmMap *pMap, sal_uInt16 nMapPos, sal_uInt16 nAlign, - sal_uInt16 nRel, ListBox &rLB, FixedText &rFT) -{ - String sSelEntry; - sal_uLong nLBRelations = 0; - std::size_t nMapCount = ::lcl_GetFrmMapCount(pMap); - - rLB.Clear(); - - if (nMapPos < nMapCount) - { - if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap) - { - String sOldEntry(rLB.GetSelectEntry()); - sal_uInt16 nRelCount = SAL_N_ELEMENTS(aAsCharRelationMap); - SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId; - - for (std::size_t _nMapPos = 0; _nMapPos < nMapCount; _nMapPos++) - { - if (pMap[_nMapPos].eStrId == eStrId) - { - nLBRelations = pMap[_nMapPos].nLBRelations; - for (sal_uInt16 nRelPos = 0; nRelPos < nRelCount; nRelPos++) - { - if (nLBRelations & aAsCharRelationMap[nRelPos].nLBRelation) - { - SvxSwFramePosString::StringId sStrId1 = aAsCharRelationMap[nRelPos].eStrId; - - sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, m_bIsVerticalFrame, m_bIsInRightToLeft); - String sEntry = m_aFramePosString.GetString(sStrId1); - sal_uInt16 nPos = rLB.InsertEntry(sEntry); - rLB.SetEntryData(nPos, &aAsCharRelationMap[nRelPos]); - if (pMap[_nMapPos].nAlign == nAlign) - sSelEntry = sEntry; - break; - } - } - } - } - if (sSelEntry.Len()) - rLB.SelectEntry(sSelEntry); - else - { - rLB.SelectEntry(sOldEntry); - - if (!rLB.GetSelectEntryCount()) - { - for (sal_uInt16 i = 0; i < rLB.GetEntryCount(); i++) - { - RelationMap *pEntry = (RelationMap *)rLB.GetEntryData(i); - if (pEntry->nLBRelation == LB_REL_CHAR) // Default - { - rLB.SelectEntryPos(i); - break; - } - } - } - } - } - else - { - sal_uInt16 nRelCount = SAL_N_ELEMENTS(aRelationMap); - - // #i22341# - special handling for map <aVCharMap>, - // because its ambigous in its <eStrId>/<eMirrorStrId>. - if ( pMap == aVCharMap ) - { - nLBRelations = ::lcl_GetLBRelationsForStrID( pMap, - ( m_aHoriMirrorCB.IsChecked() - ? pMap[nMapPos].eMirrorStrId - : pMap[nMapPos].eStrId ), - m_aHoriMirrorCB.IsChecked() ); - } - else - { - nLBRelations = pMap[nMapPos].nLBRelations; - } - - for (sal_uLong nBit = 1; nBit < 0x80000000; nBit <<= 1) - { - if (nLBRelations & nBit) - { - for (sal_uInt16 nRelPos = 0; nRelPos < nRelCount; nRelPos++) - { - if (aRelationMap[nRelPos].nLBRelation == nBit) - { - SvxSwFramePosString::StringId sStrId1 = m_aHoriMirrorCB.IsChecked() ? aRelationMap[nRelPos].eMirrorStrId : aRelationMap[nRelPos].eStrId; - sStrId1 = lcl_ChangeResIdToVerticalOrRTL(sStrId1, m_bIsVerticalFrame, m_bIsInRightToLeft); - String sEntry = m_aFramePosString.GetString(sStrId1); - sal_uInt16 nPos = rLB.InsertEntry(sEntry); - rLB.SetEntryData(nPos, &aRelationMap[nRelPos]); - if (!sSelEntry.Len() && aRelationMap[nRelPos].nRelation == nRel) - sSelEntry = sEntry; - } - } - } - } - if (sSelEntry.Len()) - rLB.SelectEntry(sSelEntry); - else - { - // Warscheinlich Ankerwechsel. Daher aehnliche Relation suchen - switch (nRel) - { - case RelOrientation::FRAME: nRel = RelOrientation::PAGE_FRAME; break; - case RelOrientation::PRINT_AREA: nRel = RelOrientation::PAGE_PRINT_AREA; break; - case RelOrientation::PAGE_LEFT: nRel = RelOrientation::FRAME_LEFT; break; - case RelOrientation::PAGE_RIGHT: nRel = RelOrientation::FRAME_RIGHT; break; - case RelOrientation::FRAME_LEFT: nRel = RelOrientation::PAGE_LEFT; break; - case RelOrientation::FRAME_RIGHT: nRel = RelOrientation::PAGE_RIGHT; break; - case RelOrientation::PAGE_FRAME: nRel = RelOrientation::FRAME; break; - case RelOrientation::PAGE_PRINT_AREA: nRel = RelOrientation::PRINT_AREA; break; - - default: - if (rLB.GetEntryCount()) - { - RelationMap *pEntry = (RelationMap *)rLB.GetEntryData(rLB.GetEntryCount() - 1); - nRel = pEntry->nRelation; - } - break; - } - - for (sal_uInt16 i = 0; i < rLB.GetEntryCount(); i++) - { - RelationMap *pEntry = (RelationMap *)rLB.GetEntryData(i); - if (pEntry->nRelation == nRel) - { - rLB.SelectEntryPos(i); - break; - } - } - - if (!rLB.GetSelectEntryCount()) - rLB.SelectEntryPos(0); - } - } - } - - rLB.Enable(rLB.GetEntryCount() != 0); - rFT.Enable(rLB.GetEntryCount() != 0); - - RelHdl(&rLB); - - return nLBRelations; -} - -sal_uInt16 SvxSwPosSizeTabPage::FillPosLB(FrmMap *_pMap, - sal_uInt16 _nAlign, - const sal_uInt16 _nRel, - ListBox &_rLB) -{ - String sSelEntry, sOldEntry; - sOldEntry = _rLB.GetSelectEntry(); - - _rLB.Clear(); - - // #i22341# - determine all possible listbox relations for - // given relation for map <aVCharMap> - const sal_uLong nLBRelations = (_pMap != aVCharMap) - ? 0L - : ::lcl_GetLBRelationsForRelations( _nRel ); - - // Listbox fuellen - std::size_t nCount = ::lcl_GetFrmMapCount(_pMap); - for (std::size_t i = 0; _pMap && i < nCount; ++i) - { -// #61359# Warum nicht von links/von innen bzw. von oben? -// if (!bFormat || (pMap[i].eStrId != SwFPos::FROMLEFT && pMap[i].eStrId != SwFPos::FROMTOP)) - { - SvxSwFramePosString::StringId eStrId = m_aHoriMirrorCB.IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId; - eStrId = lcl_ChangeResIdToVerticalOrRTL(eStrId, m_bIsVerticalFrame, m_bIsInRightToLeft); - String sEntry(m_aFramePosString.GetString(eStrId)); - if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND) - { - // bei zeichengebundenen Rahmen keine doppelten Eintraege einfuegen - _rLB.InsertEntry(sEntry); - } - // #i22341# - add condition to handle map <aVCharMap> - // that is ambigous in the alignment. - if ( _pMap[i].nAlign == _nAlign && - ( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) ) - { - sSelEntry = sEntry; - } - } - } - - _rLB.SelectEntry(sSelEntry); - if (!_rLB.GetSelectEntryCount()) - _rLB.SelectEntry(sOldEntry); - - if (!_rLB.GetSelectEntryCount()) - _rLB.SelectEntryPos(0); - - PosHdl(&_rLB); - - return GetMapPos(_pMap, _rLB); -} - -void SvxSwPosSizeTabPage::SetView( const SdrView* pSdrView ) -{ - m_pSdrView = pSdrView; - if(!m_pSdrView) - { - OSL_FAIL("No SdrView* set"); - return; - } - - // Setzen des Rechtecks und der Workingarea - m_aRect = m_pSdrView->GetAllMarkedRect(); - m_pSdrView->GetSdrPageView()->LogicToPagePos( m_aRect ); - - // get WorkArea - m_aWorkArea = m_pSdrView->GetWorkArea(); - - // Beruecksichtigung Ankerposition (bei Writer) - const SdrMarkList& rMarkList = m_pSdrView->GetMarkedObjectList(); - if( rMarkList.GetMarkCount() >= 1 ) - { - const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - m_aAnchorPos = pObj->GetAnchorPos(); - - if( m_aAnchorPos != Point(0,0) ) // -> Writer - { - for( sal_uInt16 i = 1; i < rMarkList.GetMarkCount(); i++ ) - { - pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); - if( m_aAnchorPos != pObj->GetAnchorPos() ) - { - // different anchor positions -> disable positioning - m_aPositionFL.Enable(sal_False); - m_aHoriFT.Enable(sal_False); - m_aHoriLB.Enable(sal_False); - m_aHoriByFT.Enable(sal_False); - m_aHoriByMF.Enable(sal_False); - m_aHoriToFT.Enable(sal_False); - m_aHoriToLB.Enable(sal_False); - m_aHoriMirrorCB.Enable(sal_False); - m_aVertFT.Enable(sal_False); - m_aVertLB.Enable(sal_False); - m_aVertByFT.Enable(sal_False); - m_aVertByMF.Enable(sal_False); - m_aVertToFT.Enable(sal_False); - m_aVertToLB.Enable(sal_False); - m_aFollowCB.Enable(sal_False); - m_aHoriByMF.SetText(String()); - m_aVertByMF.SetText(String()); - - m_bPositioningDisabled = true; - return; - } - } - } - Point aPt = m_aAnchorPos * -1; - Point aPt2 = aPt; - - aPt += m_aWorkArea.TopLeft(); - m_aWorkArea.SetPos( aPt ); - - aPt2 += m_aRect.TopLeft(); - m_aRect.SetPos( aPt2 ); - } - - // this should happen via SID_ATTR_TRANSFORM_AUTOSIZE - if( rMarkList.GetMarkCount() != 1 ) - m_bIsMultiSelection = true; -#if OSL_DEBUG_LEVEL > 1 - else - { - const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier(); - if( ( pObj->GetObjInventor() == SdrInventor ) && - ( eKind==OBJ_TEXT || eKind==OBJ_TITLETEXT || eKind==OBJ_OUTLINETEXT) && - ( (SdrTextObj*) pObj )->HasText() ) - { - OSL_FAIL("AutoWidth/AutoHeight should be enabled"); - } - } -#endif -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/swpossizetabpage.hrc b/cui/source/tabpages/swpossizetabpage.hrc deleted file mode 100644 index b7e69c27c..000000000 --- a/cui/source/tabpages/swpossizetabpage.hrc +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#define FL_SIZE 1 -#define FT_WIDTH 2 -#define MF_WIDTH 3 -#define FT_HEIGHT 4 -#define MF_HEIGHT 5 -#define CB_KEEPRATIO 6 -#define FL_SEPARATOR 7 -#define FL_ANCHOR 8 -#define RB_TOPAGE 9 -#define RB_TOPARA 10 -#define RB_TOCHAR 11 -#define RB_ASCHAR 12 -#define RB_TOFRAME 13 -#define FL_PROTECTION 14 -#define CB_POSITION 15 -#define CB_SIZE 16 -#define FL_POSITION 17 -#define FT_HORI 18 -#define LB_HORI 19 -#define FT_HORIBY 20 -#define MF_HORIBY 21 -#define FT_HORITO 22 -#define LB_HORITO 23 -#define CB_HORIMIRROR 24 -#define FT_VERT 25 -#define LB_VERT 26 -#define FT_VERTBY 27 -#define MF_VERTBY 28 -#define FT_VERTTO 29 -#define LB_VERTTO 30 -#define CB_FOLLOW 31 -#define WN_EXAMPLE 32 diff --git a/cui/source/tabpages/swpossizetabpage.hxx b/cui/source/tabpages/swpossizetabpage.hxx deleted file mode 100644 index 22821099d..000000000 --- a/cui/source/tabpages/swpossizetabpage.hxx +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_SWPOSSIZETABPAGE_HXX -#define _SVX_SWPOSSIZETABPAGE_HXX - -#include <sfx2/tabdlg.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <vcl/lstbox.hxx> -#include <svx/swframeposstrings.hxx> -#include <svx/swframeexample.hxx> - -// SvxSwPosSizeTabPage - position and size page for Writer drawing objects -struct FrmMap; -class SdrView; -class SvxSwPosSizeTabPage : public SfxTabPage -{ - using TabPage::DeactivatePage; - - FixedLine m_aSizeFL; - FixedText m_aWidthFT; - MetricField m_aWidthMF; - FixedText m_aHeightFT; - MetricField m_aHeightMF; - CheckBox m_aKeepRatioCB; - - FixedLine m_aSeparatorFL; - - FixedLine m_aAnchorFL; - RadioButton m_aToPageRB; - RadioButton m_aToParaRB; - RadioButton m_aToCharRB; - RadioButton m_aAsCharRB; - RadioButton m_aToFrameRB; - - FixedLine m_aProtectionFL; - TriStateBox m_aPositionCB; - TriStateBox m_aSizeCB; - - FixedLine m_aPositionFL; - FixedText m_aHoriFT; - ListBox m_aHoriLB; - FixedText m_aHoriByFT; - MetricField m_aHoriByMF; - FixedText m_aHoriToFT; - ListBox m_aHoriToLB; - - CheckBox m_aHoriMirrorCB; - - FixedText m_aVertFT; - ListBox m_aVertLB; - FixedText m_aVertByFT; - MetricField m_aVertByMF; - FixedText m_aVertToFT; - ListBox m_aVertToLB; - - CheckBox m_aFollowCB; - - SvxSwFrameExample m_aExampleWN; - - Link m_aValidateLink; - - //'string provider' - SvxSwFramePosString m_aFramePosString; - - Rectangle m_aRect; //size of all selected objects - Rectangle m_aWorkArea; - Point m_aAnchorPos; - - FrmMap* m_pVMap; - FrmMap* m_pHMap; - const SdrView* m_pSdrView; - - // initial values - short m_nOldH; - short m_nOldHRel; - short m_nOldV; - short m_nOldVRel; - - double m_fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button - sal_uInt16 m_nHtmlMode; - bool m_bHtmlMode; - bool m_bAtHoriPosModified; - bool m_bAtVertPosModified; - bool m_bIsVerticalFrame; - bool m_bPositioningDisabled; - bool m_bIsMultiSelection; - bool m_bIsInRightToLeft; - - - - DECL_LINK( RangeModifyHdl, Edit * ); - DECL_LINK( AnchorTypeHdl, RadioButton * ); - DECL_LINK( PosHdl, ListBox * ); - DECL_LINK( RelHdl, ListBox * ); - DECL_LINK( MirrorHdl, CheckBox * ); - DECL_LINK( ModifyHdl, Edit * ); - DECL_LINK( ProtectHdl, TriStateBox *); - - void InitPos(short nAnchorType, sal_uInt16 nH, sal_uInt16 nHRel, - sal_uInt16 nV, sal_uInt16 nVRel, - long nX, long nY); - sal_uInt16 GetMapPos(FrmMap *pMap, ListBox &rAlignLB); - short GetAlignment(FrmMap *pMap, sal_uInt16 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB); - short GetRelation(FrmMap *pMap, ListBox &rRelationLB); - short GetAnchorType(bool* pbHasChanged = 0); - sal_uLong FillRelLB(FrmMap *pMap, sal_uInt16 nLBSelPos, sal_uInt16 nAlign, sal_uInt16 nRel, ListBox &rLB, FixedText &rFT); - sal_uInt16 FillPosLB(FrmMap *pMap, sal_uInt16 nAlign, const sal_uInt16 _nRel, ListBox &rLB); - - void UpdateExample(); - -public: - SvxSwPosSizeTabPage( Window* pParent, const SfxItemSet& rInAttrs ); - ~SvxSwPosSizeTabPage(); - - static SfxTabPage* Create( Window*, const SfxItemSet& ); - static sal_uInt16* GetRanges(); - - virtual sal_Bool FillItemSet( SfxItemSet& ); - virtual void Reset( const SfxItemSet & ); - - virtual int DeactivatePage( SfxItemSet* pSet ); - - void EnableAnchorTypes(sal_uInt16 nAnchorEnable); - - void SetValidateFramePosLink( const Link& rLink ) - {m_aValidateLink = rLink;} - - void SetView( const SdrView* pSdrView ); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/swpossizetabpage.src b/cui/source/tabpages/swpossizetabpage.src deleted file mode 100644 index 58b9832c1..000000000 --- a/cui/source/tabpages/swpossizetabpage.src +++ /dev/null @@ -1,313 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include ------------------------------------------------------------------ -#include "helpid.hrc" -#include <cuires.hrc> -#include "swpossizetabpage.hrc" -#include <svx/dialogs.hrc> - - // RID_SVXPAGE_POSITION_SIZE ------------------------------------------------ -TabPage RID_SVXPAGE_SWPOSSIZE -{ - HelpId = HID_SVXPAGE_SWPOSSIZE; - Hide = TRUE ; - Text[ en-US ] = "Position and Size" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_SIZE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 104 , 8 ) ; - Text [ en-US ] = "Size" ; - }; - FixedText FT_WIDTH - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 43 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Width" ; - }; - MetricField MF_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_SWPOSSIZE:MF_WIDTH"; - Pos = MAP_APPFONT ( 59 , 14 ) ; - Size = MAP_APPFONT ( 45 , 12 ) ; - Border = TRUE ; - Text = "12,99" ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 5 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 5 ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_HEIGHT - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 43 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "H~eight" ; - }; - MetricField MF_HEIGHT - { - HelpID = "cui:MetricField:RID_SVXPAGE_SWPOSSIZE:MF_HEIGHT"; - Pos = MAP_APPFONT ( 59 , 30 ) ; - Size = MAP_APPFONT ( 45 , 12 ) ; - Border = TRUE ; - Text = "12,99" ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 5 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = 5 ; - Last = 9999 ; - SpinSize = 10 ; - }; - CheckBox CB_KEEPRATIO - { - HelpID = "cui:CheckBox:RID_SVXPAGE_SWPOSSIZE:CB_KEEPRATIO"; - Pos = MAP_APPFONT ( 12 , 45 ) ; - Size = MAP_APPFONT ( 95 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Keep ratio" ; - }; - FixedLine FL_SEPARATOR - { - Pos = MAP_APPFONT ( 111 , 14 ) ; - Size = MAP_APPFONT ( 4 , 66 ) ; - Vert = TRUE; - }; - FixedLine FL_ANCHOR - { - Pos = MAP_APPFONT ( 116 , 3 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Anchor" ; - }; - RadioButton RB_TOPAGE - { - HelpID = "cui:RadioButton:RID_SVXPAGE_SWPOSSIZE:RB_TOPAGE"; - Pos = MAP_APPFONT ( 122 , 14 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "To ~page"; - }; - RadioButton RB_TOPARA - { - HelpID = "cui:RadioButton:RID_SVXPAGE_SWPOSSIZE:RB_TOPARA"; - Pos = MAP_APPFONT ( 122 , 28 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "To paragrap~h"; - }; - RadioButton RB_TOCHAR - { - HelpID = "cui:RadioButton:RID_SVXPAGE_SWPOSSIZE:RB_TOCHAR"; - Pos = MAP_APPFONT ( 122 , 42 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "To cha~racter"; - }; - RadioButton RB_ASCHAR - { - HelpID = "cui:RadioButton:RID_SVXPAGE_SWPOSSIZE:RB_ASCHAR"; - Pos = MAP_APPFONT ( 122 , 56 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "~As character" ; - }; - RadioButton RB_TOFRAME - { - HelpID = "cui:RadioButton:RID_SVXPAGE_SWPOSSIZE:RB_TOFRAME"; - Hide = TRUE; - Pos = MAP_APPFONT ( 122 , 70 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "To ~frame"; - }; - Window WN_EXAMPLE - { - Pos = MAP_APPFONT ( 202 , 14 ) ; - Size = MAP_APPFONT ( 52 , 66 ) ; - }; - FixedLine FL_PROTECTION - { - Pos = MAP_APPFONT ( 6 , 86 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Protect" ; - }; - TriStateBox CB_POSITION - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_SWPOSSIZE:CB_POSITION"; - Pos = MAP_APPFONT ( 12 , 97 ) ; - Size = MAP_APPFONT ( 113 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Position" ; - }; - TriStateBox CB_SIZE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_SWPOSSIZE:CB_SIZE"; - Pos = MAP_APPFONT ( 122 , 97 ) ; - Size = MAP_APPFONT ( 113 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Size" ; - }; - FixedLine FL_POSITION - { - Pos = MAP_APPFONT ( 6 , 113 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Position" ; - }; - FixedText FT_HORI - { - Pos = MAP_APPFONT ( 12 , 126 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "Hori~zontal" ; - }; - ListBox LB_HORI - { - HelpID = "cui:ListBox:RID_SVXPAGE_SWPOSSIZE:LB_HORI"; - Pos = MAP_APPFONT ( 49 , 124 ) ; - Size = MAP_APPFONT ( 50 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedText FT_HORIBY - { - Pos = MAP_APPFONT ( 101 , 126 ) ; - Size = MAP_APPFONT ( 20 , 8 ) ; - Center = TRUE ; - Text [ en-US ] = "b~y" ; - }; - MetricField MF_HORIBY - { - HelpID = "cui:MetricField:RID_SVXPAGE_SWPOSSIZE:MF_HORIBY"; - Border = TRUE ; - Pos = MAP_APPFONT ( 123 , 124 ) ; - Size = MAP_APPFONT ( 35 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -9999 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = -9999 ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_HORITO - { - Pos = MAP_APPFONT ( 160 , 126 ) ; - Size = MAP_APPFONT ( 21 , 8 ) ; - Center = TRUE ; - Text [ en-US ] = "~to" ; - }; - ListBox LB_HORITO - { - HelpID = "cui:ListBox:RID_SVXPAGE_SWPOSSIZE:LB_HORITO"; - Pos = MAP_APPFONT ( 183 , 124 ) ; - Size = MAP_APPFONT ( 65 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - CheckBox CB_HORIMIRROR - { - HelpID = "cui:CheckBox:RID_SVXPAGE_SWPOSSIZE:CB_HORIMIRROR"; - Pos = MAP_APPFONT ( 12 , 139 ) ; - Size = MAP_APPFONT ( 236 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Mirror on even pages" ; - }; - FixedText FT_VERT - { - Pos = MAP_APPFONT ( 12 , 155 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Vertical" ; - }; - ListBox LB_VERT - { - HelpID = "cui:ListBox:RID_SVXPAGE_SWPOSSIZE:LB_VERT"; - Pos = MAP_APPFONT ( 49 , 153 ) ; - Size = MAP_APPFONT ( 50 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedText FT_VERTBY - { - Pos = MAP_APPFONT ( 101 , 155 ) ; - Size = MAP_APPFONT ( 20 , 8 ) ; - Center = TRUE ; - Text [ en-US ] = "by" ; - }; - MetricField MF_VERTBY - { - HelpID = "cui:MetricField:RID_SVXPAGE_SWPOSSIZE:MF_VERTBY"; - Border = TRUE ; - Pos = MAP_APPFONT ( 123 , 153 ) ; - Size = MAP_APPFONT ( 35 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -9999 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - First = -9999 ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_VERTTO - { - Pos = MAP_APPFONT ( 160 , 155 ) ; - Size = MAP_APPFONT ( 21 , 8 ) ; - Center = TRUE ; - Text [ en-US ] = "t~o" ; - }; - ListBox LB_VERTTO - { - HelpID = "cui:ListBox:RID_SVXPAGE_SWPOSSIZE:LB_VERTTO"; - Pos = MAP_APPFONT ( 183 , 153 ) ; - Size = MAP_APPFONT ( 65 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - CheckBox CB_FOLLOW - { - HelpID = "cui:CheckBox:RID_SVXPAGE_SWPOSSIZE:CB_FOLLOW"; - Pos = MAP_APPFONT ( 12 , 168 ) ; - Size = MAP_APPFONT ( 113 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Follow text flow" ; - }; -}; diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx deleted file mode 100644 index 95491d538..000000000 --- a/cui/source/tabpages/tabarea.cxx +++ /dev/null @@ -1,351 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <tools/ref.hxx> -#include <sfx2/app.hxx> -#include <sfx2/objsh.hxx> -#include <vcl/msgbox.hxx> -#include <unotools/pathoptions.hxx> -#include <svx/svdmark.hxx> -#include <svx/svdobj.hxx> -#include <svx/svdview.hxx> -#include <svx/dialogs.hrc> - -#define _SVX_TABAREA_CXX - -#include <cuires.hrc> -#include <svx/xtable.hxx> -#include "svx/globl3d.hxx" -#include <svx/svdmodel.hxx> -#include "svx/drawitem.hxx" -#include "cuitabarea.hxx" -#include "tabarea.hrc" -#include "dlgname.hxx" -#include <dialmgr.hxx> - -#define DLGWIN this->GetParent()->GetParent() - -/************************************************************************* -|* -|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu -|* -|************************************************************************/ - -SvxAreaTabDialog::SvxAreaTabDialog -( - Window* pParent, - const SfxItemSet* pAttr, - SdrModel* pModel, - const SdrView* /* pSdrView */ -) : - - SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_AREA ), pAttr ), - - mpDrawModel ( pModel ), - mpColorTab ( pModel->GetColorTable() ), - mpNewColorTab ( pModel->GetColorTable() ), - mpGradientList ( pModel->GetGradientList() ), - mpNewGradientList ( pModel->GetGradientList() ), - mpHatchingList ( pModel->GetHatchList() ), - mpNewHatchingList ( pModel->GetHatchList() ), - mpBitmapList ( pModel->GetBitmapList() ), - mpNewBitmapList ( pModel->GetBitmapList() ), - mrOutAttrs ( *pAttr ), - mnColorTableState ( CT_NONE ), - mnBitmapListState ( CT_NONE ), - mnGradientListState ( CT_NONE ), - mnHatchingListState ( CT_NONE ), - mnPageType( PT_AREA ), - mnDlgType( 0 ), - mnPos( 0 ), - mbAreaTP( sal_False ), - mbDeleteColorTable( sal_True ) -{ - FreeResource(); - - AddTabPage( RID_SVXPAGE_AREA, SvxAreaTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_SHADOW, SvxShadowTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create, 0); - AddTabPage( RID_SVXPAGE_COLOR, SvxColorTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_GRADIENT, SvxGradientTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_HATCH, SvxHatchTabPage::Create, 0 ); - AddTabPage( RID_SVXPAGE_BITMAP, SvxBitmapTabPage::Create, 0); - - SetCurPageId( RID_SVXPAGE_AREA ); - - CancelButton& rBtnCancel = GetCancelButton(); - rBtnCancel.SetClickHdl( LINK( this, SvxAreaTabDialog, CancelHdlImpl ) ); -//! rBtnCancel.SetText( CUI_RESSTR( RID_SVXSTR_CLOSE ) ); -} - -// ----------------------------------------------------------------------- - -SvxAreaTabDialog::~SvxAreaTabDialog() -{ -} - - -// ----------------------------------------------------------------------- - -void SvxAreaTabDialog::SavePalettes() -{ - SfxObjectShell* pShell = SfxObjectShell::Current(); - if( mpNewColorTab != mpDrawModel->GetColorTable() ) - { - if(mbDeleteColorTable) - delete mpDrawModel->GetColorTable(); - mpDrawModel->SetColorTable( mpNewColorTab ); - SvxColorTableItem aColorTableItem( mpNewColorTab, SID_COLOR_TABLE ); - if ( pShell ) - pShell->PutItem( aColorTableItem ); - else - { - mpDrawModel->GetItemPool().Put(aColorTableItem,SID_COLOR_TABLE); - } - mpColorTab = mpDrawModel->GetColorTable(); - } - if( mpNewGradientList != mpDrawModel->GetGradientList() ) - { - delete mpDrawModel->GetGradientList(); - mpDrawModel->SetGradientList( mpNewGradientList ); - SvxGradientListItem aItem( mpNewGradientList, SID_GRADIENT_LIST ); - if ( pShell ) - pShell->PutItem( aItem ); - else - { - mpDrawModel->GetItemPool().Put(aItem,SID_GRADIENT_LIST); - } - mpGradientList = mpDrawModel->GetGradientList(); - } - if( mpNewHatchingList != mpDrawModel->GetHatchList() ) - { - delete mpDrawModel->GetHatchList(); - mpDrawModel->SetHatchList( mpNewHatchingList ); - SvxHatchListItem aItem( mpNewHatchingList, SID_HATCH_LIST ); - if ( pShell ) - pShell->PutItem( aItem ); - else - { - mpDrawModel->GetItemPool().Put(aItem,SID_HATCH_LIST); - } - mpHatchingList = mpDrawModel->GetHatchList(); - } - if( mpNewBitmapList != mpDrawModel->GetBitmapList() ) - { - delete mpDrawModel->GetBitmapList(); - mpDrawModel->SetBitmapList( mpNewBitmapList ); - SvxBitmapListItem aItem( mpNewBitmapList, SID_BITMAP_LIST ); - if ( pShell ) - pShell->PutItem( aItem ); - else - { - mpDrawModel->GetItemPool().Put(aItem,SID_BITMAP_LIST); - } - mpBitmapList = mpDrawModel->GetBitmapList(); - } - - // Speichern der Tabellen, wenn sie geaendert wurden. - - const String aPath( SvtPathOptions().GetPalettePath() ); - - if( mnHatchingListState & CT_MODIFIED ) - { - mpHatchingList->SetPath( aPath ); - mpHatchingList->Save(); - - SvxHatchListItem aItem( mpHatchingList, SID_HATCH_LIST ); - // ToolBoxControls werden benachrichtigt: - if ( pShell ) - pShell->PutItem( aItem ); - else - { - mpDrawModel->GetItemPool().Put(aItem); - } - } - - if( mnBitmapListState & CT_MODIFIED ) - { - mpBitmapList->SetPath( aPath ); - mpBitmapList->Save(); - - SvxBitmapListItem aItem( mpBitmapList, SID_BITMAP_LIST ); - // ToolBoxControls werden benachrichtigt: - if ( pShell ) - pShell->PutItem( aItem ); - else - { - mpDrawModel->GetItemPool().Put(aItem); - } - } - - if( mnGradientListState & CT_MODIFIED ) - { - mpGradientList->SetPath( aPath ); - mpGradientList->Save(); - - SvxGradientListItem aItem( mpGradientList, SID_GRADIENT_LIST ); - // ToolBoxControls werden benachrichtigt: - if ( pShell ) - pShell->PutItem( aItem ); - else - { - mpDrawModel->GetItemPool().Put(aItem); - } - } - - if( mnColorTableState & CT_MODIFIED ) - { - mpColorTab->SetPath( aPath ); - mpColorTab->Save(); - - SvxColorTableItem aItem( mpColorTab, SID_COLOR_TABLE ); - // ToolBoxControls werden benachrichtigt: - if ( pShell ) - pShell->PutItem( aItem ); - else - { - mpDrawModel->GetItemPool().Put(aItem); - } - } -} -// ----------------------------------------------------------------------- - -short SvxAreaTabDialog::Ok() -{ - SavePalettes(); - - // Es wird RET_OK zurueckgeliefert, wenn wenigstens eine - // TabPage in FillItemSet() sal_True zurueckliefert. Dieses - // geschieht z.Z. standardmaessig. - return( SfxTabDialog::Ok() ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxAreaTabDialog, CancelHdlImpl, void *, EMPTYARG) -{ - SavePalettes(); - - EndDialog( RET_CANCEL ); - return 0; -} -IMPL_LINK_INLINE_END( SvxAreaTabDialog, CancelHdlImpl, void *, p ) - -// ----------------------------------------------------------------------- - -void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) -{ - switch( nId ) - { - case RID_SVXPAGE_AREA: - ( (SvxAreaTabPage&) rPage ).SetColorTable( mpColorTab ); - ( (SvxAreaTabPage&) rPage ).SetGradientList( mpGradientList ); - ( (SvxAreaTabPage&) rPage ).SetHatchingList( mpHatchingList ); - ( (SvxAreaTabPage&) rPage ).SetBitmapList( mpBitmapList ); - ( (SvxAreaTabPage&) rPage ).SetPageType( mnPageType ); - ( (SvxAreaTabPage&) rPage ).SetDlgType( mnDlgType ); - ( (SvxAreaTabPage&) rPage ).SetPos( mnPos ); - ( (SvxAreaTabPage&) rPage ).SetAreaTP( &mbAreaTP ); - ( (SvxAreaTabPage&) rPage ).SetGrdChgd( &mnGradientListState ); - ( (SvxAreaTabPage&) rPage ).SetHtchChgd( &mnHatchingListState ); - ( (SvxAreaTabPage&) rPage ).SetBmpChgd( &mnBitmapListState ); - ( (SvxAreaTabPage&) rPage ).SetColorChgd( &mnColorTableState ); - ( (SvxAreaTabPage&) rPage ).Construct(); - // ActivatePage() wird das erste mal nicht gerufen - ( (SvxAreaTabPage&) rPage ).ActivatePage( mrOutAttrs ); - - break; - - case RID_SVXPAGE_SHADOW: - { - ( (SvxShadowTabPage&) rPage ).SetColorTable( mpColorTab ); - ( (SvxShadowTabPage&) rPage ).SetPageType( mnPageType ); - ( (SvxShadowTabPage&) rPage ).SetDlgType( mnDlgType ); - ( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP ); - ( (SvxShadowTabPage&) rPage ).SetColorChgd( &mnColorTableState ); - ( (SvxShadowTabPage&) rPage ).Construct(); - } - break; - - case RID_SVXPAGE_GRADIENT: - ( (SvxGradientTabPage&) rPage ).SetColorTable( mpColorTab ); - ( (SvxGradientTabPage&) rPage ).SetGradientList( mpGradientList ); - ( (SvxGradientTabPage&) rPage ).SetPageType( &mnPageType ); - ( (SvxGradientTabPage&) rPage ).SetDlgType( &mnDlgType ); - ( (SvxGradientTabPage&) rPage ).SetPos( &mnPos ); - ( (SvxGradientTabPage&) rPage ).SetAreaTP( &mbAreaTP ); - ( (SvxGradientTabPage&) rPage ).SetGrdChgd( &mnGradientListState ); - ( (SvxGradientTabPage&) rPage ).SetColorChgd( &mnColorTableState ); - ( (SvxGradientTabPage&) rPage ).Construct(); - break; - - case RID_SVXPAGE_HATCH: - ( (SvxHatchTabPage&) rPage ).SetColorTable( mpColorTab ); - ( (SvxHatchTabPage&) rPage ).SetHatchingList( mpHatchingList ); - ( (SvxHatchTabPage&) rPage ).SetPageType( &mnPageType ); - ( (SvxHatchTabPage&) rPage ).SetDlgType( &mnDlgType ); - ( (SvxHatchTabPage&) rPage ).SetPos( &mnPos ); - ( (SvxHatchTabPage&) rPage ).SetAreaTP( &mbAreaTP ); - ( (SvxHatchTabPage&) rPage ).SetHtchChgd( &mnHatchingListState ); - ( (SvxHatchTabPage&) rPage ).SetColorChgd( &mnColorTableState ); - ( (SvxHatchTabPage&) rPage ).Construct(); - break; - - case RID_SVXPAGE_BITMAP: - ( (SvxBitmapTabPage&) rPage ).SetColorTable( mpColorTab ); - ( (SvxBitmapTabPage&) rPage ).SetBitmapList( mpBitmapList ); - ( (SvxBitmapTabPage&) rPage ).SetPageType( &mnPageType ); - ( (SvxBitmapTabPage&) rPage ).SetDlgType( &mnDlgType ); - ( (SvxBitmapTabPage&) rPage ).SetPos( &mnPos ); - ( (SvxBitmapTabPage&) rPage ).SetAreaTP( &mbAreaTP ); - ( (SvxBitmapTabPage&) rPage ).SetBmpChgd( &mnBitmapListState ); - ( (SvxBitmapTabPage&) rPage ).SetColorChgd( &mnColorTableState ); - ( (SvxBitmapTabPage&) rPage ).Construct(); - break; - - case RID_SVXPAGE_COLOR: - ( (SvxColorTabPage&) rPage ).SetColorTable( mpColorTab ); - ( (SvxColorTabPage&) rPage ).SetPageType( &mnPageType ); - ( (SvxColorTabPage&) rPage ).SetDlgType( &mnDlgType ); - ( (SvxColorTabPage&) rPage ).SetPos( &mnPos ); - ( (SvxColorTabPage&) rPage ).SetAreaTP( &mbAreaTP ); - ( (SvxColorTabPage&) rPage ).SetColorChgd( &mnColorTableState ); - ( (SvxColorTabPage&) rPage ).SetDeleteColorTable( mbDeleteColorTable ); - ( (SvxColorTabPage&) rPage ).Construct(); - break; - - case RID_SVXPAGE_TRANSPARENCE: - ( (SvxTransparenceTabPage&) rPage ).SetPageType( mnPageType ); - ( (SvxTransparenceTabPage&) rPage ).SetDlgType( mnDlgType ); - ( (SvxTransparenceTabPage&) rPage ).Construct(); - break; - - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tabarea.hrc b/cui/source/tabpages/tabarea.hrc deleted file mode 100644 index efb48ff7a..000000000 --- a/cui/source/tabpages/tabarea.hrc +++ /dev/null @@ -1,191 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#define BTN_LOAD 5 -#define BTN_SAVE 6 -#define GRP_FILL 1 -#define GRP_SHADOW 2 -#define GRP_PREVIEW 3 -#define GRP_TRANSPARENT 4 -#define GRP_STEPCOUNT 5 -#define CTL_PREVIEW 1 -#define CTL_POSITION 2 -//#define CTL_GRADIENT_PREVIEW 3 -//#define CTL_HATCHING_PREVIEW 4 -#define CTL_COLOR_PREVIEW 5 -#define CTL_BITMAP_PREVIEW 6 -#define MTR_FLD_DISTANCE 1 -#define TSB_INVISIBLE 1 -#define TSB_SHOW_SHADOW 2 -#define TSB_STEPCOUNT 3 -#define TSB_TILE 4 -#define TSB_STRETCH 5 -#define TSB_ORIGINAL 6 -#define AREADLG_INVISIBLE 0 -#define AREADLG_COLOR 1 -#define AREADLG_GRADIENT 2 -#define AREADLG_HATCH 3 -#define AREADLG_BITMAP 4 - -#define LB_COLOR 1 -#define LB_GRADIENT 2 -#define LB_HATCHING 3 -#define LB_BITMAP 4 -//#define LB_TRANSPARENT 5 -#define LB_BITMAPS 4 -#define LB_BACKGROUND_COLOR 3 -#define LB_DLG_TYPE 99 -#define GRP_COLOR 1 -#define BTN_ADD 1 -#define BTN_IMPORT 2 -#define BTN_MODIFY 3 -#define BTN_DELETE 4 -#define FT_COLOR 1 -#define FT_BACKGROUND_COLOR 2 -#define FT_POSITION 2 -#define FT_DISTANCE 1 -#define FT_LINE_COLOR 2 -#define FT_LINE_TYPE 1 -#define FT_LINE_DISTANCE 3 -#define FT_LINE_ANGLE 4 -#define GRP_LINE 1 -#define GRP_HATCHINGS 5 -#define MTR_FLD_ANGLE 3 -#define CTL_ANGLE 2 -#define LB_HATCHINGS 4 -#define LB_LINE_TYPE 1 -#define LB_LINE_COLOR 3 -#define GRP_GRADIENTS 4 -#define GRP_GRADIENT_TYPE 5 -#define LB_GRADIENTS 3 -#define LB_GRADIENT_TYPES 4 -#define LB_COLOR_FROM 1 -#define LB_COLOR_TO 2 -#define FT_COLOR_FROM 1 -#define FT_COLOR_TO 2 -#define FT_CENTER_X 3 -#define FT_CENTER_Y 5 -#define FT_ANGLE 4 -#define FT_BORDER 6 -#define MTR_COLOR_FROM 4 -#define MTR_COLOR_TO 5 -#define MTR_CENTER_X 2 -#define MTR_CENTER_Y 3 -#define MTR_BORDER 6 -#define MTR_ANGLE 1 -#define NUM_FLD_STEPCOUNT 1 -#define FT_PIXEL_EDIT 4 -#define CTL_PIXEL 2 -#define FT_TYPE 7 -#define FT_SHADOW_COLOR 10 -#define LB_SHADOW_COLOR 10 -#define FL_PROP 2 -#define FL_SIZE 3 -#define FL_POSITION 4 -#define FL_OFFSET 5 -#define FL_STEPCOUNT 7 - -// Farben definieren TabPage -// nur temporaer !!! -// #define RID_SVXPAGE_COLOR 999 - -//#define GRP_COLORTABLE 1 -//#define GRP_COLORMODEL 2 - -#define BTN_WORK_ON 2 -#define CTL_COLORTABLE 3 -#define CTL_PREVIEW_OLD 1 -#define CTL_PREVIEW_NEW 2 -#define FT_NAME 2 -#define EDT_NAME 1 -// #define LB_COLOR 1 -#define LB_COLORMODEL 2 -#define FT_1 3 -#define FT_2 4 -#define FT_3 5 -#define FT_4 6 -#define MTR_FLD_1 1 -#define MTR_FLD_2 2 -#define MTR_FLD_3 3 -#define MTR_FLD_4 4 -#define FT_TABLE_NAME 7 -#define MTR_FLD_X_SIZE 4 -#define MTR_FLD_Y_SIZE 5 -#define GRP_SIZE 6 -#define TSB_SCALE 1 -#define GRP_POSITION 7 -#define FT_X_OFFSET 1 -#define FT_Y_OFFSET 2 -#define MTR_FLD_X_OFFSET 1 -#define MTR_FLD_Y_OFFSET 2 -#define LB_AREA_TYPE 19 -#define RBT_ROW 6 -#define RBT_COLUMN 7 -#define MTR_FLD_OFFSET 3 -#define GRP_OFFSET 8 - -#define FT_TRANSPARENT 9 -#define FT_X_SIZE 10 -#define FT_Y_SIZE 11 -#define FT_BITMAPS_HIDDEN 12 - -#define RBT_TRANS_OFF 8 -#define RBT_TRANS_LINEAR 9 -#define RBT_TRANS_GRADIENT 10 -#define GRP_TRANS_MODE 9 -#define GRP_TRANS_GRADIENT 10 -#define CTL_TRANS_PREVIEW 19 - -#define FT_TRGR_TYPE 12 -#define LB_TRGR_GRADIENT_TYPES 3 -#define FT_TRGR_CENTER_X 13 -#define MTR_TRGR_CENTER_X 4 -#define FT_TRGR_CENTER_Y 14 -#define MTR_TRGR_CENTER_Y 5 -#define FT_TRGR_ANGLE 15 -#define MTR_TRGR_ANGLE 6 -#define FT_TRGR_BORDER 16 -#define MTR_TRGR_BORDER 7 -#define FT_TRGR_START_VALUE 17 -#define MTR_TRGR_START_VALUE 8 -#define FT_TRGR_END_VALUE 18 -#define MTR_TRGR_END_VALUE 9 -#define MTR_TRANSPARENT 10 - -#define MTR_SHADOW_TRANSPARENT 11 - -// Hatch-Background on Area-TabPage -#define GRP_HATCHBCKGRD 20 -#define CB_HATCHBCKGRD 21 -#define LB_HATCHBCKGRDCOLOR 22 - - -#define IMG_LOAD_H 23 -#define IMG_SAVE_H 24 -// IAccessibility2 implementation 2009 ------ -#define STR_CUI_COLORMODEL 5030 -#define STR_LB_HATCHINGSTYLE 5031 -// ------ IAccessibility2 implementation 2009. diff --git a/cui/source/tabpages/tabarea.src b/cui/source/tabpages/tabarea.src deleted file mode 100644 index 24b4c1068..000000000 --- a/cui/source/tabpages/tabarea.src +++ /dev/null @@ -1,1557 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include "helpid.hrc" -#include <cuires.hrc> -#include "tabarea.hrc" -#include <svx/dialogs.hrc> - -#define MASKCOLOR MaskColor = Color{ Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; - - - // RID_SVXPAGE_AREA ------------------------------------------------------ -#define TRANS_GRAD_OFFSET_X 6 -#define TRANS_GRAD_OFFSET_Y 64 -#define TRANS_GRAD_FIELD_SEPARATION 24 - -TabPage RID_SVXPAGE_TRANSPARENCE -{ - HelpID = HID_AREA_TRANSPARENCE; - Hide = TRUE; - Size = MAP_APPFONT ( 260 , 185 ); - FixedLine FL_PROP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248, 8 ) ; - Text [ en-US ] = "Transparency mode"; - }; - RadioButton RBT_TRANS_OFF - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TRANSPARENCE:RBT_TRANS_OFF"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 110 , 10 ) ; - Text [ en-US ] = "~No transparency"; - }; - RadioButton RBT_TRANS_LINEAR - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TRANSPARENCE:RBT_TRANS_LINEAR"; - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 60 , 10 ) ; - Text [ en-US ] = "~Transparency"; - }; - MetricField MTR_TRANSPARENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_TRANSPARENCE:MTR_TRANSPARENT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 26 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - RadioButton RBT_TRANS_GRADIENT - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TRANSPARENCE:RBT_TRANS_GRADIENT"; - Pos = MAP_APPFONT ( 12 , 42 ) ; - Size = MAP_APPFONT ( 110 , 10 ) ; - Text [ en-US ] = "Gradient"; - }; - FixedText FT_TRGR_TYPE - { - Pos = MAP_APPFONT ( 21 , 56 ) ; - Size = MAP_APPFONT ( 41 , 8 ) ; - Text [ en-US ] = "Ty~pe"; - }; - ListBox LB_TRGR_GRADIENT_TYPES - { - HelpID = "cui:ListBox:RID_SVXPAGE_TRANSPARENCE:LB_TRGR_GRADIENT_TYPES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 54 ) ; - Size = MAP_APPFONT ( 53 , 63 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Linear" ; Default ; > ; - < "Axial" ; Default ; > ; - < "Radial" ; Default ; > ; - < "Ellipsoid" ; Default ; > ; - < "Quadratic" ; Default ; > ; - < "Square" ; Default ; > ; - }; - }; - FixedText FT_TRGR_CENTER_X - { - Pos = MAP_APPFONT ( 21 , 72 ) ; - Size = MAP_APPFONT ( 41 , 8 ) ; - Text [ en-US ] = "Center ~X"; - }; - MetricField MTR_TRGR_CENTER_X - { - HelpID = "cui:MetricField:RID_SVXPAGE_TRANSPARENCE:MTR_TRGR_CENTER_X"; - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 70 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedText FT_TRGR_CENTER_Y - { - Pos = MAP_APPFONT ( 21 , 88 ) ; - Size = MAP_APPFONT ( 41 , 8 ) ; - Text [ en-US ] = "Center ~Y"; - }; - MetricField MTR_TRGR_CENTER_Y - { - HelpID = "cui:MetricField:RID_SVXPAGE_TRANSPARENCE:MTR_TRGR_CENTER_Y"; - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 86 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedText FT_TRGR_ANGLE - { - Pos = MAP_APPFONT ( 21 , 104 ) ; - Size = MAP_APPFONT ( 41 , 8 ) ; - Text [ en-US ] = "~Angle"; - }; - MetricField MTR_TRGR_ANGLE - { - HelpID = "cui:MetricField:RID_SVXPAGE_TRANSPARENCE:MTR_TRGR_ANGLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 102 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 359 ; - Unit = FUNIT_CUSTOM ; - Last = 359 ; - SpinSize = 15 ; - CustomUnitText [ en-US ] = " degrees"; - }; - FixedText FT_TRGR_BORDER - { - Pos = MAP_APPFONT ( 15 + TRANS_GRAD_OFFSET_X, 56 + TRANS_GRAD_OFFSET_Y) ; - Size = MAP_APPFONT ( 41, 8 ) ; - Text [ en-US ] = "~Border"; - }; - MetricField MTR_TRGR_BORDER - { - HelpID = "cui:MetricField:RID_SVXPAGE_TRANSPARENCE:MTR_TRGR_BORDER"; - Border = TRUE ; - Pos = MAP_APPFONT ( 66 + TRANS_GRAD_OFFSET_X, 54 + TRANS_GRAD_OFFSET_Y) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedText FT_TRGR_START_VALUE - { - Pos = MAP_APPFONT ( 21 , 136 ) ; - Size = MAP_APPFONT ( 41 , 8 ) ; - Text [ en-US ] = "~Start value"; - }; - MetricField MTR_TRGR_START_VALUE - { - HelpID = "cui:MetricField:RID_SVXPAGE_TRANSPARENCE:MTR_TRGR_START_VALUE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 134 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedText FT_TRGR_END_VALUE - { - Pos = MAP_APPFONT ( 21 , 152 ) ; - Size = MAP_APPFONT ( 41 , 8 ) ; - Text [ en-US ] = "~End value"; - }; - MetricField MTR_TRGR_END_VALUE - { - HelpID = "cui:MetricField:RID_SVXPAGE_TRANSPARENCE:MTR_TRGR_END_VALUE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 150 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - Control CTL_BITMAP_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 138 , 14 ) ; - Size = MAP_APPFONT ( 110 , 42 ) ; - }; - Control CTL_TRANS_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 138 , 14 ) ; - Size = MAP_APPFONT ( 110 , 42 ) ; - }; - Text [ en-US ] = "Transparency"; -}; - - // RID_SVXPAGE_AREA ------------------------------------------------------ -TabPage RID_SVXPAGE_AREA -{ - Size = MAP_APPFONT ( 260 , 185 ) ; - HelpID = HID_AREA_AREA ; - Hide = TRUE ; - Text [ en-US ] = "Area" ; - - FixedLine FL_PROP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 120, 8 ) ; - Text [ en-US ] = "Fill"; - }; - ListBox LB_AREA_TYPE - { - HelpID = "cui:ListBox:RID_SVXPAGE_AREA:LB_AREA_TYPE"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 108 , 60 ) ; - DropDown = TRUE; - Border = TRUE; - StringList [ en-US ] = - { - < "None" ; Default ; > ; - < "Color" ; Default ; > ; - < "Gradient" ; Default ; > ; - < "Hatching" ; Default ; > ; - < "Bitmap" ; Default ; > ; - }; - }; - - - ListBox LB_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_AREA:LB_COLOR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 30 ) ; - Size = MAP_APPFONT ( 108 , 103 ) ; - TabStop = TRUE ; - }; - ListBox LB_GRADIENT - { - HelpID = "cui:ListBox:RID_SVXPAGE_AREA:LB_GRADIENT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 30 ) ; - Size = MAP_APPFONT ( 108 , 103 ) ; - TabStop = TRUE ; - }; - ListBox LB_HATCHING - { - HelpID = "cui:ListBox:RID_SVXPAGE_AREA:LB_HATCHING"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 30 ) ; - Size = MAP_APPFONT ( 108 , 103 ) ; - TabStop = TRUE ; - }; - ListBox LB_BITMAP - { - HelpID = "cui:ListBox:RID_SVXPAGE_AREA:LB_BITMAP"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 30 ) ; - Size = MAP_APPFONT ( 108 , 103 ) ; - TabStop = TRUE ; - }; - - // ---------- preview ---------- - - Control CTL_COLOR_PREVIEW - { - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 137 ) ; - Size = MAP_APPFONT ( 110 , 42 ) ; - }; - Control CTL_BITMAP_PREVIEW - { - Border = TRUE; - Pos = MAP_APPFONT ( 12 , 137 ) ; - Size = MAP_APPFONT ( 110 , 42 ) ; - Hide = TRUE ; - }; - - // ---------- for gradients ---------- - - FixedLine FL_STEPCOUNT - { - Pos = MAP_APPFONT ( 132 , 3 ) ; - Size = MAP_APPFONT ( 122 , 8 ) ; - Text [ en-US ] = "Increments" ; - }; - TriStateBox TSB_STEPCOUNT - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_AREA:TSB_STEPCOUNT"; - Pos = MAP_APPFONT ( 138 , 15 ) ; - Size = MAP_APPFONT ( 68 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "A~utomatic" ; - }; - NumericField NUM_FLD_STEPCOUNT - { - HelpID = "cui:NumericField:RID_SVXPAGE_AREA:NUM_FLD_STEPCOUNT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 208 , 14 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 3 ; - First = 3 ; - Maximum = 256 ; - Last = 256 ; - StrictFormat = TRUE ; - }; - - // ---------- for hatches ---------- - - CheckBox CB_HATCHBCKGRD - { - HelpID = "cui:CheckBox:RID_SVXPAGE_AREA:CB_HATCHBCKGRD"; - Pos = MAP_APPFONT ( 132 , 3 ) ; - Size = MAP_APPFONT ( 122 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Background color" ; - }; - ListBox LB_HATCHBCKGRDCOLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_AREA:LB_HATCHBCKGRDCOLOR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 141 , 16 ) ; - Size = MAP_APPFONT ( 70 , 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - - // ---------- for bitmaps ---------- - - FixedLine FL_SIZE - { - Pos = MAP_APPFONT ( 132 , 3 ) ; - Size = MAP_APPFONT ( 122 , 8 ) ; - Text [ en-US ] = "Size" ; - }; - TriStateBox TSB_ORIGINAL - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_AREA:TSB_ORIGINAL"; - Pos = MAP_APPFONT ( 138 , 15 ) ; - Size = MAP_APPFONT ( 48 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Original" ; - }; - TriStateBox TSB_SCALE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_AREA:TSB_SCALE"; - Pos = MAP_APPFONT ( 138 , 30 ) ; - Size = MAP_APPFONT ( 48 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Re~lative" ; - }; - FixedText FT_X_SIZE - { - Pos = MAP_APPFONT ( 187 , 15 ) ; - Size = MAP_APPFONT ( 24 , 8 ) ; - Text [ en-US ] = "Wi~dth" ; - }; - MetricField MTR_FLD_X_SIZE - { - HelpID = "cui:MetricField:RID_SVXPAGE_AREA:MTR_FLD_X_SIZE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 212 , 14 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - CustomUnitText = "%" ; - Minimum = 5 ; - Maximum = 100 ; - First = 5 ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedText FT_Y_SIZE - { - Pos = MAP_APPFONT ( 187 , 31 ) ; - Size = MAP_APPFONT ( 24 , 8 ) ; - Text [ en-US ] = "H~eight" ; - }; - MetricField MTR_FLD_Y_SIZE - { - HelpID = "cui:MetricField:RID_SVXPAGE_AREA:MTR_FLD_Y_SIZE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 212 , 29 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - CustomUnitText = "%" ; - Minimum = 5 ; - Maximum = 100 ; - First = 5 ; - Last = 100 ; - SpinSize = 5 ; - SpinSize = 5 ; - }; - FixedLine FL_POSITION - { - Pos = MAP_APPFONT ( 132 , 47 ) ; - Size = MAP_APPFONT ( 122 , 8 ) ; - Text [ en-US ] = "Position" ; - }; - - Control CTL_POSITION - { - Border = TRUE ; - Pos = MAP_APPFONT ( 138 , 57 ) ; - Size = MAP_APPFONT ( 40 , 27 ) ; - TabStop = TRUE ; - }; - FixedText FT_X_OFFSET - { - Pos = MAP_APPFONT ( 138 , 89 ) ; - Size = MAP_APPFONT ( 39 , 8 ) ; - Text [ en-US ] = "~X Offset" ; - }; - FixedText FT_Y_OFFSET - { - Pos = MAP_APPFONT ( 139 , 104 ) ; - Size = MAP_APPFONT ( 78 , 8 ) ; - Text [ en-US ] = "~Y Offset" ; - }; - MetricField MTR_FLD_X_OFFSET - { - HelpID = "cui:MetricField:RID_SVXPAGE_AREA:MTR_FLD_X_OFFSET"; - Border = TRUE ; - Pos = MAP_APPFONT ( 219 , 87 ) ; - Size = MAP_APPFONT ( 29 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Maximum = 100 ; - Last = 100 ; - SpinSize = 5 ; - }; - MetricField MTR_FLD_Y_OFFSET - { - HelpID = "cui:MetricField:RID_SVXPAGE_AREA:MTR_FLD_Y_OFFSET"; - Border = TRUE ; - Pos = MAP_APPFONT ( 219 , 102 ) ; - Size = MAP_APPFONT ( 29 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - TriStateBox TSB_TILE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_AREA:TSB_TILE"; - Pos = MAP_APPFONT ( 138 , 117 ) ; - Size = MAP_APPFONT ( 54 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Tile" ; - }; - TriStateBox TSB_STRETCH - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_AREA:TSB_STRETCH"; - Pos = MAP_APPFONT ( 194 , 117 ) ; - Size = MAP_APPFONT ( 54 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Auto~Fit" ; - }; - FixedLine FL_OFFSET - { - Pos = MAP_APPFONT ( 132 , 133 ) ; - Size = MAP_APPFONT ( 122 , 8 ) ; - Text [ en-US ] = "Offset" ; - }; - RadioButton RBT_ROW - { - HelpID = "cui:RadioButton:RID_SVXPAGE_AREA:RBT_ROW"; - Pos = MAP_APPFONT ( 138 , 144 ) ; - Size = MAP_APPFONT ( 75 , 10 ) ; - Text [ en-US ] = "Ro~w" ; - }; - RadioButton RBT_COLUMN - { - HelpID = "cui:RadioButton:RID_SVXPAGE_AREA:RBT_COLUMN"; - Pos = MAP_APPFONT ( 138 , 158 ) ; - Size = MAP_APPFONT ( 75 , 10 ) ; - Text [ en-US ] = "Colu~mn" ; - }; - MetricField MTR_FLD_OFFSET - { - HelpID = "cui:MetricField:RID_SVXPAGE_AREA:MTR_FLD_OFFSET"; - Border = TRUE ; - Pos = MAP_APPFONT ( 219 , 157 ) ; - Size = MAP_APPFONT ( 29 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; -}; - // RID_SVXPAGE_SHADOW ------------------------------------------------------ -TabPage RID_SVXPAGE_SHADOW -{ - HelpID = HID_AREA_SHADOW ; - Hide = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Text [ en-US ] = "Shadow" ; - FixedLine FL_PROP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248, 8 ) ; - Text [ en-US ] = "Properties"; - }; - TriStateBox TSB_SHOW_SHADOW - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_SHADOW:TSB_SHOW_SHADOW"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 110 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Use shadow"; - }; - FixedText FT_POSITION - { - Pos = MAP_APPFONT ( 12 , 33 ) ; - Size = MAP_APPFONT ( 50 , 10 ) ; - Text [ en-US ] = "~Position"; - }; - Control CTL_POSITION - { - HelpId = HID_TPSHADOW_CTRL ; - Pos = MAP_APPFONT ( 65 , 31 ) ; - Size = MAP_APPFONT ( 57 , 29 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_DISTANCE - { - Pos = MAP_APPFONT ( 12 , 69 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Distance"; - }; - MetricField MTR_FLD_DISTANCE - { - HelpID = "cui:MetricField:RID_SVXPAGE_SHADOW:MTR_FLD_DISTANCE"; - Pos = MAP_APPFONT ( 65 , 67 ) ; - Size = MAP_APPFONT ( 47 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 99999 ; - Minimum = 0 ; // #i33700# - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - Last = 99999 ; - /*SpinSize = 100 ; */ - SpinSize = 1 ; - }; - ListBox LB_SHADOW_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_SHADOW:LB_SHADOW_COLOR"; - Pos = MAP_APPFONT ( 65 , 86 ) ; - Size = MAP_APPFONT ( 57 , 100 ) ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - Border = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_SHADOW_COLOR - { - Pos = MAP_APPFONT ( 12 , 88 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Color" ; - }; - FixedText FT_TRANSPARENT - { - Pos = MAP_APPFONT ( 12 , 107 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Transparency"; - }; - MetricField MTR_SHADOW_TRANSPARENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_SHADOW:MTR_SHADOW_TRANSPARENT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 65 , 105 ) ; - Size = MAP_APPFONT ( 47 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - Control CTL_COLOR_PREVIEW - { - Border = TRUE; - Pos = MAP_APPFONT ( 138 , 14 ) ; - Size = MAP_APPFONT ( 110 , 42 ) ; - TabStop = FALSE ; - }; -}; - // RID_SVXPAGE_HATCH -------------------------------------------------------- -TabPage RID_SVXPAGE_HATCH -{ - HelpID = HID_AREA_HATCH ; - Hide = TRUE ; - Text [ en-US ] = "Hatching" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_PROP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248, 8 ) ; - Text [ en-US ] = "Properties"; - }; - FixedText FT_LINE_DISTANCE - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 78 , 8 ) ; - Text [ en-US ] = "~Spacing" ; - }; - MetricField MTR_FLD_DISTANCE - { - HelpID = "cui:MetricField:RID_SVXPAGE_HATCH:MTR_FLD_DISTANCE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 30 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - First = 30 ; - Last = 9999 ; - SpinSize = 100 ; - }; - FixedText FT_LINE_ANGLE - { - Pos = MAP_APPFONT ( 12 , 41 ) ; - Size = MAP_APPFONT ( 78 , 8 ) ; - Text [ en-US ] = "A~ngle" ; - }; - MetricField MTR_FLD_ANGLE - { - HelpID = "cui:MetricField:RID_SVXPAGE_HATCH:MTR_FLD_ANGLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 52 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 359 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText [ en-US ] = " degrees" ; - Last = 359 ; - SpinSize = 15 ; - }; - Control CTL_ANGLE - { - HelpId = HID_TPHATCH_CTRL ; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 72 ) ; - Size = MAP_APPFONT ( 39 , 39 ) ; - TabStop = TRUE ; - }; - FixedText FT_LINE_TYPE - { - Pos = MAP_APPFONT ( 12 , 123 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Line type" ; - }; - ListBox LB_LINE_TYPE - { - HelpID = "cui:ListBox:RID_SVXPAGE_HATCH:LB_LINE_TYPE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 134 ) ; - Size = MAP_APPFONT ( 62 , 62 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Single" ; Default ; > ; - < "Crossed" ; Default ; > ; - < "Triple" ; Default ; > ; - }; - }; - FixedText FT_LINE_COLOR - { - Pos = MAP_APPFONT ( 12 , 150 ) ; - Size = MAP_APPFONT ( 49 , 8 ) ; - Text [ en-US ] = "Line ~color" ; - }; - ListBox LB_LINE_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_HATCH:LB_LINE_COLOR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 161 ) ; - Size = MAP_APPFONT ( 62 , 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - ListBox LB_HATCHINGS - { - HelpID = "cui:ListBox:RID_SVXPAGE_HATCH:LB_HATCHINGS"; - Border = TRUE ; - Pos = MAP_APPFONT ( 103 , 14 ) ; - Size = MAP_APPFONT ( 88 , 110 ) ; - TabStop = TRUE ; - }; - Control CTL_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 103 , 131 ) ; - Size = MAP_APPFONT ( 88 , 42 ) ; - }; - PushButton BTN_ADD - { - HelpID = "cui:PushButton:RID_SVXPAGE_HATCH:BTN_ADD"; - Pos = MAP_APPFONT ( 197 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Add..." ; - TabStop = TRUE ; - }; - PushButton BTN_MODIFY - { - HelpID = "cui:PushButton:RID_SVXPAGE_HATCH:BTN_MODIFY"; - Pos = MAP_APPFONT ( 197 , 32 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Modify..." ; - TabStop = TRUE ; - }; - PushButton BTN_DELETE - { - HelpID = "cui:PushButton:RID_SVXPAGE_HATCH:BTN_DELETE"; - Pos = MAP_APPFONT ( 197 , 68 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Delete..." ; - TabStop = TRUE ; - }; - ImageButton BTN_LOAD - { - HelpID = "cui:ImageButton:RID_SVXPAGE_HATCH:BTN_LOAD"; - Pos = MAP_APPFONT ( 197 , 104 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Load Hatches List" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05501.bmp" ; - }; - MASKCOLOR - }; - }; - ImageButton BTN_SAVE - { - HelpID = "cui:ImageButton:RID_SVXPAGE_HATCH:BTN_SAVE"; - Pos = MAP_APPFONT ( 197 , 124 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Save Hatches List" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05502.bmp" ; - }; - MASKCOLOR - }; - }; -}; - // RID_SVXPAGE_BITMAP ------------------------------------------------------- -TabPage RID_SVXPAGE_BITMAP -{ - HelpID = HID_AREA_BITMAP ; - Hide = TRUE ; - Text [ en-US ] = "Bitmap Patterns" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_PROP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248, 8 ) ; - Text [ en-US ] = "Properties"; - }; - FixedText FT_PIXEL_EDIT - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 85 , 8 ) ; - Text [ en-US ] = "Pattern Editor"; - }; - Control CTL_PIXEL - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 72 , 72 ) ; - TabStop = TRUE ; - }; - FixedText FT_COLOR - { - Pos = MAP_APPFONT ( 12 , 104 ) ; - Size = MAP_APPFONT ( 85 , 8 ) ; - Text [ en-US ] = "~Foreground color"; - }; - ListBox LB_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_BITMAP:LB_COLOR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 115 ) ; - Size = MAP_APPFONT ( 62 , 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - FixedText FT_BACKGROUND_COLOR - { - Pos = MAP_APPFONT ( 12 , 131 ) ; - Size = MAP_APPFONT ( 85 , 8 ) ; - Text [ en-US ] = "~Background color"; - }; - ListBox LB_BACKGROUND_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_BITMAP:LB_BACKGROUND_COLOR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 142 ) ; - Size = MAP_APPFONT ( 62 , 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - FixedText FT_BITMAPS_HIDDEN - { - // Hidden label that provides the name for the bitmaps list box. - Text [ en-US ] = "Bitmap"; - }; - ListBox LB_BITMAPS - { - HelpID = "cui:ListBox:RID_SVXPAGE_BITMAP:LB_BITMAPS"; - Border = TRUE ; - Pos = MAP_APPFONT ( 103 , 14 ) ; - Size = MAP_APPFONT ( 88 , 110 ) ; - TabStop = TRUE ; - }; - Control CTL_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 103 , 131 ) ; - Size = MAP_APPFONT ( 88 , 42 ) ; - }; - PushButton BTN_ADD - { - HelpID = "cui:PushButton:RID_SVXPAGE_BITMAP:BTN_ADD"; - Pos = MAP_APPFONT ( 197 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Add..." ; - TabStop = TRUE ; - }; - PushButton BTN_MODIFY - { - HelpID = "cui:PushButton:RID_SVXPAGE_BITMAP:BTN_MODIFY"; - Pos = MAP_APPFONT ( 197 , 32 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Modify..." ; - TabStop = TRUE ; - }; - PushButton BTN_IMPORT - { - HelpID = "cui:PushButton:RID_SVXPAGE_BITMAP:BTN_IMPORT"; - Pos = MAP_APPFONT ( 197 , 50 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Import..." ; - TabStop = TRUE ; - }; - PushButton BTN_DELETE - { - HelpID = "cui:PushButton:RID_SVXPAGE_BITMAP:BTN_DELETE"; - Pos = MAP_APPFONT ( 197 , 68 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Delete..." ; - TabStop = TRUE ; - }; - ImageButton BTN_LOAD - { - HelpID = "cui:ImageButton:RID_SVXPAGE_BITMAP:BTN_LOAD"; - Pos = MAP_APPFONT ( 197 , 104 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Load Bitmap List" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05501.bmp" ; - }; - MASKCOLOR - }; - }; - ImageButton BTN_SAVE - { - HelpID = "cui:ImageButton:RID_SVXPAGE_BITMAP:BTN_SAVE"; - Pos = MAP_APPFONT ( 197 , 124 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Save Bitmap List" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05502.bmp" ; - }; - MASKCOLOR - }; - }; -}; - // RID_SVXPAGE_GRADIENT ----------------------------------------------------- -TabPage RID_SVXPAGE_GRADIENT -{ - HelpID = HID_AREA_GRADIENT ; - Hide = TRUE ; - Text [ en-US ] = "Gradients" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_PROP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248, 8 ) ; - Text [ en-US ] = "Properties"; - }; - FixedText FT_TYPE - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 26 , 8 ) ; - Text [ en-US ] = "Ty~pe" ; - }; - ListBox LB_GRADIENT_TYPES - { - HelpID = "cui:ListBox:RID_SVXPAGE_GRADIENT:LB_GRADIENT_TYPES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 49 , 14 ) ; - Size = MAP_APPFONT ( 48, 63 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Linear" ; Default ; > ; - < "Axial" ; Default ; > ; - < "Radial" ; Default ; > ; - < "Ellipsoid" ; Default ; > ; - < "Square" ; Default ; > ; - < "Rectangular" ; Default ; > ; - }; - }; - FixedText FT_CENTER_X - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 37 , 8 ) ; - Text [ en-US ] = "Center ~X" ; - }; - MetricField MTR_CENTER_X - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_CENTER_X"; - Border = TRUE ; - Pos = MAP_APPFONT ( 49 , 30 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedText FT_CENTER_Y - { - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 37 , 8 ) ; - Text [ en-US ] = "Center ~Y" ; - }; - MetricField MTR_CENTER_Y - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_CENTER_Y"; - Border = TRUE ; - Pos = MAP_APPFONT ( 49 , 46 ) ; - Size = MAP_APPFONT ( 40, 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedText FT_ANGLE - { - Pos = MAP_APPFONT ( 12 , 64 ) ; - Size = MAP_APPFONT ( 37 , 8 ) ; - Text [ en-US ] = "A~ngle" ; - }; - MetricField MTR_ANGLE - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_ANGLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 49 , 62 ) ; - Size = MAP_APPFONT ( 40, 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 359 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText [ en-US ] = " degrees" ; - Last = 359 ; - SpinSize = 15 ; - }; - FixedText FT_BORDER - { - Pos = MAP_APPFONT ( 12 , 80 ) ; - Size = MAP_APPFONT ( 32 , 8 ) ; - Text [ en-US ] = "~Border" ; - }; - MetricField MTR_BORDER - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_BORDER"; - Border = TRUE ; - Pos = MAP_APPFONT ( 49 , 78 ) ; - Size = MAP_APPFONT ( 40, 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedText FT_COLOR_FROM - { - Pos = MAP_APPFONT ( 12 , 99 ) ; - Size = MAP_APPFONT ( 32 , 8 ) ; - Text [ en-US ] = "~From" ; - }; - ListBox LB_COLOR_FROM - { - HelpID = "cui:ListBox:RID_SVXPAGE_GRADIENT:LB_COLOR_FROM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 49 , 97 ) ; - Size = MAP_APPFONT ( 48, 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - MetricField MTR_COLOR_FROM - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_COLOR_FROM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 49 , 113 ) ; - Size = MAP_APPFONT ( 40, 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedText FT_COLOR_TO - { - Pos = MAP_APPFONT ( 12 , 133 ) ; - Size = MAP_APPFONT ( 32 , 8 ) ; - Text [ en-US ] = "~To" ; - }; - ListBox LB_COLOR_TO - { - HelpID = "cui:ListBox:RID_SVXPAGE_GRADIENT:LB_COLOR_TO"; - Border = TRUE ; - Pos = MAP_APPFONT ( 49 , 131 ) ; - Size = MAP_APPFONT ( 48, 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - MetricField MTR_COLOR_TO - { - HelpID = "cui:MetricField:RID_SVXPAGE_GRADIENT:MTR_COLOR_TO"; - Border = TRUE ; - Pos = MAP_APPFONT ( 49 , 147 ) ; - Size = MAP_APPFONT ( 40, 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - ListBox LB_GRADIENTS - { - HelpID = "cui:ListBox:RID_SVXPAGE_GRADIENT:LB_GRADIENTS"; - Border = TRUE ; - Pos = MAP_APPFONT ( 103 , 14 ) ; - Size = MAP_APPFONT ( 88 , 110 ) ; - TabStop = TRUE ; - }; - Control CTL_PREVIEW - { - Border = TRUE; - Pos = MAP_APPFONT ( 103 , 131 ) ; - Size = MAP_APPFONT ( 88 , 42 ) ; - }; - PushButton BTN_ADD - { - HelpID = "cui:PushButton:RID_SVXPAGE_GRADIENT:BTN_ADD"; - Pos = MAP_APPFONT ( 197 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Add..." ; - TabStop = TRUE ; - }; - PushButton BTN_MODIFY - { - HelpID = "cui:PushButton:RID_SVXPAGE_GRADIENT:BTN_MODIFY"; - Pos = MAP_APPFONT ( 197 , 32 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Modify..." ; - TabStop = TRUE ; - }; - PushButton BTN_DELETE - { - HelpID = "cui:PushButton:RID_SVXPAGE_GRADIENT:BTN_DELETE"; - Pos = MAP_APPFONT ( 197 , 68 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Delete..." ; - TabStop = TRUE ; - }; - ImageButton BTN_LOAD - { - HelpID = "cui:ImageButton:RID_SVXPAGE_GRADIENT:BTN_LOAD"; - Pos = MAP_APPFONT ( 197 , 104 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Load Gradients List" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05501.bmp" ; - }; - MASKCOLOR - }; - }; - ImageButton BTN_SAVE - { - HelpID = "cui:ImageButton:RID_SVXPAGE_GRADIENT:BTN_SAVE"; - Pos = MAP_APPFONT ( 197 , 124 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Save Gradients List" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05502.bmp" ; - }; - MASKCOLOR - }; - }; -}; - // RID_SVXPAGE_COLOR -------------------------------------------------------- -TabPage RID_SVXPAGE_COLOR -{ - HelpId = HID_OPTIONS_COLOR ; - Hide = TRUE ; - Text [ en-US ] = "Colors" ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_PROP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248, 8 ) ; - Text [ en-US ] = "Properties"; - }; - FixedText FT_NAME - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Text [ en-US ] = "~Name" ; - }; - Edit EDT_NAME - { - HelpID = "cui:Edit:RID_SVXPAGE_COLOR:EDT_NAME"; - Border = TRUE ; - Pos = MAP_APPFONT ( 42 , 14 ) ; - Size = MAP_APPFONT ( 76 , 12 ) ; - TabStop = TRUE ; - }; - FixedText FT_COLOR - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 28 , 8 ) ; - Text [ en-US ] = "C~olor" ; - }; - ListBox LB_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_COLOR:LB_COLOR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 42 , 30 ) ; - Size = MAP_APPFONT ( 76 , 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - - FixedText FT_TABLE_NAME - { - Pos = MAP_APPFONT ( 42 , 48 ) ; - Size = MAP_APPFONT ( 94 , 8 ) ; - Text [ en-US ] = "Color table" ; - }; - Control CTL_COLORTABLE - { - Border = TRUE ; - Hide = TRUE ; - Pos = MAP_APPFONT ( 42 , 59 ) ; - Size = MAP_APPFONT ( 94 , 117 ) ; - TabStop = TRUE ; - }; - - Control CTL_PREVIEW_OLD - { - Border = TRUE; - Pos = MAP_APPFONT ( 157 , 14 ) ; - Size = MAP_APPFONT ( 34 , 25 ) ; - }; - Control CTL_PREVIEW_NEW - { - Border = TRUE; - Pos = MAP_APPFONT ( 157, 39 ) ; - Size = MAP_APPFONT ( 34 , 25 ) ; - }; - ListBox LB_COLORMODEL - { - HelpID = "cui:ListBox:RID_SVXPAGE_COLOR:LB_COLORMODEL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 157 , 71 ) ; - Size = MAP_APPFONT ( 34 , 12 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "RGB" ; Default ; > ; - < "CMYK" ; Default ; > ; - }; - }; - FixedText FT_1 - { - Pos = MAP_APPFONT ( 142 , 89 ) ; - Size = MAP_APPFONT ( 15 , 8 ) ; - Text = "~C" ; - }; - MetricField MTR_FLD_1 - { - HelpID = "cui:MetricField:RID_SVXPAGE_COLOR:MTR_FLD_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 157 , 87 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - }; - FixedText FT_2 - { - Pos = MAP_APPFONT ( 142 , 105 ) ; - Size = MAP_APPFONT ( 15 , 8 ) ; - Text = "~M" ; - }; - MetricField MTR_FLD_2 - { - HelpID = "cui:MetricField:RID_SVXPAGE_COLOR:MTR_FLD_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 157 , 103 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - }; - FixedText FT_3 - { - Pos = MAP_APPFONT ( 142 , 121 ) ; - Size = MAP_APPFONT ( 15 , 8 ) ; - Text = "~Y" ; - }; - MetricField MTR_FLD_3 - { - HelpID = "cui:MetricField:RID_SVXPAGE_COLOR:MTR_FLD_3"; - Border = TRUE ; - Pos = MAP_APPFONT ( 157 , 119 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - }; - FixedText FT_4 - { - Pos = MAP_APPFONT ( 142 , 137 ) ; - Size = MAP_APPFONT ( 15 , 8 ) ; - Text = "~K" ; - }; - MetricField MTR_FLD_4 - { - HelpID = "cui:MetricField:RID_SVXPAGE_COLOR:MTR_FLD_4"; - Border = TRUE ; - Pos = MAP_APPFONT ( 157 , 135 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - }; - PushButton BTN_ADD - { - HelpID = "cui:PushButton:RID_SVXPAGE_COLOR:BTN_ADD"; - Pos = MAP_APPFONT ( 197 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Add" ; - TabStop = TRUE ; - }; - PushButton BTN_WORK_ON - { - HelpID = "cui:PushButton:RID_SVXPAGE_COLOR:BTN_WORK_ON"; - Pos = MAP_APPFONT ( 197 , 50 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Edit..." ; - TabStop = TRUE ; - }; - PushButton BTN_DELETE - { - HelpID = "cui:PushButton:RID_SVXPAGE_COLOR:BTN_DELETE"; - Pos = MAP_APPFONT ( 197 , 68 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Delete..." ; - TabStop = TRUE ; - }; - PushButton BTN_MODIFY - { - HelpID = "cui:PushButton:RID_SVXPAGE_COLOR:BTN_MODIFY"; - Pos = MAP_APPFONT ( 197, 32 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Modify" ; - TabStop = TRUE ; - }; - ImageButton BTN_LOAD - { - HelpID = "cui:ImageButton:RID_SVXPAGE_COLOR:BTN_LOAD"; - Pos = MAP_APPFONT ( 197 , 104 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Load Color List" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05501.bmp" ; - }; - MASKCOLOR - }; - }; - ImageButton BTN_SAVE - { - HelpID = "cui:ImageButton:RID_SVXPAGE_COLOR:BTN_SAVE"; - Pos = MAP_APPFONT ( 197 , 124 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Save Color List" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05502.bmp" ; - }; - MASKCOLOR - }; - }; -}; - // RID_SVXDLG_AREA ---------------------------------------------------------- -TabDialog RID_SVXDLG_AREA -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 289 , 176 ) ; - Text [ en-US ] = "Area" ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - PageList = - { - PageItem - { - Identifier = RID_SVXPAGE_AREA ; - Text [ en-US ] = "Area" ; - PageResID = RID_SVXPAGE_AREA ; - }; - PageItem - { - Identifier = RID_SVXPAGE_SHADOW ; - PageResID = RID_SVXPAGE_SHADOW ; - Text [ en-US ] = "Shadow" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_TRANSPARENCE ; - Text [ en-US ] = "Transparency"; - }; - PageItem - { - Identifier = RID_SVXPAGE_COLOR ; - Text [ en-US ] = "Colors" ; - PageResID = RID_SVXPAGE_COLOR ; - }; - PageItem - { - Identifier = RID_SVXPAGE_GRADIENT ; - Text [ en-US ] = "Gradients" ; - PageResID = RID_SVXPAGE_GRADIENT ; - }; - PageItem - { - Identifier = RID_SVXPAGE_HATCH ; - Text [ en-US ] = "Hatching" ; - PageResID = RID_SVXPAGE_HATCH ; - }; - PageItem - { - Identifier = RID_SVXPAGE_BITMAP ; - Text [ en-US ] = "Bitmaps" ; - PageResID = RID_SVXPAGE_BITMAP ; - }; - }; - }; -}; - -String STR_LB_HATCHINGSTYLE -{ - Text [ en-US ] = "Hatching Style" ; -}; - -String STR_CUI_COLORMODEL -{ - Text [ en-US ] = "Color Mode" ; -}; - diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx deleted file mode 100644 index 550cff4d7..000000000 --- a/cui/source/tabpages/tabline.cxx +++ /dev/null @@ -1,281 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <tools/shl.hxx> -#include <vcl/msgbox.hxx> -#include <unotools/pathoptions.hxx> -#include <sfx2/app.hxx> -#include <sfx2/objsh.hxx> -#include <svx/dialogs.hrc> - -#define _SVX_TABLINE_CXX -#include <cuires.hrc> -#include "tabline.hrc" - -#include "cuitabarea.hxx" -#include "cuitabline.hxx" -#include "dlgname.hxx" -#include <dialmgr.hxx> -#include <svx/svdmodel.hxx> -#include <svx/xtable.hxx> -#include "svx/drawitem.hxx" - -#define DLGWIN this->GetParent()->GetParent() - -#define BITMAP_WIDTH 32 -#define BITMAP_HEIGHT 12 -#define XOUT_WIDTH 150 - -/************************************************************************* -|* -|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu -|* -\************************************************************************/ - -SvxLineTabDialog::SvxLineTabDialog -( - Window* pParent, - const SfxItemSet* pAttr, - SdrModel* pModel, - const SdrObject* pSdrObj, - sal_Bool bHasObj -) : - - SfxTabDialog ( pParent, CUI_RES( RID_SVXDLG_LINE ), pAttr ), - pDrawModel ( pModel ), - pObj ( pSdrObj ), - rOutAttrs ( *pAttr ), - pColorTab ( pModel->GetColorTable() ), - mpNewColorTab ( pModel->GetColorTable() ), - pDashList ( pModel->GetDashList() ), - pNewDashList ( pModel->GetDashList() ), - pLineEndList ( pModel->GetLineEndList() ), - pNewLineEndList ( pModel->GetLineEndList() ), - bObjSelected ( bHasObj ), - nLineEndListState( CT_NONE ), - nDashListState( CT_NONE ), - mnColorTableState( CT_NONE ), - nPageType( 0 ), // wird hier in erster Linie benutzt, um mit FillItemSet - // die richtigen Attribute zu erhalten ( noch Fragen? ) - nDlgType( 0 ), - nPosDashLb( 0 ), - nPosLineEndLb( 0 ), - mnPos( 0 ), - mbAreaTP( sal_False ), - mbDeleteColorTable( sal_True ) -{ - FreeResource(); - - bool bLineOnly = false; - if( pObj && pObj->GetObjInventor() == SdrInventor ) - { - switch( pObj->GetObjIdentifier() ) - { - case OBJ_LINE: - case OBJ_PLIN: - case OBJ_PATHLINE: - case OBJ_FREELINE: - case OBJ_MEASURE: - case OBJ_EDGE: - bLineOnly = true; - - default: - break; - } - - } - - AddTabPage( RID_SVXPAGE_LINE, SvxLineTabPage::Create, 0); - if( bLineOnly ) - AddTabPage( RID_SVXPAGE_SHADOW, SvxShadowTabPage::Create, 0 ); - else - RemoveTabPage( RID_SVXPAGE_SHADOW ); - - AddTabPage( RID_SVXPAGE_LINE_DEF, SvxLineDefTabPage::Create, 0); - AddTabPage( RID_SVXPAGE_LINEEND_DEF, SvxLineEndDefTabPage::Create, 0); - - SetCurPageId( RID_SVXPAGE_LINE ); - - CancelButton& rBtnCancel = GetCancelButton(); - rBtnCancel.SetClickHdl( LINK( this, SvxLineTabDialog, CancelHdlImpl ) ); -} - -// ----------------------------------------------------------------------- - -SvxLineTabDialog::~SvxLineTabDialog() -{ -} - -// ----------------------------------------------------------------------- - -void SvxLineTabDialog::SavePalettes() -{ - SfxObjectShell* pShell = SfxObjectShell::Current(); - if( mpNewColorTab != pDrawModel->GetColorTable() ) - { - if(mbDeleteColorTable) - delete pDrawModel->GetColorTable(); - pDrawModel->SetColorTable( mpNewColorTab ); - if ( pShell ) - pShell->PutItem( SvxColorTableItem( mpNewColorTab, SID_COLOR_TABLE ) ); - pColorTab = pDrawModel->GetColorTable(); - } - if( pNewDashList != pDrawModel->GetDashList() ) - { - delete pDrawModel->GetDashList(); - pDrawModel->SetDashList( pNewDashList ); - if ( pShell ) - pShell->PutItem( SvxDashListItem( pNewDashList, SID_DASH_LIST ) ); - pDashList = pDrawModel->GetDashList(); - } - if( pNewLineEndList != pDrawModel->GetLineEndList() ) - { - delete pDrawModel->GetLineEndList(); - pDrawModel->SetLineEndList( pNewLineEndList ); - if ( pShell ) - pShell->PutItem( SvxLineEndListItem( pNewLineEndList, SID_LINEEND_LIST ) ); - pLineEndList = pDrawModel->GetLineEndList(); - } - - // Speichern der Tabellen, wenn sie geaendert wurden. - - const String aPath( SvtPathOptions().GetPalettePath() ); - - if( nDashListState & CT_MODIFIED ) - { - pDashList->SetPath( aPath ); - pDashList->Save(); - - // ToolBoxControls werden benachrichtigt: - if ( pShell ) - pShell->PutItem( SvxDashListItem( pDashList, SID_DASH_LIST ) ); - } - - if( nLineEndListState & CT_MODIFIED ) - { - pLineEndList->SetPath( aPath ); - pLineEndList->Save(); - - // ToolBoxControls werden benachrichtigt: - if ( pShell ) - pShell->PutItem( SvxLineEndListItem( pLineEndList, SID_LINEEND_LIST ) ); - } - - if( mnColorTableState & CT_MODIFIED ) - { - pColorTab->SetPath( aPath ); - pColorTab->Save(); - - // ToolBoxControls werden benachrichtigt: - if ( pShell ) - pShell->PutItem( SvxColorTableItem( pColorTab, SID_COLOR_TABLE ) ); - } -} - -// ----------------------------------------------------------------------- - -short SvxLineTabDialog::Ok() -{ - SavePalettes(); - - // Es wird RET_OK zurueckgeliefert, wenn wenigstens eine - // TabPage in FillItemSet() sal_True zurueckliefert. Dieses - // geschieht z.Z. standardmaessig. - return( SfxTabDialog::Ok() ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK_INLINE_START( SvxLineTabDialog, CancelHdlImpl, void *, EMPTYARG ) -{ - SavePalettes(); - - EndDialog( RET_CANCEL ); - return 0; -} -IMPL_LINK_INLINE_END( SvxLineTabDialog, CancelHdlImpl, void *, EMPTYARG ) - -// ----------------------------------------------------------------------- - -void SvxLineTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) -{ - switch( nId ) - { - case RID_SVXPAGE_LINE: - ( (SvxLineTabPage&) rPage ).SetColorTable( pColorTab ); - ( (SvxLineTabPage&) rPage ).SetDashList( pDashList ); - ( (SvxLineTabPage&) rPage ).SetLineEndList( pLineEndList ); - ( (SvxLineTabPage&) rPage ).SetDlgType( nDlgType ); - ( (SvxLineTabPage&) rPage ).SetPageType( nPageType ); - ( (SvxLineTabPage&) rPage ).SetPosDashLb( &nPosDashLb ); - ( (SvxLineTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb ); - ( (SvxLineTabPage&) rPage ).SetDashChgd( &nDashListState ); - ( (SvxLineTabPage&) rPage ).SetLineEndChgd( &nLineEndListState ); - ( (SvxLineTabPage&) rPage ).SetObjSelected( bObjSelected ); - ( (SvxLineTabPage&) rPage ).Construct(); - ( (SvxLineTabPage&) rPage ).SetColorChgd( &mnColorTableState ); - // ActivatePage() wird das erste mal nicht gerufen - ( (SvxLineTabPage&) rPage ).ActivatePage( rOutAttrs ); - break; - - case RID_SVXPAGE_LINE_DEF: - ( (SvxLineDefTabPage&) rPage ).SetDashList( pDashList ); - ( (SvxLineDefTabPage&) rPage ).SetDlgType( &nDlgType ); - ( (SvxLineDefTabPage&) rPage ).SetPageType( &nPageType ); - ( (SvxLineDefTabPage&) rPage ).SetPosDashLb( &nPosDashLb ); - ( (SvxLineDefTabPage&) rPage ).SetDashChgd( &nDashListState ); - ( (SvxLineDefTabPage&) rPage ).SetObjSelected( bObjSelected ); - ( (SvxLineDefTabPage&) rPage ).Construct(); - break; - - case RID_SVXPAGE_LINEEND_DEF: - ( (SvxLineEndDefTabPage&) rPage ).SetLineEndList( pLineEndList ); - ( (SvxLineEndDefTabPage&) rPage ).SetPolyObj( pObj ); - ( (SvxLineEndDefTabPage&) rPage ).SetDlgType( &nDlgType ); - ( (SvxLineEndDefTabPage&) rPage ).SetPageType( &nPageType ); - ( (SvxLineEndDefTabPage&) rPage ).SetPosLineEndLb( &nPosLineEndLb ); - ( (SvxLineEndDefTabPage&) rPage ).SetLineEndChgd( &nLineEndListState ); - ( (SvxLineEndDefTabPage&) rPage ).SetObjSelected( bObjSelected ); - ( (SvxLineEndDefTabPage&) rPage ).Construct(); - break; - - case RID_SVXPAGE_SHADOW: - { - ( (SvxShadowTabPage&) rPage ).SetColorTable( pColorTab ); - ( (SvxShadowTabPage&) rPage ).SetPageType( nPageType ); - ( (SvxShadowTabPage&) rPage ).SetDlgType( nDlgType ); - ( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP ); - ( (SvxShadowTabPage&) rPage ).SetColorChgd( &mnColorTableState ); - ( (SvxShadowTabPage&) rPage ).Construct(); - } - break; - } -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tabline.hrc b/cui/source/tabpages/tabline.hrc deleted file mode 100644 index 15d6db12c..000000000 --- a/cui/source/tabpages/tabline.hrc +++ /dev/null @@ -1,130 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#define TAB_CONTROL 1 -#define LB_COLOR 1 -#define FT_COLOR 1 -#define LB_LINE_STYLE 2 -#define FT_LINE_STYLE 3 -#define FT_LINE_WIDTH 2 -#define MTR_FLD_LINE_WIDTH 1 -#define TSB_INVISIBLE 1 -#define FL_LINE 1 -#define FL_LINE_ENDS 2 -#define FT_LINE_START 4 -#define FT_LINE_END 8 -#define FT_LINE_ENDS_STYLE 5 -#define FT_LINE_ENDS_WIDTH 6 -#define LB_START_STYLE 3 -#define LB_END_STYLE 4 -//IAccessibility2 Impplementaton 2009----- -#define STR_STYLE (LB_END_STYLE+1) -#define STR_LB_START_STYLE 30 -#define STR_LB_END_STYLE 31 -#define STR_MTR_FLD_START_WIDTH 32 -#define STR_MTR_FLD_END_WIDTH 33 -#define STR_CENTER_START 34 -#define STR_CENTER_END 35 -#define STR_START_TYPE 36 -#define STR_END_TYPE 37 -#define STR_START_NUM 38 -#define STR_END_NUM 39 -#define STR_START_LENGTH 40 -#define STR_END_LENGTH 41 -//-----IAccessibility2 Impplementaton 2009 -#define MTR_FLD_START_WIDTH 3 -#define MTR_FLD_END_WIDTH 2 -#define CBX_SYNCHRONIZE 1 -#define FL_MEASURING 3 -#define CTL_POSITION 2 -#define FT_POSITION 9 -#define TSB_SHOW_MEASURING 2 -#define CTL_PREVIEW 1 -#define FL_DEFINITION 1 -#define FT_NUMBER 3 -#define FT_DISTANCE 2 -#define FT_LENGTH 4 -#define TSB_SYNCHRONIZE 3 -#define LB_TYPE_1 3 -#define FT_TYPE 1 -#define LB_TYPE_2 1 -#define NUM_FLD_1 1 -#define NUM_FLD_2 2 -#define MTR_FLD_DISTANCE 1 -#define MTR_FLD_LENGTH_1 3 -#define MTR_FLD_LENGTH_2 4 -#define FT_LINESTYLE 10 -#define LB_LINESTYLES 2 -#define BTN_ADD 1 -#define BTN_MODIFY 2 -#define BTN_DELETE 3 -#define BTN_LOAD 5 -#define BTN_SAVE 6 -#define EDT_NAME 1 -#define LB_LINEENDS 1 -#define FL_TIP 1 -#define FI_TIP 10 -#define TSB_CENTER_START 4 -#define TSB_CENTER_END 5 -#define FT_TRANSPARENT 10 -#define MTR_LINE_TRANSPARENT 5 -#define FL_SEPARATOR 4 -#define FT_LINE_END_STYLE 11 -#define FT_TITLE 12 - -// #116827# -#define FL_EDGE_STYLE 5 -#define FT_EDGE_STYLE 13 -#define LB_EDGE_STYLE 5 - -//Symbole (fuer StarChart) -#define FT_SYMBOL_WIDTH 20 -#define FT_SYMBOL_HEIGHT 21 -#define MF_SYMBOL_WIDTH 22 -#define MF_SYMBOL_HEIGHT 23 -#define CB_SYMBOL_RATIO 24 -#define FL_SYMBOL_FORMAT 25 -#define MB_SYMBOL_BITMAP 26 - - -#define MN_GRAPHIC_DLG 1 -#define MN_GALLERY 2 -#define MN_SYMBOLS 3 -#define MN_SYMBOLS_NONE 4 -#define MN_SYMBOLS_AUTO 5 -#define MN_GALLERY_ENTRY 100 - -/* -//IAccessibility2 Implementation 2009----- -#define STR_START_TYPE 1 -#define STR_END_TYPE 2 -#define STR_START_NUM 3 -#define STR_END_NUM 4 -#define STR_START_LENGTH 5 -#define STR_END_LENGTH 6 -//-----IAccessibility2 Implementation 2009 -*/ diff --git a/cui/source/tabpages/tabline.src b/cui/source/tabpages/tabline.src deleted file mode 100644 index ccb482fa8..000000000 --- a/cui/source/tabpages/tabline.src +++ /dev/null @@ -1,890 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include ------------------------------------------------------------------ -#include <cuires.hrc> -#include "helpid.hrc" -#include "tabline.hrc" -#include <svx/dialogs.hrc> - -// Selecting LineStyle / Color / Width -------------------- - -#define MASKCOLOR MaskColor = Color{ Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; }; - - -TabPage RID_SVXPAGE_LINE -{ - Size = MAP_APPFONT ( 260 , 185 ); - HelpId = HID_LINE_LINE ; - Hide = TRUE ; - Text [ en-US ] = "Lines" ; - FixedLine FL_LINE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 112 , 8 ) ; - Text [ en-US ] = "Line properties" ; - }; - FixedText FT_LINE_STYLE - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text [ en-US ] = "~Style" ; - }; - ListBox LB_LINE_STYLE - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINE:LB_LINE_STYLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 25 ) ; - Size = MAP_APPFONT ( 100 , 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - FixedText FT_COLOR - { - Pos = MAP_APPFONT ( 12 , 41 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text [ en-US ] = "Colo~r" ; - }; - ListBox LB_COLOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINE:LB_COLOR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 52 ) ; - Size = MAP_APPFONT ( 100 , 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - FixedText FT_LINE_WIDTH - { - Pos = MAP_APPFONT ( 12 , 68 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text [ en-US ] = "~Width" ; - }; - MetricField MTR_FLD_LINE_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_LINE:MTR_FLD_LINE_WIDTH"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 79 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 5000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Value = 1 ; - Unit = FUNIT_MM ; - Last = 5000 ; - SpinSize = 10 ; - }; - FixedText FT_TRANSPARENT - { - Pos = MAP_APPFONT ( 12 , 95 ) ; - Size = MAP_APPFONT ( 100 , 8 ) ; - Text [ en-US ] = "~Transparency" ; - }; - MetricField MTR_LINE_TRANSPARENT - { - HelpID = "cui:MetricField:RID_SVXPAGE_LINE:MTR_LINE_TRANSPARENT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 106 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 100 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = "%" ; - Last = 100 ; - SpinSize = 5 ; - }; - FixedLine FL_SEPARATOR - { - Pos = MAP_APPFONT ( 118 , 14 ) ; - Size = MAP_APPFONT ( 6 , 111 ) ; - Vert = TRUE; - }; - FixedLine FL_LINE_ENDS - { - Pos = MAP_APPFONT ( 124 , 3 ) ; - Size = MAP_APPFONT ( 130 , 8 ) ; - Text [ en-US ] = "Arrow styles" ; - }; - FixedText FT_LINE_ENDS_STYLE - { - Pos = MAP_APPFONT ( 130 , 14 ) ; - Size = MAP_APPFONT ( 118 , 8 ) ; - Text [ en-US ] = "St~yle" ; - }; - ListBox LB_START_STYLE - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINE:LB_START_STYLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 130 , 25 ) ; - Size = MAP_APPFONT ( 57 , 99 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - ListBox LB_END_STYLE - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINE:LB_END_STYLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 191 , 25 ) ; - Size = MAP_APPFONT ( 57 , 100 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - FixedText FT_LINE_ENDS_WIDTH - { - Pos = MAP_APPFONT ( 130 , 41 ) ; - Size = MAP_APPFONT ( 118 , 8 ) ; - Text [ en-US ] = "Wi~dth" ; - }; - MetricField MTR_FLD_START_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_LINE:MTR_FLD_START_WIDTH"; - Border = TRUE ; - Pos = MAP_APPFONT ( 130 , 52 ) ; - Size = MAP_APPFONT ( 45 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 5000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Value = 1 ; - Unit = FUNIT_MM ; - Last = 5000 ; - SpinSize = 10 ; - }; - MetricField MTR_FLD_END_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_LINE:MTR_FLD_END_WIDTH"; - Border = TRUE ; - Pos = MAP_APPFONT ( 191 , 52 ) ; - Size = MAP_APPFONT ( 45 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 5000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Value = 1 ; - Unit = FUNIT_MM ; - Last = 5000 ; - SpinSize = 10 ; - }; - TriStateBox TSB_CENTER_START - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_LINE:TSB_CENTER_START"; - Pos = MAP_APPFONT ( 130 , 68 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "Ce~nter" ; - TabStop = TRUE ; - }; - TriStateBox TSB_CENTER_END - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_LINE:TSB_CENTER_END"; - Pos = MAP_APPFONT ( 191 , 68 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; - Text [ en-US ] = "C~enter" ; - TabStop = TRUE ; - }; - CheckBox CBX_SYNCHRONIZE - { - HelpID = "cui:CheckBox:RID_SVXPAGE_LINE:CBX_SYNCHRONIZE"; - // #116827# - // Pos = MAP_APPFONT ( 130 , 107 ) ; - Pos = MAP_APPFONT ( 130 , 68 + (16 - 4) ) ; - Size = MAP_APPFONT ( 118 , 10 ) ; - Text [ en-US ] = "Synchroni~ze ends" ; - TabStop = TRUE ; - }; - - ////////////////////////////////////////////////////////////////////////////// - // #116827# - - FixedLine FL_EDGE_STYLE - { - Pos = MAP_APPFONT ( 124 , 3 + (16 * 6) - 4 ) ; - Size = MAP_APPFONT ( 130 , 8 ) ; - Text [ en-US ] = "Corner style" ; - }; - FixedText FT_EDGE_STYLE - { - Pos = MAP_APPFONT ( 130 , 14 + (16 * 6) - 4 ) ; - Size = MAP_APPFONT ( 118 , 8 ) ; - Text [ en-US ] = "Sty~le" ; - }; - ListBox LB_EDGE_STYLE - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINE:LB_EDGE_STYLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 130 , 25 + (16 * 6) - 4 ) ; - Size = MAP_APPFONT ( 57 , 99 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Rounded" ; Default ; > ; - < "- none -" ; > ; - < "Mitered" ; > ; - < "Beveled" ; > ; - }; - }; - - ////////////////////////////////////////////////////////////////////////////// - - Control CTL_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 135 ) ; - Size = MAP_APPFONT ( 248 , 40 ) ; - }; - - //#58425# Symbole auf einer Linie (z.B. StarChart) -> - FixedLine FL_SYMBOL_FORMAT - { - Hide = TRUE ; - - Pos = MAP_APPFONT ( 124 , 3 ) ; - Size = MAP_APPFONT ( 130 , 8 ) ; - Text [ en-US ] = "Icon"; - }; - - MenuButton MB_SYMBOL_BITMAP - { - HelpID = "cui:MenuButton:RID_SVXPAGE_LINE:MB_SYMBOL_BITMAP"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 130 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - ButtonMenu = Menu - { - ItemList = - { - MenuItem - { - Identifier = MN_SYMBOLS_NONE; - Text [ en-US ] = "No Symbol"; - }; - MenuItem - { - Identifier = MN_SYMBOLS_AUTO; - Text [ en-US ] = "Automatic"; - }; - MenuItem - { - Identifier = MN_GRAPHIC_DLG ; - Text [ en-US ] = "From file..." ; - }; - MenuItem - { - Identifier = MN_GALLERY ; - Text [ en-US ] = "Gallery"; - }; - MenuItem - { - Identifier = MN_SYMBOLS; - Text [ en-US ] = "Symbols"; - }; - }; - }; - Text [ en-US ] = "Select..." ; - }; - FixedText FT_SYMBOL_WIDTH - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 130 , 32 ) ; - Size = MAP_APPFONT ( 57 , 8 ) ; - Text [ en-US ] = "Width" ; - }; - MetricField MF_SYMBOL_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_LINE:MF_SYMBOL_WIDTH"; - Pos = MAP_APPFONT ( 191 , 30 ); - Size = MAP_APPFONT ( 57 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - Hide = TRUE ; - }; - FixedText FT_SYMBOL_HEIGHT - { - Hide = TRUE ; - Pos = MAP_APPFONT ( 130 , 48 ) ; - Size = MAP_APPFONT ( 57 , 8 ) ; - Text [ en-US ] = "Height" ; - }; - MetricField MF_SYMBOL_HEIGHT - { - HelpID = "cui:MetricField:RID_SVXPAGE_LINE:MF_SYMBOL_HEIGHT"; - Pos = MAP_APPFONT ( 191 , 46 ); - Size = MAP_APPFONT ( 57 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 1999 ; - DecimalDigits = 2 ; - Value = 0 ; - Unit = FUNIT_CM ; - First = 0 ; - Last = 1999 ; - SpinSize = 5 ; - Hide = TRUE ; - }; - CheckBox CB_SYMBOL_RATIO - { - HelpID = "cui:CheckBox:RID_SVXPAGE_LINE:CB_SYMBOL_RATIO"; - Hide = TRUE ; - Pos = MAP_APPFONT ( 130 , 62 ); - Size = MAP_APPFONT ( 118 , 10 ) ; - Text [ en-US ] = "Keep ratio" ; - }; - String STR_STYLE - { - Text [ en-US ] = "Style" ; - }; - String STR_LB_START_STYLE - { - Text [ en-US ] = "Start style" ; - }; - String STR_LB_END_STYLE - { - Text [ en-US ] = "End style" ; - }; - String STR_MTR_FLD_START_WIDTH - { - Text [ en-US ] = "Start width" ; - }; - String STR_MTR_FLD_END_WIDTH - { - Text [ en-US ] = "End width" ; - }; - String STR_CENTER_START - { - Text [ en-US ] = "Start with center" ; - }; - String STR_CENTER_END - { - Text [ en-US ] = "End with center" ; - }; -}; - -// Defining LineStyles -------------------- - -TabPage RID_SVXPAGE_LINE_DEF -{ - Size = MAP_APPFONT ( 260 , 185 ) ; - HelpId = HID_LINE_DEF ; - Hide = TRUE ; - Text [ en-US ] = "Define line styles" ; - - FixedLine FL_DEFINITION - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Properties" ; - }; - FixedText FT_TYPE - { - Pos = MAP_APPFONT ( 12 , 34 ) ; - Size = MAP_APPFONT ( 52 , 8 ) ; - Text [ en-US ] = "~Type" ; - }; - ListBox LB_TYPE_1 - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINE_DEF:LB_TYPE_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 66 , 32 ) ; - Size = MAP_APPFONT ( 43 , 49 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Dot" ; Default ; > ; - < "Dash" ; Default ; > ; - }; - }; - ListBox LB_TYPE_2 - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINE_DEF:LB_TYPE_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 113 , 32 ) ; - Size = MAP_APPFONT ( 43 , 49 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Dot" ; Default ; > ; - < "Dash" ; Default ; > ; - }; - }; - FixedText FT_NUMBER - { - Pos = MAP_APPFONT ( 12 , 50 ) ; - Size = MAP_APPFONT ( 52 , 8 ) ; - Text [ en-US ] = "~Number" ; - }; - NumericField NUM_FLD_1 - { - HelpID = "cui:NumericField:RID_SVXPAGE_LINE_DEF:NUM_FLD_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 66 , 48 ) ; - Size = MAP_APPFONT ( 43 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 99 ; - StrictFormat = TRUE ; - Last = 99 ; - SpinSize = 1 ; - }; - NumericField NUM_FLD_2 - { - HelpID = "cui:NumericField:RID_SVXPAGE_LINE_DEF:NUM_FLD_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 113 , 48 ) ; - Size = MAP_APPFONT ( 43 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 99 ; - StrictFormat = TRUE ; - Last = 99 ; - SpinSize = 1 ; - }; - FixedText FT_LENGTH - { - Pos = MAP_APPFONT ( 12 , 66 ) ; - Size = MAP_APPFONT ( 52 , 8 ) ; - Text [ en-US ] = "~Length" ; - }; - MetricField MTR_FLD_LENGTH_1 - { - HelpID = "cui:MetricField:RID_SVXPAGE_LINE_DEF:MTR_FLD_LENGTH_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 66 , 64 ) ; - Size = MAP_APPFONT ( 43 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - Maximum = 5000 ; - Last = 5000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Value = 1 ; - Unit = FUNIT_MM ; - CustomUnitText = "%" ; - SpinSize = 10 ; - }; - MetricField MTR_FLD_LENGTH_2 - { - HelpID = "cui:MetricField:RID_SVXPAGE_LINE_DEF:MTR_FLD_LENGTH_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 113 , 64 ) ; - Size = MAP_APPFONT ( 43 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - Maximum = 5000 ; - Last = 5000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Value = 1 ; - Unit = FUNIT_MM ; - CustomUnitText = "%" ; - SpinSize = 10 ; - }; - FixedText FT_DISTANCE - { - Pos = MAP_APPFONT ( 12 , 81 ) ; - Size = MAP_APPFONT ( 52 , 8 ) ; - Text [ en-US ] = "~Spacing" ; - }; - MetricField MTR_FLD_DISTANCE - { - HelpID = "cui:MetricField:RID_SVXPAGE_LINE_DEF:MTR_FLD_DISTANCE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 66 , 79 ) ; - Size = MAP_APPFONT ( 43 , 12 ) ; - TabStop = TRUE ; - Right = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 5000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Value = 1 ; - Unit = FUNIT_MM ; - CustomUnitText = "%" ; - Last = 5000 ; - SpinSize = 10 ; - }; - CheckBox CBX_SYNCHRONIZE - { - HelpID = "cui:CheckBox:RID_SVXPAGE_LINE_DEF:CBX_SYNCHRONIZE"; - Pos = MAP_APPFONT ( 12 , 95 ) ; - Size = MAP_APPFONT ( 174 , 10 ) ; - Text [ en-US ] = "~Fit to line width" ; - TabStop = TRUE ; - }; - - // ---------------------------------------- - - FixedText FT_LINESTYLE - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 52 , 8 ) ; - Text [ en-US ] = "Line style" ; - }; - ListBox LB_LINESTYLES - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINE_DEF:LB_LINESTYLES"; - Border = TRUE ; - Pos = MAP_APPFONT ( 66 , 14 ) ; - Size = MAP_APPFONT ( 120 , 80 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - PushButton BTN_ADD - { - HelpID = "cui:PushButton:RID_SVXPAGE_LINE_DEF:BTN_ADD"; - Pos = MAP_APPFONT ( 198 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Add..." ; - TabStop = TRUE ; - }; - PushButton BTN_MODIFY - { - HelpID = "cui:PushButton:RID_SVXPAGE_LINE_DEF:BTN_MODIFY"; - Pos = MAP_APPFONT ( 198 , 34 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Modify..." ; - TabStop = TRUE ; - }; - PushButton BTN_DELETE - { - HelpID = "cui:PushButton:RID_SVXPAGE_LINE_DEF:BTN_DELETE"; - Pos = MAP_APPFONT ( 198 , 54 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Delete..." ; - TabStop = TRUE ; - }; - ImageButton BTN_LOAD - { - HelpID = "cui:ImageButton:RID_SVXPAGE_LINE_DEF:BTN_LOAD"; - Pos = MAP_APPFONT ( 198 , 74 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Load Line Styles" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05501.bmp" ; - }; - MASKCOLOR - }; - }; - ImageButton BTN_SAVE - { - HelpID = "cui:ImageButton:RID_SVXPAGE_LINE_DEF:BTN_SAVE"; - Pos = MAP_APPFONT ( 198 , 96 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Save Line Styles" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05502.bmp" ; - }; - MASKCOLOR - }; - }; - Control CTL_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 135 ) ; - Size = MAP_APPFONT ( 248 , 40 ) ; - }; - - String STR_START_TYPE - { - Text [ en-US ] = "Start type" ; - }; - String STR_END_TYPE - { - Text [ en-US ] = "End type" ; - }; - String STR_START_NUM - { - Text [ en-US ] = "Start number" ; - }; - String STR_END_NUM - { - Text [ en-US ] = "End number" ; - }; - String STR_START_LENGTH - { - Text [ en-US ] = "Start length" ; - }; - String STR_END_LENGTH - { - Text [ en-US ] = "End length" ; - }; -}; - -// Defining LineEnds -------------------- - -TabPage RID_SVXPAGE_LINEEND_DEF -{ - Size = MAP_APPFONT ( 260 , 185 ) ; - HelpId = HID_LINE_ENDDEF ; - Hide = TRUE ; - Text [ en-US ] = "Arrowheads" ; - - FixedLine FL_TIP - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Organize arrow styles" ; - }; - FixedText FI_TIP - { - Pos = MAP_APPFONT ( 6 , 123 ) ; - Size = MAP_APPFONT ( 252 , 8 ) ; - Text [ en-US ] = "Add a selected object to create new arrow styles." ; - WordBreak = TRUE ; - }; - - FixedText FT_LINE_END_STYLE - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 84 , 8 ) ; - Text [ en-US ] = "Arrow style" ; - }; - Edit EDT_NAME - { - HelpID = "cui:Edit:RID_SVXPAGE_LINEEND_DEF:EDT_NAME"; - Border = TRUE ; - Pos = MAP_APPFONT ( 98 , 14 ) ; - Size = MAP_APPFONT ( 87 , 12 ) ; - TabStop = TRUE ; - }; - FixedText FT_TITLE - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 84 , 8 ) ; - Text [ en-US ] = "~Title" ; - }; - ListBox LB_LINEENDS - { - HelpID = "cui:ListBox:RID_SVXPAGE_LINEEND_DEF:LB_LINEENDS"; - Border = TRUE ; - Pos = MAP_APPFONT ( 98 , 30 ) ; - Size = MAP_APPFONT ( 87 , 80 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - DDExtraWidth = TRUE ; - }; - PushButton BTN_ADD - { - HelpID = "cui:PushButton:RID_SVXPAGE_LINEEND_DEF:BTN_ADD"; - Pos = MAP_APPFONT ( 198 , 14 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Add..." ; - TabStop = TRUE ; - }; - PushButton BTN_MODIFY - { - HelpID = "cui:PushButton:RID_SVXPAGE_LINEEND_DEF:BTN_MODIFY"; - Pos = MAP_APPFONT ( 198 , 34 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Modify..." ; - TabStop = TRUE ; - }; - PushButton BTN_DELETE - { - HelpID = "cui:PushButton:RID_SVXPAGE_LINEEND_DEF:BTN_DELETE"; - Pos = MAP_APPFONT ( 198 , 54 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Delete..." ; - TabStop = TRUE ; - }; - ImageButton BTN_LOAD - { - HelpID = "cui:ImageButton:RID_SVXPAGE_LINEEND_DEF:BTN_LOAD"; - Pos = MAP_APPFONT ( 198 , 74 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Load Arrow Styles" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05501.bmp" ; - }; - MASKCOLOR - }; - }; - ImageButton BTN_SAVE - { - HelpID = "cui:ImageButton:RID_SVXPAGE_LINEEND_DEF:BTN_SAVE"; - Pos = MAP_APPFONT ( 198 , 96 ) ; - Size = MAP_APPFONT ( 16 , 16 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Save Arrow Styles" ; - ButtonImage = Image - { - ImageBitmap = Bitmap - { - File = "sc05502.bmp" ; - }; - MASKCOLOR - }; - }; - - Control CTL_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 135 ) ; - Size = MAP_APPFONT ( 248 , 40 ) ; - }; - -}; - // RID_SVXDLG_LINE ---------------------------------------------------------- -TabDialog RID_SVXDLG_LINE -{ - OutputSize = TRUE ; - SvLook = TRUE ; - Size = MAP_APPFONT ( 289 , 176 ) ; - Text [ en-US ] = "Line" ; - Moveable = TRUE ; - TabControl TAB_CONTROL - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( 260 , 135 ) ; - PageList = - { - PageItem - { - Identifier = RID_SVXPAGE_LINE ; - Text [ en-US ] = "Line" ; - PageResID = RID_SVXPAGE_LINE ; - }; - PageItem - { - Identifier = RID_SVXPAGE_SHADOW ; - PageResID = RID_SVXPAGE_SHADOW ; - Text [ en-US ] = "Shadow" ; - }; - PageItem - { - Identifier = RID_SVXPAGE_LINE_DEF ; - Text [ en-US ] = "Line Styles" ; - PageResID = RID_SVXPAGE_LINE_DEF ; - }; - PageItem - { - Identifier = RID_SVXPAGE_LINEEND_DEF ; - Text [ en-US ] = "Arrow Styles" ; - PageResID = RID_SVXPAGE_LINEEND_DEF ; - }; -/* - PageItem - { - Identifier = RID_SVXPAGE_COLOR ; - Text [ en-US ] = "Colors" ; - PageResID = RID_SVXPAGE_COLOR ; - }; -*/ - }; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx deleted file mode 100644 index f2d8e0c3c..000000000 --- a/cui/source/tabpages/tabstpge.cxx +++ /dev/null @@ -1,759 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- - -#include <sfx2/app.hxx> -#include <tools/shl.hxx> -#include <svtools/ruler.hxx> -#include <svx/dialogs.hrc> - -#define _SVX_TABSTPGE_CXX - -#include <cuires.hrc> -#include "tabstpge.hrc" -#include <editeng/lrspitem.hxx> -#include "tabstpge.hxx" -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include <sfx2/module.hxx> -#include <svl/cjkoptions.hxx> -#include <unotools/localedatawrapper.hxx> -#include <comphelper/processfactory.hxx> -#include <sfx2/request.hxx> -#include <svl/intitem.hxx> - -// class TabWin_Impl ----------------------------------------------------- - -class TabWin_Impl : public Window -{ -private: - sal_uInt16 nTabStyle; - -public: - TabWin_Impl( Window* pParent, const ResId& rId, sal_uInt16 nStyle ) : - Window( pParent, rId ), - nTabStyle( nStyle ) {} - - virtual void Paint( const Rectangle& rRect ); -}; - -// static ---------------------------------------------------------------- - -static sal_uInt16 pRanges[] = -{ - SID_ATTR_TABSTOP, - SID_ATTR_TABSTOP_OFFSET, - 0 -}; - -// C-Funktion ------------------------------------------------------------ - -void FillUpWithDefTabs_Impl( long nDefDist, SvxTabStopItem& rTabs ) -{ - if( rTabs.Count() ) - return; - { - SvxTabStop aSwTabStop( nDefDist, SVX_TAB_ADJUST_DEFAULT ); - rTabs.Insert( aSwTabStop ); - } -} - -// class TabWin_Impl ----------------------------------------------------- - -void TabWin_Impl::Paint( const Rectangle& ) -{ - // Tabulatoren malen - Point aPnt; - Size aSize = GetOutputSizePixel(); - aPnt.X() = aSize.Width() / 2; - aPnt.Y() = aSize.Height() / 2; - Ruler::DrawTab( this, aPnt, nTabStyle ); -} - -// class SvxTabulatorTabPage --------------------------------------------- - -SvxTabulatorTabPage::SvxTabulatorTabPage( Window* pParent, - const SfxItemSet& rAttr ): - - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_TABULATOR ), rAttr ), - - aTabLabel ( this, CUI_RES( FL_TABPOS ) ), - aTabBox ( this, CUI_RES( ED_TABPOS ) ), - aTabLabelVert ( this, CUI_RES( FL_TABPOS_VERT ) ), - aTabTypeLabel ( this, CUI_RES( FL_TABTYPE ) ), - aLeftTab ( this, CUI_RES( BTN_TABTYPE_LEFT ) ), - aRightTab ( this, CUI_RES( BTN_TABTYPE_RIGHT ) ), - aCenterTab ( this, CUI_RES( BTN_TABTYPE_CENTER ) ), - aDezTab ( this, CUI_RES( BTN_TABTYPE_DECIMAL ) ), - pLeftWin ( new TabWin_Impl( this, CUI_RES( WIN_TABLEFT ), (sal_uInt16)(RULER_TAB_LEFT|WB_HORZ) ) ), - pRightWin ( new TabWin_Impl( this, CUI_RES( WIN_TABRIGHT ), (sal_uInt16)(RULER_TAB_RIGHT|WB_HORZ) ) ), - pCenterWin ( new TabWin_Impl( this, CUI_RES( WIN_TABCENTER ), (sal_uInt16)(RULER_TAB_CENTER|WB_HORZ) ) ), - pDezWin ( new TabWin_Impl( this, CUI_RES( WIN_TABDECIMAL ), (sal_uInt16)(RULER_TAB_DECIMAL|WB_HORZ) ) ), - aDezCharLabel ( this, CUI_RES( FT_TABTYPE_DECCHAR ) ), - aDezChar ( this, CUI_RES( ED_TABTYPE_DECCHAR ) ), - aFillLabel ( this, CUI_RES( FL_FILLCHAR ) ), - aNoFillChar ( this, CUI_RES( BTN_FILLCHAR_NO ) ), - aFillPoints ( this, CUI_RES( BTN_FILLCHAR_POINTS ) ), - aFillDashLine ( this, CUI_RES( BTN_FILLCHAR_DASHLINE ) ), - aFillSolidLine ( this, CUI_RES( BTN_FILLCHAR_UNDERSCORE ) ), - aFillSpecial ( this, CUI_RES( BTN_FILLCHAR_OTHER ) ), - aFillChar ( this, CUI_RES( ED_FILLCHAR_OTHER ) ), - aNewBtn ( this, CUI_RES( BTN_NEW ) ), - aDelAllBtn ( this, CUI_RES( BTN_DELALL ) ), - aDelBtn ( this, CUI_RES( BTN_DEL ) ), - - aAktTab ( 0 ), - aNewTabs ( 0, 0, SVX_TAB_ADJUST_LEFT, GetWhich( SID_ATTR_TABSTOP ) ), - nDefDist ( 0 ), - eDefUnit( FUNIT_100TH_MM ), - bCheck ( sal_False ) - -{ - SvtCJKOptions aCJKOptions; - if(aCJKOptions.IsAsianTypographyEnabled()) - { - aLeftTab .SetText(String(CUI_RES( ST_LEFTTAB_ASIAN ))); - aRightTab .SetText(String(CUI_RES( ST_RIGHTTAB_ASIAN ))); - } - - aFillChar.SetAccessibleName(String(CUI_RES( ST_FILLCHAR_OTHER ))); - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - - // Metrik einstellen - FieldUnit eFUnit = GetModuleFieldUnit( rAttr ); - SetFieldUnit( aTabBox, eFUnit ); - - // Buttons initialisieren - aNewBtn.SetClickHdl( LINK( this,SvxTabulatorTabPage, NewHdl_Impl ) ); - aDelBtn.SetClickHdl( LINK( this,SvxTabulatorTabPage, DelHdl_Impl ) ); - aDelAllBtn.SetClickHdl( LINK( this,SvxTabulatorTabPage, DelAllHdl_Impl ) ); - - Link aLink = LINK( this, SvxTabulatorTabPage, TabTypeCheckHdl_Impl ); - aLeftTab.SetClickHdl( aLink ); - aRightTab.SetClickHdl( aLink ); - aDezTab.SetClickHdl( aLink ); - aCenterTab.SetClickHdl( aLink ); - - aDezChar.SetLoseFocusHdl( LINK( this, SvxTabulatorTabPage, GetDezCharHdl_Impl ) ); - aDezChar.SetMaxTextLen(1); - aDezChar.Disable(); - aDezCharLabel.Disable(); - - aLink = LINK( this, SvxTabulatorTabPage, FillTypeCheckHdl_Impl ); - aNoFillChar.SetClickHdl( aLink ); - aFillPoints.SetClickHdl( aLink ); - aFillDashLine.SetClickHdl( aLink ); - aFillSolidLine.SetClickHdl( aLink ); - aFillSpecial.SetClickHdl( aLink ); - aFillChar.SetLoseFocusHdl( LINK( this, SvxTabulatorTabPage, GetFillCharHdl_Impl ) ); - aFillChar.SetMaxTextLen(1); - aFillChar.Disable(); - - aTabBox.SetDoubleClickHdl( LINK( this, SvxTabulatorTabPage, SelectHdl_Impl ) ); - aTabBox.SetModifyHdl( LINK( this, SvxTabulatorTabPage, ModifyHdl_Impl ) ); - - aLeftTab.SetAccessibleRelationMemberOf( &aTabTypeLabel ); - aRightTab.SetAccessibleRelationMemberOf( &aTabTypeLabel ); - aCenterTab.SetAccessibleRelationMemberOf( &aTabTypeLabel ); - aDezTab.SetAccessibleRelationMemberOf( &aTabTypeLabel ); - aDezCharLabel.SetAccessibleRelationMemberOf( &aTabTypeLabel ); - aDezChar.SetAccessibleRelationMemberOf( &aTabTypeLabel ); - - aNoFillChar.SetAccessibleRelationMemberOf( &aFillLabel ); - aFillPoints.SetAccessibleRelationMemberOf( &aFillLabel ); - aFillDashLine.SetAccessibleRelationMemberOf( &aFillLabel ); - aFillSolidLine.SetAccessibleRelationMemberOf( &aFillLabel ); - aFillSpecial.SetAccessibleRelationMemberOf( &aFillLabel ); - aFillChar.SetAccessibleRelationMemberOf( &aFillLabel ); - - aFillChar.SetAccessibleRelationLabeledBy(&aFillSpecial); - - // das Default-Dezimalzeichen vom System holen - LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - aAktTab.GetDecimal() = aLocaleWrapper.getNumDecimalSep().GetChar(0); - FreeResource(); -} - -// ----------------------------------------------------------------------- - -SvxTabulatorTabPage::~SvxTabulatorTabPage() -{ - delete pLeftWin; - delete pRightWin; - delete pCenterWin; - delete pDezWin; -} - -// ----------------------------------------------------------------------- - -sal_uInt16* SvxTabulatorTabPage::GetRanges() -{ - return pRanges; -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxTabulatorTabPage::FillItemSet( SfxItemSet& rSet ) -{ - sal_Bool bModified = sal_False; - - // Hier die Werte aus den Controls eintueten - if ( aNewBtn.IsEnabled() ) - NewHdl_Impl( 0 ); - - // call at first the LoseFocus-Handler - GetDezCharHdl_Impl( &aDezChar ); - GetFillCharHdl_Impl( &aFillChar ); - - FillUpWithDefTabs_Impl( nDefDist, aNewTabs ); - SfxItemPool* pPool = rSet.GetPool(); - MapUnit eUnit = (MapUnit)pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) ); - const SfxPoolItem* pOld = GetOldItem( rSet, SID_ATTR_TABSTOP ); - - if ( MAP_100TH_MM != eUnit ) - { - // Wenn sich im ItemSet ein LRSpaceItem mit negativen Erstzeileneinzug - // befindet, muss im TabStopItem auf der Position 0 ein DefTab sein. - const SfxPoolItem* pLRSpace; - // wenn nicht im neuen Set, dann vielleicht im alten - if ( SFX_ITEM_SET != - rSet.GetItemState( GetWhich( SID_ATTR_LRSPACE ), sal_True, &pLRSpace ) ) - pLRSpace = GetOldItem( rSet, SID_ATTR_LRSPACE ); - - if ( pLRSpace && ( (SvxLRSpaceItem*)pLRSpace )->GetTxtFirstLineOfst() < 0 ) - { - SvxTabStop aNull( 0, SVX_TAB_ADJUST_DEFAULT ); - aNewTabs.Insert( aNull ); - } - - SvxTabStopItem aTmp( aNewTabs ); - aTmp.Remove( 0, aTmp.Count() ); - - for ( sal_uInt16 i = 0; i < aNewTabs.Count(); ++i ) - { - SvxTabStop aTmpStop = aNewTabs[i]; - aTmpStop.GetTabPos() = - LogicToLogic( aTmpStop.GetTabPos(), MAP_100TH_MM, eUnit ); - aTmp.Insert( aTmpStop ); - } - - if ( !pOld || !( *( (SvxTabStopItem*)pOld ) == aTmp ) ) - { - rSet.Put( aTmp ); - bModified = sal_True; - } - } - else if ( !pOld || !( *( (SvxTabStopItem*)pOld ) == aNewTabs ) ) - { - rSet.Put( aNewTabs ); - bModified = sal_True; - } - return bModified; -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxTabulatorTabPage::Create( Window* pParent, - const SfxItemSet& rSet) -{ - return ( new SvxTabulatorTabPage( pParent, rSet ) ); -} - -// ----------------------------------------------------------------------- - -void SvxTabulatorTabPage::Reset( const SfxItemSet& rSet ) -{ - SfxItemPool* pPool = rSet.GetPool(); - MapUnit eUnit = (MapUnit)pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) ); - - // Aktuelle Tabs - const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_TABSTOP ); - - if ( pItem ) - { - if ( MAP_100TH_MM != eUnit ) - { - SvxTabStopItem aTmp( *( (const SvxTabStopItem*)pItem ) ); - aNewTabs.Remove( 0, aNewTabs.Count() ); - - for ( sal_uInt16 i = 0; i < aTmp.Count(); ++i ) - { - SvxTabStop aTmpStop = aTmp[i]; - aTmpStop.GetTabPos() = - LogicToLogic( aTmpStop.GetTabPos(), eUnit, MAP_100TH_MM ); - aNewTabs.Insert( aTmpStop ); - } - } - else - aNewTabs = *( (const SvxTabStopItem*)pItem ); - } - else - aNewTabs.Remove( 0, aNewTabs.Count() ); - - // Default-Tab - Abstand - nDefDist = SVX_TAB_DEFDIST; - pItem = GetItem( rSet, SID_ATTR_TABSTOP_DEFAULTS ); - - if ( pItem ) - nDefDist = LogicToLogic( - (long)((const SfxUInt16Item*)pItem)->GetValue(), eUnit, MAP_100TH_MM ); - - // Aktuell selektierte Tab-Pos - sal_uInt16 nTabPos = 0; - pItem = GetItem( rSet, SID_ATTR_TABSTOP_POS ); - - if ( pItem ) - nTabPos = ( (const SfxUInt16Item*)pItem )->GetValue(); - - InitTabPos_Impl( nTabPos ); -} - -// ----------------------------------------------------------------------- - -void SvxTabulatorTabPage::DisableControls( const sal_uInt16 nFlag ) -{ - if ( ( TABTYPE_LEFT & nFlag ) == TABTYPE_LEFT ) - { - aLeftTab.Disable(); - pLeftWin->Disable(); - } - if ( ( TABTYPE_RIGHT & nFlag ) == TABTYPE_RIGHT ) - { - aRightTab.Disable(); - pRightWin->Disable(); - } - if ( ( TABTYPE_CENTER & nFlag ) == TABTYPE_CENTER ) - { - aCenterTab.Disable(); - pCenterWin->Disable(); - } - if ( ( TABTYPE_DEZIMAL & nFlag ) == TABTYPE_DEZIMAL ) - { - aDezTab.Disable(); - pDezWin->Disable(); - aDezCharLabel.Disable(); - aDezChar.Disable(); - } - if ( ( TABTYPE_ALL & nFlag ) == TABTYPE_ALL ) - aTabTypeLabel.Disable(); - if ( ( TABFILL_NONE & nFlag ) == TABFILL_NONE ) - aNoFillChar.Disable(); - if ( ( TABFILL_POINT & nFlag ) == TABFILL_POINT ) - aFillPoints.Disable(); - if ( ( TABFILL_DASHLINE & nFlag ) == TABFILL_DASHLINE ) - aFillDashLine.Disable(); - if ( ( TABFILL_SOLIDLINE & nFlag ) == TABFILL_SOLIDLINE ) - aFillSolidLine.Disable(); - if ( ( TABFILL_SPECIAL & nFlag ) == TABFILL_SPECIAL ) - { - aFillSpecial.Disable(); - aFillChar.Disable(); - } - if ( ( TABFILL_ALL & nFlag ) == TABFILL_ALL ) - aFillLabel.Disable(); -} - -// ----------------------------------------------------------------------- - -int SvxTabulatorTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( _pSet ) - FillItemSet( *_pSet ); - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -void SvxTabulatorTabPage::InitTabPos_Impl( sal_uInt16 nTabPos ) -{ - aTabBox.Clear(); - - long nOffset = 0; - const SfxPoolItem* pItem = 0; - if ( GetItemSet().GetItemState( SID_ATTR_TABSTOP_OFFSET, sal_True, &pItem ) - == SFX_ITEM_SET ) - { - nOffset = ( (const SfxInt32Item*)pItem )->GetValue(); - MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric( GetWhich( SID_ATTR_TABSTOP ) ); - nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MAP_100TH_MM ); - } - - // Aktuelle TabPos korrigieren und Defaults-Tabs - for ( sal_uInt16 i = 0; i < aNewTabs.Count(); i++ ) - { - if ( aNewTabs[i].GetAdjustment() != SVX_TAB_ADJUST_DEFAULT ) - { - aTabBox.InsertValue( aTabBox.Normalize( - aNewTabs[i].GetTabPos() + nOffset ), eDefUnit ); - } - else - aNewTabs.Remove( i-- ); - } - - // aktuellen Tabulator auswaehlen - const sal_uInt16 nSize = aNewTabs.Count(); - - if ( nTabPos >= nSize ) - nTabPos = 0; - - // alle RadioButtons erstmal ausschalten - aLeftTab.Check( sal_True ); - aNoFillChar.Check( sal_True ); - - if( aTabBox.GetEntryCount() > 0 ) - { - aTabBox.SetText( aTabBox.GetEntry( nTabPos ) ); - aAktTab = aNewTabs[nTabPos]; - - SetFillAndTabType_Impl(); - aNewBtn.Disable(); - aDelBtn.Enable(); - } - else - { // kein Eintrag dann ist 0 der Default-Wert - aTabBox.SetValue( 0, eDefUnit ); - - aNewBtn.Enable(); - aDelBtn.Disable(); - } -} - -// ----------------------------------------------------------------------- - -void SvxTabulatorTabPage::SetFillAndTabType_Impl() -{ - RadioButton* pTypeBtn = 0; - RadioButton* pFillBtn = 0; - - aDezChar.Disable(); - aDezCharLabel.Disable(); - - if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_LEFT ) - pTypeBtn = &aLeftTab; - else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_RIGHT ) - pTypeBtn = &aRightTab; - else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_DECIMAL ) - { - pTypeBtn = &aDezTab; - aDezChar.Enable(); - aDezCharLabel.Enable(); - aDezChar.SetText( String( (sal_Unicode)aAktTab.GetDecimal() ) ); - } - else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_CENTER ) - pTypeBtn = &aCenterTab; - - if ( pTypeBtn ) - pTypeBtn->Check(); - - aFillChar.Disable(); - aFillChar.SetText( String() ); - - if ( aAktTab.GetFill() == ' ' ) - pFillBtn = &aNoFillChar; - else if ( aAktTab.GetFill() == '-' ) - pFillBtn = &aFillDashLine; - else if ( aAktTab.GetFill() == '_' ) - pFillBtn = &aFillSolidLine; - else if ( aAktTab.GetFill() == '.' ) - pFillBtn = &aFillPoints; - else - { - pFillBtn = &aFillSpecial; - aFillChar.Enable(); - aFillChar.SetText( String( (sal_Unicode)aAktTab.GetFill() ) ); - } - pFillBtn->Check(); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxTabulatorTabPage, NewHdl_Impl, Button *, pBtn ) -{ - // Einen neuen Hinzufuegen und Selectieren - // Wert aus der Anzeige holen - long nVal = static_cast<long>(aTabBox.Denormalize( aTabBox.GetValue( eDefUnit ) )); - - // Wenn der pBtn == 0 && der Value == 0 dann keinen Tab Erzeugen - // weil ueber OK erzeugt - if ( nVal == 0 && pBtn == 0 ) - return 0; - - long nOffset = 0; - const SfxPoolItem* pItem = 0; - - if ( GetItemSet().GetItemState( SID_ATTR_TABSTOP_OFFSET, sal_True, &pItem ) == - SFX_ITEM_SET ) - { - nOffset = ( (const SfxInt32Item*)pItem )->GetValue(); - MapUnit eUnit = (MapUnit)GetItemSet().GetPool()->GetMetric( GetWhich( SID_ATTR_TABSTOP ) ); - nOffset = OutputDevice::LogicToLogic( nOffset, eUnit, MAP_100TH_MM ); - } - const long nReal = nVal - nOffset; - sal_uInt16 nSize = aTabBox.GetEntryCount(); - - sal_uInt16 i; - for( i = 0; i < nSize; i++ ) - { - if ( nReal < aNewTabs[i].GetTabPos() ) - break; - } - - // ListBox-Eintrag vornehmen - aTabBox.InsertValue( aTabBox.Normalize( nVal ), eDefUnit, i ); - aAktTab.GetTabPos() = nReal; - SvxTabAdjust eAdj = SVX_TAB_ADJUST_LEFT; - - if ( aRightTab.IsChecked() ) - eAdj = SVX_TAB_ADJUST_RIGHT; - else if ( aCenterTab.IsChecked() ) - eAdj = SVX_TAB_ADJUST_CENTER; - else if ( aDezTab.IsChecked() ) - eAdj = SVX_TAB_ADJUST_DECIMAL; - - aAktTab.GetAdjustment() = eAdj; - aNewTabs.Insert( aAktTab ); - - aNewBtn.Disable(); - aDelBtn.Enable(); - aTabBox.GrabFocus(); - - // falls kein RadioButton geclickt wurde, - // muss trotzdem geputtet werden - bCheck |= sal_True; - // set the selection into the position Edit - aTabBox.SetSelection(Selection(0, aTabBox.GetText().Len())); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxTabulatorTabPage, DelHdl_Impl, Button *, EMPTYARG ) -{ - sal_uInt16 nPos = aTabBox.GetValuePos( aTabBox.GetValue() ); - - if ( nPos == COMBOBOX_ENTRY_NOTFOUND ) - return 0; - - if ( aTabBox.GetEntryCount() == 1 ) - { - DelAllHdl_Impl( 0 ); - return 0; - } - - // Tab loeschen - aTabBox.RemoveEntry( nPos ); - aNewTabs.Remove( nPos ); - - // aAktTab neu setzen - const sal_uInt16 nSize = aNewTabs.Count(); - - if ( nSize > 0 ) - { - // Pos korrigieren - nPos = ( ( nSize - 1 ) >= nPos) ? nPos : nPos - 1; - aTabBox.SetValue( aTabBox.GetValue( nPos ) ); - aAktTab = aNewTabs[nPos]; - } - - // Falls keine Tabs Enable Disable Controls - if ( aTabBox.GetEntryCount() == 0 ) - { - aDelBtn.Disable(); - aNewBtn.Enable(); - aTabBox.GrabFocus(); - } - - // falls kein RadioButton geclickt wurde, - // muss trotzdem geputtet werden - bCheck |= sal_True; - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxTabulatorTabPage, DelAllHdl_Impl, Button *, EMPTYARG ) -{ - if ( aNewTabs.Count() ) - { - aNewTabs = SvxTabStopItem( 0 ); - InitTabPos_Impl(); - - // damit in FillItemSet() geputtet wird - bCheck |= sal_True; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxTabulatorTabPage, TabTypeCheckHdl_Impl, RadioButton *, pBox ) -{ - bCheck |= sal_True; - SvxTabAdjust eAdj; - aDezChar.Disable(); - aDezCharLabel.Disable(); - aDezChar.SetText( String() ); - - if ( pBox == &aLeftTab ) - eAdj = SVX_TAB_ADJUST_LEFT; - else if ( pBox == &aRightTab ) - eAdj = SVX_TAB_ADJUST_RIGHT; - else if ( pBox == &aCenterTab ) - eAdj = SVX_TAB_ADJUST_CENTER; - else - { - eAdj = SVX_TAB_ADJUST_DECIMAL; - aDezChar.Enable(); - aDezCharLabel.Enable(); - aDezChar.SetText( String( (sal_Unicode)aAktTab.GetDecimal() ) ); - } - - aAktTab.GetAdjustment() = eAdj; - sal_uInt16 nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit ); - - if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) - { - aNewTabs.Remove( nPos ); - aNewTabs.Insert( aAktTab ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxTabulatorTabPage, FillTypeCheckHdl_Impl, RadioButton *, pBox ) -{ - bCheck |= sal_True; - sal_uInt8 cFill = ' '; - aFillChar.SetText( String() ); - aFillChar.Disable(); - - if( pBox == &aFillSpecial ) - aFillChar.Enable(); - else if ( pBox == &aNoFillChar ) - cFill = ' '; - else if ( pBox == &aFillSolidLine ) - cFill = '_'; - else if ( pBox == &aFillPoints ) - cFill = '.'; - else if ( pBox == &aFillDashLine ) - cFill = '-'; - - aAktTab.GetFill() = cFill; - sal_uInt16 nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit ); - - if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) - { - aNewTabs.Remove( nPos ); - aNewTabs.Insert( aAktTab ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxTabulatorTabPage, GetFillCharHdl_Impl, Edit *, pEdit ) -{ - String aChar( pEdit->GetText() ); - - if ( aChar.Len() > 0 ) - aAktTab.GetFill() = aChar.GetChar( 0 ); - - const sal_uInt16 nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit); - if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) - { - aNewTabs.Remove( nPos ); - aNewTabs.Insert( aAktTab ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxTabulatorTabPage, GetDezCharHdl_Impl, Edit *, pEdit ) -{ - String aChar( pEdit->GetText() ); - if ( aChar.Len() > 0 && ( aChar.GetChar( 0 ) >= ' ')) - aAktTab.GetDecimal() = aChar.GetChar( 0 ); - - sal_uInt16 nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit ); - if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) - { - aNewTabs.Remove( nPos ); - aNewTabs.Insert( aAktTab ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxTabulatorTabPage, SelectHdl_Impl, MetricBox *, EMPTYARG ) -{ - sal_uInt16 nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit ); - if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) - { - aAktTab = aNewTabs[nPos]; - aNewBtn.Disable(); - SetFillAndTabType_Impl(); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxTabulatorTabPage, ModifyHdl_Impl, MetricBox *, EMPTYARG ) -{ - sal_uInt16 nPos = aTabBox.GetValuePos( aTabBox.GetValue( eDefUnit ), eDefUnit ); - if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) - { - aAktTab = aNewTabs[nPos]; - SetFillAndTabType_Impl(); - - aAktTab.GetTabPos() = - static_cast<long>(aTabBox.Denormalize( aTabBox.GetValue( eDefUnit ) )); - - aNewBtn.Disable(); - aDelBtn.Enable(); - return 0; - } - aNewBtn.Enable(); - aDelBtn.Disable(); - return 0; -} - -void SvxTabulatorTabPage::PageCreated(SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pControlItem,SfxUInt16Item,SID_SVXTABULATORTABPAGE_CONTROLFLAGS,sal_False); - if (pControlItem) - DisableControls(pControlItem->GetValue()); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tabstpge.hrc b/cui/source/tabpages/tabstpge.hrc deleted file mode 100644 index 095b89c04..000000000 --- a/cui/source/tabpages/tabstpge.hrc +++ /dev/null @@ -1,66 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#ifndef _SVX_TABSTPGE_HRC -#define _SVX_TABSTPGE_HRC - -// defines ------------------------------------------------------------------ - -#define ED_TABPOS 10 -#define FL_TABPOS 11 -#define FL_TABPOS_VERT 12 - -#define BTN_TABTYPE_LEFT 20 -#define WIN_TABLEFT 21 -#define BTN_TABTYPE_RIGHT 22 -#define WIN_TABRIGHT 23 -#define BTN_TABTYPE_CENTER 24 -#define WIN_TABCENTER 25 -#define BTN_TABTYPE_DECIMAL 26 -#define WIN_TABDECIMAL 27 -#define ED_TABTYPE_DECCHAR 28 -#define FT_TABTYPE_DECCHAR 29 -#define FL_TABTYPE 30 - - -#define BTN_FILLCHAR_NO 40 -#define BTN_FILLCHAR_POINTS 41 -#define BTN_FILLCHAR_DASHLINE 42 -#define BTN_FILLCHAR_UNDERSCORE 43 -#define BTN_FILLCHAR_OTHER 44 -#define ED_FILLCHAR_OTHER 45 -#define FL_FILLCHAR 46 - -#define BTN_NEW 50 -#define BTN_DEL 51 -#define BTN_DELALL 52 -#define ST_LEFTTAB_ASIAN 53 -#define ST_RIGHTTAB_ASIAN 54 -//IAccessibility2 Implementation 2009----- -#define ST_FILLCHAR_OTHER 55 -//-----IAccessibility2 Implementation 2009 -#endif - diff --git a/cui/source/tabpages/tabstpge.src b/cui/source/tabpages/tabstpge.src deleted file mode 100644 index 79421f0ce..000000000 --- a/cui/source/tabpages/tabstpge.src +++ /dev/null @@ -1,215 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include "helpid.hrc" -#include <cuires.hrc> -#include "tabstpge.hrc" -#include <svx/dialogs.hrc> - - // RID_SVXPAGE_TABULATOR ------------------------------------------------- -TabPage RID_SVXPAGE_TABULATOR -{ - HelpId = HID_TABULATOR ; - Hide = TRUE ; - Text [ en-US ] = "Tabs" ; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedLine FL_TABPOS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 48 , 8 ) ; - Text [ en-US ] = "Position" ; - }; - MetricBox ED_TABPOS - { - HelpID = "cui:MetricBox:RID_SVXPAGE_TABULATOR:ED_TABPOS"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 39 , 165 ) ; - Minimum = -5600 ; - Maximum = 5600 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - }; - FixedLine FL_TABPOS_VERT - { - Pos = MAP_APPFONT ( 55 , 14 ) ; - Size = MAP_APPFONT ( 4 , 165 ) ; - Vert = TRUE; - }; - FixedLine FL_TABTYPE - { - Pos = MAP_APPFONT ( 60 , 3 ) ; - Size = MAP_APPFONT ( 138 , 8 ) ; - Text [ en-US ] = "Type" ; - }; - RadioButton BTN_TABTYPE_LEFT - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TABULATOR:BTN_TABTYPE_LEFT"; - Pos = MAP_APPFONT ( 66 , 14 ) ; - Size = MAP_APPFONT ( 89 , 10 ) ; - Text [ en-US ] = "~Left" ; - Check = TRUE ; - }; - Window WIN_TABLEFT - { - Pos = MAP_APPFONT ( 157 , 14 ) ; - Size = MAP_APPFONT ( 7 , 10 ) ; - }; - RadioButton BTN_TABTYPE_RIGHT - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TABULATOR:BTN_TABTYPE_RIGHT"; - Pos = MAP_APPFONT ( 66 , 28 ) ; - Size = MAP_APPFONT ( 89 , 10 ) ; - Text [ en-US ] = "Righ~t" ; - }; - Window WIN_TABRIGHT - { - Pos = MAP_APPFONT ( 157 , 28 ) ; - Size = MAP_APPFONT ( 7 , 10 ) ; - }; - RadioButton BTN_TABTYPE_CENTER - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TABULATOR:BTN_TABTYPE_CENTER"; - Pos = MAP_APPFONT ( 66 , 42 ) ; - Size = MAP_APPFONT ( 89 , 10 ) ; - Text [ en-US ] = "C~entered" ; - }; - Window WIN_TABCENTER - { - Pos = MAP_APPFONT ( 157 , 42 ) ; - Size = MAP_APPFONT ( 7 , 10 ) ; - }; - RadioButton BTN_TABTYPE_DECIMAL - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TABULATOR:BTN_TABTYPE_DECIMAL"; - Pos = MAP_APPFONT ( 66 , 56 ) ; - Size = MAP_APPFONT ( 89 , 10 ) ; - Text [ en-US ] = "Deci~mal" ; - }; - Window WIN_TABDECIMAL - { - Pos = MAP_APPFONT ( 157 , 56 ) ; - Size = MAP_APPFONT ( 7 , 10 ) ; - }; - FixedText FT_TABTYPE_DECCHAR - { - Pos = MAP_APPFONT ( 75 , 70 ) ; - Size = MAP_APPFONT ( 79 , 8 ) ; - Text [ en-US ] = "~Character" ; - }; - Edit ED_TABTYPE_DECCHAR - { - HelpID = "cui:Edit:RID_SVXPAGE_TABULATOR:ED_TABTYPE_DECCHAR"; - Border = TRUE ; - Pos = MAP_APPFONT ( 156 , 68 ) ; - Size = MAP_APPFONT ( 9 , 12 ) ; - Left = TRUE ; - }; - FixedLine FL_FILLCHAR - { - Pos = MAP_APPFONT ( 60 , 86 ) ; - Size = MAP_APPFONT ( 138 , 8 ) ; - Text [ en-US ] = "Fill character" ; - }; - RadioButton BTN_FILLCHAR_NO - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TABULATOR:BTN_FILLCHAR_NO"; - Pos = MAP_APPFONT ( 66 , 97 ) ; - Size = MAP_APPFONT ( 89 , 10 ) ; - Text [ en-US ] = "N~one" ; - Check = TRUE ; - }; - RadioButton BTN_FILLCHAR_POINTS - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TABULATOR:BTN_FILLCHAR_POINTS"; - Pos = MAP_APPFONT ( 66 , 111 ) ; - Size = MAP_APPFONT ( 89 , 10 ) ; - Text = "~........" ; - }; - RadioButton BTN_FILLCHAR_DASHLINE - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TABULATOR:BTN_FILLCHAR_DASHLINE"; - Pos = MAP_APPFONT ( 66 , 125 ) ; - Size = MAP_APPFONT ( 89 , 10 ) ; - Text = "~--------" ; - }; - RadioButton BTN_FILLCHAR_UNDERSCORE - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TABULATOR:BTN_FILLCHAR_UNDERSCORE"; - Pos = MAP_APPFONT ( 66 , 139 ) ; - Size = MAP_APPFONT ( 89 , 10 ) ; - Text = "~_____" ; - }; - RadioButton BTN_FILLCHAR_OTHER - { - HelpID = "cui:RadioButton:RID_SVXPAGE_TABULATOR:BTN_FILLCHAR_OTHER"; - Pos = MAP_APPFONT ( 66 , 153 ) ; - Size = MAP_APPFONT ( 89 , 10 ) ; - Text [ en-US ] = "Character" ; - }; - Edit ED_FILLCHAR_OTHER - { - HelpID = "cui:Edit:RID_SVXPAGE_TABULATOR:ED_FILLCHAR_OTHER"; - Border = TRUE ; - Pos = MAP_APPFONT ( 156 , 151 ) ; - Size = MAP_APPFONT ( 9 , 12 ) ; - Left = TRUE ; - }; - PushButton BTN_NEW - { - HelpID = "cui:PushButton:RID_SVXPAGE_TABULATOR:BTN_NEW"; - Pos = MAP_APPFONT ( 204 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~New" ; - }; - PushButton BTN_DELALL - { - HelpID = "cui:PushButton:RID_SVXPAGE_TABULATOR:BTN_DELALL"; - Pos = MAP_APPFONT ( 204 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "Delete ~All" ; - }; - PushButton BTN_DEL - { - HelpID = "cui:PushButton:RID_SVXPAGE_TABULATOR:BTN_DEL"; - Pos = MAP_APPFONT ( 204 , 40 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Delete" ; - }; - String ST_LEFTTAB_ASIAN - { - Text [ en-US ] = "~Left/Top" ; - }; - String ST_RIGHTTAB_ASIAN - { - Text [ en-US ] = "Righ~t/Bottom" ; - }; - String ST_FILLCHAR_OTHER - { - Text [ en-US ] = "Character" ; - }; -}; - diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx deleted file mode 100644 index c8a0fd4ad..000000000 --- a/cui/source/tabpages/textanim.cxx +++ /dev/null @@ -1,774 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <tools/shl.hxx> - -#include <cuires.hrc> -#include <svx/dialogs.hrc> - -#ifndef _SVX_TEXTANIM_CXX -#define _SVX_TEXTANIM_CXX -#endif -#include "textanim.hxx" -#include "textanim.hrc" -#include "textattr.hxx" -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" - -static sal_uInt16 pRanges[] = -{ - SDRATTR_TEXT_ANIKIND, - SDRATTR_TEXT_ANIAMOUNT, - 0 -}; - -/************************************************************************* -|* -|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu -|* -\************************************************************************/ - -SvxTextTabDialog::SvxTextTabDialog( Window* pParent, - const SfxItemSet* pAttr, - const SdrView* pSdrView ) : - SfxTabDialog ( pParent, CUI_RES( RID_SVXDLG_TEXT ), pAttr ), - rOutAttrs ( *pAttr ), - pView ( pSdrView ) -{ - FreeResource(); - - AddTabPage( RID_SVXPAGE_TEXTATTR, SvxTextAttrPage::Create, 0); - AddTabPage( RID_SVXPAGE_TEXTANIMATION, SvxTextAnimationPage::Create, 0); -} - -/************************************************************************* -|* -|* PageCreated() -|* -\************************************************************************/ - -void SvxTextTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) -{ - switch( nId ) - { - case RID_SVXPAGE_TEXTATTR: - { - ( (SvxTextAttrPage&) rPage ).SetView( pView ); - ( (SvxTextAttrPage&) rPage ).Construct(); - } - break; - - case RID_SVXPAGE_TEXTANIMATION: - break; - - default: - break; - } -} - - -/************************************************************************* -|* -|* Page -|* -\************************************************************************/ - -SvxTextAnimationPage::SvxTextAnimationPage( Window* pWindow, const SfxItemSet& rInAttrs ) : - SfxTabPage ( pWindow, CUI_RES( RID_SVXPAGE_TEXTANIMATION ), - rInAttrs ), - aFlEffect ( this, CUI_RES(FL_EFFECT)), - aFtEffects ( this, CUI_RES(FT_EFFECTS)), - aLbEffect ( this, CUI_RES( LB_EFFECT ) ), - //aCtlEffect ( this, CUI_RES( CTL_EFFECT ) ), - aFtDirection ( this, CUI_RES(FT_DIRECTION) ), - aBtnUp ( this, CUI_RES( BTN_UP ) ), - aBtnLeft ( this, CUI_RES( BTN_LEFT ) ), - aBtnRight ( this, CUI_RES( BTN_RIGHT ) ), - aBtnDown ( this, CUI_RES( BTN_DOWN ) ), - - aFlProperties ( this, CUI_RES(FL_PROPERTIES)), - aTsbStartInside ( this, CUI_RES( TSB_START_INSIDE ) ), - aTsbStopInside ( this, CUI_RES( TSB_STOP_INSIDE ) ), - - aFtCount ( this, CUI_RES(FT_COUNT)), - aTsbEndless ( this, CUI_RES( TSB_ENDLESS ) ), - aNumFldCount ( this, CUI_RES( NUM_FLD_COUNT ) ), - - aFtAmount ( this, CUI_RES(FT_AMOUNT)), - aTsbPixel ( this, CUI_RES( TSB_PIXEL ) ), - aMtrFldAmount ( this, CUI_RES( MTR_FLD_AMOUNT ) ), - - aFtDelay ( this, CUI_RES(FT_DELAY)), - aTsbAuto ( this, CUI_RES( TSB_AUTO ) ), - aMtrFldDelay ( this, CUI_RES( MTR_FLD_DELAY ) ), - - rOutAttrs ( rInAttrs ), - eAniKind ( SDRTEXTANI_NONE ) -{ - FreeResource(); - - eFUnit = GetModuleFieldUnit( rInAttrs ); - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST ); - - Construct(); - - aLbEffect.SetSelectHdl( - LINK( this, SvxTextAnimationPage, SelectEffectHdl_Impl ) ); - aTsbEndless.SetClickHdl( - LINK( this, SvxTextAnimationPage, ClickEndlessHdl_Impl ) ); - aTsbAuto.SetClickHdl( - LINK( this, SvxTextAnimationPage, ClickAutoHdl_Impl ) ); - aTsbPixel.SetClickHdl( - LINK( this, SvxTextAnimationPage, ClickPixelHdl_Impl ) ); - - Link aLink( LINK( this, SvxTextAnimationPage, ClickDirectionHdl_Impl ) ); - aBtnUp.SetClickHdl( aLink ); - aBtnLeft.SetClickHdl( aLink ); - aBtnRight.SetClickHdl( aLink ); - aBtnDown.SetClickHdl( aLink ); - - aNumFldCount.SetAccessibleRelationLabeledBy( &aTsbEndless ); - aMtrFldAmount.SetAccessibleRelationLabeledBy( &aTsbPixel ); - aMtrFldDelay.SetAccessibleRelationLabeledBy( &aTsbAuto ); - - aBtnUp.SetAccessibleRelationLabeledBy( &aFtDirection ); - aBtnLeft.SetAccessibleRelationLabeledBy( &aFtDirection ); - aBtnRight.SetAccessibleRelationLabeledBy( &aFtDirection ); - aBtnDown.SetAccessibleRelationLabeledBy( &aFtDirection ); - - aBtnUp.SetAccessibleRelationMemberOf( &aFlEffect ); - aBtnLeft.SetAccessibleRelationMemberOf( &aFlEffect ); - aBtnRight.SetAccessibleRelationMemberOf( &aFlEffect ); - aBtnDown.SetAccessibleRelationMemberOf( &aFlEffect ); - - aTsbEndless.SetAccessibleRelationLabeledBy( &aFtCount ); - aTsbPixel.SetAccessibleRelationLabeledBy( &aFtAmount ); - aTsbAuto.SetAccessibleRelationLabeledBy( &aFtDelay ); -} - -/************************************************************************* -|* -|* Dtor -|* -\************************************************************************/ - -SvxTextAnimationPage::~SvxTextAnimationPage() -{ -} - -/************************************************************************* -|* -|* Liest uebergebenen Item-Set -|* -\************************************************************************/ - -void SvxTextAnimationPage::Reset( const SfxItemSet& rAttrs ) -{ - const SfxItemPool* pPool = rAttrs.GetPool(); - - // Animationstyp - const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIKIND ); - - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIKIND ); - if( pItem ) - { - eAniKind = ( ( const SdrTextAniKindItem* )pItem )->GetValue(); - aLbEffect.SelectEntryPos( sal::static_int_cast< sal_uInt16 >(eAniKind) ); - } - else - aLbEffect.SetNoSelection(); - aLbEffect.SaveValue(); - - // Animationsrichtung - pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDIRECTION ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDIRECTION ); - if( pItem ) - { - SdrTextAniDirection eValue = ( ( const SdrTextAniDirectionItem* )pItem )->GetValue(); - SelectDirection( eValue ); - } - else - { - aBtnUp.Check( sal_False ); - aBtnLeft.Check( sal_False ); - aBtnRight.Check( sal_False ); - aBtnDown.Check( sal_False ); - } - aBtnUp.SaveValue(); - aBtnLeft.SaveValue(); - aBtnRight.SaveValue(); - aBtnDown.SaveValue(); - - // Start inside - pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTARTINSIDE ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTARTINSIDE ); - if( pItem ) - { - aTsbStartInside.EnableTriState( sal_False ); - sal_Bool bValue = ( ( const SdrTextAniStartInsideItem* )pItem )->GetValue(); - if( bValue ) - aTsbStartInside.SetState( STATE_CHECK ); - else - aTsbStartInside.SetState( STATE_NOCHECK ); - } - else - aTsbStartInside.SetState( STATE_DONTKNOW ); - aTsbStartInside.SaveValue(); - - // Stop inside - pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTOPINSIDE ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTOPINSIDE ); - if( pItem ) - { - aTsbStopInside.EnableTriState( sal_False ); - sal_Bool bValue = ( ( const SdrTextAniStopInsideItem* )pItem )->GetValue(); - if( bValue ) - aTsbStopInside.SetState( STATE_CHECK ); - else - aTsbStopInside.SetState( STATE_NOCHECK ); - } - else - aTsbStopInside.SetState( STATE_DONTKNOW ); - aTsbStopInside.SaveValue(); - - // Anzahl - pItem = GetItem( rAttrs, SDRATTR_TEXT_ANICOUNT ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANICOUNT ); - if( pItem ) - { - aTsbEndless.EnableTriState( sal_False ); - long nValue = (long) ( ( const SdrTextAniCountItem* )pItem )->GetValue(); - aNumFldCount.SetValue( nValue ); - if( nValue == 0 ) - { - if( eAniKind == SDRTEXTANI_SLIDE ) - { - aTsbEndless.SetState( STATE_NOCHECK ); - aTsbEndless.Enable( sal_False ); - } - else - { - aTsbEndless.SetState( STATE_CHECK ); - aNumFldCount.SetEmptyFieldValue(); - } - } - else - aTsbEndless.SetState( STATE_NOCHECK ); - } - else - { - aNumFldCount.SetEmptyFieldValue(); - aTsbEndless.SetState( STATE_DONTKNOW ); - } - aTsbEndless.SaveValue(); - aNumFldCount.SaveValue(); - - // Verzoegerung - pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDELAY ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDELAY ); - if( pItem ) - { - aTsbAuto.EnableTriState( sal_False ); - long nValue = (long) ( ( const SdrTextAniDelayItem* )pItem )->GetValue(); - aMtrFldDelay.SetValue( nValue ); - if( nValue == 0 ) - { - aTsbAuto.SetState( STATE_CHECK ); - aMtrFldDelay.SetEmptyFieldValue(); - } - else - aTsbAuto.SetState( STATE_NOCHECK ); - } - else - { - aMtrFldDelay.SetEmptyFieldValue(); - aTsbAuto.SetState( STATE_DONTKNOW ); - } - aTsbAuto.SaveValue(); - aMtrFldDelay.SaveValue(); - - // Schrittweite - pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIAMOUNT ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIAMOUNT ); - if( pItem ) - { - aTsbPixel.EnableTriState( sal_False ); - long nValue = (long) ( ( const SdrTextAniAmountItem* )pItem )->GetValue(); - if( nValue <= 0 ) - { - aTsbPixel.SetState( STATE_CHECK ); - nValue = -nValue; - if( nValue == 0 ) - nValue++; - aMtrFldAmount.SetUnit( FUNIT_CUSTOM ); - aMtrFldAmount.SetDecimalDigits( 0 ); - - aMtrFldAmount.SetSpinSize( 1 ); - aMtrFldAmount.SetMin( 1 ); - aMtrFldAmount.SetFirst( 1 ); - aMtrFldAmount.SetMax( 100 ); - aMtrFldAmount.SetLast( 100 ); - - aMtrFldAmount.SetValue( nValue ); - } - else - { - aTsbPixel.SetState( STATE_NOCHECK ); - aMtrFldAmount.SetUnit( eFUnit ); - aMtrFldAmount.SetDecimalDigits( 2 ); - - aMtrFldAmount.SetSpinSize( 10 ); - aMtrFldAmount.SetMin( 1 ); - aMtrFldAmount.SetFirst( 1 ); - aMtrFldAmount.SetMax( 10000 ); - aMtrFldAmount.SetLast( 10000 ); - - SetMetricValue( aMtrFldAmount, nValue, eUnit ); - } - } - else - { - aMtrFldAmount.Disable(); - aMtrFldAmount.SetEmptyFieldValue(); - aTsbPixel.SetState( STATE_DONTKNOW ); - } - aTsbPixel.SaveValue(); - aMtrFldAmount.SaveValue(); - - - SelectEffectHdl_Impl( NULL ); - ClickEndlessHdl_Impl( NULL ); - ClickAutoHdl_Impl( NULL ); - //ClickPixelHdl_Impl( NULL ); -} - -/************************************************************************* -|* -|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen -|* -\************************************************************************/ - -sal_Bool SvxTextAnimationPage::FillItemSet( SfxItemSet& rAttrs) -{ - sal_Bool bModified = sal_False; - sal_uInt16 nPos; - TriState eState; - - // Animationstyp - nPos = aLbEffect.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND && - nPos != aLbEffect.GetSavedValue() ) - { - rAttrs.Put( SdrTextAniKindItem( (SdrTextAniKind) nPos ) ); - bModified = sal_True; - } - - // Animationsrichtung - if( aBtnUp.GetSavedValue() != aBtnUp.IsChecked() || - aBtnLeft.GetSavedValue() != aBtnLeft.IsChecked() || - aBtnRight.GetSavedValue() != aBtnRight.IsChecked() || - aBtnDown.GetSavedValue() != aBtnDown.IsChecked() ) - { - SdrTextAniDirection eValue = (SdrTextAniDirection) GetSelectedDirection(); - rAttrs.Put( SdrTextAniDirectionItem( eValue ) ); - bModified = sal_True; - } - - // Start inside - eState = aTsbStartInside.GetState(); - if( eState != aTsbStartInside.GetSavedValue() ) - { - rAttrs.Put( SdrTextAniStartInsideItem( (sal_Bool) STATE_CHECK == eState ) ); - bModified = sal_True; - } - - // Stop inside - eState = aTsbStopInside.GetState(); - if( eState != aTsbStopInside.GetSavedValue() ) - { - rAttrs.Put( SdrTextAniStopInsideItem( (sal_Bool) STATE_CHECK == eState ) ); - bModified = sal_True; - } - - // Anzahl - eState = aTsbEndless.GetState(); - String aStr = aNumFldCount.GetText(); - if( eState != aTsbEndless.GetSavedValue() || - aStr != aNumFldCount.GetSavedValue() ) - { - sal_Int64 nValue = 0; - if( eState == STATE_CHECK /*#89844#*/ && aTsbEndless.IsEnabled()) - bModified = sal_True; - else - { - if( aStr != aNumFldCount.GetSavedValue() ) - { - nValue = aNumFldCount.GetValue(); - bModified = sal_True; - } - } - if( bModified ) - rAttrs.Put( SdrTextAniCountItem( (sal_uInt16) nValue ) ); - } - - // Verzoegerung - eState = aTsbAuto.GetState(); - aStr = aMtrFldDelay.GetText(); - if( eState != aTsbAuto.GetSavedValue() || - aStr != aMtrFldDelay.GetSavedValue() ) - { - sal_Int64 nValue = 0; - if( eState == STATE_CHECK ) - bModified = sal_True; - else - { - if( aStr != aMtrFldDelay.GetSavedValue() ) - { - nValue = aMtrFldDelay.GetValue(); - bModified = sal_True; - } - } - if( bModified ) - rAttrs.Put( SdrTextAniDelayItem( (sal_uInt16) nValue ) ); - } - - // Schrittweite - eState = aTsbPixel.GetState(); - aStr = aMtrFldAmount.GetText(); - if( eState != aTsbPixel.GetSavedValue() || - aStr != aMtrFldAmount.GetSavedValue() ) - { - sal_Int64 nValue = 0; - if( eState == STATE_CHECK ) - { - nValue = aMtrFldAmount.GetValue(); - nValue = -nValue; - } - else - { - nValue = GetCoreValue( aMtrFldAmount, eUnit ); - } - rAttrs.Put( SdrTextAniAmountItem( (sal_Int16) nValue ) ); - - bModified = sal_True; - } - - return( bModified ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -void SvxTextAnimationPage::Construct() -{ -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -sal_uInt16* SvxTextAnimationPage::GetRanges() -{ - return( pRanges ); -} - -/************************************************************************* -|* -|* Erzeugt die Seite -|* -\************************************************************************/ - -SfxTabPage* SvxTextAnimationPage::Create( Window* pWindow, - const SfxItemSet& rAttrs ) -{ - return( new SvxTextAnimationPage( pWindow, rAttrs ) ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -IMPL_LINK( SvxTextAnimationPage, SelectEffectHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbEffect.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - eAniKind = (SdrTextAniKind) nPos; - switch( eAniKind ) - { - case SDRTEXTANI_NONE: - { - aFtDirection.Disable(); - aBtnUp.Disable(); - aBtnLeft.Disable(); - aBtnRight.Disable(); - aBtnDown.Disable(); - aTsbStartInside.Disable(); - aTsbStopInside.Disable(); - - aTsbEndless.Disable(); - aNumFldCount.Disable(); - aFtCount.Disable(); - - aTsbAuto.Disable(); - aMtrFldDelay.Disable(); - aFtDelay.Disable(); - - aTsbPixel.Disable(); - aMtrFldAmount.Disable(); - aFtAmount.Disable(); - } - break; - - case SDRTEXTANI_BLINK: - case SDRTEXTANI_SCROLL: - case SDRTEXTANI_ALTERNATE: - case SDRTEXTANI_SLIDE: - { - if( eAniKind == SDRTEXTANI_SLIDE ) - { - aTsbStartInside.Disable(); - aTsbStopInside.Disable(); - - aTsbEndless.Disable(); - aNumFldCount.Enable(); - aNumFldCount.SetValue( aNumFldCount.GetValue() ); - } - else - { - aTsbStartInside.Enable(); - aTsbStopInside.Enable(); - - aTsbEndless.Enable(); - ClickEndlessHdl_Impl( NULL ); - } - aFtCount.Enable(); - - aTsbAuto.Enable(); - aFtDelay.Enable(); - ClickAutoHdl_Impl( NULL ); - - if( eAniKind == SDRTEXTANI_BLINK ) - { - aFtDirection.Disable(); - aBtnUp.Disable(); - aBtnLeft.Disable(); - aBtnRight.Disable(); - aBtnDown.Disable(); - - aTsbPixel.Disable(); - aMtrFldAmount.Disable(); - aFtAmount.Disable(); - } - else - { - aFtDirection.Enable(); - aBtnUp.Enable(); - aBtnLeft.Enable(); - aBtnRight.Enable(); - aBtnDown.Enable(); - - aTsbPixel.Enable(); - aMtrFldAmount.Enable(); - aFtAmount.Enable(); - } - } - break; - } - - } - return( 0L ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -IMPL_LINK( SvxTextAnimationPage, ClickEndlessHdl_Impl, void *, EMPTYARG ) -{ - - if( eAniKind != SDRTEXTANI_SLIDE ) - { - TriState eState = aTsbEndless.GetState(); - if( eState != STATE_NOCHECK ) - { - aNumFldCount.Disable(); - aNumFldCount.SetEmptyFieldValue(); - } - else - { - aNumFldCount.Enable(); - aNumFldCount.SetValue( aNumFldCount.GetValue() ); - } - } - return( 0L ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -IMPL_LINK( SvxTextAnimationPage, ClickAutoHdl_Impl, void *, EMPTYARG ) -{ - TriState eState = aTsbAuto.GetState(); - if( eState != STATE_NOCHECK ) - { - aMtrFldDelay.Disable(); - aMtrFldDelay.SetEmptyFieldValue(); - } - else - { - aMtrFldDelay.Enable(); - aMtrFldDelay.SetValue( aMtrFldDelay.GetValue() ); - } - - return( 0L ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -IMPL_LINK( SvxTextAnimationPage, ClickPixelHdl_Impl, void *, EMPTYARG ) -{ - TriState eState = aTsbPixel.GetState(); - if( eState == STATE_CHECK ) - { - sal_Int64 nValue = aMtrFldAmount.GetValue() / 10; - aMtrFldAmount.Enable(); - aMtrFldAmount.SetUnit( FUNIT_CUSTOM ); - //SetFieldUnit( aMtrFldAmount, FUNIT_CUSTOM ); - aMtrFldAmount.SetDecimalDigits( 0 ); - - aMtrFldAmount.SetSpinSize( 1 ); - aMtrFldAmount.SetMin( 1 ); - aMtrFldAmount.SetFirst( 1 ); - aMtrFldAmount.SetMax( 100 ); - aMtrFldAmount.SetLast( 100 ); - - aMtrFldAmount.SetValue( nValue ); - } - else if( eState == STATE_NOCHECK ) - { - sal_Int64 nValue = aMtrFldAmount.GetValue() * 10; - aMtrFldAmount.Enable(); - aMtrFldAmount.SetUnit( eFUnit ); - //SetFieldUnit( aMtrFldAmount, eFUnit ); - aMtrFldAmount.SetDecimalDigits( 2 ); - - aMtrFldAmount.SetSpinSize( 10 ); - aMtrFldAmount.SetMin( 1 ); - aMtrFldAmount.SetFirst( 1 ); - aMtrFldAmount.SetMax( 10000 ); - aMtrFldAmount.SetLast( 10000 ); - - aMtrFldAmount.SetValue( nValue ); - } - - return( 0L ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -IMPL_LINK( SvxTextAnimationPage, ClickDirectionHdl_Impl, ImageButton *, pBtn ) -{ - aBtnUp.Check( pBtn == &aBtnUp ); - aBtnLeft.Check( pBtn == &aBtnLeft ); - aBtnRight.Check( pBtn == &aBtnRight ); - aBtnDown.Check( pBtn == &aBtnDown ); - - return( 0L ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -void SvxTextAnimationPage::SelectDirection( SdrTextAniDirection nValue ) -{ - aBtnUp.Check( nValue == SDRTEXTANI_UP ); - aBtnLeft.Check( nValue == SDRTEXTANI_LEFT ); - aBtnRight.Check( nValue == SDRTEXTANI_RIGHT ); - aBtnDown.Check( nValue == SDRTEXTANI_DOWN ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -sal_uInt16 SvxTextAnimationPage::GetSelectedDirection() -{ - sal_uInt16 nValue = 0; - - if( aBtnUp.IsChecked() ) - nValue = SDRTEXTANI_UP; - else if( aBtnLeft.IsChecked() ) - nValue = SDRTEXTANI_LEFT; - else if( aBtnRight.IsChecked() ) - nValue = SDRTEXTANI_RIGHT; - else if( aBtnDown.IsChecked() ) - nValue = SDRTEXTANI_DOWN; - - return( nValue ); -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/textanim.hrc b/cui/source/tabpages/textanim.hrc deleted file mode 100644 index 9fc1d207e..000000000 --- a/cui/source/tabpages/textanim.hrc +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#define LB_EFFECT 1 -#define CTL_EFFECT 1 -#define TSB_START_INSIDE 1 -#define TSB_STOP_INSIDE 2 -#define FL_EFFECT 1 -#define FT_EFFECTS 1 -#define FT_DIRECTION 2 -#define FL_PROPERTIES 2 -#define FT_COUNT 3 -#define TSB_ENDLESS 3 -#define NUM_FLD_COUNT 1 -#define FT_AMOUNT 4 -#define MTR_FLD_AMOUNT 1 -#define FT_DELAY 5 -#define MTR_FLD_DELAY 2 -#define TSB_PIXEL 4 -#define TSB_AUTO 5 -#define BTN_UP 1 -#define BTN_LEFT 2 -#define BTN_RIGHT 3 -#define BTN_DOWN 4 diff --git a/cui/source/tabpages/textanim.src b/cui/source/tabpages/textanim.src deleted file mode 100644 index 212492378..000000000 --- a/cui/source/tabpages/textanim.src +++ /dev/null @@ -1,334 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // pragma ---------------------------------------------------------------- - -#include <svtools/controldims.hrc> -#include <cuires.hrc> -#include "textanim.hrc" -#include <svx/dialogs.hrc> - -// direction image buttons -#define MA_HALFBUTTON_WIDTH 7 -#define MA_BUTTON_WIDTH (2 * MA_HALFBUTTON_WIDTH) -#define MA_BUTTON_HEIGHT (2 * MA_HALFBUTTON_WIDTH) -#define BUTTON_SIZE MAP_APPFONT( MA_BUTTON_WIDTH, MA_BUTTON_WIDTH ) -#define MA_MOVEBUT_GRACE_X 6 - -// height of first group Text effects -#define MA_EFFECTSGROUP_HEIGHT (RSC_CD_FIXEDLINE_HEIGHT + \ - RSC_SP_FLGR_INNERBORDER_LEFT + \ -/* direction buttons */ 3*MA_BUTTON_HEIGHT + \ - RSC_SP_FLGR_INNERBORDER_BOTTOM + RSC_SP_FLGR_SPACE_Y) - -// height of second group height of FIXEDTEXT -#define MA_PROPERTIESGROUP_HEIGHT (RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_LEFT + \ -/* text initially visible */ RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* text finally visible */ RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* animation runs */ RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* number of runs */ RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* step size */ RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* number of pixel */ RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* step delay */ RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y + \ -/* delay time */ RSC_CD_TEXTBOX_HEIGHT) - - -// left space for real controls -#define MA_LEFT_SPACE (RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT) - -// tabpage total size -#define MA_TOTAL_WIDTH 260 -#define MA_TOTAL_HEIGHT RSC_SP_TBPG_INNERBORDER_TOP + MA_EFFECTSGROUP_HEIGHT + MA_PROPERTIESGROUP_HEIGHT + RSC_SP_TBPG_INNERBORDER_BOTTOM - -// X position and width of effects drop down -#define MA_EFFECTLIST_X 50 -#define MA_EFFECTLIST_WIDTH 95 - - - // RID_SVXPAGE_TEXTANIMATION --------------------------------------------- -TabPage RID_SVXPAGE_TEXTANIMATION -{ - HelpID = "cui:TabPage:RID_SVXPAGE_TEXTANIMATION"; - SVLook = TRUE ; - Hide = TRUE ; - Size = MAP_APPFONT ( MA_TOTAL_WIDTH , 185 ) ; - Text [ en-US ] = "Animation" ; - FixedLine FL_EFFECT - { - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT, RSC_SP_TBPG_INNERBORDER_TOP ) ; - Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT, RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Text animation effects" ; - }; -#define MA_CURR_Y RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + MA_BUTTON_HEIGHT - FixedText FT_EFFECTS - { - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y + 3 ) ; - Size = MAP_APPFONT ( MA_EFFECTLIST_X - RSC_SP_CTRL_DESC_X - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_FLGR_INNERBORDER_LEFT, - RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "E~ffect" ; - }; - ListBox LB_EFFECT - { - HelpID = "cui:ListBox:RID_SVXPAGE_TEXTANIMATION:LB_EFFECT"; - Border = TRUE ; - Pos = MAP_APPFONT ( MA_EFFECTLIST_X, MA_CURR_Y + 1 ) ; - Size = MAP_APPFONT ( MA_EFFECTLIST_WIDTH , 57 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "No Effect" ; Default ; > ; - < "Blink" ; Default ; > ; - < "Scroll Through" ; Default ; > ; - < "Scroll Back and Forth" ; Default ; > ; - < "Scroll In" ; Default ; > ; - }; - }; - FixedText FT_DIRECTION - { - Pos = MAP_APPFONT ( MA_EFFECTLIST_X + MA_EFFECTLIST_WIDTH + RSC_SP_CTRL_X, MA_CURR_Y + 3 ) ; - Size = MAP_APPFONT ( MA_TOTAL_WIDTH - - (MA_MOVEBUT_GRACE_X + 3*MA_BUTTON_WIDTH + RSC_SP_TBPG_INNERBORDER_RIGHT + RSC_SP_FLGR_INNERBORDER_RIGHT) - - (MA_EFFECTLIST_X + MA_EFFECTLIST_WIDTH + RSC_SP_CTRL_X + RSC_SP_CTRL_DESC_X + 6), - RSC_CD_FIXEDTEXT_HEIGHT ) ; - Right = TRUE; - Text [ en-US ] = "Direction" ; - }; - ImageButton BTN_UP - { - HelpID = "cui:ImageButton:RID_SVXPAGE_TEXTANIMATION:BTN_UP"; - Pos = MAP_APPFONT ( MA_TOTAL_WIDTH - MA_MOVEBUT_GRACE_X - 2*MA_BUTTON_WIDTH - RSC_SP_TBPG_INNERBORDER_RIGHT - RSC_SP_FLGR_INNERBORDER_RIGHT, - RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP ); - Size = BUTTON_SIZE ; - Symbol = IMAGEBUTTON_ARROW_UP ; - QuickHelpText [ en-US ] = "To Top" ; - }; - ImageButton BTN_LEFT - { - HelpID = "cui:ImageButton:RID_SVXPAGE_TEXTANIMATION:BTN_LEFT"; - Pos = MAP_APPFONT ( MA_TOTAL_WIDTH - MA_MOVEBUT_GRACE_X - 3*MA_BUTTON_WIDTH - RSC_SP_TBPG_INNERBORDER_RIGHT - RSC_SP_FLGR_INNERBORDER_RIGHT, - RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + MA_BUTTON_HEIGHT); - Size = BUTTON_SIZE ; - Symbol = IMAGEBUTTON_ARROW_LEFT ; - QuickHelpText [ en-US ] = "To Left" ; - }; - ImageButton BTN_RIGHT - { - HelpID = "cui:ImageButton:RID_SVXPAGE_TEXTANIMATION:BTN_RIGHT"; - Pos = MAP_APPFONT ( MA_TOTAL_WIDTH - MA_MOVEBUT_GRACE_X - MA_BUTTON_WIDTH - RSC_SP_TBPG_INNERBORDER_RIGHT - RSC_SP_FLGR_INNERBORDER_RIGHT, - RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + MA_BUTTON_HEIGHT ) ; - Size = BUTTON_SIZE ; - Symbol = IMAGEBUTTON_ARROW_RIGHT ; - QuickHelpText [ en-US ] = "To Right" ; - }; - ImageButton BTN_DOWN - { - HelpID = "cui:ImageButton:RID_SVXPAGE_TEXTANIMATION:BTN_DOWN"; - Pos = MAP_APPFONT ( MA_TOTAL_WIDTH - MA_MOVEBUT_GRACE_X - 2*MA_BUTTON_WIDTH - RSC_SP_TBPG_INNERBORDER_RIGHT - RSC_SP_FLGR_INNERBORDER_RIGHT, - RSC_SP_TBPG_INNERBORDER_TOP + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP + 2*MA_BUTTON_HEIGHT ) ; - Size = BUTTON_SIZE ; - Symbol = IMAGEBUTTON_ARROW_DOWN ; - QuickHelpText [ en-US ] = "To Bottom" ; - }; - - FixedLine FL_PROPERTIES - { - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT , RSC_SP_TBPG_INNERBORDER_TOP + MA_EFFECTSGROUP_HEIGHT ) ; - Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT, RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Properties" ; - }; -#define MA_CURR_Y2 RSC_SP_TBPG_INNERBORDER_TOP + MA_EFFECTSGROUP_HEIGHT + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP - TriStateBox TSB_START_INSIDE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTANIMATION:TSB_START_INSIDE"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y2 ) ; - Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12, RSC_CD_CHECKBOX_HEIGHT ); - Text [ en-US ] = "S~tart inside" ; - }; -#define MA_CURR_Y3 MA_CURR_Y2 + RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y - TriStateBox TSB_STOP_INSIDE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTANIMATION:TSB_STOP_INSIDE"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y3 ) ; - Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12, RSC_CD_CHECKBOX_HEIGHT ); - Text [ en-US ] = "Text visible when exiting" ; - }; -#define MA_CURR_Y4 MA_CURR_Y3 + RSC_CD_CHECKBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y - FixedText FT_COUNT - { - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y4 ) ; - Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12, - RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Animation cycles" ; - }; -#define MA_CURR_Y5 MA_CURR_Y4 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP - TriStateBox TSB_ENDLESS - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTANIMATION:TSB_ENDLESS"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 9 , MA_CURR_Y5 + 2 ) ; - Size = MAP_APPFONT ( 71 , RSC_CD_CHECKBOX_HEIGHT ) ; - Text [ en-US ] = "~Continuous" ; - }; - NumericField NUM_FLD_COUNT - { - HelpID = "cui:NumericField:RID_SVXPAGE_TEXTANIMATION:NUM_FLD_COUNT"; - Border = TRUE ; - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 80 + RSC_SP_CTRL_GROUP_X, - MA_CURR_Y5 ) ; - Size = MAP_APPFONT ( 50 , RSC_CD_TEXTBOX_HEIGHT ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - }; -#define MA_CURR_Y6 MA_CURR_Y5 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y - FixedText FT_AMOUNT - { - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y6 ) ; - Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12, - RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Increment" ; - }; -#define MA_CURR_Y7 MA_CURR_Y6 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP - TriStateBox TSB_PIXEL - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTANIMATION:TSB_PIXEL"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 9 , MA_CURR_Y7 + 2 ) ; - Size = MAP_APPFONT ( 71 , RSC_CD_CHECKBOX_HEIGHT ) ; - Text [ en-US ] = "~Pixels" ; - }; - MetricField MTR_FLD_AMOUNT - { - HelpID = "cui:MetricField:RID_SVXPAGE_TEXTANIMATION:MTR_FLD_AMOUNT"; - Border = TRUE ; - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 80 + RSC_SP_CTRL_GROUP_X, - MA_CURR_Y7 ) ; - Size = MAP_APPFONT ( 50 , RSC_CD_TEXTBOX_HEIGHT ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText [ en-US ] = " Pixel" ; - Minimum = 1 ; - First = 1 ; - Maximum = 10000 ; - Last = 10000 ; - }; -#define MA_CURR_Y8 MA_CURR_Y7 + RSC_CD_TEXTBOX_HEIGHT + RSC_SP_CTRL_GROUP_Y - FixedText FT_DELAY - { - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT, MA_CURR_Y8 ) ; - Size = MAP_APPFONT ( MA_TOTAL_WIDTH - RSC_SP_TBPG_INNERBORDER_LEFT - RSC_SP_TBPG_INNERBORDER_RIGHT - 12, - RSC_CD_FIXEDTEXT_HEIGHT ) ; - Text [ en-US ] = "Delay" ; - }; -#define MA_CURR_Y9 MA_CURR_Y8 + RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_FLGR_INNERBORDER_TOP - TriStateBox TSB_AUTO - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTANIMATION:TSB_AUTO"; - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 9 , MA_CURR_Y9 + 2 ) ; - Size = MAP_APPFONT ( 71 , RSC_CD_CHECKBOX_HEIGHT ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Automatic" ; - }; - MetricField MTR_FLD_DELAY - { - HelpID = "cui:MetricField:RID_SVXPAGE_TEXTANIMATION:MTR_FLD_DELAY"; - Border = TRUE ; - Pos = MAP_APPFONT ( RSC_SP_TBPG_INNERBORDER_LEFT + RSC_SP_FLGR_INNERBORDER_LEFT + 80 + RSC_SP_CTRL_GROUP_X, - MA_CURR_Y9 ) ; - Size = MAP_APPFONT ( 50 , RSC_CD_TEXTBOX_HEIGHT ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Spinsize = 50 ; - StrictFormat = TRUE ; - Unit = FUNIT_CUSTOM ; - CustomUnitText = " ms" ; - Maximum = 30000 ; - Last = 30000 ; - }; -}; - // RID_SVXDLG_TEXT ------------------------------------------------------- -TabDialog RID_SVXDLG_TEXT -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 289 , 185 + 46 ) ; - Text [ en-US ] = "Text" ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( 260 , 185 ) ; - PageList = - { - PageItem - { - PageResID = RID_SVXPAGE_TEXTATTR ; - Identifier = RID_SVXPAGE_TEXTATTR ; - Text [ en-US ] = "Text" ; - }; - PageItem - { - PageResID = RID_SVXPAGE_TEXTANIMATION ; - Identifier = RID_SVXPAGE_TEXTANIMATION ; - Text [ en-US ] = "Text Animation" ; - }; - }; - }; -}; - // ******************************************************************* EOF - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx deleted file mode 100644 index f9634b6d8..000000000 --- a/cui/source/tabpages/textattr.cxx +++ /dev/null @@ -1,767 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <tools/shl.hxx> -#include <cuires.hrc> -#include <svx/svddef.hxx> -#include <svx/sdtditm.hxx> -#include <svx/sdtagitm.hxx> -#include <svx/sdtaitm.hxx> -#include <svx/sdtfsitm.hxx> -#include <svx/sdtcfitm.hxx> -#include <svx/svdobj.hxx> -#include <svx/svdmark.hxx> -#include <svx/svdview.hxx> -#include <svx/svdotext.hxx> -#include <svx/dialogs.hrc> - -#ifndef _SVX_TEXTATTR_CXX -#define _SVX_TEXTATTR_CXX -#endif -#include "textattr.hxx" -#include "textattr.hrc" -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include <sfx2/request.hxx> -#include <svx/ofaitem.hxx> -#include <editeng/writingmodeitem.hxx> - -static sal_uInt16 pRanges[] = -{ - SDRATTR_MISC_FIRST, SDRATTR_TEXT_HORZADJUST, - SDRATTR_TEXT_WORDWRAP, SDRATTR_TEXT_AUTOGROWSIZE, - 0 -}; - -/************************************************************************* -|* -|* Dialog (Seite) zum Kopieren von Objekten -|* -\************************************************************************/ - -SvxTextAttrPage::SvxTextAttrPage( Window* pWindow, const SfxItemSet& rInAttrs ) : - SvxTabPage ( pWindow, CUI_RES( RID_SVXPAGE_TEXTATTR ), - rInAttrs ), - - aFlText ( this, CUI_RES( FL_TEXT ) ), - aTsbAutoGrowWidth ( this, CUI_RES( TSB_AUTOGROW_WIDTH ) ), - aTsbAutoGrowHeight ( this, CUI_RES( TSB_AUTOGROW_HEIGHT ) ), - aTsbFitToSize ( this, CUI_RES( TSB_FIT_TO_SIZE ) ), - aTsbContour ( this, CUI_RES( TSB_CONTOUR ) ), - aTsbWordWrapText( this, CUI_RES( TSB_WORDWRAP_TEXT ) ), - aTsbAutoGrowSize( this, CUI_RES( TSB_AUTOGROW_SIZE ) ), - aFlDistance ( this, CUI_RES( FL_DISTANCE ) ), - aFtLeft ( this, CUI_RES( FT_LEFT ) ), - aMtrFldLeft ( this, CUI_RES( MTR_FLD_LEFT ) ), - aFtRight ( this, CUI_RES( FT_RIGHT ) ), - aMtrFldRight ( this, CUI_RES( MTR_FLD_RIGHT ) ), - aFtTop ( this, CUI_RES( FT_TOP ) ), - aMtrFldTop ( this, CUI_RES( MTR_FLD_TOP ) ), - aFtBottom ( this, CUI_RES( FT_BOTTOM ) ), - aMtrFldBottom ( this, CUI_RES( MTR_FLD_BOTTOM ) ), - - aFlSeparator ( this, CUI_RES( FL_SEPARATOR ) ), - - aFlPosition ( this, CUI_RES( FL_POSITION ) ), - aCtlPosition ( this, CUI_RES( CTL_POSITION ), - RP_MM, 240, 100 ), - aTsbFullWidth ( this, CUI_RES( TSB_FULL_WIDTH ) ), - - rOutAttrs ( rInAttrs ) -{ - FreeResource(); - - FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs ); - SetFieldUnit( aMtrFldLeft, eFUnit ); - SetFieldUnit( aMtrFldRight, eFUnit ); - SetFieldUnit( aMtrFldTop, eFUnit ); - SetFieldUnit( aMtrFldBottom, eFUnit ); - - Link aLink( LINK( this, SvxTextAttrPage, ClickHdl_Impl ) ); - aTsbAutoGrowWidth.SetClickHdl( aLink ); - aTsbAutoGrowHeight.SetClickHdl( aLink ); - aTsbFitToSize.SetClickHdl( aLink ); - aTsbContour.SetClickHdl( aLink ); - - aTsbFullWidth.SetClickHdl( - LINK( this, SvxTextAttrPage, ClickFullWidthHdl_Impl ) ); - - aCtlPosition.SetAccessibleRelationMemberOf( &aFlPosition ); -} - -/************************************************************************* -|* -|* Dtor -|* -\************************************************************************/ - -SvxTextAttrPage::~SvxTextAttrPage() -{ -} - -/************************************************************************* -|* -|* Liest uebergebenen Item-Set -|* -\************************************************************************/ - -void SvxTextAttrPage::Reset( const SfxItemSet& rAttrs ) -{ - SfxItemPool* pPool = rAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - SfxMapUnit eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST ); - - // Linker Abstand vom Rahmen - const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_TEXT_LEFTDIST ); - - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LEFTDIST ); - if( pItem ) - { - long nValue = ( ( const SdrTextLeftDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldLeft, nValue, eUnit ); - } - else - aMtrFldLeft.SetText( String() ); - aMtrFldLeft.SaveValue(); - - // Rechter Abstand vom Rahmen - pItem = GetItem( rAttrs, SDRATTR_TEXT_RIGHTDIST ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_RIGHTDIST ); - if( pItem ) - { - long nValue = ( ( const SdrTextRightDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldRight, nValue, eUnit ); - } - else - aMtrFldRight.SetText( String() ); - aMtrFldRight.SaveValue(); - - // Oberer Abstand vom Rahmen - pItem = GetItem( rAttrs, SDRATTR_TEXT_UPPERDIST ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_UPPERDIST ); - if( pItem ) - { - long nValue = ( ( const SdrTextUpperDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldTop, nValue, eUnit ); - } - else - aMtrFldTop.SetText( String() ); - aMtrFldTop.SaveValue(); - - // Unterer Abstand vom Rahmen - pItem = GetItem( rAttrs, SDRATTR_TEXT_LOWERDIST ); - if( !pItem ) - pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_LOWERDIST ); - if( pItem ) - { - long nValue = ( ( const SdrTextLowerDistItem* )pItem )->GetValue(); - SetMetricValue( aMtrFldBottom, nValue, eUnit ); - } - else - aMtrFldBottom.SetText( String() ); - aMtrFldBottom.SaveValue(); - - // An Hoehe anpassen - if ( rAttrs.GetItemState( SDRATTR_TEXT_AUTOGROWHEIGHT ) != SFX_ITEM_DONTCARE ) - { - aTsbAutoGrowHeight.SetState( ( ( const SdrTextAutoGrowHeightItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ). - GetValue() ? STATE_CHECK : STATE_NOCHECK ); - aTsbAutoGrowHeight.EnableTriState( sal_False ); - } - else - aTsbAutoGrowHeight.SetState( STATE_DONTKNOW ); - aTsbAutoGrowHeight.SaveValue(); - - // An Breite anpassen - if ( rAttrs.GetItemState( SDRATTR_TEXT_AUTOGROWWIDTH ) != SFX_ITEM_DONTCARE ) - { - aTsbAutoGrowWidth.SetState( ( ( const SdrTextAutoGrowWidthItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWWIDTH ) ). - GetValue() ? STATE_CHECK : STATE_NOCHECK ); - aTsbAutoGrowWidth.EnableTriState( sal_False ); - } - else - aTsbAutoGrowWidth.SetState( STATE_DONTKNOW ); - aTsbAutoGrowWidth.SaveValue(); - - // autogrowsize - if ( rAttrs.GetItemState( SDRATTR_TEXT_AUTOGROWSIZE ) != SFX_ITEM_DONTCARE ) - { - aTsbAutoGrowSize.SetState( ( ( const SdrTextAutoGrowHeightItem& )rAttrs.Get( SDRATTR_TEXT_AUTOGROWHEIGHT ) ). - GetValue() ? STATE_CHECK : STATE_NOCHECK ); - aTsbAutoGrowSize.EnableTriState( sal_False ); - } - else - aTsbAutoGrowSize.SetState( STATE_DONTKNOW ); - aTsbAutoGrowSize.SaveValue(); - - // wordwrap text - if ( rAttrs.GetItemState( SDRATTR_TEXT_WORDWRAP ) != SFX_ITEM_DONTCARE ) - { - aTsbWordWrapText.SetState( ( ( const SdrTextWordWrapItem& )rAttrs.Get( SDRATTR_TEXT_WORDWRAP ) ). - GetValue() ? STATE_CHECK : STATE_NOCHECK ); - aTsbWordWrapText.EnableTriState( sal_False ); - } - else - aTsbWordWrapText.SetState( STATE_DONTKNOW ); - aTsbWordWrapText.SaveValue(); - - - // #103516# Do the setup based on states of hor/ver adjust - // Setup center field and FullWidth - SfxItemState eVState = rAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST ); - SfxItemState eHState = rAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST ); - - if(SFX_ITEM_DONTCARE != eVState && SFX_ITEM_DONTCARE != eHState) - { - // VertAdjust and HorAdjust are unequivocal, thus - SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)rAttrs.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); - SdrTextHorzAdjust eTHA = (SdrTextHorzAdjust)((const SdrTextHorzAdjustItem&)rAttrs.Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); - RECT_POINT eRP = RP_LB; - - aTsbFullWidth.EnableTriState( sal_False ); - - // Translate item values into local anchor position. - switch (eTVA) - { - case SDRTEXTVERTADJUST_TOP: - { - switch (eTHA) - { - case SDRTEXTHORZADJUST_LEFT: eRP = RP_LT; break; - case SDRTEXTHORZADJUST_BLOCK: - case SDRTEXTHORZADJUST_CENTER: eRP = RP_MT; break; - case SDRTEXTHORZADJUST_RIGHT: eRP = RP_RT; break; - } - break; - } - case SDRTEXTVERTADJUST_BLOCK: - case SDRTEXTVERTADJUST_CENTER: - { - switch (eTHA) - { - case SDRTEXTHORZADJUST_LEFT: eRP = RP_LM; break; - case SDRTEXTHORZADJUST_BLOCK: - case SDRTEXTHORZADJUST_CENTER: eRP = RP_MM; break; - case SDRTEXTHORZADJUST_RIGHT: eRP = RP_RM; break; - } - break; - } - case SDRTEXTVERTADJUST_BOTTOM: - { - switch (eTHA) - { - case SDRTEXTHORZADJUST_LEFT: eRP = RP_LB; break; - case SDRTEXTHORZADJUST_BLOCK: - case SDRTEXTHORZADJUST_CENTER: eRP = RP_MB; break; - case SDRTEXTHORZADJUST_RIGHT: eRP = RP_RB; break; - } - break; - } - default: - break; - } - - // See if we have to check the "full width" check button. - sal_Bool bLeftToRight(IsTextDirectionLeftToRight()); - - if((bLeftToRight && (SDRTEXTHORZADJUST_BLOCK == eTHA)) || (!bLeftToRight && (SDRTEXTVERTADJUST_BLOCK == eTVA))) - { - // Move anchor to valid position. - ClickFullWidthHdl_Impl(NULL); - aTsbFullWidth.SetState(STATE_CHECK); - } - - aCtlPosition.SetActualRP( eRP ); - } - else - { - // VertAdjust or HorAdjust is not unequivocal - aCtlPosition.Reset(); - - aCtlPosition.SetState(STATE_DONTKNOW); - aCtlPosition.DoCompletelyDisable(sal_True); - - aTsbFullWidth.SetState(STATE_DONTKNOW); - aTsbFullWidth.Enable( sal_False ); - aFlPosition.Enable( sal_False ); - } - - // Am Rahmen anpassen - if ( rAttrs.GetItemState( SDRATTR_TEXT_FITTOSIZE ) != SFX_ITEM_DONTCARE ) - { - SdrFitToSizeType eFTS = (SdrFitToSizeType) - ( ( const SdrTextFitToSizeTypeItem& )rAttrs.Get( SDRATTR_TEXT_FITTOSIZE ) ).GetValue(); - aTsbFitToSize.SetState( eFTS == SDRTEXTFIT_NONE ? STATE_NOCHECK : STATE_CHECK ); - aTsbFitToSize.EnableTriState( sal_False ); - } - else - aTsbFitToSize.SetState( STATE_DONTKNOW ); - aTsbFitToSize.SaveValue(); - - // Konturfluss - if( rAttrs.GetItemState( SDRATTR_TEXT_CONTOURFRAME ) != SFX_ITEM_DONTCARE ) - { - sal_Bool bContour = ( ( const SdrTextContourFrameItem& )rAttrs.Get( SDRATTR_TEXT_CONTOURFRAME ) ).GetValue(); - aTsbContour.SetState( bContour ? STATE_CHECK : STATE_NOCHECK ); - aTsbContour.EnableTriState( sal_False ); - } - else - aTsbContour.SetState( STATE_DONTKNOW ); - aTsbContour.SaveValue(); - - ClickHdl_Impl( NULL ); -} - -/************************************************************************* -|* -|* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen -|* -\************************************************************************/ - -sal_Bool SvxTextAttrPage::FillItemSet( SfxItemSet& rAttrs) -{ - SfxItemPool* pPool = rAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool" ); - SfxMapUnit eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST ); - - sal_Int32 nValue; - TriState eState; - - if( aMtrFldLeft.GetText() != aMtrFldLeft.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldLeft, eUnit ); - rAttrs.Put( SdrTextLeftDistItem( nValue ) ); - } - - if( aMtrFldRight.GetText() != aMtrFldRight.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldRight, eUnit ); - rAttrs.Put( SdrTextRightDistItem( nValue ) ); - } - - if( aMtrFldTop.GetText() != aMtrFldTop.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldTop, eUnit ); - rAttrs.Put( SdrTextUpperDistItem( nValue ) ); - } - - if( aMtrFldBottom.GetText() != aMtrFldBottom.GetSavedValue() ) - { - nValue = GetCoreValue( aMtrFldBottom, eUnit ); - rAttrs.Put( SdrTextLowerDistItem( nValue ) ); - } - - eState = aTsbAutoGrowHeight.GetState(); - if( eState != aTsbAutoGrowHeight.GetSavedValue() ) - { - rAttrs.Put( SdrTextAutoGrowHeightItem( (sal_Bool) STATE_CHECK == eState ) ); - } - - eState = aTsbAutoGrowWidth.GetState(); - if( eState != aTsbAutoGrowWidth.GetSavedValue() ) - { - rAttrs.Put( SdrTextAutoGrowWidthItem( (sal_Bool) STATE_CHECK == eState ) ); - } - - eState = aTsbAutoGrowSize.GetState(); - if( eState != aTsbAutoGrowSize.GetSavedValue() ) - { - rAttrs.Put( SdrTextAutoGrowHeightItem( (sal_Bool) STATE_CHECK == eState ) ); - } - - eState = aTsbWordWrapText.GetState(); - if( eState != aTsbWordWrapText.GetSavedValue() ) - { - rAttrs.Put( SdrTextWordWrapItem( (sal_Bool) STATE_CHECK == eState ) ); - } - - // Konturfluss - eState = aTsbContour.GetState(); - if( eState != aTsbContour.GetSavedValue() ) - { - rAttrs.Put( SdrTextContourFrameItem( (sal_Bool) STATE_CHECK == eState ) ); - } - - eState = aTsbFitToSize.GetState(); - if( eState != aTsbFitToSize.GetSavedValue() ) - { - SdrFitToSizeType eFTS; - switch( eState ) - { - default: ; //prevent warning - OSL_FAIL( "svx::SvxTextAttrPage::FillItemSet(), unhandled state!" ); - case STATE_NOCHECK: eFTS = SDRTEXTFIT_NONE; break; - case STATE_CHECK: eFTS = SDRTEXTFIT_AUTOFIT; break; - } - rAttrs.Put( SdrTextFitToSizeTypeItem( eFTS ) ); - } - - // zentriert - RECT_POINT eRP = aCtlPosition.GetActualRP(); - SdrTextVertAdjust eTVA, eOldTVA; - SdrTextHorzAdjust eTHA, eOldTHA; - - switch( eRP ) - { - default: - case RP_LT: eTVA = SDRTEXTVERTADJUST_TOP; - eTHA = SDRTEXTHORZADJUST_LEFT; break; - case RP_LM: eTVA = SDRTEXTVERTADJUST_CENTER; - eTHA = SDRTEXTHORZADJUST_LEFT; break; - case RP_LB: eTVA = SDRTEXTVERTADJUST_BOTTOM; - eTHA = SDRTEXTHORZADJUST_LEFT; break; - case RP_MT: eTVA = SDRTEXTVERTADJUST_TOP; - eTHA = SDRTEXTHORZADJUST_CENTER; break; - case RP_MM: eTVA = SDRTEXTVERTADJUST_CENTER; - eTHA = SDRTEXTHORZADJUST_CENTER; break; - case RP_MB: eTVA = SDRTEXTVERTADJUST_BOTTOM; - eTHA = SDRTEXTHORZADJUST_CENTER; break; - case RP_RT: eTVA = SDRTEXTVERTADJUST_TOP; - eTHA = SDRTEXTHORZADJUST_RIGHT; break; - case RP_RM: eTVA = SDRTEXTVERTADJUST_CENTER; - eTHA = SDRTEXTHORZADJUST_RIGHT; break; - case RP_RB: eTVA = SDRTEXTVERTADJUST_BOTTOM; - eTHA = SDRTEXTHORZADJUST_RIGHT; break; - } - - // #103516# Do not change values if adjust controls were disabled. - sal_Bool bIsDisabled(aCtlPosition.IsCompletelyDisabled()); - - if(!bIsDisabled) - { - if( aTsbFullWidth.GetState() == STATE_CHECK ) - { - if (IsTextDirectionLeftToRight()) - eTHA = SDRTEXTHORZADJUST_BLOCK; - else - eTVA = SDRTEXTVERTADJUST_BLOCK; - } - - if ( rOutAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST ) != SFX_ITEM_DONTCARE ) - { - eOldTVA = (SdrTextVertAdjust) - ( ( const SdrTextVertAdjustItem& )rOutAttrs.Get( SDRATTR_TEXT_VERTADJUST ) ).GetValue(); - if( eOldTVA != eTVA ) - rAttrs.Put( SdrTextVertAdjustItem( eTVA ) ); - } - else - rAttrs.Put( SdrTextVertAdjustItem( eTVA ) ); - - if ( rOutAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST ) != SFX_ITEM_DONTCARE ) - { - eOldTHA = (SdrTextHorzAdjust) - ( ( const SdrTextHorzAdjustItem& )rOutAttrs.Get( SDRATTR_TEXT_HORZADJUST ) ).GetValue(); - if( eOldTHA != eTHA ) - rAttrs.Put( SdrTextHorzAdjustItem( eTHA ) ); - } - else - rAttrs.Put( SdrTextHorzAdjustItem( eTHA ) ); - } - - return( sal_True ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -void SvxTextAttrPage::Construct() -{ - DBG_ASSERT( pView, "Keine gueltige View Uebergeben!" ); - - bFitToSizeEnabled = bContourEnabled = sal_True; - bWordWrapTextEnabled = bAutoGrowSizeEnabled = bAutoGrowWidthEnabled = bAutoGrowHeightEnabled = sal_False; - - const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - if( rMarkList.GetMarkCount() == 1 ) - { - const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - SdrObjKind eKind = (SdrObjKind) pObj->GetObjIdentifier(); - if( pObj->GetObjInventor() == SdrInventor ) - { - switch( eKind ) - { - case OBJ_TEXT : - case OBJ_TITLETEXT : - case OBJ_OUTLINETEXT : - case OBJ_CAPTION : - { - if ( ((SdrTextObj*)pObj)->HasText() ) - { - // Konturfluss ist NICHT bei reinen Textobjekten m�glich - bContourEnabled = sal_False; - - // Breite und Hoehe anpassen ist NUR bei reinen Textobjekten m�glich - bAutoGrowWidthEnabled = bAutoGrowHeightEnabled = sal_True; - } - } - break; - case OBJ_CUSTOMSHAPE : - { - bFitToSizeEnabled = bContourEnabled = sal_False; - bAutoGrowSizeEnabled = sal_True; - bWordWrapTextEnabled = sal_True; - } - break; - default: ;//prevent warning - } - } - } - aTsbAutoGrowHeight.Enable( bAutoGrowHeightEnabled ); - aTsbAutoGrowWidth.Enable( bAutoGrowWidthEnabled ); - aTsbFitToSize.Enable( bFitToSizeEnabled ); - aTsbContour.Enable( bContourEnabled ); - aTsbAutoGrowSize.Enable( bAutoGrowSizeEnabled ); - aTsbWordWrapText.Enable( bWordWrapTextEnabled ); -} - -/************************************************************************* -|* -|* Erzeugt die Seite -|* -\************************************************************************/ - -SfxTabPage* SvxTextAttrPage::Create( Window* pWindow, - const SfxItemSet& rAttrs ) -{ - return( new SvxTextAttrPage( pWindow, rAttrs ) ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -sal_uInt16* SvxTextAttrPage::GetRanges() -{ - return( pRanges ); -} - -/************************************************************************* -|* -|* -|* -\************************************************************************/ - -/** Check whether we have to uncheck the "Full width" check box. -*/ -void SvxTextAttrPage::PointChanged( Window*, RECT_POINT eRP ) -{ - if (aTsbFullWidth.GetState() == STATE_CHECK) - { - // Depending on write direction and currently checked anchor we have - // to uncheck the "full width" button. - if (IsTextDirectionLeftToRight()) - switch( eRP ) - { - case RP_LT: - case RP_LM: - case RP_LB: - case RP_RT: - case RP_RM: - case RP_RB: - aTsbFullWidth.SetState( STATE_NOCHECK ); - break; - default: ;//prevent warning - } - else - switch (eRP) - { - case RP_LT: - case RP_MT: - case RP_RT: - case RP_LB: - case RP_MB: - case RP_RB: - aTsbFullWidth.SetState( STATE_NOCHECK ); - break; - default: ;//prevent warning - } - } -} - -/************************************************************************* -|* -|* Aendert evtl. die Position des Positions-Controls -|* -\************************************************************************/ - -/** When switching the "full width" check button on the text anchor may have - to be moved to a valid and adjacent position. This position depends on - the current anchor position and the text writing direction. -*/ -IMPL_LINK( SvxTextAttrPage, ClickFullWidthHdl_Impl, void *, EMPTYARG ) -{ - if( aTsbFullWidth.GetState() == STATE_CHECK ) - { - if (IsTextDirectionLeftToRight()) - { - // Move text anchor to horizontal middle axis. - switch( aCtlPosition.GetActualRP() ) - { - case RP_LT: - case RP_RT: - aCtlPosition.SetActualRP( RP_MT ); - break; - - case RP_LM: - case RP_RM: - aCtlPosition.SetActualRP( RP_MM ); - break; - - case RP_LB: - case RP_RB: - aCtlPosition.SetActualRP( RP_MB ); - break; - default: ;//prevent warning - } - } - else - { - // Move text anchor to vertical middle axis. - switch( aCtlPosition.GetActualRP() ) - { - case RP_LT: - case RP_LB: - aCtlPosition.SetActualRP( RP_LM ); - break; - - case RP_MT: - case RP_MB: - aCtlPosition.SetActualRP( RP_MM ); - break; - - case RP_RT: - case RP_RB: - aCtlPosition.SetActualRP( RP_RM ); - break; - default: ;//prevent warning - } - } - } - return( 0L ); -} - -/************************************************************************* -|* -|* Enabled/Disabled "Groesse an Text" oder "Am Rahmen Anpassen" -|* -\************************************************************************/ - -IMPL_LINK( SvxTextAttrPage, ClickHdl_Impl, void *, EMPTYARG ) -{ - sal_Bool bAutoGrowWidth = aTsbAutoGrowWidth.GetState() == STATE_CHECK; - sal_Bool bAutoGrowHeight = aTsbAutoGrowHeight.GetState() == STATE_CHECK; - sal_Bool bFitToSize = aTsbFitToSize.GetState() == STATE_CHECK; - sal_Bool bContour = aTsbContour.GetState() == STATE_CHECK; - - aTsbContour.Enable( !bFitToSize && - !( ( bAutoGrowWidth && bAutoGrowWidthEnabled ) || ( bAutoGrowHeight && bAutoGrowHeightEnabled ) ) && - bContourEnabled ); - - aTsbAutoGrowWidth.Enable( !bFitToSize && - !( bContour && bContourEnabled ) && - bAutoGrowWidthEnabled ); - - aTsbAutoGrowHeight.Enable( !bFitToSize && - !( bContour && bContourEnabled ) && - bAutoGrowHeightEnabled ); - - aTsbFitToSize.Enable( !( ( bAutoGrowWidth && bAutoGrowWidthEnabled ) || ( bAutoGrowHeight && bAutoGrowHeightEnabled ) ) && - !( bContour && bContourEnabled ) && - bFitToSizeEnabled ); - - // #101901# enable/disable metric fields and decorations dependent of contour - aMtrFldLeft.Enable(!bContour); - aMtrFldRight.Enable(!bContour); - aMtrFldTop.Enable(!bContour); - aMtrFldBottom.Enable(!bContour); - aFlDistance.Enable(!bContour); - aFtLeft.Enable(!bContour); - aFtRight.Enable(!bContour); - aFtTop.Enable(!bContour); - aFtBottom.Enable(!bContour); - - if( bContour && bContourEnabled ) - { - aMtrFldLeft.SetValue( 0 ); - aMtrFldRight.SetValue( 0 ); - aMtrFldTop.SetValue( 0 ); - aMtrFldBottom.SetValue( 0 ); - } - - // #103516# Do the setup based on states of hor/ver adjust - SfxItemState eVState = rOutAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST ); - SfxItemState eHState = rOutAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST ); - sal_Bool bHorAndVer(SFX_ITEM_DONTCARE == eVState || SFX_ITEM_DONTCARE == eHState); - - // #83698# enable/disable text anchoring dependent of contour - aCtlPosition.Enable(!bContour && !bHorAndVer); - aTsbFullWidth.Enable(!bContour && !bHorAndVer); - aFlPosition.Enable(!bContour && !bHorAndVer); - - return( 0L ); -} - - -bool SvxTextAttrPage::IsTextDirectionLeftToRight (void) const -{ - // Determine the text writing direction with left to right as default. - bool bLeftToRightDirection = true; - SfxItemState eState = rOutAttrs.GetItemState(SDRATTR_TEXTDIRECTION); - - if(SFX_ITEM_DONTCARE != eState) - { - const SvxWritingModeItem& rItem = static_cast<const SvxWritingModeItem&> ( - rOutAttrs.Get (SDRATTR_TEXTDIRECTION)); - if (rItem.GetValue() == com::sun::star::text::WritingMode_TB_RL) - bLeftToRightDirection = false; - } - return bLeftToRightDirection; -} - -void SvxTextAttrPage::PageCreated(SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pViewItem,OfaPtrItem,SID_SVXTEXTATTRPAGE_VIEW,sal_False); - - if (pViewItem) - SetView( static_cast<SdrView *>(pViewItem->GetValue())); - - Construct(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/textattr.hrc b/cui/source/tabpages/textattr.hrc deleted file mode 100644 index 70d4512c5..000000000 --- a/cui/source/tabpages/textattr.hrc +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#define FL_TEXT 2 -#define FL_DISTANCE 1 -#define FL_POSITION 3 -#define FL_SEPARATOR 4 -#define TSB_AUTOGROW_HEIGHT 1 -#define TSB_AUTOGROW_WIDTH 2 -#define TSB_FIT_TO_SIZE 3 -#define TSB_FULL_WIDTH 4 -#define TSB_CONTOUR 5 -#define TSB_WORDWRAP_TEXT 6 -#define TSB_AUTOGROW_SIZE 7 -#define CTL_POSITION 1 -#define FT_LEFT 1 -#define MTR_FLD_LEFT 1 -#define FT_RIGHT 2 -#define MTR_FLD_RIGHT 2 -#define FT_TOP 3 -#define MTR_FLD_TOP 3 -#define FT_BOTTOM 4 -#define MTR_FLD_BOTTOM 4 diff --git a/cui/source/tabpages/textattr.src b/cui/source/tabpages/textattr.src deleted file mode 100644 index 45e5e9cb7..000000000 --- a/cui/source/tabpages/textattr.src +++ /dev/null @@ -1,255 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <svtools/controldims.hrc> -#include <cuires.hrc> -#include "textattr.hrc" -#include "helpid.hrc" -#include <svx/dialogs.hrc> - - // RID_SVXPAGE_TEXTATTR -------------------------------------------------- -TabPage RID_SVXPAGE_TEXTATTR -{ - HelpId = HID_PAGE_TEXTATTR ; - Hide = TRUE ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Text [ en-US ] = "Text" ; - FixedLine FL_TEXT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Text" ; - }; - TriStateBox TSB_AUTOGROW_WIDTH - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTATTR:TSB_AUTOGROW_WIDTH"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 102 , 10 ) ; - Text [ en-US ] = "Fit wi~dth to text" ; - }; - TriStateBox TSB_AUTOGROW_HEIGHT - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTATTR:TSB_AUTOGROW_HEIGHT"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 102 , 10 ) ; - Text [ en-US ] = "Fit h~eight to text" ; - }; - TriStateBox TSB_FIT_TO_SIZE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTATTR:TSB_FIT_TO_SIZE"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 12 , 42 ) ; - Size = MAP_APPFONT ( 102 , 10 ) ; - Text [ en-US ] = "~Fit to frame" ; - }; - TriStateBox TSB_CONTOUR - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTATTR:TSB_CONTOUR"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 12 , 56 ) ; - Size = MAP_APPFONT ( 102 , 10 ) ; - Text [ en-US ] = "~Adjust to contour" ; - }; - TriStateBox TSB_WORDWRAP_TEXT - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTATTR:TSB_WORDWRAP_TEXT"; - TabStop = TRUE; - Pos = MAP_APPFONT( 132, 14 ) ; - Size = MAP_APPFONT( 127 , 10 ) ; - Text [ en-US ] = "~Word wrap text in shape"; - }; - TriStateBox TSB_AUTOGROW_SIZE - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTATTR:TSB_AUTOGROW_SIZE"; - TabStop = TRUE; - Pos = MAP_APPFONT( 132, 28 ); - Size = MAP_APPFONT( 127 , 10 ); - Text [ en-US ] = "~Resize shape to fit text"; - }; - FixedLine FL_DISTANCE - { - Pos = MAP_APPFONT ( 6 , 72 ) ; - Size = MAP_APPFONT ( 114 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Spacing to borders" ; - }; - FixedText FT_LEFT - { - Pos = MAP_APPFONT ( 12 , 85 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Left" ; - }; - FixedText FT_RIGHT - { - Pos = MAP_APPFONT ( 12 , 101 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Right" ; - }; - FixedText FT_TOP - { - Pos = MAP_APPFONT ( 12 , 117 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Top" ; - }; - FixedText FT_BOTTOM - { - Pos = MAP_APPFONT ( 12 , 133 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text [ en-US ] = "~Bottom" ; - }; - MetricField MTR_FLD_LEFT - { - HelpID = "cui:MetricField:RID_SVXPAGE_TEXTATTR:MTR_FLD_LEFT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 69 , 83 ) ; - Size = MAP_APPFONT ( 45 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - MetricField MTR_FLD_RIGHT - { - HelpID = "cui:MetricField:RID_SVXPAGE_TEXTATTR:MTR_FLD_RIGHT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 69 , 99 ) ; - Size = MAP_APPFONT ( 45 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - MetricField MTR_FLD_TOP - { - HelpID = "cui:MetricField:RID_SVXPAGE_TEXTATTR:MTR_FLD_TOP"; - Border = TRUE ; - Pos = MAP_APPFONT ( 69 , 115 ) ; - Size = MAP_APPFONT ( 45 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - MetricField MTR_FLD_BOTTOM - { - HelpID = "cui:MetricField:RID_SVXPAGE_TEXTATTR:MTR_FLD_BOTTOM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 69 , 131 ) ; - Size = MAP_APPFONT ( 45 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - Minimum = -10000 ; - First = -10000 ; - Maximum = 10000 ; - Last = 10000 ; - SpinSize = 10 ; - }; - FixedLine FL_SEPARATOR - { - Pos = MAP_APPFONT ( 121 , 83 ) ; - Size = MAP_APPFONT ( RSC_CD_FIXEDLINE_WIDTH , 66 ) ; - Vert = TRUE; - }; - FixedLine FL_POSITION - { - Pos = MAP_APPFONT ( 126 , 72 ) ; - Size = MAP_APPFONT ( 128 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Text anchor" ; - }; - Control CTL_POSITION - { - HelpId = HID_TEXTATTR_CTL_POSITION ; - Border = TRUE ; - Pos = MAP_APPFONT ( 132 , 83 ) ; - Size = MAP_APPFONT ( 116 , 52 ) ; - TabStop = TRUE ; - }; - TriStateBox TSB_FULL_WIDTH - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_TEXTATTR:TSB_FULL_WIDTH"; - TabStop = TRUE ; - Pos = MAP_APPFONT ( 132 , 139 ) ; - Size = MAP_APPFONT ( 116 , 10 ) ; - Text [ en-US ] = "Full ~width" ; - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx deleted file mode 100644 index 633e63c70..000000000 --- a/cui/source/tabpages/tparea.cxx +++ /dev/null @@ -1,2537 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <tools/shl.hxx> -#include <tools/urlobj.hxx> -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <svx/dialogs.hrc> - -#define _SVX_TPAREA_CXX - -#if defined (UNX) || defined (ICC) || defined(WNT) -#include <stdlib.h> -#endif - -#include "svx/xattr.hxx" -#include <svx/xpool.hxx> -#include <cuires.hrc> -#include "tabarea.hrc" -#include <svx/xflbckit.hxx> -#include <svx/svdattr.hxx> -#include <svx/xtable.hxx> -#include <svx/xlineit0.hxx> -#include "svx/drawitem.hxx" -#include "cuitabarea.hxx" -#include "dlgname.hxx" -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include <svl/intitem.hxx> -#include <sfx2/request.hxx> -#include "paragrph.hrc" -#define DLGWIN this->GetParent()->GetParent() - -// static ---------------------------------------------------------------- - -static sal_uInt16 pAreaRanges[] = -{ - XATTR_GRADIENTSTEPCOUNT, - XATTR_GRADIENTSTEPCOUNT, - SID_ATTR_FILL_STYLE, - SID_ATTR_FILL_BITMAP, - 0 -}; - -static sal_uInt16 pTransparenceRanges[] = -{ - XATTR_FILLTRANSPARENCE, - XATTR_FILLTRANSPARENCE, - SDRATTR_SHADOWTRANSPARENCE, - SDRATTR_SHADOWTRANSPARENCE, - XATTR_FILLFLOATTRANSPARENCE, - XATTR_FILLFLOATTRANSPARENCE, - 0 -}; - -/************************************************************************* -|* -|* Dialog for transparence -|* -\************************************************************************/ - -IMPL_LINK(SvxTransparenceTabPage, ClickTransOffHdl_Impl, void *, EMPTYARG) -{ - // disable all other controls - ActivateLinear(sal_False); - ActivateGradient(sal_False); - - // Preview - rXFSet.ClearItem (XATTR_FILLTRANSPARENCE); - rXFSet.ClearItem (XATTR_FILLFLOATTRANSPARENCE); - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - InvalidatePreview( sal_False ); - - return( 0L ); -} - -IMPL_LINK(SvxTransparenceTabPage, ClickTransLinearHdl_Impl, void *, EMPTYARG) -{ - // enable linear, disable other - ActivateLinear(sal_True); - ActivateGradient(sal_False); - - // preview - rXFSet.ClearItem (XATTR_FILLFLOATTRANSPARENCE); - ModifyTransparentHdl_Impl (NULL); - - return( 0L ); -} - -IMPL_LINK(SvxTransparenceTabPage, ClickTransGradientHdl_Impl, void *, EMPTYARG) -{ - // enable gradient, disable other - ActivateLinear(sal_False); - ActivateGradient(sal_True); - - // preview - rXFSet.ClearItem (XATTR_FILLTRANSPARENCE); - ModifiedTrgrHdl_Impl (NULL); - - return( 0L ); -} - -void SvxTransparenceTabPage::ActivateLinear(sal_Bool bActivate) -{ - aMtrTransparent.Enable(bActivate); -} - -IMPL_LINK(SvxTransparenceTabPage, ModifyTransparentHdl_Impl, void*, EMPTYARG) -{ - sal_uInt16 nPos = (sal_uInt16)aMtrTransparent.GetValue(); - XFillTransparenceItem aItem(nPos); - rXFSet.Put(XFillTransparenceItem(aItem)); - - // preview - InvalidatePreview(); - - return 0L; -} - -IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrHdl_Impl, void *, pControl) -{ - if(pControl == &aLbTrgrGradientType || pControl == this) - { - XGradientStyle eXGS = (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos(); - SetControlState_Impl( eXGS ); - } - - // preview - sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)aMtrTrgrStartValue.GetValue() * 255) / 100); - sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)aMtrTrgrEndValue.GetValue() * 255) / 100); - XGradient aTmpGradient( - Color(nStartCol, nStartCol, nStartCol), - Color(nEndCol, nEndCol, nEndCol), - (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos(), - (sal_uInt16)aMtrTrgrAngle.GetValue() * 10, - (sal_uInt16)aMtrTrgrCenterX.GetValue(), - (sal_uInt16)aMtrTrgrCenterY.GetValue(), - (sal_uInt16)aMtrTrgrBorder.GetValue(), - 100, 100); - - String aString; - XFillFloatTransparenceItem aItem( rXFSet.GetPool()/*aString*/, aTmpGradient); - rXFSet.Put ( aItem ); - - InvalidatePreview(); - - return( 0L ); -} - -void SvxTransparenceTabPage::ActivateGradient(sal_Bool bActivate) -{ - aFtTrgrType.Enable(bActivate); - aLbTrgrGradientType.Enable(bActivate); - aFtTrgrCenterX.Enable(bActivate); - aMtrTrgrCenterX.Enable(bActivate); - aFtTrgrCenterY.Enable(bActivate); - aMtrTrgrCenterY.Enable(bActivate); - aFtTrgrAngle.Enable(bActivate); - aMtrTrgrAngle.Enable(bActivate); - aFtTrgrBorder.Enable(bActivate); - aMtrTrgrBorder.Enable(bActivate); - aFtTrgrStartValue.Enable(bActivate); - aMtrTrgrStartValue.Enable(bActivate); - aFtTrgrEndValue.Enable(bActivate); - aMtrTrgrEndValue.Enable(bActivate); - - if(bActivate) - { - XGradientStyle eXGS = (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos(); - SetControlState_Impl( eXGS ); - } -} - -IMPL_LINK(SvxTransparenceTabPage, ChangeTrgrTypeHdl_Impl, void *, EMPTYARG) -{ - return( 0L ); -} - -void SvxTransparenceTabPage::SetControlState_Impl(XGradientStyle eXGS) -{ - switch(eXGS) - { - case XGRAD_LINEAR: - case XGRAD_AXIAL: - aFtTrgrCenterX.Disable(); - aMtrTrgrCenterX.Disable(); - aFtTrgrCenterY.Disable(); - aMtrTrgrCenterY.Disable(); - aFtTrgrAngle.Enable(); - aMtrTrgrAngle.Enable(); - break; - - case XGRAD_RADIAL: - aFtTrgrCenterX.Enable(); - aMtrTrgrCenterX.Enable(); - aFtTrgrCenterY.Enable(); - aMtrTrgrCenterY.Enable(); - aFtTrgrAngle.Disable(); - aMtrTrgrAngle.Disable(); - break; - - case XGRAD_ELLIPTICAL: - aFtTrgrCenterX.Enable(); - aMtrTrgrCenterX.Enable(); - aFtTrgrCenterY.Enable(); - aMtrTrgrCenterY.Enable(); - aFtTrgrAngle.Enable(); - aMtrTrgrAngle.Enable(); - break; - - case XGRAD_SQUARE: - case XGRAD_RECT: - aFtTrgrCenterX.Enable(); - aMtrTrgrCenterX.Enable(); - aFtTrgrCenterY.Enable(); - aMtrTrgrCenterY.Enable(); - aFtTrgrAngle.Enable(); - aMtrTrgrAngle.Enable(); - break; - } -} - -SvxTransparenceTabPage::SvxTransparenceTabPage(Window* pParent, const SfxItemSet& rInAttrs) -: SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_TRANSPARENCE ), rInAttrs), - rOutAttrs ( rInAttrs ), - nPageType(0), - nDlgType(0), - - aFlProp ( this, CUI_RES( FL_PROP ) ), - aRbtTransOff ( this, CUI_RES( RBT_TRANS_OFF ) ), - aRbtTransLinear ( this, CUI_RES( RBT_TRANS_LINEAR ) ), - aRbtTransGradient ( this, CUI_RES( RBT_TRANS_GRADIENT ) ), - - aMtrTransparent ( this, CUI_RES( MTR_TRANSPARENT ) ), - - aFtTrgrType ( this, CUI_RES( FT_TRGR_TYPE ) ), - aLbTrgrGradientType ( this, CUI_RES( LB_TRGR_GRADIENT_TYPES ) ), - aFtTrgrCenterX ( this, CUI_RES( FT_TRGR_CENTER_X ) ), - aMtrTrgrCenterX ( this, CUI_RES( MTR_TRGR_CENTER_X ) ), - aFtTrgrCenterY ( this, CUI_RES( FT_TRGR_CENTER_Y ) ), - aMtrTrgrCenterY ( this, CUI_RES( MTR_TRGR_CENTER_Y ) ), - aFtTrgrAngle ( this, CUI_RES( FT_TRGR_ANGLE ) ), - aMtrTrgrAngle ( this, CUI_RES( MTR_TRGR_ANGLE ) ), - aFtTrgrBorder ( this, CUI_RES( FT_TRGR_BORDER ) ), - aMtrTrgrBorder ( this, CUI_RES( MTR_TRGR_BORDER ) ), - aFtTrgrStartValue ( this, CUI_RES( FT_TRGR_START_VALUE ) ), - aMtrTrgrStartValue ( this, CUI_RES( MTR_TRGR_START_VALUE ) ), - aFtTrgrEndValue ( this, CUI_RES( FT_TRGR_END_VALUE ) ), - aMtrTrgrEndValue ( this, CUI_RES( MTR_TRGR_END_VALUE ) ), - - aCtlBitmapPreview ( this, CUI_RES( CTL_BITMAP_PREVIEW ) ), - aCtlXRectPreview ( this, CUI_RES( CTL_TRANS_PREVIEW ) ), - bBitmap ( sal_False ), - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXFillAttr ( pXPool ), - rXFSet ( aXFillAttr.GetItemSet() ) -{ - FreeResource(); - - String accName = String(CUI_RES(STR_EXAMPLE)); - aCtlBitmapPreview.SetAccessibleName(accName); - aCtlXRectPreview.SetAccessibleName(accName); - aMtrTransparent.SetAccessibleRelationLabeledBy( &aRbtTransLinear ); - - // main selection - aRbtTransOff.SetClickHdl(LINK(this, SvxTransparenceTabPage, ClickTransOffHdl_Impl)); - aRbtTransLinear.SetClickHdl(LINK(this, SvxTransparenceTabPage, ClickTransLinearHdl_Impl)); - aRbtTransGradient.SetClickHdl(LINK(this, SvxTransparenceTabPage, ClickTransGradientHdl_Impl)); - - // linear transparency - aMtrTransparent.SetValue( 50 ); - aMtrTransparent.SetModifyHdl(LINK(this, SvxTransparenceTabPage, ModifyTransparentHdl_Impl)); - - // gradient transparency - aMtrTrgrEndValue.SetValue( 100 ); - aMtrTrgrStartValue.SetValue( 0 ); - aLbTrgrGradientType.SetSelectHdl(LINK(this, SvxTransparenceTabPage, ChangeTrgrTypeHdl_Impl)); - Link aLink = LINK( this, SvxTransparenceTabPage, ModifiedTrgrHdl_Impl); - aLbTrgrGradientType.SetSelectHdl( aLink ); - aMtrTrgrCenterX.SetModifyHdl( aLink ); - aMtrTrgrCenterY.SetModifyHdl( aLink ); - aMtrTrgrAngle.SetModifyHdl( aLink ); - aMtrTrgrBorder.SetModifyHdl( aLink ); - aMtrTrgrStartValue.SetModifyHdl( aLink ); - aMtrTrgrEndValue.SetModifyHdl( aLink ); - - // this page needs ExchangeSupport - SetExchangeSupport(); -} - -void SvxTransparenceTabPage::Construct() -{ -} - -SfxTabPage* SvxTransparenceTabPage::Create(Window* pWindow, const SfxItemSet& rAttrs) -{ - return(new SvxTransparenceTabPage(pWindow, rAttrs)); -} - -sal_uInt16* SvxTransparenceTabPage::GetRanges() -{ - return(pTransparenceRanges); -} - -sal_Bool SvxTransparenceTabPage::FillItemSet(SfxItemSet& rAttrs) -{ - const SfxPoolItem* pGradientItem = NULL; - const SfxPoolItem* pLinearItem = NULL; - SfxItemState eStateGradient(rOutAttrs.GetItemState(XATTR_FILLFLOATTRANSPARENCE, sal_True, &pGradientItem)); - SfxItemState eStateLinear(rOutAttrs.GetItemState(XATTR_FILLTRANSPARENCE, sal_True, &pLinearItem)); - sal_Bool bGradActive = (eStateGradient == SFX_ITEM_SET && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled()); - sal_Bool bLinearActive = (eStateLinear == SFX_ITEM_SET && ((XFillTransparenceItem*)pLinearItem)->GetValue() != 0); - - // #103765# - sal_Bool bGradUsed = (eStateGradient == SFX_ITEM_DONTCARE); - sal_Bool bLinearUsed = (eStateLinear == SFX_ITEM_DONTCARE); - - sal_Bool bModified(sal_False); - sal_Bool bSwitchOffLinear(sal_False); - sal_Bool bSwitchOffGradient(sal_False); - - if(aMtrTransparent.IsEnabled()) - { - // linear transparence - sal_uInt16 nPos = (sal_uInt16)aMtrTransparent.GetValue(); - if(nPos != (sal_uInt16)aMtrTransparent.GetSavedValue().ToInt32() || !bLinearActive) - { - XFillTransparenceItem aItem(nPos); - SdrShadowTransparenceItem aShadowItem(nPos); - const SfxPoolItem* pOld = GetOldItem(rAttrs, XATTR_FILLTRANSPARENCE); - if(!pOld || !(*(const XFillTransparenceItem*)pOld == aItem) || !bLinearActive) - { - rAttrs.Put(aItem); - rAttrs.Put(aShadowItem); - bModified = sal_True; - bSwitchOffGradient = sal_True; - } - } - } - else if(aLbTrgrGradientType.IsEnabled()) - { - // transparence gradient, fill ItemSet from values - if(!bGradActive - || (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos() != (XGradientStyle)aLbTrgrGradientType.GetSavedValue() - || (sal_uInt16)aMtrTrgrAngle.GetValue() != (sal_uInt16)aMtrTrgrAngle.GetSavedValue().ToInt32() - || (sal_uInt16)aMtrTrgrCenterX.GetValue() != (sal_uInt16)aMtrTrgrCenterX.GetSavedValue().ToInt32() - || (sal_uInt16)aMtrTrgrCenterY.GetValue() != (sal_uInt16)aMtrTrgrCenterY.GetSavedValue().ToInt32() - || (sal_uInt16)aMtrTrgrBorder.GetValue() != (sal_uInt16)aMtrTrgrBorder.GetSavedValue().ToInt32() - || (sal_uInt16)aMtrTrgrStartValue.GetValue() != (sal_uInt16)aMtrTrgrStartValue.GetSavedValue().ToInt32() - || (sal_uInt16)aMtrTrgrEndValue.GetValue() != (sal_uInt16)aMtrTrgrEndValue.GetSavedValue().ToInt32() ) - { - sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)aMtrTrgrStartValue.GetValue() * 255) / 100); - sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)aMtrTrgrEndValue.GetValue() * 255) / 100); - XGradient aTmpGradient( - Color(nStartCol, nStartCol, nStartCol), - Color(nEndCol, nEndCol, nEndCol), - (XGradientStyle)aLbTrgrGradientType.GetSelectEntryPos(), - (sal_uInt16)aMtrTrgrAngle.GetValue() * 10, - (sal_uInt16)aMtrTrgrCenterX.GetValue(), - (sal_uInt16)aMtrTrgrCenterY.GetValue(), - (sal_uInt16)aMtrTrgrBorder.GetValue(), - 100, 100); - - String aString; - XFillFloatTransparenceItem aItem( rXFSet.GetPool()/*aString*/, aTmpGradient); - const SfxPoolItem* pOld = GetOldItem(rAttrs, XATTR_FILLFLOATTRANSPARENCE); - - if(!pOld || !(*(const XFillFloatTransparenceItem*)pOld == aItem) || !bGradActive) - { - rAttrs.Put(aItem); - bModified = sal_True; - bSwitchOffLinear = sal_True; - } - } - } - else - { - // no transparence - bSwitchOffGradient = sal_True; - bSwitchOffLinear = sal_True; - } - - // disable unused XFillFloatTransparenceItem - if(bSwitchOffGradient && (bGradActive || bGradUsed)) - { - Color aColor(COL_BLACK); - XGradient aGrad(aColor, Color(COL_WHITE)); - aGrad.SetStartIntens(100); - aGrad.SetEndIntens(100); - String aString; - XFillFloatTransparenceItem aItem( rXFSet.GetPool()/*aString*/, aGrad); - aItem.SetEnabled(sal_False); - rAttrs.Put(aItem); - bModified = sal_True; - } - - // disable unused XFillFloatTransparenceItem - if(bSwitchOffLinear && (bLinearActive || bLinearUsed)) - { - XFillTransparenceItem aItem(0); - SdrShadowTransparenceItem aShadowItem(0); - rAttrs.Put(aItem); - rAttrs.Put(aShadowItem); - bModified = sal_True; - } - rAttrs.Put (CntUInt16Item(SID_PAGE_TYPE,nPageType)); - return bModified; -} - -void SvxTransparenceTabPage::Reset(const SfxItemSet& rAttrs) -{ - const SfxPoolItem* pGradientItem = NULL; - SfxItemState eStateGradient(rAttrs.GetItemState(XATTR_FILLFLOATTRANSPARENCE, sal_True, &pGradientItem)); - if(!pGradientItem) - pGradientItem = &rAttrs.Get(XATTR_FILLFLOATTRANSPARENCE); - sal_Bool bGradActive = (eStateGradient == SFX_ITEM_SET && ((XFillFloatTransparenceItem*)pGradientItem)->IsEnabled()); - - const SfxPoolItem* pLinearItem = NULL; - SfxItemState eStateLinear(rAttrs.GetItemState(XATTR_FILLTRANSPARENCE, sal_True, &pLinearItem)); - if(!pLinearItem) - pLinearItem = &rAttrs.Get(XATTR_FILLTRANSPARENCE); - sal_Bool bLinearActive = (eStateLinear == SFX_ITEM_SET && ((XFillTransparenceItem*)pLinearItem)->GetValue() != 0); - - // transparence gradient - const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue(); - XGradientStyle eXGS(rGradient.GetGradientStyle()); - aLbTrgrGradientType.SelectEntryPos(sal::static_int_cast< sal_uInt16 >(eXGS)); - aMtrTrgrAngle.SetValue(rGradient.GetAngle() / 10); - aMtrTrgrBorder.SetValue(rGradient.GetBorder()); - aMtrTrgrCenterX.SetValue(rGradient.GetXOffset()); - aMtrTrgrCenterY.SetValue(rGradient.GetYOffset()); - aMtrTrgrStartValue.SetValue((sal_uInt16)((((sal_uInt16)rGradient.GetStartColor().GetRed() + 1) * 100) / 255)); - aMtrTrgrEndValue.SetValue((sal_uInt16)((((sal_uInt16)rGradient.GetEndColor().GetRed() + 1) * 100) / 255)); - - // linear transparence - sal_uInt16 nTransp = ((XFillTransparenceItem*)pLinearItem)->GetValue(); - aMtrTransparent.SetValue(bLinearActive ? nTransp : 50); - ModifyTransparentHdl_Impl(NULL); - - // select the correct radio button - if(bGradActive) - { - // transparence gradient, set controls appropriate to item - aRbtTransGradient.Check(); - ClickTransGradientHdl_Impl(NULL); - } - else if(bLinearActive) - { - // linear transparence - aRbtTransLinear.Check(); - ClickTransLinearHdl_Impl(NULL); - } - else - { - // no transparence - aRbtTransOff.Check(); - ClickTransOffHdl_Impl(NULL); - ModifiedTrgrHdl_Impl(NULL); - } - - // save values - aMtrTransparent.SaveValue(); - aLbTrgrGradientType.SaveValue(); - aMtrTrgrCenterX.SaveValue(); - aMtrTrgrCenterY.SaveValue(); - aMtrTrgrAngle.SaveValue(); - aMtrTrgrBorder.SaveValue(); - aMtrTrgrStartValue.SaveValue(); - aMtrTrgrEndValue.SaveValue(); - - sal_Bool bActive = InitPreview ( rAttrs ); - InvalidatePreview ( bActive ); -} - -void SvxTransparenceTabPage::ActivatePage(const SfxItemSet& rSet) -{ - SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE,sal_False); - if (pPageTypeItem) - SetPageType(pPageTypeItem->GetValue()); - - if(nDlgType == 0) // Flaechen-Dialog - nPageType = PT_TRANSPARENCE; - - InitPreview ( rSet ); -} - -int SvxTransparenceTabPage::DeactivatePage(SfxItemSet* _pSet) -{ - if( _pSet ) - FillItemSet( *_pSet ); - return(LEAVE_PAGE); -} - -void SvxTransparenceTabPage::PointChanged(Window* , RECT_POINT eRcPt) -{ - eRP = eRcPt; -} - -// -// Preview-Methods -// -sal_Bool SvxTransparenceTabPage::InitPreview ( const SfxItemSet& rSet ) -{ - // set transparencetyp for preview - if ( aRbtTransOff.IsChecked() ) - { - ClickTransOffHdl_Impl(NULL); - } else if ( aRbtTransLinear.IsChecked() ) - { - ClickTransLinearHdl_Impl(NULL); - } else if ( aRbtTransGradient.IsChecked() ) - { - ClickTransGradientHdl_Impl(NULL); - } - - // Get fillstyle for preview - rXFSet.Put ( ( XFillStyleItem& ) rSet.Get(XATTR_FILLSTYLE) ); - rXFSet.Put ( ( XFillColorItem& ) rSet.Get(XATTR_FILLCOLOR) ); - rXFSet.Put ( ( XFillGradientItem& ) rSet.Get(XATTR_FILLGRADIENT) ); - rXFSet.Put ( ( XFillHatchItem& ) rSet.Get(XATTR_FILLHATCH) ); - rXFSet.Put ( ( XFillBackgroundItem&)rSet.Get(XATTR_FILLBACKGROUND) ); - rXFSet.Put ( ( XFillBitmapItem& ) rSet.Get(XATTR_FILLBITMAP) ); - - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - bBitmap = ( ( ( XFillStyleItem& )rSet.Get(XATTR_FILLSTYLE) ).GetValue() == XFILL_BITMAP ); - - // show the right preview window - if ( bBitmap ) - { - aCtlBitmapPreview.Show(); - aCtlXRectPreview.Hide(); - } - else - { - aCtlBitmapPreview.Hide(); - aCtlXRectPreview.Show(); - } - - return !aRbtTransOff.IsChecked(); -} - -void SvxTransparenceTabPage::InvalidatePreview (sal_Bool bEnable) -{ - if ( bBitmap ) - { - if ( bEnable ) - { - aCtlBitmapPreview.Enable(); - aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() ); - } - else - aCtlBitmapPreview.Disable(); - aCtlBitmapPreview.Invalidate(); - } - else - { - if ( bEnable ) - { - aCtlXRectPreview.Enable(); - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - } - else - aCtlXRectPreview.Disable(); - aCtlXRectPreview.Invalidate(); - } -} - -void SvxTransparenceTabPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False); - SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False); - - if (pPageTypeItem) - SetPageType(pPageTypeItem->GetValue()); - if (pDlgTypeItem) - SetDlgType(pDlgTypeItem->GetValue()); - Construct(); -} -/************************************************************************* -|* -|* Dialog to modify fill-attributes -|* -\************************************************************************/ - -SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : - - SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_AREA ), rInAttrs ), - - aFlProp ( this, CUI_RES( FL_PROP ) ), - aTypeLB ( this, CUI_RES( LB_AREA_TYPE ) ), - - aLbColor ( this, CUI_RES( LB_COLOR ) ), - aLbGradient ( this, CUI_RES( LB_GRADIENT ) ), - aLbHatching ( this, CUI_RES( LB_HATCHING ) ), - aLbBitmap ( this, CUI_RES( LB_BITMAP ) ), - aCtlBitmapPreview ( this, CUI_RES( CTL_BITMAP_PREVIEW ) ), - - aTsbStepCount ( this, CUI_RES( TSB_STEPCOUNT ) ), - aFlStepCount ( this, CUI_RES( FL_STEPCOUNT ) ), - aNumFldStepCount ( this, CUI_RES( NUM_FLD_STEPCOUNT ) ), - - aCbxHatchBckgrd ( this, CUI_RES( CB_HATCHBCKGRD ) ), - aLbHatchBckgrdColor ( this, CUI_RES( LB_HATCHBCKGRDCOLOR ) ), - - aFlSize ( this, CUI_RES( FL_SIZE ) ), - aTsbOriginal ( this, CUI_RES( TSB_ORIGINAL ) ), - aTsbScale ( this, CUI_RES( TSB_SCALE ) ), - aFtXSize ( this, CUI_RES( FT_X_SIZE ) ), - aMtrFldXSize ( this, CUI_RES( MTR_FLD_X_SIZE ) ), - aFtYSize ( this, CUI_RES( FT_Y_SIZE ) ), - aMtrFldYSize ( this, CUI_RES( MTR_FLD_Y_SIZE ) ), - aFlPosition ( this, CUI_RES( FL_POSITION ) ), - aCtlPosition ( this, CUI_RES( CTL_POSITION ), RP_RM, 110, 80, CS_RECT ), - aFtXOffset ( this, CUI_RES( FT_X_OFFSET ) ), - aMtrFldXOffset ( this, CUI_RES( MTR_FLD_X_OFFSET ) ), - aFtYOffset ( this, CUI_RES( FT_Y_OFFSET ) ), - aMtrFldYOffset ( this, CUI_RES( MTR_FLD_Y_OFFSET ) ), - aTsbTile ( this, CUI_RES( TSB_TILE ) ), - aTsbStretch ( this, CUI_RES( TSB_STRETCH ) ), - aFlOffset ( this, CUI_RES( FL_OFFSET ) ), - aRbtRow ( this, CUI_RES( RBT_ROW ) ), - aRbtColumn ( this, CUI_RES( RBT_COLUMN ) ), - aMtrFldOffset ( this, CUI_RES( MTR_FLD_OFFSET ) ), - - aCtlXRectPreview ( this, CUI_RES( CTL_COLOR_PREVIEW ) ), - - rOutAttrs ( rInAttrs ), - - pColorTab( NULL ), - pGradientList( NULL ), - pHatchingList( NULL ), - pBitmapList( NULL ), - - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXFillAttr ( pXPool ), - rXFSet ( aXFillAttr.GetItemSet() ) -{ - FreeResource(); - - String accName = String(CUI_RES(STR_EXAMPLE)); - aCtlXRectPreview.SetAccessibleName(accName); - aCtlBitmapPreview.SetAccessibleName(accName); - - // Gruppen, die sich ueberlagern - aLbBitmap.Hide(); - aCtlBitmapPreview.Hide(); - - aFlStepCount.Hide(); - aTsbStepCount.Hide(); - aNumFldStepCount.Hide(); - - aTsbTile.Hide(); - aTsbStretch.Hide(); - aTsbScale.Hide(); - aTsbOriginal.Hide(); - aFtXSize.Hide(); - aMtrFldXSize.Hide(); - aFtYSize.Hide(); - aMtrFldYSize.Hide(); - aFlSize.Hide(); - aRbtRow.Hide(); - aRbtColumn.Hide(); - aMtrFldOffset.Hide(); - aFlOffset.Hide(); - aCtlPosition.Hide(); - aFtXOffset.Hide(); - aMtrFldXOffset.Hide(); - aFtYOffset.Hide(); - aMtrFldYOffset.Hide(); - aFlPosition.Hide(); - // Controls for Hatch-Background - aCbxHatchBckgrd.Hide(); - aLbHatchBckgrdColor.Hide(); - - - aTsbOriginal.EnableTriState( sal_False ); - - - // this page needs ExchangeSupport - SetExchangeSupport(); - - // set Metrics - eFUnit = GetModuleFieldUnit( rInAttrs ); - - switch ( eFUnit ) - { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; - break; - default: ;//prevent warning - } - SetFieldUnit( aMtrFldXSize, eFUnit, sal_True ); - SetFieldUnit( aMtrFldYSize, eFUnit, sal_True ); - - // get PoolUnit - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool?" ); - ePoolUnit = pPool->GetMetric( XATTR_FILLBMP_SIZEX ); - - // Setzen Output-Devices - rXFSet.Put( XFillStyleItem( XFILL_SOLID ) ); - rXFSet.Put( XFillColorItem( String(), COL_BLACK ) ); - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - aLbColor.SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyColorHdl_Impl ) ); - aLbHatchBckgrdColor.SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl ) ); - aCbxHatchBckgrd.SetToggleHdl( LINK( this, SvxAreaTabPage, ToggleHatchBckgrdColorHdl_Impl ) ); - - aLbGradient.SetSelectHdl( - LINK( this, SvxAreaTabPage, ModifyGradientHdl_Impl ) ); - aLbHatching.SetSelectHdl( - LINK( this, SvxAreaTabPage, ModifyHatchingHdl_Impl ) ); - aLbBitmap.SetSelectHdl( - LINK( this, SvxAreaTabPage, ModifyBitmapHdl_Impl ) ); - - aTsbStepCount.SetClickHdl( - LINK( this, SvxAreaTabPage, ModifyStepCountHdl_Impl ) ); - aNumFldStepCount.SetModifyHdl( - LINK( this, SvxAreaTabPage, ModifyStepCountHdl_Impl ) ); - - Link aLink( LINK( this, SvxAreaTabPage, ModifyTileHdl_Impl ) ); - aTsbTile.SetClickHdl( aLink ); - aTsbStretch.SetClickHdl( aLink ); - aTsbOriginal.SetClickHdl( aLink ); - aMtrFldXSize.SetModifyHdl( aLink ); - aMtrFldYSize.SetModifyHdl( aLink ); - aRbtRow.SetClickHdl( aLink ); - aRbtColumn.SetClickHdl( aLink ); - aMtrFldOffset.SetModifyHdl( aLink ); - aMtrFldXOffset.SetModifyHdl( aLink ); - aMtrFldYOffset.SetModifyHdl( aLink ); - aTsbScale.SetClickHdl( LINK( this, SvxAreaTabPage, ClickScaleHdl_Impl ) ); - - aTypeLB.SetSelectHdl( LINK( this, SvxAreaTabPage, SelectDialogTypeHdl_Impl ) ); - - // #i76307# always paint the preview in LTR, because this is what the document does - aCtlXRectPreview.EnableRTL(sal_False); - - aNumFldStepCount.SetAccessibleRelationLabeledBy( &aTsbStepCount ); - aCtlPosition.SetAccessibleRelationMemberOf( &aFlPosition ); - aLbHatchBckgrdColor.SetAccessibleRelationLabeledBy( &aCbxHatchBckgrd ); - aLbHatchBckgrdColor.SetAccessibleName(aCbxHatchBckgrd.GetText()); - - aLbColor.SetAccessibleRelationMemberOf( &aFlProp ); - aMtrFldOffset.SetAccessibleRelationLabeledBy(&aFlOffset); - aMtrFldOffset.SetAccessibleName(aFlOffset.GetText()); -} - -// ----------------------------------------------------------------------- - -void SvxAreaTabPage::Construct() -{ - // fill colortables / lists - aLbColor.Fill( pColorTab ); - aLbHatchBckgrdColor.Fill ( pColorTab ); - - aLbGradient.Fill( pGradientList ); - aLbHatching.Fill( pHatchingList ); - aLbBitmap.Fill( pBitmapList ); -} - -// ----------------------------------------------------------------------- - -void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) -{ - sal_uInt16 nCount; - SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False); - SFX_ITEMSET_ARG (&rSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False); - if (pPageTypeItem) - SetPageType(pPageTypeItem->GetValue()); - if (pPosItem) - SetPos(pPosItem->GetValue()); - if( nDlgType == 0 ) // Flaechen-Dialog - { - *pbAreaTP = sal_True; - - if( pColorTab ) - { - sal_uInt16 _nPos = 0; - // Bitmapliste - if( *pnBitmapListState ) - { - if( *pnBitmapListState & CT_CHANGED ) - pBitmapList = ( (SvxAreaTabDialog*) DLGWIN )-> - GetNewBitmapList(); - - _nPos = aLbBitmap.GetSelectEntryPos(); - - aLbBitmap.Clear(); - aLbBitmap.Fill( pBitmapList ); - nCount = aLbBitmap.GetEntryCount(); - if( nCount == 0 ) - ; // This case should never occur - else if( nCount <= _nPos ) - aLbBitmap.SelectEntryPos( 0 ); - else - aLbBitmap.SelectEntryPos( _nPos ); - ModifyBitmapHdl_Impl( this ); - } - // hatch-liste - if( *pnHatchingListState ) - { - if( *pnHatchingListState & CT_CHANGED ) - pHatchingList = ( (SvxAreaTabDialog*) DLGWIN )-> - GetNewHatchingList(); - - _nPos = aLbHatching.GetSelectEntryPos(); - - aLbHatching.Clear(); - aLbHatching.Fill( pHatchingList ); - nCount = aLbHatching.GetEntryCount(); - if( nCount == 0 ) - ; // This case should never occur - else if( nCount <= _nPos ) - aLbHatching.SelectEntryPos( 0 ); - else - aLbHatching.SelectEntryPos( _nPos ); - ModifyHatchingHdl_Impl( this ); - - ModifyHatchBckgrdColorHdl_Impl( this ); - } - // gradient-liste - if( *pnGradientListState ) - { - if( *pnGradientListState & CT_CHANGED ) - pGradientList = ( (SvxAreaTabDialog*) DLGWIN )-> - GetNewGradientList(); - - _nPos = aLbGradient.GetSelectEntryPos(); - - aLbGradient.Clear(); - aLbGradient.Fill( pGradientList ); - nCount = aLbGradient.GetEntryCount(); - if( nCount == 0 ) - ; // This case should never occur - else if( nCount <= _nPos ) - aLbGradient.SelectEntryPos( 0 ); - else - aLbGradient.SelectEntryPos( _nPos ); - ModifyGradientHdl_Impl( this ); - } - // ColorTable - if( *pnColorTableState ) - { - if( *pnColorTableState & CT_CHANGED ) - pColorTab = ( (SvxAreaTabDialog*) DLGWIN )-> - GetNewColorTable(); - // aLbColor - _nPos = aLbColor.GetSelectEntryPos(); - aLbColor.Clear(); - aLbColor.Fill( pColorTab ); - nCount = aLbColor.GetEntryCount(); - if( nCount == 0 ) - ; // This case should never occur - else if( nCount <= _nPos ) - aLbColor.SelectEntryPos( 0 ); - else - aLbColor.SelectEntryPos( _nPos ); - - ModifyColorHdl_Impl( this ); - - // Backgroundcolor of hatch - _nPos = aLbHatchBckgrdColor.GetSelectEntryPos(); - aLbHatchBckgrdColor.Clear(); - aLbHatchBckgrdColor.Fill( pColorTab ); - nCount = aLbHatchBckgrdColor.GetEntryCount(); - if( nCount == 0 ) - ; // This case should never occur - else if( nCount <= _nPos ) - aLbHatchBckgrdColor.SelectEntryPos( 0 ); - else - aLbHatchBckgrdColor.SelectEntryPos( _nPos ); - - ModifyHatchBckgrdColorHdl_Impl( this ); - } - - // evaluate if any other Tabpage set another filltype - if( aTypeLB.GetSelectEntryPos() > XFILL_NONE) - { - switch( nPageType ) - { - case PT_GRADIENT: - aTypeLB.SelectEntryPos( XFILL_GRADIENT ); - aLbGradient.SelectEntryPos( _nPos ); - ClickGradientHdl_Impl( this ); - break; - - case PT_HATCH: - aTypeLB.SelectEntryPos( XFILL_HATCH ); - aLbHatching.SelectEntryPos( _nPos ); - ClickHatchingHdl_Impl( this ); - break; - - case PT_BITMAP: - aTypeLB.SelectEntryPos( XFILL_BITMAP ); - aLbBitmap.SelectEntryPos( _nPos ); - ClickBitmapHdl_Impl( this ); - break; - - case PT_COLOR: - aTypeLB.SelectEntryPos( XFILL_SOLID ); - aLbColor.SelectEntryPos( _nPos ); - aLbHatchBckgrdColor.SelectEntryPos( _nPos ); - ClickColorHdl_Impl( this ); - break; - } - } - nPageType = PT_AREA; - } - } -} - -// ----------------------------------------------------------------------- - -int SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if( nDlgType == 0 ) // Flaechen-Dialog - { - XFillStyle eStyle = (XFillStyle) aTypeLB.GetSelectEntryPos(); - switch( eStyle ) - { - case XFILL_GRADIENT: - { - nPageType = PT_GRADIENT; - nPos = aLbGradient.GetSelectEntryPos(); - } - break; - case XFILL_HATCH: - { - nPageType = PT_HATCH; - nPos = aLbHatching.GetSelectEntryPos(); - } - break; - case XFILL_BITMAP: - { - nPageType = PT_BITMAP; - nPos = aLbBitmap.GetSelectEntryPos(); - } - break; - case XFILL_SOLID: - { - nPageType = PT_COLOR; - nPos = aLbColor.GetSelectEntryPos(); - } - break; - default: ;//prevent warning - } - } - - if( _pSet ) - FillItemSet( *_pSet ); - - return( LEAVE_PAGE ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxAreaTabPage::FillItemSet( SfxItemSet& rAttrs ) -{ - const SfxPoolItem* pOld = NULL; - sal_uInt16 _nPos; - sal_Bool bModified = sal_False; - - if( nDlgType != 0 || *pbAreaTP ) - { - XFillStyle eStyle = (XFillStyle) aTypeLB.GetSelectEntryPos(); - XFillStyle eSavedStyle = (XFillStyle) aTypeLB.GetSavedValue(); - switch( eStyle ) - { - case XFILL_NONE: - { - if( eSavedStyle != eStyle ) - { - XFillStyleItem aStyleItem( XFILL_NONE ); - pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE ); - if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) ) - { - rAttrs.Put( aStyleItem ); - bModified = sal_True; - } - } - } - break; - case XFILL_SOLID: - { - _nPos = aLbColor.GetSelectEntryPos(); - if( _nPos != LISTBOX_ENTRY_NOTFOUND && - _nPos != aLbColor.GetSavedValue() ) - { - XFillColorItem aItem( aLbColor.GetSelectEntry(), - aLbColor.GetSelectEntryColor() ); - pOld = GetOldItem( rAttrs, XATTR_FILLCOLOR ); - if ( !pOld || !( *(const XFillColorItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - // NEU - if( (eSavedStyle != eStyle) && - ( bModified || - SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), sal_True ) ) ) - { - XFillStyleItem aStyleItem( XFILL_SOLID ); - pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE ); - if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) ) - { - rAttrs.Put( aStyleItem ); - bModified = sal_True; - } - } - } - break; - case XFILL_GRADIENT: - { - _nPos = aLbGradient.GetSelectEntryPos(); - if( _nPos != LISTBOX_ENTRY_NOTFOUND && - _nPos != aLbGradient.GetSavedValue() ) - { - XGradient aGradient = pGradientList->GetGradient( _nPos )->GetGradient(); - String aString = aLbGradient.GetSelectEntry(); - XFillGradientItem aItem( aString, aGradient ); - pOld = GetOldItem( rAttrs, XATTR_FILLGRADIENT ); - if ( !pOld || !( *(const XFillGradientItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - // NEU - if( (eSavedStyle != eStyle) && - ( bModified || - SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLGRADIENT ), sal_True ) ) ) - { - XFillStyleItem aStyleItem( XFILL_GRADIENT ); - pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE ); - if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) ) - { - rAttrs.Put( aStyleItem ); - bModified = sal_True; - } - } - } - break; - case XFILL_HATCH: - { - _nPos = aLbHatching.GetSelectEntryPos(); - if( _nPos != LISTBOX_ENTRY_NOTFOUND && - _nPos != aLbHatching.GetSavedValue() ) - { - XHatch aHatching = pHatchingList->GetHatch( _nPos )->GetHatch(); - String aString = aLbHatching.GetSelectEntry(); - XFillHatchItem aItem( aString, aHatching ); - pOld = GetOldItem( rAttrs, XATTR_FILLHATCH ); - if ( !pOld || !( *(const XFillHatchItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - XFillBackgroundItem aItem ( aCbxHatchBckgrd.IsChecked() ); - rAttrs.Put( aItem ); - nPos = aLbHatchBckgrdColor.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND && - nPos != aLbHatchBckgrdColor.GetSavedValue() ) - { - XFillColorItem aFillColorItem( aLbHatchBckgrdColor.GetSelectEntry(), - aLbHatchBckgrdColor.GetSelectEntryColor() ); - pOld = GetOldItem( rAttrs, XATTR_FILLCOLOR ); - if ( !pOld || !( *(const XFillColorItem*)pOld == aFillColorItem ) ) - { - rAttrs.Put( aFillColorItem ); - bModified = sal_True; - } - } - // NEU - if( (eSavedStyle != eStyle) && - ( bModified || - SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLHATCH ), sal_True ) ) ) - { - XFillStyleItem aStyleItem( XFILL_HATCH ); - pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE ); - if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) ) - { - rAttrs.Put( aStyleItem ); - bModified = sal_True; - } - } - } - break; - case XFILL_BITMAP: - { - nPos = aLbBitmap.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND && - nPos != aLbBitmap.GetSavedValue() ) - { - XOBitmap aXOBitmap = pBitmapList->GetBitmap( nPos )->GetXBitmap(); - String aString = aLbBitmap.GetSelectEntry(); - XFillBitmapItem aFillBitmapItem( aString, aXOBitmap ); - pOld = GetOldItem( rAttrs, XATTR_FILLBITMAP ); - if ( !pOld || !( *(const XFillBitmapItem*)pOld == aFillBitmapItem ) ) - { - rAttrs.Put( aFillBitmapItem ); - bModified = sal_True; - } - } - // NEU - if( (eSavedStyle != eStyle) && - ( bModified || - SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), sal_True ) ) ) - { - XFillStyleItem aStyleItem( XFILL_BITMAP ); - pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE ); - if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) ) - { - rAttrs.Put( aStyleItem ); - bModified = sal_True; - } - } - } - break; - } - - // Schrittweite - if( aTsbStepCount.IsEnabled() ) - { - sal_uInt16 nValue = 0; - sal_Bool bValueModified = sal_False; - TriState eState = aTsbStepCount.GetState(); - if( eState == STATE_CHECK ) - { - if( eState != aTsbStepCount.GetSavedValue() ) - bValueModified = sal_True; - } - else - { - // Zustand != Disabled ? - if( aNumFldStepCount.GetText().Len() > 0 ) - { - nValue = (sal_uInt16) aNumFldStepCount.GetValue(); - if( nValue != (sal_uInt16) aNumFldStepCount.GetSavedValue().ToInt32() ) - bValueModified = sal_True; - } - } - if( bValueModified ) - { - XGradientStepCountItem aFillBitmapItem( nValue ); - pOld = GetOldItem( rAttrs, XATTR_GRADIENTSTEPCOUNT ); - if ( !pOld || !( *(const XGradientStepCountItem*)pOld == aFillBitmapItem ) ) - { - rAttrs.Put( aFillBitmapItem ); - bModified = sal_True; - } - } - } - - // Kacheln - if( aTsbTile.IsEnabled() ) - { - TriState eState = aTsbTile.GetState(); - if( eState != aTsbTile.GetSavedValue() ) - { - XFillBmpTileItem aFillBmpTileItem( - sal::static_int_cast< sal_Bool >( eState ) ); - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_TILE ); - if ( !pOld || !( *(const XFillBmpTileItem*)pOld == aFillBmpTileItem ) ) - { - rAttrs.Put( aFillBmpTileItem ); - bModified = sal_True; - } - } - } - // Stretchen - if( aTsbStretch.IsEnabled() ) - { - TriState eState = aTsbStretch.GetState(); - if( eState != aTsbStretch.GetSavedValue() ) - { - XFillBmpStretchItem aFillBmpStretchItem( - sal::static_int_cast< sal_Bool >( eState ) ); - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_STRETCH ); - if ( !pOld || !( *(const XFillBmpStretchItem*)pOld == aFillBmpStretchItem ) ) - { - rAttrs.Put( aFillBmpStretchItem ); - bModified = sal_True; - } - } - } - - // Originalgroesse (im UI) wird wie folgt benutzt: - // Controls sind disabled, muessen aber gesetzt werden. - // SizeX = 0; SizeY = 0; Log = sal_True - - //aTsbScale - TriState eState = aTsbScale.GetState(); - if( eState != aTsbScale.GetSavedValue() || - ( !aTsbScale.IsEnabled() && - aTsbOriginal.IsEnabled() && - aTsbScale.GetSavedValue() != STATE_CHECK ) ) - { - XFillBmpSizeLogItem* pItem = NULL; - if( aTsbScale.IsEnabled() ) - pItem = new XFillBmpSizeLogItem( eState == STATE_NOCHECK ); - else if( aTsbOriginal.IsEnabled() && aTsbOriginal.GetState() == STATE_CHECK ) - pItem = new XFillBmpSizeLogItem( sal_True ); - - if( pItem ) - { - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_SIZELOG ); - if ( !pOld || !( *(const XFillBmpSizeLogItem*)pOld == *pItem ) ) - { - rAttrs.Put( *pItem ); - bModified = sal_True; - } - delete pItem; - } - } - - //aMtrFldXSize - String aStr = aMtrFldXSize.GetText(); - { - XFillBmpSizeXItem* pItem = NULL; - TriState eScaleState = aTsbScale.GetState(); - - if( aMtrFldXSize.IsEnabled() && - aStr.Len() > 0 && - aStr != aMtrFldXSize.GetSavedValue() ) - { - if( eScaleState == STATE_NOCHECK ) - pItem = new XFillBmpSizeXItem( GetCoreValue( aMtrFldXSize, ePoolUnit ) ); - else - { - // Prozentwerte werden negativ gesetzt, damit - // diese nicht skaliert werden; dieses wird - // im Item beruecksichtigt - pItem = new XFillBmpSizeXItem( -labs( static_cast<long>(aMtrFldXSize.GetValue()) ) ); - } - } - else if( aTsbOriginal.IsEnabled() && - aTsbOriginal.GetState() == STATE_CHECK && - aMtrFldXSize.GetSavedValue().Len() > 0 ) - pItem = new XFillBmpSizeXItem( 0 ); - - if( pItem ) - { - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_SIZEX ); - if ( !pOld || !( *(const XFillBmpSizeXItem*)pOld == *pItem ) ) - { - rAttrs.Put( *pItem ); - bModified = sal_True; - } - delete pItem; - } - } - - //aMtrFldYSize - aStr = aMtrFldYSize.GetText(); - { - XFillBmpSizeYItem* pItem = NULL; - TriState eScaleState = aTsbScale.GetState(); - - if( aMtrFldYSize.IsEnabled() && - aStr.Len() > 0 && - aStr != aMtrFldYSize.GetSavedValue() ) - { - if( eScaleState == STATE_NOCHECK ) - pItem = new XFillBmpSizeYItem( GetCoreValue( aMtrFldYSize, ePoolUnit ) ); - else - { - // Prozentwerte werden negativ gesetzt, damit - // diese vom MetricItem nicht skaliert werden; - // dieses wird im Item beruecksichtigt - pItem = new XFillBmpSizeYItem( -labs( static_cast<long>(aMtrFldYSize.GetValue()) ) ); - } - } - else if( aTsbOriginal.IsEnabled() && - aTsbOriginal.GetState() == STATE_CHECK && - aMtrFldYSize.GetSavedValue().Len() > 0 ) - pItem = new XFillBmpSizeYItem( 0 ); - - if( pItem ) - { - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_SIZEY ); - if ( !pOld || !( *(const XFillBmpSizeYItem*)pOld == *pItem ) ) - { - rAttrs.Put( *pItem ); - bModified = sal_True; - } - delete pItem; - } - } - - //aRbtRow - //aRbtColumn - //aMtrFldOffset - if( aMtrFldOffset.IsEnabled() ) - { - String aMtrString = aMtrFldOffset.GetText(); - if( ( aMtrString.Len() > 0 && - aMtrString != aMtrFldOffset.GetSavedValue() ) || - aRbtRow.GetSavedValue() != aRbtRow.IsChecked() || - aRbtColumn.GetSavedValue() != aRbtColumn.IsChecked() ) - { - if( aRbtRow.IsChecked() ) - { - XFillBmpTileOffsetXItem aFillBmpTileOffsetXItem( (sal_uInt16) aMtrFldOffset.GetValue() ); - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_TILEOFFSETX ); - if ( !pOld || !( *(const XFillBmpTileOffsetXItem*)pOld == aFillBmpTileOffsetXItem ) ) - { - rAttrs.Put( aFillBmpTileOffsetXItem ); - rAttrs.Put( XFillBmpTileOffsetYItem( 0 ) ); - bModified = sal_True; - } - } - else if( aRbtColumn.IsChecked() ) - { - XFillBmpTileOffsetYItem aFillBmpTileOffsetYItem( (sal_uInt16) aMtrFldOffset.GetValue() ); - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_TILEOFFSETY ); - if ( !pOld || !( *(const XFillBmpTileOffsetYItem*)pOld == aFillBmpTileOffsetYItem ) ) - { - rAttrs.Put( aFillBmpTileOffsetYItem ); - rAttrs.Put( XFillBmpTileOffsetXItem( 0 ) ); - bModified = sal_True; - } - } - } - } - - //aCtlPosition - if( aCtlPosition.IsEnabled() ) - { - sal_Bool bPut = sal_False; - RECT_POINT _eRP = aCtlPosition.GetActualRP(); - - if( SFX_ITEM_DONTCARE == rOutAttrs.GetItemState( XATTR_FILLBMP_POS ) ) - bPut = sal_True; - else - { - RECT_POINT eValue = ( ( const XFillBmpPosItem& ) rOutAttrs.Get( XATTR_FILLBMP_POS ) ).GetValue(); - if( eValue != _eRP ) - bPut = sal_True; - } - if( bPut ) - { - XFillBmpPosItem aFillBmpPosItem( _eRP ); - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_POS ); - if ( !pOld || !( *(const XFillBmpPosItem*)pOld == aFillBmpPosItem ) ) - { - rAttrs.Put( aFillBmpPosItem ); - bModified = sal_True; - } - } - } - - //aMtrFldXOffset - if( aMtrFldXOffset.IsEnabled() ) - { - String sMtrXOffset = aMtrFldXOffset.GetText(); - if( sMtrXOffset.Len() > 0 && - sMtrXOffset != aMtrFldXOffset.GetSavedValue() ) - { - XFillBmpPosOffsetXItem aFillBmpPosOffsetXItem( (sal_uInt16) aMtrFldXOffset.GetValue() ); - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_POSOFFSETX ); - if ( !pOld || !( *(const XFillBmpPosOffsetXItem*)pOld == aFillBmpPosOffsetXItem ) ) - { - rAttrs.Put( aFillBmpPosOffsetXItem ); - bModified = sal_True; - } - } - } - - //aMtrFldYOffset - if( aMtrFldYOffset.IsEnabled() ) - { - String sMtrYOffset = aMtrFldYOffset.GetText(); - if( sMtrYOffset.Len() > 0 && - sMtrYOffset != aMtrFldYOffset.GetSavedValue() ) - { - XFillBmpPosOffsetYItem aFillBmpPosOffsetYItem( (sal_uInt16) aMtrFldYOffset.GetValue() ); - pOld = GetOldItem( rAttrs, XATTR_FILLBMP_POSOFFSETY ); - if ( !pOld || !( *(const XFillBmpPosOffsetYItem*)pOld == aFillBmpPosOffsetYItem ) ) - { - rAttrs.Put( aFillBmpPosOffsetYItem ); - bModified = sal_True; - } - } - } - rAttrs.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType)); - rAttrs.Put (SfxUInt16Item(SID_TABPAGE_POS,nPos)); - } - - return( bModified ); -} - -// ----------------------------------------------------------------------- - -void SvxAreaTabPage::Reset( const SfxItemSet& rAttrs ) -{ - XFillStyle eXFS; - if( rAttrs.GetItemState( XATTR_FILLSTYLE ) != SFX_ITEM_DONTCARE ) - { - eXFS = (XFillStyle) ( ( ( const XFillStyleItem& ) rAttrs. - Get( GetWhich( XATTR_FILLSTYLE ) ) ).GetValue() ); - aTypeLB.SelectEntryPos( sal::static_int_cast< sal_uInt16 >( eXFS ) ); - switch( eXFS ) - { - case XFILL_NONE: - ClickInvisibleHdl_Impl( this ); - break; - - case XFILL_SOLID: - if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLCOLOR ) ) - { - XFillColorItem aColorItem( ( const XFillColorItem& ) - rAttrs.Get( XATTR_FILLCOLOR ) ); - - aLbColor.SelectEntry( aColorItem.GetColorValue() ); - aLbHatchBckgrdColor.SelectEntry( aColorItem.GetColorValue() ); - } - ClickColorHdl_Impl( this ); - - break; - - case XFILL_GRADIENT: - if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLGRADIENT ) ) - { - XFillGradientItem aGradientItem( ( ( const XFillGradientItem& ) - rAttrs.Get( XATTR_FILLGRADIENT ) ) ); - String aString( aGradientItem.GetName() ); - XGradient aGradient( aGradientItem.GetGradientValue() ); - - aLbGradient.SelectEntryByList( pGradientList, aString, aGradient ); - } - ClickGradientHdl_Impl( this ); - break; - - case XFILL_HATCH: - if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLHATCH ) ) - { - aLbHatching.SelectEntry( ( ( const XFillHatchItem& ) - rAttrs.Get( XATTR_FILLHATCH ) ).GetName() ); - } - ClickHatchingHdl_Impl( this ); - - if ( SFX_ITEM_DONTCARE != rAttrs.GetItemState ( XATTR_FILLBACKGROUND ) ) - { - aCbxHatchBckgrd.Check ( ( ( const XFillBackgroundItem& ) rAttrs.Get ( XATTR_FILLBACKGROUND ) ).GetValue() ); - } - ToggleHatchBckgrdColorHdl_Impl( this ); - if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLCOLOR ) ) - { - XFillColorItem aColorItem( ( const XFillColorItem& ) - rAttrs.Get( XATTR_FILLCOLOR ) ); - - aLbColor.SelectEntry( aColorItem.GetColorValue() ); - aLbHatchBckgrdColor.SelectEntry( aColorItem.GetColorValue() ); - } - break; - - case XFILL_BITMAP: - { - if( SFX_ITEM_DONTCARE != rAttrs.GetItemState( XATTR_FILLBITMAP ) ) - { - XFillBitmapItem aBitmapItem( ( const XFillBitmapItem& ) - rAttrs.Get( XATTR_FILLBITMAP ) ); - - String aString( aBitmapItem.GetName() ); - aLbBitmap.SelectEntry( aString ); - } - ClickBitmapHdl_Impl( this ); - } - break; - - default: - break; - } - } - else - { - // Alle LBs nicht zug"anglich machen - aLbColor.Hide(); - aLbGradient.Hide(); - aLbHatching.Hide(); - aLbBitmap.Hide(); - aCtlBitmapPreview.Hide(); - aLbColor.Disable(); - aLbColor.Show(); - - // Damit Reset() auch mit Zurueck richtig funktioniert - aTypeLB.SetNoSelection(); - } - - // Schrittweite - if( ( rAttrs.GetItemState( XATTR_GRADIENTSTEPCOUNT ) != SFX_ITEM_DONTCARE ) || - ( rAttrs.GetItemState( XATTR_FILLSTYLE ) != SFX_ITEM_DONTCARE ) ) - { - aTsbStepCount.EnableTriState( sal_False ); - sal_uInt16 nValue = ( ( const XGradientStepCountItem& ) rAttrs.Get( XATTR_GRADIENTSTEPCOUNT ) ).GetValue(); - if( nValue == 0 ) - { - aTsbStepCount.SetState( STATE_CHECK ); - aNumFldStepCount.SetText( String() ); - } - else - { - aTsbStepCount.SetState( STATE_NOCHECK ); - aNumFldStepCount.SetValue( nValue ); - } - ModifyStepCountHdl_Impl( &aTsbStepCount ); - } - else - { - aTsbStepCount.SetState( STATE_DONTKNOW ); - aNumFldStepCount.SetText( String() ); - } - - // Attribute fuer die Bitmap-Fuellung - - // Ist Kacheln gesetzt? - if( rAttrs.GetItemState( XATTR_FILLBMP_TILE ) != SFX_ITEM_DONTCARE ) - { - aTsbTile.EnableTriState( sal_False ); - - if( ( ( const XFillBmpTileItem& ) rAttrs.Get( XATTR_FILLBMP_TILE ) ).GetValue() ) - aTsbTile.SetState( STATE_CHECK ); - else - aTsbTile.SetState( STATE_NOCHECK ); - } - else - aTsbTile.SetState( STATE_DONTKNOW ); - - // Ist Stretchen gesetzt? - if( rAttrs.GetItemState( XATTR_FILLBMP_STRETCH ) != SFX_ITEM_DONTCARE ) - { - aTsbStretch.EnableTriState( sal_False ); - - if( ( ( const XFillBmpStretchItem& ) rAttrs.Get( XATTR_FILLBMP_STRETCH ) ).GetValue() ) - aTsbStretch.SetState( STATE_CHECK ); - else - aTsbStretch.SetState( STATE_NOCHECK ); - } - else - aTsbStretch.SetState( STATE_DONTKNOW ); - - - //aTsbScale - if( rAttrs.GetItemState( XATTR_FILLBMP_SIZELOG ) != SFX_ITEM_DONTCARE ) - { - aTsbScale.EnableTriState( sal_False ); - - if( ( ( const XFillBmpSizeLogItem& ) rAttrs.Get( XATTR_FILLBMP_SIZELOG ) ).GetValue() ) - aTsbScale.SetState( STATE_NOCHECK ); - else - aTsbScale.SetState( STATE_CHECK ); - - ClickScaleHdl_Impl( NULL ); - } - else - aTsbScale.SetState( STATE_DONTKNOW ); - - - // Status fuer Originalgroesse ermitteln - TriState eOriginal = STATE_NOCHECK; - - //aMtrFldXSize - if( rAttrs.GetItemState( XATTR_FILLBMP_SIZEX ) != SFX_ITEM_DONTCARE ) - { - sal_Int32 nValue = ( ( const XFillBmpSizeXItem& ) rAttrs.Get( XATTR_FILLBMP_SIZEX ) ).GetValue(); - if( aTsbScale.GetState() == STATE_CHECK ) - { - // Wenn im Item eine Prozentangabe steckt, - // so ist diese wegen des MetricItems negativ - aMtrFldXSize.SetValue( labs( nValue ) ); - } - else - SetMetricValue( aMtrFldXSize, nValue, ePoolUnit ); - aMtrFldXSize.SaveValue(); - - if( nValue == 0 ) - { - eOriginal = STATE_CHECK; - // Wert ist beim Ausschalten von Originalgroesse sonst zu klein - // (Performance-Problem) - aMtrFldXSize.SetValue( 100 ); - } - } - else - { - aMtrFldXSize.SetText( String() ); - aMtrFldXSize.SaveValue(); - } - - //aMtrFldYSize - if( rAttrs.GetItemState( XATTR_FILLBMP_SIZEY ) != SFX_ITEM_DONTCARE ) - { - sal_Int32 nValue = ( ( const XFillBmpSizeYItem& ) rAttrs.Get( XATTR_FILLBMP_SIZEY ) ).GetValue(); - if( aTsbScale.GetState() == STATE_CHECK ) - { - // Wenn im Item eine Prozentangabe steckt, - // so ist diese wegen des MetricItems negativ - aMtrFldYSize.SetValue( labs( nValue ) ); - } - else - SetMetricValue( aMtrFldYSize, nValue, ePoolUnit ); - aMtrFldYSize.SaveValue(); - - if( nValue == 0 ) - aMtrFldYSize.SetValue( 100 ); //s.o. - else - eOriginal = STATE_NOCHECK; - } - else - { - aMtrFldYSize.SetText( String() ); - aMtrFldYSize.SaveValue(); - eOriginal = STATE_NOCHECK; - } - - // aTsbOriginal - aTsbOriginal.SetState( eOriginal ); - - // #93372# Setting proper state after changing button - ModifyTileHdl_Impl( NULL ); - - //aRbtRow - //aRbtColumn - //aMtrFldOffset - if( rAttrs.GetItemState( XATTR_FILLBMP_TILEOFFSETX ) != SFX_ITEM_DONTCARE ) - { - sal_uInt16 nValue = ( ( const XFillBmpTileOffsetXItem& ) rAttrs.Get( XATTR_FILLBMP_TILEOFFSETX ) ).GetValue(); - if( nValue > 0 ) - { - aMtrFldOffset.SetValue( nValue ); - aRbtRow.Check(); - } - else if( rAttrs.GetItemState( XATTR_FILLBMP_TILEOFFSETY ) != SFX_ITEM_DONTCARE ) - { - nValue = ( ( const XFillBmpTileOffsetYItem& ) rAttrs.Get( XATTR_FILLBMP_TILEOFFSETY ) ).GetValue(); - if( nValue > 0 ) - { - aMtrFldOffset.SetValue( nValue ); - aRbtColumn.Check(); - } - } - else - aMtrFldOffset.SetValue( 0 ); - } - else - aMtrFldOffset.SetText( String() ); - - - //aCtlPosition - if( rAttrs.GetItemState( XATTR_FILLBMP_POS ) != SFX_ITEM_DONTCARE ) - { - RECT_POINT eValue = ( ( const XFillBmpPosItem& ) rAttrs.Get( XATTR_FILLBMP_POS ) ).GetValue(); - aCtlPosition.SetActualRP( eValue ); - } - else - aCtlPosition.Reset(); - - //aMtrFldXOffset - if( rAttrs.GetItemState( XATTR_FILLBMP_POSOFFSETX ) != SFX_ITEM_DONTCARE ) - { - sal_Int32 nValue = ( ( const XFillBmpPosOffsetXItem& ) rAttrs.Get( XATTR_FILLBMP_POSOFFSETX ) ).GetValue(); - aMtrFldXOffset.SetValue( nValue ); - } - else - aMtrFldXOffset.SetText( String() ); - - //aMtrFldYOffset - if( rAttrs.GetItemState( XATTR_FILLBMP_POSOFFSETY ) != SFX_ITEM_DONTCARE ) - { - sal_Int32 nValue = ( ( const XFillBmpPosOffsetYItem& ) rAttrs.Get( XATTR_FILLBMP_POSOFFSETY ) ).GetValue(); - aMtrFldYOffset.SetValue( nValue ); - } - else - aMtrFldYOffset.SetText( String() ); - - // Erst hier, damit Tile und Stretch mit beruecksichtigt wird - if( aTypeLB.GetSelectEntryPos() == XFILL_BITMAP ) - ClickBitmapHdl_Impl( NULL ); - - // Werte sichern - aTypeLB.SaveValue(); - aLbColor.SaveValue(); - aLbGradient.SaveValue(); - aLbHatching.SaveValue(); - aLbHatchBckgrdColor.SaveValue(); - aLbBitmap.SaveValue(); - aTsbStepCount.SaveValue(); - aNumFldStepCount.SaveValue(); - aTsbTile.SaveValue(); - aTsbStretch.SaveValue(); - aTsbScale.SaveValue(); - aRbtRow.SaveValue(); - aRbtColumn.SaveValue(); - aMtrFldOffset.SaveValue(); - aMtrFldXOffset.SaveValue(); - aMtrFldYOffset.SaveValue(); -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxAreaTabPage::Create( Window* pWindow, - const SfxItemSet& rAttrs ) -{ - return( new SvxAreaTabPage( pWindow, rAttrs ) ); -} - -//------------------------------------------------------------------------ - -sal_uInt16* SvxAreaTabPage::GetRanges() -{ - return( pAreaRanges ); -} - -//------------------------------------------------------------------------ -IMPL_LINK( SvxAreaTabPage, SelectDialogTypeHdl_Impl, ListBox *, EMPTYARG ) -{ - switch( (XFillStyle)aTypeLB.GetSelectEntryPos() ) - { - case XFILL_NONE: ClickInvisibleHdl_Impl( this ); break; - case XFILL_SOLID: ClickColorHdl_Impl( this ); break; - case XFILL_GRADIENT: ClickGradientHdl_Impl( this ); break; - case XFILL_HATCH: ClickHatchingHdl_Impl( this ); break; - case XFILL_BITMAP: ClickBitmapHdl_Impl( this ); break; - } - - return 0; -} - -IMPL_LINK( SvxAreaTabPage, ClickInvisibleHdl_Impl, void *, EMPTYARG ) -{ - aTsbTile.Hide(); - aTsbStretch.Hide(); - aTsbScale.Hide(); - aTsbOriginal.Hide(); - aFtXSize.Hide(); - aMtrFldXSize.Hide(); - aFtYSize.Hide(); - aMtrFldYSize.Hide(); - aFlSize.Hide(); - aRbtRow.Hide(); - aRbtColumn.Hide(); - aMtrFldOffset.Hide(); - aFlOffset.Hide(); - aCtlPosition.Hide(); - aFtXOffset.Hide(); - aMtrFldXOffset.Hide(); - aFtYOffset.Hide(); - aMtrFldYOffset.Hide(); - aFlPosition.Hide(); - - aLbColor.Hide(); - aLbGradient.Hide(); - aLbHatching.Hide(); - aLbBitmap.Hide(); - aCtlXRectPreview.Hide(); - aCtlBitmapPreview.Hide(); - - aFlStepCount.Hide(); - aTsbStepCount.Hide(); - aNumFldStepCount.Hide(); - - // Controls for Hatch-Background - aCbxHatchBckgrd.Hide(); - aLbHatchBckgrdColor.Hide(); - - rXFSet.Put( XFillStyleItem( XFILL_NONE ) ); - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlXRectPreview.Invalidate(); - aCtlBitmapPreview.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ClickColorHdl_Impl, void *, EMPTYARG ) -{ - aTsbTile.Hide(); - aTsbStretch.Hide(); - aTsbScale.Hide(); - aTsbOriginal.Hide(); - aFtXSize.Hide(); - aMtrFldXSize.Hide(); - aFtYSize.Hide(); - aMtrFldYSize.Hide(); - aFlSize.Hide(); - aRbtRow.Hide(); - aRbtColumn.Hide(); - aMtrFldOffset.Hide(); - aFlOffset.Hide(); - aCtlPosition.Hide(); - aFtXOffset.Hide(); - aMtrFldXOffset.Hide(); - aFtYOffset.Hide(); - aMtrFldYOffset.Hide(); - aFlPosition.Hide(); - - aLbColor.Enable(); - aLbColor.Show(); - aLbGradient.Hide(); - aLbHatching.Hide(); - aLbBitmap.Hide(); - aCtlXRectPreview.Enable(); - aCtlXRectPreview.Show(); - aCtlBitmapPreview.Hide(); - - aFlStepCount.Hide(); - aTsbStepCount.Hide(); - aNumFldStepCount.Hide(); - - // Controls for Hatch-Background - aCbxHatchBckgrd.Hide(); - aLbHatchBckgrdColor.Hide(); - - // Text der Tabelle setzen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - INetURLObject aURL( pColorTab->GetPath() ); - - aURL.Append( pColorTab->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - ModifyColorHdl_Impl( this ); - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ModifyColorHdl_Impl, void *, EMPTYARG ) -{ - const SfxPoolItem* pPoolItem = NULL; - sal_uInt16 _nPos = aLbColor.GetSelectEntryPos(); - aLbHatchBckgrdColor.SelectEntryPos( _nPos ); - if( _nPos != LISTBOX_ENTRY_NOTFOUND ) - { - rXFSet.Put( XFillStyleItem( XFILL_SOLID ) ); - rXFSet.Put( XFillColorItem( String(), - aLbColor.GetSelectEntryColor() ) ); - } - // NEU - else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), sal_True, &pPoolItem ) ) - { - rXFSet.Put( XFillStyleItem( XFILL_SOLID ) ); - Color aColor( ( ( const XFillColorItem* ) pPoolItem )->GetColorValue() ); - rXFSet.Put( XFillColorItem( String(), aColor ) ); - } - else - rXFSet.Put( XFillStyleItem( XFILL_NONE ) ); - - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlXRectPreview.Invalidate(); - - return( 0L ); -} -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ClickGradientHdl_Impl, void *, EMPTYARG ) -{ - aTsbTile.Hide(); - aTsbStretch.Hide(); - aTsbScale.Hide(); - aTsbOriginal.Hide(); - aFtXSize.Hide(); - aMtrFldXSize.Hide(); - aFtYSize.Hide(); - aMtrFldYSize.Hide(); - aFlSize.Hide(); - aRbtRow.Hide(); - aRbtColumn.Hide(); - aMtrFldOffset.Hide(); - aFlOffset.Hide(); - aCtlPosition.Hide(); - aFtXOffset.Hide(); - aMtrFldXOffset.Hide(); - aFtYOffset.Hide(); - aMtrFldYOffset.Hide(); - aFlPosition.Hide(); - - aLbColor.Hide(); - aLbGradient.Enable(); - aLbGradient.Show(); - aLbHatching.Hide(); - aLbBitmap.Hide(); - aCtlXRectPreview.Enable(); - aCtlXRectPreview.Show(); - aCtlBitmapPreview.Hide(); - - aFlStepCount.Enable(); - aFlStepCount.Show(); - aTsbStepCount.Enable(); - aTsbStepCount.Show(); - aNumFldStepCount.Show(); - - // Controls for Hatch-Background - aCbxHatchBckgrd.Hide(); - aLbHatchBckgrdColor.Hide(); - - // Text der Tabelle setzen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - INetURLObject aURL( pGradientList->GetPath() ); - - aURL.Append( pGradientList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - ModifyGradientHdl_Impl( this ); - ModifyStepCountHdl_Impl( &aTsbStepCount ); - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ModifyGradientHdl_Impl, void *, EMPTYARG ) -{ - const SfxPoolItem* pPoolItem = NULL; - sal_uInt16 _nPos = aLbGradient.GetSelectEntryPos(); - if( _nPos != LISTBOX_ENTRY_NOTFOUND ) - { - // ItemSet fuellen und an aCtlXRectPreview weiterleiten - XGradientEntry* pEntry = pGradientList->GetGradient( _nPos ); - - rXFSet.Put( XFillStyleItem( XFILL_GRADIENT ) ); - rXFSet.Put( XFillGradientItem( String(), - pEntry->GetGradient() ) ); - } - else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLGRADIENT ), sal_True, &pPoolItem ) ) - { - rXFSet.Put( XFillStyleItem( XFILL_GRADIENT ) ); - rXFSet.Put( XFillGradientItem( String(), ( ( const XFillGradientItem* ) pPoolItem )->GetGradientValue() ) ); - } - else - rXFSet.Put( XFillStyleItem( XFILL_NONE ) ); - - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlXRectPreview.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ClickHatchingHdl_Impl, void *, EMPTYARG ) -{ - aLbColor.Hide(); - aLbGradient.Hide(); - aLbHatching.Enable(); - aLbHatching.Show(); - aLbBitmap.Hide(); - aCtlXRectPreview.Enable(); - aCtlXRectPreview.Show(); - aCtlBitmapPreview.Hide(); - - aFlStepCount.Hide(); - aTsbStepCount.Hide(); - aNumFldStepCount.Hide(); - - aTsbTile.Hide(); - aTsbStretch.Hide(); - aTsbScale.Hide(); - aTsbOriginal.Hide(); - aFtXSize.Hide(); - aMtrFldXSize.Hide(); - aFtYSize.Hide(); - aMtrFldYSize.Hide(); - aFlSize.Hide(); - aRbtRow.Hide(); - aRbtColumn.Hide(); - aMtrFldOffset.Hide(); - aFlOffset.Hide(); - aCtlPosition.Hide(); - aFtXOffset.Hide(); - aMtrFldXOffset.Hide(); - aFtYOffset.Hide(); - aMtrFldYOffset.Hide(); - aFlPosition.Hide(); - - // Controls for Hatch-Background - aCbxHatchBckgrd.Show(); - aLbHatchBckgrdColor.Show(); - aCbxHatchBckgrd.Enable(); - aLbHatchBckgrdColor.Enable(); - - // Text der Tabelle setzen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - INetURLObject aURL( pHatchingList->GetPath() ); - - aURL.Append( pHatchingList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( aURL.getBase().getLength() > 18 ) - { - aString += String(String(aURL.getBase()).Copy( 0, 15 )); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - ModifyHatchingHdl_Impl( this ); - ModifyHatchBckgrdColorHdl_Impl( this ); - ToggleHatchBckgrdColorHdl_Impl( this ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ModifyHatchingHdl_Impl, void *, EMPTYARG ) -{ - const SfxPoolItem* pPoolItem = NULL; - sal_uInt16 _nPos = aLbHatching.GetSelectEntryPos(); - if( _nPos != LISTBOX_ENTRY_NOTFOUND ) - { - // ItemSet fuellen und an aCtlXRectPreview weiterleiten - XHatchEntry* pEntry = pHatchingList->GetHatch( _nPos ); - - rXFSet.Put( XFillStyleItem( XFILL_HATCH ) ); - rXFSet.Put( XFillHatchItem( String(), pEntry->GetHatch() ) ); - } - else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLHATCH ), sal_True, &pPoolItem ) ) - { - rXFSet.Put( XFillStyleItem( XFILL_HATCH ) ); - rXFSet.Put( XFillHatchItem( String(), ( ( const XFillHatchItem* ) pPoolItem )->GetHatchValue() ) ); - } - else - rXFSet.Put( XFillStyleItem( XFILL_NONE ) ); - - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlXRectPreview.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl, void *, EMPTYARG ) -{ - const SfxPoolItem* pPoolItem = NULL; - sal_uInt16 _nPos = aLbHatchBckgrdColor.GetSelectEntryPos(); - aLbColor.SelectEntryPos( _nPos ); - if( _nPos != LISTBOX_ENTRY_NOTFOUND ) - { - rXFSet.Put( XFillColorItem( String(), - aLbHatchBckgrdColor.GetSelectEntryColor() ) ); - } - else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), sal_True, &pPoolItem ) ) - { - Color aColor( ( ( const XFillColorItem* ) pPoolItem )->GetColorValue() ); - rXFSet.Put( XFillColorItem( String(), aColor ) ); - } - else - rXFSet.Put( XFillStyleItem( XFILL_NONE ) ); - - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlXRectPreview.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ToggleHatchBckgrdColorHdl_Impl, void *, EMPTYARG ) -{ - // switch on/off backgroundcolor for hatches - aLbHatchBckgrdColor.Enable( aCbxHatchBckgrd.IsChecked() ); - - XFillBackgroundItem aItem( aCbxHatchBckgrd.IsChecked() ); - rXFSet.Put ( aItem, XATTR_FILLBACKGROUND ); - - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlXRectPreview.Invalidate(); - - if( aLbHatchBckgrdColor.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND ) - { - if ( SFX_ITEM_SET == rOutAttrs.GetItemState( XATTR_FILLCOLOR ) )//>= SFX_ITEM_DEFAULT ) - { - XFillColorItem aColorItem( (const XFillColorItem&)rOutAttrs.Get( XATTR_FILLCOLOR ) ); - aLbHatchBckgrdColor.SelectEntry( aColorItem.GetColorValue() ); - } - } - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ClickBitmapHdl_Impl, void *, EMPTYARG ) -{ - aLbColor.Hide(); - aLbGradient.Hide(); - aLbHatching.Hide(); - aLbBitmap.Enable(); - aLbBitmap.Show(); - aCtlBitmapPreview.Enable(); - aCtlBitmapPreview.Show(); - aCtlXRectPreview.Hide(); - aFlStepCount.Hide(); - aTsbStepCount.Hide(); - aNumFldStepCount.Hide(); - - aTsbTile.Enable(); - aTsbStretch.Enable(); - aTsbScale.Enable(); - aTsbOriginal.Enable(); - aFtXSize.Enable(); - aMtrFldXSize.Enable(); - aFtYSize.Enable(); - aMtrFldYSize.Enable(); - aFlSize.Enable(); - aCtlPosition.Enable(); - aFtXOffset.Enable(); - aMtrFldXOffset.Enable(); - aFtYOffset.Enable(); - aMtrFldYOffset.Enable(); - aFlPosition.Enable(); - aRbtRow.Enable(); - aRbtColumn.Enable(); - aMtrFldOffset.Enable(); - aFlOffset.Enable(); - - // Controls for Hatch-Background - aCbxHatchBckgrd.Hide(); - aLbHatchBckgrdColor.Hide(); - - aTsbTile.Show(); - aTsbStretch.Show(); - aTsbScale.Show(); - aTsbOriginal.Show(); - aFtXSize.Show(); - aMtrFldXSize.Show(); - aFtYSize.Show(); - aMtrFldYSize.Show(); - aFlSize.Show(); - aCtlPosition.Show(); - aFtXOffset.Show(); - aMtrFldXOffset.Show(); - aFtYOffset.Show(); - aMtrFldYOffset.Show(); - aFlPosition.Show(); - aRbtRow.Show(); - aRbtColumn.Show(); - aMtrFldOffset.Show(); - aFlOffset.Show(); - - // Text der Tabelle setzen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - INetURLObject aURL( pBitmapList->GetPath() ); - - aURL.Append( pBitmapList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - ModifyBitmapHdl_Impl( this ); - ModifyTileHdl_Impl( &aTsbOriginal ); - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ModifyBitmapHdl_Impl, void *, EMPTYARG ) -{ - const SfxPoolItem* pPoolItem = NULL; - sal_uInt16 _nPos = aLbBitmap.GetSelectEntryPos(); - if( _nPos != LISTBOX_ENTRY_NOTFOUND ) - { - // ItemSet fuellen und an aCtlXRectPreview weiterleiten - XBitmapEntry* pEntry = pBitmapList->GetBitmap( _nPos ); - - rXFSet.Put( XFillStyleItem( XFILL_BITMAP ) ); - rXFSet.Put( XFillBitmapItem( String(), pEntry->GetXBitmap() ) ); - } - else if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), sal_True, &pPoolItem ) ) - { - rXFSet.Put( XFillStyleItem( XFILL_BITMAP ) ); - rXFSet.Put( XFillBitmapItem( String(), ( ( const XFillBitmapItem* ) pPoolItem )->GetBitmapValue() ) ); - } - else - rXFSet.Put( XFillStyleItem( XFILL_NONE ) ); - - aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlBitmapPreview.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ModifyStepCountHdl_Impl, void *, p ) -{ - if( p == &aTsbStepCount ) - { - if( aTsbStepCount.GetState() == STATE_NOCHECK ) - { - if( aNumFldStepCount.GetText().Len() == 0 ) - aNumFldStepCount.SetText( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "64") )); - - aNumFldStepCount.Enable(); - } - else - aNumFldStepCount.Disable(); - } - - sal_uInt16 nValue = 0; - if( aTsbStepCount.GetState() != STATE_CHECK ) - { - // Zustand != Disabled ? - if( aNumFldStepCount.GetText().Len() > 0 ) - nValue = (sal_uInt16) aNumFldStepCount.GetValue(); - } - rXFSet.Put( XGradientStepCountItem( nValue ) ); - aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlXRectPreview.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ModifyTileHdl_Impl, void *, EMPTYARG ) -{ - TriState eState = aTsbTile.GetState(); - if( eState == STATE_CHECK ) - { - aTsbStretch.Disable(); - aRbtRow.Enable(); - aRbtColumn.Enable(); - aMtrFldOffset.Enable(); - aFlOffset.Enable(); - - aCtlPosition.Enable(); - aCtlPosition.Invalidate(); - aFtXOffset.Enable(); - aMtrFldXOffset.Enable(); - aFtYOffset.Enable(); - aMtrFldYOffset.Enable(); - aFlPosition.Enable(); - - aTsbScale.Enable(); - aTsbOriginal.Enable(); - aFtXSize.Enable(); - aMtrFldXSize.Enable(); - aFtYSize.Enable(); - aMtrFldYSize.Enable(); - aFlSize.Enable(); - } - else if( eState == STATE_NOCHECK ) - { - aTsbStretch.Enable(); - aRbtRow.Disable(); - aRbtColumn.Disable(); - aMtrFldOffset.Disable(); - aFlOffset.Disable(); - - aCtlPosition.Disable(); - aCtlPosition.Invalidate(); - aFtXOffset.Disable(); - aMtrFldXOffset.Disable(); - aFtYOffset.Disable(); - aMtrFldYOffset.Disable(); - aFlPosition.Disable(); - - if( aTsbStretch.GetState() != STATE_NOCHECK ) - { - aTsbScale.Disable(); - aTsbOriginal.Disable(); - aFtXSize.Disable(); - aMtrFldXSize.Disable(); - aFtYSize.Disable(); - aMtrFldYSize.Disable(); - aFlSize.Disable(); - } - else - { - aTsbScale.Enable(); - aTsbOriginal.Enable(); - aFtXSize.Enable(); - aMtrFldXSize.Enable(); - aFtYSize.Enable(); - aMtrFldYSize.Enable(); - aFlSize.Enable(); - } - } - else - { - aTsbStretch.Disable(); - aRbtRow.Disable(); - aRbtColumn.Disable(); - aMtrFldOffset.Disable(); - aFlOffset.Disable(); - - aCtlPosition.Disable(); - aCtlPosition.Invalidate(); - aFtXOffset.Disable(); - aMtrFldXOffset.Disable(); - aFtYOffset.Disable(); - aMtrFldYOffset.Disable(); - aFlPosition.Disable(); - - aTsbScale.Disable(); - aTsbOriginal.Disable(); - aFtXSize.Disable(); - aMtrFldXSize.Disable(); - aFtYSize.Disable(); - aMtrFldYSize.Disable(); - aFlSize.Disable(); - } - - if( aTsbOriginal.GetState() == STATE_CHECK ) - { - aMtrFldXSize.SetText( String() ); - aMtrFldYSize.SetText( String() ); - aFtXSize.Disable(); - aFtYSize.Disable(); - aMtrFldXSize.Disable(); - aMtrFldYSize.Disable(); - aTsbScale.Disable(); - } - else - { - aMtrFldXSize.SetValue( aMtrFldXSize.GetValue() ); - aMtrFldYSize.SetValue( aMtrFldYSize.GetValue() ); - } - - rXFSet.Put( XFillBmpTileItem( sal::static_int_cast< sal_Bool >( eState ) ) ); - - if( aTsbStretch.IsEnabled() ) - rXFSet.Put( - XFillBmpStretchItem( - sal::static_int_cast< sal_Bool >( aTsbStretch.GetState() ) ) ); - - if( aTsbScale.IsEnabled() ) - rXFSet.Put( XFillBmpSizeLogItem( aTsbScale.GetState() == STATE_NOCHECK ) ); - - if( aMtrFldXSize.IsEnabled() ) - { - XFillBmpSizeXItem* pItem = NULL; - TriState eScaleState = aTsbScale.GetState(); - - if( eScaleState == STATE_NOCHECK ) - pItem = new XFillBmpSizeXItem( GetCoreValue( aMtrFldXSize, ePoolUnit ) ); - else - pItem = new XFillBmpSizeXItem( -labs( static_cast<long>(aMtrFldXSize.GetValue()) ) ); - - rXFSet.Put( *pItem ); - - delete pItem; - } - else if( aTsbOriginal.IsEnabled() && aTsbOriginal.GetState() == STATE_CHECK ) - { - // Originalgroesse -> Size == 0 - rXFSet.Put( XFillBmpSizeXItem( 0 ) ); - rXFSet.Put( XFillBmpSizeLogItem( sal_True ) ); - } - - if( aMtrFldYSize.IsEnabled() ) - { - XFillBmpSizeYItem* pItem = NULL; - TriState eScaleState = aTsbScale.GetState(); - - if( eScaleState == STATE_NOCHECK ) - pItem = new XFillBmpSizeYItem( GetCoreValue( aMtrFldYSize, ePoolUnit ) ); - else - pItem = new XFillBmpSizeYItem( -labs( static_cast<long>(aMtrFldYSize.GetValue()) ) ); - - rXFSet.Put( *pItem ); - - delete pItem; - } - else if( aTsbOriginal.IsEnabled() && aTsbOriginal.GetState() == STATE_CHECK ) - { - // Originalgroesse -> Size == 0 - rXFSet.Put( XFillBmpSizeYItem( 0 ) ); - rXFSet.Put( XFillBmpSizeLogItem( sal_True ) ); - } - - if( aMtrFldOffset.IsEnabled() ) - { - if( aRbtRow.IsChecked() ) - { - rXFSet.Put( XFillBmpTileOffsetXItem( (sal_uInt16) aMtrFldOffset.GetValue() ) ); - rXFSet.Put( XFillBmpTileOffsetYItem( (sal_uInt16) 0 ) ); - } - else if( aRbtColumn.IsChecked() ) - { - rXFSet.Put( XFillBmpTileOffsetXItem( (sal_uInt16) 0 ) ); - rXFSet.Put( XFillBmpTileOffsetYItem( (sal_uInt16) aMtrFldOffset.GetValue() ) ); - } - } - - if( aCtlPosition.IsEnabled() ) - rXFSet.Put( XFillBmpPosItem( aCtlPosition.GetActualRP() ) ); - - if( aMtrFldXOffset.IsEnabled() ) - rXFSet.Put( XFillBmpPosOffsetXItem( (sal_uInt16) aMtrFldXOffset.GetValue() ) ); - - if( aMtrFldYOffset.IsEnabled() ) - rXFSet.Put( XFillBmpPosOffsetYItem( (sal_uInt16) aMtrFldYOffset.GetValue() ) ); - - - aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlBitmapPreview.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAreaTabPage, ClickScaleHdl_Impl, void *, EMPTYARG ) -{ - if( aTsbScale.GetState() == STATE_CHECK ) - { - aMtrFldXSize.SetDecimalDigits( 0 ); - aMtrFldXSize.SetUnit( FUNIT_CUSTOM ); - aMtrFldXSize.SetValue( 100 ); - aMtrFldXSize.SetMax( 100 ); - aMtrFldXSize.SetLast( 100 ); - - aMtrFldYSize.SetDecimalDigits( 0 ); - aMtrFldYSize.SetUnit( FUNIT_CUSTOM ); - aMtrFldYSize.SetValue( 100 ); - aMtrFldYSize.SetMax( 100 ); - aMtrFldYSize.SetLast( 100 ); - } - else - { - aMtrFldXSize.SetDecimalDigits( 2 ); - aMtrFldXSize.SetUnit( eFUnit ); - aMtrFldXSize.SetValue( 100 ); - aMtrFldXSize.SetMax( 999900 ); - aMtrFldXSize.SetLast( 100000 ); - - aMtrFldYSize.SetDecimalDigits( 2 ); - aMtrFldYSize.SetUnit( eFUnit ); - aMtrFldYSize.SetValue( 100 ); - aMtrFldYSize.SetMax( 999900 ); - aMtrFldYSize.SetLast( 100000 ); - } - - ModifyTileHdl_Impl( NULL ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -void SvxAreaTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt ) -{ - eRP = eRcPt; - - // Ausrichtung der Bitmapfuellung - ModifyTileHdl_Impl( pWindow ); -} - -void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False); - SFX_ITEMSET_ARG (&aSet,pGradientListItem,SvxGradientListItem,SID_GRADIENT_LIST,sal_False); - SFX_ITEMSET_ARG (&aSet,pHatchingListItem,SvxHatchListItem,SID_HATCH_LIST,sal_False); - SFX_ITEMSET_ARG (&aSet,pBitmapListItem,SvxBitmapListItem,SID_BITMAP_LIST,sal_False); - SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False); - SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False); - SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False); - - if (pColorTabItem) - SetColorTable(pColorTabItem->GetColorTable()); - if (pGradientListItem) - SetGradientList(pGradientListItem->GetGradientList()); - if (pHatchingListItem) - SetHatchingList(pHatchingListItem->GetHatchList()); - if (pBitmapListItem) - SetBitmapList(pBitmapListItem->GetBitmapList()); - if (pPageTypeItem) - SetPageType(pPageTypeItem->GetValue()); - if (pDlgTypeItem) - SetDlgType(pDlgTypeItem->GetValue()); - if (pPosItem) - SetPos(pPosItem->GetValue()); - Construct(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx deleted file mode 100644 index 34a9499c8..000000000 --- a/cui/source/tabpages/tpbitmap.cxx +++ /dev/null @@ -1,1150 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -//svdraw.hxx -#define _SVDRAW_HXX -#define _SDR_NOITEMS -#define _SDR_NOTOUCH -#define _SDR_NOTRANSFORM -#define _SDR_NOOBJECTS -#define _SDR_NOVIEWS -#define _SDR_NOVIEWMARKER -#define _SDR_NODRAGMETHODS -#define _SDR_NOUNDO -#define _SDR_NOXOUTDEV -#include <vcl/wrkwin.hxx> -#include <tools/shl.hxx> -#include <vcl/msgbox.hxx> -#include <tools/urlobj.hxx> -#include <unotools/ucbstreamhelper.hxx> -#include <unotools/pathoptions.hxx> -#include <sfx2/app.hxx> -#include <sfx2/filedlghelper.hxx> -#include <unotools/localfilehelper.hxx> -#include "com/sun/star/ui/dialogs/TemplateDescription.hpp" -#include <svx/dialmgr.hxx> -#include <vcl/bmpacc.hxx> -#include <svx/dialogs.hrc> - -#define _SVX_TPBITMAP_CXX - -#include <cuires.hrc> -#include "helpid.hrc" -#include "svx/xattr.hxx" -#include <svx/xpool.hxx> -#include <svx/xtable.hxx> -#include "svx/xoutbmp.hxx" -#include "svx/drawitem.hxx" -#include "cuitabarea.hxx" -#include "tabarea.hrc" -#include "defdlgname.hxx" -#include <svx/svxdlg.hxx> -#include <dialmgr.hxx> -#include "sfx2/opengrf.hxx" -#include "paragrph.hrc" - -#define DLGWIN this->GetParent()->GetParent() - -/************************************************************************* -|* -|* Dialog zum Aendern und Definieren der Bitmaps -|* -\************************************************************************/ - -SvxBitmapTabPage::SvxBitmapTabPage -( - Window* pParent, - const SfxItemSet& rInAttrs -) : - - SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_BITMAP ), rInAttrs ), - - aCtlPixel ( this, CUI_RES( CTL_PIXEL ) ), - aFtPixelEdit ( this, CUI_RES( FT_PIXEL_EDIT ) ), - aFtColor ( this, CUI_RES( FT_COLOR ) ), - aLbColor ( this, CUI_RES( LB_COLOR ) ), - aFtBackgroundColor ( this, CUI_RES( FT_BACKGROUND_COLOR ) ), - aLbBackgroundColor ( this, CUI_RES( LB_BACKGROUND_COLOR ) ), - // This fix text is used only to provide the name for the following - // bitmap list box. The fixed text is not displayed. - aLbBitmapsHidden ( this, CUI_RES( FT_BITMAPS_HIDDEN ) ), - aLbBitmaps ( this, CUI_RES( LB_BITMAPS ) ), - aFlProp ( this, CUI_RES( FL_PROP ) ), - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ), - aBtnAdd ( this, CUI_RES( BTN_ADD ) ), - aBtnModify ( this, CUI_RES( BTN_MODIFY ) ), - aBtnImport ( this, CUI_RES( BTN_IMPORT ) ), - aBtnDelete ( this, CUI_RES( BTN_DELETE ) ), - aBtnLoad ( this, CUI_RES( BTN_LOAD ) ), - aBtnSave ( this, CUI_RES( BTN_SAVE ) ), - - aBitmapCtl ( this, aCtlPreview.GetSizePixel() ), - rOutAttrs ( rInAttrs ), - - pColorTab( NULL ), - pBitmapList( NULL ), - - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXFStyleItem ( XFILL_BITMAP ), - aXBitmapItem ( String(), XOBitmap() ), - aXFillAttr ( pXPool ), - rXFSet ( aXFillAttr.GetItemSet() ) -{ - FreeResource(); - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - // Setzen des Output-Devices - rXFSet.Put( aXFStyleItem ); - rXFSet.Put( aXBitmapItem ); - - aBtnAdd.SetClickHdl( LINK( this, SvxBitmapTabPage, ClickAddHdl_Impl ) ); - aBtnImport.SetClickHdl( - LINK( this, SvxBitmapTabPage, ClickImportHdl_Impl ) ); - aBtnModify.SetClickHdl( - LINK( this, SvxBitmapTabPage, ClickModifyHdl_Impl ) ); - aBtnDelete.SetClickHdl( - LINK( this, SvxBitmapTabPage, ClickDeleteHdl_Impl ) ); - aBtnLoad.SetClickHdl( LINK( this, SvxBitmapTabPage, ClickLoadHdl_Impl ) ); - aBtnSave.SetClickHdl( LINK( this, SvxBitmapTabPage, ClickSaveHdl_Impl ) ); - - aLbBitmaps.SetSelectHdl( - LINK( this, SvxBitmapTabPage, ChangeBitmapHdl_Impl ) ); - aLbColor.SetSelectHdl( - LINK( this, SvxBitmapTabPage, ChangePixelColorHdl_Impl ) ); - aLbBackgroundColor.SetSelectHdl( - LINK( this, SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl ) ); - - String accName = String(SVX_RES(STR_EXAMPLE)); - aCtlPreview.SetAccessibleName(accName); - aCtlPixel.SetAccessibleRelationMemberOf( &aFlProp ); - aCtlPixel.SetAccessibleRelationLabeledBy( &aFtPixelEdit ); - aLbBitmaps.SetAccessibleRelationLabeledBy(&aLbBitmaps); - aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnModify.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnImport.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp ); - -} - -// ----------------------------------------------------------------------- - -void SvxBitmapTabPage::Construct() -{ - // Farbtabellen - aLbColor.Fill( pColorTab ); - aLbBackgroundColor.CopyEntries( aLbColor ); - - // Bitmaptabelle - aLbBitmaps.Fill( pBitmapList ); -} - -// ----------------------------------------------------------------------- - -void SvxBitmapTabPage::ActivatePage( const SfxItemSet& ) -{ - sal_uInt16 nPos; - sal_uInt16 nCount; - - if( *pDlgType == 0 ) // Flaechen-Dialog - { - *pbAreaTP = sal_False; - - if( pColorTab ) - { - // ColorTable - if( *pnColorTableState & CT_CHANGED || - *pnColorTableState & CT_MODIFIED ) - { - if( *pnColorTableState & CT_CHANGED ) - pColorTab = ( (SvxAreaTabDialog*) DLGWIN )->GetNewColorTable(); - - // LbColor - nPos = aLbColor.GetSelectEntryPos(); - aLbColor.Clear(); - aLbColor.Fill( pColorTab ); - nCount = aLbColor.GetEntryCount(); - if( nCount == 0 ) - ; // Dieser Fall sollte nicht auftreten - else if( nCount <= nPos ) - aLbColor.SelectEntryPos( 0 ); - else - aLbColor.SelectEntryPos( nPos ); - - // LbColorBackground - nPos = aLbBackgroundColor.GetSelectEntryPos(); - aLbBackgroundColor.Clear(); - aLbBackgroundColor.CopyEntries( aLbColor ); - nCount = aLbBackgroundColor.GetEntryCount(); - if( nCount == 0 ) - ; // Dieser Fall sollte nicht auftreten - else if( nCount <= nPos ) - aLbBackgroundColor.SelectEntryPos( 0 ); - else - aLbBackgroundColor.SelectEntryPos( nPos ); - - ChangePixelColorHdl_Impl( this ); - ChangeBackgrndColorHdl_Impl( this ); - } - - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - INetURLObject aURL( pBitmapList->GetPath() ); - - aURL.Append( pBitmapList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - if( *pPageType == PT_BITMAP && *pPos != LISTBOX_ENTRY_NOTFOUND ) - { - aLbBitmaps.SelectEntryPos( *pPos ); - } - // Farben koennten geloescht worden sein - ChangeBitmapHdl_Impl( this ); - - *pPageType = PT_BITMAP; - *pPos = LISTBOX_ENTRY_NOTFOUND; - } - } -} - -// ----------------------------------------------------------------------- - -int SvxBitmapTabPage::DeactivatePage( SfxItemSet* _pSet) -{ - if ( CheckChanges_Impl() == -1L ) - return KEEP_PAGE; - - if( _pSet ) - FillItemSet( *_pSet ); - - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxBitmapTabPage::FillItemSet( SfxItemSet& _rOutAttrs ) -{ - if( *pDlgType == 0 && *pbAreaTP == sal_False ) // Flaechen-Dialog - { - if( *pPageType == PT_BITMAP ) - { - // CheckChanges_Impl(); <-- doppelte Abfrage ? - - XOBitmap aXOBitmap; - String aString; - sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - aXOBitmap = pBitmapList->GetBitmap( nPos )->GetXBitmap(); - aString = aLbBitmaps.GetSelectEntry(); - - } - else - { - aXOBitmap = aBitmapCtl.GetXBitmap(); - - // #85339# if it's an array, force conversion to bitmap before using it. - if(aXOBitmap.GetBitmapType() == XBITMAP_8X8) - aXOBitmap.GetBitmap(); - - } - _rOutAttrs.Put( XFillStyleItem( XFILL_BITMAP ) ); - _rOutAttrs.Put( XFillBitmapItem( aString, aXOBitmap ) ); - } - } - return sal_True; -} - -// ----------------------------------------------------------------------- - -void SvxBitmapTabPage::Reset( const SfxItemSet& ) -{ - // aLbBitmaps.SelectEntryPos( 0 ); - - aBitmapCtl.SetLines( aCtlPixel.GetLineCount() ); - aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() ); - aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() ); - aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() ); - - // Bitmap holen und darstellen - XFillBitmapItem aBmpItem( (const String &) String(), aBitmapCtl.GetXBitmap() ); - rXFSet.Put( aBmpItem ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreview.Invalidate(); - - ChangeBitmapHdl_Impl( this ); - - // Status der Buttons ermitteln - if( pBitmapList->Count() ) - { - aBtnAdd.Enable(); - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxBitmapTabPage::Create( Window* pWindow, - const SfxItemSet& rSet ) -{ - return new SvxBitmapTabPage( pWindow, rSet ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBitmapTabPage, ChangeBitmapHdl_Impl, void *, EMPTYARG ) -{ - XOBitmap* pXOBitmap = NULL; - int nPos = aLbBitmaps.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - pXOBitmap = new XOBitmap( ( (XBitmapEntry*) pBitmapList->GetBitmap( nPos ) )->GetXBitmap() ); - else - { - const SfxPoolItem* pPoolItem = NULL; - if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLSTYLE ), sal_True, &pPoolItem ) ) - { - XFillStyle eXFS = (XFillStyle) ( ( const XFillStyleItem* ) pPoolItem )->GetValue(); - if( ( XFILL_BITMAP == eXFS ) && - ( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), sal_True, &pPoolItem ) ) ) - { - pXOBitmap = new XOBitmap( ( ( const XFillBitmapItem* ) pPoolItem )->GetBitmapValue() ); - } - } - if( !pXOBitmap ) - { - aLbBitmaps.SelectEntryPos( 0 ); - nPos = aLbBitmaps.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - pXOBitmap = new XOBitmap( ( (XBitmapEntry*) pBitmapList->GetBitmap( nPos ) )->GetXBitmap() ); - } - } - if( pXOBitmap ) - { - // #85339# try to convert bitmapped item to array item. - if(pXOBitmap->GetBitmapType() == XBITMAP_IMPORT) - { - Bitmap aBitmap(pXOBitmap->GetBitmap()); - Size aSizePixel(aBitmap.GetSizePixel()); - - if(8 == aSizePixel.Width() && 8 == aSizePixel.Height()) - { - sal_uInt16* pPixelArray = new sal_uInt16[64]; - sal_uInt32 nCol1(0xffffffff); // background - sal_uInt32 nCol2(0xffffffff); // pixel - BitmapReadAccess* pAccess = aBitmap.AcquireReadAccess(); - sal_Bool bValid(sal_True); - - if(pAccess) - { - for(sal_uInt32 a(0); bValid && a < 64; a++) - { - const BitmapColor aBmCol = pAccess->GetColor(a>>3, a%8); - Color aRgbCol(aBmCol.GetRed(), aBmCol.GetGreen(), aBmCol.GetBlue()); - sal_uInt32 nColVal = aRgbCol.GetRGBColor(); - - // test with nCol1 - if(nCol1 != nColVal) - { - if(0xffffffff == nCol1) - { - // nCol1 is used first time - nCol1 = nColVal; - pPixelArray[a] = 0; - } - else - { - // test with nCol2 - if(nCol2 != nColVal) - { - if(0xffffffff == nCol2) - { - // nCol2 used first time - nCol2 = nColVal; - pPixelArray[a] = 1; - } - else - { - // Third color detected - bValid = sal_False; - } - } - else - { - // color is pixel color - pPixelArray[a] = 1; - } - } - } - else - { - // color is background color - pPixelArray[a] = 0; - } - } - - // release ReadAccess - aBitmap.ReleaseAccess(pAccess); - } - else - { - // no access -> no success - bValid = sal_False; - } - - if(bValid) - { - Color aCol1(nCol1); - Color aCol2(nCol2); - - // no pixel color found? Use opposite od background color. - if(0xffffffff == nCol2) - { - aCol2 = Color( - 0xff - aCol1.GetRed(), - 0xff - aCol1.GetGreen(), - 0xff - aCol1.GetBlue()); - } - - // transformation did work, create a new Item - delete pXOBitmap; - pXOBitmap = new XOBitmap(pPixelArray, aCol2, aCol1); - } - - // cleanup - delete[] pPixelArray; - } - } - - aLbColor.SetNoSelection(); - aLbBackgroundColor.SetNoSelection(); - - if( pXOBitmap->GetBitmapType() == XBITMAP_IMPORT ) - { - aCtlPixel.Reset(); - aCtlPixel.SetPaintable( sal_False ); - aCtlPixel.Disable(); - aFtPixelEdit.Disable(); - aFtColor.Disable(); - aLbColor.Disable(); - aFtBackgroundColor.Disable(); - aLbBackgroundColor.Disable(); - aBtnModify.Disable(); - aBtnAdd.Disable(); - } - else if( pXOBitmap->GetBitmapType() == XBITMAP_8X8 ) - { - aCtlPixel.SetPaintable( sal_True ); - aCtlPixel.Enable(); - aFtPixelEdit.Enable(); - aFtColor.Enable(); - aLbColor.Enable(); - aFtBackgroundColor.Enable(); - aLbBackgroundColor.Enable(); - aBtnModify.Enable(); - aBtnAdd.Enable(); - - // Setzen des PixelControls - aCtlPixel.SetXBitmap( *pXOBitmap ); - - Color aPixelColor = pXOBitmap->GetPixelColor(); - Color aBackColor = pXOBitmap->GetBackgroundColor(); - - aBitmapCtl.SetPixelColor( aPixelColor ); - aBitmapCtl.SetBackgroundColor( aBackColor ); - - // Wenn der Eintrag nicht in der Listbox ist, wird die Farbe - // temporaer hinzugenommen - if( 0 == aLbBitmaps.GetSelectEntryPos() ) - { - aLbColor.SelectEntry( Color( COL_BLACK ) ); - ChangePixelColorHdl_Impl( this ); - } - else - aLbColor.SelectEntry( aPixelColor ); - if( aLbColor.GetSelectEntryCount() == 0 ) - { - aLbColor.InsertEntry( aPixelColor, String() ); - aLbColor.SelectEntry( aPixelColor ); - } - aLbBackgroundColor.SelectEntry( aBackColor ); - if( aLbBackgroundColor.GetSelectEntryCount() == 0 ) - { - aLbBackgroundColor.InsertEntry( aBackColor, String() ); - aLbBackgroundColor.SelectEntry( aBackColor ); - } - } - aCtlPixel.Invalidate(); - - // Bitmap darstellen - XFillBitmapItem aXBmpItem( (const String &) String(), *pXOBitmap ); - rXFSet.Put( aXBmpItem ); - - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreview.Invalidate(); - - bBmpChanged = sal_False; - delete pXOBitmap; - } - return 0L; -} - -// ----------------------------------------------------------------------- - -long SvxBitmapTabPage::CheckChanges_Impl() -{ - sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - String aString = aLbBitmaps.GetSelectEntry(); - - if( bBmpChanged ) - { - ResMgr& rMgr = CUI_MGR(); - Image aWarningBoxImage = WarningBox::GetStandardImage(); - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX, - String( SVX_RES( RID_SVXSTR_BITMAP ) ), - String( CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ) ), - &aWarningBoxImage ); - DBG_ASSERT(aMessDlg, "Dialogdiet fail!"); - aMessDlg->SetButtonText( MESS_BTN_1, - String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) ); - aMessDlg->SetButtonText( MESS_BTN_2, - String( ResId( RID_SVXSTR_ADD, rMgr ) ) ); - - short nRet = aMessDlg->Execute(); - - switch( nRet ) - { - case RET_BTN_1: // Aendern - { - ClickModifyHdl_Impl( this ); - } - break; - - case RET_BTN_2: // Hinzufuegen - { - ClickAddHdl_Impl( this ); - nPos = aLbBitmaps.GetSelectEntryPos(); - } - break; - - case RET_CANCEL: - break; - } - delete aMessDlg; - } - } - nPos = aLbBitmaps.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - *pPos = nPos; - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBitmapTabPage, ClickAddHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_BITMAP ) ); - String aDesc( CUI_RES( RID_SVXSTR_DESC_NEW_BITMAP ) ); - String aName; - - long nCount = pBitmapList->Count(); - long j = 1; - sal_Bool bDifferent = sal_False; - - while( !bDifferent ) - { - aName = aNewName; - aName += sal_Unicode(' '); - aName += UniString::CreateFromInt32( j++ ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == pBitmapList->GetBitmap( i )->GetName() ) - bDifferent = sal_False; - } - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - WarningBox* pWarnBox = NULL; - sal_uInt16 nError = RID_SVXSTR_WARN_NAME_DUPLICATE; - - while( pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == pBitmapList->GetBitmap( i )->GetName() ) - bDifferent = sal_False; - - if( bDifferent ) { - nError = 0; - break; - } - - if( !pWarnBox ) - { - pWarnBox = new WarningBox( DLGWIN, - WinBits( WB_OK_CANCEL ), - String( ResId( nError, rMgr ) ) ); - pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE ); - } - - if( pWarnBox->Execute() != RET_OK ) - break; - } - delete pDlg; - delete pWarnBox; - - if( !nError ) - { - XBitmapEntry* pEntry = 0; - if( aCtlPixel.IsEnabled() ) - { - XOBitmap aXOBitmap = aBitmapCtl.GetXBitmap(); - - // #85339# if it's an array, force conversion to bitmap before using it. - if(aXOBitmap.GetBitmapType() == XBITMAP_8X8) - aXOBitmap.GetBitmap(); - - pEntry = new XBitmapEntry( aXOBitmap, aName ); - } - else // Es muss sich um eine nicht vorhandene importierte Bitmap handeln - { - const SfxPoolItem* pPoolItem = NULL; - if( SFX_ITEM_SET == rOutAttrs.GetItemState( XATTR_FILLBITMAP, sal_True, &pPoolItem ) ) - { - XOBitmap aXOBitmap( ( ( const XFillBitmapItem* ) pPoolItem )->GetBitmapValue() ); - pEntry = new XBitmapEntry( aXOBitmap, aName ); - } - } - - DBG_ASSERT( pEntry, "SvxBitmapTabPage::ClickAddHdl_Impl(), pEntry == 0 ?" ); - - if( pEntry ) - { - pBitmapList->Insert( pEntry ); - - aLbBitmaps.Append( pEntry ); - aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 ); - -#ifdef WNT - // hack: #31355# W.P. - Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() ); - if( sal_True ) { // ??? overlapped with pDlg - // and srolling - Invalidate( aRect ); - //aLbBitmaps.Invalidate(); - } -#endif - - // Flag fuer modifiziert setzen - *pnBitmapListState |= CT_MODIFIED; - - ChangeBitmapHdl_Impl( this ); - } - } - - // Status der Buttons ermitteln - if( pBitmapList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - return 0L; -} - - -/******************************************************************************/ -/******************************************************************************/ - - -//------------------------------------------------------------------------ - -#ifdef _MSC_VER -#pragma optimize ( "", off ) -#endif - -IMPL_LINK( SvxBitmapTabPage, ClickImportHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - SvxOpenGraphicDialog aDlg( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "Import" ) ) ); - aDlg.EnableLink(sal_False); - - if( !aDlg.Execute() ) - { - Graphic aGraphic; - int nError = 1; - - EnterWait(); - nError = aDlg.GetGraphic( aGraphic ); - LeaveWait(); - - if( !nError ) - { - String aDesc( ResId(RID_SVXSTR_DESC_EXT_BITMAP, rMgr) ); - WarningBox* pWarnBox = NULL; - - // convert file URL to UI name - String aName; - INetURLObject aURL( aDlg.GetPath() ); - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, String(aURL.GetName()).GetToken( 0, '.' ), aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - nError = RID_SVXSTR_WARN_NAME_DUPLICATE; - - while( pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - - sal_Bool bDifferent = sal_True; - long nCount = pBitmapList->Count(); - - for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == pBitmapList->GetBitmap( i )->GetName() ) - bDifferent = sal_False; - - if( bDifferent ) { - nError = 0; - break; - } - - if( !pWarnBox ) - { - pWarnBox = new WarningBox( DLGWIN, - WinBits( WB_OK_CANCEL ), - String( ResId( nError, rMgr ) ) ); - pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE ); - } - - - if( pWarnBox->Execute() != RET_OK ) - break; - } - delete pDlg; - delete pWarnBox; - - if( !nError ) - { - Bitmap aBmp( aGraphic.GetBitmap() ); - XBitmapEntry* pEntry = - new XBitmapEntry( XOBitmap( aBmp ), aName ); - pBitmapList->Insert( pEntry ); - - aLbBitmaps.Append( pEntry ); - aLbBitmaps.SelectEntryPos( aLbBitmaps.GetEntryCount() - 1 ); - -#ifdef WNT - // hack: #31355# W.P. - Rectangle aRect( aLbBitmaps.GetPosPixel(), aLbBitmaps.GetSizePixel() ); - if( sal_True ) { // ??? overlapped with pDlg - // and srolling - Invalidate( aRect ); - } -#endif - - // Flag fuer modifiziert setzen - *pnBitmapListState |= CT_MODIFIED; - - ChangeBitmapHdl_Impl( this ); - } - } - else - // Graphik konnte nicht geladen werden - ErrorBox( DLGWIN, - WinBits( WB_OK ), - String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute(); - } - - return 0L; -} - -#ifdef _MSC_VER -#pragma optimize ( "", on ) -#endif - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBitmapTabPage, ClickModifyHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos(); - - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_BITMAP ) ); - String aDesc( ResId( RID_SVXSTR_DESC_NEW_BITMAP, rMgr ) ); - String aName( pBitmapList->GetBitmap( nPos )->GetName() ); - String aOldName = aName; - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - - long nCount = pBitmapList->Count(); - sal_Bool bDifferent = sal_False; - sal_Bool bLoop = sal_True; - - while( bLoop && pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - { - if( aName == pBitmapList->GetBitmap( i )->GetName() && - aName != aOldName ) - bDifferent = sal_False; - } - - if( bDifferent ) - { - bLoop = sal_False; - XBitmapEntry* pEntry = pBitmapList->GetBitmap( nPos ); - - pEntry->SetName( aName ); - - XOBitmap aXOBitmap = aBitmapCtl.GetXBitmap(); - - // #85339# if it's an array, force conversion to bitmap before using it. - if(aXOBitmap.GetBitmapType() == XBITMAP_8X8) - aXOBitmap.GetBitmap(); - - pEntry->SetXBitmap( aXOBitmap ); - - aLbBitmaps.Modify( pEntry, nPos ); - aLbBitmaps.SelectEntryPos( nPos ); - - // Flag fuer modifiziert setzen - *pnBitmapListState |= CT_MODIFIED; - - bBmpChanged = sal_False; - } - else - { - WarningBox aBox( DLGWIN, WinBits( WB_OK ), String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); - aBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); - aBox.Execute(); - } - } - delete pDlg; - } - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBitmapTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbBitmaps.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ), - String( CUI_RES( RID_SVXSTR_ASK_DEL_BITMAP ) ) ); - - if( aQueryBox.Execute() == RET_YES ) - { - delete pBitmapList->Remove( nPos ); - aLbBitmaps.RemoveEntry( nPos ); - aLbBitmaps.SelectEntryPos( 0 ); - - aCtlPreview.Invalidate(); - aCtlPixel.Invalidate(); - - ChangeBitmapHdl_Impl( this ); - - // Flag fuer modifiziert setzen - *pnBitmapListState |= CT_MODIFIED; - } - } - // Status der Buttons ermitteln - if( !pBitmapList->Count() ) - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return 0L; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxBitmapTabPage, ClickLoadHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nReturn = RET_YES; - ResMgr& rMgr = CUI_MGR(); - - if ( *pnBitmapListState & CT_MODIFIED ) - { - nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ), - String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute(); - - if ( nReturn == RET_YES ) - pBitmapList->Save(); - } - - if ( nReturn != RET_CANCEL ) - { - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sob" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - - if ( aDlg.Execute() == ERRCODE_NONE ) - { - EnterWait(); - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - // Tabelle speichern - XBitmapList* pBmpList = new XBitmapList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool ); - pBmpList->SetName( aURL.getName() ); - if( pBmpList->Load() ) - { - // Pruefen, ob Tabelle geloescht werden darf: - if( pBitmapList != ( (SvxAreaTabDialog*) DLGWIN )->GetBitmapList() ) - delete pBitmapList; - - pBitmapList = pBmpList; - ( (SvxAreaTabDialog*) DLGWIN )->SetNewBitmapList( pBitmapList ); - - aLbBitmaps.Clear(); - aLbBitmaps.Fill( pBitmapList ); - Reset( rOutAttrs ); - - pBitmapList->SetName( aURL.getName() ); - - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( ResId( RID_SVXSTR_TABLE, rMgr ) ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - // Flag fuer gewechselt setzen - *pnBitmapListState |= CT_CHANGED; - // Flag fuer modifiziert entfernen - *pnBitmapListState &= ~CT_MODIFIED; - LeaveWait(); - } - else - { - LeaveWait(); - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute(); - } - } - } - - // Status der Buttons ermitteln - if( pBitmapList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return 0L; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxBitmapTabPage, ClickSaveHdl_Impl, void *, EMPTYARG ) -{ - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sob" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( pBitmapList->GetName().Len() ) - { - aFile.Append( pBitmapList->GetName() ); - - if( !aFile.getExtension().getLength() ) - aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "sob" ) ) ); - } - - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - if ( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - pBitmapList->SetName( aURL.getName() ); - pBitmapList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( pBitmapList->Save() ) - { - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - // Flag fuer gespeichert setzen - *pnBitmapListState |= CT_SAVED; - // Flag fuer modifiziert entfernen - *pnBitmapListState &= ~CT_MODIFIED; - } - else - { - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute(); - } - } - - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBitmapTabPage, ChangePixelColorHdl_Impl, void *, EMPTYARG ) -{ - aCtlPixel.SetPixelColor( aLbColor.GetSelectEntryColor() ); - aCtlPixel.Invalidate(); - - aBitmapCtl.SetPixelColor( aLbColor.GetSelectEntryColor() ); - - // Bitmap holen und darstellen - rXFSet.Put( XFillBitmapItem( String(), aBitmapCtl.GetXBitmap() ) ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreview.Invalidate(); - - bBmpChanged = sal_True; - - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl, void *, EMPTYARG ) -{ - aCtlPixel.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() ); - aCtlPixel.Invalidate(); - - aBitmapCtl.SetBackgroundColor( aLbBackgroundColor.GetSelectEntryColor() ); - - // Bitmap holen und darstellen - rXFSet.Put( XFillBitmapItem( String(), aBitmapCtl.GetXBitmap() ) ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreview.Invalidate(); - - bBmpChanged = sal_True; - - return 0L; -} - -//------------------------------------------------------------------------ - -void SvxBitmapTabPage::PointChanged( Window* pWindow, RECT_POINT ) -{ - if( pWindow == &aCtlPixel ) - { - aBitmapCtl.SetBmpArray( aCtlPixel.GetBitmapPixelPtr() ); - - // Bitmap holen und darstellen - rXFSet.Put( XFillBitmapItem( String(), aBitmapCtl.GetXBitmap() ) ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreview.Invalidate(); - - bBmpChanged = sal_True; - } -} - - - - -Window* SvxBitmapTabPage::GetParentLabeledBy( const Window* pLabeled ) const -{ - if (pLabeled == &aLbBitmaps) - return const_cast<FixedText*>(&aLbBitmapsHidden); - else - return SvxTabPage::GetParentLabeledBy (pLabeled); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx deleted file mode 100644 index 406e4985f..000000000 --- a/cui/source/tabpages/tpcolor.cxx +++ /dev/null @@ -1,1264 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <tools/shl.hxx> -#include <tools/urlobj.hxx> -#include <unotools/pathoptions.hxx> -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <svtools/colrdlg.hxx> -#include <vcl/msgbox.hxx> -#include <sfx2/filedlghelper.hxx> -#include "com/sun/star/ui/dialogs/TemplateDescription.hpp" - -#define _SVX_TPCOLOR_CXX - -#include <cuires.hrc> -#include "helpid.hrc" -#include "svx/xattr.hxx" -#include <svx/xpool.hxx> -#include <svx/xtable.hxx> -#include "svx/drawitem.hxx" -#include "cuitabarea.hxx" -#include "tabarea.hrc" -#include "defdlgname.hxx" -#include <svx/svxdlg.hxx> -#include <dialmgr.hxx> -#include <cuitabline.hxx> -#include <svx/dialmgr.hxx> -#include <svx/dialogs.hrc> - -#define DLGWIN GetParentDialog( this ) - -/************************************************************************* -|* -|* Dialog zum Aendern und Definieren der Farben -|* -\************************************************************************/ - -static Window* GetParentDialog( Window* pWindow ) -{ - while( pWindow ) - { - if( pWindow->IsDialog() ) - break; - - pWindow = pWindow->GetParent(); - } - - return pWindow; -} - -SvxColorTabPage::SvxColorTabPage -( - Window* pParent, - const SfxItemSet& rInAttrs -) : - - SfxTabPage ( pParent, CUI_RES( RID_SVXPAGE_COLOR ), rInAttrs ), - - aFlProp ( this, CUI_RES( FL_PROP ) ), - aFtName ( this, CUI_RES( FT_NAME ) ), - aEdtName ( this, CUI_RES( EDT_NAME ) ), - aFtColor ( this, CUI_RES( FT_COLOR ) ), - aLbColor ( this, CUI_RES( LB_COLOR ) ), - - aTableNameFT ( this, CUI_RES( FT_TABLE_NAME ) ), - aValSetColorTable ( this, CUI_RES( CTL_COLORTABLE ) ), - - aCtlPreviewOld ( this, CUI_RES( CTL_PREVIEW_OLD ) ), - aCtlPreviewNew ( this, CUI_RES( CTL_PREVIEW_NEW ) ), - - aLbColorModel ( this, CUI_RES( LB_COLORMODEL ) ), - aFtColorModel1 ( this, CUI_RES( FT_1 ) ), - aMtrFldColorModel1 ( this, CUI_RES( MTR_FLD_1 ) ), - aFtColorModel2 ( this, CUI_RES( FT_2 ) ), - aMtrFldColorModel2 ( this, CUI_RES( MTR_FLD_2 ) ), - aFtColorModel3 ( this, CUI_RES( FT_3 ) ), - aMtrFldColorModel3 ( this, CUI_RES( MTR_FLD_3 ) ), - aFtColorModel4 ( this, CUI_RES( FT_4 ) ), - aMtrFldColorModel4 ( this, CUI_RES( MTR_FLD_4 ) ), - aBtnAdd ( this, CUI_RES( BTN_ADD ) ), - aBtnModify ( this, CUI_RES( BTN_MODIFY ) ), - aBtnWorkOn ( this, CUI_RES( BTN_WORK_ON ) ), - aBtnDelete ( this, CUI_RES( BTN_DELETE ) ), - aBtnLoad ( this, CUI_RES( BTN_LOAD ) ), - aBtnSave ( this, CUI_RES( BTN_SAVE ) ), - - rOutAttrs ( rInAttrs ), - pColorTab( NULL ), - - bDeleteColorTable ( sal_True ), - - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXFStyleItem ( XFILL_SOLID ), - aXFillColorItem ( String(), Color( COL_BLACK ) ), - aXFillAttr ( pXPool ), - rXFSet ( aXFillAttr.GetItemSet() ), - - eCM ( CM_RGB ) - -{ - FreeResource(); - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - // Setzen des Output-Devices - rXFSet.Put( aXFStyleItem ); - rXFSet.Put( aXFillColorItem ); - aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() ); - - // Handler ueberladen - aLbColor.SetSelectHdl( - LINK( this, SvxColorTabPage, SelectColorLBHdl_Impl ) ); - aValSetColorTable.SetSelectHdl( - LINK( this, SvxColorTabPage, SelectValSetHdl_Impl ) ); - aLbColorModel.SetSelectHdl( - LINK( this, SvxColorTabPage, SelectColorModelHdl_Impl ) ); - - Link aLink = LINK( this, SvxColorTabPage, ModifiedHdl_Impl ); - aMtrFldColorModel1.SetModifyHdl( aLink ); - aMtrFldColorModel2.SetModifyHdl( aLink ); - aMtrFldColorModel3.SetModifyHdl( aLink ); - aMtrFldColorModel4.SetModifyHdl( aLink ); - - aBtnAdd.SetClickHdl( LINK( this, SvxColorTabPage, ClickAddHdl_Impl ) ); - aBtnModify.SetClickHdl( - LINK( this, SvxColorTabPage, ClickModifyHdl_Impl ) ); - aBtnWorkOn.SetClickHdl( - LINK( this, SvxColorTabPage, ClickWorkOnHdl_Impl ) ); - aBtnDelete.SetClickHdl( - LINK( this, SvxColorTabPage, ClickDeleteHdl_Impl ) ); - aBtnLoad.SetClickHdl( LINK( this, SvxColorTabPage, ClickLoadHdl_Impl ) ); - aBtnSave.SetClickHdl( LINK( this, SvxColorTabPage, ClickSaveHdl_Impl ) ); - - // ValueSet - aValSetColorTable.SetStyle( aValSetColorTable.GetStyle() | WB_VSCROLL | WB_ITEMBORDER ); - aValSetColorTable.SetColCount( 8 ); - aValSetColorTable.SetLineCount( 13 ); - aValSetColorTable.SetExtraSpacing( 0 ); - aValSetColorTable.Show(); - - aLbColorModel.SetAccessibleName( String( CUI_RES(STR_CUI_COLORMODEL) ) ); - aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnModify.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnWorkOn.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp ); -} - -// ----------------------------------------------------------------------- - -void SvxColorTabPage::Construct() -{ - aLbColor.Fill( pColorTab ); - FillValueSet_Impl( aValSetColorTable ); -} - -// ----------------------------------------------------------------------- - -void SvxColorTabPage::ActivatePage( const SfxItemSet& ) -{ - if( *pDlgType == 0 ) // Flaechen-Dialog - { - *pbAreaTP = sal_False; - - if( pColorTab ) - { - if( *pPageType == PT_COLOR && *pPos != LISTBOX_ENTRY_NOTFOUND ) - { - aLbColor.SelectEntryPos( *pPos ); - aValSetColorTable.SelectItem( aLbColor.GetSelectEntryPos() + 1 ); - aEdtName.SetText( aLbColor.GetSelectEntry() ); - - ChangeColorHdl_Impl( this ); - } - else if( *pPageType == PT_COLOR && *pPos == LISTBOX_ENTRY_NOTFOUND ) - { - const SfxPoolItem* pPoolItem = NULL; - if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), sal_True, &pPoolItem ) ) - { - aLbColorModel.SelectEntryPos( CM_RGB ); - - aAktuellColor.SetColor ( ( ( const XFillColorItem* ) pPoolItem )->GetColorValue().GetColor() ); - - aEdtName.SetText( ( ( const XFillColorItem* ) pPoolItem )->GetName() ); - - aMtrFldColorModel1.SetValue( ColorToPercent_Impl( aAktuellColor.GetRed() ) ); - aMtrFldColorModel2.SetValue( ColorToPercent_Impl( aAktuellColor.GetGreen() ) ); - aMtrFldColorModel3.SetValue( ColorToPercent_Impl( aAktuellColor.GetBlue() ) ); - - // ItemSet fuellen und an XOut weiterleiten - rXFSet.Put( XFillColorItem( String(), aAktuellColor ) ); - aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreviewNew.Invalidate(); - aCtlPreviewOld.Invalidate(); - } - } - - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - INetURLObject aURL( pColorTab->GetPath() ); - - aURL.Append( pColorTab->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - aTableNameFT.SetText( aString ); - - // Damit evtl. geaenderte Farbe verworfen wird - SelectColorLBHdl_Impl( this ); - - *pPageType = PT_COLOR; - *pPos = LISTBOX_ENTRY_NOTFOUND; - } - } - else - { - // Buttons werden gehided, weil Paletten z.Z. nur - // ueber den AreaDlg funktionieren!!! - // ActivatePage() muss von anderen Dialogen explizit - // gerufen werden, da ActivatePage() nicht gerufen wird, - // wenn Seite als Erste im Dialog angezeigt wird - aBtnLoad.Hide(); - aBtnSave.Hide(); - } -} - -// ----------------------------------------------------------------------- - -int SvxColorTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( CheckChanges_Impl() == -1L ) - return( KEEP_PAGE ); - - if( _pSet ) - FillItemSet( *_pSet ); - - return( LEAVE_PAGE ); -} - -// ----------------------------------------------------------------------- - -long SvxColorTabPage::CheckChanges_Impl() -{ - // wird hier benutzt, um Aenderungen NICHT zu verlieren - - Color aTmpColor (aAktuellColor); - if (eCM != CM_RGB) - ConvertColorValues (aTmpColor, CM_RGB); - - sal_uInt16 nPos = aLbColor.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - Color aColor = pColorTab->GetColor( nPos )->GetColor(); - String aString = aLbColor.GetSelectEntry(); - - // aNewColor, da COL_USER != COL_irgendwas, auch wenn RGB-Werte gleich - // Color aNewColor( aColor.GetRed(), aColor.GetGreen(), aColor.GetBlue() ); - - if( ColorToPercent_Impl( aTmpColor.GetRed() ) != ColorToPercent_Impl( aColor.GetRed() ) || - ColorToPercent_Impl( aTmpColor.GetGreen() ) != ColorToPercent_Impl( aColor.GetGreen() ) || - ColorToPercent_Impl( aTmpColor.GetBlue() ) != ColorToPercent_Impl( aColor.GetBlue() ) || - aString != aEdtName.GetText() ) - { - ResMgr& rMgr = CUI_MGR(); - Image aWarningBoxImage = WarningBox::GetStandardImage(); - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX, - SVX_RESSTR( RID_SVXSTR_COLOR ), - String( ResId( RID_SVXSTR_ASK_CHANGE_COLOR, rMgr ) ), - &aWarningBoxImage ); - DBG_ASSERT(aMessDlg, "Dialogdiet fail!"); - aMessDlg->SetButtonText( MESS_BTN_1, - String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) ); - aMessDlg->SetButtonText( MESS_BTN_2, - String( ResId( RID_SVXSTR_ADD, rMgr ) ) ); - - short nRet = aMessDlg->Execute(); - - switch( nRet ) - { - case RET_BTN_1: // Aendern - { - ClickModifyHdl_Impl( this ); - aColor = pColorTab->GetColor( nPos )->GetColor(); - } - break; - - case RET_BTN_2: // Hinzufuegen - { - ClickAddHdl_Impl( this ); - nPos = aLbColor.GetSelectEntryPos(); - aColor = pColorTab->GetColor( nPos )->GetColor(); - } - break; - - case RET_CANCEL: - break; - } - delete aMessDlg; - } - } - if( *pDlgType == 0 ) // Flaechen-Dialog - { - nPos = aLbColor.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - *pPos = nPos; - } - } - return( 0L ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxColorTabPage::FillItemSet( SfxItemSet& rSet ) -{ - if( ( *pDlgType != 0 ) || - ( *pPageType == PT_COLOR && *pbAreaTP == sal_False ) ) - { - String aString; - Color aColor; - - sal_uInt16 nPos = aLbColor.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - aColor = pColorTab->GetColor( nPos )->GetColor(); - aString = aLbColor.GetSelectEntry(); - } - else - { - aColor.SetColor (aAktuellColor.GetColor()); - if (eCM != CM_RGB) - ConvertColorValues (aColor, CM_RGB); - } - rSet.Put( XFillColorItem( aString, aColor ) ); - rSet.Put( XFillStyleItem( XFILL_SOLID ) ); - } - - return( sal_True ); -} - -// ----------------------------------------------------------------------- - -void SvxColorTabPage::Reset( const SfxItemSet& rSet ) -{ - sal_uInt16 nState = rSet.GetItemState( XATTR_FILLCOLOR ); - - if ( nState >= SFX_ITEM_DEFAULT ) - { - XFillColorItem aColorItem( (const XFillColorItem&)rSet.Get( XATTR_FILLCOLOR ) ); - aLbColor.SelectEntry( aColorItem.GetColorValue() ); - aValSetColorTable.SelectItem( aLbColor.GetSelectEntryPos() + 1 ); - aEdtName.SetText( aLbColor.GetSelectEntry() ); - } - - // Farbmodell setzen - String aStr = GetUserData(); - aLbColorModel.SelectEntryPos( (sal_uInt16) aStr.ToInt32() ); - - ChangeColorHdl_Impl( this ); - SelectColorModelHdl_Impl( this ); - - aCtlPreviewOld.Invalidate(); - - // Status der Buttons ermitteln - if( pColorTab->Count() ) - { - aBtnModify.Enable(); - aBtnWorkOn.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnWorkOn.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxColorTabPage::Create( Window* pWindow, - const SfxItemSet& rOutAttrs ) -{ - return( new SvxColorTabPage( pWindow, rOutAttrs ) ); -} - -//------------------------------------------------------------------------ - -// -// Wird aufgerufen, wenn Inhalt der MtrFileds f�r Farbwerte ver�ndert wird -// -IMPL_LINK( SvxColorTabPage, ModifiedHdl_Impl, void *, EMPTYARG ) -{ - // lese aktuelle MtrFields aus, wenn cmyk, dann k-Wert als Trans.-Farbe - aAktuellColor.SetColor ( Color( (sal_uInt8)PercentToColor_Impl( (sal_uInt16) aMtrFldColorModel4.GetValue() ), - (sal_uInt8)PercentToColor_Impl( (sal_uInt16) aMtrFldColorModel1.GetValue() ), - (sal_uInt8)PercentToColor_Impl( (sal_uInt16) aMtrFldColorModel2.GetValue() ), - (sal_uInt8)PercentToColor_Impl( (sal_uInt16) aMtrFldColorModel3.GetValue() ) ).GetColor() ); - - Color aTmpColor(aAktuellColor); - if (eCM != CM_RGB) - ConvertColorValues (aTmpColor, CM_RGB); - - rXFSet.Put( XFillColorItem( String(), aTmpColor ) ); - aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreviewNew.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -// -// Button 'Hinzuf�gen' -// -IMPL_LINK( SvxColorTabPage, ClickAddHdl_Impl, void *, EMPTYARG ) -{ - Window *pWindow = this; - while( pWindow ) - { - pWindow = pWindow->GetParent(); - } - - ResMgr& rMgr = CUI_MGR(); - String aDesc( ResId( RID_SVXSTR_DESC_COLOR, rMgr ) ); - String aName( aEdtName.GetText() ); - XColorEntry* pEntry; - long nCount = pColorTab->Count(); - sal_Bool bDifferent = sal_True; - - // Pruefen, ob Name schon vorhanden ist - for ( long i = 0; i < nCount && bDifferent; i++ ) - if ( aName == pColorTab->GetColor( i )->GetName() ) - bDifferent = sal_False; - - // Wenn ja, wird wiederholt ein neuer Name angefordert - if ( !bDifferent ) - { - WarningBox aWarningBox( DLGWIN, WinBits( WB_OK ), - String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); - aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); - aWarningBox.Execute(); - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - sal_Bool bLoop = sal_True; - - while ( !bDifferent && bLoop && pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - { - if( aName == pColorTab->GetColor( i )->GetName() ) - bDifferent = sal_False; - } - - if( bDifferent ) - bLoop = sal_False; - else - aWarningBox.Execute(); - } - delete( pDlg ); - } - - // Wenn nicht vorhanden, wird Eintrag aufgenommen - if( bDifferent ) - { - if (eCM != CM_RGB) - ConvertColorValues (aAktuellColor, CM_RGB); - pEntry = new XColorEntry( aAktuellColor, aName ); - - pColorTab->Insert( pColorTab->Count(), pEntry ); - - aLbColor.Append( pEntry ); - aValSetColorTable.InsertItem( aValSetColorTable.GetItemCount() + 1, - pEntry->GetColor(), pEntry->GetName() ); - - aLbColor.SelectEntryPos( aLbColor.GetEntryCount() - 1 ); - - // Flag fuer modifiziert setzen - *pnColorTableState |= CT_MODIFIED; - - SelectColorLBHdl_Impl( this ); - } - // Status der Buttons ermitteln - if( pColorTab->Count() ) - { - aBtnModify.Enable(); - aBtnWorkOn.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -// -// Button '�ndern' -// -IMPL_LINK( SvxColorTabPage, ClickModifyHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbColor.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - ResMgr& rMgr = CUI_MGR(); - String aDesc( ResId( RID_SVXSTR_DESC_COLOR, rMgr ) ); - String aName( aEdtName.GetText() ); - long nCount = pColorTab->Count(); - sal_Bool bDifferent = sal_True; - - // Pruefen, ob Name schon vorhanden ist - for ( long i = 0; i < nCount && bDifferent; i++ ) - if ( aName == pColorTab->GetColor( i )->GetName() && nPos != i ) - bDifferent = sal_False; - - // Wenn ja, wird wiederholt ein neuer Name angefordert - if ( !bDifferent ) - { - WarningBox aWarningBox( DLGWIN, WinBits( WB_OK ), - String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); - aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); - aWarningBox.Execute(); - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - sal_Bool bLoop = sal_True; - - while ( !bDifferent && bLoop && pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - bDifferent = sal_True; - - for ( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == pColorTab->GetColor( i )->GetName() && nPos != i ) - bDifferent = sal_False; - - if( bDifferent ) - bLoop = sal_False; - else - aWarningBox.Execute(); - } - delete( pDlg ); - } - - // Wenn nicht vorhanden, wird Eintrag aufgenommen - if( bDifferent ) - { - XColorEntry* pEntry = pColorTab->GetColor( nPos ); - - Color aTmpColor (aAktuellColor); - if (eCM != CM_RGB) - ConvertColorValues (aTmpColor, CM_RGB); - - pEntry->SetColor( aTmpColor ); - pEntry->SetName( aName ); - - aLbColor.Modify( pEntry, nPos ); - aLbColor.SelectEntryPos( nPos ); - ///// - aValSetColorTable.SetItemColor( nPos + 1, pEntry->GetColor() ); - aValSetColorTable.SetItemText( nPos + 1, pEntry->GetName() ); - aEdtName.SetText( aName ); - - aCtlPreviewOld.Invalidate(); - - // Flag fuer modifiziert setzen - *pnColorTableState |= CT_MODIFIED; - } - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -// -// Button 'Bearbeiten' -// -IMPL_LINK( SvxColorTabPage, ClickWorkOnHdl_Impl, void *, EMPTYARG ) -{ - SvColorDialog* pColorDlg = new SvColorDialog( DLGWIN ); - - Color aTmpColor (aAktuellColor); - if (eCM != CM_RGB) - ConvertColorValues (aTmpColor, CM_RGB); - - pColorDlg->SetColor (aTmpColor); - pColorDlg->SetMode( svtools::ColorPickerMode_MODIFY ); - - if( pColorDlg->Execute() == RET_OK ) - { - sal_uInt16 nK = 0; - Color aPreviewColor = pColorDlg->GetColor(); - aAktuellColor = aPreviewColor; - if (eCM != CM_RGB) - ConvertColorValues (aAktuellColor, eCM); - - aMtrFldColorModel1.SetValue( ColorToPercent_Impl( aAktuellColor.GetRed() ) ); - aMtrFldColorModel2.SetValue( ColorToPercent_Impl( aAktuellColor.GetGreen() ) ); - aMtrFldColorModel3.SetValue( ColorToPercent_Impl( aAktuellColor.GetBlue() ) ); - aMtrFldColorModel4.SetValue( ColorToPercent_Impl( nK ) ); - - // ItemSet fuellen und an XOut weiterleiten - rXFSet.Put( XFillColorItem( String(), aPreviewColor ) ); - //aCtlPreviewOld.SetAttributes( aXFillAttr ); - aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreviewNew.Invalidate(); - } - delete( pColorDlg ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -// -// Button 'Loeschen' -// -IMPL_LINK( SvxColorTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbColor.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ), - String( CUI_RES( RID_SVXSTR_ASK_DEL_COLOR ) ) ); - - if( aQueryBox.Execute() == RET_YES ) - { - // Jetzt wird richtig geloescht - sal_uLong nCount = pColorTab->Count() - 1; - XColorEntry* pEntry; - - pEntry = pColorTab->Remove( nPos ); - DBG_ASSERT( pEntry, "ColorEntry nicht vorhanden (1) !" ); - delete pEntry; - - for( sal_uLong i = nPos; i < nCount; i++ ) - { - pEntry = pColorTab->Remove( i + 1 ); - DBG_ASSERT( pEntry, "ColorEntry nicht vorhanden (2) !" ); - pColorTab->Insert( i, pEntry ); - } - - // Listbox und ValueSet aktualisieren - aLbColor.RemoveEntry( nPos ); - aValSetColorTable.Clear(); - FillValueSet_Impl( aValSetColorTable ); - - // Positionieren - aLbColor.SelectEntryPos( nPos ); - SelectColorLBHdl_Impl( this ); - - aCtlPreviewOld.Invalidate(); - - // Flag fuer modifiziert setzen - *pnColorTableState |= CT_MODIFIED; - } - } - // Status der Buttons ermitteln - if( !pColorTab->Count() ) - { - aBtnModify.Disable(); - aBtnWorkOn.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return( 0L ); -} - -// ----------------------------------------------------------------------- - -// -// Button 'Farbtabelle laden' -// -IMPL_LINK( SvxColorTabPage, ClickLoadHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - sal_uInt16 nReturn = RET_YES; - - if( *pnColorTableState & CT_MODIFIED ) - { - nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ), - String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute(); - - if ( nReturn == RET_YES ) - pColorTab->Save(); - } - - if ( nReturn != RET_CANCEL ) - { - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soc" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - - if ( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - // Tabelle speichern - XColorTable* pColTab = new XColorTable( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool ); - pColTab->SetName( aURL.getName() ); // XXX - if( pColTab->Load() ) - { - // Pruefen, ob Tabelle geloescht werden darf: - const XColorTable *pTempTable = 0; - SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( DLGWIN ); - SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( DLGWIN ); - if( pArea ) - { - pTempTable = pArea->GetColorTable(); - } - else if( pLine ) - { - pTempTable = pLine->GetColorTable(); - } - - if( pColorTab != pTempTable ) - { - if( bDeleteColorTable ) - delete pColorTab; - else - bDeleteColorTable = sal_True; - } - - pColorTab = pColTab; - if( pArea ) - { - pArea->SetNewColorTable( pColorTab ); - } - else if( pLine ) - { - pLine->SetNewColorTable( pColorTab ); - } - - aLbColor.Clear(); - aValSetColorTable.Clear(); - Construct(); - Reset( rOutAttrs ); - - pColorTab->SetName( aURL.getName() ); - - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( ResId( RID_SVXSTR_TABLE, rMgr ) ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - aTableNameFT.SetText( aString ); - - // Flag fuer gewechselt setzen - *pnColorTableState |= CT_CHANGED; - // Flag fuer modifiziert entfernen - *pnColorTableState &= ~CT_MODIFIED; - - if( aLbColor.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND ) - aLbColor.SelectEntryPos( 0 ); - else - aLbColor.SelectEntryPos( aLbColor.GetSelectEntryPos() ); - - ChangeColorHdl_Impl( this ); - SelectColorLBHdl_Impl( this ); - } - else - { - ErrorBox aErrorBox( DLGWIN, WinBits( WB_OK ), - String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ); - aErrorBox.Execute(); - } - } - } - - // Status der Buttons ermitteln - if ( pColorTab->Count() ) - { - aBtnModify.Enable(); - aBtnWorkOn.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnWorkOn.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return( 0L ); -} - -// ----------------------------------------------------------------------- - -// -// Button 'Farbtabelle speichern' -// -IMPL_LINK( SvxColorTabPage, ClickSaveHdl_Impl, void *, EMPTYARG ) -{ - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soc" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( pColorTab->GetName().Len() ) - { - aFile.Append( pColorTab->GetName() ); - - if( !aFile.getExtension().getLength() ) - aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "soc" ) ) ); - } - - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - if ( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - pColorTab->SetName( aURL.getName() ); - pColorTab->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( pColorTab->Save() ) - { - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - aTableNameFT.SetText( aString ); - - // Flag fuer gespeichert setzen - *pnColorTableState |= CT_SAVED; - // Flag fuer modifiziert entfernen - *pnColorTableState &= ~CT_MODIFIED; - } - else - { - ErrorBox aErrorBox( DLGWIN, WinBits( WB_OK ), - String( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ); - aErrorBox.Execute(); - } - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxColorTabPage, SelectColorLBHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbColor.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - aValSetColorTable.SelectItem( nPos + 1 ); - aEdtName.SetText( aLbColor.GetSelectEntry() ); - - rXFSet.Put( XFillColorItem( String(), - aLbColor.GetSelectEntryColor() ) ); - aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreviewOld.Invalidate(); - aCtlPreviewNew.Invalidate(); - - ChangeColorHdl_Impl( this ); - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxColorTabPage, SelectValSetHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aValSetColorTable.GetSelectItemId(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - aLbColor.SelectEntryPos( nPos - 1 ); - aEdtName.SetText( aLbColor.GetSelectEntry() ); - - rXFSet.Put( XFillColorItem( String(), - aLbColor.GetSelectEntryColor() ) ); - aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreviewOld.Invalidate(); - aCtlPreviewNew.Invalidate(); - - ChangeColorHdl_Impl( this ); - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -// -// Farbwerte je nach �bergebenes Farbmodell umrechnen -// -void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell) -{ - switch (eModell) - { - case CM_RGB: - { - CmykToRgb_Impl (rColor, (sal_uInt16)rColor.GetTransparency() ); - rColor.SetTransparency ((sal_uInt8) 0); - } - break; - - case CM_CMYK: - { - sal_uInt16 nK; - RgbToCmyk_Impl (rColor, nK ); - rColor.SetTransparency ((sal_uInt8) nK); - } - break; - } -} - -// -// Auswahl Listbox 'Farbmodell' (RGB/CMY) -// -IMPL_LINK( SvxColorTabPage, SelectColorModelHdl_Impl, void *, EMPTYARG ) -{ - int nPos = aLbColorModel.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - if (eCM != (ColorModel) nPos) - { - // wenn Farbmodell geaendert wurde, dann Werte umrechnen - ConvertColorValues (aAktuellColor, (ColorModel) nPos); - } - - eCM = (ColorModel) nPos; - - switch( eCM ) - { - case CM_RGB: - { - String aStr( aLbColorModel.GetSelectEntry() ); - String aColorStr( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "~X" ) ) ); - xub_StrLen nIdx = 1; - aColorStr.SetChar( nIdx, aStr.GetChar( 0 ) ); - aFtColorModel1.SetText( aColorStr ); - aColorStr.SetChar( nIdx, aStr.GetChar( 1 ) ); - aFtColorModel2.SetText( aColorStr ); - aColorStr.SetChar( nIdx, aStr.GetChar( 2 ) ); - aFtColorModel3.SetText( aColorStr ); - - aFtColorModel4.Hide(); - aMtrFldColorModel4.Hide(); - aMtrFldColorModel4.SetValue( 0L ); - - aMtrFldColorModel1.SetHelpId( HID_TPCOLOR_RGB_1 ); - aMtrFldColorModel2.SetHelpId( HID_TPCOLOR_RGB_2 ); - aMtrFldColorModel3.SetHelpId( HID_TPCOLOR_RGB_3 ); - - // Da der alte HelpText noch am Control steht wuerde - // ein Umsetzen der HelpID alleine nichts bewirken - aMtrFldColorModel1.SetHelpText( String() ); - aMtrFldColorModel2.SetHelpText( String() ); - aMtrFldColorModel3.SetHelpText( String() ); - - // RGB-Werte im Bereich 0..255 verarbeiten (nicht in %), - // dazu MetricField's entsprechend einstellen - aMtrFldColorModel1.SetUnit(FUNIT_NONE); - aMtrFldColorModel1.SetMin(0); - aMtrFldColorModel1.SetMax(255); - aMtrFldColorModel1.SetLast(255); - - aMtrFldColorModel2.SetUnit(FUNIT_NONE); - aMtrFldColorModel2.SetMin(0); - aMtrFldColorModel2.SetMax(255); - aMtrFldColorModel2.SetLast(255); - - aMtrFldColorModel3.SetUnit(FUNIT_NONE); - aMtrFldColorModel3.SetMin(0); - aMtrFldColorModel3.SetMax(255); - aMtrFldColorModel3.SetLast(255); - } - break; - - case CM_CMYK: - { - String aStr( aLbColorModel.GetSelectEntry() ); - String aColorStr( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "~X" ) ) ); - xub_StrLen nIdx = 1; - aColorStr.SetChar( nIdx, aStr.GetChar( 0 ) ); - aFtColorModel1.SetText( aColorStr ); - aColorStr.SetChar( nIdx, aStr.GetChar( 1 ) ); - aFtColorModel2.SetText( aColorStr ); - aColorStr.SetChar( nIdx,aStr.GetChar( 2 ) ); - aFtColorModel3.SetText( aColorStr ); - aColorStr.SetChar( nIdx,aStr.GetChar( 3 ) ); - aFtColorModel4.SetText( aColorStr ); - - aFtColorModel4.Show(); - aMtrFldColorModel4.Show(); - - aMtrFldColorModel1.SetHelpId( HID_TPCOLOR_CMYK_1 ); - aMtrFldColorModel2.SetHelpId( HID_TPCOLOR_CMYK_2 ); - aMtrFldColorModel3.SetHelpId( HID_TPCOLOR_CMYK_3 ); - - // s.o. - aMtrFldColorModel1.SetHelpText( String() ); - aMtrFldColorModel2.SetHelpText( String() ); - aMtrFldColorModel3.SetHelpText( String() ); - - // CMYK-Werte im Bereich 0..100% verarbeiten, - // dazu MetricField's entsprechend einstellen - String aStrUnit( RTL_CONSTASCII_USTRINGPARAM( " %" ) ); - - aMtrFldColorModel1.SetUnit(FUNIT_CUSTOM); - aMtrFldColorModel1.SetCustomUnitText( aStrUnit ); - aMtrFldColorModel1.SetMin(0); - aMtrFldColorModel1.SetMax(100); - aMtrFldColorModel1.SetLast(100); - - aMtrFldColorModel2.SetUnit(FUNIT_CUSTOM); - aMtrFldColorModel2.SetCustomUnitText( aStrUnit ); - aMtrFldColorModel2.SetMin(0); - aMtrFldColorModel2.SetMax(100); - aMtrFldColorModel2.SetLast(100); - - aMtrFldColorModel3.SetUnit(FUNIT_CUSTOM); - aMtrFldColorModel3.SetCustomUnitText( aStrUnit ); - aMtrFldColorModel3.SetMin(0); - aMtrFldColorModel3.SetMax(100); - aMtrFldColorModel3.SetLast(100); - } - break; - } - - aMtrFldColorModel1.SetValue( ColorToPercent_Impl( aAktuellColor.GetRed() ) ); - aMtrFldColorModel2.SetValue( ColorToPercent_Impl( aAktuellColor.GetGreen() ) ); - aMtrFldColorModel3.SetValue( ColorToPercent_Impl( aAktuellColor.GetBlue() ) ); - aMtrFldColorModel4.SetValue( ColorToPercent_Impl( aAktuellColor.GetTransparency() ) ); - } - - aMtrFldColorModel1.SetAccessibleName( GetNonMnemonicString(aFtColorModel1.GetText()) ); - aMtrFldColorModel2.SetAccessibleName( GetNonMnemonicString(aFtColorModel2.GetText()) ); - aMtrFldColorModel3.SetAccessibleName( GetNonMnemonicString(aFtColorModel3.GetText()) ); - aMtrFldColorModel4.SetAccessibleName( GetNonMnemonicString(aFtColorModel4.GetText()) ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -long SvxColorTabPage::ChangeColorHdl_Impl( void* ) -{ - int nPos = aLbColor.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - XColorEntry* pEntry = pColorTab->GetColor( nPos ); - - aAktuellColor.SetColor ( pEntry->GetColor().GetColor() ); - if (eCM != CM_RGB) - ConvertColorValues (aAktuellColor, eCM); - - aMtrFldColorModel1.SetValue( ColorToPercent_Impl( aAktuellColor.GetRed() ) ); - aMtrFldColorModel2.SetValue( ColorToPercent_Impl( aAktuellColor.GetGreen() ) ); - aMtrFldColorModel3.SetValue( ColorToPercent_Impl( aAktuellColor.GetBlue() ) ); - aMtrFldColorModel4.SetValue( ColorToPercent_Impl( aAktuellColor.GetTransparency() ) ); - - // ItemSet fuellen und an XOut weiterleiten - rXFSet.Put( XFillColorItem( String(), pEntry->GetColor() ) ); - aCtlPreviewOld.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreviewNew.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreviewNew.Invalidate(); - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -void SvxColorTabPage::FillValueSet_Impl( ValueSet& rVs ) -{ - long nCount = pColorTab->Count(); - XColorEntry* pColorEntry; - - if( nCount > 104 ) - rVs.SetStyle( rVs.GetStyle() | WB_VSCROLL ); - - for( long i = 0; i < nCount; i++ ) - { - pColorEntry = pColorTab->GetColor( i ); - rVs.InsertItem( (sal_uInt16) i + 1, pColorEntry->GetColor(), pColorEntry->GetName() ); - } -} - -//------------------------------------------------------------------------ - -// Ein RGB-Wert wird in einen CMYK-Wert konvertiert, wobei die Color- -// Klasse vergewaltigt wird, da R in C, G in M und B in Y umgewandelt -// wird. Der Wert K wird in einer Extra-Variablen gehalten. -// Bei weiteren Farbmodellen sollte man hierfuer eigene Klassen entwickeln, -// die dann auch entsprechende Casts enthalten. - -void SvxColorTabPage::RgbToCmyk_Impl( Color& rColor, sal_uInt16& rK ) -{ - sal_uInt16 const nColor1 = 255 - rColor.GetRed(); - sal_uInt16 const nColor2 = 255 - rColor.GetGreen(); - sal_uInt16 const nColor3 = 255 - rColor.GetBlue(); - - rK = Min( Min( nColor1, nColor2 ), nColor3 ); - - rColor.SetRed( sal::static_int_cast< sal_uInt8 >( nColor1 - rK ) ); - rColor.SetGreen( sal::static_int_cast< sal_uInt8 >( nColor2 - rK ) ); - rColor.SetBlue( sal::static_int_cast< sal_uInt8 >( nColor3 - rK ) ); -} - -//------------------------------------------------------------------------ - -// Umgekehrter Fall zu RgbToCmyk_Impl (s.o.) - -void SvxColorTabPage::CmykToRgb_Impl( Color& rColor, const sal_uInt16 nK ) -{ - long lTemp; - - lTemp = 255 - ( rColor.GetRed() + nK ); - - if( lTemp < 0L ) - lTemp = 0L; - rColor.SetRed( (sal_uInt8)lTemp ); - - lTemp = 255 - ( rColor.GetGreen() + nK ); - - if( lTemp < 0L ) - lTemp = 0L; - rColor.SetGreen( (sal_uInt8)lTemp ); - - lTemp = 255 - ( rColor.GetBlue() + nK ); - - if( lTemp < 0L ) - lTemp = 0L; - rColor.SetBlue( (sal_uInt8)lTemp ); -} - -//------------------------------------------------------------------------ - -sal_uInt16 SvxColorTabPage::ColorToPercent_Impl( sal_uInt16 nColor ) -{ - sal_uInt16 nWert = 0; - - switch (eCM) - { - case CM_RGB : - nWert = nColor; - break; - - case CM_CMYK: - nWert = (sal_uInt16) ( (double) nColor * 100.0 / 255.0 + 0.5 ); - break; - } - - return ( nWert ); -} - -//------------------------------------------------------------------------ - -sal_uInt16 SvxColorTabPage::PercentToColor_Impl( sal_uInt16 nPercent ) -{ - sal_uInt16 nWert = 0; - - switch (eCM) - { - case CM_RGB : - nWert = nPercent; - break; - - case CM_CMYK: - nWert = (sal_uInt16) ( (double) nPercent * 255.0 / 100.0 + 0.5 ); - break; - } - - return ( nWert ); -} - -//------------------------------------------------------------------------ - -void SvxColorTabPage::FillUserData() -{ - // Das Farbmodell wird in der Ini-Datei festgehalten - SetUserData( UniString::CreateFromInt32( eCM ) ); -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx deleted file mode 100644 index 6fa476bb8..000000000 --- a/cui/source/tabpages/tpgradnt.cxx +++ /dev/null @@ -1,929 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <vcl/wrkwin.hxx> -#include <tools/shl.hxx> -#include <tools/urlobj.hxx> -#include <vcl/msgbox.hxx> -#include <unotools/pathoptions.hxx> -#include <sfx2/app.hxx> -#include <sfx2/filedlghelper.hxx> -#include "com/sun/star/ui/dialogs/TemplateDescription.hpp" - -#define _SVX_TPGRADNT_CXX - -#include <cuires.hrc> -#include "helpid.hrc" -#include "svx/xattr.hxx" -#include <svx/xtable.hxx> -#include <svx/xpool.hxx> -#include "svx/drawitem.hxx" -#include "cuitabarea.hxx" -#include "tabarea.hrc" -#include "defdlgname.hxx" -#include <svx/svxdlg.hxx> -#include <dialmgr.hxx> -#include <svx/dialmgr.hxx> -#include <svx/dialogs.hrc> -#include "paragrph.hrc" - -#define DLGWIN this->GetParent()->GetParent() - -#define BITMAP_WIDTH 32 -#define BITMAP_HEIGHT 12 - -/************************************************************************* -|* -|* Dialog zum Aendern und Definieren der Farbverlaeufe -|* -\************************************************************************/ - -SvxGradientTabPage::SvxGradientTabPage -( - Window* pParent, - const SfxItemSet& rInAttrs -) : - SfxTabPage ( pParent, CUI_RES( RID_SVXPAGE_GRADIENT ), rInAttrs ), - - aFlProp ( this, CUI_RES( FL_PROP ) ), - aFtType ( this, CUI_RES( FT_TYPE ) ), - aLbGradientType ( this, CUI_RES( LB_GRADIENT_TYPES ) ), - aFtCenterX ( this, CUI_RES( FT_CENTER_X ) ), - aMtrCenterX ( this, CUI_RES( MTR_CENTER_X ) ), - aFtCenterY ( this, CUI_RES( FT_CENTER_Y ) ), - aMtrCenterY ( this, CUI_RES( MTR_CENTER_Y ) ), - aFtAngle ( this, CUI_RES( FT_ANGLE ) ), - aMtrAngle ( this, CUI_RES( MTR_ANGLE ) ), - aFtBorder ( this, CUI_RES( FT_BORDER ) ), - aMtrBorder ( this, CUI_RES( MTR_BORDER ) ), - aFtColorFrom ( this, CUI_RES( FT_COLOR_FROM ) ), - aLbColorFrom ( this, CUI_RES( LB_COLOR_FROM ) ), - aMtrColorFrom ( this, CUI_RES( MTR_COLOR_FROM ) ), - aFtColorTo ( this, CUI_RES( FT_COLOR_TO ) ), - aLbColorTo ( this, CUI_RES( LB_COLOR_TO ) ), - aMtrColorTo ( this, CUI_RES( MTR_COLOR_TO ) ), - aLbGradients ( this, CUI_RES( LB_GRADIENTS ) ), - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ), - aBtnAdd ( this, CUI_RES( BTN_ADD ) ), - aBtnModify ( this, CUI_RES( BTN_MODIFY ) ), - aBtnDelete ( this, CUI_RES( BTN_DELETE ) ), - aBtnLoad ( this, CUI_RES( BTN_LOAD ) ), - aBtnSave ( this, CUI_RES( BTN_SAVE ) ), - - rOutAttrs ( rInAttrs ), - - pColorTab( NULL ), - pGradientList( NULL ), - - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXFStyleItem ( XFILL_GRADIENT ), - aXGradientItem ( String(), XGradient( COL_BLACK, COL_WHITE ) ), - aXFillAttr ( pXPool ), - rXFSet ( aXFillAttr.GetItemSet() ) -{ - FreeResource(); - - aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE))); - aLbGradients.SetAccessibleName( GetText()); - - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - // Solange NICHT vom Item unterstuetzt - - aMtrColorTo.SetValue( 100 ); - aMtrColorFrom.SetValue( 100 ); - - // Setzen des Output-Devices - rXFSet.Put( aXFStyleItem ); - rXFSet.Put( aXGradientItem ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - // Handler ueberladen - aLbGradients.SetSelectHdl( - LINK( this, SvxGradientTabPage, ChangeGradientHdl_Impl ) ); - aBtnAdd.SetClickHdl( LINK( this, SvxGradientTabPage, ClickAddHdl_Impl ) ); - aBtnModify.SetClickHdl( - LINK( this, SvxGradientTabPage, ClickModifyHdl_Impl ) ); - aBtnDelete.SetClickHdl( - LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) ); - - Link aLink = LINK( this, SvxGradientTabPage, ModifiedHdl_Impl ); - aLbGradientType.SetSelectHdl( aLink ); - aMtrCenterX.SetModifyHdl( aLink ); - aMtrCenterY.SetModifyHdl( aLink ); - aMtrAngle.SetModifyHdl( aLink ); - aMtrBorder.SetModifyHdl( aLink ); - aMtrColorFrom.SetModifyHdl( aLink ); - aLbColorFrom.SetSelectHdl( aLink ); - aMtrColorTo.SetModifyHdl( aLink ); - aLbColorTo.SetSelectHdl( aLink ); - - aBtnLoad.SetClickHdl( - LINK( this, SvxGradientTabPage, ClickLoadHdl_Impl ) ); - aBtnSave.SetClickHdl( - LINK( this, SvxGradientTabPage, ClickSaveHdl_Impl ) ); - - aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnModify.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp ); - aLbGradients.SetAccessibleRelationLabeledBy(&aLbGradients); - - // #i76307# always paint the preview in LTR, because this is what the document does - aCtlPreview.EnableRTL( sal_False ); -} - -// ----------------------------------------------------------------------- - -void SvxGradientTabPage::Construct() -{ - // Farbtabelle - aLbColorFrom.Fill( pColorTab ); - aLbColorTo.CopyEntries( aLbColorFrom ); - - // Farbverlauftabelle - aLbGradients.Fill( pGradientList ); -} - -// ----------------------------------------------------------------------- - -void SvxGradientTabPage::ActivatePage( const SfxItemSet& ) -{ - sal_uInt16 nPos; - sal_uInt16 nCount; - - if( *pDlgType == 0 ) // Flaechen-Dialog - { - *pbAreaTP = sal_False; - - if( pColorTab ) - { - // ColorTable - if( *pnColorTableState & CT_CHANGED || - *pnColorTableState & CT_MODIFIED ) - { - if( *pnColorTableState & CT_CHANGED ) - pColorTab = ( (SvxAreaTabDialog*) DLGWIN )->GetNewColorTable(); - - // LbColorFrom - nPos = aLbColorFrom.GetSelectEntryPos(); - aLbColorFrom.Clear(); - aLbColorFrom.Fill( pColorTab ); - nCount = aLbColorFrom.GetEntryCount(); - if( nCount == 0 ) - ; // Dieser Fall sollte nicht auftreten - else if( nCount <= nPos ) - aLbColorFrom.SelectEntryPos( 0 ); - else - aLbColorFrom.SelectEntryPos( nPos ); - - // LbColorTo - nPos = aLbColorTo.GetSelectEntryPos(); - aLbColorTo.Clear(); - aLbColorTo.CopyEntries( aLbColorFrom ); - nCount = aLbColorTo.GetEntryCount(); - if( nCount == 0 ) - ; // Dieser Fall sollte nicht auftreten - else if( nCount <= nPos ) - aLbColorTo.SelectEntryPos( 0 ); - else - aLbColorTo.SelectEntryPos( nPos ); - - ModifiedHdl_Impl( this ); - } - - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - INetURLObject aURL( pGradientList->GetPath() ); - - aURL.Append( pGradientList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - if ( *pPageType == PT_GRADIENT && *pPos != LISTBOX_ENTRY_NOTFOUND ) - { - aLbGradients.SelectEntryPos( *pPos ); - } - // Farben koennten geloescht worden sein - ChangeGradientHdl_Impl( this ); - - *pPageType = PT_GRADIENT; - *pPos = LISTBOX_ENTRY_NOTFOUND; - } - } -} - -// ----------------------------------------------------------------------- - -int SvxGradientTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if( CheckChanges_Impl() == -1L ) - return KEEP_PAGE; - - if( _pSet ) - FillItemSet( *_pSet ); - - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -long SvxGradientTabPage::CheckChanges_Impl() -{ - // wird hier benutzt, um Aenderungen NICHT zu verlieren - XGradient aTmpGradient( aLbColorFrom.GetSelectEntryColor(), - aLbColorTo.GetSelectEntryColor(), - (XGradientStyle) aLbGradientType.GetSelectEntryPos(), - static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden - (sal_uInt16) aMtrCenterX.GetValue(), - (sal_uInt16) aMtrCenterY.GetValue(), - (sal_uInt16) aMtrBorder.GetValue(), - (sal_uInt16) aMtrColorFrom.GetValue(), - (sal_uInt16) aMtrColorTo.GetValue() ); - - sal_uInt16 nPos = aLbGradients.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - XGradient aGradient = pGradientList->GetGradient( nPos )->GetGradient(); - String aString = aLbGradients.GetSelectEntry(); - - if( !( aTmpGradient == aGradient ) ) - { - ResMgr& rMgr = CUI_MGR(); - Image aWarningBoxImage = WarningBox::GetStandardImage(); - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX, - SVX_RESSTR( RID_SVXSTR_GRADIENT ), - CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_GRADIENT ), - &aWarningBoxImage ); - DBG_ASSERT(aMessDlg, "Dialogdiet fail!"); - aMessDlg->SetButtonText( MESS_BTN_1, - String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) ); - aMessDlg->SetButtonText( MESS_BTN_2, - String( ResId( RID_SVXSTR_ADD, rMgr ) ) ); - - short nRet = aMessDlg->Execute(); - - switch( nRet ) - { - case RET_BTN_1: // Aendern - { - ClickModifyHdl_Impl( this ); - aGradient = pGradientList->GetGradient( nPos )->GetGradient(); - } - break; - - case RET_BTN_2: // Hinzufuegen - { - ClickAddHdl_Impl( this ); - nPos = aLbGradients.GetSelectEntryPos(); - aGradient = pGradientList->GetGradient( nPos )->GetGradient(); - } - break; - - case RET_CANCEL: - break; - } - delete aMessDlg; - } - } - nPos = aLbGradients.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - *pPos = nPos; - } - return 0L; -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxGradientTabPage::FillItemSet( SfxItemSet& rSet ) -{ - if( *pDlgType == 0 && *pPageType == PT_GRADIENT && *pbAreaTP == sal_False ) - { - // CheckChanges(); <-- doppelte Abfrage ? - - XGradient* pXGradient = NULL; - String aString; - sal_uInt16 nPos = aLbGradients.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - pXGradient = new XGradient( pGradientList->GetGradient( nPos )->GetGradient() ); - aString = aLbGradients.GetSelectEntry(); - - } - else - // Farbverlauf wurde (unbekannt) uebergeben - { - pXGradient = new XGradient( aLbColorFrom.GetSelectEntryColor(), - aLbColorTo.GetSelectEntryColor(), - (XGradientStyle) aLbGradientType.GetSelectEntryPos(), - static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden - (sal_uInt16) aMtrCenterX.GetValue(), - (sal_uInt16) aMtrCenterY.GetValue(), - (sal_uInt16) aMtrBorder.GetValue(), - (sal_uInt16) aMtrColorFrom.GetValue(), - (sal_uInt16) aMtrColorTo.GetValue() ); - } - DBG_ASSERT( pXGradient, "XGradient konnte nicht erzeugt werden" ); - rSet.Put( XFillStyleItem( XFILL_GRADIENT ) ); - rSet.Put( XFillGradientItem( aString, *pXGradient ) ); - - delete pXGradient; - } - return sal_True; -} - -// ----------------------------------------------------------------------- - -void SvxGradientTabPage::Reset( const SfxItemSet& ) -{ - // aLbGradients.SelectEntryPos( 0 ); - ChangeGradientHdl_Impl( this ); - - // Status der Buttons ermitteln - if( pGradientList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxGradientTabPage::Create( Window* pWindow, - const SfxItemSet& rOutAttrs ) -{ - return new SvxGradientTabPage( pWindow, rOutAttrs ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxGradientTabPage, ModifiedHdl_Impl, void *, pControl ) -{ - XGradientStyle eXGS = (XGradientStyle) aLbGradientType.GetSelectEntryPos(); - - XGradient aXGradient( aLbColorFrom.GetSelectEntryColor(), - aLbColorTo.GetSelectEntryColor(), - eXGS, - static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden - (sal_uInt16) aMtrCenterX.GetValue(), - (sal_uInt16) aMtrCenterY.GetValue(), - (sal_uInt16) aMtrBorder.GetValue(), - (sal_uInt16) aMtrColorFrom.GetValue(), - (sal_uInt16) aMtrColorTo.GetValue() ); - - // Enablen/Disablen von Controls - if( pControl == &aLbGradientType || pControl == this ) - SetControlState_Impl( eXGS ); - - // Anzeigen im XOutDev - rXFSet.Put( XFillGradientItem( String(), aXGradient ) ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreview.Invalidate(); - - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxGradientTabPage, ClickAddHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_GRADIENT ) ); - String aDesc( CUI_RES( RID_SVXSTR_DESC_GRADIENT ) ); - String aName; - - long nCount = pGradientList->Count(); - long j = 1; - sal_Bool bDifferent = sal_False; - - while( !bDifferent ) - { - aName = aNewName; - aName += sal_Unicode(' '); - aName += UniString::CreateFromInt32( j++ ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == pGradientList->GetGradient( i )->GetName() ) - bDifferent = sal_False; - } - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - WarningBox* pWarnBox = NULL; - sal_uInt16 nError = RID_SVXSTR_WARN_NAME_DUPLICATE; - - while( pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == pGradientList->GetGradient( i )->GetName() ) - bDifferent = sal_False; - - if( bDifferent ) - { - nError = 0; - break; - } - - if( !pWarnBox ) - { - pWarnBox = new WarningBox( DLGWIN, - WinBits( WB_OK_CANCEL ), - String( ResId( nError, rMgr ) ) ); - pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE ); - } - - if( pWarnBox->Execute() != RET_OK ) - break; - } - delete pDlg; - delete pWarnBox; - - if( !nError ) - { - XGradient aXGradient( aLbColorFrom.GetSelectEntryColor(), - aLbColorTo.GetSelectEntryColor(), - (XGradientStyle) aLbGradientType.GetSelectEntryPos(), - static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden - (sal_uInt16) aMtrCenterX.GetValue(), - (sal_uInt16) aMtrCenterY.GetValue(), - (sal_uInt16) aMtrBorder.GetValue(), - (sal_uInt16) aMtrColorFrom.GetValue(), - (sal_uInt16) aMtrColorTo.GetValue() ); - XGradientEntry* pEntry = new XGradientEntry( aXGradient, aName ); - - pGradientList->Insert( pEntry, nCount ); - - aLbGradients.Append( pEntry ); - - aLbGradients.SelectEntryPos( aLbGradients.GetEntryCount() - 1 ); - -#ifdef WNT - // hack: #31355# W.P. - Rectangle aRect( aLbGradients.GetPosPixel(), aLbGradients.GetSizePixel() ); - if( sal_True ) { // ??? overlapped with pDlg - // and srolling - Invalidate( aRect ); - } -#endif - - // Flag fuer modifiziert setzen - *pnGradientListState |= CT_MODIFIED; - - ChangeGradientHdl_Impl( this ); - } - - // Status der Buttons ermitteln - if( pGradientList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxGradientTabPage, ClickModifyHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbGradients.GetSelectEntryPos(); - - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_GRADIENT ) ); - String aDesc( CUI_RES( RID_SVXSTR_DESC_GRADIENT ) ); - String aName( pGradientList->GetGradient( nPos )->GetName() ); - String aOldName = aName; - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - - long nCount = pGradientList->Count(); - sal_Bool bDifferent = sal_False; - sal_Bool bLoop = sal_True; - - while( bLoop && pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - { - if( aName == pGradientList->GetGradient( i )->GetName() && - aName != aOldName ) - bDifferent = sal_False; - } - - if( bDifferent ) - { - bLoop = sal_False; - XGradient aXGradient( aLbColorFrom.GetSelectEntryColor(), - aLbColorTo.GetSelectEntryColor(), - (XGradientStyle) aLbGradientType.GetSelectEntryPos(), - static_cast<long>(aMtrAngle.GetValue() * 10), // sollte in Resource geaendert werden - (sal_uInt16) aMtrCenterX.GetValue(), - (sal_uInt16) aMtrCenterY.GetValue(), - (sal_uInt16) aMtrBorder.GetValue(), - (sal_uInt16) aMtrColorFrom.GetValue(), - (sal_uInt16) aMtrColorTo.GetValue() ); - - XGradientEntry* pEntry = new XGradientEntry( aXGradient, aName ); - - delete pGradientList->Replace( pEntry, nPos ); - - aLbGradients.Modify( pEntry, nPos ); - - aLbGradients.SelectEntryPos( nPos ); - - // Flag fuer modifiziert setzen - *pnGradientListState |= CT_MODIFIED; - } - else - { - WarningBox aBox( DLGWIN, WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); - aBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); - aBox.Execute(); - } - - } - delete pDlg; - } - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxGradientTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbGradients.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ), - String( CUI_RES( RID_SVXSTR_ASK_DEL_GRADIENT ) ) ); - - if ( aQueryBox.Execute() == RET_YES ) - { - delete pGradientList->Remove( nPos ); - aLbGradients.RemoveEntry( nPos ); - aLbGradients.SelectEntryPos( 0 ); - - aCtlPreview.Invalidate(); - - ChangeGradientHdl_Impl( this ); - - // Flag fuer modifiziert setzen - *pnGradientListState |= CT_MODIFIED; - } - } - // Status der Buttons ermitteln - if( !pGradientList->Count() ) - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return 0L; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxGradientTabPage, ClickLoadHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - sal_uInt16 nReturn = RET_YES; - - if ( *pnGradientListState & CT_MODIFIED ) - { - nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ), - String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute(); - - if ( nReturn == RET_YES ) - pGradientList->Save(); - } - - if ( nReturn != RET_CANCEL ) - { - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sog" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( aDlg.Execute() == ERRCODE_NONE ) - { - EnterWait(); - - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - // Liste speichern - XGradientList* pGrdList = new XGradientList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool ); - pGrdList->SetName( aURL.getName() ); - - if ( pGrdList->Load() ) - { - // Pruefen, ob Tabelle geloescht werden darf: - if ( pGradientList != - ( (SvxAreaTabDialog*) DLGWIN )->GetGradientList() ) - delete pGradientList; - - pGradientList = pGrdList; - ( (SvxAreaTabDialog*) DLGWIN )-> - SetNewGradientList( pGradientList ); - - aLbGradients.Clear(); - aLbGradients.Fill( pGradientList ); - Reset( rOutAttrs ); - - pGradientList->SetName( aURL.getName() ); - - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( ResId( RID_SVXSTR_TABLE, rMgr ) ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - // Flag fuer gewechselt setzen - *pnGradientListState |= CT_CHANGED; - // Flag fuer modifiziert entfernen - *pnGradientListState &= ~CT_MODIFIED; - LeaveWait(); - } - else - { - LeaveWait(); - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute(); - } - } - } - - // Status der Buttons ermitteln - if( pGradientList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return 0L; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxGradientTabPage, ClickSaveHdl_Impl, void *, EMPTYARG ) -{ - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sog" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( pGradientList->GetName().Len() ) - { - aFile.Append( pGradientList->GetName() ); - - if( !aFile.getExtension().getLength() ) - aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "sog" ) ) ); - } - - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - if ( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - pGradientList->SetName( aURL.getName() ); - pGradientList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( pGradientList->Save() ) - { - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - // Flag fuer gespeichert setzen - *pnGradientListState |= CT_SAVED; - // Flag fuer modifiziert entfernen - *pnGradientListState &= ~CT_MODIFIED; - } - else - { - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute(); - } - } - - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxGradientTabPage, ChangeGradientHdl_Impl, void *, EMPTYARG ) -{ - XGradient* pGradient = NULL; - int nPos = aLbGradients.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - pGradient = new XGradient( ( (XGradientEntry*) pGradientList->GetGradient( nPos ) )->GetGradient() ); - else - { - const SfxPoolItem* pPoolItem = NULL; - if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLSTYLE ), sal_True, &pPoolItem ) ) - { - if( ( XFILL_GRADIENT == (XFillStyle) ( ( const XFillStyleItem* ) pPoolItem )->GetValue() ) && - ( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLGRADIENT ), sal_True, &pPoolItem ) ) ) - { - pGradient = new XGradient( ( ( const XFillGradientItem* ) pPoolItem )->GetGradientValue() ); - } - } - if( !pGradient ) - { - aLbGradients.SelectEntryPos( 0 ); - nPos = aLbGradients.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - pGradient = new XGradient( ( (XGradientEntry*) pGradientList->GetGradient( nPos ) )->GetGradient() ); - } - } - - if( pGradient ) - { - XGradientStyle eXGS = pGradient->GetGradientStyle(); - - aLbGradientType.SelectEntryPos( - sal::static_int_cast< sal_uInt16 >( eXGS ) ); - // Wenn der EIntrag nicht in der Listbox ist, werden die Farben - // temporaer hinzugenommen - aLbColorFrom.SetNoSelection(); - aLbColorFrom.SelectEntry( pGradient->GetStartColor() ); - - if ( aLbColorFrom.GetSelectEntryCount() == 0 ) - { - aLbColorFrom.InsertEntry( pGradient->GetStartColor(), - String() ); - aLbColorFrom.SelectEntry( pGradient->GetStartColor() ); - } - aLbColorTo.SetNoSelection(); - aLbColorTo.SelectEntry( pGradient->GetEndColor() ); - - if ( aLbColorTo.GetSelectEntryCount() == 0 ) - { - aLbColorTo.InsertEntry( pGradient->GetEndColor(), String() ); - aLbColorTo.SelectEntry( pGradient->GetEndColor() ); - } - - aMtrAngle.SetValue( pGradient->GetAngle() / 10 ); // sollte in Resource geaendert werden - aMtrBorder.SetValue( pGradient->GetBorder() ); - aMtrCenterX.SetValue( pGradient->GetXOffset() ); - aMtrCenterY.SetValue( pGradient->GetYOffset() ); - aMtrColorFrom.SetValue( pGradient->GetStartIntens() ); - aMtrColorTo.SetValue( pGradient->GetEndIntens() ); - - // Controls Disablen/Enablen - SetControlState_Impl( eXGS ); - - // ItemSet fuellen und an aCtlPreview weiterleiten - rXFSet.Put( XFillGradientItem( String(), *pGradient ) ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreview.Invalidate(); - delete pGradient; - } - return 0L; -} - -//------------------------------------------------------------------------ - -void SvxGradientTabPage::SetControlState_Impl( XGradientStyle eXGS ) -{ - switch( eXGS ) - { - case XGRAD_LINEAR: - case XGRAD_AXIAL: - aFtCenterX.Disable(); - aMtrCenterX.Disable(); - aFtCenterY.Disable(); - aMtrCenterY.Disable(); - aFtAngle.Enable(); - aMtrAngle.Enable(); - break; - - case XGRAD_RADIAL: - aFtCenterX.Enable(); - aMtrCenterX.Enable(); - aFtCenterY.Enable(); - aMtrCenterY.Enable(); - aFtAngle.Disable(); - aMtrAngle.Disable(); - break; - - case XGRAD_ELLIPTICAL: - aFtCenterX.Enable(); - aMtrCenterX.Enable(); - aFtCenterY.Enable(); - aMtrCenterY.Enable(); - aFtAngle.Enable(); - aMtrAngle.Enable(); - break; - - case XGRAD_SQUARE: - case XGRAD_RECT: - aFtCenterX.Enable(); - aMtrCenterX.Enable(); - aFtCenterY.Enable(); - aMtrCenterY.Enable(); - aFtAngle.Enable(); - aMtrAngle.Enable(); - break; - } -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx deleted file mode 100644 index 8c6901684..000000000 --- a/cui/source/tabpages/tphatch.cxx +++ /dev/null @@ -1,876 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <tools/shl.hxx> -#include <tools/urlobj.hxx> -#include <vcl/msgbox.hxx> -#include <unotools/pathoptions.hxx> -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <sfx2/filedlghelper.hxx> -#include "com/sun/star/ui/dialogs/TemplateDescription.hpp" - -#define _SVX_TPHATCH_CXX - -#include <cuires.hrc> -#include "tabarea.hrc" -#include "helpid.hrc" -#include "svx/xattr.hxx" -#include <svx/xpool.hxx> -#include <svx/xtable.hxx> -#include "svx/drawitem.hxx" -#include "cuitabarea.hxx" -#include "defdlgname.hxx" -#include <svx/svxdlg.hxx> -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include <svx/dialmgr.hxx> -#include "paragrph.hrc" -#include <svx/dialogs.hrc> - -#define DLGWIN this->GetParent()->GetParent() - -#define BITMAP_WIDTH 32 -#define BITMAP_HEIGHT 12 - -/************************************************************************* -|* -|* Dialog zum Aendern und Definieren der Schraffuren -|* -\************************************************************************/ - -SvxHatchTabPage::SvxHatchTabPage -( - Window* pParent, - const SfxItemSet& rInAttrs -) : - - SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_HATCH ), rInAttrs ), - - aFtDistance ( this, CUI_RES( FT_LINE_DISTANCE ) ), - aMtrDistance ( this, CUI_RES( MTR_FLD_DISTANCE ) ), - aFtAngle ( this, CUI_RES( FT_LINE_ANGLE ) ), - aMtrAngle ( this, CUI_RES( MTR_FLD_ANGLE ) ), - aCtlAngle ( this, CUI_RES( CTL_ANGLE ), - RP_RB, 200, 80, CS_ANGLE ), - aFlProp ( this, CUI_RES( FL_PROP ) ), - aFtLineType ( this, CUI_RES( FT_LINE_TYPE ) ), - aLbLineType ( this, CUI_RES( LB_LINE_TYPE ) ), - aFtLineColor ( this, CUI_RES( FT_LINE_COLOR ) ), - aLbLineColor ( this, CUI_RES( LB_LINE_COLOR ) ), - aLbHatchings ( this, CUI_RES( LB_HATCHINGS ) ), - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ), - aBtnAdd ( this, CUI_RES( BTN_ADD ) ), - aBtnModify ( this, CUI_RES( BTN_MODIFY ) ), - aBtnDelete ( this, CUI_RES( BTN_DELETE ) ), - aBtnLoad ( this, CUI_RES( BTN_LOAD ) ), - aBtnSave ( this, CUI_RES( BTN_SAVE ) ), - - rOutAttrs ( rInAttrs ), - pColorTab( NULL ), - pHatchingList( NULL ), - - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXFStyleItem ( XFILL_HATCH ), - aXHatchItem ( String(), XHatch() ), - aXFillAttr ( pXPool ), - rXFSet ( aXFillAttr.GetItemSet() ) - -{ - FreeResource(); - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - // Metrik einstellen - FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs ); - - switch ( eFUnit ) - { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; - break; - default: ;//prevent warning - } - SetFieldUnit( aMtrDistance, eFUnit ); - - // PoolUnit ermitteln - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool?" ); - ePoolUnit = pPool->GetMetric( SID_ATTR_FILL_HATCH ); - - // Setzen des Output-Devices - rXFSet.Put( aXFStyleItem ); - rXFSet.Put( aXHatchItem ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - aLbHatchings.SetSelectHdl( LINK( this, SvxHatchTabPage, ChangeHatchHdl_Impl ) ); - - Link aLink = LINK( this, SvxHatchTabPage, ModifiedHdl_Impl ); - aMtrDistance.SetModifyHdl( aLink ); - aMtrAngle.SetModifyHdl( aLink ); - aLbLineType.SetSelectHdl( aLink ); - aLbLineColor.SetSelectHdl( aLink ); - - aBtnAdd.SetClickHdl( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) ); - aBtnModify.SetClickHdl( - LINK( this, SvxHatchTabPage, ClickModifyHdl_Impl ) ); - aBtnDelete.SetClickHdl( - LINK( this, SvxHatchTabPage, ClickDeleteHdl_Impl ) ); - aBtnLoad.SetClickHdl( LINK( this, SvxHatchTabPage, ClickLoadHdl_Impl ) ); - aBtnSave.SetClickHdl( LINK( this, SvxHatchTabPage, ClickSaveHdl_Impl ) ); - - aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); - - aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE))); - aLbHatchings.SetAccessibleName( String(CUI_RES(STR_LB_HATCHINGSTYLE)) ); - aCtlAngle.SetAccessibleRelationMemberOf( &aFlProp ); - aLbHatchings.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnModify.SetAccessibleRelationMemberOf( &aFlProp ); - aBtnDelete.SetAccessibleRelationMemberOf( &aFlProp ); - aLbHatchings.SetAccessibleRelationLabeledBy(&aLbHatchings); -} - -// ----------------------------------------------------------------------- - -void SvxHatchTabPage::Construct() -{ - // Farbtabelle - aLbLineColor.Fill( pColorTab ); - - // Schraffurentabelle - aLbHatchings.Fill( pHatchingList ); -} - -// ----------------------------------------------------------------------- - -void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) -{ - sal_uInt16 nPos; - sal_uInt16 nCount; - - if( *pDlgType == 0 ) // Flaechen-Dialog - { - *pbAreaTP = sal_False; - - if( pColorTab ) - { - // ColorTable - if( *pnColorTableState & CT_CHANGED || - *pnColorTableState & CT_MODIFIED ) - { - if( *pnColorTableState & CT_CHANGED ) - pColorTab = ( (SvxAreaTabDialog*) DLGWIN )->GetNewColorTable(); - - // LbLineColor - nPos = aLbLineColor.GetSelectEntryPos(); - aLbLineColor.Clear(); - aLbLineColor.Fill( pColorTab ); - nCount = aLbLineColor.GetEntryCount(); - if( nCount == 0 ) - ; // Dieser Fall sollte nicht auftreten - else if( nCount <= nPos ) - aLbLineColor.SelectEntryPos( 0 ); - else - aLbLineColor.SelectEntryPos( nPos ); - - ModifiedHdl_Impl( this ); - } - - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - INetURLObject aURL( pHatchingList->GetPath() ); - - aURL.Append( pHatchingList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - if( *pPageType == PT_HATCH && *pPos != LISTBOX_ENTRY_NOTFOUND ) - { - aLbHatchings.SelectEntryPos( *pPos ); - } - // Farben koennten geloescht worden sein - ChangeHatchHdl_Impl( this ); - - *pPageType = PT_HATCH; - *pPos = LISTBOX_ENTRY_NOTFOUND; - } - } - - rXFSet.Put ( ( XFillColorItem& ) rSet.Get(XATTR_FILLCOLOR) ); - rXFSet.Put ( ( XFillBackgroundItem&)rSet.Get(XATTR_FILLBACKGROUND) ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreview.Invalidate(); -} - -// ----------------------------------------------------------------------- - -int SvxHatchTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if ( CheckChanges_Impl() == -1L ) - return KEEP_PAGE; - - if( _pSet ) - FillItemSet( *_pSet ); - - return LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -long SvxHatchTabPage::CheckChanges_Impl() -{ - if( aMtrDistance.GetText() != aMtrDistance.GetSavedValue() || - aMtrAngle.GetText() != aMtrAngle.GetSavedValue() || - aLbLineType.GetSelectEntryPos() != aLbLineType.GetSavedValue() || - aLbLineColor.GetSelectEntryPos() != aLbLineColor.GetSavedValue() || - aLbHatchings.GetSelectEntryPos() != aLbHatchings.GetSavedValue() ) - { - ResMgr& rMgr = CUI_MGR(); - Image aWarningBoxImage = WarningBox::GetStandardImage(); - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX, - SVX_RESSTR( RID_SVXSTR_HATCH ), - CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_HATCH ), - &aWarningBoxImage ); - DBG_ASSERT(aMessDlg, "Dialogdiet fail!"); - aMessDlg->SetButtonText( MESS_BTN_1, - String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) ); - aMessDlg->SetButtonText( MESS_BTN_2, - String( ResId( RID_SVXSTR_ADD, rMgr ) ) ); - - short nRet = aMessDlg->Execute(); - - switch( nRet ) - { - case RET_BTN_1: // Aendern - { - ClickModifyHdl_Impl( this ); - } - break; - - case RET_BTN_2: // Hinzufuegen - { - ClickAddHdl_Impl( this ); - } - break; - - case RET_CANCEL: - break; - } - delete aMessDlg; - } - - sal_uInt16 nPos = aLbHatchings.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - *pPos = nPos; - return 0L; -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxHatchTabPage::FillItemSet( SfxItemSet& rSet ) -{ - if( *pDlgType == 0 && *pbAreaTP == sal_False ) // Flaechen-Dialog - { - if( *pPageType == PT_HATCH ) - { - // CheckChanges(); <-- doppelte Abfrage ? - - XHatch* pXHatch = NULL; - String aString; - sal_uInt16 nPos = aLbHatchings.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - pXHatch = new XHatch( pHatchingList->GetHatch( nPos )->GetHatch() ); - aString = aLbHatchings.GetSelectEntry(); - } - // Farbverlauf wurde (unbekannt) uebergeben - else - { - pXHatch = new XHatch( aLbLineColor.GetSelectEntryColor(), - (XHatchStyle) aLbLineType.GetSelectEntryPos(), - GetCoreValue( aMtrDistance, ePoolUnit ), - static_cast<long>(aMtrAngle.GetValue() * 10) ); - } - DBG_ASSERT( pXHatch, "XHatch konnte nicht erzeugt werden" ); - rSet.Put( XFillStyleItem( XFILL_HATCH ) ); - rSet.Put( XFillHatchItem( aString, *pXHatch ) ); - - delete pXHatch; - } - } - return sal_True; -} - -// ----------------------------------------------------------------------- - -void SvxHatchTabPage::Reset( const SfxItemSet& rSet ) -{ - ChangeHatchHdl_Impl( this ); - - // Status der Buttons ermitteln - if( pHatchingList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - - rXFSet.Put ( ( XFillColorItem& ) rSet.Get(XATTR_FILLCOLOR) ); - rXFSet.Put ( ( XFillBackgroundItem&)rSet.Get(XATTR_FILLBACKGROUND) ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - aCtlPreview.Invalidate(); -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxHatchTabPage::Create( Window* pWindow, - const SfxItemSet& rSet ) -{ - return new SvxHatchTabPage( pWindow, rSet ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxHatchTabPage, ModifiedHdl_Impl, void *, p ) -{ - if( p == &aMtrAngle ) - { - // Setzen des Winkels im AngleControl - switch( aMtrAngle.GetValue() ) - { - case 135: aCtlAngle.SetActualRP( RP_LT ); break; - case 90: aCtlAngle.SetActualRP( RP_MT ); break; - case 45: aCtlAngle.SetActualRP( RP_RT ); break; - case 180: aCtlAngle.SetActualRP( RP_LM ); break; - case 0: aCtlAngle.SetActualRP( RP_RM ); break; - case 225: aCtlAngle.SetActualRP( RP_LB ); break; - case 270: aCtlAngle.SetActualRP( RP_MB ); break; - case 315: aCtlAngle.SetActualRP( RP_RB ); break; - default: aCtlAngle.SetActualRP( RP_MM ); break; - } - } - - XHatch aXHatch( aLbLineColor.GetSelectEntryColor(), - (XHatchStyle) aLbLineType.GetSelectEntryPos(), - GetCoreValue( aMtrDistance, ePoolUnit ), - static_cast<long>(aMtrAngle.GetValue() * 10) ); - - rXFSet.Put( XFillHatchItem( String(), aXHatch ) ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreview.Invalidate(); - - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxHatchTabPage, ChangeHatchHdl_Impl, void *, EMPTYARG ) -{ - XHatch* pHatch = NULL; - int nPos = aLbHatchings.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - pHatch = new XHatch( ( (XHatchEntry*) pHatchingList->GetHatch( nPos ) )->GetHatch() ); - else - { - const SfxPoolItem* pPoolItem = NULL; - if( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLSTYLE ), sal_True, &pPoolItem ) ) - { - if( ( XFILL_HATCH == (XFillStyle) ( ( const XFillStyleItem* ) pPoolItem )->GetValue() ) && - ( SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLHATCH ), sal_True, &pPoolItem ) ) ) - { - pHatch = new XHatch( ( ( const XFillHatchItem* ) pPoolItem )->GetHatchValue() ); - } - } - if( !pHatch ) - { - aLbHatchings.SelectEntryPos( 0 ); - nPos = aLbHatchings.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - pHatch = new XHatch( ( (XHatchEntry*) pHatchingList->GetHatch( nPos ) )->GetHatch() ); - } - } - if( pHatch ) - { - aLbLineType.SelectEntryPos( - sal::static_int_cast< sal_uInt16 >( pHatch->GetHatchStyle() ) ); - // Wenn der Eintrag nicht in der Listbox ist, wird die Farbe - // temporaer hinzugenommen - aLbLineColor.SetNoSelection(); - aLbLineColor.SelectEntry( pHatch->GetColor() ); - if( aLbLineColor.GetSelectEntryCount() == 0 ) - { - aLbLineColor.InsertEntry( pHatch->GetColor(), String() ); - aLbLineColor.SelectEntry( pHatch->GetColor() ); - } - SetMetricValue( aMtrDistance, pHatch->GetDistance(), ePoolUnit ); - aMtrAngle.SetValue( pHatch->GetAngle() / 10 ); - - // Setzen des Winkels im AngleControl - switch( aMtrAngle.GetValue() ) - { - case 135: aCtlAngle.SetActualRP( RP_LT ); break; - case 90: aCtlAngle.SetActualRP( RP_MT ); break; - case 45: aCtlAngle.SetActualRP( RP_RT ); break; - case 180: aCtlAngle.SetActualRP( RP_LM ); break; - case 0: aCtlAngle.SetActualRP( RP_RM ); break; - case 225: aCtlAngle.SetActualRP( RP_LB ); break; - case 270: aCtlAngle.SetActualRP( RP_MB ); break; - case 315: aCtlAngle.SetActualRP( RP_RB ); break; - default: aCtlAngle.SetActualRP( RP_MM ); break; - } - - // ItemSet fuellen und an aCtlPreview weiterleiten - rXFSet.Put( XFillHatchItem( String(), *pHatch ) ); - aCtlPreview.SetAttributes( aXFillAttr.GetItemSet() ); - - aCtlPreview.Invalidate(); - delete pHatch; - } - aMtrDistance.SaveValue(); - aMtrAngle.SaveValue(); - aLbLineType.SaveValue(); - aLbLineColor.SaveValue(); - aLbHatchings.SaveValue(); - - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxHatchTabPage, ClickAddHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_HATCH ) ); - String aDesc( CUI_RES( RID_SVXSTR_DESC_HATCH ) ); - String aName; - - long nCount = pHatchingList->Count(); - long j = 1; - sal_Bool bDifferent = sal_False; - - while( !bDifferent ) - { - aName = aNewName; - aName += sal_Unicode(' '); - aName += UniString::CreateFromInt32( j++ ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == pHatchingList->GetHatch( i )->GetName() ) - bDifferent = sal_False; - } - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - WarningBox* pWarnBox = NULL; - sal_uInt16 nError = RID_SVXSTR_WARN_NAME_DUPLICATE; - - while( pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - if( aName == pHatchingList->GetHatch( i )->GetName() ) - bDifferent = sal_False; - - if( bDifferent ) { - nError = 0; - break; - } - - if( !pWarnBox ) - { - pWarnBox = new WarningBox( DLGWIN, - WinBits( WB_OK_CANCEL ), - String( ResId( nError, rMgr ) ) ); - pWarnBox->SetHelpId( HID_WARN_NAME_DUPLICATE ); - } - - if( pWarnBox->Execute() != RET_OK ) - break; - } - delete pDlg; - delete pWarnBox; - - if( !nError ) - { - XHatch aXHatch( aLbLineColor.GetSelectEntryColor(), - (XHatchStyle) aLbLineType.GetSelectEntryPos(), - GetCoreValue( aMtrDistance, ePoolUnit ), - static_cast<long>(aMtrAngle.GetValue() * 10) ); - XHatchEntry* pEntry = new XHatchEntry( aXHatch, aName ); - - pHatchingList->Insert( pEntry, nCount ); - - aLbHatchings.Append( pEntry ); - - aLbHatchings.SelectEntryPos( aLbHatchings.GetEntryCount() - 1 ); - -#ifdef WNT - // hack: #31355# W.P. - Rectangle aRect( aLbHatchings.GetPosPixel(), aLbHatchings.GetSizePixel() ); - if( sal_True ) { // ??? overlapped with pDlg - // and srolling - Invalidate( aRect ); - } -#endif - - // Flag fuer modifiziert setzen - *pnHatchingListState |= CT_MODIFIED; - - ChangeHatchHdl_Impl( this ); - } - - // Status der Buttons ermitteln - if( pHatchingList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxHatchTabPage, ClickModifyHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbHatchings.GetSelectEntryPos(); - - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_HATCH ) ); - String aDesc( CUI_RES( RID_SVXSTR_DESC_HATCH ) ); - String aName( pHatchingList->GetHatch( nPos )->GetName() ); - String aOldName = aName; - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - - long nCount = pHatchingList->Count(); - sal_Bool bDifferent = sal_False; - sal_Bool bLoop = sal_True; - while( bLoop && pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - { - if( aName == pHatchingList->GetHatch( i )->GetName() && - aName != aOldName ) - bDifferent = sal_False; - } - - if( bDifferent ) - { - bLoop = sal_False; - XHatch aXHatch( aLbLineColor.GetSelectEntryColor(), - (XHatchStyle) aLbLineType.GetSelectEntryPos(), - GetCoreValue( aMtrDistance, ePoolUnit ), - static_cast<long>(aMtrAngle.GetValue() * 10) ); - - XHatchEntry* pEntry = new XHatchEntry( aXHatch, aName ); - - delete pHatchingList->Replace( pEntry, nPos ); - - aLbHatchings.Modify( pEntry, nPos ); - - aLbHatchings.SelectEntryPos( nPos ); - - // Werte sichern fuer Changes-Erkennung ( -> Methode ) - aMtrDistance.SaveValue(); - aMtrAngle.SaveValue(); - aLbLineType.SaveValue(); - aLbLineColor.SaveValue(); - aLbHatchings.SaveValue(); - - // Flag fuer modifiziert setzen - *pnHatchingListState |= CT_MODIFIED; - } - else - { - WarningBox aBox( DLGWIN, WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); - aBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); - aBox.Execute(); - } - } - delete( pDlg ); - } - return 0L; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxHatchTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbHatchings.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ), - String( CUI_RES( RID_SVXSTR_ASK_DEL_HATCH ) ) ); - - if( aQueryBox.Execute() == RET_YES ) - { - delete pHatchingList->Remove( nPos ); - aLbHatchings.RemoveEntry( nPos ); - aLbHatchings.SelectEntryPos( 0 ); - - aCtlPreview.Invalidate(); - - ChangeHatchHdl_Impl( this ); - - // Flag fuer modifiziert setzen - *pnHatchingListState |= CT_MODIFIED; - } - } - // Status der Buttons ermitteln - if( !pHatchingList->Count() ) - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return 0L; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHatchTabPage, ClickLoadHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - sal_uInt16 nReturn = RET_YES; - - if ( *pnHatchingListState & CT_MODIFIED ) - { - nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ), - String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute(); - - if ( nReturn == RET_YES ) - pHatchingList->Save(); - } - - if ( nReturn != RET_CANCEL ) - { - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soh" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - // Liste speichern - XHatchList* pHatchList = new XHatchList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool ); - pHatchList->SetName( aURL.getName() ); - if( pHatchList->Load() ) - { - // Pruefen, ob Tabelle geloescht werden darf: - if( pHatchingList != ( (SvxAreaTabDialog*) DLGWIN )->GetHatchingList() ) - delete pHatchingList; - - pHatchingList = pHatchList; - ( (SvxAreaTabDialog*) DLGWIN )->SetNewHatchingList( pHatchingList ); - - aLbHatchings.Clear(); - aLbHatchings.Fill( pHatchingList ); - Reset( rOutAttrs ); - - pHatchingList->SetName( aURL.getName() ); - - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( ResId( RID_SVXSTR_TABLE, rMgr ) ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - // Flag fuer gewechselt setzen - *pnHatchingListState |= CT_CHANGED; - // Flag fuer modifiziert entfernen - *pnHatchingListState &= ~CT_MODIFIED; - } - else - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute(); - } - } - - // Status der Buttons ermitteln - if ( pHatchingList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return 0L; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHatchTabPage, ClickSaveHdl_Impl, void *, EMPTYARG ) -{ - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soh" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( pHatchingList->GetName().Len() ) - { - aFile.Append( pHatchingList->GetName() ); - - if( !aFile.getExtension().getLength() ) - aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "soh" ) ) ); - } - - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - if ( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - pHatchingList->SetName( aURL.getName() ); - pHatchingList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( pHatchingList->Save() ) - { - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - - if ( aURL.getBase().getLength() > 18 ) - { - aString += String(aURL.getBase()).Copy( 0, 15 ); - aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) ); - } - else - aString += String(aURL.getBase()); - - // Flag fuer gespeichert setzen - *pnHatchingListState |= CT_SAVED; - // Flag fuer modifiziert entfernen - *pnHatchingListState &= ~CT_MODIFIED; - } - else - { - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute(); - } - } - - return 0L; -} - -//------------------------------------------------------------------------ - -void SvxHatchTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt ) -{ - if( pWindow == &aCtlAngle ) - { - switch( eRcPt ) - { - case RP_LT: aMtrAngle.SetValue( 135 ); break; - case RP_MT: aMtrAngle.SetValue( 90 ); break; - case RP_RT: aMtrAngle.SetValue( 45 ); break; - case RP_LM: aMtrAngle.SetValue( 180 ); break; - case RP_RM: aMtrAngle.SetValue( 0 ); break; - case RP_LB: aMtrAngle.SetValue( 225 ); break; - case RP_MB: aMtrAngle.SetValue( 270 ); break; - case RP_RB: aMtrAngle.SetValue( 315 ); break; - case RP_MM: break; - } - ModifiedHdl_Impl( this ); - } -} - - -void SvxHatchTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - if ( ( rDCEvt.GetType() == DATACHANGED_SETTINGS ) && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) ) - aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); - - SvxTabPage::DataChanged( rDCEvt ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx deleted file mode 100644 index ee1b0a3ec..000000000 --- a/cui/source/tabpages/tpline.cxx +++ /dev/null @@ -1,1845 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#ifndef _SVX_SIZEITEM_HXX //autogen -#include <editeng/sizeitem.hxx> -#endif -#include <tools/shl.hxx> -#include <tools/urlobj.hxx> -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> - -#define _SVX_TPLINE_CXX - -#include <cuires.hrc> -#include "tabline.hrc" -#include "svx/xattr.hxx" -#include <svx/xpool.hxx> -#include <svx/xtable.hxx> -#include "svx/drawitem.hxx" -#include "cuitabline.hxx" -#include "dlgname.hxx" -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include "svx/svxgrahicitem.hxx" -#include <sfx2/request.hxx> -#include "svx/ofaitem.hxx" -#include <svx/svdobj.hxx> -#include <svx/svdview.hxx> -#include <svx/svdmodel.hxx> -#include <svx/numvset.hxx> -#include <vcl/msgbox.hxx> -#include <editeng/numitem.hxx> -#include <editeng/svxenum.hxx> -#include <sfx2/objsh.hxx> -#include <editeng/brshitem.hxx> -#include <svx/gallery.hxx> -#include <svx/xbitmap.hxx> -#include <unotools/localfilehelper.hxx> -#include "paragrph.hrc" -#include "sfx2/opengrf.hxx" -#include <svx/dialmgr.hxx> -#include <svx/dialogs.hrc> - -#define MAX_BMP_WIDTH 16 -#define MAX_BMP_HEIGHT 16 -// define ---------------------------------------------------------------- - -#define DLGWIN this->GetParent()->GetParent() - -#define BITMAP_WIDTH 32 -#define BITMAP_HEIGHT 12 -#define XOUT_WIDTH 150 - -// static ---------------------------------------------------------------- - -static sal_uInt16 pLineRanges[] = -{ - XATTR_LINETRANSPARENCE, - XATTR_LINETRANSPARENCE, - SID_ATTR_LINE_STYLE, - SID_ATTR_LINE_ENDCENTER, - 0 -}; - -/************************************************************************* -|* -|* Dialog zum Aendern der Linien -|* -\************************************************************************/ - -SvxLineTabPage::SvxLineTabPage -( - Window* pParent, - const SfxItemSet& rInAttrs -) : - SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_LINE ), rInAttrs ), - aFlLine ( this, CUI_RES( FL_LINE ) ), - aFtLineStyle ( this, CUI_RES( FT_LINE_STYLE ) ), - aLbLineStyle ( this, CUI_RES( LB_LINE_STYLE ) ), - aFtColor ( this, CUI_RES( FT_COLOR ) ), - aLbColor ( this, CUI_RES( LB_COLOR ) ), - aFtLineWidth ( this, CUI_RES( FT_LINE_WIDTH ) ), - aMtrLineWidth ( this, CUI_RES( MTR_FLD_LINE_WIDTH ) ), - aFtTransparent ( this, CUI_RES( FT_TRANSPARENT ) ), - aMtrTransparent ( this, CUI_RES( MTR_LINE_TRANSPARENT ) ), - aFlLineEnds ( this, CUI_RES( FL_LINE_ENDS ) ), - aLbStartStyle ( this, CUI_RES( LB_START_STYLE ) ), - aMtrStartWidth ( this, CUI_RES( MTR_FLD_START_WIDTH ) ), - aTsbCenterStart ( this, CUI_RES( TSB_CENTER_START ) ), - aFtLineEndsStyle ( this, CUI_RES( FT_LINE_ENDS_STYLE ) ), - aLbEndStyle ( this, CUI_RES( LB_END_STYLE ) ), - aFtLineEndsWidth ( this, CUI_RES( FT_LINE_ENDS_WIDTH ) ), - aMtrEndWidth ( this, CUI_RES( MTR_FLD_END_WIDTH ) ), - aTsbCenterEnd ( this, CUI_RES( TSB_CENTER_END ) ), - aCbxSynchronize ( this, CUI_RES( CBX_SYNCHRONIZE ) ), - aFLSeparator ( this, CUI_RES( FL_SEPARATOR ) ), - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ), - - // #116827# - maFLEdgeStyle ( this, CUI_RES( FL_EDGE_STYLE ) ), - maFTEdgeStyle ( this, CUI_RES( FT_EDGE_STYLE ) ), - maLBEdgeStyle ( this, CUI_RES( LB_EDGE_STYLE ) ), - - pSymbolList(NULL), - bNewSize(false), - nNumMenuGalleryItems(0), - nSymbolType(SVX_SYMBOLTYPE_UNKNOWN), //unbekannt bzw. unchanged - pSymbolAttr(NULL), - //#58425# Symbole auf einer Linie (z.B. StarChart) - aFlSymbol ( this, CUI_RES(FL_SYMBOL_FORMAT)), - aSymbolMB ( this, CUI_RES(MB_SYMBOL_BITMAP)), - aSymbolWidthFT ( this, CUI_RES(FT_SYMBOL_WIDTH)), - aSymbolWidthMF ( this, CUI_RES(MF_SYMBOL_WIDTH)), - aSymbolHeightFT ( this, CUI_RES(FT_SYMBOL_HEIGHT)), - aSymbolHeightMF ( this, CUI_RES(MF_SYMBOL_HEIGHT)), - aSymbolRatioCB ( this, CUI_RES(CB_SYMBOL_RATIO)), - - bLastWidthModified(sal_False), - aSymbolLastSize(Size(0,0)), - bSymbols(sal_False), - - rOutAttrs ( rInAttrs ), - bObjSelected( sal_False ), - - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXLStyle ( XLINE_DASH ), - aXWidth ( 1 ), - aXDash ( String(), XDash( XDASH_RECT, 3, 7, 2, 40, 15 ) ), - aXColor ( String(), COL_LIGHTRED ), - aXLineAttr ( pXPool ), - rXLSet ( aXLineAttr.GetItemSet() ), - pnLineEndListState( 0 ), - pnDashListState( 0 ), - pnColorTableState( 0 ), - nPageType ( 0 ) -{ - aLbEndStyle.SetAccessibleName(String(CUI_RES(STR_STYLE))); - aLbStartStyle.SetAccessibleName(String(CUI_RES( STR_LB_START_STYLE ) ) ); - aMtrStartWidth.SetAccessibleName(String(CUI_RES( STR_MTR_FLD_START_WIDTH ) ) ); - aLbEndStyle.SetAccessibleName(String(CUI_RES( STR_LB_END_STYLE ) ) ); - aMtrEndWidth.SetAccessibleName(String(CUI_RES( STR_MTR_FLD_END_WIDTH ) ) ); - aTsbCenterStart.SetAccessibleName(String(CUI_RES( STR_CENTER_START ) ) ); - aTsbCenterEnd.SetAccessibleName(String(CUI_RES( STR_CENTER_END ) ) ); - - FreeResource(); - - aCtlPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE))); - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - // Metrik einstellen - FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs ); - - switch ( eFUnit ) - { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; - // no break -> we now have mm - case FUNIT_MM: - aMtrLineWidth.SetSpinSize( 50 ); - aMtrStartWidth.SetSpinSize( 50 ); - aMtrEndWidth.SetSpinSize( 50 ); - break; - - case FUNIT_INCH: - aMtrLineWidth.SetSpinSize( 2 ); - aMtrStartWidth.SetSpinSize( 2 ); - aMtrEndWidth.SetSpinSize( 2 ); - break; - default: ;//prevent warning - } - SetFieldUnit( aMtrLineWidth, eFUnit ); - SetFieldUnit( aMtrStartWidth, eFUnit ); - SetFieldUnit( aMtrEndWidth, eFUnit ); - - // PoolUnit ermitteln - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool?" ); - ePoolUnit = pPool->GetMetric( SID_ATTR_LINE_WIDTH ); - - aLbLineStyle.SetSelectHdl( - LINK( this, SvxLineTabPage, ClickInvisibleHdl_Impl ) ); - aLbColor.SetSelectHdl( - LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) ); - aMtrLineWidth.SetModifyHdl( - LINK( this, SvxLineTabPage, ChangePreviewHdl_Impl ) ); - aMtrTransparent.SetModifyHdl( - LINK( this, SvxLineTabPage, ChangeTransparentHdl_Impl ) ); - - Link aStart = LINK( this, SvxLineTabPage, ChangeStartHdl_Impl ); - Link aEnd = LINK( this, SvxLineTabPage, ChangeEndHdl_Impl ); - aLbStartStyle.SetSelectHdl( aStart ); - aLbEndStyle.SetSelectHdl( aEnd ); - aMtrStartWidth.SetModifyHdl( aStart ); - aMtrEndWidth.SetModifyHdl( aEnd ); - aTsbCenterStart.SetClickHdl( aStart ); - aTsbCenterEnd.SetClickHdl( aEnd ); - - pColorTab = NULL; - pDashList = NULL; - pLineEndList = NULL; - - // #116827# - Link aEdgeStyle = LINK( this, SvxLineTabPage, ChangeEdgeStyleHdl_Impl ); - maLBEdgeStyle.SetSelectHdl( aEdgeStyle ); - - //#58425# Symbole auf einer Linie (z.B. StarChart) , MB-Handler setzen - aSymbolMB.SetSelectHdl(LINK(this, SvxLineTabPage, GraphicHdl_Impl)); - aSymbolMB.SetActivateHdl(LINK(this, SvxLineTabPage, MenuCreateHdl_Impl)); - aSymbolWidthMF.SetModifyHdl(LINK(this, SvxLineTabPage, SizeHdl_Impl)); - aSymbolHeightMF.SetModifyHdl(LINK(this, SvxLineTabPage, SizeHdl_Impl)); - aSymbolRatioCB.SetClickHdl(LINK(this, SvxLineTabPage, RatioHdl_Impl)); - - aSymbolRatioCB.Check(sal_True); - ShowSymbolControls(sal_False); - - // #63083# - nActLineWidth = -1; -} -//#58425# Symbole auf einer Linie (z.B. StarChart) , Symbol-Controls aktivieren -void SvxLineTabPage::ShowSymbolControls(sal_Bool bOn) -{ - bSymbols=bOn; - aSymbolWidthFT.Show(bOn); - aSymbolWidthMF.Show(bOn); - aSymbolHeightFT.Show(bOn); - aSymbolHeightMF.Show(bOn); - aFlSymbol.Show(bOn); - aSymbolRatioCB.Show(bOn); - aSymbolMB.Show(bOn); - aCtlPreview.ShowSymbol(bOn); -} -// ----------------------------------------------------------------------- -//#58425# Symbole auf einer Linie (z.B. StarChart) , dtor neu! -SvxLineTabPage::~SvxLineTabPage() -{ - delete aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY ); - - if(pSymbolList) - delete aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ); - - for ( size_t i = 0, n = aGrfBrushItems.size(); i < n; ++i ) - { - SvxBmpItemInfo* pInfo = aGrfBrushItems[ i ]; - delete pInfo->pBrushItem; - delete pInfo; - } -} -void SvxLineTabPage::Construct() -{ - // Farbtabelle - aLbColor.Fill( pColorTab ); - FillListboxes(); -} - -void SvxLineTabPage::FillListboxes() -{ - // Linienstile - sal_uInt16 nOldSelect = aLbLineStyle.GetSelectEntryPos(); - aLbLineStyle.FillStyles(); - aLbLineStyle.Fill( pDashList ); - aLbLineStyle.SelectEntryPos( nOldSelect ); - - // LinienEndenStile - String sNone( SVX_RES( RID_SVXSTR_NONE ) ); - nOldSelect = aLbStartStyle.GetSelectEntryPos(); - aLbStartStyle.Clear(); - aLbStartStyle.InsertEntry( sNone ); - aLbStartStyle.Fill( pLineEndList ); - aLbStartStyle.SelectEntryPos( nOldSelect ); - nOldSelect = aLbEndStyle.GetSelectEntryPos(); - aLbEndStyle.Clear(); - aLbEndStyle.InsertEntry( sNone ); - aLbEndStyle.Fill( pLineEndList, sal_False ); - aLbEndStyle.SelectEntryPos( nOldSelect ); -} - -// ----------------------------------------------------------------------- - -void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet ) -{ - SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE,sal_False); - if (pPageTypeItem) - SetPageType(pPageTypeItem->GetValue()); - if( nDlgType == 0 && pDashList ) - { - sal_uInt16 nPos; - sal_uInt16 nCount; - - // Dashliste - if( ( *pnDashListState & CT_MODIFIED ) || - ( *pnDashListState & CT_CHANGED ) ) - { - if( *pnDashListState & CT_CHANGED ) - pDashList = ( (SvxLineTabDialog*) DLGWIN )-> - GetNewDashList(); - *pnDashListState = CT_NONE; - - // Styleliste - nPos = aLbLineStyle.GetSelectEntryPos(); - - aLbLineStyle.Clear(); - aLbLineStyle.InsertEntry( - SVX_RESSTR( RID_SVXSTR_INVISIBLE ) ); - aLbLineStyle.InsertEntry( - SVX_RESSTR( RID_SVXSTR_SOLID ) ); - aLbLineStyle.Fill( pDashList ); - nCount = aLbLineStyle.GetEntryCount(); - - if ( nCount == 0 ) - ; // Dieser Fall sollte nicht auftreten - else if( nCount <= nPos ) - aLbLineStyle.SelectEntryPos( 0 ); - else - aLbLineStyle.SelectEntryPos( nPos ); - // SelectStyleHdl_Impl( this ); - } - - INetURLObject aDashURL( pDashList->GetPath() ); - - aDashURL.Append( pDashList->GetName() ); - DBG_ASSERT( aDashURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - // LineEndliste - if( ( *pnLineEndListState & CT_MODIFIED ) || - ( *pnLineEndListState & CT_CHANGED ) ) - { - if( *pnLineEndListState & CT_CHANGED ) - pLineEndList = ( (SvxLineTabDialog*) DLGWIN )-> - GetNewLineEndList(); - *pnLineEndListState = CT_NONE; - - nPos = aLbLineStyle.GetSelectEntryPos(); - String sNone( SVX_RES( RID_SVXSTR_NONE ) ); - aLbStartStyle.Clear(); - aLbStartStyle.InsertEntry( sNone ); - - aLbStartStyle.Fill( pLineEndList ); - nCount = aLbStartStyle.GetEntryCount(); - if( nCount == 0 ) - ; // Dieser Fall sollte nicht auftreten - else if( nCount <= nPos ) - aLbStartStyle.SelectEntryPos( 0 ); - else - aLbStartStyle.SelectEntryPos( nPos ); - - aLbEndStyle.Clear(); - aLbEndStyle.InsertEntry( sNone ); - - aLbEndStyle.Fill( pLineEndList, sal_False ); - nCount = aLbEndStyle.GetEntryCount(); - - if( nCount == 0 ) - ; // Dieser Fall sollte nicht auftreten - else if( nCount <= nPos ) - aLbEndStyle.SelectEntryPos( 0 ); - else - aLbEndStyle.SelectEntryPos( nPos ); - } - INetURLObject aLineURL( pLineEndList->GetPath() ); - - aLineURL.Append( pLineEndList->GetName() ); - DBG_ASSERT( aLineURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - // Auswertung, ob von einer anderen TabPage ein anderer Fuelltyp gesetzt wurde - if( aLbLineStyle.GetSelectEntryPos() != 0 ) - { - if( nPageType == 2 ) // 1 - { - aLbLineStyle.SelectEntryPos( *pPosDashLb + 2 ); // +2 wegen SOLID und INVLISIBLE - ChangePreviewHdl_Impl( this ); - } - if( nPageType == 3 ) - { - aLbStartStyle.SelectEntryPos( *pPosLineEndLb + 1 );// +1 wegen SOLID - aLbEndStyle.SelectEntryPos( *pPosLineEndLb + 1 );// +1 wegen SOLID - ChangePreviewHdl_Impl( this ); - } - } - - // ColorTable - if( *pnColorTableState ) - { - if( *pnColorTableState & CT_CHANGED ) - pColorTab = ( (SvxLineTabDialog*) DLGWIN )-> - GetNewColorTable(); - // aLbColor - sal_uInt16 nColorPos = aLbColor.GetSelectEntryPos(); - aLbColor.Clear(); - aLbColor.Fill( pColorTab ); - nCount = aLbColor.GetEntryCount(); - if( nCount == 0 ) - ; // This case should never occur - else if( nCount <= nColorPos ) - aLbColor.SelectEntryPos( 0 ); - else - aLbColor.SelectEntryPos( nColorPos ); - - ChangePreviewHdl_Impl( this ); - } - - nPageType = 0; - } - // Seite existiert im Ctor noch nicht, deswegen hier! - - else if ( nDlgType == 1100 || - nDlgType == 1101 ) - { - aFtLineEndsStyle.Hide(); - aFtLineEndsWidth.Hide(); - aLbStartStyle.Hide(); - aMtrStartWidth.Hide(); - aTsbCenterStart.Hide(); - aLbEndStyle.Hide(); - aMtrEndWidth.Hide(); - aTsbCenterEnd.Hide(); - aCbxSynchronize.Hide(); - aFlLineEnds.Hide(); - - // #116827# - maFLEdgeStyle.Hide(); - maFTEdgeStyle.Hide(); - maLBEdgeStyle.Hide(); - } -} - -// ----------------------------------------------------------------------- - -int SvxLineTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if( nDlgType == 0 ) // Linien-Dialog - { - nPageType = 1; // evtl. fuer Erweiterungen - *pPosDashLb = aLbLineStyle.GetSelectEntryPos() - 2;// erster Eintrag SOLID !!! - sal_uInt16 nPos = aLbStartStyle.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - nPos--; - *pPosLineEndLb = nPos; - } - - if( _pSet ) - FillItemSet( *_pSet ); - - return( LEAVE_PAGE ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxLineTabPage::FillItemSet( SfxItemSet& rAttrs ) -{ - const SfxPoolItem* pOld = NULL; - sal_uInt16 nPos; - sal_Bool bModified = sal_False; - - // Um evtl. Modifikationen der Liste vorzubeugen - // werden Items anderer Seiten nicht gesetzt - if( nDlgType != 0 || nPageType != 2 ) - { - nPos = aLbLineStyle.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND && - nPos != aLbLineStyle.GetSavedValue() ) - { - XLineStyleItem* pStyleItem = NULL; - - if( nPos == 0 ) - pStyleItem = new XLineStyleItem( XLINE_NONE ); - else if( nPos == 1 ) - pStyleItem = new XLineStyleItem( XLINE_SOLID ); - else - { - pStyleItem = new XLineStyleItem( XLINE_DASH ); - - // Zusaetzliche Sicherheit - if( pDashList->Count() > (long) ( nPos - 2 ) ) - { - XLineDashItem aDashItem( aLbLineStyle.GetSelectEntry(), - pDashList->GetDash( nPos - 2 )->GetDash() ); - pOld = GetOldItem( rAttrs, XATTR_LINEDASH ); - if ( !pOld || !( *(const XLineDashItem*)pOld == aDashItem ) ) - { - rAttrs.Put( aDashItem ); - bModified = sal_True; - } - } - } - pOld = GetOldItem( rAttrs, XATTR_LINESTYLE ); - if ( !pOld || !( *(const XLineStyleItem*)pOld == *pStyleItem ) ) - { - rAttrs.Put( *pStyleItem ); - bModified = sal_True; - } - delete pStyleItem; - } - } - // Linienbreite - // GetSavedValue() liefert String! - if( aMtrLineWidth.GetText() != aMtrLineWidth.GetSavedValue() ) - { - XLineWidthItem aItem( GetCoreValue( aMtrLineWidth, ePoolUnit ) ); - pOld = GetOldItem( rAttrs, XATTR_LINEWIDTH ); - if ( !pOld || !( *(const XLineWidthItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - //Breite Linienanfang - if( aMtrStartWidth.GetText() != aMtrStartWidth.GetSavedValue() ) - { - XLineStartWidthItem aItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) ); - pOld = GetOldItem( rAttrs, XATTR_LINESTARTWIDTH ); - if ( !pOld || !( *(const XLineStartWidthItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - //Breite Linienende - if( aMtrEndWidth.GetText() != aMtrEndWidth.GetSavedValue() ) - { - XLineEndWidthItem aItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) ); - pOld = GetOldItem( rAttrs, XATTR_LINEENDWIDTH ); - if ( !pOld || !( *(const XLineEndWidthItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - - // Linienfarbe - if( aLbColor.GetSelectEntryPos() != aLbColor.GetSavedValue() ) - { - XLineColorItem aItem( aLbColor.GetSelectEntry(), - aLbColor.GetSelectEntryColor() ); - pOld = GetOldItem( rAttrs, XATTR_LINECOLOR ); - if ( !pOld || !( *(const XLineColorItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - - if( nDlgType != 0 || nPageType != 3 ) - { - // Linienanfang - nPos = aLbStartStyle.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND && - nPos != aLbStartStyle.GetSavedValue() ) - { - XLineStartItem* pItem = NULL; - if( nPos == 0 ) - pItem = new XLineStartItem(); - else if( pLineEndList->Count() > (long) ( nPos - 1 ) ) - pItem = new XLineStartItem( aLbStartStyle.GetSelectEntry(), - pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ); - pOld = GetOldItem( rAttrs, XATTR_LINESTART ); - if( pItem && - ( !pOld || !( *(const XLineEndItem*)pOld == *pItem ) ) ) - { - rAttrs.Put( *pItem ); - bModified = sal_True; - } - delete pItem; - } - // Linienende - nPos = aLbEndStyle.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND && - nPos != aLbEndStyle.GetSavedValue() ) - { - XLineEndItem* pItem = NULL; - if( nPos == 0 ) - pItem = new XLineEndItem(); - else if( pLineEndList->Count() > (long) ( nPos - 1 ) ) - pItem = new XLineEndItem( aLbEndStyle.GetSelectEntry(), - pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ); - pOld = GetOldItem( rAttrs, XATTR_LINEEND ); - if( pItem && - ( !pOld || !( *(const XLineEndItem*)pOld == *pItem ) ) ) - { - rAttrs.Put( *pItem ); - bModified = sal_True; - } - delete pItem; - } - } - - // Linienenden zentriert - TriState eState = aTsbCenterStart.GetState(); - if( eState != aTsbCenterStart.GetSavedValue() ) - { - XLineStartCenterItem aItem( sal::static_int_cast< sal_Bool >( eState ) ); - pOld = GetOldItem( rAttrs, XATTR_LINESTARTCENTER ); - if ( !pOld || !( *(const XLineStartCenterItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - eState = aTsbCenterEnd.GetState(); - if( eState != aTsbCenterEnd.GetSavedValue() ) - { - XLineEndCenterItem aItem( sal::static_int_cast< sal_Bool >( eState ) ); - pOld = GetOldItem( rAttrs, XATTR_LINEENDCENTER ); - if ( !pOld || !( *(const XLineEndCenterItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - - //Breite Linienanfang - if( aMtrStartWidth.GetText() != aMtrStartWidth.GetSavedValue() ) - { - XLineStartWidthItem aItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) ); - pOld = GetOldItem( rAttrs, XATTR_LINESTARTWIDTH ); - if ( !pOld || !( *(const XLineStartWidthItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - //Breite Linienende - if( aMtrEndWidth.GetText() != aMtrEndWidth.GetSavedValue() ) - { - XLineEndWidthItem aItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) ); - pOld = GetOldItem( rAttrs, XATTR_LINEENDWIDTH ); - if ( !pOld || !( *(const XLineEndWidthItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - - // Transparenz - sal_uInt16 nVal = (sal_uInt16)aMtrTransparent.GetValue(); - if( nVal != (sal_uInt16)aMtrTransparent.GetSavedValue().ToInt32() ) - { - XLineTransparenceItem aItem( nVal ); - pOld = GetOldItem( rAttrs, XATTR_LINETRANSPARENCE ); - if ( !pOld || !( *(const XLineTransparenceItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - - // #116827# - nPos = maLBEdgeStyle.GetSelectEntryPos(); - if( LISTBOX_ENTRY_NOTFOUND != nPos && nPos != maLBEdgeStyle.GetSavedValue() ) - { - XLineJointItem* pNew = 0L; - - switch(nPos) - { - case 0: // Rounded, default - { - pNew = new XLineJointItem(XLINEJOINT_ROUND); - break; - } - case 1: // - none - - { - pNew = new XLineJointItem(XLINEJOINT_NONE); - break; - } - case 2: // Miter - { - pNew = new XLineJointItem(XLINEJOINT_MITER); - break; - } - case 3: // Bevel - { - pNew = new XLineJointItem(XLINEJOINT_BEVEL); - break; - } - } - - if(pNew) - { - pOld = GetOldItem( rAttrs, XATTR_LINEJOINT ); - - if(!pOld || !(*(const XLineJointItem*)pOld == *pNew)) - { - rAttrs.Put( *pNew ); - bModified = sal_True; - } - - delete pNew; - } - } - - if(nSymbolType!=SVX_SYMBOLTYPE_UNKNOWN || bNewSize) - { - //wurde also per Auswahl gesetzt oder Gr��e ist anders - SvxSizeItem aSItem(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),aSymbolSize); - const SfxPoolItem* pSOld = GetOldItem( rAttrs, rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE) ); - bNewSize = pSOld ? *(const SvxSizeItem *)pSOld != aSItem : bNewSize ; - if(bNewSize) - { - rAttrs.Put(aSItem); - bModified=sal_True; - } - - SfxInt32Item aTItem(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),nSymbolType); - const SfxPoolItem* pTOld = GetOldItem( rAttrs, rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE) ); - bool bNewType = pTOld == NULL || *(const SfxInt32Item*)pTOld != aTItem; - if(bNewType && nSymbolType==SVX_SYMBOLTYPE_UNKNOWN) - bNewType=false;//kleine Korrektur, Typ wurde garnicht gesetzt -> kein Type-Item erzeugen! - if(bNewType) - { - rAttrs.Put(aTItem); - bModified=sal_True; - } - - if(nSymbolType!=SVX_SYMBOLTYPE_NONE) - { - SvxBrushItem aBItem(aSymbolGraphic,GPOS_MM,rAttrs.GetPool()->GetWhich(SID_ATTR_BRUSH)); - const SfxPoolItem* pBOld = GetOldItem( rAttrs, rAttrs.GetPool()->GetWhich(SID_ATTR_BRUSH) ); - bool bNewBrush = - pBOld == NULL || *(const SvxBrushItem*)pBOld != aBItem; - if(bNewBrush) - { - rAttrs.Put(aBItem); - bModified=sal_True; - } - } - } - rAttrs.Put (CntUInt16Item(SID_PAGE_TYPE,nPageType)); - return( bModified ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxLineTabPage::FillXLSet_Impl() -{ - sal_uInt16 nPos; - - if( aLbLineStyle.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND ) - { - rXLSet.Put( XLineStyleItem( XLINE_NONE ) ); - } - else if( aLbLineStyle.IsEntryPosSelected( 0 ) ) - rXLSet.Put( XLineStyleItem( XLINE_NONE ) ); - else if( aLbLineStyle.IsEntryPosSelected( 1 ) ) - rXLSet.Put( XLineStyleItem( XLINE_SOLID ) ); - else - { - rXLSet.Put( XLineStyleItem( XLINE_DASH ) ); - - nPos = aLbLineStyle.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - rXLSet.Put( XLineDashItem( aLbLineStyle.GetSelectEntry(), - pDashList->GetDash( nPos - 2 )->GetDash() ) ); - } - } - - nPos = aLbStartStyle.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - if( nPos == 0 ) - rXLSet.Put( XLineStartItem() ); - else - rXLSet.Put( XLineStartItem( aLbStartStyle.GetSelectEntry(), - pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ) ); - } - nPos = aLbEndStyle.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - if( nPos == 0 ) - rXLSet.Put( XLineEndItem() ); - else - rXLSet.Put( XLineEndItem( aLbEndStyle.GetSelectEntry(), - pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ) ); - } - - // #116827# - nPos = maLBEdgeStyle.GetSelectEntryPos(); - if(LISTBOX_ENTRY_NOTFOUND != nPos) - { - switch(nPos) - { - case 0: // Rounded, default - { - rXLSet.Put(XLineJointItem(XLINEJOINT_ROUND)); - break; - } - case 1: // - none - - { - rXLSet.Put(XLineJointItem(XLINEJOINT_NONE)); - break; - } - case 2: // Miter - { - rXLSet.Put(XLineJointItem(XLINEJOINT_MITER)); - break; - } - case 3: // Bevel - { - rXLSet.Put(XLineJointItem(XLINEJOINT_BEVEL)); - break; - } - } - } - - rXLSet.Put( XLineStartWidthItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) ) ); - rXLSet.Put( XLineEndWidthItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) ) ); - - rXLSet.Put( XLineWidthItem( GetCoreValue( aMtrLineWidth, ePoolUnit ) ) ); - rXLSet.Put( XLineColorItem( aLbColor.GetSelectEntry(), - aLbColor.GetSelectEntryColor() ) ); - - // Linienenden zentriert - if( aTsbCenterStart.GetState() == STATE_CHECK ) - rXLSet.Put( XLineStartCenterItem( sal_True ) ); - else if( aTsbCenterStart.GetState() == STATE_NOCHECK ) - rXLSet.Put( XLineStartCenterItem( sal_False ) ); - - if( aTsbCenterEnd.GetState() == STATE_CHECK ) - rXLSet.Put( XLineEndCenterItem( sal_True ) ); - else if( aTsbCenterEnd.GetState() == STATE_NOCHECK ) - rXLSet.Put( XLineEndCenterItem( sal_False ) ); - - // Transparenz - sal_uInt16 nVal = (sal_uInt16)aMtrTransparent.GetValue(); - rXLSet.Put( XLineTransparenceItem( nVal ) ); - - // #116827# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); - - return( sal_True ); -} - -// ----------------------------------------------------------------------- - -void SvxLineTabPage::Reset( const SfxItemSet& rAttrs ) -{ - String aString; - XLineStyle eXLS; // XLINE_NONE, XLINE_SOLID, XLINE_DASH - - // Linienstil - const SfxPoolItem *pPoolItem; - long nSymType=SVX_SYMBOLTYPE_UNKNOWN; - sal_Bool bPrevSym=sal_False; - sal_Bool bEnable=sal_True; - sal_Bool bIgnoreGraphic=sal_False; - sal_Bool bIgnoreSize=sal_False; - if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),sal_True,&pPoolItem) == SFX_ITEM_SET) - { - nSymType=((const SfxInt32Item *)pPoolItem)->GetValue(); - } - - if(nSymType == SVX_SYMBOLTYPE_AUTO) - { - aSymbolGraphic=aAutoSymbolGraphic; - aSymbolSize=aSymbolLastSize=aAutoSymbolGraphic.GetPrefSize(); - bPrevSym=sal_True; - } - else if(nSymType == SVX_SYMBOLTYPE_NONE) - { - bEnable=sal_False; - bIgnoreGraphic=sal_True; - bIgnoreSize=sal_True; - } - else if(nSymType >= 0) - { - VirtualDevice aVDev; - aVDev.SetMapMode(MapMode(MAP_100TH_MM)); - - SdrModel* pModel = new SdrModel(NULL, NULL, LOADREFCOUNTS); - pModel->GetItemPool().FreezeIdRanges(); - SdrPage* pPage = new SdrPage( *pModel, sal_False ); - pPage->SetSize(Size(1000,1000)); - pModel->InsertPage( pPage, 0 ); - SdrView* pView = new SdrView( pModel, &aVDev ); - pView->hideMarkHandles(); - SdrPageView* pPageView = pView->ShowSdrPage(pPage); - SdrObject *pObj=NULL; - long nSymTmp=nSymType; - if(pSymbolList) - { - if(pSymbolList->GetObjCount()) - { - nSymTmp=nSymTmp%pSymbolList->GetObjCount(); //Liste wird als cyclisch betrachtet!!! - pObj=pSymbolList->GetObj(nSymTmp); - if(pObj) - { - pObj=pObj->Clone(); - pPage->NbcInsertObject(pObj); - pView->MarkObj(pObj,pPageView); - if(pSymbolAttr) - { - pObj->SetMergedItemSet(*pSymbolAttr); - } - else - { - pObj->SetMergedItemSet(rOutAttrs); - } - GDIMetaFile aMeta(pView->GetAllMarkedMetaFile()); - - aSymbolGraphic=Graphic(aMeta); - aSymbolSize=pObj->GetSnapRect().GetSize(); - aSymbolGraphic.SetPrefSize(aSymbolSize); - aSymbolGraphic.SetPrefMapMode(MAP_100TH_MM); - bPrevSym=sal_True; - bEnable=sal_True; - bIgnoreGraphic=sal_True; - - pView->UnmarkAll(); - pObj=pPage->RemoveObject(0); - SdrObject::Free( pObj ); - } - } - } - delete pView; - delete pModel; - } - if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_BRUSH),sal_True,&pPoolItem) == SFX_ITEM_SET) - { - const Graphic* pGraphic = ((const SvxBrushItem *)pPoolItem)->GetGraphic(); - if( pGraphic ) - { - if(!bIgnoreGraphic) - { - aSymbolGraphic=*pGraphic; - } - if(!bIgnoreSize) - { - aSymbolSize=OutputDevice::LogicToLogic( pGraphic->GetPrefSize(), - pGraphic->GetPrefMapMode(), - MAP_100TH_MM ); - } - bPrevSym=sal_True; - } - } - if(rAttrs.GetItemState(rAttrs.GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),sal_True,&pPoolItem) == SFX_ITEM_SET) - { - aSymbolSize = ((const SvxSizeItem *)pPoolItem)->GetSize(); - } - - - aSymbolRatioCB.Enable(bEnable); - aSymbolHeightFT.Enable(bEnable); - aSymbolWidthFT.Enable(bEnable); - aSymbolWidthMF.Enable(bEnable); - aSymbolHeightMF.Enable(bEnable); - if(bPrevSym) - { - SetMetricValue(aSymbolWidthMF, aSymbolSize.Width(), ePoolUnit); - SetMetricValue(aSymbolHeightMF, aSymbolSize.Height(),ePoolUnit); - aCtlPreview.SetSymbol(&aSymbolGraphic,aSymbolSize); - aSymbolLastSize=aSymbolSize; - } - - if( rAttrs.GetItemState( XATTR_LINESTYLE ) != SFX_ITEM_DONTCARE ) - { - eXLS = (XLineStyle) ( ( const XLineStyleItem& ) rAttrs.Get( XATTR_LINESTYLE ) ).GetValue(); - - switch( eXLS ) - { - case XLINE_NONE: - aLbLineStyle.SelectEntryPos( 0 ); - break; - case XLINE_SOLID: - aLbLineStyle.SelectEntryPos( 1 ); - break; - - case XLINE_DASH: - aLbLineStyle.SetNoSelection(); - aLbLineStyle.SelectEntry( ( ( const XLineDashItem& ) rAttrs. - Get( XATTR_LINEDASH ) ).GetName() ); - break; - - default: - break; - } - } - else - { - aLbLineStyle.SetNoSelection(); - } - - // Linienstaerke - if( rAttrs.GetItemState( XATTR_LINEWIDTH ) != SFX_ITEM_DONTCARE ) - { - SetMetricValue( aMtrLineWidth, ( ( const XLineWidthItem& ) rAttrs. - Get( XATTR_LINEWIDTH ) ).GetValue(), ePoolUnit ); - } - else - aMtrLineWidth.SetText( String() ); - - // Linienfarbe - aLbColor.SetNoSelection(); - - if ( rAttrs.GetItemState( XATTR_LINECOLOR ) != SFX_ITEM_DONTCARE ) - { - Color aCol = ( ( const XLineColorItem& ) rAttrs.Get( XATTR_LINECOLOR ) ).GetColorValue(); - aLbColor.SelectEntry( aCol ); - if( aLbColor.GetSelectEntryCount() == 0 ) - { - aLbColor.InsertEntry( aCol, String() ); - aLbColor.SelectEntry( aCol ); - } - } - - // LinienAnfang - if( bObjSelected && - rAttrs.GetItemState( XATTR_LINESTART ) == SFX_ITEM_DEFAULT ) - { - aLbStartStyle.Disable(); - } - else if( rAttrs.GetItemState( XATTR_LINESTART ) != SFX_ITEM_DONTCARE ) - { - // #86265# select entry using list and polygon, not string - sal_Bool bSelected(sal_False); - const basegfx::B2DPolyPolygon& rItemPolygon = ((const XLineStartItem&)rAttrs.Get(XATTR_LINESTART)).GetLineStartValue(); - - for(sal_Int32 a(0);!bSelected && a < pLineEndList->Count(); a++) - { - XLineEndEntry* pEntry = pLineEndList->GetLineEnd(a); - const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd(); - - if(rItemPolygon == rEntryPolygon) - { - // select this entry - aLbStartStyle.SelectEntryPos((sal_uInt16)a + 1); - bSelected = sal_True; - } - } - - if(!bSelected) - aLbStartStyle.SelectEntryPos( 0 ); - } - else - { - aLbStartStyle.SetNoSelection(); - } - - // LinienEnde - if( bObjSelected && - rAttrs.GetItemState( XATTR_LINEEND ) == SFX_ITEM_DEFAULT ) - { - aLbEndStyle.Disable(); - } - else if( rAttrs.GetItemState( XATTR_LINEEND ) != SFX_ITEM_DONTCARE ) - { - // #86265# select entry using list and polygon, not string - sal_Bool bSelected(sal_False); - const basegfx::B2DPolyPolygon& rItemPolygon = ((const XLineEndItem&)rAttrs.Get(XATTR_LINEEND)).GetLineEndValue(); - - for(sal_Int32 a(0);!bSelected && a < pLineEndList->Count(); a++) - { - XLineEndEntry* pEntry = pLineEndList->GetLineEnd(a); - const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd(); - - if(rItemPolygon == rEntryPolygon) - { - // select this entry - aLbEndStyle.SelectEntryPos((sal_uInt16)a + 1); - bSelected = sal_True; - } - } - - if(!bSelected) - aLbEndStyle.SelectEntryPos( 0 ); - } - else - { - aLbEndStyle.SetNoSelection(); - } - - // LinienAnfang St"arke - if( bObjSelected && - rAttrs.GetItemState( XATTR_LINESTARTWIDTH ) == SFX_ITEM_DEFAULT ) - { - aMtrStartWidth.Disable(); - } - else if( rAttrs.GetItemState( XATTR_LINESTARTWIDTH ) != SFX_ITEM_DONTCARE ) - { - SetMetricValue( aMtrStartWidth, ( ( const XLineStartWidthItem& ) rAttrs. - Get( XATTR_LINESTARTWIDTH ) ).GetValue(), ePoolUnit ); - } - else - aMtrStartWidth.SetText( String() ); - - // LinienEnde St"arke - if( bObjSelected && - rAttrs.GetItemState( XATTR_LINEENDWIDTH ) == SFX_ITEM_DEFAULT ) - { - aMtrEndWidth.Disable(); - } - else if( rAttrs.GetItemState( XATTR_LINEENDWIDTH ) != SFX_ITEM_DONTCARE ) - { - SetMetricValue( aMtrEndWidth, ( ( const XLineEndWidthItem& ) rAttrs. - Get( XATTR_LINEENDWIDTH ) ).GetValue(), ePoolUnit ); - } - else - aMtrEndWidth.SetText( String() ); - - // Linienenden zentriert (Start) - if( bObjSelected && - rAttrs.GetItemState( XATTR_LINESTARTCENTER ) == SFX_ITEM_DEFAULT ) - { - aTsbCenterStart.Disable(); - } - else if( rAttrs.GetItemState( XATTR_LINESTARTCENTER ) != SFX_ITEM_DONTCARE ) - { - aTsbCenterStart.EnableTriState( sal_False ); - - if( ( ( const XLineStartCenterItem& ) rAttrs.Get( XATTR_LINESTARTCENTER ) ).GetValue() ) - aTsbCenterStart.SetState( STATE_CHECK ); - else - aTsbCenterStart.SetState( STATE_NOCHECK ); - } - else - { - aTsbCenterStart.SetState( STATE_DONTKNOW ); - } - - // Linienenden zentriert (Ende) - if( bObjSelected && - rAttrs.GetItemState( XATTR_LINEENDCENTER ) == SFX_ITEM_DEFAULT ) - { - aTsbCenterEnd.Disable(); - } - else if( rAttrs.GetItemState( XATTR_LINEENDCENTER ) != SFX_ITEM_DONTCARE ) - { - aTsbCenterEnd.EnableTriState( sal_False ); - - if( ( ( const XLineEndCenterItem& ) rAttrs.Get( XATTR_LINEENDCENTER ) ).GetValue() ) - aTsbCenterEnd.SetState( STATE_CHECK ); - else - aTsbCenterEnd.SetState( STATE_NOCHECK ); - } - else - { - aTsbCenterEnd.SetState( STATE_DONTKNOW ); - } - - // Transparenz - if( rAttrs.GetItemState( XATTR_LINETRANSPARENCE ) != SFX_ITEM_DONTCARE ) - { - sal_uInt16 nTransp = ( ( const XLineTransparenceItem& ) rAttrs. - Get( XATTR_LINETRANSPARENCE ) ).GetValue(); - aMtrTransparent.SetValue( nTransp ); - ChangeTransparentHdl_Impl( NULL ); - } - else - aMtrTransparent.SetText( String() ); - - if( !aLbStartStyle.IsEnabled() && - !aLbEndStyle.IsEnabled() && - !aMtrStartWidth.IsEnabled() && - !aMtrEndWidth.IsEnabled() && - !aTsbCenterStart.IsEnabled()&& - !aTsbCenterEnd.IsEnabled() ) - { - aCbxSynchronize.Disable(); - aFtLineEndsStyle.Disable(); - aFtLineEndsWidth.Disable(); - aFlLineEnds.Disable(); - } - - // Synchronisieren - // Jetzt wird der Wert aus der INI-Datei geholt (#42258#) - String aStr = GetUserData(); - aCbxSynchronize.Check( (sal_Bool)aStr.ToInt32() ); - - // #116827# - if(bObjSelected && SFX_ITEM_DEFAULT == rAttrs.GetItemState(XATTR_LINEJOINT)) - { - maFTEdgeStyle.Disable(); - maLBEdgeStyle.Disable(); - } - else if(SFX_ITEM_DONTCARE != rAttrs.GetItemState(XATTR_LINEJOINT)) - { - XLineJoint eLineJoint = ((const XLineJointItem&)(rAttrs.Get(XATTR_LINEJOINT))).GetValue(); - - switch(eLineJoint) - { - case XLINEJOINT_ROUND : maLBEdgeStyle.SelectEntryPos(0); break; - case XLINEJOINT_NONE : maLBEdgeStyle.SelectEntryPos(1); break; - case XLINEJOINT_MITER : maLBEdgeStyle.SelectEntryPos(2); break; - case XLINEJOINT_BEVEL : maLBEdgeStyle.SelectEntryPos(3); break; - case XLINEJOINT_MIDDLE : break; - } - } - else - { - maLBEdgeStyle.SetNoSelection(); - } - - // Werte sichern - aLbLineStyle.SaveValue(); - aMtrLineWidth.SaveValue(); - aLbColor.SaveValue(); - aLbStartStyle.SaveValue(); - aLbEndStyle.SaveValue(); - aMtrStartWidth.SaveValue(); - aMtrEndWidth.SaveValue(); - aTsbCenterStart.SaveValue(); - aTsbCenterEnd.SaveValue(); - aMtrTransparent.SaveValue(); - - // #116827# - maLBEdgeStyle.SaveValue(); - - ClickInvisibleHdl_Impl( this ); - - ChangePreviewHdl_Impl( NULL ); -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxLineTabPage::Create( Window* pWindow, - const SfxItemSet& rAttrs ) -{ - return( new SvxLineTabPage( pWindow, rAttrs ) ); -} - -//------------------------------------------------------------------------ - -sal_uInt16* SvxLineTabPage::GetRanges() -{ - return( pLineRanges ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineTabPage, ChangePreviewHdl_Impl, void *, pCntrl ) -{ - if(pCntrl == &aMtrLineWidth) - { - // Linienbreite und Start/EndBreite - sal_Int32 nNewLineWidth = GetCoreValue( aMtrLineWidth, ePoolUnit ); - if(nActLineWidth == -1) - { - // Noch nicht initialisiert, hole den Startwert - const SfxPoolItem* pOld = GetOldItem( rXLSet, XATTR_LINEWIDTH ); - sal_Int32 nStartLineWidth = 0; - if(pOld) - nStartLineWidth = (( const XLineWidthItem *)pOld)->GetValue(); - nActLineWidth = nStartLineWidth; - } - - if(nActLineWidth != nNewLineWidth) - { - // Anpassungen Start/EndWidth #63083# - sal_Int32 nValAct = GetCoreValue( aMtrStartWidth, ePoolUnit ); - sal_Int32 nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10); - if(nValNew < 0) - nValNew = 0; - SetMetricValue( aMtrStartWidth, nValNew, ePoolUnit ); - - nValAct = GetCoreValue( aMtrEndWidth, ePoolUnit ); - nValNew = nValAct + (((nNewLineWidth - nActLineWidth) * 15) / 10); - if(nValNew < 0) - nValNew = 0; - SetMetricValue( aMtrEndWidth, nValNew, ePoolUnit ); - } - - // Aktuellen Wert merken - nActLineWidth = nNewLineWidth; - } - - FillXLSet_Impl(); - aCtlPreview.Invalidate(); - - // Transparenz entspr. zugaenglich machen - if( aLbLineStyle.GetSelectEntryPos() == 0 ) // unsichtbar - { - aFtTransparent.Disable(); - aMtrTransparent.Disable(); - } - else - { - aFtTransparent.Enable(); - aMtrTransparent.Enable(); - } - - const bool bHasLineStart = aLbStartStyle.GetSelectEntryPos() != 0; - const bool bHasLineEnd = aLbEndStyle.GetSelectEntryPos() != 0; - - aFtLineEndsWidth.Enable( bHasLineStart || bHasLineEnd ); - aMtrStartWidth.Enable( bHasLineStart ); - aTsbCenterStart.Enable( bHasLineStart ); - aMtrEndWidth.Enable( bHasLineEnd ); - aTsbCenterEnd.Enable( bHasLineEnd ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineTabPage, ChangeStartHdl_Impl, void *, p ) -{ - if( aCbxSynchronize.IsChecked() ) - { - if( p == &aMtrStartWidth ) - aMtrEndWidth.SetValue( aMtrStartWidth.GetValue() ); - if( p == &aLbStartStyle ) - aLbEndStyle.SelectEntryPos( aLbStartStyle.GetSelectEntryPos() ); - if( p == &aTsbCenterStart ) - aTsbCenterEnd.SetState( aTsbCenterStart.GetState() ); - } - - ChangePreviewHdl_Impl( this ); - - return( 0L ); -} - -//------------------------------------------------------------------------ -// #116827# - -IMPL_LINK( SvxLineTabPage, ChangeEdgeStyleHdl_Impl, void *, EMPTYARG ) -{ - ChangePreviewHdl_Impl( this ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineTabPage, ClickInvisibleHdl_Impl, void *, EMPTYARG ) -{ - if( aLbLineStyle.GetSelectEntryPos() == 0 ) // unsichtbar - { - aFtColor.Disable(); - if(!bSymbols) - aLbColor.Disable(); - aFtLineWidth.Disable(); - aMtrLineWidth.Disable(); - - if( aFlLineEnds.IsEnabled() ) - { - aFtLineEndsStyle.Disable(); - aFtLineEndsWidth.Disable(); - aLbStartStyle.Disable(); - aMtrStartWidth.Disable(); - aTsbCenterStart.Disable(); - aLbEndStyle.Disable(); - aMtrEndWidth.Disable(); - aTsbCenterEnd.Disable(); - aCbxSynchronize.Disable(); - - // #116827# - maFTEdgeStyle.Disable(); - maLBEdgeStyle.Disable(); - } - } - else - { - aFtColor.Enable(); - aLbColor.Enable(); - aFtLineWidth.Enable(); - aMtrLineWidth.Enable(); - - if( aFlLineEnds.IsEnabled() ) - { - aFtLineEndsStyle.Enable(); - aFtLineEndsWidth.Enable(); - aLbStartStyle.Enable(); - aMtrStartWidth.Enable(); - aTsbCenterStart.Enable(); - aLbEndStyle.Enable(); - aMtrEndWidth.Enable(); - aTsbCenterEnd.Enable(); - aCbxSynchronize.Enable(); - - // #116827# - maFTEdgeStyle.Enable(); - maLBEdgeStyle.Enable(); - } - } - ChangePreviewHdl_Impl( NULL ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineTabPage, ChangeEndHdl_Impl, void *, p ) -{ - if( aCbxSynchronize.IsChecked() ) - { - if( p == &aMtrEndWidth ) - aMtrStartWidth.SetValue( aMtrEndWidth.GetValue() ); - if( p == &aLbEndStyle ) - aLbStartStyle.SelectEntryPos( aLbEndStyle.GetSelectEntryPos() ); - if( p == &aTsbCenterEnd ) - aTsbCenterStart.SetState( aTsbCenterEnd.GetState() ); - } - - ChangePreviewHdl_Impl( this ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineTabPage, ChangeTransparentHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nVal = (sal_uInt16)aMtrTransparent.GetValue(); - XLineTransparenceItem aItem( nVal ); - - rXLSet.Put( XLineTransparenceItem( aItem ) ); - - // #116827# - FillXLSet_Impl(); - - aCtlPreview.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -void SvxLineTabPage::PointChanged( Window*, RECT_POINT eRcPt ) -{ - eRP = eRcPt; -} - -//------------------------------------------------------------------------ - -void SvxLineTabPage::FillUserData() -{ - // Abgleich wird in der Ini-Datei festgehalten - UniString aStrUserData = UniString::CreateFromInt32( (sal_Int32) aCbxSynchronize.IsChecked() ); - SetUserData( aStrUserData ); -} - - -//#58425# Symbole auf einer Linie (z.B. StarChart) -//Handler f�r Popup-Menue der Symbolauswahl (NumMenueButton) -//der folgende Link stammt urspruenglich aus SvxNumOptionsTabPage -IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton ) -{ - //Popup initialisieren - if(!pButton->GetPopupMenu()->GetPopupMenu( MN_GALLERY )) - { - // Gallery-Eintraege besorgen - GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames); - - PopupMenu* pPopup = new PopupMenu; - String aEmptyStr; - const String *pUIName = NULL; - sal_uInt32 i = 0; - for(std::vector<String>::iterator it = aGrfNames.begin(); it != aGrfNames.end(); ++it, ++i) - { - pUIName = &(*it); - - // convert URL encodings to UI characters (eg %20 for spaces) - String aPhysicalName; - if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( *it, aPhysicalName )) - pUIName = &aPhysicalName; - - SvxBrushItem* pBrushItem = new SvxBrushItem(*it, aEmptyStr, GPOS_AREA, SID_ATTR_BRUSH); - pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl)); - - SvxBmpItemInfo* pInfo = new SvxBmpItemInfo(); - pInfo->pBrushItem = pBrushItem; - pInfo->nItemId = (sal_uInt16)(MN_GALLERY_ENTRY + i); - if ( i < aGrfBrushItems.size() ) { - aGrfBrushItems.insert( aGrfBrushItems.begin() + i, pInfo ); - } else { - aGrfBrushItems.push_back( pInfo ); - } - const Graphic* pGraphic = pBrushItem->GetGraphic(); - - if(pGraphic) - { - Bitmap aBitmap(pGraphic->GetBitmap()); - Size aSize(aBitmap.GetSizePixel()); - if(aSize.Width() > MAX_BMP_WIDTH || - aSize.Height() > MAX_BMP_HEIGHT) - { - sal_Bool bWidth = aSize.Width() > aSize.Height(); - double nScale = bWidth ? - (double)MAX_BMP_WIDTH / (double)aSize.Width(): - (double)MAX_BMP_HEIGHT / (double)aSize.Height(); - aBitmap.Scale(nScale, nScale); - - } - Image aImage(aBitmap); - pPopup->InsertItem(pInfo->nItemId, *pUIName, aImage ); - } - else - { - Image aImage; - pPopup->InsertItem(pInfo->nItemId, *pUIName, aImage ); - } - } - aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_GALLERY, pPopup ); - - if(aGrfNames.empty()) - aSymbolMB.GetPopupMenu()->EnableItem(MN_GALLERY, sal_False); - } - - if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList) - { - VirtualDevice aVDev; - aVDev.SetMapMode(MapMode(MAP_100TH_MM)); - SdrModel* pModel = new SdrModel(NULL, NULL, LOADREFCOUNTS); - pModel->GetItemPool().FreezeIdRanges(); - // Page - SdrPage* pPage = new SdrPage( *pModel, sal_False ); - pPage->SetSize(Size(1000,1000)); - pModel->InsertPage( pPage, 0 ); - // 3D View - SdrView* pView = new SdrView( pModel, &aVDev ); - pView->hideMarkHandles(); - SdrPageView* pPageView = pView->ShowSdrPage(pPage); - - PopupMenu* pPopup = new PopupMenu; - String aEmptyStr; - for(long i=0;; ++i) - { - SdrObject *pObj=pSymbolList->GetObj(i); - if(pObj==NULL) - break; - pObj=pObj->Clone(); - aGrfNames.push_back(aEmptyStr); - pPage->NbcInsertObject(pObj); - pView->MarkObj(pObj,pPageView); - if(pSymbolAttr) - { - pObj->SetMergedItemSet(*pSymbolAttr); - } - else - { - pObj->SetMergedItemSet(rOutAttrs); - } - - Bitmap aBitmap(pView->GetAllMarkedBitmap()); - GDIMetaFile aMeta(pView->GetAllMarkedMetaFile()); - pView->UnmarkAll(); - pObj=pPage->RemoveObject(0); - SdrObject::Free(pObj); - - SvxBrushItem* pBrushItem = new SvxBrushItem(Graphic(aMeta), GPOS_AREA, SID_ATTR_BRUSH); - pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, GraphicArrivedHdl_Impl)); - - SvxBmpItemInfo* pInfo = new SvxBmpItemInfo(); - pInfo->pBrushItem = pBrushItem; - pInfo->nItemId = (sal_uInt16)(MN_GALLERY_ENTRY + i + nNumMenuGalleryItems); - if ( (size_t)(nNumMenuGalleryItems + i) < aGrfBrushItems.size() ) { - aGrfBrushItems.insert( aGrfBrushItems.begin() + nNumMenuGalleryItems + i, pInfo ); - } else { - aGrfBrushItems.push_back( pInfo ); - } - - Size aSize(aBitmap.GetSizePixel()); - if(aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT) - { - sal_Bool bWidth = aSize.Width() > aSize.Height(); - double nScale = bWidth ? - (double)MAX_BMP_WIDTH / (double)aSize.Width(): - (double)MAX_BMP_HEIGHT / (double)aSize.Height(); - aBitmap.Scale(nScale, nScale); - } - Image aImage(aBitmap); - pPopup->InsertItem(pInfo->nItemId,aEmptyStr,aImage); - } - aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_SYMBOLS, pPopup ); - - if(aGrfNames.empty()) - aSymbolMB.GetPopupMenu()->EnableItem(MN_SYMBOLS, sal_False); - - delete pView; - delete pModel; - } - return 0; -} -//#58425# Symbole auf einer Linie (z.B. StarChart) -//Handler f�r Popup-Menue der Symbolauswahl (NumMenueButton) -//der folgende Link stammt urspruenglich aus SvxNumOptionsTabPage: -IMPL_STATIC_LINK(SvxLineTabPage, GraphicArrivedHdl_Impl, SvxBrushItem*, pItem) -{ - PopupMenu* pPopup = pThis->aSymbolMB.GetPopupMenu()->GetPopupMenu( MN_GALLERY ); - - SvxBmpItemInfo* pBmpInfo = 0; - for ( size_t i = 0; i < pThis->aGrfBrushItems.size(); i++ ) - { - SvxBmpItemInfo* pInfo = pThis->aGrfBrushItems[ i ]; - if( pInfo->pBrushItem == pItem ) - { - pBmpInfo = pInfo; break; - } - } - if( pBmpInfo ) - { - if( pItem->GetGraphic() ) - { - Bitmap aBitmap(pItem->GetGraphic()->GetBitmap()); - Size aSize(aBitmap.GetSizePixel()); - if(aSize.Width() > MAX_BMP_WIDTH || - aSize.Height() > MAX_BMP_HEIGHT) - { - sal_Bool bWidth = aSize.Width() > aSize.Height(); - double nScale = bWidth ? - (double)MAX_BMP_WIDTH / (double)aSize.Width(): - (double)MAX_BMP_HEIGHT / (double)aSize.Height(); - aBitmap.Scale(nScale, nScale); - } - Image aImage(aBitmap); - pPopup->SetItemImage( pBmpInfo->nItemId, aImage ); - } - } - - return 0; -} - -//#58425# Symbole auf einer Linie (z.B. StarChart) -//Handler f�r Menuebutton -IMPL_LINK( SvxLineTabPage, GraphicHdl_Impl, MenuButton *, pButton ) -{ - sal_uInt16 nItemId = pButton->GetCurItemId(); - const Graphic* pGraphic = 0; - Graphic aGraphic; - String aGrfName; - sal_Bool bResetSize = sal_False; - sal_Bool bEnable=sal_True; - long nPreviousSymbolType = nSymbolType; - - if(nItemId >= MN_GALLERY_ENTRY) - { - if( (nItemId-MN_GALLERY_ENTRY) >= nNumMenuGalleryItems) - { - nSymbolType=nItemId-MN_GALLERY_ENTRY-nNumMenuGalleryItems; //Index der Liste - } - else - { - nSymbolType=SVX_SYMBOLTYPE_BRUSHITEM; - bResetSize = sal_True; - } - SvxBmpItemInfo* pInfo = aGrfBrushItems[ nItemId - MN_GALLERY_ENTRY ]; - pGraphic = pInfo->pBrushItem->GetGraphic(); - } - else switch(nItemId) - { - case MN_SYMBOLS_AUTO: - { - pGraphic=&aAutoSymbolGraphic; - aAutoSymbolGraphic.SetPrefSize( Size(253,253) ); - nSymbolType=SVX_SYMBOLTYPE_AUTO; - } - break; - - case MN_SYMBOLS_NONE: - { - nSymbolType=SVX_SYMBOLTYPE_NONE; - pGraphic=NULL; - bEnable=sal_False; - } - break; - default: - { - SvxOpenGraphicDialog aGrfDlg(CUI_RES(RID_STR_EDIT_GRAPHIC)); - aGrfDlg.EnableLink(sal_False); - aGrfDlg.AsLink(sal_False); - if( !aGrfDlg.Execute() ) - { - // ausgewaehlten Filter merken - aGrfName = aGrfDlg.GetPath(); - if( !aGrfDlg.GetGraphic(aGraphic) ) - { - nSymbolType=SVX_SYMBOLTYPE_BRUSHITEM; - pGraphic = &aGraphic; - bResetSize = sal_True; - } - } - if( !pGraphic ) - return 0; - } - break; - } - - if(pGraphic) - { - Size aSize = SvxNumberFormat::GetGraphicSizeMM100(pGraphic); - aSize = OutputDevice::LogicToLogic(aSize, MAP_100TH_MM, (MapUnit)ePoolUnit); - aSymbolGraphic=*pGraphic; - if( bResetSize ) - { - aSymbolSize=aSize; - } - else if( nPreviousSymbolType == SVX_SYMBOLTYPE_BRUSHITEM ) - { //#i31097# Data Point Symbol size changes when a different symbol is choosen(maoyg) - if( aSymbolSize.Width() != aSymbolSize.Height() ) - { - aSize.setWidth( (long)( aSymbolSize.Width() + aSymbolSize.Height() )/2 ); - aSize.setHeight( (long)( aSymbolSize.Width() + aSymbolSize.Height() )/2 ); - aSymbolSize = aSize; - } - } - aCtlPreview.SetSymbol(&aSymbolGraphic,aSymbolSize); - } - else - { - aSymbolGraphic=Graphic(); - aCtlPreview.SetSymbol(NULL,aSymbolSize); - bEnable=sal_False; - } - aSymbolLastSize=aSymbolSize; - SetMetricValue(aSymbolWidthMF, aSymbolSize.Width(), ePoolUnit); - SetMetricValue(aSymbolHeightMF, aSymbolSize.Height(), ePoolUnit); - aSymbolRatioCB.Enable(bEnable); - aSymbolHeightFT.Enable(bEnable); - aSymbolWidthFT.Enable(bEnable); - aSymbolWidthMF.Enable(bEnable); - aSymbolHeightMF.Enable(bEnable); - aCtlPreview.Invalidate(); - - return 0; -} -IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, MetricField *, pField) -{ - bNewSize=true; - sal_Bool bWidth = (sal_Bool)(pField == &aSymbolWidthMF); - bLastWidthModified = bWidth; - sal_Bool bRatio = aSymbolRatioCB.IsChecked(); - long nWidthVal = static_cast<long>(aSymbolWidthMF.Denormalize(aSymbolWidthMF.GetValue(FUNIT_100TH_MM))); - long nHeightVal= static_cast<long>(aSymbolHeightMF.Denormalize(aSymbolHeightMF.GetValue(FUNIT_100TH_MM))); - nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MAP_100TH_MM,(MapUnit)ePoolUnit ); - nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MAP_100TH_MM,(MapUnit)ePoolUnit); - aSymbolSize=Size(nWidthVal,nHeightVal); - double fSizeRatio = (double)1; - - if(bRatio) - { - if (aSymbolLastSize.Height() && aSymbolLastSize.Width()) - fSizeRatio = (double)aSymbolLastSize.Width() / aSymbolLastSize.Height(); - } - - //Size aSymbolSize(aSymbolLastSize); - - if(bWidth) - { - long nDelta = nWidthVal - aSymbolLastSize.Width(); - aSymbolSize.Width() = nWidthVal; - if (bRatio) - { - aSymbolSize.Height() = aSymbolLastSize.Height() + (long)((double)nDelta / fSizeRatio); - aSymbolSize.Height() = OutputDevice::LogicToLogic( aSymbolSize.Height(),(MapUnit)ePoolUnit, MAP_100TH_MM ); - aSymbolHeightMF.SetUserValue(aSymbolHeightMF.Normalize(aSymbolSize.Height()), FUNIT_100TH_MM); - } - } - else - { - long nDelta = nHeightVal - aSymbolLastSize.Height(); - aSymbolSize.Height() = nHeightVal; - if (bRatio) - { - aSymbolSize.Width() = aSymbolLastSize.Width() + (long)((double)nDelta * fSizeRatio); - aSymbolSize.Width() = OutputDevice::LogicToLogic( aSymbolSize.Width(), - (MapUnit)ePoolUnit, MAP_100TH_MM ); - aSymbolWidthMF.SetUserValue(aSymbolWidthMF.Normalize(aSymbolSize.Width()), FUNIT_100TH_MM); - } - } - aCtlPreview.ResizeSymbol(aSymbolSize); - aSymbolLastSize=aSymbolSize; - return 0; -} -IMPL_LINK( SvxLineTabPage, RatioHdl_Impl, CheckBox *, pBox ) -{ - if (pBox->IsChecked()) - { - if (bLastWidthModified) - SizeHdl_Impl(&aSymbolWidthMF); - else - SizeHdl_Impl(&aSymbolHeightMF); - } - return 0; -} - - -void SvxLineTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SvxTabPage::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - { - FillListboxes(); - } -} - -void SvxLineTabPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False); - SFX_ITEMSET_ARG (&aSet,pDashListItem,SvxDashListItem,SID_DASH_LIST,sal_False); - SFX_ITEMSET_ARG (&aSet,pLineEndListItem,SvxLineEndListItem,SID_LINEEND_LIST,sal_False); - SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False); - SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False); - SFX_ITEMSET_ARG (&aSet,pSdrObjListItem,OfaPtrItem,SID_OBJECT_LIST,sal_False); - SFX_ITEMSET_ARG (&aSet,pSymbolAttrItem,SfxTabDialogItem,SID_ATTR_SET,sal_False); - SFX_ITEMSET_ARG (&aSet,pGraphicItem,SvxGraphicItem,SID_GRAPHIC,sal_False); - - if (pColorTabItem) - SetColorTable(pColorTabItem->GetColorTable()); - if (pDashListItem) - SetDashList(pDashListItem->GetDashList()); - if (pLineEndListItem) - SetLineEndList(pLineEndListItem->GetLineEndList()); - if (pPageTypeItem) - SetPageType(pPageTypeItem->GetValue()); - if (pDlgTypeItem) - SetDlgType(pDlgTypeItem->GetValue()); - Construct(); - - if(pSdrObjListItem) //symbols - { - ShowSymbolControls(sal_True); - pSymbolList = static_cast<SdrObjList*>(pSdrObjListItem->GetValue()); - if (pSymbolAttrItem) - pSymbolAttr = new SfxItemSet(pSymbolAttrItem->GetItemSet()); - if(pGraphicItem) - aAutoSymbolGraphic = pGraphicItem->GetGraphic(); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx deleted file mode 100644 index bfa75eac1..000000000 --- a/cui/source/tabpages/tplnedef.cxx +++ /dev/null @@ -1,959 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -#include <tools/shl.hxx> -#include <tools/urlobj.hxx> -#include <vcl/msgbox.hxx> -#include <unotools/pathoptions.hxx> -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <sfx2/filedlghelper.hxx> -#include "com/sun/star/ui/dialogs/TemplateDescription.hpp" - -#define _SVX_TPLNEDEF_CXX - -#include <cuires.hrc> -#include "tabline.hrc" -#include "helpid.hrc" - -#include "svx/xattr.hxx" -#include <svx/xpool.hxx> -#include <svx/xtable.hxx> - -#include "svx/drawitem.hxx" -#include "cuitabline.hxx" -#include "defdlgname.hxx" -#include <svx/svxdlg.hxx> -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include <svx/dialmgr.hxx> -#include <svx/dialogs.hrc> - -#define DLGWIN this->GetParent()->GetParent() - -#define BITMAP_WIDTH 32 -#define BITMAP_HEIGHT 12 -#define XOUT_WIDTH 150 - -/************************************************************************* -|* -|* Dialog zum Definieren von Linienstilen -|* -\************************************************************************/ - -SvxLineDefTabPage::SvxLineDefTabPage -( - Window* pParent, - const SfxItemSet& rInAttrs -) : - - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_LINE_DEF ), rInAttrs ), - - aFlDefinition ( this, CUI_RES( FL_DEFINITION ) ), - aFTLinestyle ( this, CUI_RES( FT_LINESTYLE ) ), - aLbLineStyles ( this, CUI_RES( LB_LINESTYLES ) ), - aFtType ( this, CUI_RES( FT_TYPE ) ), - aLbType1 ( this, CUI_RES( LB_TYPE_1 ) ), - aLbType2 ( this, CUI_RES( LB_TYPE_2 ) ), - aFtNumber ( this, CUI_RES( FT_NUMBER ) ), - aNumFldNumber1 ( this, CUI_RES( NUM_FLD_1 ) ), - aNumFldNumber2 ( this, CUI_RES( NUM_FLD_2 ) ), - aFtLength ( this, CUI_RES( FT_LENGTH ) ), - aMtrLength1 ( this, CUI_RES( MTR_FLD_LENGTH_1 ) ), - aMtrLength2 ( this, CUI_RES( MTR_FLD_LENGTH_2 ) ), - aFtDistance ( this, CUI_RES( FT_DISTANCE ) ), - aMtrDistance ( this, CUI_RES( MTR_FLD_DISTANCE ) ), - aCbxSynchronize ( this, CUI_RES( CBX_SYNCHRONIZE ) ), - aBtnAdd ( this, CUI_RES( BTN_ADD ) ), - aBtnModify ( this, CUI_RES( BTN_MODIFY ) ), - aBtnDelete ( this, CUI_RES( BTN_DELETE ) ), - aBtnLoad ( this, CUI_RES( BTN_LOAD ) ), - aBtnSave ( this, CUI_RES( BTN_SAVE ) ), - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ), - - rOutAttrs ( rInAttrs ), - - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXLStyle ( XLINE_DASH ), - aXWidth ( XOUT_WIDTH ), - aXDash ( String(), XDash( XDASH_RECT, 3, 7, 2, 40, 15 ) ), - aXColor ( String(), COL_BLACK ), - aXLineAttr ( pXPool ), - rXLSet ( aXLineAttr.GetItemSet() ) -{ - aLbType1.SetAccessibleName(String(CUI_RES( STR_START_TYPE ) ) ); - aLbType2.SetAccessibleName(String(CUI_RES( STR_END_TYPE ) ) ); - aNumFldNumber1.SetAccessibleName(String(CUI_RES( STR_START_NUM ) ) ); - aNumFldNumber2.SetAccessibleName(String(CUI_RES( STR_END_NUM ) ) ); - aMtrLength1.SetAccessibleName(String(CUI_RES( STR_START_LENGTH ) ) ); - aMtrLength2.SetAccessibleName(String(CUI_RES( STR_END_LENGTH ) ) ); - - FreeResource(); - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - // Metrik einstellen - eFUnit = GetModuleFieldUnit( rInAttrs ); - - switch ( eFUnit ) - { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; - break; - default: ; //prevent warning - } - SetFieldUnit( aMtrDistance, eFUnit ); - SetFieldUnit( aMtrLength1, eFUnit ); - SetFieldUnit( aMtrLength2, eFUnit ); - - // PoolUnit ermitteln - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool?" ); - ePoolUnit = pPool->GetMetric( SID_ATTR_LINE_WIDTH ); - - rXLSet.Put( aXLStyle ); - rXLSet.Put( aXWidth ); - rXLSet.Put( aXDash ); - rXLSet.Put( aXColor ); - - // #i34740# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); - - aBtnAdd.SetClickHdl( LINK( this, SvxLineDefTabPage, ClickAddHdl_Impl ) ); - aBtnModify.SetClickHdl( - LINK( this, SvxLineDefTabPage, ClickModifyHdl_Impl ) ); - aBtnDelete.SetClickHdl( - LINK( this, SvxLineDefTabPage, ClickDeleteHdl_Impl ) ); - aBtnLoad.SetClickHdl( LINK( this, SvxLineDefTabPage, ClickLoadHdl_Impl ) ); - aBtnSave.SetClickHdl( LINK( this, SvxLineDefTabPage, ClickSaveHdl_Impl ) ); - - aNumFldNumber1.SetModifyHdl( - LINK( this, SvxLineDefTabPage, ChangeNumber1Hdl_Impl ) ); - aNumFldNumber2.SetModifyHdl( - LINK( this, SvxLineDefTabPage, ChangeNumber2Hdl_Impl ) ); - aLbLineStyles.SetSelectHdl( - LINK( this, SvxLineDefTabPage, SelectLinestyleHdl_Impl ) ); - - // Absolut (in mm) oder Relativ (in %) - aCbxSynchronize.SetClickHdl( - LINK( this, SvxLineDefTabPage, ChangeMetricHdl_Impl ) ); - - // Wenn sich etwas aendert, muss Preview upgedatet werden werden - Link aLink = LINK( this, SvxLineDefTabPage, SelectTypeHdl_Impl ); - aLbType1.SetSelectHdl( aLink ); - aLbType2.SetSelectHdl( aLink ); - aLink = LINK( this, SvxLineDefTabPage, ChangePreviewHdl_Impl ); - aMtrLength1.SetModifyHdl( aLink ); - aMtrLength2.SetModifyHdl( aLink ); - aMtrDistance.SetModifyHdl( aLink ); - - pDashList = NULL; - - aBtnAdd.SetAccessibleRelationMemberOf( &aFlDefinition ); - aBtnModify.SetAccessibleRelationMemberOf( &aFlDefinition ); - aBtnDelete.SetAccessibleRelationMemberOf( &aFlDefinition ); - aBtnLoad.SetAccessibleRelationMemberOf( &aFlDefinition ); - aBtnSave.SetAccessibleRelationMemberOf( &aFlDefinition ); -} - - -// ----------------------------------------------------------------------- - -void SvxLineDefTabPage::Construct() -{ - // Linienstile - aLbLineStyles.Fill( pDashList ); -} - -// ----------------------------------------------------------------------- - -void SvxLineDefTabPage::ActivatePage( const SfxItemSet& ) -{ - if( *pDlgType == 0 ) // Flaechen-Dialog - { - // ActivatePage() wird aufgerufen bevor der Dialog PageCreated() erhaelt !!! - if( pDashList ) - { - if( *pPageType == 1 && - *pPosDashLb != LISTBOX_ENTRY_NOTFOUND ) - { - aLbLineStyles.SelectEntryPos( *pPosDashLb ); - } - // Damit evtl. vorhandener Linestyle verworfen wird - SelectLinestyleHdl_Impl( this ); - - // Ermitteln (evtl. abschneiden) des Namens und in - // der GroupBox darstellen - String aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) ); - INetURLObject aURL( pDashList->GetPath() ); - - aURL.Append( pDashList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - *pPageType = 0; // 2 - *pPosDashLb = LISTBOX_ENTRY_NOTFOUND; - } - } -} - -// ----------------------------------------------------------------------- - -int SvxLineDefTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - CheckChanges_Impl(); - - if( _pSet ) - FillItemSet( *_pSet ); - - return( LEAVE_PAGE ); -} - -// ----------------------------------------------------------------------- - -void SvxLineDefTabPage::CheckChanges_Impl() -{ - // wird hier benutzt, um Aenderungen NICHT zu verlieren - //XDashStyle eXDS; - - if( aNumFldNumber1.GetText() != aNumFldNumber1.GetSavedValue() || - aMtrLength1.GetText() != aMtrLength1.GetSavedValue() || - aLbType1.GetSelectEntryPos() != aLbType1.GetSavedValue() || - aNumFldNumber2.GetText() != aNumFldNumber2.GetSavedValue() || - aMtrLength2.GetText() != aMtrLength2.GetSavedValue() || - aLbType2.GetSelectEntryPos() != aLbType2.GetSavedValue() || - aMtrDistance.GetText() != aMtrDistance.GetSavedValue() ) - { - ResMgr& rMgr = CUI_MGR(); - Image aWarningBoxImage = WarningBox::GetStandardImage(); - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxMessDialog* aMessDlg = pFact->CreateSvxMessDialog( DLGWIN, RID_SVXDLG_MESSBOX, - SVX_RESSTR( RID_SVXSTR_LINESTYLE ), - String( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ), - &aWarningBoxImage ); - DBG_ASSERT(aMessDlg, "Dialogdiet fail!"); - aMessDlg->SetButtonText( MESS_BTN_1, - String( ResId( RID_SVXSTR_CHANGE, rMgr ) ) ); - aMessDlg->SetButtonText( MESS_BTN_2, - String( ResId( RID_SVXSTR_ADD, rMgr ) ) ); - - short nRet = aMessDlg->Execute(); - - switch( nRet ) - { - case RET_BTN_1: // Aendern - { - ClickModifyHdl_Impl( this ); - } - break; - - case RET_BTN_2: // Hinzufuegen - { - ClickAddHdl_Impl( this ); - } - break; - - case RET_CANCEL: - break; - } - delete aMessDlg; - } - - - - sal_uInt16 nPos = aLbLineStyles.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - *pPosDashLb = nPos; - } -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxLineDefTabPage::FillItemSet( SfxItemSet& rAttrs ) -{ - if( *pDlgType == 0 ) // Linien-Dialog - { - if( *pPageType == 2 ) - { - FillDash_Impl(); - - String aString( aLbLineStyles.GetSelectEntry() ); - rAttrs.Put( XLineStyleItem( XLINE_DASH ) ); - rAttrs.Put( XLineDashItem( aString, aDash ) ); - } - } - return( sal_True ); -} - -// ----------------------------------------------------------------------- - -void SvxLineDefTabPage::Reset( const SfxItemSet& rAttrs ) -{ - if( rAttrs.GetItemState( GetWhich( XATTR_LINESTYLE ) ) != SFX_ITEM_DONTCARE ) - { - XLineStyle eXLS = (XLineStyle) ( ( const XLineStyleItem& ) rAttrs.Get( GetWhich( XATTR_LINESTYLE ) ) ).GetValue(); - - switch( eXLS ) - { - case XLINE_NONE: - case XLINE_SOLID: - aLbLineStyles.SelectEntryPos( 0 ); - break; - - case XLINE_DASH: - { - const XLineDashItem& rDashItem = ( const XLineDashItem& ) rAttrs.Get( XATTR_LINEDASH ); - aDash = rDashItem.GetDashValue(); - - aLbLineStyles.SetNoSelection(); - aLbLineStyles.SelectEntry( rDashItem.GetName() ); - } - break; - - default: - break; - } - } - SelectLinestyleHdl_Impl( NULL ); - - // Status der Buttons ermitteln - if( pDashList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxLineDefTabPage::Create( Window* pWindow, - const SfxItemSet& rOutAttrs ) -{ - return( new SvxLineDefTabPage( pWindow, rOutAttrs ) ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineDefTabPage, SelectLinestyleHdl_Impl, void *, p ) -{ - if( pDashList->Count() > 0 ) - { - int nTmp = aLbLineStyles.GetSelectEntryPos(); - if( nTmp == LISTBOX_ENTRY_NOTFOUND ) - { - } - else - aDash = pDashList->GetDash( nTmp )->GetDash(); - - FillDialog_Impl(); - - rXLSet.Put( XLineDashItem( String(), aDash ) ); - - // #i34740# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); - - aCtlPreview.Invalidate(); - - // Wird erst hier gesetzt, um den Style nur dann zu uebernehmen, - // wenn in der ListBox ein Eintrag ausgewaehlt wurde - // Wenn ueber Reset() gerufen wurde ist p == NULL - if( p ) - *pPageType = 2; - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK_INLINE_START( SvxLineDefTabPage, ChangePreviewHdl_Impl, void *, EMPTYARG ) -{ - FillDash_Impl(); - aCtlPreview.Invalidate(); - - return( 0L ); -} -IMPL_LINK_INLINE_END( SvxLineDefTabPage, ChangePreviewHdl_Impl, void *, EMPTYARG ) - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineDefTabPage, ChangeNumber1Hdl_Impl, void *, EMPTYARG ) -{ - if( aNumFldNumber1.GetValue() == 0L ) - { - aNumFldNumber2.SetMin( 1L ); - aNumFldNumber2.SetFirst( 1L ); - } - else - { - aNumFldNumber2.SetMin( 0L ); - aNumFldNumber2.SetFirst( 0L ); - } - - ChangePreviewHdl_Impl( this ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineDefTabPage, ChangeNumber2Hdl_Impl, void *, EMPTYARG ) -{ - if( aNumFldNumber2.GetValue() == 0L ) - { - aNumFldNumber1.SetMin( 1L ); - aNumFldNumber1.SetFirst( 1L ); - } - else - { - aNumFldNumber1.SetMin( 0L ); - aNumFldNumber1.SetFirst( 0L ); - } - - ChangePreviewHdl_Impl( this ); - - return( 0L ); -} - - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineDefTabPage, ChangeMetricHdl_Impl, void *, p ) -{ - if( !aCbxSynchronize.IsChecked() && aMtrLength1.GetUnit() != eFUnit ) - { - long nTmp1, nTmp2, nTmp3; - - // Wurde ueber Control geaendert - if( p ) - { - nTmp1 = GetCoreValue( aMtrLength1, ePoolUnit ) * XOUT_WIDTH / 100; - nTmp2 = GetCoreValue( aMtrLength2, ePoolUnit ) * XOUT_WIDTH / 100; - nTmp3 = GetCoreValue( aMtrDistance, ePoolUnit ) * XOUT_WIDTH / 100; - } - else - { - nTmp1 = GetCoreValue( aMtrLength1, ePoolUnit ); - nTmp2 = GetCoreValue( aMtrLength2, ePoolUnit ); - nTmp3 = GetCoreValue( aMtrDistance, ePoolUnit ); - } - aMtrLength1.SetDecimalDigits( 2 ); - aMtrLength2.SetDecimalDigits( 2 ); - aMtrDistance.SetDecimalDigits( 2 ); - - // Metrik einstellen - aMtrLength1.SetUnit( eFUnit ); - aMtrLength2.SetUnit( eFUnit ); - aMtrDistance.SetUnit( eFUnit ); - - SetMetricValue( aMtrLength1, nTmp1, ePoolUnit ); - SetMetricValue( aMtrLength2, nTmp2, ePoolUnit ); - SetMetricValue( aMtrDistance, nTmp3, ePoolUnit ); - } - else if( aCbxSynchronize.IsChecked() && aMtrLength1.GetUnit() != FUNIT_CUSTOM ) - { - long nTmp1, nTmp2, nTmp3; - - // Wurde ueber Control geaendert - if( p ) - { - nTmp1 = GetCoreValue( aMtrLength1, ePoolUnit ) * 100 / XOUT_WIDTH; - nTmp2 = GetCoreValue( aMtrLength2, ePoolUnit ) * 100 / XOUT_WIDTH; - nTmp3 = GetCoreValue( aMtrDistance, ePoolUnit ) * 100 / XOUT_WIDTH; - } - else - { - nTmp1 = GetCoreValue( aMtrLength1, ePoolUnit ); - nTmp2 = GetCoreValue( aMtrLength2, ePoolUnit ); - nTmp3 = GetCoreValue( aMtrDistance, ePoolUnit ); - } - - aMtrLength1.SetDecimalDigits( 0 ); - aMtrLength2.SetDecimalDigits( 0 ); - aMtrDistance.SetDecimalDigits( 0 ); - - aMtrLength1.SetUnit( FUNIT_CUSTOM ); - aMtrLength2.SetUnit( FUNIT_CUSTOM ); - aMtrDistance.SetUnit( FUNIT_CUSTOM ); - - - SetMetricValue( aMtrLength1, nTmp1, ePoolUnit ); - SetMetricValue( aMtrLength2, nTmp2, ePoolUnit ); - SetMetricValue( aMtrDistance, nTmp3, ePoolUnit ); - } - SelectTypeHdl_Impl( NULL ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineDefTabPage, SelectTypeHdl_Impl, void *, p ) -{ - if ( p == &aLbType1 || !p ) - { - if ( aLbType1.GetSelectEntryPos() == 0 ) - { - aMtrLength1.Disable(); - aMtrLength1.SetText( String() ); - } - else if ( !aMtrLength1.IsEnabled() ) - { - aMtrLength1.Enable(); - aMtrLength1.Reformat(); - } - } - - if ( p == &aLbType2 || !p ) - { - if ( aLbType2.GetSelectEntryPos() == 0 ) - { - aMtrLength2.Disable(); - aMtrLength2.SetText( String() ); - } - else if ( !aMtrLength2.IsEnabled() ) - { - aMtrLength2.Enable(); - aMtrLength2.Reformat(); - } - } - ChangePreviewHdl_Impl( p ); - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineDefTabPage, ClickAddHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_LINESTYLE ) ); - String aDesc( ResId( RID_SVXSTR_DESC_LINESTYLE, rMgr ) ); - String aName; - XDashEntry* pEntry; - - long nCount = pDashList->Count(); - long j = 1; - sal_Bool bDifferent = sal_False; - - while ( !bDifferent ) - { - aName = aNewName; - aName += sal_Unicode(' '); - aName += UniString::CreateFromInt32( j++ ); - bDifferent = sal_True; - - for ( long i = 0; i < nCount && bDifferent; i++ ) - if ( aName == pDashList->GetDash( i )->GetName() ) - bDifferent = sal_False; - } - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - sal_Bool bLoop = sal_True; - - while ( bLoop && pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - { - if( aName == pDashList->GetDash( i )->GetName() ) - bDifferent = sal_False; - } - - if( bDifferent ) - { - bLoop = sal_False; - FillDash_Impl(); - - pEntry = new XDashEntry( aDash, aName ); - - long nDashCount = pDashList->Count(); - pDashList->Insert( pEntry, nDashCount ); - Bitmap* pBitmap = pDashList->GetBitmap( nDashCount ); - aLbLineStyles.Append( pEntry, pBitmap ); - - aLbLineStyles.SelectEntryPos( aLbLineStyles.GetEntryCount() - 1 ); - - // Flag fuer modifiziert setzen - *pnDashListState |= CT_MODIFIED; - - *pPageType = 2; - - // Werte sichern fuer Changes-Erkennung ( -> Methode ) - aNumFldNumber1.SaveValue(); - aMtrLength1.SaveValue(); - aLbType1.SaveValue(); - aNumFldNumber2.SaveValue(); - aMtrLength2.SaveValue(); - aLbType2.SaveValue(); - aMtrDistance.SaveValue(); - } - else - { - WarningBox aBox( DLGWIN, WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); - aBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); - aBox.Execute(); - } - } - delete( pDlg ); - - // Status der Buttons ermitteln - if ( pDashList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineDefTabPage, ClickModifyHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbLineStyles.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_LINESTYLE ) ); - String aDesc( ResId( RID_SVXSTR_DESC_LINESTYLE, rMgr ) ); - String aName( pDashList->GetDash( nPos )->GetName() ); - String aOldName = aName; - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - - long nCount = pDashList->Count(); - sal_Bool bDifferent = sal_False; - sal_Bool bLoop = sal_True; - - while ( bLoop && pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - { - if( aName == pDashList->GetDash( i )->GetName() && - aName != aOldName ) - bDifferent = sal_False; - } - - if ( bDifferent ) - { - bLoop = sal_False; - FillDash_Impl(); - - XDashEntry* pEntry = new XDashEntry( aDash, aName ); - - delete pDashList->Replace( pEntry, nPos ); - Bitmap* pBitmap = pDashList->GetBitmap( nPos ); - aLbLineStyles.Modify( pEntry, nPos, pBitmap ); - - aLbLineStyles.SelectEntryPos( nPos ); - - // Flag fuer modifiziert setzen - *pnDashListState |= CT_MODIFIED; - - *pPageType = 2; - - // Werte sichern fuer Changes-Erkennung ( -> Methode ) - aNumFldNumber1.SaveValue(); - aMtrLength1.SaveValue(); - aLbType1.SaveValue(); - aNumFldNumber2.SaveValue(); - aMtrLength2.SaveValue(); - aLbType2.SaveValue(); - aMtrDistance.SaveValue(); - } - else - { - WarningBox aBox( DLGWIN, WinBits( WB_OK ), String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); - aBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); - aBox.Execute(); - } - } - delete( pDlg ); - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineDefTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbLineStyles.GetSelectEntryPos(); - - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ), - String( CUI_RES( RID_SVXSTR_ASK_DEL_LINESTYLE ) ) ); - - if ( aQueryBox.Execute() == RET_YES ) - { - delete pDashList->Remove( nPos ); - aLbLineStyles.RemoveEntry( nPos ); - aLbLineStyles.SelectEntryPos( 0 ); - - SelectLinestyleHdl_Impl( this ); - *pPageType = 0; // Style soll nicht uebernommen werden - - // Flag fuer modifiziert setzen - *pnDashListState |= CT_MODIFIED; - - ChangePreviewHdl_Impl( this ); - } - } - - // Status der Buttons ermitteln - if ( !pDashList->Count() ) - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return( 0L ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxLineDefTabPage, ClickLoadHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - sal_uInt16 nReturn = RET_YES; - - if ( *pnDashListState & CT_MODIFIED ) - { - nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ), - String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute(); - - if ( nReturn == RET_YES ) - pDashList->Save(); - } - - if ( nReturn != RET_CANCEL ) - { - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sod" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - // Liste speichern - XDashList* pDshLst = new XDashList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool ); - pDshLst->SetName( aURL.getName() ); - - if( pDshLst->Load() ) - { - // Pruefen, ob Tabelle geloescht werden darf: - if( pDashList != ( (SvxLineTabDialog*) DLGWIN )->GetDashList() ) - delete pDashList; - - pDashList = pDshLst; - ( (SvxLineTabDialog*) DLGWIN )->SetNewDashList( pDashList ); - - aLbLineStyles.Clear(); - aLbLineStyles.Fill( pDashList ); - Reset( rOutAttrs ); - - pDashList->SetName( aURL.getName() ); - - // Flag fuer gewechselt setzen - *pnDashListState |= CT_CHANGED; - // Flag fuer modifiziert entfernen - *pnDashListState &= ~CT_MODIFIED; - } - else - //aIStream.Close(); - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute(); - } - } - - // Status der Buttons ermitteln - if ( pDashList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return( 0L ); -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxLineDefTabPage, ClickSaveHdl_Impl, void *, EMPTYARG ) -{ - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.sod" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( pDashList->GetName().Len() ) - { - aFile.Append( pDashList->GetName() ); - - if( !aFile.getExtension().getLength() ) - aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "sod" ) ) ); - } - - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - if ( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - pDashList->SetName( aURL.getName() ); - pDashList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( pDashList->Save() ) - { - // Flag fuer gespeichert setzen - *pnDashListState |= CT_SAVED; - // Flag fuer modifiziert entfernen - *pnDashListState &= ~CT_MODIFIED; - } - else - { - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute(); - } - } - - return( 0L ); -} - -//------------------------------------------------------------------------ - -void SvxLineDefTabPage::FillDash_Impl() -{ - XDashStyle eXDS; - - if( aCbxSynchronize.IsChecked() ) - eXDS = XDASH_RECTRELATIVE; - else - eXDS = XDASH_RECT; - - aDash.SetDashStyle( eXDS ); - aDash.SetDots( (sal_uInt8) aNumFldNumber1.GetValue() ); - aDash.SetDotLen( aLbType1.GetSelectEntryPos() == 0 ? 0 : - GetCoreValue( aMtrLength1, ePoolUnit ) ); - aDash.SetDashes( (sal_uInt8) aNumFldNumber2.GetValue() ); - aDash.SetDashLen( aLbType2.GetSelectEntryPos() == 0 ? 0 : - GetCoreValue( aMtrLength2, ePoolUnit ) ); - aDash.SetDistance( GetCoreValue( aMtrDistance, ePoolUnit ) ); - - rXLSet.Put( XLineDashItem( String(), aDash ) ); - - // #i34740# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); -} - -//------------------------------------------------------------------------ - -void SvxLineDefTabPage::FillDialog_Impl() -{ - XDashStyle eXDS = aDash.GetDashStyle(); // XDASH_RECT, XDASH_ROUND - if( eXDS == XDASH_RECTRELATIVE ) - aCbxSynchronize.Check(); - else - aCbxSynchronize.Check( sal_False ); - - aNumFldNumber1.SetValue( aDash.GetDots() ); - SetMetricValue( aMtrLength1, aDash.GetDotLen(), ePoolUnit ); - aLbType1.SelectEntryPos( aDash.GetDotLen() == 0 ? 0 : 1 ); - aNumFldNumber2.SetValue( aDash.GetDashes() ); - SetMetricValue( aMtrLength2, aDash.GetDashLen(), ePoolUnit ); - aLbType2.SelectEntryPos( aDash.GetDashLen() == 0 ? 0 : 1 ); - SetMetricValue( aMtrDistance, aDash.GetDistance(), ePoolUnit ); - - ChangeMetricHdl_Impl( NULL ); - - // Werte sichern fuer Changes-Erkennung ( -> Methode ) - aNumFldNumber1.SaveValue(); - aMtrLength1.SaveValue(); - aLbType1.SaveValue(); - aNumFldNumber2.SaveValue(); - aMtrLength2.SaveValue(); - aLbType2.SaveValue(); - aMtrDistance.SaveValue(); -} - - -void SvxLineDefTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxTabPage::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - { - sal_uInt16 nOldSelect = aLbLineStyles.GetSelectEntryPos(); - aLbLineStyles.Clear(); - aLbLineStyles.Fill( pDashList ); - aLbLineStyles.SelectEntryPos( nOldSelect ); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx deleted file mode 100644 index afb15156c..000000000 --- a/cui/source/tabpages/tplneend.cxx +++ /dev/null @@ -1,701 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <tools/shl.hxx> -#include <tools/urlobj.hxx> -#include <vcl/msgbox.hxx> -#include <unotools/pathoptions.hxx> -#include <sfx2/app.hxx> -#include <sfx2/filedlghelper.hxx> -#include "com/sun/star/ui/dialogs/TemplateDescription.hpp" - -#define _SVX_TPLNEEND_CXX - -#include <cuires.hrc> -#include "tabline.hrc" -#include "helpid.hrc" -#include <svx/dialmgr.hxx> -#include <svx/svdobj.hxx> -#include <svx/svdopath.hxx> -#include "svx/drawitem.hxx" -#include <svx/xpool.hxx> -#include <svx/xtable.hxx> -#include "cuitabline.hxx" -#include <svx/svxdlg.hxx> -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include <basegfx/range/b2drange.hxx> -#include <basegfx/polygon/b2dpolygontools.hxx> -#include <basegfx/matrix/b2dhommatrix.hxx> -#include <basegfx/polygon/b2dpolygon.hxx> -#include <basegfx/polygon/b2dpolypolygontools.hxx> -#include <basegfx/matrix/b2dhommatrixtools.hxx> -#include <svx/dialogs.hrc> - -#define DLGWIN this->GetParent()->GetParent() - -#define BITMAP_WIDTH 32 -#define BITMAP_HEIGHT 12 -#define XOUT_WIDTH 150 - -/************************************************************************* -|* -|* Dialog zum Definieren von Linienenden-Stilen -|* -\************************************************************************/ - -SvxLineEndDefTabPage::SvxLineEndDefTabPage -( - Window* pParent, - const SfxItemSet& rInAttrs -) : - - SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_LINEEND_DEF ), rInAttrs ), - - aFlTip ( this, CUI_RES( FL_TIP ) ), - aFTTitle ( this, CUI_RES( FT_TITLE ) ), - aEdtName ( this, CUI_RES( EDT_NAME ) ), - aFTLineEndStyle ( this, CUI_RES( FT_LINE_END_STYLE ) ), - aLbLineEnds ( this, CUI_RES( LB_LINEENDS ) ), - aBtnAdd ( this, CUI_RES( BTN_ADD ) ), - aBtnModify ( this, CUI_RES( BTN_MODIFY ) ), - aBtnDelete ( this, CUI_RES( BTN_DELETE ) ), - aBtnLoad ( this, CUI_RES( BTN_LOAD ) ), - aBtnSave ( this, CUI_RES( BTN_SAVE ) ), - aFiTip ( this, CUI_RES( FI_TIP ) ), - aCtlPreview ( this, CUI_RES( CTL_PREVIEW ) ), - - rOutAttrs ( rInAttrs ), - pPolyObj( NULL ), - - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXLStyle ( XLINE_SOLID ), - aXWidth ( XOUT_WIDTH ), - aXColor ( String(), COL_BLACK ), - aXLineAttr ( pXPool ), - rXLSet ( aXLineAttr.GetItemSet() ), - pLineEndList( NULL ) -{ - FreeResource(); - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - rXLSet.Put( aXLStyle ); - rXLSet.Put( aXWidth ); - rXLSet.Put( aXColor ); - rXLSet.Put( XLineStartWidthItem( aCtlPreview.GetOutputSize().Height() / 2 ) ); - rXLSet.Put( XLineEndWidthItem( aCtlPreview.GetOutputSize().Height() / 2 ) ); - - // #i34740# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); - - aBtnAdd.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickAddHdl_Impl ) ); - aBtnModify.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickModifyHdl_Impl ) ); - aBtnDelete.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickDeleteHdl_Impl ) ); - aBtnLoad.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickLoadHdl_Impl ) ); - aBtnSave.SetClickHdl( - LINK( this, SvxLineEndDefTabPage, ClickSaveHdl_Impl ) ); - - aLbLineEnds.SetSelectHdl( - LINK( this, SvxLineEndDefTabPage, SelectLineEndHdl_Impl ) ); - - aBtnAdd.SetAccessibleRelationMemberOf(&aFlTip); - aBtnModify.SetAccessibleRelationMemberOf(&aFlTip); - aBtnDelete.SetAccessibleRelationMemberOf(&aFlTip); -} - -//------------------------------------------------------------------------ - -SvxLineEndDefTabPage::~SvxLineEndDefTabPage() -{ -} - -// ----------------------------------------------------------------------- - -void SvxLineEndDefTabPage::Construct() -{ - aLbLineEnds.Fill( pLineEndList ); - - bool bCreateArrowPossible = true; - - if( !pPolyObj ) - { - bCreateArrowPossible = false; - } - else if( !pPolyObj->ISA( SdrPathObj ) ) - { - SdrObjTransformInfoRec aInfoRec; - pPolyObj->TakeObjInfo( aInfoRec ); - SdrObject* pNewObj = 0; - if( aInfoRec.bCanConvToPath ) - pNewObj = pPolyObj->ConvertToPolyObj( sal_True, sal_False ); - - bCreateArrowPossible = pNewObj && pNewObj->ISA( SdrPathObj ); - SdrObject::Free( pNewObj ); - } - - if( !bCreateArrowPossible ) - aBtnAdd.Disable(); -} - -// ----------------------------------------------------------------------- - -void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& ) -{ - if( *pDlgType == 0 ) // Flaechen-Dialog - { - // ActivatePage() wird aufgerufen bevor der Dialog PageCreated() erhaelt !!! - if( pLineEndList ) - { - if( *pPosLineEndLb != LISTBOX_ENTRY_NOTFOUND ) - { - aLbLineEnds.SelectEntryPos( *pPosLineEndLb ); - SelectLineEndHdl_Impl( this ); - } - INetURLObject aURL( pLineEndList->GetPath() ); - - aURL.Append( pLineEndList->GetName() ); - DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - *pPageType = 0; // 3 - *pPosLineEndLb = LISTBOX_ENTRY_NOTFOUND; - } - } -} - -// ----------------------------------------------------------------------- - -int SvxLineEndDefTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - CheckChanges_Impl(); - - if( _pSet ) - FillItemSet( *_pSet ); - - return( LEAVE_PAGE ); -} - -// ----------------------------------------------------------------------- - -void SvxLineEndDefTabPage::CheckChanges_Impl() -{ - sal_uInt16 nPos = aLbLineEnds.GetSelectEntryPos(); - - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - String aString = aEdtName.GetText(); - - if( aString != aLbLineEnds.GetSelectEntry() ) - { - QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ), - CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_LINEEND ) ); - - if ( aQueryBox.Execute() == RET_YES ) - ClickModifyHdl_Impl( this ); - } - } - nPos = aLbLineEnds.GetSelectEntryPos(); - - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - *pPosLineEndLb = nPos; -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxLineEndDefTabPage::FillItemSet( SfxItemSet& rSet ) -{ - if( *pDlgType == 0 ) // Linien-Dialog - { - if( *pPageType == 3 ) - { - CheckChanges_Impl(); - - long nPos = aLbLineEnds.GetSelectEntryPos(); - XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); - - rSet.Put( XLineStartItem( pEntry->GetName(), pEntry->GetLineEnd() ) ); - rSet.Put( XLineEndItem( pEntry->GetName(), pEntry->GetLineEnd() ) ); - } - } - return( sal_True ); -} - -// ----------------------------------------------------------------------- - -void SvxLineEndDefTabPage::Reset( const SfxItemSet& ) -{ - aLbLineEnds.SelectEntryPos( 0 ); - - // Update lineend - if( pLineEndList->Count() > 0 ) - { - int nPos = aLbLineEnds.GetSelectEntryPos(); - - XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); - - aEdtName.SetText( aLbLineEnds.GetSelectEntry() ); - - rXLSet.Put( XLineStartItem( String(), pEntry->GetLineEnd() ) ); - rXLSet.Put( XLineEndItem( String(), pEntry->GetLineEnd() ) ); - - // #i34740# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); - - aCtlPreview.Invalidate(); - } - - // Status der Buttons ermitteln - if( pLineEndList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxLineEndDefTabPage::Create( Window* pWindow, - const SfxItemSet& rSet ) -{ - return( new SvxLineEndDefTabPage( pWindow, rSet ) ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineEndDefTabPage, SelectLineEndHdl_Impl, void *, EMPTYARG ) -{ - if( pLineEndList->Count() > 0 ) - { - int nPos = aLbLineEnds.GetSelectEntryPos(); - - XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); - - aEdtName.SetText( aLbLineEnds.GetSelectEntry() ); - - rXLSet.Put( XLineStartItem( String(), pEntry->GetLineEnd() ) ); - rXLSet.Put( XLineEndItem( String(), pEntry->GetLineEnd() ) ); - - // #i34740# - aCtlPreview.SetLineAttributes(aXLineAttr.GetItemSet()); - - aCtlPreview.Invalidate(); - - // Wird erst hier gesetzt, um den Style nur dann zu uebernehmen, - // wenn in der ListBox ein Eintrag ausgewaehlt wurde - *pPageType = 3; - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -long SvxLineEndDefTabPage::ChangePreviewHdl_Impl( void* ) -{ - aCtlPreview.Invalidate(); - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineEndDefTabPage, ClickModifyHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbLineEnds.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - ResMgr& rMgr = CUI_MGR(); - String aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) ); - String aName( aEdtName.GetText() ); - long nCount = pLineEndList->Count(); - sal_Bool bDifferent = sal_True; - - // Pruefen, ob Name schon vorhanden ist - for ( long i = 0; i < nCount && bDifferent; i++ ) - if ( aName == pLineEndList->GetLineEnd( i )->GetName() ) - bDifferent = sal_False; - - // Wenn ja, wird wiederholt ein neuer Name angefordert - if ( !bDifferent ) - { - WarningBox aWarningBox( DLGWIN, WinBits( WB_OK ), - String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); - aWarningBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); - aWarningBox.Execute(); - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - sal_Bool bLoop = sal_True; - - while( !bDifferent && bLoop && pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - { - if( aName == pLineEndList->GetLineEnd( i )->GetName() ) - bDifferent = sal_False; - } - - if( bDifferent ) - bLoop = sal_False; - else - aWarningBox.Execute(); - } - delete( pDlg ); - } - - // Wenn nicht vorhanden, wird Eintrag aufgenommen - if( bDifferent ) - { - XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nPos ); - - pEntry->SetName( aName ); - aEdtName.SetText( aName ); - - aLbLineEnds.Modify( pEntry, nPos, pLineEndList->GetBitmap( nPos ) ); - aLbLineEnds.SelectEntryPos( nPos ); - - // Flag fuer modifiziert setzen - *pnLineEndListState |= CT_MODIFIED; - - *pPageType = 3; - } - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineEndDefTabPage, ClickAddHdl_Impl, void *, EMPTYARG ) -{ - if( pPolyObj ) - { - const SdrObject* pNewObj; - SdrObject* pConvPolyObj = NULL; - - if( pPolyObj->ISA( SdrPathObj ) ) - { - pNewObj = pPolyObj; - } - else - { - SdrObjTransformInfoRec aInfoRec; - pPolyObj->TakeObjInfo( aInfoRec ); - - if( aInfoRec.bCanConvToPath ) - { - pNewObj = pConvPolyObj = pPolyObj->ConvertToPolyObj( sal_True, sal_False ); - - if( !pNewObj || !pNewObj->ISA( SdrPathObj ) ) - return( 0L ); // Abbruch, zusaetzliche Sicherheit, die bei - // Gruppenobjekten aber nichts bringt. - } - else return( 0L ); // Abbruch - } - - basegfx::B2DPolyPolygon aNewPolyPolygon(((SdrPathObj*)pNewObj)->GetPathPoly()); - basegfx::B2DRange aNewRange(basegfx::tools::getRange(aNewPolyPolygon)); - - // Normalisieren - aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix( - -aNewRange.getMinX(), -aNewRange.getMinY())); - - // Loeschen des angelegten PolyObjektes - SdrObject::Free( pConvPolyObj ); - - XLineEndEntry* pEntry; - - ResMgr& rMgr = CUI_MGR(); - String aNewName( SVX_RES( RID_SVXSTR_LINEEND ) ); - String aDesc( ResId( RID_SVXSTR_DESC_LINEEND, rMgr ) ); - String aName; - - long nCount = pLineEndList->Count(); - long j = 1; - sal_Bool bDifferent = sal_False; - - while ( !bDifferent ) - { - aName = aNewName; - aName += sal_Unicode(' '); - aName += UniString::CreateFromInt32( j++ ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - if ( aName == pLineEndList->GetLineEnd( i )->GetName() ) - bDifferent = sal_False; - } - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); - AbstractSvxNameDialog* pDlg = pFact->CreateSvxNameDialog( DLGWIN, aName, aDesc ); - DBG_ASSERT(pDlg, "Dialogdiet fail!"); - sal_Bool bLoop = sal_True; - - while ( bLoop && pDlg->Execute() == RET_OK ) - { - pDlg->GetName( aName ); - bDifferent = sal_True; - - for( long i = 0; i < nCount && bDifferent; i++ ) - { - if( aName == pLineEndList->GetLineEnd( i )->GetName() ) - bDifferent = sal_False; - } - - if( bDifferent ) - { - bLoop = sal_False; - pEntry = new XLineEndEntry( aNewPolyPolygon, aName ); - - long nLineEndCount = pLineEndList->Count(); - pLineEndList->Insert( pEntry, nLineEndCount ); - Bitmap* pBitmap = pLineEndList->GetBitmap( nLineEndCount ); - - // Zur ListBox hinzufuegen - aLbLineEnds.Append( pEntry, pBitmap ); - aLbLineEnds.SelectEntryPos( aLbLineEnds.GetEntryCount() - 1 ); - - // Flag fuer modifiziert setzen - *pnLineEndListState |= CT_MODIFIED; - - SelectLineEndHdl_Impl( this ); - } - else - { - WarningBox aBox( DLGWIN, WinBits( WB_OK ),String( ResId( RID_SVXSTR_WARN_NAME_DUPLICATE, rMgr ) ) ); - aBox.SetHelpId( HID_WARN_NAME_DUPLICATE ); - aBox.Execute(); - } - } - delete pDlg; - } - else - aBtnAdd.Disable(); - - // Status der Buttons ermitteln - if ( pLineEndList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineEndDefTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG ) -{ - sal_uInt16 nPos = aLbLineEnds.GetSelectEntryPos(); - - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - QueryBox aQueryBox( DLGWIN, WinBits( WB_YES_NO | WB_DEF_NO ), - String( CUI_RES( RID_SVXSTR_ASK_DEL_LINEEND ) ) ); - - if ( aQueryBox.Execute() == RET_YES ) - { - delete pLineEndList->Remove( nPos ); - aLbLineEnds.RemoveEntry( nPos ); - aLbLineEnds.SelectEntryPos( 0 ); - - SelectLineEndHdl_Impl( this ); - *pPageType = 0; // LineEnd soll nicht uebernommen werden - - // Flag fuer modifiziert setzen - *pnLineEndListState |= CT_MODIFIED; - - ChangePreviewHdl_Impl( this ); - } - } - // Status der Buttons ermitteln - if( !pLineEndList->Count() ) - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineEndDefTabPage, ClickLoadHdl_Impl, void *, EMPTYARG ) -{ - ResMgr& rMgr = CUI_MGR(); - sal_uInt16 nReturn = RET_YES; - - if ( *pnLineEndListState & CT_MODIFIED ) - { - nReturn = WarningBox( DLGWIN, WinBits( WB_YES_NO_CANCEL ), - String( ResId( RID_SVXSTR_WARN_TABLE_OVERWRITE, rMgr ) ) ).Execute(); - - if ( nReturn == RET_YES ) - pLineEndList->Save(); - } - - if ( nReturn != RET_CANCEL ) - { - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soe" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - // Liste speichern - XLineEndList* pLeList = new XLineEndList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool ); - pLeList->SetName( aURL.getName() ); - if( pLeList->Load() ) - { - // Pruefen, ob Tabelle geloescht werden darf: - if( pLineEndList != ( (SvxLineTabDialog*) DLGWIN )->GetLineEndList() ) - delete pLineEndList; - - pLineEndList = pLeList; - ( (SvxLineTabDialog*) DLGWIN )->SetNewLineEndList( pLineEndList ); - aLbLineEnds.Clear(); - aLbLineEnds.Fill( pLineEndList ); - Reset( rOutAttrs ); - - pLineEndList->SetName( aURL.getName() ); - - // Flag fuer gewechselt setzen - *pnLineEndListState |= CT_CHANGED; - // Flag fuer modifiziert entfernen - *pnLineEndListState &= ~CT_MODIFIED; - } - else - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( ResId( RID_SVXSTR_READ_DATA_ERROR, rMgr ) ) ).Execute(); - } - } - - // Status der Buttons ermitteln - if ( pLineEndList->Count() ) - { - aBtnModify.Enable(); - aBtnDelete.Enable(); - aBtnSave.Enable(); - } - else - { - aBtnModify.Disable(); - aBtnDelete.Disable(); - aBtnSave.Disable(); - } - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxLineEndDefTabPage, ClickSaveHdl_Impl, void *, EMPTYARG ) -{ - ::sfx2::FileDialogHelper aDlg( - com::sun::star::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE, 0 ); - String aStrFilterType( RTL_CONSTASCII_USTRINGPARAM( "*.soe" ) ); - aDlg.AddFilter( aStrFilterType, aStrFilterType ); - - INetURLObject aFile( SvtPathOptions().GetPalettePath() ); - DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); - - if( pLineEndList->GetName().Len() ) - { - aFile.Append( pLineEndList->GetName() ); - - if( !aFile.getExtension().getLength() ) - aFile.SetExtension( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "soe" ) ) ); - } - - aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); - if ( aDlg.Execute() == ERRCODE_NONE ) - { - INetURLObject aURL( aDlg.GetPath() ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); - aPathURL.removeFinalSlash(); - - pLineEndList->SetName( aURL.getName() ); - pLineEndList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) ); - - if( pLineEndList->Save() ) - { - // Flag fuer gespeichert setzen - *pnLineEndListState |= CT_SAVED; - // Flag fuer modifiziert entfernen - *pnLineEndListState &= ~CT_MODIFIED; - } - else - { - ErrorBox( DLGWIN, WinBits( WB_OK ), - String( CUI_RES( RID_SVXSTR_WRITE_DATA_ERROR ) ) ).Execute(); - } - } - return( 0L ); -} - -void SvxLineEndDefTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxTabPage::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) ) - { - sal_uInt16 nOldSelect = aLbLineEnds.GetSelectEntryPos(); - aLbLineEnds.Clear(); - aLbLineEnds.Fill( pLineEndList ); - aLbLineEnds.SelectEntryPos( nOldSelect ); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx deleted file mode 100644 index aa01b6933..000000000 --- a/cui/source/tabpages/tpshadow.cxx +++ /dev/null @@ -1,612 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- -#include <tools/shl.hxx> -#include <sfx2/app.hxx> -#include <sfx2/module.hxx> -#include <svx/dialogs.hrc> - -#define _SVX_TPSHADOW_CXX - -#include "svx/xattr.hxx" -#include <svx/xpool.hxx> -#include <cuires.hrc> -#include "tabarea.hrc" -#include <svx/svdattr.hxx> -#include "svx/drawitem.hxx" -#include "cuitabarea.hxx" -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include <cuitabline.hxx> -#include "paragrph.hrc" -#include <svx/xlineit0.hxx> -#include <sfx2/request.hxx> - -#define DLGWIN this->GetParent()->GetParent() - -// static ---------------------------------------------------------------- - -static sal_uInt16 pShadowRanges[] = -{ - SDRATTR_SHADOWCOLOR, - SDRATTR_SHADOWTRANSPARENCE, - SID_ATTR_FILL_SHADOW, - SID_ATTR_FILL_SHADOW, - 0 -}; - -/************************************************************************* -|* -|* Dialog zum Aendern des Schattens -|* -\************************************************************************/ - -SvxShadowTabPage::SvxShadowTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : - - SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_SHADOW ), rInAttrs ), - - aFlProp ( this, CUI_RES( FL_PROP ) ), - aTsbShowShadow ( this, CUI_RES( TSB_SHOW_SHADOW ) ), - aFtPosition ( this, CUI_RES( FT_POSITION ) ), - aCtlPosition ( this, CUI_RES( CTL_POSITION ) ), - aFtDistance ( this, CUI_RES( FT_DISTANCE ) ), - aMtrDistance ( this, CUI_RES( MTR_FLD_DISTANCE ) ), - aFtShadowColor ( this, CUI_RES( FT_SHADOW_COLOR ) ), - aLbShadowColor ( this, CUI_RES( LB_SHADOW_COLOR ) ), - aFtTransparent ( this, CUI_RES( FT_TRANSPARENT ) ), - aMtrTransparent ( this, CUI_RES( MTR_SHADOW_TRANSPARENT ) ), - aCtlXRectPreview ( this, CUI_RES( CTL_COLOR_PREVIEW ) ), - rOutAttrs ( rInAttrs ), - pColorTab( NULL ), - bDisable ( sal_False ), - pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ), - aXFillAttr ( pXPool ), - rXFSet ( aXFillAttr.GetItemSet() ) -{ - FreeResource(); - - // diese Page braucht ExchangeSupport - SetExchangeSupport(); - - // Metrik einstellen - FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs ); - - switch ( eFUnit ) - { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; - break; - default: ;//prevent warning - } - SetFieldUnit( aMtrDistance, eFUnit ); - - // PoolUnit ermitteln - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "Wo ist der Pool?" ); - ePoolUnit = pPool->GetMetric( SDRATTR_SHADOWXDIST ); - - // Setzen des Output-Devices - XFillStyle eXFS = XFILL_SOLID; - if( rOutAttrs.GetItemState( XATTR_FILLSTYLE ) != SFX_ITEM_DONTCARE ) - { - eXFS = (XFillStyle) ( ( ( const XFillStyleItem& ) rOutAttrs. - Get( GetWhich( XATTR_FILLSTYLE ) ) ).GetValue() ); - switch( eXFS ) - { - //case XFILL_NONE: --> NICHTS - - case XFILL_SOLID: - if( SFX_ITEM_DONTCARE != rOutAttrs.GetItemState( XATTR_FILLCOLOR ) ) - { - XFillColorItem aColorItem( ( const XFillColorItem& ) - rOutAttrs.Get( XATTR_FILLCOLOR ) ); - rXFSet.Put( aColorItem ); - } - break; - - case XFILL_GRADIENT: - if( SFX_ITEM_DONTCARE != rOutAttrs.GetItemState( XATTR_FILLGRADIENT ) ) - { - XFillGradientItem aGradientItem( ( ( const XFillGradientItem& ) - rOutAttrs.Get( XATTR_FILLGRADIENT ) ) ); - rXFSet.Put( aGradientItem ); - } - break; - - case XFILL_HATCH: - if( SFX_ITEM_DONTCARE != rOutAttrs.GetItemState( XATTR_FILLHATCH ) ) - { - XFillHatchItem aHatchItem( ( ( const XFillHatchItem& ) - rOutAttrs.Get( XATTR_FILLHATCH ) ) ); - rXFSet.Put( aHatchItem ); - } - break; - - case XFILL_BITMAP: - { - if( SFX_ITEM_DONTCARE != rOutAttrs.GetItemState( XATTR_FILLBITMAP ) ) - { - XFillBitmapItem aBitmapItem( ( const XFillBitmapItem& ) - rOutAttrs.Get( XATTR_FILLBITMAP ) ); - rXFSet.Put( aBitmapItem ); - } - } - break; - case XFILL_NONE : break; - } - } - else - { - rXFSet.Put( XFillColorItem( String(), COL_LIGHTRED ) ); - } - - if(XFILL_NONE == eXFS) - { - // #i96350# - // fallback to solid fillmode when no fill mode is provided to have - // a reasonable shadow preview. The used color will be a set one or - // the default (currently blue8) - eXFS = XFILL_SOLID; - } - - rXFSet.Put( XFillStyleItem( eXFS ) ); - aCtlXRectPreview.SetRectangleAttributes(aXFillAttr.GetItemSet()); - //aCtlXRectPreview.SetFillAttr( aXFillAttr ); - - aTsbShowShadow.SetClickHdl( LINK( this, SvxShadowTabPage, ClickShadowHdl_Impl ) ); - Link aLink = LINK( this, SvxShadowTabPage, ModifyShadowHdl_Impl ); - aLbShadowColor.SetSelectHdl( aLink ); - aMtrTransparent.SetModifyHdl( aLink ); - aMtrDistance.SetModifyHdl( aLink ); - - aCtlXRectPreview.SetAccessibleName(String(CUI_RES(STR_EXAMPLE))); - aCtlPosition.SetAccessibleRelationMemberOf( &aFlProp ); -} - -// ----------------------------------------------------------------------- - -void SvxShadowTabPage::Construct() -{ - // Farbtabelle fuellen - aLbShadowColor.Fill( pColorTab ); - - if( bDisable ) - { - aTsbShowShadow.Disable(); - aFtPosition.Disable(); - aCtlPosition.Disable(); - aFtDistance.Disable(); - aMtrDistance.Disable(); - aFtShadowColor.Disable(); - aLbShadowColor.Disable(); - aFtTransparent.Disable(); - aMtrTransparent.Disable(); - } -} - -// ----------------------------------------------------------------------- - -void SvxShadowTabPage::ActivatePage( const SfxItemSet& rSet ) -{ - sal_uInt16 nPos; - sal_uInt16 nCount; - - SFX_ITEMSET_ARG (&rSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False); - if (pPageTypeItem) - SetPageType(pPageTypeItem->GetValue()); - - if( nDlgType == 0 ) - { - if( pColorTab ) - { - // ColorTable - if( *pnColorTableState & CT_CHANGED || - *pnColorTableState & CT_MODIFIED ) - { - if( *pnColorTableState & CT_CHANGED ) - { - SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( DLGWIN ); - if( pArea ) - { - pColorTab = pArea->GetNewColorTable(); - } - else - { - SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( DLGWIN ); - if( pLine ) - pColorTab = pLine->GetNewColorTable(); - } - } - - // aLbShadowColor - nPos = aLbShadowColor.GetSelectEntryPos(); - aLbShadowColor.Clear(); - aLbShadowColor.Fill( pColorTab ); - nCount = aLbShadowColor.GetEntryCount(); - if( nCount == 0 ) - ; // Dieser Fall sollte nicht auftreten - else if( nCount <= nPos ) - aLbShadowColor.SelectEntryPos( 0 ); - else - aLbShadowColor.SelectEntryPos( nPos ); - - ModifyShadowHdl_Impl( this ); - } - nPageType = PT_SHADOW; - } - } -} - -// ----------------------------------------------------------------------- - -int SvxShadowTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if( _pSet ) - FillItemSet( *_pSet ); - - return( LEAVE_PAGE ); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxShadowTabPage::FillItemSet( SfxItemSet& rAttrs ) -{ - const SfxPoolItem* pOld = NULL; - sal_Bool bModified = sal_False; - - if( !bDisable ) - { - // Schatten - TriState eState = aTsbShowShadow.GetState(); - if( eState != aTsbShowShadow.GetSavedValue() ) - { - SdrShadowItem aItem( sal::static_int_cast< sal_Bool >( eState ) ); - pOld = GetOldItem( rAttrs, SDRATTR_SHADOW ); - if ( !pOld || !( *(const SdrShadowItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - - // Schatten-Entfernung - // Etwas umstaendliche Abfrage, ob etwas geaendert wurde, - // da Items nicht direkt auf Controls abbildbar sind - sal_Int32 nX = 0L, nY = 0L; - sal_Int32 nXY = GetCoreValue( aMtrDistance, ePoolUnit ); - - switch( aCtlPosition.GetActualRP() ) - { - case RP_LT: nX = nY = -nXY; break; - case RP_MT: nY = -nXY; break; - case RP_RT: nX = nXY; nY = -nXY; break; - case RP_LM: nX = -nXY; break; - case RP_RM: nX = nXY; break; - case RP_LB: nX = -nXY; nY = nXY; break; - case RP_MB: nY = nXY; break; - case RP_RB: nX = nY = nXY; break; - case RP_MM: break; - } - - // Wenn die Werte des Schattenabstanden==SFX_ITEM_DONTCARE und der angezeigte - // String im entspr. MetricField=="", dann w�rde der Vergleich zw. alten und - // neuen Distance-Werte ein falsches Ergebnis liefern, da in so einem Fall die - // neuen Distance-Werte den Default-Werten des MetricField entspr�chen !!!! - if ( !aMtrDistance.IsEmptyFieldValue() || - rOutAttrs.GetItemState( SDRATTR_SHADOWXDIST ) != SFX_ITEM_DONTCARE || - rOutAttrs.GetItemState( SDRATTR_SHADOWYDIST ) != SFX_ITEM_DONTCARE ) - { - sal_Int32 nOldX = 9876543; // Unmoeglicher Wert, entspr. DontCare - sal_Int32 nOldY = 9876543; - if( rOutAttrs.GetItemState( SDRATTR_SHADOWXDIST ) != SFX_ITEM_DONTCARE && - rOutAttrs.GetItemState( SDRATTR_SHADOWYDIST ) != SFX_ITEM_DONTCARE ) - { - nOldX = ( ( const SdrShadowXDistItem& ) rOutAttrs. - Get( SDRATTR_SHADOWXDIST ) ).GetValue(); - nOldY = ( ( const SdrShadowYDistItem& ) rOutAttrs. - Get( SDRATTR_SHADOWYDIST ) ).GetValue(); - } - SdrShadowXDistItem aXItem( nX ); - pOld = GetOldItem( rAttrs, SDRATTR_SHADOWXDIST ); - if ( nX != nOldX && - ( !pOld || !( *(const SdrShadowXDistItem*)pOld == aXItem ) ) ) - { - rAttrs.Put( aXItem ); - bModified = sal_True; - } - SdrShadowYDistItem aYItem( nY ); - pOld = GetOldItem( rAttrs, SDRATTR_SHADOWYDIST ); - if ( nY != nOldY && - ( !pOld || !( *(const SdrShadowYDistItem*)pOld == aYItem ) ) ) - { - rAttrs.Put( aYItem ); - bModified = sal_True; - } - } - - // ShadowColor - sal_uInt16 nPos = aLbShadowColor.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND && - nPos != aLbShadowColor.GetSavedValue() ) - { - SdrShadowColorItem aItem( aLbShadowColor.GetSelectEntry(), - aLbShadowColor.GetSelectEntryColor() ); - pOld = GetOldItem( rAttrs, SDRATTR_SHADOWCOLOR ); - if ( !pOld || !( *(const SdrShadowColorItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - - // Transparenz - sal_uInt16 nVal = (sal_uInt16)aMtrTransparent.GetValue(); - if( nVal != (sal_uInt16)aMtrTransparent.GetSavedValue().ToInt32() ) - { - SdrShadowTransparenceItem aItem( nVal ); - pOld = GetOldItem( rAttrs, SDRATTR_SHADOWTRANSPARENCE ); - if ( !pOld || !( *(const SdrShadowTransparenceItem*)pOld == aItem ) ) - { - rAttrs.Put( aItem ); - bModified = sal_True; - } - } - } - - rAttrs.Put (CntUInt16Item(SID_PAGE_TYPE,nPageType)); - - return( bModified ); -} - -// ----------------------------------------------------------------------- - -void SvxShadowTabPage::Reset( const SfxItemSet& rAttrs ) -{ - if( !bDisable ) - { - // Alle Objekte koennen einen Schatten besitzen - // z.Z. gibt es nur 8 m�gliche Positionen den Schatten zu setzen - - // Ist Schatten gesetzt? - if( rAttrs.GetItemState( SDRATTR_SHADOW ) != SFX_ITEM_DONTCARE ) - { - aTsbShowShadow.EnableTriState( sal_False ); - - if( ( ( const SdrShadowItem& ) rAttrs.Get( SDRATTR_SHADOW ) ).GetValue() ) - aTsbShowShadow.SetState( STATE_CHECK ); - else - { - aTsbShowShadow.SetState( STATE_NOCHECK ); - } - } - else - aTsbShowShadow.SetState( STATE_DONTKNOW ); - - // Entfernung (nur 8 moegliche Positionen), deshalb - // wird nur ein Item ausgewertet - - if( rAttrs.GetItemState( SDRATTR_SHADOWXDIST ) != SFX_ITEM_DONTCARE && - rAttrs.GetItemState( SDRATTR_SHADOWYDIST ) != SFX_ITEM_DONTCARE ) - { - sal_Int32 nX = ( ( const SdrShadowXDistItem& ) rAttrs.Get( SDRATTR_SHADOWXDIST ) ).GetValue(); - sal_Int32 nY = ( ( const SdrShadowYDistItem& ) rAttrs.Get( SDRATTR_SHADOWYDIST ) ).GetValue(); - - if( nX != 0 ) - SetMetricValue( aMtrDistance, nX < 0L ? -nX : nX, ePoolUnit ); - else - SetMetricValue( aMtrDistance, nY < 0L ? -nY : nY, ePoolUnit ); - - // Setzen des Schatten-Controls - if ( nX < 0L && nY < 0L ) aCtlPosition.SetActualRP( RP_LT ); - else if( nX == 0L && nY < 0L ) aCtlPosition.SetActualRP( RP_MT ); - else if( nX > 0L && nY < 0L ) aCtlPosition.SetActualRP( RP_RT ); - else if( nX < 0L && nY == 0L ) aCtlPosition.SetActualRP( RP_LM ); - // Mittelpunkt gibt es nicht mehr - else if( nX == 0L && nY == 0L ) aCtlPosition.SetActualRP( RP_RB ); - else if( nX > 0L && nY == 0L ) aCtlPosition.SetActualRP( RP_RM ); - else if( nX < 0L && nY > 0L ) aCtlPosition.SetActualRP( RP_LB ); - else if( nX == 0L && nY > 0L ) aCtlPosition.SetActualRP( RP_MB ); - else if( nX > 0L && nY > 0L ) aCtlPosition.SetActualRP( RP_RB ); - } - else - { - // determine default-distance - SfxItemPool* pPool = rOutAttrs.GetPool(); - SdrShadowXDistItem* pXDistItem = (SdrShadowXDistItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWXDIST); - SdrShadowYDistItem* pYDistItem = (SdrShadowYDistItem*)&pPool->GetDefaultItem (SDRATTR_SHADOWYDIST); - if (pXDistItem && pYDistItem) - { - sal_Int32 nX = pXDistItem->GetValue(); - sal_Int32 nY = pYDistItem->GetValue(); - if( nX != 0 ) - SetMetricValue( aMtrDistance, nX < 0L ? -nX : nX, ePoolUnit ); - else - SetMetricValue( aMtrDistance, nY < 0L ? -nY : nY, ePoolUnit ); - } - - // Tristate, z.B. mehrer Objekte wurden markiert, wovon einige einen Schatten besitzen, einige nicht. - // Der anzuzeigende Text des MetricFields wird auf "" gesetzt und dient in der Methode FillItemSet - // als Erkennungszeichen daf�r, das der Distance-Wert NICHT ver�ndert wurde !!!! - aMtrDistance.SetText( String() ); - aCtlPosition.SetActualRP( RP_MM ); - } - - // SchattenFarbe: - if( rAttrs.GetItemState( SDRATTR_SHADOWCOLOR ) != SFX_ITEM_DONTCARE ) - { - aLbShadowColor.SelectEntry( ( ( const SdrShadowColorItem& ) rAttrs.Get( SDRATTR_SHADOWCOLOR ) ).GetColorValue() ); - } - else - aLbShadowColor.SetNoSelection(); - - // Transparenz - if( rAttrs.GetItemState( SDRATTR_SHADOWTRANSPARENCE ) != SFX_ITEM_DONTCARE ) - { - sal_uInt16 nTransp = ( ( const SdrShadowTransparenceItem& ) rAttrs.Get( SDRATTR_SHADOWTRANSPARENCE ) ).GetValue(); - aMtrTransparent.SetValue( nTransp ); - } - else - aMtrTransparent.SetText( String() ); - - // Werte sichern - //aCtlPosition - aMtrDistance.SaveValue(); - aLbShadowColor.SaveValue(); - aTsbShowShadow.SaveValue(); - - // #66832# This field was not saved, but used to determine changes. - // Why? Seems to be the error. - // It IS the error. - aMtrTransparent.SaveValue(); - - ClickShadowHdl_Impl( NULL ); - ModifyShadowHdl_Impl( NULL ); - } -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxShadowTabPage::Create( Window* pWindow, - const SfxItemSet& rAttrs ) -{ - return( new SvxShadowTabPage( pWindow, rAttrs ) ); -} - -//------------------------------------------------------------------------ - -sal_uInt16* SvxShadowTabPage::GetRanges() -{ - return( pShadowRanges ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxShadowTabPage, ClickShadowHdl_Impl, void *, EMPTYARG ) -{ - if( aTsbShowShadow.GetState() == STATE_NOCHECK ) - { - aFtPosition.Disable(); - aCtlPosition.Disable(); - aFtDistance.Disable(); - aMtrDistance.Disable(); - aFtShadowColor.Disable(); - aLbShadowColor.Disable(); - aFtTransparent.Disable(); - aMtrTransparent.Disable(); - } - else - { - aFtPosition.Enable(); - aCtlPosition.Enable(); - aFtDistance.Enable(); - aMtrDistance.Enable(); - aFtShadowColor.Enable(); - aLbShadowColor.Enable(); - aFtTransparent.Enable(); - aMtrTransparent.Enable(); - } - aCtlPosition.Invalidate(); - - ModifyShadowHdl_Impl( NULL ); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxShadowTabPage, ModifyShadowHdl_Impl, void *, EMPTYARG ) -{ - if( aTsbShowShadow.GetState() == STATE_CHECK ) - rXFSet.Put( XFillStyleItem( XFILL_SOLID ) ); - else - rXFSet.Put( XFillStyleItem( XFILL_NONE ) ); - - sal_uInt16 nPos = aLbShadowColor.GetSelectEntryPos(); - if( nPos != LISTBOX_ENTRY_NOTFOUND ) - { - rXFSet.Put( XFillColorItem( String(), - aLbShadowColor.GetSelectEntryColor() ) ); - } - sal_uInt16 nVal = (sal_uInt16)aMtrTransparent.GetValue(); - XFillTransparenceItem aItem( nVal ); - rXFSet.Put( XFillTransparenceItem( aItem ) ); - - // Schatten-Entfernung - sal_Int32 nX = 0L, nY = 0L; - sal_Int32 nXY = GetCoreValue( aMtrDistance, ePoolUnit ); - switch( aCtlPosition.GetActualRP() ) - { - case RP_LT: nX = nY = -nXY; break; - case RP_MT: nY = -nXY; break; - case RP_RT: nX = nXY; nY = -nXY; break; - case RP_LM: nX = -nXY; break; - case RP_RM: nX = nXY; break; - case RP_LB: nX = -nXY; nY = nXY; break; - case RP_MB: nY = nXY; break; - case RP_RB: nX = nY = nXY; break; - case RP_MM: break; - } - - aCtlXRectPreview.SetShadowPosition(Point(nX, nY)); - - aCtlXRectPreview.SetShadowAttributes(aXFillAttr.GetItemSet()); - //aCtlXRectPreview.SetFillAttr( aXFillAttr ); - aCtlXRectPreview.Invalidate(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -void SvxShadowTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt ) -{ - eRP = eRcPt; - - // Schatten neu zeichnen - ModifyShadowHdl_Impl( pWindow ); -} - -void SvxShadowTabPage::PageCreated (SfxAllItemSet aSet) -{ - SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False); - SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False); - SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False); - - - if (pColorTabItem) - SetColorTable(pColorTabItem->GetColorTable()); - if (pPageTypeItem) - SetPageType(pPageTypeItem->GetValue()); - if (pDlgTypeItem) - SetDlgType(pDlgTypeItem->GetValue()); - Construct(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx deleted file mode 100644 index 0f2409b64..000000000 --- a/cui/source/tabpages/transfrm.cxx +++ /dev/null @@ -1,1705 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - -// include --------------------------------------------------------------- - -#include <tools/shl.hxx> -#include <sfx2/app.hxx> -#include <svx/svdview.hxx> -#include <svx/svdobj.hxx> -#include <svx/svdpagv.hxx> -#include <svx/svdotext.hxx> -#include <svx/sderitm.hxx> -#include <svx/dialogs.hrc> -#include <cuires.hrc> -#include "transfrm.hrc" -#include <editeng/sizeitem.hxx> - -#include "transfrm.hxx" -#include <dialmgr.hxx> -#include "svx/dlgutil.hxx" -#include <editeng/svxenum.hxx> -#include "svx/anchorid.hxx" -#include <sfx2/module.hxx> -#include <svl/rectitem.hxx> -#include <svl/aeitem.hxx> -#include <swpossizetabpage.hxx> - -// Toleranz fuer WorkingArea -#define DIFF 1000 - -// static ---------------------------------------------------------------- - -static sal_uInt16 pPosSizeRanges[] = -{ - SID_ATTR_TRANSFORM_POS_X, - SID_ATTR_TRANSFORM_POS_Y, - SID_ATTR_TRANSFORM_PROTECT_POS, - SID_ATTR_TRANSFORM_PROTECT_POS, - SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_ANCHOR, - SID_ATTR_TRANSFORM_VERT_ORIENT, - SID_ATTR_TRANSFORM_WIDTH, - SID_ATTR_TRANSFORM_SIZE_POINT, - SID_ATTR_TRANSFORM_PROTECT_POS, - SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_AUTOWIDTH, - SID_ATTR_TRANSFORM_AUTOHEIGHT, - 0 -}; - -static sal_uInt16 pAngleRanges[] = -{ - SID_ATTR_TRANSFORM_ROT_X, - SID_ATTR_TRANSFORM_ANGLE, - SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_INTERN, - 0 -}; - -static sal_uInt16 pSlantRanges[] = -{ - SDRATTR_ECKENRADIUS, - SDRATTR_ECKENRADIUS, - SID_ATTR_TRANSFORM_SHEAR, - SID_ATTR_TRANSFORM_SHEAR_VERTICAL, - SID_ATTR_TRANSFORM_INTERN, - SID_ATTR_TRANSFORM_INTERN, - 0 -}; - -void lcl_ConvertRect(basegfx::B2DRange& rRange, const sal_uInt16 nDigits, const MapUnit ePoolUnit, const FieldUnit eDlgUnit) -{ - const basegfx::B2DPoint aTopLeft( - (double)MetricField::ConvertValue(basegfx::fround(rRange.getMinX()), nDigits, ePoolUnit, eDlgUnit), - (double)MetricField::ConvertValue(basegfx::fround(rRange.getMinY()), nDigits, ePoolUnit, eDlgUnit)); - const basegfx::B2DPoint aBottomRight( - (double)MetricField::ConvertValue(basegfx::fround(rRange.getMaxX()), nDigits, ePoolUnit, eDlgUnit), - (double)MetricField::ConvertValue(basegfx::fround(rRange.getMaxY()), nDigits, ePoolUnit, eDlgUnit)); - - rRange = basegfx::B2DRange(aTopLeft, aBottomRight); -} - -void lcl_ScaleRect(basegfx::B2DRange& rRange, const Fraction aUIScale) -{ - const double fFactor(1.0 / double(aUIScale)); - rRange = basegfx::B2DRange(rRange.getMinimum() * fFactor, rRange.getMaximum() * fFactor); -} - -/************************************************************************* -|* -|* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu -|* -\************************************************************************/ - -SvxTransformTabDialog::SvxTransformTabDialog( Window* pParent, const SfxItemSet* pAttr, - const SdrView* pSdrView, sal_uInt16 nAnchorTypes ) : - SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_TRANSFORM ), pAttr ), - pView ( pSdrView ), - nAnchorCtrls(nAnchorTypes) -{ - DBG_ASSERT(pView, "no valid view (!)"); - FreeResource(); - - //different positioning page in Writer - if(nAnchorCtrls & 0x00ff) - { - AddTabPage(RID_SVXPAGE_SWPOSSIZE, SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges); - RemoveTabPage(RID_SVXPAGE_POSITION_SIZE); - } - else - { - AddTabPage(RID_SVXPAGE_POSITION_SIZE, SvxPositionSizeTabPage::Create, SvxPositionSizeTabPage::GetRanges); - RemoveTabPage(RID_SVXPAGE_SWPOSSIZE); - } - - AddTabPage(RID_SVXPAGE_ANGLE, SvxAngleTabPage::Create, SvxAngleTabPage::GetRanges); - AddTabPage(RID_SVXPAGE_SLANT, SvxSlantTabPage::Create, SvxSlantTabPage::GetRanges); -} - -// ----------------------------------------------------------------------- - -SvxTransformTabDialog::~SvxTransformTabDialog() -{ -} - -// ----------------------------------------------------------------------- - -void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage) -{ - switch(nId) - { - case RID_SVXPAGE_POSITION_SIZE: - { - SvxPositionSizeTabPage& rSvxPos = static_cast<SvxPositionSizeTabPage&>(rPage); - rSvxPos.SetView(pView); - rSvxPos.Construct(); - - if(nAnchorCtrls & SVX_OBJ_NORESIZE) - { - rSvxPos.DisableResize(); - } - - if(nAnchorCtrls & SVX_OBJ_NOPROTECT) - { - rSvxPos.DisableProtect(); - rSvxPos.UpdateControlStates(); - } - - break; - } - case RID_SVXPAGE_SWPOSSIZE : - { - SvxSwPosSizeTabPage& rSwPos = static_cast<SvxSwPosSizeTabPage&>(rPage); - - rSwPos.EnableAnchorTypes(nAnchorCtrls); - rSwPos.SetValidateFramePosLink(aValidateLink); - rSwPos.SetView(pView); - - break; - } - - case RID_SVXPAGE_ANGLE: - { - SvxAngleTabPage& rSvxAng = static_cast<SvxAngleTabPage&>(rPage); - - rSvxAng.SetView( pView ); - rSvxAng.Construct(); - - break; - } - - case RID_SVXPAGE_SLANT: - { - SvxSlantTabPage& rSvxSlnt = static_cast<SvxSlantTabPage&>(rPage); - - rSvxSlnt.SetView( pView ); - rSvxSlnt.Construct(); - - break; - } - } -} - -// ----------------------------------------------------------------------- - -void SvxTransformTabDialog::SetValidateFramePosLink(const Link& rLink) -{ - aValidateLink = rLink; -} - -/************************************************************************* -|* -|* Dialog zum Aendern der Position des Drehwinkels und des Drehwinkels -|* der Grafikobjekte -|* -\************************************************************************/ - -SvxAngleTabPage::SvxAngleTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : - SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_ANGLE ), rInAttrs ), - aFlPosition ( this, CUI_RES( FL_POSITION ) ), - aFtPosX ( this, CUI_RES( FT_POS_X ) ), - aMtrPosX ( this, CUI_RES( MTR_FLD_POS_X ) ), - aFtPosY ( this, CUI_RES( FT_POS_Y ) ), - aMtrPosY ( this, CUI_RES( MTR_FLD_POS_Y ) ), - aFtPosPresets ( this, CUI_RES(FT_POSPRESETS) ), - aCtlRect ( this, CUI_RES( CTL_RECT ) ), - - aFlAngle ( this, CUI_RES( FL_ANGLE ) ), - aFtAngle ( this, CUI_RES( FT_ANGLE ) ), - aMtrAngle ( this, CUI_RES( MTR_FLD_ANGLE ) ), - aFtAnglePresets ( this, CUI_RES(FT_ANGLEPRESETS) ), - aCtlAngle ( this, CUI_RES( CTL_ANGLE ), - RP_RB, 200, 80, CS_ANGLE ), - rOutAttrs ( rInAttrs ) -{ - FreeResource(); - - // calculate PoolUnit - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "no pool (!)" ); - ePoolUnit = pPool->GetMetric(SID_ATTR_TRANSFORM_POS_X); - - aMtrAngle.SetModifyHdl(LINK( this, SvxAngleTabPage, ModifiedHdl)); - - aCtlRect.SetAccessibleRelationLabeledBy(&aFtPosPresets); - aCtlRect.SetAccessibleRelationMemberOf(&aFlPosition); - aCtlAngle.SetAccessibleRelationLabeledBy(&aFtAnglePresets); - aCtlAngle.SetAccessibleRelationMemberOf(&aFlAngle); -} - -// ----------------------------------------------------------------------- - -void SvxAngleTabPage::Construct() -{ - DBG_ASSERT(pView, "No valid view (!)"); - eDlgUnit = GetModuleFieldUnit(GetItemSet()); - SetFieldUnit(aMtrPosX, eDlgUnit, sal_True); - SetFieldUnit(aMtrPosY, eDlgUnit, sal_True); - - if(FUNIT_MILE == eDlgUnit || FUNIT_KM == eDlgUnit) - { - aMtrPosX.SetDecimalDigits( 3 ); - aMtrPosY.SetDecimalDigits( 3 ); - } - - { // #i75273# - Rectangle aTempRect(pView->GetAllMarkedRect()); - pView->GetSdrPageView()->LogicToPagePos(aTempRect); - maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom()); - } - - // Take anchor into account (Writer) - const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); - - if(rMarkList.GetMarkCount()) - { - const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - maAnchor = basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y()); - - if(!maAnchor.equalZero()) // -> Writer - { - maRange = basegfx::B2DRange(maRange.getMinimum() - maAnchor, maRange.getMaximum() - maAnchor); - } - } - - // take scale into account - const Fraction aUIScale(pView->GetModel()->GetUIScale()); - lcl_ScaleRect(maRange, aUIScale); - - // take UI units into account - sal_uInt16 nDigits(aMtrPosX.GetDecimalDigits()); - lcl_ConvertRect(maRange, nDigits, (MapUnit)ePoolUnit, eDlgUnit); - - if(!pView->IsRotateAllowed()) - { - aFlPosition.Disable(); - aFtPosX.Disable(); - aMtrPosX.Disable(); - aFtPosY.Disable(); - aMtrPosY.Disable(); - aFtPosPresets.Disable(); - aCtlRect.Disable(); - aFlAngle.Disable(); - aFtAngle.Disable(); - aMtrAngle.Disable(); - aFtAnglePresets.Disable(); - aCtlAngle.Disable(); - } -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxAngleTabPage::FillItemSet(SfxItemSet& rSet) -{ - sal_Bool bModified = sal_False; - - if(aMtrAngle.IsValueModified() || aMtrPosX.IsValueModified() || aMtrPosY.IsValueModified()) - { - const double fUIScale(double(pView->GetModel()->GetUIScale())); - const double fTmpX((GetCoreValue(aMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale); - const double fTmpY((GetCoreValue(aMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale); - - rSet.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), static_cast<sal_Int32>(aMtrAngle.GetValue()))); - rSet.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), basegfx::fround(fTmpX))); - rSet.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY))); - - bModified |= sal_True; - } - - return bModified; -} - -// ----------------------------------------------------------------------- - -void SvxAngleTabPage::Reset(const SfxItemSet& rAttrs) -{ - const double fUIScale(double(pView->GetModel()->GetUIScale())); - - const SfxPoolItem* pItem = GetItem( rAttrs, SID_ATTR_TRANSFORM_ROT_X ); - if(pItem) - { - const double fTmp(((double)((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getX()) / fUIScale); - SetMetricValue(aMtrPosX, basegfx::fround(fTmp), ePoolUnit); - } - else - { - aMtrPosX.SetText( String() ); - } - - pItem = GetItem(rAttrs, SID_ATTR_TRANSFORM_ROT_Y); - if(pItem) - { - const double fTmp(((double)((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getY()) / fUIScale); - SetMetricValue(aMtrPosY, basegfx::fround(fTmp), ePoolUnit); - } - else - { - aMtrPosX.SetText( String() ); - } - - pItem = GetItem( rAttrs, SID_ATTR_TRANSFORM_ANGLE ); - if(pItem) - { - aMtrAngle.SetValue(((const SfxInt32Item*)pItem)->GetValue()); - } - else - { - aMtrAngle.SetText( String() ); - } - - aMtrAngle.SaveValue(); - ModifiedHdl(this); -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxAngleTabPage::Create( Window* pWindow, const SfxItemSet& rSet) -{ - return(new SvxAngleTabPage(pWindow, rSet)); -} - -//------------------------------------------------------------------------ - -sal_uInt16* SvxAngleTabPage::GetRanges() -{ - return(pAngleRanges); -} - -// ----------------------------------------------------------------------- - -void SvxAngleTabPage::ActivatePage(const SfxItemSet& /*rSet*/) -{ -} - -// ----------------------------------------------------------------------- - -int SvxAngleTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if(_pSet) - { - FillItemSet(*_pSet); - } - - return LEAVE_PAGE; -} - -//------------------------------------------------------------------------ - -void SvxAngleTabPage::PointChanged(Window* pWindow, RECT_POINT eRP) -{ - if(pWindow == &aCtlRect) - { - switch(eRP) - { - case RP_LT: - { - aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMinX()), FUNIT_NONE ); - aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMinY()), FUNIT_NONE ); - break; - } - case RP_MT: - { - aMtrPosX.SetUserValue( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE ); - aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMinY()), FUNIT_NONE ); - break; - } - case RP_RT: - { - aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE ); - aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMinY()), FUNIT_NONE ); - break; - } - case RP_LM: - { - aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMinX()), FUNIT_NONE ); - aMtrPosY.SetUserValue( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE ); - break; - } - case RP_MM: - { - aMtrPosX.SetUserValue( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE ); - aMtrPosY.SetUserValue( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE ); - break; - } - case RP_RM: - { - aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE ); - aMtrPosY.SetUserValue( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE ); - break; - } - case RP_LB: - { - aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMinX()), FUNIT_NONE ); - aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE ); - break; - } - case RP_MB: - { - aMtrPosX.SetUserValue( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE ); - aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE ); - break; - } - case RP_RB: - { - aMtrPosX.SetUserValue( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE ); - aMtrPosY.SetUserValue( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE ); - break; - } - } - } - else if(pWindow == &aCtlAngle) - { - switch( eRP ) - { - case RP_LT: aMtrAngle.SetUserValue( 13500, FUNIT_NONE ); break; - case RP_MT: aMtrAngle.SetUserValue( 9000, FUNIT_NONE ); break; - case RP_RT: aMtrAngle.SetUserValue( 4500, FUNIT_NONE ); break; - case RP_LM: aMtrAngle.SetUserValue( 18000, FUNIT_NONE ); break; - case RP_RM: aMtrAngle.SetUserValue( 0, FUNIT_NONE ); break; - case RP_LB: aMtrAngle.SetUserValue( 22500, FUNIT_NONE ); break; - case RP_MB: aMtrAngle.SetUserValue( 27000, FUNIT_NONE ); break; - case RP_RB: aMtrAngle.SetUserValue( 31500, FUNIT_NONE ); break; - case RP_MM: break; - } - } -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxAngleTabPage, ModifiedHdl, void *, EMPTYARG ) -{ - switch(aMtrAngle.GetValue()) - { - case 13500: aCtlAngle.SetActualRP( RP_LT ); break; - case 9000: aCtlAngle.SetActualRP( RP_MT ); break; - case 4500: aCtlAngle.SetActualRP( RP_RT ); break; - case 18000: aCtlAngle.SetActualRP( RP_LM ); break; - case 0: aCtlAngle.SetActualRP( RP_RM ); break; - case 22500: aCtlAngle.SetActualRP( RP_LB ); break; - case 27000: aCtlAngle.SetActualRP( RP_MB ); break; - case 31500: aCtlAngle.SetActualRP( RP_RB ); break; - default: aCtlAngle.SetActualRP( RP_MM ); break; - } - - return( 0L ); -} - -/************************************************************************* -|* -|* Dialog zum Aendern des Eckenradius und zum Schraegstellen -|* -\************************************************************************/ - -SvxSlantTabPage::SvxSlantTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : - SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_SLANT ), rInAttrs ), - - aFlRadius ( this, CUI_RES( FL_RADIUS ) ), - aFtRadius ( this, CUI_RES( FT_RADIUS ) ), - aMtrRadius ( this, CUI_RES( MTR_FLD_RADIUS ) ), - aFlAngle ( this, CUI_RES( FL_SLANT ) ), - aFtAngle ( this, CUI_RES( FT_ANGLE ) ), - aMtrAngle ( this, CUI_RES( MTR_FLD_ANGLE ) ), - rOutAttrs ( rInAttrs ) -{ - FreeResource(); - - // this page needs ExchangeSupport - SetExchangeSupport(); - - // evaluate PoolUnit - SfxItemPool* pPool = rOutAttrs.GetPool(); - DBG_ASSERT( pPool, "no pool (!)" ); - ePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X ); -} - -// ----------------------------------------------------------------------- - -void SvxSlantTabPage::Construct() -{ - // get the range - DBG_ASSERT(pView, "no valid view (!)"); - eDlgUnit = GetModuleFieldUnit(GetItemSet()); - SetFieldUnit(aMtrRadius, eDlgUnit, sal_True); - - { // #i75273# - Rectangle aTempRect(pView->GetAllMarkedRect()); - pView->GetSdrPageView()->LogicToPagePos(aTempRect); - maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom()); - } -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxSlantTabPage::FillItemSet(SfxItemSet& rAttrs) -{ - sal_Bool bModified = sal_False; - String aStr = aMtrRadius.GetText(); - - if( aStr != aMtrRadius.GetSavedValue() ) - { - Fraction aUIScale = pView->GetModel()->GetUIScale(); - long nTmp = GetCoreValue( aMtrRadius, ePoolUnit ); - nTmp = Fraction( nTmp ) * aUIScale; - - rAttrs.Put( SdrEckenradiusItem( nTmp ) ); - bModified = sal_True; - } - - aStr = aMtrAngle.GetText(); - - if( aStr != aMtrAngle.GetSavedValue() ) - { - sal_Int32 nValue = static_cast<sal_Int32>(aMtrAngle.GetValue()); - rAttrs.Put( SfxInt32Item( SID_ATTR_TRANSFORM_SHEAR, nValue ) ); - bModified = sal_True; - } - - if( bModified ) - { - // Referenzpunkt setzen - // #75897# - Rectangle aObjectRect(pView->GetAllMarkedRect()); - pView->GetSdrPageView()->LogicToPagePos(aObjectRect); - Point aPt = aObjectRect.Center(); - - rAttrs.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_X, aPt.X())); - rAttrs.Put(SfxInt32Item(SID_ATTR_TRANSFORM_SHEAR_Y, aPt.Y())); - rAttrs.Put( SfxBoolItem( SID_ATTR_TRANSFORM_SHEAR_VERTICAL, sal_False ) ); - } - - return( bModified ); -} - -// ----------------------------------------------------------------------- - -void SvxSlantTabPage::Reset(const SfxItemSet& rAttrs) -{ - // if the view has selected objects, items with SFX_ITEM_DEFAULT need to be disabled - const SfxPoolItem* pItem; - - // Eckenradius - if(!pView->IsEdgeRadiusAllowed()) - { - aFlRadius.Disable(); - aFtRadius.Disable(); - aMtrRadius.Disable(); - aMtrRadius.SetText( String() ); - } - else - { - pItem = GetItem( rAttrs, SDRATTR_ECKENRADIUS ); - - if( pItem ) - { - const double fUIScale(double(pView->GetModel()->GetUIScale())); - const double fTmp((double)((const SdrEckenradiusItem*)pItem)->GetValue() / fUIScale); - SetMetricValue(aMtrRadius, basegfx::fround(fTmp), ePoolUnit); - } - else - { - aMtrRadius.SetText( String() ); - } - } - - aMtrRadius.SaveValue(); - - // Schraegstellen: Winkel - if( !pView->IsShearAllowed() ) - { - aFlAngle.Disable(); - aFtAngle.Disable(); - aMtrAngle.Disable(); - aMtrAngle.SetText( String() ); - } - else - { - pItem = GetItem( rAttrs, SID_ATTR_TRANSFORM_SHEAR ); - - if( pItem ) - { - aMtrAngle.SetValue( ( (const SfxInt32Item*)pItem )->GetValue() ); - } - else - { - aMtrAngle.SetText( String() ); - } - } - - aMtrAngle.SaveValue(); -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxSlantTabPage::Create( Window* pWindow, const SfxItemSet& rOutAttrs ) -{ - return( new SvxSlantTabPage( pWindow, rOutAttrs ) ); -} - -//------------------------------------------------------------------------ - -sal_uInt16* SvxSlantTabPage::GetRanges() -{ - return( pSlantRanges ); -} - -// ----------------------------------------------------------------------- - -void SvxSlantTabPage::ActivatePage( const SfxItemSet& rSet ) -{ - SfxRectangleItem* pRectItem = NULL; - - if( SFX_ITEM_SET == rSet.GetItemState( GetWhich( SID_ATTR_TRANSFORM_INTERN ) , sal_False, (const SfxPoolItem**) &pRectItem ) ) - { - const Rectangle aTempRect(pRectItem->GetValue()); - maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom()); - } -} - -// ----------------------------------------------------------------------- - -int SvxSlantTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if(_pSet) - { - FillItemSet(*_pSet); - } - - return LEAVE_PAGE; -} - -//------------------------------------------------------------------------ - -void SvxSlantTabPage::PointChanged( Window* , RECT_POINT ) -{ -} - -/************************************************************************* -|* -|* Dialog for changing position and size of graphic objects -|* -\************************************************************************/ - -SvxPositionSizeTabPage::SvxPositionSizeTabPage( Window* pParent, const SfxItemSet& rInAttrs ) : - SvxTabPage ( pParent, CUI_RES( RID_SVXPAGE_POSITION_SIZE ), rInAttrs ), - maFlPosition ( this, CUI_RES( FL_POSITION ) ), - maFtPosX ( this, CUI_RES( FT_POS_X ) ), - maMtrPosX ( this, CUI_RES( MTR_FLD_POS_X ) ), - maFtPosY ( this, CUI_RES( FT_POS_Y ) ), - maMtrPosY ( this, CUI_RES( MTR_FLD_POS_Y ) ), - maFtPosReference ( this, CUI_RES( FT_POSREFERENCE ) ), - maCtlPos ( this, CUI_RES( CTL_POSRECT ), RP_LT ), - - maFlSize ( this, CUI_RES( FL_SIZE ) ), - maFtWidth ( this, CUI_RES( FT_WIDTH ) ), - maMtrWidth ( this, CUI_RES( MTR_FLD_WIDTH ) ), - maFtHeight ( this, CUI_RES( FT_HEIGHT ) ), - maMtrHeight ( this, CUI_RES( MTR_FLD_HEIGHT ) ), - maCbxScale ( this, CUI_RES( CBX_SCALE ) ), - maFtSizeReference ( this, CUI_RES( FT_SIZEREFERENCE) ), - maCtlSize ( this, CUI_RES( CTL_SIZERECT ), RP_LT ), - - maFlProtect ( this, CUI_RES( FL_PROTECT) ), - maTsbPosProtect ( this, CUI_RES( TSB_POSPROTECT ) ), - maTsbSizeProtect ( this, CUI_RES( TSB_SIZEPROTECT ) ), - - - maFlAdjust ( this, CUI_RES( FL_ADJUST ) ), - maTsbAutoGrowWidth ( this, CUI_RES( TSB_AUTOGROW_WIDTH ) ), - maTsbAutoGrowHeight ( this, CUI_RES( TSB_AUTOGROW_HEIGHT ) ), - - maFlDivider (this, CUI_RES( FL_DIVIDER ) ), - - mrOutAttrs ( rInAttrs ), - mnProtectSizeState( STATE_NOCHECK ), - mbPageDisabled ( sal_False ), - mbProtectDisabled( false ), - mbSizeDisabled( false ), - mbAdjustDisabled( true ) -{ - FreeResource(); - - // this pege needs ExchangeSupport - SetExchangeSupport(); - - // evaluate PoolUnit - SfxItemPool* pPool = mrOutAttrs.GetPool(); - DBG_ASSERT( pPool, "no pool (!)" ); - mePoolUnit = pPool->GetMetric( SID_ATTR_TRANSFORM_POS_X ); - - meRP = RP_LT; // s.o. - - maMtrWidth.SetModifyHdl( LINK( this, SvxPositionSizeTabPage, ChangeWidthHdl ) ); - maMtrHeight.SetModifyHdl( LINK( this, SvxPositionSizeTabPage, ChangeHeightHdl ) ); - maCbxScale.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ClickAutoHdl ) ); - - maTsbAutoGrowWidth.Disable(); - maTsbAutoGrowHeight.Disable(); - maFlAdjust.Disable(); - - // #i2379# disable controls when protected - maTsbPosProtect.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ChangePosProtectHdl ) ); - maTsbSizeProtect.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ChangeSizeProtectHdl ) ); - - maCtlPos.SetAccessibleRelationMemberOf( &maFlPosition ); - maCtlSize.SetAccessibleRelationMemberOf( &maFlSize ); - maCtlPos.SetAccessibleRelationLabeledBy( &maFtPosReference ); - maCtlSize.SetAccessibleRelationLabeledBy( &maFtSizeReference ); -} - -// ----------------------------------------------------------------------- - -void SvxPositionSizeTabPage::Construct() -{ - // get range and work area - DBG_ASSERT( mpView, "no valid view (!)" ); - meDlgUnit = GetModuleFieldUnit( GetItemSet() ); - SetFieldUnit( maMtrPosX, meDlgUnit, sal_True ); - SetFieldUnit( maMtrPosY, meDlgUnit, sal_True ); - SetFieldUnit( maMtrWidth, meDlgUnit, sal_True ); - SetFieldUnit( maMtrHeight, meDlgUnit, sal_True ); - - if(FUNIT_MILE == meDlgUnit || FUNIT_KM == meDlgUnit) - { - maMtrPosX.SetDecimalDigits( 3 ); - maMtrPosY.SetDecimalDigits( 3 ); - maMtrWidth.SetDecimalDigits( 3 ); - maMtrHeight.SetDecimalDigits( 3 ); - } - - { // #i75273# - Rectangle aTempRect(mpView->GetAllMarkedRect()); - mpView->GetSdrPageView()->LogicToPagePos(aTempRect); - maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom()); - } - - { // #i75273# - Rectangle aTempRect(mpView->GetWorkArea()); - mpView->GetSdrPageView()->LogicToPagePos(aTempRect); - maWorkRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom()); - } - - // take anchor into account (Writer) - const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); - - if(rMarkList.GetMarkCount()) - { - const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - maAnchor = basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y()); - - if(!maAnchor.equalZero()) // -> Writer - { - for(sal_uInt16 i(1); i < rMarkList.GetMarkCount(); i++) - { - pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); - - if(maAnchor != basegfx::B2DPoint(pObj->GetAnchorPos().X(), pObj->GetAnchorPos().Y())) - { - // diferent anchor positions - maMtrPosX.SetText( String() ); - maMtrPosY.SetText( String() ); - mbPageDisabled = sal_True; - return; - } - } - - // translate ranges about anchor - maRange = basegfx::B2DRange(maRange.getMinimum() - maAnchor, maRange.getMaximum() - maAnchor); - maWorkRange = basegfx::B2DRange(maWorkRange.getMinimum() - maAnchor, maWorkRange.getMaximum() - maAnchor); - } - } - - // this should happen via SID_ATTR_TRANSFORM_AUTOSIZE - if(1 == rMarkList.GetMarkCount()) - { - const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const SdrObjKind eKind((SdrObjKind)pObj->GetObjIdentifier()); - - if((pObj->GetObjInventor() == SdrInventor) && (OBJ_TEXT == eKind || OBJ_TITLETEXT == eKind || OBJ_OUTLINETEXT == eKind) && ((SdrTextObj*)pObj)->HasText()) - { - mbAdjustDisabled = false; - maFlAdjust.Enable(); - maTsbAutoGrowWidth.Enable(); - maTsbAutoGrowHeight.Enable(); - maTsbAutoGrowWidth.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ClickSizeProtectHdl ) ); - maTsbAutoGrowHeight.SetClickHdl( LINK( this, SvxPositionSizeTabPage, ClickSizeProtectHdl ) ); - - // is used as flag to evaluate if its selectable - maTsbAutoGrowWidth.EnableTriState( sal_False ); - maTsbAutoGrowHeight.EnableTriState( sal_False ); - } - } - - // take scale into account - const Fraction aUIScale(mpView->GetModel()->GetUIScale()); - lcl_ScaleRect( maWorkRange, aUIScale ); - lcl_ScaleRect( maRange, aUIScale ); - - // take UI units into account - const sal_uInt16 nDigits(maMtrPosX.GetDecimalDigits()); - lcl_ConvertRect( maWorkRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit ); - lcl_ConvertRect( maRange, nDigits, (MapUnit) mePoolUnit, meDlgUnit ); - - SetMinMaxPosition(); -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet& rOutAttrs ) -{ - sal_Bool bModified(sal_False); - - if ( maMtrWidth.HasFocus() ) - { - ChangeWidthHdl( this ); - } - - if ( maMtrHeight.HasFocus() ) - { - ChangeHeightHdl( this ); - } - - if( !mbPageDisabled ) - { - if ( maMtrPosX.IsValueModified() || maMtrPosY.IsValueModified() ) - { - const double fUIScale(double(mpView->GetModel()->GetUIScale())); - double fX((GetCoreValue( maMtrPosX, mePoolUnit ) + maAnchor.getX()) * fUIScale); - double fY((GetCoreValue( maMtrPosY, mePoolUnit ) + maAnchor.getY()) * fUIScale); - - { // #i75273# - Rectangle aTempRect(mpView->GetAllMarkedRect()); - mpView->GetSdrPageView()->LogicToPagePos(aTempRect); - maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom()); - } - - // #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions - GetTopLeftPosition(fX, fY, maRange); - - rOutAttrs.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_X), basegfx::fround(fX))); - rOutAttrs.Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_Y), basegfx::fround(fY))); - - bModified |= sal_True; - } - - if ( maTsbPosProtect.GetState() != maTsbPosProtect.GetSavedValue() ) - { - if( maTsbPosProtect.GetState() == STATE_DONTKNOW ) - { - rOutAttrs.InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_POS ); - } - else - { - rOutAttrs.Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ), - maTsbPosProtect.GetState() == STATE_CHECK ? sal_True : sal_False ) ); - } - - bModified |= sal_True; - } - } - - if ( maMtrWidth.IsValueModified() || maMtrHeight.IsValueModified() ) - { - Fraction aUIScale = mpView->GetModel()->GetUIScale(); - - // get Width - double nWidth = static_cast<double>(maMtrWidth.GetValue( meDlgUnit )); - nWidth = MetricField::ConvertDoubleValue( nWidth, maMtrWidth.GetBaseValue(), maMtrWidth.GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM ); - long lWidth = long(nWidth * (double)aUIScale); - lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit ); - lWidth = static_cast<long>(maMtrWidth.Denormalize( lWidth )); - - // get Height - double nHeight = static_cast<double>(maMtrHeight.GetValue( meDlgUnit )); - nHeight = MetricField::ConvertDoubleValue( nHeight, maMtrHeight.GetBaseValue(), maMtrHeight.GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM ); - long lHeight = long(nHeight * (double)aUIScale); - lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit ); - lHeight = static_cast<long>(maMtrWidth.Denormalize( lHeight )); - - // put Width & Height to itemset - rOutAttrs.Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), - (sal_uInt32) lWidth ) ); - rOutAttrs.Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), - (sal_uInt32) lHeight ) ); - rOutAttrs.Put( SfxAllEnumItem( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), sal::static_int_cast< sal_uInt16 >( meRP ) ) ); - bModified |= sal_True; - } - - if ( maTsbSizeProtect.GetState() != maTsbSizeProtect.GetSavedValue() ) - { - if ( maTsbSizeProtect.GetState() == STATE_DONTKNOW ) - rOutAttrs.InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_SIZE ); - else - rOutAttrs.Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ), - maTsbSizeProtect.GetState() == STATE_CHECK ? sal_True : sal_False ) ); - bModified |= sal_True; - } - - if ( maTsbAutoGrowWidth.GetState() != maTsbAutoGrowWidth.GetSavedValue() ) - { - if ( !maTsbAutoGrowWidth.IsTriStateEnabled() ) - { - if( maTsbAutoGrowWidth.GetState() == STATE_DONTKNOW ) - rOutAttrs.InvalidateItem( SID_ATTR_TRANSFORM_AUTOWIDTH ); - else - rOutAttrs.Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOWIDTH ), - maTsbAutoGrowWidth.GetState() == STATE_CHECK ? sal_True : sal_False ) ); - } - bModified |= sal_True; - } - - if ( maTsbAutoGrowHeight.GetState() != maTsbAutoGrowHeight.GetSavedValue() ) - { - if ( !maTsbAutoGrowHeight.IsTriStateEnabled() ) - { - if( maTsbAutoGrowHeight.GetState() == STATE_DONTKNOW ) - rOutAttrs.InvalidateItem( SID_ATTR_TRANSFORM_AUTOHEIGHT ); - else - rOutAttrs.Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOHEIGHT ), - maTsbAutoGrowHeight.GetState() == STATE_CHECK ? sal_True : sal_False ) ); - } - bModified |= sal_True; - } - - - return bModified; -} - -// ----------------------------------------------------------------------- - -void SvxPositionSizeTabPage::Reset( const SfxItemSet& ) -{ - const SfxPoolItem* pItem; - const double fUIScale(double(mpView->GetModel()->GetUIScale())); - - if ( !mbPageDisabled ) - { - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_X ); - if ( pItem ) - { - const double fTmp((((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getX()) / fUIScale); - SetMetricValue(maMtrPosX, basegfx::fround(fTmp), mePoolUnit); - } - - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_POS_Y ); - if ( pItem ) - { - const double fTmp((((const SfxInt32Item*)pItem)->GetValue() - maAnchor.getY()) / fUIScale); - SetMetricValue(maMtrPosY, basegfx::fround(fTmp), mePoolUnit); - } - - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_POS ); - if ( pItem ) - { - sal_Bool bProtected = ( ( const SfxBoolItem* )pItem )->GetValue(); - maTsbPosProtect.SetState( bProtected ? STATE_CHECK : STATE_NOCHECK ); - maTsbPosProtect.EnableTriState( sal_False ); - } - else - { - maTsbPosProtect.SetState( STATE_DONTKNOW ); - } - - maTsbPosProtect.SaveValue(); - maCtlPos.Reset(); - - // #i2379# Disable controls for protected objects - ChangePosProtectHdl( this ); - } - - { // #i75273# set width - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH ); - mfOldWidth = std::max( pItem ? (double)((const SfxUInt32Item*)pItem)->GetValue() : 0.0, 1.0 ); - double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale); - - if(maMtrWidth.GetDecimalDigits()) - fTmpWidth *= pow(10.0, maMtrWidth.GetDecimalDigits()); - - fTmpWidth = MetricField::ConvertDoubleValue(fTmpWidth, maMtrWidth.GetBaseValue(), maMtrWidth.GetDecimalDigits(), FUNIT_100TH_MM, meDlgUnit); - maMtrWidth.SetValue(static_cast<sal_Int64>(fTmpWidth), meDlgUnit); - } - - { // #i75273# set height - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT ); - mfOldHeight = std::max( pItem ? (double)((const SfxUInt32Item*)pItem)->GetValue() : 0.0, 1.0 ); - double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), (MapUnit)mePoolUnit, MAP_100TH_MM)) / fUIScale); - - if(maMtrHeight.GetDecimalDigits()) - fTmpHeight *= pow(10.0, maMtrHeight.GetDecimalDigits()); - - fTmpHeight = MetricField::ConvertDoubleValue(fTmpHeight, maMtrHeight.GetBaseValue(), maMtrHeight.GetDecimalDigits(), FUNIT_100TH_MM, meDlgUnit); - maMtrHeight.SetValue(static_cast<sal_Int64>(fTmpHeight), meDlgUnit); - } - - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_SIZE ); - if ( pItem ) - { - maTsbSizeProtect.SetState( ( (const SfxBoolItem*)pItem )->GetValue() - ? STATE_CHECK : STATE_NOCHECK ); - maTsbSizeProtect.EnableTriState( sal_False ); - } - else - maTsbSizeProtect.SetState( STATE_DONTKNOW ); - - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOWIDTH ); - if ( pItem ) - { - maTsbAutoGrowWidth.SetState( ( ( const SfxBoolItem* )pItem )->GetValue() - ? STATE_CHECK : STATE_NOCHECK ); - } - else - maTsbAutoGrowWidth.SetState( STATE_DONTKNOW ); - - pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_AUTOHEIGHT ); - if ( pItem ) - { - maTsbAutoGrowHeight.SetState( ( ( const SfxBoolItem* )pItem )->GetValue() - ? STATE_CHECK : STATE_NOCHECK ); - } - else - maTsbAutoGrowHeight.SetState( STATE_DONTKNOW ); - - // Ist Abgleich gesetzt? - String aStr = GetUserData(); - maCbxScale.Check( (sal_Bool)aStr.ToInt32() ); - - maTsbSizeProtect.SaveValue(); - maTsbAutoGrowWidth.SaveValue(); - maTsbAutoGrowHeight.SaveValue(); - ClickSizeProtectHdl( NULL ); - - // #i2379# Disable controls for protected objects - ChangeSizeProtectHdl( this ); -} - -// ----------------------------------------------------------------------- - -SfxTabPage* SvxPositionSizeTabPage::Create( Window* pWindow, const SfxItemSet& rOutAttrs ) -{ - return( new SvxPositionSizeTabPage( pWindow, rOutAttrs ) ); -} - -//------------------------------------------------------------------------ - -sal_uInt16* SvxPositionSizeTabPage::GetRanges() -{ - return( pPosSizeRanges ); -} - -// ----------------------------------------------------------------------- - -void SvxPositionSizeTabPage::ActivatePage( const SfxItemSet& rSet ) -{ - SfxRectangleItem* pRectItem = NULL; - - if( SFX_ITEM_SET == rSet.GetItemState( GetWhich( SID_ATTR_TRANSFORM_INTERN ) , sal_False, (const SfxPoolItem**) &pRectItem ) ) - { - { // #i75273# - const Rectangle aTempRect(pRectItem->GetValue()); - maRange = basegfx::B2DRange(aTempRect.Left(), aTempRect.Top(), aTempRect.Right(), aTempRect.Bottom()); - } - - SetMinMaxPosition(); - } -} - -// ----------------------------------------------------------------------- - -int SvxPositionSizeTabPage::DeactivatePage( SfxItemSet* _pSet ) -{ - if( _pSet ) - { - double fX((double)maMtrPosX.GetValue()); - double fY((double)maMtrPosY.GetValue()); - - GetTopLeftPosition(fX, fY, maRange); - const Rectangle aOutRectangle( - basegfx::fround(fX), basegfx::fround(fY), - basegfx::fround(fX + maRange.getWidth()), basegfx::fround(fY + maRange.getHeight())); - _pSet->Put(SfxRectangleItem(SID_ATTR_TRANSFORM_INTERN, aOutRectangle)); - - FillItemSet(*_pSet); - } - - return LEAVE_PAGE; -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxPositionSizeTabPage, ChangePosProtectHdl, void *, EMPTYARG ) -{ - // #106572# Remember user's last choice - maTsbSizeProtect.SetState( maTsbPosProtect.GetState() == STATE_CHECK ? STATE_CHECK : mnProtectSizeState ); - UpdateControlStates(); - return( 0L ); -} - -//------------------------------------------------------------------------ - -void SvxPositionSizeTabPage::UpdateControlStates() -{ - const bool bPosProtect = maTsbPosProtect.GetState() == STATE_CHECK; - const bool bSizeProtect = maTsbSizeProtect.GetState() == STATE_CHECK; - const bool bHeightChecked = !maTsbAutoGrowHeight.IsTriStateEnabled() && (maTsbAutoGrowHeight.GetState() == STATE_CHECK); - const bool bWidthChecked = !maTsbAutoGrowWidth.IsTriStateEnabled() && (maTsbAutoGrowWidth.GetState() == STATE_CHECK); - - maFlPosition.Enable( !bPosProtect && !mbPageDisabled ); - maFtPosX.Enable( !bPosProtect && !mbPageDisabled ); - maMtrPosX.Enable( !bPosProtect && !mbPageDisabled ); - maFtPosY.Enable( !bPosProtect && !mbPageDisabled ); - maMtrPosY.Enable( !bPosProtect && !mbPageDisabled ); - maFtPosReference.Enable( !bPosProtect && !mbPageDisabled ); - maCtlPos.Enable( !bPosProtect ); - maTsbPosProtect.Enable( !mbProtectDisabled && !mbPageDisabled ); - - maFlSize.Enable( !mbSizeDisabled && !bSizeProtect ); - maCtlSize.Enable( !mbSizeDisabled && !bSizeProtect && (!bHeightChecked || !bWidthChecked) ); - maFtWidth.Enable( !mbSizeDisabled && !bSizeProtect && !bWidthChecked ); - maMtrWidth.Enable( !mbSizeDisabled && !bSizeProtect && !bWidthChecked ); - maFtHeight.Enable( !mbSizeDisabled && !bSizeProtect && !bHeightChecked ); - maMtrHeight.Enable( !mbSizeDisabled && !bSizeProtect && !bHeightChecked ); - maCbxScale.Enable( !mbSizeDisabled && !bSizeProtect && !bHeightChecked && !bWidthChecked ); - maFtSizeReference.Enable( !mbSizeDisabled && !bSizeProtect ); - maFlProtect.Enable( !mbProtectDisabled ); - maTsbSizeProtect.Enable( !mbProtectDisabled && !bPosProtect ); - - maFlAdjust.Enable( !mbSizeDisabled && !bSizeProtect && !mbAdjustDisabled ); - maTsbAutoGrowWidth.Enable( !mbSizeDisabled && !bSizeProtect && !mbAdjustDisabled ); - maTsbAutoGrowHeight.Enable( !mbSizeDisabled && !bSizeProtect && !mbAdjustDisabled ); - - maCtlSize.Invalidate(); - maCtlPos.Invalidate(); - -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxPositionSizeTabPage, ChangeSizeProtectHdl, void *, EMPTYARG ) -{ - if( maTsbSizeProtect.IsEnabled() ) - { - // #106572# Remember user's last choice - - // Note: this works only as long as the dialog is open. When - // the user closes the dialog, there is no way to remember - // whether size was enabled or disabled befor pos protect was - // clicked. Thus, if pos protect is selected, the dialog is - // closed and reopened again, unchecking pos protect will - // always uncheck size protect, too. That's life. - mnProtectSizeState = maTsbSizeProtect.GetState(); - } - - UpdateControlStates(); - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK_INLINE_START( SvxPositionSizeTabPage, ChangePosXHdl, void *, EMPTYARG ) -{ - return( 0L ); -} -IMPL_LINK_INLINE_END( SvxPositionSizeTabPage, ChangePosXHdl, void *, EMPTYARG ) - -//------------------------------------------------------------------------ - -IMPL_LINK_INLINE_START( SvxPositionSizeTabPage, ChangePosYHdl, void *, EMPTYARG ) -{ - return( 0L ); -} -IMPL_LINK_INLINE_END( SvxPositionSizeTabPage, ChangePosYHdl, void *, EMPTYARG ) - -//------------------------------------------------------------------------ - -void SvxPositionSizeTabPage::SetMinMaxPosition() -{ - // position - double fLeft(maWorkRange.getMinX()); - double fTop(maWorkRange.getMinY()); - double fRight(maWorkRange.getMaxX()); - double fBottom(maWorkRange.getMaxY()); - - switch ( maCtlPos.GetActualRP() ) - { - case RP_LT: - { - fRight -= maRange.getWidth(); - fBottom -= maRange.getHeight(); - break; - } - case RP_MT: - { - fLeft += maRange.getWidth() / 2.0; - fRight -= maRange.getWidth() / 2.0; - fBottom -= maRange.getHeight(); - break; - } - case RP_RT: - { - fLeft += maRange.getWidth(); - fBottom -= maRange.getHeight(); - break; - } - case RP_LM: - { - fRight -= maRange.getWidth(); - fTop += maRange.getHeight() / 2.0; - fBottom -= maRange.getHeight() / 2.0; - break; - } - case RP_MM: - { - fLeft += maRange.getWidth() / 2.0; - fRight -= maRange.getWidth() / 2.0; - fTop += maRange.getHeight() / 2.0; - fBottom -= maRange.getHeight() / 2.0; - break; - } - case RP_RM: - { - fLeft += maRange.getWidth(); - fTop += maRange.getHeight() / 2.0; - fBottom -= maRange.getHeight() / 2.0; - break; - } - case RP_LB: - { - fRight -= maRange.getWidth(); - fTop += maRange.getHeight(); - break; - } - case RP_MB: - { - fLeft += maRange.getWidth() / 2.0; - fRight -= maRange.getWidth() / 2.0; - fTop += maRange.getHeight(); - break; - } - case RP_RB: - { - fLeft += maRange.getWidth(); - fTop += maRange.getHeight(); - break; - } - } - - const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MAP_100TH_MM, meDlgUnit ) - 1L)); - fLeft = (fLeft > fMaxLong) ? fMaxLong : (fLeft < -fMaxLong) ? -fMaxLong : fLeft; - fRight = (fRight > fMaxLong) ? fMaxLong : (fRight < -fMaxLong) ? -fMaxLong : fRight; - fTop = (fTop > fMaxLong) ? fMaxLong : (fTop < -fMaxLong) ? -fMaxLong : fTop; - fBottom = (fBottom > fMaxLong) ? fMaxLong : (fBottom < -fMaxLong) ? -fMaxLong : fBottom; - - // #i75273# normalizing when setting the min/max values was wrong, removed - maMtrPosX.SetMin(basegfx::fround64(fLeft)); - maMtrPosX.SetFirst(basegfx::fround64(fLeft)); - maMtrPosX.SetMax(basegfx::fround64(fRight)); - maMtrPosX.SetLast(basegfx::fround64(fRight)); - maMtrPosY.SetMin(basegfx::fround64(fTop)); - maMtrPosY.SetFirst(basegfx::fround64(fTop)); - maMtrPosY.SetMax(basegfx::fround64(fBottom)); - maMtrPosY.SetLast(basegfx::fround64(fBottom)); - - // size - fLeft = maWorkRange.getMinX(); - fTop = maWorkRange.getMinY(); - fRight = maWorkRange.getMaxX(); - fBottom = maWorkRange.getMaxY(); - double fNewX(0); - double fNewY(0); - - switch ( maCtlSize.GetActualRP() ) - { - case RP_LT: - { - fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft ); - fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop ); - break; - } - case RP_MT: - { - fNewX = std::min( maRange.getCenter().getX() - fLeft, fRight - maRange.getCenter().getX() ) * 2.0; - fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop ); - break; - } - case RP_RT: - { - fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() ); - fNewY = maWorkRange.getHeight() - ( maRange.getMinY() - fTop ); - break; - } - case RP_LM: - { - fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft ); - fNewY = std::min( maRange.getCenter().getY() - fTop, fBottom - maRange.getCenter().getY() ) * 2.0; - break; - } - case RP_MM: - { - const double f1(maRange.getCenter().getX() - fLeft); - const double f2(fRight - maRange.getCenter().getX()); - const double f3(std::min(f1, f2)); - const double f4(maRange.getCenter().getY() - fTop); - const double f5(fBottom - maRange.getCenter().getY()); - const double f6(std::min(f4, f5)); - - fNewX = f3 * 2.0; - fNewY = f6 * 3.0; - - break; - } - case RP_RM: - { - fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() ); - fNewY = std::min( maRange.getCenter().getY() - fTop, fBottom - maRange.getCenter().getY() ) * 2.0; - break; - } - case RP_LB: - { - fNewX = maWorkRange.getWidth() - ( maRange.getMinX() - fLeft ); - fNewY = maWorkRange.getHeight() - ( fBottom - maRange.getMaxY() ); - break; - } - case RP_MB: - { - fNewX = std::min( maRange.getCenter().getX() - fLeft, fRight - maRange.getCenter().getX() ) * 2.0; - fNewY = maWorkRange.getHeight() - ( maRange.getMaxY() - fBottom ); - break; - } - case RP_RB: - { - fNewX = maWorkRange.getWidth() - ( fRight - maRange.getMaxX() ); - fNewY = maWorkRange.getHeight() - ( fBottom - maRange.getMaxY() ); - break; - } - } - - // #i75273# normalizing when setting the min/max values was wrong, removed - maMtrWidth.SetMax(basegfx::fround64(fNewX)); - maMtrWidth.SetLast(basegfx::fround64(fNewX)); - maMtrHeight.SetMax(basegfx::fround64(fNewY)); - maMtrHeight.SetLast(basegfx::fround64(fNewY)); -} - -//------------------------------------------------------------------------ - -void SvxPositionSizeTabPage::GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange) -{ - switch (maCtlPos.GetActualRP()) - { - case RP_LT: - { - break; - } - case RP_MT: - { - rfX -= rRange.getCenter().getX() - rRange.getMinX(); - break; - } - case RP_RT: - { - rfX -= rRange.getWidth(); - break; - } - case RP_LM: - { - rfY -= rRange.getCenter().getY() - rRange.getMinY(); - break; - } - case RP_MM: - { - rfX -= rRange.getCenter().getX() - rRange.getMinX(); - rfY -= rRange.getCenter().getY() - rRange.getMinY(); - break; - } - case RP_RM: - { - rfX -= rRange.getWidth(); - rfY -= rRange.getCenter().getY() - rRange.getMinY(); - break; - } - case RP_LB: - { - rfY -= rRange.getHeight(); - break; - } - case RP_MB: - { - rfX -= rRange.getCenter().getX() - rRange.getMinX(); - rfY -= rRange.getHeight(); - break; - } - case RP_RB: - { - rfX -= rRange.getWidth(); - rfY -= rRange.getHeight(); - break; - } - } -} - -//------------------------------------------------------------------------ - -void SvxPositionSizeTabPage::PointChanged( Window* pWindow, RECT_POINT eRP ) -{ - if( pWindow == &maCtlPos ) - { - SetMinMaxPosition(); - switch( eRP ) - { - case RP_LT: - { - maMtrPosX.SetValue( basegfx::fround64(maRange.getMinX()) ); - maMtrPosY.SetValue( basegfx::fround64(maRange.getMinY()) ); - break; - } - case RP_MT: - { - maMtrPosX.SetValue( basegfx::fround64(maRange.getCenter().getX()) ); - maMtrPosY.SetValue( basegfx::fround64(maRange.getMinY()) ); - break; - } - case RP_RT: - { - maMtrPosX.SetValue( basegfx::fround64(maRange.getMaxX()) ); - maMtrPosY.SetValue( basegfx::fround64(maRange.getMinY()) ); - break; - } - case RP_LM: - { - maMtrPosX.SetValue( basegfx::fround64(maRange.getMinX()) ); - maMtrPosY.SetValue( basegfx::fround64(maRange.getCenter().getY()) ); - break; - } - case RP_MM: - { - maMtrPosX.SetValue( basegfx::fround64(maRange.getCenter().getX()) ); - maMtrPosY.SetValue( basegfx::fround64(maRange.getCenter().getY()) ); - break; - } - case RP_RM: - { - maMtrPosX.SetValue( basegfx::fround64(maRange.getMaxX()) ); - maMtrPosY.SetValue( basegfx::fround64(maRange.getCenter().getY()) ); - break; - } - case RP_LB: - { - maMtrPosX.SetValue( basegfx::fround64(maRange.getMinX()) ); - maMtrPosY.SetValue( basegfx::fround64(maRange.getMaxY()) ); - break; - } - case RP_MB: - { - maMtrPosX.SetValue( basegfx::fround64(maRange.getCenter().getX()) ); - maMtrPosY.SetValue( basegfx::fround64(maRange.getMaxY()) ); - break; - } - case RP_RB: - { - maMtrPosX.SetValue( basegfx::fround64(maRange.getMaxX()) ); - maMtrPosY.SetValue( basegfx::fround64(maRange.getMaxY()) ); - break; - } - } - } - else - { - meRP = eRP; - - Rectangle aTmpRect( GetRect() ); - SetMinMaxPosition(); - } -} - -//------------------------------------------------------------------------ - -void SvxPositionSizeTabPage::DisableResize() -{ - mbSizeDisabled = true; -} - -//------------------------------------------------------------------------ - -void SvxPositionSizeTabPage::DisableProtect() -{ - mbProtectDisabled = true; -} - -//------------------------------------------------------------------------ - -Rectangle SvxPositionSizeTabPage::GetRect() -{ - double fLeft(maRange.getMinX()); - double fTop(maRange.getMinY()); - double fRight(fLeft + (double)maMtrWidth.GetValue()); - double fBottom(fTop + (double)maMtrHeight.GetValue()); - - switch ( maCtlSize.GetActualRP() ) - { - case RP_LT: - { - break; - } - case RP_MT: - { - fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() ) / 2.0; - break; - } - case RP_RT: - { - fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() ); - break; - } - case RP_LM: - { - fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() ) / 2.0; - break; - } - case RP_MM: - { - fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() ) / 2.0; - fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() ) / 2.0; - break; - } - case RP_RM: - { - fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() ); - fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() ) / 2.0; - break; - } - case RP_LB: - { - fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() ); - break; - } - case RP_MB: - { - fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() ) / 2.0; - fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() ); - break; - } - case RP_RB: - { - fLeft = maRange.getMinX() - ( fRight - maRange.getMaxX() ); - fTop = maRange.getMinY() - ( fBottom - maRange.getMaxY() ); - break; - } - } - - return Rectangle(basegfx::fround(fLeft), basegfx::fround(fTop), basegfx::fround(fRight), basegfx::fround(fBottom)); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxPositionSizeTabPage, ChangeWidthHdl, void *, EMPTYARG ) -{ - if( maCbxScale.IsChecked() && maCbxScale.IsEnabled() ) - { - sal_Int64 nHeight(basegfx::fround64((mfOldHeight * (double)maMtrWidth.GetValue()) / mfOldWidth)); - - if(nHeight <= maMtrHeight.GetMax(FUNIT_NONE)) - { - maMtrHeight.SetUserValue(nHeight, FUNIT_NONE); - } - else - { - nHeight = maMtrHeight.GetMax(FUNIT_NONE); - maMtrHeight.SetUserValue(nHeight); - - const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * (double)nHeight) / mfOldHeight)); - maMtrWidth.SetUserValue(nWidth, FUNIT_NONE); - } - } - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxPositionSizeTabPage, ChangeHeightHdl, void *, EMPTYARG ) -{ - if( maCbxScale.IsChecked() && maCbxScale.IsEnabled() ) - { - sal_Int64 nWidth(basegfx::fround64((mfOldWidth * (double)maMtrHeight.GetValue()) / mfOldHeight)); - - if(nWidth <= maMtrWidth.GetMax(FUNIT_NONE)) - { - maMtrWidth.SetUserValue(nWidth, FUNIT_NONE); - } - else - { - nWidth = maMtrWidth.GetMax(FUNIT_NONE); - maMtrWidth.SetUserValue(nWidth); - - const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * (double)nWidth) / mfOldWidth)); - maMtrHeight.SetUserValue(nHeight, FUNIT_NONE); - } - } - - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxPositionSizeTabPage, ClickSizeProtectHdl, void *, EMPTYARG ) -{ - UpdateControlStates(); - return( 0L ); -} - -//------------------------------------------------------------------------ - -IMPL_LINK( SvxPositionSizeTabPage, ClickAutoHdl, void *, EMPTYARG ) -{ - if( maCbxScale.IsChecked() ) - { - mfOldWidth = std::max( (double)GetCoreValue( maMtrWidth, mePoolUnit ), 1.0 ); - mfOldHeight = std::max( (double)GetCoreValue( maMtrHeight, mePoolUnit ), 1.0 ); - } - - return( 0L ); -} - -//------------------------------------------------------------------------ - -void SvxPositionSizeTabPage::FillUserData() -{ - // Abgleich wird in der Ini-Datei festgehalten - UniString aStr = UniString::CreateFromInt32( (sal_Int32) maCbxScale.IsChecked() ); - SetUserData( aStr ); -} - -// eof - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/transfrm.hrc b/cui/source/tabpages/transfrm.hrc deleted file mode 100644 index 28d81fa62..000000000 --- a/cui/source/tabpages/transfrm.hrc +++ /dev/null @@ -1,76 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ -#define TAB_CONTROL 1 -#define BTN_OK 2 -#define BTN_CANCEL 3 -#define BTN_HELP 4 -#define FT_POS_X 5 -#define FT_POS_Y 6 -#define MTR_FLD_POS_X 7 -#define MTR_FLD_POS_Y 8 -#define CBX_COPY 9 -#define TSB_PROTECT 10 -#define TSB_AUTO 11 -#define TSB_AUTOGROW_HEIGHT 12 -#define TSB_AUTOGROW_WIDTH 13 -#define BTN_RESET 14 -#define FT_WIDTH 15 -#define FT_HEIGHT 16 -#define MTR_FLD_WIDTH 17 -#define MTR_FLD_HEIGHT 18 -#define MTR_FLD_ANGLE 19 -#define CTL_RECT 20 -#define CTL_ANGLE 21 -#define CBX_SCALE 22 -#define FL_ADJUST 23 -#define FL_POSITION 24 -#define FL_SIZE 25 -#define FL_SLANT 26 -#define FL_RADIUS 27 -#define FT_RADIUS 28 -#define MTR_FLD_RADIUS 29 -#define FL_ANGLE 30 -#define FT_ANGLE 31 -#define TSB_VERTICAL 32 -#define FL_ANCHOR 33 -#define FT_ANCHOR 34 -#define LB_ANCHOR 35 -#define FT_ORIENT 36 -#define FT_REFERENCE 37 -#define FT_POSPRESETS 38 -#define FT_ANGLEPRESETS 39 -#define LB_ORIENT 40 -#define FT_SIZEREFERENCE 41 -#define CTL_SIZERECT 42 -#define FT_POSREFERENCE 43 -#define CTL_POSRECT 44 -#define TSB_POSPROTECT 45 -#define TSB_SIZEPROTECT 46 -#define FL_PROTECT 47 -#define FL_DIVIDER 48 - -// diff --git a/cui/source/tabpages/transfrm.src b/cui/source/tabpages/transfrm.src deleted file mode 100644 index d8960137a..000000000 --- a/cui/source/tabpages/transfrm.src +++ /dev/null @@ -1,625 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * 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. - * - * 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). - * - * 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. - * - ************************************************************************/ - // include ------------------------------------------------------------------ -#include <svtools/controldims.hrc> -#include "helpid.hrc" -#include <cuires.hrc> -#include "transfrm.hrc" -#include <svx/dialogs.hrc> - -#define MA_TABPAGE_HEIGHT 185 - - // RID_SVXPAGE_POSITION_SIZE ------------------------------------------------ -TabPage RID_SVXPAGE_POSITION_SIZE -{ - HelpId = HID_TRANS_POSITION_SIZE ; - Hide = TRUE ; - Text [ en-US ] = "Position and Size" ; - Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ; - - FixedLine FL_POSITION - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Position" ; - }; - FixedText FT_POS_X - { - Pos = MAP_APPFONT ( 12 , 16 + 8 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "Position ~X" ; - }; - FixedText FT_POS_Y - { - Pos = MAP_APPFONT ( 12 , 32 + 8 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "Position ~Y" ; - }; - MetricField MTR_FLD_POS_X - { - HelpID = "cui:MetricField:RID_SVXPAGE_POSITION_SIZE:MTR_FLD_POS_X"; - Border = TRUE ; - Pos = MAP_APPFONT ( 56 , 14 + 8 ) ; - Size = MAP_APPFONT ( 54 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -120000 ; - Maximum = 240000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 10 ; - }; - MetricField MTR_FLD_POS_Y - { - HelpID = "cui:MetricField:RID_SVXPAGE_POSITION_SIZE:MTR_FLD_POS_Y"; - Border = TRUE ; - Pos = MAP_APPFONT ( 56 , 30 + 8 ) ; - Size = MAP_APPFONT ( 54 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -120000 ; - Maximum = 240000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 10 ; - }; - FixedText FT_POSREFERENCE - { - Pos = MAP_APPFONT ( 178 , 2 + 8 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "Base point"; - }; - Control CTL_POSRECT - { - HelpId = HID_TPPOSITION_CTRL ; - Border = TRUE ; - Pos = MAP_APPFONT ( 178 , 12 + 8 ) ; - Size = MAP_APPFONT ( 48 , 34 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Base point" ; - }; - - // size - - FixedLine FL_SIZE - { - Pos = MAP_APPFONT ( 6 , 56 ) ; - Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Size" ; - }; - FixedText FT_WIDTH - { - Pos = MAP_APPFONT ( 12 , 16 + 61 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "Wi~dth" ; - }; - FixedText FT_HEIGHT - { - Pos = MAP_APPFONT ( 12 , 32 + 61 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "H~eight" ; - }; - MetricField MTR_FLD_WIDTH - { - HelpID = "cui:MetricField:RID_SVXPAGE_POSITION_SIZE:MTR_FLD_WIDTH"; - Border = TRUE ; - Pos = MAP_APPFONT ( 56 , 14 + 61 ) ; - Size = MAP_APPFONT ( 54 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 120000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 10 ; - }; - MetricField MTR_FLD_HEIGHT - { - HelpID = "cui:MetricField:RID_SVXPAGE_POSITION_SIZE:MTR_FLD_HEIGHT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 56 , 30 + 61 ) ; - Size = MAP_APPFONT ( 54 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 120000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 10 ; - }; - FixedText FT_SIZEREFERENCE - { - Pos = MAP_APPFONT ( 178 , 2 + 61 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "Base point"; - }; - Control CTL_SIZERECT - { - HelpId = HID_TPSIZE_CTRL ; - Border = TRUE ; - Pos = MAP_APPFONT ( 178 , 12 + 61 ) ; - Size = MAP_APPFONT ( 48 , 34 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Base point" ; - }; - CheckBox CBX_SCALE - { - HelpID = "cui:CheckBox:RID_SVXPAGE_POSITION_SIZE:CBX_SCALE"; - Pos = MAP_APPFONT ( 12 , 47 + 61 ) ; - Size = MAP_APPFONT ( 162 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Keep ratio" ; - }; - - // Protect - - FixedLine FL_PROTECT - { - Pos = MAP_APPFONT ( 6 , 120 ) ; - Size = MAP_APPFONT ( 119 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Protect" ; - }; - - TriStateBox TSB_POSPROTECT - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_POSITION_SIZE:TSB_POSPROTECT"; - Pos = MAP_APPFONT ( 12 , 10 + 120 ) ; - Size = MAP_APPFONT ( 113 , 10 ) ; - Text [ en-US ] = "Position" ; - TabStop = TRUE ; - }; - - TriStateBox TSB_SIZEPROTECT - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_POSITION_SIZE:TSB_SIZEPROTECT"; - Pos = MAP_APPFONT ( 12 , 24 + 120 ) ; - Size = MAP_APPFONT ( 113 , 10 ) ; - Text [ en-US ] = "~Size" ; - TabStop = TRUE ; - }; - - // Adjust - - FixedLine FL_ADJUST - { - Pos = MAP_APPFONT ( 6 + 123 + 6 , 120 ) ; - Size = MAP_APPFONT ( 119 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Adapt" ; - }; - TriStateBox TSB_AUTOGROW_WIDTH - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_POSITION_SIZE:TSB_AUTOGROW_WIDTH"; - Pos = MAP_APPFONT ( 12 + 121 + 8, 10 + 120 ) ; - Size = MAP_APPFONT ( 113 , 10 ) ; - Text [ en-US ] = "~Fit width to text" ; - TabStop = TRUE ; - }; - TriStateBox TSB_AUTOGROW_HEIGHT - { - HelpID = "cui:TriStateBox:RID_SVXPAGE_POSITION_SIZE:TSB_AUTOGROW_HEIGHT"; - Pos = MAP_APPFONT ( 12 + 121 + 8, 24 + 120 ) ; - Size = MAP_APPFONT ( 113 , 10 ) ; - Text [ en-US ] = "Fit ~height to text" ; - TabStop = TRUE ; - }; - - FixedLine FL_DIVIDER - { - Pos = MAP_APPFONT( 6 + 119 + 5, 128 ); - Size = MAP_APPFONT( RSC_CD_FIXEDLINE_WIDTH, 26 ); - Vert = True; - }; - - // Anchor - - FixedLine FL_ANCHOR - { - Pos = MAP_APPFONT ( 6 + 123 + 6 , 120 ) ; - Size = MAP_APPFONT ( 119 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Hide = TRUE ; - Text [ en-US ] = "Anchor" ; - }; - FixedText FT_ANCHOR - { - Pos = MAP_APPFONT ( 12 + 121 + 8, 10 + 120 ) ; - Size = MAP_APPFONT ( 37 , 10 ) ; - Hide = TRUE ; - Text [ en-US ] = "~Anchor" ; - }; - ListBox LB_ANCHOR - { - HelpID = "cui:ListBox:RID_SVXPAGE_POSITION_SIZE:LB_ANCHOR"; - Pos = MAP_APPFONT ( 46 + 121 + 16 , 8 + 120 ) ; - Size = MAP_APPFONT ( 54 , 60 ) ; - Hide = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "To paragraph" ; > ; - < "As character" ; > ; - < "To page" ; > ; - < "To frame" ; > ; - }; - }; - FixedText FT_ORIENT - { - Pos = MAP_APPFONT ( 12 + 121 + 8, 24 + 120 ) ; - Size = MAP_APPFONT ( 37 , 10 ) ; - Hide = TRUE ; - Text [ en-US ] = "P~osition"; - }; - ListBox LB_ORIENT - { - HelpID = "cui:ListBox:RID_SVXPAGE_POSITION_SIZE:LB_ORIENT"; - Pos = MAP_APPFONT ( 46 + 121 + 16 , 22 + 120 ); - Size = MAP_APPFONT ( 54 , 60 ) ; - Hide = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "From top" ; > ; - < "Above" ; > ; - < "Centered" ; > ; - < "Below" ; > ; - < "Top of character" ; > ; - < "Center of character" ; > ; - < "Bottom of character" ; > ; - < "Top of line" ; > ; - < "Center of line" ; > ; - < "Bottom of line" ; > ; - }; - }; -}; - - // RID_SVXPAGE_ANGLE -------------------------------------------------------- -TabPage RID_SVXPAGE_ANGLE -{ - HelpId = HID_TRANS_ANGLE ; - Hide = TRUE ; - Text [ en-US ] = "Angle" ; - Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ; - FixedLine FL_POSITION - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Pivot point" ; - }; - FixedText FT_POS_X - { - Pos = MAP_APPFONT ( 12 , 16 + 11 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "Position ~X" ; - }; - FixedText FT_POS_Y - { - Pos = MAP_APPFONT ( 12 , 32 + 11 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "Position ~Y" ; - }; - MetricField MTR_FLD_POS_X - { - HelpID = "cui:MetricField:RID_SVXPAGE_ANGLE:MTR_FLD_POS_X"; - Border = TRUE ; - Pos = MAP_APPFONT ( 56 , 14 + 11 ) ; - Size = MAP_APPFONT ( 54 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -500000 ; - Maximum = 500000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 10 ; - }; - MetricField MTR_FLD_POS_Y - { - HelpID = "cui:MetricField:RID_SVXPAGE_ANGLE:MTR_FLD_POS_Y"; - Border = TRUE ; - Pos = MAP_APPFONT ( 56 , 30 + 11 ) ; - Size = MAP_APPFONT ( 54 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -500000 ; - Maximum = 500000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 10 ; - }; - FixedText FT_POSPRESETS - { - Pos = MAP_APPFONT ( 178 , 14 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; - Text [ en-US ] = "Default settings"; - }; - Control CTL_RECT - { - HelpId = HID_TPROTATION_CTRL1 ; - Border = TRUE ; - Pos = MAP_APPFONT ( 178 , 14 + 11 ) ; - Size = MAP_APPFONT ( 70 , 48 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Rotation point" ; - }; - FixedLine FL_ANGLE - { - Pos = MAP_APPFONT ( 6 , 71 + 11 ) ; - Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Rotation angle" ; - }; - FixedText FT_ANGLE - { - Pos = MAP_APPFONT ( 12 , 84 + 22 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "~Angle" ; - }; - MetricField MTR_FLD_ANGLE - { - HelpID = "cui:MetricField:RID_SVXPAGE_ANGLE:MTR_FLD_ANGLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 56 , 82 + 22 ) ; - Size = MAP_APPFONT ( 54 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -500000 ; - Maximum = 500000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_CUSTOM ; - CustomUnitText [ en-US ] = " degrees" ; - SpinSize = 500 ; - }; - FixedText FT_ANGLEPRESETS - { - Pos = MAP_APPFONT ( 178 , 82 + 11 ) ; - Size = MAP_APPFONT ( 70 , 8 ) ; - Text [ en-US ] = "Default settings"; - }; - Control CTL_ANGLE - { - HelpId = HID_TPROTATION_CTRL2 ; - Border = TRUE ; - Pos = MAP_APPFONT ( 178 , 82 + 22 ) ; - Size = MAP_APPFONT ( 70 , 48 ) ; - TabStop = TRUE ; - QuickHelpText [ en-US ] = "Rotation Angle"; - }; -}; - // RID_SVXPAGE_SLANT ----------------------------------------------------- -TabPage RID_SVXPAGE_SLANT -{ - HelpId = HID_TRANS_SLANT ; - Hide = TRUE ; - Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ; - Text [ en-US ] = "Slant & Corner Radius" ; - FixedLine FL_RADIUS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Corner radius" ; - }; - FixedText FT_RADIUS - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "~Radius" ; - }; - MetricField MTR_FLD_RADIUS - { - HelpID = "cui:MetricField:RID_SVXPAGE_SLANT:MTR_FLD_RADIUS"; - Border = TRUE ; - Pos = MAP_APPFONT ( 56 , 14 ) ; - Size = MAP_APPFONT ( 54 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 0 ; - Maximum = 500000 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_MM ; - SpinSize = 10 ; - }; - FixedLine FL_SLANT - { - Pos = MAP_APPFONT ( 6 , 35 ) ; - Size = MAP_APPFONT ( 248 , RSC_CD_FIXEDLINE_HEIGHT ) ; - Text [ en-US ] = "Slant" ; - }; - FixedText FT_ANGLE - { - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - Text [ en-US ] = "~Angle" ; - }; - MetricField MTR_FLD_ANGLE - { - HelpID = "cui:MetricField:RID_SVXPAGE_SLANT:MTR_FLD_ANGLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 56 , 46 ) ; - Size = MAP_APPFONT ( 54 , 12 ) ; - TabStop = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = -8900 ; - First = -8900 ; - Maximum = 8900 ; - Last = 8900 ; - StrictFormat = TRUE ; - DecimalDigits = 2 ; - Unit = FUNIT_CUSTOM ; - SpinSize = 500 ; - CustomUnitText [ en-US ] = " degrees" ; - }; -}; - // RID_SVXDLG_TRANSFORM ----------------------------------------------------- - -#define _POS_SIZE_TEXT \ - Text [ en-US ] = "Position and Size" ; \ - - -TabDialog RID_SVXDLG_TRANSFORM\ -{ - OutputSize = TRUE ; - SvLook = TRUE ; - Size = MAP_APPFONT ( 289 , MA_TABPAGE_HEIGHT + 41 ) ; - Text [ en-US ] = "Position and Size" ;\ - Moveable = TRUE ; - TabControl TAB_CONTROL\ - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 3 , 3 ) ; - Size = MAP_APPFONT ( 260 , MA_TABPAGE_HEIGHT ) ; - PageList = - { - PageItem\ - { - Identifier = RID_SVXPAGE_POSITION_SIZE ; - PageResID = RID_SVXPAGE_POSITION_SIZE ; - _POS_SIZE_TEXT - }; - PageItem - { - Identifier = RID_SVXPAGE_SWPOSSIZE; - PageResID = RID_SVXPAGE_SWPOSSIZE; - _POS_SIZE_TEXT - }; - PageItem - { - Identifier = RID_SVXPAGE_ANGLE ; - Text [ en-US ] = "Rotation" ; - PageResID = RID_SVXPAGE_ANGLE ; - }; - PageItem - { - Identifier = RID_SVXPAGE_SLANT ; - PageResID = RID_SVXPAGE_SLANT ; - Text [ en-US ] = "Slant & Corner Radius" ; - }; - }; - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |