summaryrefslogtreecommitdiff
path: root/sc/source/ui/pagedlg
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/pagedlg')
-rw-r--r--sc/source/ui/pagedlg/areasdlg.cxx908
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.cxx187
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.hrc54
-rw-r--r--sc/source/ui/pagedlg/hfedtdlg.src777
-rw-r--r--sc/source/ui/pagedlg/pagedlg.hrc100
-rw-r--r--sc/source/ui/pagedlg/pagedlg.src409
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx994
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx334
-rw-r--r--sc/source/ui/pagedlg/tphf.src37
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx441
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx570
11 files changed, 0 insertions, 4811 deletions
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
deleted file mode 100644
index 0c5ec961e..000000000
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ /dev/null
@@ -1,908 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sc.hxx"
-
-
-
-//----------------------------------------------------------------------------
-#include <rangelst.hxx>
-
-#include <sfx2/dispatch.hxx>
-#include <svl/stritem.hxx>
-#include <vcl/msgbox.hxx>
-#include <unotools/charclass.hxx>
-#include <stdlib.h>
-
-#define _AREASDLG_CXX
-#include "areasdlg.hxx"
-#undef _AREASDLG_CXX
-
-#include "scresid.hxx"
-#include "rangenam.hxx"
-#include "reffact.hxx"
-#include "tabvwsh.hxx"
-#include "docsh.hxx"
-#include "globstr.hrc"
-#include "pagedlg.hrc"
-#include "compiler.hxx"
-
-// STATIC DATA ---------------------------------------------------------------
-
-// List box positions for print range (PR)
-const sal_uInt16 SC_AREASDLG_PR_NONE = 0;
-const sal_uInt16 SC_AREASDLG_PR_ENTIRE = 1;
-const sal_uInt16 SC_AREASDLG_PR_USER = 2;
-const sal_uInt16 SC_AREASDLG_PR_SELECT = 3;
-const sal_uInt16 SC_AREASDLG_PR_OFFSET = 4;
-
-// List box positions for repeat ranges (RR)
-const sal_uInt16 SC_AREASDLG_RR_NONE = 0;
-const sal_uInt16 SC_AREASDLG_RR_USER = 1;
-const sal_uInt16 SC_AREASDLG_RR_OFFSET = 2;
-
-//============================================================================
-
-using ::rtl::OUString;
-
-#define HDL(hdl) LINK( this, ScPrintAreasDlg, hdl )
-#define ERRORBOX(nId) ErrorBox( this, WinBits(WB_OK|WB_DEF_OK), \
- ScGlobal::GetRscString( nId ) ).Execute()
-#define SWAP(x1,x2) { int n=x1; x1=x2; x2=n; }
-
-// globale Funktionen (->am Ende der Datei):
-
-bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange );
-void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr );
-void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, OUString& rStr )
-{
- String aStr;
- lcl_GetRepeatRangeString(pRange, pDoc, bIsRow, aStr);
- rStr = aStr;
-}
-
-#if 0
-// this method is useful when debugging address flags.
-static void printAddressFlags(sal_uInt16 nFlag)
-{
- if ((nFlag & SCA_COL_ABSOLUTE ) == SCA_COL_ABSOLUTE ) printf("SCA_COL_ABSOLUTE \n");
- if ((nFlag & SCA_ROW_ABSOLUTE ) == SCA_ROW_ABSOLUTE ) printf("SCA_ROW_ABSOLUTE \n");
- if ((nFlag & SCA_TAB_ABSOLUTE ) == SCA_TAB_ABSOLUTE ) printf("SCA_TAB_ABSOLUTE \n");
- if ((nFlag & SCA_TAB_3D ) == SCA_TAB_3D ) printf("SCA_TAB_3D \n");
- if ((nFlag & SCA_COL2_ABSOLUTE ) == SCA_COL2_ABSOLUTE ) printf("SCA_COL2_ABSOLUTE\n");
- if ((nFlag & SCA_ROW2_ABSOLUTE ) == SCA_ROW2_ABSOLUTE ) printf("SCA_ROW2_ABSOLUTE\n");
- if ((nFlag & SCA_TAB2_ABSOLUTE ) == SCA_TAB2_ABSOLUTE ) printf("SCA_TAB2_ABSOLUTE\n");
- if ((nFlag & SCA_TAB2_3D ) == SCA_TAB2_3D ) printf("SCA_TAB2_3D \n");
- if ((nFlag & SCA_VALID_ROW ) == SCA_VALID_ROW ) printf("SCA_VALID_ROW \n");
- if ((nFlag & SCA_VALID_COL ) == SCA_VALID_COL ) printf("SCA_VALID_COL \n");
- if ((nFlag & SCA_VALID_TAB ) == SCA_VALID_TAB ) printf("SCA_VALID_TAB \n");
- if ((nFlag & SCA_FORCE_DOC ) == SCA_FORCE_DOC ) printf("SCA_FORCE_DOC \n");
- if ((nFlag & SCA_VALID_ROW2 ) == SCA_VALID_ROW2 ) printf("SCA_VALID_ROW2 \n");
- if ((nFlag & SCA_VALID_COL2 ) == SCA_VALID_COL2 ) printf("SCA_VALID_COL2 \n");
- if ((nFlag & SCA_VALID_TAB2 ) == SCA_VALID_TAB2 ) printf("SCA_VALID_TAB2 \n");
- if ((nFlag & SCA_VALID ) == SCA_VALID ) printf("SCA_VALID \n");
- if ((nFlag & SCA_ABS ) == SCA_ABS ) printf("SCA_ABS \n");
- if ((nFlag & SCR_ABS ) == SCR_ABS ) printf("SCR_ABS \n");
- if ((nFlag & SCA_ABS_3D ) == SCA_ABS_3D ) printf("SCA_ABS_3D \n");
- if ((nFlag & SCR_ABS_3D ) == SCR_ABS_3D ) printf("SCR_ABS_3D \n");
-}
-#endif
-
-//============================================================================
-// class ScPrintAreasDlg
-
-//----------------------------------------------------------------------------
-
-ScPrintAreasDlg::ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent )
- : ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_AREAS),
- //
- aFlPrintArea ( this, ScResId( FL_PRINTAREA ) ),
- aLbPrintArea ( this, ScResId( LB_PRINTAREA ) ),
- aEdPrintArea ( this, this, ScResId( ED_PRINTAREA ) ),
- aRbPrintArea ( this, ScResId( RB_PRINTAREA ), &aEdPrintArea, this ),
- //
- aFlRepeatRow ( this, ScResId( FL_REPEATROW ) ),
- aLbRepeatRow ( this, ScResId( LB_REPEATROW ) ),
- aEdRepeatRow ( this, this, ScResId( ED_REPEATROW ) ),
- aRbRepeatRow ( this, ScResId( RB_REPEATROW ), &aEdRepeatRow, this ),
- //
- aFlRepeatCol ( this, ScResId( FL_REPEATCOL ) ),
- aLbRepeatCol ( this, ScResId( LB_REPEATCOL ) ),
- aEdRepeatCol ( this, this, ScResId( ED_REPEATCOL ) ),
- aRbRepeatCol ( this, ScResId( RB_REPEATCOL ), &aEdRepeatCol, this ),
- //
- aBtnOk ( this, ScResId( BTN_OK ) ),
- aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
- aBtnHelp ( this, ScResId( BTN_HELP ) ),
- //
- bDlgLostFocus ( false ),
- pRefInputEdit ( &aEdPrintArea ),
- pDoc ( NULL ),
- pViewData ( NULL ),
- nCurTab ( 0 )
-{
- ScTabViewShell* pScViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current() );
- ScDocShell* pScDocSh = PTR_CAST( ScDocShell, SfxObjectShell::Current() );
-
- OSL_ENSURE( pScDocSh, "Current DocumentShell not found :-(" );
-
- pDoc = pScDocSh->GetDocument();
-
- if ( pScViewSh )
- {
- pViewData = pScViewSh->GetViewData();
- nCurTab = pViewData->GetTabNo();
- }
-
- Impl_Reset();
-
- //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
- //SFX_APPWINDOW->Enable();
-
- FreeResource();
-}
-
-
-//----------------------------------------------------------------------------
-
-ScPrintAreasDlg::~ScPrintAreasDlg()
-{
- // Extra-Data an ListBox-Entries abraeumen
- ListBox* pLb[3] = { &aLbPrintArea, &aLbRepeatRow, &aLbRepeatCol };
-
- for ( sal_uInt16 i=0; i<3; i++ )
- {
- sal_uInt16 nCount = pLb[i]->GetEntryCount();
- for ( sal_uInt16 j=0; j<nCount; j++ )
- delete (String*)pLb[i]->GetEntryData(j);
- }
-}
-
-
-//----------------------------------------------------------------------------
-
-sal_Bool ScPrintAreasDlg::Close()
-{
- return DoClose( ScPrintAreasDlgWrapper::GetChildWindowId() );
-}
-
-
-//----------------------------------------------------------------------------
-
-sal_Bool ScPrintAreasDlg::IsTableLocked() const
-{
- // Druckbereiche gelten pro Tabelle, darum macht es keinen Sinn,
- // bei der Eingabe die Tabelle umzuschalten
-
- return sal_True;
-}
-
-
-//----------------------------------------------------------------------------
-
-void ScPrintAreasDlg::SetReference( const ScRange& rRef, ScDocument* /* pDoc */ )
-{
- if ( pRefInputEdit )
- {
- if ( rRef.aStart != rRef.aEnd )
- RefInputStart( pRefInputEdit );
-
- String aStr;
- const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
-
- if ( &aEdPrintArea == pRefInputEdit )
- {
- rRef.Format( aStr, SCR_ABS, pDoc, eConv );
- String aVal = aEdPrintArea.GetText();
- Selection aSel = aEdPrintArea.GetSelection();
- aSel.Justify();
- aVal.Erase( (xub_StrLen)aSel.Min(), (xub_StrLen)aSel.Len() );
- aVal.Insert( aStr, (xub_StrLen)aSel.Min() );
- Selection aNewSel( aSel.Min(), aSel.Min()+aStr.Len() );
- aEdPrintArea.SetRefString( aVal );
- aEdPrintArea.SetSelection( aNewSel );
- }
- else
- {
- sal_Bool bRow = ( &aEdRepeatRow == pRefInputEdit );
- lcl_GetRepeatRangeString(&rRef, pDoc, bRow, aStr);
- pRefInputEdit->SetRefString( aStr );
- }
- }
-
- Impl_ModifyHdl( pRefInputEdit );
-}
-
-
-//----------------------------------------------------------------------------
-
-void ScPrintAreasDlg::AddRefEntry()
-{
- if ( pRefInputEdit == &aEdPrintArea )
- {
- const sal_Unicode sep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
- String aVal = aEdPrintArea.GetText();
- aVal += sep;
- aEdPrintArea.SetText(aVal);
-
- xub_StrLen nLen = aVal.Len();
- aEdPrintArea.SetSelection( Selection( nLen, nLen ) );
-
- Impl_ModifyHdl( &aEdPrintArea );
- }
-}
-
-
-//----------------------------------------------------------------------------
-
-void ScPrintAreasDlg::Deactivate()
-{
- bDlgLostFocus = sal_True;
-}
-
-
-//----------------------------------------------------------------------------
-
-void ScPrintAreasDlg::SetActive()
-{
- if ( bDlgLostFocus )
- {
- bDlgLostFocus = false;
-
- if ( pRefInputEdit )
- {
- pRefInputEdit->GrabFocus();
- Impl_ModifyHdl( pRefInputEdit );
- }
- }
- else
- GrabFocus();
-
- RefInputDone();
-}
-
-
-//----------------------------------------------------------------------------
-
-void ScPrintAreasDlg::Impl_Reset()
-{
- String aStrRange;
- const ScRange* pRepeatColRange = pDoc->GetRepeatColRange( nCurTab );
- const ScRange* pRepeatRowRange = pDoc->GetRepeatRowRange( nCurTab );
-
- aEdPrintArea.SetModifyHdl ( HDL(Impl_ModifyHdl) );
- aEdRepeatRow.SetModifyHdl ( HDL(Impl_ModifyHdl) );
- aEdRepeatCol.SetModifyHdl ( HDL(Impl_ModifyHdl) );
- aEdPrintArea.SetGetFocusHdl( HDL(Impl_GetFocusHdl) );
- aEdRepeatRow.SetGetFocusHdl( HDL(Impl_GetFocusHdl) );
- aEdRepeatCol.SetGetFocusHdl( HDL(Impl_GetFocusHdl) );
- aLbPrintArea.SetGetFocusHdl( HDL(Impl_GetFocusHdl) );
- aLbRepeatRow.SetGetFocusHdl( HDL(Impl_GetFocusHdl) );
- aLbRepeatCol.SetGetFocusHdl( HDL(Impl_GetFocusHdl) );
- aLbPrintArea.SetSelectHdl ( HDL(Impl_SelectHdl) );
- aLbRepeatRow.SetSelectHdl ( HDL(Impl_SelectHdl) );
- aLbRepeatCol.SetSelectHdl ( HDL(Impl_SelectHdl) );
- aBtnOk .SetClickHdl ( HDL(Impl_BtnHdl) );
- aBtnCancel .SetClickHdl ( HDL(Impl_BtnHdl) );
-
- Impl_FillLists();
-
- //-------------------------
- // Druckbereich
- //-------------------------
- aStrRange.Erase();
- String aOne;
- const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- const sal_Unicode sep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
- sal_uInt16 nRangeCount = pDoc->GetPrintRangeCount( nCurTab );
- for (sal_uInt16 i=0; i<nRangeCount; i++)
- {
- const ScRange* pPrintRange = pDoc->GetPrintRange( nCurTab, i );
- if (pPrintRange)
- {
- if ( aStrRange.Len() )
- aStrRange += sep;
- pPrintRange->Format( aOne, SCR_ABS, pDoc, eConv );
- aStrRange += aOne;
- }
- }
- aEdPrintArea.SetText( aStrRange );
-
- //-------------------------------
- // Wiederholungszeile
- //-------------------------------
- lcl_GetRepeatRangeString(pRepeatRowRange, pDoc, true, aStrRange);
- aEdRepeatRow.SetText( aStrRange );
-
- //--------------------------------
- // Wiederholungsspalte
- //--------------------------------
- lcl_GetRepeatRangeString(pRepeatColRange, pDoc, false, aStrRange);
- aEdRepeatCol.SetText( aStrRange );
-
- Impl_ModifyHdl( &aEdPrintArea );
- Impl_ModifyHdl( &aEdRepeatRow );
- Impl_ModifyHdl( &aEdRepeatCol );
- if( pDoc->IsPrintEntireSheet( nCurTab ) )
- aLbPrintArea.SelectEntryPos( SC_AREASDLG_PR_ENTIRE );
-
- aEdPrintArea.SaveValue(); // fuer FillItemSet() merken:
- aEdRepeatRow.SaveValue();
- aEdRepeatCol.SaveValue();
-}
-
-
-//----------------------------------------------------------------------------
-
-sal_Bool ScPrintAreasDlg::Impl_GetItem( Edit* pEd, SfxStringItem& rItem )
-{
- String aRangeStr = pEd->GetText();
- sal_Bool bDataChanged = (pEd->GetSavedValue() != aRangeStr);
-
- if ( (aRangeStr.Len() > 0) && &aEdPrintArea != pEd )
- {
- ScRange aRange;
- const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- lcl_CheckRepeatString(aRangeStr, pDoc, &aEdRepeatRow == pEd, &aRange);
- aRange.Format(aRangeStr, SCR_ABS, pDoc, eConv);
- }
-
- rItem.SetValue( aRangeStr );
-
- return bDataChanged;
-}
-
-
-//----------------------------------------------------------------------------
-
-sal_Bool ScPrintAreasDlg::Impl_CheckRefStrings()
-{
- sal_Bool bOk = false;
- String aStrPrintArea = aEdPrintArea.GetText();
- String aStrRepeatRow = aEdRepeatRow.GetText();
- String aStrRepeatCol = aEdRepeatCol.GetText();
-
- sal_Bool bPrintAreaOk = sal_True;
- if ( aStrPrintArea.Len() )
- {
- const sal_uInt16 nValidAddr = SCA_VALID | SCA_VALID_ROW | SCA_VALID_COL;
- const sal_uInt16 nValidRange = nValidAddr | SCA_VALID_ROW2 | SCA_VALID_COL2;
- const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- const sal_Unicode sep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
-
- ScAddress aAddr;
- ScRange aRange;
- xub_StrLen nSepCount = aStrPrintArea.GetTokenCount(sep);
- for ( xub_StrLen i = 0; i < nSepCount && bPrintAreaOk; ++i )
- {
- String aOne = aStrPrintArea.GetToken(i, sep);
- sal_uInt16 nResult = aRange.Parse( aOne, pDoc, eConv );
- if ((nResult & nValidRange) != nValidRange)
- {
- sal_uInt16 nAddrResult = aAddr.Parse( aOne, pDoc, eConv );
- if ((nAddrResult & nValidAddr) != nValidAddr)
- bPrintAreaOk = false;
- }
- }
- }
-
- sal_Bool bRepeatRowOk = (aStrRepeatRow.Len() == 0);
- if ( !bRepeatRowOk )
- bRepeatRowOk = lcl_CheckRepeatString(aStrRepeatRow, pDoc, true, NULL);
-
- sal_Bool bRepeatColOk = (aStrRepeatCol.Len() == 0);
- if ( !bRepeatColOk )
- bRepeatColOk = lcl_CheckRepeatString(aStrRepeatCol, pDoc, false, NULL);
-
- // Fehlermeldungen
-
- bOk = (bPrintAreaOk && bRepeatRowOk && bRepeatColOk);
-
- if ( !bOk )
- {
- Edit* pEd = NULL;
-
- if ( !bPrintAreaOk ) pEd = &aEdPrintArea;
- else if ( !bRepeatRowOk ) pEd = &aEdRepeatRow;
- else if ( !bRepeatColOk ) pEd = &aEdRepeatCol;
-
- ERRORBOX( STR_INVALID_TABREF );
-
- OSL_ASSERT(pEd);
-
- if (pEd)
- pEd->GrabFocus();
- }
-
- return bOk;
-}
-
-
-//----------------------------------------------------------------------------
-
-void ScPrintAreasDlg::Impl_FillLists()
-{
- //------------------------------------------------------
- // Selektion holen und String in PrintArea-ListBox merken
- //------------------------------------------------------
- ScRange aRange;
- String aStrRange;
- sal_Bool bSimple = sal_True;
-
- if ( pViewData )
- bSimple = (pViewData->GetSimpleArea( aRange ) == SC_MARK_SIMPLE);
-
- formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
-
- if ( bSimple )
- aRange.Format( aStrRange, SCR_ABS, pDoc, eConv );
- else
- {
- ScRangeListRef aList( new ScRangeList );
- pViewData->GetMarkData().FillRangeListWithMarks( aList, false );
- aList->Format( aStrRange, SCR_ABS, pDoc, eConv );
- }
-
- aLbPrintArea.SetEntryData( SC_AREASDLG_PR_SELECT, new String( aStrRange ) );
-
- //------------------------------------------------------
- // Ranges holen und in ListBoxen merken
- //------------------------------------------------------
- ScRangeName* pRangeNames = pDoc->GetRangeName();
-
- if (!pRangeNames || pRangeNames->empty())
- // No range names to process.
- return;
-
- ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = pRangeNames->end();
- for (; itr != itrEnd; ++itr)
- {
- if (!itr->HasType(RT_ABSAREA) && !itr->HasType(RT_REFAREA) && !itr->HasType(RT_ABSPOS))
- continue;
-
- OUString aName = itr->GetName();
- OUString aSymbol;
- itr->GetSymbol(aSymbol);
- if (aRange.ParseAny(aSymbol, pDoc, eConv) & SCA_VALID)
- {
- if (itr->HasType(RT_PRINTAREA))
- {
- aRange.Format(aSymbol, SCR_ABS, pDoc, eConv);
- aLbPrintArea.SetEntryData(
- aLbPrintArea.InsertEntry(aName),
- new String(aSymbol) );
- }
-
- if (itr->HasType(RT_ROWHEADER))
- {
- lcl_GetRepeatRangeString(&aRange, pDoc, true, aSymbol);
- aLbRepeatRow.SetEntryData(
- aLbRepeatRow.InsertEntry(aName),
- new String(aSymbol) );
- }
-
- if (itr->HasType(RT_COLHEADER))
- {
- lcl_GetRepeatRangeString(&aRange, pDoc, false, aSymbol);
- aLbRepeatCol.SetEntryData(
- aLbRepeatCol.InsertEntry(aName),
- new String(aSymbol));
- }
- }
- }
-}
-
-
-//----------------------------------------------------------------------------
-// Handler:
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScPrintAreasDlg, Impl_BtnHdl, PushButton*, pBtn )
-{
- if ( &aBtnOk == pBtn )
- {
- if ( Impl_CheckRefStrings() )
- {
- sal_Bool bDataChanged = false;
- String aStr;
- SfxStringItem aPrintArea( SID_CHANGE_PRINTAREA, aStr );
- SfxStringItem aRepeatRow( FN_PARAM_2, aStr );
- SfxStringItem aRepeatCol( FN_PARAM_3, aStr );
-
- //-------------------------
- // Druckbereich veraendert?
- //-------------------------
-
- // first try the list box, if "Entite sheet" is selected
- sal_Bool bEntireSheet = (aLbPrintArea.GetSelectEntryPos() == SC_AREASDLG_PR_ENTIRE);
- SfxBoolItem aEntireSheet( FN_PARAM_4, bEntireSheet );
-
- bDataChanged = bEntireSheet != pDoc->IsPrintEntireSheet( nCurTab );
- if( !bEntireSheet )
- {
- // if new list box selection is not "Entire sheet", get the edit field contents
- bDataChanged |= Impl_GetItem( &aEdPrintArea, aPrintArea );
- }
-
- //-------------------------------
- // Wiederholungszeile veraendert?
- //-------------------------------
- bDataChanged |= Impl_GetItem( &aEdRepeatRow, aRepeatRow );
-
- //--------------------------------
- // Wiederholungsspalte veraendert?
- //--------------------------------
- bDataChanged |= Impl_GetItem( &aEdRepeatCol, aRepeatCol );
-
- if ( bDataChanged )
- {
- SetDispatcherLock( false );
- SwitchToDocument();
- GetBindings().GetDispatcher()->Execute( SID_CHANGE_PRINTAREA,
- SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD,
- &aPrintArea, &aRepeatRow, &aRepeatCol, &aEntireSheet, 0L );
- }
-
- Close();
- }
- }
- else if ( &aBtnCancel == pBtn )
- Close();
-
- return 0;
-}
-
-
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScPrintAreasDlg, Impl_GetFocusHdl, Control*, pCtr )
-{
- if ( pCtr ==(Control *) &aEdPrintArea ||
- pCtr ==(Control *) &aEdRepeatRow ||
- pCtr ==(Control *) &aEdRepeatCol)
- {
- pRefInputEdit = (formula::RefEdit*) pCtr;
- }
- else if ( pCtr ==(Control *) &aLbPrintArea)
- {
- pRefInputEdit = &aEdPrintArea;
- }
- else if ( pCtr ==(Control *) &aLbRepeatRow)
- {
- pRefInputEdit = &aEdRepeatRow;
- }
- else if ( pCtr ==(Control *) &aLbRepeatCol)
- {
- pRefInputEdit = &aEdRepeatCol;
- }
-
- return 0;
-}
-
-
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScPrintAreasDlg, Impl_SelectHdl, ListBox*, pLb )
-{
- sal_uInt16 nSelPos = pLb->GetSelectEntryPos();
- Edit* pEd = NULL;
-
- // list box positions of specific entries, default to "repeat row/column" list boxes
- sal_uInt16 nAllSheetPos = SC_AREASDLG_RR_NONE;
- sal_uInt16 nUserDefPos = SC_AREASDLG_RR_USER;
- sal_uInt16 nFirstCustomPos = SC_AREASDLG_RR_OFFSET;
-
- // find edit field for list box, and list box positions
- if( pLb == &aLbPrintArea )
- {
- pEd = &aEdPrintArea;
- nAllSheetPos = SC_AREASDLG_PR_ENTIRE;
- nUserDefPos = SC_AREASDLG_PR_USER;
- nFirstCustomPos = SC_AREASDLG_PR_SELECT; // "Selection" and following
- }
- else if( pLb == &aLbRepeatCol )
- pEd = &aEdRepeatCol;
- else if( pLb == &aLbRepeatRow )
- pEd = &aEdRepeatRow;
- else
- return 0;
-
- // fill edit field according to list box selection
- if( (nSelPos == 0) || (nSelPos == nAllSheetPos) )
- pEd->SetText( EMPTY_STRING );
- else if( nSelPos == nUserDefPos && !pLb->IsTravelSelect() && pEd->GetText().Len() == 0 )
- pLb->SelectEntryPos( 0 );
- else if( nSelPos >= nFirstCustomPos )
- pEd->SetText( *static_cast< String* >( pLb->GetEntryData( nSelPos ) ) );
-
- return 0;
-}
-
-
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScPrintAreasDlg, Impl_ModifyHdl, formula::RefEdit*, pEd )
-{
- ListBox* pLb = NULL;
-
- // list box positions of specific entries, default to "repeat row/column" list boxes
- sal_uInt16 nUserDefPos = SC_AREASDLG_RR_USER;
- sal_uInt16 nFirstCustomPos = SC_AREASDLG_RR_OFFSET;
-
- if( pEd == &aEdPrintArea )
- {
- pLb = &aLbPrintArea;
- nUserDefPos = SC_AREASDLG_PR_USER;
- nFirstCustomPos = SC_AREASDLG_PR_SELECT; // "Selection" and following
- }
- else if( pEd == &aEdRepeatCol )
- pLb = &aLbRepeatCol;
- else if( pEd == &aEdRepeatRow )
- pLb = &aLbRepeatRow;
- else
- return 0;
-
- // set list box selection according to edit field
- sal_uInt16 nEntryCount = pLb->GetEntryCount();
- String aStrEd( pEd->GetText() );
- String aEdUpper = aStrEd;
- aEdUpper.ToUpperAscii();
-
- if ( (nEntryCount > nFirstCustomPos) && aStrEd.Len() > 0 )
- {
- sal_Bool bFound = false;
- String* pSymbol = NULL;
- sal_uInt16 i;
-
- for ( i=nFirstCustomPos; i<nEntryCount && !bFound; i++ )
- {
- pSymbol = (String*)pLb->GetEntryData( i );
- bFound = ( (*pSymbol == aStrEd) || (*pSymbol == aEdUpper) );
- }
-
- pLb->SelectEntryPos( bFound ? i-1 : nUserDefPos );
- }
- else
- pLb->SelectEntryPos( aStrEd.Len() ? nUserDefPos : 0 );
-
- return 0;
-}
-
-
-//============================================================================
-// globale Funktionen:
-
-// ----------------------------------------------------------------------------
-
-// TODO: It might make sense to move these functions to address.?xx. -kohei
-
-bool lcl_CheckOne_OOO( const String& rStr, bool bIsRow, SCCOLROW& rVal )
-{
- // Zulaessige Syntax fuer rStr:
- // Row: [$]1-MAXTAB
- // Col: [$]A-IV
-
- String aStr = rStr;
- xub_StrLen nLen = aStr.Len();
- SCCOLROW nNum = 0;
- sal_Bool bStrOk = ( nLen > 0 ) && ( bIsRow ? ( nLen < 6 ) : ( nLen < 4 ) );
-
- if ( bStrOk )
- {
- if ( '$' == aStr.GetChar(0) )
- aStr.Erase( 0, 1 );
-
- if ( bIsRow )
- {
- bStrOk = CharClass::isAsciiNumeric(aStr);
-
- if ( bStrOk )
- {
- sal_Int32 n = aStr.ToInt32();
-
- if ( ( bStrOk = (n > 0) && ( n <= MAXROWCOUNT ) ) != false )
- nNum = static_cast<SCCOLROW>(n - 1);
- }
- }
- else
- {
- SCCOL nCol = 0;
- bStrOk = ::AlphaToCol( nCol, aStr);
- nNum = nCol;
- }
- }
-
- if ( bStrOk )
- rVal = nNum;
-
- return bStrOk;
-}
-
-bool lcl_CheckOne_XL_A1( const String& rStr, bool bIsRow, SCCOLROW& rVal )
-{
- // XL A1 style is identical to OOO one for print range formats.
- return lcl_CheckOne_OOO(rStr, bIsRow, rVal);
-}
-
-bool lcl_CheckOne_XL_R1C1( const String& rStr, bool bIsRow, SCCOLROW& rVal )
-{
- xub_StrLen nLen = rStr.Len();
- if (nLen <= 1)
- // There must be at least two characters.
- return false;
-
- const sal_Unicode preUpper = bIsRow ? 'R' : 'C';
- const sal_Unicode preLower = bIsRow ? 'r' : 'c';
- if (rStr.GetChar(0) != preUpper && rStr.GetChar(0) != preLower)
- return false;
-
- String aNumStr = rStr.Copy(1);
- if (!CharClass::isAsciiNumeric(aNumStr))
- return false;
-
- sal_Int32 nNum = aNumStr.ToInt32();
-
- if (nNum <= 0)
- return false;
-
- if ((bIsRow && nNum > MAXROWCOUNT) || (!bIsRow && nNum > MAXCOLCOUNT))
- return false;
-
- rVal = static_cast<SCCOLROW>(nNum-1);
- return true;
-}
-
-bool lcl_CheckRepeatOne( const String& rStr, formula::FormulaGrammar::AddressConvention eConv, bool bIsRow, SCCOLROW& rVal )
-{
- switch (eConv)
- {
- case formula::FormulaGrammar::CONV_OOO:
- return lcl_CheckOne_OOO(rStr, bIsRow, rVal);
- case formula::FormulaGrammar::CONV_XL_A1:
- return lcl_CheckOne_XL_A1(rStr, bIsRow, rVal);
- case formula::FormulaGrammar::CONV_XL_R1C1:
- return lcl_CheckOne_XL_R1C1(rStr, bIsRow, rVal);
- default:
- {
- // added to avoid warnings
- }
- }
- return false;
-}
-
-bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange )
-{
- // Row: [valid row] rsep [valid row]
- // Col: [valid col] rsep [valid col]
-
- const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- const sal_Unicode rsep = ScCompiler::GetNativeSymbol(ocRange).GetChar(0);
-
- if (pRange)
- {
- // initialize the range value.
- pRange->aStart.SetCol(0);
- pRange->aStart.SetRow(0);
- pRange->aEnd.SetCol(0);
- pRange->aEnd.SetRow(0);
- }
-
- String aBuf;
- SCCOLROW nVal = 0;
- xub_StrLen nLen = rStr.Len();
- bool bEndPos = false;
- for (xub_StrLen i = 0; i < nLen; ++i)
- {
- const sal_Unicode c = rStr.GetChar(i);
- if (c == rsep)
- {
- if (bEndPos)
- // We aren't supposed to have more than one range separator.
- return false;
-
- // range separator
- if (aBuf.Len() == 0)
- return false;
-
- bool bRes = lcl_CheckRepeatOne(aBuf, eConv, bIsRow, nVal);
- if (!bRes)
- return false;
-
- if (pRange)
- {
- if (bIsRow)
- {
- pRange->aStart.SetRow(static_cast<SCROW>(nVal));
- pRange->aEnd.SetRow(static_cast<SCROW>(nVal));
- }
- else
- {
- pRange->aStart.SetCol(static_cast<SCCOL>(nVal));
- pRange->aEnd.SetCol(static_cast<SCCOL>(nVal));
- }
- }
-
- aBuf.Erase();
- bEndPos = true;
- }
- else
- aBuf.Append(c);
- }
-
- if (aBuf.Len() > 0)
- {
- bool bRes = lcl_CheckRepeatOne(aBuf, eConv, bIsRow, nVal);
- if (!bRes)
- return false;
-
- if (pRange)
- {
- if (bIsRow)
- {
- if (!bEndPos)
- pRange->aStart.SetRow(static_cast<SCROW>(nVal));
- pRange->aEnd.SetRow(static_cast<SCROW>(nVal));
- }
- else
- {
- if (!bEndPos)
- pRange->aStart.SetCol(static_cast<SCCOL>(nVal));
- pRange->aEnd.SetCol(static_cast<SCCOL>(nVal));
- }
- }
- }
-
- return true;
-}
-
-// ----------------------------------------------------------------------------
-
-void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr )
-{
- rStr.Erase();
- if (!pRange)
- return;
-
- const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- const ScAddress& rStart = pRange->aStart;
- const ScAddress& rEnd = pRange->aEnd;
-
- const sal_uInt16 nFmt = bIsRow ? (SCA_VALID_ROW | SCA_ROW_ABSOLUTE) : (SCA_VALID_COL | SCA_COL_ABSOLUTE);
- String aTmpStr;
- rStart.Format(aTmpStr, nFmt, pDoc, eConv);
- rStr += aTmpStr;
- if ((bIsRow && rStart.Row() != rEnd.Row()) || (!bIsRow && rStart.Col() != rEnd.Col()))
- {
- rStr += ScCompiler::GetNativeSymbol(ocRange);
- rEnd.Format(aTmpStr, nFmt, pDoc, eConv);
- rStr += aTmpStr;
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx
deleted file mode 100644
index b9cec500b..000000000
--- a/sc/source/ui/pagedlg/hfedtdlg.cxx
+++ /dev/null
@@ -1,187 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sc.hxx"
-
-#undef SC_DLLIMPLEMENTATION
-
-
-
-//------------------------------------------------------------------
-
-#include "scitems.hxx"
-#include <svl/eitem.hxx>
-
-#include "hfedtdlg.hxx"
-#include "global.hxx"
-#include "globstr.hrc"
-#include "scresid.hxx"
-#include "hfedtdlg.hrc"
-#include "scuitphfedit.hxx"
-//------------------------------------------------------------------
-
-// macros from docsh4.cxx
-//! use SIDs?
-
-#define IS_SHARE_HEADER(set) \
- ((SfxBoolItem&) \
- ((SvxSetItem&)(set).Get(ATTR_PAGE_HEADERSET)).GetItemSet(). \
- Get(ATTR_PAGE_SHARED)).GetValue()
-
-#define IS_SHARE_FOOTER(set) \
- ((SfxBoolItem&) \
- ((SvxSetItem&)(set).Get(ATTR_PAGE_FOOTERSET)).GetItemSet(). \
- Get(ATTR_PAGE_SHARED)).GetValue()
-
-//==================================================================
-
-ScHFEditDlg::ScHFEditDlg( SfxViewFrame* pFrameP,
- Window* pParent,
- const SfxItemSet& rCoreSet,
- const String& rPageStyle,
- sal_uInt16 nResIdP )
- : SfxTabDialog( pFrameP, pParent, ScResId( nResIdP ), &rCoreSet )
-{
- eNumType = ((const SvxPageItem&)rCoreSet.Get(ATTR_PAGE)).GetNumType();
-
- String aTmp = GetText();
-
- aTmp.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " (" ));
- aTmp += ScGlobal::GetRscString( STR_PAGESTYLE );
- aTmp.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
- aTmp += rPageStyle;
- aTmp += ')';
- SetText( aTmp );
-
- switch ( nResIdP )
- {
- case RID_SCDLG_HFED_HEADER:
- case RID_SCDLG_HFEDIT_HEADER:
- AddTabPage( 1, ScRightHeaderEditPage::Create, NULL );
- AddTabPage( 2, ScLeftHeaderEditPage::Create, NULL );
- break;
-
- case RID_SCDLG_HFED_FOOTER:
- case RID_SCDLG_HFEDIT_FOOTER:
- AddTabPage( 1, ScRightFooterEditPage::Create, NULL );
- AddTabPage( 2, ScLeftFooterEditPage::Create, NULL );
- break;
-
- case RID_SCDLG_HFEDIT_LEFTHEADER:
- AddTabPage( 1, ScLeftHeaderEditPage::Create, NULL );
- break;
-
- case RID_SCDLG_HFEDIT_RIGHTHEADER:
- AddTabPage( 1, ScRightHeaderEditPage::Create, NULL );
- break;
-
- case RID_SCDLG_HFEDIT_LEFTFOOTER:
- AddTabPage( 1, ScLeftFooterEditPage::Create, NULL );
- break;
-
- case RID_SCDLG_HFEDIT_RIGHTFOOTER:
- AddTabPage( 1, ScRightFooterEditPage::Create, NULL );
- break;
-
- case RID_SCDLG_HFEDIT_SHDR:
- AddTabPage( 1, ScRightHeaderEditPage::Create, NULL );
- AddTabPage( 2, ScRightFooterEditPage::Create, NULL );
- AddTabPage( 3, ScLeftFooterEditPage::Create, NULL );
- break;
-
- case RID_SCDLG_HFEDIT_SFTR:
- AddTabPage( 1, ScRightHeaderEditPage::Create, NULL );
- AddTabPage( 2, ScLeftHeaderEditPage::Create, NULL );
- AddTabPage( 3, ScRightFooterEditPage::Create, NULL );
- break;
-
- case RID_SCDLG_HFEDIT_ALL:
- AddTabPage( 1, ScRightHeaderEditPage::Create, NULL );
- AddTabPage( 2, ScLeftHeaderEditPage::Create, NULL );
- AddTabPage( 3, ScRightFooterEditPage::Create, NULL );
- AddTabPage( 4, ScLeftFooterEditPage::Create, NULL );
- break;
-
- default:
- case RID_SCDLG_HFEDIT:
- {
- const SvxPageItem& rPageItem = (const SvxPageItem&)
- rCoreSet.Get(
- rCoreSet.GetPool()->GetWhich(SID_ATTR_PAGE) );
-
- sal_Bool bRightPage = ( SVX_PAGE_LEFT !=
- SvxPageUsage(rPageItem.GetPageUsage()) );
-
- if ( bRightPage )
- {
- AddTabPage( 1, ScRightHeaderEditPage::Create, NULL );
- AddTabPage( 2, ScRightFooterEditPage::Create, NULL );
- }
- else
- {
- // #69193a# respect "shared" setting
-
- sal_Bool bShareHeader = IS_SHARE_HEADER(rCoreSet);
- if ( bShareHeader )
- AddTabPage( 1, ScRightHeaderEditPage::Create, NULL );
- else
- AddTabPage( 1, ScLeftHeaderEditPage::Create, NULL );
-
- sal_Bool bShareFooter = IS_SHARE_FOOTER(rCoreSet);
- if ( bShareFooter )
- AddTabPage( 2, ScRightFooterEditPage::Create, NULL );
- else
- AddTabPage( 2, ScLeftFooterEditPage::Create, NULL );
- }
- }
- break;
- }
-
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-ScHFEditDlg::~ScHFEditDlg()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void ScHFEditDlg::PageCreated( sal_uInt16 /* nId */, SfxTabPage& rPage )
-{
- // kann ja nur ne ScHFEditPage sein...
-
- ((ScHFEditPage&)rPage).SetNumType(eNumType);
-}
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/hfedtdlg.hrc b/sc/source/ui/pagedlg/hfedtdlg.hrc
deleted file mode 100644
index e5b4b53a6..000000000
--- a/sc/source/ui/pagedlg/hfedtdlg.hrc
+++ /dev/null
@@ -1,54 +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 "sc.hrc"
-
-#define FT_LEFT 1
-#define FT_CENTER 2
-#define FT_RIGHT 3
-#define FT_INFO 4
-#define WND_LEFT 1
-#define WND_CENTER 2
-#define WND_RIGHT 3
-#define BTN_TEXT 1
-#define BTN_PAGE 2
-#define BTN_PAGES 3
-#define BTN_DATE 4
-#define BTN_TIME 5
-#define BTN_FILE 6
-#define BTN_TABLE 7
-
-#define RID_POPUP_FCOMMAND 10
-#define FILE_COMMAND_TITEL 11
-#define FILE_COMMAND_FILENAME 12
-#define FILE_COMMAND_PATH 13
-
-#define FL_INFO 14
-
-#define FT_HF_DEFINED 28
-#define LB_DEFINED 29
-#define FT_HF_CUSTOM 30
diff --git a/sc/source/ui/pagedlg/hfedtdlg.src b/sc/source/ui/pagedlg/hfedtdlg.src
deleted file mode 100644
index d2bd85929..000000000
--- a/sc/source/ui/pagedlg/hfedtdlg.src
+++ /dev/null
@@ -1,777 +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.
- *
- ************************************************************************/
-/* StarView ressource file */
-#include "hfedtdlg.hrc"
-#define HFEDIT_DLGTITLE \
- Text [ en-US ] = "Headers/Footers" ; \
-
-#define HEADER \
- Text [ en-US ] = "Header" ; \
-
-#define FOOTER \
- Text [ en-US ] = "Footer" ; \
-
-#define HEADER_RIGHT \
- Text [ en-US ] = "Header (right)" ; \
-
-#define HEADER_LEFT \
- Text [ en-US ] = "Header (left)" ; \
-
-#define FOOTER_RIGHT \
- Text [ en-US ] = "Footer (right)" ; \
-
-#define FOOTER_LEFT \
- Text [ en-US ] = "Footer (left)" ; \
-
- //------------------------------------------------------------------------
- // Bearbeiten vom Seitendialog aus aufgerufen
- //------------------------------------------------------------------------
-TabDialog RID_SCDLG_HFED_HEADER
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Text [ en-US ] = "Headers" ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- HEADER_RIGHT
- PageResID = RID_SCPAGE_HFED_HR ;
- };
- PageItem
- {
- Identifier = 2 ;
- HEADER_LEFT
- PageResID = RID_SCPAGE_HFED_HL ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFED_FOOTER
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Text [ en-US ] = "Footers" ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- FOOTER_RIGHT
- PageResID = RID_SCPAGE_HFED_FR ;
- };
- PageItem
- {
- Identifier = 2 ;
- FOOTER_LEFT
- PageResID = RID_SCPAGE_HFED_FL ;
- };
- };
- };
-};
-
- //------------------------------------------------------------------------
- // Bearbeiten/Kopf-Fusszeile:
- //------------------------------------------------------------------------
-TabDialog RID_SCDLG_HFEDIT_ALL
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- HEADER_RIGHT
- PageResID = RID_SCPAGE_HFED_HR ;
- };
- PageItem
- {
- Identifier = 2 ;
- HEADER_LEFT
- PageResID = RID_SCPAGE_HFED_HL ;
- };
- PageItem
- {
- Identifier = 3 ;
- FOOTER_RIGHT
- PageResID = RID_SCPAGE_HFED_FR ;
- };
- PageItem
- {
- Identifier = 4 ;
- FOOTER_LEFT
- PageResID = RID_SCPAGE_HFED_FL ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFEDIT_SHDR
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- HEADER
- PageResID = RID_SCPAGE_HFED_HR ;
- };
- PageItem
- {
- Identifier = 2 ;
- FOOTER_RIGHT
- PageResID = RID_SCPAGE_HFED_FR ;
- };
- PageItem
- {
- Identifier = 3 ;
- FOOTER_LEFT
- PageResID = RID_SCPAGE_HFED_FL ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFEDIT_SFTR
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- HEADER_RIGHT
- PageResID = RID_SCPAGE_HFED_HR ;
- };
- PageItem
- {
- Identifier = 2 ;
- HEADER_LEFT
- PageResID = RID_SCPAGE_HFED_HL ;
- };
- PageItem
- {
- Identifier = 3 ;
- FOOTER
- PageResID = RID_SCPAGE_HFED_FR ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFEDIT
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- HEADER
- PageResID = RID_SCPAGE_HFED_HR ;
- };
- PageItem
- {
- Identifier = 2 ;
- FOOTER
- PageResID = RID_SCPAGE_HFED_FR ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFEDIT_HEADER
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- HEADER_RIGHT
- PageResID = RID_SCPAGE_HFED_HR ;
- };
- PageItem
- {
- Identifier = 2 ;
- HEADER_LEFT
- PageResID = RID_SCPAGE_HFED_HL ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFEDIT_FOOTER
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- FOOTER_RIGHT
- PageResID = RID_SCPAGE_HFED_FR ;
- };
- PageItem
- {
- Identifier = 2 ;
- FOOTER_LEFT
- PageResID = RID_SCPAGE_HFED_FL ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFEDIT_RIGHTHEADER
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- HEADER_RIGHT
- PageResID = RID_SCPAGE_HFED_HR ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFEDIT_LEFTHEADER
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- HEADER_LEFT
- PageResID = RID_SCPAGE_HFED_HL ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFEDIT_RIGHTFOOTER
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- FOOTER_RIGHT
- PageResID = RID_SCPAGE_HFED_FR ;
- };
- };
- };
-};
-
-TabDialog RID_SCDLG_HFEDIT_LEFTFOOTER
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 270 , 140 ) ;
- Moveable = TRUE ;
- // Closeable = TRUE;
- HFEDIT_DLGTITLE
- TabControl 1
- {
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = 1 ;
- FOOTER_LEFT
- PageResID = RID_SCPAGE_HFED_FL ;
- };
- };
- };
-};
-
- //------------------------------------------------------------------------
- // ScTpHFEdit
- //------------------------------------------------------------------------
-TabPage RID_HFBASE
-{
- Hide = TRUE ;
- HelpId = HID_SCPAGE_HFEDIT ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- FixedText FT_LEFT
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "~Left area" ;
- };
- FixedText FT_CENTER
- {
- Pos = MAP_APPFONT ( 90 , 6 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "~Center area" ;
- };
- FixedText FT_RIGHT
- {
- Pos = MAP_APPFONT ( 174 , 6 ) ;
- Size = MAP_APPFONT ( 75 , 10 ) ;
- Text [ en-US ] = "R~ight area" ;
- };
- FixedText FT_HF_DEFINED
- {
- Pos = MAP_APPFONT ( 12 , 102 ) ;
- Size = MAP_APPFONT ( 76 , 10 ) ;
- Text [ en-US ] = "Hea~der" ;
- };
-
- FixedText FT_HF_CUSTOM
- {
- Pos = MAP_APPFONT ( 12 , 124 ) ;
- Size = MAP_APPFONT ( 76 , 10 ) ;
- Text [ en-US ] = "Custom header" ;
- };
-
- ImageButton BTN_TEXT
- {
- HelpId = HID_SC_HF_TEXT ;
- Pos = MAP_APPFONT ( 90 , 122 ) ;
- Size = MAP_APPFONT ( 15 , 15 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Text Attributes" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "text.png" ; };
- MaskColor = STD_MASKCOLOR ;
- };
- };
-
- ImageButton BTN_FILE
- {
- HelpId = HID_SC_HF_FILE ;
- Pos = MAP_APPFONT ( 113 , 122 ) ;
- Size = MAP_APPFONT ( 15 , 15 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Title" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "file.png" ; };
- MaskColor = STD_MASKCOLOR ;
- };
- };
-
- Menu RID_POPUP_FCOMMAND
- {
- ItemList =
- {
- MenuItem
- {
- Identifier = FILE_COMMAND_TITEL ;
- HelpID = HID_FCOMMAND_TITEL ;
- Text [ en-US ] = "Title";
- };
- MenuItem
- {
- Identifier = FILE_COMMAND_FILENAME;
- HelpID = HID_FCOMMAND_FILENAME;
- RadioCheck = TRUE ;
- Text [ en-US ] = "File Name";
- };
- MenuItem
- {
- Identifier = FILE_COMMAND_PATH;
- HelpID = HID_FCOMMAND_PATH;
- RadioCheck = TRUE ;
- Text [ en-US ] = "Path/File Name";
- };
- };
- };
-
- ImageButton BTN_TABLE
- {
- HelpId = HID_SC_HF_TABLE ;
- Pos = MAP_APPFONT ( 130 , 122 ) ;
- Size = MAP_APPFONT ( 15 , 15 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Sheet Name" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "table.png" ; };
- MaskColor = STD_MASKCOLOR;
- };
- };
-
- ImageButton BTN_PAGE
- {
- HelpId = HID_SC_HF_PAGE ;
- Pos = MAP_APPFONT ( 150 , 122 ) ;
- Size = MAP_APPFONT ( 15 , 15 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Page" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "page.png" ; };
- MaskColor = STD_MASKCOLOR ;
- };
- };
-
- ImageButton BTN_PAGES
- {
- HelpId = HID_SC_HF_PAGES ;
- Pos = MAP_APPFONT ( 167 , 122 ) ;
- Size = MAP_APPFONT ( 15 , 15 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Pages" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "pages.png" ; };
- MaskColor = STD_MASKCOLOR ;
- };
- };
-
- ImageButton BTN_DATE
- {
- HelpId = HID_SC_HF_DATE ;
- Pos = MAP_APPFONT ( 187 , 122 ) ;
- Size = MAP_APPFONT ( 15 , 15 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Date" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "date.png" ; };
- MaskColor = STD_MASKCOLOR ;
- };
- };
-
- ImageButton BTN_TIME
- {
- HelpId = HID_SC_HF_TIME ;
- Pos = MAP_APPFONT ( 204 , 122 ) ;
- Size = MAP_APPFONT ( 15 , 15 ) ;
- TabStop = TRUE ;
- QuickHelpText [ en-US ] = "Time" ;
- ButtonImage = Image
- {
- ImageBitmap = Bitmap { File = "time.png" ; };
- MaskColor = STD_MASKCOLOR ;
- };
- };
-
- FixedText FT_INFO
- {
- Pos = MAP_APPFONT ( 12 , 155 ) ;
- Size = MAP_APPFONT ( 240 , 24 ) ;
- WordBreak = TRUE ;
- Text [ en-US ] = "Use the buttons to change the font or insert field commands such as date, time, etc." ;
- };
- FixedLine FL_INFO
- {
- Pos = MAP_APPFONT ( 6 , 144 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Note" ;
- };
-};
-
- // Kombinationen: Header/Footer links/rechts
- // die Eingabefenster jeweils mit eigener ID, sonst aus RID_HFBASE kopiert
-TabPage RID_SCPAGE_HFED_HL < RID_HFBASE
-{
- Hide = TRUE ;
- HelpId = HID_SCPAGE_HFED_HL ;
- Control WND_LEFT
- {
- HelpId = HID_SC_HF_HLL ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- Control WND_CENTER
- {
- HelpId = HID_SC_HF_HLC ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- Control WND_RIGHT
- {
- HelpId = HID_SC_HF_HLR ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 174 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- ListBox LB_DEFINED
- {
- HelpId = HID_SC_HF_HL_DEFINED ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 100 ) ;
- Size = MAP_APPFONT ( 130 , 80 ) ;
- DropDown = TRUE ;
- TabStop = TRUE ;
- };
-};
-
-TabPage RID_SCPAGE_HFED_HR < RID_HFBASE
-{
- Hide = TRUE ;
- HelpId = HID_SCPAGE_HFED_HR ;
- Control WND_LEFT
- {
- HelpId = HID_SC_HF_HRL ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- Control WND_CENTER
- {
- HelpId = HID_SC_HF_HRC ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- Control WND_RIGHT
- {
- HelpId = HID_SC_HF_HRR ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 174 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- ListBox LB_DEFINED
- {
- HelpId = HID_SC_HF_HR_DEFINED ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 100 ) ;
- Size = MAP_APPFONT ( 130 , 80 ) ;
- DropDown = TRUE ;
- TabStop = TRUE ;
- };
-};
-
-TabPage RID_SCPAGE_HFED_FL < RID_HFBASE
-{
- Hide = TRUE ;
- HelpId = HID_SCPAGE_HFED_FL ;
- Control WND_LEFT
- {
- HelpId = HID_SC_HF_FLL ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- Control WND_CENTER
- {
- HelpId = HID_SC_HF_FLC ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- Control WND_RIGHT
- {
- HelpId = HID_SC_HF_FLR ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 174 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- ListBox LB_DEFINED
- {
- HelpId = HID_SC_HF_FL_DEFINED ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 100 ) ;
- Size = MAP_APPFONT ( 130 , 80 ) ;
- DropDown = TRUE ;
- TabStop = TRUE ;
- };
-};
-
-TabPage RID_SCPAGE_HFED_FR < RID_HFBASE
-{
- Hide = TRUE ;
- HelpId = HID_SCPAGE_HFED_FR ;
- Control WND_LEFT
- {
- HelpId = HID_SC_HF_FRL ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- Control WND_CENTER
- {
- HelpId = HID_SC_HF_FRC ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- Control WND_RIGHT
- {
- HelpId = HID_SC_HF_FRR ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 174 , 18 ) ;
- Size = MAP_APPFONT ( 80 , 72 ) ;
- TabStop = TRUE ;
- };
- ListBox LB_DEFINED
- {
- HelpId = HID_SC_HF_FR_DEFINED ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 90 , 100 ) ;
- Size = MAP_APPFONT ( 130 , 80 ) ;
- DropDown = TRUE ;
- TabStop = TRUE ;
- };
-};
diff --git a/sc/source/ui/pagedlg/pagedlg.hrc b/sc/source/ui/pagedlg/pagedlg.hrc
deleted file mode 100644
index 2ffe5f9e9..000000000
--- a/sc/source/ui/pagedlg/pagedlg.hrc
+++ /dev/null
@@ -1,100 +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 "sc.hrc" // -> RID_SCDLG_PAGE
- // -> RID_SCPAGE_TABLE
- // -> RID_SCPAGE_AREAS
-
-#define TP_PAGE_STD 1
-#define TP_PAGE_HEADER 2
-#define TP_PAGE_FOOTER 3
-#define TP_PAGE_TABLE 4
-#define TP_PAGE_AREAS 5
-
-//================================================
-// TabPage: Tabelle
-
-#define BTN_GRID 10
-#define BTN_HEADER 11
-#define BTN_NOTES 12
-#define BTN_CHARTS 13
-#define BTN_OBJECTS 14
-#define BTN_DRAWINGS 15
-#define BTN_FORMULAS 16
-#define BTN_NULLVALS 17
-#define FL_PRINT 19
-
-#define BTN_TOPDOWN 20
-#define BTN_LEFTRIGHT 21
-#define BMP_PAGEDIR 22
-#define IMG_LEFTRIGHT 23
-#define IMG_TOPDOWN 24
-#define BTN_PAGENO 25
-#define ED_PAGENO 26
-#define FL_PAGEDIR 29
-
-#define FT_SCALEMODE 30
-#define LB_SCALEMODE 31
-#define ED_SCALEALL 32
-#define ED_SCALEPAGENUM 34
-#define ED_SCALEPAGEWIDTH 35
-#define ED_SCALEPAGEHEIGHT 36
-#define FL_SCALE 39
-
-#define FT_SCALEFACTOR 51
-#define FT_SCALEPAGEWIDTH 52
-#define FT_SCALEPAGEHEIGHT 53
-#define FT_SCALEPAGENUM 54
-
-// List box entries "Scaling mode"
-#define SC_TPTABLE_SCALE_PERCENT 0
-#define SC_TPTABLE_SCALE_TO 1
-#define SC_TPTABLE_SCALE_TO_PAGES 2
-
-//================================================
-// Dialog: Druckbereiche
-
-#define FL_PRINTAREA 10
-#define ED_PRINTAREA 11
-#define RB_PRINTAREA 12
-#define LB_PRINTAREA 13
-
-#define FL_REPEATROW 20
-#define ED_REPEATROW 21
-#define RB_REPEATROW 22
-#define LB_REPEATROW 23
-
-#define FL_REPEATCOL 30
-#define ED_REPEATCOL 31
-#define RB_REPEATCOL 32
-#define LB_REPEATCOL 33
-
-#define BTN_OK 1
-#define BTN_CANCEL 2
-#define BTN_HELP 3
-
diff --git a/sc/source/ui/pagedlg/pagedlg.src b/sc/source/ui/pagedlg/pagedlg.src
deleted file mode 100644
index 42a1e12e9..000000000
--- a/sc/source/ui/pagedlg/pagedlg.src
+++ /dev/null
@@ -1,409 +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 "pagedlg.hrc"
-
-ModelessDialog RID_SCDLG_AREAS
-{
- HelpId = HID_SCPAGE_AREAS ;
- Size = MAP_APPFONT ( 316 , 90 ) ;
- OutputSize = TRUE ;
- Moveable = TRUE ;
- //Closeable = TRUE; // Dieser Dialog hat einen Cancel-Button !
- Hide = TRUE ;
- SVLook = TRUE ;
- Text [ en-US ] = "Edit Print Ranges" ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 260 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 260 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 260 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- FixedLine FL_PRINTAREA
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Print range" ;
- };
- ListBox LB_PRINTAREA
- {
- HelpID = "sc:ListBox:RID_SCDLG_AREAS:LB_PRINTAREA";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 90 , 60 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "- none -" ; Default ; > ;
- < "- entire sheet -" ; Default ; > ;
- < "- user defined -" ; Default ; > ;
- < "- selection -" ; Default ; > ;
- };
- };
- Edit ED_PRINTAREA
- {
- HelpID = "sc:Edit:RID_SCDLG_AREAS:ED_PRINTAREA";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 106 , 14 ) ;
- Size = MAP_APPFONT ( 131 , 12 ) ;
- };
- ImageButton RB_PRINTAREA
- {
- HelpID = "sc:ImageButton:RID_SCDLG_AREAS:RB_PRINTAREA";
- Pos = MAP_APPFONT ( 239 , 13 ) ;
- Size = MAP_APPFONT ( 13 , 15 ) ;
- TabStop = FALSE ;
- QuickHelpText [ en-US ] = "Shrink" ;
- };
- FixedLine FL_REPEATROW
- {
- Pos = MAP_APPFONT ( 6 , 32 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Rows to repeat" ;
- };
- ListBox LB_REPEATROW
- {
- HelpID = "sc:ListBox:RID_SCDLG_AREAS:LB_REPEATROW";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 90 , 60 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "- none -" ; Default ; > ;
- < "- user defined -" ; Default ; > ;
- };
- };
- Edit ED_REPEATROW
- {
- HelpID = "sc:Edit:RID_SCDLG_AREAS:ED_REPEATROW";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 106 , 43 ) ;
- Size = MAP_APPFONT ( 131 , 12 ) ;
- };
- ImageButton RB_REPEATROW
- {
- HelpID = "sc:ImageButton:RID_SCDLG_AREAS:RB_REPEATROW";
- Pos = MAP_APPFONT ( 239 , 42 ) ;
- Size = MAP_APPFONT ( 13 , 15 ) ;
- TabStop = FALSE ;
- QuickHelpText [ en-US ] = "Shrink" ;
- };
- FixedLine FL_REPEATCOL
- {
- Pos = MAP_APPFONT ( 6 , 61 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Columns to repeat" ;
- };
- ListBox LB_REPEATCOL
- {
- HelpID = "sc:ListBox:RID_SCDLG_AREAS:LB_REPEATCOL";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 72 ) ;
- Size = MAP_APPFONT ( 90 , 60 ) ;
- DropDown = TRUE ;
- StringList [ en-US ] =
- {
- < "- none -" ; Default ; > ;
- < "- user defined -" ; Default ; > ;
- };
- };
- Edit ED_REPEATCOL
- {
- HelpID = "sc:Edit:RID_SCDLG_AREAS:ED_REPEATCOL";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 106 , 72 ) ;
- Size = MAP_APPFONT ( 131 , 12 ) ;
- };
- ImageButton RB_REPEATCOL
- {
- HelpID = "sc:ImageButton:RID_SCDLG_AREAS:RB_REPEATCOL";
- Pos = MAP_APPFONT ( 239 , 71 ) ;
- Size = MAP_APPFONT ( 13 , 15 ) ;
- TabStop = FALSE ;
- QuickHelpText [ en-US ] = "Shrink" ;
- };
-};
-
-TabPage RID_SCPAGE_TABLE
-{
- Hide = TRUE ;
- HelpId = HID_SCPAGE_TABLE ;
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- CheckBox BTN_HEADER
- {
- HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_HEADER";
- Pos = MAP_APPFONT ( 12 , 73 ) ;
- Size = MAP_APPFONT ( 142 , 10 ) ;
- Text [ en-US ] = "~Column and row headers" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_GRID
- {
- HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_GRID";
- Pos = MAP_APPFONT ( 12 , 87 ) ;
- Size = MAP_APPFONT ( 142 , 10 ) ;
- Text [ en-US ] = "~Grid" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_NOTES
- {
- HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_NOTES";
- Pos = MAP_APPFONT ( 12 , 101 ) ;
- Size = MAP_APPFONT ( 142 , 10 ) ;
- Text [ en-US ] = "~Comments" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_OBJECTS
- {
- HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_OBJECTS";
- Pos = MAP_APPFONT ( 12 , 115 ) ;
- Size = MAP_APPFONT ( 142 , 10 ) ;
- Text [ en-US ] = "~Objects/graphics" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_CHARTS
- {
- HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_CHARTS";
- Pos = MAP_APPFONT ( 160 , 73 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
- Text [ en-US ] = "Ch~arts" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_DRAWINGS
- {
- HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_DRAWINGS";
- Pos = MAP_APPFONT ( 160 , 87 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
- Text [ en-US ] = "~Drawing objects" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_FORMULAS
- {
- HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_FORMULAS";
- Pos = MAP_APPFONT ( 160 , 101 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
- Text [ en-US ] = "~Formulas" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_NULLVALS
- {
- HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_NULLVALS";
- Pos = MAP_APPFONT ( 160 , 115 ) ;
- Size = MAP_APPFONT ( 91 , 10 ) ;
- Text [ en-US ] = "Zero ~values" ;
- TabStop = TRUE ;
- };
- FixedLine FL_PRINT
- {
- Pos = MAP_APPFONT ( 6 , 62 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Print" ;
- };
- RadioButton BTN_TOPDOWN
- {
- HelpID = "sc:RadioButton:RID_SCPAGE_TABLE:BTN_TOPDOWN";
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 142 , 10 ) ;
- Text [ en-US ] = "~Top to bottom, then right" ;
- TabStop = TRUE ;
- };
- RadioButton BTN_LEFTRIGHT
- {
- HelpID = "sc:RadioButton:RID_SCPAGE_TABLE:BTN_LEFTRIGHT";
- Pos = MAP_APPFONT ( 12 , 28 ) ;
- Size = MAP_APPFONT ( 142 , 10 ) ;
- Text [ en-US ] = "~Left to right, then down" ;
- TabStop = TRUE ;
- };
- FixedImage BMP_PAGEDIR
- {
- Pos = MAP_APPFONT ( 160 , 14 ) ;
- Size = MAP_APPFONT ( 25 , 25 ) ;
- };
- Image IMG_LEFTRIGHT
- {
- ImageBitmap = Bitmap { File = "lftrgt.png" ; };
- MaskColor = STD_MASKCOLOR;
- };
- Image IMG_TOPDOWN
- {
- ImageBitmap = Bitmap { File = "topdown.png" ; };
- MaskColor = STD_MASKCOLOR;
- };
- CheckBox BTN_PAGENO
- {
- HelpID = "sc:CheckBox:RID_SCPAGE_TABLE:BTN_PAGENO";
- Pos = MAP_APPFONT ( 12 , 46 ) ;
- Size = MAP_APPFONT ( 90 , 10 ) ;
- Text [ en-US ] = "First ~page number" ;
- TabStop = TRUE ;
- };
- NumericField ED_PAGENO
- {
- HelpID = "sc:NumericField:RID_SCPAGE_TABLE:ED_PAGENO";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 106 , 44 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 9999 ;
- SpinSize = 1 ;
- Repeat = TRUE ;
- };
- FixedLine FL_PAGEDIR
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Page order" ;
- };
- FixedText FT_SCALEMODE
- {
- Pos = MAP_APPFONT( 12, 144 );
- Size = MAP_APPFONT( 124, 8 );
- Text [ en-US ] = "Scaling ~mode";
- };
- ListBox LB_SCALEMODE
- {
- HelpID = "sc:ListBox:RID_SCPAGE_TABLE:LB_SCALEMODE";
- Border = TRUE;
- Pos = MAP_APPFONT( 12, 155 );
- Size = MAP_APPFONT( 124, 60 );
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- < "Reduce/enlarge printout"; SC_TPTABLE_SCALE_PERCENT; >;
- < "Fit print range(s) to width/height"; SC_TPTABLE_SCALE_TO; >;
- < "Fit print range(s) on number of pages"; SC_TPTABLE_SCALE_TO_PAGES; >;
- };
- };
- MetricField ED_SCALEALL
- {
- HelpID = "sc:MetricField:RID_SCPAGE_TABLE:ED_SCALEALL";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 218 , 155 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- Minimum = 10 ;
- Maximum = 400 ;
- First = 15 ;
- Last = 200 ;
- SpinSize = 1 ;
- Unit = FUNIT_CUSTOM ;
- CustomUnitText = "%" ;
- };
- NumericField ED_SCALEPAGEWIDTH
- {
- HelpID = "sc:NumericField:RID_SCPAGE_TABLE:ED_SCALEPAGEWIDTH";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 218 , 144 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Hide = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- Minimum = 1 ;
- Maximum = 1000 ;
- SpinSize = 1 ;
- };
- NumericField ED_SCALEPAGEHEIGHT
- {
- HelpID = "sc:NumericField:RID_SCPAGE_TABLE:ED_SCALEPAGEHEIGHT";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 218 , 160 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Hide = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- Minimum = 1 ;
- Maximum = 1000 ;
- SpinSize = 1 ;
- };
- NumericField ED_SCALEPAGENUM
- {
- HelpID = "sc:NumericField:RID_SCPAGE_TABLE:ED_SCALEPAGENUM";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 218 , 155 ) ;
- Size = MAP_APPFONT ( 30 , 12 ) ;
- TabStop = TRUE ;
- Hide = TRUE ;
- Spin = TRUE ;
- Repeat = TRUE ;
- Minimum = 1 ;
- Maximum = 1000 ;
- SpinSize = 1 ;
- };
- FixedText FT_SCALEFACTOR
- {
- Pos = MAP_APPFONT( 148, 157 );
- Size = MAP_APPFONT( 68 , 8 );
- Hide = TRUE;
- Text [ en-US ] = "~Scaling factor";
- };
- FixedText FT_SCALEPAGEWIDTH
- {
- Pos = MAP_APPFONT( 148, 146 );
- Size = MAP_APPFONT( 68 , 8 );
- Hide = TRUE;
- Text [ en-US ] = "~Width in pages";
- };
- FixedText FT_SCALEPAGEHEIGHT
- {
- Pos = MAP_APPFONT( 148, 162 );
- Size = MAP_APPFONT( 68 , 8 );
- Hide = TRUE;
- Text [ en-US ] = "H~eight in pages";
- };
- FixedText FT_SCALEPAGENUM
- {
- Pos = MAP_APPFONT( 148, 157 );
- Size = MAP_APPFONT( 68, 8 );
- Hide = TRUE;
- Text [ en-US ] = "N~umber of pages";
- };
- FixedLine FL_SCALE
- {
- Pos = MAP_APPFONT ( 6 , 131 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Scale" ;
- };
-};
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
deleted file mode 100644
index 59ef7fedf..000000000
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ /dev/null
@@ -1,994 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sc.hxx"
-
-#undef SC_DLLIMPLEMENTATION
-
-
-
-//------------------------------------------------------------------
-
-#define _TPHFEDIT_CXX
-#include "scitems.hxx"
-#include <editeng/eeitem.hxx>
-
-#include <editeng/editobj.hxx>
-#include <editeng/editstat.hxx>
-#include <editeng/editview.hxx>
-#include <editeng/flditem.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <sfx2/objsh.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/svapp.hxx>
-#include <unotools/useroptions.hxx>
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
-
-#include "editutil.hxx"
-#include "global.hxx"
-#include "attrib.hxx"
-#include "patattr.hxx"
-#include "scresid.hxx"
-#include "sc.hrc"
-#include "globstr.hrc"
-#include "tabvwsh.hxx"
-#include "prevwsh.hxx"
-#include "hfedtdlg.hrc"
-#include "textdlgs.hxx"
-#include "AccessibleEditObject.hxx"
-
-#include "scuitphfedit.hxx"
-#include <memory> // header file for auto_ptr
-
-// STATIC DATA -----------------------------------------------------------
-
-static sal_uInt16 pPageRightHeaderRanges[] = { SID_SCATTR_PAGE_HEADERRIGHT,
- SID_SCATTR_PAGE_HEADERRIGHT,
- 0 };
-
-static sal_uInt16 pPageRightFooterRanges[] = { SID_SCATTR_PAGE_FOOTERRIGHT,
- SID_SCATTR_PAGE_FOOTERRIGHT,
- 0 };
-
-static sal_uInt16 pPageLeftHeaderRanges[] = { SID_SCATTR_PAGE_HEADERLEFT,
- SID_SCATTR_PAGE_HEADERLEFT,
- 0 };
-
-static sal_uInt16 pPageLeftFooterRanges[] = { SID_SCATTR_PAGE_FOOTERLEFT,
- SID_SCATTR_PAGE_FOOTERLEFT,
- 0 };
-
-
-static ScEditWindow* pActiveEdWnd = NULL;
-
-
-//========================================================================
-// class ScHFEditPage
-//
-
-ScHFEditPage::ScHFEditPage( Window* pParent,
- sal_uInt16 nResId,
- const SfxItemSet& rCoreAttrs,
- sal_uInt16 nWhichId,
- bool bHeader )
-
- : SfxTabPage ( pParent, ScResId( nResId ), rCoreAttrs ),
-
- aFtLeft ( this, ScResId( FT_LEFT ) ),
- aWndLeft ( this, ScResId( WND_LEFT ), Left ),
- aFtCenter ( this, ScResId( FT_CENTER ) ),
- aWndCenter ( this, ScResId( WND_CENTER ), Center ),
- aFtRight ( this, ScResId( FT_RIGHT ) ),
- aWndRight ( this, ScResId( WND_RIGHT ), Right ),
- maFtDefinedHF ( this, ScResId( FT_HF_DEFINED ) ),
- maLbDefined ( this, ScResId( LB_DEFINED ) ),
- maFtCustomHF ( this, ScResId( FT_HF_CUSTOM ) ),
- aBtnText ( this, ScResId( BTN_TEXT ) ),
- aBtnFile ( this, ScResId( BTN_FILE ) ),
- aBtnTable ( this, ScResId( BTN_TABLE ) ),
- aBtnPage ( this, ScResId( BTN_PAGE ) ),
- aBtnLastPage ( this, ScResId( BTN_PAGES ) ),
- aBtnDate ( this, ScResId( BTN_DATE ) ),
- aBtnTime ( this, ScResId( BTN_TIME ) ),
- aFlInfo ( this, ScResId( FL_INFO ) ),
- aFtInfo ( this, ScResId( FT_INFO ) ),
- aPopUpFile ( ScResId( RID_POPUP_FCOMMAND) ),
- nWhich ( nWhichId )
-{
- //! use default style from current document?
- //! if font color is used, header/footer background color must be set
-
- ScPatternAttr aPatAttr( rCoreAttrs.GetPool() );
-
-
- aBtnFile.SetPopupMenu(&aPopUpFile);
-
- maLbDefined.SetSelectHdl( LINK( this, ScHFEditPage, ListHdl_Impl ) );
- aBtnFile.SetMenuHdl( LINK( this, ScHFEditPage, MenuHdl ) );
- aBtnText .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
- aBtnPage .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
- aBtnLastPage.SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
- aBtnDate .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
- aBtnTime .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
- aBtnFile .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
- aBtnTable .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) );
-
- if(!bHeader)
- {
- maFtDefinedHF.SetText(ScGlobal::GetRscString( STR_FOOTER ));
- maFtCustomHF.SetText(ScGlobal::GetRscString( STR_HF_CUSTOM_FOOTER ));
- }
- if( Application::GetSettings().GetLayoutRTL() )
- {
- Point pt1 = aWndLeft.GetPosPixel();
- Point pt2 = aWndRight.GetPosPixel();
- aWndLeft.SetPosPixel(pt2);
- aWndRight.SetPosPixel(pt1);
-
- pt1 = aFtLeft.GetPosPixel();
- pt2 = aFtRight.GetPosPixel();
- aFtLeft.SetPosPixel(pt2);
- aFtRight.SetPosPixel(pt1);
- }
- aWndLeft. SetFont( aPatAttr );
- aWndCenter. SetFont( aPatAttr );
- aWndRight. SetFont( aPatAttr );
-
- FillCmdArr();
-
- aWndLeft.GrabFocus();
-
- InitPreDefinedList();
-
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-ScHFEditPage::~ScHFEditPage()
-{
-}
-
-void ScHFEditPage::SetNumType(SvxNumType eNumType)
-{
- aWndLeft.SetNumType(eNumType);
- aWndCenter.SetNumType(eNumType);
- aWndRight.SetNumType(eNumType);
-}
-
-// -----------------------------------------------------------------------
-
-#define IS_AVAILABLE(w)(rCoreSet.GetItemState( (w) ) >= SFX_ITEM_AVAILABLE)
-
-void ScHFEditPage::Reset( const SfxItemSet& rCoreSet )
-{
- if ( IS_AVAILABLE( nWhich ) )
- {
- const ScPageHFItem& rItem = (const ScPageHFItem&)(rCoreSet.Get( nWhich ));
-
- if( const EditTextObject* pLeft = rItem.GetLeftArea() )
- aWndLeft.SetText( *pLeft );
- if( const EditTextObject* pCenter = rItem.GetCenterArea() )
- aWndCenter.SetText( *pCenter );
- if( const EditTextObject* pRight = rItem.GetRightArea() )
- aWndRight.SetText( *pRight );
-
- SetSelectDefinedList();
- }
-}
-
-#undef IS_AVAILABLE
-
-// -----------------------------------------------------------------------
-
-sal_Bool ScHFEditPage::FillItemSet( SfxItemSet& rCoreSet )
-{
- ScPageHFItem aItem( nWhich );
- EditTextObject* pLeft = aWndLeft .CreateTextObject();
- EditTextObject* pCenter = aWndCenter.CreateTextObject();
- EditTextObject* pRight = aWndRight .CreateTextObject();
-
- aItem.SetLeftArea ( *pLeft );
- aItem.SetCenterArea( *pCenter );
- aItem.SetRightArea ( *pRight );
- delete pLeft;
- delete pCenter;
- delete pRight;
-
- rCoreSet.Put( aItem );
-
- return sal_True;
-}
-
-// -----------------------------------------------------------------------
-
-#define SET_CMD(i,id) \
- aCmd = aDel; \
- aCmd += ScGlobal::GetRscString( id ); \
- aCmd += aDel; \
- aCmdArr[i] = aCmd;
-
-// -----------------------------------------------------------------------
-
-void ScHFEditPage::FillCmdArr()
-{
- String aDel( ScGlobal::GetRscString( STR_HFCMD_DELIMITER ) );
- String aCmd;
-
- SET_CMD( 0, STR_HFCMD_PAGE )
- SET_CMD( 1, STR_HFCMD_PAGES )
- SET_CMD( 2, STR_HFCMD_DATE )
- SET_CMD( 3, STR_HFCMD_TIME )
- SET_CMD( 4, STR_HFCMD_FILE )
- SET_CMD( 5, STR_HFCMD_TABLE )
-}
-
-#undef SET_CMD
-
-void ScHFEditPage::InitPreDefinedList()
-{
- SvtUserOptions aUserOpt;
-
- Color* pTxtColour = NULL;
- Color* pFldColour = NULL;
-
- // Get the all field values at the outset.
- String aPageFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour));
- String aSheetFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour));
- String aFileFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour));
- String aExtFileFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxExtFileField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour));
- String aDateFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxDateField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour));
-
- maLbDefined.Clear();
-
- maLbDefined.InsertEntry( ScGlobal::GetRscString( STR_HF_NONE_IN_BRACKETS ));
-
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- aPageEntry += aPageFieldValue;
- maLbDefined.InsertEntry(aPageEntry);
-
- String aPageOfEntry(aPageEntry);
- aPageOfEntry += ' ';
- aPageOfEntry += ScGlobal::GetRscString( STR_HF_OF_QUESTION );
- maLbDefined.InsertEntry( aPageOfEntry);
-
- maLbDefined.InsertEntry(aSheetFieldValue);
-
- String aConfidentialEntry(aUserOpt.GetCompany());
- aConfidentialEntry += ' ';
- aConfidentialEntry += ScGlobal::GetRscString( STR_HF_CONFIDENTIAL );
- aConfidentialEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aConfidentialEntry += aDateFieldValue;
- aConfidentialEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aConfidentialEntry += aPageEntry;
- maLbDefined.InsertEntry( aConfidentialEntry);
-
- String aFileNamePageEntry(aFileFieldValue);
- aFileNamePageEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aFileNamePageEntry += aPageEntry;
- maLbDefined.InsertEntry( aFileNamePageEntry);
-
- maLbDefined.InsertEntry( aExtFileFieldValue);
-
- String aPageSheetNameEntry(aPageEntry);
- aPageSheetNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aPageSheetNameEntry += aSheetFieldValue;
- maLbDefined.InsertEntry( aPageSheetNameEntry);
-
- String aPageFileNameEntry(aPageEntry);
- aPageFileNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aPageFileNameEntry += aFileFieldValue;
- maLbDefined.InsertEntry( aPageFileNameEntry);
-
- String aPagePathNameEntry(aPageEntry);
- aPagePathNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aPagePathNameEntry += aExtFileFieldValue;
- maLbDefined.InsertEntry( aPagePathNameEntry);
-
- String aUserNameEntry(aUserOpt.GetFirstName());
- aUserNameEntry += ' ';
- aUserNameEntry += (String)aUserOpt.GetLastName();
- aUserNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aUserNameEntry += aPageEntry;
- aUserNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aUserNameEntry += aDateFieldValue;
- maLbDefined.InsertEntry( aUserNameEntry);
-
- String aCreatedByEntry(ScGlobal::GetRscString( STR_HF_CREATED_BY ) );
- aCreatedByEntry += ' ';
- aCreatedByEntry += (String)aUserOpt.GetFirstName();
- aCreatedByEntry += ' ';
- aCreatedByEntry += (String)aUserOpt.GetLastName();
- aCreatedByEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aCreatedByEntry += aDateFieldValue;
- aCreatedByEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
- aCreatedByEntry += aPageEntry;
- maLbDefined.InsertEntry( aCreatedByEntry);
-}
-
-void ScHFEditPage::InsertToDefinedList()
-{
- sal_uInt16 nCount = maLbDefined.GetEntryCount();
- if(nCount == eEntryCount)
- {
- String aCustomizedEntry(ScGlobal::GetRscString( STR_HF_CUSTOMIZED ) );
- maLbDefined.InsertEntry( aCustomizedEntry);
- maLbDefined.SelectEntryPos(eEntryCount);
- }
-}
-
-void ScHFEditPage::RemoveFromDefinedList()
-{
- sal_uInt16 nCount = maLbDefined.GetEntryCount();
- if(nCount > eEntryCount )
- maLbDefined.RemoveEntry( nCount-1);
-}
-
-// determine if the header/footer exists in our predefined list and set select to it.
-void ScHFEditPage::SetSelectDefinedList()
-{
- SvtUserOptions aUserOpt;
-
- // default to customized
- ScHFEntryId eSelectEntry = eEntryCount;
-
- ::std::auto_ptr< EditTextObject > pLeftObj;
- ::std::auto_ptr< EditTextObject > pCenterObj;
- ::std::auto_ptr< EditTextObject > pRightObj;
-
- XubString aLeftEntry;
- XubString aCenterEntry;
- XubString aRightEntry;
-
- pLeftObj.reset(aWndLeft.GetEditEngine()->CreateTextObject());
- pCenterObj.reset(aWndCenter.GetEditEngine()->CreateTextObject());
- pRightObj.reset(aWndRight.GetEditEngine()->CreateTextObject());
-
- bool bFound = false;
-
- sal_uInt16 i;
- sal_uInt16 nCount = maLbDefined.GetEntryCount();
- for(i = 0; i < nCount && !bFound; i++)
- {
- switch(static_cast<ScHFEntryId>(i))
- {
- case eNoneEntry:
- {
- aLeftEntry = pLeftObj->GetText(0);
- aCenterEntry = pCenterObj->GetText(0);
- aRightEntry = pRightObj->GetText(0);
- if(aLeftEntry == EMPTY_STRING && aCenterEntry == EMPTY_STRING
- && aRightEntry == EMPTY_STRING)
- {
- eSelectEntry = eNoneEntry;
- bFound = true;
- }
- }
- break;
-
- case ePageEntry:
- {
- aLeftEntry = pLeftObj->GetText(0);
- aRightEntry = pRightObj->GetText(0);
- if(aLeftEntry == EMPTY_STRING && aRightEntry == EMPTY_STRING)
- {
- if(IsPageEntry(aWndCenter.GetEditEngine(), pCenterObj.get()))
- {
- eSelectEntry = ePageEntry;
- bFound = true;
- }
- }
- }
- break;
-
-
- //TODO
- case ePagesEntry:
- {
- }
- break;
-
- case eSheetEntry:
- {
- aLeftEntry = pLeftObj->GetText(0);
- aRightEntry = pRightObj->GetText(0);
- if(aLeftEntry == EMPTY_STRING && aRightEntry == EMPTY_STRING)
- {
- if(pCenterObj->IsFieldObject())
- {
- const SvxFieldItem* pFieldItem = pCenterObj->GetField();
- if(pFieldItem)
- {
- const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxTableField))
- {
- eSelectEntry = eSheetEntry;
- bFound = true;
- }
- }
- }
- }
- }
- break;
-
- case eConfidentialEntry:
- {
- if(IsDateEntry(pCenterObj.get()) && IsPageEntry(aWndRight.GetEditEngine(), pRightObj.get()))
- {
- String aConfidentialEntry(aUserOpt.GetCompany());
- aConfidentialEntry += ' ';
- aConfidentialEntry += ScGlobal::GetRscString( STR_HF_CONFIDENTIAL );
- if(aConfidentialEntry == aWndLeft.GetEditEngine()->GetText(0))
- {
- eSelectEntry = eConfidentialEntry;
- bFound = true;
- }
- }
- }
- break;
-
- //TODO
- case eFileNamePageEntry:
- {
- }
- break;
-
- case eExtFileNameEntry:
- {
- aLeftEntry = pLeftObj->GetText(0);
- aRightEntry = pRightObj->GetText(0);
- if(IsExtFileNameEntry(pCenterObj.get()) && aLeftEntry == EMPTY_STRING
- && aRightEntry == EMPTY_STRING)
- {
- eSelectEntry = eExtFileNameEntry;
- bFound = true;
- }
- }
- break;
-
- //TODO
- case ePageSheetEntry:
- {
- }
- break;
-
- //TODO
- case ePageFileNameEntry:
- {
- }
- break;
-
- case ePageExtFileNameEntry:
- {
- aLeftEntry = pLeftObj->GetText(0);
- if(IsPageEntry(aWndCenter.GetEditEngine(), pCenterObj.get()) &&
- IsExtFileNameEntry(pRightObj.get()) && aLeftEntry == EMPTY_STRING)
- {
- eSelectEntry = ePageExtFileNameEntry;
- bFound = true;
- }
- }
- break;
-
- case eUserNameEntry:
- {
- if(IsDateEntry(pRightObj.get()) && IsPageEntry(aWndCenter.GetEditEngine(), pCenterObj.get()))
- {
- String aUserNameEntry(aUserOpt.GetFirstName());
- aUserNameEntry += ' ';
- aUserNameEntry += (String)aUserOpt.GetLastName();
- if(aUserNameEntry == aWndLeft.GetEditEngine()->GetText(0))
- {
- eSelectEntry = eUserNameEntry;
- bFound = true;
- }
- }
- }
- break;
-
- case eCreatedByEntry:
- {
- if(IsDateEntry(pCenterObj.get()) && IsPageEntry(aWndRight.GetEditEngine(), pRightObj.get()))
- {
- String aCreatedByEntry(ScGlobal::GetRscString( STR_HF_CREATED_BY ) );
- aCreatedByEntry += ' ';
- aCreatedByEntry += (String)aUserOpt.GetFirstName();
- aCreatedByEntry += ' ';
- aCreatedByEntry += (String)aUserOpt.GetLastName();
- if(aCreatedByEntry == aWndLeft.GetEditEngine()->GetText(0))
- {
- eSelectEntry = eCreatedByEntry;
- bFound = true;
- }
- }
- }
- break;
-
- default:
- {
- // added to avoid warnings
- }
- }
- }
-
- if(eSelectEntry == eEntryCount)
- InsertToDefinedList();
-
- maLbDefined.SelectEntryPos( sal::static_int_cast<sal_uInt16>( eSelectEntry ) );
-}
-
-bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj)
-{
- if(!pEngine && !pTextObj)
- return false;
-
- bool bReturn = false;
-
- if(!pTextObj->IsFieldObject())
- {
- SvUShorts aPosList;
- pEngine->GetPortions(0,aPosList);
- if(aPosList.Count() == 2)
- {
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- ESelection aSel(0,0,0,0);
- aSel.nEndPos = aPageEntry.Len();
- if(aPageEntry == pEngine->GetText(aSel))
- {
- aSel.nStartPos = aSel.nEndPos;
- aSel.nEndPos++;
- ::std::auto_ptr< EditTextObject > pPageObj;
- pPageObj.reset(pEngine->CreateTextObject(aSel));
- if(pPageObj.get() && pPageObj->IsFieldObject() )
- {
- const SvxFieldItem* pFieldItem = pPageObj->GetField();
- if(pFieldItem)
- {
- const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxPageField))
- bReturn = true;
- }
- }
- }
- }
- }
- return bReturn;
-}
-
-bool ScHFEditPage::IsDateEntry(EditTextObject* pTextObj)
-{
- if(!pTextObj)
- return false;
-
- bool bReturn = false;
- if(pTextObj->IsFieldObject())
- {
- const SvxFieldItem* pFieldItem = pTextObj->GetField();
- if(pFieldItem)
- {
- const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxDateField))
- bReturn = true;
- }
- }
- return bReturn;
-}
-
-bool ScHFEditPage::IsExtFileNameEntry(EditTextObject* pTextObj)
-{
- if(!pTextObj)
- return false;
- bool bReturn = false;
- if(pTextObj->IsFieldObject())
- {
- const SvxFieldItem* pFieldItem = pTextObj->GetField();
- if(pFieldItem)
- {
- const SvxFieldData* pField = pFieldItem->GetField();
- if(pField && pField->ISA(SvxExtFileField))
- bReturn = true;
- }
- }
- return bReturn;
-}
-
-void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling)
-{
- SvtUserOptions aUserOpt;
- ::std::auto_ptr< EditTextObject > pTextObj;
-
- switch(eSel)
- {
- case eNoneEntry:
- ClearTextAreas();
- if(!bTravelling)
- aWndLeft.GrabFocus();
- break;
-
- case ePageEntry:
- {
- ClearTextAreas();
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- aWndCenter.GetEditEngine()->SetText(aPageEntry);
- aWndCenter.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) );
- if(!bTravelling)
- aWndCenter.GrabFocus();
- }
- break;
-
- case ePagesEntry:
- {
- ClearTextAreas();
- ESelection aSel(0,0,0,0);
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- aWndCenter.GetEditEngine()->SetText(aPageEntry);
- aSel.nEndPos = aPageEntry.Len();
- aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- ++aSel.nEndPos;
- String aPageOfEntry = ' ';
- aPageOfEntry += ScGlobal::GetRscString( STR_HF_OF );
- aPageOfEntry += ' ';
- aWndCenter.GetEditEngine()->QuickInsertText(aPageOfEntry,ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aPageOfEntry.Len() );
- aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- pTextObj.reset(aWndCenter.GetEditEngine()->CreateTextObject());
- aWndCenter.SetText(*pTextObj);
- XubString aEntry(pTextObj.get()->GetText(0));
- if(!bTravelling)
- aWndCenter.GrabFocus();
- }
- break;
-
- case eSheetEntry:
- ClearTextAreas();
- aWndCenter.InsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD) );
- if(!bTravelling)
- aWndCenter.GrabFocus();
- break;
-
- case eConfidentialEntry:
- {
- ClearTextAreas();
- String aConfidentialEntry(aUserOpt.GetCompany());
- aConfidentialEntry += ' ';
- aConfidentialEntry += ScGlobal::GetRscString( STR_HF_CONFIDENTIAL );
- aWndLeft.GetEditEngine()->SetText(aConfidentialEntry);
- aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) );
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- aWndRight.GetEditEngine()->SetText(aPageEntry);
- aWndRight.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) );
- if(!bTravelling)
- aWndRight.GrabFocus();
- }
- break;
-
- case eFileNamePageEntry:
- {
- ClearTextAreas();
- ESelection aSel(0,0,0,0);
- aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem( SvxFileField(), EE_FEATURE_FIELD ), aSel );
- ++aSel.nEndPos;
- String aPageEntry(RTL_CONSTASCII_USTRINGPARAM(", "));
- aPageEntry += ScGlobal::GetRscString( STR_PAGE ) ;
- aPageEntry += ' ';
- aWndCenter.GetEditEngine()->QuickInsertText(aPageEntry, ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- aSel.nStartPos = aSel.nEndPos;
- aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aPageEntry.Len() );
- aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- pTextObj.reset(aWndCenter.GetEditEngine()->CreateTextObject());
- aWndCenter.SetText(*pTextObj);
- XubString aEntry2(pTextObj.get()->GetText(0));
- if(!bTravelling)
- aWndCenter.GrabFocus();
- }
- break;
-
- case eExtFileNameEntry:
- ClearTextAreas();
- aWndCenter.InsertField( SvxFieldItem( SvxExtFileField(
- EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_FULLPATH ), EE_FEATURE_FIELD ) );
- if(!bTravelling)
- aWndCenter.GrabFocus();
- break;
-
- case ePageSheetEntry:
- {
- ClearTextAreas();
- ESelection aSel(0,0,0,0);
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- aWndCenter.GetEditEngine()->SetText(aPageEntry);
- aSel.nEndPos = aPageEntry.Len();
- aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- ++aSel.nEndPos;
- String aCommaSpace(RTL_CONSTASCII_USTRINGPARAM(", "));
- aWndCenter.GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aCommaSpace.Len() );
- aWndCenter.GetEditEngine()->QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- pTextObj.reset(aWndCenter.GetEditEngine()->CreateTextObject());
- aWndCenter.SetText(*pTextObj);
- if(!bTravelling)
- aWndCenter.GrabFocus();
- }
- break;
-
- case ePageFileNameEntry:
- {
- ClearTextAreas();
- ESelection aSel(0,0,0,0);
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- aWndCenter.GetEditEngine()->SetText(aPageEntry);
- aSel.nEndPos = aPageEntry.Len();
- aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- ++aSel.nEndPos;
- String aCommaSpace(RTL_CONSTASCII_USTRINGPARAM(", "));
- aWndCenter.GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aCommaSpace.Len() );
- aWndCenter.GetEditEngine()->QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- pTextObj.reset(aWndCenter.GetEditEngine()->CreateTextObject());
- aWndCenter.SetText(*pTextObj);
- if(!bTravelling)
- aWndCenter.GrabFocus();
- }
- break;
-
- case ePageExtFileNameEntry:
- {
- ClearTextAreas();
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- aWndCenter.GetEditEngine()->SetText(aPageEntry);
- aWndCenter.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) );
- aWndRight.InsertField( SvxFieldItem( SvxExtFileField(
- EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_FULLPATH ), EE_FEATURE_FIELD ) );
- if(!bTravelling)
- aWndRight.GrabFocus();
- }
- break;
-
- case eUserNameEntry:
- {
- ClearTextAreas();
- String aUserNameEntry(aUserOpt.GetFirstName());
- aUserNameEntry += ' ';
- aUserNameEntry += (String)aUserOpt.GetLastName();
- aWndLeft.GetEditEngine()->SetText(aUserNameEntry);
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- aWndCenter.GetEditEngine()->SetText(aPageEntry);
- aWndCenter.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) );
- aWndRight.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) );
- if(!bTravelling)
- aWndRight.GrabFocus();
- }
- break;
-
- case eCreatedByEntry:
- {
- ClearTextAreas();
- String aCreatedByEntry(ScGlobal::GetRscString( STR_HF_CREATED_BY ) );
- aCreatedByEntry += ' ';
- aCreatedByEntry += (String)aUserOpt.GetFirstName();
- aCreatedByEntry += ' ';
- aCreatedByEntry += (String)aUserOpt.GetLastName();
- aWndLeft.GetEditEngine()->SetText(aCreatedByEntry);
- aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) );
- String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) );
- aPageEntry += ' ';
- aWndRight.GetEditEngine()->SetText(aPageEntry);
- aWndRight.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) );
- if(!bTravelling)
- aWndRight.GrabFocus();
- }
- break;
-
- default :
- break;
- }
-}
-
-void ScHFEditPage::ClearTextAreas()
-{
- aWndLeft.GetEditEngine()->SetText(EMPTY_STRING);
- aWndLeft.Invalidate();
- aWndCenter.GetEditEngine()->SetText(EMPTY_STRING);
- aWndCenter.Invalidate();
- aWndRight.GetEditEngine()->SetText(EMPTY_STRING);
- aWndRight.Invalidate();
-}
-
-//-----------------------------------------------------------------------
-// Handler:
-//-----------------------------------------------------------------------
-
-IMPL_LINK( ScHFEditPage, ListHdl_Impl, ListBox*, pList )
-{
- if ( pList && pList == &maLbDefined )
- {
- ScHFEntryId eSel = static_cast<ScHFEntryId>(maLbDefined.GetSelectEntryPos());
- if(!maLbDefined.IsTravelSelect())
- {
- ProcessDefinedListSel(eSel);
-
- // check if we need to remove the customized entry.
- if(eSel < eEntryCount)
- RemoveFromDefinedList();
- }
- else
- {
- ProcessDefinedListSel(eSel, true);
- }
- }
- return 0;
-}
-
-IMPL_LINK( ScHFEditPage, ClickHdl, ImageButton*, pBtn )
-{
- pActiveEdWnd = ::GetScEditWindow();
- if ( !pActiveEdWnd )
- return 0;
-
- if ( pBtn == &aBtnText )
- {
- pActiveEdWnd->SetCharAttriutes();
- }
- else
- {
- if ( pBtn == &aBtnPage )
- pActiveEdWnd->InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) );
- else if ( pBtn == &aBtnLastPage )
- pActiveEdWnd->InsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD) );
- else if ( pBtn == &aBtnDate )
- pActiveEdWnd->InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) );
- else if ( pBtn == &aBtnTime )
- pActiveEdWnd->InsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD) );
- else if ( pBtn == &aBtnFile )
- {
- pActiveEdWnd->InsertField( SvxFieldItem( SvxFileField(), EE_FEATURE_FIELD ) );
- }
- else if ( pBtn == &aBtnTable )
- pActiveEdWnd->InsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD) );
- }
- InsertToDefinedList();
- pActiveEdWnd->GrabFocus();
-
- return 0;
-}
-
-IMPL_LINK( ScHFEditPage, MenuHdl, ScExtIButton*, pBtn )
-{
- pActiveEdWnd = ::GetScEditWindow();
- if ( !pActiveEdWnd )
- return 0;
-
- if(pBtn!=NULL)
- {
- switch(pBtn->GetSelected())
- {
- case FILE_COMMAND_TITEL:
- pActiveEdWnd->InsertField( SvxFieldItem( SvxFileField(), EE_FEATURE_FIELD ) );
- break;
- case FILE_COMMAND_FILENAME:
- pActiveEdWnd->InsertField( SvxFieldItem( SvxExtFileField(
- EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_NAME_EXT ), EE_FEATURE_FIELD ) );
- break;
- case FILE_COMMAND_PATH:
- pActiveEdWnd->InsertField( SvxFieldItem( SvxExtFileField(
- EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_FULLPATH ), EE_FEATURE_FIELD ) );
- break;
- }
- }
- return 0;
-}
-
-//========================================================================
-// class ScRightHeaderEditPage
-//========================================================================
-
-ScRightHeaderEditPage::ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rCoreSet )
- : ScHFEditPage( pParent, RID_SCPAGE_HFED_HR, rCoreSet,
- rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_HEADERRIGHT ), true )
- {}
-
-// -----------------------------------------------------------------------
-
-sal_uInt16* ScRightHeaderEditPage::GetRanges()
- { return pPageRightHeaderRanges; }
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* ScRightHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
- { return ( new ScRightHeaderEditPage( pParent, rCoreSet ) ); };
-
-
-//========================================================================
-// class ScLeftHeaderEditPage
-//========================================================================
-
-ScLeftHeaderEditPage::ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rCoreSet )
- : ScHFEditPage( pParent, RID_SCPAGE_HFED_HL, rCoreSet,
- rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_HEADERLEFT ), true )
- {}
-
-// -----------------------------------------------------------------------
-
-sal_uInt16* ScLeftHeaderEditPage::GetRanges()
- { return pPageLeftHeaderRanges; }
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* ScLeftHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
- { return ( new ScLeftHeaderEditPage( pParent, rCoreSet ) ); };
-
-//========================================================================
-// class ScRightFooterEditPage
-//========================================================================
-
-ScRightFooterEditPage::ScRightFooterEditPage( Window* pParent, const SfxItemSet& rCoreSet )
- : ScHFEditPage( pParent, RID_SCPAGE_HFED_FR, rCoreSet,
- rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_FOOTERRIGHT ), false )
- {}
-
-// -----------------------------------------------------------------------
-
-sal_uInt16* ScRightFooterEditPage::GetRanges()
- { return pPageRightFooterRanges; }
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* ScRightFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
- { return ( new ScRightFooterEditPage( pParent, rCoreSet ) ); };
-
-//========================================================================
-// class ScLeftFooterEditPage
-//========================================================================
-
-ScLeftFooterEditPage::ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rCoreSet )
- : ScHFEditPage( pParent, RID_SCPAGE_HFED_FL, rCoreSet,
- rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_FOOTERLEFT ), false )
- {}
-
-// -----------------------------------------------------------------------
-
-sal_uInt16* ScLeftFooterEditPage::GetRanges()
- { return pPageLeftFooterRanges; }
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* ScLeftFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
- { return ( new ScLeftFooterEditPage( pParent, rCoreSet ) ); };
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
deleted file mode 100644
index 93e949f1e..000000000
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ /dev/null
@@ -1,334 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sc.hxx"
-
-#undef SC_DLLIMPLEMENTATION
-
-
-
-//------------------------------------------------------------------
-
-#define _TPHF_CXX
-#include "scitems.hxx"
-#include <sfx2/basedlgs.hxx>
-#include <svl/style.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/msgbox.hxx>
-
-#include "tphf.hxx"
-#include "sc.hrc"
-#include "globstr.hrc"
-#include "tabvwsh.hxx"
-#include "viewdata.hxx"
-#include "document.hxx"
-#include "hfedtdlg.hxx"
-#include "styledlg.hxx"
-#include "scresid.hxx"
-#include "scuitphfedit.hxx"
-#undef _TPHF_CXX
-
-
-
-//==================================================================
-// class ScHFPage
-//==================================================================
-
-ScHFPage::ScHFPage( Window* pParent, sal_uInt16 nResId,
- const SfxItemSet& rSet, sal_uInt16 nSetId )
-
- : SvxHFPage ( pParent, nResId, rSet, nSetId ),
- aBtnEdit ( this, ScResId( RID_SCBTN_HFEDIT ) ),
- aDataSet ( *rSet.GetPool(),
- ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERRIGHT,
- ATTR_PAGE, ATTR_PAGE, 0 ),
- nPageUsage ( (sal_uInt16)SVX_PAGE_ALL ),
- pStyleDlg ( NULL )
-{
- SetExchangeSupport();
-
- SfxViewShell* pSh = SfxViewShell::Current();
- ScTabViewShell* pViewSh = PTR_CAST(ScTabViewShell,pSh);
- Point aPos( aBackgroundBtn.GetPosPixel() );
-
- // aBackgroundBtn position not changed anymore
-
- aPos.X() += aBackgroundBtn.GetSizePixel().Width();
- aPos.X() += LogicToPixel( Size(3,0), MAP_APPFONT ).Width();
- aBtnEdit.SetPosPixel( aPos );
- aBtnEdit.Show();
-
- aDataSet.Put( rSet );
-
- if ( pViewSh )
- {
- ScViewData* pViewData = pViewSh->GetViewData();
- ScDocument* pDoc = pViewData->GetDocument();
-
- aStrPageStyle = pDoc->GetPageStyle( pViewData->GetTabNo() );
- }
-
- aBtnEdit.SetClickHdl ( LINK( this, ScHFPage, BtnHdl ) );
- aTurnOnBox.SetClickHdl ( LINK( this, ScHFPage, TurnOnHdl ) );
-
- if ( nId == SID_ATTR_PAGE_HEADERSET )
- aBtnEdit.SetHelpId( HID_SC_HEADER_EDIT );
- else
- aBtnEdit.SetHelpId( HID_SC_FOOTER_EDIT );
-
- aBtnEdit.SetAccessibleRelationMemberOf(&aFrm);
-}
-
-//------------------------------------------------------------------
-
-ScHFPage::~ScHFPage()
-{
-}
-
-//------------------------------------------------------------------
-
-void ScHFPage::Reset( const SfxItemSet& rSet )
-{
- SvxHFPage::Reset( rSet );
- TurnOnHdl( 0 );
-}
-
-//------------------------------------------------------------------
-
-sal_Bool ScHFPage::FillItemSet( SfxItemSet& rOutSet )
-{
- sal_Bool bResult = SvxHFPage::FillItemSet( rOutSet );
-
- if ( nId == SID_ATTR_PAGE_HEADERSET )
- {
- rOutSet.Put( aDataSet.Get( ATTR_PAGE_HEADERLEFT ) );
- rOutSet.Put( aDataSet.Get( ATTR_PAGE_HEADERRIGHT ) );
- }
- else
- {
- rOutSet.Put( aDataSet.Get( ATTR_PAGE_FOOTERLEFT ) );
- rOutSet.Put( aDataSet.Get( ATTR_PAGE_FOOTERRIGHT ) );
- }
-
- return bResult;
-}
-
-//------------------------------------------------------------------
-
-void ScHFPage::ActivatePage( const SfxItemSet& rSet )
-{
- sal_uInt16 nPageWhich = GetWhich( SID_ATTR_PAGE );
- const SvxPageItem& rPageItem = (const SvxPageItem&)
- rSet.Get(nPageWhich);
-
- nPageUsage = rPageItem.GetPageUsage();
-
- if ( pStyleDlg )
- aStrPageStyle = pStyleDlg->GetStyleSheet().GetName();
-
- aDataSet.Put( rSet.Get(ATTR_PAGE) );
-
- SvxHFPage::ActivatePage( rSet );
-}
-
-//------------------------------------------------------------------
-
-int ScHFPage::DeactivatePage( SfxItemSet* pSetP )
-{
- if ( LEAVE_PAGE == SvxHFPage::DeactivatePage( pSetP ) )
- if ( pSetP )
- FillItemSet( *pSetP );
-
- return LEAVE_PAGE;
-}
-
-//------------------------------------------------------------------
-
-void ScHFPage::ActivatePage()
-{
-}
-
-void ScHFPage::DeactivatePage()
-{
-}
-
-//------------------------------------------------------------------
-// Handler:
-//------------------------------------------------------------------
-
-IMPL_LINK( ScHFPage, TurnOnHdl, CheckBox*, EMPTYARG )
-{
- SvxHFPage::TurnOnHdl( &aTurnOnBox );
-
- if ( aTurnOnBox.IsChecked() )
- aBtnEdit.Enable();
- else
- aBtnEdit.Disable();
-
- return 0;
-}
-
-
-//------------------------------------------------------------------
-
-IMPL_LINK( ScHFPage, BtnHdl, PushButton*, EMPTYARG )
-{
- // Wenn der Bearbeiten-Dialog direkt aus dem Click-Handler des Buttons
- // aufgerufen wird, funktioniert im Bearbeiten-Dialog unter OS/2 das
- // GrabFocus nicht (Bug #41805#).
- // Mit dem neuen StarView sollte dieser Workaround wieder raus koennen!
-
- Application::PostUserEvent( LINK( this, ScHFPage, HFEditHdl ) );
- return 0;
-}
-
-IMPL_LINK( ScHFPage, HFEditHdl, void*, EMPTYARG )
-{
- SfxViewShell* pViewSh = SfxViewShell::Current();
-
- if ( !pViewSh )
- {
- OSL_FAIL( "Current ViewShell not found." );
- return 0;
- }
-
- if ( aCntSharedBox.IsEnabled()
- && !aCntSharedBox.IsChecked() )
- {
- sal_uInt16 nResId = ( nId == SID_ATTR_PAGE_HEADERSET )
- ? RID_SCDLG_HFED_HEADER
- : RID_SCDLG_HFED_FOOTER;
-
- ScHFEditDlg* pDlg
- = new ScHFEditDlg( pViewSh->GetViewFrame(), this,
- aDataSet, aStrPageStyle, nResId );
-
- if ( pDlg->Execute() == RET_OK )
- {
- aDataSet.Put( *pDlg->GetOutputItemSet() );
- }
-
- delete pDlg;
- }
- else
- {
- String aText;
- SfxSingleTabDialog* pDlg = new SfxSingleTabDialog( this, aDataSet, 42 );
- sal_Bool bRightPage = aCntSharedBox.IsChecked()
- || ( SVX_PAGE_LEFT != SvxPageUsage(nPageUsage) );
-
- if ( nId == SID_ATTR_PAGE_HEADERSET )
- {
- aText = ScGlobal::GetRscString( STR_PAGEHEADER );
- if ( bRightPage )
- pDlg->SetTabPage( ScRightHeaderEditPage::Create( pDlg, aDataSet ) );
- else
- pDlg->SetTabPage( ScLeftHeaderEditPage::Create( pDlg, aDataSet ) );
- }
- else
- {
- aText = ScGlobal::GetRscString( STR_PAGEFOOTER );
- if ( bRightPage )
- pDlg->SetTabPage( ScRightFooterEditPage::Create( pDlg, aDataSet ) );
- else
- pDlg->SetTabPage( ScLeftFooterEditPage::Create( pDlg, aDataSet ) );
- }
-
- SvxNumType eNumType = ((const SvxPageItem&)aDataSet.Get(ATTR_PAGE)).GetNumType();
- ((ScHFEditPage*)pDlg->GetTabPage())->SetNumType(eNumType);
-
- aText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " (" ));
- aText += ScGlobal::GetRscString( STR_PAGESTYLE );
- aText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
- aText += aStrPageStyle;
- aText += ')';
-
- pDlg->SetText( aText );
-
- if ( pDlg->Execute() == RET_OK )
- {
- aDataSet.Put( *pDlg->GetOutputItemSet() );
- }
-
- delete pDlg;
- }
-
- return 0;
-}
-
-//==================================================================
-// class ScHeaderPage
-//==================================================================
-
-ScHeaderPage::ScHeaderPage( Window* pParent, const SfxItemSet& rSet )
- : ScHFPage( pParent, RID_SVXPAGE_HEADER, rSet, SID_ATTR_PAGE_HEADERSET )
-{
-}
-
-//------------------------------------------------------------------
-
-SfxTabPage* ScHeaderPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
-{
- return ( new ScHeaderPage( pParent, rCoreSet ) );
-}
-
-//------------------------------------------------------------------
-
-sal_uInt16* ScHeaderPage::GetRanges()
-{
- return SvxHeaderPage::GetRanges();
-}
-
-//==================================================================
-// class ScFooterPage
-//==================================================================
-
-ScFooterPage::ScFooterPage( Window* pParent, const SfxItemSet& rSet )
- : ScHFPage( pParent, RID_SVXPAGE_FOOTER, rSet, SID_ATTR_PAGE_FOOTERSET )
-{
-}
-
-//------------------------------------------------------------------
-
-SfxTabPage* ScFooterPage::Create( Window* pParent, const SfxItemSet& rCoreSet )
-{
- return ( new ScFooterPage( pParent, rCoreSet ) );
-}
-
-//------------------------------------------------------------------
-
-sal_uInt16* ScFooterPage::GetRanges()
-{
- return SvxHeaderPage::GetRanges();
-}
-
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphf.src b/sc/source/ui/pagedlg/tphf.src
deleted file mode 100644
index d6cda1047..000000000
--- a/sc/source/ui/pagedlg/tphf.src
+++ /dev/null
@@ -1,37 +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 "sc.hrc"
-
-PushButton RID_SCBTN_HFEDIT
-{
- TabStop = TRUE ;
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Edit..." ;
-};
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
deleted file mode 100644
index c35049796..000000000
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ /dev/null
@@ -1,441 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sc.hxx"
-
-
-
-//------------------------------------------------------------------
-
-#define _TPHFEDIT_CXX
-#include "scitems.hxx"
-#include <editeng/eeitem.hxx>
-
-
-#include <editeng/editobj.hxx>
-#include <editeng/editstat.hxx>
-#include <editeng/editview.hxx>
-#include <editeng/flditem.hxx>
-#include <editeng/adjitem.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <sfx2/objsh.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/svapp.hxx>
-
-#include "tphfedit.hxx"
-#include "editutil.hxx"
-#include "global.hxx"
-#include "attrib.hxx"
-#include "patattr.hxx"
-#include "scresid.hxx"
-#include "sc.hrc"
-#include "globstr.hrc"
-#include "tabvwsh.hxx"
-#include "prevwsh.hxx"
-#include "hfedtdlg.hrc"
-#include "AccessibleEditObject.hxx"
-
-#include "scabstdlg.hxx"
-
-
-// STATIC DATA -----------------------------------------------------------
-static ScEditWindow* pActiveEdWnd = NULL;
-
-ScEditWindow* GetScEditWindow ()
-{
- return pActiveEdWnd;
-}
-
-//========================================================================
-
-void lcl_GetFieldData( ScHeaderFieldData& rData )
-{
- SfxViewShell* pShell = SfxViewShell::Current();
- if (pShell)
- {
- if (pShell->ISA(ScTabViewShell))
- ((ScTabViewShell*)pShell)->FillFieldData(rData);
- else if (pShell->ISA(ScPreviewShell))
- ((ScPreviewShell*)pShell)->FillFieldData(rData);
- }
-}
-
-//========================================================================
-// class ScEditWindow
-//========================================================================
-
-ScEditWindow::ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLocation eLoc )
- : Control( pParent, rResId ),
- eLocation(eLoc),
- pAcc(NULL)
-{
- EnableRTL(false);
-
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- Color aBgColor = rStyleSettings.GetWindowColor();
-
- SetMapMode( MAP_TWIP );
- SetPointer( POINTER_TEXT );
- SetBackground( aBgColor );
-
- Size aSize( GetOutputSize() );
- aSize.Height() *= 4;
-
- pEdEngine = new ScHeaderEditEngine( EditEngine::CreatePool(), sal_True );
- pEdEngine->SetPaperSize( aSize );
- pEdEngine->SetRefDevice( this );
-
- ScHeaderFieldData aData;
- lcl_GetFieldData( aData );
-
- // Feldbefehle:
- pEdEngine->SetData( aData );
- pEdEngine->SetControlWord( pEdEngine->GetControlWord() | EE_CNTRL_MARKFIELDS );
- mbRTL = ScGlobal::IsSystemRTL();
- if (mbRTL)
- pEdEngine->SetDefaultHorizontalTextDirection(EE_HTEXTDIR_R2L);
-
- pEdView = new EditView( pEdEngine, this );
- pEdView->SetOutputArea( Rectangle( Point(0,0), GetOutputSize() ) );
-
- pEdView->SetBackgroundColor( aBgColor );
- pEdEngine->InsertView( pEdView );
-}
-
-// -----------------------------------------------------------------------
-
-ScEditWindow::~ScEditWindow()
-{
- // delete Accessible object before deleting EditEngine and EditView
- if (pAcc)
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xTemp = xAcc;
- if (xTemp.is())
- pAcc->dispose();
- }
- delete pEdEngine;
- delete pEdView;
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::SetNumType(SvxNumType eNumType)
-{
- pEdEngine->SetNumType(eNumType);
- pEdEngine->UpdateFields();
-}
-
-// -----------------------------------------------------------------------
-
-EditTextObject* ScEditWindow::CreateTextObject()
-{
- // Absatzattribute zuruecksetzen
- // (GetAttribs beim Format-Dialog-Aufruf gibt immer gesetzte Items zurueck)
-
- const SfxItemSet& rEmpty = pEdEngine->GetEmptyItemSet();
- sal_uInt16 nParCnt = pEdEngine->GetParagraphCount();
- for (sal_uInt16 i=0; i<nParCnt; i++)
- pEdEngine->SetParaAttribs( i, rEmpty );
-
- return pEdEngine->CreateTextObject();
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::SetFont( const ScPatternAttr& rPattern )
-{
- SfxItemSet* pSet = new SfxItemSet( pEdEngine->GetEmptyItemSet() );
- rPattern.FillEditItemSet( pSet );
- // FillEditItemSet adjusts font height to 1/100th mm,
- // but for header/footer twips is needed, as in the PatternAttr:
- pSet->Put( rPattern.GetItem(ATTR_FONT_HEIGHT), EE_CHAR_FONTHEIGHT );
- pSet->Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CJK );
- pSet->Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CTL );
- if (mbRTL)
- pSet->Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
- pEdEngine->SetDefaults( pSet );
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::SetText( const EditTextObject& rTextObject )
-{
- pEdEngine->SetText( rTextObject );
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::InsertField( const SvxFieldItem& rFld )
-{
- pEdView->InsertField( rFld );
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::SetCharAttriutes()
-{
- SfxObjectShell* pDocSh = SfxObjectShell::Current();
-
- SfxViewShell* pViewSh = SfxViewShell::Current();
-
- ScTabViewShell* pTabViewSh = PTR_CAST(ScTabViewShell, SfxViewShell::Current());
-
-
- OSL_ENSURE( pDocSh, "Current DocShell not found" );
- OSL_ENSURE( pViewSh, "Current ViewShell not found" );
-
- if ( pDocSh && pViewSh )
- {
- if(pTabViewSh!=NULL) pTabViewSh->SetInFormatDialog(sal_True);
-
- SfxItemSet aSet( pEdView->GetAttribs() );
-
- ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
-
- SfxAbstractTabDialog* pDlg = pFact->CreateScCharDlg( GetParent(), &aSet,
- pDocSh,RID_SCDLG_CHAR );
- OSL_ENSURE(pDlg, "Dialog create fail!");
- pDlg->SetText( ScGlobal::GetRscString( STR_TEXTATTRS ) );
- if ( pDlg->Execute() == RET_OK )
- {
- aSet.ClearItem();
- aSet.Put( *pDlg->GetOutputItemSet() );
- pEdView->SetAttribs( aSet );
- }
-
- if(pTabViewSh!=NULL) pTabViewSh->SetInFormatDialog(false);
- delete pDlg;
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::Paint( const Rectangle& rRec )
-{
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- Color aBgColor = rStyleSettings.GetWindowColor();
-
- pEdView->SetBackgroundColor( aBgColor );
-
- SetBackground( aBgColor );
-
- Control::Paint( rRec );
-
- pEdView->Paint( rRec );
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::MouseMove( const MouseEvent& rMEvt )
-{
- pEdView->MouseMove( rMEvt );
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::MouseButtonDown( const MouseEvent& rMEvt )
-{
- if ( !HasFocus() )
- GrabFocus();
-
- pEdView->MouseButtonDown( rMEvt );
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::MouseButtonUp( const MouseEvent& rMEvt )
-{
- pEdView->MouseButtonUp( rMEvt );
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::KeyInput( const KeyEvent& rKEvt )
-{
- sal_uInt16 nKey = rKEvt.GetKeyCode().GetModifier()
- + rKEvt.GetKeyCode().GetCode();
-
- if ( nKey == KEY_TAB || nKey == KEY_TAB + KEY_SHIFT )
- {
- Control::KeyInput( rKEvt );
- }
- else if ( !pEdView->PostKeyEvent( rKEvt ) )
- {
- Control::KeyInput( rKEvt );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::Command( const CommandEvent& rCEvt )
-{
- pEdView->Command( rCEvt );
-}
-
-// -----------------------------------------------------------------------
-
-void ScEditWindow::GetFocus()
-{
- pActiveEdWnd = this;
-
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xTemp = xAcc;
- if (xTemp.is() && pAcc)
- {
- pAcc->GotFocus();
- }
- else
- pAcc = NULL;
-}
-
-void ScEditWindow::LoseFocus()
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xTemp = xAcc;
- if (xTemp.is() && pAcc)
- {
- pAcc->LostFocus();
- }
- else
- pAcc = NULL;
-}
-
-// -----------------------------------------------------------------------
-
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ScEditWindow::CreateAccessible()
-{
- String sName;
- String sDescription(GetHelpText());
- switch (eLocation)
- {
- case Left:
- {
- sName = String(ScResId(STR_ACC_LEFTAREA_NAME));
- }
- break;
- case Center:
- {
- sName = String(ScResId(STR_ACC_CENTERAREA_NAME));
- }
- break;
- case Right:
- {
- sName = String(ScResId(STR_ACC_RIGHTAREA_NAME));
- }
- break;
- }
- pAcc = new ScAccessibleEditObject(GetAccessibleParentWindow()->GetAccessible(), pEdView, this,
- rtl::OUString(sName), rtl::OUString(sDescription), EditControl);
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAccessible = pAcc;
- xAcc = xAccessible;
- return pAcc;
-}
-
-ScExtIButton::ScExtIButton(Window* pParent, const ResId& rResId )
-: ImageButton(pParent,rResId),
- pPopupMenu(NULL)
-{
- nSelected=0;
- aTimer.SetTimeout(600);
- SetDropDown( true);
-}
-
-void ScExtIButton::SetPopupMenu(ScPopupMenu* pPopUp)
-{
- pPopupMenu=pPopUp;
-}
-
-sal_uInt16 ScExtIButton::GetSelected()
-{
- return nSelected;
-}
-
-void ScExtIButton::MouseButtonDown( const MouseEvent& rMEvt )
-{
- if(!aTimer.IsActive())
- {
- aTimer.Start();
- aTimer.SetTimeoutHdl(LINK( this, ScExtIButton, TimerHdl));
- }
-
- ImageButton::MouseButtonDown(rMEvt );
-}
-void ScExtIButton::MouseButtonUp( const MouseEvent& rMEvt)
-{
- aTimer.Stop();
- aTimer.SetTimeoutHdl(Link());
- ImageButton::MouseButtonUp(rMEvt );
-}
-
-void ScExtIButton::Click()
-{
- aTimer.Stop();
- aTimer.SetTimeoutHdl(Link());
- ImageButton::Click();
-}
-
-void ScExtIButton::StartPopup()
-{
- nSelected=0;
-
- if(pPopupMenu!=NULL)
- {
- SetPressed( sal_True );
- EndSelection();
- Point aPoint(0,0);
- aPoint.Y()=GetOutputSizePixel().Height();
-
- nSelected=pPopupMenu->Execute( this, aPoint );
-
- if(nSelected)
- {
- aMLink.Call(this);
- }
- SetPressed( false);
- }
-}
-
-long ScExtIButton::PreNotify( NotifyEvent& rNEvt )
-{
- sal_uInt16 nSwitch=rNEvt.GetType();
- if(nSwitch==EVENT_MOUSEBUTTONUP)
- {
- MouseButtonUp(*rNEvt.GetMouseEvent());
- }
-
- return ImageButton::PreNotify(rNEvt );
-}
-
-IMPL_LINK( ScExtIButton, TimerHdl, Timer*, EMPTYARG )
-{
- StartPopup();
- return 0;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
deleted file mode 100644
index 5928506b2..000000000
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ /dev/null
@@ -1,570 +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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sc.hxx"
-
-#undef SC_DLLIMPLEMENTATION
-
-
-
-//------------------------------------------------------------------
-
-#include "scitems.hxx"
-
-#include "tptable.hxx"
-#include "global.hxx"
-#include "attrib.hxx"
-#include "scresid.hxx"
-#include "sc.hrc"
-#include "pagedlg.hrc"
-
-// =======================================================================
-
-void EmptyNumericField::Modify()
-{
- if( GetText().Len() )
- NumericField::Modify();
- else
- SetEmptyFieldValue();
-}
-
-void EmptyNumericField::SetValue( sal_Int64 nValue )
-{
- if( nValue == 0 )
- SetEmptyFieldValue();
- else
- NumericField::SetValue( nValue );
-}
-
-sal_Int64 EmptyNumericField::GetValue() const
-{
- return IsEmptyFieldValue() ? 0 : NumericField::GetValue();
-}
-
-// =======================================================================
-
-// STATIC DATA -----------------------------------------------------------
-
-static sal_uInt16 pPageTableRanges[] =
-{
- ATTR_PAGE_NOTES, ATTR_PAGE_FIRSTPAGENO,
- 0
-};
-
-sal_Bool lcl_PutVObjModeItem( sal_uInt16 nWhich,
- SfxItemSet& rCoreSet,
- const SfxItemSet& rOldSet,
- const CheckBox& rBtn );
-
-sal_Bool lcl_PutScaleItem( sal_uInt16 nWhich,
- SfxItemSet& rCoreSet,
- const SfxItemSet& rOldSet,
- const ListBox& rListBox,
- sal_uInt16 nLBEntry,
- const SpinField& rEd,
- sal_uInt16 nValue );
-
-sal_Bool lcl_PutScaleItem2( sal_uInt16 nWhich,
- SfxItemSet& rCoreSet,
- const SfxItemSet& rOldSet,
- const ListBox& rListBox,
- sal_uInt16 nLBEntry,
- const NumericField& rEd1,
- const NumericField& rEd2 );
-
-sal_Bool lcl_PutBoolItem( sal_uInt16 nWhich,
- SfxItemSet& rCoreSet,
- const SfxItemSet& rOldSet,
- sal_Bool bIsChecked,
- sal_Bool bSavedValue );
-
-//------------------------------------------------------------------------
-
-#define PAGENO_HDL LINK(this,ScTablePage,PageNoHdl)
-#define PAGEDIR_HDL LINK(this,ScTablePage,PageDirHdl)
-#define SCALE_HDL LINK(this,ScTablePage,ScaleHdl)
-
-#define WAS_DEFAULT(w,s) (SFX_ITEM_DEFAULT==(s).GetItemState((w),sal_True))
-#define GET_BOOL(sid,set) ((const SfxBoolItem&)((set).Get(GetWhich((sid))))).GetValue()
-#define GET_USHORT(sid,set) (sal_uInt16)((const SfxUInt16Item&)((set).Get(GetWhich((sid))))).GetValue()
-#define GET_SHOW(sid,set) ( ScVObjMode( ((const ScViewObjectModeItem&)((set).Get(GetWhich((sid))))).GetValue() ) \
- == VOBJ_MODE_SHOW )
-
-//========================================================================
-
-ScTablePage::ScTablePage( Window* pParent, const SfxItemSet& rCoreAttrs ) :
-
- SfxTabPage( pParent, ScResId( RID_SCPAGE_TABLE ), rCoreAttrs ),
-
- aFlPageDir ( this, ScResId( FL_PAGEDIR ) ),
- aBtnTopDown ( this, ScResId( BTN_TOPDOWN ) ),
- aBtnLeftRight ( this, ScResId( BTN_LEFTRIGHT ) ),
- aBmpPageDir ( this, ScResId( BMP_PAGEDIR ) ),
- aImgLeftRight ( ScResId( IMG_LEFTRIGHT ) ),
- aImgTopDown ( ScResId( IMG_TOPDOWN ) ),
- aBtnPageNo ( this, ScResId( BTN_PAGENO ) ),
- aEdPageNo ( this, ScResId( ED_PAGENO ) ),
- aFlPrint ( this, ScResId( FL_PRINT ) ),
- aBtnHeaders ( this, ScResId( BTN_HEADER ) ),
- aBtnGrid ( this, ScResId( BTN_GRID ) ),
- aBtnNotes ( this, ScResId( BTN_NOTES ) ),
- aBtnObjects ( this, ScResId( BTN_OBJECTS ) ),
- aBtnCharts ( this, ScResId( BTN_CHARTS ) ),
- aBtnDrawings ( this, ScResId( BTN_DRAWINGS ) ),
- aBtnFormulas ( this, ScResId( BTN_FORMULAS ) ),
- aBtnNullVals ( this, ScResId( BTN_NULLVALS ) ),
- aFlScale ( this, ScResId( FL_SCALE ) ),
- aFtScaleMode ( this, ScResId( FT_SCALEMODE ) ),
- aLbScaleMode ( this, ScResId( LB_SCALEMODE ) ),
- aFtScaleAll ( this, ScResId( FT_SCALEFACTOR ) ),
- aEdScaleAll ( this, ScResId( ED_SCALEALL ) ),
- aFtScalePageWidth ( this, ScResId( FT_SCALEPAGEWIDTH ) ),
- aEdScalePageWidth ( this, ScResId( ED_SCALEPAGEWIDTH ) ),
- aFtScalePageHeight ( this, ScResId( FT_SCALEPAGEHEIGHT ) ),
- aEdScalePageHeight ( this, ScResId( ED_SCALEPAGEHEIGHT ) ),
- aFtScalePageNum ( this, ScResId( FT_SCALEPAGENUM ) ),
- aEdScalePageNum ( this, ScResId( ED_SCALEPAGENUM ) )
-{
- SetExchangeSupport();
- aBtnPageNo.SetClickHdl( PAGENO_HDL );
- aBtnTopDown.SetClickHdl( PAGEDIR_HDL );
- aBtnLeftRight.SetClickHdl( PAGEDIR_HDL );
- aLbScaleMode.SetSelectHdl( SCALE_HDL );
-
- Size aBmpSize = Image( ScResId( IMG_LEFTRIGHT ) ).GetSizePixel();
- aBmpPageDir.SetOutputSizePixel( aBmpSize );
-
- FreeResource();
-
- aEdPageNo.SetAccessibleName(aBtnPageNo.GetText());
- aEdPageNo.SetAccessibleRelationLabeledBy(&aBtnPageNo);
-}
-
-// -----------------------------------------------------------------------
-
-void ScTablePage::ShowImage()
-{
- bool bLeftRight = aBtnLeftRight.IsChecked();
- aBmpPageDir.SetImage( (bLeftRight ? aImgLeftRight : aImgTopDown) );
-}
-
-// -----------------------------------------------------------------------
-
-ScTablePage::~ScTablePage()
-{
-}
-
-//------------------------------------------------------------------------
-
-sal_uInt16* ScTablePage::GetRanges()
-{
- return pPageTableRanges;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* ScTablePage::Create( Window* pParent, const SfxItemSet& rCoreSet )
-{
- return ( new ScTablePage( pParent, rCoreSet ) );
-}
-
-// -----------------------------------------------------------------------
-
-void ScTablePage::Reset( const SfxItemSet& rCoreSet )
-{
- sal_Bool bTopDown = GET_BOOL( SID_SCATTR_PAGE_TOPDOWN, rCoreSet );
- sal_uInt16 nWhich = 0;
-
- //-----------
- // sal_Bool-Flags
- //-----------
- aBtnNotes .Check( GET_BOOL(SID_SCATTR_PAGE_NOTES,rCoreSet) );
- aBtnGrid .Check( GET_BOOL(SID_SCATTR_PAGE_GRID,rCoreSet) );
- aBtnHeaders .Check( GET_BOOL(SID_SCATTR_PAGE_HEADERS,rCoreSet) );
- aBtnFormulas .Check( GET_BOOL(SID_SCATTR_PAGE_FORMULAS,rCoreSet) );
- aBtnNullVals .Check( GET_BOOL(SID_SCATTR_PAGE_NULLVALS,rCoreSet) );
- aBtnTopDown .Check( bTopDown );
- aBtnLeftRight .Check( !bTopDown );
-
- //------------------
- // Erste Druckseite:
- //------------------
- sal_uInt16 nPage = GET_USHORT(SID_SCATTR_PAGE_FIRSTPAGENO,rCoreSet);
- aBtnPageNo.Check( nPage != 0 );
- aEdPageNo.SetValue( (nPage != 0) ? nPage : 1 );
- PageNoHdl( NULL );
-
- //-------------------
- // Objektdarstellung:
- //-------------------
- aBtnCharts .Check( GET_SHOW( SID_SCATTR_PAGE_CHARTS, rCoreSet ) );
- aBtnObjects .Check( GET_SHOW( SID_SCATTR_PAGE_OBJECTS, rCoreSet ) );
- aBtnDrawings .Check( GET_SHOW( SID_SCATTR_PAGE_DRAWINGS, rCoreSet ) );
-
- //------------
- // Skalierung:
- //------------
-
- nWhich = GetWhich(SID_SCATTR_PAGE_SCALE);
- if ( rCoreSet.GetItemState( nWhich, sal_True ) >= SFX_ITEM_AVAILABLE )
- {
- sal_uInt16 nScale = ((const SfxUInt16Item&)rCoreSet.Get(nWhich)).GetValue();
- if( nScale > 0 )
- aLbScaleMode.SelectEntryPos( SC_TPTABLE_SCALE_PERCENT );
- aEdScaleAll.SetValue( (nScale > 0) ? nScale : 100 );
- }
-
- nWhich = GetWhich(SID_SCATTR_PAGE_SCALETO);
- if ( rCoreSet.GetItemState( nWhich, sal_True ) >= SFX_ITEM_AVAILABLE )
- {
- const ScPageScaleToItem& rItem = static_cast< const ScPageScaleToItem& >( rCoreSet.Get( nWhich ) );
- sal_uInt16 nWidth = rItem.GetWidth();
- sal_uInt16 nHeight = rItem.GetHeight();
-
- /* width==0 and height==0 is invalid state, used as "not selected".
- Dialog shows width=height=1 then. */
- bool bValid = nWidth || nHeight;
- if( bValid )
- aLbScaleMode.SelectEntryPos( SC_TPTABLE_SCALE_TO );
- aEdScalePageWidth.SetValue( bValid ? nWidth : 1 );
- aEdScalePageHeight.SetValue( bValid ? nHeight : 1 );
- }
-
- nWhich = GetWhich(SID_SCATTR_PAGE_SCALETOPAGES);
- if ( rCoreSet.GetItemState( nWhich, sal_True ) >= SFX_ITEM_AVAILABLE )
- {
- sal_uInt16 nPages = ((const SfxUInt16Item&)rCoreSet.Get(nWhich)).GetValue();
- if( nPages > 0 )
- aLbScaleMode.SelectEntryPos( SC_TPTABLE_SCALE_TO_PAGES );
- aEdScalePageNum.SetValue( (nPages > 0) ? nPages : 1 );
- }
-
- if( aLbScaleMode.GetSelectEntryCount() == 0 )
- {
- // fall back to 100%
- OSL_FAIL( "ScTablePage::Reset - missing scaling item" );
- aLbScaleMode.SelectEntryPos( SC_TPTABLE_SCALE_PERCENT );
- aEdScaleAll.SetValue( 100 );
- }
-
- PageDirHdl( NULL );
- ScaleHdl( NULL );
-
- // merken fuer FillItemSet
- aBtnFormulas .SaveValue();
- aBtnNullVals .SaveValue();
- aBtnNotes .SaveValue();
- aBtnGrid .SaveValue();
- aBtnHeaders .SaveValue();
- aBtnTopDown .SaveValue();
- aBtnLeftRight .SaveValue();
- aLbScaleMode .SaveValue();
- aBtnCharts .SaveValue();
- aBtnObjects .SaveValue();
- aBtnDrawings .SaveValue();
- aBtnPageNo .SaveValue();
- aEdPageNo .SaveValue();
- aEdScaleAll .SaveValue();
- aEdScalePageWidth.SaveValue();
- aEdScalePageHeight.SaveValue();
- aEdScalePageNum .SaveValue();
-}
-
-// -----------------------------------------------------------------------
-
-sal_Bool ScTablePage::FillItemSet( SfxItemSet& rCoreSet )
-{
- const SfxItemSet& rOldSet = GetItemSet();
- sal_uInt16 nWhichPageNo = GetWhich(SID_SCATTR_PAGE_FIRSTPAGENO);
- sal_Bool bDataChanged = false;
-
- //-----------
- // sal_Bool-Flags
- //-----------
-
- bDataChanged |= lcl_PutBoolItem( GetWhich(SID_SCATTR_PAGE_NOTES),
- rCoreSet, rOldSet,
- aBtnNotes.IsChecked(),
- aBtnNotes.GetSavedValue() != STATE_NOCHECK );
-
- bDataChanged |= lcl_PutBoolItem( GetWhich(SID_SCATTR_PAGE_GRID),
- rCoreSet, rOldSet,
- aBtnGrid.IsChecked(),
- aBtnGrid.GetSavedValue() != STATE_NOCHECK );
-
- bDataChanged |= lcl_PutBoolItem( GetWhich(SID_SCATTR_PAGE_HEADERS),
- rCoreSet, rOldSet,
- aBtnHeaders.IsChecked(),
- aBtnHeaders.GetSavedValue() != STATE_NOCHECK );
-
- bDataChanged |= lcl_PutBoolItem( GetWhich(SID_SCATTR_PAGE_TOPDOWN),
- rCoreSet, rOldSet,
- aBtnTopDown.IsChecked(),
- aBtnTopDown.GetSavedValue() );
-
- bDataChanged |= lcl_PutBoolItem( GetWhich(SID_SCATTR_PAGE_FORMULAS),
- rCoreSet, rOldSet,
- aBtnFormulas.IsChecked(),
- aBtnFormulas.GetSavedValue() != STATE_NOCHECK );
-
- bDataChanged |= lcl_PutBoolItem( GetWhich(SID_SCATTR_PAGE_NULLVALS),
- rCoreSet, rOldSet,
- aBtnNullVals.IsChecked(),
- aBtnNullVals.GetSavedValue() != STATE_NOCHECK );
-
- //------------------
- // Erste Druckseite:
- //------------------
- sal_Bool bUseValue = aBtnPageNo.IsChecked();
-
- if ( WAS_DEFAULT(nWhichPageNo,rOldSet)
- && ( (!bUseValue && bUseValue == aBtnPageNo.GetSavedValue())
- || ( bUseValue && bUseValue == aBtnPageNo.GetSavedValue()
- && aEdPageNo.GetText() == aEdPageNo.GetSavedValue() ) ) )
- {
- rCoreSet.ClearItem( nWhichPageNo );
- }
- else
- {
- sal_uInt16 nPage = (sal_uInt16)( aBtnPageNo.IsChecked()
- ? aEdPageNo.GetValue()
- : 0 );
-
- rCoreSet.Put( SfxUInt16Item( nWhichPageNo, nPage ) );
- bDataChanged = sal_True;
- }
-
- //-------------------
- // Objektdarstellung:
- //-------------------
-
- bDataChanged |= lcl_PutVObjModeItem( GetWhich(SID_SCATTR_PAGE_CHARTS),
- rCoreSet, rOldSet, aBtnCharts );
-
- bDataChanged |= lcl_PutVObjModeItem( GetWhich(SID_SCATTR_PAGE_OBJECTS),
- rCoreSet, rOldSet, aBtnObjects );
-
- bDataChanged |= lcl_PutVObjModeItem( GetWhich(SID_SCATTR_PAGE_DRAWINGS),
- rCoreSet, rOldSet, aBtnDrawings );
-
- //------------
- // Skalierung:
- //------------
-
- if( !aEdScalePageWidth.GetValue() && !aEdScalePageHeight.GetValue() )
- {
- aLbScaleMode.SelectEntryPos( SC_TPTABLE_SCALE_PERCENT );
- aEdScaleAll.SetValue( 100 );
- }
-
- bDataChanged |= lcl_PutScaleItem( GetWhich(SID_SCATTR_PAGE_SCALE),
- rCoreSet, rOldSet,
- aLbScaleMode, SC_TPTABLE_SCALE_PERCENT,
- aEdScaleAll, (sal_uInt16)aEdScaleAll.GetValue() );
-
- bDataChanged |= lcl_PutScaleItem2( GetWhich(SID_SCATTR_PAGE_SCALETO),
- rCoreSet, rOldSet,
- aLbScaleMode, SC_TPTABLE_SCALE_TO,
- aEdScalePageWidth, aEdScalePageHeight );
-
- bDataChanged |= lcl_PutScaleItem( GetWhich(SID_SCATTR_PAGE_SCALETOPAGES),
- rCoreSet, rOldSet,
- aLbScaleMode, SC_TPTABLE_SCALE_TO_PAGES,
- aEdScalePageNum, (sal_uInt16)aEdScalePageNum.GetValue() );
-
- return bDataChanged;
-}
-
-//------------------------------------------------------------------------
-
-int ScTablePage::DeactivatePage( SfxItemSet* pSetP )
-{
- if ( pSetP )
- FillItemSet( *pSetP );
-
- return LEAVE_PAGE;
-}
-
-//------------------------------------------------------------------------
-
-void ScTablePage::DataChanged( const DataChangedEvent& rDCEvt )
-{
- if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
- ShowImage();
- SfxTabPage::DataChanged( rDCEvt );
-}
-
-//------------------------------------------------------------------------
-// Handler:
-//------------------------------------------------------------------------
-
-IMPL_LINK( ScTablePage, PageDirHdl, RadioButton*, EMPTYARG )
-{
- ShowImage();
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( ScTablePage, PageNoHdl, CheckBox*, pBtn )
-{
- if ( aBtnPageNo.IsChecked() )
- {
- aEdPageNo.Enable();
- if ( pBtn )
- aEdPageNo.GrabFocus();
- }
- else
- aEdPageNo.Disable();
-
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( ScTablePage, ScaleHdl, ListBox*, EMPTYARG )
-{
- // controls for "Reduce/enlarge"
- bool bPercent = (aLbScaleMode.GetSelectEntryPos() == SC_TPTABLE_SCALE_PERCENT);
- aFtScaleAll.Show( bPercent );
- aEdScaleAll.Show( bPercent );
-
- // controls for "Scale to width/height"
- bool bScaleTo = (aLbScaleMode.GetSelectEntryPos() == SC_TPTABLE_SCALE_TO);
- aFtScalePageWidth.Show( bScaleTo );
- aEdScalePageWidth.Show( bScaleTo );
- aFtScalePageHeight.Show( bScaleTo );
- aEdScalePageHeight.Show( bScaleTo );
-
- // controls for "Scale to pages"
- bool bScalePages = (aLbScaleMode.GetSelectEntryPos() == SC_TPTABLE_SCALE_TO_PAGES);
- aFtScalePageNum.Show( bScalePages );
- aEdScalePageNum.Show( bScalePages );
-
- return 0;
-}
-
-//========================================================================
-// Hilfsfunktionen fuer FillItemSet:
-//========================================================================
-
-sal_Bool lcl_PutBoolItem( sal_uInt16 nWhich,
- SfxItemSet& rCoreSet,
- const SfxItemSet& rOldSet,
- sal_Bool bIsChecked,
- sal_Bool bSavedValue )
-{
- sal_Bool bDataChanged = ( bSavedValue == bIsChecked
- && WAS_DEFAULT(nWhich,rOldSet) );
-
- if ( bDataChanged )
- rCoreSet.ClearItem(nWhich);
- else
- rCoreSet.Put( SfxBoolItem( nWhich, bIsChecked ) );
-
- return bDataChanged;
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool lcl_PutVObjModeItem( sal_uInt16 nWhich,
- SfxItemSet& rCoreSet,
- const SfxItemSet& rOldSet,
- const CheckBox& rBtn )
-{
- sal_Bool bIsChecked = rBtn.IsChecked();
- sal_Bool bDataChanged = ( rBtn.GetSavedValue() == bIsChecked
- && WAS_DEFAULT(nWhich,rOldSet) );
-
- if ( bDataChanged )
- rCoreSet.ClearItem( nWhich );
-
- else
- rCoreSet.Put( ScViewObjectModeItem( nWhich, bIsChecked
- ? VOBJ_MODE_SHOW
- : VOBJ_MODE_HIDE ) );
- return bDataChanged;
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool lcl_PutScaleItem( sal_uInt16 nWhich,
- SfxItemSet& rCoreSet,
- const SfxItemSet& rOldSet,
- const ListBox& rListBox,
- sal_uInt16 nLBEntry,
- const SpinField& rEd,
- sal_uInt16 nValue )
-{
- sal_Bool bIsSel = (rListBox.GetSelectEntryPos() == nLBEntry);
- sal_Bool bDataChanged = (rListBox.GetSavedValue() != nLBEntry) ||
- (rEd.GetSavedValue() != rEd.GetText()) ||
- !WAS_DEFAULT( nWhich, rOldSet );
-
- if( bDataChanged )
- rCoreSet.Put( SfxUInt16Item( nWhich, bIsSel ? nValue : 0 ) );
- else
- rCoreSet.ClearItem( nWhich );
-
- return bDataChanged;
-}
-
-
-sal_Bool lcl_PutScaleItem2( sal_uInt16 nWhich,
- SfxItemSet& rCoreSet,
- const SfxItemSet& rOldSet,
- const ListBox& rListBox,
- sal_uInt16 nLBEntry,
- const NumericField& rEd1,
- const NumericField& rEd2 )
-{
- sal_uInt16 nValue1 = (sal_uInt16)rEd1.GetValue();
- sal_uInt16 nValue2 = (sal_uInt16)rEd2.GetValue();
- sal_Bool bIsSel = (rListBox.GetSelectEntryPos() == nLBEntry);
- sal_Bool bDataChanged = (rListBox.GetSavedValue() != nLBEntry) ||
- (rEd1.GetSavedValue() != rEd1.GetText()) ||
- (rEd2.GetSavedValue() != rEd2.GetText()) ||
- !WAS_DEFAULT( nWhich, rOldSet );
-
- if( bDataChanged )
- {
- ScPageScaleToItem aItem;
- if( bIsSel )
- aItem.Set( nValue1, nValue2 );
- rCoreSet.Put( aItem );
- }
- else
- rCoreSet.ClearItem( nWhich );
-
- return bDataChanged;
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */