diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-02-26 08:13:29 +0100 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-02-26 08:13:29 +0100 |
commit | f3f9bbf544328823c6816bcc6e9afecc886c18ab (patch) | |
tree | ef19e016bd5efea85f5e82ea265fd5a9531407c3 /svx/source/dialog | |
parent | 97d964702b7d8a9814a52b974505603ffba2e6c6 (diff) | |
parent | 4d8175599b8d193aba6eef89ef905c830b87d7e7 (diff) |
cws tl74: merge with DEV300_m72
Diffstat (limited to 'svx/source/dialog')
120 files changed, 1042 insertions, 6806 deletions
diff --git a/svx/source/dialog/SpellDialogChildWindow.cxx b/svx/source/dialog/SpellDialogChildWindow.cxx index fa98eee5852a..6e021ce20d3d 100644 --- a/svx/source/dialog/SpellDialogChildWindow.cxx +++ b/svx/source/dialog/SpellDialogChildWindow.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: SpellDialogChildWindow.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index cda3f993a76b..d010109d34b3 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: _bmpmask.cxx,v $ - * $Revision: 1.13 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index 0c87beb39a74..2eee0268816a 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: _contdlg.cxx,v $ - * $Revision: 1.20 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -874,7 +871,7 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx ) IMPL_LINK( SvxSuperContourDlg, MousePosHdl, ContourWindow*, pWnd ) { String aStr; - const FieldUnit eFieldUnit = GetModuleFieldUnit(); + const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Point& rMousePos = pWnd->GetMousePos(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0); @@ -897,7 +894,7 @@ IMPL_LINK( SvxSuperContourDlg, MousePosHdl, ContourWindow*, pWnd ) IMPL_LINK( SvxSuperContourDlg, GraphSizeHdl, ContourWindow*, pWnd ) { String aStr; - const FieldUnit eFieldUnit = GetModuleFieldUnit(); + const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Size& rSize = pWnd->GetGraphicSize(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0); diff --git a/svx/source/dialog/bmpmask.hrc b/svx/source/dialog/bmpmask.hrc index d6e0e8f059f7..99c9eab04b7b 100644 --- a/svx/source/dialog/bmpmask.hrc +++ b/svx/source/dialog/bmpmask.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: bmpmask.hrc,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/bmpmask.src b/svx/source/dialog/bmpmask.src index 18a57306ae63..445a46025dd0 100644 --- a/svx/source/dialog/bmpmask.src +++ b/svx/source/dialog/bmpmask.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: bmpmask.src,v $ - * $Revision: 1.46 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index d1ef3768eaa7..41d7026e7e8f 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: charmap.cxx,v $ - * $Revision: 1.44 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx index 208fb585ccc1..c54634017392 100644 --- a/svx/source/dialog/checklbx.cxx +++ b/svx/source/dialog/checklbx.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: checklbx.cxx,v $ - * $Revision: 1.13 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index 74fde268f9fa..79e563510dbc 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: connctrl.cxx,v $ - * $Revision: 1.15 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/contdlg.hrc b/svx/source/dialog/contdlg.hrc index 6230e9e86cf8..a191231daa22 100644 --- a/svx/source/dialog/contdlg.hrc +++ b/svx/source/dialog/contdlg.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: contdlg.hrc,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/contdlg.src b/svx/source/dialog/contdlg.src index 91e22ed59f9a..1b1923c66eab 100644 --- a/svx/source/dialog/contdlg.src +++ b/svx/source/dialog/contdlg.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: contdlg.src,v $ - * $Revision: 1.39 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/contimp.hxx b/svx/source/dialog/contimp.hxx index 5aa2411c998d..0017966f1eaf 100644 --- a/svx/source/dialog/contimp.hxx +++ b/svx/source/dialog/contimp.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: contimp.hxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx index 45e25388c028..590408bf6707 100644 --- a/svx/source/dialog/contwnd.cxx +++ b/svx/source/dialog/contwnd.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: contwnd.cxx,v $ - * $Revision: 1.16 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/contwnd.hxx b/svx/source/dialog/contwnd.hxx index bb31243aea06..0e32da5767cb 100644 --- a/svx/source/dialog/contwnd.hxx +++ b/svx/source/dialog/contwnd.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: contwnd.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 490adac522fc..503814823467 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: ctredlin.cxx,v $ - * $Revision: 1.17 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -39,7 +36,7 @@ #include <svtools/txtcmp.hxx> #include <unotools/charclass.hxx> // INCLUDE ------------------------------------------------------------------- -#include <unolingu.hxx> +#include <editeng/unolingu.hxx> #include <svx/dialmgr.hxx> #include "ctredlin.hrc" #include <svx/ctredlin.hxx> diff --git a/svx/source/dialog/ctredlin.hrc b/svx/source/dialog/ctredlin.hrc index 6134973eb5e4..23cc504c0573 100644 --- a/svx/source/dialog/ctredlin.hrc +++ b/svx/source/dialog/ctredlin.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: ctredlin.hrc,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/ctredlin.src b/svx/source/dialog/ctredlin.src index 37abce1fa4b2..e617607ebfad 100644 --- a/svx/source/dialog/ctredlin.src +++ b/svx/source/dialog/ctredlin.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: ctredlin.src,v $ - * $Revision: 1.47 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/databaseregistrationui.cxx b/svx/source/dialog/databaseregistrationui.cxx index 2c4af6be9784..fb7b4a6903ef 100644 --- a/svx/source/dialog/databaseregistrationui.cxx +++ b/svx/source/dialog/databaseregistrationui.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: databaseregistrationui.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 0d6d305a99ad..0d5e6ed4bd6f 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dialcontrol.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/dialmgr.cxx b/svx/source/dialog/dialmgr.cxx index 574a68a6ce91..c8e057ee8502 100644 --- a/svx/source/dialog/dialmgr.cxx +++ b/svx/source/dialog/dialmgr.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dialmgr.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index edaa2cb92adb..fe884859afcd 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dlgctl3d.cxx,v $ - * $Revision: 1.20.226.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index d0a15be5e4f2..56873298382f 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dlgctrl.cxx,v $ - * $Revision: 1.36 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/dlgctrl.src b/svx/source/dialog/dlgctrl.src index b67f719e183e..2da544673c65 100644 --- a/svx/source/dialog/dlgctrl.src +++ b/svx/source/dialog/dlgctrl.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dlgctrl.src,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/dlgutil.cxx b/svx/source/dialog/dlgutil.cxx index 1d2b295a793d..6c7a42f90970 100644 --- a/svx/source/dialog/dlgutil.cxx +++ b/svx/source/dialog/dlgutil.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dlgutil.cxx,v $ - * $Revision: 1.17 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -33,935 +30,26 @@ // include --------------------------------------------------------------- -#include <limits.h> -#include <tools/shl.hxx> -#include <tools/urlobj.hxx> -#include <unolingu.hxx> - -#include <svtools/langtab.hxx> -#include <svl/itemset.hxx> -#include <sfx2/viewfrm.hxx> -#include <sfx2/objsh.hxx> - -#include <svx/dialogs.hrc> - #include "dlgutil.hxx" -#include <svx/dialmgr.hxx> - -// ----------------------------------------------------------------------- - -String GetLanguageString( LanguageType eType ) -{ - static const SvtLanguageTable aLangTable; - return aLangTable.GetString( eType ); -} - -// ----------------------------------------------------------------------- - -String GetDicInfoStr( const String& rName, const USHORT nLang, const BOOL bNeg ) -{ - INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); - aURLObj.SetSmartURL( rName, INetURLObject::ENCODE_ALL ); - String aTmp( aURLObj.GetBase() ); - aTmp += sal_Unicode( ' ' ); - - if ( bNeg ) - { - sal_Char const sTmp[] = " (-) "; - aTmp.AppendAscii( sTmp ); - } - - if ( LANGUAGE_NONE == nLang ) - aTmp += String( ResId( RID_SVXSTR_LANGUAGE_ALL, DIALOG_MGR() ) ); - else - { - aTmp += sal_Unicode( '[' ); - aTmp += ::GetLanguageString( (LanguageType)nLang ); - aTmp += sal_Unicode( ']' ); - } - - return aTmp; -} - -// ----------------------------------------------------------------------- - -void SetFieldUnit( MetricField& rField, FieldUnit eUnit, BOOL bAll ) -{ - sal_Int64 nFirst = rField.Denormalize( rField.GetFirst( FUNIT_TWIP ) ); - sal_Int64 nLast = rField.Denormalize( rField.GetLast( FUNIT_TWIP ) ); - sal_Int64 nMin = rField.Denormalize( rField.GetMin( FUNIT_TWIP ) ); - sal_Int64 nMax = rField.Denormalize( rField.GetMax( FUNIT_TWIP ) ); - - if ( !bAll ) - { - switch ( eUnit ) - { - case FUNIT_M: - case FUNIT_KM: - eUnit = FUNIT_CM; - break; - - case FUNIT_FOOT: - case FUNIT_MILE: - eUnit = FUNIT_INCH; - break; - default: ;//prevent warning - } - } - rField.SetUnit( eUnit ); - switch( eUnit ) - { - case FUNIT_MM: - rField.SetSpinSize( 50 ); - break; - - case FUNIT_INCH: - rField.SetSpinSize( 2 ); - break; - - default: - rField.SetSpinSize( 10 ); - } - - if ( FUNIT_POINT == eUnit ) - { - if( rField.GetDecimalDigits() > 1 ) - rField.SetDecimalDigits( 1 ); - } - else - rField.SetDecimalDigits( 2 ); - - if ( !bAll ) - { - rField.SetFirst( rField.Normalize( nFirst ), FUNIT_TWIP ); - rField.SetLast( rField.Normalize( nLast ), FUNIT_TWIP ); - rField.SetMin( rField.Normalize( nMin ), FUNIT_TWIP ); - rField.SetMax( rField.Normalize( nMax ), FUNIT_TWIP ); - } -} - -// ----------------------------------------------------------------------- - -void SetFieldUnit( MetricBox& rBox, FieldUnit eUnit, BOOL bAll ) -{ - sal_Int64 nMin = rBox.Denormalize( rBox.GetMin( FUNIT_TWIP ) ); - sal_Int64 nMax = rBox.Denormalize( rBox.GetMax( FUNIT_TWIP ) ); - - if ( !bAll ) - { - switch ( eUnit ) - { - case FUNIT_M: - case FUNIT_KM: - eUnit = FUNIT_CM; - break; - - case FUNIT_FOOT: - case FUNIT_MILE: - eUnit = FUNIT_INCH; - break; - default: ;//prevent warning - } - } - rBox.SetUnit( eUnit ); - - if ( FUNIT_POINT == eUnit && rBox.GetDecimalDigits() > 1 ) - rBox.SetDecimalDigits( 1 ); - else - rBox.SetDecimalDigits( 2 ); - - if ( !bAll ) - { - rBox.SetMin( rBox.Normalize( nMin ), FUNIT_TWIP ); - rBox.SetMax( rBox.Normalize( nMax ), FUNIT_TWIP ); - } -} +#include <svl/itemset.hxx> +#include <sfx2/sfxsids.hrc> +#include <sfx2/module.hxx> +#include <svl/intitem.hxx> // ----------------------------------------------------------------------- -FieldUnit GetModuleFieldUnit( const SfxItemSet* pSet ) +FieldUnit GetModuleFieldUnit( const SfxItemSet& rSet ) { FieldUnit eUnit = FUNIT_INCH; const SfxPoolItem* pItem = NULL; - if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_ATTR_METRIC, FALSE, &pItem ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC, FALSE, &pItem ) ) eUnit = (FieldUnit)( (const SfxUInt16Item*)pItem )->GetValue(); else { - SfxViewFrame* pFrame = SfxViewFrame::Current(); - SfxObjectShell* pSh = NULL; - if ( pFrame ) - pSh = pFrame->GetObjectShell(); - if ( pSh ) // #93209# the object shell is not always available during reload - { - SfxModule* pModule = pSh->GetModule(); - if ( pModule ) - { - const SfxPoolItem* _pItem = pModule->GetItem( SID_ATTR_METRIC ); - if ( _pItem ) - eUnit = (FieldUnit)( (SfxUInt16Item*)_pItem )->GetValue(); - } - else - { - DBG_ERRORFILE( "GetModuleFieldUnit(): no module found" ); - } - } - } - return eUnit; -} - -// ----------------------------------------------------------------------- -void SetMetricValue( MetricField& rField, long nCoreValue, SfxMapUnit eUnit ) -{ - sal_Int64 nVal = OutputDevice::LogicToLogic( nCoreValue, (MapUnit)eUnit, MAP_100TH_MM ); - nVal = rField.Normalize( nVal ); - rField.SetValue( nVal, FUNIT_100TH_MM ); - -/* - if ( SFX_MAPUNIT_100TH_MM == eUnit ) - { - FieldUnit eFUnit = ( (MetricField&)rField ).GetUnit(); - USHORT nDigits = rField.GetDecimalDigits(); - - if ( FUNIT_MM == eFUnit ) - { - if ( 0 == nDigits ) - lCoreValue /= 100; - else if ( 1 == nDigits ) - lCoreValue /= 10; - else if ( nDigits > 2 ) - { - DBG_ERROR( "too much decimal digits" ); - return; - } - rField.SetValue( lCoreValue, FUNIT_MM ); - return; - } - else if ( FUNIT_CM == eFUnit ) - { - if ( 0 == nDigits ) - lCoreValue /= 1000; - else if ( 1 == nDigits ) - lCoreValue /= 100; - else if ( 2 == nDigits ) - lCoreValue /= 10; - else if ( nDigits > 3 ) - { - DBG_ERROR( "too much decimal digits" ); - return; - } - rField.SetValue( lCoreValue, FUNIT_CM ); - return; - } - } - rField.SetValue( rField.Normalize( - ConvertValueToUnit( lCoreValue, eUnit ) ), MapToFieldUnit( eUnit ) ); -*/ -} - -// ----------------------------------------------------------------------- - -long GetCoreValue( const MetricField& rField, SfxMapUnit eUnit ) -{ - sal_Int64 nVal = rField.GetValue( FUNIT_100TH_MM ); - // avoid rounding issues - const sal_Int64 nSizeMask = 0xffffffffff000000LL; - bool bRoundBefore = true; - if( nVal >= 0 ) - { - if( (nVal & nSizeMask) == 0 ) - bRoundBefore = false; - } - else - { - if( ((-nVal) & nSizeMask ) == 0 ) - bRoundBefore = false; - } - if( bRoundBefore ) - nVal = rField.Denormalize( nVal ); - sal_Int64 nUnitVal = OutputDevice::LogicToLogic( static_cast<long>(nVal), MAP_100TH_MM, (MapUnit)eUnit ); - if( ! bRoundBefore ) - nUnitVal = rField.Denormalize( nUnitVal ); - return static_cast<long>(nUnitVal); - -/* - long nRet = rField.GetValue( MapToFieldUnit( eUnit ) ); - FieldUnit eFUnit = ( (MetricField&)rField ).GetUnit(); - USHORT nDigits = rField.GetDecimalDigits(); - DBG_ASSERT( nDigits <= 2, "decimal digits > 2!" ); - - switch ( eUnit ) - { - case SFX_MAPUNIT_100TH_MM: - { - if ( 2 == nDigits ) - return nRet; - else if ( 1 == nDigits ) - return nRet * 10; - else - return nRet * 100; - } - - case SFX_MAPUNIT_TWIP: - { - if ( 2 == nDigits ) - { - long nMod = 100; - long nTmp = nRet % nMod; - - if ( nTmp >= 49 ) - nRet += 100 - nTmp; - return nRet / 100; - } - else if ( 1 == nDigits ) - { - long nMod = 10; - long nTmp = nRet % nMod; - - if ( nTmp >= 4 ) - nRet += 10 - nTmp; - return nRet / 10; - } - else - return nRet; - } - - default: - DBG_ERROR( "this unit is not implemented" ); - return 0; - } -*/ - -/*!!! - return ConvertValueToMap( rField.Denormalize( - rField.GetValue( MapToFieldUnit( eUnit ) ) ), eUnit ); -*/ -} - -// ----------------------------------------------------------------------- - -long CalcToUnit( float nIn, SfxMapUnit eUnit ) -{ - // nIn ist in Points - - DBG_ASSERT( eUnit == SFX_MAPUNIT_TWIP || - eUnit == SFX_MAPUNIT_100TH_MM || - eUnit == SFX_MAPUNIT_10TH_MM || - eUnit == SFX_MAPUNIT_MM || - eUnit == SFX_MAPUNIT_CM, "this unit is not implemented" ); - - float nTmp = nIn; - - if ( SFX_MAPUNIT_TWIP != eUnit ) - nTmp = nIn * 10 / 567; - - switch ( eUnit ) - { - case SFX_MAPUNIT_100TH_MM: nTmp *= 100; break; - case SFX_MAPUNIT_10TH_MM: nTmp *= 10; break; - case SFX_MAPUNIT_MM: break; - case SFX_MAPUNIT_CM: nTmp /= 10; break; - default: ;//prevent warning - } - - nTmp *= 20; - long nRet = (long)nTmp; - return nRet; -//! return (long)(nTmp * 20); -} - -// ----------------------------------------------------------------------- - -long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit eCtrl ) -{ - long nOut = 0; - - switch ( eItem ) - { - case SFX_MAPUNIT_100TH_MM: - case SFX_MAPUNIT_10TH_MM: - case SFX_MAPUNIT_MM: - { - if ( eItem == SFX_MAPUNIT_10TH_MM ) - nIn /= 10; - else if ( eItem == SFX_MAPUNIT_100TH_MM ) - nIn /= 100; - nOut = TransformMetric( nIn, FUNIT_MM, (FieldUnit)eCtrl ); - } - break; - - case SFX_MAPUNIT_CM: - { - nOut = TransformMetric( nIn, FUNIT_CM, (FieldUnit)eCtrl ); - } - break; - - case SFX_MAPUNIT_1000TH_INCH: - case SFX_MAPUNIT_100TH_INCH: - case SFX_MAPUNIT_10TH_INCH: - case SFX_MAPUNIT_INCH: - { - if ( eItem == SFX_MAPUNIT_10TH_INCH ) - nIn /= 10; - else if ( eItem == SFX_MAPUNIT_100TH_INCH ) - nIn /= 100; - else if ( eItem == SFX_MAPUNIT_1000TH_INCH ) - nIn /= 1000; - nOut = TransformMetric( nIn, FUNIT_INCH, (FieldUnit)eCtrl ); - } - break; - - case SFX_MAPUNIT_POINT: - { - nOut = TransformMetric( nIn, FUNIT_POINT, (FieldUnit)eCtrl ); - } - break; - - case SFX_MAPUNIT_TWIP: - { - nOut = TransformMetric( nIn, FUNIT_TWIP, (FieldUnit)eCtrl ); - } - break; - default: ;//prevent warning - } - return nOut; -} - -// ----------------------------------------------------------------------- - -long ControlToItem( long nIn, SfxFieldUnit eCtrl, SfxMapUnit eItem ) -{ - return ItemToControl( nIn, eItem, eCtrl ); -} - -// ----------------------------------------------------------------------- - -FieldUnit MapToFieldUnit( const SfxMapUnit eUnit ) -{ - switch ( eUnit ) - { - case SFX_MAPUNIT_100TH_MM: - case SFX_MAPUNIT_10TH_MM: - case SFX_MAPUNIT_MM: - return FUNIT_MM; - - case SFX_MAPUNIT_CM: - return FUNIT_CM; - - case SFX_MAPUNIT_1000TH_INCH: - case SFX_MAPUNIT_100TH_INCH: - case SFX_MAPUNIT_10TH_INCH: - case SFX_MAPUNIT_INCH: - return FUNIT_INCH; - - case SFX_MAPUNIT_POINT: - return FUNIT_POINT; - - case SFX_MAPUNIT_TWIP: - return FUNIT_TWIP; - default: ;//prevent warning - } - return FUNIT_NONE; -} - -// ----------------------------------------------------------------------- - -MapUnit FieldToMapUnit( const SfxFieldUnit /*eUnit*/ ) -{ - return MAP_APPFONT; -} - -// ----------------------------------------------------------------------- - -long ConvertValueToMap( long nVal, SfxMapUnit eUnit ) -{ - long nNew = nVal; - - switch ( eUnit ) - { - case SFX_MAPUNIT_10TH_MM: - case SFX_MAPUNIT_10TH_INCH: - nNew *= 10; - break; - - case SFX_MAPUNIT_100TH_MM: - case SFX_MAPUNIT_100TH_INCH: - nNew *= 100; - break; - - case SFX_MAPUNIT_1000TH_INCH: - nNew *= 1000; - default: ;//prevent warning - } - return nNew; -} - -// ----------------------------------------------------------------------- - -long ConvertValueToUnit( long nVal, SfxMapUnit eUnit ) -{ - long nNew = nVal; - - switch ( eUnit ) - { - case SFX_MAPUNIT_10TH_MM: - case SFX_MAPUNIT_10TH_INCH: - nNew /= 10; - break; - - case SFX_MAPUNIT_100TH_MM: - case SFX_MAPUNIT_100TH_INCH: - nNew /= 100; - break; - - case SFX_MAPUNIT_1000TH_INCH: - nNew /= 1000; - break; - default: ;//prevent warning - } - return nNew; -} - -// ----------------------------------------------------------------------- - -long CalcToPoint( long nIn, SfxMapUnit eUnit, USHORT nFaktor ) -{ - DBG_ASSERT( eUnit == SFX_MAPUNIT_TWIP || - eUnit == SFX_MAPUNIT_100TH_MM || - eUnit == SFX_MAPUNIT_10TH_MM || - eUnit == SFX_MAPUNIT_MM || - eUnit == SFX_MAPUNIT_CM, "this unit is not implemented" ); - - long nRet = 0; - - if ( SFX_MAPUNIT_TWIP == eUnit ) - nRet = nIn; - else - nRet = nIn * 567; - - switch ( eUnit ) - { - case SFX_MAPUNIT_100TH_MM: nRet /= 100; break; - case SFX_MAPUNIT_10TH_MM: nRet /= 10; break; - case SFX_MAPUNIT_MM: break; - case SFX_MAPUNIT_CM: nRet *= 10; break; - default: ;//prevent warning - } - - // ggf. aufrunden - if ( SFX_MAPUNIT_TWIP != eUnit ) - { - long nMod = 10; - long nTmp = nRet % nMod; - - if ( nTmp >= 4 ) - nRet += 10 - nTmp; - nRet /= 10; - } - return nRet * nFaktor / 20; -} - -// ----------------------------------------------------------------------- - -long CMToTwips( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 567 ) && nIn >= ( LONG_MIN / 567 ) ) - nRet = nIn * 567; - return nRet; -} - -// ----------------------------------------------------------------------- - -long MMToTwips( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 567 ) && nIn >= ( LONG_MIN / 567 ) ) - nRet = nIn * 567 / 10; - return nRet; -} - -// ----------------------------------------------------------------------- - -long InchToTwips( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 1440 ) && nIn >= ( LONG_MIN / 1440 ) ) - nRet = nIn * 1440; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PointToTwips( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 20 ) && nIn >= ( LONG_MIN / 20 ) ) - nRet = nIn * 20; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PicaToTwips( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 240 ) && nIn >= ( LONG_MIN / 240 ) ) - nRet = nIn * 240; - return nRet; -} - -// ----------------------------------------------------------------------- - -long TwipsToCM( long nIn ) -{ - long nRet = nIn / 567; - return nRet; -} - -// ----------------------------------------------------------------------- - -long InchToCM( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 254 ) && nIn >= ( LONG_MIN / 254 ) ) - nRet = nIn * 254 / 100; - return nRet; -} - -// ----------------------------------------------------------------------- - -long MMToCM( long nIn ) -{ - long nRet = nIn / 10; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PointToCM( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 20 ) && nIn >= ( LONG_MIN / 20 ) ) - nRet = nIn * 20 / 567; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PicaToCM( long nIn) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 12 / 20 ) && nIn >= ( LONG_MIN / 12 / 20 ) ) - nRet = nIn * 12 * 20 / 567; - return nRet; -} - -// ----------------------------------------------------------------------- - -long TwipsToMM( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 10 ) && nIn >= ( LONG_MIN / 10 ) ) - nRet = nIn * 10 / 566; - return nRet; -} - -// ----------------------------------------------------------------------- - -long CMToMM( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 10 ) && nIn >= ( LONG_MIN / 10 ) ) - nRet = nIn * 10; - return nRet; -} - -// ----------------------------------------------------------------------- - -long InchToMM( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 254 ) && nIn >= ( LONG_MIN / 254 ) ) - nRet = nIn * 254 / 10; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PointToMM( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 200 ) && nIn >= ( LONG_MIN / 200 ) ) - nRet = nIn * 200 / 567; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PicaToMM( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 12 / 200 ) && nIn >= ( LONG_MIN / 12 / 200 ) ) - nRet = nIn * 12 * 200 / 567; - return nRet; -} - -// ----------------------------------------------------------------------- - -long TwipsToInch( long nIn ) -{ - long nRet = nIn / 1440; - return nRet; -} - -// ----------------------------------------------------------------------- - -long CMToInch( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 100 ) && nIn >= ( LONG_MIN / 100 ) ) - nRet = nIn * 100 / 254; - return nRet; -} - -// ----------------------------------------------------------------------- - -long MMToInch( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 10 ) && nIn >= ( LONG_MIN / 10 ) ) - nRet = nIn * 10 / 254; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PointToInch( long nIn ) -{ - long nRet = nIn / 72; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PicaToInch( long nIn ) -{ - long nRet = nIn / 6; - return nRet; -} - -// ----------------------------------------------------------------------- - -long TwipsToPoint( long nIn ) -{ - long nRet = nIn / 20; - return nRet; -} - -// ----------------------------------------------------------------------- - -long InchToPoint( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 72 ) && nIn >= ( LONG_MIN / 72 ) ) - nRet = nIn * 72; - return nRet; -} - -// ----------------------------------------------------------------------- - -long CMToPoint( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 567 ) && nIn >= ( LONG_MIN / 567 ) ) - nRet = nIn * 567 / 20; - return nRet; -} - -// ----------------------------------------------------------------------- - -long MMToPoint( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 567 ) && nIn >= ( LONG_MIN / 567 ) ) - nRet = nIn * 567 / 200; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PicaToPoint( long nIn ) -{ - long nRet = nIn / 12; - return nRet; -} - -// ----------------------------------------------------------------------- - -long TwipsToPica( long nIn ) -{ - long nRet = nIn / 240; - return nRet; -} - -// ----------------------------------------------------------------------- - -long InchToPica( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 6 ) && nIn >= ( LONG_MIN / 6 ) ) - nRet = nIn * 6; - return nRet; -} - -// ----------------------------------------------------------------------- - -long PointToPica( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 12 ) && nIn >= ( LONG_MIN / 12 ) ) - nRet = nIn * 12; - return nRet; -} - -// ----------------------------------------------------------------------- - -long CMToPica( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 567 ) && nIn >= ( LONG_MIN / 567 ) ) - nRet = nIn * 567 / 20 / 12; - return nRet; -} - -// ----------------------------------------------------------------------- - -long MMToPica( long nIn ) -{ - long nRet = 0; - - if ( nIn <= ( LONG_MAX / 567 ) && nIn >= ( LONG_MIN / 567 ) ) - nRet = nIn * 567 / 200 / 12; - return nRet; -} - -// ----------------------------------------------------------------------- - -long Nothing( long nIn ) -{ - long nRet = nIn; - return nRet; -} - -FUNC_CONVERT ConvertTable[6][6] = -{ -// CM, MM INCH POINT PICAS=32 TWIPS - { Nothing, CMToMM, CMToInch, CMToPoint, CMToPica, CMToTwips }, - { MMToCM, Nothing, MMToInch, MMToPoint, MMToPica, MMToTwips }, - { InchToCM, InchToMM, Nothing, InchToPoint, InchToPica, InchToTwips }, - { PointToCM, PointToMM, PointToInch, Nothing, PointToPica, PointToTwips }, - { PicaToCM, PicaToMM, PicaToInch, PicaToPoint, Nothing, PicaToTwips }, - { TwipsToCM, TwipsToMM, TwipsToInch, TwipsToPoint,TwipsToPica, Nothing } -}; - -// ----------------------------------------------------------------------- - -long TransformMetric( long nVal, FieldUnit aOld, FieldUnit aNew ) -{ - if ( aOld == FUNIT_NONE || aNew == FUNIT_NONE || - aOld == FUNIT_CUSTOM || aNew == FUNIT_CUSTOM ) - { - return nVal; - } - - USHORT nOld = 0; - USHORT nNew = 0; - - switch ( aOld ) - { - case FUNIT_CM: - nOld = 0; break; - case FUNIT_MM: - nOld = 1; break; - case FUNIT_INCH: - nOld = 2; break; - case FUNIT_POINT: - nOld = 3; break; - case FUNIT_PICA: - nOld = 4; break; - case FUNIT_TWIP: - nOld = 5; break; - default: ;//prevent warning + DBG_ERROR("Using fallback for field unit - field unit should be provided in ItemSet"); + return SfxModule::GetCurrentFieldUnit(); } - switch ( aNew ) - { - case FUNIT_CM: - nNew = 0; break; - case FUNIT_MM: - nNew = 1; break; - case FUNIT_INCH: - nNew = 2; break; - case FUNIT_POINT: - nNew = 3; break; - case FUNIT_PICA: - nNew = 4; break; - case FUNIT_TWIP: - nNew = 5; break; - default: ;//prevent warning - } - return ConvertTable[nOld][nNew]( nVal ); -} - -String ConvertPosSizeToIniString( const Point& rPos, const Size& rSize ) -{ - String aRet = String::CreateFromInt32( rPos.X() ); - aRet += '/'; - aRet += String::CreateFromInt32( rPos.Y() ); - aRet += '/'; - aRet += String::CreateFromInt32( rSize.Width() ); - aRet += '/'; - aRet += String::CreateFromInt32( rSize.Height() ); - return aRet; -} - -sal_Bool ConvertIniStringToPosSize( const String& rIniStr, Point& rPos, Size& rSize ) -{ - if ( rIniStr.GetTokenCount('/') != 4 ) - return sal_False; - - USHORT nIdx = 0; - rPos.X() = rIniStr.GetToken( 0, '/', nIdx ).ToInt32(); - rPos.Y() = rIniStr.GetToken( 0, '/', nIdx ).ToInt32(); - rSize.Width() = rIniStr.GetToken( 0, '/', nIdx ).ToInt32(); - rSize.Height() = rIniStr.GetToken( 0, '/', nIdx ).ToInt32(); - - // negative sizes are invalid - if ( rSize.Width() < 0 || rSize.Height() < 0 ) - return sal_False; - - return sal_True; + return eUnit; } diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index f407e532f1fd..b4ee4dd2956f 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: docrecovery.cxx,v $ - * $Revision: 1.24 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/docrecovery.hrc b/svx/source/dialog/docrecovery.hrc index 372fa2cbed45..18148131f6aa 100644 --- a/svx/source/dialog/docrecovery.hrc +++ b/svx/source/dialog/docrecovery.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: docrecovery.hrc,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/docrecovery.src b/svx/source/dialog/docrecovery.src index aa708399df97..5bcde8bdf071 100644 --- a/svx/source/dialog/docrecovery.src +++ b/svx/source/dialog/docrecovery.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: docrecovery.src,v $ - * $Revision: 1.19 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 513a3aa57a80..27b01dacec7e 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: fntctrl.cxx,v $ - * $Revision: 1.24 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx index 135808060021..6443c12b427b 100644 --- a/svx/source/dialog/fontlb.cxx +++ b/svx/source/dialog/fontlb.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: fontlb.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx index ffcf8f21b49d..054a76fec493 100644 --- a/svx/source/dialog/fontwork.cxx +++ b/svx/source/dialog/fontwork.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: fontwork.cxx,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -49,7 +46,7 @@ #include <svx/dialogs.hrc> #include "fontwork.hrc" #include <svx/fontwork.hxx> -#include <svx/outlobj.hxx> +#include <editeng/outlobj.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/point/b2dpoint.hxx> @@ -295,7 +292,7 @@ SvxFontWorkDialog::SvxFontWorkDialog( SfxBindings *pBindinx, aMtrFldShadowY.SetModifyHdl( aLink ); // System-Metrik setzen - const FieldUnit eDlgUnit = GetModuleFieldUnit(); + const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit(); SetFieldUnit( aMtrFldDistance, eDlgUnit, TRUE ); SetFieldUnit( aMtrFldTextStart, eDlgUnit, TRUE ); SetFieldUnit( aMtrFldShadowX, eDlgUnit, TRUE ); @@ -605,7 +602,7 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem, if ( pItem->GetValue() == XFTSHADOW_NORMAL ) { nId = TBI_SHADOW_NORMAL; - const FieldUnit eDlgUnit = GetModuleFieldUnit(); + const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit(); // aFbShadowX.SetBitmap( Bitmap( ResId(RID_SVXBMP_SHADOW_XDIST, _pMgr ) ) ); //aMtrFldShadowX.SetUnit(FUNIT_MM); @@ -888,7 +885,7 @@ IMPL_LINK( SvxFontWorkDialog, InputTimoutHdl_Impl, void *, EMPTYARG ) // System-Metrik evtl. neu setzen // Dieses sollte mal als Listener passieren, ist aber aus // inkompatibilitaetsgruenden z.Z. nicht moeglich - const FieldUnit eDlgUnit = GetModuleFieldUnit(); + const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit(); if( eDlgUnit != aMtrFldDistance.GetUnit() ) { SetFieldUnit( aMtrFldDistance, eDlgUnit, TRUE ); diff --git a/svx/source/dialog/fontwork.hrc b/svx/source/dialog/fontwork.hrc index 66949d6dbde7..cdbc48aa032e 100644 --- a/svx/source/dialog/fontwork.hrc +++ b/svx/source/dialog/fontwork.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: fontwork.hrc,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/fontwork.src b/svx/source/dialog/fontwork.src index 1178c07f40ba..b0c63d9313d4 100644 --- a/svx/source/dialog/fontwork.src +++ b/svx/source/dialog/fontwork.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: fontwork.src,v $ - * $Revision: 1.41 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx index a47f0a44c6e2..8d9ebac5a5aa 100644 --- a/svx/source/dialog/framelink.cxx +++ b/svx/source/dialog/framelink.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: framelink.cxx,v $ - * $Revision: 1.10 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -34,7 +31,7 @@ #include <math.h> #include <vcl/outdev.hxx> -#include <svx/borderline.hxx> +#include <editeng/borderline.hxx> // ---------------------------------------------------------------------------- diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index 713d959febb0..a449c778f7b3 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: framelinkarray.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/frmdirlbox.cxx b/svx/source/dialog/frmdirlbox.cxx index 972e0c2327fd..dcfc14afcacd 100644 --- a/svx/source/dialog/frmdirlbox.cxx +++ b/svx/source/dialog/frmdirlbox.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: frmdirlbox.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index fa413d81ed17..16bc17976aa4 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: frmsel.cxx,v $ - * $Revision: 1.25 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/frmsel.src b/svx/source/dialog/frmsel.src index 4403a556860d..754e0b962b29 100644 --- a/svx/source/dialog/frmsel.src +++ b/svx/source/dialog/frmsel.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: frmsel.src,v $ - * $Revision: 1.19 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 7ff915a51650..a50bc6247a5f 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: graphctl.cxx,v $ - * $Revision: 1.32 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/grfflt.cxx b/svx/source/dialog/grfflt.cxx index 9e87debfe3bd..99d8d507f13c 100644 --- a/svx/source/dialog/grfflt.cxx +++ b/svx/source/dialog/grfflt.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: grfflt.cxx,v $ - * $Revision: 1.12 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/hangulhanja.cxx b/svx/source/dialog/hangulhanja.cxx deleted file mode 100644 index 64555110937f..000000000000 --- a/svx/source/dialog/hangulhanja.cxx +++ /dev/null @@ -1,1175 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hangulhanja.cxx,v $ - * $Revision: 1.20.102.1 $ - * - * 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_svx.hxx" -#include <svx/hangulhanja.hxx> -#include <vcl/msgbox.hxx> //add CHINA001 -#include <vcl/button.hxx> -// header for class SvtLinguConfig -#include <unotools/lingucfg.hxx> -#include <unotools/linguprops.hxx> - -#include <set> -#include <map> -#include <com/sun/star/uno/Sequence.hxx> -#include <com/sun/star/i18n/XBreakIterator.hpp> -#include <com/sun/star/i18n/ScriptType.hpp> -#include <com/sun/star/i18n/UnicodeScript.hpp> -#include <com/sun/star/i18n/XTextConversion.hpp> -#include <com/sun/star/i18n/XExtendedTextConversion.hpp> -#include <com/sun/star/i18n/TextConversionType.hpp> -#include <com/sun/star/i18n/TextConversionOption.hpp> -#include <com/sun/star/i18n/WordType.hpp> -#include <vcl/stdtext.hxx> -#include <unotools/charclass.hxx> - -#include <svx/svxdlg.hxx> //CHINA001 -#include <svx/dialogs.hrc> //CHINA001 -#include <unolingu.hxx> - -#define HHC HangulHanjaConversion - -//............................................................................. -namespace svx -{ -//............................................................................. - - using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::i18n; - using namespace ::com::sun::star::i18n::TextConversionOption; - using namespace ::com::sun::star::i18n::TextConversionType; - using namespace ::com::sun::star::lang; -/* - using HangulHanjaConversion::ReplacementAction; - using HangulHanjaConversion::eExchange; - using HangulHanjaConversion::eReplacementBracketed; - using HangulHanjaConversion::eOriginalBracketed; - using HangulHanjaConversion::eReplacementAbove; - using HangulHanjaConversion::eOriginalAbove; - using HangulHanjaConversion::eReplacementBelow; - using HangulHanjaConversion::eOriginalBelow; - - using HangulHanjaConversion::eHangulToHanja; - using HangulHanjaConversion::eHanjaToHangul; - - using HangulHanjaConversion::eSimpleConversion; - using HangulHanjaConversion::eHangulBracketed; - using HangulHanjaConversion::eHanjaBracketed; - using HangulHanjaConversion::eRubyHanjaAbove; - using HangulHanjaConversion::eRubyHanjaBelow; - using HangulHanjaConversion::eRubyHangulAbove; - using HangulHanjaConversion::eRubyHangulBelow; - - using ::com::sun::star::i18n::TextConversionType::TO_HANJA; - using ::com::sun::star::i18n::TextConversionType::TO_HANGUL; - using ::com::sun::star::i18n::TextConversionOption::CHARACTER_BY_CHARACTER; - using ::com::sun::star::i18n::TextConversionOption::NONE; -*/ - //========================================================================= - //= HangulHanjaConversion_Impl - //========================================================================= - //using HangulHanjaConversion::ConversionFormat; - - class HangulHanjaConversion_Impl - { - private: - typedef ::std::set< ::rtl::OUString, ::std::less< ::rtl::OUString > > StringBag; - typedef ::std::map< ::rtl::OUString, ::rtl::OUString, ::std::less< ::rtl::OUString > > StringMap; - - private: - StringBag m_sIgnoreList; - StringMap m_aChangeList; - static StringMap m_aRecentlyUsedList; - - // general - AbstractHangulHanjaConversionDialog* //CHINA001 HangulHanjaConversionDialog* - m_pConversionDialog; // the dialog to display for user interaction - Window* m_pUIParent; // the parent window for any UI we raise - Reference< XMultiServiceFactory > - m_xORB; // the service factory to use - Reference< XTextConversion > - m_xConverter; // the text conversion service - Locale m_aSourceLocale; // the locale we're working with - - // additions for Chinese simplified / traditional conversion - HHC::ConversionType m_eConvType; // conversion type (Hangul/Hanja, simplified/traditional Chinese,...) - LanguageType m_nSourceLang; // just a 'copy' of m_aSourceLocale in order in order to - // save the applications from always converting to this - // type in their implementations - LanguageType m_nTargetLang; // target language of new replacement text - const Font* m_pTargetFont; // target font of new replacement text - sal_Int32 m_nConvOptions; // text conversion options (as used by 'getConversions') - sal_Bool m_bIsInteractive; // specifies if the conversion requires user interaction - // (and likeley a specialised dialog) or if it is to run - // automatically without any user interaction. - // True for Hangul / Hanja conversion - // False for Chinese simlified / traditional conversion - - HangulHanjaConversion* m_pAntiImpl; // our "anti-impl" instance - - // options - sal_Bool m_bByCharacter; // are we in "by character" mode currently? - HHC::ConversionFormat m_eConversionFormat; // the current format for the conversion - HHC::ConversionDirection m_ePrimaryConversionDirection; // the primary conversion direction - HHC::ConversionDirection m_eCurrentConversionDirection; // the primary conversion direction - - //options from Hangul/Hanja Options dialog (also saved to configuration) - bool m_bIgnorePostPositionalWord; - bool m_bShowRecentlyUsedFirst; - bool m_bAutoReplaceUnique; - - // state - ::rtl::OUString m_sCurrentPortion; // the text which we are currently working on - LanguageType m_nCurrentPortionLang; // language of m_sCurrentPortion found - sal_Int32 m_nCurrentStartIndex; // the start index within m_sCurrentPortion of the current convertible portion - sal_Int32 m_nCurrentEndIndex; // the end index (excluding) within m_sCurrentPortion of the current convertible portion - sal_Int32 m_nReplacementBaseIndex;// index which ReplaceUnit-calls need to be relative to - sal_Int32 m_nCurrentConversionOption; - sal_Int16 m_nCurrentConversionType; - Sequence< ::rtl::OUString > - m_aCurrentSuggestions; // the suggestions for the current unit - // (means for the text [m_nCurrentStartIndex, m_nCurrentEndIndex) in m_sCurrentPortion) - sal_Bool m_bTryBothDirections; // specifies if other conversion directions should be tried when looking for convertible characters - - - public: - HangulHanjaConversion_Impl( - Window* _pUIParent, - const Reference< XMultiServiceFactory >& _rxORB, - const Locale& _rSourceLocale, - const Locale& _rTargetLocale, - const Font* _pTargetFont, - sal_Int32 _nConvOptions, - sal_Bool _bIsInteractive, - HangulHanjaConversion* _pAntiImpl ); - - public: - - static void SetUseSavedConversionDirectionState( sal_Bool bVal ); - - void DoDocumentConversion( ); - - inline sal_Bool IsByCharacter( ) const { return m_bByCharacter; } - - inline sal_Bool IsValid() const { return m_xConverter.is(); } - - inline LanguageType GetSourceLang() const { return m_nSourceLang; } - inline LanguageType GetTargetLang() const { return m_nTargetLang; } - inline const Font * GetTargetFont() const { return m_pTargetFont; } - inline sal_Int32 GetConvOptions() const { return m_nConvOptions; } - inline sal_Bool IsInteractive() const { return m_bIsInteractive; } - - protected: - void createDialog(); - - /** continue with the conversion, return <TRUE/> if and only if the complete conversion is done - @param _bRepeatCurrentUnit - if <TRUE/>, an implNextConvertible will be called initially to advance to the next convertible. - if <FALSE/>, the method will initially work with the current convertible unit - */ - sal_Bool ContinueConversion( bool _bRepeatCurrentUnit ); - - private: - DECL_LINK( OnOptionsChanged, void* ); - DECL_LINK( OnIgnore, void* ); - DECL_LINK( OnIgnoreAll, void* ); - DECL_LINK( OnChange, void* ); - DECL_LINK( OnChangeAll, void* ); - DECL_LINK( OnByCharClicked, CheckBox* ); - DECL_LINK( OnConversionTypeChanged, void* ); - DECL_LINK( OnFind, void* ); - - /** proceed, after the current convertible has been handled - - <p><b>Attention:</b> - When returning from this method, the dialog may have been deleted!</p> - - @param _bRepeatCurrentUnit - will be passed to the <member>ContinueConversion</member> call - */ - void implProceed( bool _bRepeatCurrentUnit ); - - // change the current convertible, and do _not_ proceed - void implChange( const ::rtl::OUString& _rChangeInto ); - - /** find the next convertible piece of text, with possibly advancing to the next portion - - @see HangulHanjaConversion::GetNextPortion - */ - sal_Bool implNextConvertible( bool _bRepeatUnit ); - - /** find the next convertible unit within the current portion - @param _bRepeatUnit - if <TRUE/>, the search will start at the beginning of the current unit, - if <FALSE/>, it will start at the end of the current unit - */ - bool implNextConvertibleUnit( const sal_Int32 _nStartAt ); - - /** retrieves the next portion, with setting the index members properly - @return - <TRUE/> if and only if there is a next portion - */ - bool implRetrieveNextPortion( ); - - /** determine the ConversionDirection for m_sCurrentPortion - @return - <FALSE/> if and only if something went wrong - */ - bool implGetConversionDirectionForCurrentPortion( HHC::ConversionDirection& rDirection ); - - /** member m_aCurrentSuggestions and m_nCurrentEndIndex are updated according to the other settings and current dictionaries - - if _bAllowSearchNextConvertibleText is true _nStartAt is used as starting point to search the next - convertible text portion. This may result in changing of the member m_nCurrentStartIndex additionally. - - @return - <TRUE/> if Suggestions were found - */ - bool implUpdateSuggestions( const bool _bAllowSearchNextConvertibleText=false, const sal_Int32 _nStartAt=-1 ); - - /** reads the options from Hangul/Hanja Options dialog that are saved to configuration - */ - void implReadOptionsFromConfiguration(); - - /** get the string currently considered to be replaced or ignored - */ - ::rtl::OUString GetCurrentUnit() const; - - /** read options from configuration, update suggestion list and dialog content - */ - void implUpdateData(); - - /** get the conversion direction dependent from m_eConvType and m_eCurrentConversionDirection - in case of switching the direction is allowed this can be triggered with parameter bSwitchDirection - */ - sal_Int16 implGetConversionType( bool bSwitchDirection=false ) const; - }; - - //========================================================================= - //= HangulHanjaConversion_Impl - //========================================================================= - //------------------------------------------------------------------------- - // static member initialization - HangulHanjaConversion_Impl::StringMap HangulHanjaConversion_Impl::m_aRecentlyUsedList = HangulHanjaConversion_Impl::StringMap(); - - //------------------------------------------------------------------------- - HangulHanjaConversion_Impl::HangulHanjaConversion_Impl( Window* _pUIParent, - const Reference< XMultiServiceFactory >& _rxORB, - const Locale& _rSourceLocale, - const Locale& _rTargetLocale, - const Font* _pTargetFont, - sal_Int32 _nOptions, - sal_Bool _bIsInteractive, - HangulHanjaConversion* _pAntiImpl ) -: m_pConversionDialog( NULL ) -, m_pUIParent( _pUIParent ) -, m_xORB( _rxORB ) -, m_aSourceLocale( _rSourceLocale ) -, m_nSourceLang( SvxLocaleToLanguage( _rSourceLocale ) ) -, m_nTargetLang( SvxLocaleToLanguage( _rTargetLocale ) ) -, m_pTargetFont( _pTargetFont ) -, m_bIsInteractive( _bIsInteractive ) -, m_pAntiImpl( _pAntiImpl ) -, m_nCurrentPortionLang( LANGUAGE_NONE ) -, m_nCurrentStartIndex( 0 ) -, m_nCurrentEndIndex( 0 ) -, m_nReplacementBaseIndex( 0 ) -, m_nCurrentConversionOption( TextConversionOption::NONE ) -, m_nCurrentConversionType( -1 ) // not yet known -, m_bTryBothDirections( sal_True ) - { - implReadOptionsFromConfiguration(); - - DBG_ASSERT( m_xORB.is(), "HangulHanjaConversion_Impl::HangulHanjaConversion_Impl: no ORB!" ); - - // determine conversion type - if (m_nSourceLang == LANGUAGE_KOREAN && m_nTargetLang == LANGUAGE_KOREAN) - m_eConvType = HHC::eConvHangulHanja; - else if ( (m_nSourceLang == LANGUAGE_CHINESE_TRADITIONAL && m_nTargetLang == LANGUAGE_CHINESE_SIMPLIFIED) || - (m_nSourceLang == LANGUAGE_CHINESE_SIMPLIFIED && m_nTargetLang == LANGUAGE_CHINESE_TRADITIONAL) ) - m_eConvType = HHC::eConvSimplifiedTraditional; - else - { - DBG_ERROR( "failed to determine conversion type from languages" ); - } - - // set remaining conversion parameters to their default values - m_nConvOptions = _nOptions; - m_bByCharacter = 0 != (_nOptions & CHARACTER_BY_CHARACTER); - m_eConversionFormat = HHC::eSimpleConversion; - m_ePrimaryConversionDirection = HHC::eHangulToHanja; // used for eConvHangulHanja - m_eCurrentConversionDirection = HHC::eHangulToHanja; // used for eConvHangulHanja - - if ( m_xORB.is() ) - { - ::rtl::OUString sTextConversionService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.TextConversion" ) ); - m_xConverter = m_xConverter.query( m_xORB->createInstance( sTextConversionService ) ); - if ( !m_xConverter.is() ) - ShowServiceNotAvailableError( m_pUIParent, sTextConversionService, sal_True ); - } - - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion_Impl::createDialog() - { - DBG_ASSERT( m_bIsInteractive, "createDialog when the conversion should not be interactive?" ); - if ( m_bIsInteractive && !m_pConversionDialog ) - { - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - if(pFact) - { - m_pConversionDialog = pFact->CreateHangulHanjaConversionDialog(m_pUIParent, m_ePrimaryConversionDirection ); - DBG_ASSERT(m_pConversionDialog, "Dialogdiet fail!");//CHINA001 - - m_pConversionDialog->EnableRubySupport( m_pAntiImpl->HasRubySupport() ); - - m_pConversionDialog->SetByCharacter( m_bByCharacter ); - m_pConversionDialog->SetConversionFormat( m_eConversionFormat ); - m_pConversionDialog->SetConversionDirectionState( m_bTryBothDirections, m_ePrimaryConversionDirection ); - - // the handlers - m_pConversionDialog->SetOptionsChangedHdl( LINK( this, HangulHanjaConversion_Impl, OnOptionsChanged ) ); - m_pConversionDialog->SetIgnoreHdl( LINK( this, HangulHanjaConversion_Impl, OnIgnore ) ); - m_pConversionDialog->SetIgnoreAllHdl( LINK( this, HangulHanjaConversion_Impl, OnIgnoreAll ) ); - m_pConversionDialog->SetChangeHdl( LINK( this, HangulHanjaConversion_Impl, OnChange ) ); - m_pConversionDialog->SetChangeAllHdl( LINK( this, HangulHanjaConversion_Impl, OnChangeAll ) ); - m_pConversionDialog->SetClickByCharacterHdl( LINK( this, HangulHanjaConversion_Impl, OnByCharClicked ) ); - m_pConversionDialog->SetConversionFormatChangedHdl( LINK( this, HangulHanjaConversion_Impl, OnConversionTypeChanged ) ); - m_pConversionDialog->SetFindHdl( LINK( this, HangulHanjaConversion_Impl, OnFind ) ); - } - } - } - - //------------------------------------------------------------------------- - sal_Int16 HangulHanjaConversion_Impl::implGetConversionType( bool bSwitchDirection ) const - { - sal_Int16 nConversionType = -1; - if (m_eConvType == HHC::eConvHangulHanja) - nConversionType = HHC::eHangulToHanja == ( m_eCurrentConversionDirection && !bSwitchDirection ) ? TO_HANJA : TO_HANGUL; - else if (m_eConvType == HHC::eConvSimplifiedTraditional) - nConversionType = LANGUAGE_CHINESE_SIMPLIFIED == m_nTargetLang ? TO_SCHINESE : TO_TCHINESE; - DBG_ASSERT( nConversionType != -1, "unexpected conversion type" ); - return nConversionType; - } - - //------------------------------------------------------------------------- - bool HangulHanjaConversion_Impl::implUpdateSuggestions( bool _bAllowSearchNextConvertibleText, const sal_Int32 _nStartAt ) - { - // parameters for the converter - sal_Int32 nStartSearch = m_nCurrentStartIndex; - if( _bAllowSearchNextConvertibleText ) - nStartSearch = _nStartAt; - - sal_Int32 nLength = m_sCurrentPortion.getLength() - nStartSearch; - m_nCurrentConversionType = implGetConversionType(); - m_nCurrentConversionOption = IsByCharacter() ? CHARACTER_BY_CHARACTER : NONE; - if( m_bIgnorePostPositionalWord ) - m_nCurrentConversionOption = m_nCurrentConversionOption | IGNORE_POST_POSITIONAL_WORD; - - // no need to check both directions for chinese conversion (saves time) - if (m_eConvType == HHC::eConvSimplifiedTraditional) - m_bTryBothDirections = sal_False; - - sal_Bool bFoundAny = sal_True; - try - { - TextConversionResult aResult = m_xConverter->getConversions( - m_sCurrentPortion, - nStartSearch, - nLength, - m_aSourceLocale, - m_nCurrentConversionType, - m_nCurrentConversionOption - ); - sal_Bool bFoundPrimary = aResult.Boundary.startPos < aResult.Boundary.endPos; - bFoundAny = bFoundPrimary; - - if ( m_bTryBothDirections ) - { // see if we find another convertible when assuming the other direction - TextConversionResult aSecondResult = m_xConverter->getConversions( - m_sCurrentPortion, - nStartSearch, - nLength, - m_aSourceLocale, - implGetConversionType( true ), // switched! - m_nCurrentConversionOption - ); - if ( aSecondResult.Boundary.startPos < aSecondResult.Boundary.endPos ) - { // we indeed found such a convertible - - // in case the first attempt (with the original conversion direction) - // didn't find anything - if ( !bFoundPrimary - // or if the second location is _before_ the first one - || ( aSecondResult.Boundary.startPos < aResult.Boundary.startPos ) - ) - { - // then use the second finding - aResult = aSecondResult; - - // our current conversion direction changed now - m_eCurrentConversionDirection = ( HHC::eHangulToHanja == m_eCurrentConversionDirection ) - ? HHC::eHanjaToHangul : HHC::eHangulToHanja; - bFoundAny = sal_True; - } - } - } - - if( _bAllowSearchNextConvertibleText ) - { - //this might change the current position - m_aCurrentSuggestions = aResult.Candidates; - m_nCurrentStartIndex = aResult.Boundary.startPos; - m_nCurrentEndIndex = aResult.Boundary.endPos; - } - else - { - //the change of starting position is not allowed - if( m_nCurrentStartIndex == aResult.Boundary.startPos - && aResult.Boundary.endPos != aResult.Boundary.startPos ) - { - m_aCurrentSuggestions = aResult.Candidates; - m_nCurrentEndIndex = aResult.Boundary.endPos; - } - else - { - m_aCurrentSuggestions.realloc( 0 ); - if( m_sCurrentPortion.getLength() >= m_nCurrentStartIndex+1 ) - m_nCurrentEndIndex = m_nCurrentStartIndex+1; - } - } - - //put recently used string to front: - if( m_bShowRecentlyUsedFirst && m_aCurrentSuggestions.getLength()>1 ) - { - ::rtl::OUString sCurrentUnit( GetCurrentUnit() ); - StringMap::const_iterator aRecentlyUsed = m_aRecentlyUsedList.find( sCurrentUnit ); - bool bUsedBefore = aRecentlyUsed != m_aRecentlyUsedList.end(); - if( bUsedBefore && m_aCurrentSuggestions[0] != aRecentlyUsed->second ) - { - sal_Int32 nCount = m_aCurrentSuggestions.getLength(); - Sequence< ::rtl::OUString > aTmp(nCount); - aTmp[0]=aRecentlyUsed->second; - sal_Int32 nDiff = 1; - for( sal_Int32 n=1; n<nCount; n++)//we had 0 already - { - if( nDiff && m_aCurrentSuggestions[n-nDiff]==aRecentlyUsed->second ) - nDiff=0; - aTmp[n]=m_aCurrentSuggestions[n-nDiff]; - } - m_aCurrentSuggestions = aTmp; - } - } - } - catch( const Exception& ) - { - DBG_ERROR( "HangulHanjaConversion_Impl::implNextConvertibleUnit: caught an exception!" ); - - //!!! at least we want to move on in the text in order - //!!! to avoid an endless loop... - return false; - } - return bFoundAny; - } - - //------------------------------------------------------------------------- - bool HangulHanjaConversion_Impl::implNextConvertibleUnit( const sal_Int32 _nStartAt ) - { - m_aCurrentSuggestions.realloc( 0 ); - - // ask the TextConversion service for the next convertible piece of text - - // get current values from dialog - if( m_eConvType == HHC::eConvHangulHanja && m_pConversionDialog ) - { - m_bTryBothDirections = m_pConversionDialog->GetUseBothDirections(); - HHC::ConversionDirection eDialogDirection = HHC::eHangulToHanja; - eDialogDirection = m_pConversionDialog->GetDirection( eDialogDirection ); - - if( !m_bTryBothDirections && eDialogDirection != m_eCurrentConversionDirection ) - { - m_eCurrentConversionDirection = eDialogDirection; - } - - // save curently used value for possible later use - m_pAntiImpl->m_bTryBothDirectionsSave = m_bTryBothDirections; - m_pAntiImpl->m_ePrimaryConversionDirectionSave = m_eCurrentConversionDirection; - } - - bool bFoundAny = implUpdateSuggestions( true, _nStartAt ); - - return bFoundAny && - (m_nCurrentStartIndex < m_sCurrentPortion.getLength()); - } - - //------------------------------------------------------------------------- - bool HangulHanjaConversion_Impl::implRetrieveNextPortion( ) - { - sal_Bool bAllowImplicitChanges = m_eConvType == HHC::eConvSimplifiedTraditional; - - m_sCurrentPortion = ::rtl::OUString(); - m_nCurrentPortionLang = LANGUAGE_NONE; - m_pAntiImpl->GetNextPortion( m_sCurrentPortion, m_nCurrentPortionLang, bAllowImplicitChanges ); - m_nReplacementBaseIndex = 0; - m_nCurrentStartIndex = m_nCurrentEndIndex = 0; - - bool bRet = 0 != m_sCurrentPortion.getLength(); - - if (m_eConvType == HHC::eConvHangulHanja && m_bTryBothDirections) - implGetConversionDirectionForCurrentPortion( m_eCurrentConversionDirection ); - - return bRet; - } - - //------------------------------------------------------------------------- - sal_Bool HangulHanjaConversion_Impl::implNextConvertible( bool _bRepeatUnit ) - { - if ( _bRepeatUnit || ( m_nCurrentEndIndex < m_sCurrentPortion.getLength() ) ) - { - if ( implNextConvertibleUnit( - _bRepeatUnit - ? ( IsByCharacter() ? m_nCurrentStartIndex : m_nCurrentStartIndex ) - : m_nCurrentEndIndex - ) ) - return sal_True; - } - - // no convertible text in the current portion anymore - // -> advance to the next portion - do - { - // next portion - if ( implRetrieveNextPortion( ) ) - { // there is a next portion - // -> find the next convertible unit in the current portion - if ( implNextConvertibleUnit( 0 ) ) - return sal_True; - } - } - while ( m_sCurrentPortion.getLength() ); - - // no more portions - return sal_False; - } - - //------------------------------------------------------------------------- - ::rtl::OUString HangulHanjaConversion_Impl::GetCurrentUnit() const - { - DBG_ASSERT( m_nCurrentStartIndex < m_sCurrentPortion.getLength(), - "HangulHanjaConversion_Impl::GetCurrentUnit: invalid index into current portion!" ); - DBG_ASSERT( m_nCurrentEndIndex <= m_sCurrentPortion.getLength(), - "HangulHanjaConversion_Impl::GetCurrentUnit: invalid index into current portion!" ); - DBG_ASSERT( m_nCurrentStartIndex <= m_nCurrentEndIndex, - "HangulHanjaConversion_Impl::GetCurrentUnit: invalid interval!" ); - - ::rtl::OUString sCurrentUnit = m_sCurrentPortion.copy( m_nCurrentStartIndex, m_nCurrentEndIndex - m_nCurrentStartIndex ); - return sCurrentUnit; - } - - //------------------------------------------------------------------------- - sal_Bool HangulHanjaConversion_Impl::ContinueConversion( bool _bRepeatCurrentUnit ) - { - sal_Bool bNeedUserInteraction = sal_False; // when we leave here, do we need user interaction? - sal_Bool bDocumentDone = sal_False; // did we already check the whole document? - - while ( !bDocumentDone && !bNeedUserInteraction && implNextConvertible( _bRepeatCurrentUnit ) ) - { - ::rtl::OUString sCurrentUnit( GetCurrentUnit() ); - - // do we need to ignore it? - sal_Bool bAlwaysIgnoreThis = m_sIgnoreList.end() != m_sIgnoreList.find( sCurrentUnit ); - - // do we need to change it? - StringMap::const_iterator aChangeListPos = m_aChangeList.find( sCurrentUnit ); - sal_Bool bAlwaysChangeThis = m_aChangeList.end() != aChangeListPos; - - // do we automatically change this? - sal_Bool bAutoChange = m_bAutoReplaceUnique && m_aCurrentSuggestions.getLength() == 1; - - if (!m_bIsInteractive) - { - // silent conversion (e.g. for simplified/traditional Chinese)... - if(m_aCurrentSuggestions.getLength()>0) - implChange( m_aCurrentSuggestions.getConstArray()[0] ); - } - else if (bAutoChange) - { - implChange( m_aCurrentSuggestions.getConstArray()[0] ); - } - else if ( bAlwaysChangeThis ) - { - implChange( aChangeListPos->second ); - } - else if ( !bAlwaysIgnoreThis ) - { - // here we need to ask the user for what to do with the text - // for this, allow derivees to highlight the current text unit in a possible document view - m_pAntiImpl->HandleNewUnit( m_nCurrentStartIndex - m_nReplacementBaseIndex, m_nCurrentEndIndex - m_nReplacementBaseIndex ); - - DBG_ASSERT( m_pConversionDialog, "we should always have a dialog here!" ); - if( m_pConversionDialog ) - m_pConversionDialog->SetCurrentString( sCurrentUnit, m_aCurrentSuggestions ); - - // do not look for the next convertible: We have to wait for the user to interactivly - // decide what happens with the current convertible - bNeedUserInteraction = sal_True; - } - } - - /* - if ( bDocumentDone ) - return sal_True; // we explicitly know that the complete document is done - else if ( bNeedUserInteraction ) - return sal_False; // the doc is not done, we found a convertible, but need the user to decide - else - return sal_True; // we did not find a next convertible, so the document is implicitly done - */ - - return bDocumentDone || !bNeedUserInteraction; - } - - //------------------------------------------------------------------------- - bool HangulHanjaConversion_Impl::implGetConversionDirectionForCurrentPortion( HHC::ConversionDirection& rDirection ) - { - // - For eConvHangulHanja the direction is determined by - // the first encountered Korean character. - // - For eConvSimplifiedTraditional the conversion direction - // is already specified by the source language. - - bool bSuccess = true; - - if (m_eConvType == HHC::eConvHangulHanja) - { - bSuccess = false; - try - { - // get the break iterator service - ::rtl::OUString sBreakIteratorService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.BreakIterator" ) ); - Reference< XInterface > xBI( m_xORB->createInstance( ::rtl::OUString( sBreakIteratorService ) ) ); - Reference< XBreakIterator > xBreakIter( xBI, UNO_QUERY ); - if ( !xBreakIter.is() ) - { - ShowServiceNotAvailableError( m_pUIParent, sBreakIteratorService, sal_True ); - } - else - { - sal_Int32 nNextAsianScript = xBreakIter->beginOfScript( m_sCurrentPortion, m_nCurrentStartIndex, com::sun::star::i18n::ScriptType::ASIAN ); - if ( -1 == nNextAsianScript ) - nNextAsianScript = xBreakIter->nextScript( m_sCurrentPortion, m_nCurrentStartIndex, com::sun::star::i18n::ScriptType::ASIAN ); - if ( ( nNextAsianScript >= m_nCurrentStartIndex ) && ( nNextAsianScript < m_sCurrentPortion.getLength() ) ) - { // found asian text - - // determine if it's Hangul - CharClass aCharClassificaton( m_xORB, m_aSourceLocale ); - sal_Int16 nScript = aCharClassificaton.getScript( m_sCurrentPortion, sal::static_int_cast< USHORT >(nNextAsianScript) ); - if ( ( UnicodeScript_kHangulJamo == nScript ) - || ( UnicodeScript_kHangulCompatibilityJamo == nScript ) - || ( UnicodeScript_kHangulSyllable == nScript ) - ) - { - rDirection = HHC::eHangulToHanja; - } - else - { - rDirection = HHC::eHanjaToHangul; - } - - bSuccess = true; - } - } - } - catch( const Exception& ) - { - DBG_ERROR( "HangulHanjaConversion_Impl::implGetConversionDirectionForCurrentPortion: caught an exception!" ); - } - } - - return bSuccess; - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion_Impl::DoDocumentConversion( ) - { - // clear the change-all list - it's to be re-initialized for every single document - { - StringMap aEmpty; - m_aChangeList.swap( aEmpty ); - } - - // first of all, we need to guess the direction of our conversion - it is determined by the first - // hangul or hanja character in the first text - if ( !implRetrieveNextPortion() ) - { - DBG_WARNING( "HangulHanjaConversion_Impl::DoDocumentConversion: why did you call me if you do have nothing to convert?" ); - // nothing to do - return; - } - if( m_eConvType == HHC::eConvHangulHanja ) - { - //init conversion direction from saved value - HHC::ConversionDirection eDirection = HHC::eHangulToHanja; - if(!implGetConversionDirectionForCurrentPortion( eDirection )) - // something went wrong, has already been asserted - return; - - if (m_pAntiImpl->IsUseSavedConversionDirectionState()) - { - m_ePrimaryConversionDirection = m_pAntiImpl->m_ePrimaryConversionDirectionSave; - m_bTryBothDirections = m_pAntiImpl->m_bTryBothDirectionsSave; - if( m_bTryBothDirections ) - m_eCurrentConversionDirection = eDirection; - else - m_eCurrentConversionDirection = m_ePrimaryConversionDirection; - } - else - { - m_ePrimaryConversionDirection = eDirection; - m_eCurrentConversionDirection = eDirection; - } - } - - if (m_bIsInteractive && m_eConvType == HHC::eConvHangulHanja) - { - //always open dialog if at least having a hangul or hanja text portion - createDialog(); - if(m_pAntiImpl->IsUseSavedConversionDirectionState()) - ContinueConversion( sal_False ); - else - implUpdateData(); - m_pConversionDialog->Execute(); - DELETEZ( m_pConversionDialog ); - } - else - { -#ifdef DBG_UTIL - sal_Bool bCompletelyDone = -#endif - ContinueConversion( sal_False ); - DBG_ASSERT( bCompletelyDone, "HangulHanjaConversion_Impl::DoDocumentConversion: ContinueConversion should have returned true here!" ); - } - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion_Impl::implProceed( bool _bRepeatCurrentUnit ) - { - if ( ContinueConversion( _bRepeatCurrentUnit ) ) - { // we're done with the whole document - DBG_ASSERT( !m_bIsInteractive || m_pConversionDialog, "HangulHanjaConversion_Impl::implProceed: we should not reach this here without dialog!" ); - if ( m_pConversionDialog ) - m_pConversionDialog->EndDialog( RET_OK ); - } - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion_Impl::implChange( const ::rtl::OUString& _rChangeInto ) - { - if( !_rChangeInto.getLength() ) - return; - - // translate the conversion format into a replacement action - // this translation depends on whether we have a Hangul original, or a Hanja original - - HHC::ReplacementAction eAction( HHC::eExchange ); - - if (m_eConvType == HHC::eConvHangulHanja) - { - // is the original we're about to change in Hangul? - sal_Bool bOriginalIsHangul = HHC::eHangulToHanja == m_eCurrentConversionDirection; - - switch ( m_eConversionFormat ) - { - case HHC::eSimpleConversion: eAction = HHC::eExchange; break; - case HHC::eHangulBracketed: eAction = bOriginalIsHangul ? HHC::eOriginalBracketed : HHC::eReplacementBracketed; break; - case HHC::eHanjaBracketed: eAction = bOriginalIsHangul ? HHC::eReplacementBracketed : HHC::eOriginalBracketed; break; - case HHC::eRubyHanjaAbove: eAction = bOriginalIsHangul ? HHC::eReplacementAbove : HHC::eOriginalAbove; break; - case HHC::eRubyHanjaBelow: eAction = bOriginalIsHangul ? HHC::eReplacementBelow : HHC::eOriginalBelow; break; - case HHC::eRubyHangulAbove: eAction = bOriginalIsHangul ? HHC::eOriginalAbove : HHC::eReplacementAbove; break; - case HHC::eRubyHangulBelow: eAction = bOriginalIsHangul ? HHC::eOriginalBelow : HHC::eReplacementBelow; break; - default: - DBG_ERROR( "HangulHanjaConversion_Impl::implChange: invalid/unexpected conversion format!" ); - } - } - - // the proper indicies (the wrapper implementation needs indicies relative to the - // previous replacement) - DBG_ASSERT( ( m_nReplacementBaseIndex <= m_nCurrentStartIndex ) && ( m_nReplacementBaseIndex <= m_nCurrentEndIndex ), - "HangulHanjaConversion_Impl::implChange: invalid replacement base!" ); - - sal_Int32 nStartIndex = m_nCurrentStartIndex - m_nReplacementBaseIndex; - sal_Int32 nEndIndex = m_nCurrentEndIndex - m_nReplacementBaseIndex; - - //remind this decision - m_aRecentlyUsedList[ GetCurrentUnit() ] = _rChangeInto; - - LanguageType *pNewUnitLang = 0; - LanguageType nNewUnitLang = LANGUAGE_NONE; - if (m_eConvType == HHC::eConvSimplifiedTraditional) - { - // check if language needs to be changed - if ( m_pAntiImpl->GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL && - !m_pAntiImpl->IsTraditional( m_nCurrentPortionLang )) - nNewUnitLang = LANGUAGE_CHINESE_TRADITIONAL; - else if ( m_pAntiImpl->GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED && - !m_pAntiImpl->IsSimplified( m_nCurrentPortionLang )) - nNewUnitLang = LANGUAGE_CHINESE_SIMPLIFIED; - if (nNewUnitLang != LANGUAGE_NONE) - pNewUnitLang = &nNewUnitLang; - } - - // according to FT we should not (yet) bother about Hangul/Hanja conversion here - // - // aOffsets is needed in ReplaceUnit below in order to to find out - // exactly which characters are really changed in order to keep as much - // from attributation for the text as possible. - Sequence< sal_Int32 > aOffsets; - Reference< XExtendedTextConversion > xExtConverter( m_xConverter, UNO_QUERY ); - if (m_eConvType == HHC::eConvSimplifiedTraditional && xExtConverter.is()) - { - try - { - ::rtl::OUString aConvText = xExtConverter->getConversionWithOffset( - m_sCurrentPortion, - m_nCurrentStartIndex, - m_nCurrentEndIndex - m_nCurrentStartIndex, - m_aSourceLocale, - m_nCurrentConversionType, - m_nCurrentConversionOption, - aOffsets - ); - } - catch( const Exception& ) - { - DBG_ERROR( "HangulHanjaConversion_Impl::implChange: caught unexpected exception!" ); - aOffsets.realloc(0); - } - } - - // do the replacement - m_pAntiImpl->ReplaceUnit( nStartIndex, nEndIndex, m_sCurrentPortion, - _rChangeInto, aOffsets, eAction, pNewUnitLang ); - - - // adjust the replacement base - m_nReplacementBaseIndex = m_nCurrentEndIndex; - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion_Impl::implReadOptionsFromConfiguration() - { - SvtLinguConfig aLngCfg; - aLngCfg.GetProperty( UPH_IS_IGNORE_POST_POSITIONAL_WORD ) >>= m_bIgnorePostPositionalWord; - aLngCfg.GetProperty( UPH_IS_SHOW_ENTRIES_RECENTLY_USED_FIRST ) >>= m_bShowRecentlyUsedFirst; - aLngCfg.GetProperty( UPH_IS_AUTO_REPLACE_UNIQUE_ENTRIES ) >>= m_bAutoReplaceUnique; - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion_Impl::implUpdateData() - { - implReadOptionsFromConfiguration(); - implUpdateSuggestions(); - - if(m_pConversionDialog) - { - ::rtl::OUString sCurrentUnit( GetCurrentUnit() ); - - m_pConversionDialog->SetCurrentString( sCurrentUnit, m_aCurrentSuggestions ); - m_pConversionDialog->FocusSuggestion(); - } - - m_pAntiImpl->HandleNewUnit( m_nCurrentStartIndex - m_nReplacementBaseIndex, m_nCurrentEndIndex - m_nReplacementBaseIndex ); - } - - //------------------------------------------------------------------------- - IMPL_LINK( HangulHanjaConversion_Impl, OnOptionsChanged, void*, EMPTYARG ) - { - //options and dictionaries might have been changed - //-> update our internal settings and the dialog - implUpdateData(); - - return 0L; - } - - //------------------------------------------------------------------------- - IMPL_LINK( HangulHanjaConversion_Impl, OnIgnore, void*, EMPTYARG ) - { - // simply ignore, and proceed - implProceed( sal_False ); - return 0L; - } - - //------------------------------------------------------------------------- - IMPL_LINK( HangulHanjaConversion_Impl, OnIgnoreAll, void*, EMPTYARG ) - { - DBG_ASSERT( m_pConversionDialog, "HangulHanjaConversion_Impl::OnIgnoreAll: no dialog! How this?" ); - - if ( m_pConversionDialog ) - { - String sCurrentUnit = m_pConversionDialog->GetCurrentString(); - DBG_ASSERT( m_sIgnoreList.end() == m_sIgnoreList.find( sCurrentUnit ), - "HangulHanjaConversion_Impl, OnIgnoreAll: shouldn't this have been ignored before" ); - - // put into the "ignore all" list - m_sIgnoreList.insert( sCurrentUnit ); - - // and proceed - implProceed( sal_False ); - } - - return 0L; - } - - //------------------------------------------------------------------------- - IMPL_LINK( HangulHanjaConversion_Impl, OnChange, void*, EMPTYARG ) - { - // change - DBG_ASSERT( m_pConversionDialog, "we should always have a dialog here!" ); - if( m_pConversionDialog ) - implChange( m_pConversionDialog->GetCurrentSuggestion( ) ); - // and proceed - implProceed( sal_False ); - - return 0L; - } - - //------------------------------------------------------------------------- - IMPL_LINK( HangulHanjaConversion_Impl, OnChangeAll, void*, EMPTYARG ) - { - DBG_ASSERT( m_pConversionDialog, "HangulHanjaConversion_Impl::OnChangeAll: no dialog! How this?" ); - if ( m_pConversionDialog ) - { - ::rtl::OUString sCurrentUnit( m_pConversionDialog->GetCurrentString() ); - ::rtl::OUString sChangeInto( m_pConversionDialog->GetCurrentSuggestion( ) ); - - if( sChangeInto.getLength() ) - { - // change the current occurence - implChange( sChangeInto ); - - // put into the "change all" list - m_aChangeList.insert( StringMap::value_type( sCurrentUnit, sChangeInto ) ); - } - - // and proceed - implProceed( sal_False ); - } - - return 0L; - } - - //------------------------------------------------------------------------- - IMPL_LINK( HangulHanjaConversion_Impl, OnByCharClicked, CheckBox*, _pBox ) - { - m_bByCharacter = _pBox->IsChecked(); - - // continue conversion, without advancing to the next unit, but instead continuing with the current unit - implProceed( sal_True ); - return 0L; - } - - //------------------------------------------------------------------------- - IMPL_LINK( HangulHanjaConversion_Impl, OnConversionTypeChanged, void*, EMPTYARG ) - { - DBG_ASSERT( m_pConversionDialog, "we should always have a dialog here!" ); - if( m_pConversionDialog ) - m_eConversionFormat = m_pConversionDialog->GetConversionFormat( ); - return 0L; - } - - //------------------------------------------------------------------------- - IMPL_LINK( HangulHanjaConversion_Impl, OnFind, void*, EMPTYARG ) - { - DBG_ASSERT( m_pConversionDialog, "HangulHanjaConversion_Impl::OnFind: where did this come from?" ); - if ( m_pConversionDialog ) - { - try - { - ::rtl::OUString sNewOriginal( m_pConversionDialog->GetCurrentSuggestion( ) ); - Sequence< ::rtl::OUString > aSuggestions; - - DBG_ASSERT( m_xConverter.is(), "HangulHanjaConversion_Impl::OnFind: no converter!" ); - TextConversionResult aToHanja = m_xConverter->getConversions( - sNewOriginal, - 0, sNewOriginal.getLength(), - m_aSourceLocale, - TextConversionType::TO_HANJA, - TextConversionOption::NONE - ); - TextConversionResult aToHangul = m_xConverter->getConversions( - sNewOriginal, - 0, sNewOriginal.getLength(), - m_aSourceLocale, - TextConversionType::TO_HANGUL, - TextConversionOption::NONE - ); - - bool bHaveToHanja = ( aToHanja.Boundary.startPos < aToHanja.Boundary.endPos ); - bool bHaveToHangul = ( aToHangul.Boundary.startPos < aToHangul.Boundary.endPos ); - - TextConversionResult* pResult = NULL; - if ( bHaveToHanja && bHaveToHangul ) - { // it found convertibles in both directions -> use the first - if ( aToHangul.Boundary.startPos < aToHanja.Boundary.startPos ) - pResult = &aToHangul; - else - pResult = &aToHanja; - } - else if ( bHaveToHanja ) - { // only found toHanja - pResult = &aToHanja; - } - else - { // only found toHangul - pResult = &aToHangul; - } - if ( pResult ) - aSuggestions = pResult->Candidates; - - m_pConversionDialog->SetCurrentString( sNewOriginal, aSuggestions, false ); - m_pConversionDialog->FocusSuggestion(); - } - catch( const Exception& ) - { - DBG_ERROR( "HangulHanjaConversion_Impl::OnFind: caught an exception!" ); - } - } - return 0L; - } - - //========================================================================= - //= HangulHanjaConversion - //========================================================================= - //------------------------------------------------------------------------- - - // static member initialization - sal_Bool HangulHanjaConversion::m_bUseSavedValues = sal_False; - sal_Bool HangulHanjaConversion::m_bTryBothDirectionsSave = sal_False; - HHC::ConversionDirection HangulHanjaConversion::m_ePrimaryConversionDirectionSave = HHC::eHangulToHanja; - - //------------------------------------------------------------------------- - HangulHanjaConversion::HangulHanjaConversion( Window* _pUIParent, - const Reference< XMultiServiceFactory >& _rxORB, - const Locale& _rSourceLocale, const Locale& _rTargetLocale, - const Font* _pTargetFont, - sal_Int32 _nOptions, sal_Bool _bIsInteractive) - :m_pImpl( new HangulHanjaConversion_Impl( _pUIParent, _rxORB, _rSourceLocale, _rTargetLocale, _pTargetFont, _nOptions, _bIsInteractive, this ) ) - { - } - - //------------------------------------------------------------------------- - HangulHanjaConversion::~HangulHanjaConversion( ) - { - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion::SetUseSavedConversionDirectionState( sal_Bool bVal ) - { - m_bUseSavedValues = bVal; - } - - //------------------------------------------------------------------------- - sal_Bool HangulHanjaConversion::IsUseSavedConversionDirectionState() - { - return m_bUseSavedValues; - } - - //------------------------------------------------------------------------- - LanguageType HangulHanjaConversion::GetSourceLanguage( ) const - { - return m_pImpl->GetSourceLang(); - } - - //------------------------------------------------------------------------- - LanguageType HangulHanjaConversion::GetTargetLanguage( ) const - { - return m_pImpl->GetTargetLang(); - } - - //------------------------------------------------------------------------- - const Font * HangulHanjaConversion::GetTargetFont( ) const - { - return m_pImpl->GetTargetFont(); - } - - //------------------------------------------------------------------------- - sal_Int32 HangulHanjaConversion::GetConversionOptions( ) const - { - return m_pImpl->GetConvOptions(); - } - - //------------------------------------------------------------------------- - sal_Bool HangulHanjaConversion::IsInteractive( ) const - { - return m_pImpl->IsInteractive(); - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion::HandleNewUnit( const sal_Int32, const sal_Int32 ) - { - // nothing to do, only derived classes need this. - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion::GetNextPortion( ::rtl::OUString&, LanguageType&, sal_Bool ) - { - DBG_ERROR( "HangulHanjaConversion::GetNextPortion: to be overridden!" ); - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion::ReplaceUnit( - const sal_Int32, const sal_Int32, - const ::rtl::OUString&, - const ::rtl::OUString&, - const ::com::sun::star::uno::Sequence< sal_Int32 > &, - ReplacementAction, - LanguageType * ) - { - DBG_ERROR( "HangulHanjaConversion::ReplaceUnit: to be overridden!" ); - } - - //------------------------------------------------------------------------- - sal_Bool HangulHanjaConversion::HasRubySupport() const - { - DBG_ERROR( "HangulHanjaConversion::HasRubySupport: to be overridden!" ); - return sal_False; - } - - //------------------------------------------------------------------------- - void HangulHanjaConversion::ConvertDocument() - { - if ( m_pImpl->IsValid() ) - m_pImpl->DoDocumentConversion( ); - } - -//............................................................................. -} // namespace svx -//............................................................................. - diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 741df55c960a..729d4f748921 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hdft.cxx,v $ - * $Revision: 1.19 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -42,17 +39,7 @@ #include <svx/dialogs.hrc> #include "hdft.hrc" - - - - - - - - - - - +#include <svl/intitem.hxx> #define _SVX_HDFT_CXX @@ -63,12 +50,12 @@ #include <svx/dialmgr.hxx> #include "htmlmode.hxx" -#include <svx/brshitem.hxx> -#include <svx/lrspitem.hxx> -#include <svx/ulspitem.hxx> -#include <svx/shaditem.hxx> -#include <svx/sizeitem.hxx> -#include <svx/boxitem.hxx> +#include <editeng/brshitem.hxx> +#include <editeng/lrspitem.hxx> +#include <editeng/ulspitem.hxx> +#include <editeng/shaditem.hxx> +#include <editeng/sizeitem.hxx> +#include <editeng/boxitem.hxx> #include <svx/svxdlg.hxx> //CHINA001 #include <svx/dialogs.hrc> //CHINA001 @@ -188,7 +175,7 @@ SvxHFPage::SvxHFPage( Window* pParent, USHORT nResId, const SfxItemSet& rAttr, U FreeResource(); // Metrik einstellen - FieldUnit eFUnit = GetModuleFieldUnit( &rAttr ); + FieldUnit eFUnit = GetModuleFieldUnit( rAttr ); SetFieldUnit( aDistEdit, eFUnit ); SetFieldUnit( aHeightEdit, eFUnit ); SetFieldUnit( aLMEdit, eFUnit ); diff --git a/svx/source/dialog/hdft.hrc b/svx/source/dialog/hdft.hrc index e9bc1509b2b0..e9c72c38b45f 100644 --- a/svx/source/dialog/hdft.hrc +++ b/svx/source/dialog/hdft.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hdft.hrc,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/hdft.src b/svx/source/dialog/hdft.src index 4b8962a28c77..e93d18ff351f 100644 --- a/svx/source/dialog/hdft.src +++ b/svx/source/dialog/hdft.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hdft.src,v $ - * $Revision: 1.52 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/hyperdlg.cxx b/svx/source/dialog/hyperdlg.cxx index ad5854e8bb9c..6828f222facc 100644 --- a/svx/source/dialog/hyperdlg.cxx +++ b/svx/source/dialog/hyperdlg.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hyperdlg.cxx,v $ - * $Revision: 1.23 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/hyphen.cxx b/svx/source/dialog/hyphen.cxx deleted file mode 100755 index 0fedaf7f5cf8..000000000000 --- a/svx/source/dialog/hyphen.cxx +++ /dev/null @@ -1,575 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hyphen.cxx,v $ - * $Revision: 1.14 $ - * - * 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_svx.hxx" - -// include --------------------------------------------------------------- -#include <tools/shl.hxx> -#include <tools/list.hxx> -#include <com/sun/star/linguistic2/XPossibleHyphens.hpp> -#include <vcl/msgbox.hxx> - - -#define _SVX_HYPHEN_CXX - -#include <svx/dialogs.hrc> -#include "hyphen.hrc" - -#include <svx/svxenum.hxx> -#include "hyphen.hxx" -#include <svx/splwrap.hxx> -#include "dlgutil.hxx" -#include <svx/dialmgr.hxx> -#include <unolingu.hxx> - -using namespace ::com::sun::star; - - -// define ---------------------------------------------------------------- - -#define HYPHHERE '-' -#define CONTINUE_HYPH USHRT_MAX - -// Dies ist nur ein Hack, weil an dieser Stelle das extern char aus hmwrap -// nicht bekannt ist, wird demnaechst in hmwrap durch ein define ersetzt. -#define SW_SOFT_HYPHEN '=' - -// class SvxHyphenEdit --------------------------------------------------- - -SvxHyphenEdit::SvxHyphenEdit( Window* pParent, const ResId& rResId ) : - - Edit( pParent, rResId ) -{ -} - -// ----------------------------------------------------------------------- - -void SvxHyphenEdit::KeyInput( const KeyEvent& rKEvt ) -{ -// sal_uInt16 nMod = rKEvt.GetKeyCode().GetModifier(); - sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); - - switch ( nCode ) - { - case KEY_LEFT: - ( (SvxHyphenWordDialog*)GetParent() )->SelLeft(); - break; - - case KEY_RIGHT: - ( (SvxHyphenWordDialog*)GetParent() )->SelRight(); - break; - - case KEY_TAB: - case KEY_ESCAPE: - case KEY_RETURN: - Edit::KeyInput(rKEvt); - break; - default: - Control::KeyInput( rKEvt ); // An den Dialog weiterleiten - break; - } -} - -// struct SvxHyphenWordDialog_Impl --------------------------------------------- - -struct SvxHyphenWordDialog_Impl -{ - FixedText aWordFT; - SvxHyphenEdit aWordEdit; - ImageButton aLeftBtn; - ImageButton aRightBtn; - OKButton aOkBtn; - PushButton aContBtn; - PushButton aDelBtn; - FixedLine aFLBottom;
- HelpButton aHelpBtn; - PushButton aHyphAll; - CancelButton aCancelBtn; - String aLabel; - SvxSpellWrapper* pHyphWrapper; - uno::Reference< linguistic2::XHyphenator > xHyphenator; - uno::Reference< linguistic2::XPossibleHyphens > xPossHyph; - String aActWord; // actual (to be displayed) word - LanguageType nActLanguage; // and language - sal_uInt16 nMaxHyphenationPos; // right most valid hyphenation pos - sal_uInt16 nHyphPos; - sal_uInt16 nOldPos; - sal_Bool bBusy; - - SvxHyphenWordDialog_Impl( Window* pParent ); - ~SvxHyphenWordDialog_Impl(); -}; - - -SvxHyphenWordDialog_Impl::SvxHyphenWordDialog_Impl( Window* pParent ) : - aWordFT ( pParent, SVX_RES( FT_WORD ) ), - aWordEdit ( pParent, SVX_RES( ED_WORD ) ), - aLeftBtn ( pParent, SVX_RES( BTN_LEFT ) ), - aRightBtn ( pParent, SVX_RES( BTN_RIGHT ) ), - aOkBtn ( pParent, SVX_RES( BTN_HYPH_CUT ) ), - aContBtn ( pParent, SVX_RES( BTN_HYPH_CONTINUE ) ), - aDelBtn ( pParent, SVX_RES( BTN_HYPH_DELETE ) ), - aFLBottom ( pParent, SVX_RES( FL_BOTTOM ) ), - aHelpBtn ( pParent, SVX_RES( BTN_HYPH_HELP ) ), - aHyphAll ( pParent, SVX_RES( BTN_HYPH_ALL ) ), - aCancelBtn ( pParent, SVX_RES( BTN_HYPH_CANCEL ) ), - aLabel ( ), - pHyphWrapper ( NULL ), - xHyphenator ( NULL ), - xPossHyph ( NULL ), - aActWord ( ), - nActLanguage ( LANGUAGE_NONE ), - nMaxHyphenationPos ( 0 ), - nHyphPos ( 0 ), - nOldPos ( 0 ), - bBusy ( sal_False ) -{ -} - - -SvxHyphenWordDialog_Impl::~SvxHyphenWordDialog_Impl() -{ -} - -// class SvxHyphenWordDialog --------------------------------------------- - -SvxHyphenWordDialog::SvxHyphenWordDialog( - const String &rWord, LanguageType nLang, - Window* pParent, - uno::Reference< linguistic2::XHyphenator > &xHyphen, - SvxSpellWrapper* pWrapper ) : - - SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_HYPHENATE ) ) -{ - m_pImpl = boost::shared_ptr< SvxHyphenWordDialog_Impl >(new SvxHyphenWordDialog_Impl( this )); - - FreeResource(); - - m_pImpl->aLabel = GetText(); - m_pImpl->pHyphWrapper = pWrapper; - m_pImpl->xHyphenator = xHyphen; - m_pImpl->aActWord = rWord; - m_pImpl->nActLanguage = nLang; - - m_pImpl->aLeftBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Left_Impl ) ); - m_pImpl->aRightBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, Right_Impl ) ); - m_pImpl->aOkBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, CutHdl_Impl ) ); - m_pImpl->aContBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, ContinueHdl_Impl ) ); - m_pImpl->aDelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, DeleteHdl_Impl ) ); - m_pImpl->aHyphAll.SetClickHdl( LINK( this, SvxHyphenWordDialog, HyphenateAllHdl_Impl ) ); - m_pImpl->aCancelBtn.SetClickHdl( LINK( this, SvxHyphenWordDialog, CancelHdl_Impl ) ); - m_pImpl->aWordEdit.SetGetFocusHdl( LINK( this, SvxHyphenWordDialog, GetFocusHdl_Impl ) ); - - uno::Reference< linguistic2::XHyphenatedWord > xHyphWord( pWrapper ? - pWrapper->GetLast() : uno::Reference< uno::XInterface > () , uno::UNO_QUERY ); - DBG_ASSERT(xHyphWord.is(), "missing hyphenated word"); - m_pImpl->nMaxHyphenationPos = xHyphWord.is() ? xHyphWord->getHyphenationPos() : 0; - SetLabel_Impl( nLang ); - - InitControls_Impl(); - m_pImpl->aWordEdit.GrabFocus(); - - // disable controls if service is not available - if (!m_pImpl->xHyphenator.is()) - Enable( sal_False ); -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::SelLeft() -{ - String aTxt( m_pImpl->aWordEdit.GetText() ); - - for ( xub_StrLen i = m_pImpl->nOldPos + 1; i-- > 0 ; ) - { - DBG_ASSERT(i <= aTxt.Len(), "index out of range"); - if( aTxt.GetChar( i ) == sal_Unicode( SW_SOFT_HYPHEN ) ) - { - aTxt.SetChar( i, sal_Unicode( HYPHHERE ) ); - - if ( m_pImpl->nOldPos != 0 && m_pImpl->nOldPos != aTxt.Len() ) - aTxt.SetChar( m_pImpl->nOldPos, sal_Unicode( SW_SOFT_HYPHEN ) ); - m_pImpl->nOldPos = i; - m_pImpl->aWordEdit.SetText( aTxt ); - m_pImpl->aWordEdit.GrabFocus(); - m_pImpl->aWordEdit.SetSelection( Selection( i, i + 1 ) ); - break; - } - } - m_pImpl->nHyphPos = GetHyphIndex_Impl(); - EnableLRBtn_Impl(); -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::SelRight() -{ - String aTxt( m_pImpl->aWordEdit.GetText() ); - - for ( xub_StrLen i = m_pImpl->nOldPos + 1; i < aTxt.Len(); ++i ) - { - if( aTxt.GetChar( i ) == sal_Unicode( SW_SOFT_HYPHEN ) ) - { - aTxt.SetChar( i, sal_Unicode( HYPHHERE ) ); - - if ( m_pImpl->nOldPos != 0 && m_pImpl->nOldPos != aTxt.Len() ) - aTxt.SetChar( m_pImpl->nOldPos, sal_Unicode( SW_SOFT_HYPHEN ) ); - m_pImpl->nOldPos = i; - m_pImpl->aWordEdit.SetText( aTxt ); - m_pImpl->aWordEdit.GrabFocus(); - m_pImpl->aWordEdit.SetSelection( Selection( i, i + 1 ) ); - break; - } - } - m_pImpl->nHyphPos = GetHyphIndex_Impl(); - EnableLRBtn_Impl(); -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::EnableLRBtn_Impl() -{ - String aTxt( m_pImpl->aWordEdit.GetText() ); - xub_StrLen nLen = aTxt.Len(); - xub_StrLen i; - - m_pImpl->aRightBtn.Disable(); - for ( i = m_pImpl->nOldPos + 2; i < nLen; ++i ) - { - if ( aTxt.GetChar( i ) == sal_Unicode( SW_SOFT_HYPHEN ) ) - { - m_pImpl->aRightBtn.Enable(); - break; - } - } - - DBG_ASSERT(m_pImpl->nOldPos < aTxt.Len(), "m_pImpl->nOldPos out of range"); - if (m_pImpl->nOldPos >= aTxt.Len()) - m_pImpl->nOldPos = aTxt.Len() - 1; - m_pImpl->aLeftBtn.Disable(); - for ( i = m_pImpl->nOldPos; i-- > 0; ) - { - if ( aTxt.GetChar( i ) == sal_Unicode( SW_SOFT_HYPHEN ) ) - { - m_pImpl->aLeftBtn.Enable(); - break; - } - } -} - -// ----------------------------------------------------------------------- - - -void SvxHyphenWordDialog::SetLabel_Impl( LanguageType nLang ) -{ - String aLangStr( ::GetLanguageString( nLang ) ); - String aTmp( m_pImpl->aLabel ); - aTmp.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " (" ) ); - aTmp.Append( aLangStr ); - aTmp.Append( sal_Unicode( ')' ) ); - SetText( aTmp ); -} - -// ----------------------------------------------------------------------- - -String SvxHyphenWordDialog::EraseUnusableHyphens_Impl( - uno::Reference< linguistic2::XPossibleHyphens > &rxPossHyph, - sal_uInt16 _nMaxHyphenationPos ) -{ - // returns a String showing only those hyphen positions which will result - // in a line break if hyphenation is done there - - String aTxt; - DBG_ASSERT(rxPossHyph.is(), "missing possible hyphens"); - if (rxPossHyph.is()) - { - aTxt = String( rxPossHyph->getPossibleHyphens() ); - - uno::Sequence< sal_Int16 > aHyphenationPositions( - rxPossHyph->getHyphenationPositions() ); - sal_Int32 nLen = aHyphenationPositions.getLength(); - const sal_Int16 *pHyphenationPos = aHyphenationPositions.getConstArray(); - - // find position nIdx after which all hyphen positions are unusable - xub_StrLen nIdx = STRING_NOTFOUND, - nPos; - if (nLen) - { - xub_StrLen nStart = 0; - for (sal_Int32 i = 0; i < nLen; ++i) - { - if (pHyphenationPos[i] > _nMaxHyphenationPos) - break; - else - { - // find corresponding hyphen pos in string - nPos = aTxt.Search( sal_Unicode( SW_SOFT_HYPHEN ), nStart ); - - if (nStart == STRING_NOTFOUND) - break; - else - { - nIdx = nPos; - nStart = nPos + 1; - } - } - } - } - DBG_ASSERT(nIdx != STRING_NOTFOUND, "no usable hyphenation position"); - - // remove not usable hyphens from string - nPos = nIdx == STRING_NOTFOUND ? 0 : nIdx + 1; - String aTmp( sal_Unicode( SW_SOFT_HYPHEN ) ), - aEmpty; - while (nPos != STRING_NOTFOUND) - nPos = aTxt.SearchAndReplace( aTmp, aEmpty, nPos + 1 ); - } - return aTxt; -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::InitControls_Impl() -{ - String aTxt; - m_pImpl->xPossHyph = NULL; - if (m_pImpl->xHyphenator.is()) - { - lang::Locale aLocale( SvxCreateLocale(m_pImpl->nActLanguage) ); - m_pImpl->xPossHyph = m_pImpl->xHyphenator->createPossibleHyphens( m_pImpl->aActWord, aLocale, - uno::Sequence< beans::PropertyValue >() ); - if (m_pImpl->xPossHyph.is()) - { - aTxt = EraseUnusableHyphens_Impl( m_pImpl->xPossHyph, m_pImpl->nMaxHyphenationPos ); - } - SetLabel_Impl( m_pImpl->nActLanguage ); - } - m_pImpl->aWordEdit.SetText( aTxt ); - - m_pImpl->nOldPos = aTxt.Len(); - SelLeft(); - EnableLRBtn_Impl(); -} - -// ----------------------------------------------------------------------- - -void SvxHyphenWordDialog::ContinueHyph_Impl( sal_uInt16 nInsPos ) -{ - if ( nInsPos != CONTINUE_HYPH && m_pImpl->xPossHyph.is()) - { - if (nInsPos) - { - String aTmp( m_pImpl->aWordEdit.GetText() ); - DBG_ASSERT(nInsPos <= aTmp.Len() - 2, "wrong hyphen position"); - - sal_uInt16 nIdxPos = 0; - sal_uInt16 i = 0; - sal_Unicode c; - while (i < aTmp.Len() && HYPHHERE != (c = aTmp.GetChar(i++)) ) - { - if (SW_SOFT_HYPHEN == c) - nIdxPos++; - } - - uno::Sequence< sal_Int16 > aSeq = m_pImpl->xPossHyph->getHyphenationPositions(); - sal_Int32 nLen = aSeq.getLength(); - DBG_ASSERT(nLen, "empty sequence"); - DBG_ASSERT(nIdxPos < nLen, "index out of range"); - if (nLen && nIdxPos < nLen) - { - nInsPos = aSeq.getConstArray()[ nIdxPos ]; - m_pImpl->pHyphWrapper->InsertHyphen( nInsPos ); - } - } - else - { - //! calling with 0 as argument will remove hyphens! - m_pImpl->pHyphWrapper->InsertHyphen( nInsPos ); - } - } - - if ( m_pImpl->pHyphWrapper->FindSpellError() ) - { - uno::Reference< linguistic2::XHyphenatedWord > xHyphWord( m_pImpl->pHyphWrapper->GetLast(), uno::UNO_QUERY ); - - // adapt actual word and language to new found hyphenation result - if(xHyphWord.is()) - { - m_pImpl->aActWord = String( xHyphWord->getWord() ); - m_pImpl->nActLanguage = SvxLocaleToLanguage( xHyphWord->getLocale() ); - m_pImpl->nMaxHyphenationPos = xHyphWord->getHyphenationPos(); - InitControls_Impl(); - } - } - else - EndDialog( RET_OK ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16 SvxHyphenWordDialog::GetHyphIndex_Impl() -{ - sal_uInt16 nPos = 0; - String aTxt(m_pImpl->aWordEdit.GetText()); - - for ( sal_uInt16 i=0 ; i < aTxt.Len(); ++i ) - { - sal_Unicode nChar = aTxt.GetChar( i ); - - if ( nChar == HYPHHERE ) - break; - - if ( nChar != SW_SOFT_HYPHEN ) - nPos++; - } - return nPos; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHyphenWordDialog, CutHdl_Impl, Button *, EMPTYARG ) -{ - if( !m_pImpl->bBusy ) - { - m_pImpl->bBusy = sal_True; - ContinueHyph_Impl( m_pImpl->nHyphPos ); - m_pImpl->bBusy = sal_False; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHyphenWordDialog, HyphenateAllHdl_Impl, Button *, EMPTYARG /*pButton*/ ) -{ - if( !m_pImpl->bBusy ) - { - try - { - uno::Reference< beans::XPropertySet > xProp( SvxGetLinguPropertySet() ); - const rtl::OUString aName( rtl::OUString::createFromAscii( "IsHyphAuto" ) ); - uno::Any aAny; - - aAny <<= sal_True; - xProp->setPropertyValue( aName, aAny ); - - m_pImpl->bBusy = sal_True; - ContinueHyph_Impl( m_pImpl->nHyphPos ); - m_pImpl->bBusy = sal_False; - - aAny <<= sal_False; - xProp->setPropertyValue( aName, aAny ); - } - catch (uno::Exception &e) - { - (void) e; - DBG_ASSERT( 0, "Hyphenate All failed" ); - } - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHyphenWordDialog, DeleteHdl_Impl, Button *, EMPTYARG ) -{ - if( !m_pImpl->bBusy ) - { - m_pImpl->bBusy = sal_True; - ContinueHyph_Impl(); - m_pImpl->bBusy = sal_False; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHyphenWordDialog, ContinueHdl_Impl, Button *, EMPTYARG ) -{ - if( !m_pImpl->bBusy ) - { - m_pImpl->bBusy = sal_True; - ContinueHyph_Impl( CONTINUE_HYPH ); - m_pImpl->bBusy = sal_False; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHyphenWordDialog, CancelHdl_Impl, Button *, EMPTYARG ) -{ - if( !m_pImpl->bBusy ) - { - m_pImpl->bBusy = sal_True; - m_pImpl->pHyphWrapper->SpellEnd(); - EndDialog( RET_CANCEL ); - m_pImpl->bBusy = sal_False; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHyphenWordDialog, Left_Impl, Button *, EMPTYARG ) -{ - if( !m_pImpl->bBusy ) - { - m_pImpl->bBusy = sal_True; - SelLeft(); - m_pImpl->bBusy = sal_False; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHyphenWordDialog, Right_Impl, Button *, EMPTYARG ) -{ - if( !m_pImpl->bBusy ) - { - m_pImpl->bBusy = sal_True; - SelRight(); - m_pImpl->bBusy = sal_False; - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxHyphenWordDialog, GetFocusHdl_Impl, Edit *, EMPTYARG ) -{ - m_pImpl->aWordEdit.SetSelection( Selection( m_pImpl->nOldPos, m_pImpl->nOldPos + 1 ) ); - return 0; -} - - - diff --git a/svx/source/dialog/hyphen.hrc b/svx/source/dialog/hyphen.hrc deleted file mode 100755 index e60339b137e1..000000000000 --- a/svx/source/dialog/hyphen.hrc +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hyphen.hrc,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_HYPHEN_HRC -#define _SVX_HYPHEN_HRC - -// defines ------------------------------------------------------------------ - -#define ED_WORD 10 -#define BTN_LEFT 11 -#define BTN_RIGHT 12 -#define FT_WORD 13 -#define FL_BOTTOM 14 - -#define BTN_HYPH_CONTINUE 20 -#define BTN_HYPH_DELETE 21 -#define BTN_HYPH_CUT 22 -#define BTN_HYPH_CANCEL 23 -#define BTN_HYPH_HELP 24 -#define BTN_HYPH_ALL 25 - -#endif - diff --git a/svx/source/dialog/hyphen.hxx b/svx/source/dialog/hyphen.hxx deleted file mode 100755 index 48fda9192a3b..000000000000 --- a/svx/source/dialog/hyphen.hxx +++ /dev/null @@ -1,104 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hyphen.hxx,v $ - * $Revision: 1.5 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_HYPHEN_HXX -#define _SVX_HYPHEN_HXX - -// include --------------------------------------------------------------- - -#include <boost/shared_ptr.hpp> - -#include <vcl/edit.hxx> -#ifndef _SV_BUTTON_HXX -#include <vcl/button.hxx> -#endif -#include <vcl/fixed.hxx> -#include <sfx2/basedlgs.hxx> -#include <com/sun/star/uno/Reference.hxx> -// forward --------------------------------------------------------------- - -namespace com{namespace sun{namespace star{ -namespace linguistic2{ - class XHyphenator; - class XPossibleHyphens; -}}}} - -class SvxSpellWrapper; - -// class SvxHyphenEdit --------------------------------------------------- - -class SvxHyphenEdit : public Edit -{ -public: - SvxHyphenEdit( Window* pParent, const ResId& rResId ); - -protected: - virtual void KeyInput( const KeyEvent &rKEvt ); -}; - -// class SvxHyphenWordDialog --------------------------------------------- - -struct SvxHyphenWordDialog_Impl; - -class SvxHyphenWordDialog : public SfxModalDialog -{ - boost::shared_ptr< SvxHyphenWordDialog_Impl > m_pImpl; - -#ifdef _SVX_HYPHEN_CXX - void EnableLRBtn_Impl(); - void SetLabel_Impl( LanguageType nLang ); - String EraseUnusableHyphens_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XPossibleHyphens > &rxPossHyph, sal_uInt16 nMaxHyphenationPos ); - - void InitControls_Impl(); - void ContinueHyph_Impl( sal_uInt16 nInsPos = 0 ); - sal_uInt16 GetHyphIndex_Impl(); - - DECL_LINK( Left_Impl, Button* ); - DECL_LINK( Right_Impl, Button* ); - DECL_LINK( CutHdl_Impl, Button* ); - DECL_LINK( ContinueHdl_Impl, Button* ); - DECL_LINK( DeleteHdl_Impl, Button* ); - DECL_LINK( HyphenateAllHdl_Impl, Button* ); - DECL_LINK( CancelHdl_Impl, Button* ); - DECL_LINK( GetFocusHdl_Impl, Edit* ); -#endif - -public: - SvxHyphenWordDialog( const String &rWord, LanguageType nLang, - Window* pParent, - ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > &xHyphen, - SvxSpellWrapper* pWrapper ); - - void SelLeft(); - void SelRight(); -}; - - -#endif - diff --git a/svx/source/dialog/hyphen.src b/svx/source/dialog/hyphen.src deleted file mode 100755 index fd3db6e41af4..000000000000 --- a/svx/source/dialog/hyphen.src +++ /dev/null @@ -1,123 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hyphen.src,v $ - * $Revision: 1.24 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include "helpid.hrc" -#include <svx/dialogs.hrc> -#include "hyphen.hrc" - // pragma ---------------------------------------------------------------- - - // RID_SVXDLG_HYPHENATE -------------------------------------------------- -ModalDialog RID_SVXDLG_HYPHENATE -{ - HelpId = HID_HYPHENATE ; - Size = MAP_APPFONT ( 200 , 111 ) ; - OutputSize = TRUE ; - SvLook = TRUE ; - Text [ en-US ] = "Hyphenation" ; - Moveable = TRUE ; - - FixedText FT_WORD - { - Pos = MAP_APPFONT ( 5 , 5 ) ; - Size = MAP_APPFONT ( 120 , 8 ) ; - Text [ en-US ] = "~Word" ; - }; - Edit ED_WORD - { - BORDER = TRUE ; - Pos = MAP_APPFONT ( 5 , 17 ) ; - Size = MAP_APPFONT ( 132 , 12 ) ; - TABSTOP = TRUE ; - LEFT = TRUE ; - }; - ImageButton BTN_LEFT - { - Pos = MAP_APPFONT ( 56 , 33 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - TABSTOP = TRUE ; - SYMBOL = IMAGEBUTTON_ARROW_LEFT ; - }; - ImageButton BTN_RIGHT - { - Pos = MAP_APPFONT ( 75 , 33 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - TABSTOP = TRUE ; - Symbol = IMAGEBUTTON_ARROW_RIGHT ; - }; - OKButton BTN_HYPH_CUT - { - Pos = MAP_APPFONT ( 144 , 17 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "H~yphenate" ; - TABSTOP = TRUE ; - DEFBUTTON = TRUE ; - }; - PushButton BTN_HYPH_CONTINUE - { - Pos = MAP_APPFONT ( 144 , 35 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Skip" ; - TABSTOP = TRUE ; - }; - PushButton BTN_HYPH_DELETE - { - Pos = MAP_APPFONT ( 144 , 52 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Remove" ; - TABSTOP = TRUE ; - }; - FixedLine FL_BOTTOM - { - Pos = MAP_APPFONT ( 0 , 81 ) ; - Size = MAP_APPFONT ( 200 , 8 ) ; - }; - HelpButton BTN_HYPH_HELP - { - Pos = MAP_APPFONT ( 5 , 93 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TABSTOP = TRUE ; - }; - PushButton BTN_HYPH_ALL - { - Pos = MAP_APPFONT ( 63 , 93 ) ; - Size = MAP_APPFONT ( 74 , 14 ) ; - Text [ en-US ] = "Hyphenate ~All" ; - TABSTOP = TRUE ; - }; - CancelButton BTN_HYPH_CANCEL - { - Pos = MAP_APPFONT ( 144 , 93 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - Text [ en-US ] = "~Close"; - TABSTOP = TRUE ; - }; -}; - - diff --git a/svx/source/dialog/hyprdlg.hxx b/svx/source/dialog/hyprdlg.hxx index 9400b674f510..51897af95da8 100644 --- a/svx/source/dialog/hyprdlg.hxx +++ b/svx/source/dialog/hyprdlg.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hyprdlg.hxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -35,7 +32,7 @@ #include <vcl/menu.hxx> #include <svtools/stdctrl.hxx> #include <sfx2/ctrlitem.hxx> -#include "srchcfg.hxx" +#include <svl/srchcfg.hxx> #include <sfx2/tbxctrl.hxx> class SvxHyperlinkDlg; diff --git a/svx/source/dialog/hyprlink.cxx b/svx/source/dialog/hyprlink.cxx index 413289599d33..117b3b3a9beb 100644 --- a/svx/source/dialog/hyprlink.cxx +++ b/svx/source/dialog/hyprlink.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hyprlink.cxx,v $ - * $Revision: 1.15 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/hyprlink.hrc b/svx/source/dialog/hyprlink.hrc index 919437e39c4f..add71ece3bcc 100644 --- a/svx/source/dialog/hyprlink.hrc +++ b/svx/source/dialog/hyprlink.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hyprlink.hrc,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/hyprlink.hxx b/svx/source/dialog/hyprlink.hxx index ab23488adf67..0a5af0afae82 100644 --- a/svx/source/dialog/hyprlink.hxx +++ b/svx/source/dialog/hyprlink.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hyprlink.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/hyprlink.src b/svx/source/dialog/hyprlink.src index d15afc089dc9..abefc7832d8b 100644 --- a/svx/source/dialog/hyprlink.src +++ b/svx/source/dialog/hyprlink.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: hyprlink.src,v $ - * $Revision: 1.36 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 2157fecc7cce..e876431b13ec 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: imapdlg.cxx,v $ - * $Revision: 1.36 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -835,7 +832,7 @@ IMPL_LINK( SvxIMapDlg, InfoHdl, IMapWindow*, pWnd ) IMPL_LINK( SvxIMapDlg, MousePosHdl, IMapWindow*, pWnd ) { String aStr; - const FieldUnit eFieldUnit = GetModuleFieldUnit(); + const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Point& rMousePos = pWnd->GetMousePos(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0); @@ -858,7 +855,7 @@ IMPL_LINK( SvxIMapDlg, MousePosHdl, IMapWindow*, pWnd ) IMPL_LINK( SvxIMapDlg, GraphSizeHdl, IMapWindow*, pWnd ) { String aStr; - const FieldUnit eFieldUnit = GetModuleFieldUnit(); + const FieldUnit eFieldUnit = GetBindings().GetDispatcher()->GetModule()->GetFieldUnit(); const Size& rSize = pWnd->GetGraphicSize(); LocaleDataWrapper aLocaleWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); const sal_Unicode cSep = aLocaleWrapper.getNumDecimalSep().GetChar(0); diff --git a/svx/source/dialog/imapdlg.hrc b/svx/source/dialog/imapdlg.hrc index c23545fb9b28..4a6d322699b5 100644 --- a/svx/source/dialog/imapdlg.hrc +++ b/svx/source/dialog/imapdlg.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: imapdlg.hrc,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/imapdlg.src b/svx/source/dialog/imapdlg.src index e15d6e466f4c..a61a9e34fa5e 100644 --- a/svx/source/dialog/imapdlg.src +++ b/svx/source/dialog/imapdlg.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: imapdlg.src,v $ - * $Revision: 1.53 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/imapimp.hxx b/svx/source/dialog/imapimp.hxx index 691cb5f05fc5..7a6a16a45bd6 100644 --- a/svx/source/dialog/imapimp.hxx +++ b/svx/source/dialog/imapimp.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: imapimp.hxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 37a9959acd89..b4da78cabe59 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: imapwnd.cxx,v $ - * $Revision: 1.26 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/imapwnd.hxx b/svx/source/dialog/imapwnd.hxx index 012e3bf7e06c..1138eb47e68a 100644 --- a/svx/source/dialog/imapwnd.hxx +++ b/svx/source/dialog/imapwnd.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: imapwnd.hxx,v $ - * $Revision: 1.11 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/impgrf.cxx b/svx/source/dialog/impgrf.cxx deleted file mode 100644 index b29671d6b36b..000000000000 --- a/svx/source/dialog/impgrf.cxx +++ /dev/null @@ -1,135 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: impgrf.cxx,v $ - * $Revision: 1.27 $ - * - * 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_svx.hxx" -// include ------------------------------------------------------------------ - -#include <limits.h> // USHRT_MAX -#include <tools/urlobj.hxx> -#include <tools/bigint.hxx> -#include <svl/eitem.hxx> -#include <svl/stritem.hxx> -#include <sfx2/docfile.hxx> -#include <sfx2/dispatch.hxx> -#include <vcl/msgbox.hxx> -#include <vcl/waitobj.hxx> -#include <unotools/pathoptions.hxx> -#include <unotools/viewoptions.hxx> -#include <unotools/localfilehelper.hxx> -#include <ucbhelper/content.hxx> -#include <osl/file.hxx> -#include <com/sun/star/ucb/CommandAbortedException.hpp> - -using namespace ::ucbhelper; -using namespace com::sun::star::uno; - -#include <svx/dialogs.hrc> -#include "impgrf.hrc" - -#define _SVX_IMPGRF_CXX -#include "svx/impgrf.hxx" - -#include <svx/dialmgr.hxx> -#include "svxerr.hxx" -#include "helpid.hrc" - -// defines --------------------------------------------------------------- - -#define IMPGRF_INIKEY_ASLINK "ImportGraphicAsLink" -#define IMPGRF_INIKEY_PREVIEW "ImportGraphicPreview" -#define IMPGRF_CONFIGNAME String(DEFINE_CONST_UNICODE("ImportGraphicDialog")) - -GraphicFilter* GetGrfFilter() -{ - return GraphicFilter::GetGraphicFilter(); -} - -// ----------------------------------------------------------------------- - -int LoadGraphic( const String &rPath, const String &rFilterName, - Graphic& rGraphic, GraphicFilter* pFilter, - USHORT* pDeterminedFormat ) -{ - if ( !pFilter ) - pFilter = ::GetGrfFilter(); - - const USHORT nFilter = rFilterName.Len() && pFilter->GetImportFormatCount() - ? pFilter->GetImportFormatNumber( rFilterName ) - : GRFILTER_FORMAT_DONTKNOW; - - SfxMedium* pMed = 0; - - // dann teste mal auf File-Protokoll: - SvStream* pStream = NULL; - INetURLObject aURL( rPath ); - - if ( aURL.HasError() || INET_PROT_NOT_VALID == aURL.GetProtocol() ) - { - aURL.SetSmartProtocol( INET_PROT_FILE ); - aURL.SetSmartURL( rPath ); - } - else if ( INET_PROT_FILE != aURL.GetProtocol() ) - { - // z.Z. nur auf die aktuelle DocShell - pMed = new SfxMedium( rPath, STREAM_READ, TRUE ); - pMed->DownLoad(); - pStream = pMed->GetInStream(); - } - int nRes = GRFILTER_OK; - - if ( !pStream ) - nRes = pFilter->ImportGraphic( rGraphic, aURL, nFilter, pDeterminedFormat ); - else - nRes = pFilter->ImportGraphic( rGraphic, rPath, *pStream, - nFilter, pDeterminedFormat ); - -#ifdef DBG_UTIL - if( nRes ) - { - if( pMed ) - { - DBG_WARNING3( "GrafikFehler [%d] - [%s] URL[%s]", - nRes, - pMed->GetPhysicalName().GetBuffer(), - rPath.GetBuffer() ); - } - else - { - DBG_WARNING2( "GrafikFehler [%d] - [%s]", nRes, rPath.GetBuffer() ); - } - } -#endif - - if ( pMed ) - delete pMed; - return nRes; -} - diff --git a/svx/source/dialog/impgrf.hrc b/svx/source/dialog/impgrf.hrc deleted file mode 100644 index dd18c4e4ee4c..000000000000 --- a/svx/source/dialog/impgrf.hrc +++ /dev/null @@ -1,59 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: impgrf.hrc,v $ - * $Revision: 1.3 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_IMPGRF_HRC -#define _SVX_IMPGRF_HRC - -// define ------------------------------------------------------------------- - -#define STR_IMPORT_ALL 1 -#define STR_UNKNOWN_FORMAT 2 -#define STR_FLT_BMP 3 -#define STR_FLT_SGF 4 -#define STR_FLT_SGV 5 -#define STR_FLT_SVM 6 -#define STR_PATH_NOT_FOUND1 7 -#define STR_PATH_NOT_FOUND2 8 -#define STR_GRFILTER_OPENERROR 9 -#define STR_GRFILTER_IOERROR 10 -#define STR_GRFILTER_FORMATERROR 11 -#define STR_GRFILTER_VERSIONERROR 12 -#define STR_GRFILTER_FILTERERROR 13 -#define STR_GRFILTER_TOOBIG 14 -#define STR_PROPERTIES 15 -#define STR_HOME 16 -#define STR_LINK 17 -#define STR_PREVIEW 18 -#define STR_FILTER 19 -#define STR_IMPORTGRAPHIC_COUNT 19 - - -#endif - - diff --git a/svx/source/dialog/impgrf.src b/svx/source/dialog/impgrf.src deleted file mode 100644 index 34d3755e6023..000000000000 --- a/svx/source/dialog/impgrf.src +++ /dev/null @@ -1,153 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: impgrf.src,v $ - * $Revision: 1.29 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - // pragma ------------------------------------------------------------------- - - // include ------------------------------------------------------------------ -#include <svx/dialogs.hrc> -#include "impgrf.hrc" - // -------------------------------------------------------------------------- -String RID_SVXSTR_ALL_FILES -{ - Text [ en-US ] = "<All files>" ; -}; -Resource RID_SVXRES_IMPORTGRAPHIC -{ - String STR_IMPORT_ALL - { - Text [ en-US ] = "<All formats>" ; - }; - String STR_UNKNOWN_FORMAT - { - Text [ en-US ] = "Unknown file format!" ; - }; - String STR_PATH_NOT_FOUND1 - { - Text [ en-US ] = "The directory '" ; - }; - String STR_PATH_NOT_FOUND2 - { - Text [ en-US ] = "' does not exist" ; - }; - String STR_FLT_BMP - { - Text = "BMP - MS Windows,*.BMP,BMPp0" ; - }; - String STR_FLT_SGF - { - Text = "SGF - StarWriter SGF,*.SGF,????0" ; - }; - String STR_FLT_SGV - { - Text = "SGV - StarDraw 2.0,*.SGV,????0" ; - }; - String STR_FLT_SVM - { - Text = "SVM - StarView Metafile,*.SVM,SVM 0" ; - }; - String STR_GRFILTER_OPENERROR - { - Text [ en-US ] = "Graphics file cannot be opened" ; - }; - String STR_GRFILTER_IOERROR - { - Text [ en-US ] = "Graphics file cannot be read" ; - }; - String STR_GRFILTER_FORMATERROR - { - Text [ en-US ] = "Unknown graphics format" ; - }; - String STR_GRFILTER_VERSIONERROR - { - Text [ en-US ] = "Cannot support version of graphic file" ; - }; - String STR_GRFILTER_FILTERERROR - { - Text [ en-US ] = "Graphics filter not found" ; - }; - String STR_GRFILTER_TOOBIG - { - Text [ en-US ] = "Not enough memory to insert graphic" ; - }; - String STR_PROPERTIES - { - Text [ en-US ] = "~Properties..." ; - }; - String STR_HOME - { - Text [ en-US ] = "Standard" ; - }; - String STR_LINK - { - Text [ en-US ] = "~Link" ; - }; - String STR_PREVIEW - { - Text [ en-US ] = "Pr~eview" ; - }; - String STR_FILTER - { - Text [ en-US ] = "~Filter..." ; - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 87f1b89bd3f4..c06212d02dea 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: langbox.cxx,v $ - * $Revision: 1.25.132.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -33,21 +30,19 @@ // include --------------------------------------------------------------- -#ifndef _COM_SUN_STAR_LINGUISTIC2_XLINGUSERVICEMANAGER_HDL_ #include <com/sun/star/linguistic2/XLinguServiceManager.hdl> -#endif #include <com/sun/star/linguistic2/XAvailableLocales.hpp> #include <com/sun/star/i18n/ScriptType.hpp> #include <linguistic/misc.hxx> #include <rtl/ustring.hxx> #include <unotools/localedatawrapper.hxx> - +#include <tools/urlobj.hxx> #include <svtools/langtab.hxx> #include <tools/shl.hxx> #include <i18npool/mslangid.hxx> #include <i18npool/lang.h> -#include <svx/scripttypeitem.hxx> -#include <unolingu.hxx> +#include <editeng/scripttypeitem.hxx> +#include <editeng/unolingu.hxx> #include <svx/langbox.hxx> #include <svx/dialmgr.hxx> #include <svx/dialogs.hrc> @@ -57,13 +52,38 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::linguistic2; using namespace ::com::sun::star::uno; +// ----------------------------------------------------------------------- + +String GetDicInfoStr( const String& rName, const USHORT nLang, BOOL bNeg ) +{ + INetURLObject aURLObj; + aURLObj.SetSmartProtocol( INET_PROT_FILE ); + aURLObj.SetSmartURL( rName, INetURLObject::ENCODE_ALL ); + String aTmp( aURLObj.GetBase() ); + aTmp += sal_Unicode( ' ' ); + + if ( bNeg ) + { + sal_Char const sTmp[] = " (-) "; + aTmp.AppendAscii( sTmp ); + } + + if ( LANGUAGE_NONE == nLang ) + aTmp += String( ResId( RID_SVXSTR_LANGUAGE_ALL, DIALOG_MGR() ) ); + else + { + aTmp += sal_Unicode( '[' ); + aTmp += SvtLanguageTable::GetLanguageString( (LanguageType)nLang ); + aTmp += sal_Unicode( ']' ); + } + + return aTmp; +} //======================================================================== // misc local helper functions //======================================================================== - - static Sequence< INT16 > lcl_LocaleSeqToLangSeq( Sequence< Locale > &rSeq ) { const Locale *pLocale = rSeq.getConstArray(); diff --git a/svx/source/dialog/langbox.src b/svx/source/dialog/langbox.src index 2a91bbe29fde..79bf1cf010c3 100644 --- a/svx/source/dialog/langbox.src +++ b/svx/source/dialog/langbox.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: langbox.src,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/language.src b/svx/source/dialog/language.src index fa15a2ffb2e4..aa2bee89d742 100644 --- a/svx/source/dialog/language.src +++ b/svx/source/dialog/language.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: language.src,v $ - * $Revision: 1.28 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/lingu.src b/svx/source/dialog/lingu.src deleted file mode 100644 index 0ad46765b258..000000000000 --- a/svx/source/dialog/lingu.src +++ /dev/null @@ -1,180 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: lingu.src,v $ - * $Revision: 1.33 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <svx/dialogs.hrc> - // pragma ---------------------------------------------------------------- - - // QueryBoxen --------------------------------------------------------------- -QueryBox RID_SVXQB_THESAURUS -{ - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_NO ; - // ### ACHTUNG: Neuer Text in Resource? Dieses Wort sollten Sie vermeiden! Thesaurus starten? : Dieses Wort sollten sie vermeiden! Thesaurus starten? - Message [ en-US ] = "This word appears in the list of words you want to avoid. Start thesaurus?" ; -}; -QueryBox RID_SVXQB_CONTINUE -{ - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_YES ; - /* ### ACHTUNG: Neuer Text in Resource? berprfung am Anfang des Dokumentes fortsetzen? : berprfung am Anfang des Dokumentes fortsetzen? */ - /* ### ACHTUNG: Neuer Text in Resource? berprfung am Anfang des Dokumentes fortsetzen? : berprfung am Anfang des Dokumentes fortsetzen? */ - Message [ en-US ] = "Continue checking at beginning of document?" ; -}; -QueryBox RID_SVXQB_BW_CONTINUE -{ - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_YES ; - /* ### ACHTUNG: Neuer Text in Resource? berprfung am Ende des Dokumentes fortsetzen? : berprfung am Ende des Dokumentes fortsetzen? */ - /* ### ACHTUNG: Neuer Text in Resource? berprfung am Ende des Dokumentes fortsetzen? : berprfung am Ende des Dokumentes fortsetzen? */ - Message [ en-US ] = "Continue checking at end of document?" ; -}; -QueryBox RID_SVXQB_BODYTEXT -{ - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_NO ; - // ### ACHTUNG: Neuer Text in Resource? Mchten Sie den Haupttext prfen? : Wollen Sie den Haupttext prfen? - /* ### ACHTUNG: Neuer Text in Resource? Mchten Sie den Haupttext prfen? : Mchten Sie den Haupttext prfen? */ - /* ### ACHTUNG: Neuer Text in Resource? Mchten Sie den Haupttext prfen? : Mchten Sie den Haupttext prfen? */ - Message [ en-US ] = "Do you want to check the main text?" ; -}; -QueryBox RID_SVXQB_SPECIAL -{ - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_NO ; - /* ### ACHTUNG: Neuer Text in Resource? Sonderbereiche prfen? : Sonderbereiche prfen? */ - /* ### ACHTUNG: Neuer Text in Resource? Sonderbereiche prfen? : Sonderbereiche prfen? */ - Message [ en-US ] = "Do you want check the special regions?" ; -}; -QueryBox RID_SVXQB_SPECIAL_FORCED -{ - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_NO ; - /* ### ACHTUNG: Neuer Text in Resource? Sonderbereichprfung ist ausgeschaltet, Trotzdem prfen? : Sonderbereichprfung ist ausgeschaltet, Trotzdem prfen? */ - /* ### ACHTUNG: Neuer Text in Resource? Sonderbereichprfung ist ausgeschaltet, Trotzdem prfen? : Sonderbereichprfung ist ausgeschaltet, Trotzdem prfen? */ - Message [ en-US ] = "Check special regions is deactivated. Check anyway?" ; -}; - // Strings --------------------------------------------------------------- -String RID_SVXSTR_HMSTATUS_OK -{ - Text [ en-US ] = "The word is spelled correctly" ; -}; -String RID_SVXSTR_HMSTATUS_DONTUSE -{ - Text [ en-US ] = "Avoid using this word" ; -}; -String RID_SVXSTR_HMSTATUS_WRONG -{ - Text [ en-US ] = "Unknown word." ; -}; -String RID_SVXSTR_HMSTATUS_CAPERROR -{ - /* ### ACHTUNG: Neuer Text in Resource? Gro- / Kleinschreibungs - Fehler : Gro- / Kleinschreibungs - Fehler */ - /* ### ACHTUNG: Neuer Text in Resource? Gro- / Kleinschreibungs - Fehler : Gro- / Kleinschreibungs - Fehler */ - Text [ en-US ] = "Capitalization error" ; -}; -String RID_SVXSTR_HMSTATUS_INVALID_LANG -{ - Text [ en-US ] = "Language not supported"; -}; -String RID_SVXSTR_HMERR_CHECKINSTALL -{ - /* ### ACHTUNG: Neuer Text in Resource? ist fr die Prfung nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache : ist fr die Prfung nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache */ - /* ### ACHTUNG: Neuer Text in Resource? ist fr die Prfung nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache : ist fr die Prfung nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache */ - Text [ en-US ] = "is not available for spellchecking\nPlease check your installation and install the desired language\n" ; -}; -String RID_SVXSTR_HMERR_ADDWORD -{ - /* ### ACHTUNG: Neuer Text in Resource? Das Wort konnte nicht ins Wrterbuch aufgenommen werden. : Das Wort konnte nicht ins Wrterbuch aufgenommen werden. */ - /* ### ACHTUNG: Neuer Text in Resource? Das Wort konnte nicht ins Wrterbuch aufgenommen werden. : Das Wort konnte nicht ins Wrterbuch aufgenommen werden. */ - Text [ en-US ] = "The word could not be added to dictionary" ; -}; -String RID_SVXSTR_HMERR_HYPH -{ - /* ### ACHTUNG: Neuer Text in Resource? Die Trennhilfe ist nicht verfgbar : Die Trennhilfe ist nicht verfgbar */ - /* ### ACHTUNG: Neuer Text in Resource? Die Trennhilfe ist nicht verfgbar : Die Trennhilfe ist nicht verfgbar */ - Text [ en-US ] = "Hyphenation not available" ; -}; -String RID_SVXSTR_HMERR_THESAURUS -{ - /* ### ACHTUNG: Neuer Text in Resource? Ein Thesaurus fr die eingestellte Sprache ist nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache : Ein Thesaurus fr die eingestellte Sprache ist nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache */ - /* ### ACHTUNG: Neuer Text in Resource? Ein Thesaurus fr die eingestellte Sprache ist nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache : Ein Thesaurus fr die eingestellte Sprache ist nicht verfgbar. \nberprfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewnschte Sprache */ - Text [ en-US ] = "No thesaurus is available for the selected language. \nPlease check your installation and install the desired language\n" ; -}; -String RID_SVXSTR_DIC_ERR_UNKNOWN -{ - Text [ en-US ] = "Word cannot be added to dictionary\ndue to unknown reason."; -}; -String RID_SVXSTR_DIC_ERR_FULL -{ - Text [ en-US ] = "The dictionary is already full."; -}; -String RID_SVXSTR_DIC_ERR_READONLY -{ - Text [ en-US ] = "The dictionary is read-only."; -}; - - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svx/source/dialog/makefile.mk b/svx/source/dialog/makefile.mk index 1fc3c9f8b3fe..ac608fae8ec8 100644 --- a/svx/source/dialog/makefile.mk +++ b/svx/source/dialog/makefile.mk @@ -1,15 +1,11 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.65 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -56,13 +52,10 @@ SRC1FILES = \ fontwork.src \ frmsel.src \ hdft.src \ - hyphen.src \ hyprlink.src \ imapdlg.src \ - impgrf.src \ langbox.src \ language.src \ - lingu.src \ passwd.src \ prtqry.src \ rubydialog.src\ @@ -70,9 +63,9 @@ SRC1FILES = \ srchdlg.src \ svxbmpnumvalueset.src \ swframeposstrings.src \ - thesdlg.src \ txenctab.src \ - ucsubset.src + ucsubset.src \ + optgrid.src SRS2NAME=drawdlgs SRC2FILES = \ @@ -85,16 +78,10 @@ LIB1OBJFILES= \ $(SLO)$/dialmgr.obj\ $(SLO)$/dlgutil.obj \ $(SLO)$/framelink.obj\ - $(SLO)$/hangulhanja.obj \ - $(SLO)$/hyphen.obj \ - $(SLO)$/impgrf.obj \ $(SLO)$/langbox.obj \ - $(SLO)$/opengrf.obj \ $(SLO)$/simptabl.obj \ - $(SLO)$/splwrap.obj \ $(SLO)$/svxdlg.obj \ $(SLO)$/stddlg.obj \ - $(SLO)$/thesdlg.obj LIB2TARGET=$(SLB)$/$(TARGET).lib @@ -137,7 +124,6 @@ LIB2OBJFILES= \ $(SLO)$/srchdlg.obj \ $(SLO)$/strarray.obj \ $(SLO)$/svxbmpnumvalueset.obj\ - $(SLO)$/svxbox.obj \ $(SLO)$/svxgrahicitem.obj \ $(SLO)$/svxruler.obj \ $(SLO)$/swframeexample.obj \ @@ -146,7 +132,9 @@ LIB2OBJFILES= \ $(SLO)$/txenctab.obj \ $(SLO)$/wrapfield.obj \ $(SLO)$/_bmpmask.obj \ - $(SLO)$/_contdlg.obj + $(SLO)$/_contdlg.obj \ + $(SLO)$/optgrid.obj + .IF "$(GUI)"=="UNX" LIB2OBJFILES += $(SLO)$/sendreportunx.obj diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index 73e376f9eac1..3b56b443e2fe 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: measctrl.cxx,v $ - * $Revision: 1.12 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/opengrf.cxx b/svx/source/dialog/opengrf.cxx deleted file mode 100644 index 1056c6f1c162..000000000000 --- a/svx/source/dialog/opengrf.cxx +++ /dev/null @@ -1,307 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: opengrf.cxx,v $ - * $Revision: 1.22 $ - * - * 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_svx.hxx" -#include <tools/urlobj.hxx> -#include <cppuhelper/implbase1.hxx> -#include <com/sun/star/uno/Reference.h> -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> -#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> -#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> -#include <com/sun/star/ui/dialogs/FilePreviewImageFormats.hpp> -#include <com/sun/star/ui/dialogs/ListboxControlActions.hpp> -#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> -#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> -#include <com/sun/star/ui/dialogs/XFilePicker.hpp> -#include <com/sun/star/ui/dialogs/XFilePickerListener.hpp> -#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp> -#include <com/sun/star/ui/dialogs/XFilePreview.hpp> -#include <com/sun/star/ui/dialogs/XFilterManager.hpp> -#include <svl/urihelper.hxx> -#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX -#include <unotools/ucbstreamhelper.hxx> -#endif -#include <svtools/transfer.hxx> -#include <svx/svdograf.hxx> -#include <sot/formats.hxx> -#ifndef _MSGBOX_HXX //autogen -#include <vcl/msgbox.hxx> -#endif -#include <sfx2/filedlghelper.hxx> -#include <sfx2/docfile.hxx> -#include <unotools/pathoptions.hxx> -#include <svx/dialmgr.hxx> -#include "opengrf.hxx" - -#include <svx/dialogs.hrc> -#include "impgrf.hrc" - - -//----------------------------------------------------------------------------- - -using namespace ::com::sun::star; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::ui::dialogs; -using namespace ::com::sun::star::uno; -using namespace ::rtl; -using namespace ::cppu; - - -//----------------------------------------------------------------------------- - -USHORT SvxOpenGrfErr2ResId( short err ) -{ - switch( err ) - { - case GRFILTER_OPENERROR: - return RID_SVXSTR_GRFILTER_OPENERROR; - case GRFILTER_IOERROR: - return RID_SVXSTR_GRFILTER_IOERROR; - case GRFILTER_VERSIONERROR: - return RID_SVXSTR_GRFILTER_VERSIONERROR; - case GRFILTER_FILTERERROR: - return RID_SVXSTR_GRFILTER_FILTERERROR; - case GRFILTER_FORMATERROR: - default: - return RID_SVXSTR_GRFILTER_FORMATERROR; - } -} - - -struct SvxOpenGrf_Impl -{ - SvxOpenGrf_Impl (); - - sfx2::FileDialogHelper aFileDlg; - uno::Reference < XFilePickerControlAccess > xCtrlAcc; -}; - - -SvxOpenGrf_Impl::SvxOpenGrf_Impl() : - aFileDlg(SFXWB_GRAPHIC) -{ - uno::Reference < XFilePicker > xFP = aFileDlg.GetFilePicker(); - xCtrlAcc = uno::Reference < XFilePickerControlAccess >(xFP, UNO_QUERY); -} - - -SvxOpenGraphicDialog::SvxOpenGraphicDialog( const String& rTitle ) : - mpImpl( new SvxOpenGrf_Impl ) -{ - mpImpl->aFileDlg.SetTitle(rTitle); -} - - -SvxOpenGraphicDialog::~SvxOpenGraphicDialog() -{ -} - - -GraphicFilter* GetGrfFilter(); - -short SvxOpenGraphicDialog::Execute() -{ - USHORT nImpRet; - BOOL bQuitLoop(FALSE); - - while( bQuitLoop == FALSE && - mpImpl->aFileDlg.Execute() == ERRCODE_NONE ) - { - if( GetPath().Len() ) - { - GraphicFilter* pFilter = GetGrfFilter(); - INetURLObject aObj( GetPath() ); - - // check whether we can load the graphic - String aCurFilter( GetCurrentFilter() ); - USHORT nFormatNum = pFilter->GetImportFormatNumber( aCurFilter ); - USHORT nRetFormat = 0; - USHORT nFound = USHRT_MAX; - - // non-local? - if ( INET_PROT_FILE != aObj.GetProtocol() ) - { - SfxMedium aMed( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ, TRUE ); - aMed.DownLoad(); - SvStream* pStream = aMed.GetInStream(); - - if( pStream ) - nImpRet = pFilter->CanImportGraphic( aObj.GetMainURL( INetURLObject::NO_DECODE ), *pStream, nFormatNum, &nRetFormat ); - else - nImpRet = pFilter->CanImportGraphic( aObj, nFormatNum, &nRetFormat ); - - if ( GRFILTER_OK != nImpRet ) - { - if ( !pStream ) - nImpRet = pFilter->CanImportGraphic( aObj, GRFILTER_FORMAT_DONTKNOW, &nRetFormat ); - else - nImpRet = pFilter->CanImportGraphic( aObj.GetMainURL( INetURLObject::NO_DECODE ), *pStream, - GRFILTER_FORMAT_DONTKNOW, &nRetFormat ); - } - } - else - { - if( (nImpRet=pFilter->CanImportGraphic( aObj, nFormatNum, &nRetFormat )) != GRFILTER_OK ) - nImpRet = pFilter->CanImportGraphic( aObj, GRFILTER_FORMAT_DONTKNOW, &nRetFormat ); - } - - if ( GRFILTER_OK == nImpRet ) - nFound = nRetFormat; - - // could not load? - if ( nFound == USHRT_MAX ) - { - WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, SVX_RESSTR( SvxOpenGrfErr2ResId(nImpRet) ) ); - bQuitLoop = aWarningBox.Execute()==RET_RETRY ? FALSE : TRUE; - } - else - { - // setup appropriate filter (so next time, it will work) - if( pFilter->GetImportFormatCount() ) - { - String aFormatName(pFilter->GetImportFormatName(nFound)); - SetCurrentFilter(aFormatName); - } - - return nImpRet; - } - } - } - - // cancel - return -1; -} - - -void SvxOpenGraphicDialog::SetPath( const String& rPath ) -{ - mpImpl->aFileDlg.SetDisplayDirectory(rPath); -} - -void SvxOpenGraphicDialog::SetPath( const String& rPath, sal_Bool bLinkState ) -{ - SetPath(rPath); - AsLink(bLinkState); -} - - -void SvxOpenGraphicDialog::EnableLink( sal_Bool state ) -{ - if( mpImpl->xCtrlAcc.is() ) - { - try - { - mpImpl->xCtrlAcc->enableControl( ExtendedFilePickerElementIds::CHECKBOX_LINK, state ); - } - catch(IllegalArgumentException) - { -#ifdef DBG_UTIL - DBG_ERROR( "Cannot enable \"link\" checkbox" ); -#endif - } - } -} - - -void SvxOpenGraphicDialog::AsLink(sal_Bool bState) -{ - if( mpImpl->xCtrlAcc.is() ) - { - try - { - Any aAny; aAny <<= bState; - mpImpl->xCtrlAcc->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aAny ); - } - catch(IllegalArgumentException) - { -#ifdef DBG_UTIL - DBG_ERROR( "Cannot check \"link\" checkbox" ); -#endif - } - } -} - - -sal_Bool SvxOpenGraphicDialog::IsAsLink() const -{ - try - { - if( mpImpl->xCtrlAcc.is() ) - { - Any aVal = mpImpl->xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0 ); - DBG_ASSERT(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found"); - return aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_False; - } - } - catch(IllegalArgumentException) - { -#ifdef DBG_UTIL - DBG_ERROR( "Cannot access \"link\" checkbox" ); -#endif - } - - return sal_False; -} - - -int SvxOpenGraphicDialog::GetGraphic(Graphic& rGraphic) const -{ - return mpImpl->aFileDlg.GetGraphic(rGraphic); -} - - -String SvxOpenGraphicDialog::GetPath() const -{ - return mpImpl->aFileDlg.GetPath(); -} - - -String SvxOpenGraphicDialog::GetCurrentFilter() const -{ - return mpImpl->aFileDlg.GetCurrentFilter(); -} - - -void SvxOpenGraphicDialog::SetCurrentFilter(const String& rStr) -{ - mpImpl->aFileDlg.SetCurrentFilter(rStr); -} - -void SvxOpenGraphicDialog::SetControlHelpIds( const INT16* _pControlId, const INT32* _pHelpId ) -{ - mpImpl->aFileDlg.SetControlHelpIds( _pControlId, _pHelpId ); -} - -void SvxOpenGraphicDialog::SetDialogHelpId( const INT32 _nHelpId ) -{ - mpImpl->aFileDlg.SetDialogHelpId( _nHelpId ); -} diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx new file mode 100644 index 000000000000..7565539578df --- /dev/null +++ b/svx/source/dialog/optgrid.cxx @@ -0,0 +1,419 @@ +/************************************************************************* + * + * 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_svx.hxx" + +// include --------------------------------------------------------------- +#include <tools/shl.hxx> +#include <sfx2/app.hxx> +#include <sfx2/module.hxx> +#include <svl/intitem.hxx> + +#define _SVX_OPTGRID_CXX + +#include <svx/svxids.hrc> +#include <svx/dialmgr.hxx> +#include "optgrid.hxx" +#include <svx/dialogs.hrc> +#include "optgrid.hrc" +#include "dlgutil.hxx" + +/* -----------------18.08.98 17:41------------------- + * local functions + * --------------------------------------------------*/ +void lcl_GetMinMax(MetricField& rField, long& nFirst, long& nLast, long& nMin, long& nMax) +{ + nFirst = static_cast<long>(rField.Denormalize( rField.GetFirst( FUNIT_TWIP ) )); + nLast = static_cast<long>(rField.Denormalize( rField.GetLast( FUNIT_TWIP ) )); + nMin = static_cast<long>(rField.Denormalize( rField.GetMin( FUNIT_TWIP ) )); + nMax = static_cast<long>(rField.Denormalize( rField.GetMax( FUNIT_TWIP ) )); +} + +void lcl_SetMinMax(MetricField& rField, long nFirst, long nLast, long nMin, long nMax) +{ + rField.SetFirst( rField.Normalize( nFirst ), FUNIT_TWIP ); + rField.SetLast( rField.Normalize( nLast ), FUNIT_TWIP ); + rField.SetMin( rField.Normalize( nMin ), FUNIT_TWIP ); + rField.SetMax( rField.Normalize( nMax ), FUNIT_TWIP ); +} + +/*-------------------------------------------------------------------- + Beschreibung: Rastereinstellungen Ctor + --------------------------------------------------------------------*/ + +SvxOptionsGrid::SvxOptionsGrid() : + nFldDrawX ( 100 ), + nFldDivisionX ( 0 ), + nFldDrawY ( 100 ), + nFldDivisionY ( 0 ), + nFldSnapX ( 100 ), + nFldSnapY ( 100 ), + bUseGridsnap ( 0 ), + bSynchronize ( 1 ), + bGridVisible ( 0 ), + bEqualGrid ( 1 ) +{ +} + +/*-------------------------------------------------------------------- + Beschreibung: Rastereinstellungen Dtor + --------------------------------------------------------------------*/ + +SvxOptionsGrid::~SvxOptionsGrid() +{ +} + +/*-------------------------------------------------------------------- + Beschreibung: Item fuer Rastereinstellungen + --------------------------------------------------------------------*/ + +SvxGridItem::SvxGridItem( const SvxGridItem& rItem ) +: SvxOptionsGrid() +, SfxPoolItem(rItem) +{ + bUseGridsnap = rItem.bUseGridsnap ; + bSynchronize = rItem.bSynchronize ; + bGridVisible = rItem.bGridVisible ; + bEqualGrid = rItem.bEqualGrid ; + nFldDrawX = rItem.nFldDrawX ; + nFldDivisionX= rItem.nFldDivisionX; + nFldDrawY = rItem.nFldDrawY ; + nFldDivisionY= rItem.nFldDivisionY; + nFldSnapX = rItem.nFldSnapX ; + nFldSnapY = rItem.nFldSnapY ; + +}; + +/*-------------------------------------------------------------------- + Beschreibung: + --------------------------------------------------------------------*/ + +SfxPoolItem* SvxGridItem::Clone( SfxItemPool* ) const +{ + return new SvxGridItem( *this ); +} + +/*-------------------------------------------------------------------- + Beschreibung: + --------------------------------------------------------------------*/ + +int SvxGridItem::operator==( const SfxPoolItem& rAttr ) const +{ + DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unterschiedliche Typen" ); + + const SvxGridItem& rItem = (const SvxGridItem&) rAttr; + + return ( bUseGridsnap == rItem.bUseGridsnap && + bSynchronize == rItem.bSynchronize && + bGridVisible == rItem.bGridVisible && + bEqualGrid == rItem.bEqualGrid && + nFldDrawX == rItem.nFldDrawX && + nFldDivisionX== rItem.nFldDivisionX&& + nFldDrawY == rItem.nFldDrawY && + nFldDivisionY== rItem.nFldDivisionY&& + nFldSnapX == rItem.nFldSnapX && + nFldSnapY == rItem.nFldSnapY ); +} + +/*-------------------------------------------------------------------- + Beschreibung: + --------------------------------------------------------------------*/ + +SfxItemPresentation SvxGridItem::GetPresentation +( + SfxItemPresentation ePres, + SfxMapUnit /*eCoreUnit*/, + SfxMapUnit /*ePresUnit*/, + String& rText, const IntlWrapper * +) const +{ + switch ( ePres ) + { + case SFX_ITEM_PRESENTATION_NONE: + rText.Erase(); + return SFX_ITEM_PRESENTATION_NONE; + case SFX_ITEM_PRESENTATION_NAMELESS: + case SFX_ITEM_PRESENTATION_COMPLETE: + rText = String::CreateFromAscii("SvxGridItem"); + return ePres; + default: + return SFX_ITEM_PRESENTATION_NONE; + } +} + + +/*----------------- OS 23.02.95 ----------------------- + TabPage Rastereinstellungen +-------------------------------------------------------*/ + +SvxGridTabPage::SvxGridTabPage( Window* pParent, const SfxItemSet& rCoreSet) : + + SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_GRID ), rCoreSet ), + + aCbxUseGridsnap ( this, SVX_RES( CBX_USE_GRIDSNAP ) ), + aCbxGridVisible ( this, SVX_RES( CBX_GRID_VISIBLE ) ), + + aFlResolution ( this, SVX_RES( FL_RESOLUTION ) ), + aFtDrawX ( this, SVX_RES( FT_DRAW_X ) ), + aMtrFldDrawX ( this, SVX_RES( MTR_FLD_DRAW_X ) ), + aFtDrawY ( this, SVX_RES( FT_DRAW_Y ) ), + aMtrFldDrawY ( this, SVX_RES( MTR_FLD_DRAW_Y ) ), + + aFlDivision ( this, SVX_RES( FL_DIVISION ) ), + aFtDivisionX( this, SVX_RES( FT_DIVISION_X) ), + aNumFldDivisionX( this, SVX_RES( NUM_FLD_DIVISION_X ) ), + aDivisionPointX( this, SVX_RES( FT_HORZ_POINTS) ), + + aFtDivisionY( this, SVX_RES( FT_DIVISION_Y) ), + aNumFldDivisionY( this, SVX_RES( NUM_FLD_DIVISION_Y ) ), + aDivisionPointY( this, SVX_RES( FT_VERT_POINTS) ), + + aCbxSynchronize ( this, SVX_RES( CBX_SYNCHRONIZE ) ), + aGrpDrawGrid ( this, SVX_RES( GRP_DRAWGRID ) ), + + aGrpSnap ( this, SVX_RES( GRP_SNAP ) ), + aCbxSnapHelplines ( this, SVX_RES( CBX_SNAP_HELPLINES ) ), + aCbxSnapBorder ( this, SVX_RES( CBX_SNAP_BORDER ) ), + aCbxSnapFrame ( this, SVX_RES( CBX_SNAP_FRAME ) ), + aCbxSnapPoints ( this, SVX_RES( CBX_SNAP_POINTS ) ), + aFtSnapArea ( this, SVX_RES( FT_SNAP_AREA ) ), + aMtrFldSnapArea ( this, SVX_RES( MTR_FLD_SNAP_AREA ) ), + + aSeparatorFL ( this, SVX_RES( FL_SEPARATOR ) ), + + aGrpOrtho ( this, SVX_RES( GRP_ORTHO ) ), + aCbxOrtho ( this, SVX_RES( CBX_ORTHO ) ), + aCbxBigOrtho ( this, SVX_RES( CBX_BIGORTHO ) ), + aCbxRotate ( this, SVX_RES( CBX_ROTATE ) ), + aMtrFldAngle ( this, SVX_RES( MTR_FLD_ANGLE ) ), + aFtBezAngle ( this, SVX_RES( FT_BEZ_ANGLE ) ), + aMtrFldBezAngle ( this, SVX_RES( MTR_FLD_BEZ_ANGLE ) ), + + bAttrModified( FALSE ) +{ + // diese Page braucht ExchangeSupport + SetExchangeSupport(); + + FreeResource(); + + aDivisionPointY.SetText(aDivisionPointX.GetText()); + // Metrik einstellen + FieldUnit eFUnit = GetModuleFieldUnit( rCoreSet ); + long nFirst, nLast, nMin, nMax; + + lcl_GetMinMax(aMtrFldDrawX, nFirst, nLast, nMin, nMax); + SetFieldUnit( aMtrFldDrawX, eFUnit, TRUE ); + lcl_SetMinMax(aMtrFldDrawX, nFirst, nLast, nMin, nMax); + + lcl_GetMinMax(aMtrFldDrawY, nFirst, nLast, nMin, nMax); + SetFieldUnit( aMtrFldDrawY, eFUnit, TRUE ); + lcl_SetMinMax(aMtrFldDrawY, nFirst, nLast, nMin, nMax); + + + aCbxRotate.SetClickHdl( LINK( this, SvxGridTabPage, ClickRotateHdl_Impl ) ); + Link aLink = LINK( this, SvxGridTabPage, ChangeGridsnapHdl_Impl ); + aCbxUseGridsnap.SetClickHdl( aLink ); + aCbxSynchronize.SetClickHdl( aLink ); + aCbxGridVisible.SetClickHdl( aLink ); + aMtrFldDrawX.SetModifyHdl( + LINK( this, SvxGridTabPage, ChangeDrawHdl_Impl ) ); + aMtrFldDrawY.SetModifyHdl( + LINK( this, SvxGridTabPage, ChangeDrawHdl_Impl ) ); + aNumFldDivisionX.SetModifyHdl( + LINK( this, SvxGridTabPage, ChangeDivisionHdl_Impl ) ); + aNumFldDivisionY.SetModifyHdl( + LINK( this, SvxGridTabPage, ChangeDivisionHdl_Impl ) ); +} + +//------------------------------------------------------------------------ + +SfxTabPage* SvxGridTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) +{ + return ( new SvxGridTabPage( pParent, rAttrSet ) ); +} + +//------------------------------------------------------------------------ + +BOOL SvxGridTabPage::FillItemSet( SfxItemSet& rCoreSet ) +{ + if ( bAttrModified ) + { + SvxGridItem aGridItem( SID_ATTR_GRID_OPTIONS ); + + aGridItem.bUseGridsnap = aCbxUseGridsnap.IsChecked(); + aGridItem.bSynchronize = aCbxSynchronize.IsChecked(); + aGridItem.bGridVisible = aCbxGridVisible.IsChecked(); + + SfxMapUnit eUnit = + rCoreSet.GetPool()->GetMetric( GetWhich( SID_ATTR_GRID_OPTIONS ) ); + long nX =GetCoreValue( aMtrFldDrawX, eUnit ); + long nY = GetCoreValue( aMtrFldDrawY, eUnit ); + + aGridItem.nFldDrawX = (UINT32) nX; + aGridItem.nFldDrawY = (UINT32) nY; + aGridItem.nFldDivisionX = static_cast<long>(aNumFldDivisionX.GetValue()); + aGridItem.nFldDivisionY = static_cast<long>(aNumFldDivisionY.GetValue()); + + rCoreSet.Put( aGridItem ); + } + return bAttrModified; +} + +//------------------------------------------------------------------------ + +void SvxGridTabPage::Reset( const SfxItemSet& rSet ) +{ + const SfxPoolItem* pAttr = 0; + + if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS , FALSE, + (const SfxPoolItem**)&pAttr )) + { + const SvxGridItem* pGridAttr = (SvxGridItem*)pAttr; + aCbxUseGridsnap.Check( pGridAttr->bUseGridsnap == 1 ); + aCbxSynchronize.Check( pGridAttr->bSynchronize == 1 ); + aCbxGridVisible.Check( pGridAttr->bGridVisible == 1 ); + + SfxMapUnit eUnit = + rSet.GetPool()->GetMetric( GetWhich( SID_ATTR_GRID_OPTIONS ) ); + SetMetricValue( aMtrFldDrawX , pGridAttr->nFldDrawX, eUnit ); + SetMetricValue( aMtrFldDrawY , pGridAttr->nFldDrawY, eUnit ); + +// UINT32 nFineX = pGridAttr->nFldDivisionX; +// UINT32 nFineY = pGridAttr->nFldDivisionY; +// aNumFldDivisionX.SetValue( nFineX ? (pGridAttr->nFldDrawX / nFineX - 1) : 0 ); +// aNumFldDivisionY.SetValue( nFineY ? (pGridAttr->nFldDrawY / nFineY - 1) : 0 ); + aNumFldDivisionX.SetValue( pGridAttr->nFldDivisionX ); + aNumFldDivisionY.SetValue( pGridAttr->nFldDivisionY ); + } + + ChangeGridsnapHdl_Impl( &aCbxUseGridsnap ); + bAttrModified = FALSE; +} + +// ----------------------------------------------------------------------- + +void SvxGridTabPage::ActivatePage( const SfxItemSet& rSet ) +{ + const SfxPoolItem* pAttr = NULL; + if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS , FALSE, + (const SfxPoolItem**)&pAttr )) + { + const SvxGridItem* pGridAttr = (SvxGridItem*) pAttr; + aCbxUseGridsnap.Check( pGridAttr->bUseGridsnap == 1 ); + + ChangeGridsnapHdl_Impl( &aCbxUseGridsnap ); + } + + // Metrik ggfs. aendern (da TabPage im Dialog liegt, + // wo die Metrik eingestellt werden kann + //USHORT nWhich = GetWhich( SID_ATTR_METRIC ); + //if( rSet.GetItemState( GetWhich( SID_ATTR_METRIC ) ) >= SFX_ITEM_AVAILABLE ) + if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC , FALSE, + (const SfxPoolItem**)&pAttr )) + { + const SfxUInt16Item* pItem = (SfxUInt16Item*) pAttr; + + FieldUnit eFUnit = (FieldUnit)(long)pItem->GetValue(); + + if( eFUnit != aMtrFldDrawX.GetUnit() ) + { + // Metriken einstellen + long nFirst, nLast, nMin, nMax; + long nVal = static_cast<long>(aMtrFldDrawX.Denormalize( aMtrFldDrawX.GetValue( FUNIT_TWIP ) )); + + lcl_GetMinMax(aMtrFldDrawX, nFirst, nLast, nMin, nMax); + SetFieldUnit( aMtrFldDrawX, eFUnit, TRUE ); + lcl_SetMinMax(aMtrFldDrawX, nFirst, nLast, nMin, nMax); + + aMtrFldDrawX.SetValue( aMtrFldDrawX.Normalize( nVal ), FUNIT_TWIP ); + + nVal = static_cast<long>(aMtrFldDrawY.Denormalize( aMtrFldDrawY.GetValue( FUNIT_TWIP ) )); + lcl_GetMinMax(aMtrFldDrawY, nFirst, nLast, nMin, nMax); + SetFieldUnit( aMtrFldDrawY, eFUnit, TRUE ); + lcl_SetMinMax(aMtrFldDrawY, nFirst, nLast, nMin, nMax); + aMtrFldDrawY.SetValue( aMtrFldDrawY.Normalize( nVal ), FUNIT_TWIP ); + + } + } +} + +// ----------------------------------------------------------------------- +int SvxGridTabPage::DeactivatePage( SfxItemSet* _pSet ) +{ + if ( _pSet ) + FillItemSet( *_pSet ); + return( LEAVE_PAGE ); +} +//------------------------------------------------------------------------ +IMPL_LINK( SvxGridTabPage, ChangeDrawHdl_Impl, MetricField *, pField ) +{ + bAttrModified = TRUE; + if( aCbxSynchronize.IsChecked() ) + { + if(pField == &aMtrFldDrawX) + aMtrFldDrawY.SetValue( aMtrFldDrawX.GetValue() ); + else + aMtrFldDrawX.SetValue( aMtrFldDrawY.GetValue() ); + } + return 0; +} +//------------------------------------------------------------------------ + +IMPL_LINK( SvxGridTabPage, ClickRotateHdl_Impl, void *, EMPTYARG ) +{ + if( aCbxRotate.IsChecked() ) + aMtrFldAngle.Enable(); + else + aMtrFldAngle.Disable(); + + return( 0L ); +} + +//------------------------------------------------------------------------ + +IMPL_LINK( SvxGridTabPage, ChangeDivisionHdl_Impl, NumericField *, pField ) +{ + bAttrModified = TRUE; + if( aCbxSynchronize.IsChecked() ) + { + if(&aNumFldDivisionX == pField) + aNumFldDivisionY.SetValue( aNumFldDivisionX.GetValue() ); + else + aNumFldDivisionX.SetValue( aNumFldDivisionY.GetValue() ); + } + return 0; +} +//------------------------------------------------------------------------ + +IMPL_LINK( SvxGridTabPage, ChangeGridsnapHdl_Impl, void *, EMPTYARG ) +{ + bAttrModified = TRUE; + return 0; +} + + diff --git a/svx/source/dialog/optgrid.hrc b/svx/source/dialog/optgrid.hrc new file mode 100644 index 000000000000..ced9bee740ca --- /dev/null +++ b/svx/source/dialog/optgrid.hrc @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SVX_OPTGRID_HRC +#define _SVX_OPTGRID_HRC + +//Grid-Page +#define MTR_FLD_GRID 1 +#define GRP_DRAWGRID 2 +#define GRP_SNAPGRID 3 +#define CBX_USE_GRIDSNAP 4 +#define CBX_SYNCHRONIZE 5 +#define CBX_EQUAL_GRID 6 +#define CBX_SNAPGRID 7 +#define CBX_GRID_VISIBLE 8 +#define MTR_FLD_DRAW_Y 9 +#define MTR_FLD_SNAP_X 10 +#define MTR_FLD_SNAP_Y 11 +#define MTR_FLD_DRAW_X 12 +#define NUM_FLD_DIVISION_X 13 +#define NUM_FLD_DIVISION_Y 14 +#define FT_SNAP_X 15 +#define FT_SNAP_Y 16 +#define FT_DRAW_X 17 +#define FT_DRAW_Y 18 +#define FL_RESOLUTION 19 +#define FL_DIVISION 20 +#define FT_VERT_POINTS 21 +#define FT_HORZ_POINTS 22 +#define FT_DIVISION_Y 23 +#define FT_DIVISION_X 24 +#define CBX_SNAP_HELPLINES 25 +#define CBX_SNAP_BORDER 26 +#define CBX_SNAP_FRAME 27 +#define CBX_SNAP_POINTS 28 +#define FT_SNAP_AREA 29 +#define MTR_FLD_SNAP_AREA 30 +#define GRP_SNAP 31 +#define CBX_ORTHO 32 +#define CBX_BIGORTHO 33 +#define CBX_ROTATE 34 +#define MTR_FLD_ANGLE 35 +#define FT_BEZ_ANGLE 36 +#define MTR_FLD_BEZ_ANGLE 37 +#define GRP_ORTHO 38 +#define FL_SEPARATOR 39 + +#endif diff --git a/svx/source/dialog/optgrid.src b/svx/source/dialog/optgrid.src new file mode 100644 index 000000000000..8db8d0b54643 --- /dev/null +++ b/svx/source/dialog/optgrid.src @@ -0,0 +1,353 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + // include --------------------------------------------------------------- +#include <sfx2/sfx.hrc> +#include "helpid.hrc" +#include <svx/dialogs.hrc> +#include "optgrid.hrc" + // pragma ---------------------------------------------------------------- + +TabPage RID_SVXPAGE_GRID +{ + HelpId = HID_OPTIONS_GRID ; + SVLook = TRUE ; + Hide = TRUE ; + Size = MAP_APPFONT ( 260 , 185 ) ; + FixedLine GRP_DRAWGRID + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Grid" ; + }; + CheckBox CBX_USE_GRIDSNAP + { + Pos = MAP_APPFONT ( 12 , 14 ) ; + Size = MAP_APPFONT ( 204 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Sn~ap to grid" ; + }; + CheckBox CBX_GRID_VISIBLE + { + Pos = MAP_APPFONT ( 12 , 27 ) ; + Size = MAP_APPFONT ( 204 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "V~isible grid" ; + }; + FixedLine FL_RESOLUTION + { + Pos = MAP_APPFONT ( 6 , 45 ) ; + Size = MAP_APPFONT ( 120 , 8 ) ; + Text [ en-US ] = "Resolution" ; + }; + FixedText FT_DRAW_X + { + Pos = MAP_APPFONT ( 12 , 56 ) ; + Size = MAP_APPFONT ( 60 , 8 ) ; + Text [ en-US ] = "H~orizontal"; + }; + FixedText FT_DRAW_Y + { + Pos = MAP_APPFONT ( 12 , 71 ) ; + Size = MAP_APPFONT ( 60 , 8 ) ; + Text [ en-US ] = "~Vertical"; + }; + MetricField MTR_FLD_DRAW_X + { + Border = TRUE ; + Pos = MAP_APPFONT ( 75 , 54 ) ; + Size = MAP_APPFONT ( 45 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 10 ; + First = 10 ; + Maximum = 10000 ; + Last = 10000 ; + StrictFormat = TRUE ; + DecimalDigits = 2 ; + Unit = FUNIT_MM ; + SpinSize = 50 ; + }; + MetricField MTR_FLD_DRAW_Y + { + Border = TRUE ; + Pos = MAP_APPFONT ( 75 , 69 ) ; + Size = MAP_APPFONT ( 45 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 10 ; + First = 10 ; + Maximum = 10000 ; + Last = 10000 ; + StrictFormat = TRUE ; + DecimalDigits = 2 ; + Unit = FUNIT_MM ; + SpinSize = 50 ; + }; + FixedLine FL_DIVISION + { + Pos = MAP_APPFONT ( 130 , 45 ) ; + Size = MAP_APPFONT ( 124 , 8 ) ; + Text [ en-US ] = "Subdivision" ; + }; + FixedText FT_DIVISION_X + { + Pos = MAP_APPFONT ( 136 , 56 ) ; + Size = MAP_APPFONT ( 50 , 8 ) ; + Text [ en-US ] = "Horizont~al"; + }; + FixedText FT_DIVISION_Y + { + Pos = MAP_APPFONT ( 136 , 71 ) ; + Size = MAP_APPFONT ( 50 , 8 ) ; + Text [ en-US ] = "V~ertical"; + }; + NumericField NUM_FLD_DIVISION_X + { + Border = TRUE ; + Pos = MAP_APPFONT ( 195 , 54 ) ; + Size = MAP_APPFONT ( 25 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Maximum = 99 ; + Last = 99 ; + StrictFormat = TRUE ; + SpinSize = 1 ; + }; + FixedText FT_HORZ_POINTS + { + Pos = MAP_APPFONT ( 223 , 56 ) ; + Size = MAP_APPFONT ( 29 , 8 ) ; + Text [ en-US ] = "point(s)" ; + }; + NumericField NUM_FLD_DIVISION_Y + { + Border = TRUE ; + Pos = MAP_APPFONT ( 195 , 69 ) ; + Size = MAP_APPFONT ( 25 , 12 ) ; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Maximum = 99 ; + Last = 99 ; + StrictFormat = TRUE ; + SpinSize = 1 ; + }; + FixedText FT_VERT_POINTS + { + Pos = MAP_APPFONT ( 223 , 71 ) ; + Size = MAP_APPFONT ( 29 , 8 ) ; + + }; + CheckBox CBX_SYNCHRONIZE + { + Pos = MAP_APPFONT ( 12 , 84 ) ; + Size = MAP_APPFONT ( 127 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Synchronize a~xes" ; + }; + FixedLine GRP_SNAP + { + Pos = MAP_APPFONT ( 6 , 100 ) ; + Size = MAP_APPFONT ( 120 , 8 ) ; + Hide = TRUE; + Text [ en-US ] = "Snap" ; + }; + + CheckBox CBX_SNAP_HELPLINES + { + Pos = MAP_APPFONT ( 12 , 111 ) ; + Size = MAP_APPFONT ( 106 , 10 ) ; + Hide = TRUE; + TabStop = TRUE ; + Text [ en-US ] = "To snap lines" ; + }; + CheckBox CBX_SNAP_BORDER + { + Hide = TRUE; + TabStop = TRUE ; + Pos = MAP_APPFONT ( 12 , 125 ) ; + Size = MAP_APPFONT ( 106 , 10 ) ; + Text [ en-US ] = "To the ~page margins" ; + }; + CheckBox CBX_SNAP_FRAME + { + Pos = MAP_APPFONT ( 12 , 139 ) ; + Size = MAP_APPFONT ( 106 , 10 ) ; + Hide = TRUE; + TabStop = TRUE ; + Text [ en-US ] = "To object ~frame" ; + }; + CheckBox CBX_SNAP_POINTS + { + Pos = MAP_APPFONT ( 12 , 153 ) ; + Size = MAP_APPFONT ( 106 , 10 ) ; + Hide = TRUE; + TabStop = TRUE ; + Text [ en-US ] = "To obje~ct points" ; + }; + FixedText FT_SNAP_AREA + { + Pos = MAP_APPFONT ( 12 , 169 ) ; + Size = MAP_APPFONT ( 69 , 10 ) ; + Hide = TRUE; + Text [ en-US ] = "~Snap range" ; + }; + MetricField MTR_FLD_SNAP_AREA + { + Border = TRUE ; + Pos = MAP_APPFONT ( 83 , 167 ) ; + Size = MAP_APPFONT ( 35 , 12 ) ; + Hide = TRUE; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Minimum = 1 ; + Maximum = 50 ; + StrictFormat = TRUE ; + Unit = FUNIT_CUSTOM ; + First = 1 ; + Last = 999 ; + CustomUnitText [ en-US ] = " Pixels" ; + }; + FixedLine FL_SEPARATOR + { + Pos = MAP_APPFONT ( 127 , 111 ) ; + Size = MAP_APPFONT ( 4 , 68 ) ; + Hide = TRUE; + Vert = TRUE; + }; + FixedLine GRP_ORTHO + { + Pos = MAP_APPFONT ( 130 , 100 ) ; + Size = MAP_APPFONT ( 124 , 8 ) ; + Hide = TRUE; + Text [ en-US ] = "Snap position" ; + }; + CheckBox CBX_ORTHO + { + Pos = MAP_APPFONT ( 136 , 111 ) ; + Size = MAP_APPFONT ( 112 , 10 ) ; + Hide = TRUE; + TabStop = TRUE ; + Text [ en-US ] = "~When creating or moving objects" ; + }; + CheckBox CBX_BIGORTHO + { + Pos = MAP_APPFONT ( 136 , 125 ) ; + Size = MAP_APPFONT ( 112 , 10 ) ; + Hide = TRUE; + TabStop = TRUE ; + Text [ en-US ] = "~Extend edges" ; + }; + CheckBox CBX_ROTATE + { + Pos = MAP_APPFONT ( 136 , 139 ) ; + // 136, 111 + Size = MAP_APPFONT ( 55 , 10 ) ; + Hide = TRUE; + TabStop = TRUE ; + Text [ en-US ] = "When ro~tating" ; + }; + MetricField MTR_FLD_ANGLE + { + Border = TRUE ; + Pos = MAP_APPFONT ( 194 , 137 ) ; + // 190, 111 + Size = MAP_APPFONT ( 54 , 12 ) ; + Hide = TRUE; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Maximum = 18000 ; + Last = 18000 ; + DecimalDigits = 2 ; + StrictFormat = TRUE ; + Unit = FUNIT_CUSTOM ; + SpinSize = 500 ; + CustomUnitText [ en-US ] = " degrees" ; + }; + FixedText FT_BEZ_ANGLE + { + Pos = MAP_APPFONT ( 136 , 156 ) ; + Size = MAP_APPFONT ( 55 , 10 ) ; + Hide = TRUE; + Text [ en-US ] = "Point reducti~on" ; + }; + MetricField MTR_FLD_BEZ_ANGLE + { + Border = TRUE ; + Pos = MAP_APPFONT ( 194 , 154 ) ; + Size = MAP_APPFONT ( 54 , 12 ) ; + Hide = TRUE; + TabStop = TRUE ; + Repeat = TRUE ; + Spin = TRUE ; + Maximum = 9000 ; + Last = 9000 ; + DecimalDigits = 2 ; + StrictFormat = TRUE ; + Unit = FUNIT_CUSTOM ; + SpinSize = 500 ; + CustomUnitText [ en-US ] = " degrees" ; + }; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/svx/source/dialog/orienthelper.cxx b/svx/source/dialog/orienthelper.cxx index d61923324651..f546bb95dc21 100644 --- a/svx/source/dialog/orienthelper.cxx +++ b/svx/source/dialog/orienthelper.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: orienthelper.cxx,v $ - * $Revision: 1.6.274.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 4acb07fb27e6..0fd6bc5474da 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: pagectrl.cxx,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -35,10 +32,10 @@ #include <vcl/bitmap.hxx> -#include <svx/frmdiritem.hxx> +#include <editeng/frmdiritem.hxx> #include <svx/pageitem.hxx> #include <svx/pagectrl.hxx> -#include <svx/boxitem.hxx> +#include <editeng/boxitem.hxx> #include <algorithm> diff --git a/svx/source/dialog/paraprev.cxx b/svx/source/dialog/paraprev.cxx index 367c39628413..ef0dbb6b0931 100644 --- a/svx/source/dialog/paraprev.cxx +++ b/svx/source/dialog/paraprev.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: paraprev.cxx,v $ - * $Revision: 1.14 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/passwd.cxx b/svx/source/dialog/passwd.cxx index 5977102d0af4..19d97d368496 100644 --- a/svx/source/dialog/passwd.cxx +++ b/svx/source/dialog/passwd.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: passwd.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/passwd.hrc b/svx/source/dialog/passwd.hrc index 4992632f7e8b..337990a952e6 100644 --- a/svx/source/dialog/passwd.hrc +++ b/svx/source/dialog/passwd.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: passwd.hrc,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/passwd.src b/svx/source/dialog/passwd.src index 8f9397b43d27..256628a2caca 100644 --- a/svx/source/dialog/passwd.src +++ b/svx/source/dialog/passwd.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: passwd.src,v $ - * $Revision: 1.26 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/pfiledlg.cxx b/svx/source/dialog/pfiledlg.cxx index 98bac431296c..aa6e0b835e2c 100644 --- a/svx/source/dialog/pfiledlg.cxx +++ b/svx/source/dialog/pfiledlg.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: pfiledlg.cxx,v $ - * $Revision: 1.13 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/prtqry.cxx b/svx/source/dialog/prtqry.cxx index 47c190742d5d..07f4d2fe9928 100644 --- a/svx/source/dialog/prtqry.cxx +++ b/svx/source/dialog/prtqry.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: prtqry.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/prtqry.src b/svx/source/dialog/prtqry.src index 09f7abfcd6e9..9ae23f6a4a05 100644 --- a/svx/source/dialog/prtqry.src +++ b/svx/source/dialog/prtqry.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: prtqry.src,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx index d0187f456de7..8cdb6ee5ba3f 100644 --- a/svx/source/dialog/relfld.cxx +++ b/svx/source/dialog/relfld.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: relfld.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/rlrcitem.cxx b/svx/source/dialog/rlrcitem.cxx index 53e1e8bea1e9..38223bcb8893 100644 --- a/svx/source/dialog/rlrcitem.cxx +++ b/svx/source/dialog/rlrcitem.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: rlrcitem.cxx,v $ - * $Revision: 1.11 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -42,10 +39,10 @@ #include <svx/dialogs.hrc> #include <svx/ruler.hxx> -#include <svx/lrspitem.hxx> -#include <svx/ulspitem.hxx> -#include <svx/tstpitem.hxx> -#include "protitem.hxx" +#include <editeng/lrspitem.hxx> +#include <editeng/ulspitem.hxx> +#include <editeng/tstpitem.hxx> +#include "editeng/protitem.hxx" #include "rlrcitem.hxx" #include "rulritem.hxx" #include <svl/eitem.hxx> diff --git a/svx/source/dialog/rlrcitem.hxx b/svx/source/dialog/rlrcitem.hxx index 9bf6fed688e9..c8595a92495e 100644 --- a/svx/source/dialog/rlrcitem.hxx +++ b/svx/source/dialog/rlrcitem.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: rlrcitem.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 8c4d1cc07cd0..f2cabe5fa4e1 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: rubydialog.cxx,v $ - * $Revision: 1.30 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/rubydialog.hrc b/svx/source/dialog/rubydialog.hrc index a1d825aacd11..f22b1da10ea7 100644 --- a/svx/source/dialog/rubydialog.hrc +++ b/svx/source/dialog/rubydialog.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: rubydialog.hrc,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/rubydialog.src b/svx/source/dialog/rubydialog.src index 93f9e147fe5a..6b83f01fc2ee 100644 --- a/svx/source/dialog/rubydialog.src +++ b/svx/source/dialog/rubydialog.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: rubydialog.src,v $ - * $Revision: 1.43 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/ruler.hrc b/svx/source/dialog/ruler.hrc index d8df43ea6712..1280b1237bc5 100644 --- a/svx/source/dialog/ruler.hrc +++ b/svx/source/dialog/ruler.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: ruler.hrc,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/ruler.src b/svx/source/dialog/ruler.src index 39e37cc7ac5d..4d0218f525ee 100644 --- a/svx/source/dialog/ruler.src +++ b/svx/source/dialog/ruler.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: ruler.src,v $ - * $Revision: 1.24 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/rulritem.cxx b/svx/source/dialog/rulritem.cxx index 05165121c4ee..fd0007cce8e5 100644 --- a/svx/source/dialog/rulritem.cxx +++ b/svx/source/dialog/rulritem.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: rulritem.cxx,v $ - * $Revision: 1.14 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/sdstring.src b/svx/source/dialog/sdstring.src index 4668e0c42fa0..4b70dda6a151 100644 --- a/svx/source/dialog/sdstring.src +++ b/svx/source/dialog/sdstring.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: sdstring.src,v $ - * $Revision: 1.42 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -367,32 +364,6 @@ String RID_SVXSTR_LINEJOINT_ROUND Text [ en-US ] = "Line joint round"; }; -String RID_SVXSTR_GRFILTER_OPENERROR -{ - Text [ en-US ] = "Graphics file cannot be opened" ; -}; -String RID_SVXSTR_GRFILTER_IOERROR -{ - Text [ en-US ] = "Graphics file cannot be read" ; -}; -String RID_SVXSTR_GRFILTER_FORMATERROR -{ - Text [ en-US ] = "Unknown graphics format" ; -}; -String RID_SVXSTR_GRFILTER_VERSIONERROR -{ - Text [ en-US ] = "This version of the graphics file is not supported" ; -}; -String RID_SVXSTR_GRFILTER_FILTERERROR -{ - Text [ en-US ] = "Graphics filter not found" ; -}; -String RID_SVXSTR_GRFILTER_TOOBIG -{ - Text [ en-US ] = "Not enough memory to insert graphic" ; -}; - - /////////////////////////////////////////////////////////////////////////////// // // Reference-strings for standardcolor-table diff --git a/svx/source/dialog/sendreportgen.cxx b/svx/source/dialog/sendreportgen.cxx index 141eb7a33253..00295556164f 100644 --- a/svx/source/dialog/sendreportgen.cxx +++ b/svx/source/dialog/sendreportgen.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: sendreportgen.cxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/sendreportunx.cxx b/svx/source/dialog/sendreportunx.cxx index 895fb2d25a01..47a75f668b2f 100644 --- a/svx/source/dialog/sendreportunx.cxx +++ b/svx/source/dialog/sendreportunx.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: sendreportunx.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/sendreportw32.cxx b/svx/source/dialog/sendreportw32.cxx index 3bf53a53ff09..10734e8495f6 100644 --- a/svx/source/dialog/sendreportw32.cxx +++ b/svx/source/dialog/sendreportw32.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: sendreportw32.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/simptabl.cxx b/svx/source/dialog/simptabl.cxx index 8fe68a692a11..ab5533513000 100644 --- a/svx/source/dialog/simptabl.cxx +++ b/svx/source/dialog/simptabl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: simptabl.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -291,7 +288,7 @@ void SvxSimpleTable::ShowTable() void SvxSimpleTable::HideTable() { - aPrivContainer.Show(); + aPrivContainer.Hide(); } BOOL SvxSimpleTable::IsVisible() const diff --git a/svx/source/dialog/splwrap.cxx b/svx/source/dialog/splwrap.cxx deleted file mode 100644 index ad3a973fc2a8..000000000000 --- a/svx/source/dialog/splwrap.cxx +++ /dev/null @@ -1,642 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: splwrap.cxx,v $ - * $Revision: 1.19 $ - * - * 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_svx.hxx" -#include<rtl/ustring.hxx> -#include <tools/shl.hxx> -#include <vcl/wrkwin.hxx> -#include <vcl/svapp.hxx> -#include <vcl/msgbox.hxx> -#include <tools/debug.hxx> - -#ifndef __RSC -#include <tools/errinf.hxx> -#endif -#include <svxerr.hxx> -#include <dlgutil.hxx> -#include <unolingu.hxx> -#include <sfx2/sfxuno.hxx> -#include <linguistic/lngprops.hxx> -#include <com/sun/star/frame/XStorable.hpp> - -#include <map> - -#include <svx/svxenum.hxx> -#include "hyphen.hxx" // Der HyphenDialog -#include <svx/splwrap.hxx> // Der Wrapper -#include <svx/thesdlg.hxx> // ThesaurusDlg -#include <svx/dialmgr.hxx> - -#include <svx/dialogs.hrc> - - -#define WAIT_ON() if(pWin != NULL) { pWin->EnterWait(); } - -#define WAIT_OFF() if(pWin != NULL) { pWin->LeaveWait(); } - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::linguistic2; - - -// misc functions --------------------------------------------- - -void SvxPrepareAutoCorrect( String &rOldText, String &rNewText ) -{ - // This function should be used to strip (or add) trailing '.' from - // the strings before passing them on to the autocorrect function in - // order that the autocorrect function will hopefully - // works properly with normal words and abbreviations (with trailing '.') - // independ of if they are at the end of the sentence or not. - // - // rOldText: text to be replaced - // rNewText: replacement text - - xub_StrLen nOldLen = rOldText.Len(), - nNewLen = rNewText.Len(); - if (nOldLen && nNewLen) - { - sal_Bool bOldHasDot = sal_Unicode( '.' ) == rOldText.GetChar( nOldLen - 1 ), - bNewHasDot = sal_Unicode( '.' ) == rNewText.GetChar( nNewLen - 1 ); - if (bOldHasDot && !bNewHasDot - /*this is: !(bOldHasDot && bNewHasDot) && bOldHasDot*/) - rOldText.Erase( nOldLen - 1 ); - } -} - -// ----------------------------------------------------------------------- - -#define SVX_LANG_NEED_CHECK 0 -#define SVX_LANG_OK 1 -#define SVX_LANG_MISSING 2 -#define SVX_LANG_MISSING_DO_WARN 3 - -#define SVX_FLAGS_NEW - - -struct lt_LanguageType -{ - bool operator()( LanguageType n1, LanguageType n2 ) const - { - return n1 < n2; - } -}; - -typedef std::map< LanguageType, USHORT, lt_LanguageType > LangCheckState_map_t; - -static LangCheckState_map_t & GetLangCheckState() -{ - static LangCheckState_map_t aLangCheckState; - return aLangCheckState; -} - -void SvxSpellWrapper::ShowLanguageErrors() -{ - // display message boxes for languages not available for - // spellchecking or hyphenation - LangCheckState_map_t &rLCS = GetLangCheckState(); - LangCheckState_map_t::iterator aIt( rLCS.begin() ); - while (aIt != rLCS.end()) - { - LanguageType nLang = aIt->first; - sal_uInt16 nVal = aIt->second; - sal_uInt16 nTmpSpell = nVal & 0x00FF; - sal_uInt16 nTmpHyph = (nVal >> 8) & 0x00FF; - - if (SVX_LANG_MISSING_DO_WARN == nTmpSpell) - { - String aErr( ::GetLanguageString( nLang ) ); - ErrorHandler::HandleError( - *new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ) ); - nTmpSpell = SVX_LANG_MISSING; - } - if (SVX_LANG_MISSING_DO_WARN == nTmpHyph) - { - String aErr( ::GetLanguageString( nLang ) ); - ErrorHandler::HandleError( - *new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ) ); - nTmpHyph = SVX_LANG_MISSING; - } - - rLCS[ nLang ] = (nTmpHyph << 8) | nTmpSpell; - ++aIt; - } - -} - -SvxSpellWrapper::~SvxSpellWrapper() -{ -} - -/*-------------------------------------------------------------------- - * Beschreibung: Ctor, die Pruefreihenfolge wird festgelegt - * - * !bStart && !bOtherCntnt: BODY_END, BODY_START, OTHER - * !bStart && bOtherCntnt: OTHER, BODY - * bStart && !bOtherCntnt: BODY_END, OTHER - * bStart && bOtherCntnt: OTHER - * - --------------------------------------------------------------------*/ - -SvxSpellWrapper::SvxSpellWrapper( Window* pWn, - Reference< XSpellChecker1 > &xSpellChecker, - const sal_Bool bStart, const sal_Bool bIsAllRight, - const sal_Bool bOther, const sal_Bool bRevAllow ) : - - pWin ( pWn ), - xSpell ( xSpellChecker ), - bOtherCntnt ( bOther ), - bDialog ( sal_False ), - bHyphen ( sal_False ), - bAuto ( sal_False ), - bStartChk ( bOther ), - bRevAllowed ( bRevAllow ), - bAllRight ( bIsAllRight ) -{ - Reference< beans::XPropertySet > xProp( SvxGetLinguPropertySet() ); - sal_Bool bWrapReverse = xProp.is() ? - *(sal_Bool*)xProp->getPropertyValue( - ::rtl::OUString::createFromAscii(UPN_IS_WRAP_REVERSE) ).getValue() - : sal_False; - bReverse = bRevAllow && bWrapReverse; - bStartDone = bOther || ( !bReverse && bStart ); - bEndDone = bReverse && bStart && !bOther; -} - -// ----------------------------------------------------------------------- - -SvxSpellWrapper::SvxSpellWrapper( Window* pWn, - Reference< XHyphenator > &xHyphenator, - const sal_Bool bStart, const sal_Bool bOther ) : - pWin ( pWn ), - xHyph ( xHyphenator ), - bOtherCntnt ( bOther ), - bDialog ( sal_False ), - bHyphen ( sal_False ), - bAuto ( sal_False ), - bReverse ( sal_False ), - bStartDone ( bOther || ( !bReverse && bStart ) ), - bEndDone ( bReverse && bStart && !bOther ), - bStartChk ( bOther ), - bRevAllowed ( sal_False ), - bAllRight ( sal_True ) -{ -} - -// ----------------------------------------------------------------------- - -sal_Int16 SvxSpellWrapper::CheckSpellLang( - Reference< XSpellChecker1 > xSpell, sal_Int16 nLang) -{ - LangCheckState_map_t &rLCS = GetLangCheckState(); - - LangCheckState_map_t::iterator aIt( rLCS.find( nLang ) ); - sal_uInt16 nVal = aIt == rLCS.end() ? SVX_LANG_NEED_CHECK : aIt->second; - - if (aIt == rLCS.end()) - rLCS[ nLang ] = nVal; - - if (SVX_LANG_NEED_CHECK == (nVal & 0x00FF)) - { - sal_uInt16 nTmpVal = SVX_LANG_MISSING_DO_WARN; - if (xSpell.is() && xSpell->hasLanguage( nLang )) - nTmpVal = SVX_LANG_OK; - nVal &= 0xFF00; - nVal |= nTmpVal; - - rLCS[ nLang ] = nVal; - } - - return (sal_Int16) nVal; -} - -sal_Int16 SvxSpellWrapper::CheckHyphLang( - Reference< XHyphenator > xHyph, sal_Int16 nLang) -{ - LangCheckState_map_t &rLCS = GetLangCheckState(); - - LangCheckState_map_t::iterator aIt( rLCS.find( nLang ) ); - sal_uInt16 nVal = aIt == rLCS.end() ? 0 : aIt->second; - - if (aIt == rLCS.end()) - rLCS[ nLang ] = nVal; - - if (SVX_LANG_NEED_CHECK == ((nVal >> 8) & 0x00FF)) - { - sal_uInt16 nTmpVal = SVX_LANG_MISSING_DO_WARN; - if (xHyph.is() && xHyph->hasLocale( SvxCreateLocale( nLang ) )) - nTmpVal = SVX_LANG_OK; - nVal &= 0x00FF; - nVal |= nTmpVal << 8; - - rLCS[ nLang ] = nVal; - } - - return (sal_Int16) nVal; -} - -// ----------------------------------------------------------------------- - - -void SvxSpellWrapper::SpellStart( SvxSpellArea /*eSpell*/ ) -{ // Hier muessen die notwendigen Vorbereitungen fuer SpellContinue -} // im uebergebenen Bereich getroffen werden. - -// ----------------------------------------------------------------------- - - -sal_Bool SvxSpellWrapper::HasOtherCnt() -{ - return sal_False; // Gibt es ueberhaupt einen Sonderbereich? -} - -// ----------------------------------------------------------------------- - - -sal_Bool SvxSpellWrapper::SpellMore() -{ - return sal_False; // Sollen weitere Dokumente geprueft werden? -} - -// ----------------------------------------------------------------------- - - -void SvxSpellWrapper::SpellEnd() -{ // Bereich ist abgeschlossen, ggf. Aufraeumen - - // display error for last language not found - ShowLanguageErrors(); -} - -// ----------------------------------------------------------------------- - - -sal_Bool SvxSpellWrapper::SpellContinue() -{ - return sal_False; -} - -// ----------------------------------------------------------------------- - -void SvxSpellWrapper::AutoCorrect( const String&, const String& ) -{ -} - -// ----------------------------------------------------------------------- - - -void SvxSpellWrapper::ScrollArea() -{ // Scrollarea einstellen -} - -// ----------------------------------------------------------------------- - - -void SvxSpellWrapper::ChangeWord( const String&, const sal_uInt16 ) -{ // Wort ersetzen -} - -// ----------------------------------------------------------------------- - - -String SvxSpellWrapper::GetThesWord() -{ - // Welches Wort soll nachgeschlagen werden? - return String(); -} - -// ----------------------------------------------------------------------- - - -void SvxSpellWrapper::ChangeThesWord( const String& ) -{ - // Wort wg. Thesaurus ersetzen -} - -// ----------------------------------------------------------------------- - -void SvxSpellWrapper::StartThesaurus( const String &rWord, sal_uInt16 nLanguage ) -{ - - String sErr( SVX_RES( RID_SVXSTR_HMERR_THESAURUS ) ); - - Reference< XThesaurus > xThes( SvxGetThesaurus() ); - if (!xThes.is()) - { - InfoBox( pWin, sErr ).Execute(); - return; - } - - WAIT_ON(); // while looking up for initial word - SvxThesaurusDialog aDlg(pWin, xThes, rWord, nLanguage); - WAIT_OFF(); - - if ( aDlg.Execute()== RET_OK ) - { - ChangeThesWord( aDlg.GetWord() ); - } - -} - -// ----------------------------------------------------------------------- - -void SvxSpellWrapper::ReplaceAll( const String &, sal_Int16 ) -{ // Wort aus der Replace-Liste ersetzen -} - -// ----------------------------------------------------------------------- - - -void SvxSpellWrapper::SetLanguage( const sal_uInt16 ) -{ // Sprache aendern -} - -// ----------------------------------------------------------------------- - - -void SvxSpellWrapper::InsertHyphen( const sal_uInt16 ) -{ // Hyphen einfuegen bzw. loeschen -} - -// ----------------------------------------------------------------------- -// Pruefung der Dokumentbereiche in der durch die Flags angegebenen Reihenfolge - - -void SvxSpellWrapper::SpellDocument( ) -{ - if ( bOtherCntnt ) - { - bReverse = sal_False; - SpellStart( SVX_SPELL_OTHER ); - } - else - { - bStartChk = bReverse; - SpellStart( bReverse ? SVX_SPELL_BODY_START : SVX_SPELL_BODY_END ); - } - - if ( FindSpellError() ) - { - Reference< XSpellAlternatives > xAlt( GetLast(), UNO_QUERY ); - Reference< XHyphenatedWord > xHyphWord( GetLast(), UNO_QUERY ); - - Window *pOld = pWin; - bDialog = sal_True; - if (xHyphWord.is()) - { - DBG_ASSERT(xHyphWord.is(), "NULL pointer"); - SvxHyphenWordDialog* pDlg = - new SvxHyphenWordDialog( xHyphWord->getWord(), - SvxLocaleToLanguage( xHyphWord->getLocale() ), - pWin, xHyph, this ); - pWin = pDlg; - pDlg->Execute(); - delete pDlg; - } - bDialog = sal_False; - pWin = pOld; - }; -} - -// ----------------------------------------------------------------------- -// Naechsten Bereich auswaehlen - - -sal_Bool SvxSpellWrapper::SpellNext( ) -{ - Reference< beans::XPropertySet > xProp( SvxGetLinguPropertySet() ); - sal_Bool bWrapReverse = xProp.is() ? - *(sal_Bool*)xProp->getPropertyValue( - ::rtl::OUString::createFromAscii(UPN_IS_WRAP_REVERSE) ).getValue() - : sal_False; - sal_Bool bActRev = bRevAllowed && bWrapReverse; - - // bActRev ist die Richtung nach dem Spellen, bReverse die am Anfang. - if( bActRev == bReverse ) - { // Keine Richtungsaenderung, also ist - if( bStartChk ) // der gewuenschte Bereich ( bStartChk ) - bStartDone = sal_True; // vollstaendig abgearbeitet. - else - bEndDone = sal_True; - } - else if( bReverse == bStartChk ) // Bei einer Richtungsaenderung kann - { // u.U. auch ein Bereich abgearbeitet sein. - if( bStartChk ) // Sollte der vordere Teil rueckwaerts gespellt - bEndDone = sal_True; // werden und wir kehren unterwegs um, so ist - else // der hintere Teil abgearbeitet (und umgekehrt). - bStartDone = sal_True; - } - - bReverse = bActRev; - if( bOtherCntnt && bStartDone && bEndDone ) // Dokument komplett geprueft? - { - if ( SpellMore() ) // ein weiteres Dokument pruefen? - { - bOtherCntnt = sal_False; - bStartDone = !bReverse; - bEndDone = bReverse; - SpellStart( SVX_SPELL_BODY ); - return sal_True; - } - return sal_False; - } - - ResMgr& rMgr = DIALOG_MGR(); - sal_Bool bGoOn = sal_False; - - if ( bOtherCntnt ) - { - bStartChk = sal_False; - SpellStart( SVX_SPELL_BODY ); - bGoOn = sal_True; - } - else if ( bStartDone && bEndDone ) - { - sal_Bool bIsSpellSpecial = xProp.is() ? - *(sal_Bool*)xProp->getPropertyValue( - ::rtl::OUString::createFromAscii(UPN_IS_SPELL_SPECIAL) ).getValue() - : sal_False; - // Bodybereich erledigt, Frage nach Sonderbereich - if( !IsHyphen() && bIsSpellSpecial && HasOtherCnt() ) - { - SpellStart( SVX_SPELL_OTHER ); - bOtherCntnt = bGoOn = sal_True; - } - else if ( SpellMore() ) // ein weiteres Dokument pruefen? - { - bOtherCntnt = sal_False; - bStartDone = !bReverse; - bEndDone = bReverse; - SpellStart( SVX_SPELL_BODY ); - return sal_True; - } - } - else - { - // Ein BODY_Bereich erledigt, Frage nach dem anderen BODY_Bereich - WAIT_OFF(); - -// Sobald im Dialog das DontWrapAround gesetzt werden kann, kann der -// folgende #ifdef-Zweig aktiviert werden ... -#ifdef USED - sal_Bool bDontWrapAround = IsHyphen() ? - pSpell->GetOptions() & DONT_WRAPAROUND : - pSpell->GetHyphOptions() & HYPH_DONT_WRAPAROUND; - if( bDontWrapAround ) -#else - sal_uInt16 nResId = bReverse ? RID_SVXQB_BW_CONTINUE : RID_SVXQB_CONTINUE; - QueryBox aBox( pWin, ResId( nResId, rMgr ) ); - if ( aBox.Execute() != RET_YES ) -#endif - - { - // Verzicht auf den anderen Bereich, ggf. Frage nach Sonderbereich - WAIT_ON(); - bStartDone = bEndDone = sal_True; - return SpellNext(); - } - else - { - bStartChk = !bStartDone; - SpellStart( bStartChk ? SVX_SPELL_BODY_START : SVX_SPELL_BODY_END ); - bGoOn = sal_True; - } - WAIT_ON(); - } - return bGoOn; -} - -// ----------------------------------------------------------------------- - -Reference< XDictionary > SvxSpellWrapper::GetAllRightDic() const -{ - Reference< XDictionary > xDic; - - Reference< XDictionaryList > xDicList( SvxGetDictionaryList() ); - if (xDicList.is()) - { - Sequence< Reference< XDictionary > > aDics( xDicList->getDictionaries() ); - const Reference< XDictionary > *pDic = aDics.getConstArray(); - sal_Int32 nCount = aDics.getLength(); - - sal_Int32 i = 0; - while (!xDic.is() && i < nCount) - { - Reference< XDictionary > xTmp( pDic[i], UNO_QUERY ); - if (xTmp.is()) - { - if ( xTmp->isActive() && - xTmp->getDictionaryType() != DictionaryType_NEGATIVE && - SvxLocaleToLanguage( xTmp->getLocale() ) == LANGUAGE_NONE ) - { - Reference< frame::XStorable > xStor( xTmp, UNO_QUERY ); - if (xStor.is() && xStor->hasLocation() && !xStor->isReadonly()) - { - xDic = xTmp; - } - } - } - ++i; - } - - if (!xDic.is()) - { - xDic = SvxGetOrCreatePosDic( xDicList ); - if (xDic.is()) - xDic->setActive( sal_True ); - } - } - - return xDic; -} - -// ----------------------------------------------------------------------- - -sal_Bool SvxSpellWrapper::FindSpellError() -{ - ShowLanguageErrors(); - - Reference< XInterface > xRef; - - WAIT_ON(); - sal_Bool bSpell = sal_True; - - Reference< XDictionary > xAllRightDic; - if (IsAllRight()) - xAllRightDic = GetAllRightDic(); - - while ( bSpell ) - { - SpellContinue(); - - Reference< XSpellAlternatives > xAlt( GetLast(), UNO_QUERY ); - Reference< XHyphenatedWord > xHyphWord( GetLast(), UNO_QUERY ); - - if (xAlt.is()) - { - if (IsAllRight() && xAllRightDic.is()) - { - xAllRightDic->add( xAlt->getWord(), sal_False, ::rtl::OUString() ); - } - else - { - // look up in ChangeAllList for misspelled word - Reference< XDictionary > xChangeAllList( - SvxGetChangeAllList(), UNO_QUERY ); - Reference< XDictionaryEntry > xEntry; - if (xChangeAllList.is()) - xEntry = xChangeAllList->getEntry( xAlt->getWord() ); - - if (xEntry.is()) - { - // replace word without asking - ReplaceAll( xEntry->getReplacementText(), - SvxLocaleToLanguage( xAlt->getLocale() ) ); - } - else - bSpell = sal_False; - } - } - else if (xHyphWord.is()) - bSpell = sal_False; - else - { - SpellEnd(); - bSpell = SpellNext(); - } - } - WAIT_OFF(); - return GetLast().is(); -} - - - diff --git a/svx/source/dialog/srchctrl.cxx b/svx/source/dialog/srchctrl.cxx index a55fe24d6955..993288bcd622 100644 --- a/svx/source/dialog/srchctrl.cxx +++ b/svx/source/dialog/srchctrl.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: srchctrl.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -44,7 +41,7 @@ #include "srchctrl.hxx" #include "srchdlg.hxx" -#include <sfx2/srchitem.hxx> +#include <svl/srchitem.hxx> // class SvxSearchFamilyControllerItem ----------------------------------- diff --git a/svx/source/dialog/srchctrl.hxx b/svx/source/dialog/srchctrl.hxx index 94c0bd5b3bcb..107280743ba6 100644 --- a/svx/source/dialog/srchctrl.hxx +++ b/svx/source/dialog/srchctrl.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: srchctrl.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 9a121a578448..5f3aa24394a3 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: srchdlg.cxx,v $ - * $Revision: 1.46 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -53,6 +50,7 @@ #include <com/sun/star/frame/XModuleManager.hpp> #include <comphelper/processfactory.hxx> #include <svl/itempool.hxx> +#include <svl/intitem.hxx> #include <sfx2/app.hxx> #include <toolkit/unohlp.hxx> @@ -67,13 +65,13 @@ #define ITEMID_SETITEM 0 -#include <sfx2/srchitem.hxx> +#include <svl/srchitem.hxx> #include <svx/pageitem.hxx> #include "srchctrl.hxx" #include <svx/dialmgr.hxx> #include "dlgutil.hxx" -#include <svx/brshitem.hxx> - +#include <editeng/brshitem.hxx> +#include <tools/resary.hxx> #include <svx/svxdlg.hxx> //CHINA001 #include <sfx2/layout-pre.hxx> @@ -81,6 +79,7 @@ using namespace com::sun::star::i18n; using namespace com::sun::star; using namespace comphelper; + // ----------------------------------------------------------------------- #define REMEMBER_SIZE 10 @@ -2320,8 +2319,7 @@ String& SvxSearchDialog::BuildAttrText_Impl( String& rStr, // Metrik abfragen SfxMapUnit eMapUnit = SFX_MAPUNIT_CM; - FieldUnit eFieldUnit = GetModuleFieldUnit(); - + FieldUnit eFieldUnit = pSh->GetModule()->GetFieldUnit(); switch ( eFieldUnit ) { case FUNIT_MM: eMapUnit = SFX_MAPUNIT_MM; break; @@ -2338,6 +2336,8 @@ String& SvxSearchDialog::BuildAttrText_Impl( String& rStr, default: ;//prevent warning } + ResStringArray aAttrNames( SVX_RES( RID_ATTR_NAMES ) ); + for ( USHORT i = 0; i < pList->Count(); ++i ) { const SearchAttrItem& rItem = pList->GetObject(i); @@ -2353,13 +2353,16 @@ String& SvxSearchDialog::BuildAttrText_Impl( String& rStr, eMapUnit, aStr ); rStr += aStr; } - else + else if ( rItem.nSlot == SID_ATTR_BRUSH_CHAR ) { //Sonderbehandlung fuer Zeichenhintergrund - USHORT nId = rItem.nSlot == SID_ATTR_BRUSH_CHAR ? - RID_SVXITEMS_BRUSH_CHAR : - rItem.nSlot - SID_SVX_START + RID_ATTR_BEGIN; - rStr += SVX_RESSTR( nId ); + rStr += SVX_RESSTR( RID_SVXITEMS_BRUSH_CHAR ); + } + else + { + sal_uInt32 nId = aAttrNames.FindIndex( rItem.nSlot ); + if ( RESARRAY_INDEX_NOTFOUND != nId ) + rStr += aAttrNames.GetString( nId ); } } return rStr; diff --git a/svx/source/dialog/srchdlg.hrc b/svx/source/dialog/srchdlg.hrc index a903caa86801..6632b11fd7c8 100644 --- a/svx/source/dialog/srchdlg.hrc +++ b/svx/source/dialog/srchdlg.hrc @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: srchdlg.hrc,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/srchdlg.src b/svx/source/dialog/srchdlg.src index 2c69a25b92d8..a91c5c00aa6b 100644 --- a/svx/source/dialog/srchdlg.src +++ b/svx/source/dialog/srchdlg.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: srchdlg.src,v $ - * $Revision: 1.75 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/stddlg.cxx b/svx/source/dialog/stddlg.cxx index 7533522cff6e..0cd6421f5a77 100644 --- a/svx/source/dialog/stddlg.cxx +++ b/svx/source/dialog/stddlg.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: stddlg.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/strarray.cxx b/svx/source/dialog/strarray.cxx index 348eaea3e06f..47cb66850e9f 100644 --- a/svx/source/dialog/strarray.cxx +++ b/svx/source/dialog/strarray.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: strarray.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx index dcfaabf0f415..cbf5a39997bd 100644 --- a/svx/source/dialog/svxbmpnumvalueset.cxx +++ b/svx/source/dialog/svxbmpnumvalueset.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: svxbmpnumvalueset.cxx,v $ - * $Revision: 1.15 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -41,17 +38,17 @@ #ifndef _SVX_HELPID_HRC #include <helpid.hrc> #endif -#include <svx/numitem.hxx> +#include <editeng/numitem.hxx> #include <svl/eitem.hxx> #include <vcl/svapp.hxx> #include <gallery.hxx> #include <svl/urihelper.hxx> -#include <svx/brshitem.hxx> +#include <editeng/brshitem.hxx> #include <svl/intitem.hxx> #include <sfx2/objsh.hxx> #include <vcl/graph.hxx> #include <vcl/msgbox.hxx> -#include <flstitem.hxx> +#include <editeng/flstitem.hxx> #include <dlgutil.hxx> #ifndef _XTABLE_HXX //autogen @@ -62,7 +59,7 @@ #include <htmlmode.hxx> #include <unotools/pathoptions.hxx> #include <svtools/ctrltool.hxx> -#include <unolingu.hxx> +#include <editeng/unolingu.hxx> #include <com/sun/star/style/NumberingType.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XIndexAccess.hpp> @@ -73,7 +70,7 @@ #include <com/sun/star/text/XNumberingTypeInfo.hpp> #include <algorithm> -#include "opengrf.hxx" +#include <sfx2/opengrf.hxx> using namespace com::sun::star::uno; using namespace com::sun::star::beans; diff --git a/svx/source/dialog/svxbmpnumvalueset.src b/svx/source/dialog/svxbmpnumvalueset.src index 065bc7ee8f64..aa01932e359b 100644 --- a/svx/source/dialog/svxbmpnumvalueset.src +++ b/svx/source/dialog/svxbmpnumvalueset.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: numpages.src,v $ - * $Revision: 1.64.242.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/svxbox.cxx b/svx/source/dialog/svxbox.cxx deleted file mode 100644 index 4cdd6249be56..000000000000 --- a/svx/source/dialog/svxbox.cxx +++ /dev/null @@ -1,623 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: svxbox.cxx,v $ - * $Revision: 1.8 $ - * - * 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_svx.hxx" -#include <tools/debug.hxx> -#ifndef _APP_HXX //autogen -#include <vcl/svapp.hxx> -#endif - -#include <svx/svxbox.hxx> -#include <unotools/charclass.hxx> - -// ----------------------------------------------------------------------- - -SV_IMPL_PTRARR(SvxEntryLst, SvxBoxEntry*) - -/*-------------------------------------------------------------------- - Beschreibung: Ein ListboxElement - --------------------------------------------------------------------*/ - -SvxBoxEntry::SvxBoxEntry() : - nId(LISTBOX_ENTRY_NOTFOUND), - bModified(FALSE), - bNew(FALSE) -{ -} - - -SvxBoxEntry::SvxBoxEntry(const String& aNam, USHORT nIdx) : - aName(aNam), - nId(nIdx), - bModified(FALSE), - bNew(FALSE) -{ -} - - -SvxBoxEntry::SvxBoxEntry(const SvxBoxEntry& rOld) : - aName(rOld.aName), - nId(rOld.nId), - bModified(rOld.bModified), - bNew(rOld.bNew) -{ -} - -/*-------------------------------------------------------------------- - Beschreibung: - --------------------------------------------------------------------*/ - -SvxListBox::SvxListBox(Window* pParent, WinBits nBits) : - ListBox(pParent, nBits) -{ - InitListBox(); -} - - -SvxListBox::SvxListBox(Window* pParent, const ResId& rId): - ListBox(pParent, rId) -{ - InitListBox(); -} - -/*-------------------------------------------------------------------- - Beschreibung: Basisklasse Dtor - --------------------------------------------------------------------*/ - -__EXPORT SvxListBox::~SvxListBox() -{ - aEntryLst.DeleteAndDestroy(0, aEntryLst.Count()); - aDelEntryLst.DeleteAndDestroy(0, aDelEntryLst.Count()); -} - -/*-------------------------------------------------------------------- - Beschreibung: Evtl. Liste aus der Ressource beachten - --------------------------------------------------------------------*/ - -void SvxListBox::InitListBox() -{ - // Verwaltung fuer die Stringlist aus der Resource aufbauen - USHORT nSize = GetEntryCount(); - for(USHORT i=0; i < nSize; ++i) - { const SvxBoxEntry* pTmp = new SvxBoxEntry(ListBox::GetEntry(i), i); - const SvxBoxEntry* &rpTmp = pTmp; - aEntryLst.Insert(rpTmp, aEntryLst.Count()); - } -} - -/*-------------------------------------------------------------------- - Beschreibung: neue Eintraege verwalten - --------------------------------------------------------------------*/ - -void SvxListBox::InsertNewEntry(const SvxBoxEntry& rEntry) -{ - SvxBoxEntry* pNew = new SvxBoxEntry(rEntry); - pNew->bNew = TRUE; - InsertSorted(pNew); -} - -/*-------------------------------------------------------------------- - Beschreibung: Eintrag in die ListBox aufnehmen - --------------------------------------------------------------------*/ - -void SvxListBox::InsertEntry(const SvxBoxEntry& rEntry, USHORT nPos) -{ - if(nPos != LISTBOX_ENTRY_NOTFOUND) - { - SvxBoxEntry* pEntry = new SvxBoxEntry(rEntry); - ListBox::InsertEntry(pEntry->aName, nPos); - //const SvxBoxEntry* &rpEntry = pEntry; - aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos); - } - else - InsertSorted(new SvxBoxEntry(rEntry)); -} - -/*-------------------------------------------------------------------- - Beschreibung: Eintrag aus der Liste loeschen - --------------------------------------------------------------------*/ - -void SvxListBox::RemoveEntry(USHORT nPos) -{ - if(nPos >= aEntryLst.Count()) - return; - - // Altes Element austragen - SvxBoxEntry* pEntry = aEntryLst[nPos]; - aEntryLst.Remove(nPos, 1); - ListBox::RemoveEntry(nPos); - - // keine neuen Eintraege in die Liste mit aufnehmen - if(pEntry->bNew) - return; - - // in DeleteListe eintragen - aDelEntryLst.C40_INSERT(SvxBoxEntry, pEntry, aDelEntryLst.Count()); -} - -/*-------------------------------------------------------------------- - Beschreibung: Eintrag ueber konkretes Obkjekt loeschen - --------------------------------------------------------------------*/ - -void SvxListBox::RemoveEntry(const SvxBoxEntry& rEntry) -{ - USHORT nPos = ListBox::GetEntryPos(rEntry.aName); - RemoveEntry(nPos); -} - -/*-------------------------------------------------------------------- - Beschreibung: Listen loeschen und Anzeige loeschen - --------------------------------------------------------------------*/ - -void SvxListBox::Clear() -{ - ListBox::Clear(); - aEntryLst.DeleteAndDestroy(0, aEntryLst.Count()); - aDelEntryLst.DeleteAndDestroy(0, aDelEntryLst.Count()); -} - -/*-------------------------------------------------------------------- - Beschreibung: Position by Name - --------------------------------------------------------------------*/ - -USHORT SvxListBox::GetEntryPos(const SvxBoxEntry& rEntry) const -{ - return ListBox::GetEntryPos(rEntry.aName); -} - -/*-------------------------------------------------------------------- - Beschreibung: Rund um die Entries - --------------------------------------------------------------------*/ - -const SvxBoxEntry& SvxListBox::GetSvxBoxEntry(USHORT nPos) const -{ - if(nPos < aEntryLst.Count()) - return *aEntryLst[nPos]; - else - return aDefault; -} - -/*-------------------------------------------------------------------- - Beschreibung: aktullen Eintrag zurueckgeben - --------------------------------------------------------------------*/ - -const SvxBoxEntry& SvxListBox::GetSelectSvxBoxEntry(USHORT nSelId) const -{ - String aName(ListBox::GetSelectEntry(nSelId)); - - if(aName.Len() > 0) - { - for (USHORT i=0; i < aEntryLst.Count(); i++) - { - if(aEntryLst[i]->aName == aName ) - return *aEntryLst[i]; - } - } - return aDefault; -} - -/*-------------------------------------------------------------------- - Beschreibung: modifizierte Eintraege - --------------------------------------------------------------------*/ - -USHORT SvxListBox::GetModifiedCount() const -{ - USHORT nMod = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) - { if(aEntryLst[i]->bModified) - nMod++; - } - return nMod; -} - -/*-------------------------------------------------------------------- - Beschreibung: Modifizierte Eintraege behandeln - --------------------------------------------------------------------*/ - -void SvxListBox::ModifyEntry(USHORT nPos, const String& rName) -{ - if(nPos >= aEntryLst.Count()) - return; - - SvxBoxEntry* pEntry = aEntryLst[nPos]; - aEntryLst.Remove(nPos, 1); - aEntryLst[nPos]->aName = rName; - aEntryLst[nPos]->bModified = TRUE; - ListBox::RemoveEntry(nPos); - - InsertSorted(pEntry); -} - -/*-------------------------------------------------------------------- - Beschreibung: alle modifizierten Eintraege bahandeln - --------------------------------------------------------------------*/ - -const SvxBoxEntry& SvxListBox::GetModifiedEntry(USHORT nPos) const -{ - USHORT nSize = aEntryLst.Count(); - USHORT nMod = 0; - for(USHORT i=0; i < nSize; ++i) - { if(aEntryLst[i]->bModified) - { if(nMod == nPos) - return *aEntryLst[i]; - nMod++; - } - } - return aDefault; -} - -/*-------------------------------------------------------------------- - Beschreibung: geloeschte Eintraege - --------------------------------------------------------------------*/ - -USHORT SvxListBox::GetRemovedCount() const -{ - return aDelEntryLst.Count(); -} - - -const SvxBoxEntry& SvxListBox::GetRemovedEntry(USHORT nPos) const -{ - if(nPos < aDelEntryLst.Count()) - return *aDelEntryLst[nPos]; - - return aDefault; -} - -/*-------------------------------------------------------------------- - Beschreibung: Neue Entries begutachten - --------------------------------------------------------------------*/ - -USHORT SvxListBox::GetNewCount() const -{ - USHORT nNew = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) - { if(aEntryLst[i]->bNew) - nNew++; - } - return nNew; -} - -/*-------------------------------------------------------------------- - Beschreibung: Alle neuen Eintraege ueberpruefen - --------------------------------------------------------------------*/ - -const SvxBoxEntry& SvxListBox::GetNewEntry(USHORT nPos) const -{ - USHORT nSize = aEntryLst.Count(); - USHORT nNew = 0; - for(USHORT i=0; i < nSize; ++i) - { if(aEntryLst[i]->bNew) - { if(nNew == nPos) - return *aEntryLst[i]; - nNew++; - } - } - return aDefault; -} - -/*-------------------------------------------------------------------- - Beschreibung: Sortiert einfuegen - --------------------------------------------------------------------*/ - -void SvxListBox::InsertSorted(SvxBoxEntry* pEntry) -{ - ListBox::InsertEntry(pEntry->aName); - USHORT nPos = ListBox::GetEntryPos(pEntry->aName); - aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos); -} - -/*-------------------------------------------------------------------- - Beschreibung: ComboBoxen mit Verwaltungseinheit - --------------------------------------------------------------------*/ - -SvxComboBox::SvxComboBox(Window* pParent, WinBits nBits, USHORT nStyleBits) : - ComboBox(pParent, nBits), - nStyle(nStyleBits) -{ - InitComboBox(); -} - - -SvxComboBox::SvxComboBox(Window* pParent, const ResId& rId, USHORT nStyleBits ): - ComboBox(pParent, rId), - nStyle(nStyleBits) -{ - InitComboBox(); -} - -/*-------------------------------------------------------------------- - Beschreibung: Basisklasse Dtor - --------------------------------------------------------------------*/ - -__EXPORT SvxComboBox::~SvxComboBox() -{ - aEntryLst.DeleteAndDestroy(0, aEntryLst.Count()); - aDelEntryLst.DeleteAndDestroy(0, aDelEntryLst.Count()); -} - -/*-------------------------------------------------------------------- - Beschreibung: Evtl. Liste aus der Ressource beachten - --------------------------------------------------------------------*/ - -void SvxComboBox::InitComboBox() -{ - // Verwaltung fuer die Stringlist aus der Resource aufbauen - USHORT nSize = GetEntryCount(); - for(USHORT i=0; i < nSize; ++i) - { const SvxBoxEntry* pTmp = new SvxBoxEntry(ComboBox::GetEntry(i), i); - const SvxBoxEntry* &rpTmp = pTmp; - aEntryLst.Insert(rpTmp, aEntryLst.Count()); - } -} - -/*-------------------------------------------------------------------- - Beschreibung: neue Eintraege verwalten - --------------------------------------------------------------------*/ - -void SvxComboBox::InsertNewEntry(const SvxBoxEntry& rEntry) -{ - SvxBoxEntry* pNew = new SvxBoxEntry(rEntry); - pNew->bNew = TRUE; - InsertSorted(pNew); -} - -/*-------------------------------------------------------------------- - Beschreibung: Eintrag in die ComboBox aufnehmen - --------------------------------------------------------------------*/ - -void SvxComboBox::InsertEntry(const SvxBoxEntry& rEntry) -{ - InsertSorted(new SvxBoxEntry(rEntry)); -} - -/*-------------------------------------------------------------------- - Beschreibung: Eintrag aus der Liste loeschen - --------------------------------------------------------------------*/ - -void SvxComboBox::RemoveEntry(USHORT nPos) -{ - if(nPos >= aEntryLst.Count()) - return; - - // Altes Element austragen - SvxBoxEntry* pEntry = aEntryLst[nPos]; - aEntryLst.Remove(nPos, 1); - ComboBox::RemoveEntry(nPos); - - // keine neuen Eintraege in die Liste mit aufnehmen - if(pEntry->bNew) - return; - - // in DeleteListe eintragen - aDelEntryLst.C40_INSERT(SvxBoxEntry, pEntry, aDelEntryLst.Count()); -} - -/*-------------------------------------------------------------------- - Beschreibung: Eintrag ueber konkretes Obkjekt loeschen - --------------------------------------------------------------------*/ - -void SvxComboBox::RemoveEntry(const SvxBoxEntry& rEntry) -{ - USHORT nPos = ComboBox::GetEntryPos(rEntry.aName); - RemoveEntry(nPos); -} - -/*-------------------------------------------------------------------- - Beschreibung: Listen loeschen und Anzeige loeschen - --------------------------------------------------------------------*/ - -void SvxComboBox::Clear() -{ - ComboBox::Clear(); - aEntryLst.DeleteAndDestroy(0, aEntryLst.Count()); - aDelEntryLst.DeleteAndDestroy(0, aDelEntryLst.Count()); -} - - -/*-------------------------------------------------------------------- - Beschreibung: Position by Name - --------------------------------------------------------------------*/ - -USHORT SvxComboBox::GetEntryPos(const SvxBoxEntry& rEntry) const -{ - return ComboBox::GetEntryPos(rEntry.aName); -} - -/*-------------------------------------------------------------------- - Beschreibung: Rund um die Entries - --------------------------------------------------------------------*/ - -const SvxBoxEntry& SvxComboBox::GetEntry(USHORT nPos) const -{ - if(nPos < aEntryLst.Count()) - return *aEntryLst[nPos]; - else - return aDefault; -} - -/*-------------------------------------------------------------------- - Beschreibung: modifizierte Eintraege - --------------------------------------------------------------------*/ - -USHORT SvxComboBox::GetModifiedCount() const -{ - USHORT nMod = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) - { if(aEntryLst[i]->bModified) - nMod++; - } - return nMod; -} - -/*-------------------------------------------------------------------- - Beschreibung: Modifizierte Eintraege behandeln - --------------------------------------------------------------------*/ - -void SvxComboBox::ModifyEntry(USHORT nPos, const String& rName) -{ - if(nPos >= aEntryLst.Count()) - return; - - SvxBoxEntry* pEntry = aEntryLst[nPos]; - aEntryLst.Remove(nPos, 1); - aEntryLst[nPos]->aName = rName; - aEntryLst[nPos]->bModified = TRUE; - ComboBox::RemoveEntry(nPos); - - InsertSorted(pEntry); -} - -/*-------------------------------------------------------------------- - Beschreibung: alle modifizierten Eintraege bahandeln - --------------------------------------------------------------------*/ - -const SvxBoxEntry& SvxComboBox::GetModifiedEntry(USHORT nPos) const -{ - USHORT nSize = aEntryLst.Count(); - USHORT nMod = 0; - for(USHORT i=0; i < nSize; ++i) - { if(aEntryLst[i]->bModified) - { if(nMod == nPos) - return *aEntryLst[i]; - nMod++; - } - } - return aDefault; -} - -/*-------------------------------------------------------------------- - Beschreibung: geloeschte Eintraege - --------------------------------------------------------------------*/ - -USHORT SvxComboBox::GetRemovedCount() const -{ - return aDelEntryLst.Count(); -} - - -const SvxBoxEntry& SvxComboBox::GetRemovedEntry(USHORT nPos) const -{ - if(nPos < aDelEntryLst.Count()) - return *aDelEntryLst[nPos]; - - return aDefault; -} - -/*-------------------------------------------------------------------- - Beschreibung: Neue Entries begutachten - --------------------------------------------------------------------*/ - -USHORT SvxComboBox::GetNewCount() const -{ - USHORT nNew = 0; - USHORT nSize = aEntryLst.Count(); - for(USHORT i=0; i < nSize; ++i) - { if(aEntryLst[i]->bNew) - nNew++; - } - return nNew; -} - -/*-------------------------------------------------------------------- - Beschreibung: Alle neuen Eintraege ueberpruefen - --------------------------------------------------------------------*/ - -const SvxBoxEntry& SvxComboBox::GetNewEntry(USHORT nPos) const -{ - USHORT nSize = aEntryLst.Count(); - USHORT nNew = 0; - for(USHORT i=0; i < nSize; ++i) - { if(aEntryLst[i]->bNew) - { if(nNew == nPos) - return *aEntryLst[i]; - nNew++; - } - } - return aDefault; -} - -/*-------------------------------------------------------------------- - Beschreibung: Sortiert einfuegen - --------------------------------------------------------------------*/ - -void SvxComboBox::InsertSorted(SvxBoxEntry* pEntry) -{ - ComboBox::InsertEntry(pEntry->aName); - USHORT nPos = ComboBox::GetEntryPos(pEntry->aName); - aEntryLst.C40_INSERT(SvxBoxEntry, pEntry, nPos); -} - - -/*-------------------------------------------------------------------- - Beschreibung: Je nach Option bestimmte Zeichen ausblenden - --------------------------------------------------------------------*/ - -void __EXPORT SvxComboBox::KeyInput( const KeyEvent& rKEvt ) -{ - sal_Unicode cChar = rKEvt.GetCharCode(); - - if(nStyle & SVX_CBS_FILENAME) - { -#if defined UNX - if( cChar == sal_Unicode( '/' ) || cChar == sal_Unicode( ' ' ) ) - return; -#else - if( cChar == sal_Unicode( ':' ) || cChar == sal_Unicode( '\\' ) || - cChar == sal_Unicode( '.' ) || cChar == sal_Unicode( ' ' ) ) - return; -#endif - } - ComboBox::KeyInput(rKEvt); -} - -/*-------------------------------------------------------------------- - Beschreibung: Text nach Option konvertieren - --------------------------------------------------------------------*/ - -String SvxComboBox::GetText() const -{ - String aTxt(ComboBox::GetText()); - CharClass aCharClass( Application::GetSettings().GetLocale() ); - - if(nStyle & SVX_CBS_LOWER) - return aCharClass.lower(aTxt); - - if(nStyle & SVX_CBS_UPPER) - return aCharClass.upper(aTxt); - - return aTxt; -} - - diff --git a/svx/source/dialog/svxdlg.cxx b/svx/source/dialog/svxdlg.cxx index 7be500b0a3c7..4ee81686e9c0 100644 --- a/svx/source/dialog/svxdlg.cxx +++ b/svx/source/dialog/svxdlg.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: svxdlg.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -35,7 +32,7 @@ SvxAbstractDialogFactory* SvxAbstractDialogFactory::Create() { - return (SvxAbstractDialogFactory*) VclAbstractDialogFactory::Create(); + return dynamic_cast< SvxAbstractDialogFactory* >( VclAbstractDialogFactory::Create() ); } SvxAbstractDialogFactory::~SvxAbstractDialogFactory() diff --git a/svx/source/dialog/svxgrahicitem.cxx b/svx/source/dialog/svxgrahicitem.cxx index 46bce25249f2..07daea2064ab 100644 --- a/svx/source/dialog/svxgrahicitem.cxx +++ b/svx/source/dialog/svxgrahicitem.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: svxgrahicitem.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index a07cf1f254d2..00c1edaa7f04 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: svxruler.cxx,v $ - * $Revision: 1.39.76.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -52,9 +49,9 @@ #include <svx/ruler.hxx> #include "rlrcitem.hxx" #include "rulritem.hxx" -#include <svx/tstpitem.hxx> -#include <svx/lrspitem.hxx> -#include "protitem.hxx" +#include <editeng/tstpitem.hxx> +#include <editeng/lrspitem.hxx> +#include "editeng/protitem.hxx" #ifndef _APP_HXX #include <vcl/svapp.hxx> #endif diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index 79035bc4b8cb..f79e009bb332 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: swframeexample.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/swframeposstrings.cxx b/svx/source/dialog/swframeposstrings.cxx index a24d3a025d92..7faa97230c92 100644 --- a/svx/source/dialog/swframeposstrings.cxx +++ b/svx/source/dialog/swframeposstrings.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: swframeposstrings.cxx,v $ - * $Revision: 1.8 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/swframeposstrings.src b/svx/source/dialog/swframeposstrings.src index 1dd2eae6cfc3..3c9788fa8c9e 100644 --- a/svx/source/dialog/swframeposstrings.src +++ b/svx/source/dialog/swframeposstrings.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: swframeposstrings.src,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/thesdlg.cxx b/svx/source/dialog/thesdlg.cxx deleted file mode 100755 index c99dfc506195..000000000000 --- a/svx/source/dialog/thesdlg.cxx +++ /dev/null @@ -1,804 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: thesdlg.cxx,v $ - * $Revision: 1.21 $ - * - * 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_svx.hxx" - -#include <svx/thesdlg.hxx> -#include <svx/dialmgr.hxx> -#include <svx/dialogs.hrc> -#include <svx/langbox.hxx> -#include <svx/checklbx.hxx> -#include <dlgutil.hxx> -#include <svxerr.hxx> -#include <unolingu.hxx> -#include "thesdlg_impl.hxx" -#include "thesdlg.hrc" - -#include <com/sun/star/linguistic2/XThesaurus.hpp> -#include <com/sun/star/linguistic2/XMeaning.hpp> -#include <com/sun/star/linguistic2/XLinguServiceManager.hpp> - -#include <tools/shl.hxx> -#include <svl/lngmisc.hxx> -#include <svtools/svlbitm.hxx> -#include <svtools/svtreebx.hxx> -#include <svtools/langtab.hxx> -#include <unotools/lingucfg.hxx> -#include <i18npool/mslangid.hxx> -#include <comphelper/processfactory.hxx> -#include <osl/file.hxx> - - -#include <stack> -#include <algorithm> - -using namespace ::com::sun::star; -using ::rtl::OUString; - - -#define A2S(x) String::CreateFromAscii( x ) - - - -// GetReplaceEditString ------------------------------- - -static void GetReplaceEditString( String &rText ) -{ - // The strings returned by the thesaurus saometimes have some - // explanation text put in between '(' and ')' or a trailing '*'. - // These parts should not be put in the ReplaceEdit Text that may get - // inserted into the document. Thus we strip them from the text. - - xub_StrLen nPos = rText.Search( sal_Unicode('(') ); - while (STRING_NOTFOUND != nPos) - { - xub_StrLen nEnd = rText.Search( sal_Unicode(')'), nPos ); - if (STRING_NOTFOUND != nEnd) - rText.Erase( nPos, nEnd-nPos+1 ); - else - break; - nPos = rText.Search( sal_Unicode('(') ); - } - - nPos = rText.Search( sal_Unicode('*') ); - if (STRING_NOTFOUND != nPos) - rText.Erase( nPos ); - - // remove any possible remaining ' ' that may confuse the thesaurus - // when it gets called with the text - rText.EraseLeadingAndTrailingChars( sal_Unicode(' ') ); -} - -// class LookUpComboBox_Impl -------------------------------------------------- - -LookUpComboBox_Impl::LookUpComboBox_Impl( - Window *pParent, const ResId &rResId, SvxThesaurusDialog_Impl &rImpl ) : - ComboBox (pParent, rResId), - m_rDialogImpl( rImpl ) -{ - m_aModifyTimer.SetTimeoutHdl( LINK( this, LookUpComboBox_Impl, ModifyTimer_Hdl ) ); - m_aModifyTimer.SetTimeout( 500 ); - - EnableAutocomplete( FALSE ); -} - - -LookUpComboBox_Impl::~LookUpComboBox_Impl() -{ -} - - -void LookUpComboBox_Impl::Modify() -{ - m_aModifyTimer.Start(); -} - - -IMPL_LINK( LookUpComboBox_Impl, ModifyTimer_Hdl, Timer *, EMPTYARG /*pTimer*/ ) -{ - m_rDialogImpl.LookUp( GetText() ); - m_aModifyTimer.Stop(); - return 0; -} - - -// class ReplaceEdit_Impl -------------------------------------------------- - -ReplaceEdit_Impl::ReplaceEdit_Impl( - Window *pParent, const ResId &rResId ) : - Edit (pParent, rResId) -{ -} - - -ReplaceEdit_Impl::~ReplaceEdit_Impl() -{ -} - - -void ReplaceEdit_Impl::Modify() -{ - if (m_pBtn) - m_pBtn->Enable( GetText().Len() > 0 ); -} - -void ReplaceEdit_Impl::SetText( const XubString& rStr ) -{ - Edit::SetText( rStr ); - Modify(); -} - - -void ReplaceEdit_Impl::SetText( const XubString& rStr, const Selection& rNewSelection ) -{ - Edit::SetText( rStr, rNewSelection ); - Modify(); -} - - -// class ThesaurusAlternativesCtrl_Impl ---------------------------------- - -void AlternativesString_Impl::Paint( - const Point& rPos, - SvLBox& rDev, USHORT, - SvLBoxEntry* pEntry ) -{ - AlternativesUserData_Impl* pData = (AlternativesUserData_Impl*)pEntry->GetUserData(); - Point aPos( rPos ); - Font aOldFont( rDev.GetFont()); - if (pData && pData->IsHeader()) - { - Font aFont( aOldFont ); - aFont.SetWeight( WEIGHT_BOLD ); - rDev.SetFont( aFont ); - aPos.X() = 0; - } - else - aPos.X() += 5; - rDev.DrawText( aPos, GetText() ); - rDev.SetFont( aOldFont ); -} - - -ThesaurusAlternativesCtrl_Impl::ThesaurusAlternativesCtrl_Impl( - Window* pParent, - SvxThesaurusDialog_Impl &rImpl ) : - SvxCheckListBox( pParent, SVX_RES( CT_THES_ALTERNATIVES ) ), - m_rDialogImpl( rImpl ) -{ - SetWindowBits( WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE ); - SetHighlightRange(); -} - - -ThesaurusAlternativesCtrl_Impl::~ThesaurusAlternativesCtrl_Impl() -{ - ClearUserData(); -} - - -void ThesaurusAlternativesCtrl_Impl::ClearUserData() -{ - for (USHORT i = 0; i < GetEntryCount(); ++i) - delete (AlternativesUserData_Impl*)GetEntry(i)->GetUserData(); -} - - -SvLBoxEntry * ThesaurusAlternativesCtrl_Impl::AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader ) -{ - SvLBoxEntry* pEntry = new SvLBoxEntry; - String aText; - if (bIsHeader && nVal >= 0) - { - aText = String::CreateFromInt32( nVal ); - aText += A2S( ". " ); - } - pEntry->AddItem( new SvLBoxString( pEntry, 0, String() ) ); // add empty column - aText += rText; - pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, Image(), Image(), 0 ) ); // otherwise crash - pEntry->AddItem( new AlternativesString_Impl( pEntry, 0, aText ) ); - - AlternativesUserData_Impl* pUserData = new AlternativesUserData_Impl( rText, bIsHeader ); - pEntry->SetUserData( pUserData ); - GetModel()->Insert( pEntry ); - - if (bIsHeader) - GetViewDataEntry( pEntry )->SetSelectable( false ); - - return pEntry; -} - - -void ThesaurusAlternativesCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) -{ - const KeyCode& rKey = rKEvt.GetKeyCode(); - - if (rKey.GetCode() == KEY_RETURN || rKey.GetCode() == KEY_ESCAPE) - GetParent()->KeyInput( rKEvt ); // parent will close dialog... - else if (rKey.GetCode() == KEY_SPACE) - m_rDialogImpl.AlternativesDoubleClickHdl_Impl( this ); // look up current selected entry - else if (GetEntryCount()) - SvxCheckListBox::KeyInput( rKEvt ); -} - - -void ThesaurusAlternativesCtrl_Impl::Paint( const Rectangle& rRect ) -{ - if (!m_rDialogImpl.m_bWordFound) - { -/* Push( PUSH_FONT ); - - Font aFont( GetFont() ); - aFont.SetHeight( 2 * aFont.GetHeight() ); - SetFont( aFont ); -*/ - Size aTextSize( GetTextWidth( m_rDialogImpl.aErrStr ), GetTextHeight() ); - aTextSize = LogicToPixel( aTextSize ); - Point aPos; - aPos.X() += GetSizePixel().Width() / 2 - aTextSize.Width() / 2; - aPos.Y() += GetSizePixel().Height() / 2 /*- aTextSize.Height() / 2*/; - aPos = PixelToLogic( aPos ); - DrawText( aPos, m_rDialogImpl.aErrStr ); - -// Pop(); - } - else - SvxCheckListBox::Paint( rRect ); -} - - -// struct SvxThesaurusDialog_Impl ---------------------------------------- - -SvxThesaurusDialog_Impl::SvxThesaurusDialog_Impl( Window* pParent ) : - m_pParent ( pParent ), - aVendorImageFI ( pParent , SVX_RES( IMG_VENDOR ) ), - aLeftBtn ( pParent, SVX_RES( BTN_LEFT ) ), - aWordText ( pParent, SVX_RES( FT_WORD ) ), - aWordCB ( pParent, SVX_RES( CB_WORD ), *this ), - m_aAlternativesText ( pParent, SVX_RES( FT_THES_ALTERNATIVES ) ), - m_pAlternativesCT ( new ThesaurusAlternativesCtrl_Impl( pParent, *this ) ), - aReplaceText ( pParent, SVX_RES( FT_REPL ) ), - aReplaceEdit ( pParent, SVX_RES( ED_REPL ) ), - aFL ( pParent, SVX_RES( FL_VAR ) ), - aHelpBtn ( pParent, SVX_RES( BTN_THES_HELP ) ), - aLangMBtn ( pParent, SVX_RES( MB_LANGUAGE ) ), - aReplaceBtn ( pParent, SVX_RES( BTN_THES_OK ) ), - aCancelBtn ( pParent, SVX_RES( BTN_THES_CANCEL ) ), - aErrStr ( SVX_RES( STR_ERR_TEXTNOTFOUND ) ), - aVendorDefaultImage ( SVX_RES( IMG_DEFAULT_VENDOR ) ), - aVendorDefaultImageHC ( SVX_RES( IMG_DEFAULT_VENDOR_HC ) ), - xThesaurus ( NULL ), - aLookUpText (), - nLookUpLanguage ( LANGUAGE_NONE ), - m_bWordFound( false ), - pErrContext ( NULL ) -{ - // note: FreeResource must only be called in the c-tor of SvxThesaurusDialog - - aReplaceEdit.SetButton( &aReplaceBtn ); - - aLeftBtn.SetClickHdl( LINK( this, SvxThesaurusDialog_Impl, LeftBtnHdl_Impl ) ); - aWordCB.SetSelectHdl( LINK( this, SvxThesaurusDialog_Impl, WordSelectHdl_Impl ) ); - aLangMBtn.SetSelectHdl( LINK( this, SvxThesaurusDialog_Impl, LanguageHdl_Impl ) ); - m_pAlternativesCT->SetSelectHdl( LINK( this, SvxThesaurusDialog_Impl, AlternativesSelectHdl_Impl )); - m_pAlternativesCT->SetDoubleClickHdl( LINK( this, SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl )); - - Application::PostUserEvent( STATIC_LINK( this, SvxThesaurusDialog_Impl, VendorImageInitHdl ) ); -} - - -SvxThesaurusDialog_Impl::~SvxThesaurusDialog_Impl() -{ - delete aLangMBtn.GetPopupMenu(); - delete pErrContext; -} - - -uno::Sequence< uno::Reference< linguistic2::XMeaning > > SAL_CALL SvxThesaurusDialog_Impl::queryMeanings_Impl( - OUString& rTerm, - const lang::Locale& rLocale, - const beans::PropertyValues& rProperties ) - throw(lang::IllegalArgumentException, uno::RuntimeException) -{ - uno::Sequence< uno::Reference< linguistic2::XMeaning > > aMeanings( - xThesaurus->queryMeanings( rTerm, rLocale, rProperties ) ); - - // text with '.' at the end? - if (0 == aMeanings.getLength() && rTerm.getLength() && - rTerm.getStr()[ rTerm.getLength() - 1 ] == '.') - { - // try again without trailing '.' chars. It may be a word at the - // end of a sentence and not an abbreviation... - String aTxt( rTerm ); - aTxt.EraseTrailingChars( '.' ); - aMeanings = xThesaurus->queryMeanings( aTxt, rLocale, rProperties ); - if (aMeanings.getLength()) - { - rTerm = aTxt; - } - } - - return aMeanings; -} - - -bool SvxThesaurusDialog_Impl::UpdateAlternativesBox_Impl() -{ - lang::Locale aLocale( SvxCreateLocale( nLookUpLanguage ) ); - uno::Sequence< uno::Reference< linguistic2::XMeaning > > aMeanings = queryMeanings_Impl( - aLookUpText, aLocale, uno::Sequence< beans::PropertyValue >() ); - const sal_Int32 nMeanings = aMeanings.getLength(); - const uno::Reference< linguistic2::XMeaning > *pMeanings = aMeanings.getConstArray(); - - m_pAlternativesCT->SetUpdateMode( FALSE ); - - // clear old user data of control before creating new ones via AddEntry below - m_pAlternativesCT->ClearUserData(); - - m_pAlternativesCT->Clear(); - for (sal_Int32 i = 0; i < nMeanings; ++i) - { - OUString rMeaningTxt = pMeanings[i]->getMeaning(); - uno::Sequence< OUString > aSynonyms( pMeanings[i]->querySynonyms() ); - const sal_Int32 nSynonyms = aSynonyms.getLength(); - const OUString *pSynonyms = aSynonyms.getConstArray(); - DBG_ASSERT( rMeaningTxt.getLength() > 0, "meaning with empty text" ); - DBG_ASSERT( nSynonyms > 0, "meaning without synonym" ); - - m_pAlternativesCT->AddEntry( i + 1, rMeaningTxt, true ); - for (sal_Int32 k = 0; k < nSynonyms; ++k) - m_pAlternativesCT->AddEntry( -1, pSynonyms[k], false ); - } - - m_pAlternativesCT->SetUpdateMode( TRUE ); - - return nMeanings > 0; -} - - -void SvxThesaurusDialog_Impl::SetWindowTitle( LanguageType nLanguage ) -{ - // Sprache anpassen - String aStr( m_pParent->GetText() ); - aStr.Erase( aStr.Search( sal_Unicode( '(' ) ) - 1 ); - aStr.Append( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( " (" ) ) ); - aStr += GetLanguageString( (LanguageType) nLanguage ); - aStr.Append( sal_Unicode( ')' ) ); - m_pParent->SetText( aStr ); // set window title -} - - -void SvxThesaurusDialog_Impl::LookUp( const String &rText ) -{ - if (rText != aWordCB.GetText()) // avoid moving of the cursor if the text is the same - aWordCB.SetText( rText ); - LookUp_Impl(); -} - - -IMPL_LINK( SvxThesaurusDialog_Impl, LeftBtnHdl_Impl, Button *, pBtn ) -{ - if (pBtn && aLookUpHistory.size() >= 2) - { - aLookUpHistory.pop(); // remove current look up word from stack - aWordCB.SetText( aLookUpHistory.top() ); // retrieve previous look up word - aLookUpHistory.pop(); - LookUp_Impl(); - } - return 0; -} - - -IMPL_LINK( SvxThesaurusDialog_Impl, LanguageHdl_Impl, MenuButton *, pBtn ) -{ - PopupMenu *pMenu = aLangMBtn.GetPopupMenu(); - if (pMenu && pBtn) - { - USHORT nItem = pBtn->GetCurItemId(); - String aLangText( pMenu->GetItemText( nItem ) ); - LanguageType nLang = SvtLanguageTable().GetType( aLangText ); - DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); - if (xThesaurus->hasLocale( SvxCreateLocale( nLang ) )) - nLookUpLanguage = nLang; - SetWindowTitle( nLang ); - UpdateVendorImage(); - LookUp_Impl(); - } - return 0; -} - - -void SvxThesaurusDialog_Impl::LookUp_Impl() -{ - String aText( aWordCB.GetText() ); - - aLookUpText = OUString( aText ); - if (aLookUpText.getLength() > 0 && - (aLookUpHistory.size() == 0 || aLookUpText != aLookUpHistory.top())) - aLookUpHistory.push( aLookUpText ); - - m_bWordFound = UpdateAlternativesBox_Impl(); - m_pAlternativesCT->Enable( m_bWordFound ); - - if ( aWordCB.GetEntryPos( aText ) == LISTBOX_ENTRY_NOTFOUND ) - aWordCB.InsertEntry( aText ); - - aReplaceEdit.SetText( String() ); - aLeftBtn.Enable( aLookUpHistory.size() > 1 ); -} - - -IMPL_LINK( SvxThesaurusDialog_Impl, WordSelectHdl_Impl, ComboBox *, pBox ) -{ - if (pBox && !aWordCB.IsTravelSelect()) // act only upon return key and not when traveling with cursor keys - { - USHORT nPos = pBox->GetSelectEntryPos(); - String aStr( pBox->GetEntry( nPos ) ); - GetReplaceEditString( aStr ); - aWordCB.SetText( aStr ); - LookUp_Impl(); - } - - return 0; -} - - -IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesSelectHdl_Impl, SvxCheckListBox *, pBox ) -{ - SvLBoxEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL; - if (pEntry) - { - AlternativesUserData_Impl * pData = (AlternativesUserData_Impl *) pEntry->GetUserData(); - String aStr; - if (!pData->IsHeader()) - { - aStr = pData->GetText(); - GetReplaceEditString( aStr ); - } - aReplaceEdit.SetText( aStr ); - } - return 0; -} - - -IMPL_LINK( SvxThesaurusDialog_Impl, AlternativesDoubleClickHdl_Impl, SvxCheckListBox *, pBox ) -{ - SvLBoxEntry *pEntry = pBox ? pBox->GetCurEntry() : NULL; - if (pEntry) - { - AlternativesUserData_Impl * pData = (AlternativesUserData_Impl *) pEntry->GetUserData(); - String aStr; - if (!pData->IsHeader()) - { - aStr = pData->GetText(); - GetReplaceEditString( aStr ); - } - - aWordCB.SetText( aStr ); - if (aStr.Len() > 0) - LookUp_Impl(); - } - - //! workaround to set the selection since calling SelectEntryPos within - //! the double click handler does not work - Application::PostUserEvent( STATIC_LINK( this, SvxThesaurusDialog_Impl, SelectFirstHdl_Impl ), pBox ); - return 0; -} - - -IMPL_STATIC_LINK( SvxThesaurusDialog_Impl, SelectFirstHdl_Impl, SvxCheckListBox *, pBox ) -{ - (void) pThis; - if (pBox && pBox->GetEntryCount() > 0) - pBox->SelectEntryPos( 0 ); - return 0; -} - -//////////////////////////////////////////////////////////// - -//!! temporary implement locally: -//!! once MBAs latest CWS is integrated this functions are available in svtools -//!! under a slightly different name - -#include <svx/impgrf.hxx> -#include <sfx2/docfile.hxx> - -#define IMPGRF_INIKEY_ASLINK "ImportGraphicAsLink" -#define IMPGRF_INIKEY_PREVIEW "ImportGraphicPreview" -#define IMPGRF_CONFIGNAME String(DEFINE_CONST_UNICODE("ImportGraphicDialog")) - -GraphicFilter* lcl_GetGrfFilter() -{ - return GraphicFilter::GetGraphicFilter(); -} - -// ----------------------------------------------------------------------- - -int lcl_LoadGraphic( const String &rPath, const String &rFilterName, - Graphic& rGraphic, GraphicFilter* pFilter, - USHORT* pDeterminedFormat ) -{ - if ( !pFilter ) - pFilter = ::lcl_GetGrfFilter(); - - const USHORT nFilter = rFilterName.Len() && pFilter->GetImportFormatCount() - ? pFilter->GetImportFormatNumber( rFilterName ) - : GRFILTER_FORMAT_DONTKNOW; - - SfxMedium* pMed = 0; - - // dann teste mal auf File-Protokoll: - SvStream* pStream = NULL; - INetURLObject aURL( rPath ); - - if ( aURL.HasError() || INET_PROT_NOT_VALID == aURL.GetProtocol() ) - { - aURL.SetSmartProtocol( INET_PROT_FILE ); - aURL.SetSmartURL( rPath ); - } - else if ( INET_PROT_FILE != aURL.GetProtocol() ) - { - // z.Z. nur auf die aktuelle DocShell - pMed = new SfxMedium( rPath, STREAM_READ, TRUE ); - pMed->DownLoad(); - pStream = pMed->GetInStream(); - } - int nRes = GRFILTER_OK; - - if ( !pStream ) - nRes = pFilter->ImportGraphic( rGraphic, aURL, nFilter, pDeterminedFormat ); - else - nRes = pFilter->ImportGraphic( rGraphic, rPath, *pStream, - nFilter, pDeterminedFormat ); - if ( pMed ) - delete pMed; - return nRes; -} - -//////////////////////////////////////////////////////////// - -static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl ) -{ - Image aRes; - - OUString aTmp; - osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp ); - - Graphic aGraphic; - const String aFilterName( RTL_CONSTASCII_USTRINGPARAM( IMP_PNG ) ); - if( GRFILTER_OK == lcl_LoadGraphic( aTmp, aFilterName, aGraphic, NULL, NULL ) ) - { - aRes = Image( aGraphic.GetBitmapEx() ); - } - return aRes; -} - - -static String lcl_GetThesImplName( const lang::Locale &rLocale ) -{ - String aRes; - - uno::Reference< linguistic2::XLinguServiceManager > xLngMgr; - try - { - uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - xLngMgr = uno::Reference< linguistic2::XLinguServiceManager >( xMSF->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.linguistic2.LinguServiceManager" ))), uno::UNO_QUERY_THROW ); - - DBG_ASSERT( xLngMgr.is(), "LinguServiceManager missing" ); - if (xLngMgr.is()) - { - uno::Sequence< OUString > aServiceNames = xLngMgr->getConfiguredServices( - OUString::createFromAscii("com.sun.star.linguistic2.Thesaurus"), rLocale ); - // there should be at most one thesaurus configured for each language - DBG_ASSERT( aServiceNames.getLength() <= 1, "more than one thesaurus found. Should not be possible" ); - if (aServiceNames.getLength() == 1) - aRes = aServiceNames[0]; - } - } - catch (uno::Exception &e) - { - (void) e; - DBG_ASSERT( 0, "failed to get thesaurus" ); - } - - return aRes; -} - - -void SvxThesaurusDialog_Impl::UpdateVendorImage() -{ - m_pParent->SetUpdateMode( sal_False ); - - SvtLinguConfig aCfg; - if (aCfg.HasVendorImages( "ThesaurusDialogImage" )) - { - const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); - - Image aImage; - String sThesImplName( lcl_GetThesImplName( SvxCreateLocale( nLookUpLanguage ) ) ); - OUString aThesDialogImageUrl( aCfg.GetThesaurusDialogImage( sThesImplName, bHC ) ); - if (sThesImplName.Len() > 0 && aThesDialogImageUrl.getLength() > 0) - aImage = Image( lcl_GetImageFromPngUrl( aThesDialogImageUrl ) ); - else - aImage = bHC ? aVendorDefaultImageHC : aVendorDefaultImage; - aVendorImageFI.SetImage( aImage ); - } - - m_pParent->SetUpdateMode( sal_True ); -} - - -IMPL_STATIC_LINK( SvxThesaurusDialog_Impl, VendorImageInitHdl, SvxThesaurusDialog_Impl *, EMPTYARG ) -{ - pThis->m_pParent->SetUpdateMode( sal_False ); - - SvtLinguConfig aCfg; - if (aCfg.HasVendorImages( "ThesaurusDialogImage" )) - { - const bool bHC = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); - Image aImage( bHC ? pThis->aVendorDefaultImageHC : pThis->aVendorDefaultImage ); - pThis->aVendorImageFI.SetImage( aImage ); - pThis->aVendorImageFI.Show(); - - // move down visible controls according to the vendor images height - Size aVendorSize = pThis->aVendorImageFI.GetSizePixel(); - Size aImageSize = pThis->aVendorImageFI.GetImage().GetSizePixel(); - if (aImageSize.Height()) - { - aVendorSize.Height() = aImageSize.Height(); - if(aVendorSize.Width() < aImageSize.Width()) - aVendorSize.Width() = aImageSize.Width(); - pThis->aVendorImageFI.SetSizePixel( aVendorSize ); - } - const sal_Int32 nDiff = aVendorSize.Height(); - pThis->aVendorImageFI.SetSizePixel( aVendorSize ); - Control* aControls[] = { - &pThis->aLeftBtn, - &pThis->aWordText, - &pThis->aWordCB, - &pThis->m_aAlternativesText, - pThis->m_pAlternativesCT.get(), - &pThis->aReplaceText, - &pThis->aReplaceEdit, - &pThis->aFL, - &pThis->aHelpBtn, - &pThis->aLangMBtn, - &pThis->aReplaceBtn, - &pThis->aCancelBtn, - 0 - }; - sal_Int32 nControl = 0; - while (aControls[nControl]) - { - Point aPos = aControls[nControl]->GetPosPixel(); - aPos.Y() += nDiff; - aControls[nControl]->SetPosPixel(aPos); - ++nControl; - } - Size aDlgSize = pThis->m_pParent->GetSizePixel(); - aDlgSize.Height() += nDiff; - pThis->m_pParent->SetSizePixel( aDlgSize ); - pThis->m_pParent->Invalidate(); - } - - pThis->UpdateVendorImage(); - pThis->m_pParent->SetUpdateMode( sal_True ); - - return 0; -}; - - -// class SvxThesaurusDialog ---------------------------------------------- - -SvxThesaurusDialog::SvxThesaurusDialog( - Window* pParent, - uno::Reference< linguistic2::XThesaurus > xThes, - const String &rWord, - LanguageType nLanguage ) : - - SvxStandardDialog( pParent, SVX_RES( RID_SVXDLG_THESAURUS ) ) -{ - m_pImpl = boost::shared_ptr< SvxThesaurusDialog_Impl >(new SvxThesaurusDialog_Impl( this )); - - m_pImpl->xThesaurus = xThes; - m_pImpl->aLookUpText = OUString( rWord ); - m_pImpl->nLookUpLanguage = nLanguage; - if (rWord.Len() > 0) - m_pImpl->aLookUpHistory.push( rWord ); - m_pImpl->pErrContext = new SfxErrorContext( ERRCTX_SVX_LINGU_THESAURUS, String(), this, - RID_SVXERRCTX, &DIALOG_MGR() ); - - FreeResource(); - - OUString aTmp( rWord ); - linguistic::RemoveHyphens( aTmp ); - linguistic::ReplaceControlChars( aTmp ); - String aTmp2( aTmp ); - m_pImpl->aReplaceEdit.SetText( aTmp2 ); - m_pImpl->aWordCB.InsertEntry( aTmp2 ); - - m_pImpl->SetWindowTitle( nLanguage ); - - m_pImpl->LookUp( aTmp2 ); - m_pImpl->m_pAlternativesCT->GrabFocus(); - m_pImpl->aLeftBtn.Enable( sal_False ); - - // fill language menu button list - SvtLanguageTable aLangTab; - uno::Sequence< lang::Locale > aLocales; - if (m_pImpl->xThesaurus.is()) - aLocales = m_pImpl->xThesaurus->getLocales(); - const sal_Int32 nLocales = aLocales.getLength(); - const lang::Locale *pLocales = aLocales.getConstArray(); - delete m_pImpl->aLangMBtn.GetPopupMenu(); - PopupMenu* pMenu = new PopupMenu; - pMenu->SetMenuFlags( MENU_FLAG_NOAUTOMNEMONICS ); - std::vector< OUString > aLangVec; - for (sal_Int32 i = 0; i < nLocales; ++i ) - { - const LanguageType nLang = SvxLocaleToLanguage( pLocales[i] ); - DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); - aLangVec.push_back( aLangTab.GetString( nLang ) ); - } - std::sort( aLangVec.begin(), aLangVec.end() ); - for (size_t i = 0; i < aLangVec.size(); ++i) - pMenu->InsertItem( (USHORT)i+1, aLangVec[i] ); // menu items should be enumerated from 1 and not 0 - m_pImpl->aLangMBtn.SetPopupMenu( pMenu ); - - // disable controls if service is missing - if (!m_pImpl->xThesaurus.is()) - Enable( sal_False ); -} - - -SvxThesaurusDialog::~SvxThesaurusDialog() -{ -} - - -String SvxThesaurusDialog::GetWord() -{ - return m_pImpl->aReplaceEdit.GetText(); -} - - -sal_uInt16 SvxThesaurusDialog::GetLanguage() const -{ - return m_pImpl->nLookUpLanguage; -} - - -void SvxThesaurusDialog::Apply() -{ -} - diff --git a/svx/source/dialog/thesdlg.hrc b/svx/source/dialog/thesdlg.hrc deleted file mode 100755 index 18ceadad4831..000000000000 --- a/svx/source/dialog/thesdlg.hrc +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: thesdlg.hrc,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_THESDLG_HRC -#define _SVX_THESDLG_HRC - -// defines --------------------------------------------------------------- - -#define BTN_LEFT 9 -#define BTN_THES_OK 10 -#define BTN_THES_CANCEL 11 -#define MB_LANGUAGE 12 -#define BTN_THES_HELP 13 -#define FT_WORD 15 -#define CB_WORD 16 -#define FT_REPL 21 -#define ED_REPL 22 -#define FL_VAR 23 -#define FT_THES_ALTERNATIVES 24 -#define CT_THES_ALTERNATIVES 25 -#define IMG_VENDOR 26 -#define IMG_DEFAULT_VENDOR 27 -#define IMG_DEFAULT_VENDOR_HC 28 - -#define STR_ERR_TEXTNOTFOUND 101 - - -#endif - diff --git a/svx/source/dialog/thesdlg.src b/svx/source/dialog/thesdlg.src deleted file mode 100755 index 7cad0bc196de..000000000000 --- a/svx/source/dialog/thesdlg.src +++ /dev/null @@ -1,149 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: thesdlg.src,v $ - * $Revision: 1.23 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include <svx/svxids.hrc> -#include <svx/dialogs.hrc> -#include "thesdlg.hrc" -#include "helpid.hrc" - // pragma ---------------------------------------------------------------- - - // RID_SVXDLG_THES ------------------------------------------------------- -ModalDialog RID_SVXDLG_THESAURUS -{ - HelpId = SID_THESAURUS ; - OutputSize = TRUE ; - Size = MAP_APPFONT ( 235, 230 ) ; - Text [ en-US ] = "Thesaurus" ; - SvLook = TRUE ; - Moveable = TRUE ; - - FixedImage IMG_VENDOR - { - Pos = MAP_APPFONT ( 0, 0 ) ; - Size = MAP_APPFONT ( 235, 0 ) ; // correct size will be applied at runtime - Hide = TRUE; - }; - - ImageButton BTN_LEFT - { - Pos = MAP_APPFONT ( 5 , 15 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - TABSTOP = TRUE ; - SYMBOL = IMAGEBUTTON_ARROW_LEFT ; - }; - FixedText FT_WORD - { - Pos = MAP_APPFONT ( 24 , 5 ) ; - Size = MAP_APPFONT ( 143 , 8 ) ; - Text [ en-US ] = "Current ~word" ; - LEFT = TRUE ; - }; - ComboBox CB_WORD - { - DropDown = TRUE ; - Pos = MAP_APPFONT ( 24 , 16 ) ; - Size = MAP_APPFONT ( 141 , 60 ) ; // have drop down space for several lines - }; - MenuButton MB_LANGUAGE - { - Pos = MAP_APPFONT ( 170 , 16 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "~Language" ; - }; - - FixedText FT_THES_ALTERNATIVES - { - Pos = MAP_APPFONT ( 5 , 33 ) ; - Size = MAP_APPFONT ( 255 , 8 ) ; - Text [ en-US ] = "~Alternatives" ; - LEFT = TRUE ; - }; - Control CT_THES_ALTERNATIVES - { - HelpID = HID_CT_THES_ALTERNATIVES ; - Pos = MAP_APPFONT ( 5 , 45 ) ; - Size = MAP_APPFONT ( 225 , 121 ) ; - Border = TRUE; - TabStop = TRUE ; - }; - - FixedText FT_REPL - { - Pos = MAP_APPFONT ( 5 , 173 ) ; - Size = MAP_APPFONT ( 255 , 8 ) ; - Text [ en-US ] = "Replace ~with" ; - LEFT = TRUE ; - }; - Edit ED_REPL - { - BORDER = TRUE ; - Pos = MAP_APPFONT ( 5 , 184 ) ; - Size = MAP_APPFONT ( 225 , 12 ) ; - LEFT = TRUE ; - }; - FixedLine FL_VAR - { - Pos = MAP_APPFONT ( 0 , 200 ) ; - Size = MAP_APPFONT ( 235 , 8 ) ; - }; - - HelpButton BTN_THES_HELP - { - Pos = MAP_APPFONT ( 5 , 210 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - }; - OkButton BTN_THES_OK - { - Pos = MAP_APPFONT ( 105 , 210 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - Text [ en-US ] = "~Replace" ; - DefButton = TRUE ; - }; - CancelButton BTN_THES_CANCEL - { - Pos = MAP_APPFONT ( 170 , 210 ) ; - Size = MAP_APPFONT ( 60 , 14 ) ; - }; - - String STR_ERR_TEXTNOTFOUND - { - Text [ en-US ] = "No alternatives found." ; - }; - - Image IMG_DEFAULT_VENDOR - { - ImageBitmap = Bitmap { File = "vendor01.png"; }; - }; - Image IMG_DEFAULT_VENDOR_HC - { - ImageBitmap = Bitmap { File = "vendor01h.png"; }; - }; -}; - diff --git a/svx/source/dialog/thesdlg_impl.hxx b/svx/source/dialog/thesdlg_impl.hxx deleted file mode 100755 index 354bc95c09db..000000000000 --- a/svx/source/dialog/thesdlg_impl.hxx +++ /dev/null @@ -1,220 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: $ - * $Revision: $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVX_THESDLG_IMPL_HXX -#define _SVX_THESDLG_IMPL_HXX - -#include <svx/thesdlg.hxx> -#include <svx/checklbx.hxx> - -#include <vcl/button.hxx> -#include <vcl/combobox.hxx> -#include <vcl/edit.hxx> -#include <vcl/fixed.hxx> -#include <vcl/image.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/menubtn.hxx> -#include <vcl/msgbox.hxx> -#include <vcl/svapp.hxx> -#include <vcl/timer.hxx> -#include <vcl/wrkwin.hxx> - -#include <com/sun/star/linguistic2/XThesaurus.hpp> -#include <com/sun/star/linguistic2/XMeaning.hpp> - -#include <stack> -#include <algorithm> - -using namespace ::com::sun::star; -using ::rtl::OUString; - -// class LookUpComboBox_Impl -------------------------------------------------- - -class LookUpComboBox_Impl : public ComboBox -{ - Timer m_aModifyTimer; - Selection m_aSelection; - Button * m_pBtn; - SvxThesaurusDialog_Impl & m_rDialogImpl; - - // disable copy c-tor and assignment operator - LookUpComboBox_Impl( const LookUpComboBox_Impl & ); - LookUpComboBox_Impl & operator = ( const LookUpComboBox_Impl & ); - -public: - LookUpComboBox_Impl( Window *pParent, const ResId &rResId, SvxThesaurusDialog_Impl &rImpl ); - virtual ~LookUpComboBox_Impl(); - - DECL_LINK( ModifyTimer_Hdl, Timer * ); - - void SetButton( Button *pBtn ) { m_pBtn = pBtn; } - - // ComboBox - virtual void Modify(); -}; - -// class ReplaceEdit_Impl -------------------------------------------------- - -class ReplaceEdit_Impl : public Edit -{ - Button * m_pBtn; - - // disable copy c-tor and assignment operator - ReplaceEdit_Impl( const ReplaceEdit_Impl & ); - ReplaceEdit_Impl & operator = ( const ReplaceEdit_Impl & ); - -public: - ReplaceEdit_Impl( Window *pParent, const ResId &rResId ); - virtual ~ReplaceEdit_Impl(); - - void SetButton( Button *pBtn ) { m_pBtn = pBtn; } - - // Edit - virtual void Modify(); - virtual void SetText( const XubString& rStr ); - virtual void SetText( const XubString& rStr, const Selection& rNewSelection ); -}; - -// class ThesaurusAlternativesCtrl_Impl ---------------------------------- - -class AlternativesUserData_Impl -{ - String sText; - bool bHeader; - - // disable copy c-tor and assignment operator - AlternativesUserData_Impl( const AlternativesUserData_Impl & ); - AlternativesUserData_Impl & operator = ( const AlternativesUserData_Impl & ); - -public: - AlternativesUserData_Impl( const String &rText, bool bIsHeader ) : - sText(rText), - bHeader(bIsHeader) - { - } - - bool IsHeader() const { return bHeader; } - const String& GetText() const { return sText; } -}; - - -class AlternativesString_Impl : public SvLBoxString -{ -public: - - AlternativesString_Impl( SvLBoxEntry* pEntry, USHORT nFlags, const String& rStr ) - : SvLBoxString( pEntry, nFlags, rStr ) {} - - virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, SvLBoxEntry* pEntry); -}; - - -class ThesaurusAlternativesCtrl_Impl : - public SvxCheckListBox -{ - SvxThesaurusDialog_Impl & m_rDialogImpl; - - // disable copy c-tor and assignment operator - ThesaurusAlternativesCtrl_Impl( const ThesaurusAlternativesCtrl_Impl & ); - ThesaurusAlternativesCtrl_Impl & operator = ( const ThesaurusAlternativesCtrl_Impl & ); - -public: - ThesaurusAlternativesCtrl_Impl( Window* pParent, SvxThesaurusDialog_Impl &rImpl ); - virtual ~ThesaurusAlternativesCtrl_Impl(); - - - SvLBoxEntry * AddEntry( sal_Int32 nVal, const String &rText, bool bIsHeader ); - void ClearUserData(); - - virtual void KeyInput( const KeyEvent& rKEvt ); - virtual void Paint( const Rectangle& rRect ); -}; - - -// struct SvxThesaurusDialog_Impl ---------------------------------------- - -struct SvxThesaurusDialog_Impl -{ - Window * m_pParent; - - FixedImage aVendorImageFI; - ImageButton aLeftBtn; - FixedText aWordText; - LookUpComboBox_Impl aWordCB; - FixedText m_aAlternativesText; - boost::shared_ptr< ThesaurusAlternativesCtrl_Impl > m_pAlternativesCT; - FixedText aReplaceText; - ReplaceEdit_Impl aReplaceEdit; - FixedLine aFL; - HelpButton aHelpBtn; - MenuButton aLangMBtn; - OKButton aReplaceBtn; - CancelButton aCancelBtn; - - String aErrStr; - Image aVendorDefaultImage; - Image aVendorDefaultImageHC; - - uno::Reference< linguistic2::XThesaurus > xThesaurus; - OUString aLookUpText; - LanguageType nLookUpLanguage; - std::stack< OUString > aLookUpHistory; - bool m_bWordFound; - - SfxErrorContext* pErrContext; // error context while dfalog is opened - - - // Handler - DECL_LINK( LeftBtnHdl_Impl, Button * ); - DECL_LINK( LanguageHdl_Impl, MenuButton * ); - DECL_LINK( LookUpHdl_Impl, Button * ); - DECL_LINK( WordSelectHdl_Impl, ComboBox * ); - DECL_LINK( AlternativesSelectHdl_Impl, SvxCheckListBox * ); - DECL_LINK( AlternativesDoubleClickHdl_Impl, SvxCheckListBox * ); - - DECL_STATIC_LINK( SvxThesaurusDialog_Impl, SelectFirstHdl_Impl, SvxCheckListBox * ); - DECL_STATIC_LINK( SvxThesaurusDialog_Impl, VendorImageInitHdl, SvxThesaurusDialog_Impl * ); - - - SvxThesaurusDialog_Impl( Window* pParent ); - ~SvxThesaurusDialog_Impl(); - - uno::Sequence< uno::Reference< linguistic2::XMeaning > > SAL_CALL - queryMeanings_Impl( ::rtl::OUString& rTerm, const lang::Locale& rLocale, const beans::PropertyValues& rProperties ) throw(lang::IllegalArgumentException, uno::RuntimeException); - - bool UpdateAlternativesBox_Impl(); - void UpdateVendorImage(); - void SetWindowTitle( LanguageType nLanguage ); - void LookUp( const String &rText ); - void LookUp_Impl(); -}; - -#endif - diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx index 0c96191c3db8..718989b84450 100644 --- a/svx/source/dialog/txencbox.cxx +++ b/svx/source/dialog/txencbox.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: txencbox.cxx,v $ - * $Revision: 1.13 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -178,36 +175,10 @@ void SvxTextEncodingBox::FillFromDbTextEncodingMap( //------------------------------------------------------------------------ -// static -rtl_TextEncoding SvxTextEncodingBox::GetBestMimeEncoding() -{ - const sal_Char* pCharSet = rtl_getBestMimeCharsetFromTextEncoding( - gsl_getSystemTextEncoding() ); - if ( !pCharSet ) - { - // If the system locale is unknown to us, e.g. LC_ALL=xx, match the UI - // language if possible. - ::com::sun::star::lang::Locale aLocale( - Application::GetSettings().GetUILocale() ); - rtl_Locale * pLocale = rtl_locale_register( aLocale.Language.getStr(), - aLocale.Country.getStr(), aLocale.Variant.getStr() ); - rtl_TextEncoding nEnc = osl_getTextEncodingFromLocale( pLocale ); - pCharSet = rtl_getBestMimeCharsetFromTextEncoding( nEnc ); - } - rtl_TextEncoding nRet; - if ( pCharSet ) - nRet = rtl_getTextEncodingFromMimeCharset( pCharSet ); - else - nRet = RTL_TEXTENCODING_UTF8; - return nRet; -} - -//------------------------------------------------------------------------ - void SvxTextEncodingBox::FillWithMimeAndSelectBest() { FillFromTextEncodingTable( sal_False, 0xffffffff, RTL_TEXTENCODING_INFO_MIME ); - rtl_TextEncoding nEnc = GetBestMimeEncoding(); + rtl_TextEncoding nEnc = SvtSysLocale::GetBestMimeEncoding(); SelectTextEncoding( nEnc ); } diff --git a/svx/source/dialog/txenctab.cxx b/svx/source/dialog/txenctab.cxx index 44444832019a..3fc82705141c 100644 --- a/svx/source/dialog/txenctab.cxx +++ b/svx/source/dialog/txenctab.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: txenctab.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/txenctab.src b/svx/source/dialog/txenctab.src index 7126c6f5a3f0..b90b5fb9a94c 100644 --- a/svx/source/dialog/txenctab.src +++ b/svx/source/dialog/txenctab.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: txenctab.src,v $ - * $Revision: 1.49 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/ucsubset.src b/svx/source/dialog/ucsubset.src index fb8419606cb9..2a47777469ea 100755 --- a/svx/source/dialog/ucsubset.src +++ b/svx/source/dialog/ucsubset.src @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: charmap.src,v $ - * $Revision: 1.57 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svx/source/dialog/wrapfield.cxx b/svx/source/dialog/wrapfield.cxx index d2ce222c54f6..8c6da9f1ff81 100644 --- a/svx/source/dialog/wrapfield.cxx +++ b/svx/source/dialog/wrapfield.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: wrapfield.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify |