diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2009-02-18 14:18:51 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2009-02-18 14:18:51 +0000 |
commit | dc8c7d3b5eda7e8aa2a7d3e8b3e6d6bed9c02873 (patch) | |
tree | 26b450ea5e63b4489c629be2a94adaaf800e09ad | |
parent | d6b1961572f3a4c949db35f8f7ce9d54c5bbda8d (diff) |
#i10000# Fix even more line ends
-rw-r--r-- | formula/inc/AddressConvention.hxx | 84 | ||||
-rw-r--r-- | formula/inc/formula/intruref.hxx | 10 | ||||
-rw-r--r-- | formula/source/core/api/FormulaOpCodeMapperObj.cxx | 258 | ||||
-rw-r--r-- | formula/source/core/api/token.cxx | 180 | ||||
-rw-r--r-- | formula/source/core/inc/core_resource.hxx | 228 | ||||
-rw-r--r-- | formula/source/core/resource/core_resource.cxx | 222 | ||||
-rw-r--r-- | formula/source/ui/dlg/parawin.cxx | 1206 | ||||
-rw-r--r-- | sfx2/inc/sfx2/dockwin.hxx | 290 | ||||
-rw-r--r-- | sfx2/inc/sfx2/mnumgr.hxx | 10 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 10 |
10 files changed, 1249 insertions, 1249 deletions
diff --git a/formula/inc/AddressConvention.hxx b/formula/inc/AddressConvention.hxx index d65a3be795..fdb6f18043 100644 --- a/formula/inc/AddressConvention.hxx +++ b/formula/inc/AddressConvention.hxx @@ -1,42 +1,42 @@ -/*************************************************************************
- *
- * 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: tokenuno.hxx,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 FORMULA_ADDRESSCONVENTION_HXX_INCLUDED
-#define FORMULA_ADDRESSCONVENTION_HXX_INCLUDED
-
-#include "formula/formuladllapi.h"
-namespace formula
-{
-// =============================================================================
-// =============================================================================
-} // formula
-// =============================================================================
-
-#endif // FORMULA_ADDRESSCONVENTION_HXX_INCLUDED
+/************************************************************************* + * + * 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: tokenuno.hxx,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 FORMULA_ADDRESSCONVENTION_HXX_INCLUDED +#define FORMULA_ADDRESSCONVENTION_HXX_INCLUDED + +#include "formula/formuladllapi.h" +namespace formula +{ +// ============================================================================= +// ============================================================================= +} // formula +// ============================================================================= + +#endif // FORMULA_ADDRESSCONVENTION_HXX_INCLUDED diff --git a/formula/inc/formula/intruref.hxx b/formula/inc/formula/intruref.hxx index 831eeb1f91..a0dc9ad5ee 100644 --- a/formula/inc/formula/intruref.hxx +++ b/formula/inc/formula/intruref.hxx @@ -31,8 +31,8 @@ #ifndef FORMULA_INTRUREF_HXX #define FORMULA_INTRUREF_HXX -namespace formula
-{
+namespace formula +{ /** A simple intrusive refcounting template, not thread safe, but therefore also a bit faster than boost's smart_ptr or uno::Reference equivalents, and @@ -96,9 +96,9 @@ public: inline operator T*() const { return p; } inline T* get() const { return p; } }; -// =============================================================================
-} // formula
-// =============================================================================
+// ============================================================================= +} // formula +// ============================================================================= #endif // SC_INTRUREF_HXX diff --git a/formula/source/core/api/FormulaOpCodeMapperObj.cxx b/formula/source/core/api/FormulaOpCodeMapperObj.cxx index 29f0a2d278..d71126816a 100644 --- a/formula/source/core/api/FormulaOpCodeMapperObj.cxx +++ b/formula/source/core/api/FormulaOpCodeMapperObj.cxx @@ -1,129 +1,129 @@ -/*************************************************************************
- *
- * 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: tokenuno.hxx,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.
- *
- ************************************************************************/
-#include "precompiled_formula.hxx"
-#include "formula/FormulaOpCodeMapperObj.hxx"
-#include "formula/opcode.hxx"
-#include <comphelper/sequence.hxx>
-
-// =============================================================================
-namespace formula
-{
-// =============================================================================
-
- using namespace ::com::sun::star;
-
- // -----------------------------------------------------------------------------
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL FormulaOpCodeMapperObj::supportsService( const ::rtl::OUString& _rServiceName ) throw(uno::RuntimeException)
-{
- return ::comphelper::findValue( getSupportedServiceNames_Static(), _rServiceName, sal_True ).getLength() != 0;
-}
-//------------------------------------------------------------------------
-FormulaOpCodeMapperObj::FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler)
-: m_pCompiler(_pCompiler)
-{
-}
-
-FormulaOpCodeMapperObj::~FormulaOpCodeMapperObj()
-{
-}
-
-
-::sal_Int32 SAL_CALL FormulaOpCodeMapperObj::getOpCodeExternal()
- throw (::com::sun::star::uno::RuntimeException)
-{
- return ocExternal;
-}
-
-
-::sal_Int32 SAL_CALL FormulaOpCodeMapperObj::getOpCodeUnknown()
- throw (::com::sun::star::uno::RuntimeException)
-{
- return FormulaCompiler::OpCodeMap::getOpCodeUnknown();
-}
-
-
-::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >
-SAL_CALL FormulaOpCodeMapperObj::getMappings(
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames,
- sal_Int32 nLanguage )
- throw ( ::com::sun::star::lang::IllegalArgumentException,
- ::com::sun::star::uno::RuntimeException)
-{
- FormulaCompiler::OpCodeMapPtr xMap = m_pCompiler->GetOpCodeMap( nLanguage);
- if (!xMap)
- throw lang::IllegalArgumentException();
- return xMap->createSequenceOfFormulaTokens( *m_pCompiler,rNames);
-}
-
-
-::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry >
-SAL_CALL FormulaOpCodeMapperObj::getAvailableMappings(
- sal_Int32 nLanguage, sal_Int32 nGroups )
- throw ( ::com::sun::star::lang::IllegalArgumentException,
- ::com::sun::star::uno::RuntimeException)
-{
- FormulaCompiler::OpCodeMapPtr xMap = m_pCompiler->GetOpCodeMap( nLanguage);
- if (!xMap)
- throw lang::IllegalArgumentException();
- return xMap->createSequenceOfAvailableMappings( *m_pCompiler,nGroups);
-}
-//--------------------------------------------------------------------------
-::rtl::OUString SAL_CALL FormulaOpCodeMapperObj::getImplementationName( ) throw(uno::RuntimeException)
-{
- return getImplementationName_Static();
-}
-// -----------------------------------------------------------------------------
-::rtl::OUString SAL_CALL FormulaOpCodeMapperObj::getImplementationName_Static()
-{
- return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "simple.formula.FormulaOpCodeMapperObj" ) );
-}
-// --------------------------------------------------------------------------------
-uno::Sequence< ::rtl::OUString > SAL_CALL FormulaOpCodeMapperObj::getSupportedServiceNames( ) throw(uno::RuntimeException)
-{
- return getSupportedServiceNames_Static();
-}
-uno::Sequence< rtl::OUString > SAL_CALL FormulaOpCodeMapperObj::getSupportedServiceNames_Static()
-{
- uno::Sequence< rtl::OUString > aSeq( 1 );
- aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.FormulaOpCodeMapper" ));
- return aSeq;
-}
-
-uno::Reference< uno::XInterface > SAL_CALL FormulaOpCodeMapperObj::create(
- uno::Reference< uno::XComponentContext > const & /*_xContext*/)
-{
- return static_cast<sheet::XFormulaOpCodeMapper*>(new FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler>(new FormulaCompiler())));
-}
-// -----------------------------------------------------------------------------
-
-// =============================================================================
-} // formula
-// =============================================================================
+/************************************************************************* + * + * 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: tokenuno.hxx,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. + * + ************************************************************************/ +#include "precompiled_formula.hxx" +#include "formula/FormulaOpCodeMapperObj.hxx" +#include "formula/opcode.hxx" +#include <comphelper/sequence.hxx> + +// ============================================================================= +namespace formula +{ +// ============================================================================= + + using namespace ::com::sun::star; + + // ----------------------------------------------------------------------------- +// -------------------------------------------------------------------------------- +sal_Bool SAL_CALL FormulaOpCodeMapperObj::supportsService( const ::rtl::OUString& _rServiceName ) throw(uno::RuntimeException) +{ + return ::comphelper::findValue( getSupportedServiceNames_Static(), _rServiceName, sal_True ).getLength() != 0; +} +//------------------------------------------------------------------------ +FormulaOpCodeMapperObj::FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler) +: m_pCompiler(_pCompiler) +{ +} + +FormulaOpCodeMapperObj::~FormulaOpCodeMapperObj() +{ +} + + +::sal_Int32 SAL_CALL FormulaOpCodeMapperObj::getOpCodeExternal() + throw (::com::sun::star::uno::RuntimeException) +{ + return ocExternal; +} + + +::sal_Int32 SAL_CALL FormulaOpCodeMapperObj::getOpCodeUnknown() + throw (::com::sun::star::uno::RuntimeException) +{ + return FormulaCompiler::OpCodeMap::getOpCodeUnknown(); +} + + +::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > +SAL_CALL FormulaOpCodeMapperObj::getMappings( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames, + sal_Int32 nLanguage ) + throw ( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException) +{ + FormulaCompiler::OpCodeMapPtr xMap = m_pCompiler->GetOpCodeMap( nLanguage); + if (!xMap) + throw lang::IllegalArgumentException(); + return xMap->createSequenceOfFormulaTokens( *m_pCompiler,rNames); +} + + +::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry > +SAL_CALL FormulaOpCodeMapperObj::getAvailableMappings( + sal_Int32 nLanguage, sal_Int32 nGroups ) + throw ( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException) +{ + FormulaCompiler::OpCodeMapPtr xMap = m_pCompiler->GetOpCodeMap( nLanguage); + if (!xMap) + throw lang::IllegalArgumentException(); + return xMap->createSequenceOfAvailableMappings( *m_pCompiler,nGroups); +} +//-------------------------------------------------------------------------- +::rtl::OUString SAL_CALL FormulaOpCodeMapperObj::getImplementationName( ) throw(uno::RuntimeException) +{ + return getImplementationName_Static(); +} +// ----------------------------------------------------------------------------- +::rtl::OUString SAL_CALL FormulaOpCodeMapperObj::getImplementationName_Static() +{ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "simple.formula.FormulaOpCodeMapperObj" ) ); +} +// -------------------------------------------------------------------------------- +uno::Sequence< ::rtl::OUString > SAL_CALL FormulaOpCodeMapperObj::getSupportedServiceNames( ) throw(uno::RuntimeException) +{ + return getSupportedServiceNames_Static(); +} +uno::Sequence< rtl::OUString > SAL_CALL FormulaOpCodeMapperObj::getSupportedServiceNames_Static() +{ + uno::Sequence< rtl::OUString > aSeq( 1 ); + aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.FormulaOpCodeMapper" )); + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL FormulaOpCodeMapperObj::create( + uno::Reference< uno::XComponentContext > const & /*_xContext*/) +{ + return static_cast<sheet::XFormulaOpCodeMapper*>(new FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler>(new FormulaCompiler()))); +} +// ----------------------------------------------------------------------------- + +// ============================================================================= +} // formula +// ============================================================================= diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index bf034210ea..2ee64da24b 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -898,20 +898,20 @@ static void DumpTokArr( FormulaTokenArray *pCode ) } #endif -inline bool MissingConvention::isRewriteNeeded( OpCode eOp ) const
-{
- switch (eOp)
- {
- case ocGammaDist:
- case ocPoissonDist:
- return true;
- case ocMissing:
- case ocLog:
- case ocAddress:
- return !isODFF(); // rewrite only for PODF
- default:
- return false;
- }
+inline bool MissingConvention::isRewriteNeeded( OpCode eOp ) const +{ + switch (eOp) + { + case ocGammaDist: + case ocPoissonDist: + return true; + case ocMissing: + case ocLog: + case ocAddress: + return !isODFF(); // rewrite only for PODF + default: + return false; + } } class FormulaMissingContext @@ -929,34 +929,34 @@ class FormulaMissingContext }; void FormulaMissingContext::AddMoreArgs( FormulaTokenArray *pNewArr, const MissingConvention & rConv ) const { - if ( !mpFunc )
- return;
-
- switch (mpFunc->GetOpCode())
- {
- case ocGammaDist:
- if (mnCurArg == 2)
- {
- pNewArr->AddOpCode( ocSep );
- pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=TRUE()
- }
- break;
- case ocPoissonDist:
- if (mnCurArg == 1)
- {
- pNewArr->AddOpCode( ocSep );
- pNewArr->AddDouble( 1.0 ); // 3rd, Cumulative=TRUE()
- }
- break;
- case ocLog:
- if ( !rConv.isODFF() && mnCurArg == 0 )
- {
- pNewArr->AddOpCode( ocSep );
- pNewArr->AddDouble( 10.0 ); // 2nd, basis 10
- }
- break;
- default:
- break;
+ if ( !mpFunc ) + return; + + switch (mpFunc->GetOpCode()) + { + case ocGammaDist: + if (mnCurArg == 2) + { + pNewArr->AddOpCode( ocSep ); + pNewArr->AddDouble( 1.0 ); // 4th, Cumulative=TRUE() + } + break; + case ocPoissonDist: + if (mnCurArg == 1) + { + pNewArr->AddOpCode( ocSep ); + pNewArr->AddDouble( 1.0 ); // 3rd, Cumulative=TRUE() + } + break; + case ocLog: + if ( !rConv.isODFF() && mnCurArg == 0 ) + { + pNewArr->AddOpCode( ocSep ); + pNewArr->AddDouble( 10.0 ); // 2nd, basis 10 + } + break; + default: + break; } } @@ -1007,54 +1007,54 @@ bool FormulaMissingContext::AddMissingExternal( FormulaTokenArray *pNewArr ) con bool FormulaMissingContext::AddMissing( FormulaTokenArray *pNewArr, const MissingConvention & rConv ) const { - if ( !mpFunc )
- return false;
-
- bool bRet = false;
- if (rConv.isODFF())
- {
- }
- else
- {
- switch ( mpFunc->GetOpCode() )
- {
- case ocFixed:
- return AddDefaultArg( pNewArr, 1, 2.0 );
- //break;
- case ocBetaDist:
- case ocBetaInv:
- case ocRMZ: // PMT
- return AddDefaultArg( pNewArr, 3, 0.0 );
- //break;
- case ocZinsZ: // IPMT
- case ocKapz: // PPMT
- return AddDefaultArg( pNewArr, 4, 0.0 );
- //break;
- case ocBW: // PV
- case ocZW: // FV
- bRet |= AddDefaultArg( pNewArr, 2, 0.0 ); // pmt
- bRet |= AddDefaultArg( pNewArr, 3, 0.0 ); // [fp]v
- break;
- case ocZins: // RATE
- bRet |= AddDefaultArg( pNewArr, 1, 0.0 ); // pmt
- bRet |= AddDefaultArg( pNewArr, 3, 0.0 ); // fv
- bRet |= AddDefaultArg( pNewArr, 4, 0.0 ); // type
- break;
- case ocExternal:
- return AddMissingExternal( pNewArr );
- //break;
-
- // --- more complex cases ---
-
- case ocOffset:
- // FIXME: rather tough.
- // if arg 3 (height) ommitted, export arg1 (rows)
- break;
- default:
- break;
- }
- }
-
+ if ( !mpFunc ) + return false; + + bool bRet = false; + if (rConv.isODFF()) + { + } + else + { + switch ( mpFunc->GetOpCode() ) + { + case ocFixed: + return AddDefaultArg( pNewArr, 1, 2.0 ); + //break; + case ocBetaDist: + case ocBetaInv: + case ocRMZ: // PMT + return AddDefaultArg( pNewArr, 3, 0.0 ); + //break; + case ocZinsZ: // IPMT + case ocKapz: // PPMT + return AddDefaultArg( pNewArr, 4, 0.0 ); + //break; + case ocBW: // PV + case ocZW: // FV + bRet |= AddDefaultArg( pNewArr, 2, 0.0 ); // pmt + bRet |= AddDefaultArg( pNewArr, 3, 0.0 ); // [fp]v + break; + case ocZins: // RATE + bRet |= AddDefaultArg( pNewArr, 1, 0.0 ); // pmt + bRet |= AddDefaultArg( pNewArr, 3, 0.0 ); // fv + bRet |= AddDefaultArg( pNewArr, 4, 0.0 ); // type + break; + case ocExternal: + return AddMissingExternal( pNewArr ); + //break; + + // --- more complex cases --- + + case ocOffset: + // FIXME: rather tough. + // if arg 3 (height) ommitted, export arg1 (rows) + break; + default: + break; + } + } + return bRet; } diff --git a/formula/source/core/inc/core_resource.hxx b/formula/source/core/inc/core_resource.hxx index 400febcedf..77b1a4de50 100644 --- a/formula/source/core/inc/core_resource.hxx +++ b/formula/source/core/inc/core_resource.hxx @@ -1,114 +1,114 @@ -/*************************************************************************
- *
- * 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: core_resource.hxx,v $
- * $Revision: 1.5.68.2 $
- *
- * 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 _FORMULA_CORE_RESOURCE_HXX_
-#define _FORMULA_CORE_RESOURCE_HXX_
-
-#ifndef _RTL_USTRING_HXX_
-#include <rtl/ustring.hxx>
-#endif
-#include <osl/mutex.hxx>
-
-class ResMgr;
-//.........................................................................
-namespace formula
-{
-
-#define FORMULA_RES( id ) ResourceManager::loadString( id )
-#define FORMULA_RES_PARAM( id, ascii, replace ) ResourceManager::loadString( id, ascii, replace )
-
-#define FORMULACORE_RESSTRING( id ) FORMULA_RES( id )
- // (compatibility)
-
- //==================================================================
- //= ResourceManager
- //= handling ressources within the FORMULA-Core library
- //==================================================================
- class ResourceManager
- {
- friend class OModuleClient;
- static ::osl::Mutex s_aMutex; /// access safety
- static sal_Int32 s_nClients; /// number of registered clients
- static ResMgr* m_pImpl;
-
- private:
- // no instantiation allowed
- ResourceManager() { }
- ~ResourceManager() { }
-
- protected:
- static void ensureImplExists();
- /// register a client for the module
- static void registerClient();
- /// revoke a client for the module
- static void revokeClient();
-
- public:
- /** loads the string with the specified resource id
- */
- static ::rtl::OUString loadString(sal_uInt16 _nResId);
-
- /** loads a string from the resource file, substituting a placeholder with a given string
-
- @param _nResId
- the resource ID of the string to loAD
- @param _pPlaceholderAscii
- the ASCII representation of the placeholder string
- @param _rReplace
- the string which should substutite the placeholder
- */
- static ::rtl::OUString loadString(
- sal_uInt16 _nResId,
- const sal_Char* _pPlaceholderAscii,
- const ::rtl::OUString& _rReplace
- );
-
- static ResMgr* getResManager();
- };
-
- //=========================================================================
- //= OModuleClient
- //=========================================================================
- /** base class for objects which uses any global module-specific ressources
- */
- class OModuleClient
- {
- public:
- OModuleClient() { ResourceManager::registerClient(); }
- ~OModuleClient() { ResourceManager::revokeClient(); }
- };
-
-
-//.........................................................................
-} // formula
-//.........................................................................
-
-#endif // _FORMULA_CORE_RESOURCE_HXX_
-
+/************************************************************************* + * + * 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: core_resource.hxx,v $ + * $Revision: 1.5.68.2 $ + * + * 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 _FORMULA_CORE_RESOURCE_HXX_ +#define _FORMULA_CORE_RESOURCE_HXX_ + +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> +#endif +#include <osl/mutex.hxx> + +class ResMgr; +//......................................................................... +namespace formula +{ + +#define FORMULA_RES( id ) ResourceManager::loadString( id ) +#define FORMULA_RES_PARAM( id, ascii, replace ) ResourceManager::loadString( id, ascii, replace ) + +#define FORMULACORE_RESSTRING( id ) FORMULA_RES( id ) + // (compatibility) + + //================================================================== + //= ResourceManager + //= handling ressources within the FORMULA-Core library + //================================================================== + class ResourceManager + { + friend class OModuleClient; + static ::osl::Mutex s_aMutex; /// access safety + static sal_Int32 s_nClients; /// number of registered clients + static ResMgr* m_pImpl; + + private: + // no instantiation allowed + ResourceManager() { } + ~ResourceManager() { } + + protected: + static void ensureImplExists(); + /// register a client for the module + static void registerClient(); + /// revoke a client for the module + static void revokeClient(); + + public: + /** loads the string with the specified resource id + */ + static ::rtl::OUString loadString(sal_uInt16 _nResId); + + /** loads a string from the resource file, substituting a placeholder with a given string + + @param _nResId + the resource ID of the string to loAD + @param _pPlaceholderAscii + the ASCII representation of the placeholder string + @param _rReplace + the string which should substutite the placeholder + */ + static ::rtl::OUString loadString( + sal_uInt16 _nResId, + const sal_Char* _pPlaceholderAscii, + const ::rtl::OUString& _rReplace + ); + + static ResMgr* getResManager(); + }; + + //========================================================================= + //= OModuleClient + //========================================================================= + /** base class for objects which uses any global module-specific ressources + */ + class OModuleClient + { + public: + OModuleClient() { ResourceManager::registerClient(); } + ~OModuleClient() { ResourceManager::revokeClient(); } + }; + + +//......................................................................... +} // formula +//......................................................................... + +#endif // _FORMULA_CORE_RESOURCE_HXX_ + diff --git a/formula/source/core/resource/core_resource.cxx b/formula/source/core/resource/core_resource.cxx index 787adf1227..088c5958f2 100644 --- a/formula/source/core/resource/core_resource.cxx +++ b/formula/source/core/resource/core_resource.cxx @@ -1,111 +1,111 @@ -/*************************************************************************
- *
- * 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: core_resource.cxx,v $
- * $Revision: 1.11.68.2 $
- *
- * 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_formula.hxx"
-
-#include "core_resource.hxx"
-
-#include <tools/resmgr.hxx>
-
-// ---- needed as long as we have no contexts for components ---
-#include <vcl/svapp.hxx>
-#include <svtools/solar.hrc>
-
-//.........................................................................
-namespace formula
-{
-
- //==================================================================
- //= ResourceManager
- //==================================================================
- ::osl::Mutex ResourceManager::s_aMutex;
- sal_Int32 ResourceManager::s_nClients = 0;
- ResMgr* ResourceManager::m_pImpl = NULL;
-
- //------------------------------------------------------------------
- void ResourceManager::ensureImplExists()
- {
- if (m_pImpl)
- return;
-
- ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
-
- ByteString sFileName("for");
-
- m_pImpl = ResMgr::CreateResMgr(sFileName.GetBuffer(), aLocale);
- }
-
- //------------------------------------------------------------------
- ::rtl::OUString ResourceManager::loadString(sal_uInt16 _nResId)
- {
- ::rtl::OUString sReturn;
-
- ensureImplExists();
- if (m_pImpl)
- sReturn = String(ResId(_nResId,*m_pImpl));
-
- return sReturn;
- }
-
- //------------------------------------------------------------------
- ::rtl::OUString ResourceManager::loadString( sal_uInt16 _nResId, const sal_Char* _pPlaceholderAscii, const ::rtl::OUString& _rReplace )
- {
- String sString( loadString( _nResId ) );
- sString.SearchAndReplaceAscii( _pPlaceholderAscii, _rReplace );
- return sString;
- }
- //-------------------------------------------------------------------------
- void ResourceManager::registerClient()
- {
- ::osl::MutexGuard aGuard(s_aMutex);
- ++s_nClients;
- }
-
- //-------------------------------------------------------------------------
- void ResourceManager::revokeClient()
- {
- ::osl::MutexGuard aGuard(s_aMutex);
- if (!--s_nClients && m_pImpl)
- {
- delete m_pImpl;
- m_pImpl = NULL;
- }
- }
- ResMgr* ResourceManager::getResManager()
- {
- ensureImplExists();
- return m_pImpl;
- }
-
-//.........................................................................
-} // formula
-//.........................................................................
-
+/************************************************************************* + * + * 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: core_resource.cxx,v $ + * $Revision: 1.11.68.2 $ + * + * 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_formula.hxx" + +#include "core_resource.hxx" + +#include <tools/resmgr.hxx> + +// ---- needed as long as we have no contexts for components --- +#include <vcl/svapp.hxx> +#include <svtools/solar.hrc> + +//......................................................................... +namespace formula +{ + + //================================================================== + //= ResourceManager + //================================================================== + ::osl::Mutex ResourceManager::s_aMutex; + sal_Int32 ResourceManager::s_nClients = 0; + ResMgr* ResourceManager::m_pImpl = NULL; + + //------------------------------------------------------------------ + void ResourceManager::ensureImplExists() + { + if (m_pImpl) + return; + + ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale(); + + ByteString sFileName("for"); + + m_pImpl = ResMgr::CreateResMgr(sFileName.GetBuffer(), aLocale); + } + + //------------------------------------------------------------------ + ::rtl::OUString ResourceManager::loadString(sal_uInt16 _nResId) + { + ::rtl::OUString sReturn; + + ensureImplExists(); + if (m_pImpl) + sReturn = String(ResId(_nResId,*m_pImpl)); + + return sReturn; + } + + //------------------------------------------------------------------ + ::rtl::OUString ResourceManager::loadString( sal_uInt16 _nResId, const sal_Char* _pPlaceholderAscii, const ::rtl::OUString& _rReplace ) + { + String sString( loadString( _nResId ) ); + sString.SearchAndReplaceAscii( _pPlaceholderAscii, _rReplace ); + return sString; + } + //------------------------------------------------------------------------- + void ResourceManager::registerClient() + { + ::osl::MutexGuard aGuard(s_aMutex); + ++s_nClients; + } + + //------------------------------------------------------------------------- + void ResourceManager::revokeClient() + { + ::osl::MutexGuard aGuard(s_aMutex); + if (!--s_nClients && m_pImpl) + { + delete m_pImpl; + m_pImpl = NULL; + } + } + ResMgr* ResourceManager::getResManager() + { + ensureImplExists(); + return m_pImpl; + } + +//......................................................................... +} // formula +//......................................................................... + diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index 9f80c56564..a0c26562a5 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -1,603 +1,603 @@ -/*************************************************************************
- *
- * 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: parawin.cxx,v $
- * $Revision: 1.10 $
- *
- * 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_formula.hxx"
-
-
-
-//----------------------------------------------------------------------------
-
-#include <svtools/zforlist.hxx>
-#include <svtools/stritem.hxx>
-
-#include "parawin.hxx"
-#include "parawin.hrc"
-#include "helpids.hrc"
-#include "formula/formdata.hxx"
-#include "formula/IFunctionDescription.hxx"
-#include "ModuleHelper.hxx"
-#include "ForResId.hrc"
-
-#define VAR_ARGS 30
-namespace formula
-{
-//============================================================================
-
-ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos):
- TabPage (pParent,ModuleRes(RID_FORMULATAB_PARAMETER)),
- pFuncDesc ( NULL ),
- pMyParent (_pDlg),
- aFtEditDesc ( this, ModuleRes( FT_EDITDESC ) ),
- aFtArgName ( this, ModuleRes( FT_PARNAME ) ),
- aFtArgDesc ( this, ModuleRes( FT_PARDESC ) ),
-
- aFtArg1 ( this, ModuleRes( FT_ARG1 ) ),
- aFtArg2 ( this, ModuleRes( FT_ARG2 ) ),
- aFtArg3 ( this, ModuleRes( FT_ARG3 ) ),
- aFtArg4 ( this, ModuleRes( FT_ARG4 ) ),
-
- aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ),
- aBtnFx2 ( this, ModuleRes( BTN_FX2 ) ),
- aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ),
- aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ),
-
- aEdArg1 ( this, ModuleRes( ED_ARG1 ) ),
- aEdArg2 ( this, ModuleRes( ED_ARG2 ) ),
- aEdArg3 ( this, ModuleRes( ED_ARG3 ) ),
- aEdArg4 ( this, ModuleRes( ED_ARG4 ) ),
-
- aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ),
- aRefBtn2 ( this, ModuleRes( RB_ARG2 ) ),
- aRefBtn3 ( this, ModuleRes( RB_ARG3 ) ),
- aRefBtn4 ( this, ModuleRes( RB_ARG4 ) ),
-
- aSlider ( this, ModuleRes( WND_SLIDER ) ),
- m_sOptional ( ModuleRes( STR_OPTIONAL ) ),
- m_sRequired ( ModuleRes( STR_REQUIRED ) ),
- bRefMode (FALSE)
-{
- Image aFxHC( ModuleRes( IMG_FX_H ) );
- FreeResource();
- aDefaultString=aFtEditDesc.GetText();
-
- SetPosPixel(aPos);
- nEdFocus=NOT_FOUND;
- nActiveLine=0;
- Size aSize = aSlider.GetSizePixel();
- aSize.Width() = GetSettings().GetStyleSettings().GetScrollBarSize();
- aSlider.SetSizePixel( aSize );
- aSlider.SetEndScrollHdl( LINK( this, ParaWin, ScrollHdl ) );
- aSlider.SetScrollHdl( LINK( this, ParaWin, ScrollHdl ) );
-
- aBtnFx1.SetModeImage( aFxHC, BMP_COLOR_HIGHCONTRAST );
- aBtnFx2.SetModeImage( aFxHC, BMP_COLOR_HIGHCONTRAST );
- aBtnFx3.SetModeImage( aFxHC, BMP_COLOR_HIGHCONTRAST );
- aBtnFx4.SetModeImage( aFxHC, BMP_COLOR_HIGHCONTRAST );
-
- InitArgInput( 0, aFtArg1, aBtnFx1, aEdArg1, aRefBtn1);
- InitArgInput( 1, aFtArg2, aBtnFx2, aEdArg2, aRefBtn2);
- InitArgInput( 2, aFtArg3, aBtnFx3, aEdArg3, aRefBtn3);
- InitArgInput( 3, aFtArg4, aBtnFx4, aEdArg4, aRefBtn4);
- ClearAll();
-}
-
-void ParaWin::UpdateArgDesc( USHORT nArg )
-{
- if (nArg==NOT_FOUND) return;
-
- if ( nArgs > 4 )
- nArg = sal::static_int_cast<USHORT>( nArg + GetSliderPos() );
- //@ nArg += (USHORT)aSlider.GetThumbPos();
-
- if ( (nArgs > 0) && (nArg<nArgs) )
- {
- String aArgDesc;
- String aArgName;
-
- SetArgumentDesc( String() );
- SetArgumentText( String() );
-
- if ( nArgs < VAR_ARGS )
- {
- USHORT nRealArg = (aVisibleArgMapping.size() < nArg) ? aVisibleArgMapping[nArg] : nArg;
- aArgDesc = pFuncDesc->getParameterDescription(nRealArg);
- aArgName = pFuncDesc->getParameterName(nRealArg);
- aArgName += ' ';
- aArgName += (pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ;
- }
- else
- {
- USHORT nFix = nArgs - VAR_ARGS;
- USHORT nPos = ( nArg < nFix ? nArg : nFix );
- USHORT nRealArg = (nPos < aVisibleArgMapping.size() ?
- aVisibleArgMapping[nPos] : aVisibleArgMapping.back());
- aArgDesc = pFuncDesc->getParameterDescription(nRealArg);
- aArgName = pFuncDesc->getParameterName(nRealArg);
- if ( nArg >= nFix )
- aArgName += String::CreateFromInt32(nArg-nFix+1);
- aArgName += ' ';
-
- aArgName += (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ;
- }
-
- SetArgumentDesc(aArgDesc);
- SetArgumentText(aArgName);
- }
-}
-
-void ParaWin::UpdateArgInput( USHORT nOffset, USHORT i )
-{
- USHORT nArg = nOffset + i;
- if ( nArgs < VAR_ARGS)
- {
- if(nArg<nArgs)
- {
- USHORT nRealArg = aVisibleArgMapping[nArg];
- SetArgNameFont (i,(pFuncDesc->isParameterOptional(nRealArg))
- ? aFntLight : aFntBold );
- SetArgName (i,pFuncDesc->getParameterName(nRealArg));
- }
- }
- else
- {
- USHORT nFix = nArgs - VAR_ARGS;
- USHORT nPos = ( nArg < nFix ? nArg : nFix );
- USHORT nRealArg = (nPos < aVisibleArgMapping.size() ?
- aVisibleArgMapping[nPos] : aVisibleArgMapping.back());
- SetArgNameFont( i,
- (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ?
- aFntLight : aFntBold );
- if ( nArg >= nFix )
- {
- String aArgName( pFuncDesc->getParameterName(nRealArg) );
- aArgName += String::CreateFromInt32(nArg-nFix+1);
- SetArgName( i, aArgName );
- }
- else
- SetArgName( i, pFuncDesc->getParameterName(nRealArg) );
- }
- if(nArg<nArgs) SetArgVal(i,aParaArray[nArg]);
- //@ aArgInput[i].SetArgVal( *(pArgArr[nOffset+i]) );
-
-}
-
-ParaWin::~ParaWin()
-{
- // #i66422# if the focus changes during destruction of the controls,
- // don't call the focus handlers
- Link aEmptyLink;
- aBtnFx1.SetGetFocusHdl( aEmptyLink );
- aBtnFx2.SetGetFocusHdl( aEmptyLink );
- aBtnFx3.SetGetFocusHdl( aEmptyLink );
- aBtnFx4.SetGetFocusHdl( aEmptyLink );
-}
-
-USHORT ParaWin::GetActiveLine()
-{
- return nActiveLine;
-}
-
-void ParaWin::SetActiveLine(USHORT no)
-{
- if(no<nArgs)
- {
- long nOffset = GetSliderPos();
- nActiveLine=no;
- long nNewEdPos=(long)nActiveLine-nOffset;
- if(nNewEdPos<0 || nNewEdPos>3)
- {
- nOffset+=nNewEdPos;
- SetSliderPos((USHORT) nOffset);
- nOffset=GetSliderPos();
- }
- nEdFocus=no-(USHORT)nOffset;
- UpdateArgDesc( nEdFocus );
- }
-}
-
-RefEdit* ParaWin::GetActiveEdit()
-{
- if(nArgs>0 && nEdFocus!=NOT_FOUND)
- {
- return aArgInput[nEdFocus].GetArgEdPtr();
- }
- else
- {
- return NULL;
- }
-}
-
-
-String ParaWin::GetArgument(USHORT no)
-{
- String aStr;
- if(no<aParaArray.size())
- {
- aStr=aParaArray[no];
- if(no==nActiveLine && aStr.Len()==0)
- aStr+=' ';
- }
- return aStr;
-}
-
-String ParaWin::GetActiveArgName()
-{
- String aStr;
- if(nArgs>0 && nEdFocus!=NOT_FOUND)
- {
- aStr=aArgInput[nEdFocus].GetArgName();
- }
- return aStr;
-}
-
-
-void ParaWin::SetArgument(USHORT no, const String& aString)
-{
- if(no<aParaArray.size())
- {
- aParaArray[no] = aString;
- aParaArray[no].EraseLeadingChars();
- }
-}
-
-void ParaWin::DelParaArray()
-{
- ::std::vector<String>().swap(aParaArray);
-}
-
-void ParaWin::SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont)
-{
- aFntBold=aBoldFont;
- aFntLight=aLightFont;
-}
-
-void ParaWin::SetFunctionDesc(const IFunctionDescription* pFDesc)
-{
- pFuncDesc=pFDesc;
-
- SetArgumentDesc( String() );
- SetArgumentText( String() );
- SetEditDesc( String() );
- nArgs = 0;
- if ( pFuncDesc!=NULL)
- {
- if ( pFuncDesc->getDescription().getLength() )
- {
- SetEditDesc(pFuncDesc->getDescription());
- }
- else
- {
- SetEditDesc(aDefaultString);
- }
- long nHelpId = pFuncDesc->getHelpId();
- nArgs = pFuncDesc->getSuppressedArgumentCount();
- pFuncDesc->fillVisibleArgumentMapping(aVisibleArgMapping);
- aSlider.Hide();
- SetHelpId( nHelpId );
- aEdArg1.SetHelpId( nHelpId );
- aEdArg2.SetHelpId( nHelpId );
- aEdArg3.SetHelpId( nHelpId );
- aEdArg4.SetHelpId( nHelpId );
-
- // Unique-IDs muessen gleich bleiben fuer Automatisierung
- SetUniqueId( HID_FORMULA_FAP_PAGE );
- aEdArg1.SetUniqueId( HID_FORMULA_FAP_EDIT1 );
- aEdArg2.SetUniqueId( HID_FORMULA_FAP_EDIT2 );
- aEdArg3.SetUniqueId( HID_FORMULA_FAP_EDIT3 );
- aEdArg4.SetUniqueId( HID_FORMULA_FAP_EDIT4 );
- SetActiveLine(0);
- }
- else
- {
- nActiveLine=0;
- }
-
-}
-
-void ParaWin::SetArgumentText(const String& aText)
-{
- aFtArgName.SetText(aText);
-}
-
-void ParaWin::SetArgumentDesc(const String& aText)
-{
- aFtArgDesc.SetText(aText);
-}
-
-void ParaWin::SetEditDesc(const String& aText)
-{
- aFtEditDesc.SetText(aText);
-}
-
-void ParaWin::SetArgName(USHORT no,const String& aText)
-{
- aArgInput[no].SetArgName(aText);
-}
-
-void ParaWin::SetArgNameFont(USHORT no,const Font& aFont)
-{
- aArgInput[no].SetArgNameFont(aFont);
-}
-
-void ParaWin::SetArgVal(USHORT no,const String& aText)
-{
- aArgInput[no].SetArgVal(aText);
-}
-
-void ParaWin::HideParaLine(USHORT no)
-{
- aArgInput[no].Hide();
-}
-
-void ParaWin::ShowParaLine(USHORT no)
-{
- aArgInput[no].Show();
-}
-
-void ParaWin::SetEdFocus(USHORT no)
-{
- UpdateArgDesc(no);
- if(no<4 && no<aParaArray.size())
- aArgInput[no].GetArgEdPtr()->GrabFocus();
-}
-
-
-void ParaWin::InitArgInput( USHORT nPos, FixedText& rFtArg, ImageButton& rBtnFx,
- ArgEdit& rEdArg, RefButton& rRefBtn)
-{
-
- rRefBtn.SetReferences(pMyParent,&rEdArg);
- rEdArg.SetRefDialog(pMyParent);
-
- aArgInput[nPos].InitArgInput (&rFtArg,&rBtnFx,&rEdArg,&rRefBtn);
-
- aArgInput[nPos].Hide();
-
- aArgInput[nPos].SetFxClickHdl ( LINK( this, ParaWin, GetFxHdl ) );
- aArgInput[nPos].SetFxFocusHdl ( LINK( this, ParaWin, GetFxFocusHdl ) );
- aArgInput[nPos].SetEdFocusHdl ( LINK( this, ParaWin, GetEdFocusHdl ) );
- aArgInput[nPos].SetEdModifyHdl ( LINK( this, ParaWin, ModifyHdl ) );
-}
-
-void ParaWin::ClearAll()
-{
- SetFunctionDesc(NULL);
- SetArgumentOffset(0);
-}
-
-void ParaWin::SetArgumentOffset(USHORT nOffset)
-{
- DelParaArray();
- aSlider.SetThumbPos(0);
-
- aParaArray.resize(nArgs);
-
- if ( nArgs > 0 )
- {
- for ( int i=0; i<4 && i<nArgs; i++ )
- {
- String aString;
- aArgInput[i].SetArgVal(aString);
- aArgInput[i].GetArgEdPtr()->Init(
- (i==0) ? (ArgEdit *)NULL : aArgInput[i-1].GetArgEdPtr(),
- (i==3 || i==nArgs-1) ? (ArgEdit *)NULL : aArgInput[i+1].GetArgEdPtr(),
- aSlider, nArgs );
- }
- }
-
- if ( nArgs < 5 )
- {
- aSlider.Hide();
- }
- else
- {
- //aSlider.SetEndScrollHdl( LINK( this, ScFormulaDlg, ScrollHdl ) );
- aSlider.SetPageSize( 4 );
- aSlider.SetVisibleSize( 4 );
- aSlider.SetLineSize( 1 );
- aSlider.SetRange( Range( 0, nArgs ) );
- aSlider.SetThumbPos( nOffset );
- aSlider.Show();
- }
-
- UpdateParas();
-}
-
-void ParaWin::UpdateParas()
-{
- USHORT i;
- USHORT nOffset = GetSliderPos();
-
- if ( nArgs > 0 )
- {
- for ( i=0; (i<nArgs) && (i<4); i++ )
- {
- UpdateArgInput( nOffset, i );
- ShowParaLine(i);
- }
- }
-
- for ( i=nArgs; i<4; i++ ) HideParaLine(i);
-}
-
-
-USHORT ParaWin::GetSliderPos()
-{
- return (USHORT) aSlider.GetThumbPos();
-}
-
-void ParaWin::SetSliderPos(USHORT nSliderPos)
-{
- USHORT nOffset = GetSliderPos();
-
- if(aSlider.IsVisible() && nOffset!=nSliderPos)
- {
- aSlider.SetThumbPos(nSliderPos);
- for ( USHORT i=0; i<4; i++ )
- {
- UpdateArgInput( nSliderPos, i );
- }
- }
-}
-
-void ParaWin::SliderMoved()
-{
- USHORT nOffset = GetSliderPos();
-
- for ( USHORT i=0; i<4; i++ )
- {
- UpdateArgInput( nOffset, i );
- }
- if(nEdFocus!=NOT_FOUND)
- {
- UpdateArgDesc( nEdFocus );
- aArgInput[nEdFocus].SetArgSelection(Selection(0,SELECTION_MAX ));
- nActiveLine=nEdFocus+nOffset;
- ArgumentModified();
- }
- aScrollLink.Call(this);
-}
-
-void ParaWin::ArgumentModified()
-{
- aArgModifiedLink.Call(this);
-}
-
-void ParaWin::FxClick()
-{
- aFxLink.Call(this);
-}
-
-
-IMPL_LINK( ParaWin, GetFxHdl, ArgInput*, pPtr )
-{
- USHORT nOffset = GetSliderPos();
- nEdFocus=NOT_FOUND;
- for ( USHORT nPos=0; nPos<5;nPos++)
- {
- if(pPtr == &aArgInput[nPos])
- {
- nEdFocus=nPos;
- break;
- }
- }
-
- if(nEdFocus!=NOT_FOUND)
- {
- aArgInput[nEdFocus].SetArgSelection(Selection(0,SELECTION_MAX ));
- nActiveLine=nEdFocus+nOffset;
- FxClick();
- }
- return 0;
-}
-
-IMPL_LINK( ParaWin, GetFxFocusHdl, ArgInput*, pPtr )
-{
- USHORT nOffset = GetSliderPos();
- nEdFocus=NOT_FOUND;
- for ( USHORT nPos=0; nPos<5;nPos++)
- {
- if(pPtr == &aArgInput[nPos])
- {
- nEdFocus=nPos;
- break;
- }
- }
-
- if(nEdFocus!=NOT_FOUND)
- {
- aArgInput[nEdFocus].SetArgSelection(Selection(0,SELECTION_MAX ));
- UpdateArgDesc( nEdFocus );
- nActiveLine=nEdFocus+nOffset;
- }
- return 0;
-}
-
-
-
-IMPL_LINK( ParaWin, GetEdFocusHdl, ArgInput*, pPtr )
-{
- USHORT nOffset = GetSliderPos();
- nEdFocus=NOT_FOUND;
- for ( USHORT nPos=0; nPos<5;nPos++)
- {
- if(pPtr == &aArgInput[nPos])
- {
- nEdFocus=nPos;
- break;
- }
- }
-
- if(nEdFocus!=NOT_FOUND)
- {
- aArgInput[nEdFocus].SetArgSelection(Selection(0,SELECTION_MAX ));
- UpdateArgDesc( nEdFocus );
- nActiveLine=nEdFocus+nOffset;
- ArgumentModified();
- }
-
- return 0;
-}
-
-
-IMPL_LINK( ParaWin, ScrollHdl, ScrollBar*, EMPTYARG )
-{
- SliderMoved();
-
- return 0;
-}
-
-IMPL_LINK( ParaWin, ModifyHdl, ArgInput*, pPtr )
-{
- USHORT nOffset = GetSliderPos();
- nEdFocus=NOT_FOUND;
- for ( USHORT nPos=0; nPos<5;nPos++)
- {
- if(pPtr == &aArgInput[nPos])
- {
- nEdFocus=nPos;
- break;
- }
- }
- if(nEdFocus!=NOT_FOUND)
- {
- aParaArray[nEdFocus+nOffset] = aArgInput[nEdFocus].GetArgVal();
- UpdateArgDesc( nEdFocus);
- nActiveLine=nEdFocus+nOffset;
- }
-
- ArgumentModified();
- return 0;
-}
-
-
-
-} // formula
+/************************************************************************* + * + * 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: parawin.cxx,v $ + * $Revision: 1.10 $ + * + * 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_formula.hxx" + + + +//---------------------------------------------------------------------------- + +#include <svtools/zforlist.hxx> +#include <svtools/stritem.hxx> + +#include "parawin.hxx" +#include "parawin.hrc" +#include "helpids.hrc" +#include "formula/formdata.hxx" +#include "formula/IFunctionDescription.hxx" +#include "ModuleHelper.hxx" +#include "ForResId.hrc" + +#define VAR_ARGS 30 +namespace formula +{ +//============================================================================ + +ParaWin::ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos): + TabPage (pParent,ModuleRes(RID_FORMULATAB_PARAMETER)), + pFuncDesc ( NULL ), + pMyParent (_pDlg), + aFtEditDesc ( this, ModuleRes( FT_EDITDESC ) ), + aFtArgName ( this, ModuleRes( FT_PARNAME ) ), + aFtArgDesc ( this, ModuleRes( FT_PARDESC ) ), + + aFtArg1 ( this, ModuleRes( FT_ARG1 ) ), + aFtArg2 ( this, ModuleRes( FT_ARG2 ) ), + aFtArg3 ( this, ModuleRes( FT_ARG3 ) ), + aFtArg4 ( this, ModuleRes( FT_ARG4 ) ), + + aBtnFx1 ( this, ModuleRes( BTN_FX1 ) ), + aBtnFx2 ( this, ModuleRes( BTN_FX2 ) ), + aBtnFx3 ( this, ModuleRes( BTN_FX3 ) ), + aBtnFx4 ( this, ModuleRes( BTN_FX4 ) ), + + aEdArg1 ( this, ModuleRes( ED_ARG1 ) ), + aEdArg2 ( this, ModuleRes( ED_ARG2 ) ), + aEdArg3 ( this, ModuleRes( ED_ARG3 ) ), + aEdArg4 ( this, ModuleRes( ED_ARG4 ) ), + + aRefBtn1 ( this, ModuleRes( RB_ARG1 ) ), + aRefBtn2 ( this, ModuleRes( RB_ARG2 ) ), + aRefBtn3 ( this, ModuleRes( RB_ARG3 ) ), + aRefBtn4 ( this, ModuleRes( RB_ARG4 ) ), + + aSlider ( this, ModuleRes( WND_SLIDER ) ), + m_sOptional ( ModuleRes( STR_OPTIONAL ) ), + m_sRequired ( ModuleRes( STR_REQUIRED ) ), + bRefMode (FALSE) +{ + Image aFxHC( ModuleRes( IMG_FX_H ) ); + FreeResource(); + aDefaultString=aFtEditDesc.GetText(); + + SetPosPixel(aPos); + nEdFocus=NOT_FOUND; + nActiveLine=0; + Size aSize = aSlider.GetSizePixel(); + aSize.Width() = GetSettings().GetStyleSettings().GetScrollBarSize(); + aSlider.SetSizePixel( aSize ); + aSlider.SetEndScrollHdl( LINK( this, ParaWin, ScrollHdl ) ); + aSlider.SetScrollHdl( LINK( this, ParaWin, ScrollHdl ) ); + + aBtnFx1.SetModeImage( aFxHC, BMP_COLOR_HIGHCONTRAST ); + aBtnFx2.SetModeImage( aFxHC, BMP_COLOR_HIGHCONTRAST ); + aBtnFx3.SetModeImage( aFxHC, BMP_COLOR_HIGHCONTRAST ); + aBtnFx4.SetModeImage( aFxHC, BMP_COLOR_HIGHCONTRAST ); + + InitArgInput( 0, aFtArg1, aBtnFx1, aEdArg1, aRefBtn1); + InitArgInput( 1, aFtArg2, aBtnFx2, aEdArg2, aRefBtn2); + InitArgInput( 2, aFtArg3, aBtnFx3, aEdArg3, aRefBtn3); + InitArgInput( 3, aFtArg4, aBtnFx4, aEdArg4, aRefBtn4); + ClearAll(); +} + +void ParaWin::UpdateArgDesc( USHORT nArg ) +{ + if (nArg==NOT_FOUND) return; + + if ( nArgs > 4 ) + nArg = sal::static_int_cast<USHORT>( nArg + GetSliderPos() ); + //@ nArg += (USHORT)aSlider.GetThumbPos(); + + if ( (nArgs > 0) && (nArg<nArgs) ) + { + String aArgDesc; + String aArgName; + + SetArgumentDesc( String() ); + SetArgumentText( String() ); + + if ( nArgs < VAR_ARGS ) + { + USHORT nRealArg = (aVisibleArgMapping.size() < nArg) ? aVisibleArgMapping[nArg] : nArg; + aArgDesc = pFuncDesc->getParameterDescription(nRealArg); + aArgName = pFuncDesc->getParameterName(nRealArg); + aArgName += ' '; + aArgName += (pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; + } + else + { + USHORT nFix = nArgs - VAR_ARGS; + USHORT nPos = ( nArg < nFix ? nArg : nFix ); + USHORT nRealArg = (nPos < aVisibleArgMapping.size() ? + aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); + aArgDesc = pFuncDesc->getParameterDescription(nRealArg); + aArgName = pFuncDesc->getParameterName(nRealArg); + if ( nArg >= nFix ) + aArgName += String::CreateFromInt32(nArg-nFix+1); + aArgName += ' '; + + aArgName += (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; + } + + SetArgumentDesc(aArgDesc); + SetArgumentText(aArgName); + } +} + +void ParaWin::UpdateArgInput( USHORT nOffset, USHORT i ) +{ + USHORT nArg = nOffset + i; + if ( nArgs < VAR_ARGS) + { + if(nArg<nArgs) + { + USHORT nRealArg = aVisibleArgMapping[nArg]; + SetArgNameFont (i,(pFuncDesc->isParameterOptional(nRealArg)) + ? aFntLight : aFntBold ); + SetArgName (i,pFuncDesc->getParameterName(nRealArg)); + } + } + else + { + USHORT nFix = nArgs - VAR_ARGS; + USHORT nPos = ( nArg < nFix ? nArg : nFix ); + USHORT nRealArg = (nPos < aVisibleArgMapping.size() ? + aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); + SetArgNameFont( i, + (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? + aFntLight : aFntBold ); + if ( nArg >= nFix ) + { + String aArgName( pFuncDesc->getParameterName(nRealArg) ); + aArgName += String::CreateFromInt32(nArg-nFix+1); + SetArgName( i, aArgName ); + } + else + SetArgName( i, pFuncDesc->getParameterName(nRealArg) ); + } + if(nArg<nArgs) SetArgVal(i,aParaArray[nArg]); + //@ aArgInput[i].SetArgVal( *(pArgArr[nOffset+i]) ); + +} + +ParaWin::~ParaWin() +{ + // #i66422# if the focus changes during destruction of the controls, + // don't call the focus handlers + Link aEmptyLink; + aBtnFx1.SetGetFocusHdl( aEmptyLink ); + aBtnFx2.SetGetFocusHdl( aEmptyLink ); + aBtnFx3.SetGetFocusHdl( aEmptyLink ); + aBtnFx4.SetGetFocusHdl( aEmptyLink ); +} + +USHORT ParaWin::GetActiveLine() +{ + return nActiveLine; +} + +void ParaWin::SetActiveLine(USHORT no) +{ + if(no<nArgs) + { + long nOffset = GetSliderPos(); + nActiveLine=no; + long nNewEdPos=(long)nActiveLine-nOffset; + if(nNewEdPos<0 || nNewEdPos>3) + { + nOffset+=nNewEdPos; + SetSliderPos((USHORT) nOffset); + nOffset=GetSliderPos(); + } + nEdFocus=no-(USHORT)nOffset; + UpdateArgDesc( nEdFocus ); + } +} + +RefEdit* ParaWin::GetActiveEdit() +{ + if(nArgs>0 && nEdFocus!=NOT_FOUND) + { + return aArgInput[nEdFocus].GetArgEdPtr(); + } + else + { + return NULL; + } +} + + +String ParaWin::GetArgument(USHORT no) +{ + String aStr; + if(no<aParaArray.size()) + { + aStr=aParaArray[no]; + if(no==nActiveLine && aStr.Len()==0) + aStr+=' '; + } + return aStr; +} + +String ParaWin::GetActiveArgName() +{ + String aStr; + if(nArgs>0 && nEdFocus!=NOT_FOUND) + { + aStr=aArgInput[nEdFocus].GetArgName(); + } + return aStr; +} + + +void ParaWin::SetArgument(USHORT no, const String& aString) +{ + if(no<aParaArray.size()) + { + aParaArray[no] = aString; + aParaArray[no].EraseLeadingChars(); + } +} + +void ParaWin::DelParaArray() +{ + ::std::vector<String>().swap(aParaArray); +} + +void ParaWin::SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont) +{ + aFntBold=aBoldFont; + aFntLight=aLightFont; +} + +void ParaWin::SetFunctionDesc(const IFunctionDescription* pFDesc) +{ + pFuncDesc=pFDesc; + + SetArgumentDesc( String() ); + SetArgumentText( String() ); + SetEditDesc( String() ); + nArgs = 0; + if ( pFuncDesc!=NULL) + { + if ( pFuncDesc->getDescription().getLength() ) + { + SetEditDesc(pFuncDesc->getDescription()); + } + else + { + SetEditDesc(aDefaultString); + } + long nHelpId = pFuncDesc->getHelpId(); + nArgs = pFuncDesc->getSuppressedArgumentCount(); + pFuncDesc->fillVisibleArgumentMapping(aVisibleArgMapping); + aSlider.Hide(); + SetHelpId( nHelpId ); + aEdArg1.SetHelpId( nHelpId ); + aEdArg2.SetHelpId( nHelpId ); + aEdArg3.SetHelpId( nHelpId ); + aEdArg4.SetHelpId( nHelpId ); + + // Unique-IDs muessen gleich bleiben fuer Automatisierung + SetUniqueId( HID_FORMULA_FAP_PAGE ); + aEdArg1.SetUniqueId( HID_FORMULA_FAP_EDIT1 ); + aEdArg2.SetUniqueId( HID_FORMULA_FAP_EDIT2 ); + aEdArg3.SetUniqueId( HID_FORMULA_FAP_EDIT3 ); + aEdArg4.SetUniqueId( HID_FORMULA_FAP_EDIT4 ); + SetActiveLine(0); + } + else + { + nActiveLine=0; + } + +} + +void ParaWin::SetArgumentText(const String& aText) +{ + aFtArgName.SetText(aText); +} + +void ParaWin::SetArgumentDesc(const String& aText) +{ + aFtArgDesc.SetText(aText); +} + +void ParaWin::SetEditDesc(const String& aText) +{ + aFtEditDesc.SetText(aText); +} + +void ParaWin::SetArgName(USHORT no,const String& aText) +{ + aArgInput[no].SetArgName(aText); +} + +void ParaWin::SetArgNameFont(USHORT no,const Font& aFont) +{ + aArgInput[no].SetArgNameFont(aFont); +} + +void ParaWin::SetArgVal(USHORT no,const String& aText) +{ + aArgInput[no].SetArgVal(aText); +} + +void ParaWin::HideParaLine(USHORT no) +{ + aArgInput[no].Hide(); +} + +void ParaWin::ShowParaLine(USHORT no) +{ + aArgInput[no].Show(); +} + +void ParaWin::SetEdFocus(USHORT no) +{ + UpdateArgDesc(no); + if(no<4 && no<aParaArray.size()) + aArgInput[no].GetArgEdPtr()->GrabFocus(); +} + + +void ParaWin::InitArgInput( USHORT nPos, FixedText& rFtArg, ImageButton& rBtnFx, + ArgEdit& rEdArg, RefButton& rRefBtn) +{ + + rRefBtn.SetReferences(pMyParent,&rEdArg); + rEdArg.SetRefDialog(pMyParent); + + aArgInput[nPos].InitArgInput (&rFtArg,&rBtnFx,&rEdArg,&rRefBtn); + + aArgInput[nPos].Hide(); + + aArgInput[nPos].SetFxClickHdl ( LINK( this, ParaWin, GetFxHdl ) ); + aArgInput[nPos].SetFxFocusHdl ( LINK( this, ParaWin, GetFxFocusHdl ) ); + aArgInput[nPos].SetEdFocusHdl ( LINK( this, ParaWin, GetEdFocusHdl ) ); + aArgInput[nPos].SetEdModifyHdl ( LINK( this, ParaWin, ModifyHdl ) ); +} + +void ParaWin::ClearAll() +{ + SetFunctionDesc(NULL); + SetArgumentOffset(0); +} + +void ParaWin::SetArgumentOffset(USHORT nOffset) +{ + DelParaArray(); + aSlider.SetThumbPos(0); + + aParaArray.resize(nArgs); + + if ( nArgs > 0 ) + { + for ( int i=0; i<4 && i<nArgs; i++ ) + { + String aString; + aArgInput[i].SetArgVal(aString); + aArgInput[i].GetArgEdPtr()->Init( + (i==0) ? (ArgEdit *)NULL : aArgInput[i-1].GetArgEdPtr(), + (i==3 || i==nArgs-1) ? (ArgEdit *)NULL : aArgInput[i+1].GetArgEdPtr(), + aSlider, nArgs ); + } + } + + if ( nArgs < 5 ) + { + aSlider.Hide(); + } + else + { + //aSlider.SetEndScrollHdl( LINK( this, ScFormulaDlg, ScrollHdl ) ); + aSlider.SetPageSize( 4 ); + aSlider.SetVisibleSize( 4 ); + aSlider.SetLineSize( 1 ); + aSlider.SetRange( Range( 0, nArgs ) ); + aSlider.SetThumbPos( nOffset ); + aSlider.Show(); + } + + UpdateParas(); +} + +void ParaWin::UpdateParas() +{ + USHORT i; + USHORT nOffset = GetSliderPos(); + + if ( nArgs > 0 ) + { + for ( i=0; (i<nArgs) && (i<4); i++ ) + { + UpdateArgInput( nOffset, i ); + ShowParaLine(i); + } + } + + for ( i=nArgs; i<4; i++ ) HideParaLine(i); +} + + +USHORT ParaWin::GetSliderPos() +{ + return (USHORT) aSlider.GetThumbPos(); +} + +void ParaWin::SetSliderPos(USHORT nSliderPos) +{ + USHORT nOffset = GetSliderPos(); + + if(aSlider.IsVisible() && nOffset!=nSliderPos) + { + aSlider.SetThumbPos(nSliderPos); + for ( USHORT i=0; i<4; i++ ) + { + UpdateArgInput( nSliderPos, i ); + } + } +} + +void ParaWin::SliderMoved() +{ + USHORT nOffset = GetSliderPos(); + + for ( USHORT i=0; i<4; i++ ) + { + UpdateArgInput( nOffset, i ); + } + if(nEdFocus!=NOT_FOUND) + { + UpdateArgDesc( nEdFocus ); + aArgInput[nEdFocus].SetArgSelection(Selection(0,SELECTION_MAX )); + nActiveLine=nEdFocus+nOffset; + ArgumentModified(); + } + aScrollLink.Call(this); +} + +void ParaWin::ArgumentModified() +{ + aArgModifiedLink.Call(this); +} + +void ParaWin::FxClick() +{ + aFxLink.Call(this); +} + + +IMPL_LINK( ParaWin, GetFxHdl, ArgInput*, pPtr ) +{ + USHORT nOffset = GetSliderPos(); + nEdFocus=NOT_FOUND; + for ( USHORT nPos=0; nPos<5;nPos++) + { + if(pPtr == &aArgInput[nPos]) + { + nEdFocus=nPos; + break; + } + } + + if(nEdFocus!=NOT_FOUND) + { + aArgInput[nEdFocus].SetArgSelection(Selection(0,SELECTION_MAX )); + nActiveLine=nEdFocus+nOffset; + FxClick(); + } + return 0; +} + +IMPL_LINK( ParaWin, GetFxFocusHdl, ArgInput*, pPtr ) +{ + USHORT nOffset = GetSliderPos(); + nEdFocus=NOT_FOUND; + for ( USHORT nPos=0; nPos<5;nPos++) + { + if(pPtr == &aArgInput[nPos]) + { + nEdFocus=nPos; + break; + } + } + + if(nEdFocus!=NOT_FOUND) + { + aArgInput[nEdFocus].SetArgSelection(Selection(0,SELECTION_MAX )); + UpdateArgDesc( nEdFocus ); + nActiveLine=nEdFocus+nOffset; + } + return 0; +} + + + +IMPL_LINK( ParaWin, GetEdFocusHdl, ArgInput*, pPtr ) +{ + USHORT nOffset = GetSliderPos(); + nEdFocus=NOT_FOUND; + for ( USHORT nPos=0; nPos<5;nPos++) + { + if(pPtr == &aArgInput[nPos]) + { + nEdFocus=nPos; + break; + } + } + + if(nEdFocus!=NOT_FOUND) + { + aArgInput[nEdFocus].SetArgSelection(Selection(0,SELECTION_MAX )); + UpdateArgDesc( nEdFocus ); + nActiveLine=nEdFocus+nOffset; + ArgumentModified(); + } + + return 0; +} + + +IMPL_LINK( ParaWin, ScrollHdl, ScrollBar*, EMPTYARG ) +{ + SliderMoved(); + + return 0; +} + +IMPL_LINK( ParaWin, ModifyHdl, ArgInput*, pPtr ) +{ + USHORT nOffset = GetSliderPos(); + nEdFocus=NOT_FOUND; + for ( USHORT nPos=0; nPos<5;nPos++) + { + if(pPtr == &aArgInput[nPos]) + { + nEdFocus=nPos; + break; + } + } + if(nEdFocus!=NOT_FOUND) + { + aParaArray[nEdFocus+nOffset] = aArgInput[nEdFocus].GetArgVal(); + UpdateArgDesc( nEdFocus); + nActiveLine=nEdFocus+nOffset; + } + + ArgumentModified(); + return 0; +} + + + +} // formula diff --git a/sfx2/inc/sfx2/dockwin.hxx b/sfx2/inc/sfx2/dockwin.hxx index 6437f2c725..5e2e598ebe 100644 --- a/sfx2/inc/sfx2/dockwin.hxx +++ b/sfx2/inc/sfx2/dockwin.hxx @@ -1,145 +1,145 @@ -/*************************************************************************
- *
- * 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: dockwin.hxx,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 _SFXDOCKWIN_HXX
-#define _SFXDOCKWIN_HXX
-
-#include "sal/config.h"
-#include "sal/types.h"
-#include <vcl/dockwin.hxx>
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-
-#include "sfx2/dllapi.h"
-#include <sfx2/childwin.hxx>
-
-class SfxSplitWindow;
-class SfxDockingWindow_Impl;
-
-void SFX2_DLLPUBLIC SAL_CALL SfxDockingWindowFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName );
-bool SFX2_DLLPUBLIC SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName );
-
-class SFX2_DLLPUBLIC SfxDockingWindow : public DockingWindow
-{
-private:
- Rectangle aInnerRect;
- Rectangle aOuterRect;
- SfxBindings* pBindings;
- Size aFloatSize;
- SfxChildWindow* pMgr;
- SfxDockingWindow_Impl* pImp;
-
- SAL_DLLPRIVATE SfxDockingWindow(SfxDockingWindow &); // not defined
- SAL_DLLPRIVATE void operator =(SfxDockingWindow &); // not defined
-
-protected:
- SfxChildAlignment CalcAlignment(const Point& rPos, Rectangle& rRect );
- void CalcSplitPosition(const Point rPos, Rectangle& rRect,
- SfxChildAlignment eAlign);
- virtual Size CalcDockingSize(SfxChildAlignment);
- virtual SfxChildAlignment
- CheckAlignment(SfxChildAlignment,SfxChildAlignment);
-
- virtual void Resize();
- virtual BOOL PrepareToggleFloatingMode();
- virtual void ToggleFloatingMode();
- virtual void StartDocking();
- virtual BOOL Docking( const Point& rPos, Rectangle& rRect );
- virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
- virtual void Resizing( Size& rSize );
- virtual void Paint( const Rectangle& rRect );
- virtual BOOL Close();
- virtual void Move();
-
-//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return pMgr; }
-//#endif
-
-public:
- SfxDockingWindow( SfxBindings *pBindings,
- SfxChildWindow *pCW,
- Window* pParent,
- WinBits nWinBits=0);
- SfxDockingWindow( SfxBindings *pBindings,
- SfxChildWindow *pCW,
- Window* pParent,
- const ResId& rResId);
- ~SfxDockingWindow();
-
- void Initialize (SfxChildWinInfo* pInfo);
- virtual void FillInfo(SfxChildWinInfo&) const;
- virtual void StateChanged( StateChangedType nStateChange );
-
- void SetDockingRects(const Rectangle& rOuter, const Rectangle& rInner)
- { aInnerRect = rInner; aOuterRect = rOuter; }
- const Rectangle& GetInnerRect() const { return aInnerRect; }
- const Rectangle& GetOuterRect() const { return aOuterRect; }
- SfxBindings& GetBindings() const { return *pBindings; }
- USHORT GetType() const { return pMgr->GetType(); }
- SfxChildAlignment GetAlignment() const { return pMgr->GetAlignment(); }
- void SetAlignment(SfxChildAlignment eAlign) { pMgr->SetAlignment(eAlign); }
- Size GetFloatingSize() const { return aFloatSize; }
- void SetFloatingSize(const Size& rSize) { aFloatSize=rSize; }
-
- void SetMinOutputSizePixel( const Size& rSize );
- Size GetMinOutputSizePixel() const;
- virtual long Notify( NotifyEvent& rNEvt );
- virtual void FadeIn( BOOL );
- void AutoShow( BOOL bShow = TRUE );
- DECL_LINK( TimerHdl, Timer* );
-
-//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE void Initialize_Impl();
- SAL_DLLPRIVATE USHORT GetWinBits_Impl() const;
- SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize );
- SAL_DLLPRIVATE void Disappear_Impl();
- SAL_DLLPRIVATE void Reappear_Impl();
- SAL_DLLPRIVATE BOOL IsAutoHide_Impl() const;
- SAL_DLLPRIVATE BOOL IsPinned_Impl() const;
- SAL_DLLPRIVATE void AutoShow_Impl( BOOL bShow = TRUE );
- SAL_DLLPRIVATE void Pin_Impl( BOOL bPinned );
- SAL_DLLPRIVATE SfxSplitWindow* GetSplitWindow_Impl() const;
- SAL_DLLPRIVATE void ReleaseChildWindow_Impl();
-//#endif
-};
-
-class SfxDockingWrapper : public SfxChildWindow
-{
- public:
- SfxDockingWrapper( Window* pParent ,
- USHORT nId ,
- SfxBindings* pBindings ,
- SfxChildWinInfo* pInfo );
-
- SFX_DECL_CHILDWINDOW(SfxDockingWrapper);
-};
-
-#endif // #ifndef _SFXDOCKWIN_HXX
+/************************************************************************* + * + * 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: dockwin.hxx,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 _SFXDOCKWIN_HXX +#define _SFXDOCKWIN_HXX + +#include "sal/config.h" +#include "sal/types.h" +#include <vcl/dockwin.hxx> + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/awt/XWindow.hpp> +#include <com/sun/star/frame/XFrame.hpp> + +#include "sfx2/dllapi.h" +#include <sfx2/childwin.hxx> + +class SfxSplitWindow; +class SfxDockingWindow_Impl; + +void SFX2_DLLPUBLIC SAL_CALL SfxDockingWindowFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName ); +bool SFX2_DLLPUBLIC SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName ); + +class SFX2_DLLPUBLIC SfxDockingWindow : public DockingWindow +{ +private: + Rectangle aInnerRect; + Rectangle aOuterRect; + SfxBindings* pBindings; + Size aFloatSize; + SfxChildWindow* pMgr; + SfxDockingWindow_Impl* pImp; + + SAL_DLLPRIVATE SfxDockingWindow(SfxDockingWindow &); // not defined + SAL_DLLPRIVATE void operator =(SfxDockingWindow &); // not defined + +protected: + SfxChildAlignment CalcAlignment(const Point& rPos, Rectangle& rRect ); + void CalcSplitPosition(const Point rPos, Rectangle& rRect, + SfxChildAlignment eAlign); + virtual Size CalcDockingSize(SfxChildAlignment); + virtual SfxChildAlignment + CheckAlignment(SfxChildAlignment,SfxChildAlignment); + + virtual void Resize(); + virtual BOOL PrepareToggleFloatingMode(); + virtual void ToggleFloatingMode(); + virtual void StartDocking(); + virtual BOOL Docking( const Point& rPos, Rectangle& rRect ); + virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode ); + virtual void Resizing( Size& rSize ); + virtual void Paint( const Rectangle& rRect ); + virtual BOOL Close(); + virtual void Move(); + +//#if 0 // _SOLAR__PRIVATE + SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return pMgr; } +//#endif + +public: + SfxDockingWindow( SfxBindings *pBindings, + SfxChildWindow *pCW, + Window* pParent, + WinBits nWinBits=0); + SfxDockingWindow( SfxBindings *pBindings, + SfxChildWindow *pCW, + Window* pParent, + const ResId& rResId); + ~SfxDockingWindow(); + + void Initialize (SfxChildWinInfo* pInfo); + virtual void FillInfo(SfxChildWinInfo&) const; + virtual void StateChanged( StateChangedType nStateChange ); + + void SetDockingRects(const Rectangle& rOuter, const Rectangle& rInner) + { aInnerRect = rInner; aOuterRect = rOuter; } + const Rectangle& GetInnerRect() const { return aInnerRect; } + const Rectangle& GetOuterRect() const { return aOuterRect; } + SfxBindings& GetBindings() const { return *pBindings; } + USHORT GetType() const { return pMgr->GetType(); } + SfxChildAlignment GetAlignment() const { return pMgr->GetAlignment(); } + void SetAlignment(SfxChildAlignment eAlign) { pMgr->SetAlignment(eAlign); } + Size GetFloatingSize() const { return aFloatSize; } + void SetFloatingSize(const Size& rSize) { aFloatSize=rSize; } + + void SetMinOutputSizePixel( const Size& rSize ); + Size GetMinOutputSizePixel() const; + virtual long Notify( NotifyEvent& rNEvt ); + virtual void FadeIn( BOOL ); + void AutoShow( BOOL bShow = TRUE ); + DECL_LINK( TimerHdl, Timer* ); + +//#if 0 // _SOLAR__PRIVATE + SAL_DLLPRIVATE void Initialize_Impl(); + SAL_DLLPRIVATE USHORT GetWinBits_Impl() const; + SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize ); + SAL_DLLPRIVATE void Disappear_Impl(); + SAL_DLLPRIVATE void Reappear_Impl(); + SAL_DLLPRIVATE BOOL IsAutoHide_Impl() const; + SAL_DLLPRIVATE BOOL IsPinned_Impl() const; + SAL_DLLPRIVATE void AutoShow_Impl( BOOL bShow = TRUE ); + SAL_DLLPRIVATE void Pin_Impl( BOOL bPinned ); + SAL_DLLPRIVATE SfxSplitWindow* GetSplitWindow_Impl() const; + SAL_DLLPRIVATE void ReleaseChildWindow_Impl(); +//#endif +}; + +class SfxDockingWrapper : public SfxChildWindow +{ + public: + SfxDockingWrapper( Window* pParent , + USHORT nId , + SfxBindings* pBindings , + SfxChildWinInfo* pInfo ); + + SFX_DECL_CHILDWINDOW(SfxDockingWrapper); +}; + +#endif // #ifndef _SFXDOCKWIN_HXX diff --git a/sfx2/inc/sfx2/mnumgr.hxx b/sfx2/inc/sfx2/mnumgr.hxx index 8a9aca1364..08358a6f84 100644 --- a/sfx2/inc/sfx2/mnumgr.hxx +++ b/sfx2/inc/sfx2/mnumgr.hxx @@ -105,11 +105,11 @@ private: DECL_LINK( SelectHdl, void * ); Menu* pSVMenu; -private:
- // only declared, but not defined: don't allow copying
- SfxPopupMenuManager( const SfxPopupMenuManager& );
- SfxPopupMenuManager& operator=( const SfxPopupMenuManager& );
-
+private: + // only declared, but not defined: don't allow copying + SfxPopupMenuManager( const SfxPopupMenuManager& ); + SfxPopupMenuManager& operator=( const SfxPopupMenuManager& ); + public: SfxPopupMenuManager( const ResId&, SfxBindings& ); SfxPopupMenuManager( PopupMenu*, SfxBindings& ); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index b9aed45986..2330dd6da7 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -2410,7 +2410,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , } else if ( SFX_EVENT_LOADFINISHED == pNamedHint->GetEventId() ) { - impl_getPrintHelper();
+ impl_getPrintHelper(); ListenForStorage_Impl( m_pData->m_pObjectShell->GetStorage() ); } else if ( SFX_EVENT_SAVEASDOCDONE == pNamedHint->GetEventId() ) @@ -2424,10 +2424,10 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , addTitle_Impl( aArgs, aTitle ); attachResource( m_pData->m_pObjectShell->GetMedium()->GetName(), aArgs ); } - else if ( SFX_EVENT_DOCCREATED == pNamedHint->GetEventId() )
- {
- impl_getPrintHelper();
- }
+ else if ( SFX_EVENT_DOCCREATED == pNamedHint->GetEventId() ) + { + impl_getPrintHelper(); + } postEvent_Impl( pNamedHint->GetEventId() ); } |