diff options
Diffstat (limited to 'sw/source/ui/dialog')
26 files changed, 0 insertions, 8871 deletions
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx deleted file mode 100644 index 3614cf2044..0000000000 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ /dev/null @@ -1,866 +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_sw.hxx" - -#include <SwSpellDialogChildWindow.hxx> -#include <vcl/msgbox.hxx> -#include <editeng/svxacorr.hxx> -#include <editeng/acorrcfg.hxx> -#include <svx/svxids.hrc> -#include <sfx2/app.hxx> -#include <sfx2/bindings.hxx> -#include <sfx2/dispatch.hxx> -#include <editeng/unolingu.hxx> -#include <editeng/editeng.hxx> -#include <editeng/editview.hxx> -#include <wrtsh.hxx> -#include <sfx2/printer.hxx> -#include <svx/svdoutl.hxx> -#include <svx/svdview.hxx> -#include <svx/svditer.hxx> -#include <svx/svdogrp.hxx> -#include <unotools/linguprops.hxx> -#include <unotools/lingucfg.hxx> -#include <doc.hxx> -#include <docsh.hxx> -#include <docary.hxx> -#include <frmfmt.hxx> -#include <dcontact.hxx> -#include <edtwin.hxx> -#include <pam.hxx> -#include <drawbase.hxx> -#include <unotextrange.hxx> -#include <dialog.hrc> -#include <cmdid.h> - - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::text; -using namespace ::com::sun::star::linguistic2; -using namespace ::com::sun::star::beans; - -SFX_IMPL_CHILDWINDOW(SwSpellDialogChildWindow, FN_SPELL_GRAMMAR_DIALOG) - - -#define SPELL_START_BODY 0 // body text area -#define SPELL_START_OTHER 1 // frame, footnote, header, footer -#define SPELL_START_DRAWTEXT 2 // started in a draw text object - -struct SpellState -{ - bool m_bInitialCall; - bool m_bLockFocus; //lock the focus notification while a modal dialog is active - bool m_bLostFocus; - - //restart and progress information - sal_uInt16 m_SpellStartPosition; - bool m_bBodySpelled; //body already spelled - bool m_bOtherSpelled; //frames, footnotes, headers and footers spelled - bool m_bStartedInOther; //started the spelling insided of the _other_ area - bool m_bStartedInSelection; // there was an initial text selection - SwPaM* pOtherCursor; // position where the spelling inside the _other_ area started - bool m_bDrawingsSpelled; //all drawings spelled - Reference<XTextRange> m_xStartRange; //text range that marks the start of spelling - const SdrObject* m_pStartDrawing; //draw text object spelling started in - ESelection m_aStartDrawingSelection; //draw text start selection - bool m_bRestartDrawing; // the first selected drawing object is found again - - //lose/get focus information to decide if spelling can be continued - ShellModes m_eSelMode; - const SwNode* m_pPointNode; - const SwNode* m_pMarkNode; - xub_StrLen m_nPointPos; - xub_StrLen m_nMarkPos; - const SdrOutliner* m_pOutliner; - ESelection m_aESelection; - - //iterating over draw text objects - std::list<SdrTextObj*> m_aTextObjects; - bool m_bTextObjectsCollected; - - SpellState() : - m_bInitialCall(true), - m_bLockFocus(false), - m_bLostFocus(false), - m_SpellStartPosition(SPELL_START_BODY), - m_bBodySpelled(false), - m_bOtherSpelled(false), - m_bStartedInOther(false), - m_bStartedInSelection(false), - pOtherCursor(0), - m_bDrawingsSpelled(false), - m_pStartDrawing(0), - m_bRestartDrawing(false), - - m_eSelMode(SHELL_MODE_OBJECT), //initially invalid - m_pPointNode(0), - m_pMarkNode(0), - m_nPointPos(0), - m_nMarkPos(0), - m_pOutliner(0), - m_bTextObjectsCollected(false) - {} - - ~SpellState() {delete pOtherCursor;} - - // reset state in ::InvalidateSpellDialog - void Reset() - { m_bInitialCall = true; - m_bBodySpelled = m_bOtherSpelled = m_bDrawingsSpelled = false; - m_xStartRange = 0; - m_pStartDrawing = 0; - m_bRestartDrawing = false; - m_bTextObjectsCollected = false; - m_aTextObjects.clear(); - m_bStartedInOther = false; - delete pOtherCursor; - pOtherCursor = 0; - } -}; - -void lcl_LeaveDrawText(SwWrtShell& rSh) -{ - if(rSh.GetDrawView()) - { - rSh.GetDrawView()->SdrEndTextEdit( sal_True ); - Point aPt(LONG_MIN, LONG_MIN); - //go out of the frame - rSh.SelectObj(aPt, SW_LEAVE_FRAME); - rSh.EnterStdMode(); - rSh.GetView().AttrChangedNotify(&rSh); - } -} - -SwSpellDialogChildWindow::SwSpellDialogChildWindow ( - Window* _pParent, - sal_uInt16 nId, - SfxBindings* pBindings, - SfxChildWinInfo* pInfo) : - svx::SpellDialogChildWindow ( - _pParent, nId, pBindings, pInfo), - m_pSpellState(new SpellState) -{ - - String aPropName( String::CreateFromAscii(UPN_IS_GRAMMAR_INTERACTIVE ) ); - SvtLinguConfig().GetProperty( aPropName ) >>= m_bIsGrammarCheckingOn; -} - -SwSpellDialogChildWindow::~SwSpellDialogChildWindow () -{ - SwWrtShell* pWrtShell = GetWrtShell_Impl(); - if(!m_pSpellState->m_bInitialCall && pWrtShell) - pWrtShell->SpellEnd(); - delete m_pSpellState; -} - - -SfxChildWinInfo SwSpellDialogChildWindow::GetInfo (void) const -{ - SfxChildWinInfo aInfo = svx::SpellDialogChildWindow::GetInfo(); - aInfo.bVisible = sal_False; - return aInfo; -} - - -svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck) -{ - svx::SpellPortions aRet; - SwWrtShell* pWrtShell = GetWrtShell_Impl(); - if(pWrtShell) - { - if (!bRecheck) - { - // first set continuation point for spell/grammar check to the - // end of the current sentence - pWrtShell->MoveContinuationPosToEndOfCheckedSentence(); - } - - ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); - bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode; - bool bNormalText = - SHELL_MODE_TABLE_TEXT == eSelMode || - SHELL_MODE_LIST_TEXT == eSelMode || - SHELL_MODE_TABLE_LIST_TEXT == eSelMode || - SHELL_MODE_TEXT == eSelMode; - //Writer text outside of the body - bool bOtherText = false; - - if( m_pSpellState->m_bInitialCall ) - { - //if no text selection exists the cursor has to be set into the text - if(!bDrawText && !bNormalText) - { - if(!MakeTextSelection_Impl(*pWrtShell, eSelMode)) - return aRet; - else - { - // the selection type has to be checked again - both text types are possible - if(0 != (pWrtShell->GetSelectionType()& nsSelectionType::SEL_DRW_TXT)) - bDrawText = true; - bNormalText = !bDrawText; - } - } - if(bNormalText) - { - //set cursor to the start of the sentence - if(!pWrtShell->HasSelection()) - pWrtShell->GoStartSentence(); - else - { - pWrtShell->ExpandToSentenceBorders(); - m_pSpellState->m_bStartedInSelection = true; - } - //determine if the selection is outside of the body text - bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY); - m_pSpellState->m_SpellStartPosition = bOtherText ? SPELL_START_OTHER : SPELL_START_BODY; - if(bOtherText) - { - m_pSpellState->pOtherCursor = new SwPaM(*pWrtShell->GetCrsr()->GetPoint()); - m_pSpellState->m_bStartedInOther = true; - pWrtShell->SpellStart( DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_CURR, sal_False ); - } - else - { - SwPaM* pCrsr = pWrtShell->GetCrsr(); - //mark the start position only if not at start of doc - if(!pWrtShell->IsStartOfDoc()) - { - m_pSpellState->m_xStartRange = - SwXTextRange::CreateXTextRange( - *pWrtShell->GetDoc(), - *pCrsr->Start(), pCrsr->End()); - } - pWrtShell->SpellStart( DOCPOS_START, DOCPOS_END, DOCPOS_CURR, sal_False ); - } - } - else - { - SdrView* pSdrView = pWrtShell->GetDrawView(); - m_pSpellState->m_SpellStartPosition = SPELL_START_DRAWTEXT; - m_pSpellState->m_pStartDrawing = pSdrView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); - OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); - // start checking at the top of the drawing object - pOLV->SetSelection( ESelection() ); - m_pSpellState->m_aStartDrawingSelection = ESelection(); -/* -Note: spelling in a selection only, or starting in a mid of a drawing object requires -further changes elsewhere. (Especially if it should work in sc and sd as well.) -The code below would only be part of the solution. -(Keeping it a as a comment for the time being) - ESelection aCurSel( pOLV->GetSelection() ); - ESelection aSentenceSel( pOLV->GetEditView().GetEditEngine()->SelectSentence( aCurSel ) ); - if (!aCurSel.HasRange()) - { - aSentenceSel.nEndPara = aSentenceSel.nStartPara; - aSentenceSel.nEndPos = aSentenceSel.nStartPos; - } - pOLV->SetSelection( aSentenceSel ); - m_pSpellState->m_aStartDrawingSelection = aSentenceSel; -*/ - } - - m_pSpellState->m_bInitialCall = false; - } - if( bDrawText ) - { - // spell inside of the current draw text - if(!SpellDrawText_Impl(*pWrtShell, aRet)) - { - if(!FindNextDrawTextError_Impl(*pWrtShell) || !SpellDrawText_Impl(*pWrtShell, aRet)) - { - lcl_LeaveDrawText(*pWrtShell); - //now the drawings have been spelled - m_pSpellState->m_bDrawingsSpelled = true; - //the spelling continues at the other content - //if there's any that has not been spelled yet - if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt()) - { - pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART, sal_False ); - if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) - { - pWrtShell->SpellEnd(); - m_pSpellState->m_bOtherSpelled = true; - } - } - else - m_pSpellState->m_bOtherSpelled = true; - //if no result has been found try at the body text - completely - if(!m_pSpellState->m_bBodySpelled && !aRet.size()) - { - pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START, sal_False ); - if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) - { - m_pSpellState->m_bBodySpelled = true; - pWrtShell->SpellEnd(); - } - } - - } - } - } - else - { - //spell inside of the Writer text - if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) - { - // if there is a selection (within body or header/footer text) - // then spell/grammar checking should not move outside of it. - if (!m_pSpellState->m_bStartedInSelection) - { - //find out which text has been spelled body or other - bOtherText = !(pWrtShell->GetFrmType(0,sal_True) & FRMTYPE_BODY); - if(bOtherText && m_pSpellState->m_bStartedInOther && m_pSpellState->pOtherCursor) - { - m_pSpellState->m_bStartedInOther = false; - pWrtShell->SetSelection(*m_pSpellState->pOtherCursor); - pWrtShell->SpellEnd(); - delete m_pSpellState->pOtherCursor; - m_pSpellState->pOtherCursor = 0; - pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_CURR, DOCPOS_OTHERSTART, sal_False ); - pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn); - } - if(!aRet.size()) - { - //end spelling - pWrtShell->SpellEnd(); - if(bOtherText) - { - m_pSpellState->m_bOtherSpelled = true; - //has the body been spelled? - if(!m_pSpellState->m_bBodySpelled) - { - pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START, sal_False ); - if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) - { - m_pSpellState->m_bBodySpelled = true; - pWrtShell->SpellEnd(); - } - } - } - else - { - m_pSpellState->m_bBodySpelled = true; - if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt()) - { - pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART, sal_False ); - if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) - { - pWrtShell->SpellEnd(); - m_pSpellState->m_bOtherSpelled = true; - } - } - else - m_pSpellState->m_bOtherSpelled = true; - } - } - - //search for a draw text object that contains error and spell it - if(!aRet.size() && - (m_pSpellState->m_bDrawingsSpelled || - !FindNextDrawTextError_Impl(*pWrtShell) || !SpellDrawText_Impl(*pWrtShell, aRet))) - { - lcl_LeaveDrawText(*pWrtShell); - m_pSpellState->m_bDrawingsSpelled = true; - } - } - } - } - // now only the rest of the body text can be spelled - - // if the spelling started inside of the body - // - bool bCloseMessage = true; - if(!aRet.size() && !m_pSpellState->m_bStartedInSelection) - { - OSL_ENSURE(m_pSpellState->m_bDrawingsSpelled && - m_pSpellState->m_bOtherSpelled && m_pSpellState->m_bBodySpelled, - "not all parts of the document are already spelled"); - if(m_pSpellState->m_xStartRange.is()) - { - LockFocusNotification( true ); - sal_uInt16 nRet = QueryBox( GetWindow(), SW_RES(RID_QB_SPELL_CONTINUE)).Execute(); - if(RET_YES == nRet) - { - SwUnoInternalPaM aPam(*pWrtShell->GetDoc()); - if (::sw::XTextRangeToSwPaM(aPam, - m_pSpellState->m_xStartRange)) - { - pWrtShell->SetSelection(aPam); - pWrtShell->SpellStart(DOCPOS_START, DOCPOS_CURR, DOCPOS_START); - if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) - pWrtShell->SpellEnd(); - } - m_pSpellState->m_xStartRange = 0; - LockFocusNotification( false ); - //take care that the now valid selection is stored - LoseFocus(); - } - else - bCloseMessage = false; //no closing message if a wrap around has been denied - } - } - if(!aRet.size()) - { - if(bCloseMessage) - { - LockFocusNotification( true ); - String sInfo(SW_RES(STR_SPELLING_COMPLETED)); - //#i84610# - Window* pTemp = GetWindow(); // temporary needed for g++ 3.3.5 - InfoBox(pTemp, sInfo ).Execute(); - LockFocusNotification( false ); - //take care that the now valid selection is stored - LoseFocus(); - } - - //close the spelling dialog - GetBindings().GetDispatcher()->Execute(FN_SPELL_GRAMMAR_DIALOG, SFX_CALLMODE_ASYNCHRON); - } - } - return aRet; - -} - -void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rChanged, bool bRecheck) -{ - SwWrtShell* pWrtShell = GetWrtShell_Impl(); - OSL_ENSURE(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume"); - if(pWrtShell && !m_pSpellState->m_bInitialCall) - { - ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); - bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode; - bool bNormalText = - SHELL_MODE_TABLE_TEXT == eSelMode || - SHELL_MODE_LIST_TEXT == eSelMode || - SHELL_MODE_TABLE_LIST_TEXT == eSelMode || - SHELL_MODE_TEXT == eSelMode; - - // evaluate if the same sentence should be rechecked or not. - // Sentences that got grammar checked should always be rechecked in order - // to detect possible errors that get introduced with the changes - bRecheck |= pWrtShell->HasLastSentenceGotGrammarChecked(); - - if(bNormalText) - pWrtShell->ApplyChangedSentence(rChanged, bRecheck); - else if(bDrawText ) - { - SdrView* pDrView = pWrtShell->GetDrawView(); - SdrOutliner *pOutliner = pDrView->GetTextEditOutliner(); - pOutliner->ApplyChangedSentence(pDrView->GetTextEditOutlinerView()->GetEditView(), rChanged, bRecheck); - } - } -} - -void SwSpellDialogChildWindow::AddAutoCorrection( - const String& rOld, const String& rNew, LanguageType eLanguage) -{ - SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect(); - pACorr->PutText( rOld, rNew, eLanguage ); -} - -bool SwSpellDialogChildWindow::HasAutoCorrection() -{ - return true; -} - -bool SwSpellDialogChildWindow::HasGrammarChecking() -{ - return SvtLinguConfig().HasGrammarChecker(); -} - -bool SwSpellDialogChildWindow::IsGrammarChecking() -{ - return m_bIsGrammarCheckingOn; -} - -void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn) -{ - uno::Any aVal; - aVal <<= bOn; - m_bIsGrammarCheckingOn = bOn; - String aPropName( C2S(UPN_IS_GRAMMAR_INTERACTIVE ) ); - SvtLinguConfig().SetProperty( aPropName, aVal ); - // set current spell position to the start of the current sentence to - // continue with this sentence after grammar checking state has been changed - SwWrtShell* pWrtShell = GetWrtShell_Impl(); - if(pWrtShell) - { - ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); - bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode; - bool bNormalText = - SHELL_MODE_TABLE_TEXT == eSelMode || - SHELL_MODE_LIST_TEXT == eSelMode || - SHELL_MODE_TABLE_LIST_TEXT == eSelMode || - SHELL_MODE_TEXT == eSelMode; - if( bNormalText ) - pWrtShell->PutSpellingToSentenceStart(); - else if( bDrawText ) - { - SdrView* pSdrView = pWrtShell->GetDrawView(); - SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : 0; - OSL_ENSURE(pOutliner, "No Outliner in SwSpellDialogChildWindow::SetGrammarChecking"); - if(pOutliner) - { - pOutliner->PutSpellingToSentenceStart( pSdrView->GetTextEditOutlinerView()->GetEditView() ); - } - } - } -} - -void SwSpellDialogChildWindow::GetFocus() -{ - if(m_pSpellState->m_bLockFocus) - return; - bool bInvalidate = false; - SwWrtShell* pWrtShell = GetWrtShell_Impl(); - if(pWrtShell && !m_pSpellState->m_bInitialCall) - { - ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); - if(eSelMode != m_pSpellState->m_eSelMode) - { - //prevent initial invalidation - if(m_pSpellState->m_bLostFocus) - bInvalidate = true; - } - else - { - switch(m_pSpellState->m_eSelMode) - { - case SHELL_MODE_TEXT: - case SHELL_MODE_LIST_TEXT: - case SHELL_MODE_TABLE_TEXT: - case SHELL_MODE_TABLE_LIST_TEXT: - { - SwPaM* pCursor = pWrtShell->GetCrsr(); - if(m_pSpellState->m_pPointNode != pCursor->GetNode(sal_True) || - m_pSpellState->m_pMarkNode != pCursor->GetNode(sal_False)|| - m_pSpellState->m_nPointPos != pCursor->GetPoint()->nContent.GetIndex()|| - m_pSpellState->m_nMarkPos != pCursor->GetMark()->nContent.GetIndex()) - bInvalidate = true; - } - break; - case SHELL_MODE_DRAWTEXT: - { - SdrView* pSdrView = pWrtShell->GetDrawView(); - SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : 0; - if(!pOutliner || m_pSpellState->m_pOutliner != pOutliner) - bInvalidate = true; - else - { - OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); - OSL_ENSURE(pOLV, "no OutlinerView in SwSpellDialogChildWindow::GetFocus()"); - if(!pOLV || !m_pSpellState->m_aESelection.IsEqual(pOLV->GetSelection())) - bInvalidate = true; - } - } - break; - default: bInvalidate = true; - } - } - } - else - { - bInvalidate = true; - } - if(bInvalidate) - InvalidateSpellDialog(); -} - -void SwSpellDialogChildWindow::LoseFocus() -{ - //prevent initial invalidation - m_pSpellState->m_bLostFocus = true; - if(m_pSpellState->m_bLockFocus) - return; - SwWrtShell* pWrtShell = GetWrtShell_Impl(); - if(pWrtShell) - { - m_pSpellState->m_eSelMode = pWrtShell->GetView().GetShellMode(); - m_pSpellState->m_pPointNode = m_pSpellState->m_pMarkNode = 0; - m_pSpellState->m_nPointPos = m_pSpellState->m_nMarkPos = 0; - m_pSpellState->m_pOutliner = 0; - - switch(m_pSpellState->m_eSelMode) - { - case SHELL_MODE_TEXT: - case SHELL_MODE_LIST_TEXT: - case SHELL_MODE_TABLE_TEXT: - case SHELL_MODE_TABLE_LIST_TEXT: - { - //store a node pointer and a pam-position to be able to check on next GetFocus(); - SwPaM* pCursor = pWrtShell->GetCrsr(); - m_pSpellState->m_pPointNode = pCursor->GetNode(sal_True); - m_pSpellState->m_pMarkNode = pCursor->GetNode(sal_False); - m_pSpellState->m_nPointPos = pCursor->GetPoint()->nContent.GetIndex(); - m_pSpellState->m_nMarkPos = pCursor->GetMark()->nContent.GetIndex(); - - } - break; - case SHELL_MODE_DRAWTEXT: - { - SdrView* pSdrView = pWrtShell->GetDrawView(); - SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner(); - m_pSpellState->m_pOutliner = pOutliner; - OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); - OSL_ENSURE(pOutliner && pOLV, "no Outliner/OutlinerView in SwSpellDialogChildWindow::LoseFocus()"); - if(pOLV) - { - m_pSpellState->m_aESelection = pOLV->GetSelection(); - } - } - break; - default:;//prevent warning - } - } - else - m_pSpellState->m_eSelMode = SHELL_MODE_OBJECT; -} - -void SwSpellDialogChildWindow::InvalidateSpellDialog() -{ - SwWrtShell* pWrtShell = GetWrtShell_Impl(); - if(!m_pSpellState->m_bInitialCall && pWrtShell) - pWrtShell->SpellEnd(0, false); - m_pSpellState->Reset(); - svx::SpellDialogChildWindow::InvalidateSpellDialog(); -} - -SwWrtShell* SwSpellDialogChildWindow::GetWrtShell_Impl() -{ - SfxDispatcher* pDispatch = GetBindings().GetDispatcher(); - SwView* pView = 0; - if(pDispatch) - { - sal_uInt16 nShellIdx = 0; - SfxShell* pShell; - while(0 != (pShell = pDispatch->GetShell(nShellIdx++))) - if(pShell->ISA(SwView)) - { - pView = static_cast<SwView* >(pShell); - break; - } - } - return pView ? pView->GetWrtShellPtr(): 0; -} - -/*------------------------------------------------------------------------- - set the cursor into the body text - necessary if any object is selected - on start of the spelling dialog - -----------------------------------------------------------------------*/ -bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellModes eSelMode) -{ - SwView& rView = rShell.GetView(); - switch(eSelMode) - { - case SHELL_MODE_TEXT: - case SHELL_MODE_LIST_TEXT: - case SHELL_MODE_TABLE_TEXT: - case SHELL_MODE_TABLE_LIST_TEXT: - case SHELL_MODE_DRAWTEXT: - OSL_FAIL("text already active in SwSpellDialogChildWindow::MakeTextSelection_Impl()"); - break; - - case SHELL_MODE_FRAME: - { - rShell.UnSelectFrm(); - rShell.LeaveSelFrmMode(); - rView.AttrChangedNotify(&rShell); - } - break; - - case SHELL_MODE_DRAW: - case SHELL_MODE_DRAW_CTRL: - case SHELL_MODE_DRAW_FORM: - case SHELL_MODE_BEZIER: - if(FindNextDrawTextError_Impl(rShell)) - { - rView.AttrChangedNotify(&rShell); - break; - } - //otherwise no break to deselect the object - case SHELL_MODE_GRAPHIC: - case SHELL_MODE_OBJECT: - { - if ( rShell.IsDrawCreate() ) - { - rView.GetDrawFuncPtr()->BreakCreate(); - rView.AttrChangedNotify(&rShell); - } - else if ( rShell.HasSelection() || rView.IsDrawMode() ) - { - SdrView *pSdrView = rShell.GetDrawView(); - if(pSdrView && pSdrView->AreObjectsMarked() && - pSdrView->GetHdlList().GetFocusHdl()) - { - ((SdrHdlList&)pSdrView->GetHdlList()).ResetFocusHdl(); - } - else - { - rView.LeaveDrawCreate(); - Point aPt(LONG_MIN, LONG_MIN); - //go out of the frame - rShell.SelectObj(aPt, SW_LEAVE_FRAME); - SfxBindings& rBind = rView.GetViewFrame()->GetBindings(); - rBind.Invalidate( SID_ATTR_SIZE ); - rShell.EnterStdMode(); - rView.AttrChangedNotify(&rShell); - } - } - } - break; - default:; //prevent warning - } - return true; -} -/*------------------------------------------------------------------------- - select the next draw text object that has a spelling error - -----------------------------------------------------------------------*/ -bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh) -{ - bool bNextDoc = false; - SdrView* pDrView = rSh.GetDrawView(); - if(!pDrView) - return bNextDoc; - SwView& rView = rSh.GetView(); - SwDoc* pDoc = rView.GetDocShell()->GetDoc(); - const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList(); - //start at the current draw object - if there is any selected - SdrTextObj* pCurrentTextObj = 0; - if ( rMarkList.GetMarkCount() == 1 ) - { - SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if( pObj && pObj->ISA(SdrTextObj) ) - pCurrentTextObj = static_cast<SdrTextObj*>(pObj); - } - //at first fill the list of drawing objects - if(!m_pSpellState->m_bTextObjectsCollected ) - { - m_pSpellState->m_bTextObjectsCollected = true; - std::list<SdrTextObj*> aTextObjs; - SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pDoc ); - if(pCurrentTextObj) - { - m_pSpellState->m_aTextObjects.remove(pCurrentTextObj); - m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj); - } - } - if(m_pSpellState->m_aTextObjects.size()) - { - Reference< XSpellChecker1 > xSpell( GetSpellChecker() ); - while(!bNextDoc && m_pSpellState->m_aTextObjects.size()) - { - std::list<SdrTextObj*>::iterator aStart = m_pSpellState->m_aTextObjects.begin(); - SdrTextObj* pTextObj = *aStart; - if(m_pSpellState->m_pStartDrawing == pTextObj) - m_pSpellState->m_bRestartDrawing = true; - m_pSpellState->m_aTextObjects.erase(aStart); - OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject(); - if ( pParaObj ) - { - bool bHasSpellError = false; - { - SdrOutliner aTmpOutliner(pDoc->GetDrawModel()-> - GetDrawOutliner().GetEmptyItemSet().GetPool(), - OUTLINERMODE_TEXTOBJECT ); - aTmpOutliner.SetRefDevice( pDoc->getPrinter( false ) ); - MapMode aMapMode (MAP_TWIP); - aTmpOutliner.SetRefMapMode(aMapMode); - aTmpOutliner.SetPaperSize( pTextObj->GetLogicRect().GetSize() ); - aTmpOutliner.SetSpeller( xSpell ); - - OutlinerView* pOutlView = new OutlinerView( &aTmpOutliner, &(rView.GetEditWin()) ); - pOutlView->GetOutliner()->SetRefDevice( rSh.getIDocumentDeviceAccess()->getPrinter( false ) ); - aTmpOutliner.InsertView( pOutlView ); - Point aPt; - Size aSize(1,1); - Rectangle aRect( aPt, aSize ); - pOutlView->SetOutputArea( aRect ); - aTmpOutliner.SetText( *pParaObj ); - aTmpOutliner.ClearModifyFlag(); - bHasSpellError = EE_SPELL_OK != aTmpOutliner.HasSpellErrors(); - aTmpOutliner.RemoveView( pOutlView ); - delete pOutlView; - } - if(bHasSpellError) - { - //now the current one has to be deselected - if(pCurrentTextObj) - pDrView->SdrEndTextEdit( sal_True ); - //and the found one should be activated - rSh.MakeVisible(pTextObj->GetLogicRect()); - Point aTmp( 0,0 ); - rSh.SelectObj( aTmp, 0, pTextObj ); - SdrPageView* pPV = pDrView->GetSdrPageView(); - rView.BeginTextEdit( pTextObj, pPV, &rView.GetEditWin(), sal_False, sal_True ); - rView.AttrChangedNotify(&rSh); - bNextDoc = true; - } - } - } - } - return bNextDoc; -} - - -bool SwSpellDialogChildWindow::SpellDrawText_Impl(SwWrtShell& rSh, ::svx::SpellPortions& rPortions) -{ - bool bRet = false; - SdrView* pSdrView = rSh.GetDrawView(); - SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : 0; - OSL_ENSURE(pOutliner, "No Outliner in SwSpellDialogChildWindow::SpellDrawText_Impl"); - if(pOutliner) - { - bRet = pOutliner->SpellSentence(pSdrView->GetTextEditOutlinerView()->GetEditView(), rPortions, m_bIsGrammarCheckingOn); - //find out if the current selection is in the first spelled drawing object - //and behind the initial selection - if(bRet && m_pSpellState->m_bRestartDrawing) - { - OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); - ESelection aCurrentSelection = pOLV->GetSelection(); - if(m_pSpellState->m_aStartDrawingSelection.nEndPara < aCurrentSelection.nEndPara || - (m_pSpellState->m_aStartDrawingSelection.nEndPara == aCurrentSelection.nEndPara && - m_pSpellState->m_aStartDrawingSelection.nEndPos < aCurrentSelection.nEndPos)) - { - bRet = false; - rPortions.clear(); - } - } - } - return bRet; -} - -void SwSpellDialogChildWindow::LockFocusNotification(bool bLock) -{ - OSL_ENSURE(m_pSpellState->m_bLockFocus != bLock, "invalid locking - no change of state"); - m_pSpellState->m_bLockFocus = bLock; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/abstract.cxx b/sw/source/ui/dialog/abstract.cxx deleted file mode 100644 index 056c06c7a3..0000000000 --- a/sw/source/ui/dialog/abstract.cxx +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" - -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif - - -#include "swtypes.hxx" -#include "hintids.hxx" - -#include "dialog.hrc" -#include "abstract.hxx" -#include "abstract.hrc" - - -SwInsertAbstractDlg::SwInsertAbstractDlg( Window* pParent ) : - SfxModalDialog(pParent, SW_RES(DLG_INSERT_ABSTRACT)), - aFL (this, SW_RES(FL_1 )), - aLevelFT(this, SW_RES(FT_LEVEL )), - aLevelNF(this, SW_RES(NF_LEVEL )), - aParaFT (this, SW_RES(FT_PARA )), - aParaNF (this, SW_RES(NF_PARA )), - aDescFT (this, SW_RES(FT_DESC )), - aOkPB (this, SW_RES(PB_OK )), - aCancelPB (this, SW_RES(PB_CANCEL )), - aHelpPB (this, SW_RES(PB_HELP )) -{ - FreeResource(); -} - -SwInsertAbstractDlg::~SwInsertAbstractDlg() -{ -} - -sal_uInt8 SwInsertAbstractDlg::GetLevel() const -{ - return static_cast< sal_uInt8 >(aLevelNF.GetValue() - 1); -} - -sal_uInt8 SwInsertAbstractDlg::GetPara() const -{ - return (sal_uInt8) aParaNF.GetValue(); -} - - - - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/abstract.hrc b/sw/source/ui/dialog/abstract.hrc deleted file mode 100644 index a42781e454..0000000000 --- a/sw/source/ui/dialog/abstract.hrc +++ /dev/null @@ -1,36 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define FL_1 1 -#define FT_PARA 2 -#define NF_PARA 3 -#define FT_LEVEL 4 -#define NF_LEVEL 5 -#define FT_DESC 6 -#define PB_OK 7 -#define PB_CANCEL 8 -#define PB_HELP 9 diff --git a/sw/source/ui/dialog/abstract.src b/sw/source/ui/dialog/abstract.src deleted file mode 100644 index 5abdc5aff0..0000000000 --- a/sw/source/ui/dialog/abstract.src +++ /dev/null @@ -1,150 +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 "dialog.hrc" -#include "helpid.h" -#include "abstract.hrc" - -ModalDialog DLG_INSERT_ABSTRACT -{ - HelpID = HID_INSERT_ABSTRACT ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 239 , 68 ) ; - Moveable = TRUE ; - FixedLine FL_1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 174 , 8 ) ; - Text [ en-US ] = "Properties" ; - }; - FixedText FT_LEVEL - { - Pos = MAP_APPFONT ( 12 , 12 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "Included outline levels" ; - }; - NumericField NF_LEVEL - { - HelpID = "sw:NumericField:DLG_INSERT_ABSTRACT:NF_LEVEL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 153 , 12 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 5 ; - Value = 3 ; - First = 1 ; - Last = 5 ; - }; - FixedText FT_PARA - { - Pos = MAP_APPFONT ( 12 , 27 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "Subpoints per level" ; - }; - NumericField NF_PARA - { - HelpID = "sw:NumericField:DLG_INSERT_ABSTRACT:NF_PARA"; - Border = TRUE ; - Pos = MAP_APPFONT ( 153 , 27 ) ; - Size = MAP_APPFONT ( 24 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 5 ; - Value = 1 ; - First = 1 ; - Last = 5 ; - }; - FixedText FT_DESC - { - Pos = MAP_APPFONT ( 12 , 43 ) ; - Size = MAP_APPFONT ( 165 , 16 ) ; - WordBreak = TRUE ; - Text [ en-US ] = "The abstract contains the selected number of paragraphs from the included outline levels." ; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 186 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 186 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 186 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - Text [ en-US ] = "Create AutoAbstract" ; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sw/source/ui/dialog/addrdlg.cxx b/sw/source/ui/dialog/addrdlg.cxx deleted file mode 100644 index dc3c36811b..0000000000 --- a/sw/source/ui/dialog/addrdlg.cxx +++ /dev/null @@ -1,60 +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_sw.hxx" - -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif - -#include "addrdlg.hxx" -#include <svx/svxdlg.hxx> -#include <sfx2/sfx.hrc> - -SwAddrDlg::SwAddrDlg(Window* pParent, const SfxItemSet& rSet ) : - - SfxSingleTabDialog(pParent, rSet, 0) - -{ - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SFXPAGE_GENERAL ); - if ( fnCreatePage ) - { - SfxTabPage* pPage2 = (*fnCreatePage)( this, rSet ); - SetTabPage(pPage2); - } -} - -SwAddrDlg::~SwAddrDlg() -{ -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx deleted file mode 100644 index 11fa3926ed..0000000000 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ /dev/null @@ -1,450 +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_sw.hxx" -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif -#include <hintids.hxx> -#include <rtl/textenc.h> -#include <i18npool/mslangid.hxx> -#include <com/sun/star/i18n/ScriptType.hpp> -#include <unotools/lingucfg.hxx> -#include <fontcfg.hxx> -#include <swmodule.hxx> -#include <editeng/unolingu.hxx> -#include <sfx2/printer.hxx> -#include <editeng/flstitem.hxx> -#include <svx/dlgutil.hxx> -#include <editeng/fontitem.hxx> -#include <editeng/langitem.hxx> -#include <editeng/scripttypeitem.hxx> -#include <swtypes.hxx> -#include <ascfldlg.hxx> -#include <shellio.hxx> -#include <docsh.hxx> -#include <doc.hxx> - -#include <dialog.hrc> -#include <ascfldlg.hrc> - -#include "vcl/metric.hxx" - - -using namespace ::com::sun::star; - -const sal_Unicode cDialogExtraDataClose = '}'; -const char sDialogImpExtraData[] = "EncImpDlg:{"; -const char sDialogExpExtraData[] = "EncExpDlg:{"; -const sal_uInt16 nDialogExtraDataLen = 11; // 12345678901 - -SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, - SvStream* pStream ) - : SfxModalDialog( pParent, SW_RES( DLG_ASCII_FILTER )), - aFL( this, SW_RES( FL_1 )), - aCharSetFT( this, SW_RES( FT_CHARSET )), - aCharSetLB( this, SW_RES( LB_CHARSET )), - aFontFT( this, SW_RES( FT_FONT )), - aFontLB( this, SW_RES( LB_FONT )), - aLanguageFT( this, SW_RES( FT_LANGUAGE )), - aLanguageLB( this, SW_RES( LB_LANGUAGE )), - aCRLF_FT( this, SW_RES( FT_CRLF )), - aCRLF_RB( this, SW_RES( RB_CRLF )), - aCR_RB( this, SW_RES( RB_CR )), - aLF_RB( this, SW_RES( RB_LF )), - aOkPB( this, SW_RES( PB_OK )), - aCancelPB( this, SW_RES( PB_CANCEL )), - aHelpPB( this, SW_RES( PB_HELP )), - sSystemCharSet( SW_RES( STR_SYS_CHARSET )), - bSaveLineStatus( sal_True ) -{ - FreeResource(); - - SwAsciiOptions aOpt; - { - const String& rFindNm = String::CreateFromAscii( - pStream ? sDialogImpExtraData - : sDialogExpExtraData); - sal_uInt16 nEnd, nStt = GetExtraData().Search( rFindNm ); - if( STRING_NOTFOUND != nStt ) - { - nStt += nDialogExtraDataLen; - nEnd = GetExtraData().Search( cDialogExtraDataClose, nStt ); - if( STRING_NOTFOUND != nEnd ) - { - aOpt.ReadUserData( GetExtraData().Copy( nStt, nEnd - nStt )); - nStt -= nDialogExtraDataLen; - GetExtraData().Erase( nStt, nEnd - nStt + 1 ); - } - } - } - - // read the first chars and check the charset, (language - with L&H) - if( pStream ) - { - char aBuffer[ 4098 ]; - sal_uLong nOldPos = pStream->Tell(); - sal_uLong nBytesRead = pStream->Read( aBuffer, 4096 ); - pStream->Seek( nOldPos ); - - if( nBytesRead <= 4096 ) - { - aBuffer[ nBytesRead ] = '0'; - aBuffer[ nBytesRead+1 ] = '0'; - if( 0 != ( nBytesRead & 0x00000001 ) ) - aBuffer[ nBytesRead + 2 ] = '0'; - } - - sal_Bool bCR = sal_False, bLF = sal_False, bNullChar = sal_False; - for( sal_uInt16 nCnt = 0; nCnt < nBytesRead; ++nCnt ) - switch( aBuffer[ nCnt ] ) - { - case 0x0: bNullChar = sal_True; break; - case 0xA: bLF = sal_True; break; - case 0xD: bCR = sal_True; break; - case 0xC: - case 0x1A: - case 0x9: break; - default: break; - } - - if( !bNullChar ) - { - if( bCR ) - { - if( bLF ) - { - aOpt.SetParaFlags( LINEEND_CRLF ); - } - else - { - aOpt.SetParaFlags( LINEEND_CR ); - } - } - else if( bLF ) - { - aOpt.SetParaFlags( LINEEND_LF ); - } - } - - SwDoc* pDoc = rDocSh.GetDoc(); - - sal_uInt16 nAppScriptType = GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() ); - { - sal_Bool bDelPrinter = sal_False; - SfxPrinter* pPrt = pDoc ? pDoc->getPrinter(false) : 0; - if( !pPrt ) - { - SfxItemSet* pSet = new SfxItemSet( rDocSh.GetPool(), - SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - 0 ); - pPrt = new SfxPrinter( pSet ); - bDelPrinter = sal_True; - } - - - // get the set of disctinct available family names - std::set< String > aFontNames; - int nFontNames = pPrt->GetDevFontCount(); - for( int i = 0; i < nFontNames; i++ ) - { - FontInfo aInf( pPrt->GetDevFont( i ) ); - aFontNames.insert( aInf.GetName() ); - } - - // insert to listbox - for( std::set< String >::const_iterator it = aFontNames.begin(); - it != aFontNames.end(); ++it ) - { - aFontLB.InsertEntry( *it ); - } - - if( !aOpt.GetFontName().Len() ) - { - if(pDoc) - { - sal_uInt16 nFontRes = RES_CHRATR_FONT; - if(SCRIPTTYPE_ASIAN == nAppScriptType) - nFontRes = RES_CHRATR_CJK_FONT; - else if(SCRIPTTYPE_COMPLEX == nAppScriptType) - nFontRes = RES_CHRATR_CTL_FONT; - - aOpt.SetFontName( ((SvxFontItem&)pDoc->GetDefault( - nFontRes )).GetFamilyName() ); - } - else - { - sal_uInt16 nFontType = FONT_STANDARD; - if(SCRIPTTYPE_ASIAN == nAppScriptType) - nFontType = FONT_STANDARD_CJK; - else if(SCRIPTTYPE_COMPLEX == nAppScriptType) - nFontType = FONT_STANDARD_CTL; - aOpt.SetFontName(SW_MOD()->GetStdFontConfig()->GetFontFor(nFontType)); - } - } - aFontLB.SelectEntry( aOpt.GetFontName() ); - - if( bDelPrinter ) - delete pPrt; - } - - // initialise language - { - if( !aOpt.GetLanguage() ) - { - if(pDoc) - { - sal_uInt16 nWhich = GetWhichOfScript( RES_CHRATR_LANGUAGE, nAppScriptType); - aOpt.SetLanguage( ((SvxLanguageItem&)pDoc-> - GetDefault( nWhich )).GetLanguage()); - } - else - { - SvtLinguOptions aLinguOpt; - SvtLinguConfig().GetOptions( aLinguOpt ); - switch(nAppScriptType) - { - case SCRIPTTYPE_ASIAN: - aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, SCRIPTTYPE_ASIAN)); - break; - case SCRIPTTYPE_COMPLEX: - aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, SCRIPTTYPE_COMPLEX)); - break; - //SCRIPTTYPE_LATIN: - default: - aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, SCRIPTTYPE_LATIN)); - } - } - } - - aLanguageLB.SetLanguageList( LANG_LIST_ALL, sal_True, sal_False ); - aLanguageLB.SelectLanguage( aOpt.GetLanguage() ); - } - } - else - { - // hide the used Control for the Export and move the - // other behind the charset controls - aFontFT.Hide(); - aFontLB.Hide(); - aLanguageFT.Hide(); - aLanguageLB.Hide(); - - long nY = aFontFT.GetPosPixel().Y() + 1; - Point aPos( aCRLF_FT.GetPosPixel() ); aPos.Y() = nY; - aCRLF_FT.SetPosPixel( aPos ); - - aPos = aCRLF_RB.GetPosPixel(); aPos.Y() = nY; - aCRLF_RB.SetPosPixel( aPos ); - - aPos = aCR_RB.GetPosPixel(); aPos.Y() = nY; - aCR_RB.SetPosPixel( aPos ); - - aPos = aLF_RB.GetPosPixel(); aPos.Y() = nY; - aLF_RB.SetPosPixel( aPos ); - - Size aSize = GetSizePixel(); - Size aTmpSz( 6, 6 ); - aTmpSz = LogicToPixel(aTmpSz, MAP_APPFONT); - aSize.Height() = aHelpPB.GetPosPixel().Y() + - aHelpPB.GetSizePixel().Height() + aTmpSz.Height(); - SetSizePixel( aSize ); - } - - // initialise character set - aCharSetLB.FillFromTextEncodingTable( pStream != NULL ); - aCharSetLB.SelectTextEncoding( aOpt.GetCharSet() ); - - aCharSetLB.SetSelectHdl( LINK( this, SwAsciiFilterDlg, CharSetSelHdl )); - aCRLF_RB.SetToggleHdl( LINK( this, SwAsciiFilterDlg, LineEndHdl )); - aLF_RB.SetToggleHdl( LINK( this, SwAsciiFilterDlg, LineEndHdl )); - aCR_RB.SetToggleHdl( LINK( this, SwAsciiFilterDlg, LineEndHdl )); - - SetCRLF( aOpt.GetParaFlags() ); - - aCRLF_RB.SaveValue(); - aLF_RB.SaveValue(); - aCR_RB.SaveValue(); -} - - -SwAsciiFilterDlg::~SwAsciiFilterDlg() -{ -} - - -void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions ) -{ - sal_uLong nCCode = aCharSetLB.GetSelectTextEncoding(); - String sFont; - sal_uLong nLng = 0; - if( aFontLB.IsVisible() ) - { - sFont = aFontLB.GetSelectEntry(); - nLng = (sal_uLong)aLanguageLB.GetSelectLanguage(); - } - - rOptions.SetFontName( sFont ); - rOptions.SetCharSet( rtl_TextEncoding( nCCode ) ); - rOptions.SetLanguage( sal_uInt16( nLng ) ); - rOptions.SetParaFlags( GetCRLF() ); - - // save the user settings - String sData; - rOptions.WriteUserData( sData ); - if( sData.Len() ) - { - const String& rFindNm = String::CreateFromAscii( - aFontLB.IsVisible() ? sDialogImpExtraData - : sDialogExpExtraData); - sal_uInt16 nEnd, nStt = GetExtraData().Search( rFindNm ); - if( STRING_NOTFOUND != nStt ) - { - // called twice, so remove "old" settings - nEnd = GetExtraData().Search( cDialogExtraDataClose, - nStt + nDialogExtraDataLen ); - if( STRING_NOTFOUND != nEnd ) - GetExtraData().Erase( nStt, nEnd - nStt + 1 ); - } - String sTmp(GetExtraData()); - sTmp += rFindNm; - sTmp += sData; - sTmp += cDialogExtraDataClose; - GetExtraData() = sTmp; - } -} - -void SwAsciiFilterDlg::SetCRLF( LineEnd eEnd ) -{ - switch( eEnd ) - { - case LINEEND_CR: aCR_RB.Check(); break; - case LINEEND_CRLF: aCRLF_RB.Check(); break; - case LINEEND_LF: aLF_RB.Check(); break; - } -} - -LineEnd SwAsciiFilterDlg::GetCRLF() const -{ - LineEnd eEnd; - if( aCR_RB.IsChecked() ) - eEnd = LINEEND_CR; - else if( aLF_RB.IsChecked() ) - eEnd = LINEEND_LF; - else - eEnd = LINEEND_CRLF; - return eEnd; -} - -IMPL_LINK( SwAsciiFilterDlg, CharSetSelHdl, SvxTextEncodingBox*, pBox ) -{ - LineEnd eOldEnd = GetCRLF(), eEnd = (LineEnd)-1; - LanguageType nLng = aFontLB.IsVisible() - ? aLanguageLB.GetSelectLanguage() - : LANGUAGE_SYSTEM, - nOldLng = nLng; - - rtl_TextEncoding nChrSet = pBox->GetSelectTextEncoding(); - if( nChrSet == gsl_getSystemTextEncoding() ) - eEnd = GetSystemLineEnd(); - else - { - switch( nChrSet ) - { - case RTL_TEXTENCODING_MS_1252: -#ifdef UNX - eEnd = LINEEND_LF; -#else - eEnd = LINEEND_CRLF; // ANSI -#endif - break; - - case RTL_TEXTENCODING_APPLE_ROMAN: // MAC - eEnd = LINEEND_CR; - break; - - case RTL_TEXTENCODING_IBM_850: // DOS - eEnd = LINEEND_CRLF; - break; - - case RTL_TEXTENCODING_APPLE_ARABIC: - case RTL_TEXTENCODING_APPLE_CENTEURO: - case RTL_TEXTENCODING_APPLE_CROATIAN: - case RTL_TEXTENCODING_APPLE_CYRILLIC: - case RTL_TEXTENCODING_APPLE_DEVANAGARI: - case RTL_TEXTENCODING_APPLE_FARSI: - case RTL_TEXTENCODING_APPLE_GREEK: - case RTL_TEXTENCODING_APPLE_GUJARATI: - case RTL_TEXTENCODING_APPLE_GURMUKHI: - case RTL_TEXTENCODING_APPLE_HEBREW: - case RTL_TEXTENCODING_APPLE_ICELAND: - case RTL_TEXTENCODING_APPLE_ROMANIAN: - case RTL_TEXTENCODING_APPLE_THAI: - case RTL_TEXTENCODING_APPLE_TURKISH: - case RTL_TEXTENCODING_APPLE_UKRAINIAN: - case RTL_TEXTENCODING_APPLE_CHINSIMP: - case RTL_TEXTENCODING_APPLE_CHINTRAD: - case RTL_TEXTENCODING_APPLE_JAPANESE: - case RTL_TEXTENCODING_APPLE_KOREAN: - eEnd = LINEEND_CR; - break; - } - } - - bSaveLineStatus = sal_False; - if( eEnd != (LineEnd)-1 ) // changed? - { - if( eOldEnd != eEnd ) - SetCRLF( eEnd ); - } - else - { - // restore old user choise (not the automatic!) - aCRLF_RB.Check( aCRLF_RB.GetSavedValue() ); - aCR_RB.Check( aCR_RB.GetSavedValue() ); - aLF_RB.Check( aLF_RB.GetSavedValue() ); - } - bSaveLineStatus = sal_True; - - if( nOldLng != nLng && aFontLB.IsVisible() ) - aLanguageLB.SelectLanguage( nLng ); - - return 0; -} - -IMPL_LINK( SwAsciiFilterDlg, LineEndHdl, RadioButton*, pBtn ) -{ - if( bSaveLineStatus ) - pBtn->SaveValue(); - return 0; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/ascfldlg.hrc b/sw/source/ui/dialog/ascfldlg.hrc deleted file mode 100644 index efbafaa00b..0000000000 --- a/sw/source/ui/dialog/ascfldlg.hrc +++ /dev/null @@ -1,44 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define FL_1 1 -#define FT_CHARSET 2 -#define LB_CHARSET 3 -#define FT_FONT 4 -#define LB_FONT 5 -#define FT_LANGUAGE 6 -#define LB_LANGUAGE 7 -#define FT_CRLF 8 -#define RB_CRLF 9 -#define RB_CR 10 -#define RB_LF 11 -#define PB_OK 12 -#define PB_CANCEL 13 -#define PB_HELP 14 -#define STR_SYS_CHARSET 15 - - diff --git a/sw/source/ui/dialog/ascfldlg.src b/sw/source/ui/dialog/ascfldlg.src deleted file mode 100644 index 66be6d35c9..0000000000 --- a/sw/source/ui/dialog/ascfldlg.src +++ /dev/null @@ -1,183 +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 "dialog.hrc" -#include "helpid.h" -#include "ascfldlg.hrc" - -ModalDialog DLG_ASCII_FILTER -{ - HelpID = HID_ASCII_FILTER ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 239 , 80 ) ; - Moveable = TRUE ; - FixedLine FL_1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 170 , 8 ) ; - Text [ en-US ] = "Properties"; - }; - FixedText FT_CHARSET - { - Pos = MAP_APPFONT ( 12 , 15 ) ; - Size = MAP_APPFONT ( 66 , 10 ) ; - Text [ en-US ] = "~Character set"; - }; - ListBox LB_CHARSET - { - HelpID = "sw:ListBox:DLG_ASCII_FILTER:LB_CHARSET"; - Pos = MAP_APPFONT ( 80 , 14 ) ; - Size = MAP_APPFONT ( 90 , 61 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - FixedText FT_FONT - { - Pos = MAP_APPFONT ( 12 , 31 ) ; - Size = MAP_APPFONT ( 66 , 10 ) ; - Text [ en-US ] = "Default fonts"; - }; - ListBox LB_FONT - { - HelpID = "sw:ListBox:DLG_ASCII_FILTER:LB_FONT"; - Pos = MAP_APPFONT ( 80 , 30 ) ; - Size = MAP_APPFONT ( 90 , 61 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - FixedText FT_LANGUAGE - { - Pos = MAP_APPFONT ( 12 , 47 ) ; - Size = MAP_APPFONT ( 66 , 10 ) ; - Text [ en-US ] = "Lan~guage"; - }; - ListBox LB_LANGUAGE - { - HelpID = "sw:ListBox:DLG_ASCII_FILTER:LB_LANGUAGE"; - Pos = MAP_APPFONT ( 80 , 46 ) ; - Size = MAP_APPFONT ( 90 , 61 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - FixedText FT_CRLF - { - Pos = MAP_APPFONT ( 12 , 64 ) ; - Size = MAP_APPFONT ( 66 , 8 ) ; - Text [ en-US ] = "~Paragraph break"; - }; - RadioButton RB_CRLF - { - HelpID = "sw:RadioButton:DLG_ASCII_FILTER:RB_CRLF"; - Pos = MAP_APPFONT ( 80 , 64 ) ; - Size = MAP_APPFONT ( 40 , 10 ) ; - TabStop = TRUE ; - Check = TRUE; - Text [ en-US ] = "~CR & LF"; - }; - RadioButton RB_CR - { - HelpID = "sw:RadioButton:DLG_ASCII_FILTER:RB_CR"; - Pos = MAP_APPFONT ( 121 , 64 ) ; - Size = MAP_APPFONT ( 20 , 10 ) ; -// TabStop = TRUE ; - Text [ en-US ] = "C~R"; - }; - RadioButton RB_LF - { - HelpID = "sw:RadioButton:DLG_ASCII_FILTER:RB_LF"; - Pos = MAP_APPFONT ( 155 , 64 ) ; - Size = MAP_APPFONT ( 20 , 10 ) ; -// TabStop = TRUE ; - Text [ en-US ] = "~LF"; - }; - - OKButton PB_OK - { - Pos = MAP_APPFONT ( 183 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 183 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 183 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - String STR_SYS_CHARSET - { - Text [ en-US ] = "System"; - }; - Text [ en-US ] = "ASCII Filter Options"; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sw/source/ui/dialog/dialog.src b/sw/source/ui/dialog/dialog.src deleted file mode 100644 index 599594ea38..0000000000 --- a/sw/source/ui/dialog/dialog.src +++ /dev/null @@ -1,60 +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 "dialog.hrc" - -CheckBox CB_USE_PASSWD -{ - Text [ en-US ] = "~Password" ; -}; -CheckBox CB_READ_ONLY -{ - Text [ en-US ] = "~Read-only" ; -}; -String STR_LINKEDIT_TEXT -{ - Text [ en-US ] = "Edit links" ; -}; -String STR_PATH_NOT_FOUND -{ - Text [ en-US ] = "The directory '%1' does not exist." ; -}; -String STR_FLT_SGV -{ - Text = "SGV - StarDraw 2.0,SGV" ; -}; - -QueryBox RID_QB_SPELL_CONTINUE -{ - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_YES ; - MESSAGE [ en-US ] = "Continue checking at beginning of document?" ; -}; -String STR_SPELLING_COMPLETED -{ - Text [ en-US ] = "The spellcheck is complete." ; -}; - diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx deleted file mode 100644 index cd2fb7a762..0000000000 --- a/sw/source/ui/dialog/docstdlg.cxx +++ /dev/null @@ -1,170 +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_sw.hxx" -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif - - -#include <stdio.h> -#include <ctype.h> -#include <swwait.hxx> -#include <wrtsh.hxx> -#include <view.hxx> -#include <swmodule.hxx> -#include <globals.hrc> -#include <docsh.hxx> -#include <pview.hxx> -#include <doc.hxx> -#include <docstdlg.hxx> -#include <modcfg.hxx> - -// for statistics fields -#include <fldmgr.hxx> -#include <fldbas.hxx> - -#include <docstdlg.hrc> - - -SfxTabPage * SwDocStatPage::Create(Window *pParent, const SfxItemSet &rSet) -{ - return new SwDocStatPage(pParent, rSet); -} - -SwDocStatPage::SwDocStatPage(Window *pParent, const SfxItemSet &rSet) : - - SfxTabPage (pParent, SW_RES(TP_DOC_STAT), rSet), - aPageLbl (this, SW_RES( FT_PAGE )), - aPageNo (this, SW_RES( FT_PAGE_COUNT )), - aTableLbl (this, SW_RES( FT_TABLE )), - aTableNo (this, SW_RES( FT_TABLE_COUNT)), - aGrfLbl (this, SW_RES( FT_GRF )), - aGrfNo (this, SW_RES( FT_GRF_COUNT )), - aOLELbl (this, SW_RES( FT_OLE )), - aOLENo (this, SW_RES( FT_OLE_COUNT )), - aParaLbl (this, SW_RES( FT_PARA )), - aParaNo (this, SW_RES( FT_PARA_COUNT )), - aWordLbl (this, SW_RES( FT_WORD )), - aWordNo (this, SW_RES( FT_WORD_COUNT )), - aCharLbl (this, SW_RES( FT_CHAR )), - aCharNo (this, SW_RES( FT_CHAR_COUNT )), - aCharExclSpacesLbl (this, SW_RES( FT_CHAR_EXCL_SPACES )), - aCharExclSpacesNo (this, SW_RES( FT_CHAR_COUNT_EXCL_SPACES )), - aLineLbl (this, SW_RES( FT_LINE )), - aLineNo (this, SW_RES( FT_LINE_COUNT )), - aUpdatePB (this, SW_RES( PB_PDATE )) -{ - Update(); - FreeResource(); - aUpdatePB.SetClickHdl(LINK(this, SwDocStatPage, UpdateHdl)); - //#111684# is the current view a page preview no SwFEShell can be found -> hide the update button - SwDocShell* pDocShell = (SwDocShell*) SfxObjectShell::Current(); - SwFEShell* pFEShell = pDocShell->GetFEShell(); - if(!pFEShell) - { - aUpdatePB.Show(sal_False); - aLineLbl.Show(sal_False); - aLineNo .Show(sal_False); - } - -} - - - SwDocStatPage::~SwDocStatPage() -{ -} - -/*-------------------------------------------------------------------- - Description: fill ItemSet when changed - --------------------------------------------------------------------*/ - - -sal_Bool SwDocStatPage::FillItemSet(SfxItemSet & /*rSet*/) -{ - return sal_False; -} - -void SwDocStatPage::Reset(const SfxItemSet &/*rSet*/) -{ -} -/*------------------------------------------------------------------------ - Description: update / set data -------------------------------------------------------------------------*/ - - -void SwDocStatPage::SetData(const SwDocStat &rStat) -{ - aTableNo.SetText(String::CreateFromInt32( rStat.nTbl )); - aGrfNo.SetText(String::CreateFromInt32( rStat.nGrf )); - aOLENo.SetText(String::CreateFromInt32( rStat.nOLE )); - aPageNo.SetText(String::CreateFromInt32( rStat.nPage )); - aParaNo.SetText(String::CreateFromInt32( rStat.nPara )); - aWordNo.SetText(String::CreateFromInt32( rStat.nWord )); - aCharNo.SetText(String::CreateFromInt32( rStat.nChar )); - aCharExclSpacesNo.SetText(String::CreateFromInt32( rStat.nCharExcludingSpaces )); -} - -/*------------------------------------------------------------------------ - Description: update statistics -------------------------------------------------------------------------*/ - - -void SwDocStatPage::Update() -{ - SfxViewShell *pVSh = SfxViewShell::Current(); - ViewShell *pSh = 0; - if ( pVSh->ISA(SwView) ) - pSh = ((SwView*)pVSh)->GetWrtShellPtr(); - else if ( pVSh->ISA(SwPagePreView) ) - pSh = ((SwPagePreView*)pVSh)->GetViewShell(); - - OSL_ENSURE( pSh, "Shell not found" ); - - SwWait aWait( *pSh->GetDoc()->GetDocShell(), sal_True ); - pSh->StartAction(); - aDocStat = pSh->GetDoc()->GetDocStat(); - pSh->GetDoc()->UpdateDocStat( aDocStat ); - pSh->EndAction(); - - SetData(aDocStat); -} - -IMPL_LINK( SwDocStatPage, UpdateHdl, PushButton*, EMPTYARG) -{ - Update(); - SwDocShell* pDocShell = (SwDocShell*) SfxObjectShell::Current(); - SwFEShell* pFEShell = pDocShell->GetFEShell(); - if(pFEShell) - aLineNo.SetText( String::CreateFromInt32( pFEShell->GetLineCount(sal_False))); - //pButton->Disable(); - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/docstdlg.hrc b/sw/source/ui/dialog/docstdlg.hrc deleted file mode 100644 index e1b5762d90..0000000000 --- a/sw/source/ui/dialog/docstdlg.hrc +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define FT_TABLE 1 -#define FT_GRF 2 -#define FT_OLE 3 -#define FT_PAGE 4 -#define FT_PARA 5 -#define FT_WORD 6 -#define FT_CHAR 9 -#define FT_TABLE_COUNT 10 -#define FT_GRF_COUNT 11 -#define FT_OLE_COUNT 12 -#define FT_PAGE_COUNT 13 -#define FT_PARA_COUNT 14 -#define FT_WORD_COUNT 15 -#define FT_CHAR_COUNT 16 -#define FT_LINE 17 -#define FT_LINE_COUNT 18 -#define PB_PDATE 19 -#define FT_CHAR_COUNT_EXCL_SPACES 20 -#define FT_CHAR_EXCL_SPACES 21 - -#define BT_OK 100 - diff --git a/sw/source/ui/dialog/docstdlg.src b/sw/source/ui/dialog/docstdlg.src deleted file mode 100644 index 97dbdddff7..0000000000 --- a/sw/source/ui/dialog/docstdlg.src +++ /dev/null @@ -1,197 +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 "globals.hrc" -#include "docstdlg.hrc" -#include "helpid.h" - // #define TP_DOC_STAT 256 -TabPage TP_DOC_STAT -{ - HelpID = HID_DOC_STAT ; - Hide = TRUE; - Size = MAP_APPFONT ( 260 , 185 ) ; - FixedText FT_PAGE - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Number of Pages:" ; - Left = TRUE ; - }; - FixedText FT_TABLE - { - Pos = MAP_APPFONT ( 6 , 18 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Number of Tables:" ; - Left = TRUE ; - }; - FixedText FT_GRF - { - Pos = MAP_APPFONT ( 6 , 30 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Number of Graphics:" ; - Left = TRUE ; - }; - FixedText FT_OLE - { - Pos = MAP_APPFONT ( 6 , 42 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Number of OLE Objects:" ; - Left = TRUE ; - }; - FixedText FT_PARA - { - Pos = MAP_APPFONT ( 6 , 54 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Number of Paragraphs:" ; - Left = TRUE ; - }; - FixedText FT_WORD - { - Pos = MAP_APPFONT ( 6 , 68 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Number of Words:" ; - Left = TRUE ; - }; - FixedText FT_CHAR - { - Pos = MAP_APPFONT ( 6 , 82 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Number of Characters:" ; - Left = TRUE ; - }; - FixedText FT_CHAR_EXCL_SPACES - { - Pos = MAP_APPFONT ( 6 , 96 ) ; - Size = MAP_APPFONT ( 138 , 8 ) ; - Text [ en-US ] = "Number of Characters excluding spaces:" ; - Left = TRUE ; - }; - FixedText FT_LINE - { - Pos = MAP_APPFONT ( 6 , 110 ) ; - Size = MAP_APPFONT ( 90 , 8 ) ; - Text [ en-US ] = "Number of Lines:" ; - }; - FixedText FT_PAGE_COUNT - { - Pos = MAP_APPFONT ( 138 , 6 ) ; - Size = MAP_APPFONT ( 27 , 8 ) ; - Left = TRUE ; - }; - FixedText FT_TABLE_COUNT - { - Pos = MAP_APPFONT ( 138 , 18 ) ; - Size = MAP_APPFONT ( 27 , 8 ) ; - Left = TRUE ; - }; - FixedText FT_GRF_COUNT - { - Pos = MAP_APPFONT ( 138 , 30 ) ; - Size = MAP_APPFONT ( 27 , 8 ) ; - Left = TRUE ; - }; - FixedText FT_OLE_COUNT - { - Pos = MAP_APPFONT ( 138 , 42 ) ; - Size = MAP_APPFONT ( 27 , 8 ) ; - Left = TRUE ; - }; - FixedText FT_PARA_COUNT - { - Pos = MAP_APPFONT ( 138 , 54 ) ; - Size = MAP_APPFONT ( 27 , 8 ) ; - Left = TRUE ; - }; - FixedText FT_WORD_COUNT - { - Pos = MAP_APPFONT ( 138 , 68 ) ; - Size = MAP_APPFONT ( 27 , 8 ) ; - Left = TRUE ; - }; - FixedText FT_CHAR_COUNT - { - Pos = MAP_APPFONT ( 138 , 82 ) ; - Size = MAP_APPFONT ( 27 , 8 ) ; - Left = TRUE ; - }; - FixedText FT_CHAR_COUNT_EXCL_SPACES - { - Pos = MAP_APPFONT ( 138 , 96 ) ; - Size = MAP_APPFONT ( 27 , 8 ) ; - Left = TRUE ; - }; - FixedText FT_LINE_COUNT - { - Pos = MAP_APPFONT ( 138 , 110 ) ; - Size = MAP_APPFONT ( 27 , 8 ) ; - Left = TRUE ; - Text = "..." ; - }; - PushButton PB_PDATE - { - HelpID = "sw:PushButton:TP_DOC_STAT:PB_PDATE"; - Pos = MAP_APPFONT ( 204 , 108 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Update" ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx deleted file mode 100644 index 8b31f40f4d..0000000000 --- a/sw/source/ui/dialog/macassgn.cxx +++ /dev/null @@ -1,161 +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_sw.hxx" - -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif - - -#include "hintids.hxx" - -#define _SVSTDARR_STRINGSDTOR -#include <svl/svstdarr.hxx> -#include <svx/htmlmode.hxx> -#include <svx/svxids.hrc> -#include <sfx2/app.hxx> -#include <vcl/msgbox.hxx> - -#include "swtypes.hxx" -#include "wrtsh.hxx" -#include "viewopt.hxx" -#include "macassgn.hxx" -#include "swevent.hxx" -#include "docsh.hxx" -#include "globals.hrc" -#include "view.hxx" -#include <sfx2/viewfrm.hxx> - -#include <svx/svxdlg.hxx> - -#include <doc.hxx> - -using ::com::sun::star::uno::Reference; -using ::com::sun::star::frame::XFrame; - -SfxEventNamesItem SwMacroAssignDlg::AddEvents( DlgEventType eType ) -{ - SfxEventNamesItem aItem(SID_EVENTCONFIG); - - sal_Bool bHtmlMode = sal_False; - sal_uInt16 nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current()); - bHtmlMode = nHtmlMode & HTMLMODE_ON ? sal_True : sal_False; - - switch( eType ) - { - case MACASSGN_AUTOTEXT: - aItem.AddEvent( String( SW_RES(STR_EVENT_START_INS_GLOSSARY) ), String(), - SW_EVENT_START_INS_GLOSSARY ); - aItem.AddEvent( String( SW_RES(STR_EVENT_END_INS_GLOSSARY) ), String(), - SW_EVENT_END_INS_GLOSSARY); - // in order for the new handler to become active! - break; - case MACASSGN_ALLFRM: - case MACASSGN_GRAPHIC: // graphics - { - aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_ERROR) ), String(), - SVX_EVENT_IMAGE_ERROR); - aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_ABORT) ), String(), - SVX_EVENT_IMAGE_ABORT); - aItem.AddEvent( String( SW_RES(STR_EVENT_IMAGE_LOAD) ), String(), - SVX_EVENT_IMAGE_LOAD); - } - // no break; - case MACASSGN_FRMURL: // Frm - URL-Attributes - { - if( !bHtmlMode && - (MACASSGN_FRMURL == eType || MACASSGN_ALLFRM == eType)) - { - aItem.AddEvent( String( SW_RES( STR_EVENT_FRM_KEYINPUT_A ) ), String(), - SW_EVENT_FRM_KEYINPUT_ALPHA ); - aItem.AddEvent( String( SW_RES( STR_EVENT_FRM_KEYINPUT_NOA ) ), String(), - SW_EVENT_FRM_KEYINPUT_NOALPHA ); - aItem.AddEvent( String( SW_RES( STR_EVENT_FRM_RESIZE ) ), String(), - SW_EVENT_FRM_RESIZE ); - aItem.AddEvent( String( SW_RES( STR_EVENT_FRM_MOVE ) ), String(), - SW_EVENT_FRM_MOVE ); - } - } - // no break; - case MACASSGN_OLE: // OLE - { - if( !bHtmlMode ) - aItem.AddEvent( String( SW_RES(STR_EVENT_OBJECT_SELECT) ), String(), - SW_EVENT_OBJECT_SELECT ); - } - // no break; - case MACASSGN_INETFMT: // INetFmt-Attributes - { - aItem.AddEvent( String( SW_RES(STR_EVENT_MOUSEOVER_OBJECT) ), String(), - SFX_EVENT_MOUSEOVER_OBJECT ); - aItem.AddEvent( String( SW_RES(STR_EVENT_MOUSECLICK_OBJECT) ), String(), - SFX_EVENT_MOUSECLICK_OBJECT); - aItem.AddEvent( String( SW_RES(STR_EVENT_MOUSEOUT_OBJECT) ), String(), - SFX_EVENT_MOUSEOUT_OBJECT); - } - break; - } - - return aItem; -} - - -sal_Bool SwMacroAssignDlg::INetFmtDlg( Window* pParent, SwWrtShell& rSh, - SvxMacroItem*& rpINetItem ) -{ - sal_Bool bRet = sal_False; - SfxItemSet aSet( rSh.GetAttrPool(), RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ); - SvxMacroItem aItem( RES_FRMMACRO ); - if( !rpINetItem ) - rpINetItem = new SvxMacroItem( RES_FRMMACRO ); - else - aItem.SetMacroTable( rpINetItem->GetMacroTable() ); - - aSet.Put( aItem ); - aSet.Put( AddEvents( MACASSGN_INETFMT ) ); - - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - SfxAbstractDialog* pMacroDlg = pFact->CreateSfxDialog( pParent, aSet, - rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), - SID_EVENTCONFIG ); - if ( pMacroDlg && pMacroDlg->Execute() == RET_OK ) - { - const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet(); - const SfxPoolItem* pItem; - if( SFX_ITEM_SET == pOutSet->GetItemState( RES_FRMMACRO, sal_False, &pItem )) - { - rpINetItem->SetMacroTable( ((SvxMacroItem*)pItem)->GetMacroTable() ); - bRet = sal_True; - } - } - return bRet; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/regionsw.cxx b/sw/source/ui/dialog/regionsw.cxx deleted file mode 100644 index fe6d9132de..0000000000 --- a/sw/source/ui/dialog/regionsw.cxx +++ /dev/null @@ -1,256 +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_sw.hxx" - - -#include <hintids.hxx> -#include <uitool.hxx> -#include <svl/urihelper.hxx> -#include <svl/PasswordHelper.hxx> -#include <vcl/msgbox.hxx> -#include <svl/stritem.hxx> -#include <svl/eitem.hxx> -#include <sot/formats.hxx> -#include <sfx2/passwd.hxx> -#include <sfx2/docfilt.hxx> -#include <sfx2/request.hxx> -#include <sfx2/docfile.hxx> -#include <sfx2/linkmgr.hxx> -#include <editeng/sizeitem.hxx> -#include <svtools/htmlcfg.hxx> -#include <section.hxx> -#include <docary.hxx> -#include <regionsw.hxx> -#include <basesh.hxx> -#include <wdocsh.hxx> -#include <view.hxx> -#include <swmodule.hxx> -#include <wrtsh.hxx> -#include <swundo.hxx> // for Undo-Ids -#include <column.hxx> -#include <fmtfsize.hxx> -#include <swunodef.hxx> -#include <shellio.hxx> -#include <helpid.h> -#include <cmdid.h> -#include <regionsw.hrc> -#include <comcore.hrc> -#include <globals.hrc> -#include <sfx2/bindings.hxx> -#include <svx/htmlmode.hxx> -#include <svx/dlgutil.hxx> -#include "swabstdlg.hxx" - -void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) -{ - SwWrtShell& rSh = GetShell(); - const SfxItemSet *pSet = rReq.GetArgs(); - - SfxItemSet aSet(GetPool(), - RES_COL, RES_COL, - RES_LR_SPACE, RES_LR_SPACE, - RES_COLUMNBALANCE, RES_FRAMEDIR, - RES_BACKGROUND, RES_BACKGROUND, - RES_FRM_SIZE, RES_FRM_SIZE, - RES_FTN_AT_TXTEND, RES_END_AT_TXTEND, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - 0); - - if (!pSet || pSet->Count()==0) - { - SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_AS_CHAR); - - long nWidth = aRect.Width(); - aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); - - // height=width for more consistent preview (analog to edit region) - aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION, - &GetView().GetViewFrame()->GetWindow(), aSet , rSh); - OSL_ENSURE(aTabDlg, "Dialogdiet fail!"); - aTabDlg->Execute(); - rReq.Ignore(); - delete aTabDlg; - } - else - { - const SfxPoolItem *pItem = 0; - String aTmpStr; - if ( SFX_ITEM_SET == - pSet->GetItemState(FN_PARAM_REGION_NAME, sal_True, &pItem) ) - aTmpStr = rSh.GetUniqueSectionName( - &((const SfxStringItem *)pItem)->GetValue() ); - else - aTmpStr = rSh.GetUniqueSectionName(); - - SwSectionData aSection(CONTENT_SECTION, aTmpStr); - rReq.SetReturnValue(SfxStringItem(FN_INSERT_REGION, aTmpStr)); - - aSet.Put( *pSet ); - if(SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_COLUMNS, sal_False, &pItem)|| - SFX_ITEM_SET == pSet->GetItemState(FN_INSERT_REGION, sal_False, &pItem)) - { - SwFmtCol aCol; - SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_AS_CHAR); - long nWidth = aRect.Width(); - - sal_uInt16 nCol = ((SfxUInt16Item *)pItem)->GetValue(); - if(nCol) - { - aCol.Init( nCol, 0, static_cast< sal_uInt16 >(nWidth) ); - aSet.Put(aCol); - } - } - else if(SFX_ITEM_SET == pSet->GetItemState(RES_COL, sal_False, &pItem)) - { - aSet.Put(*pItem); - } - - const sal_Bool bHidden = SFX_ITEM_SET == - pSet->GetItemState(FN_PARAM_REGION_HIDDEN, sal_True, &pItem)? - (sal_Bool)((const SfxBoolItem *)pItem)->GetValue():sal_False; - const sal_Bool bProtect = SFX_ITEM_SET == - pSet->GetItemState(FN_PARAM_REGION_PROTECT, sal_True, &pItem)? - (sal_Bool)((const SfxBoolItem *)pItem)->GetValue():sal_False; - // #114856# edit in readonly sections - const sal_Bool bEditInReadonly = SFX_ITEM_SET == - pSet->GetItemState(FN_PARAM_REGION_EDIT_IN_READONLY, sal_True, &pItem)? - (sal_Bool)((const SfxBoolItem *)pItem)->GetValue():sal_False; - - aSection.SetProtectFlag(bProtect); - aSection.SetHidden(bHidden); - // #114856# edit in readonly sections - aSection.SetEditInReadonlyFlag(bEditInReadonly); - - if(SFX_ITEM_SET == - pSet->GetItemState(FN_PARAM_REGION_CONDITION, sal_True, &pItem)) - aSection.SetCondition(((const SfxStringItem *)pItem)->GetValue()); - - String aFile, aSub; - if(SFX_ITEM_SET == - pSet->GetItemState(FN_PARAM_1, sal_True, &pItem)) - aFile = ((const SfxStringItem *)pItem)->GetValue(); - - if(SFX_ITEM_SET == - pSet->GetItemState(FN_PARAM_3, sal_True, &pItem)) - aSub = ((const SfxStringItem *)pItem)->GetValue(); - - - if(aFile.Len() || aSub.Len()) - { - String sLinkFileName(sfx2::cTokenSeperator); - sLinkFileName += sfx2::cTokenSeperator; - sLinkFileName.SetToken(0, sfx2::cTokenSeperator,aFile); - - if(SFX_ITEM_SET == - pSet->GetItemState(FN_PARAM_2, sal_True, &pItem)) - sLinkFileName.SetToken(1, sfx2::cTokenSeperator, - ((const SfxStringItem *)pItem)->GetValue()); - - sLinkFileName += aSub; - aSection.SetType( FILE_LINK_SECTION ); - aSection.SetLinkFileName(sLinkFileName); - } - rSh.InsertSection(aSection, aSet.Count() ? &aSet : 0); - rReq.Done(); - } -} - -IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData*, pSect ) -{ - ::std::auto_ptr<SwSectionData> pSectionData(pSect); - if (pSectionData.get()) - { - SfxItemSet aSet(pThis->GetView().GetPool(), - RES_COL, RES_COL, - RES_BACKGROUND, RES_BACKGROUND, - RES_FRM_SIZE, RES_FRM_SIZE, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - 0); - SwRect aRect; - pThis->CalcBoundRect(aRect, FLY_AS_CHAR); - long nWidth = aRect.Width(); - aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); - // height=width for more consistent preview (analog to edit region) - aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractInsertSectionTabDialog* aTabDlg = pFact->CreateInsertSectionTabDialog( DLG_INSERT_SECTION, - &pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis); - OSL_ENSURE(aTabDlg, "Dialogdiet fail!"); - aTabDlg->SetSectionData(*pSectionData); - aTabDlg->Execute(); - - delete aTabDlg; - } - return 0; -} - -void SwBaseShell::EditRegionDialog(SfxRequest& rReq) -{ - const SfxItemSet* pArgs = rReq.GetArgs(); - sal_uInt16 nSlot = rReq.GetSlot(); - const SfxPoolItem* pItem = 0; - if(pArgs) - pArgs->GetItemState(nSlot, sal_False, &pItem); - SwWrtShell& rWrtShell = GetShell(); - - switch ( nSlot ) - { - case FN_EDIT_REGION: - { - Window* pParentWin = &GetView().GetViewFrame()->GetWindow(); - sal_Bool bStart = sal_True; - if(bStart) - { - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractEditRegionDlg* pEditRegionDlg = pFact->CreateEditRegionDlg( MD_EDIT_REGION, - pParentWin, rWrtShell); - OSL_ENSURE(pEditRegionDlg, "Dialogdiet fail!"); - if(pItem && pItem->ISA(SfxStringItem)) - { - pEditRegionDlg->SelectSection(((const SfxStringItem*)pItem)->GetValue()); - } - pEditRegionDlg->Execute(); - delete pEditRegionDlg; - } - else - InfoBox(pParentWin, SW_RES(REG_WRONG_PASSWORD)).Execute(); - } - break; - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/regionsw.hrc b/sw/source/ui/dialog/regionsw.hrc deleted file mode 100644 index c5a76caf6f..0000000000 --- a/sw/source/ui/dialog/regionsw.hrc +++ /dev/null @@ -1,114 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _REGIONSW_HRC -#define _REGIONSW_HRC - -#include "dialog.hrc" - - -#define CB_DDE 1 -#define CB_DISMISS 2 -#define CB_END_AT_TXTEND 3 -#define CB_END_NUM 4 -#define CB_FILE 5 -#define CB_FTN_AT_TXTEND 6 -#define CB_FTN_NUM 7 -#define CB_HIDE 8 -#define CB_PASSWD 9 -#define CB_PROTECT 10 -#define CB_FTN_NUM_FMT 11 -#define CB_END_NUM_FMT 12 -#define ED_CONDITION 13 -#define ED_END_PREFIX 14 -#define ED_END_SUFFIX 15 -#define ED_FILE 16 -#define ED_FTN_PREFIX 17 -#define ED_FTN_SUFFIX 18 -#define ED_RANAME 19 -#define ED_RNAME 20 -#define FT_CONDITION 21 -#define FL_EDIT_OPTIONS 22 -#define FLD_END_OFFSET 23 -#define FLD_FTN_OFFSET 24 -#define FT_DDE 25 -#define FT_END_OFFSET 26 -#define FT_END_PREFIX 27 -#define FT_END_SUFFIX 28 -#define FT_FILE 29 -#define FT_FTN_OFFSET 30 -#define FT_FTN_PREFIX 31 -#define FT_FTN_SUFFIX 32 -#define FT_RNAME 33 -#define FT_SUBREG 34 -#define LB_END_NUMVIEW 36 -#define LB_FTN_NUMVIEW 37 -#define LB_SUBREG 38 -#define PB_CANCEL 39 -#define PB_FILE 40 -#define PB_HELP 41 -#define PB_OK 42 -#define PB_OPTIONS 43 -#define PB_SAVED 44 -#define ST_INSERT 45 -#define TLB_SECTION 46 -#define FL_NAME 47 -#define FL_LINK 48 -#define FL_PROTECT 49 -#define FL_HIDE 50 -#define PB_PASSWD 51 -#define FL_END 52 -#define FL_FTN 53 -#define IL_BITMAPS 54 -// #114856# edit in readonly sections -#define FL_PROPERTIES 56 -#define CB_EDIT_IN_READONLY 57 - -/* global resources */ -#define STR_REG_DUPLICATE (RC_REGIONSW_BEGIN+6) -#define STR_INFO_DUPLICATE (RC_REGIONSW_BEGIN+7) - -#define MD_INS_REGION (RC_REGIONSW_BEGIN+8) -#define MD_EDIT_REGION (RC_REGIONSW_BEGIN+9) -#define QB_CONNECT (RC_REGIONSW_BEGIN+10) -#define REG_WRONG_PASSWORD (RC_REGIONSW_BEGIN+11) -#define REG_WRONG_PASSWD_REPEAT (RC_REGIONSW_BEGIN+12) - -//ImageList elements -#define BMP_HIDE 1 -#define BMP_NO_HIDE 2 -#define BMP_PROT_HIDE 3 -#define BMP_PROT_NO_HIDE 4 - -//SwSectionIndentTabPage -#define FL_INDENT 1 -#define FT_BEFORE 2 -#define MF_BEFORE 3 -#define FT_AFTER 4 -#define MF_AFTER 5 -#define WIN_PREVIEW 6 - -#endif diff --git a/sw/source/ui/dialog/regionsw.src b/sw/source/ui/dialog/regionsw.src deleted file mode 100644 index 8f249a890f..0000000000 --- a/sw/source/ui/dialog/regionsw.src +++ /dev/null @@ -1,893 +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 "regionsw.hrc" -#include "cmdid.h" -#include "globals.hrc" -#include "helpid.h" -/************************************************************************* - - Dialog "paste region" - -*************************************************************************/ -#define FT_SUBREG_TEXT \ - Text [ en-US ] = "~Section" ; \ - -#define CB_HIDE_TEXT \ - Text [ en-US ] = "H~ide" ;\ - -#define FL_HIDE_TEXT \ - Text [ en-US ] = "Hide" ;\ - -#define CB_CONDITION_TEXT \ - Text [ en-US ] = "~With Condition" ;\ - -#define FL_PROPERTIES_TEXT \ - Text [ en-US ] = "Properties" ;\ - -#define CB_EDIT_IN_READONLY_TEXT \ - Text [ en-US ] = "E~ditable in read-only document" ;\ - -#define FL_FILE_TEXT \ - Text [ en-US ] = "Link" ;\ - -#define CB_FILE_TEXT\ - Text [ en-US ] = "~Link";\ - -#define CB_DDE_TEXT \ - Text [ en-US ] = "DD~E" ;\ - -#define FT_DDE_TEXT \ - Text [ en-US ] = "DDE ~command" ;\ - -#define FT_FILE_TEXT \ - Text [ en-US ] = "~File name" ;\ - - -#define GB_HIDE_TEXT \ - Text [ en-US ] = "Hide";\ - -#define GB_OPTIONS_TEXT \ - Text [ en-US ] = "Options" ;\ - -#define FL_PROTECT_TEXT \ - Text [ en-US ] = "Write protection";\ - -#define CB_PASSWD_TEXT\ - Text [ en-US ] = "Wit~h password";\ - -/************************************************************************* - - Dialog "edit region" - -*************************************************************************/ -ModalDialog MD_EDIT_REGION -{ - HelpID = CMD_FN_EDIT_REGION ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 316 , 185 ) ; - Text [ en-US ] = "Edit Sections" ; - Moveable = TRUE ; - FixedLine FL_NAME - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Section" ; - }; - Edit ED_RANAME - { - HelpID = "sw:Edit:MD_EDIT_REGION:ED_RANAME"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 71 , 12 ) ; - TabStop = TRUE ; - Disable = TRUE ; - }; - Control TLB_SECTION - { - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 29 ) ; - Size = MAP_APPFONT ( 71 , 150 ) ; - TabStop = TRUE ; - }; - FixedLine FL_LINK - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 92 , 3 ) ; - Size = MAP_APPFONT ( 162 , 8 ) ; - FL_FILE_TEXT - }; - TriStateBox CB_FILE - { - HelpID = "sw:TriStateBox:MD_EDIT_REGION:CB_FILE"; - Pos = MAP_APPFONT ( 98 , 14 ) ; - Size = MAP_APPFONT ( 59 , 10 ) ; - TabStop = TRUE ; - CB_FILE_TEXT - }; - CheckBox CB_DDE - { - HelpID = "sw:CheckBox:MD_EDIT_REGION:CB_DDE"; - Pos = MAP_APPFONT ( 98 , 28 ) ; - Size = MAP_APPFONT ( 30 , 10 ) ; - Disable = TRUE ; - CB_DDE_TEXT - }; - FixedText FT_DDE - { - Pos = MAP_APPFONT ( 104 , 44) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Hide = TRUE ; - FT_DDE_TEXT - }; - FixedText FT_FILE - { - Pos = MAP_APPFONT ( 104 , 44 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Disable = TRUE ; - FT_FILE_TEXT - }; - Edit ED_FILE - { - HelpID = "sw:Edit:MD_EDIT_REGION:ED_FILE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 165 , 42 ) ; - Size = MAP_APPFONT ( 68 , 12 ) ; - Disable = TRUE ; - TabStop = TRUE ; - }; - PushButton PB_FILE - { - HelpID = "sw:PushButton:MD_EDIT_REGION:PB_FILE"; - Pos = MAP_APPFONT ( 239 , 42 ) ; - Size = MAP_APPFONT ( 12 , 12 ) ; - TabStop = TRUE ; - Disable = TRUE ; - Text = "..."; - }; - FixedText FT_SUBREG - { - Pos = MAP_APPFONT ( 104 , 59 ) ; - Size = MAP_APPFONT ( 38 , 8 ) ; - Disable = TRUE ; - FT_SUBREG_TEXT - }; - ComboBox LB_SUBREG - { - HelpID = "sw:ComboBox:MD_EDIT_REGION:LB_SUBREG"; - Pos = MAP_APPFONT ( 165 , 57 ) ; - Size = MAP_APPFONT ( 68 , 50 ) ; - Disable = TRUE ; - TabStop = TRUE ; - Sort = TRUE ; - DropDown = TRUE ; - }; - FixedLine FL_PROTECT - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 92 , 75 ) ; - Size = MAP_APPFONT ( 162 , 8 ) ; - FL_PROTECT_TEXT - }; - TriStateBox CB_PROTECT - { - HelpID = "sw:TriStateBox:MD_EDIT_REGION:CB_PROTECT"; - Pos = MAP_APPFONT ( 98 , 86 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - TabStop = TRUE ; - Disable = TRUE ; - TriStateDisable = FALSE ; - Text [ en-US ] = "~Protected" ; - }; - CheckBox CB_PASSWD - { - HelpID = "sw:CheckBox:MD_EDIT_REGION:CB_PASSWD"; - Pos = MAP_APPFONT ( 107 , 100 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - CB_PASSWD_TEXT - }; - PushButton PB_PASSWD - { - HelpID = "sw:PushButton:MD_EDIT_REGION:PB_PASSWD"; - Pos = MAP_APPFONT ( 239 , 98 ) ; - Size = MAP_APPFONT ( 12 , 12 ) ; - TabStop = TRUE ; - Text = "..." ; - }; - FixedLine FL_HIDE - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 92 , 116 ) ; - Size = MAP_APPFONT ( 162 , 8 ) ; - FL_HIDE_TEXT - }; - TriStateBox CB_HIDE - { - HelpID = "sw:TriStateBox:MD_EDIT_REGION:CB_HIDE"; - Pos = MAP_APPFONT ( 98 , 127 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - TabStop = TRUE ; - TriStateDisable = FALSE ; - CB_HIDE_TEXT - }; - FixedText FT_CONDITION - { - Pos = MAP_APPFONT ( 104 , 143) ; - Size = MAP_APPFONT ( 55 , 8 ) ; - Disable = TRUE ; - CB_CONDITION_TEXT - }; - Edit ED_CONDITION - { - HelpID = "sw:Edit:MD_EDIT_REGION:ED_CONDITION"; - Border = TRUE ; - Pos = MAP_APPFONT ( 165 , 141) ; - Size = MAP_APPFONT ( 86 , 12 ) ; - TabStop = TRUE ; - Disable = TRUE ; - }; - - FixedLine FL_PROPERTIES - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 92 , 159 ) ; - Size = MAP_APPFONT ( 162 , 8 ) ; - FL_PROPERTIES_TEXT - }; - TriStateBox CB_EDIT_IN_READONLY - { - HelpID = "sw:TriStateBox:MD_EDIT_REGION:CB_EDIT_IN_READONLY"; - Pos = MAP_APPFONT ( 98 , 170 ) ; - Size = MAP_APPFONT ( 156 , 10 ) ; - TabStop = TRUE ; - TriStateDisable = FALSE ; - CB_EDIT_IN_READONLY_TEXT - }; - - OKButton PB_OK - { - Pos = MAP_APPFONT ( 263 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Disable = TRUE ; - DefButton = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 263 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - PushButton PB_OPTIONS - { - HelpID = "sw:PushButton:MD_EDIT_REGION:PB_OPTIONS"; - Pos = MAP_APPFONT ( 263 , 40 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Hide = TRUE ; - Text [ en-US ] = "~Options..."; - }; - PushButton CB_DISMISS - { - HelpID = "sw:PushButton:MD_EDIT_REGION:CB_DISMISS"; - Pos = MAP_APPFONT ( 263 , 57 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Disable = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "Remove" ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 263 , 77 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - -#define DLG_IMAGE_IDLIST \ - IdList = \ - { \ - BMP_HIDE /*1*/ ;\ - BMP_NO_HIDE /*2*/ ;\ - BMP_PROT_HIDE /*3*/ ;\ - BMP_PROT_NO_HIDE /*4*/ ;\ - }; \ - IdCount = { 4 ; }; - - ImageList IL_BITMAPS - { - Prefix = "re"; - MaskColor = IMAGE_MASK_COLOR ; - DLG_IMAGE_IDLIST - }; -}; -String STR_REG_DUPLICATE -{ - Text [ en-US ] = "Section name changed:" ; -}; -String STR_INFO_DUPLICATE -{ - Text [ en-US ] = "Duplicate section name" ; -}; -QueryBox QB_CONNECT -{ - Buttons = WB_YES_NO ; - DefButton = WB_DEF_NO ; - Message [ en-US ] = "A file connection will delete the contents of the current section. Connect anyway?" ; -}; -InfoBox REG_WRONG_PASSWORD -{ - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "The password entered is invalid." ; -}; -InfoBox REG_WRONG_PASSWD_REPEAT -{ - BUTTONS = WB_OK ; - DEFBUTTON = WB_DEF_OK ; - Message [ en-US ] = "The password has not been set." ; -}; - -TabDialog DLG_INSERT_SECTION -{ - HelpId = HID_INSERT_SECTION_DLG; - Text [ en-US ] = "Insert Section" ; - OutputSize = TRUE ; - SVLook = TRUE ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - PageList = - { - PageItem - { - Identifier = TP_INSERT_SECTION; - PageResID = TP_INSERT_SECTION; - Text [ en-US ] = "Section"; - }; - PageItem - { - Identifier = TP_COLUMN ; - PageResID = TP_COLUMN ; - Text [ en-US ] = "Columns" ; - }; - PageItem - { - Identifier = TP_SECTION_INDENTS; - PageResID = TP_SECTION_INDENTS; - Text [ en-US ] = "Indents" ; - }; - PageItem - { - Identifier = TP_BACKGROUND ; - PageResID = TP_BACKGROUND ; - Text [ en-US ] = "Background" ; - }; - PageItem - { - Identifier = TP_SECTION_FTNENDNOTES ; - PageResID = TP_SECTION_FTNENDNOTES ; - Text [ en-US ] = "Footnotes/Endnotes"; - }; - }; - }; - String ST_INSERT - { - Text [ en-US ] = "Insert" ; - }; -}; - -TabPage TP_INSERT_SECTION -{ - HelpID = HID_INSERT_SECTION_PAGE; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE ; - FixedLine FL_NAME - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 78 , 8 ) ; - Text [ en-US ] = "New section" ; - }; - ComboBox ED_RNAME - { - HelpID = "sw:ComboBox:TP_INSERT_SECTION:ED_RNAME"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 69 , 140 ) ; - TabStop = TRUE ; - AutoHScroll = TRUE ; - SORT = TRUE ; - }; - FixedLine FL_LINK - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 90 , 3 ) ; - Size = MAP_APPFONT ( 164 , 8 ) ; - FL_FILE_TEXT - }; - CheckBox CB_FILE - { - HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_FILE"; - Pos = MAP_APPFONT ( 96 , 14 ) ; - Size = MAP_APPFONT ( 60 , 10 ) ; - TabStop = TRUE ; - CB_FILE_TEXT - }; - CheckBox CB_DDE - { - HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_DDE"; - Pos = MAP_APPFONT ( 96 , 28) ; - Size = MAP_APPFONT ( 60 , 10 ) ; - Disable = TRUE ; - CB_DDE_TEXT - }; - FixedText FT_DDE - { - Pos = MAP_APPFONT ( 96 , 44 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Hide = TRUE ; - FT_DDE_TEXT - }; - FixedText FT_FILE - { - Pos = MAP_APPFONT ( 96 , 44 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Disable = TRUE ; - FT_FILE_TEXT - }; - Edit ED_FILE - { - HelpID = "sw:Edit:TP_INSERT_SECTION:ED_FILE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 160 , 42 ) ; - Size = MAP_APPFONT ( 76 , 12 ) ; - Disable = TRUE ; - TabStop = TRUE ; - }; - PushButton PB_FILE - { - HelpID = "sw:PushButton:TP_INSERT_SECTION:PB_FILE"; - Pos = MAP_APPFONT ( 239 , 42 ) ; - Size = MAP_APPFONT ( 12 , 12 ) ; - Disable = TRUE ; - TabStop = TRUE ; - Text = "..."; - }; - FixedText FT_SUBREG - { - Pos = MAP_APPFONT ( 96 , 60 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Disable = TRUE ; - FT_SUBREG_TEXT - }; - ComboBox LB_SUBREG - { - HelpID = "sw:ComboBox:TP_INSERT_SECTION:LB_SUBREG"; - Pos = MAP_APPFONT ( 160 , 58 ) ; - Size = MAP_APPFONT ( 76 , 50 ) ; - DropDown = TRUE ; - Disable = TRUE ; - TabStop = TRUE ; - Sort = TRUE ; - }; - FixedLine FL_PROTECT - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 90 , 76 ) ; - Size = MAP_APPFONT ( 164 , 8 ) ; - FL_PROTECT_TEXT - }; - CheckBox CB_PROTECT - { - HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_PROTECT"; - Pos = MAP_APPFONT ( 96 , 87 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Protect"; - }; - CheckBox CB_PASSWD - { - HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_PASSWD"; - Pos = MAP_APPFONT ( 105 , 101 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - CB_PASSWD_TEXT - }; - PushButton PB_PASSWD - { - HelpID = "sw:PushButton:TP_INSERT_SECTION:PB_PASSWD"; - Pos = MAP_APPFONT ( 239 , 99 ) ; - Size = MAP_APPFONT ( 12 , 12 ) ; - TabStop = TRUE ; - Text = "..." ; - }; - FixedLine FL_HIDE - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 90 , 117 ) ; - Size = MAP_APPFONT ( 164 , 8 ) ; - FL_HIDE_TEXT - }; - CheckBox CB_HIDE - { - HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_HIDE"; - Pos = MAP_APPFONT ( 96 , 128 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - CB_HIDE_TEXT - }; - FixedText FT_CONDITION - { - Pos = MAP_APPFONT ( 96 , 144 ) ; - Size = MAP_APPFONT ( 60 , 8 ) ; - Disable = TRUE ; - CB_CONDITION_TEXT - }; - Edit ED_CONDITION - { - HelpID = "sw:Edit:TP_INSERT_SECTION:ED_CONDITION"; - Border = TRUE ; - Pos = MAP_APPFONT ( 160 , 142 ) ; - Size = MAP_APPFONT ( 91 , 12 ) ; - Disable = TRUE ; - TabStop = TRUE ; - }; - - FixedLine FL_PROPERTIES - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 90 , 159 ) ; - Size = MAP_APPFONT ( 164 , 8 ) ; - FL_PROPERTIES_TEXT - }; - CheckBox CB_EDIT_IN_READONLY - { - HelpID = "sw:CheckBox:TP_INSERT_SECTION:CB_EDIT_IN_READONLY"; - Pos = MAP_APPFONT ( 96 , 170 ) ; - Size = MAP_APPFONT ( 158 , 10 ) ; - CB_EDIT_IN_READONLY_TEXT - }; - -}; - -TabDialog DLG_SECTION_PROPERTIES -{ - HelpId = HID_SECTION_PROPERTIES_DLG; - OutputSize = TRUE ; - SVLook = TRUE ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - PageList = - { - PageItem - { - Identifier = TP_COLUMN ; - PageResID = TP_COLUMN ; - Text [ en-US ] = "Columns" ; - }; - PageItem - { - Identifier = TP_SECTION_INDENTS; - PageResID = TP_SECTION_INDENTS; - Text [ en-US ] = "Indents" ; - }; - PageItem - { - Identifier = TP_BACKGROUND ; - PageResID = TP_BACKGROUND ; - Text [ en-US ] = "Background" ; - }; - PageItem - { - Identifier = TP_SECTION_FTNENDNOTES ; - PageResID = TP_SECTION_FTNENDNOTES ; - Text [ en-US ] = "Footnotes/Endnotes"; - }; - }; - }; - Text [ en-US ] = "Options"; -}; - - -TabPage TP_SECTION_FTNENDNOTES -{ - HelpID = HID_SECTION_FTNENDNOTES_PAGE; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE ; - FixedLine FL_FTN - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Footnotes"; - }; - CheckBox CB_FTN_AT_TXTEND - { - HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_FTN_AT_TXTEND"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 90 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Collec~t at end of text"; - - }; - CheckBox CB_FTN_NUM - { - HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_FTN_NUM"; - Pos = MAP_APPFONT ( 18 , 29 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Restart numbering"; - }; - FixedText FT_FTN_OFFSET - { - Pos = MAP_APPFONT ( 24 , 46 ) ; - Size = MAP_APPFONT ( 64 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Start at" ; - }; - NumericField FLD_FTN_OFFSET - { - HelpID = "sw:NumericField:TP_SECTION_FTNENDNOTES:FLD_FTN_OFFSET"; - Pos = MAP_APPFONT ( 90 , 44 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - Last = 9999 ; - Maximum = 9999 ; - TabStop = TRUE ; - Border = TRUE ; - }; - CheckBox CB_FTN_NUM_FMT - { - HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_FTN_NUM_FMT"; - Pos = MAP_APPFONT ( 24 , 61 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Custom ~format"; - }; - FixedText FT_FTN_PREFIX - { - Pos = MAP_APPFONT ( 30 , 76 ) ; - Size = MAP_APPFONT ( 58 , 8 ) ; - Text [ en-US ] = "Be~fore" ; - Left = TRUE ; - }; - Edit ED_FTN_PREFIX - { - HelpID = "sw:Edit:TP_SECTION_FTNENDNOTES:ED_FTN_PREFIX"; - Border = TRUE ; - Pos = MAP_APPFONT ( 90 , 74 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; - ListBox LB_FTN_NUMVIEW - { - HelpID = "sw:ListBox:TP_SECTION_FTNENDNOTES:LB_FTN_NUMVIEW"; - Border = TRUE ; - Pos = MAP_APPFONT ( 123 , 74 ) ; - Size = MAP_APPFONT ( 62 , 50 ) ; - TabStop = TRUE ; - Group = TRUE ; - DropDown = TRUE ; - }; - FixedText FT_FTN_SUFFIX - { - Pos = MAP_APPFONT ( 191 , 76 ) ; - Size = MAP_APPFONT ( 25 , 8 ) ; - Text [ en-US ] = "Aft~er" ; - Right = TRUE ; - }; - Edit ED_FTN_SUFFIX - { - HelpID = "sw:Edit:TP_SECTION_FTNENDNOTES:ED_FTN_SUFFIX"; - Border = TRUE ; - Pos = MAP_APPFONT ( 219 , 74 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; - - - FixedLine FL_END - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 6 , 92 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Endnotes"; - }; - CheckBox CB_END_AT_TXTEND - { - HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_END_AT_TXTEND"; - Pos = MAP_APPFONT ( 12 , 103 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "C~ollect at end of section"; - }; - CheckBox CB_END_NUM - { - HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_END_NUM"; - Pos = MAP_APPFONT ( 16 , 118 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Restart numbering"; - }; - FixedText FT_END_OFFSET - { - Pos = MAP_APPFONT ( 24 , 135 ) ; - Size = MAP_APPFONT ( 64 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Start at" ; - }; - NumericField FLD_END_OFFSET - { - HelpID = "sw:NumericField:TP_SECTION_FTNENDNOTES:FLD_END_OFFSET"; - Pos = MAP_APPFONT ( 90 , 133 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - Last = 9999 ; - Maximum = 9999 ; - TabStop = TRUE ; - Border = TRUE ; - }; - CheckBox CB_END_NUM_FMT - { - HelpID = "sw:CheckBox:TP_SECTION_FTNENDNOTES:CB_END_NUM_FMT"; - Pos = MAP_APPFONT ( 24 , 150 ) ; - Size = MAP_APPFONT ( 100 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Custom format"; - }; - - FixedText FT_END_PREFIX - { - Pos = MAP_APPFONT ( 30 , 165 ) ; - Size = MAP_APPFONT ( 58 , 8 ) ; - Text [ en-US ] = "Be~fore" ; - Left = TRUE ; - }; - Edit ED_END_PREFIX - { - HelpID = "sw:Edit:TP_SECTION_FTNENDNOTES:ED_END_PREFIX"; - Border = TRUE ; - Pos = MAP_APPFONT ( 90 , 163 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; - ListBox LB_END_NUMVIEW - { - HelpID = "sw:ListBox:TP_SECTION_FTNENDNOTES:LB_END_NUMVIEW"; - Border = TRUE ; - Pos = MAP_APPFONT ( 123 , 163 ) ; - Size = MAP_APPFONT ( 62 , 50 ) ; - TabStop = TRUE ; - Group = TRUE ; - DropDown = TRUE ; - CurPos = 0 ; - }; - FixedText FT_END_SUFFIX - { - Pos = MAP_APPFONT ( 191 , 165 ) ; - Size = MAP_APPFONT ( 25 , 8 ) ; - Text [ en-US ] = "Aft~er" ; - Right = TRUE ; - }; - Edit ED_END_SUFFIX - { - HelpID = "sw:Edit:TP_SECTION_FTNENDNOTES:ED_END_SUFFIX"; - Border = TRUE ; - Pos = MAP_APPFONT ( 219 , 163 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; -}; - -TabPage TP_SECTION_INDENTS -{ - HelpID = HID_SECTION_INDENTS_PAGE; - SVLook = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 260 , 185 ) ; - Hide = TRUE ; - FixedLine FL_INDENT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 173 , 8 ) ; - Text [ en-US ] = "Indent" ; - }; - FixedText FT_BEFORE - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Before section" ; - }; - MetricField MF_BEFORE - { - HelpID = "sw:MetricField:TP_SECTION_INDENTS:MF_BEFORE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 135 , 14 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 9999 ; - Minimum = -9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - Last = 9999 ; - SpinSize = 10 ; - }; - FixedText FT_AFTER - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~After section" ; - }; - MetricField MF_AFTER - { - HelpID = "sw:MetricField:TP_SECTION_INDENTS:MF_AFTER"; - Border = TRUE ; - Pos = MAP_APPFONT ( 135 , 30 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - Group = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Maximum = 9999 ; - Minimum = -9999 ; - DecimalDigits = 2 ; - Unit = FUNIT_CM ; - Last = 9999 ; - SpinSize = 10 ; - }; - Window WIN_PREVIEW - { - Border = TRUE ; - Pos = MAP_APPFONT ( 185 , 7 ) ; - Size = MAP_APPFONT ( 68 , 112 ) ; - }; -}; diff --git a/sw/source/ui/dialog/swabstdlg.cxx b/sw/source/ui/dialog/swabstdlg.cxx deleted file mode 100644 index 3e64a6ecb4..0000000000 --- a/sw/source/ui/dialog/swabstdlg.cxx +++ /dev/null @@ -1,56 +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_sw.hxx" - -#include "swabstdlg.hxx" - -#include <osl/module.hxx> -#include <tools/string.hxx> -#include <vcl/unohelp.hxx> - -typedef SwAbstractDialogFactory* (__LOADONCALLAPI *SwFuncPtrCreateDialogFactory)(); - -extern "C" { static void SAL_CALL thisModule() {} } - -SwAbstractDialogFactory* SwAbstractDialogFactory::Create() -{ - SwFuncPtrCreateDialogFactory fp = 0; - static ::osl::Module aDialogLibrary; - static const ::rtl::OUString sLibName(::vcl::unohelper::CreateLibraryName("swui", sal_True)); - if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( sLibName ), - SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) ) - fp = ( SwAbstractDialogFactory* (__LOADONCALLAPI*)() ) - aDialogLibrary.getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDialogFactory"))); - if ( fp ) - return fp(); - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swdialmgr.cxx b/sw/source/ui/dialog/swdialmgr.cxx deleted file mode 100644 index 7ff123857d..0000000000 --- a/sw/source/ui/dialog/swdialmgr.cxx +++ /dev/null @@ -1,57 +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_sw.hxx" - -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif - -// include --------------------------------------------------------------- - -#include "dialmgr.hxx" -#include "tools/string.hxx" -#include <sfx2/app.hxx> - -//copy from core\bastyp\swtypes.cxx -String aEmptyStr; // constant strings - -ResMgr* pSwResMgr=0; - -ResMgr* SwDialogsResMgr::GetResMgr() -{ - if ( !pSwResMgr ) - { - pSwResMgr = SfxApplication::CreateResManager( "sw" ); - } - - return pSwResMgr; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx deleted file mode 100644 index 9e197bbaab..0000000000 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ /dev/null @@ -1,1679 +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_sw.hxx" - -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif - -#include "swdlgfact.hxx" -#include <svl/style.hxx> -#include <svx/svxids.hrc> -#include "dialog.hrc" -#include "misc.hrc" -#include "chrdlg.hrc" -#include "table.hrc" -#include "frmui.hrc" -#include "dbui.hrc" -#include "globals.hrc" -#include "fldui.hrc" -#include "envelp.hrc" -#include "dochdl.hrc" -#include <index.hrc> -#include <regionsw.hrc> -#include <fmtui.hrc> - -#include <wordcountdialog.hxx> -#include "abstract.hxx" // add for SwInsertAbstractDlg -#include "addrdlg.hxx" // add for SwAddrDlg -#include "ascfldlg.hxx" // add for SwAsciiFilterDlg -#include "bookmark.hxx" //add for SwInsertBookmarkDlg -#include "break.hxx" //add for SwBreakDlg -#include "changedb.hxx" //add for SwChangeDBDlg -#include "chrdlg.hxx" // add for SwCharDlg -#include "convert.hxx" //add for SwConvertTableDlg -#include "cption.hxx" //add for SwCaptionDialog -#include "dbinsdlg.hxx" //add for SwInsertDBColAutoPilot -#include "docfnote.hxx" //add for SwFootNoteOptionDlg -#include "docstdlg.hxx" //add for SwDocStatPage -#include "DropDownFieldDialog.hxx" //add for DropDownFieldDialog -#include "envlop.hxx" //add for SwEnvDlg -#include "label.hxx" //add for SwLabDlg -#include "drpcps.hxx" //add for SwDropCapsDlg -#include "swuipardlg.hxx" //add for SwParaDlg -#include "pattern.hxx" //add for SwBackgroundDlg -#include "rowht.hxx" //add for SwTableHeightDlg -#include "selglos.hxx" //add for SwSelGlossaryDlg -#include "splittbl.hxx" //add for SwSplitTblDlg -#include "srtdlg.hxx" //add for SwSortDlg -#include "tautofmt.hxx" //add for SwAutoFormatDlg -#include "tblnumfm.hxx" //add for SwNumFmtDlg -#include "uiborder.hxx" //add for SwBorderDlg -#include "wrap.hxx" //add for SwWrapDlg -#include "colwd.hxx" //add for SwTableWidthDlg -#include "tabledlg.hxx" //add for SwTableTabDlg -#include "fldtdlg.hxx" //add for SwFldDlg -#include "fldedt.hxx" //add for SwFldEditDlg -#include "swrenamexnameddlg.hxx" //add for SwRenameXNamedDlg -#include "swmodalredlineacceptdlg.hxx" //add for SwModalRedlineAcceptDlg -#include <frmdlg.hxx> //add for SwFrmDlg -#include <tmpdlg.hxx> //add for SwTemplateDlg -#include <glossary.hxx> //add for SwGlossaryDlg -#include <inpdlg.hxx> //add for SwFldInputDlg -#include <insfnote.hxx> //add for SwInsFootNoteDlg -#include <insrule.hxx> //add for SwInsertGrfRulerDlg -#include <instable.hxx> //add for SwInsTableDlg -#include <javaedit.hxx> //add for SwJavaEditDialog -#include <linenum.hxx> //add for SwLineNumberingDlg -#include <titlepage.hxx> //add for SwTitlePageDlg -#include <mailmrge.hxx> //add for SwMailMergeDlg, SwMailMergeCreateFromDlg, SwMailMergeFieldConnectionsDlg -#include <mergetbl.hxx> //add for SwMergeTblDlg -#include <multmrk.hxx> //add for SwMultiTOXMarkDlg -#include <num.hxx> //add for SwSvxNumBulletTabDialog -#include <outline.hxx> //add for SwOutlineTabDialog -#include <column.hxx> //add for SwColumnDlg -#include <cnttab.hxx> //add for SwMultiTOXTabDialog -#include <swuicnttab.hxx> //add for SwMultiTOXTabDialog -#include <regionsw.hxx> //add for SwEditRegionDlg, SwInsertSectionTabDialog -#include <optcomp.hxx> //add for SwCompatibilityOptPage -#include <optload.hxx> //add for SwLoadOptPage -#include <optpage.hxx> //add for OptPage -#include <swuiidxmrk.hxx> //add for SwIndexMarkDlg, SwAuthMarkDlg, SwIndexMarkModalDlg, SwAuthMarkModalDlg -#include <svx/dialogs.hrc> -#include <mailmergewizard.hxx> -#include <mailconfigpage.hxx> - -using namespace ::com::sun::star; - -IMPL_ABSTDLG_BASE(AbstractSwWordCountDialog_Impl); -IMPL_ABSTDLG_BASE(AbstractSwInsertAbstractDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractSfxDialog_Impl); -IMPL_ABSTDLG_BASE(AbstractSwAsciiFilterDlg_Impl); -IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl); -IMPL_ABSTDLG_BASE(AbstractSplitTableDialog_Impl); -IMPL_ABSTDLG_BASE(AbstractSwBreakDlg_Impl); //add for SwBreakDlg -IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); //add for SwCharDlg, SwFootNoteOptionDlg, SwEnvDlg SwParaDlg SwTableTabDlg -IMPL_ABSTDLG_BASE(AbstractSwConvertTableDlg_Impl); //add for SwConvertTableDlg -IMPL_ABSTDLG_BASE(AbstractSwInsertDBColAutoPilot_Impl); //add for SwInsertDBColAutoPilot -IMPL_ABSTDLG_BASE(AbstractDropDownFieldDialog_Impl); //add for DropDownFieldDialog -IMPL_ABSTDLG_BASE(AbstractSwLabDlg_Impl);//add for SwLabDlg -IMPL_ABSTDLG_BASE(AbstractSwSelGlossaryDlg_Impl);//add for SwSelGlossaryDlg -IMPL_ABSTDLG_BASE(AbstractSwAutoFormatDlg_Impl); //add for SwAutoFormatDlg -IMPL_ABSTDLG_BASE(AbstractSwFldDlg_Impl); //add for SwFldDlg -IMPL_ABSTDLG_BASE(AbstractSwRenameXNamedDlg_Impl); //add for SwRenameXNamedDlg -IMPL_ABSTDLG_BASE(AbstractSwModalRedlineAcceptDlg_Impl); //add for SwModalRedlineAcceptDlg -IMPL_ABSTDLG_BASE(AbstractGlossaryDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractFldInputDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractInsFootNoteDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractInsertGrfRulerDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractInsTableDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractJavaEditDialog_Impl); -IMPL_ABSTDLG_BASE(AbstractMailMergeDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractMailMergeCreateFromDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractMultiTOXTabDialog_Impl); -IMPL_ABSTDLG_BASE(AbstractEditRegionDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractInsertSectionTabDialog_Impl); -IMPL_ABSTDLG_BASE(AbstractIndexMarkFloatDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractAuthMarkFloatDlg_Impl); - -void AbstractTabDialog_Impl::SetCurPageId( sal_uInt16 nId ) -{ - pDlg->SetCurPageId( nId ); -} - -const SfxItemSet* AbstractTabDialog_Impl::GetOutputItemSet() const -{ - return pDlg->GetOutputItemSet(); -} - -const sal_uInt16* AbstractTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem ) -{ - return pDlg->GetInputRanges( pItem ); -} - -void AbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) -{ - pDlg->SetInputSet( pInSet ); -} - -//From class Window. -void AbstractTabDialog_Impl::SetText( const XubString& rStr ) -{ - pDlg->SetText( rStr ); -} - -String AbstractTabDialog_Impl::GetText() const -{ - return pDlg->GetText(); -} - -void AbstractSwWordCountDialog_Impl::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) -{ - pDlg->SetValues(rCurrent, rDoc); -} - -sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetLevel() const -{ - return pDlg->GetLevel(); -} -sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetPara() const -{ - return pDlg->GetPara(); -} - -//add for SwAddrDlg, SwDropCapsDlg ,SwBackgroundDlg, SwNumFmtDlg SwBorderDlg SwWrapDlg SwFldEditDlg begin -const SfxItemSet* AbstractSfxDialog_Impl::GetOutputItemSet() const -{ - return pDlg->GetOutputItemSet(); -} - -void AbstractSfxDialog_Impl::SetText( const XubString& rStr ) -{ - pDlg->SetText( rStr ); -} - -String AbstractSfxDialog_Impl::GetText() const -{ - return pDlg->GetText(); -} - -void AbstractSwAsciiFilterDlg_Impl::FillOptions( SwAsciiOptions& rOptions ) -{ - pDlg->FillOptions(rOptions); -} - -sal_uInt16 AbstractSplitTableDialog_Impl::GetSplitMode() -{ - return pDlg->GetSplitMode(); -} - -String AbstractSwBreakDlg_Impl::GetTemplateName() -{ - return pDlg->GetTemplateName(); -} - -sal_uInt16 AbstractSwBreakDlg_Impl:: GetKind() -{ - return pDlg->GetKind(); -} - -sal_uInt16 AbstractSwBreakDlg_Impl:: GetPageNumber() -{ - return pDlg->GetPageNumber(); -} - -void AbstractSwConvertTableDlg_Impl::GetValues( sal_Unicode& rDelim,SwInsertTableOptions& rInsTblFlags, - SwTableAutoFmt *& prTAFmt ) -{ - pDlg->GetValues(rDelim,rInsTblFlags, prTAFmt); -} - -void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::Any >& rSelection, - uno::Reference< sdbc::XDataSource> rxSource, - uno::Reference< sdbc::XConnection> xConnection, - uno::Reference< sdbc::XResultSet > xResultSet) -{ - pDlg->DataToDoc(rSelection, rxSource, xConnection, xResultSet); -} - -ByteString AbstractDropDownFieldDialog_Impl::GetWindowState( sal_uLong nMask ) const -{ - return pDlg->GetWindowState(nMask); -} - -void AbstractDropDownFieldDialog_Impl::SetWindowState( const ByteString& rStr ) -{ - pDlg->SetWindowState(rStr); -} - -void AbstractSwLabDlg_Impl::SetCurPageId( sal_uInt16 nId ) -{ - pDlg->SetCurPageId( nId ); -} - -const SfxItemSet* AbstractSwLabDlg_Impl::GetOutputItemSet() const -{ - return pDlg->GetOutputItemSet(); -} - -const sal_uInt16* AbstractSwLabDlg_Impl::GetInputRanges(const SfxItemPool& pItem ) -{ - return pDlg->GetInputRanges( pItem ); -} - -void AbstractSwLabDlg_Impl::SetInputSet( const SfxItemSet* pInSet ) -{ - pDlg->SetInputSet( pInSet ); -} - -void AbstractSwLabDlg_Impl::SetText( const XubString& rStr ) -{ - pDlg->SetText( rStr ); -} - -String AbstractSwLabDlg_Impl::GetText() const -{ - return pDlg->GetText(); -} - -const String& AbstractSwLabDlg_Impl::GetBusinessCardStr() const -{ - return pDlg->GetBusinessCardStr(); -} - -Printer * AbstractSwLabDlg_Impl::GetPrt() -{ - return pDlg->GetPrt(); -} - -void AbstractSwSelGlossaryDlg_Impl::InsertGlos(const String &rRegion, const String &rGlosName) -{ - pDlg->InsertGlos( rRegion, rGlosName ); -} - -sal_uInt16 AbstractSwSelGlossaryDlg_Impl::GetSelectedIdx() const -{ - return pDlg->GetSelectedIdx(); -} - -void AbstractSwSelGlossaryDlg_Impl::SelectEntryPos(sal_uInt16 nIdx) -{ - pDlg->SelectEntryPos( nIdx ); -} - -void AbstractSwAutoFormatDlg_Impl::FillAutoFmtOfIndex( SwTableAutoFmt*& rToFill ) const -{ - pDlg->FillAutoFmtOfIndex(rToFill); -} - -void AbstractSwFldDlg_Impl::SetCurPageId( sal_uInt16 nId ) -{ - pDlg->SetCurPageId( nId ); -} - -const SfxItemSet* AbstractSwFldDlg_Impl::GetOutputItemSet() const -{ - return pDlg->GetOutputItemSet(); -} - -const sal_uInt16* AbstractSwFldDlg_Impl::GetInputRanges(const SfxItemPool& pItem ) -{ - return pDlg->GetInputRanges( pItem ); -} - -void AbstractSwFldDlg_Impl::SetInputSet( const SfxItemSet* pInSet ) -{ - pDlg->SetInputSet( pInSet ); -} - -void AbstractSwFldDlg_Impl::SetText( const XubString& rStr ) -{ - pDlg->SetText( rStr ); -} - -String AbstractSwFldDlg_Impl::GetText() const -{ - return pDlg->GetText(); -} - -void AbstractSwFldDlg_Impl::Start( sal_Bool bShowl ) -{ - pDlg->Start( bShowl ); -} - -void AbstractSwFldDlg_Impl::Initialize(SfxChildWinInfo *pInfo) -{ - pDlg->Initialize( pInfo ); -} - -void AbstractSwFldDlg_Impl::ReInitDlg() -{ - pDlg->ReInitDlg(); -} - -void AbstractSwFldDlg_Impl::ActivateDatabasePage() -{ - pDlg->ActivateDatabasePage(); -} - -Window* AbstractSwFldDlg_Impl::GetWindow() -{ - return (Window*)pDlg; -} -void AbstractSwFldDlg_Impl::ShowPage( sal_uInt16 nId ) -{ - pDlg->ShowPage(nId); -} - -void AbstractSwRenameXNamedDlg_Impl::SetForbiddenChars( const String& rSet ) -{ - pDlg->SetForbiddenChars( rSet ); -} - -void AbstractSwRenameXNamedDlg_Impl::SetAlternativeAccess( - STAR_REFERENCE( container::XNameAccess ) & xSecond, - STAR_REFERENCE( container::XNameAccess ) & xThird ) -{ - pDlg->SetAlternativeAccess( xSecond, xThird); -} - -void AbstractSwModalRedlineAcceptDlg_Impl::AcceptAll( sal_Bool bAccept ) -{ - pDlg->AcceptAll( bAccept); -} - -String AbstractGlossaryDlg_Impl::GetCurrGrpName() const -{ - return pDlg->GetCurrGrpName(); -} - -String AbstractGlossaryDlg_Impl::GetCurrShortName() const -{ - return pDlg->GetCurrShortName(); -} - -void AbstractFldInputDlg_Impl::SetWindowState( const ByteString& rStr ) -{ - pDlg->SetWindowState( rStr ); -} - -ByteString AbstractFldInputDlg_Impl::GetWindowState( sal_uLong nMask ) const -{ - return pDlg->GetWindowState( nMask ); -} - -String AbstractInsFootNoteDlg_Impl::GetFontName() -{ - return pDlg->GetFontName(); -} -sal_Bool AbstractInsFootNoteDlg_Impl::IsEndNote() -{ - return pDlg->IsEndNote(); -} - -String AbstractInsFootNoteDlg_Impl::GetStr() -{ - return pDlg->GetStr(); -} -void AbstractInsFootNoteDlg_Impl::SetHelpId( const rtl::OString& sHelpId ) -{ - pDlg->SetHelpId( sHelpId ); -} - -void AbstractInsFootNoteDlg_Impl::SetText( const XubString& rStr ) -{ - pDlg->SetText( rStr ); -} - -String AbstractInsertGrfRulerDlg_Impl::GetGraphicName() -{ - return pDlg->GetGraphicName(); -} -sal_Bool AbstractInsertGrfRulerDlg_Impl::IsSimpleLine() -{ - return pDlg->IsSimpleLine(); -} -sal_Bool AbstractInsertGrfRulerDlg_Impl::HasImages() const -{ - return pDlg->HasImages(); -} - -void AbstractInsTableDlg_Impl::GetValues( String& rName, sal_uInt16& rRow, sal_uInt16& rCol, - SwInsertTableOptions& rInsTblFlags, String& rTableAutoFmtName, - SwTableAutoFmt *& prTAFmt ) -{ - pDlg->GetValues( rName, rRow, rCol, rInsTblFlags, rTableAutoFmtName, prTAFmt); -} - -String AbstractJavaEditDialog_Impl::GetText() -{ - return pDlg->GetText(); -} - -String AbstractJavaEditDialog_Impl::GetType() -{ - return pDlg->GetType(); -} -sal_Bool AbstractJavaEditDialog_Impl::IsUrl() -{ - return pDlg->IsUrl(); -} -sal_Bool AbstractJavaEditDialog_Impl::IsNew() -{ - return pDlg->IsNew(); -} -sal_Bool AbstractJavaEditDialog_Impl::IsUpdate() -{ - return pDlg->IsUpdate(); -} - -sal_uInt16 AbstractMailMergeDlg_Impl::GetMergeType() -{ - return pDlg->GetMergeType(); -} - -const ::rtl::OUString& AbstractMailMergeDlg_Impl::GetSaveFilter() const -{ - return pDlg->GetSaveFilter(); -} - -const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > AbstractMailMergeDlg_Impl::GetSelection() const -{ - return pDlg->GetSelection(); -} - -uno::Reference< sdbc::XResultSet> AbstractMailMergeDlg_Impl::GetResultSet() const -{ - return pDlg->GetResultSet(); -} -bool AbstractMailMergeDlg_Impl::IsSaveIndividualDocs() const -{ - return pDlg->IsSaveIndividualDocs(); -} -bool AbstractMailMergeDlg_Impl::IsGenerateFromDataBase() const -{ - return pDlg->IsGenerateFromDataBase(); -} -String AbstractMailMergeDlg_Impl::GetColumnName() const -{ - return pDlg->GetColumnName(); -} -String AbstractMailMergeDlg_Impl::GetPath() const -{ - return pDlg->GetPath(); -} - -sal_Bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const -{ - return pDlg->IsThisDocument(); -} - -sal_Bool AbstractMailMergeFieldConnectionsDlg_Impl::IsUseExistingConnections() const -{ - return pDlg->IsUseExistingConnections(); -} - -SwForm* AbstractMultiTOXTabDialog_Impl::GetForm(CurTOXType eType) -{ - return pDlg->GetForm(eType); -} - -CurTOXType AbstractMultiTOXTabDialog_Impl::GetCurrentTOXType() const -{ - return pDlg->GetCurrentTOXType(); -} - -SwTOXDescription& AbstractMultiTOXTabDialog_Impl::GetTOXDescription(CurTOXType eTOXTypes) -{ - return pDlg->GetTOXDescription(eTOXTypes); -} - -const SfxItemSet* AbstractMultiTOXTabDialog_Impl::GetOutputItemSet() const -{ - return pDlg->GetOutputItemSet(); -} - -void AbstractEditRegionDlg_Impl::SelectSection(const String& rSectionName) -{ - pDlg->SelectSection(rSectionName); -} - -void -AbstractInsertSectionTabDialog_Impl::SetSectionData(SwSectionData const& rSect) -{ - pDlg->SetSectionData(rSect); -} - -void AbstractIndexMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell) -{ - pDlg->ReInitDlg( rWrtShell); -} - -Window* AbstractIndexMarkFloatDlg_Impl::GetWindow() -{ - return (Window*)pDlg; -} - -void AbstractAuthMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell) -{ - pDlg->ReInitDlg( rWrtShell); -} - -Window* AbstractAuthMarkFloatDlg_Impl::GetWindow() -{ - return (Window*)pDlg; -} - -AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl() -{ - delete pDlg; -} - -void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link& rEndDialogHdl ) -{ - aEndDlgHdl = rEndDialogHdl; - pDlg->StartExecuteModal( - LINK( this, AbstractMailMergeWizard_Impl, EndDialogHdl ) ); -} - -long AbstractMailMergeWizard_Impl::GetResult() -{ - return pDlg->GetResult(); -} - -#if OSL_DEBUG_LEVEL > 1 -IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, pDialog ) -#else -IMPL_LINK( AbstractMailMergeWizard_Impl, EndDialogHdl, SwMailMergeWizard*, EMPTYARG ) -#endif -{ -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( pDialog == pDlg, "wrong dialog passed to EndDialogHdl!" ); -#endif - - aEndDlgHdl.Call( this ); - aEndDlgHdl = Link(); - - return 0L; -} - -void AbstractMailMergeWizard_Impl::SetReloadDocument(const String& rURL) -{ - pDlg->SetReloadDocument(rURL); -} - -const String& AbstractMailMergeWizard_Impl::GetReloadDocument() const -{ - return pDlg->GetReloadDocument(); -} -sal_Bool AbstractMailMergeWizard_Impl::ShowPage( sal_uInt16 nLevel ) -{ - return pDlg->skipUntil(nLevel); -} - -sal_uInt16 AbstractMailMergeWizard_Impl::GetRestartPage() const -{ - return pDlg->GetRestartPage(); -} - -AbstractSwWordCountDialog* SwAbstractDialogFactory_Impl::CreateSwWordCountDialog(Window* pParent) -{ - SwWordCountDialog* pDlg = new SwWordCountDialog( pParent ); - return new AbstractSwWordCountDialog_Impl( pDlg ); -} - -AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstractDlg( Window* pParent, - int nResId ) -{ - SwInsertAbstractDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSERT_ABSTRACT : - pDlg = new SwInsertAbstractDlg( pParent); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSwInsertAbstractDlg_Impl( pDlg ); - return 0; -} - -SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSfxDialog( Window* pParent, - const SfxItemSet& rSet, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >&, - sal_uInt32 nResId - ) -{ - SfxModalDialog* pDlg=NULL; - switch ( nResId ) - { - case RC_DLG_ADDR : - pDlg = new SwAddrDlg( pParent, rSet ); - break; - case DLG_SWDROPCAPS : - pDlg = new SwDropCapsDlg( pParent, rSet ); - break; - case RC_SWDLG_BACKGROUND : - pDlg = new SwBackgroundDlg( pParent, rSet ); - break; - case RC_DLG_SWNUMFMTDLG : - pDlg = new SwNumFmtDlg( pParent, rSet ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSfxDialog_Impl( pDlg ); - return 0; -} - -AbstractSwAsciiFilterDlg* SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg( Window* pParent, - SwDocShell& rDocSh, - SvStream* pStream, - int nResId ) -{ - SwAsciiFilterDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_ASCII_FILTER : - pDlg = new SwAsciiFilterDlg( pParent, rDocSh, pStream ); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractSwAsciiFilterDlg_Impl( pDlg ); - return 0; -} - -VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( Window *pParent, - SwWrtShell &rSh, - SfxRequest& rReq, - int nResId ) -{ - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSERT_BOOKMARK : - pDlg = new SwInsertBookmarkDlg( pParent, rSh, rReq ); - break; - - default: - break; - } - - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - -AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg ( Window *pParent, - SwWrtShell &rSh, - int nResId ) -{ - SwBreakDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_BREAK : - pDlg = new SwBreakDlg( pParent, rSh ); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractSwBreakDlg_Impl( pDlg ); - return 0; -} - -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg( SwView& rVw, int nResId ) -{ - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_CHANGE_DB : - pDlg = new SwChangeDBDlg( rVw ); - break; - - default: - break; - } - - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - - -SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwCharDlg(Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg - const String* pFmtStr , sal_Bool bIsDrwTxtDlg ) -{ - - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_CHAR : - pDlg = new SwCharDlg( pParent, pVw, rCoreSet, pFmtStr, bIsDrwTxtDlg ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); - return 0; - -} - -AbstractSwConvertTableDlg* SwAbstractDialogFactory_Impl::CreateSwConvertTableDlg ( - SwView& rView,int nResId, bool bToTable ) -{ - SwConvertTableDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_CONV_TEXT_TABLE : - pDlg = new SwConvertTableDlg( rView, bToTable ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSwConvertTableDlg_Impl( pDlg ); - return 0; -} - -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwCaptionDialog ( Window *pParent, SwView &rV,int nResId) -{ - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_CAPTION : - pDlg = new SwCaptionDialog( pParent, rV ); - break; - - default: - break; - } - - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - -AbstractSwInsertDBColAutoPilot* SwAbstractDialogFactory_Impl::CreateSwInsertDBColAutoPilot( SwView& rView, // add for SwInsertDBColAutoPilot - uno::Reference< sdbc::XDataSource> rxSource, - uno::Reference<sdbcx::XColumnsSupplier> xColSupp, - const SwDBData& rData, int nResId) -{ - SwInsertDBColAutoPilot* pDlg=NULL; - switch ( nResId ) - { - case DLG_AP_INSERT_DB_SEL : - pDlg = new SwInsertDBColAutoPilot( rView, rxSource, xColSupp, rData ); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractSwInsertDBColAutoPilot_Impl( pDlg ); - return 0; -} - -SfxAbstractTabDialog * SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg( Window *pParent, SwWrtShell &rSh,int nResId) -{ - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_DOC_FOOTNOTE : - pDlg = new SwFootNoteOptionDlg( pParent, rSh ); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); - return 0; -} - -AbstractDropDownFieldDialog * SwAbstractDialogFactory_Impl::CreateDropDownFieldDialog ( Window *pParent, SwWrtShell &rSh, //add for DropDownFieldDialog - SwField* pField,int nResId, sal_Bool bNextButton ) -{ - sw::DropDownFieldDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_FLD_DROPDOWN : - pDlg = new sw::DropDownFieldDialog( pParent, rSh, pField, bNextButton ); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractDropDownFieldDialog_Impl( pDlg ); - return 0; -} - -SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwEnvDlg ( Window* pParent, const SfxItemSet& rSet, - SwWrtShell* pWrtSh, Printer* pPrt, - sal_Bool bInsert,int nResId ) //add for SwEnvDlg -{ - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_ENV : - pDlg = new SwEnvDlg( pParent, rSet, pWrtSh,pPrt, bInsert ); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); - return 0; -} - -AbstractSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg - SwNewDBMgr* pNewDBMgr, sal_Bool bLabel,int nResId ) -{ - SwLabDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_LAB : - pDlg = new SwLabDlg( pParent, rSet, pNewDBMgr,bLabel ); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractSwLabDlg_Impl( pDlg ); - return 0; -} - -SwLabDlgMethod SwAbstractDialogFactory_Impl::GetSwLabDlgStaticMethod () -{ - return SwLabDlg::UpdateFieldInformation; -} - - -SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( Window *pParent, SwView& rVw, - const SfxItemSet& rCoreSet , - sal_uInt8 nDialogMode, - int nResId, - const String *pCollName, - sal_Bool bDraw , sal_uInt16 nDefPage) -{ - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_DRAWPARA : - case DLG_PARA : - pDlg = new SwParaDlg( pParent, rVw, rCoreSet,nDialogMode, pCollName, bDraw, nDefPage ); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); - return 0; -} - -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( Window *pParent, SwWrtShell &rSh, int nResId ) -{ - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_ROW_HEIGHT : - pDlg = new SwTableHeightDlg( pParent, rSh); - break; - - case DLG_SORTING : - pDlg = new SwSortDlg( pParent, rSh); - break; - case DLG_COLUMN : - pDlg = new SwColumnDlg( pParent, rSh ); - break; - case DLG_EDIT_AUTHMARK : - pDlg = new SwAuthMarkModalDlg( pParent, rSh ); - break; - default: - break; - } - - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - -AbstractSplitTableDialog * SwAbstractDialogFactory_Impl::CreateSplitTblDialog ( Window *pParent, SwWrtShell &rSh ) -{ - return new AbstractSplitTableDialog_Impl( new SwSplitTblDlg( pParent, rSh) ); -} - -AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ) -{ - SwSelGlossaryDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_SEL_GLOS : - pDlg = new SwSelGlossaryDlg( pParent, rShortName); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractSwSelGlossaryDlg_Impl( pDlg ); - return 0; -} - -AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell, - int nResId, - sal_Bool bSetAutoFmt, - const SwTableAutoFmt* pSelFmt ) -{ - SwAutoFormatDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_AUTOFMT_TABLE : - pDlg = new SwAutoFormatDlg( pParent, pShell,bSetAutoFmt,pSelFmt); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractSwAutoFormatDlg_Impl( pDlg ); - return 0; -} - -SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType,int nResId ) -{ - SfxModalDialog* pDlg=NULL; - switch ( nResId ) - { - case RC_DLG_SWBORDERDLG : - pDlg = new SwBorderDlg( pParent, rSet, nType ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSfxDialog_Impl( pDlg ); - return 0; -} - -SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId ) -{ - SfxModalDialog* pDlg=NULL; - switch ( nResId ) - { - case RC_DLG_SWWRAPDLG : - pDlg = new SwWrapDlg( pParent, rSet, pSh, bDrawMode ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSfxDialog_Impl( pDlg ); - return 0; -} - -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg ( Window *pParent, SwTableFUNC &rFnc , int nResId ) -{ - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_COL_WIDTH : - pDlg = new SwTableWidthDlg( pParent, rFnc); - break; - - default: - break; - } - - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - -SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTableTabDlg( Window* pParent, SfxItemPool& Pool, - const SfxItemSet* pItemSet, SwWrtShell* pSh,int nResId ) -{ - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_FORMAT_TABLE : - pDlg = new SwTableTabDlg( pParent, Pool, pItemSet,pSh ); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); - return 0; -} - -AbstractSwFldDlg * SwAbstractDialogFactory_Impl::CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId ) -{ - SwFldDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_FLD_INSERT : - pDlg = new SwFldDlg( pB, pCW,pParent); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractSwFldDlg_Impl( pDlg ); - return 0; -} - -SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwFldEditDlg ( SwView& rVw, int nResId ) -{ - SfxModalDialog* pDlg=NULL; - switch ( nResId ) - { - case RC_DLG_SWFLDEDITDLG : - pDlg = new SwFldEditDlg( rVw ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSfxDialog_Impl( pDlg ); - return 0; -} - -AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDlg( Window* pParent, - STAR_REFERENCE( container::XNamed ) & xNamed, - STAR_REFERENCE( container::XNameAccess ) & xNameAccess,int nResId ) -{ - SwRenameXNamedDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_RENAME_XNAMED : - pDlg = new SwRenameXNamedDlg( pParent,xNamed, xNameAccess); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSwRenameXNamedDlg_Impl( pDlg ); - return 0; -} - -AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRedlineAcceptDlg ( Window *pParent, int nResId ) -{ - SwModalRedlineAcceptDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_MOD_REDLINE_ACCEPT : - pDlg = new SwModalRedlineAcceptDlg( pParent ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg ); - return 0; -} - -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwVclDialog( int nResId, - Window* pParent, sal_Bool& rWithPrev ) //add for SwMergeTblDlg -{ - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_MERGE_TABLE : - pDlg = new SwMergeTblDlg( pParent, rWithPrev ); - break; - default: - break; - } - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - -SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog( int nResId, - SfxViewFrame *pFrame, Window *pParent, - const SfxItemSet& rCoreSet, - sal_Bool bNewFrm, - sal_uInt16 nResType, - sal_Bool bFmt, - sal_uInt16 nDefPage, - const String* pFmtStr ) //add for SwFrmDlg -{ - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_FRM_GRF : - case DLG_FRM_OLE : - case DLG_FRM_STD : - pDlg = new SwFrmDlg( pFrame, pParent, rCoreSet, bNewFrm, nResType, bFmt, nDefPage, pFmtStr ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); - return 0; -} - -SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog( int nResId, - Window* pParent, - SfxStyleSheetBase& rBase, - sal_uInt16 nRegion, - sal_Bool bColumn, - SwWrtShell* pActShell, - sal_Bool bNew ) //add for SwTemplateDlg -{ - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_TEMPLATE_BASE : - pDlg = new SwTemplateDlg( pParent, rBase, nRegion, bColumn, pActShell, bNew ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); - return 0; -} - -AbstractGlossaryDlg* SwAbstractDialogFactory_Impl::CreateGlossaryDlg( int nResId, - SfxViewFrame* pViewFrame, - SwGlossaryHdl* pGlosHdl, - SwWrtShell *pWrtShell) //add for SwGlossaryDlg -{ - SwGlossaryDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_RENAME_GLOS : - pDlg = new SwGlossaryDlg( pViewFrame, pGlosHdl, pWrtShell ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractGlossaryDlg_Impl( pDlg ); - return 0; -} - -AbstractFldInputDlg* SwAbstractDialogFactory_Impl::CreateFldInputDlg( int nResId, - Window *pParent, SwWrtShell &rSh, - SwField* pField, sal_Bool bNextButton ) //add for SwFldInputDlg -{ - SwFldInputDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_FLD_INPUT : - pDlg = new SwFldInputDlg( pParent, rSh, pField, bNextButton ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractFldInputDlg_Impl( pDlg ); - return 0; -} - -AbstractInsFootNoteDlg* SwAbstractDialogFactory_Impl::CreateInsFootNoteDlg( int nResId, - Window * pParent, SwWrtShell &rSh, sal_Bool bEd ) //add for SwInsFootNoteDlg -{ - SwInsFootNoteDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INS_FOOTNOTE : - pDlg = new SwInsFootNoteDlg( pParent, rSh, bEd ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractInsFootNoteDlg_Impl( pDlg ); - return 0; -} - -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTitlePageDlg ( Window *pParent ) -{ - Dialog* pDlg = new SwTitlePageDlg( pParent ); - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog( int nResId, - SwView& rView, sal_Bool /*bCol*/ ) //add for SwInsRowColDlg, SwLineNumberingDlg -{ - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_LINE_NUMBERING : - pDlg = new SwLineNumberingDlg( &rView ); - break; - default: - break; - } - - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - -AbstractInsertGrfRulerDlg * SwAbstractDialogFactory_Impl::CreateInsertGrfRulerDlg( int nResId, - Window * pParent ) //add for SwInsertGrfRulerDlg -{ - SwInsertGrfRulerDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSERT_RULER : - pDlg = new SwInsertGrfRulerDlg( pParent ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractInsertGrfRulerDlg_Impl( pDlg ); - return 0; -} - -AbstractInsTableDlg * SwAbstractDialogFactory_Impl::CreateInsTableDlg( int nResId, - SwView& rView ) //add for SwInsTableDlg -{ - SwInsTableDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSERT_TABLE : - pDlg = new SwInsTableDlg( rView ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractInsTableDlg_Impl( pDlg ); - return 0; -} - -AbstractJavaEditDialog * SwAbstractDialogFactory_Impl::CreateJavaEditDialog( int nResId, - Window* pParent, SwWrtShell* pWrtSh ) //add for SwJavaEditDialog -{ - SwJavaEditDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_JAVAEDIT : - pDlg = new SwJavaEditDialog( pParent, pWrtSh ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractJavaEditDialog_Impl( pDlg ); - return 0; -} - -AbstractMailMergeDlg * SwAbstractDialogFactory_Impl::CreateMailMergeDlg( int nResId, - Window* pParent, SwWrtShell& rSh, - const String& rSourceName, - const String& rTblName, - sal_Int32 nCommandType, - const uno::Reference< sdbc::XConnection>& xConnection, - uno::Sequence< uno::Any >* pSelection ) //add for SwMailMergeDlg -{ - SwMailMergeDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_MAILMERGE : - pDlg = new SwMailMergeDlg( pParent, rSh, rSourceName, rTblName, nCommandType, xConnection, pSelection ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractMailMergeDlg_Impl( pDlg ); - return 0; -} - -AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCreateFromDlg( int nResId, - Window* pParent ) //add for SwMailMergeCreateFromDlg -{ - SwMailMergeCreateFromDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_MERGE_CREATE : - pDlg = new SwMailMergeCreateFromDlg( pParent ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractMailMergeCreateFromDlg_Impl( pDlg ); - return 0; -} - -AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg( int nResId, - Window* pParent ) //add for SwMailMergeFieldConnectionsDlg -{ - SwMailMergeFieldConnectionsDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_MERGE_FIELD_CONNECTIONS : - pDlg = new SwMailMergeFieldConnectionsDlg( pParent ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg ); - return 0; -} - -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg( int nResId, - Window* pParent, SwTOXMgr &rTOXMgr ) //add for SwMultiTOXMarkDlg -{ - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_MULTMRK : - pDlg = new SwMultiTOXMarkDlg( pParent, rTOXMgr ); - break; - default: - break; - } - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - -SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResId, - Window* pParent, - const SfxItemSet* pSwItemSet, - SwWrtShell & rWrtSh ) //add for SwSvxNumBulletTabDialog, SwOutlineTabDialog -{ - SfxTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_SVXTEST_NUM_BULLET : - pDlg = new SwSvxNumBulletTabDialog( pParent, pSwItemSet, rWrtSh ); - break; - case DLG_TAB_OUTLINE : - pDlg = new SwOutlineTabDialog( pParent, pSwItemSet, rWrtSh ); - break; - - default: - break; - } - if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); - return 0; -} - -AbstractMultiTOXTabDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialog( int nResId, - Window* pParent, const SfxItemSet& rSet, - SwWrtShell &rShell, - SwTOXBase* pCurTOX, sal_uInt16 nToxType, - sal_Bool bGlobal ) //add for SwMultiTOXTabDialog -{ - SwMultiTOXTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_MULTI_TOX : - pDlg = new SwMultiTOXTabDialog( pParent, rSet, rShell, pCurTOX, nToxType, bGlobal ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractMultiTOXTabDialog_Impl( pDlg ); - return 0; -} - -AbstractEditRegionDlg * SwAbstractDialogFactory_Impl::CreateEditRegionDlg( int nResId, - Window* pParent, SwWrtShell& rWrtSh ) //add for SwEditRegionDlg -{ - SwEditRegionDlg* pDlg=NULL; - switch ( nResId ) - { - case MD_EDIT_REGION : - pDlg = new SwEditRegionDlg( pParent, rWrtSh ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractEditRegionDlg_Impl( pDlg ); - return 0; -} - -AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog( int nResId, - Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) //add for SwInsertSectionTabDialog -{ - SwInsertSectionTabDialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSERT_SECTION : - pDlg = new SwInsertSectionTabDialog( pParent, rSet, rSh ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractInsertSectionTabDialog_Impl( pDlg ); - return 0; -} - -AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg( int nResId, - SfxBindings* pBindings, - SfxChildWindow* pChild, - Window *pParent, - SfxChildWinInfo* pInfo, - sal_Bool bNew ) //add for SwIndexMarkFloatDlg -{ - SwIndexMarkFloatDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSIDXMARK_CJK : - case DLG_INSIDXMARK : - pDlg = new SwIndexMarkFloatDlg( pBindings, pChild, pParent, pInfo, bNew ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractIndexMarkFloatDlg_Impl( pDlg ); - return 0; -} - -AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg( int nResId, - SfxBindings* pBindings, - SfxChildWindow* pChild, - Window *pParent, - SfxChildWinInfo* pInfo, - sal_Bool bNew ) //add for SwAuthMarkFloatDlg -{ - SwAuthMarkFloatDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSAUTHMARK : - pDlg = new SwAuthMarkFloatDlg( pBindings, pChild, pParent, pInfo, bNew ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractAuthMarkFloatDlg_Impl( pDlg ); - return 0; -} - -//add for SwIndexMarkModalDlg begin -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg( int nResId, - Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ) //add for SwIndexMarkModalDlg -{ - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_EDIT_IDXMARK_CJK : - case DLG_EDIT_IDXMARK : - pDlg = new SwIndexMarkModalDlg( pParent, rSh, pCurTOXMark ); - break; - - default: - break; - } - - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; -} - -//add for SwIndexMarkModalDlg end -AbstractMailMergeWizard* SwAbstractDialogFactory_Impl::CreateMailMergeWizard( - SwView& rView, SwMailMergeConfigItem& rConfigItem) -{ - return new AbstractMailMergeWizard_Impl( new SwMailMergeWizard(rView, rConfigItem)); -} - -//add for static func in SwGlossaryDlg -GlossaryGetCurrGroup SwAbstractDialogFactory_Impl::GetGlossaryCurrGroupFunc( sal_uInt16 nId ) -{ - switch ( nId ) - { - case DLG_RENAME_GLOS : - return SwGlossaryDlg::GetCurrGroup; - default: - break; - } - return 0; -} -GlossarySetActGroup SwAbstractDialogFactory_Impl::SetGlossaryActGroupFunc( sal_uInt16 nId ) -{ - switch ( nId ) - { - case DLG_RENAME_GLOS : - return SwGlossaryDlg::SetActGroup; - default: - break; - } - return 0; -} - -//------------------ Factories for TabPages -CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nId ) -{ - CreateTabPage pRet = 0; - switch ( nId ) - { - case TP_OPTCOMPATIBILITY_PAGE : - case RID_SW_TP_OPTCOMPATIBILITY_PAGE : - pRet = SwCompatibilityOptPage::Create; - break; - case TP_OPTLOAD_PAGE : - case RID_SW_TP_OPTLOAD_PAGE : - pRet = SwLoadOptPage::Create; - break; - case TP_OPTCAPTION_PAGE: - case RID_SW_TP_OPTCAPTION_PAGE: - return SwCaptionOptPage::Create; - case TP_CONTENT_OPT : - case RID_SW_TP_CONTENT_OPT: - case RID_SW_TP_HTML_CONTENT_OPT: - pRet = SwContentOptPage::Create; - break; - case TP_OPTSHDWCRSR : - case RID_SW_TP_OPTSHDWCRSR: - case RID_SW_TP_HTML_OPTSHDWCRSR: - pRet = SwShdwCrsrOptionsTabPage::Create; - break; - case RID_SW_TP_REDLINE_OPT : - case TP_REDLINE_OPT : - pRet = SwRedlineOptionsTabPage::Create; - break; - case RID_SW_TP_OPTTEST_PAGE : - case TP_OPTTEST_PAGE : -#if OSL_DEBUG_LEVEL > 1 - pRet = SwTestTabPage::Create; -#endif - break; - case TP_OPTPRINT_PAGE : - case RID_SW_TP_HTML_OPTPRINT_PAGE: - case RID_SW_TP_OPTPRINT_PAGE: - pRet = SwAddPrinterTabPage::Create; - break; - case TP_STD_FONT : - case RID_SW_TP_STD_FONT: - case RID_SW_TP_STD_FONT_CJK: - case RID_SW_TP_STD_FONT_CTL: - pRet = SwStdFontTabPage::Create; - break; - case TP_OPTTABLE_PAGE : - case RID_SW_TP_HTML_OPTTABLE_PAGE: - case RID_SW_TP_OPTTABLE_PAGE: - pRet = SwTableOptionsTabPage::Create; - break; - case TP_DOC_STAT : - pRet = SwDocStatPage::Create; - break; - case RID_SW_TP_MAILCONFIG: - pRet = SwMailConfigPage::Create; - break; - } - - return pRet; -} - -GetTabPageRanges SwAbstractDialogFactory_Impl::GetTabPageRangesFunc( sal_uInt16 nId ) -{ - switch ( nId ) - { - case 1 : //RID_SVXPAGE_TEXTANIMATION : - //return SvxTextAnimationPage::GetRanges; - break; - default: - break; - } - - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx deleted file mode 100644 index e65452943d..0000000000 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ /dev/null @@ -1,591 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SW_DLGFACT_HXX -#define _SW_DLGFACT_HXX - -#include "swabstdlg.hxx" - -class SwSaveLabelDlg; -class SwInsertAbstractDlg; -class SfxSingleTabDialog; -class SwAsciiFilterDlg; -class Dialog; -class SwBreakDlg; -class SfxTabDialog; -class SwConvertTableDlg; -class SwInsertDBColAutoPilot; -class SwLabDlg; -class SwSelGlossaryDlg; -class SwAutoFormatDlg; -class SwFldDlg; -class SwRenameXNamedDlg; -class SwModalRedlineAcceptDlg; -class SwTOXMark; -class SwWordCountDialog; -class SwSplitTblDlg; - -#include "itabenum.hxx" - -namespace sw -{ -class DropDownFieldDialog; -} - -#define DECL_ABSTDLG_BASE(Class,DialogClass) \ - DialogClass* pDlg; \ -public: \ - Class( DialogClass* p) \ - : pDlg(p) \ - {} \ - virtual ~Class(); \ - virtual short Execute() ; -// virtual void Show( sal_Bool bVisible = sal_True, sal_uInt16 nFlags = 0 ) - -#define IMPL_ABSTDLG_BASE(Class) \ -Class::~Class() \ -{ \ - delete pDlg; \ -} \ -short Class::Execute() \ -{ \ - return pDlg->Execute(); \ -} - - -class AbstractSwWordCountDialog_Impl : public AbstractSwWordCountDialog -{ - DECL_ABSTDLG_BASE(AbstractSwWordCountDialog_Impl,SwWordCountDialog) - void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc); -}; - -//add for SwInsertAbstractDlg begin -class AbstractSwInsertAbstractDlg_Impl : public AbstractSwInsertAbstractDlg -{ - DECL_ABSTDLG_BASE(AbstractSwInsertAbstractDlg_Impl,SwInsertAbstractDlg) - virtual sal_uInt8 GetLevel() const ; - virtual sal_uInt8 GetPara() const ; -}; - -//add for SwInsertAbstractDlg end - -// add for SwAddrDlg, SwDropCapsDlg, SwBackgroundDlg SwNumFmtDlg SwWrapDlg SwBorderDlg, SwFldEditDlg begin -class SfxSingleTabDialog; -class AbstractSfxDialog_Impl :public SfxAbstractDialog -{ - DECL_ABSTDLG_BASE(AbstractSfxDialog_Impl,SfxModalDialog) - virtual const SfxItemSet* GetOutputItemSet() const; - virtual void SetText( const XubString& rStr ); - virtual String GetText() const; -}; -// add for SwAddrDlg,SwDropCapsDlg , SwBackgroundDlg SwNumFmtDlg SwWrapDlg SwBorderDlg, SwFldEditDlg end - -// add for SwAsciiFilterDlg begin -class AbstractSwAsciiFilterDlg_Impl : public AbstractSwAsciiFilterDlg -{ - DECL_ABSTDLG_BASE( AbstractSwAsciiFilterDlg_Impl,SwAsciiFilterDlg ) - virtual void FillOptions( SwAsciiOptions& rOptions ); - -}; -// add for SwAsciiFilterDlg end - -// add for SwInsertBookmarkDlg SwChangeDBDlg, SwTableHeightDlg, SwSplitTblDlg SwSortDlg SwTableWidthDlgbegin -class VclAbstractDialog_Impl : public VclAbstractDialog -{ - DECL_ABSTDLG_BASE(VclAbstractDialog_Impl,Dialog) -}; -// add for SwInsertBookmarkDlg SwChangeDBDlg, SwTableHeightDlg SwSplitTblDlg SwSortDlg SwTableWidthDlg end - -// add for SwBreakDlg begin -class AbstractSwBreakDlg_Impl : public AbstractSwBreakDlg // add for SwBreakDlg -{ - DECL_ABSTDLG_BASE(AbstractSwBreakDlg_Impl,SwBreakDlg) - virtual String GetTemplateName(); - virtual sal_uInt16 GetKind(); - virtual sal_uInt16 GetPageNumber(); - -}; -class AbstractSplitTableDialog_Impl : public AbstractSplitTableDialog // add for -{ - DECL_ABSTDLG_BASE(AbstractSplitTableDialog_Impl, SwSplitTblDlg) - virtual sal_uInt16 GetSplitMode(); -}; - -// add for SwBreakDlg end - -//add for SwCharDlg , SwEnvDlg , SwFootNoteOptionDlg SwParaDlg SwTableTabDlg begin -class AbstractTabDialog_Impl : public SfxAbstractTabDialog -{ - DECL_ABSTDLG_BASE( AbstractTabDialog_Impl,SfxTabDialog ) - virtual void SetCurPageId( sal_uInt16 nId ); - virtual const SfxItemSet* GetOutputItemSet() const; - virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); - virtual void SetInputSet( const SfxItemSet* pInSet ); - //From class Window. - virtual void SetText( const XubString& rStr ); - virtual String GetText() const; -}; -//add for SwCharDlg, SwEnvDlg ,SwFootNoteOptionDlg SwParaDlg SwTableTabDlg end - -//add for SwConvertTableDlg begin -class AbstractSwConvertTableDlg_Impl : public AbstractSwConvertTableDlg // add for SwConvertTableDlg -{ - DECL_ABSTDLG_BASE( AbstractSwConvertTableDlg_Impl,SwConvertTableDlg) - virtual void GetValues( sal_Unicode& rDelim,SwInsertTableOptions& rInsTblFlags, - SwTableAutoFmt *& prTAFmt ); -}; -//add for SwConvertTableDlg end - -//add for SwInsertDBColAutoPilot begin -class AbstractSwInsertDBColAutoPilot_Impl : public AbstractSwInsertDBColAutoPilot // add for SwInsertDBColAutoPilot -{ - DECL_ABSTDLG_BASE( AbstractSwInsertDBColAutoPilot_Impl,SwInsertDBColAutoPilot) - virtual void DataToDoc( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rSelection, - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> rxSource, - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> xConnection, - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > xResultSet); -}; -//add for SwInsertDBColAutoPilot end - -//add for DropDownFieldDialog begin -class AbstractDropDownFieldDialog_Impl : public AbstractDropDownFieldDialog //add for DropDownFieldDialog -{ - DECL_ABSTDLG_BASE(AbstractDropDownFieldDialog_Impl, sw::DropDownFieldDialog) - virtual ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const; //this method inherit from SystemWindow - virtual void SetWindowState( const ByteString& rStr );//this method inherit from SystemWindow -}; -//add for DropDownFieldDialog end - - -class AbstractSwLabDlg_Impl : public AbstractSwLabDlg -{ - DECL_ABSTDLG_BASE(AbstractSwLabDlg_Impl,SwLabDlg) - virtual void SetCurPageId( sal_uInt16 nId ); - virtual const SfxItemSet* GetOutputItemSet() const; - virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); - virtual void SetInputSet( const SfxItemSet* pInSet ); - //From class Window. - virtual void SetText( const XubString& rStr ); - virtual String GetText() const; - virtual const String& GetBusinessCardStr() const; - virtual Printer *GetPrt(); -}; -//add for SwLabDlg end - -//add for SwSelGlossaryDlg begin -class AbstractSwSelGlossaryDlg_Impl : public AbstractSwSelGlossaryDlg -{ - DECL_ABSTDLG_BASE(AbstractSwSelGlossaryDlg_Impl,SwSelGlossaryDlg) - virtual void InsertGlos(const String &rRegion, const String &rGlosName); // inline - virtual sal_uInt16 GetSelectedIdx() const; // inline - virtual void SelectEntryPos(sal_uInt16 nIdx); // inline -}; -//add for SwSelGlossaryDlg end - -//add for SwAutoFormatDlg begin -class AbstractSwAutoFormatDlg_Impl : public AbstractSwAutoFormatDlg -{ - DECL_ABSTDLG_BASE(AbstractSwAutoFormatDlg_Impl,SwAutoFormatDlg ) - virtual void FillAutoFmtOfIndex( SwTableAutoFmt*& rToFill ) const; -}; -//add for SwAutoFormatDlg end - -//add for SwFldDlg begin - -class AbstractSwFldDlg_Impl : public AbstractSwFldDlg //add for SwFldDlg -{ - DECL_ABSTDLG_BASE(AbstractSwFldDlg_Impl,SwFldDlg ) - virtual void SetCurPageId( sal_uInt16 nId ); - virtual const SfxItemSet* GetOutputItemSet() const; - virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); - virtual void SetInputSet( const SfxItemSet* pInSet ); - //From class Window. - virtual void SetText( const XubString& rStr ); - virtual String GetText() const; - virtual void Start( sal_Bool bShow = sal_True ); //this method from SfxTabDialog - virtual void ShowPage( sal_uInt16 nId );// this method from SfxTabDialog - virtual void Initialize(SfxChildWinInfo *pInfo); - virtual void ReInitDlg(); - virtual void ActivateDatabasePage(); - virtual Window * GetWindow(); //this method is added for return a Window type pointer -}; -//add for SwFldD end - -//add for SwRenameXNamedDlg begin -class AbstractSwRenameXNamedDlg_Impl : public AbstractSwRenameXNamedDlg -{ - DECL_ABSTDLG_BASE(AbstractSwRenameXNamedDlg_Impl,SwRenameXNamedDlg ) - virtual void SetForbiddenChars( const String& rSet ); - virtual void SetAlternativeAccess( - STAR_REFERENCE( container::XNameAccess ) & xSecond, - STAR_REFERENCE( container::XNameAccess ) & xThird ); -}; -//add for SwRenameXNamedDlg end -//add for SwModalRedlineAcceptDlg begin -class AbstractSwModalRedlineAcceptDlg_Impl : public AbstractSwModalRedlineAcceptDlg -{ - DECL_ABSTDLG_BASE(AbstractSwModalRedlineAcceptDlg_Impl,SwModalRedlineAcceptDlg ) - virtual void AcceptAll( sal_Bool bAccept ); -}; -//add for SwModalRedlineAcceptDlg end - -//for SwGlossaryDlg begin -class SwGlossaryDlg; -class AbstractGlossaryDlg_Impl : public AbstractGlossaryDlg -{ - DECL_ABSTDLG_BASE(AbstractGlossaryDlg_Impl,SwGlossaryDlg) - virtual String GetCurrGrpName() const; - virtual String GetCurrShortName() const; -}; -//for SwGlossaryDlg end - -//for SwFldInputDlg begin -class SwFldInputDlg; -class AbstractFldInputDlg_Impl : public AbstractFldInputDlg -{ - DECL_ABSTDLG_BASE(AbstractFldInputDlg_Impl,SwFldInputDlg) - //from class SalFrame - virtual void SetWindowState( const ByteString& rStr ) ; - virtual ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const ; -}; -//for SwFldInputDlg end - -//for SwInsFootNoteDlg begin -class SwInsFootNoteDlg; -class AbstractInsFootNoteDlg_Impl : public AbstractInsFootNoteDlg -{ - DECL_ABSTDLG_BASE(AbstractInsFootNoteDlg_Impl,SwInsFootNoteDlg) - virtual String GetFontName(); - virtual sal_Bool IsEndNote(); - virtual String GetStr(); - //from class Window - virtual void SetHelpId( const rtl::OString& sHelpId ); - virtual void SetText( const XubString& rStr ); -}; -//for SwInsFootNoteDlg end - -//for SwInsertGrfRulerDlg begin -class SwInsertGrfRulerDlg; -class AbstractInsertGrfRulerDlg_Impl : public AbstractInsertGrfRulerDlg -{ - DECL_ABSTDLG_BASE(AbstractInsertGrfRulerDlg_Impl,SwInsertGrfRulerDlg) - virtual String GetGraphicName(); - virtual sal_Bool IsSimpleLine(); - virtual sal_Bool HasImages() const ; -}; -//for SwInsertGrfRulerDlg end - -//for SwInsTableDlg begin -class SwInsTableDlg; -class AbstractInsTableDlg_Impl : public AbstractInsTableDlg -{ - DECL_ABSTDLG_BASE(AbstractInsTableDlg_Impl,SwInsTableDlg) - virtual void GetValues( String& rName, sal_uInt16& rRow, sal_uInt16& rCol, - SwInsertTableOptions& rInsTblFlags, String& rTableAutoFmtName, - SwTableAutoFmt *& prTAFmt ); -}; -//for SwInsTableDlg end - -//for SwJavaEditDialog begin -class SwJavaEditDialog; -class AbstractJavaEditDialog_Impl : public AbstractJavaEditDialog -{ - DECL_ABSTDLG_BASE(AbstractJavaEditDialog_Impl,SwJavaEditDialog) - virtual String GetText(); - virtual String GetType(); - virtual sal_Bool IsUrl(); - virtual sal_Bool IsNew(); - virtual sal_Bool IsUpdate(); -}; -//for SwJavaEditDialog end - -//for SwMailMergeDlg begin -class SwMailMergeDlg; -class AbstractMailMergeDlg_Impl : public AbstractMailMergeDlg -{ - DECL_ABSTDLG_BASE(AbstractMailMergeDlg_Impl,SwMailMergeDlg) - virtual sal_uInt16 GetMergeType() ; - virtual const ::rtl::OUString& GetSaveFilter() const; - virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const ; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const; - virtual bool IsSaveIndividualDocs() const; - virtual bool IsGenerateFromDataBase() const; - virtual String GetColumnName() const; - virtual String GetPath() const; -}; -//for SwMailMergeDlg end -//for SwMailMergeCreateFromDlg begin -class SwMailMergeCreateFromDlg; -class AbstractMailMergeCreateFromDlg_Impl : public AbstractMailMergeCreateFromDlg -{ - DECL_ABSTDLG_BASE(AbstractMailMergeCreateFromDlg_Impl,SwMailMergeCreateFromDlg) - virtual sal_Bool IsThisDocument() const ; -}; -//for SwMailMergeCreateFromDlg end -//for SwMailMergeFieldConnectionsDlg begin -class SwMailMergeFieldConnectionsDlg; -class AbstractMailMergeFieldConnectionsDlg_Impl : public AbstractMailMergeFieldConnectionsDlg -{ - DECL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl,SwMailMergeFieldConnectionsDlg) - virtual sal_Bool IsUseExistingConnections() const ; -}; -//for SwMailMergeFieldConnectionsDlg end - -//for SwMultiTOXTabDialog begin -class SwMultiTOXTabDialog; -class AbstractMultiTOXTabDialog_Impl : public AbstractMultiTOXTabDialog -{ - DECL_ABSTDLG_BASE(AbstractMultiTOXTabDialog_Impl,SwMultiTOXTabDialog) - virtual SwForm* GetForm(CurTOXType eType); - virtual CurTOXType GetCurrentTOXType() const ; - virtual SwTOXDescription& GetTOXDescription(CurTOXType eTOXTypes); - //from SfxTabDialog - virtual const SfxItemSet* GetOutputItemSet() const; -}; -//for SwMultiTOXTabDialog end - -//for SwEditRegionDlg begin -class SwEditRegionDlg; -class AbstractEditRegionDlg_Impl : public AbstractEditRegionDlg -{ - DECL_ABSTDLG_BASE(AbstractEditRegionDlg_Impl,SwEditRegionDlg) - virtual void SelectSection(const String& rSectionName); -}; -//for SwEditRegionDlg end -//for SwInsertSectionTabDialog begin -class SwInsertSectionTabDialog; -class AbstractInsertSectionTabDialog_Impl : public AbstractInsertSectionTabDialog -{ - DECL_ABSTDLG_BASE(AbstractInsertSectionTabDialog_Impl,SwInsertSectionTabDialog) - virtual void SetSectionData(SwSectionData const& rSect); -}; -//for SwInsertSectionTabDialog end - -//for SwIndexMarkFloatDlg begin -class SwIndexMarkFloatDlg; -class AbstractIndexMarkFloatDlg_Impl : public AbstractMarkFloatDlg -{ - DECL_ABSTDLG_BASE(AbstractIndexMarkFloatDlg_Impl,SwIndexMarkFloatDlg) - virtual void ReInitDlg(SwWrtShell& rWrtShell); - virtual Window * GetWindow(); //this method is added for return a Window type pointer -}; -//for SwIndexMarkFloatDlg end - -//for SwAuthMarkFloatDlg begin -class SwAuthMarkFloatDlg; -class AbstractAuthMarkFloatDlg_Impl : public AbstractMarkFloatDlg -{ - DECL_ABSTDLG_BASE(AbstractAuthMarkFloatDlg_Impl,SwAuthMarkFloatDlg) - virtual void ReInitDlg(SwWrtShell& rWrtShell); - virtual Window * GetWindow(); //this method is added for return a Window type pointer -}; -//for SwAuthMarkFloatDlg end - -class SwMailMergeWizard; -class AbstractMailMergeWizard_Impl : public AbstractMailMergeWizard -{ - SwMailMergeWizard* pDlg; - Link aEndDlgHdl; - - DECL_LINK( EndDialogHdl, SwMailMergeWizard* ); -public: - AbstractMailMergeWizard_Impl( SwMailMergeWizard* p ) - : pDlg(p) - {} - virtual ~AbstractMailMergeWizard_Impl(); - virtual void StartExecuteModal( const Link& rEndDialogHdl ); - virtual long GetResult(); - - virtual void SetReloadDocument(const String& rURL); - virtual const String& GetReloadDocument() const; - virtual sal_Bool ShowPage( sal_uInt16 nLevel ); - virtual sal_uInt16 GetRestartPage() const; -}; - -//------------------------------------------------------------------------ -//AbstractDialogFactory_Impl implementations -class SwAbstractDialogFactory_Impl : public SwAbstractDialogFactory -{ - -public: - virtual SfxAbstractDialog* CreateSfxDialog( Window* pParent, //add for SvxMeasureDialog & SvxConnectionDialog - const SfxItemSet& rAttr, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame, - sal_uInt32 nResId - ); - virtual AbstractSwWordCountDialog* CreateSwWordCountDialog(Window* pParent); - virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg( Window* pParent,int nResId ); - virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh, - SvStream* pStream, int nResId ); //add for SwAsciiFilterDlg - virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId );//add for SwInsertBookmarkDlg - virtual AbstractSwBreakDlg * CreateSwBreakDlg ( Window *pParent, SwWrtShell &rSh,int nResId ); // add for SwBreakDlg - virtual VclAbstractDialog * CreateSwChangeDBDlg( SwView& rVw, int nResId ); //add for SwChangeDBDlg - virtual SfxAbstractTabDialog * CreateSwCharDlg( Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet, int nResId, // add for SwCharDlg - const String* pFmtStr = 0, sal_Bool bIsDrwTxtDlg = sal_False); - virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg ( SwView& rView, int nResId, bool bToTable ); //add for SwConvertTableDlg - virtual VclAbstractDialog * CreateSwCaptionDialog ( Window *pParent, SwView &rV,int nResId); //add for SwCaptionDialog - - virtual AbstractSwInsertDBColAutoPilot* CreateSwInsertDBColAutoPilot( SwView& rView, // add for SwInsertDBColAutoPilot - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> rxSource, - com::sun::star::uno::Reference<com::sun::star::sdbcx::XColumnsSupplier> xColSupp, - const SwDBData& rData, int nResId); - virtual SfxAbstractTabDialog * CreateSwFootNoteOptionDlg( Window *pParent, SwWrtShell &rSh,int nResId);//add for SwFootNoteOptionDlg - - virtual AbstractDropDownFieldDialog * CreateDropDownFieldDialog ( Window *pParent, SwWrtShell &rSh, //add for DropDownFieldDialog - SwField* pField,int nResId, sal_Bool bNextButton = sal_False ); - virtual SfxAbstractTabDialog* CreateSwEnvDlg ( Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert,int nResId ); //add for SwEnvDlg - virtual AbstractSwLabDlg* CreateSwLabDlg ( Window* pParent, const SfxItemSet& rSet, //add for SwLabDlg - SwNewDBMgr* pNewDBMgr, sal_Bool bLabel,int nResId ); - - virtual SwLabDlgMethod GetSwLabDlgStaticMethod (); //add for SwLabDlg - virtual SfxAbstractTabDialog* CreateSwParaDlg ( Window *pParent, //add for SwParaDlg - SwView& rVw, - const SfxItemSet& rCoreSet, - sal_uInt8 nDialogMode, - int nResId, - const String *pCollName = 0, - sal_Bool bDraw = sal_False, - sal_uInt16 nDefPage = 0); - - virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ); //add for SwSelGlossaryDlg - virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ); //add for SwTableHeightDlg SwSortDlg - virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ); //add for SwSplitTblDlg - - virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell, //add for SwAutoFormatDlg - int nResId, - sal_Bool bSetAutoFmt = sal_True, - const SwTableAutoFmt* pSelFmt = 0 ); - virtual SfxAbstractDialog * CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType,int nResId );//add for SwBorderDlg - - virtual SfxAbstractDialog * CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId ); //add for SwWrapDlg - virtual VclAbstractDialog * CreateSwTableWidthDlg ( Window *pParent, SwTableFUNC &rFnc , int nResId ); //add for SwTableWidthDlg - virtual SfxAbstractTabDialog* CreateSwTableTabDlg( Window* pParent, SfxItemPool& Pool, - const SfxItemSet* pItemSet, SwWrtShell* pSh,int nResId ); //add for SwTableTabDlg - virtual AbstractSwFldDlg * CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId ); //add for SwFldDlg - virtual SfxAbstractDialog* CreateSwFldEditDlg ( SwView& rVw, int nResId ); //add for SwFldEditDlg - virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg( Window* pParent, //add for SwRenameXNamedDlg - STAR_REFERENCE( container::XNamed ) & xNamed, - STAR_REFERENCE( container::XNameAccess ) & xNameAccess, int nResId ); - virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg ( Window *pParent, int nResId ); //add for SwModalRedlineAcceptDlg - - virtual VclAbstractDialog* CreateSwVclDialog( int nResId, - Window* pParent, sal_Bool& rWithPrev ); //add for SwMergeTblDlg - virtual SfxAbstractTabDialog* CreateFrmTabDialog( int nResId, - SfxViewFrame *pFrame, Window *pParent, - const SfxItemSet& rCoreSet, - sal_Bool bNewFrm = sal_True, - sal_uInt16 nResType = DLG_FRM_STD, - sal_Bool bFmt = sal_False, - sal_uInt16 nDefPage = 0, - const String* pFmtStr = 0); //add for SwFrmDlg - virtual SfxAbstractTabDialog* CreateTemplateDialog( int nResId, - Window* pParent, - SfxStyleSheetBase& rBase, - sal_uInt16 nRegion, - sal_Bool bColumn = sal_False, - SwWrtShell* pActShell = 0, - sal_Bool bNew = sal_False ); //add for SwTemplateDlg - virtual AbstractGlossaryDlg* CreateGlossaryDlg( int nResId, - SfxViewFrame* pViewFrame, - SwGlossaryHdl* pGlosHdl, - SwWrtShell *pWrtShell); //add for SwGlossaryDlg - virtual AbstractFldInputDlg* CreateFldInputDlg( int nResId, - Window *pParent, SwWrtShell &rSh, - SwField* pField, sal_Bool bNextButton = sal_False ); //add for SwFldInputDlg - virtual AbstractInsFootNoteDlg* CreateInsFootNoteDlg( int nResId, - Window * pParent, SwWrtShell &rSh, sal_Bool bEd = sal_False); //add for SwInsFootNoteDlg - virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent ); - virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId, - SwView& rView, sal_Bool bCol = sal_False ); //add for SwInsRowColDlg, SwLineNumberingDlg - virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId, - Window * pParent ); //add for SwInsertGrfRulerDlg - virtual AbstractInsTableDlg* CreateInsTableDlg( int nResId, - SwView& rView ); //add for SwInsTableDlg - virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId, - Window* pParent, SwWrtShell* pWrtSh ); //add for SwJavaEditDialog - virtual AbstractMailMergeDlg* CreateMailMergeDlg( int nResId, - Window* pParent, SwWrtShell& rSh, - const String& rSourceName, - const String& rTblName, - sal_Int32 nCommandType, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& xConnection, - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 ); //add for SwMailMergeDlg - virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg( int nResId, - Window* pParent ); //add for SwMailMergeCreateFromDlg - virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg( int nResId, - Window* pParent ); //add for SwMailMergeFieldConnectionsDlg - virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId, - Window* pParent, SwTOXMgr &rTOXMgr ); //add for SwMultiTOXMarkDlg - virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId, - Window* pParent, - const SfxItemSet* pSwItemSet, - SwWrtShell &); //add for SwSvxNumBulletTabDialog, SwOutlineTabDialog - virtual AbstractMultiTOXTabDialog* CreateMultiTOXTabDialog( int nResId, - Window* pParent, const SfxItemSet& rSet, - SwWrtShell &rShell, - SwTOXBase* pCurTOX, sal_uInt16 nToxType = USHRT_MAX, - sal_Bool bGlobal = sal_False); //add for SwMultiTOXTabDialog - virtual AbstractEditRegionDlg* CreateEditRegionDlg( int nResId, - Window* pParent, SwWrtShell& rWrtSh ); //add for SwEditRegionDlg - virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog( int nResId, - Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh); //add for SwInsertSectionTabDialog - virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg( int nResId, - SfxBindings* pBindings, - SfxChildWindow* pChild, - Window *pParent, - SfxChildWinInfo* pInfo, - sal_Bool bNew=sal_True); //add for SwIndexMarkFloatDlg - virtual AbstractMarkFloatDlg* CreateAuthMarkFloatDlg( int nResId, - SfxBindings* pBindings, - SfxChildWindow* pChild, - Window *pParent, - SfxChildWinInfo* pInfo, - sal_Bool bNew=sal_True); //add for SwAuthMarkFloatDlg - virtual VclAbstractDialog * CreateIndexMarkModalDlg( int nResId, - Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ); //add for SwIndexMarkModalDlg - - virtual AbstractMailMergeWizard* CreateMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rConfigItem); - - //add for static func in SwGlossaryDlg - virtual GlossaryGetCurrGroup GetGlossaryCurrGroupFunc( sal_uInt16 nId ); - virtual GlossarySetActGroup SetGlossaryActGroupFunc( sal_uInt16 nId ); - - // For TabPage - virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ); - - virtual GetTabPageRanges GetTabPageRangesFunc( sal_uInt16 nId ); - -}; - -struct SwDialogsResMgr -{ - static ResMgr* GetResMgr(); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swuiexp.cxx b/sw/source/ui/dialog/swuiexp.cxx deleted file mode 100644 index a60e1f7dfc..0000000000 --- a/sw/source/ui/dialog/swuiexp.cxx +++ /dev/null @@ -1,58 +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_sw.hxx" -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif - -#include "swdlgfact.hxx" - -namespace swui -{ - static SwAbstractDialogFactory_Impl* pFactory=NULL; - SwAbstractDialogFactory * GetFactory() - { - if ( !pFactory ) - pFactory = new SwAbstractDialogFactory_Impl; - if ( !pSwResMgr) - SwDialogsResMgr::GetResMgr(); - return pFactory; - } -} - -extern "C" -{ - SAL_DLLPUBLIC_EXPORT SwAbstractDialogFactory* CreateDialogFactory() - { - return ::swui::GetFactory(); - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swwrtshitem.cxx b/sw/source/ui/dialog/swwrtshitem.cxx deleted file mode 100644 index 6bfcd3d8da..0000000000 --- a/sw/source/ui/dialog/swwrtshitem.cxx +++ /dev/null @@ -1,54 +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_sw.hxx" -#include "swwrtshitem.hxx" -TYPEINIT1(SwWrtShellItem,SfxPoolItem); -SwWrtShellItem::SwWrtShellItem( sal_uInt16 _nWhich, SwWrtShell* pSh ) - : SfxPoolItem( _nWhich ), pWrtSh( pSh ) -{ - -} -SwWrtShellItem::SwWrtShellItem( const SwWrtShellItem& rItem) : - SfxPoolItem( rItem.Which() ), - pWrtSh( rItem.pWrtSh ) -{ -} - -int SwWrtShellItem::operator==( const SfxPoolItem& rItem) const -{ - return ((SwWrtShellItem&)rItem).pWrtSh == pWrtSh; -} - -SfxPoolItem* SwWrtShellItem::Clone( SfxItemPool * /*pPool*/ ) const -{ - return new SwWrtShellItem( *this ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx deleted file mode 100644 index 08105bb65b..0000000000 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ /dev/null @@ -1,2324 +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_sw.hxx" -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif - -#include <hintids.hxx> -#include <regionsw.hxx> -#include <svl/urihelper.hxx> -#include <svl/PasswordHelper.hxx> -#include <vcl/svapp.hxx> -#include <vcl/msgbox.hxx> -#include <svl/stritem.hxx> -#include <svl/eitem.hxx> -#include <sfx2/passwd.hxx> -#include <sfx2/docfilt.hxx> -#include <sfx2/request.hxx> -#include <sfx2/docfile.hxx> -#include <sfx2/linkmgr.hxx> -#include <sfx2/docinsert.hxx> -#include <sfx2/filedlghelper.hxx> -#include <editeng/sizeitem.hxx> -#include <svtools/htmlcfg.hxx> - -#include <comphelper/storagehelper.hxx> -#include <uitool.hxx> -#include <IMark.hxx> -#include <section.hxx> -#include <docary.hxx> -#include <doc.hxx> // for the SwSectionFmt-Array -#include <basesh.hxx> -#include <wdocsh.hxx> -#include <view.hxx> -#include <swmodule.hxx> -#include <wrtsh.hxx> -#include <swundo.hxx> // for Undo-Ids -#include <column.hxx> -#include <fmtfsize.hxx> -#include <swunodef.hxx> -#include <shellio.hxx> - -#include <helpid.h> -#include <cmdid.h> -#include <regionsw.hrc> -#include <comcore.hrc> -#include <globals.hrc> -#include <sfx2/bindings.hxx> -#include <svx/htmlmode.hxx> -#include <svx/dlgutil.hxx> -#include <svx/dialogs.hrc> -#include <svx/svxdlg.hxx> -#include <svx/flagsdef.hxx> - -using namespace ::com::sun::star; - - -// sw/inc/docary.hxx -SV_IMPL_PTRARR( SwSectionFmts, SwSectionFmtPtr ) - -#define FILE_NAME_LENGTH 17 - -static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox ); - -void lcl_FillList( SwWrtShell& rSh, ComboBox& rSubRegions, ComboBox* pAvailNames, const SwSectionFmt* pNewFmt ) -{ - const SwSectionFmt* pFmt; - if( !pNewFmt ) - { - sal_uInt16 nCount = rSh.GetSectionFmtCount(); - for(sal_uInt16 i=0;i<nCount;i++) - { - SectionType eTmpType; - if( !(pFmt = &rSh.GetSectionFmt(i))->GetParent() && - pFmt->IsInNodesArr() && - (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION - && TOX_HEADER_SECTION != eTmpType ) - { - String* pString = - new String(pFmt->GetSection()->GetSectionName()); - if(pAvailNames) - pAvailNames->InsertEntry(*pString); - rSubRegions.InsertEntry(*pString); - lcl_FillList( rSh, rSubRegions, pAvailNames, pFmt ); - } - } - } - else - { - SwSections aTmpArr; - sal_uInt16 nCnt = pNewFmt->GetChildSections(aTmpArr,SORTSECT_POS); - if( nCnt ) - { - SectionType eTmpType; - for( sal_uInt16 n = 0; n < nCnt; ++n ) - if( (pFmt = aTmpArr[n]->GetFmt())->IsInNodesArr()&& - (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION - && TOX_HEADER_SECTION != eTmpType ) - { - String* pString = - new String(pFmt->GetSection()->GetSectionName()); - if(pAvailNames) - pAvailNames->InsertEntry(*pString); - rSubRegions.InsertEntry(*pString); - lcl_FillList( rSh, rSubRegions, pAvailNames, pFmt ); - } - } - } -} - -void lcl_FillSubRegionList( SwWrtShell& rSh, ComboBox& rSubRegions, ComboBox* pAvailNames ) -{ - lcl_FillList( rSh, rSubRegions, pAvailNames, 0 ); - IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess(); - for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); - ppMark != pMarkAccess->getMarksEnd(); - ppMark++) - { - const ::sw::mark::IMark* pBkmk = ppMark->get(); - if( pBkmk->IsExpanded() ) - rSubRegions.InsertEntry( pBkmk->GetName() ); - } -} - -class SwTestPasswdDlg : public SfxPasswordDialog -{ -public: - SwTestPasswdDlg(Window* pParent) : - SfxPasswordDialog(pParent) - { - SetHelpId(HID_DLG_PASSWD_SECTION); - } -}; - -/*---------------------------------------------------------------------------- - Description: user data class for region information -----------------------------------------------------------------------------*/ - -class SectRepr -{ -private: - SwSectionData m_SectionData; - SwFmtCol m_Col; - SvxBrushItem m_Brush; - SwFmtFtnAtTxtEnd m_FtnNtAtEnd; - SwFmtEndAtTxtEnd m_EndNtAtEnd; - SwFmtNoBalancedColumns m_Balance; - SvxFrameDirectionItem m_FrmDirItem; - SvxLRSpaceItem m_LRSpaceItem; - sal_uInt16 m_nArrPos; - // shows, if maybe textcontent is in the region - bool m_bContent : 1; - // for multiselection, mark at first, then work with TreeListBox! - bool m_bSelected : 1; - uno::Sequence<sal_Int8> m_TempPasswd; - -public: - SectRepr(sal_uInt16 nPos, SwSection& rSect); - bool operator==(SectRepr& rSectRef) const - { return m_nArrPos == rSectRef.GetArrPos(); } - - bool operator< (SectRepr& rSectRef) const - { return m_nArrPos < rSectRef.GetArrPos(); } - - SwSectionData & GetSectionData() { return m_SectionData; } - SwSectionData const&GetSectionData() const { return m_SectionData; } - SwFmtCol& GetCol() { return m_Col; } - SvxBrushItem& GetBackground() { return m_Brush; } - SwFmtFtnAtTxtEnd& GetFtnNtAtEnd() { return m_FtnNtAtEnd; } - SwFmtEndAtTxtEnd& GetEndNtAtEnd() { return m_EndNtAtEnd; } - SwFmtNoBalancedColumns& GetBalance() { return m_Balance; } - SvxFrameDirectionItem& GetFrmDir() { return m_FrmDirItem; } - SvxLRSpaceItem& GetLRSpace() { return m_LRSpaceItem; } - - sal_uInt16 GetArrPos() const { return m_nArrPos; } - String GetFile() const; - String GetSubRegion() const; - void SetFile(String const& rFile); - void SetFilter(String const& rFilter); - void SetSubRegion(String const& rSubRegion); - - bool IsContent() { return m_bContent; } - void SetContent(bool const bValue) { m_bContent = bValue; } - - void SetSelected() { m_bSelected = true; } - bool IsSelected() const { return m_bSelected; } - - uno::Sequence<sal_Int8> & GetTempPasswd() { return m_TempPasswd; } - void SetTempPasswd(const uno::Sequence<sal_Int8> & rPasswd) - { m_TempPasswd = rPasswd; } -}; - - -SV_IMPL_OP_PTRARR_SORT( SectReprArr, SectReprPtr ) - -SectRepr::SectRepr( sal_uInt16 nPos, SwSection& rSect ) - : m_SectionData( rSect ) - , m_Brush( RES_BACKGROUND ) - , m_FrmDirItem( FRMDIR_ENVIRONMENT, RES_FRAMEDIR ) - , m_LRSpaceItem( RES_LR_SPACE ) - , m_nArrPos(nPos) - , m_bContent(m_SectionData.GetLinkFileName().Len() == 0) - , m_bSelected(false) -{ - SwSectionFmt *pFmt = rSect.GetFmt(); - if( pFmt ) - { - m_Col = pFmt->GetCol(); - m_Brush = pFmt->GetBackground(); - m_FtnNtAtEnd = pFmt->GetFtnAtTxtEnd(); - m_EndNtAtEnd = pFmt->GetEndAtTxtEnd(); - m_Balance.SetValue(pFmt->GetBalancedColumns().GetValue()); - m_FrmDirItem = pFmt->GetFrmDir(); - m_LRSpaceItem = pFmt->GetLRSpace(); - } -} - -void SectRepr::SetFile( const String& rFile ) -{ - String sNewFile( INetURLObject::decode( rFile, INET_HEX_ESCAPE, - INetURLObject::DECODE_UNAMBIGUOUS, - RTL_TEXTENCODING_UTF8 )); - String sOldFileName( m_SectionData.GetLinkFileName() ); - String sSub( sOldFileName.GetToken( 2, sfx2::cTokenSeperator ) ); - - if( rFile.Len() || sSub.Len() ) - { - sNewFile += sfx2::cTokenSeperator; - if( rFile.Len() ) // Filter only with FileName - sNewFile += sOldFileName.GetToken( 1, sfx2::cTokenSeperator ); - - sNewFile += sfx2::cTokenSeperator; - sNewFile += sSub; - } - - m_SectionData.SetLinkFileName( sNewFile ); - - if( rFile.Len() || sSub.Len() ) - { - m_SectionData.SetType( FILE_LINK_SECTION ); - } - else - { - m_SectionData.SetType( CONTENT_SECTION ); - } -} - - -void SectRepr::SetFilter( const String& rFilter ) -{ - String sNewFile; - String sOldFileName( m_SectionData.GetLinkFileName() ); - String sFile( sOldFileName.GetToken( 0, sfx2::cTokenSeperator ) ); - String sSub( sOldFileName.GetToken( 2, sfx2::cTokenSeperator ) ); - - if( sFile.Len() ) - (((( sNewFile = sFile ) += sfx2::cTokenSeperator ) += rFilter ) - += sfx2::cTokenSeperator ) += sSub; - else if( sSub.Len() ) - (( sNewFile = sfx2::cTokenSeperator ) += sfx2::cTokenSeperator ) += sSub; - - m_SectionData.SetLinkFileName( sNewFile ); - - if( sNewFile.Len() ) - { - m_SectionData.SetType( FILE_LINK_SECTION ); - } -} - -void SectRepr::SetSubRegion(const String& rSubRegion) -{ - String sNewFile; - String sOldFileName( m_SectionData.GetLinkFileName() ); - String sFilter( sOldFileName.GetToken( 1, sfx2::cTokenSeperator ) ); - sOldFileName = sOldFileName.GetToken( 0, sfx2::cTokenSeperator ); - - if( rSubRegion.Len() || sOldFileName.Len() ) - (((( sNewFile = sOldFileName ) += sfx2::cTokenSeperator ) += sFilter ) - += sfx2::cTokenSeperator ) += rSubRegion; - - m_SectionData.SetLinkFileName( sNewFile ); - - if( rSubRegion.Len() || sOldFileName.Len() ) - { - m_SectionData.SetType( FILE_LINK_SECTION ); - } - else - { - m_SectionData.SetType( CONTENT_SECTION ); - } -} - - -String SectRepr::GetFile() const -{ - String sLinkFile( m_SectionData.GetLinkFileName() ); - if( sLinkFile.Len() ) - { - if (DDE_LINK_SECTION == m_SectionData.GetType()) - { - sal_uInt16 n = sLinkFile.SearchAndReplace( sfx2::cTokenSeperator, ' ' ); - sLinkFile.SearchAndReplace( sfx2::cTokenSeperator, ' ', n ); - } - else - sLinkFile = INetURLObject::decode( sLinkFile.GetToken( 0, - sfx2::cTokenSeperator ), - INET_HEX_ESCAPE, - INetURLObject::DECODE_UNAMBIGUOUS, - RTL_TEXTENCODING_UTF8 ); - } - return sLinkFile; -} - - -String SectRepr::GetSubRegion() const -{ - String sLinkFile( m_SectionData.GetLinkFileName() ); - if( sLinkFile.Len() ) - sLinkFile = sLinkFile.GetToken( 2, sfx2::cTokenSeperator ); - return sLinkFile; -} - -/*---------------------------------------------------------------------------- - Description: dialog edit regions -----------------------------------------------------------------------------*/ -SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh ) - : SfxModalDialog( pParent, SW_RES(MD_EDIT_REGION) ), - aNameFL ( this, SW_RES( FL_NAME ) ), - aCurName ( this, SW_RES( ED_RANAME ) ), - aTree ( this, SW_RES( TLB_SECTION )), - aLinkFL ( this, SW_RES( FL_LINK ) ), - aFileCB ( this, SW_RES( CB_FILE ) ), - aDDECB ( this, SW_RES( CB_DDE ) ) , - aFileNameFT ( this, SW_RES( FT_FILE ) ) , - aDDECommandFT ( this, SW_RES( FT_DDE ) ) , - aFileNameED ( this, SW_RES( ED_FILE ) ), - aFilePB ( this, SW_RES( PB_FILE ) ), - aSubRegionFT ( this, SW_RES( FT_SUBREG ) ) , - aSubRegionED ( this, SW_RES( LB_SUBREG ) ) , - bSubRegionsFilled( false ), - - aProtectFL ( this, SW_RES( FL_PROTECT ) ), - aProtectCB ( this, SW_RES( CB_PROTECT ) ), - aPasswdCB ( this, SW_RES( CB_PASSWD ) ), - aPasswdPB ( this, SW_RES( PB_PASSWD ) ), - - aHideFL ( this, SW_RES( FL_HIDE ) ), - aHideCB ( this, SW_RES( CB_HIDE ) ), - aConditionFT ( this, SW_RES( FT_CONDITION ) ), - aConditionED ( this, SW_RES( ED_CONDITION ) ), - - // edit in readonly sections - aPropertiesFL ( this, SW_RES( FL_PROPERTIES ) ), - aEditInReadonlyCB ( this, SW_RES( CB_EDIT_IN_READONLY ) ), - - aOK ( this, SW_RES( PB_OK ) ), - aCancel ( this, SW_RES( PB_CANCEL ) ), - aOptionsPB ( this, SW_RES( PB_OPTIONS ) ), - aDismiss ( this, SW_RES( CB_DISMISS ) ), - aHelp ( this, SW_RES( PB_HELP ) ), - - aImageIL ( SW_RES(IL_BITMAPS)), - - rSh( rWrtSh ), - pAktEntry( 0 ), - m_pDocInserter ( NULL ), - m_pOldDefDlgParent ( NULL ), - bDontCheckPasswd ( sal_True) -{ - FreeResource(); - - bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() ); - - aTree.SetSelectHdl ( LINK( this, SwEditRegionDlg, GetFirstEntryHdl)); - aTree.SetDeselectHdl ( LINK( this, SwEditRegionDlg, DeselectHdl)); - aCurName.SetModifyHdl ( LINK( this, SwEditRegionDlg, NameEditHdl)); - aConditionED.SetModifyHdl( LINK( this, SwEditRegionDlg, ConditionEditHdl)); - aOK.SetClickHdl ( LINK( this, SwEditRegionDlg, OkHdl)); - aPasswdCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangePasswdHdl)); - aPasswdPB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangePasswdHdl)); - aHideCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeHideHdl)); - // edit in readonly sections - aEditInReadonlyCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeEditInReadonlyHdl)); - - aOptionsPB.Show(); - aOptionsPB.SetClickHdl ( LINK( this, SwEditRegionDlg, OptionsHdl)); - aProtectCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeProtectHdl)); - aDismiss.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeDismissHdl)); - aFileCB.SetClickHdl ( LINK( this, SwEditRegionDlg, UseFileHdl )); - aFilePB.SetClickHdl ( LINK( this, SwEditRegionDlg, FileSearchHdl )); - aFileNameED.SetModifyHdl( LINK( this, SwEditRegionDlg, FileNameHdl )); - aSubRegionED.SetModifyHdl( LINK( this, SwEditRegionDlg, FileNameHdl )); - aSubRegionED.AddEventListener( LINK( this, SwEditRegionDlg, SubRegionEventHdl )); - aSubRegionED.EnableAutocomplete( sal_True, sal_True ); - - aTree.SetHelpId(HID_REGION_TREE); - aTree.SetSelectionMode( MULTIPLE_SELECTION ); - aTree.SetStyle(aTree.GetStyle()|WB_HASBUTTONSATROOT|WB_CLIPCHILDREN|WB_HSCROLL); - aTree.SetSpaceBetweenEntries(0); - - if(bWeb) - { - aConditionFT .Hide(); - aConditionED .Hide(); - aPasswdCB .Hide(); - aHideCB .Hide(); - - aDDECB .Hide(); - aDDECommandFT .Hide(); - } - - aDDECB.SetClickHdl ( LINK( this, SwEditRegionDlg, DDEHdl )); - - pCurrSect = rSh.GetCurrSection(); - RecurseList( 0, 0 ); - // if the cursor is not in a region - // the first one will always be selected - if( !aTree.FirstSelected() && aTree.First() ) - aTree.Select( aTree.First() ); - aTree.Show(); - bDontCheckPasswd = sal_False; - - aPasswdPB.SetAccessibleRelationMemberOf(&aProtectFL); - aPasswdPB.SetAccessibleRelationLabeledBy(&aPasswdCB); - aSubRegionED.SetAccessibleName(aSubRegionFT.GetText()); -} - -sal_Bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox) -{ - if(bDontCheckPasswd) - return sal_True; - sal_Bool bRet = sal_True; - SvLBoxEntry* pEntry = aTree.FirstSelected(); - while( pEntry ) - { - SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData(); - if (!pRepr->GetTempPasswd().getLength() - && pRepr->GetSectionData().GetPassword().getLength()) - { - SwTestPasswdDlg aPasswdDlg(this); - bRet = sal_False; - if (aPasswdDlg.Execute()) - { - String sNewPasswd( aPasswdDlg.GetPassword() ); - UNO_NMSPC::Sequence <sal_Int8 > aNewPasswd; - SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd ); - if (SvPasswordHelper::CompareHashPassword( - pRepr->GetSectionData().GetPassword(), sNewPasswd)) - { - pRepr->SetTempPasswd(aNewPasswd); - bRet = sal_True; - } - else - { - InfoBox(this, SW_RES(REG_WRONG_PASSWORD)).Execute(); - } - } - } - pEntry = aTree.NextSelected(pEntry); - } - if(!bRet && pBox) - { - //reset old button state - if(pBox->IsTriStateEnabled()) - pBox->SetState(pBox->IsChecked() ? STATE_NOCHECK : STATE_DONTKNOW); - else - pBox->Check(!pBox->IsChecked()); - } - - return bRet; -} - -/*--------------------------------------------------------------------- - Description: recursively look for child-sections ----------------------------------------------------------------------*/ -void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry ) -{ - SwSection* pSect = 0; - SvLBoxEntry* pSelEntry = 0; - - if (!pFmt) - { - sal_uInt16 nCount=rSh.GetSectionFmtCount(); - for ( sal_uInt16 n=0; n < nCount; n++ ) - { - SectionType eTmpType; - if( !( pFmt = &rSh.GetSectionFmt(n))->GetParent() && - pFmt->IsInNodesArr() && - (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION - && TOX_HEADER_SECTION != eTmpType ) - { - SectRepr* pSectRepr = new SectRepr( n, - *(pSect=pFmt->GetSection()) ); - Image aImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden()); - pEntry = aTree.InsertEntry(pSect->GetSectionName(), aImg, aImg); - pEntry->SetUserData(pSectRepr); - RecurseList( pFmt, pEntry ); - if (pEntry->HasChilds()) - aTree.Expand(pEntry); - if (pCurrSect==pSect) - aTree.Select(pEntry); - } - } - } - else - { - SwSections aTmpArr; - SvLBoxEntry* pNEntry; - sal_uInt16 nCnt = pFmt->GetChildSections(aTmpArr,SORTSECT_POS); - if( nCnt ) - { - for( sal_uInt16 n = 0; n < nCnt; ++n ) - { - SectionType eTmpType; - pFmt = aTmpArr[n]->GetFmt(); - if( pFmt->IsInNodesArr() && - (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION - && TOX_HEADER_SECTION != eTmpType ) - { - pSect=aTmpArr[n]; - SectRepr* pSectRepr=new SectRepr( - FindArrPos( pSect->GetFmt() ), *pSect ); - Image aImage = BuildBitmap( pSect->IsProtect(), - pSect->IsHidden()); - pNEntry = aTree.InsertEntry( - pSect->GetSectionName(), aImage, aImage, pEntry); - pNEntry->SetUserData(pSectRepr); - RecurseList( aTmpArr[n]->GetFmt(), pNEntry ); - if( pNEntry->HasChilds()) - aTree.Expand(pNEntry); - if (pCurrSect==pSect) - pSelEntry = pNEntry; - } - } - } - } - if(0 != pSelEntry) - { - aTree.MakeVisible(pSelEntry); - aTree.Select(pSelEntry); - } -} - -sal_uInt16 SwEditRegionDlg::FindArrPos(const SwSectionFmt* pFmt ) -{ - sal_uInt16 nCount=rSh.GetSectionFmtCount(); - for (sal_uInt16 i=0;i<nCount;i++) - if (pFmt==&rSh.GetSectionFmt(i)) - return i; - - OSL_FAIL("SectionFormat not on the list" ); - return USHRT_MAX; -} - -SwEditRegionDlg::~SwEditRegionDlg( ) -{ - SvLBoxEntry* pEntry = aTree.First(); - while( pEntry ) - { - delete (SectRepr*)pEntry->GetUserData(); - pEntry = aTree.Next( pEntry ); - } - - aSectReprArr.DeleteAndDestroy( 0, aSectReprArr.Count() ); - delete m_pDocInserter; -} - -void SwEditRegionDlg::SelectSection(const String& rSectionName) -{ - SvLBoxEntry* pEntry = aTree.First(); - while(pEntry) - { - SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData(); - if (pRepr->GetSectionData().GetSectionName() == rSectionName) - break; - pEntry = aTree.Next(pEntry); - } - if(pEntry) - { - aTree.SelectAll( sal_False); - aTree.Select(pEntry); - aTree.MakeVisible(pEntry); - } -} - -/*--------------------------------------------------------------------- - Description: selected entry in TreeListBox is showed in - Edit window - in case of multiselection some controls are disabled ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) -{ - bDontCheckPasswd = sal_True; - SvLBoxEntry* pEntry=pBox->FirstSelected(); - aHideCB .Enable(sal_True); - // edit in readonly sections - aEditInReadonlyCB.Enable(sal_True); - - aProtectCB .Enable(sal_True); - aFileCB .Enable(sal_True); - UNO_NMSPC::Sequence <sal_Int8> aCurPasswd; - if( 1 < pBox->GetSelectionCount() ) - { - aHideCB.EnableTriState( sal_True ); - aProtectCB.EnableTriState( sal_True ); - // edit in readonly sections - aEditInReadonlyCB.EnableTriState ( sal_True ); - - aFileCB.EnableTriState( sal_True ); - - bool bHiddenValid = true; - bool bProtectValid = true; - bool bConditionValid = true; - // edit in readonly sections - bool bEditInReadonlyValid = true; - bool bEditInReadonly = true; - - bool bHidden = true; - bool bProtect = true; - String sCondition; - sal_Bool bFirst = sal_True; - sal_Bool bFileValid = sal_True; - sal_Bool bFile = sal_True; - sal_Bool bPasswdValid = sal_True; - - while( pEntry ) - { - SectRepr* pRepr=(SectRepr*) pEntry->GetUserData(); - SwSectionData const& rData( pRepr->GetSectionData() ); - if(bFirst) - { - sCondition = rData.GetCondition(); - bHidden = rData.IsHidden(); - bProtect = rData.IsProtectFlag(); - // edit in readonly sections - bEditInReadonly = rData.IsEditInReadonlyFlag(); - - bFile = (rData.GetType() != CONTENT_SECTION); - aCurPasswd = rData.GetPassword(); - } - else - { - String sTemp(rData.GetCondition()); - if(sCondition != sTemp) - bConditionValid = sal_False; - bHiddenValid = (bHidden == rData.IsHidden()); - bProtectValid = (bProtect == rData.IsProtectFlag()); - // edit in readonly sections - bEditInReadonlyValid = - (bEditInReadonly == rData.IsEditInReadonlyFlag()); - - bFileValid = (bFile == - (rData.GetType() != CONTENT_SECTION)); - bPasswdValid = (aCurPasswd == rData.GetPassword()); - } - pEntry = pBox->NextSelected(pEntry); - bFirst = sal_False; - } - - aHideCB.SetState( !bHiddenValid ? STATE_DONTKNOW : - bHidden ? STATE_CHECK : STATE_NOCHECK); - aProtectCB.SetState( !bProtectValid ? STATE_DONTKNOW : - bProtect ? STATE_CHECK : STATE_NOCHECK); - // edit in readonly sections - aEditInReadonlyCB.SetState( !bEditInReadonlyValid ? STATE_DONTKNOW : - bEditInReadonly ? STATE_CHECK : STATE_NOCHECK); - - aFileCB.SetState(!bFileValid ? STATE_DONTKNOW : - bFile ? STATE_CHECK : STATE_NOCHECK); - - if(bConditionValid) - aConditionED.SetText(sCondition); - else - { - aConditionFT.Enable(sal_False); - aConditionED.Enable(sal_False); - } - - aFilePB.Enable(sal_False); - aFileNameFT .Enable(sal_False); - aFileNameED .Enable(sal_False); - aSubRegionFT.Enable(sal_False); - aSubRegionED.Enable(sal_False); - aCurName .Enable(sal_False); - aOptionsPB .Enable(sal_False); - aDDECB .Enable(sal_False); - aDDECommandFT .Enable(sal_False); - sal_Bool bPasswdEnabled = aProtectCB.GetState() == STATE_CHECK; - aPasswdCB.Enable(bPasswdEnabled); - aPasswdPB.Enable(bPasswdEnabled); - if(!bPasswdValid) - { - pEntry = pBox->FirstSelected(); - pBox->SelectAll( sal_False ); - pBox->Select( pEntry ); - GetFirstEntryHdl(pBox); - return 0; - } - else - aPasswdCB.Check(aCurPasswd.getLength() > 0); - } - else if (pEntry ) - { - aCurName .Enable(sal_True); - aOptionsPB .Enable(sal_True); - SectRepr* pRepr=(SectRepr*) pEntry->GetUserData(); - SwSectionData const& rData( pRepr->GetSectionData() ); - aConditionED.SetText(rData.GetCondition()); - aHideCB.Enable(); - aHideCB.SetState((rData.IsHidden()) ? STATE_CHECK : STATE_NOCHECK); - sal_Bool bHide = STATE_CHECK == aHideCB.GetState(); - aConditionED.Enable(bHide); - aConditionFT.Enable(bHide); - aPasswdCB.Check(rData.GetPassword().getLength() > 0); - - aOK.Enable(); - aPasswdCB.Enable(); - aCurName.SetText(pBox->GetEntryText(pEntry)); - aCurName.Enable(); - aDismiss.Enable(); - String aFile = pRepr->GetFile(); - String sSub = pRepr->GetSubRegion(); - bSubRegionsFilled = false; - aSubRegionED.Clear(); - if(aFile.Len()||sSub.Len()) - { - aFileCB.Check(sal_True); - aFileNameED.SetText(aFile); - aSubRegionED.SetText(sSub); - aDDECB.Check(rData.GetType() == DDE_LINK_SECTION); - } - else - { - aFileCB.Check(sal_False); - aFileNameED.SetText(aFile); - aDDECB.Enable(sal_False); - aDDECB.Check(sal_False); - } - UseFileHdl(&aFileCB); - DDEHdl( &aDDECB ); - aProtectCB.SetState((rData.IsProtectFlag()) - ? STATE_CHECK : STATE_NOCHECK); - aProtectCB.Enable(); - - // edit in readonly sections - aEditInReadonlyCB.SetState((rData.IsEditInReadonlyFlag()) - ? STATE_CHECK : STATE_NOCHECK); - aEditInReadonlyCB.Enable(); - - sal_Bool bPasswdEnabled = aProtectCB.IsChecked(); - aPasswdCB.Enable(bPasswdEnabled); - aPasswdPB.Enable(bPasswdEnabled); - } - bDontCheckPasswd = sal_False; - return 0; -} - -IMPL_LINK( SwEditRegionDlg, DeselectHdl, SvTreeListBox *, pBox ) -{ - if( !pBox->GetSelectionCount() ) - { - aHideCB .Enable(sal_False); - aProtectCB .Enable(sal_False); - // edit in readonly sections - aEditInReadonlyCB.Enable(sal_False); - - aPasswdCB .Enable(sal_False); - aPasswdCB .Enable(sal_False); - aConditionFT .Enable(sal_False); - aConditionED.Enable(sal_False); - aFileCB .Enable(sal_False); - aFilePB .Enable(sal_False); - aFileNameFT .Enable(sal_False); - aFileNameED .Enable(sal_False); - aSubRegionFT .Enable(sal_False); - aSubRegionED .Enable(sal_False); - aCurName .Enable(sal_False); - aDDECB .Enable(sal_False); - aDDECommandFT .Enable(sal_False); - - UseFileHdl(&aFileCB); - DDEHdl( &aDDECB ); - } - return 0; -} - -/*--------------------------------------------------------------------- - Description: in OkHdl the modified settings are being applied - and reversed regions are deleted ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, OkHdl, CheckBox *, EMPTYARG ) -{ - // temp. Array because during changing of a region the position - // inside of the "Core-Arrays" can be shifted: - // - at linked regions, when they have more SubRegions or get - // new ones. - // StartUndo must certainly also happen not before the formats - // are copied (ClearRedo!) - - const SwSectionFmts& rDocFmts = rSh.GetDoc()->GetSections(); - SwSectionFmts aOrigArray( 0, 5 ); - aOrigArray.Insert( &rDocFmts, 0 ); - - rSh.StartAllAction(); - rSh.StartUndo(); - rSh.ResetSelect( 0,sal_False ); - SvLBoxEntry* pEntry = aTree.First(); - - while( pEntry ) - { - SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData(); - SwSectionFmt* pFmt = aOrigArray[ pRepr->GetArrPos() ]; - if (!pRepr->GetSectionData().IsProtectFlag()) - { - pRepr->GetSectionData().SetPassword(uno::Sequence<sal_Int8 >()); - } - sal_uInt16 nNewPos = rDocFmts.GetPos( pFmt ); - if( USHRT_MAX != nNewPos ) - { - SfxItemSet* pSet = pFmt->GetAttrSet().Clone( sal_False ); - if( pFmt->GetCol() != pRepr->GetCol() ) - pSet->Put( pRepr->GetCol() ); - - if( pFmt->GetBackground(sal_False) != pRepr->GetBackground() ) - pSet->Put( pRepr->GetBackground() ); - - if( pFmt->GetFtnAtTxtEnd(sal_False) != pRepr->GetFtnNtAtEnd() ) - pSet->Put( pRepr->GetFtnNtAtEnd() ); - - if( pFmt->GetEndAtTxtEnd(sal_False) != pRepr->GetEndNtAtEnd() ) - pSet->Put( pRepr->GetEndNtAtEnd() ); - - if( pFmt->GetBalancedColumns() != pRepr->GetBalance() ) - pSet->Put( pRepr->GetBalance() ); - - if( pFmt->GetFrmDir() != pRepr->GetFrmDir() ) - pSet->Put( pRepr->GetFrmDir() ); - - if( pFmt->GetLRSpace() != pRepr->GetLRSpace()) - pSet->Put( pRepr->GetLRSpace()); - - rSh.UpdateSection( nNewPos, pRepr->GetSectionData(), - pSet->Count() ? pSet : 0 ); - delete pSet; - } - pEntry = aTree.Next( pEntry ); - } - - for(sal_uInt16 i = aSectReprArr.Count(); i; ) - { - SwSectionFmt* pFmt = aOrigArray[ aSectReprArr[ --i ]->GetArrPos() ]; - sal_uInt16 nNewPos = rDocFmts.GetPos( pFmt ); - if( USHRT_MAX != nNewPos ) - rSh.DelSectionFmt( nNewPos ); - } - - aOrigArray.Remove( 0, aOrigArray.Count() ); - - // EndDialog must be called ahead of EndAction's end, - // otherwise ScrollError can occur. - EndDialog(RET_OK); - - rSh.EndUndo(); - rSh.EndAllAction(); - - return 0; -} - -/*--------------------------------------------------------------------- - Description: Toggle protect ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, ChangeProtectHdl, TriStateBox *, pBox ) -{ - if(!CheckPasswd(pBox)) - return 0; - pBox->EnableTriState( sal_False ); - SvLBoxEntry* pEntry=aTree.FirstSelected(); - OSL_ENSURE(pEntry,"no entry found"); - sal_Bool bCheck = STATE_CHECK == pBox->GetState(); - while( pEntry ) - { - SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData(); - pRepr->GetSectionData().SetProtectFlag(bCheck); - Image aImage = BuildBitmap( bCheck, - STATE_CHECK == aHideCB.GetState()); - aTree.SetExpandedEntryBmp( pEntry, aImage ); - aTree.SetCollapsedEntryBmp( pEntry, aImage ); - pEntry = aTree.NextSelected(pEntry); - } - aPasswdCB.Enable(bCheck); - aPasswdPB.Enable(bCheck); - return 0; -} - -/*--------------------------------------------------------------------- - Description: Toggle hide ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, ChangeHideHdl, TriStateBox *, pBox ) -{ - if(!CheckPasswd(pBox)) - return 0; - pBox->EnableTriState( sal_False ); - SvLBoxEntry* pEntry=aTree.FirstSelected(); - OSL_ENSURE(pEntry,"no entry found"); - while( pEntry ) - { - SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData(); - pRepr->GetSectionData().SetHidden(STATE_CHECK == pBox->GetState()); - - Image aImage = BuildBitmap(STATE_CHECK == aProtectCB.GetState(), - STATE_CHECK == pBox->GetState()); - aTree.SetExpandedEntryBmp( pEntry, aImage ); - aTree.SetCollapsedEntryBmp( pEntry, aImage ); - - pEntry = aTree.NextSelected(pEntry); - } - - sal_Bool bHide = STATE_CHECK == pBox->GetState(); - aConditionED.Enable(bHide); - aConditionFT.Enable(bHide); - return 0; -} - -/*--------------------------------------------------------------------- - Description: Toggle edit in readonly ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, ChangeEditInReadonlyHdl, TriStateBox *, pBox ) -{ - if(!CheckPasswd(pBox)) - return 0; - pBox->EnableTriState( sal_False ); - SvLBoxEntry* pEntry=aTree.FirstSelected(); - OSL_ENSURE(pEntry,"no entry found"); - while( pEntry ) - { - SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData(); - pRepr->GetSectionData().SetEditInReadonlyFlag( - STATE_CHECK == pBox->GetState()); - pEntry = aTree.NextSelected(pEntry); - } - - return 0; -} - -/*--------------------------------------------------------------------- - Description: clear selected region ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG ) -{ - if(!CheckPasswd()) - return 0; - SvLBoxEntry* pEntry = aTree.FirstSelected(); - SvLBoxEntry* pChild; - SvLBoxEntry* pParent; - // at first mark all selected - while(pEntry) - { - const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); - pSectRepr->SetSelected(); - pEntry = aTree.NextSelected(pEntry); - } - pEntry = aTree.FirstSelected(); - // then delete - while(pEntry) - { - const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); - SvLBoxEntry* pRemove = 0; - sal_Bool bRestart = sal_False; - if(pSectRepr->IsSelected()) - { - aSectReprArr.Insert( pSectRepr ); - while( (pChild = aTree.FirstChild(pEntry) )!= 0 ) - { - // because of the repositioning we have to start at the beginning again - bRestart = sal_True; - pParent=aTree.GetParent(pEntry); - aTree.GetModel()->Move(pChild, pParent, aTree.GetModel()->GetRelPos(pEntry)); - } - pRemove = pEntry; - } - if(bRestart) - pEntry = aTree.First(); - else - pEntry = aTree.Next(pEntry); - if(pRemove) - aTree.GetModel()->Remove( pRemove ); - } - - if ( (pEntry=aTree.FirstSelected()) == 0 ) - { - aConditionFT. Enable(sal_False); - aConditionED. Enable(sal_False); - aDismiss. Enable(sal_False); - aCurName. Enable(sal_False); - aProtectCB. Enable(sal_False); - aPasswdCB. Enable(sal_False); - aHideCB. Enable(sal_False); - // edit in readonly sections - aEditInReadonlyCB.Enable(sal_False); - aEditInReadonlyCB.SetState(STATE_NOCHECK); - aProtectCB. SetState(STATE_NOCHECK); - aPasswdCB. Check(sal_False); - aHideCB. SetState(STATE_NOCHECK); - aFileCB. Check(sal_False); - // otherwise the focus would be on HelpButton - aOK.GrabFocus(); - UseFileHdl(&aFileCB); - } - return 0; -} - -/*--------------------------------------------------------------------- - Description: link CheckBox to file? ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox ) -{ - if(!CheckPasswd(pBox)) - return 0; - SvLBoxEntry* pEntry = aTree.FirstSelected(); - pBox->EnableTriState(sal_False); - sal_Bool bMulti = 1 < aTree.GetSelectionCount(); - sal_Bool bFile = pBox->IsChecked(); - if(pEntry) - { - while(pEntry) - { - const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); - sal_Bool bContent = pSectRepr->IsContent(); - if( pBox->IsChecked() && bContent && rSh.HasSelection() ) - { - if( RET_NO == QueryBox( this, SW_RES(QB_CONNECT) ).Execute() ) - pBox->Check( sal_False ); - } - if( bFile ) - pSectRepr->SetContent(sal_False); - else - { - pSectRepr->SetFile(aEmptyStr); - pSectRepr->SetSubRegion(aEmptyStr); - pSectRepr->GetSectionData().SetLinkFilePassword(aEmptyStr); - } - - pEntry = aTree.NextSelected(pEntry); - } - aFileNameFT.Enable(bFile && ! bMulti); - aFileNameED.Enable(bFile && ! bMulti); - aFilePB.Enable(bFile && ! bMulti); - aSubRegionED.Enable(bFile && ! bMulti); - aSubRegionFT.Enable(bFile && ! bMulti); - aDDECommandFT.Enable(bFile && ! bMulti); - aDDECB.Enable(bFile && ! bMulti); - if( bFile ) - { - aProtectCB.SetState(STATE_CHECK); - aFileNameED.GrabFocus(); - - } - else - { - aDDECB.Check(sal_False); - DDEHdl(&aDDECB); - aSubRegionED.SetText(aEmptyStr); - } - } - else - { - pBox->Check(sal_False); - pBox->Enable(sal_False); - aFilePB.Enable(sal_False); - aFileNameED.Enable(sal_False); - aFileNameFT.Enable(sal_False); - aSubRegionED.Enable(sal_False); - aSubRegionFT.Enable(sal_False); - aDDECB.Check(sal_False); - aDDECB.Enable(sal_False); - aDDECommandFT.Enable(sal_False); - } - return 0; -} - -/*--------------------------------------------------------------------- - Description: call dialog paste file ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, FileSearchHdl, PushButton *, EMPTYARG ) -{ - if(!CheckPasswd(0)) - return 0; - - m_pOldDefDlgParent = Application::GetDefDialogParent(); - Application::SetDefDialogParent( this ); - if ( m_pDocInserter ) - delete m_pDocInserter; - m_pDocInserter = new ::sfx2::DocumentInserter( 0, String::CreateFromAscii("swriter") ); - m_pDocInserter->StartExecuteModal( LINK( this, SwEditRegionDlg, DlgClosedHdl ) ); - return 0; -} - -IMPL_LINK( SwEditRegionDlg, OptionsHdl, PushButton *, EMPTYARG ) -{ - if(!CheckPasswd()) - return 0; - SvLBoxEntry* pEntry = aTree.FirstSelected(); - - if(pEntry) - { - SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); - SfxItemSet aSet(rSh.GetView().GetPool(), - RES_COL, RES_COL, - RES_COLUMNBALANCE, RES_FRAMEDIR, - RES_BACKGROUND, RES_BACKGROUND, - RES_FRM_SIZE, RES_FRM_SIZE, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - RES_LR_SPACE, RES_LR_SPACE, - RES_FTN_AT_TXTEND, RES_END_AT_TXTEND, - 0); - - aSet.Put( pSectRepr->GetCol() ); - aSet.Put( pSectRepr->GetBackground() ); - aSet.Put( pSectRepr->GetFtnNtAtEnd() ); - aSet.Put( pSectRepr->GetEndNtAtEnd() ); - aSet.Put( pSectRepr->GetBalance() ); - aSet.Put( pSectRepr->GetFrmDir() ); - aSet.Put( pSectRepr->GetLRSpace() ); - - const SwSectionFmts& rDocFmts = rSh.GetDoc()->GetSections(); - SwSectionFmts aOrigArray( 0, 5 ); - aOrigArray.Insert( &rDocFmts, 0 ); - - SwSectionFmt* pFmt = aOrigArray[pSectRepr->GetArrPos()]; - long nWidth = rSh.GetSectionWidth(*pFmt); - aOrigArray.Remove( 0, aOrigArray.Count() ); - if (!nWidth) - nWidth = USHRT_MAX; - - aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); - aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); - - SwSectionPropertyTabDialog aTabDlg(this, aSet, rSh); - if(RET_OK == aTabDlg.Execute()) - { - const SfxItemSet* pOutSet = aTabDlg.GetOutputItemSet(); - if( pOutSet && pOutSet->Count() ) - { - const SfxPoolItem *pColItem, *pBrushItem, - *pFtnItem, *pEndItem, *pBalanceItem, - *pFrmDirItem, *pLRSpaceItem; - SfxItemState eColState = pOutSet->GetItemState( - RES_COL, sal_False, &pColItem ); - SfxItemState eBrushState = pOutSet->GetItemState( - RES_BACKGROUND, sal_False, &pBrushItem ); - SfxItemState eFtnState = pOutSet->GetItemState( - RES_FTN_AT_TXTEND, sal_False, &pFtnItem ); - SfxItemState eEndState = pOutSet->GetItemState( - RES_END_AT_TXTEND, sal_False, &pEndItem ); - SfxItemState eBalanceState = pOutSet->GetItemState( - RES_COLUMNBALANCE, sal_False, &pBalanceItem ); - SfxItemState eFrmDirState = pOutSet->GetItemState( - RES_FRAMEDIR, sal_False, &pFrmDirItem ); - SfxItemState eLRState = pOutSet->GetItemState( - RES_LR_SPACE, sal_False, &pLRSpaceItem); - - if( SFX_ITEM_SET == eColState || - SFX_ITEM_SET == eBrushState || - SFX_ITEM_SET == eFtnState || - SFX_ITEM_SET == eEndState || - SFX_ITEM_SET == eBalanceState|| - SFX_ITEM_SET == eFrmDirState|| - SFX_ITEM_SET == eLRState) - { - SvLBoxEntry* pSelEntry = aTree.FirstSelected(); - while( pSelEntry ) - { - SectReprPtr pRepr = (SectReprPtr)pSelEntry->GetUserData(); - if( SFX_ITEM_SET == eColState ) - pRepr->GetCol() = *(SwFmtCol*)pColItem; - if( SFX_ITEM_SET == eBrushState ) - pRepr->GetBackground() = *(SvxBrushItem*)pBrushItem; - if( SFX_ITEM_SET == eFtnState ) - pRepr->GetFtnNtAtEnd() = *(SwFmtFtnAtTxtEnd*)pFtnItem; - if( SFX_ITEM_SET == eEndState ) - pRepr->GetEndNtAtEnd() = *(SwFmtEndAtTxtEnd*)pEndItem; - if( SFX_ITEM_SET == eBalanceState ) - pRepr->GetBalance().SetValue(((SwFmtNoBalancedColumns*)pBalanceItem)->GetValue()); - if( SFX_ITEM_SET == eFrmDirState ) - pRepr->GetFrmDir().SetValue(((SvxFrameDirectionItem*)pFrmDirItem)->GetValue()); - if( SFX_ITEM_SET == eLRState ) - pRepr->GetLRSpace() = *(SvxLRSpaceItem*)pLRSpaceItem; - - pSelEntry = aTree.NextSelected(pSelEntry); - } - } - } - } - } - - return 0; -} - -/*--------------------------------------------------------------------- - Description: Applying of the filename or the - linked region ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit ) -{ - Selection aSelect = pEdit->GetSelection(); - if(!CheckPasswd()) - return 0; - pEdit->SetSelection(aSelect); - SvLBoxEntry* pEntry=aTree.FirstSelected(); - OSL_ENSURE(pEntry,"no entry found"); - SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); - if(pEdit == &aFileNameED) - { - bSubRegionsFilled = false; - aSubRegionED.Clear(); - if( aDDECB.IsChecked() ) - { - String sLink( pEdit->GetText() ); - sal_uInt16 nPos = 0; - while( STRING_NOTFOUND != (nPos = sLink.SearchAscii( " ", nPos )) ) - sLink.Erase( nPos--, 1 ); - - nPos = sLink.SearchAndReplace( ' ', sfx2::cTokenSeperator ); - sLink.SearchAndReplace( ' ', sfx2::cTokenSeperator, nPos ); - - pSectRepr->GetSectionData().SetLinkFileName( sLink ); - pSectRepr->GetSectionData().SetType( DDE_LINK_SECTION ); - } - else - { - String sTmp(pEdit->GetText()); - if(sTmp.Len()) - { - SfxMedium* pMedium = rSh.GetView().GetDocShell()->GetMedium(); - INetURLObject aAbs; - if( pMedium ) - aAbs = pMedium->GetURLObject(); - sTmp = URIHelper::SmartRel2Abs( - aAbs, sTmp, URIHelper::GetMaybeFileHdl() ); - } - pSectRepr->SetFile( sTmp ); - pSectRepr->GetSectionData().SetLinkFilePassword( aEmptyStr ); - } - } - else - { - pSectRepr->SetSubRegion( pEdit->GetText() ); - } - return 0; -} - -IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox ) -{ - if(!CheckPasswd(pBox)) - return 0; - SvLBoxEntry* pEntry=aTree.FirstSelected(); - if(pEntry) - { - sal_Bool bFile = aFileCB.IsChecked(); - SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); - SwSectionData & rData( pSectRepr->GetSectionData() ); - sal_Bool bDDE = pBox->IsChecked(); - if(bDDE) - { - aFileNameFT.Hide(); - aDDECommandFT.Enable(); - aDDECommandFT.Show(); - aSubRegionFT.Hide(); - aSubRegionED.Hide(); - if (FILE_LINK_SECTION == rData.GetType()) - { - pSectRepr->SetFile(aEmptyStr); - aFileNameED.SetText(aEmptyStr); - rData.SetLinkFilePassword( aEmptyStr ); - } - rData.SetType(DDE_LINK_SECTION); - aFileNameED.SetAccessibleName(aDDECommandFT.GetText()); - } - else - { - aDDECommandFT.Hide(); - aFileNameFT.Enable(bFile); - aFileNameFT.Show(); - aSubRegionED.Show(); - aSubRegionFT.Show(); - aSubRegionED.Enable(bFile); - aSubRegionFT.Enable(bFile); - aSubRegionED.Enable(bFile); - if (DDE_LINK_SECTION == rData.GetType()) - { - rData.SetType(FILE_LINK_SECTION); - pSectRepr->SetFile(aEmptyStr); - rData.SetLinkFilePassword( aEmptyStr ); - aFileNameED.SetText(aEmptyStr); - } - aFileNameED.SetAccessibleName(aFileNameFT.GetText()); - } - aFilePB.Enable(bFile && !bDDE); - } - return 0; -} - -IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox ) -{ - sal_Bool bChange = pBox == &aPasswdPB; - if(!CheckPasswd(0)) - { - if(!bChange) - aPasswdCB.Check(!aPasswdCB.IsChecked()); - return 0; - } - SvLBoxEntry* pEntry=aTree.FirstSelected(); - sal_Bool bSet = bChange ? bChange : aPasswdCB.IsChecked(); - OSL_ENSURE(pEntry,"no entry found"); - while( pEntry ) - { - SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData(); - if(bSet) - { - if(!pRepr->GetTempPasswd().getLength() || bChange) - { - SwTestPasswdDlg aPasswdDlg(this); - aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM); - if(RET_OK == aPasswdDlg.Execute()) - { - String sNewPasswd( aPasswdDlg.GetPassword() ); - if( aPasswdDlg.GetConfirm() == sNewPasswd ) - { - SvPasswordHelper::GetHashPassword( pRepr->GetTempPasswd(), sNewPasswd ); - } - else - { - InfoBox(pBox, SW_RES(REG_WRONG_PASSWD_REPEAT)).Execute(); - ChangePasswdHdl(pBox); - break; - } - } - else - { - if(!bChange) - aPasswdCB.Check(sal_False); - break; - } - } - pRepr->GetSectionData().SetPassword(pRepr->GetTempPasswd()); - } - else - { - pRepr->GetSectionData().SetPassword(uno::Sequence<sal_Int8 >()); - } - pEntry = aTree.NextSelected(pEntry); - } - return 0; -} - -/*--------------------------------------------------------------------- - Description: the current region name is being added to the - TreeListBox immediately during editing, with empty - string no Ok() ----------------------------------------------------------------------*/ -IMPL_LINK( SwEditRegionDlg, NameEditHdl, Edit *, EMPTYARG ) -{ - if(!CheckPasswd(0)) - return 0; - SvLBoxEntry* pEntry=aTree.FirstSelected(); - OSL_ENSURE(pEntry,"no entry found"); - if (pEntry) - { - String aName = aCurName.GetText(); - aTree.SetEntryText(pEntry,aName); - SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData(); - pRepr->GetSectionData().SetSectionName(aName); - - aOK.Enable(aName.Len() != 0); - } - return 0; -} - -IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit ) -{ - Selection aSelect = pEdit->GetSelection(); - if(!CheckPasswd(0)) - return 0; - pEdit->SetSelection(aSelect); - SvLBoxEntry* pEntry = aTree.FirstSelected(); - OSL_ENSURE(pEntry,"no entry found"); - while( pEntry ) - { - SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData(); - pRepr->GetSectionData().SetCondition(pEdit->GetText()); - pEntry = aTree.NextSelected(pEntry); - } - return 0; -} - -IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) -{ - String sFileName, sFilterName, sPassword; - if ( _pFileDlg->GetError() == ERRCODE_NONE ) - { - SfxMedium* pMedium = m_pDocInserter->CreateMedium(); - if ( pMedium ) - { - sFileName = pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); - sFilterName = pMedium->GetFilter()->GetFilterName(); - const SfxPoolItem* pItem; - if ( SFX_ITEM_SET == pMedium->GetItemSet()->GetItemState( SID_PASSWORD, sal_False, &pItem ) ) - sPassword = ( (SfxStringItem*)pItem )->GetValue(); - ::lcl_ReadSections( *pMedium, aSubRegionED ); - delete pMedium; - } - } - - SvLBoxEntry* pEntry = aTree.FirstSelected(); - OSL_ENSURE( pEntry, "no entry found" ); - if ( pEntry ) - { - SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); - pSectRepr->SetFile( sFileName ); - pSectRepr->SetFilter( sFilterName ); - pSectRepr->GetSectionData().SetLinkFilePassword(sPassword); - aFileNameED.SetText( pSectRepr->GetFile() ); - } - - Application::SetDefDialogParent( m_pOldDefDlgParent ); - return 0; -} - -IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent *, pEvent ) -{ - if( !bSubRegionsFilled && pEvent && pEvent->GetId() == VCLEVENT_DROPDOWN_PRE_OPEN ) - { - //if necessary fill the names bookmarks/sections/tables now - - rtl::OUString sFileName = aFileNameED.GetText(); - if(sFileName.getLength()) - { - SfxMedium* pMedium = rSh.GetView().GetDocShell()->GetMedium(); - INetURLObject aAbs; - if( pMedium ) - aAbs = pMedium->GetURLObject(); - sFileName = URIHelper::SmartRel2Abs( - aAbs, sFileName, URIHelper::GetMaybeFileHdl() ); - - //load file and set the shell - SfxMedium aMedium( sFileName, STREAM_STD_READ ); - sFileName = aMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); - ::lcl_ReadSections( aMedium, aSubRegionED ); - } - else - lcl_FillSubRegionList( rSh, aSubRegionED, 0 ); - bSubRegionsFilled = true; - } - return 0; -} - -Image SwEditRegionDlg::BuildBitmap( sal_Bool bProtect, sal_Bool bHidden ) -{ - ImageList& rImgLst = aImageIL; - return rImgLst.GetImage((!bHidden+(bProtect<<1)) + 1); -} - -/*-------------------------------------------------------------------- - Description: helper function - read region names from medium - --------------------------------------------------------------------*/ -static void lcl_ReadSections( SfxMedium& rMedium, ComboBox& rBox ) -{ - rBox.Clear(); - uno::Reference < embed::XStorage > xStg; - if( rMedium.IsStorage() && (xStg = rMedium.GetStorage()).is() ) - { - SvStrings aArr( 10, 10 ); - sal_uInt32 nFormat = SotStorage::GetFormatID( xStg ); - if ( nFormat == SOT_FORMATSTR_ID_STARWRITER_60 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_60 || - nFormat == SOT_FORMATSTR_ID_STARWRITER_8 || nFormat == SOT_FORMATSTR_ID_STARWRITERGLOB_8) - SwGetReaderXML()->GetSectionList( rMedium, aArr ); - - for( sal_uInt16 n = 0; n < aArr.Count(); ++n ) - rBox.InsertEntry( *aArr[ n ] ); - - aArr.DeleteAndDestroy(0, aArr.Count()); - } -} - -SwInsertSectionTabDialog::SwInsertSectionTabDialog( - Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) : - SfxTabDialog( pParent, SW_RES(DLG_INSERT_SECTION), &rSet ), - rWrtSh(rSh) - , m_pSectionData(0) -{ - String sInsert(SW_RES(ST_INSERT)); - GetOKButton().SetText(sInsert); - FreeResource(); - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AddTabPage(TP_INSERT_SECTION, SwInsertSectionTabPage::Create, 0); - AddTabPage(TP_COLUMN, SwColumnPage::Create, 0); - AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0); - AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0); - AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0); - - SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get(); - long nHtmlMode = rHtmlOpt.GetExportMode(); - - sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() ); - if(bWeb) - { - RemoveTabPage(TP_SECTION_FTNENDNOTES); - RemoveTabPage(TP_SECTION_INDENTS); - if( HTML_CFG_NS40 != nHtmlMode && HTML_CFG_WRITER != nHtmlMode) - RemoveTabPage(TP_COLUMN); - } - SetCurPageId(TP_INSERT_SECTION); -} - -SwInsertSectionTabDialog::~SwInsertSectionTabDialog() -{ -} - -void SwInsertSectionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) -{ - if(TP_INSERT_SECTION == nId) - ((SwInsertSectionTabPage&)rPage).SetWrtShell(rWrtSh); - else if( TP_BACKGROUND == nId ) - { - SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_SHOW_SELECTOR)); - rPage.PageCreated(aSet); - } - else if( TP_COLUMN == nId ) - { - const SwFmtFrmSize& rSize = (const SwFmtFrmSize&)GetInputSetImpl()->Get(RES_FRM_SIZE); - ((SwColumnPage&)rPage).SetPageWidth(rSize.GetWidth()); - ((SwColumnPage&)rPage).ShowBalance(sal_True); - ((SwColumnPage&)rPage).SetInSection(sal_True); - } - else if(TP_SECTION_INDENTS == nId) - ((SwSectionIndentTabPage&)rPage).SetWrtShell(rWrtSh); -} - -void SwInsertSectionTabDialog::SetSectionData(SwSectionData const& rSect) -{ - m_pSectionData.reset( new SwSectionData(rSect) ); -} - -short SwInsertSectionTabDialog::Ok() -{ - short nRet = SfxTabDialog::Ok(); - OSL_ENSURE(m_pSectionData.get(), - "SwInsertSectionTabDialog: no SectionData?"); - const SfxItemSet* pOutputItemSet = GetOutputItemSet(); - rWrtSh.InsertSection(*m_pSectionData, pOutputItemSet); - SfxViewFrame* pViewFrm = rWrtSh.GetView().GetViewFrame(); - uno::Reference< frame::XDispatchRecorder > xRecorder = - pViewFrm->GetBindings().GetRecorder(); - if ( xRecorder.is() ) - { - SfxRequest aRequest( pViewFrm, FN_INSERT_REGION); - const SfxPoolItem* pCol; - if(SFX_ITEM_SET == pOutputItemSet->GetItemState(RES_COL, sal_False, &pCol)) - { - aRequest.AppendItem(SfxUInt16Item(SID_ATTR_COLUMNS, - ((const SwFmtCol*)pCol)->GetColumns().Count())); - } - aRequest.AppendItem(SfxStringItem( FN_PARAM_REGION_NAME, - m_pSectionData->GetSectionName())); - aRequest.AppendItem(SfxStringItem( FN_PARAM_REGION_CONDITION, - m_pSectionData->GetCondition())); - aRequest.AppendItem(SfxBoolItem( FN_PARAM_REGION_HIDDEN, - m_pSectionData->IsHidden())); - aRequest.AppendItem(SfxBoolItem( FN_PARAM_REGION_PROTECT, - m_pSectionData->IsProtectFlag())); - // edit in readonly sections - aRequest.AppendItem(SfxBoolItem( FN_PARAM_REGION_EDIT_IN_READONLY, - m_pSectionData->IsEditInReadonlyFlag())); - - String sLinkFileName( m_pSectionData->GetLinkFileName() ); - aRequest.AppendItem(SfxStringItem( FN_PARAM_1, sLinkFileName.GetToken( 0, sfx2::cTokenSeperator ))); - aRequest.AppendItem(SfxStringItem( FN_PARAM_2, sLinkFileName.GetToken( 1, sfx2::cTokenSeperator ))); - aRequest.AppendItem(SfxStringItem( FN_PARAM_3, sLinkFileName.GetToken( 2, sfx2::cTokenSeperator ))); - aRequest.Done(); - } - return nRet; -} - -SwInsertSectionTabPage::SwInsertSectionTabPage( - Window *pParent, const SfxItemSet &rAttrSet) : - SfxTabPage( pParent, SW_RES(TP_INSERT_SECTION), rAttrSet ), - aNameFL ( this, SW_RES( FL_NAME ) ), - aCurName ( this, SW_RES( ED_RNAME ) ), - aLinkFL ( this, SW_RES( FL_LINK ) ), - aFileCB ( this, SW_RES( CB_FILE ) ), - aDDECB ( this, SW_RES( CB_DDE ) ) , - aDDECommandFT ( this, SW_RES( FT_DDE ) ) , - aFileNameFT ( this, SW_RES( FT_FILE ) ) , - aFileNameED ( this, SW_RES( ED_FILE ) ), - aFilePB ( this, SW_RES( PB_FILE ) ), - aSubRegionFT ( this, SW_RES( FT_SUBREG ) ) , - aSubRegionED ( this, SW_RES( LB_SUBREG ) ) , - - aProtectFL ( this, SW_RES( FL_PROTECT ) ), - aProtectCB ( this, SW_RES( CB_PROTECT ) ), - aPasswdCB ( this, SW_RES( CB_PASSWD ) ), - aPasswdPB ( this, SW_RES( PB_PASSWD ) ), - - aHideFL ( this, SW_RES( FL_HIDE ) ), - aHideCB ( this, SW_RES( CB_HIDE ) ), - aConditionFT ( this, SW_RES( FT_CONDITION ) ), - aConditionED ( this, SW_RES( ED_CONDITION ) ), - // edit in readonly sections - aPropertiesFL ( this, SW_RES( FL_PROPERTIES ) ), - aEditInReadonlyCB ( this, SW_RES( CB_EDIT_IN_READONLY ) ), - - m_pWrtSh(0), - m_pDocInserter(NULL), - m_pOldDefDlgParent(NULL) -{ - FreeResource(); - - aProtectCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeProtectHdl)); - aPasswdCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl)); - aPasswdPB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl)); - aHideCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeHideHdl)); - // edit in readonly sections - aEditInReadonlyCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeEditInReadonlyHdl)); - aFileCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, UseFileHdl )); - aFilePB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, FileSearchHdl )); - aCurName.SetModifyHdl ( LINK( this, SwInsertSectionTabPage, NameEditHdl)); - aDDECB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, DDEHdl )); - ChangeProtectHdl(&aProtectCB); - aPasswdPB.SetAccessibleRelationMemberOf(&aProtectFL); - aSubRegionED.EnableAutocomplete( sal_True, sal_True ); -} - -SwInsertSectionTabPage::~SwInsertSectionTabPage() -{ - delete m_pDocInserter; -} - -void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh) -{ - m_pWrtSh = &rSh; - - sal_Bool bWeb = 0 != PTR_CAST(SwWebDocShell, m_pWrtSh->GetView().GetDocShell()); - if(bWeb) - { - aHideCB .Hide(); - aConditionED .Hide(); - aConditionFT .Hide(); - aDDECB .Hide(); - aDDECommandFT .Hide(); - } - - lcl_FillSubRegionList( *m_pWrtSh, aSubRegionED, &aCurName ); - - SwSectionData *const pSectionData = - static_cast<SwInsertSectionTabDialog*>(GetTabDialog()) - ->GetSectionData(); - if (pSectionData) // something set? - { - aCurName.SetText( - rSh.GetUniqueSectionName(& pSectionData->GetSectionName())); - aProtectCB.Check( 0 != pSectionData->IsProtectFlag() ); - m_sFileName = pSectionData->GetLinkFileName(); - m_sFilePasswd = pSectionData->GetLinkFilePassword(); - aFileCB.Check( 0 != m_sFileName.Len() ); - aFileNameED.SetText( m_sFileName ); - UseFileHdl( &aFileCB ); - } - else - { - aCurName.SetText( rSh.GetUniqueSectionName() ); - } -} - -sal_Bool SwInsertSectionTabPage::FillItemSet( SfxItemSet& ) -{ - SwSectionData aSection(CONTENT_SECTION, aCurName.GetText()); - aSection.SetCondition(aConditionED.GetText()); - sal_Bool bProtected = aProtectCB.IsChecked(); - aSection.SetProtectFlag(bProtected); - aSection.SetHidden(aHideCB.IsChecked()); - // edit in readonly sections - aSection.SetEditInReadonlyFlag(aEditInReadonlyCB.IsChecked()); - - if(bProtected) - { - aSection.SetPassword(m_aNewPasswd); - } - String sFileName = aFileNameED.GetText(); - String sSubRegion = aSubRegionED.GetText(); - sal_Bool bDDe = aDDECB.IsChecked(); - if(aFileCB.IsChecked() && (sFileName.Len() || sSubRegion.Len() || bDDe)) - { - String aLinkFile; - if( bDDe ) - { - aLinkFile = sFileName; - - sal_uInt16 nPos = 0; - while( STRING_NOTFOUND != (nPos = aLinkFile.SearchAscii( " ", nPos )) ) - aLinkFile.Erase( nPos--, 1 ); - - nPos = aLinkFile.SearchAndReplace( ' ', sfx2::cTokenSeperator ); - aLinkFile.SearchAndReplace( ' ', sfx2::cTokenSeperator, nPos ); - } - else - { - if(sFileName.Len()) - { - SfxMedium* pMedium = m_pWrtSh->GetView().GetDocShell()->GetMedium(); - INetURLObject aAbs; - if( pMedium ) - aAbs = pMedium->GetURLObject(); - aLinkFile = URIHelper::SmartRel2Abs( - aAbs, sFileName, URIHelper::GetMaybeFileHdl() ); - aSection.SetLinkFilePassword( m_sFilePasswd ); - } - - aLinkFile += sfx2::cTokenSeperator; - aLinkFile += m_sFilterName; - aLinkFile += sfx2::cTokenSeperator; - aLinkFile += sSubRegion; - } - - aSection.SetLinkFileName(aLinkFile); - if(aLinkFile.Len()) - { - aSection.SetType( aDDECB.IsChecked() ? - DDE_LINK_SECTION : - FILE_LINK_SECTION); - } - } - ((SwInsertSectionTabDialog*)GetTabDialog())->SetSectionData(aSection); - return sal_True; -} - -void SwInsertSectionTabPage::Reset( const SfxItemSet& ) -{ -} - -SfxTabPage* SwInsertSectionTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new SwInsertSectionTabPage(pParent, rAttrSet); -} - -IMPL_LINK( SwInsertSectionTabPage, ChangeHideHdl, CheckBox *, pBox ) -{ - sal_Bool bHide = pBox->IsChecked(); - aConditionED.Enable(bHide); - aConditionFT.Enable(bHide); - return 0; -} - -IMPL_LINK( SwInsertSectionTabPage, ChangeEditInReadonlyHdl, CheckBox *, EMPTYARG ) -{ - return 0; -} - -IMPL_LINK( SwInsertSectionTabPage, ChangeProtectHdl, CheckBox *, pBox ) -{ - sal_Bool bCheck = pBox->IsChecked(); - aPasswdCB.Enable(bCheck); - aPasswdPB.Enable(bCheck); - return 0; -} - -IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton ) -{ - sal_Bool bChange = pButton == &aPasswdPB; - sal_Bool bSet = bChange ? bChange : aPasswdCB.IsChecked(); - if(bSet) - { - if(!m_aNewPasswd.getLength() || bChange) - { - SwTestPasswdDlg aPasswdDlg(this); - aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM); - if(RET_OK == aPasswdDlg.Execute()) - { - String sNewPasswd( aPasswdDlg.GetPassword() ); - if( aPasswdDlg.GetConfirm() == sNewPasswd ) - { - SvPasswordHelper::GetHashPassword( m_aNewPasswd, sNewPasswd ); - } - else - { - InfoBox(pButton, SW_RES(REG_WRONG_PASSWD_REPEAT)).Execute(); - } - } - else if(!bChange) - aPasswdCB.Check(sal_False); - } - } - else - m_aNewPasswd.realloc(0); - return 0; -} - -IMPL_LINK_INLINE_START( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG ) -{ - String aName=aCurName.GetText(); - GetTabDialog()->GetOKButton().Enable(aName.Len() && aCurName.GetEntryPos( aName ) == USHRT_MAX); - return 0; -} -IMPL_LINK_INLINE_END( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG ) - -IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, CheckBox *, pBox ) -{ - if( pBox->IsChecked() ) - { - if( m_pWrtSh->HasSelection() && - RET_NO == QueryBox( this, SW_RES(QB_CONNECT) ).Execute() ) - pBox->Check( sal_False ); - } - - sal_Bool bFile = pBox->IsChecked(); - aFileNameFT.Enable(bFile); - aFileNameED.Enable(bFile); - aFilePB.Enable(bFile); - aSubRegionFT.Enable(bFile); - aSubRegionED.Enable(bFile); - aDDECommandFT.Enable(bFile); - aDDECB.Enable(bFile); - if( bFile ) - { - aFileNameED.GrabFocus(); - aProtectCB.Check( sal_True ); - } - else - { - aDDECB.Check(sal_False); - DDEHdl(&aDDECB); - } - return 0; -} - -IMPL_LINK( SwInsertSectionTabPage, FileSearchHdl, PushButton *, EMPTYARG ) -{ - m_pOldDefDlgParent = Application::GetDefDialogParent(); - Application::SetDefDialogParent( this ); - if ( m_pDocInserter ) - delete m_pDocInserter; - m_pDocInserter = new ::sfx2::DocumentInserter( 0, String::CreateFromAscii("swriter") ); - m_pDocInserter->StartExecuteModal( LINK( this, SwInsertSectionTabPage, DlgClosedHdl ) ); - return 0; -} - -IMPL_LINK( SwInsertSectionTabPage, DDEHdl, CheckBox*, pBox ) -{ - sal_Bool bDDE = pBox->IsChecked(); - sal_Bool bFile = aFileCB.IsChecked(); - aFilePB.Enable(!bDDE && bFile); - if(bDDE) - { - aFileNameFT.Hide(); - aDDECommandFT.Enable(bDDE); - aDDECommandFT.Show(); - aSubRegionFT.Hide(); - aSubRegionED.Hide(); - aFileNameED.SetAccessibleName(aDDECommandFT.GetText()); - } - else - { - aDDECommandFT.Hide(); - aFileNameFT.Enable(bFile); - aFileNameFT.Show(); - aSubRegionFT.Show(); - aSubRegionED.Show(); - aSubRegionED.Enable(bFile); - aFileNameED.SetAccessibleName(aFileNameFT.GetText()); - } - return 0; -} - -IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) -{ - if ( _pFileDlg->GetError() == ERRCODE_NONE ) - { - SfxMedium* pMedium = m_pDocInserter->CreateMedium(); - if ( pMedium ) - { - m_sFileName = pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); - m_sFilterName = pMedium->GetFilter()->GetFilterName(); - const SfxPoolItem* pItem; - if ( SFX_ITEM_SET == pMedium->GetItemSet()->GetItemState( SID_PASSWORD, sal_False, &pItem ) ) - m_sFilePasswd = ( (SfxStringItem*)pItem )->GetValue(); - aFileNameED.SetText( INetURLObject::decode( - m_sFileName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_UTF8 ) ); - ::lcl_ReadSections( *pMedium, aSubRegionED ); - delete pMedium; - } - } - else - m_sFilterName = m_sFilePasswd = aEmptyStr; - - Application::SetDefDialogParent( m_pOldDefDlgParent ); - return 0; -} - -// -------------------------------------------------------------- - -// numbering format conversion: -// ListBox - format - enum-value -// 0 - A, B, C, ... - 0 -// 1 - a, b, c, ... - 1 -// 2 - I, II, III, ... - 2 -// 3 - i, ii, iii, ... - 3 -// 4 - 1, 2, 3, ... - 4 -// 5 - A, .., AA, .., - 9 -// 6 - a, .., aa, .., - 10 - -inline sal_uInt16 GetNumPos( sal_uInt16 n ) -{ - return SVX_NUM_ARABIC < n ? n - 4 : n; -} - -inline SvxExtNumType GetNumType( sal_uInt16 n ) -{ - return (SvxExtNumType)(4 < n ? n + 4 : n ); -} - -SwSectionFtnEndTabPage::SwSectionFtnEndTabPage( Window *pParent, - const SfxItemSet &rAttrSet) - : SfxTabPage( pParent, SW_RES( TP_SECTION_FTNENDNOTES ), rAttrSet ), - aFtnFL ( this, SW_RES( FL_FTN ) ), - aFtnNtAtTextEndCB ( this, SW_RES( CB_FTN_AT_TXTEND ) ), - - aFtnNtNumCB ( this, SW_RES( CB_FTN_NUM ) ), - aFtnOffsetLbl ( this, SW_RES( FT_FTN_OFFSET )), - aFtnOffsetFld ( this, SW_RES( FLD_FTN_OFFSET )), - - aFtnNtNumFmtCB ( this, SW_RES( CB_FTN_NUM_FMT ) ), - aFtnPrefixFT ( this, SW_RES( FT_FTN_PREFIX )), - aFtnPrefixED ( this, SW_RES( ED_FTN_PREFIX )), - aFtnNumViewBox ( this, SW_RES( LB_FTN_NUMVIEW ), INSERT_NUM_EXTENDED_TYPES), - aFtnSuffixFT ( this, SW_RES( FT_FTN_SUFFIX )), - aFtnSuffixED ( this, SW_RES( ED_FTN_SUFFIX )), - - aEndFL ( this, SW_RES( FL_END ) ), - aEndNtAtTextEndCB ( this, SW_RES( CB_END_AT_TXTEND )), - - aEndNtNumCB ( this, SW_RES( CB_END_NUM )), - aEndOffsetLbl ( this, SW_RES( FT_END_OFFSET )), - aEndOffsetFld ( this, SW_RES( FLD_END_OFFSET )), - - aEndNtNumFmtCB ( this, SW_RES( CB_END_NUM_FMT ) ), - aEndPrefixFT ( this, SW_RES( FT_END_PREFIX )), - aEndPrefixED ( this, SW_RES( ED_END_PREFIX )), - aEndNumViewBox ( this, SW_RES( LB_END_NUMVIEW ), INSERT_NUM_EXTENDED_TYPES), - aEndSuffixFT ( this, SW_RES( FT_END_SUFFIX )), - aEndSuffixED ( this, SW_RES( ED_END_SUFFIX )) -{ - FreeResource(); - - Link aLk( LINK( this, SwSectionFtnEndTabPage, FootEndHdl)); - aFtnNtAtTextEndCB.SetClickHdl( aLk ); - aFtnNtNumCB.SetClickHdl( aLk ); - aEndNtAtTextEndCB.SetClickHdl( aLk ); - aEndNtNumCB.SetClickHdl( aLk ); - aFtnNtNumFmtCB.SetClickHdl( aLk ); - aEndNtNumFmtCB.SetClickHdl( aLk ); -} - -SwSectionFtnEndTabPage::~SwSectionFtnEndTabPage() -{ -} - -sal_Bool SwSectionFtnEndTabPage::FillItemSet( SfxItemSet& rSet ) -{ - SwFmtFtnAtTxtEnd aFtn( aFtnNtAtTextEndCB.IsChecked() - ? ( aFtnNtNumCB.IsChecked() - ? ( aFtnNtNumFmtCB.IsChecked() - ? FTNEND_ATTXTEND_OWNNUMANDFMT - : FTNEND_ATTXTEND_OWNNUMSEQ ) - : FTNEND_ATTXTEND ) - : FTNEND_ATPGORDOCEND ); - - switch( aFtn.GetValue() ) - { - case FTNEND_ATTXTEND_OWNNUMANDFMT: - aFtn.SetNumType( aFtnNumViewBox.GetSelectedNumberingType() ); - aFtn.SetPrefix( aFtnPrefixED.GetText() ); - aFtn.SetSuffix( aFtnSuffixED.GetText() ); - // no break; - - case FTNEND_ATTXTEND_OWNNUMSEQ: - aFtn.SetOffset( static_cast< sal_uInt16 >( aFtnOffsetFld.GetValue()-1 ) ); - // no break; - } - - SwFmtEndAtTxtEnd aEnd( aEndNtAtTextEndCB.IsChecked() - ? ( aEndNtNumCB.IsChecked() - ? ( aEndNtNumFmtCB.IsChecked() - ? FTNEND_ATTXTEND_OWNNUMANDFMT - : FTNEND_ATTXTEND_OWNNUMSEQ ) - : FTNEND_ATTXTEND ) - : FTNEND_ATPGORDOCEND ); - - switch( aEnd.GetValue() ) - { - case FTNEND_ATTXTEND_OWNNUMANDFMT: - aEnd.SetNumType( aEndNumViewBox.GetSelectedNumberingType() ); - aEnd.SetPrefix( aEndPrefixED.GetText() ); - aEnd.SetSuffix( aEndSuffixED.GetText() ); - // no break; - - case FTNEND_ATTXTEND_OWNNUMSEQ: - aEnd.SetOffset( static_cast< sal_uInt16 >( aEndOffsetFld.GetValue()-1 ) ); - // no break; - } - - rSet.Put( aFtn ); - rSet.Put( aEnd ); - - return sal_True; -} - -void SwSectionFtnEndTabPage::ResetState( sal_Bool bFtn, - const SwFmtFtnEndAtTxtEnd& rAttr ) -{ - CheckBox *pNtAtTextEndCB, *pNtNumCB, *pNtNumFmtCB; - FixedText*pPrefixFT, *pSuffixFT; - Edit *pPrefixED, *pSuffixED; - SwNumberingTypeListBox *pNumViewBox; - FixedText* pOffsetTxt; - NumericField *pOffsetFld; - - if( bFtn ) - { - pNtAtTextEndCB = &aFtnNtAtTextEndCB; - pNtNumCB = &aFtnNtNumCB; - pNtNumFmtCB = &aFtnNtNumFmtCB; - pPrefixFT = &aFtnPrefixFT; - pPrefixED = &aFtnPrefixED; - pSuffixFT = &aFtnSuffixFT; - pSuffixED = &aFtnSuffixED; - pNumViewBox = &aFtnNumViewBox; - pOffsetTxt = &aFtnOffsetLbl; - pOffsetFld = &aFtnOffsetFld; - } - else - { - pNtAtTextEndCB = &aEndNtAtTextEndCB; - pNtNumCB = &aEndNtNumCB; - pNtNumFmtCB = &aEndNtNumFmtCB; - pPrefixFT = &aEndPrefixFT; - pPrefixED = &aEndPrefixED; - pSuffixFT = &aEndSuffixFT; - pSuffixED = &aEndSuffixED; - pNumViewBox = &aEndNumViewBox; - pOffsetTxt = &aEndOffsetLbl; - pOffsetFld = &aEndOffsetFld; - } - - sal_uInt16 eState = rAttr.GetValue(); - switch( eState ) - { - case FTNEND_ATTXTEND_OWNNUMANDFMT: - pNtNumFmtCB->SetState( STATE_CHECK ); - // no break; - - case FTNEND_ATTXTEND_OWNNUMSEQ: - pNtNumCB->SetState( STATE_CHECK ); - // no break; - - case FTNEND_ATTXTEND: - pNtAtTextEndCB->SetState( STATE_CHECK ); - // no break; - } - - pNumViewBox->SelectNumberingType( rAttr.GetNumType() ); - pOffsetFld->SetValue( rAttr.GetOffset() + 1 ); - pPrefixED->SetText( rAttr.GetPrefix() ); - pSuffixED->SetText( rAttr.GetSuffix() ); - - switch( eState ) - { - case FTNEND_ATPGORDOCEND: - pNtNumCB->Enable( sal_False ); - // no break; - - case FTNEND_ATTXTEND: - pNtNumFmtCB->Enable( sal_False ); - pOffsetFld->Enable( sal_False ); - pOffsetTxt->Enable( sal_False ); - // no break; - - case FTNEND_ATTXTEND_OWNNUMSEQ: - pNumViewBox->Enable( sal_False ); - pPrefixFT->Enable( sal_False ); - pPrefixED->Enable( sal_False ); - pSuffixFT->Enable( sal_False ); - pSuffixED->Enable( sal_False ); - // no break; - } -} - -void SwSectionFtnEndTabPage::Reset( const SfxItemSet& rSet ) -{ - ResetState( sal_True, (const SwFmtFtnAtTxtEnd&)rSet.Get( - RES_FTN_AT_TXTEND, sal_False )); - ResetState( sal_False, (const SwFmtEndAtTxtEnd&)rSet.Get( - RES_END_AT_TXTEND, sal_False )); -} - -SfxTabPage* SwSectionFtnEndTabPage::Create( Window* pParent, - const SfxItemSet& rAttrSet) -{ - return new SwSectionFtnEndTabPage(pParent, rAttrSet); -} - -IMPL_LINK( SwSectionFtnEndTabPage, FootEndHdl, CheckBox *, pBox ) -{ - sal_Bool bFoot = &aFtnNtAtTextEndCB == pBox || &aFtnNtNumCB == pBox || - &aFtnNtNumFmtCB == pBox ; - - CheckBox *pNumBox, *pNumFmtBox, *pEndBox; - SwNumberingTypeListBox* pNumViewBox; - FixedText* pOffsetTxt; - NumericField *pOffsetFld; - FixedText*pPrefixFT, *pSuffixFT; - Edit *pPrefixED, *pSuffixED; - - if( bFoot ) - { - pEndBox = &aFtnNtAtTextEndCB; - pNumBox = &aFtnNtNumCB; - pNumFmtBox = &aFtnNtNumFmtCB; - pNumViewBox = &aFtnNumViewBox; - pOffsetTxt = &aFtnOffsetLbl; - pOffsetFld = &aFtnOffsetFld; - pPrefixFT = &aFtnPrefixFT; - pSuffixFT = &aFtnSuffixFT; - pPrefixED = &aFtnPrefixED; - pSuffixED = &aFtnSuffixED; - } - else - { - pEndBox = &aEndNtAtTextEndCB; - pNumBox = &aEndNtNumCB; - pNumFmtBox = &aEndNtNumFmtCB; - pNumViewBox = &aEndNumViewBox; - pOffsetTxt = &aEndOffsetLbl; - pOffsetFld = &aEndOffsetFld; - pPrefixFT = &aEndPrefixFT; - pSuffixFT = &aEndSuffixFT; - pPrefixED = &aEndPrefixED; - pSuffixED = &aEndSuffixED; - } - - sal_Bool bEnableAtEnd = STATE_CHECK == pEndBox->GetState(); - sal_Bool bEnableNum = bEnableAtEnd && STATE_CHECK == pNumBox->GetState(); - sal_Bool bEnableNumFmt = bEnableNum && STATE_CHECK == pNumFmtBox->GetState(); - - pNumBox->Enable( bEnableAtEnd ); - pOffsetTxt->Enable( bEnableNum ); - pOffsetFld->Enable( bEnableNum ); - pNumFmtBox->Enable( bEnableNum ); - pNumViewBox->Enable( bEnableNumFmt ); - pPrefixED->Enable( bEnableNumFmt ); - pSuffixED->Enable( bEnableNumFmt ); - pPrefixFT->Enable( bEnableNumFmt ); - pSuffixFT->Enable( bEnableNumFmt ); - - return 0; -} - -SwSectionPropertyTabDialog::SwSectionPropertyTabDialog( - Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) : - SfxTabDialog(pParent, SW_RES(DLG_SECTION_PROPERTIES), &rSet), - rWrtSh(rSh) -{ - FreeResource(); - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AddTabPage(TP_COLUMN, SwColumnPage::Create, 0); - AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 ); - AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0); - AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0); - - SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get(); - long nHtmlMode = rHtmlOpt.GetExportMode(); - sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() ); - if(bWeb) - { - RemoveTabPage(TP_SECTION_FTNENDNOTES); - RemoveTabPage(TP_SECTION_INDENTS); - if( HTML_CFG_NS40 != nHtmlMode && HTML_CFG_WRITER != nHtmlMode) - RemoveTabPage(TP_COLUMN); - } -} - -SwSectionPropertyTabDialog::~SwSectionPropertyTabDialog() -{ -} - -void SwSectionPropertyTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) -{ - if( TP_BACKGROUND == nId ) - { - SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_SHOW_SELECTOR)); - rPage.PageCreated(aSet); - } - else if( TP_COLUMN == nId ) - { - ((SwColumnPage&)rPage).ShowBalance(sal_True); - ((SwColumnPage&)rPage).SetInSection(sal_True); - } - else if(TP_SECTION_INDENTS == nId) - ((SwSectionIndentTabPage&)rPage).SetWrtShell(rWrtSh); -} - -SwSectionIndentTabPage::SwSectionIndentTabPage( Window *pParent, const SfxItemSet &rAttrSet ) : - SfxTabPage(pParent, SW_RES(TP_SECTION_INDENTS), rAttrSet), - aIndentFL(this, SW_RES(FL_INDENT )), - aBeforeFT(this, SW_RES(FT_BEFORE )), - aBeforeMF(this, SW_RES(MF_BEFORE )), - aAfterFT(this, SW_RES(FT_AFTER )), - aAfterMF(this, SW_RES(MF_AFTER )), - aPreviewWin(this, SW_RES(WIN_PREVIEW )) -{ - FreeResource(); - Link aLk = LINK(this, SwSectionIndentTabPage, IndentModifyHdl); - aBeforeMF.SetModifyHdl(aLk); - aAfterMF.SetModifyHdl(aLk); - aPreviewWin.SetAccessibleName(aIndentFL.GetText()); -} - -SwSectionIndentTabPage::~SwSectionIndentTabPage() -{ -} - -sal_Bool SwSectionIndentTabPage::FillItemSet( SfxItemSet& rSet) -{ - if(aBeforeMF.IsValueModified() || - aAfterMF.IsValueModified()) - { - SvxLRSpaceItem aLRSpace( - static_cast< long >(aBeforeMF.Denormalize(aBeforeMF.GetValue(FUNIT_TWIP))) , - static_cast< long >(aAfterMF.Denormalize(aAfterMF.GetValue(FUNIT_TWIP))), 0, 0, RES_LR_SPACE); - rSet.Put(aLRSpace); - } - return sal_True; -} - -void SwSectionIndentTabPage::Reset( const SfxItemSet& rSet) -{ - //this page doesn't show up in HTML mode - FieldUnit aMetric = ::GetDfltMetric(sal_False); - SetMetric(aBeforeMF, aMetric); - SetMetric(aAfterMF , aMetric); - - SfxItemState eItemState = rSet.GetItemState( RES_LR_SPACE ); - if ( eItemState >= SFX_ITEM_AVAILABLE ) - { - const SvxLRSpaceItem& rSpace = - (const SvxLRSpaceItem&)rSet.Get( RES_LR_SPACE ); - - aBeforeMF.SetValue( aBeforeMF.Normalize(rSpace.GetLeft()), FUNIT_TWIP ); - aAfterMF.SetValue( aAfterMF.Normalize(rSpace.GetRight()), FUNIT_TWIP ); - } - else - { - aBeforeMF.SetEmptyFieldValue(); - aAfterMF.SetEmptyFieldValue(); - } - aBeforeMF.SaveValue(); - aAfterMF.SaveValue(); - IndentModifyHdl(0); -} - -SfxTabPage* SwSectionIndentTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet) -{ - return new SwSectionIndentTabPage(pParent, rAttrSet); -} - -void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh) -{ - //set sensible values at the preview - aPreviewWin.SetAdjust(SVX_ADJUST_BLOCK); - aPreviewWin.SetLastLine(SVX_ADJUST_BLOCK); - const SwRect& rPageRect = rSh.GetAnyCurRect( RECT_PAGE, 0 ); - Size aPageSize(rPageRect.Width(), rPageRect.Height()); - aPreviewWin.SetSize(aPageSize); -} - -IMPL_LINK(SwSectionIndentTabPage, IndentModifyHdl, MetricField*, EMPTYARG) -{ - aPreviewWin.SetLeftMargin( static_cast< long >(aBeforeMF.Denormalize(aBeforeMF.GetValue(FUNIT_TWIP))) ); - aPreviewWin.SetRightMargin( static_cast< long >(aAfterMF.Denormalize(aAfterMF.GetValue(FUNIT_TWIP))) ); - aPreviewWin.Draw(sal_True); - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx deleted file mode 100644 index 808e169859..0000000000 --- a/sw/source/ui/dialog/wordcountdialog.cxx +++ /dev/null @@ -1,98 +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_sw.hxx" -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif -#include <swtypes.hxx> -#include <wordcountdialog.hxx> -#include <docstat.hxx> - -#include <dialog.hrc> -#include <layout/layout-pre.hxx> -#include <wordcountdialog.hrc> - -#if ENABLE_LAYOUT -#undef SW_RES -#define SW_RES(x) #x -#undef SfxModalDialog -#define SfxModalDialog( parent, id ) Dialog( parent, "wordcount.xml", id ) -#define SW_WORDCOUNTDIALOG_HRC -#include <helpid.h> -#endif /* ENABLE_LAYOUT */ - -SwWordCountDialog::SwWordCountDialog(Window* pParent) : - SfxModalDialog(pParent, SW_RES(DLG_WORDCOUNT)), -#if defined _MSC_VER -#pragma warning (disable : 4355) -#endif - aCurrentFL( this, SW_RES( FL_CURRENT )), - aCurrentWordFT( this, SW_RES( FT_CURRENTWORD )), - aCurrentWordFI( this, SW_RES( FI_CURRENTWORD )), - aCurrentCharacterFT( this, SW_RES( FT_CURRENTCHARACTER )), - aCurrentCharacterFI( this, SW_RES( FI_CURRENTCHARACTER )), - aCurrentCharacterExcludingSpacesFT( this, SW_RES( FT_CURRENTCHARACTEREXCLUDINGSPACES )), - aCurrentCharacterExcludingSpacesFI( this, SW_RES( FI_CURRENTCHARACTEREXCLUDINGSPACES )), - - aDocFL( this, SW_RES( FL_DOC )), - aDocWordFT( this, SW_RES( FT_DOCWORD )), - aDocWordFI( this, SW_RES( FI_DOCWORD )), - aDocCharacterFT( this, SW_RES( FT_DOCCHARACTER )), - aDocCharacterFI( this, SW_RES( FI_DOCCHARACTER )), - aDocCharacterExcludingSpacesFT( this, SW_RES( FT_DOCCHARACTEREXCLUDINGSPACES )), - aDocCharacterExcludingSpacesFI( this, SW_RES( FI_DOCCHARACTEREXCLUDINGSPACES )), - aBottomFL(this, SW_RES( FL_BOTTOM )), - aOK( this, SW_RES( PB_OK )), - aHelp( this, SW_RES( PB_HELP )) -#if defined _MSC_VER -#pragma warning (default : 4355) -#endif -{ -#if ENABLE_LAYOUT - SetHelpId (HID_DLG_WORDCOUNT); -#endif /* ENABLE_LAYOUT */ - FreeResource(); -} - -SwWordCountDialog::~SwWordCountDialog() -{ -} - -void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) -{ - aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord )); - aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar )); - aCurrentCharacterExcludingSpacesFI.SetText(String::CreateFromInt32(rCurrent.nCharExcludingSpaces )); - aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord )); - aDocCharacterFI.SetText( String::CreateFromInt32(rDoc.nChar )); - aDocCharacterExcludingSpacesFI.SetText( String::CreateFromInt32(rDoc.nCharExcludingSpaces )); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/wordcountdialog.hrc b/sw/source/ui/dialog/wordcountdialog.hrc deleted file mode 100644 index f8b64c86a0..0000000000 --- a/sw/source/ui/dialog/wordcountdialog.hrc +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SW_WORDCOUNTDIALOG_HRC -#define SW_WORDCOUNTDIALOG_HRC -#define FL_CURRENT 1 -#define FT_CURRENTWORD 2 -#define FI_CURRENTWORD 3 -#define FT_CURRENTCHARACTER 4 -#define FI_CURRENTCHARACTER 5 -#define FT_CURRENTCHARACTEREXCLUDINGSPACES 6 -#define FI_CURRENTCHARACTEREXCLUDINGSPACES 7 -#define FL_DOC 8 -#define FT_DOCWORD 9 -#define FI_DOCWORD 10 -#define FT_DOCCHARACTER 11 -#define FI_DOCCHARACTER 12 -#define FT_DOCCHARACTEREXCLUDINGSPACES 13 -#define FI_DOCCHARACTEREXCLUDINGSPACES 14 -#define FL_BOTTOM 15 -#define PB_OK 16 -#define PB_HELP 17 - -#endif diff --git a/sw/source/ui/dialog/wordcountdialog.src b/sw/source/ui/dialog/wordcountdialog.src deleted file mode 100644 index f73cac2406..0000000000 --- a/sw/source/ui/dialog/wordcountdialog.src +++ /dev/null @@ -1,139 +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 <helpid.h> -#include <dialog.hrc> -#include <wordcountdialog.hrc> -ModalDialog DLG_WORDCOUNT -{ - HelpID = HID_DLG_WORDCOUNT ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 170 , 132 ) ; - Text [ en-US ] = "Word Count" ; - Moveable = TRUE ; - - FixedLine FL_CURRENT - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 158 , 8 ) ; - Text [ en-US ] = "Current selection"; - }; - FixedText FT_CURRENTWORD - { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Words:"; - }; - FixedText FI_CURRENTWORD - { - Pos = MAP_APPFONT ( 111 , 14 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Right = TRUE; - }; - FixedText FT_CURRENTCHARACTER - { - Pos = MAP_APPFONT ( 12 , 26 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Characters:"; - }; - FixedText FI_CURRENTCHARACTER - { - Pos = MAP_APPFONT ( 111 , 26 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Right = TRUE; - }; - FixedText FT_CURRENTCHARACTEREXCLUDINGSPACES - { - Pos = MAP_APPFONT ( 12 , 38 ) ; - Size = MAP_APPFONT ( 98 , 8 ) ; - Text [ en-US ] = "Characters excluding spaces:"; - }; - FixedText FI_CURRENTCHARACTEREXCLUDINGSPACES - { - Pos = MAP_APPFONT ( 111 , 38 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Right = TRUE; - }; - FixedLine FL_DOC - { - Pos = MAP_APPFONT ( 6, 52 ) ; - Size = MAP_APPFONT ( 158 , 8 ) ; - Text [ en-US ] = "Whole document"; - }; - FixedText FT_DOCWORD - { - Pos = MAP_APPFONT ( 12, 63 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Words:"; - }; - FixedText FI_DOCWORD - { - Pos = MAP_APPFONT ( 111 , 63 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Right = TRUE; - }; - FixedText FT_DOCCHARACTER - { - Pos = MAP_APPFONT ( 12 , 75 ) ; - Size = MAP_APPFONT ( 80 , 8 ) ; - Text [ en-US ] = "Characters:"; - }; - FixedText FI_DOCCHARACTER - { - Pos = MAP_APPFONT ( 111, 75 ) ; - Size = MAP_APPFONT ( 50, 8 ) ; - Right = TRUE; - }; - FixedText FT_DOCCHARACTEREXCLUDINGSPACES - { - Pos = MAP_APPFONT ( 12 , 87 ) ; - Size = MAP_APPFONT ( 98 , 8 ) ; - Text [ en-US ] = "Characters excluding spaces:"; - }; - FixedText FI_DOCCHARACTEREXCLUDINGSPACES - { - Pos = MAP_APPFONT ( 111, 87 ) ; - Size = MAP_APPFONT ( 50, 8 ) ; - Right = TRUE; - }; - FixedLine FL_BOTTOM - { - Pos = MAP_APPFONT ( 6 , 101 ) ; - Size = MAP_APPFONT ( 158 , 8 ) ; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 61 , 112 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - DefButton = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 114 , 112 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; -}; |