diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-03-11 11:26:05 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-03-11 11:26:05 +0100 |
commit | db5a0cd99b1ebc5679445238a891fda7c5abfb5e (patch) | |
tree | 039fd11869b2c068694f91f33654ce0abb133c25 /svtools/source/misc | |
parent | 4107ff94b0446bca97e03dfbcc4db3654b9b9118 (diff) | |
parent | f696d8ce6bbcc8cded7b075049a8c163c20c3782 (diff) |
autorecovery: merged changes from m74. Still need to find out how to re-do two patches (to module_hidden_ooo.scp and file_ooo.scp in scp2/source/ooo) which do not apply anymore.
Diffstat (limited to 'svtools/source/misc')
30 files changed, 799 insertions, 117 deletions
diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 16bc8339a0d9..6458e359a49c 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.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: acceleratorexecute.cxx,v $ - * $Revision: 1.14.90.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svtools/source/misc/chartprettypainter.cxx b/svtools/source/misc/chartprettypainter.cxx index 7e9a16879789..bc2d02384816 100644 --- a/svtools/source/misc/chartprettypainter.cxx +++ b/svtools/source/misc/chartprettypainter.cxx @@ -2,14 +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: chartprettypainter.cxx,v $ - * - * $Revision: 1.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svtools/source/misc/cliplistener.cxx b/svtools/source/misc/cliplistener.cxx index c8c6428233e8..8fb61a5a1cb9 100644 --- a/svtools/source/misc/cliplistener.cxx +++ b/svtools/source/misc/cliplistener.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: cliplistener.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/svtools/source/misc/dialogclosedlistener.cxx b/svtools/source/misc/dialogclosedlistener.cxx index 582d2bbf4879..a08c8a3b6dd5 100644 --- a/svtools/source/misc/dialogclosedlistener.cxx +++ b/svtools/source/misc/dialogclosedlistener.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: dialogclosedlistener.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/svtools/source/misc/dialogcontrolling.cxx b/svtools/source/misc/dialogcontrolling.cxx index d461e5898227..7565dad731f7 100644 --- a/svtools/source/misc/dialogcontrolling.cxx +++ b/svtools/source/misc/dialogcontrolling.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: dialogcontrolling.cxx,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/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index 3a31c1b812a6..cf476098056b 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.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: ehdl.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/svtools/source/misc/ehdl.src b/svtools/source/misc/ehdl.src index 5267d13765c3..55ab99b93bdf 100644 --- a/svtools/source/misc/ehdl.src +++ b/svtools/source/misc/ehdl.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: ehdl.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/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 3554f6955171..f606e1e2e4b1 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -2,12 +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: embedhlp.cxx,v $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx index d667580b41fb..cbf87f40b7fc 100644 --- a/svtools/source/misc/embedtransfer.cxx +++ b/svtools/source/misc/embedtransfer.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: embedtransfer.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/svtools/source/misc/errtxt.src b/svtools/source/misc/errtxt.src index 3ab58ef92dbf..4e9a316308e0 100644 --- a/svtools/source/misc/errtxt.src +++ b/svtools/source/misc/errtxt.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: errtxt.src,v $ - * $Revision: 1.63 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svtools/source/misc/helpagent.src b/svtools/source/misc/helpagent.src index 181583bc8f6d..c649c1f17a40 100644 --- a/svtools/source/misc/helpagent.src +++ b/svtools/source/misc/helpagent.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: helpagent.src,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/svtools/source/misc/helpagentwindow.cxx b/svtools/source/misc/helpagentwindow.cxx index 51cd7ebfb740..55800a213a2e 100644 --- a/svtools/source/misc/helpagentwindow.cxx +++ b/svtools/source/misc/helpagentwindow.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: helpagentwindow.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/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index 76752b27354e..e57c0d21d98a 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.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: imagemgr.cxx,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/svtools/source/misc/imagemgr.src b/svtools/source/misc/imagemgr.src index e082398beaa1..0664cdc6bc87 100644 --- a/svtools/source/misc/imagemgr.src +++ b/svtools/source/misc/imagemgr.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: imagemgr.src,v $ - * $Revision: 1.69 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svtools/source/misc/imageresourceaccess.cxx b/svtools/source/misc/imageresourceaccess.cxx index b27bf6fa0174..a4f19d9e004a 100644 --- a/svtools/source/misc/imageresourceaccess.cxx +++ b/svtools/source/misc/imageresourceaccess.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: imageresourceaccess.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/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index b0aaee113c20..25f23e2ef00b 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.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: imap.cxx,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/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 1dd10c36c81a..9834fe0fcb76 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.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: imap2.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/svtools/source/misc/imap3.cxx b/svtools/source/misc/imap3.cxx index 7e0dd4d4c5f1..76763ae422f2 100644 --- a/svtools/source/misc/imap3.cxx +++ b/svtools/source/misc/imap3.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: imap3.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/svtools/source/misc/itemdel.cxx b/svtools/source/misc/itemdel.cxx index 9db70f852d30..559d31cdeb1d 100644 --- a/svtools/source/misc/itemdel.cxx +++ b/svtools/source/misc/itemdel.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: itemdel.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/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index ef2cedcc50c2..b656dbf501c4 100644..100755 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.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: langtab.cxx,v $ - * $Revision: 1.3.140.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -166,6 +163,12 @@ const String& SvtLanguageTable::GetString( const LanguageType eType ) const return aEmptyStr; } +String SvtLanguageTable::GetLanguageString( const LanguageType eType ) +{ + static const SvtLanguageTable aLangTable; + return aLangTable.GetString( eType ); +} + //------------------------------------------------------------------------ LanguageType SvtLanguageTable::GetType( const String& rStr ) const diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src index 0aa90f8e96b9..929276cfbdb5 100644 --- a/svtools/source/misc/langtab.src +++ b/svtools/source/misc/langtab.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: langtab.src,v $ - * $Revision: 1.6.126.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk index 77cf8a41a8bd..65e43747a586 100644 --- a/svtools/source/misc/makefile.mk +++ b/svtools/source/misc/makefile.mk @@ -2,14 +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: makefile.mk,v $ -# -# $Revision: 1.45 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -78,6 +74,7 @@ SLOFILES=\ $(SLO)$/templatefoldercache.obj \ $(SLO)$/transfer.obj \ $(SLO)$/transfer2.obj \ + $(SLO)$/unitconv.obj \ $(SLO)$/wallitem.obj # --- Targets ------------------------------------------------------- diff --git a/svtools/source/misc/stringtransfer.cxx b/svtools/source/misc/stringtransfer.cxx index 323093ae76a2..fa216b27f99c 100644 --- a/svtools/source/misc/stringtransfer.cxx +++ b/svtools/source/misc/stringtransfer.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: stringtransfer.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/svtools/source/misc/svtaccessiblefactory.cxx b/svtools/source/misc/svtaccessiblefactory.cxx index a4b3cc1e8ecc..1a8284642698 100644 --- a/svtools/source/misc/svtaccessiblefactory.cxx +++ b/svtools/source/misc/svtaccessiblefactory.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: svtaccessiblefactory.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/svtools/source/misc/svtdata.cxx b/svtools/source/misc/svtdata.cxx index 2bc1977e9197..65715f635883 100644 --- a/svtools/source/misc/svtdata.cxx +++ b/svtools/source/misc/svtdata.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: svtdata.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/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx index 348a9638399b..62f3ec39eb6f 100644 --- a/svtools/source/misc/templatefoldercache.cxx +++ b/svtools/source/misc/templatefoldercache.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: templatefoldercache.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/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 4a814637e1af..4628c0d4b846 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.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: transfer.cxx,v $ - * $Revision: 1.81 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx index 027dbc31572d..dcd0f81b2758 100644 --- a/svtools/source/misc/transfer2.cxx +++ b/svtools/source/misc/transfer2.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: transfer2.cxx,v $ - * $Revision: 1.21 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx new file mode 100644 index 000000000000..612bcb4f0221 --- /dev/null +++ b/svtools/source/misc/unitconv.cxx @@ -0,0 +1,763 @@ +/************************************************************************* + * + * 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: 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 + * 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_svtools.hxx" + +// include --------------------------------------------------------------- + +#include <svtools/unitconv.hxx> + +// ----------------------------------------------------------------------- + +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 ); + } +} + +// ----------------------------------------------------------------------- +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 ); + +} + +// ----------------------------------------------------------------------- + +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 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 + } + + 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 ); +} + diff --git a/svtools/source/misc/wallitem.cxx b/svtools/source/misc/wallitem.cxx index 6ceb414db003..505af52c9908 100644 --- a/svtools/source/misc/wallitem.cxx +++ b/svtools/source/misc/wallitem.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: wallitem.cxx,v $ - * $Revision: 1.10 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify |