diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-11-02 17:49:42 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-11-02 17:49:42 +0100 |
commit | 66d9925bb6e9c43aacfe9e4ac6f1ee10a8e25166 (patch) | |
tree | ea3e9cb2bd0ca5a8fe7432908bdfdd5071f0773d | |
parent | b2254d5d6fde8c28501e99e29bc824e935a25247 (diff) | |
parent | f6f5c89259867b5aeb86d5509f826da949d122c4 (diff) |
Merge branch 'master' of git://anongit.freedesktop.org/libreoffice/core
446 files changed, 3282 insertions, 15722 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index db8138cf9ebb..8891d6bfc48f 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -646,6 +646,34 @@ $(call gb_LinkTarget_add_libs,$(1),$(GTHREAD_LIBS)) endef + +ifeq ($(ENABLE_DBUS),YES) + +define gb_LinkTarget__use_dbus +$(call gb_LinkTarget_set_include,$(1),\ + $$(INCLUDE) \ + $(DBUS_CFLAGS) \ +) + +$(call gb_Library_add_defs,$(1),\ + -DENABLE_DBUS \ +) + +$(call gb_LinkTarget_add_libs,$(1),\ + $(DBUS_LIBS) \ +) + +endef + +else # ENABLE_DBUS + +define gb_LinkTarget__use_dbus + +endef + +endif # ENABLE_DBUS + + define gb_LinkTarget__use_dbusmenugtk $(call gb_LinkTarget_set_include,$(1),\ $$(INCLUDE) \ diff --git a/autodoc/inc/ary/actions.hxx b/autodoc/inc/ary/actions.hxx deleted file mode 100644 index 5e2536ccd063..000000000000 --- a/autodoc/inc/ary/actions.hxx +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ARY_ACTIONS_HXX -#define ARY_ACTIONS_HXX -// KORR_DEPRECATED_3.0 - - -// USED SERVICES - // BASE CLASSES - // COMPONENTS - // PARAMETERS - - -namespace ary -{ - class RepositoryCenter; - - -/* -enum E_Action -{ - action_Parse, - action_SecondaryProductions, - action_Save, - action_Load, - action_ReadyForRead -}; -*/ - - -/** @resp - Performs such commands on the repository, which refer to - large parts of it. - - @collab ::ary::Repository - and its components and derivates. - @descr - This class works in kind of double dispatch way: - - // Client code: - Command_Xy aMyCommand; - ary::Repository::The_().PerformCommand( aMyCommand ); - - // Repository_Implementation::PerformCommand() code: - aMyCommand.Run(*this); - - // Command_Xy::Run(Repository_Implementation & rRepository) code: - rRepository.Run_Command_Xy(*this); -*/ -class Command -{ - public: - virtual ~Command() {} - - void Run( - n22::RepositoryCenter & - io_rReposy ); - private: - virtual void do_Run( - n22::RepositoryCenter & - io_rReposy ) = 0; -}; - - -// IMPLEMENTATION - -inline void -Command::Run(n22::RepositoryCenter & io_rReposy) - { do_Run(io_rReposy); } - - -} // namespace ary - - -#endif - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/inc/ary/doc/d_parametrized.hxx b/autodoc/inc/ary/doc/d_parametrized.hxx deleted file mode 100644 index 78659e701441..000000000000 --- a/autodoc/inc/ary/doc/d_parametrized.hxx +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ARY_DOC_D_PARAMETER_HXX -#define ARY_DOC_D_PARAMETER_HXX - -// USED SERVICES - // BASE CLASSES -#include <ary/doc/d_node.hxx> - -namespace ary -{ -namespace doc -{ - - -/** Documentation unit with Parameter. -*/ -template <class T> -class Parametrized : public Node -{ - public: - // LIFECYCLE - explicit Parametrized( - nodetype::id i_id, - T i_Parameter ); - virtual ~Parametrized(); - - // INQUIRY - const HyperText & Doc() const; - const T & Parameter() const; - - // ACESS - HyperText & Doc(); - void Set_Parameter( - const T & i_param ); - private: - // Interface csv::ConstProcessorClient: - virtual void do_Accept( - csv::ProcessorIfc & io_processor ) const; - // DATA - HyperText aDoc; - T aParameter; -}; - - - - -// IMPLEMENTATION -template <class T> -Parametrized<T>::Parametrized( nodetype::id i_id, - T i_Parameter ) - : Node(i_id), - aDoc(), - aParameter(i_Parameter) -{ -} - -template <class T> -Parametrized<T>::~Parametrized() -{ -} - -template <class T> -const HyperText & -Parametrized<T>::Doc() const -{ - return aDoc; -} - -template <class T> -const T & -Parametrized<T>::Parameter() const -{ - return aParameter; -} - -template <class T> -HyperText & -Parametrized<T>::Doc() -{ - return aDoc; -} - -template <class T> -inline void -Parametrized<T>::Set_Parameter(const T & i_param) -{ - aParameter = i_param; -} - - - - -} // namespace doc -} // namespace ary -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/inc/ary/doc/ht/dht_interpreter.hxx b/autodoc/inc/ary/doc/ht/dht_interpreter.hxx deleted file mode 100644 index 874f3425bf48..000000000000 --- a/autodoc/inc/ary/doc/ht/dht_interpreter.hxx +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ARY_DHT_INTERPRETER_HXX -#define ARY_DHT_INTERPRETER_HXX - - - - -namespace ary -{ -namespace doc -{ -namespace ht -{ - class Processor; - - -/** Interface for all interpreters of a ->Component. -*/ -class Interpreter -{ - public: - virtual ~Interpreter() {} - - void Accept( - Processor & io_processor, - const String & i_data ) const; - private: - virtual void do_Accept( - Processor & io_processor, - const String & i_data ) const = 0; -}; - - - - -// IMPLEMENTATION -inline void -Interpreter::Accept( Processor & io_processor, - const String & i_data ) const -{ - do_Accept(io_processor, i_data); -} - - - - -} // namespace ht -} // namespace doc -} // namespace ary -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/inc/ary/udmhost.hxx b/autodoc/inc/ary/udmhost.hxx deleted file mode 100644 index 13d8c2377d82..000000000000 --- a/autodoc/inc/ary/udmhost.hxx +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ARY_UDMHOST_HXX -#define ARY_UDMHOST_HXX -// KORR_DEPRECATED_3.0 - - - -// USED SERVICES - // BASE CLASSES -#include <ary/host.hxx> - // COMPONENTS - // PARAMETERS - -namespace ary -{ - - - -class UdmHost : public Host -{ - public: - enum E_ClassId { class_id = 1000 }; - - UdmHost(); - virtual ~UdmHost(); - - private: - virtual Host_ClassId - inq_ClassId() const; -}; - - - - -} // namespace ary -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/inc/autodoc/dsp_txt_flist.hxx b/autodoc/inc/autodoc/dsp_txt_flist.hxx deleted file mode 100644 index 1b655bd939aa..000000000000 --- a/autodoc/inc/autodoc/dsp_txt_flist.hxx +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef AUTODOC_DSP_TXT_FLIST_HXX -#define AUTODOC_DSP_TXT_FLIST_HXX - -#include <iostream> - - -namespace ary -{ - namespace cpp - { - class DisplayGate; - } -} - - -namespace autodoc -{ - -class TextDisplay_FunctionList_Ifc -{ - public: - virtual ~TextDisplay_FunctionList_Ifc() {} - - /** Displays the names of all C++ functions and methods within the - given namespace (or the global namespace as default). All - subnamespaces are included. - */ - virtual void Run( - ostream & o_rStream, - const ary::cpp::DisplayGate & - i_rAryGate ) = 0; /// If i_pNamespace == 0, the global namespace is displayed. -}; - - -} // namespace autodoc - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/ary/inc/cross_refs.hxx b/autodoc/source/ary/inc/cross_refs.hxx deleted file mode 100644 index d07a629a4797..000000000000 --- a/autodoc/source/ary/inc/cross_refs.hxx +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ARY_CROSS_REFS_HXX -#define ARY_CROSS_REFS_HXX - - - -// USED SERVICES - // BASE CLASSES - // COMPONENTS - // PARAMETERS -#include "sorted_idset.hxx" - - -template <class VALUE_LIST, class TYPES> -class CrossReferences -{ - public: - typedef TYPES::element_type element; - - /// Checks for double occurrences - void Add( - VALUE_LIST::index_type - i_nPosition - const element & i_rElem ); - void Get_List( - Dyn_StdConstIterator<element> & - o_rResult ) const; - private: - SortedIdSet<TYPES> aData[VALUE_LIST::max]; -}; - - - -namespace ary -{ - -template <class TYPES> -class SortedIdSet -{ - public: - typedef typename TYPES::element_type element; - typedef typename TYPES::sort_type sorter; - typedef typename TYPES::find_type finder; - - SortedIdSet( - const finder & i_rFinder ) - : aSorter(i_rFinder), - aData(aSorter) {} - ~SortedIdSet() {} - - void Get_Begin( - Dyn_StdConstIterator<element> & - o_rResult ) - { o_rResult = new SCI_Set<FINDER>(aData); } - void Add( - const element & i_rElement ) - { aData.insert(i_rElement); } - - private: - typedef std::set<element, sorter> Set; - - // DATA - sorter aSorter; - Set aData; -}; - - -} // namespace ary - - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/ary/inc/sorted_idset.hxx b/autodoc/source/ary/inc/sorted_idset.hxx deleted file mode 100644 index 4113bfb3f47d..000000000000 --- a/autodoc/source/ary/inc/sorted_idset.hxx +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ARY_SORTED_IDSET_HXX -#define ARY_SORTED_IDSET_HXX - - - -// USED SERVICES - // BASE CLASSES - // COMPONENTS -#include <set> - // PARAMETERS -#include "csi_impl.hxx" - - -template <class XY> class SortedIdSet; - -class Interface_2s -{ - public: - /// Checks for double occurrences - void Add_ExportingService( - Ce_id i_nId ); - void Get_ExportingServices( - Dyn_StdConstIterator<Ce_id> & - o_rResult ) const; - private: - Dyn<SortedIdSet> pExportingServices; -}; - - - -namespace ary -{ - -template <class TYPES> -class SortedIdSet -{ - public: - typedef typename TYPES::element_type element; - typedef typename TYPES::sort_type sorter; - typedef typename TYPES::find_type finder; - - SortedIdSet( - const finder & i_rFinder ) - : aSorter(i_rFinder), - aData(aSorter) {} - ~SortedIdSet() {} - - void Get_Begin( - Dyn_StdConstIterator<element> & - o_rResult ) - { o_rResult = new SCI_Set<FINDER>(aData); } - void Add( - const element & i_rElement ) - { aData.insert(i_rElement); } - - private: - typedef std::set<element, sorter> Set; - - // DATA - sorter aSorter; - Set aData; -}; - - -} // namespace ary - - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/ary/inc/traits_impl.hxx b/autodoc/source/ary/inc/traits_impl.hxx deleted file mode 100644 index b7ac789e486b..000000000000 --- a/autodoc/source/ary/inc/traits_impl.hxx +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ARY_TRAITS_IMPL_HXX -#define ARY_TRAITS_IMPL_HXX - - -// USED SERVICES -#include <ary/getncast.hxx> - - -namespace ary -{ -namespace traits -{ - - -/** Finds the node assigned to an entity, if that entity has a specific - actual type. - - @tpl NODE - The assumed actual type of io_node. -*/ -template<class NODE> -const typename NODE::node_t * - NodeOf( - const typename NODE::traits_t::entity_base_type & - io_node ); - -/** Finds the node assigned to an entity, if that entity has a specific - actual type. - - @tpl NODE - The assumed actual type of io_node. -*/ -template<class NODE> -typename NODE::node_t * - NodeOf( - typename NODE::traits_t::entity_base_type & - io_node ); - -/** Finds a child to a node. -*/ -template<class NODE, class KEY> -typename NODE::traits_t::id_type - Search_Child( - const typename NODE::traits_t::entity_base_type & - i_node, - const KEY & i_localKey ); - - - - -// IMPLEMENTATION - -template<class NODE> -const typename NODE::node_t * -NodeOf(const typename NODE::traits_t::entity_base_type & io_node) -{ - const NODE * - pn = ary_cast<NODE>(&io_node); - if (pn != 0) - return & pn->AsNode(); - return 0; -} - -template<class NODE> -typename NODE::node_t * -NodeOf(typename NODE::traits_t::entity_base_type & io_node) -{ - NODE * - pn = ary_cast<NODE>(&io_node); - if (pn != 0) - return & pn->AsNode(); - return 0; -} - -template<class NODE, class KEY> -typename NODE::traits_t::id_type -Search_Child( const typename NODE::traits_t::entity_base_type & i_node, - const KEY & i_localKey ) -{ - const NODE * - pn = ary_cast<NODE>(&i_node); - if (pn != 0) - return pn->Search_Child(i_localKey); - return typename NODE::traits_t::id_type(0); -} - - - - -} // namespace traits -} // namespace ary -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/inc/manip.hxx b/autodoc/source/inc/manip.hxx deleted file mode 100644 index cd07815d3fd9..000000000000 --- a/autodoc/source/inc/manip.hxx +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ARY_MANIP_HXX -#define ARY_MANIP_HXX - -template <class XY > -class Manipulator -{ - public: - virtual ~Manipulator() {} - - void operator()( - XY & io_r ) const - { op_fcall(io_r); } - private: - virtual void op_fcall( - XY & io_r ) const = 0; -}; - -template <class XY > -class Const_Manipulator -{ - public: - virtual ~Const_Manipulator() {} - - void operator()( - const XY & io_r ) const - { op_fcall(io_r); } - private: - virtual void op_fcall( - const XY & io_r ) const = 0; -}; - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser_i/inc/s2_luidl/pe_modul.hxx b/autodoc/source/parser_i/inc/s2_luidl/pe_modul.hxx deleted file mode 100644 index 1c75d25203d1..000000000000 --- a/autodoc/source/parser_i/inc/s2_luidl/pe_modul.hxx +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef LUIDL_PE_MODUL_HXX -#define LUIDL_PE_MODUL_HXX - - - -// USED SERVICES - // BASE CLASSES -#include <semantic/semnode.hxx> - // COMPONENTS - // PARAMETERS - - -namespace csi -{ -namespace uidl -{ - - - -class PE_Module : public ::ParseEnvironment -{ - public: - - virtual void Enter( - E_EnvStackAction i_eWayOfEntering ); - virtual void Leave( - E_EnvStackAction i_eWayOfLeaving ); - - private: -}; - - -} // namespace uidl -} // namespace csi - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/autodoc/source/parser_i/inc/s2_luidl/smp_uidl.hxx b/autodoc/source/parser_i/inc/s2_luidl/smp_uidl.hxx deleted file mode 100644 index c29f7297c181..000000000000 --- a/autodoc/source/parser_i/inc/s2_luidl/smp_uidl.hxx +++ /dev/null @@ -1,84 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef ADC_SMP_HXX -#define ADC_SMP_HXX - - - -// USED SERVICES - // BASE CLASSES -#include <s2_luidl/tok_recv.hxx> -#include <s2_dsapi/tok_recv.hxx> - // COMPONENTS - // PARAMETERS - -namespace csi -{ -namespace uidl -{ - - - -/** is an implementation class for ParseEnvironment -*/ -class SemanticParser : public csi::uidl::Token_Receiver, - public csi::dsapi::Token_Receiver -{ - public: - typedef std::deque< DYN TextToken * > TokenQueue; - - ~SemanticParser(); - - - void Receive( - DYN csi::uidl::Token & - let_drToken ); - void Receive( - DYN csi::dsapi::Token & - let_drToken ); - - private: - // DATA - TokenQueue aTokenQueue; - - -}; - - - -// IMPLEMENTATION - - -} // namespace uidl -} // namespace csi - -#endif - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/automation/source/server/XMLParser.cxx b/automation/source/server/XMLParser.cxx index 55214414127b..7768775bba44 100644 --- a/automation/source/server/XMLParser.cxx +++ b/automation/source/server/XMLParser.cxx @@ -277,11 +277,11 @@ sal_Bool SAXParser::Parse( ParseAction aAct ) { xParser->parseStream ( sSource ); } - catch( class SAXParseException & rPEx) + catch( class SAXParseException & ) { // TODO } - catch( class Exception & rEx) + catch( class Exception & ) { // TODO } diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index dd1ceab1f53c..6659f663da5c 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -128,12 +128,6 @@ DBG_CTOR(ControlItem,0); pData->aUId = aUIdP; } -ControlItem::ControlItem( ControlData *pDataP ) -{ -DBG_CTOR(ControlItem,0); - pData = pDataP; -} - ControlSon::~ControlSon() { if (pSons) diff --git a/automation/source/testtool/objtest.hxx b/automation/source/testtool/objtest.hxx index f4aa1b0cbb4c..afcb6b963b6d 100644 --- a/automation/source/testtool/objtest.hxx +++ b/automation/source/testtool/objtest.hxx @@ -120,7 +120,6 @@ public: ControlItem( const char *Name, rtl::OString aUIdP ); ControlItem( const String &Name, rtl::OString aUIdP ); - ControlItem( ControlData *pDataP ); virtual ~ControlItem() { DBG_DTOR(ControlItem,0); delete pData; diff --git a/basctl/source/basicide/bastype4.hxx b/basctl/source/basicide/bastype4.hxx deleted file mode 100644 index 000eec70755e..000000000000 --- a/basctl/source/basicide/bastype4.hxx +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _BASTYPE4_HXX -#define _BASTYPE4_HXX - - -#include <svtools/tabbar.hxx> - -class EditEngine; -class EditView; - -class ExtendedTabBar : public TabBar -{ - EditEngine* pEditEngine; - EditView* pEditView; - sal_Bool bIsInKeyInput; -#if _SOLAR__PRIVATE - void ImpCheckEditEngine( sal_Bool bKeepNewText ); -#endif -protected: - virtual void MouseButtonDown( const MouseEvent& rMEvt ); - virtual void MouseButtonUp( const MouseEvent& rMEvt ); - virtual void MouseMove( const MouseEvent& rMEvt ); - virtual void LoseFocus(); - virtual void KeyInput( const KeyEvent& rKEvent ); - virtual void Paint( const Rectangle& ); - - virtual sal_Bool StartRenamingTab( sal_uInt16 nCurId ); - virtual sal_Bool AllowRenamingTab( sal_uInt16 nCurId, const String& rNewName ); - virtual void TabRenamed( sal_uInt16 nCurId, const String& rNewName ); - -public: - ExtendedTabBar( Window* pParent, WinBits nStyle ); - ~ExtendedTabBar(); - - void RenameSelectedTab(); - sal_Bool IsInEditMode() const { return pEditEngine ? sal_True : sal_False; } - void StopEditMode( sal_Bool bKeepCurText = sal_False ); -}; - -#endif //_BASTYPE4_HXX - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx index a121a774615c..42f75c330042 100644 --- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx @@ -143,6 +143,7 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const catch( beans::UnknownPropertyException &ex ) { delete pItem; + (void)ex; OSL_FAIL( ::rtl::OUStringToOString( ex.Message + @@ -152,6 +153,7 @@ void ItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const } catch( uno::Exception &ex ) { + (void)ex; ASSERT_EXCEPTION( ex ); } } @@ -214,6 +216,7 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) } catch( beans::UnknownPropertyException &ex ) { + (void)ex; OSL_FAIL( ::rtl::OUStringToOString( ex.Message + @@ -223,6 +226,7 @@ bool ItemConverter::ApplyItemSet( const SfxItemSet & rItemSet ) } catch( uno::Exception &ex ) { + (void)ex; OSL_FAIL( ::rtl::OUStringToOString( ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr()); } diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx index 8e54505ab342..328b341ed08c 100644 --- a/chart2/source/controller/main/SelectionHelper.cxx +++ b/chart2/source/controller/main/SelectionHelper.cxx @@ -329,7 +329,6 @@ bool Selection::isResizeableObjectSelected() default: return false; } - return false; } bool Selection::isRotateableObjectSelected( const uno::Reference< frame::XModel >& xChartModel ) diff --git a/cli_ure/inc/pch/precompiled_cli_ure.cxx b/cli_ure/inc/pch/precompiled_cli_ure.cxx deleted file mode 100644 index e11d2045be2d..000000000000 --- a/cli_ure/inc/pch/precompiled_cli_ure.cxx +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "precompiled_cli_ure.hxx" - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cli_ure/inc/pch/precompiled_cli_ure.hxx b/cli_ure/inc/pch/precompiled_cli_ure.hxx deleted file mode 100644 index 59c8eb0fd6a9..000000000000 --- a/cli_ure/inc/pch/precompiled_cli_ure.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:33.514782 - -#ifdef PRECOMPILED_HEADERS -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cli_ure/source/climaker/climaker_app.cxx b/cli_ure/source/climaker/climaker_app.cxx index 3d34498c0f2f..b7f5db1de782 100644 --- a/cli_ure/source/climaker/climaker_app.cxx +++ b/cli_ure/source/climaker/climaker_app.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cli_ure.hxx" - #include <stdio.h> #include <vector> #include <memory> diff --git a/cli_ure/source/climaker/climaker_emit.cxx b/cli_ure/source/climaker/climaker_emit.cxx index 5415d8f3342b..d7d20e405f9b 100644 --- a/cli_ure/source/climaker/climaker_emit.cxx +++ b/cli_ure/source/climaker/climaker_emit.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cli_ure.hxx" - #include "climaker_share.h" #include "rtl/string.hxx" diff --git a/cli_ure/source/native/assembly.cxx b/cli_ure/source/native/assembly.cxx index 5efc4af891fc..e15bd8c245a0 100644 --- a/cli_ure/source/native/assembly.cxx +++ b/cli_ure/source/native/assembly.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cli_ure.hxx" #using <mscorlib.dll> [assembly:System::Reflection::AssemblyProduct( "CLI-UNO Language Binding" )]; diff --git a/cli_ure/source/uno_bridge/cli_bridge.cxx b/cli_ure/source/uno_bridge/cli_bridge.cxx index 6f6f16978864..dd3f03ef8e26 100644 --- a/cli_ure/source/uno_bridge/cli_bridge.cxx +++ b/cli_ure/source/uno_bridge/cli_bridge.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cli_ure.hxx" - #include <vcclr.h> //ToDo: remove when build with .NET 2 #pragma warning(push, 1) diff --git a/cli_ure/source/uno_bridge/cli_data.cxx b/cli_ure/source/uno_bridge/cli_data.cxx index 30dce98d5332..a8a7efabc391 100644 --- a/cli_ure/source/uno_bridge/cli_data.cxx +++ b/cli_ure/source/uno_bridge/cli_data.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cli_ure.hxx" - #pragma warning(push, 1) #include "windows.h" #pragma warning(pop) diff --git a/cli_ure/source/uno_bridge/cli_environment.cxx b/cli_ure/source/uno_bridge/cli_environment.cxx index 213cfc9ae5dd..87f7286635cd 100644 --- a/cli_ure/source/uno_bridge/cli_environment.cxx +++ b/cli_ure/source/uno_bridge/cli_environment.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cli_ure.hxx" - #include "Cli_environment.h" #using <mscorlib.dll> diff --git a/cli_ure/source/uno_bridge/cli_proxy.cxx b/cli_ure/source/uno_bridge/cli_proxy.cxx index eedd20d5df5f..9be5afe2e7da 100644 --- a/cli_ure/source/uno_bridge/cli_proxy.cxx +++ b/cli_ure/source/uno_bridge/cli_proxy.cxx @@ -26,8 +26,6 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cli_ure.hxx" #include "typelib/typedescription.h" #include "rtl/ustrbuf.hxx" #include "com/sun/star/uno/RuntimeException.hpp" diff --git a/cli_ure/source/uno_bridge/cli_uno.cxx b/cli_ure/source/uno_bridge/cli_uno.cxx index 3e5b709bd313..a40065cb53c9 100644 --- a/cli_ure/source/uno_bridge/cli_uno.cxx +++ b/cli_ure/source/uno_bridge/cli_uno.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_cli_ure.hxx" - #include <sal/alloca.h> #include "rtl/ustrbuf.hxx" #include "cli_base.h" diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 5b87cc095483..e1a524feb410 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -125,6 +125,10 @@ void CppuType::addGetCppuTypeIncludes(codemaker::cppumaker::Includes & includes) } } +void CppuType::dumpDeclaration(FileStream &) throw (CannotDumpException) { + OSL_ASSERT(false); +} + bool CppuType::dumpFiles(CppuOptions * options, rtl::OString const & outPath) { return dumpFile(options, ".hdl", m_typeName, outPath) && dumpFile(options, ".hpp", m_typeName, outPath); @@ -433,6 +437,42 @@ void CppuType::dumpInitializer( out << ")"; } +void CppuType::dumpHFileContent( + FileStream & out, codemaker::cppumaker::Includes & includes) +{ + addDefaultHIncludes(includes); + dumpHeaderDefine(out, "HDL"); + out << "\n"; + includes.dump(out, 0); + out << ("\nnamespace com { namespace sun { namespace star { namespace uno" + " { class Type; } } } }\n\n"); + if (codemaker::cppumaker::dumpNamespaceOpen(out, m_typeName, false)) { + out << "\n"; + } + dumpDeclaration(out); + if (!(m_typeName.equalsL( + RTL_CONSTASCII_STRINGPARAM("com/sun/star/uno/XInterface")) || + m_typeName.equalsL( + RTL_CONSTASCII_STRINGPARAM("com/sun/star/uno/Exception")) || + isPolymorphic())) + { + out << "\n" << indent() + << ("inline ::com::sun::star::uno::Type const &" + " cppu_detail_getUnoType("); + dumpType(out, m_typeName, false, false, true); + out << " const *);\n"; + } + if (codemaker::cppumaker::dumpNamespaceClose(out, m_typeName, false)) { + out << "\n"; + } + out << "\n"; + dumpTemplateHead(out); + out << "inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType("; + dumpType(out, m_typeName, true); + dumpTemplateParameters(out); + out << " *) SAL_THROW(());\n\n#endif\n"; +} + void CppuType::dumpGetCppuType(FileStream & out) { if (m_typeName.equals("com/sun/star/uno/XInterface")) { out << indent() @@ -1268,34 +1308,14 @@ sal_Bool InterfaceType::dumpHFile( FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ) { - OString headerDefine(dumpHeaderDefine(o, "HDL")); - o << "\n"; - - addDefaultHIncludes(includes); if (m_reader.getMethodCount() != 0) { includes.add("com/sun/star/uno/RuntimeException"); } - includes.dump(o, 0); - o << ("\nnamespace com { namespace sun { namespace star { namespace uno {\n" - "class Type;\n} } } }\n\n"); - - if (codemaker::cppumaker::dumpNamespaceOpen(o, m_typeName, false)) { - o << "\n"; - } - dumpDeclaration(o); - if (codemaker::cppumaker::dumpNamespaceClose(o, m_typeName, false)) { - o << "\n"; - } - - o << "\ninline const ::com::sun::star::uno::Type& SAL_CALL getCppuType( "; - dumpType(o, m_typeName, sal_True, sal_False); - o << "* ) SAL_THROW( () );\n\n"; - - o << "#endif // "<< headerDefine << "\n"; + dumpHFileContent(o, includes); return sal_True; } -sal_Bool InterfaceType::dumpDeclaration(FileStream& o) +void InterfaceType::dumpDeclaration(FileStream& o) throw( CannotDumpException ) { // rtl::OString cppName(translateUnoToCppIdentifier( @@ -1323,8 +1343,6 @@ sal_Bool InterfaceType::dumpDeclaration(FileStream& o) dec(); o << "};\n\n"; - - return sal_True; } sal_Bool InterfaceType::dumpHxxFile( @@ -2283,7 +2301,7 @@ sal_Bool ConstantsType::dumpHFile( return sal_True; } -sal_Bool ConstantsType::dumpDeclaration(FileStream& o) +void ConstantsType::dumpDeclaration(FileStream& o) throw( CannotDumpException ) { sal_uInt16 fieldCount = m_reader.getFieldCount(); @@ -2302,8 +2320,6 @@ sal_Bool ConstantsType::dumpDeclaration(FileStream& o) dumpConstantValue(o, i); o << ";\n"; } - - return sal_True; } sal_Bool ConstantsType::hasConstants() @@ -2395,38 +2411,11 @@ sal_Bool StructureType::dumpHFile( FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ) { - OString headerDefine(dumpHeaderDefine(o, "HDL")); - o << "\n"; - - addDefaultHIncludes(includes); - includes.dump(o, 0); - o << "\n"; - - if (codemaker::cppumaker::dumpNamespaceOpen(o, m_typeName, false)) { - o << "\n"; - } - - dumpDeclaration(o); - - if (codemaker::cppumaker::dumpNamespaceClose(o, m_typeName, false)) { - o << "\n"; - } - - o << "\nnamespace com { namespace sun { namespace star { namespace uno {\n" - << "class Type;\n} } } }\n\n"; - - dumpTemplateHead(o); - o << "inline const ::com::sun::star::uno::Type& SAL_CALL getCppuType( "; - dumpType(o, m_typeName, sal_True, sal_False); - dumpTemplateParameters(o); - o << "* );\n\n"; - - o << "#endif // "<< headerDefine << "\n"; - + dumpHFileContent(o, includes); return sal_True; } -sal_Bool StructureType::dumpDeclaration(FileStream& o) +void StructureType::dumpDeclaration(FileStream& o) throw( CannotDumpException ) { o << "\n#ifdef SAL_W32\n" @@ -2508,8 +2497,6 @@ sal_Bool StructureType::dumpDeclaration(FileStream& o) o << "#ifdef SAL_W32\n" << "# pragma pack(pop)\n" << "#endif\n\n"; - - return sal_True; } sal_Bool StructureType::dumpHxxFile( @@ -3177,36 +3164,11 @@ sal_Bool ExceptionType::dumpHFile( FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ) { - OString headerDefine(dumpHeaderDefine(o, "HDL")); - o << "\n"; - - addDefaultHIncludes(includes); - includes.dump(o, 0); - o << "\n"; - - if (codemaker::cppumaker::dumpNamespaceOpen(o, m_typeName, false)) { - o << "\n"; - } - - dumpDeclaration(o); - - if (codemaker::cppumaker::dumpNamespaceClose(o, m_typeName, false)) { - o << "\n"; - } - - o << "\nnamespace com { namespace sun { namespace star { namespace uno {\n" - << "class Type;\n} } } }\n\n"; - - o << "inline const ::com::sun::star::uno::Type& SAL_CALL getCppuType( "; - dumpType(o, m_typeName, sal_True, sal_False); - o << "* ) SAL_THROW( () );\n\n"; - - o << "#endif // "<< headerDefine << "\n"; - + dumpHFileContent(o, includes); return sal_True; } -sal_Bool ExceptionType::dumpDeclaration(FileStream& o) +void ExceptionType::dumpDeclaration(FileStream& o) throw( CannotDumpException ) { o << "\nclass CPPU_GCC_DLLPUBLIC_EXPORT " << m_name; @@ -3291,8 +3253,6 @@ sal_Bool ExceptionType::dumpDeclaration(FileStream& o) dec(); o << "};\n\n"; - - return sal_True; } sal_Bool ExceptionType::dumpHxxFile( @@ -3558,36 +3518,11 @@ sal_Bool EnumType::dumpHFile( FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ) { - OString headerDefine(dumpHeaderDefine(o, "HDL")); - o << "\n"; - - addDefaultHIncludes(includes); - includes.dump(o, 0); - o << "\n"; - - if (codemaker::cppumaker::dumpNamespaceOpen(o, m_typeName, false)) { - o << "\n"; - } - - dumpDeclaration(o); - - if (codemaker::cppumaker::dumpNamespaceClose(o, m_typeName, false)) { - o << "\n"; - } - - o << "\nnamespace com { namespace sun { namespace star { namespace uno {\n" - << "class Type;\n} } } }\n\n"; - - o << "inline const ::com::sun::star::uno::Type& SAL_CALL getCppuType( "; - dumpType(o, m_typeName, sal_True, sal_False); - o << "* ) SAL_THROW( () );\n\n"; - - o << "#endif // "<< headerDefine << "\n"; - + dumpHFileContent(o, includes); return sal_True; } -sal_Bool EnumType::dumpDeclaration(FileStream& o) +void EnumType::dumpDeclaration(FileStream& o) throw( CannotDumpException ) { o << "\nenum " << m_name << "\n{\n"; @@ -3621,8 +3556,6 @@ sal_Bool EnumType::dumpDeclaration(FileStream& o) dec(); o << "};\n\n"; - - return sal_True; } sal_Bool EnumType::dumpHxxFile( @@ -3800,7 +3733,7 @@ sal_Bool TypeDefType::dumpHFile( return sal_True; } -sal_Bool TypeDefType::dumpDeclaration(FileStream& o) +void TypeDefType::dumpDeclaration(FileStream& o) throw( CannotDumpException ) { o << "\ntypedef "; @@ -3809,8 +3742,6 @@ sal_Bool TypeDefType::dumpDeclaration(FileStream& o) rtl::OUStringToOString( m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8)); o << " " << m_name << ";\n\n"; - - return sal_True; } sal_Bool TypeDefType::dumpHxxFile( diff --git a/codemaker/source/cppumaker/cpputype.hxx b/codemaker/source/cppumaker/cpputype.hxx index 2823e9c30159..c33a0f06e860 100644 --- a/codemaker/source/cppumaker/cpputype.hxx +++ b/codemaker/source/cppumaker/cpputype.hxx @@ -110,6 +110,8 @@ protected: codemaker::cpp::IdentifierTranslationMode isGlobal() const; + virtual void dumpDeclaration(FileStream & out) throw (CannotDumpException); + virtual void addSpecialDependencies() {} virtual bool dumpFiles(CppuOptions * options, rtl::OString const & outPath); @@ -139,6 +141,9 @@ protected: void dumpInitializer( FileStream & out, bool parameterized, rtl::OUString const & type) const; + void dumpHFileContent( + FileStream & out, codemaker::cppumaker::Includes & includes); + protected: sal_uInt32 m_inheritedMemberCount; @@ -165,7 +170,7 @@ public: virtual ~InterfaceType(); - sal_Bool dumpDeclaration(FileStream& o) throw( CannotDumpException ); + virtual void dumpDeclaration(FileStream& o) throw( CannotDumpException ); sal_Bool dumpHFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); sal_Bool dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); @@ -227,7 +232,7 @@ public: virtual sal_Bool dump(CppuOptions* pOptions) throw( CannotDumpException ); - sal_Bool dumpDeclaration(FileStream& o) throw( CannotDumpException ); + virtual void dumpDeclaration(FileStream& o) throw( CannotDumpException ); sal_Bool dumpHFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); sal_Bool dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); sal_Bool hasConstants(); @@ -255,7 +260,7 @@ public: virtual ~StructureType(); - sal_Bool dumpDeclaration(FileStream& o) throw( CannotDumpException ); + virtual void dumpDeclaration(FileStream& o) throw( CannotDumpException ); sal_Bool dumpHFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); sal_Bool dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); @@ -293,7 +298,7 @@ public: virtual ~ExceptionType(); - sal_Bool dumpDeclaration(FileStream& o) throw( CannotDumpException ); + virtual void dumpDeclaration(FileStream& o) throw( CannotDumpException ); sal_Bool dumpHFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); sal_Bool dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); @@ -309,7 +314,7 @@ public: virtual ~EnumType(); - sal_Bool dumpDeclaration(FileStream& o) throw( CannotDumpException ); + virtual void dumpDeclaration(FileStream& o) throw( CannotDumpException ); sal_Bool dumpHFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); sal_Bool dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); @@ -326,7 +331,7 @@ public: virtual ~TypeDefType(); - sal_Bool dumpDeclaration(FileStream& o) throw( CannotDumpException ); + virtual void dumpDeclaration(FileStream& o) throw( CannotDumpException ); sal_Bool dumpHFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); sal_Bool dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) throw( CannotDumpException ); }; diff --git a/comphelper/inc/comphelper/embeddedobjectcontainer.hxx b/comphelper/inc/comphelper/embeddedobjectcontainer.hxx index 7983dec4b662..8d1aab98ed24 100644 --- a/comphelper/inc/comphelper/embeddedobjectcontainer.hxx +++ b/comphelper/inc/comphelper/embeddedobjectcontainer.hxx @@ -124,9 +124,6 @@ public: ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > InsertEmbeddedObject( const ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream >&, ::rtl::OUString& ); - // copy an embedded object into the storage - sal_Bool CopyEmbeddedObject( EmbeddedObjectContainer& rSrc, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >&, ::rtl::OUString& ); - // copy an embedded object into the storage, open the new copy and return it ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject > CopyAndGetEmbeddedObject( EmbeddedObjectContainer& rSrc, const ::com::sun::star::uno::Reference < ::com::sun::star::embed::XEmbeddedObject >& xObj, /* TODO const ::rtl::OUString& aOrigName,*/ ::rtl::OUString& rName ); diff --git a/comphelper/inc/comphelper/mimeconfighelper.hxx b/comphelper/inc/comphelper/mimeconfighelper.hxx index 992f367d67df..c8eeed153015 100644 --- a/comphelper/inc/comphelper/mimeconfighelper.hxx +++ b/comphelper/inc/comphelper/mimeconfighelper.hxx @@ -138,9 +138,6 @@ public: static ::com::sun::star::uno::Sequence< sal_Int8 > GetSequenceClassID( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3, sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11, sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 ); - - ::com::sun::star::uno::Sequence<sal_Int8> GetSequenceClassIDFromObjectName(const ::rtl::OUString& _sObjectName) ; - }; } diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 9f84b7afa053..8842205a42dd 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -711,30 +711,6 @@ sal_Bool EmbeddedObjectContainer::TryToCopyGraphReplacement( EmbeddedObjectConta return bResult; } -sal_Bool EmbeddedObjectContainer::CopyEmbeddedObject( EmbeddedObjectContainer& rSrc, const uno::Reference < embed::XEmbeddedObject >& xObj, ::rtl::OUString& rName ) -{ - RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::CopyEmbeddedObject" ); - - OSL_FAIL( "This method is depricated! Use EmbeddedObjectContainer::CopyAndGetEmbeddedObject() to copy object!\n" ); - - // get the object name before(!) it is assigned to a new storage - ::rtl::OUString aOrigName; - uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY ); - if ( xPersist.is() ) - aOrigName = xPersist->getEntryName(); - - if ( !rName.getLength() ) - rName = CreateUniqueObjectName(); - - if ( StoreEmbeddedObject( xObj, rName, sal_True ) ) - { - TryToCopyGraphReplacement( rSrc, aOrigName, rName ); - return sal_True; - } - - return sal_False; -} - uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmbeddedObject( EmbeddedObjectContainer& rSrc, const uno::Reference < embed::XEmbeddedObject >& xObj, ::rtl::OUString& rName ) { RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::CopyAndGetEmbeddedObject" ); diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx index c81e761392b9..dfa66e839bd9 100644 --- a/comphelper/source/misc/mimeconfighelper.cxx +++ b/comphelper/source/misc/mimeconfighelper.cxx @@ -925,19 +925,4 @@ uno::Sequence< sal_Int8 > MimeConfigurationHelper::GetSequenceClassID( sal_uInt3 return aResult; } -//------------------------------------------------------------------------- -uno::Sequence<sal_Int8> MimeConfigurationHelper::GetSequenceClassIDFromObjectName(const ::rtl::OUString& _sObjectName) -{ - uno::Sequence<sal_Int8> aClassId; - uno::Reference< container::XNameAccess > xObjectNames = GetConfigurationByPath(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Embedding/ObjectNames"))); - uno::Reference< container::XNameAccess > xProps; - if ( xObjectNames.is() && (xObjectNames->getByName(_sObjectName) >>= xProps) && xProps.is() ) - { - ::rtl::OUString sValue; - xProps->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ClassID"))) >>= sValue; - aClassId = GetSequenceClassIDRepresentation(sValue); - } - return aClassId; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 3724b16075f0..456bdfc27d1a 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -304,12 +304,12 @@ bool Components::hasModifications() const void Components::writeModifications() { - if (!hasModifications()) + if (!hasModifications() || modificationFileUrl_.isEmpty()) return; if (!writeThread_.is()) { writeThread_ = new WriteThread( - &writeThread_, *this, getModificationFileUrl(), data_); + &writeThread_, *this, modificationFileUrl_, data_); writeThread_->create(); } } @@ -329,8 +329,9 @@ void Components::flushModifications() { void Components::insertExtensionXcsFile( bool shared, rtl::OUString const & fileUri) { + int layer = getExtensionLayer(shared); try { - parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0, 0); + parseXcsFile(fileUri, layer, data_, 0, 0, 0); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -345,7 +346,7 @@ void Components::insertExtensionXcuFile( bool shared, rtl::OUString const & fileUri, Modifications * modifications) { OSL_ASSERT(modifications != 0); - int layer = shared ? 10 : 14; + int layer = getExtensionLayer(shared) + 1; Additions * adds = data_.addExtensionXcuAdditions(fileUri, layer); try { parseXcuFile(fileUri, layer, data_, 0, modifications, adds); @@ -506,96 +507,108 @@ css::beans::Optional< css::uno::Any > Components::getExternalValue( Components::Components( css::uno::Reference< css::uno::XComponentContext > const & context): - context_(context) + context_(context), sharedExtensionLayer_(-1), userExtensionLayer_(-1) { - lock_ = lock(); - OSL_ASSERT(context.is()); - - // Check if we are being used for in-tree unit tests ... - rtl::OUString aUnitTestDir; - if (rtl::Bootstrap::get( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("OOO_CONFIG_REGISTRY_DIR") ), aUnitTestDir)) - { - parseXcsXcuLayer( 0, aUnitTestDir ); - // next is required for the (somewhat strange) filter configuration - parseModuleLayer( 2, aUnitTestDir + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/spool"))); - // allow a directory to be specified to allow extra configuration to be stored - // for example to place a registrymodifications.xcu to override some configuration - rtl::OUString extra; - if (rtl::Bootstrap::get( + lock_ = lock(); + rtl::OUString conf( + expand( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("${CONFIGURATION_LAYERS}")))); + RTL_LOGFILE_TRACE("configmgr : begin parsing"); + int layer = 0; + for (sal_Int32 i = 0;;) { + while (i != conf.getLength() && conf[i] == ' ') { + ++i; + } + if (i == conf.getLength()) { + break; + } + if (!modificationFileUrl_.isEmpty()) { + throw css::uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "OOO_CONFIG_REGISTRY_EXTRA_DIR")), - extra)) + "CONFIGURATION_LAYERS: \"user\" followed by further" + " layers")), + css::uno::Reference< css::uno::XInterface >()); + } + sal_Int32 c = i; + for (;; ++c) { + if (c == conf.getLength() || conf[c] == ' ') { + throw css::uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "CONFIGURATION_LAYERS: missing \":\"")), + css::uno::Reference< css::uno::XInterface >()); + } + if (conf[c] == ':') { + break; + } + } + sal_Int32 n = conf.indexOf(' ', c + 1); + if (n == -1) { + n = conf.getLength(); + } + rtl::OUString type(conf.copy(i, c - i)); + rtl::OUString url(expand(conf.copy(c + 1, n - c - 1))); + if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("xcsxcu"))) { + parseXcsXcuLayer(layer, url); + layer += 2; //TODO: overflow + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("bundledext"))) { - parseXcsXcuLayer(3, extra); + parseXcsXcuIniLayer(layer, url, false); + layer += 2; //TODO: overflow + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sharedext"))) { + if (sharedExtensionLayer_ != -1) { + throw css::uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "CONFIGURATION_LAYERS: multiple \"sharedext\"" + " layers")), + css::uno::Reference< css::uno::XInterface >()); + } + sharedExtensionLayer_ = layer; + parseXcsXcuIniLayer(layer, url, true); + layer += 2; //TODO: overflow + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("userext"))) { + if (userExtensionLayer_ != -1) { + throw css::uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "CONFIGURATION_LAYERS: multiple \"userext\"" + " layers")), + css::uno::Reference< css::uno::XInterface >()); + } + userExtensionLayer_ = layer; + parseXcsXcuIniLayer(layer, url, true); + layer += 2; //TODO: overflow + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("module"))) { + parseModuleLayer(layer, url); + ++layer; //TODO: overflow + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("res"))) { + parseResLayer(layer, url); + ++layer; //TODO: overflow + } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("user"))) { + if (url.isEmpty()) { + throw css::uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "CONFIGURATION_LAYERS: empty \"user\" URL")), + css::uno::Reference< css::uno::XInterface >()); + } + modificationFileUrl_ = url; + parseModificationLayer(url); + } else { + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "CONFIGURATION_LAYERS: unknown layer type \"")) + + type + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\""))), + css::uno::Reference< css::uno::XInterface >()); } - return; + i = n; } - - RTL_LOGFILE_TRACE("configmgr : begin parsing"); - - parseXcsXcuLayer( - 0, - expand( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "$BRAND_BASE_DIR/share/registry")))); - parseModuleLayer( - 2, - expand( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "$BRAND_BASE_DIR/share/registry/modules")))); - parseResLayer( - 3, - expand( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "$BRAND_BASE_DIR/share/registry")))); - parseXcsXcuIniLayer( - 4, - expand( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("uno") - ":BUNDLED_EXTENSIONS_USER}/registry/" - "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/configmgr.ini"))), - false); - parseXcsXcuIniLayer( - 6, - expand( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("uno") - ":SHARED_EXTENSIONS_USER}/registry/" - "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/configmgr.ini"))), - true); - parseXcsXcuLayer( - 8, - expand( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("uno") - ":UNO_USER_PACKAGES_CACHE}/registry/" - "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/registry")))); - // can be dropped once old UserInstallation format can no longer exist - // (probably OOo 4) - parseXcsXcuIniLayer( - 10, - expand( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("uno") - ":UNO_USER_PACKAGES_CACHE}/registry/" - "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/configmgr.ini"))), - true); - parseModificationLayer(); RTL_LOGFILE_TRACE("configmgr : end parsing"); } @@ -858,19 +871,9 @@ void Components::parseResLayer(int layer, rtl::OUString const & url) { &parseXcuFile, resUrl, false); } -rtl::OUString Components::getModificationFileUrl() const { - return expand( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("bootstrap") - ":UserInstallation}/user/registrymodifications.xcu"))); -} - -void Components::parseModificationLayer() { +void Components::parseModificationLayer(rtl::OUString const & url) { try { - parseFileLeniently( - &parseXcuFile, getModificationFileUrl(), Data::NO_LAYER, data_, 0, - 0, 0); + parseFileLeniently(&parseXcuFile, url, Data::NO_LAYER, data_, 0, 0, 0); } catch (css::container::NoSuchElementException &) { OSL_TRACE( "configmgr user registrymodifications.xcu does not (yet) exist"); @@ -889,6 +892,18 @@ void Components::parseModificationLayer() { } } +int Components::getExtensionLayer(bool shared) { + int layer = shared ? sharedExtensionLayer_ : userExtensionLayer_; + if (layer == -1) { + throw css::uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "insert extension xcs/xcu file into undefined layer")), + css::uno::Reference< css::uno::XInterface >()); + } + return layer; +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx index 26af3fbdecea..bc4c5d0b9513 100644 --- a/configmgr/source/components.hxx +++ b/configmgr/source/components.hxx @@ -155,9 +155,9 @@ private: void parseResLayer(int layer, rtl::OUString const & url); - rtl::OUString getModificationFileUrl() const; + void parseModificationLayer(rtl::OUString const & url); - void parseModificationLayer(); + int getExtensionLayer(bool shared); typedef std::set< RootAccess * > WeakRootSet; @@ -176,6 +176,9 @@ private: WeakRootSet roots_; ExternalServices externalServices_; rtl::Reference< WriteThread > writeThread_; + int sharedExtensionLayer_; + int userExtensionLayer_; + rtl::OUString modificationFileUrl_; boost::shared_ptr<osl::Mutex> lock_; }; diff --git a/configure.in b/configure.in index 3b48331e43b1..b69aeb63f802 100644 --- a/configure.in +++ b/configure.in @@ -361,10 +361,10 @@ AC_ARG_ENABLE(build-mozilla, the Mozilla source code but take precompiled zips.]), ,) -AC_ARG_ENABLE(nss-module, - AS_HELP_STRING([--disable-nss-module], - [Whether to use provided NSS module.]), -,enable_nss_module=yes) +AC_ARG_ENABLE(xmlsec, + AS_HELP_STRING([--disable-xmlsec], + [Whether to enable XMLsec for open document signing.]), +) AC_ARG_ENABLE(kde, AS_HELP_STRING([--enable-kde], @@ -643,6 +643,11 @@ AC_ARG_WITH(system-cairo, [Use Cairo libraries already on system.]), ,) +AC_ARG_WITH(system-nss, + AS_HELP_STRING([--with-system-nss], + [Use NSS/nspr libraries already on system.]), +,) + AC_ARG_WITH(mozilla-version, AS_HELP_STRING([--with-mozilla-version], [Choose which version of Mozilla to use while building Mozilla. @@ -2004,14 +2009,14 @@ if test "$_os" = "Darwin" ; then ;; esac - AC_MSG_CHECKING([that macosx-verion-min-required is coherent with macosx-version-max-allowed]) + AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed]) if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED ; then AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed]) else AC_MSG_RESULT([ok]) fi - AC_MSG_CHECKING([that macosx-verion-max-allowed is coherent macos-with-sdk]) + AC_MSG_CHECKING([that macosx-version-max-allowed is coherent macos-with-sdk]) if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $macosx_sdk_value ; then AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level]) else @@ -5723,11 +5728,14 @@ else fi AC_MSG_CHECKING([whether to build XML Security support]) -if test "$enable_nss_module" = "no"; then - AC_MSG_RESULT([no, NSS disabled]) +if test "$enable_xmlsec" = "no"; then + AC_MSG_RESULT([no]) + ENABLE_XMLSEC=no else + ENABLE_XMLSEC=yes AC_MSG_RESULT([yes]) fi +AC_SUBST(ENABLE_XMLSEC) AC_MSG_CHECKING([whether to build LDAP configuration backend]) if test -z "$enable_ldap" || test "$enable_ldap" = "yes"; then @@ -5776,8 +5784,6 @@ AC_MSG_CHECKING([which Mozilla to use]) if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then AC_MSG_RESULT([external]) SYSTEM_MOZILLA=YES - ENABLE_NSS_MODULE=NO - enable_nss_module=no AC_MSG_CHECKING([which Mozilla flavour to use]) if test -n "$with_system_mozilla" && test "$with_system_mozilla" = "libxul"; then MOZ_FLAVOUR=libxul @@ -5795,22 +5801,6 @@ if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then tmp=`echo $MOZ_FLAVOUR | $PERL -e 'print ucfirst(<STDIN>);'` AC_MSG_RESULT($tmp) - PKG_CHECK_MODULES( MOZ_NSS, nss, STANDALONENSS="TRUE", STANDALONENSS="" ) - if test -z "$STANDALONENSS"; then - PKG_CHECK_MODULES( MOZ_NSS, $MOZ_FLAVOUR-nss ) - else - NSS_LIB="-L`$PKG_CONFIG --variable=libdir nss`" - AC_SUBST(NSS_LIB) - fi - - if $PKG_CONFIG --exists nspr ; then - PKG_CHECK_MODULES( MOZ_NSPR, nspr ) - NSPR_LIB="-L`$PKG_CONFIG --variable=libdir nspr`" - AC_SUBST(NSPR_LIB) - else - PKG_CHECK_MODULES( MOZ_NSPR, $MOZ_FLAVOUR-nspr ) - fi - if test "$MOZ_FLAVOUR" != "libxul"; then PKG_CHECK_MODULES( MOZILLAXPCOM, $MOZ_FLAVOUR-xpcom, HASXPCOM="TRUE", HASXPCOM="" ) MOZ_INC=`$PKG_CONFIG --variable=includedir $MOZ_FLAVOUR-xpcom` @@ -5829,19 +5819,6 @@ if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then fi fi - save_CPPFLAGS="$CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - save_LIBS="$LIBS" - CPPFLAGS="$CPPFLAGS $MOZ_NSS_CFLAGS" - LDFLAGS="$LDFLAGS $MOZ_NSS_LIBS" - AC_CHECK_LIB(nss3, PK11_GetCertFromPrivateKey, [], - [AC_MSG_ERROR(PK11_GetCertFromPrivateKey missing but needed. -See https://bugzilla.mozilla.org/show_bug.cgi?id=262274. -Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5))], []) - LDFLAGS="$save_LDFLAGS" - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" - MOZ_LIB_XPCOM=$MOZILLAXPCOM_LIBS if test "$WITH_LDAP" != "NO" && test "$WITH_OPENLDAP" != "YES"; then AC_MSG_CHECKING([whether $tmp was compiled with --enable-ldap]) @@ -6001,18 +5978,22 @@ AC_SUBST(MOZ_FLAVOUR) AC_SUBST(MOZ_INC) AC_SUBST(MOZ_LIB) AC_SUBST(MOZ_LIB_XPCOM) -AC_SUBST(MOZ_NSPR_CFLAGS) -AC_SUBST(MOZ_NSS_CFLAGS) AC_SUBST(MOZ_LDAP_CFLAGS) dnl =================================================================== -dnl Check for system NSS +dnl Check for system NSS only with xmlsec or mozilla build enabled dnl =================================================================== -AC_MSG_CHECKING([whether to build provided NSS module]) -if test "$enable_nss_module" != "no"; then - ENABLE_NSS_MODULE="YES" +if test "x$enable_xmlsec" != "xno" -o "x$enable_mozilla" = "xyes"; then +AC_MSG_CHECKING([which NSS to use]) +if test -n "$with_system_nss" -o -n "$with_system_headers" && \ + test "$with_system_nss" != "no"; then + AC_MSG_RESULT([external]) + SYSTEM_NSS="YES" + PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8) +else + SYSTEM_NSS="NO" BUILD_TYPE="$BUILD_TYPE NSS" - AC_MSG_RESULT([yes]) + AC_MSG_RESULT([internal]) if test "$build_os" = "cygwin"; then AC_MSG_CHECKING([for Mozilla build tooling]) if test -z "$MOZILLABUILD" ; then @@ -6036,11 +6017,11 @@ from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32]) fi fi fi -else - ENABLE_NSS_MODULE="NO" - AC_MSG_RESULT([no]) fi -AC_SUBST(ENABLE_NSS_MODULE) +fi +AC_SUBST(SYSTEM_NSS) +AC_SUBST(NSS_CFLAGS) +AC_SUBST(NSS_LIBS) dnl =================================================================== dnl Check for system sane @@ -6956,7 +6937,7 @@ AC_MSG_CHECKING([whether to enable GConf support]) if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then ENABLE_GCONF="TRUE" AC_MSG_RESULT([yes]) - PKG_CHECK_MODULES( GCONF, gconf-2.0 ) + PKG_CHECK_MODULES( GCONF, gconf-2.0 ORBit-2.0 ) else AC_MSG_RESULT([no]) fi @@ -6968,13 +6949,10 @@ dnl =================================================================== ENABLE_GNOMEVFS="" AC_MSG_CHECKING([whether to enable GNOME VFS support]) -if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes"; then +if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then ENABLE_GNOMEVFS="TRUE" AC_MSG_RESULT([yes]) PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 ) - if test "$ENABLE_GCONF" != "TRUE"; then - PKG_CHECK_MODULES( GCONF, gconf-2.0 ) - fi else AC_MSG_RESULT([no]) fi @@ -6988,6 +6966,8 @@ GTK_CFLAGS="" GTK_LIBS="" ENABLE_SYSTRAY_GTK="" ENABLE_DBUS="" +DBUS_CFLAGS="" +DBUS_LIBS="" if test "$test_gtk" = "yes"; then if test "$ENABLE_GTK" = "TRUE" ; then @@ -7030,6 +7010,8 @@ AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) AC_SUBST(GTHREAD_CFLAGS) AC_SUBST(GTHREAD_LIBS) +AC_SUBST(DBUS_CFLAGS) +AC_SUBST(DBUS_LIBS) PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" ) AC_SUBST(LIBPNG_LIBS) diff --git a/connectivity/inc/connectivity/sqlnode.hxx b/connectivity/inc/connectivity/sqlnode.hxx index 5b010bc03333..1d8381a9a321 100644 --- a/connectivity/inc/connectivity/sqlnode.hxx +++ b/connectivity/inc/connectivity/sqlnode.hxx @@ -239,7 +239,7 @@ namespace connectivity between_predicate_part_2, cast_spec, rule_count, // last value - UNKNOWN_RULE // ID indicating that a node is no rule with a matching Rule-enum value (see getKnownRuleID) + UNKNOWN_RULE = -1 // ID indicating that a node is no rule with a matching Rule-enum value (see getKnownRuleID) }; // must be ascii encoding for the value @@ -289,7 +289,7 @@ namespace connectivity /** parses the node to a string which can be passed to a driver's connection for execution Any particles of the parse tree which represent application-level features - such - as queries appearing in the FROM part - are subsituted, so that the resulting statement can + as queries appearing in the FROM part - are substituted, so that the resulting statement can be executed at an SDBC-level connection. @param _out_rString @@ -315,7 +315,7 @@ namespace connectivity Currently, there's only one condition how this method can fail: If it contains a nested query which causes a cycle. E.g., consider a statement <code>SELECT * from "foo"</code>, - where <code>bar </code> is a query defined as <code>SELECT * FROM "bar"</code>, where + where <code>foo</code> is a query defined as <code>SELECT * FROM "bar"</code>, where <code>bar</code> is defined as <code>SELECT * FROM "foo"</code>. This statement obviously cannot be parsed to an executable statement. @@ -333,7 +333,7 @@ namespace connectivity sal_Bool _bIntl = sal_False, sal_Bool _bQuote= sal_True) const; - // quoted und internationalisert + // quoted and internationalised void parseNodeToPredicateStr(::rtl::OUString& rString, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter, @@ -352,14 +352,14 @@ namespace connectivity OSQLParseNode* getByRule(OSQLParseNode::Rule eRule) const; #if OSL_DEBUG_LEVEL > 0 - // shows the ParseTree with tabs and linefeeds + // shows the ParseTree with tabs and linefeeds void showParseTree( ::rtl::OUString& rString ) const; void showParseTree( ::rtl::OUStringBuffer& _inout_rBuf, sal_uInt32 nLevel ) const; #endif SQLNodeType getNodeType() const {return m_eNodeType;}; - // RuleId returns the RuleID of the node's rule (only if IsRule()) + // RuleId returns the RuleID of the node's rule (only if IsRule()) sal_uInt32 getRuleID() const {return m_nNodeID;} /** returns the ID of the rule represented by the node @@ -392,17 +392,17 @@ namespace connectivity // e.q. (a or b) and (c or d) <=> a and c or a and d or b and c or b and d static void disjunctiveNormalForm(OSQLParseNode*& pSearchCondition); - // Simplies logic expressions - // a * a = a - // a + a = a - // a * ( a + b) = a - // a + a * b = a + // Simplifies logic expressions + // a and a = a + // a or a = a + // a and ( a + b) = a + // a or a and b = a static void absorptions(OSQLParseNode*& pSearchCondition); - // erase not nessary braces + // erase unnecessary braces static void eraseBraces(OSQLParseNode*& pSearchCondition); - // makes the logic formula a little more smaller + // makes the logic formula a little smaller static void compress(OSQLParseNode*& pSearchCondition); // return the catalog, schema and tablename form this node // _pTableNode must be a rule of that above or a SQL_TOKEN_NAME @@ -412,7 +412,7 @@ namespace connectivity ::rtl::OUString &_rTable ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData); - // susbtitute all occurrences of :var or [name] into the dynamic parameter ? + // substitute all occurrences of :var or [name] into the dynamic parameter ? // _pNode will be modified if parameters exists static void substituteParameterNames(OSQLParseNode* _pNode); @@ -421,7 +421,7 @@ namespace connectivity static ::rtl::OUString getTableRange(const OSQLParseNode* _pTableRef); protected: - // ParseNodeToStr konkateniert alle Token (leaves) des ParseNodes + // ParseNodeToStr concatenates all Tokens (leaves) of the ParseNodes. void parseNodeToStr(::rtl::OUString& rString, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter, @@ -462,9 +462,18 @@ namespace connectivity return m_aChildren.at(nPos); } - // Utility-Methoden zum Abfragen auf bestimmte Rules, Token oder Punctuation: + // utilities to query for a specific rule, token or punctuation #define SQL_ISRULE(pParseNode, eRule) ((pParseNode)->isRule() && (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::eRule)) + #define SQL_ISRULEOR2(pParseNode, e1, e2) ((pParseNode)->isRule() && ( \ + (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \ + (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2))) + #define SQL_ISRULEOR3(pParseNode, e1, e2, e3) ((pParseNode)->isRule() && ( \ + (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \ + (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2) || \ + (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e3))) #define SQL_ISTOKEN(pParseNode, token) ((pParseNode)->isToken() && (pParseNode)->getTokenID() == SQL_TOKEN_##token) + #define SQL_ISTOKENOR2(pParseNode, tok0, tok1) ((pParseNode)->isToken() && ( (pParseNode)->getTokenID() == SQL_TOKEN_##tok0 || (pParseNode)->getTokenID() == SQL_TOKEN_##tok1 )) + #define SQL_ISTOKENOR3(pParseNode, tok0, tok1, tok2) ((pParseNode)->isToken() && ( (pParseNode)->getTokenID() == SQL_TOKEN_##tok0 || (pParseNode)->getTokenID() == SQL_TOKEN_##tok1 || (pParseNode)->getTokenID() == SQL_TOKEN_##tok2 )) #define SQL_ISPUNCTUATION(pParseNode, aString) ((pParseNode)->getNodeType() == SQL_NODE_PUNCTUATION && !(pParseNode)->getTokenValue().compareToAscii(aString)) } diff --git a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx index 8a719ee3f638..208717c3c9e9 100644 --- a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx +++ b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx @@ -84,6 +84,9 @@ SAL_DLLPUBLIC_EXPORT jboolean JNICALL Java_com_sun_star_sdbcx_comp_hsqldb_Storag catch(const NoSuchElementException&) { } + catch(const IllegalArgumentException&) + { + } return aStoragePair.first.first->isStreamElement(StorageContainer::removeURLPrefix(sName,aStoragePair.first.second)); } catch(const NoSuchElementException&) diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y index d559c292df63..41da5b07091d 100755 --- a/connectivity/source/parse/sqlbison.y +++ b/connectivity/source/parse/sqlbison.y @@ -4733,8 +4733,8 @@ OSQLParseNode* OSQLParser::parseTree(::rtl::OUString& rErrorMessage, //----------------------------------------------------------------------------- sal_uInt32 OSQLParser::StrToRuleID(const ::rtl::OString & rValue) { - // In yysvar nach dem angegebenen Namen suchen, den Index zurueckliefern - // (oder 0, wenn nicht gefunden) + // Search for the given name in yytname and return the index + // (or UNKNOWN_RULE, if not found) static sal_uInt32 nLen = SAL_N_ELEMENTS(yytname); for (sal_uInt32 i = YYTRANSLATE(SQL_TOKEN_INVALIDSYMBOL); i < (nLen-1); i++) { @@ -4742,8 +4742,8 @@ sal_uInt32 OSQLParser::StrToRuleID(const ::rtl::OString & rValue) return i; } - // Nicht gefunden - return 0; + // Not found + return OSQLParseNode::UNKNOWN_RULE; } //----------------------------------------------------------------------------- diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l index 45485fd1f370..d5b2f142bac0 100755 --- a/connectivity/source/parse/sqlflex.l +++ b/connectivity/source/parse/sqlflex.l @@ -435,10 +435,10 @@ ZONE {SQL_NEW_KEYWORD(SQL_TOKEN_ZONE); } <SQL>[A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375][A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375_0-9]* {return gatherName( SQLyytext);} -<SQL>([0-9]+) | -<SQL>([0-9]+"."[0-9]*) | -<SQL>("."[0-9]*) {SQL_NEW_INTNUM; } +<SQL>([0-9]+) {SQL_NEW_INTNUM; } +<SQL>("."[0-9]*) | +<SQL>([0-9]+"."[0-9]*) | <SQL>[0-9]+[eE][+-]?[0-9]+ | <SQL>[0-9]+"."[0-9]*[eE][+-]?[0-9]+ | <SQL>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; } @@ -598,7 +598,7 @@ sal_Int32 mapEnumToToken(IParseContext::InternationalKeyCode _eKeyCode ) } /* * Read SQL Name literal - * Valid Names or internatioanl keywords: + * Valid Names or international keywords: * As we have international keywords, we test first on them */ sal_Int32 gatherName(const sal_Char* text) diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx index 0c3b6a0cd958..325523c9f8e4 100644 --- a/connectivity/source/parse/sqliterator.cxx +++ b/connectivity/source/parse/sqliterator.cxx @@ -51,10 +51,6 @@ #include "diagnose_ex.h" #include <rtl/logfile.hxx> -#define SQL_ISRULEOR2(pParseNode, e1,e2) ((pParseNode)->isRule() && (\ - (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \ - (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2))) - using namespace ::comphelper; using namespace ::connectivity; using namespace ::connectivity::sdbcx; diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 065aae480cce..1ddfc69f7dc7 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -516,8 +516,8 @@ namespace cppcanvas ++io_rCurrActionIndex; if( pCurrAct->GetType() == META_COMMENT_ACTION && - static_cast<MetaCommentAction*>(pCurrAct)->GetComment().CompareIgnoreCaseToAscii( - pCommentString ) == COMPARE_EQUAL ) + static_cast<MetaCommentAction*>(pCurrAct)->GetComment().equalsIgnoreAsciiCase( + pCommentString) ) { // requested comment found, done return; @@ -551,8 +551,8 @@ namespace cppcanvas } if( pCurrAct->GetType() == META_COMMENT_ACTION && - static_cast<MetaCommentAction*>(pCurrAct)->GetComment().CompareIgnoreCaseToAscii( - pCommentString ) == COMPARE_EQUAL ) + static_cast<MetaCommentAction*>(pCurrAct)->GetComment().equalsIgnoreAsciiCase( + pCommentString) ) { // delimiting end comment found, done bRet = false; // not yet found @@ -1686,7 +1686,7 @@ namespace cppcanvas MetaCommentAction* pAct = static_cast<MetaCommentAction*>(pCurrAct); // Handle gradients - if ( pAct->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL ) + if (pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN"))) { MetaGradientExAction* pGradAction = NULL; bool bDone( false ); @@ -1702,7 +1702,7 @@ namespace cppcanvas // skip broken-down rendering, output gradient when sequence is ended case META_COMMENT_ACTION: - if( static_cast<MetaCommentAction*>(pCurrAct)->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) + if( static_cast<MetaCommentAction*>(pCurrAct)->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END")) ) { bDone = true; @@ -1723,7 +1723,7 @@ namespace cppcanvas // XPATHSTROKE_SEQ_BEGIN comment // Handle drawing layer fills - else if( pAct->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) ) + else if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) ) { const sal_uInt8* pData = pAct->GetData(); if ( pData ) @@ -1839,7 +1839,7 @@ namespace cppcanvas } } // Handle drawing layer fills - else if( pAct->GetComment().Equals( "EMF_PLUS" ) ) { + else if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("EMF_PLUS")) ) { static int count = -1, limit = 0x7fffffff; if (count == -1) { count = 0; @@ -1852,7 +1852,7 @@ namespace cppcanvas if (count < limit) processEMFPlus( pAct, rFactoryParms, getState( rStates ), rCanvas ); count ++; - } else if( pAct->GetComment().Equals( "EMF_PLUS_HEADER_INFO" ) ) { + } else if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("EMF_PLUS_HEADER_INFO")) ) { EMFP_DEBUG (printf ("EMF+ passed to canvas mtf renderer - header info, size: %u\n", (unsigned int)pAct->GetDataSize ())); SvMemoryStream rMF ((void*) pAct->GetData (), pAct->GetDataSize (), STREAM_READ); diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx index 0da5cb0bdfd5..7aefa0b26b59 100644 --- a/cppuhelper/source/bootstrap.cxx +++ b/cppuhelper/source/bootstrap.cxx @@ -38,9 +38,6 @@ #include "rtl/string.hxx" #include "rtl/ustrbuf.hxx" #include "rtl/uri.hxx" -#if OSL_DEBUG_LEVEL > 0 -#include "rtl/strbuf.hxx" -#endif #include "osl/diagnose.h" #include "osl/file.hxx" #include "osl/module.hxx" @@ -78,6 +75,8 @@ using namespace ::osl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; +namespace css = com::sun::star; + namespace cppu { @@ -150,7 +149,7 @@ inline beans::PropertyValue createPropertyValue( name, -1, makeAny( value ), beans::PropertyState_DIRECT_VALUE ); } -OUString findBoostrapArgument( +OUString findBootstrapArgument( const Bootstrap & bootstrap, const OUString & arg_name, sal_Bool * pFallenBack ) @@ -180,38 +179,126 @@ OUString findBoostrapArgument( result_buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(".rdb") ); result = result_buf.makeStringAndClear(); -#if OSL_DEBUG_LEVEL > 1 - OString result_dbg = - OUStringToOString(result, RTL_TEXTENCODING_ASCII_US); - OString arg_name_dbg = - OUStringToOString(arg_name, RTL_TEXTENCODING_ASCII_US); OSL_TRACE( - "cppuhelper::findBoostrapArgument - " - "setting %s relative to executable: %s\n", - arg_name_dbg.getStr(), - result_dbg.getStr() ); -#endif + (OSL_LOG_PREFIX "findBootstrapArgument, setting \"%s\" relative to" + " executable \"%s\""), + OUStringToOString(arg_name, RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(result, RTL_TEXTENCODING_UTF8).getStr()); } else { if(pFallenBack) *pFallenBack = sal_False; -#if OSL_DEBUG_LEVEL > 1 - OString prefixed_arg_name_dbg = OUStringToOString( - prefixed_arg_name, RTL_TEXTENCODING_ASCII_US ); - OString result_dbg = OUStringToOString( - result, RTL_TEXTENCODING_ASCII_US ); OSL_TRACE( - "cppuhelper::findBoostrapArgument - found %s in env: %s", - prefixed_arg_name_dbg.getStr(), - result_dbg.getStr() ); -#endif + OSL_LOG_PREFIX "findBootstrapArgument, found \"%s\" in env \"%s\"", + (OUStringToOString(prefixed_arg_name, RTL_TEXTENCODING_UTF8). + getStr()), + OUStringToOString(result, RTL_TEXTENCODING_UTF8).getStr()); } return result; } +css::uno::Reference< css::registry::XSimpleRegistry > readRdbFile( + rtl::OUString const & url, bool fatalErrors, + css::uno::Reference< css::registry::XSimpleRegistry > const & lastRegistry, + css::uno::Reference< css::lang::XSingleServiceFactory > const & + simpleRegistryFactory, + css::uno::Reference< css::lang::XSingleServiceFactory > const & + nestedRegistryFactory) +{ + OSL_ASSERT(simpleRegistryFactory.is() && nestedRegistryFactory.is()); + try { + css::uno::Reference< css::registry::XSimpleRegistry > simple( + simpleRegistryFactory->createInstance(), css::uno::UNO_QUERY_THROW); + simple->open(url, true, false); + if (lastRegistry.is()) { + css::uno::Reference< css::registry::XSimpleRegistry > nested( + nestedRegistryFactory->createInstance(), + css::uno::UNO_QUERY_THROW); + css::uno::Sequence< css::uno::Any > args(2); + args[0] <<= lastRegistry; + args[1] <<= simple; + css::uno::Reference< css::lang::XInitialization >( + nested, css::uno::UNO_QUERY_THROW)-> + initialize(args); + return nested; + } else { + return simple; + } + } catch (css::registry::InvalidRegistryException & e) { + (void) e; // avoid warnings + OSL_TRACE( + OSL_LOG_PREFIX "warning, could not open \"%s\": \"%s\"", + rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); + if (fatalErrors) { + throw; + } + return lastRegistry; + } +} + +Reference< registry::XSimpleRegistry > readRdbDirectory( + rtl::OUString const & url, bool fatalErrors, + css::uno::Reference< css::registry::XSimpleRegistry > const & lastRegistry, + css::uno::Reference< css::lang::XSingleServiceFactory > const & + simpleRegistryFactory, + css::uno::Reference< css::lang::XSingleServiceFactory > const & + nestedRegistryFactory) +{ + OSL_ASSERT(simpleRegistryFactory.is() && nestedRegistryFactory.is()); + osl::Directory dir(url); + switch (dir.open()) { + case osl::FileBase::E_None: + break; + case osl::FileBase::E_NOENT: + if (!fatalErrors) { + return lastRegistry; + } + // fall through + default: + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("cannot open directory ")) + + url), + css::uno::Reference< css::uno::XInterface >()); + } + for (css::uno::Reference< css::registry::XSimpleRegistry > last( + lastRegistry);;) + { + osl::DirectoryItem i; + switch (dir.getNextItem(i, SAL_MAX_UINT32)) { + case osl::FileBase::E_None: + break; + case osl::FileBase::E_NOENT: + return last; + default: + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("cannot iterate directory ")) + + url), + css::uno::Reference< css::uno::XInterface >()); + } + osl::FileStatus stat( + osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileName | + osl_FileStatus_Mask_FileURL); + if (i.getFileStatus(stat) != osl::FileBase::E_None) { + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("cannot stat in directory ")) + + url), + css::uno::Reference< css::uno::XInterface >()); + } + if (stat.getFileType() != osl::FileStatus::Directory) { //TODO: symlinks + last = readRdbFile( + stat.getFileURL(), fatalErrors, last, simpleRegistryFactory, + nestedRegistryFactory); + } + } +} + Reference< registry::XSimpleRegistry > nestRegistries( const OUString &baseDir, const Reference< lang::XSingleServiceFactory > & xSimRegFac, @@ -233,18 +320,13 @@ Reference< registry::XSimpleRegistry > nestRegistries( { lastRegistry->open(write_rdb, sal_False, forceWrite_rdb); } - catch (registry::InvalidRegistryException & invalidRegistryException) + catch (registry::InvalidRegistryException & e) { - (void) invalidRegistryException; -#if OSL_DEBUG_LEVEL > 1 - OString rdb_name_tmp = OUStringToOString( - write_rdb, RTL_TEXTENCODING_ASCII_US); - OString message_dbg = OUStringToOString( - invalidRegistryException.Message, RTL_TEXTENCODING_ASCII_US); + (void) e; // avoid warnings OSL_TRACE( - "warning: couldn't open %s cause of %s", - rdb_name_tmp.getStr(), message_dbg.getStr() ); -#endif + OSL_LOG_PREFIX "warning, could not open \"%s\": \"%s\"", + OUStringToOString(write_rdb, RTL_TEXTENCODING_UTF8).getStr(), + OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); } if(!lastRegistry->isValid()) @@ -257,59 +339,30 @@ Reference< registry::XSimpleRegistry > nestRegistries( OUString rdb_name = (index == -1) ? csl_rdbs : csl_rdbs.copy(0, index); csl_rdbs = (index == -1) ? OUString() : csl_rdbs.copy(index + 1); - if (! rdb_name.getLength()) + if (rdb_name.isEmpty()) { continue; + } - bool optional = ('?' == rdb_name[ 0 ]); - if (optional) - rdb_name = rdb_name.copy( 1 ); - - try - { - Reference<registry::XSimpleRegistry> simpleRegistry( - xSimRegFac->createInstance(), UNO_QUERY_THROW ); - - osl::FileBase::getAbsoluteFileURL(baseDir, rdb_name, rdb_name); - simpleRegistry->open(rdb_name, sal_True, sal_False); - - if(lastRegistry.is()) - { - Reference< registry::XSimpleRegistry > nestedRegistry( - xNesRegFac->createInstance(), UNO_QUERY ); - Reference< lang::XInitialization > nestedRegistry_xInit( - nestedRegistry, UNO_QUERY ); - - Sequence<Any> aArgs(2); - aArgs[0] <<= lastRegistry; - aArgs[1] <<= simpleRegistry; - - nestedRegistry_xInit->initialize(aArgs); - - lastRegistry = nestedRegistry; - } - else - lastRegistry = simpleRegistry; + bool fatalErrors = !bFallenBack; + if (rdb_name[0] == '?') { + rdb_name = rdb_name.copy(1); + fatalErrors = false; } - catch(registry::InvalidRegistryException & invalidRegistryException) - { -#if OSL_DEBUG_LEVEL > 1 - OString rdb_name_tmp = OUStringToOString( - rdb_name, RTL_TEXTENCODING_ASCII_US ); - OString message_dbg = OUStringToOString( - invalidRegistryException.Message, RTL_TEXTENCODING_ASCII_US ); - OSL_TRACE( - "warning: couldn't open %s cause of %s", - rdb_name_tmp.getStr(), message_dbg.getStr() ); -#endif - if (! optional) - { - // if a registry was explicitly given, the exception shall fly - if( ! bFallenBack ) - throw; - } - (void) invalidRegistryException; + bool directory = rdb_name.getLength() >= 3 && rdb_name[0] == '<' && + rdb_name[rdb_name.getLength() - 2] == '>' && + rdb_name[rdb_name.getLength() -1] == '*'; + if (directory) { + rdb_name = rdb_name.copy(1, rdb_name.getLength() - 3); } + + osl::FileBase::getAbsoluteFileURL(baseDir, rdb_name, rdb_name); + + lastRegistry = directory + ? readRdbDirectory( + rdb_name, fatalErrors, lastRegistry, xSimRegFac, xNesRegFac) + : readRdbFile( + rdb_name, fatalErrors, lastRegistry, xSimRegFac, xNesRegFac); } while(index != -1 && csl_rdbs.getLength()); // are there more rdbs in list? @@ -356,7 +409,7 @@ SAL_CALL defaultBootstrap_InitialComponentContext( sal_Bool bFallenback_types; OUString cls_uno_types = - findBoostrapArgument( bootstrap, OUSTR("TYPES"), &bFallenback_types ); + findBootstrapArgument( bootstrap, OUSTR("TYPES"), &bFallenback_types ); Reference<registry::XSimpleRegistry> types_xRegistry = nestRegistries( @@ -366,11 +419,11 @@ SAL_CALL defaultBootstrap_InitialComponentContext( // ==== bootstrap from services registry ==== sal_Bool bFallenback_services; - OUString cls_uno_services = findBoostrapArgument( + OUString cls_uno_services = findBootstrapArgument( bootstrap, OUSTR("SERVICES"), &bFallenback_services ); sal_Bool fallenBackWriteRegistry; - OUString write_rdb = findBoostrapArgument( + OUString write_rdb = findBootstrapArgument( bootstrap, OUSTR("WRITERDB"), &fallenBackWriteRegistry ); if (fallenBackWriteRegistry) { diff --git a/cui/source/dialogs/SpellAttrib.hxx b/cui/source/dialogs/SpellAttrib.hxx index 9ebc229380ce..731c6942a082 100644 --- a/cui/source/dialogs/SpellAttrib.hxx +++ b/cui/source/dialogs/SpellAttrib.hxx @@ -47,6 +47,7 @@ struct SpellErrorDescription ::rtl::OUString sErrorText; ::rtl::OUString sDialogTitle; ::rtl::OUString sExplanation; + ::rtl::OUString sExplanationURL; ::com::sun::star::lang::Locale aLocale; ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XProofreader > xGrammarChecker; ::rtl::OUString sServiceName; //service name of GrammarChecker/SpellChecker @@ -64,9 +65,13 @@ struct SpellErrorDescription const ::rtl::OUString& rServiceName, const ::rtl::OUString* pDialogTitle = 0, const ::rtl::OUString* pExplanation = 0, - const ::rtl::OUString* pRuleId = 0 ) : + const ::rtl::OUString* pRuleId = 0, + const ::rtl::OUString* pExplanationURL = 0 ) : bIsGrammarError( bGrammar ), sErrorText( rText ), + sDialogTitle( ), + sExplanation( ), + sExplanationURL( ), aLocale( rLocale ), xGrammarChecker( rxGrammarChecker ), sServiceName( rServiceName ), @@ -76,6 +81,8 @@ struct SpellErrorDescription sDialogTitle = *pDialogTitle; if( pExplanation ) sExplanation = *pExplanation; + if( pExplanationURL ) + sExplanationURL = *pExplanationURL; if( pRuleId ) sRuleId = *pRuleId; }; @@ -91,6 +98,7 @@ struct SpellErrorDescription xGrammarChecker == rDesc.xGrammarChecker && sDialogTitle.equals( rDesc.sDialogTitle ) && sExplanation.equals( rDesc.sExplanation ) && + sExplanationURL.equals( rDesc.sExplanationURL ) && sRuleId == rDesc.sRuleId; } }; diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 389cee6a7887..9990e4c28e7c 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -51,6 +51,8 @@ #include <com/sun/star/lang/XServiceDisplayName.hpp> #include <com/sun/star/linguistic2/SpellFailure.hpp> #include <com/sun/star/frame/XStorable.hpp> +#include <com/sun/star/system/SystemShellExecuteFlags.hpp> +#include <com/sun/star/system/XSystemShellExecute.hpp> #include <sfx2/app.hxx> #include <vcl/help.hxx> #include <vcl/graph.hxx> @@ -68,6 +70,8 @@ #include <svx/svxerr.hxx> #include "treeopt.hxx" #include <svtools/langtab.hxx> +#include <comphelper/anytostring.hxx> +#include <cppuhelper/exc_hlp.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -189,6 +193,26 @@ sal_uInt16 SpellUndoAction_Impl::GetId()const return m_nId; } +HelpFixedText::HelpFixedText( Window* pParent, const ResId& rResId ): + FixedText( pParent, rResId ) +{ +} + +void HelpFixedText::Paint( const Rectangle& rRect ) +{ + Rectangle aTextRect( rRect.Left() + 6, rRect.Top(), rRect.Right() - 6, rRect.Bottom() ); + DrawText( aTextRect, GetText(), TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE ); +} + +long HelpFixedText::GetActualHeight( ) +{ + Rectangle rRect( GetPosPixel( ), GetSizePixel() ); + Rectangle aTextRect( rRect.Left() + 6, rRect.Top(), rRect.Right() - 6, rRect.Bottom() ); + Rectangle aBounds = GetTextRect( aTextRect, GetText(), TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE ); + + return aBounds.getHeight(); +} + // class SvxSpellCheckDialog --------------------------------------------- SpellDialog::SpellDialog( @@ -200,9 +224,10 @@ SpellDialog::SpellDialog( pParent, CUI_RES(RID_SVXDLG_SPELLCHECK)), - aVendorImageFI ( this , CUI_RES( IMG_VENDOR ) ), aLanguageFT ( this, CUI_RES( FT_LANGUAGE ) ), aLanguageLB ( this, CUI_RES( LB_LANGUAGE ) ), + aExplainFT ( this, CUI_RES( FT_EXPLAIN ) ), + aExplainLink ( this, CUI_RES( LINK_EXPLAIN ) ), aNotInDictFT ( this, CUI_RES( FT_NOTINDICT ) ), aSentenceED ( this, CUI_RES( ED_NEWWORD ) ), aSuggestionFT ( this, CUI_RES( FT_SUGGESTION ) ), @@ -215,7 +240,6 @@ SpellDialog::SpellDialog( aChangePB ( this, CUI_RES( PB_CHANGE ) ), aChangeAllPB ( this, CUI_RES( PB_CHANGEALL ) ), - aExplainPB ( this, CUI_RES( PB_EXPLAIN) ), aAutoCorrPB ( this, CUI_RES( PB_AUTOCORR ) ), aCheckGrammarCB ( this, CUI_RES( CB_CHECK_GRAMMAR ) ), @@ -226,8 +250,6 @@ SpellDialog::SpellDialog( aClosePB ( this, CUI_RES( PB_CLOSE ) ), aBackgroundGB ( this, CUI_RES( GB_BACKGROUND ) ), - aVendorImage ( CUI_RES( IMG_DEFAULT_VENDOR ) ), - aResumeST ( CUI_RES(ST_RESUME )), aIgnoreOnceST ( aIgnorePB.GetText()), aNoSuggestionsST( CUI_RES(ST_NOSUGGESTIONS)), @@ -244,6 +266,12 @@ SpellDialog::SpellDialog( xSpell = LinguMgr::GetSpellChecker(); pImpl = new SpellDialog_Impl; + const StyleSettings& rSettings = GetSettings().GetStyleSettings(); + Color aCol = rSettings.GetHelpColor(); + Wallpaper aWall( aCol ); + aExplainLink.SetBackground( aWall ); + aExplainFT.SetBackground( aWall ); + //HelpIds aClosePB. SetHelpId(HID_SPLDLG_BUTTON_CLOSE ); aIgnorePB. SetHelpId(HID_SPLDLG_BUTTON_IGNORE ); @@ -251,7 +279,7 @@ SpellDialog::SpellDialog( aIgnoreRulePB. SetHelpId(HID_SPLDLG_BUTTON_IGNORERULE); aChangePB. SetHelpId(HID_SPLDLG_BUTTON_CHANGE ); aChangeAllPB. SetHelpId(HID_SPLDLG_BUTTON_CHANGEALL); - aExplainPB. SetHelpId(HID_SPLDLG_BUTTON_EXPLAIN ); + aExplainLink. SetHelpId(HID_SPLDLG_BUTTON_EXPLAIN ); Init_Impl(); // disable controls if service is missing @@ -300,6 +328,8 @@ void SpellDialog::Init_Impl() aAddToDictMB.SetSelectHdl(LINK ( this, SpellDialog, AddToDictionaryHdl ) ); aLanguageLB.SetSelectHdl(LINK( this, SpellDialog, LanguageSelectHdl ) ); + aExplainLink.SetClickHdl( LINK( this, SpellDialog, HandleHyperlink ) ); + // initialize language ListBox aLanguageLB.SetLanguageList( LANG_LIST_SPELL_USED, sal_False, sal_False, sal_True ); @@ -324,7 +354,8 @@ void SpellDialog::UpdateBoxes_Impl() nAltLanguage = SvxLocaleToLanguage( pSpellErrorDescription->aLocale ); aNewWords = pSpellErrorDescription->aSuggestions; bIsGrammarError = pSpellErrorDescription->bIsGrammarError; - aExplainPB.SetExplanation(pSpellErrorDescription->sExplanation ); + aExplainLink.SetURL( pSpellErrorDescription->sExplanationURL ); + aExplainFT.SetText( pSpellErrorDescription->sExplanation ); } if( pSpellErrorDescription && pSpellErrorDescription->sDialogTitle.getLength() ) { @@ -363,13 +394,12 @@ void SpellDialog::UpdateBoxes_Impl() aChangeAllPB.Enable(nSize > 0); bool bShowChangeAll = !bIsGrammarError; aChangeAllPB.Show( bShowChangeAll ); - aExplainPB.Show( !bShowChangeAll ); + aExplainFT.Show( !bShowChangeAll ); aLanguageLB.Enable( bShowChangeAll ); aIgnoreAllPB.Show( bShowChangeAll ); aAddToDictMB.Show( bShowChangeAll ); aIgnoreRulePB.Show( !bShowChangeAll ); aIgnoreRulePB.Enable(pSpellErrorDescription && pSpellErrorDescription->sRuleId.getLength()); - aExplainPB.Enable( aExplainPB.HasExplanation() ); aAutoCorrPB.Show( bShowChangeAll && rParent.HasAutoCorrection() ); } @@ -463,23 +493,37 @@ IMPL_STATIC_LINK( SpellDialog, InitHdl, SpellDialog *, EMPTYARG ) } else { - if( SvtLinguConfig().HasVendorImages( "SpellAndGrammarDialogImage" ) ) + if( pThis->aExplainLink.GetURL().Len() == 0 ) + { + pThis->aExplainLink.Hide(); + Size aExplainSize = pThis->aExplainFT.GetSizePixel(); + aExplainSize.Width() += pThis->aExplainLink.GetSizePixel().Width(); + pThis->aExplainFT.SetSizePixel( aExplainSize ); + } + + sal_Int32 nExplainHeight = pThis->aExplainFT.GetActualHeight(); + sal_Int32 nCurrentHeight = pThis->aExplainFT.GetSizePixel().Height(); + if( pThis->aExplainFT.GetText().Len() == 0 ) + { + nExplainHeight = 0; + pThis->aExplainFT.Hide(); + pThis->aExplainLink.Hide(); + } + else + { + Size aSize = pThis->aExplainFT.GetSizePixel(); + aSize.Height() = nExplainHeight; + pThis->aExplainFT.SetSizePixel( aSize ); + + aSize = pThis->aExplainLink.GetSizePixel(); + aSize.Height() = nExplainHeight; + pThis->aExplainLink.SetSizePixel( aSize ); + } + + sal_Int32 nDiff = - ( nCurrentHeight - nExplainHeight ); + if ( nDiff != 0 ) { - pThis->aVendorImageFI.Show(); - Size aVendorSize = pThis->aVendorImageFI.GetSizePixel(); - Size aImageSize = pThis->aVendorImageFI.GetImage().GetSizePixel(); - if( aImageSize.Height() ) - { - aVendorSize.Height() = aImageSize.Height(); - if(aVendorSize.Width() < aImageSize.Width()) - aVendorSize.Width() = aImageSize.Width(); - pThis->aVendorImageFI.SetSizePixel( aVendorSize ); - } - sal_Int32 nDiff = aVendorSize.Height(); - pThis->aVendorImageFI.SetSizePixel(aVendorSize); Control* aControls[] = { - &pThis->aLanguageFT, - &pThis->aLanguageLB, &pThis->aNotInDictFT, &pThis->aSentenceED, &pThis->aSuggestionFT, @@ -490,7 +534,6 @@ IMPL_STATIC_LINK( SpellDialog, InitHdl, SpellDialog *, EMPTYARG ) &pThis->aAddToDictMB, &pThis->aChangePB, &pThis->aChangeAllPB, - &pThis->aExplainPB, &pThis->aAutoCorrPB, &pThis->aCheckGrammarCB, &pThis->aHelpPB, @@ -884,17 +927,10 @@ void SpellDialog::SetTitle_Impl(LanguageType nLang) const SpellErrorDescription* pSpellErrorDescription = aSentenceED.GetAlternatives(); if( pSpellErrorDescription && pSpellErrorDescription->sServiceName.getLength() ) { - ::rtl::OUString sSuggestionImageUrl = - SvtLinguConfig().GetSpellAndGrammarDialogImage( pSpellErrorDescription->sServiceName ); - aVendorImageFI.SetImage( lcl_GetImageFromPngUrl( sSuggestionImageUrl ) ); uno::Reference< lang::XServiceDisplayName > xDisplayName( pSpellErrorDescription->xGrammarChecker, uno::UNO_QUERY ); if( xDisplayName.is() ) sVendor = xDisplayName->getServiceDisplayName( pSpellErrorDescription->aLocale ); } - else - { - aVendorImageFI.SetImage( aVendorImage ); - } if( sVendor.Len() ) { @@ -1193,6 +1229,19 @@ bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence, bool bRecheck) } else if(aStart->bIsGrammarError ) { + beans::PropertyValues aProperties = aStart->aGrammarError.aProperties; + rtl::OUString sFullCommentURL; + sal_Int32 i = 0; + while ( !sFullCommentURL.isEmpty() && i < aProperties.getLength() ) + { + if ( aProperties[i].Name.equalsAscii( "FullCommentURL" ) ) + { + uno::Any aValue = aProperties[i].Value; + aValue >>= sFullCommentURL; + } + ++i; + } + uno::Reference< lang::XServiceInfo > xInfo( aStart->xGrammarChecker, uno::UNO_QUERY ); SpellErrorDescription aDesc( true, aStart->sText, @@ -1202,7 +1251,8 @@ bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence, bool bRecheck) xInfo->getImplementationName(), &aStart->sDialogTitle, &aStart->aGrammarError.aFullComment, - &aStart->aGrammarError.aRuleIdentifier ); + &aStart->aGrammarError.aRuleIdentifier, + &sFullCommentURL ); aSentenceED.SetAttrib( SpellErrorAttrib(aDesc), 0, (sal_uInt16) nStartPosition, (sal_uInt16) nEndPosition ); } if(aStart->bIsField) @@ -2056,7 +2106,7 @@ void SentenceEditWindow_Impl::SetUndoEditMode(bool bSet) Control* aControls[] = { &pSpellDialog->aChangeAllPB, - &pSpellDialog->aExplainPB, + &pSpellDialog->aExplainFT, &pSpellDialog->aIgnoreAllPB, &pSpellDialog->aIgnoreRulePB, &pSpellDialog->aIgnorePB, @@ -2087,20 +2137,31 @@ void SentenceEditWindow_Impl::SetUndoEditMode(bool bSet) pSpellDialog->aChangePB.Enable(); } -//----------------------------------------------------------------------- -ExplainButton::~ExplainButton() +IMPL_LINK( SpellDialog, HandleHyperlink, svt::FixedHyperlink*, pHyperlink ) { -} + rtl::OUString sURL=pHyperlink->GetURL(); + rtl::OUString sTitle=GetText(); -//----------------------------------------------------------------------- -void ExplainButton::RequestHelp( const HelpEvent& ) -{ - Help::ShowBalloon( this, GetPosPixel(), m_sExplanation ); -} + if ( ! sURL.getLength() ) // Nothing to do, when the URL is empty + return 1; + try + { + uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( + ::comphelper::getProcessServiceFactory()->createInstance( + DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), uno::UNO_QUERY_THROW ); + xSystemShellExecute->execute( sURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); + } + catch ( uno::Exception& ) + { + uno::Any exc( ::cppu::getCaughtException() ); + rtl::OUString msg( ::comphelper::anyToString( exc ) ); + const SolarMutexGuard guard; + ErrorBox aErrorBox( NULL, WB_OK, msg ); + aErrorBox.SetText( sTitle ); + aErrorBox.Execute(); + } -void ExplainButton::Click() -{ - RequestHelp( HelpEvent() ); + return 1; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/dialogs/SpellDialog.hrc b/cui/source/dialogs/SpellDialog.hrc index d51ec1e82249..36b6c56d584d 100644 --- a/cui/source/dialogs/SpellDialog.hrc +++ b/cui/source/dialogs/SpellDialog.hrc @@ -48,7 +48,6 @@ #define ST_SPELLING_AND_GRAMMAR 52 #define ST_SPELLING_AND_GRAMMAR_VENDORNAME 53 #define CB_CHECK_GRAMMAR 54 -#define PB_EXPLAIN 55 -#define IMG_VENDOR 56 -#define IMG_DEFAULT_VENDOR 57 +#define LINK_EXPLAIN 55 +#define FT_EXPLAIN 56 #define PB_IGNORERULE 59 diff --git a/cui/source/dialogs/SpellDialog.src b/cui/source/dialogs/SpellDialog.src index 88da8b74e7b7..4a5b2c9c127f 100644 --- a/cui/source/dialogs/SpellDialog.src +++ b/cui/source/dialogs/SpellDialog.src @@ -36,7 +36,7 @@ ModelessDialog RID_SVXDLG_SPELLCHECK { HelpId = HID_SPELLCHECK ; - Size = MAP_APPFONT( 270, 188 ); + Size = MAP_APPFONT( 270, 208 ); OutputSize = TRUE; Closeable = TRUE ; SVLook = TRUE; @@ -45,13 +45,6 @@ ModelessDialog RID_SVXDLG_SPELLCHECK Moveable = TRUE ; - FixedImage IMG_VENDOR - { - Pos = MAP_APPFONT ( 0, 0 ) ; - Size = MAP_APPFONT ( 270, 21 ) ; - Hide = TRUE; - }; - FixedText FT_LANGUAGE { Pos = MAP_APPFONT( 6, 8 ); @@ -67,9 +60,23 @@ ModelessDialog RID_SVXDLG_SPELLCHECK Sort = TRUE; DropDown = TRUE; }; + FixedText FT_EXPLAIN + { + Pos = MAP_APPFONT( 1, 18 ); + Size = MAP_APPFONT( 239, 20 ); + VCenter = TRUE ; + }; + FixedText LINK_EXPLAIN + { + Pos = MAP_APPFONT( 240, 18 ); + Size = MAP_APPFONT( 29, 20 ); + Text [ en-US ] = "More..." ; + Right = TRUE ; + VCenter = TRUE ; + }; FixedText FT_NOTINDICT { - Pos = MAP_APPFONT( 6, 26 ); + Pos = MAP_APPFONT( 6, 46 ); Size = MAP_APPFONT( 120, 8 ); Text [ en-US ] = "~Not in dictionary" ; }; @@ -77,7 +84,7 @@ ModelessDialog RID_SVXDLG_SPELLCHECK MultiLineEdit ED_NEWWORD { HelpID = "cui:MultiLineEdit:RID_SVXDLG_SPELLCHECK:ED_NEWWORD"; - Pos = MAP_APPFONT( 6, 37 ); + Pos = MAP_APPFONT( 6, 57 ); Size = MAP_APPFONT( 197, 48 ); Border = TRUE; VScroll = TRUE; @@ -86,14 +93,14 @@ ModelessDialog RID_SVXDLG_SPELLCHECK FixedText FT_SUGGESTION { - Pos = MAP_APPFONT( 6, 88 ); + Pos = MAP_APPFONT( 6, 108 ); Size = MAP_APPFONT( 120, 8 ); Text [ en-US ] = "~Suggestions" ; }; ListBox LB_SUGGESTION { HelpID = "cui:ListBox:RID_SVXDLG_SPELLCHECK:LB_SUGGESTION"; - Pos = MAP_APPFONT( 6, 99 ); + Pos = MAP_APPFONT( 6, 119 ); Size = MAP_APPFONT( 197, 48 ); Border = TRUE; }; @@ -101,7 +108,7 @@ ModelessDialog RID_SVXDLG_SPELLCHECK CheckBox CB_CHECK_GRAMMAR { HelpID = "cui:CheckBox:RID_SVXDLG_SPELLCHECK:CB_CHECK_GRAMMAR"; - Pos = MAP_APPFONT( 6, 153 ); + Pos = MAP_APPFONT( 6, 173 ); Size = MAP_APPFONT( 100, 10 ); Text [ en-US ] = "Check ~grammar" ; Hide = TRUE; @@ -110,7 +117,7 @@ ModelessDialog RID_SVXDLG_SPELLCHECK PushButton PB_IGNORE { HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_IGNORE"; - Pos = MAP_APPFONT( 209, 37 ); + Pos = MAP_APPFONT( 209, 57 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "~Ignore Once" ; }; @@ -118,14 +125,14 @@ ModelessDialog RID_SVXDLG_SPELLCHECK PushButton PB_IGNOREALL { HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_IGNOREALL"; - Pos = MAP_APPFONT( 209, 54 ); + Pos = MAP_APPFONT( 209, 74 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "I~gnore All" ; }; PushButton PB_IGNORERULE { HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_IGNORERULE"; - Pos = MAP_APPFONT( 209, 54 ); + Pos = MAP_APPFONT( 209, 74 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "I~gnore Rule" ; Hide = TRUE; @@ -133,7 +140,7 @@ ModelessDialog RID_SVXDLG_SPELLCHECK MenuButton MB_ADDTODICT { HelpID = "cui:MenuButton:RID_SVXDLG_SPELLCHECK:MB_ADDTODICT"; - Pos = MAP_APPFONT( 209, 71 ); + Pos = MAP_APPFONT( 209, 91 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "~Add" ; }; @@ -141,7 +148,7 @@ ModelessDialog RID_SVXDLG_SPELLCHECK PushButton PB_CHANGE { HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_CHANGE"; - Pos = MAP_APPFONT( 209, 99 ); + Pos = MAP_APPFONT( 209, 119 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "~Change" ; DefButton = TRUE ; @@ -150,48 +157,40 @@ ModelessDialog RID_SVXDLG_SPELLCHECK PushButton PB_CHANGEALL { HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_CHANGEALL"; - Pos = MAP_APPFONT( 209, 117 ); + Pos = MAP_APPFONT( 209, 137 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "Change A~ll" ; }; - PushButton PB_EXPLAIN - { - HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_EXPLAIN"; - Pos = MAP_APPFONT( 209, 117 ); - Size = MAP_APPFONT( 55, 14 ); - Hide = TRUE; - Text [ en-US ] = "~Explain..." ; - }; PushButton PB_AUTOCORR { HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_AUTOCORR"; - Pos = MAP_APPFONT( 209, 134 ); + Pos = MAP_APPFONT( 209, 154 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "AutoCor~rect" ; }; GroupBox GB_BACKGROUND { - Pos = MAP_APPFONT( 1, 21 ); + Pos = MAP_APPFONT( 1, 41 ); Size = MAP_APPFONT( 268, 146 ); Hide=TRUE; }; HelpButton PB_HELP { - Pos = MAP_APPFONT( 6, 170 ); + Pos = MAP_APPFONT( 6, 191 ); Size = MAP_APPFONT( 55, 14 ); }; PushButton PB_OPTIONS { HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_OPTIONS"; - Pos = MAP_APPFONT( 87, 170 ); + Pos = MAP_APPFONT( 87, 191 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "O~ptions..." ; }; PushButton PB_UNDO { HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_UNDO"; - Pos = MAP_APPFONT( 148, 170 ); + Pos = MAP_APPFONT( 148, 191 ); Size = MAP_APPFONT( 55, 14 ); Text [ en-US ] = "~Undo" ; }; @@ -199,7 +198,7 @@ ModelessDialog RID_SVXDLG_SPELLCHECK PushButton PB_CLOSE { HelpID = "cui:PushButton:RID_SVXDLG_SPELLCHECK:PB_CLOSE"; - Pos = MAP_APPFONT ( 209 , 170 ) ; + Pos = MAP_APPFONT ( 209 , 191 ) ; Size = MAP_APPFONT ( 55 , 14 ) ; TabStop = TRUE ; Text [ en-US ] = "Cl~ose" ; @@ -224,9 +223,5 @@ ModelessDialog RID_SVXDLG_SPELLCHECK { Text[ en-US ] = "Spelling and Grammar: $LANGUAGE ($LOCATION) [$VendorName]"; }; - Image IMG_DEFAULT_VENDOR - { - ImageBitmap = Bitmap { File = "vendor01.png"; }; - }; }; // ********************************************************************** EOF diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 0d77033cc2d7..b987b4af08ed 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -65,14 +65,6 @@ using namespace ::com::sun::star; #define SPACE_OFFSET 5 #define SCROLL_TIMER 30 -/** loads the application logo as used in the about dialog and impress slideshow pause screen */ -Image SfxApplication::GetApplicationLogo() -{ - BitmapEx aBitmap; - Application::LoadBrandBitmap ("about", aBitmap); - return Image( aBitmap ); -} - /* get good version information */ static String GetBuildId() diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx index 51e9f1d91bbb..99e0c6d7e7ce 100644 --- a/cui/source/dialogs/iconcdlg.cxx +++ b/cui/source/dialogs/iconcdlg.cxx @@ -30,8 +30,6 @@ #include <tools/rc.h> #include <tools/shl.hxx> -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> #include <dialmgr.hxx> #include "iconcdlg.hxx" @@ -45,11 +43,6 @@ using ::std::vector; -int SAL_CALL IconcDlgCmpUS_Impl( const void* p1, const void* p2 ) -{ - return *(sal_uInt16*)p1 - *(sal_uInt16*)p2; -} - // some stuff for easier changes for SvtViewOptions static const sal_Char* pViewOptDataName = "dialog data"; #define VIEWOPT_DATANAME ::rtl::OUString::createFromAscii( pViewOptDataName ) @@ -962,7 +955,7 @@ const sal_uInt16* IconChoiceDialog::GetInputRanges( const SfxItemPool& rPool ) if ( pRanges ) return pRanges; - SvUShorts aUS( 16, 16 ); + std::vector<sal_uInt16> aUS; size_t nCount = maPageList.size(); for ( size_t i = 0; i < nCount; ++i ) @@ -976,32 +969,26 @@ const sal_uInt16* IconChoiceDialog::GetInputRanges( const SfxItemPool& rPool ) sal_uInt16 nLen; for( nLen = 0; *pIter; ++nLen, ++pIter ) ; - aUS.Insert( pTmpRanges, nLen, aUS.Count() ); + aUS.insert( aUS.end(), pTmpRanges, pTmpRanges + nLen ); } } // remove double Id's { - nCount = aUS.Count(); + nCount = aUS.size(); for ( size_t i = 0; i < nCount; ++i ) aUS[i] = rPool.GetWhich( aUS[i] ); } // sortieren - if ( aUS.Count() > 1 ) + if ( aUS.size() > 1 ) { -#if defined __SUNPRO_CC -#pragma disable_warn -#endif - qsort( (void*)aUS.GetData(), aUS.Count(), sizeof(sal_uInt16), IconcDlgCmpUS_Impl ); -#if defined __SUNPRO_CC -#pragma enable_warn -#endif + std::sort( aUS.begin(), aUS.end() ); } - pRanges = new sal_uInt16[aUS.Count() + 1]; - memcpy(pRanges, aUS.GetData(), sizeof(sal_uInt16) * aUS.Count()); - pRanges[aUS.Count()] = 0; + pRanges = new sal_uInt16[aUS.size() + 1]; + std::copy( aUS.begin(), aUS.end(), pRanges ); + pRanges[aUS.size()] = 0; return pRanges; } diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx index 99d6af3d444b..71d502c322b2 100644 --- a/cui/source/inc/SpellDialog.hxx +++ b/cui/source/inc/SpellDialog.hxx @@ -48,6 +48,7 @@ #include <memory> #include <svtools/svmedit.hxx> #include <svl/lstner.hxx> +#include <svtools/fixedhyper.hxx> #include <svtools/xtextedt.hxx> #include <editeng/SpellPortions.hxx> @@ -129,23 +130,18 @@ public: void ResetIgnoreErrorsAt() { m_aIgnoreErrorsAt.clear(); } }; - -// class SvxSpellDialog --------------------------------------------- -class SpellDialogChildWindow; -class ExplainButton : public PushButton +class HelpFixedText : public FixedText { - String m_sExplanation; - - virtual void RequestHelp( const HelpEvent& rHEvt ); - virtual void Click(); -public: - ExplainButton( Window* pParent, const ResId& rResId ) : PushButton( pParent, rResId ){} - ~ExplainButton(); - void SetExplanation( const String& rText ) {m_sExplanation = rText;} - bool HasExplanation() { return m_sExplanation.Len() > 0;} + public: + HelpFixedText( Window* pParent, const ResId& rResId ); + virtual void Paint( const Rectangle& rRect ); + long GetActualHeight( ); }; +// class SvxSpellDialog --------------------------------------------- +class SpellDialogChildWindow; + class SpellDialog : public SfxModelessDialog { using Window::Invalidate; @@ -153,11 +149,12 @@ class SpellDialog : public SfxModelessDialog friend class SentenceEditWindow_Impl; private: - FixedImage aVendorImageFI; - FixedText aLanguageFT; SvxLanguageBox aLanguageLB; + HelpFixedText aExplainFT; + svt::FixedHyperlink aExplainLink; + FixedText aNotInDictFT; SentenceEditWindow_Impl aSentenceED; @@ -171,7 +168,6 @@ private: PushButton aChangePB; PushButton aChangeAllPB; - ExplainButton aExplainPB; PushButton aAutoCorrPB; CheckBox aCheckGrammarCB; @@ -219,6 +215,7 @@ private: DECL_LINK( AddToDictionaryHdl, MenuButton* ); DECL_LINK( LanguageSelectHdl, SvxLanguageBox* ); DECL_LINK( DialogUndoHdl, SpellUndoAction_Impl* ); + DECL_LINK( HandleHyperlink, svt::FixedHyperlink * ); DECL_STATIC_LINK( SpellDialog, InitHdl, SpellDialog * ); diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index dfcbc59da534..9bb95b62eafe 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -49,9 +49,6 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> -#define _SVSTDARR_USHORTS -#define _SVSTDARR_STRINGSDTOR -#include <svl/svstdarr.hxx> // SvUShorts #include <sfx2/minarray.hxx> #include <sfx2/tabdlg.hxx> #include <vector> diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 1f76ce0ad609..7bb13e2ecbb7 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -657,6 +657,7 @@ public: const ResId &aLoad, const ResId &aSave, const ResId &aEmbed, const ResId &aTableName, XPropertyListType t, XOutdevItemPool* mpXPool ); + virtual ~SvxLoadSaveEmbed() {}; XPropertyListRef GetList(); void HideLoadSaveEmbed(); bool GetEmbed(); diff --git a/cui/source/inc/selector.hxx b/cui/source/inc/selector.hxx index 2959b0e7bfb6..d7c6641f2367 100644 --- a/cui/source/inc/selector.hxx +++ b/cui/source/inc/selector.hxx @@ -39,9 +39,6 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/script/browse/XBrowseNode.hpp> -#define _SVSTDARR_USHORTS -#define _SVSTDARR_STRINGSDTOR -#include <svl/svstdarr.hxx> // SvUShorts #include <sfx2/minarray.hxx> #define SVX_CFGGROUP_FUNCTION 1 diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index a8fe225571da..17a55efdd03a 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -315,15 +315,15 @@ void SvxProxyTabPage::ReadConfigData_Impl() } } - catch(container::NoSuchElementException &e) { + catch(container::NoSuchElementException &) { OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: NoSuchElementException caught" ); } - catch(com::sun::star::lang::WrappedTargetException &e) { + catch(com::sun::star::lang::WrappedTargetException &) { OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: WrappedTargetException caught" ); } - catch(RuntimeException &e) { + catch(RuntimeException &) { OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: RuntimeException caught" ); } @@ -373,16 +373,16 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl() aNoProxyForED.SetText( aStringValue ); } } - catch(beans::UnknownPropertyException &e) + catch(beans::UnknownPropertyException &) { OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: UnknownPropertyException caught" ); } - catch(com::sun::star::lang::WrappedTargetException &e) { + catch(com::sun::star::lang::WrappedTargetException &) { OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: WrappedTargetException caught" ); } - catch(RuntimeException &e) + catch(RuntimeException &) { OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: RuntimeException caught" ); } @@ -407,16 +407,16 @@ void SvxProxyTabPage::RestoreConfigDefaults_Impl() xChangesBatch->commitChanges(); } - catch(beans::UnknownPropertyException &e) + catch(beans::UnknownPropertyException &) { OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: UnknownPropertyException caught" ); } - catch(com::sun::star::lang::WrappedTargetException &e) { + catch(com::sun::star::lang::WrappedTargetException &) { OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: WrappedTargetException caught" ); } - catch(RuntimeException &e) + catch(RuntimeException &) { OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: RuntimeException caught" ); } @@ -512,23 +512,23 @@ sal_Bool SvxProxyTabPage::FillItemSet(SfxItemSet& ) xChangesBatch->commitChanges(); } - catch(com::sun::star::lang::IllegalArgumentException &e) { + catch(com::sun::star::lang::IllegalArgumentException &) { OSL_TRACE( "SvxProxyTabPage::FillItemSet: IllegalArgumentException caught" ); } - catch(beans::UnknownPropertyException &e) { + catch(beans::UnknownPropertyException &) { OSL_TRACE( "SvxProxyTabPage::FillItemSet: UnknownPropertyException caught" ); } - catch(beans::PropertyVetoException &e) { + catch(beans::PropertyVetoException &) { OSL_TRACE( "SvxProxyTabPage::FillItemSet: PropertyVetoException caught" ); } - catch(com::sun::star::lang::WrappedTargetException &e) { + catch(com::sun::star::lang::WrappedTargetException &) { OSL_TRACE( "SvxProxyTabPage::FillItemSet: WrappedTargetException caught" ); } - catch(RuntimeException &e) { + catch(RuntimeException &) { OSL_TRACE( "SvxProxyTabPage::FillItemSet: RuntimeException caught" ); } diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 7269fc821fdd..61ce1b230518 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1137,7 +1137,7 @@ SvxLinguTabPage::SvxLinguTabPage( Window* pParent, != SvtExtendedSecurityOptions::OPEN_NEVER ) { aMoreDictsLink.SetURL( String( - RTL_CONSTASCII_USTRINGPARAM( "http://extensions.libreoffice.org/dictionary/" ) ) ); + RTL_CONSTASCII_USTRINGPARAM( "http://extensions.libreoffice.org/dictionaries/" ) ) ); aMoreDictsLink.SetClickHdl( LINK( this, SvxLinguTabPage, OpenURLHdl_Impl ) ); } else @@ -2017,7 +2017,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(Window* pParent, SvxLinguData_Impl& rData) != SvtExtendedSecurityOptions::OPEN_NEVER ) { aMoreDictsLink.SetURL( String( - RTL_CONSTASCII_USTRINGPARAM( "http://extensions.libreoffice.org/dictionary/" ) ) ); + RTL_CONSTASCII_USTRINGPARAM( "http://extensions.libreoffice.org/dictionaries/" ) ) ); aMoreDictsLink.SetClickHdl( LINK( this, SvxEditModulesDlg, OpenURLHdl_Impl ) ); } else diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 44c250383c66..455b343e30fa 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -76,10 +76,6 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; -#define SQL_ISRULEOR2(pParseNode, e1,e2) ((pParseNode)->isRule() && (\ - (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \ - (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2))) - // here we define our functions used in the anonymous namespace to get our header file smaller // please look at the book LargeScale C++ to know why namespace @@ -1432,10 +1428,9 @@ namespace _pSelectionBrw->AddCondition(aDragLeft, aCondition, nLevel,bAddOrOnOneLine); } } - else if(SQL_ISRULEOR2(pValueExp,general_set_fct ,set_fct_spec) || - SQL_ISRULEOR2(pValueExp,position_exp,extract_exp) || - SQL_ISRULEOR2(pValueExp,fold,char_substring_fct) || - SQL_ISRULEOR2(pValueExp,length_exp,char_value_fct)) + else if(SQL_ISRULEOR3(pValueExp, general_set_fct, set_fct_spec, position_exp) || + SQL_ISRULEOR3(pValueExp, extract_exp, fold, char_substring_fct) || + SQL_ISRULEOR2(pValueExp, length_exp, char_value_fct)) { AddFunctionCondition( _pView, _pSelectionBrw, @@ -1528,10 +1523,10 @@ namespace OSQLParseNode* pFunction = pCondition->getChild(0); - OSL_ENSURE(SQL_ISRULEOR2(pFunction,general_set_fct ,set_fct_spec) || - SQL_ISRULEOR2(pFunction,position_exp,extract_exp) || - SQL_ISRULEOR2(pFunction,fold,char_substring_fct) || - SQL_ISRULEOR2(pFunction,length_exp,char_value_fct),"Illegal call!"); + OSL_ENSURE(SQL_ISRULEOR3(pFunction, general_set_fct, set_fct_spec, position_exp) || + SQL_ISRULEOR3(pFunction, extract_exp, fold, char_substring_fct) || + SQL_ISRULEOR2(pFunction,length_exp,char_value_fct), + "Illegal call!"); ::rtl::OUString aCondition; OTableFieldDescRef aDragLeft = new OTableFieldDesc(); @@ -2196,10 +2191,9 @@ namespace eErrorCode = _pView->InsertField(aInfo, sal_True, bFirstField); bFirstField = sal_False; } - else if(SQL_ISRULEOR2(pColumnRef,general_set_fct ,set_fct_spec) || - SQL_ISRULEOR2(pColumnRef,position_exp,extract_exp) || - SQL_ISRULEOR2(pColumnRef,fold,char_substring_fct) || - SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct)) + else if(SQL_ISRULEOR3(pColumnRef, general_set_fct, set_fct_spec, position_exp) || + SQL_ISRULEOR3(pColumnRef, extract_exp, fold, char_substring_fct) || + SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct)) { ::rtl::OUString aColumns; pColumnRef->parseNodeToPredicateStr(aColumns, @@ -2225,8 +2219,8 @@ namespace { if ( pParamRef && pParamRef->getTokenValue().toChar() == '*' ) { - OJoinTableView::OTableWindowMap::iterator aIter = pTabList->begin(); - OJoinTableView::OTableWindowMap::iterator aEnd = pTabList->end(); + OJoinTableView::OTableWindowMap::iterator aIter = pTabList->begin(); + const OJoinTableView::OTableWindowMap::const_iterator aEnd = pTabList->end(); for(;aIter != aEnd;++aIter) { OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second); @@ -3204,43 +3198,387 @@ bool OQueryDesignView::initByParseIterator( ::dbtools::SQLExceptionInfo* _pError } return eErrorCode == eOk; } + +// Utility function for fillFunctionInfo +namespace { + sal_Int32 char_datatype(const::connectivity::OSQLParseNode* pDataType, const unsigned int offset) { + int cnt = pDataType->count() - offset; + if ( cnt < 0 ) + { + OSL_FAIL("internal error in decoding character datatype specification"); + return DataType::VARCHAR; + } + else if ( cnt == 0 ) + { + if ( offset == 0 ) + { + // The datatype is the node itself + if ( SQL_ISTOKENOR2 (pDataType, CHARACTER, CHAR) ) + return DataType::CHAR; + else if ( SQL_ISTOKEN (pDataType, VARCHAR) ) + return DataType::VARCHAR; + else if ( SQL_ISTOKEN (pDataType, CLOB) ) + return DataType::CLOB; + else + { + OSL_FAIL("unknown/unexpected token in decoding character datatype specification"); + return DataType::VARCHAR; + } + } + else + { + // No child left to read! + OSL_FAIL("incomplete datatype in decoding character datatype specification"); + return DataType::VARCHAR; + } + } + + if ( SQL_ISTOKEN(pDataType->getChild(offset), NATIONAL) ) + return char_datatype(pDataType, offset+1); + else if ( SQL_ISTOKENOR3(pDataType->getChild(offset), CHARACTER, CHAR, NCHAR) ) + { + if ( cnt > 2 && SQL_ISTOKEN(pDataType->getChild(offset+1), LARGE) && SQL_ISTOKEN(pDataType->getChild(offset+2), OBJECT) ) + return DataType::CLOB; + else if ( cnt > 1 && SQL_ISTOKEN(pDataType->getChild(offset+1), VARYING) ) + return DataType::VARCHAR; + else + return DataType::CHAR; + } + else if ( SQL_ISTOKEN (pDataType->getChild(offset), VARCHAR) ) + return DataType::VARCHAR; + else if ( SQL_ISTOKENOR2 (pDataType->getChild(offset), CLOB, NCLOB) ) + return DataType::CLOB; + + OSL_FAIL("unrecognised character datatype"); + return DataType::VARCHAR; + } +} + //------------------------------------------------------------------------------ +// Try to guess the type of an expression in simple cases. +// Originally meant to be called only on a function call (hence the misnomer), +// but now tries to do the best it can also in other cases. +// Don't completely rely on fillFunctionInfo, +// it won't look at the function's arguments to find the return type +// (in particular, in the case of general_set_fct, +// the return type is the type of the argument; +// if that is (as is typical) a column reference, +// it is the type of the column). +// TODO: There is similar "guess the expression's type" code in several places: +// SelectionBrowseBox.cxx: OSelectionBrowseBox::saveField +// QueryDesignView.cxx: InstallFields, GetOrderCriteria, GetGroupCriteria +// If possible, they should be factorised into this function +// (which should then be renamed...) + void OQueryDesignView::fillFunctionInfo( const ::connectivity::OSQLParseNode* pNode ,const ::rtl::OUString& sFunctionTerm ,OTableFieldDescRef& aInfo) { - // get the type out of the funtion name + // get the type of the expression, as far as easily possible OQueryController& rController = static_cast<OQueryController&>(getController()); sal_Int32 nDataType = DataType::DOUBLE; - ::rtl::OUString sFieldName = sFunctionTerm; - const OSQLParseNode* pFunctionName; - // Fix fdo#38286 : crash when constant in the query - // TODO : is it possible to have a child or children in the pNode ? - // if not this part could be simplified - if (pNode->count()) - { - pFunctionName = pNode->getChild(0); - } - else - { - pFunctionName = pNode; - } - if ( !SQL_ISPUNCTUATION(pFunctionName,"{") ) - { - if ( SQL_ISRULEOR2(pNode,length_exp,char_value_fct) ) - pFunctionName = pFunctionName->getChild(0); + switch(pNode->getNodeType()) + { + case SQL_NODE_CONCAT: + case SQL_NODE_STRING: + nDataType = DataType::VARCHAR; + break; + case SQL_NODE_INTNUM: + nDataType = DataType::INTEGER; + break; + case SQL_NODE_APPROXNUM: + nDataType = DataType::DOUBLE; + break; + case SQL_NODE_DATE: + case SQL_NODE_ACCESS_DATE: + nDataType = DataType::TIMESTAMP; + break; + case SQL_NODE_COMPARISON: + case SQL_NODE_EQUAL: + case SQL_NODE_LESS: + case SQL_NODE_GREAT: + case SQL_NODE_LESSEQ: + case SQL_NODE_GREATEQ: + case SQL_NODE_NOTEQUAL: + nDataType = DataType::BOOLEAN; + break; + case SQL_NODE_NAME: + case SQL_NODE_LISTRULE: + case SQL_NODE_COMMALISTRULE: + case SQL_NODE_KEYWORD: + case SQL_NODE_AMMSC: //?? + case SQL_NODE_PUNCTUATION: + OSL_FAIL("Unexpected SQL Node Type"); + break; + case SQL_NODE_RULE: + switch(pNode->getKnownRuleID()) + { + case OSQLParseNode::select_statement: + case OSQLParseNode::table_exp: + case OSQLParseNode::table_ref_commalist: + case OSQLParseNode::table_ref: + case OSQLParseNode::catalog_name: + case OSQLParseNode::schema_name: + case OSQLParseNode::table_name: + case OSQLParseNode::opt_column_commalist: + case OSQLParseNode::column_commalist: + case OSQLParseNode::column_ref_commalist: + case OSQLParseNode::column_ref: + case OSQLParseNode::opt_order_by_clause: + case OSQLParseNode::ordering_spec_commalist: + case OSQLParseNode::ordering_spec: + case OSQLParseNode::opt_asc_desc: + case OSQLParseNode::where_clause: + case OSQLParseNode::opt_where_clause: + case OSQLParseNode::opt_escape: + case OSQLParseNode::scalar_exp_commalist: + case OSQLParseNode::scalar_exp: // Seems to never be generated? + case OSQLParseNode::parameter_ref: + case OSQLParseNode::parameter: + case OSQLParseNode::range_variable: + case OSQLParseNode::delete_statement_positioned: + case OSQLParseNode::delete_statement_searched: + case OSQLParseNode::update_statement_positioned: + case OSQLParseNode::update_statement_searched: + case OSQLParseNode::assignment_commalist: + case OSQLParseNode::assignment: + case OSQLParseNode::insert_statement: + case OSQLParseNode::insert_atom_commalist: + case OSQLParseNode::insert_atom: + case OSQLParseNode::from_clause: + case OSQLParseNode::qualified_join: + case OSQLParseNode::cross_union: + case OSQLParseNode::select_sublist: + case OSQLParseNode::join_type: + case OSQLParseNode::named_columns_join: + case OSQLParseNode::joined_table: + case OSQLParseNode::sql_not: + case OSQLParseNode::manipulative_statement: + case OSQLParseNode::value_exp_commalist: + case OSQLParseNode::union_statement: + case OSQLParseNode::outer_join_type: + case OSQLParseNode::selection: + case OSQLParseNode::base_table_def: + case OSQLParseNode::base_table_element_commalist: + case OSQLParseNode::data_type: + case OSQLParseNode::column_def: + case OSQLParseNode::table_node: + case OSQLParseNode::as: // Seems to never be generated? + case OSQLParseNode::op_column_commalist: + case OSQLParseNode::table_primary_as_range_column: + case OSQLParseNode::character_string_type: + OSL_FAIL("Unexpected SQL RuleID"); + break; + case OSQLParseNode::column: + case OSQLParseNode::column_val: + OSL_FAIL("Cannot guess column type"); + break; + case OSQLParseNode::values_or_query_spec: + OSL_FAIL("Cannot guess VALUES type"); + break; + case OSQLParseNode::derived_column: + OSL_FAIL("Cannot guess computed column type"); + break; + case OSQLParseNode::subquery: + OSL_FAIL("Cannot guess subquery return type"); + break; + case OSQLParseNode::search_condition: + case OSQLParseNode::comparison_predicate: + case OSQLParseNode::between_predicate: + case OSQLParseNode::like_predicate: + case OSQLParseNode::test_for_null: + case OSQLParseNode::predicate_check: // Seems to never be generated? + case OSQLParseNode::boolean_term: + case OSQLParseNode::boolean_primary: + case OSQLParseNode::in_predicate: + case OSQLParseNode::existence_test: + case OSQLParseNode::unique_test: + case OSQLParseNode::all_or_any_predicate: + case OSQLParseNode::join_condition: + case OSQLParseNode::boolean_factor: + case OSQLParseNode::boolean_test: + case OSQLParseNode::comparison_predicate_part_2: + case OSQLParseNode::parenthesized_boolean_value_expression: + case OSQLParseNode::other_like_predicate_part_2: + case OSQLParseNode::between_predicate_part_2: + nDataType = DataType::BOOLEAN; + break; + case OSQLParseNode::num_value_exp: + case OSQLParseNode::extract_exp: + case OSQLParseNode::term: + case OSQLParseNode::factor: + // Might by an integer or a float; take the most generic + nDataType = DataType::DOUBLE; + break; + case OSQLParseNode::value_exp_primary: + case OSQLParseNode::value_exp: + case OSQLParseNode::odbc_call_spec: + // Really, we don't know. Let the default. + break; + case OSQLParseNode::position_exp: + case OSQLParseNode::length_exp: + nDataType = DataType::INTEGER; + break; + case OSQLParseNode::char_value_exp: + case OSQLParseNode::char_value_fct: + case OSQLParseNode::fold: + case OSQLParseNode::char_substring_fct: + case OSQLParseNode::char_factor: + case OSQLParseNode::concatenation: + nDataType = DataType::VARCHAR; + break; + case OSQLParseNode::datetime_primary: + nDataType = DataType::TIMESTAMP; + break; + case OSQLParseNode::bit_value_fct: + nDataType = DataType::BINARY; + break; + case OSQLParseNode::general_set_fct: // May depend on argument; ignore that for now + case OSQLParseNode::set_fct_spec: + { + if (pNode->count() == 0) + { + // This is not a function call, no sense to continue with a function return type lookup + OSL_FAIL("Got leaf SQL node where non-leaf expected"); + break; + } + const OSQLParseNode* pFunctionName = pNode->getChild(0); + if ( SQL_ISPUNCTUATION(pFunctionName,"{") ) + { + if ( pNode->count() == 3 ) + return fillFunctionInfo( pNode->getChild(1), sFunctionTerm, aInfo ); + else + OSL_FAIL("ODBC escape not in recognised form"); + break; + } + else + { + if ( SQL_ISRULEOR2(pNode,length_exp,char_value_fct) ) + pFunctionName = pFunctionName->getChild(0); + + ::rtl::OUString sFunctionName = pFunctionName->getTokenValue(); + if ( !sFunctionName.getLength() ) + sFunctionName = ::rtl::OStringToOUString(OSQLParser::TokenIDToStr(pFunctionName->getTokenID()),RTL_TEXTENCODING_UTF8); - ::rtl::OUString sFunctionName = pFunctionName->getTokenValue(); - if ( !sFunctionName.getLength() ) - sFunctionName = ::rtl::OStringToOUString(OSQLParser::TokenIDToStr(pFunctionName->getTokenID()),RTL_TEXTENCODING_UTF8); + nDataType = OSQLParser::getFunctionReturnType( + sFunctionName + ,&rController.getParser().getContext()); + } + break; + } + case OSQLParseNode::odbc_fct_spec: + { + if (pNode->count() != 2) + { + OSL_FAIL("interior of ODBC escape not in recognised shape"); + break; + } - nDataType = OSQLParser::getFunctionReturnType( - sFunctionName - ,&rController.getParser().getContext()); + const OSQLParseNode* const pEscapeType = pNode->getChild(0); + if (SQL_ISTOKEN(pEscapeType, TS)) + nDataType = DataType::TIMESTAMP; + else if (SQL_ISTOKEN(pEscapeType, D)) + nDataType = DataType::DATE; + else if (SQL_ISTOKEN(pEscapeType, T)) + nDataType = DataType::TIME; + else if (SQL_ISTOKEN(pEscapeType, FN)) + return fillFunctionInfo( pNode->getChild(1), sFunctionTerm, aInfo ); + else + OSL_FAIL("Unknown ODBC escape"); + break; + } + case OSQLParseNode::cast_spec: + { + if ( pNode->count() != 6 || !SQL_ISTOKEN(pNode->getChild(3), AS) ) + { + OSL_FAIL("CAST not in recognised shape"); + break; + } + const OSQLParseNode *pCastTarget = pNode->getChild(4); + if ( SQL_ISTOKENOR2(pCastTarget, INTEGER, INT) ) + nDataType = DataType::INTEGER; + else if ( SQL_ISTOKEN(pCastTarget, SMALLINT) ) + nDataType = DataType::SMALLINT; + else if ( SQL_ISTOKEN(pCastTarget, BIGINT) ) + nDataType = DataType::BIGINT; + else if ( SQL_ISTOKEN(pCastTarget, FLOAT) ) + nDataType = DataType::FLOAT; + else if ( SQL_ISTOKEN(pCastTarget, REAL) ) + nDataType = DataType::REAL; + else if ( SQL_ISTOKEN(pCastTarget, DOUBLE) ) + nDataType = DataType::DOUBLE; + else if ( SQL_ISTOKEN(pCastTarget, BOOLEAN) ) + nDataType = DataType::BOOLEAN; + else if ( SQL_ISTOKEN(pCastTarget, DATE) ) + nDataType = DataType::DATE; + else if ( pCastTarget->count() > 0 ) + { + const OSQLParseNode *pDataType = pCastTarget->getChild(0); + while (pDataType->count() > 0) + { + pCastTarget = pDataType; + pDataType = pDataType->getChild(0); + } + if ( SQL_ISTOKEN (pDataType, TIME) ) + nDataType = DataType::TIME; + else if ( SQL_ISTOKEN (pDataType, TIMESTAMP) ) + nDataType = DataType::TIMESTAMP; + else if ( SQL_ISTOKENOR3 (pDataType, CHARACTER, CHAR, NCHAR) ) + nDataType = char_datatype(pCastTarget, 0); + else if ( SQL_ISTOKEN (pDataType, VARCHAR) ) + nDataType = DataType::VARCHAR; + else if ( SQL_ISTOKEN (pDataType, CLOB) ) + nDataType = DataType::CLOB; + else if ( SQL_ISTOKEN (pDataType, NATIONAL) ) + nDataType = char_datatype(pCastTarget, 1); + else if ( SQL_ISTOKEN (pDataType, BINARY) ) + { + if ( pCastTarget->count() > 2 && SQL_ISTOKEN(pCastTarget->getChild(1), LARGE) && SQL_ISTOKEN(pCastTarget->getChild(2), OBJECT) ) + nDataType = DataType::BLOB; + else if ( pCastTarget->count() > 1 && SQL_ISTOKEN(pCastTarget->getChild(1), VARYING) ) + nDataType = DataType::VARBINARY; + else + nDataType = DataType::BINARY; + } + else if ( SQL_ISTOKEN (pDataType, VARBINARY) ) + nDataType = DataType::VARBINARY; + else if ( SQL_ISTOKEN (pDataType, BLOB) ) + nDataType = DataType::BLOB; + else if ( SQL_ISTOKEN (pDataType, NUMERIC) ) + nDataType = DataType::NUMERIC; + else if ( SQL_ISTOKENOR2 (pDataType, DECIMAL, DEC) ) + nDataType = DataType::DECIMAL; + else if ( SQL_ISTOKEN (pDataType, FLOAT) ) + nDataType = DataType::FLOAT; + else if ( SQL_ISTOKEN (pDataType, DOUBLE) ) + nDataType = DataType::DOUBLE; + else if ( SQL_ISTOKEN (pDataType, TIME) ) + nDataType = DataType::TIME; + else if ( SQL_ISTOKEN (pDataType, TIMESTAMP) ) + nDataType = DataType::TIMESTAMP; + else if ( SQL_ISTOKEN (pDataType, INTERVAL) ) + // Not in DataType published constant (because not in JDBC...) + nDataType = DataType::VARCHAR; + else + OSL_FAIL("Failed to decode CAST target"); + } + else + OSL_FAIL("Could not decipher CAST target"); + break; + } + default: + OSL_FAIL("Unknown SQL RuleID"); + break; + } + break; + default: + OSL_FAIL("Unknown SQL Node Type"); + break; } + aInfo->SetDataType(nDataType); aInfo->SetFieldType(TAB_NORMAL_FIELD); - aInfo->SetField(sFieldName); + aInfo->SetField(sFunctionTerm); aInfo->SetTabWindow(NULL); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 35654a876fba..8b9330e0b7cd 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -71,11 +71,6 @@ const String g_strZero = String::CreateFromAscii("0"); #define HANDLE_ID 0 #define HANDLE_COLUMN_WITDH 70 -#define SQL_ISRULEOR2(pParseNode, e1,e2) ((pParseNode)->isRule() && (\ - (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e1) || \ - (pParseNode)->getRuleID() == OSQLParser::RuleID(OSQLParseNode::e2))) - - // ----------------------------------------------------------------------------- namespace { @@ -803,105 +798,93 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes // and the function is different to count clearEntryFunctionField(_sFieldName,aSelEntry,_bListAction,nColumnId); } - else + // do we have a aggregate function and only a function? + else if ( SQL_ISRULE(pColumnRef,general_set_fct) ) { - // first check if we have a aggregate function and only a function - if ( SQL_ISRULE(pColumnRef,general_set_fct) ) + String sLocalizedFunctionName; + if ( GetFunctionName(pColumnRef->getChild(0)->getTokenID(),sLocalizedFunctionName) ) { - String sLocalizedFunctionName; - if ( GetFunctionName(pColumnRef->getChild(0)->getTokenID(),sLocalizedFunctionName) ) + String sOldLocalizedFunctionName = aSelEntry->GetFunction(); + aSelEntry->SetFunction(sLocalizedFunctionName); + sal_uInt32 nFunCount = pColumnRef->count() - 1; + sal_Int32 nFunctionType = FKT_AGGREGATE; + sal_Bool bQuote = sal_False; + // may be there exists only one parameter which is a column, fill all information into our fields + if ( nFunCount == 4 && SQL_ISRULE(pColumnRef->getChild(3),column_ref) ) + bError = fillColumnRef( pColumnRef->getChild(3), xConnection, aSelEntry, _bListAction ); + else if ( nFunCount == 3 ) // we have a COUNT(*) here, so take the first table + bError = fillColumnRef( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")), ::rtl::OUString(), xMetaData, aSelEntry, _bListAction ); + else { - String sOldLocalizedFunctionName = aSelEntry->GetFunction(); - aSelEntry->SetFunction(sLocalizedFunctionName); - sal_uInt32 nFunCount = pColumnRef->count() - 1; - sal_Int32 nFunctionType = FKT_AGGREGATE; - sal_Bool bQuote = sal_False; - // may be there exists only one parameter which is a column, fill all information into our fields - if ( nFunCount == 4 && SQL_ISRULE(pColumnRef->getChild(3),column_ref) ) - bError = fillColumnRef( pColumnRef->getChild(3), xConnection, aSelEntry, _bListAction ); - else if ( nFunCount == 3 ) // we have a COUNT(*) here, so take the first table - bError = fillColumnRef( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")), ::rtl::OUString(), xMetaData, aSelEntry, _bListAction ); - else - { - nFunctionType |= FKT_NUMERIC; - bQuote = sal_True; - aSelEntry->SetDataType(DataType::DOUBLE); - aSelEntry->SetFieldType(TAB_NORMAL_FIELD); - } - - // now parse the parameters - ::rtl::OUString sParameters; - for(sal_uInt32 function = 2; function < nFunCount; ++function) // we only want to parse the parameters of the function - pColumnRef->getChild(function)->parseNodeToStr( sParameters, xConnection, &rParser.getContext(), sal_True, bQuote ); + nFunctionType |= FKT_NUMERIC; + bQuote = sal_True; + aSelEntry->SetDataType(DataType::DOUBLE); + aSelEntry->SetFieldType(TAB_NORMAL_FIELD); + } - aSelEntry->SetFunctionType(nFunctionType); - aSelEntry->SetField(sParameters); - if ( aSelEntry->IsGroupBy() ) - { - sOldLocalizedFunctionName = m_aFunctionStrings.GetToken(m_aFunctionStrings.GetTokenCount()-1); - aSelEntry->SetGroupBy(sal_False); - } + // now parse the parameters + ::rtl::OUString sParameters; + for(sal_uInt32 function = 2; function < nFunCount; ++function) // we only want to parse the parameters of the function + pColumnRef->getChild(function)->parseNodeToStr( sParameters, xConnection, &rParser.getContext(), sal_True, bQuote ); - // append undo action - notifyFunctionFieldChanged(sOldLocalizedFunctionName,sLocalizedFunctionName,_bListAction, nColumnId); + aSelEntry->SetFunctionType(nFunctionType); + aSelEntry->SetField(sParameters); + if ( aSelEntry->IsGroupBy() ) + { + sOldLocalizedFunctionName = m_aFunctionStrings.GetToken(m_aFunctionStrings.GetTokenCount()-1); + aSelEntry->SetGroupBy(sal_False); } - else - OSL_FAIL("Unsupported function inserted!"); + // append undo action + notifyFunctionFieldChanged(sOldLocalizedFunctionName,sLocalizedFunctionName,_bListAction, nColumnId); } else + OSL_FAIL("Unsupported function inserted!"); + + } + else + { + // so we first clear the function field + clearEntryFunctionField(_sFieldName,aSelEntry,_bListAction,nColumnId); + ::rtl::OUString sFunction; + pColumnRef->parseNodeToStr( sFunction, + xConnection, + &rController.getParser().getContext(), + sal_True, + sal_True); // quote is to true because we need quoted elements inside the function + + getDesignView()->fillFunctionInfo(pColumnRef,sFunction,aSelEntry); + + if( SQL_ISRULEOR3(pColumnRef, position_exp, extract_exp, fold) || + SQL_ISRULEOR3(pColumnRef, char_substring_fct, length_exp, char_value_fct) ) + // a calculation has been found ( can be calc and function ) { - // so we first clear the function field - clearEntryFunctionField(_sFieldName,aSelEntry,_bListAction,nColumnId); - ::rtl::OUString sFunction; - pColumnRef->parseNodeToStr( sFunction, - xConnection, - &rController.getParser().getContext(), - sal_True, - sal_True); // quote is to true because we need quoted elements inside the function - - getDesignView()->fillFunctionInfo(pColumnRef,sFunction,aSelEntry); - - if( SQL_ISRULEOR2(pColumnRef,position_exp,extract_exp) || - SQL_ISRULEOR2(pColumnRef,fold,char_substring_fct) || - SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct) ) - // a calculation has been found ( can be calc and function ) - { - // now parse the whole statement - sal_uInt32 nFunCount = pColumnRef->count(); - ::rtl::OUString sParameters; - for(sal_uInt32 function = 0; function < nFunCount; ++function) - pColumnRef->getChild(function)->parseNodeToStr( sParameters, xConnection, &rParser.getContext(), sal_True, sal_True ); - - sOldAlias = aSelEntry->GetAlias(); - sal_Int32 nNewFunctionType = aSelEntry->GetFunctionType() | FKT_NUMERIC | FKT_OTHER; - aSelEntry->SetFunctionType(nNewFunctionType); - aSelEntry->SetField(sParameters); - } + // now parse the whole statement + sal_uInt32 nFunCount = pColumnRef->count(); + ::rtl::OUString sParameters; + for(sal_uInt32 function = 0; function < nFunCount; ++function) + pColumnRef->getChild(function)->parseNodeToStr( sParameters, xConnection, &rParser.getContext(), sal_True, sal_True ); + + sOldAlias = aSelEntry->GetAlias(); + sal_Int32 nNewFunctionType = aSelEntry->GetFunctionType() | FKT_NUMERIC | FKT_OTHER; + aSelEntry->SetFunctionType(nNewFunctionType); + aSelEntry->SetField(sParameters); + } + else + { + aSelEntry->SetFieldAlias(sColumnAlias); + if ( SQL_ISRULE(pColumnRef,set_fct_spec) ) + aSelEntry->SetFunctionType(/*FKT_NUMERIC | */FKT_OTHER); else - { - aSelEntry->SetFieldAlias(sColumnAlias); - if ( SQL_ISRULE(pColumnRef,set_fct_spec) ) - aSelEntry->SetFunctionType(/*FKT_NUMERIC | */FKT_OTHER); - else - { - if ( SQL_ISRULEOR2(pColumnRef,num_value_exp,term) || SQL_ISRULE(pColumnRef,factor) ) - aSelEntry->SetDataType(DataType::DOUBLE); - else if ( SQL_ISRULE(pColumnRef,value_exp) ) - aSelEntry->SetDataType(DataType::TIMESTAMP); - else - aSelEntry->SetDataType(DataType::VARCHAR); - aSelEntry->SetFunctionType(FKT_NUMERIC | FKT_OTHER); - } - } - - aSelEntry->SetAlias(::rtl::OUString()); - notifyTableFieldChanged(sOldAlias,aSelEntry->GetAlias(),_bListAction, nColumnId); + aSelEntry->SetFunctionType(FKT_NUMERIC | FKT_OTHER); } + aSelEntry->SetAlias(::rtl::OUString()); + notifyTableFieldChanged(sOldAlias,aSelEntry->GetAlias(),_bListAction, nColumnId); } + if ( i > 0 && !InsertField(aSelEntry,BROWSER_INVALIDID,sal_True,sal_False).is() ) // may we have to append more than one field - { // the field could not be isnerted + { // the field could not be inserted String sErrorMessage( ModuleRes( RID_STR_FIELD_DOESNT_EXIST ) ); sErrorMessage.SearchAndReplaceAscii("$name$",aSelEntry->GetField()); OSQLWarningBox( this, sErrorMessage ).Execute(); diff --git a/desktop/Executable_soffice.bin.mk b/desktop/Executable_soffice.bin.mk index 7731aefd6e1e..3953b26508b6 100644 --- a/desktop/Executable_soffice.bin.mk +++ b/desktop/Executable_soffice.bin.mk @@ -69,13 +69,25 @@ $(eval $(call gb_Executable_add_noexception_objects,$(sofficebin),\ desktop/win32/source/extendloaderenvironment \ )) -# the resulting executable is called soffice_bin.exe, copy it to soffice.bin -$(eval $(call gb_Package_Package,$(sofficebin),$(OUTDIR)/bin)) -$(eval $(call gb_Package_add_file,$(sofficebin),bin/soffice.bin,$(sofficebin).exe)) +$(call gb_Executable_get_target,$(sofficebin)) : $(OUTDIR)/bin/soffice.bin +$(call gb_Executable_get_clean_target,$(sofficebin)) : $(WORKDIR)/Clean/OutDir/bin/soffice.bin +$(OUTDIR)/bin/soffice.bin : $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(sofficebin))) + $(call gb_Deliver_deliver,$<,$@) + +.PHONY : $(WORKDIR)/Clean/OutDir/bin/soffice.bin +$(WORKDIR)/Clean/OutDir/bin/soffice.bin : + rm $(OUTDIR)/bin/soffice.bin ifeq ($(COM),MSC) -# also copy the manifest -$(eval $(call gb_Package_add_file,$(sofficebin),bin/soffice.bin.manifest,$(sofficebin).exe.manifest)) +$(call gb_Executable_get_target,$(sofficebin)) : $(OUTDIR)/bin/soffice.bin.manifest +$(call gb_Executable_get_clean_target,$(sofficebin)) : $(WORKDIR)/Clean/OutDir/bin/soffice.bin.manifest +$(OUTDIR)/bin/soffice.bin.manifest : $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(sofficebin))).manifest $(call gb_LinkTarget_get_target,$(call gb_Executable_get_linktargetname,$(sofficebin))) + $(call gb_Deliver_deliver,$<,$@) + +.PHONY : $(WORKDIR)/Clean/OutDir/bin/soffice.bin.manifest +$(WORKDIR)/Clean/OutDir/bin/soffice.bin.manifest : + rm $(OUTDIR)/bin/soffice.bin.manifest + endif endif diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index b63ee06d8ed6..be33faca1b9e 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -776,6 +776,7 @@ void Desktop::ensureProcessServiceFactory() } catch (const css::uno::Exception& e) { + (void)e; OSL_FAIL(rtl::OUStringToOString(e.Message, osl_getThreadTextEncoding()).getStr()); // let exceptions escape and tear down the process, it is // completely broken anyway diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index cbb0bf53abad..672364d9645f 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -677,8 +677,13 @@ void Package::processPackage_impl( xCmdEnv ); } } - catch (RuntimeException &) { - OSL_FAIL( "### unexpected RuntimeException!" ); + catch (RuntimeException &e) { + (void) e; // avoid warnings + OSL_FAIL( + OSL_FORMAT( + "unexpected RuntimeException \"%s\"", + (rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8). + getStr()))); throw; } catch (CommandFailedException &) { diff --git a/desktop/win32/source/applauncher/sbase.cxx b/desktop/win32/source/applauncher/sbase.cxx index 9a1f31d3dce0..5fbbd157927f 100644 --- a/desktop/win32/source/applauncher/sbase.cxx +++ b/desktop/win32/source/applauncher/sbase.cxx @@ -32,6 +32,6 @@ #include "launcher.hxx" -_TCHAR APPLICATION_SWITCH[] = _T( "-base" ); +_TCHAR APPLICATION_SWITCH[] = _T( "--base" ); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/win32/source/applauncher/scalc.cxx b/desktop/win32/source/applauncher/scalc.cxx index ceca63e14450..1a56bd635980 100644 --- a/desktop/win32/source/applauncher/scalc.cxx +++ b/desktop/win32/source/applauncher/scalc.cxx @@ -32,6 +32,6 @@ #include "launcher.hxx" -_TCHAR APPLICATION_SWITCH[] = _T( "-calc" ); +_TCHAR APPLICATION_SWITCH[] = _T( "--calc" ); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/win32/source/applauncher/sdraw.cxx b/desktop/win32/source/applauncher/sdraw.cxx index 034a7c4f949c..e3f0a5364769 100644 --- a/desktop/win32/source/applauncher/sdraw.cxx +++ b/desktop/win32/source/applauncher/sdraw.cxx @@ -32,6 +32,6 @@ #include "launcher.hxx" -_TCHAR APPLICATION_SWITCH[] = _T( "-draw" ); +_TCHAR APPLICATION_SWITCH[] = _T( "--draw" ); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/win32/source/applauncher/simpress.cxx b/desktop/win32/source/applauncher/simpress.cxx index cd01d01b346d..9397e246b437 100644 --- a/desktop/win32/source/applauncher/simpress.cxx +++ b/desktop/win32/source/applauncher/simpress.cxx @@ -32,6 +32,6 @@ #include "launcher.hxx" -_TCHAR APPLICATION_SWITCH[] = _T( "-impress" ); +_TCHAR APPLICATION_SWITCH[] = _T( "--impress" ); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/win32/source/applauncher/smath.cxx b/desktop/win32/source/applauncher/smath.cxx index 3e670cd8e692..d1e50c5c9642 100644 --- a/desktop/win32/source/applauncher/smath.cxx +++ b/desktop/win32/source/applauncher/smath.cxx @@ -32,6 +32,6 @@ #include "launcher.hxx" -_TCHAR APPLICATION_SWITCH[] = _T( "-math" ); +_TCHAR APPLICATION_SWITCH[] = _T( "--math" ); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/win32/source/applauncher/sweb.cxx b/desktop/win32/source/applauncher/sweb.cxx index 1c2fd8eabd6c..bbe2c7724bda 100644 --- a/desktop/win32/source/applauncher/sweb.cxx +++ b/desktop/win32/source/applauncher/sweb.cxx @@ -32,6 +32,6 @@ #include "launcher.hxx" -_TCHAR APPLICATION_SWITCH[] = _T( "-web" ); +_TCHAR APPLICATION_SWITCH[] = _T( "--web" ); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/win32/source/applauncher/swriter.cxx b/desktop/win32/source/applauncher/swriter.cxx index 1909cb97cded..5e4100387a2e 100644 --- a/desktop/win32/source/applauncher/swriter.cxx +++ b/desktop/win32/source/applauncher/swriter.cxx @@ -30,6 +30,6 @@ #include "launcher.hxx" -_TCHAR APPLICATION_SWITCH[] = _T( "-writer" ); +_TCHAR APPLICATION_SWITCH[] = _T( "--writer" ); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index e2e0c5994142..967e1e740757 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -3107,7 +3107,7 @@ namespace // and makes the code less dependent from those Metafile Add-Ons const MetaCommentAction* pA = (const MetaCommentAction*)pAction; - if(COMPARE_EQUAL == pA->GetComment().CompareIgnoreCaseToAscii("XGRAD_SEQ_BEGIN")) + if (pA->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN"))) { // XGRAD_SEQ_BEGIN, XGRAD_SEQ_END should be supported since the // pure recorded paint of the gradients uses the XOR paint functionality @@ -3127,7 +3127,7 @@ namespace } else if(META_COMMENT_ACTION == pAction->GetType()) { - if(COMPARE_EQUAL == ((const MetaCommentAction*)pAction)->GetComment().CompareIgnoreCaseToAscii("XGRAD_SEQ_END")) + if (((const MetaCommentAction*)pAction)->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END"))) { bDone = true; } diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx index 9346ac7bfbdc..31f08248ff9c 100644 --- a/editeng/inc/editeng/editview.hxx +++ b/editeng/inc/editeng/editview.hxx @@ -148,10 +148,6 @@ public: sal_Bool MouseMove( const MouseEvent& rMouseEvent ); void Command( const CommandEvent& rCEvt ); - sal_Bool Drop( const DropEvent& rEvt ); - sal_Bool QueryDrop( DropEvent& rEvt ); - ESelection GetDropPos(); - void Cut(); void Copy(); void Paste(); diff --git a/editeng/inc/editeng/svxrtf.hxx b/editeng/inc/editeng/svxrtf.hxx index f1e932134eac..125ce5535a3f 100644 --- a/editeng/inc/editeng/svxrtf.hxx +++ b/editeng/inc/editeng/svxrtf.hxx @@ -34,8 +34,6 @@ #include <svl/itemset.hxx> #include <svtools/parrtf.hxx> -#define _SVSTDARR_sal_uInt16S -#include <svl/svstdarr.hxx> #include <editeng/editengdllapi.h> #include <deque> @@ -231,9 +229,9 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser SvxRTFItemStack aAttrStack; SvxRTFItemStackList aAttrSetList; - SvUShorts aPlainMap; - SvUShorts aPardMap; - SvUShorts aWhichMap; + std::vector<sal_uInt16> aPlainMap; + std::vector<sal_uInt16> aPardMap; + std::vector<sal_uInt16> aWhichMap; String sBaseURL; SvxPosition* pInsPos; @@ -360,8 +358,8 @@ protected: // Query/Set the mapping IDs for the Pard/Plain attributes //(Set: It is noted in the pointers, which thus does not create a copy) - void AddPardAttr( sal_uInt16 nWhich ) { aPardMap.Insert( nWhich, aPardMap.Count() ); } - void AddPlainAttr( sal_uInt16 nWhich ) { aPlainMap.Insert( nWhich, aPlainMap.Count() ); } + void AddPardAttr( sal_uInt16 nWhich ) { aPardMap.push_back( nWhich ); } + void AddPlainAttr( sal_uInt16 nWhich ) { aPlainMap.push_back( nWhich ); } SvxRTFStyleTbl& GetStyleTbl() { return aStyleTbl; } SvxRTFItemStack& GetAttrStack() { return aAttrStack; } @@ -393,9 +391,9 @@ public: void SetAttrPool( SfxItemPool* pNewPool ) { pAttrPool = pNewPool; } // to set different WhichIds for a different pool. RTFPardAttrMapIds& GetPardMap() - { return (RTFPardAttrMapIds&)*aPardMap.GetData(); } + { return (RTFPardAttrMapIds&)*aPardMap.begin(); } RTFPlainAttrMapIds& GetPlainMap() - { return (RTFPlainAttrMapIds&)*aPlainMap.GetData(); } + { return (RTFPlainAttrMapIds&)*aPlainMap.begin(); } // to be able to assign them from the outside as for example table cells void ReadBorderAttr( int nToken, SfxItemSet& rSet, int bTableDef=sal_False ); void ReadBackgroundAttr( int nToken, SfxItemSet& rSet, int bTableDef=sal_False ); diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 80193d018589..764ecead5e96 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -487,6 +487,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox ) InfoBox(0, String( RTL_CONSTASCII_USTRINGPARAM( "D:\\DEBUG.LOG !" ) ) ).Execute(); } +#if OSL_DEBUG_LEVEL > 2 sal_Bool ParaPortion::DbgCheckTextPortions() { // check, if Portion length ok: @@ -495,6 +496,7 @@ sal_Bool ParaPortion::DbgCheckTextPortions() nXLen = nXLen + aTextPortionList[nPortion]->GetLen(); return nXLen == pNode->Len() ? sal_True : sal_False; } +#endif sal_Bool CheckOrderedList( CharAttribArray& rAttribs, sal_Bool bStart ) { diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index a51d07122f37..a8e29bc28454 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -627,8 +627,9 @@ public: short GetInvalidDiff() const { return nInvalidDiff; } void CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ); - +#if OSL_DEBUG_LEVEL > 2 sal_Bool DbgCheckTextPortions(); +#endif }; typedef ParaPortion* ParaPortionPtr; diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index b0df9d0aab35..919e40ffd77b 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -746,22 +746,6 @@ void EditView::InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::d PIMPEE->FormatAndUpdate( this ); } -sal_Bool EditView::Drop( const DropEvent& ) -{ - return sal_False; -} - -ESelection EditView::GetDropPos() -{ - OSL_FAIL( "GetDropPos - Why?!" ); - return ESelection(); -} - -sal_Bool EditView::QueryDrop( DropEvent& ) -{ - return sal_False; -} - void EditView::SetEditEngineUpdateMode( sal_Bool bUpdate ) { DBG_CHKTHIS( EditView, 0 ); diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index d97c05b3d67f..e04113ef6a87 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -109,14 +109,14 @@ inline const SvxLRSpaceItem& GetLRSpace(const SfxItemSet& rSet,sal_uInt16 nId,sa inline const SvxULSpaceItem& GetULSpace(const SfxItemSet& rSet,sal_uInt16 nId,sal_Bool bInP=sal_True) { return (const SvxULSpaceItem&)rSet.Get( nId,bInP); } -#define PARDID ((RTFPardAttrMapIds*)aPardMap.GetData()) -#define PLAINID ((RTFPlainAttrMapIds*)aPlainMap.GetData()) +#define PARDID ((RTFPardAttrMapIds*)&aPardMap[0]) +#define PLAINID ((RTFPlainAttrMapIds*)&aPlainMap[0]) void SvxRTFParser::SetScriptAttr( RTF_CharTypeDef eType, SfxItemSet& rSet, SfxPoolItem& rItem ) { const sal_uInt16 *pNormal = 0, *pCJK = 0, *pCTL = 0; - const RTFPlainAttrMapIds* pIds = (RTFPlainAttrMapIds*)aPlainMap.GetData(); + const RTFPlainAttrMapIds* pIds = (RTFPlainAttrMapIds*)&aPlainMap[0]; switch( rItem.Which() ) { case SID_ATTR_CHAR_FONT: @@ -1761,13 +1761,13 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) if( bPard ) { pAkt->nStyleNo = 0; - pPtr = aPardMap.GetData(); - nCnt = aPardMap.Count(); + pPtr = &aPardMap[0]; + nCnt = aPardMap.size(); } else { - pPtr = aPlainMap.GetData(); - nCnt = aPlainMap.Count(); + pPtr = &aPlainMap[0]; + nCnt = aPlainMap.size(); } for( sal_uInt16 n = 0; n < nCnt; ++n, ++pPtr ) @@ -1827,7 +1827,7 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) if( !bNewDoc ) return; - SfxItemSet aTmp( *pAttrPool, aWhichMap.GetData() ); + SfxItemSet aTmp( *pAttrPool, &aWhichMap[0] ); sal_Bool bOldFlag = bIsLeftToRightDef; bIsLeftToRightDef = sal_True; switch( nToken ) diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index e24905345aea..beec9c66a21b 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -94,13 +94,13 @@ SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& rIn, { RTFPlainAttrMapIds aTmp( rPool ); - aPlainMap.Insert( (sal_uInt16*)&aTmp, - sizeof( RTFPlainAttrMapIds ) / sizeof(sal_uInt16), 0 ); + aPlainMap.insert( aPlainMap.begin(), (sal_uInt16*)&aTmp, + (sal_uInt16*)&aTmp + (sizeof( RTFPlainAttrMapIds ) / sizeof(sal_uInt16)) ); } { RTFPardAttrMapIds aTmp( rPool ); - aPardMap.Insert( (sal_uInt16*)&aTmp, - sizeof( RTFPardAttrMapIds ) / sizeof(sal_uInt16), 0 ); + aPardMap.insert( aPardMap.begin(), (sal_uInt16*)&aTmp, + (sal_uInt16*)&aTmp + (sizeof( RTFPardAttrMapIds ) / sizeof(sal_uInt16)) ); } pDfltFont = new Font; pDfltColor = new Color; @@ -340,7 +340,7 @@ void SvxRTFParser::ReadStyleTable() int nToken, bSaveChkStyleAttr = bChkStyleAttr; short nStyleNo = 0; int _nOpenBrakets = 1; // the first was already detected earlier!! - SvxRTFStyleType* pStyle = new SvxRTFStyleType( *pAttrPool, aWhichMap.GetData() ); + SvxRTFStyleType* pStyle = new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] ); pStyle->aAttrSet.Put( GetRTFDefaults() ); bIsInReadStyleTab = sal_True; @@ -396,7 +396,7 @@ void SvxRTFParser::ReadStyleTable() } // All data from the font is available, so off to the table aStyleTbl.Insert( nStyleNo, pStyle ); - pStyle = new SvxRTFStyleType( *pAttrPool, aWhichMap.GetData() ); + pStyle = new SvxRTFStyleType( *pAttrPool, &aWhichMap[0] ); pStyle->aAttrSet.Put( GetRTFDefaults() ); nStyleNo = 0; } @@ -841,7 +841,7 @@ const Font& SvxRTFParser::GetFont( sal_uInt16 nId ) { const SvxFontItem& rDfltFont = (const SvxFontItem&) pAttrPool->GetDefaultItem( - ((RTFPlainAttrMapIds*)aPlainMap.GetData())->nFont ); + ((RTFPlainAttrMapIds*)&aPlainMap[0])->nFont ); pDfltFont->SetName( rDfltFont.GetStyleName() ); pDfltFont->SetFamily( rDfltFont.GetFamily() ); pFont = pDfltFont; @@ -856,7 +856,7 @@ SvxRTFItemStackType* SvxRTFParser::_GetAttrSet( int bCopyAttr ) if( pAkt ) pNew = new SvxRTFItemStackType( *pAkt, *pInsPos, bCopyAttr ); else - pNew = new SvxRTFItemStackType( *pAttrPool, aWhichMap.GetData(), + pNew = new SvxRTFItemStackType( *pAttrPool, &aWhichMap[0], *pInsPos ); pNew->SetRTFDefaults( GetRTFDefaults() ); @@ -982,7 +982,7 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack pNew->aAttrSet.SetParent( pOld->aAttrSet.GetParent() ); // Delete all paragraph attributes from pNew - for( sal_uInt16 n = 0; n < aPardMap.Count() && + for( sal_uInt16 n = 0; n < aPardMap.size() && pNew->aAttrSet.Count(); ++n ) if( aPardMap[n] ) pNew->aAttrSet.ClearItem( aPardMap[n] ); @@ -1132,24 +1132,23 @@ void SvxRTFParser::SetAttrInDoc( SvxRTFItemStackType & ) void SvxRTFParser::BuildWhichTbl() { - if( aWhichMap.Count() ) - aWhichMap.Remove( 0, aWhichMap.Count() ); - aWhichMap.Insert( (sal_uInt16)0, (sal_uInt16)0 ); + aWhichMap.clear(); + aWhichMap.push_back( 0 ); // Building a Which-Map 'rWhichMap' from an Array of // 'pWhichIds' frm Which-Ids. It has the long 'nWhichIds'. // The Which-Map is not going to be deleted. - SvParser::BuildWhichTbl( aWhichMap, (sal_uInt16*)aPardMap.GetData(), aPardMap.Count() ); - SvParser::BuildWhichTbl( aWhichMap, (sal_uInt16*)aPlainMap.GetData(), aPlainMap.Count() ); + SvParser::BuildWhichTbl( aWhichMap, (sal_uInt16*)&aPardMap[0], aPardMap.size() ); + SvParser::BuildWhichTbl( aWhichMap, (sal_uInt16*)&aPlainMap[0], aPlainMap.size() ); } const SfxItemSet& SvxRTFParser::GetRTFDefaults() { if( !pRTFDefaults ) { - pRTFDefaults = new SfxItemSet( *pAttrPool, aWhichMap.GetData() ); + pRTFDefaults = new SfxItemSet( *pAttrPool, &aWhichMap[0] ); sal_uInt16 nId; - if( 0 != ( nId = ((RTFPardAttrMapIds*)aPardMap.GetData())->nScriptSpace )) + if( 0 != ( nId = ((RTFPardAttrMapIds*)&aPardMap[0])->nScriptSpace )) { SvxScriptSpaceItem aItem( sal_False, nId ); if( bNewDoc ) diff --git a/filter/source/flash/swfdialog.cxx b/filter/source/flash/swfdialog.cxx index 6520341f60e9..d86bfe2fd57f 100644 --- a/filter/source/flash/swfdialog.cxx +++ b/filter/source/flash/swfdialog.cxx @@ -101,9 +101,7 @@ Reference< XInterface > SAL_CALL SWFDialog_createInstance( const Reference< XMul SWFDialog::SWFDialog( const Reference< XMultiServiceFactory > &rxMSF ) : OGenericUnoDialog( rxMSF ) { - ByteString aResMgrName( "flash" ); - - mpResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); + mpResMgr = ResMgr::CreateResMgr( "flash", Application::GetSettings().GetUILocale() ); } // ----------------------------------------------------------------------------- diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index ebb5238cc954..4a4abf9907ee 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -1658,7 +1658,7 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) const sal_uInt8* pData = pA->GetData(); String aSkipComment; - if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL ) + if( pA->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN")) ) { const MetaGradientExAction* pGradAction = NULL; sal_Bool bDone = sal_False; @@ -1670,7 +1670,7 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) if( pAction->GetType() == META_GRADIENTEX_ACTION ) pGradAction = (const MetaGradientExAction*) pAction; else if( ( pAction->GetType() == META_COMMENT_ACTION ) && - ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) ) + ( ( (const MetaCommentAction*) pAction )->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END")) ) ) { bDone = sal_True; } @@ -1679,7 +1679,7 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) if( pGradAction ) Impl_writeGradientEx( pGradAction->GetPolyPolygon(), pGradAction->GetGradient()); } - else if( pA->GetComment().CompareIgnoreCaseToAscii( "XPATHFILL_SEQ_BEGIN" ) == COMPARE_EQUAL && + else if( pA->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) && pData ) { @@ -1703,14 +1703,14 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) pAction = rMtf.GetAction( i ); if( ( pAction->GetType() == META_COMMENT_ACTION ) && - ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XPATHFILL_SEQ_END" ) == COMPARE_EQUAL ) ) + ( ( (const MetaCommentAction*) pAction )->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END")) ) ) { bDone = sal_True; } } } } - else if( pA->GetComment().CompareIgnoreCaseToAscii( "XPATHSTROKE_SEQ_BEGIN" ) == COMPARE_EQUAL && + else if( pA->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN")) && pData ) { @@ -1734,37 +1734,13 @@ void Writer::Impl_writeActions( const GDIMetaFile& rMtf ) pAction = rMtf.GetAction( i ); if( ( pAction->GetType() == META_COMMENT_ACTION ) && - ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XPATHSTROKE_SEQ_END" ) == COMPARE_EQUAL ) ) + ( ( (const MetaCommentAction*) pAction )->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_END")) ) ) { bDone = sal_True; } } } } -#if 0 - else if( pA->GetComment().CompareIgnoreCaseToAscii( "FIELD_SEQ_BEGIN;PageField" ) == COMPARE_EQUAL ) - { - bool bDone = sal_False; - - while( !bDone && ( ++i < nCount ) ) - { - pAction = rMtf.GetAction( i ); - - if( pAction->GetType() == META_TEXTARRAY_ACTION ) - { - const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction; - Rectangle aRect( pA->GetPoint(), Size( 100, 100 ) ); - Impl_writePageField( aRect ); - } - - if( ( pAction->GetType() == META_COMMENT_ACTION ) && - ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "FIELD_SEQ_END" ) == COMPARE_EQUAL ) ) - { - bDone = sal_True; - } - } - } -#endif } break; diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx index 8d874303b56f..fffe2ebb4ebe 100644 --- a/filter/source/graphicfilter/eos2met/eos2met.cxx +++ b/filter/source/graphicfilter/eos2met/eos2met.cxx @@ -492,11 +492,12 @@ void METWriter::WriteChrSets() *pMET << (sal_uInt8)0x03 << (sal_uInt8)0x52; *pMET << (sal_uInt8)0x24 << (sal_uInt8)0x02 << (sal_uInt8)0x08 << (sal_uInt8)0x00; - ByteString n(pCS->aName, gsl_getSystemTextEncoding()); + rtl::OString n(rtl::OUStringToOString(pCS->aName, + osl_getThreadTextEncoding())); for (i=0; i<32; i++) { if ( i == 0 || c != 0 ) - c = n.GetChar( i ); + c = n[i]; *pMET << c; } } @@ -1384,14 +1385,14 @@ void METWriter::METPartialArcAtCurPos(Point aCenter, double fMultiplier, void METWriter::METChrStr( Point aPt, String aUniStr ) { - sal_uInt16 nLen,i; - ByteString aStr( aUniStr, gsl_getSystemTextEncoding() ); - nLen = aStr.Len(); + rtl::OString aStr(rtl::OUStringToOString(aUniStr, + osl_getThreadTextEncoding())); + sal_uInt16 nLen = aStr.getLength(); WillWriteOrder( 11 + nLen ); *pMET << (sal_uInt8)0xc3 << (sal_uInt8)( 9 + nLen ); WritePoint(aPt); - for ( i = 0; i < nLen; i++ ) - *pMET << aStr.GetChar( i ); + for (sal_uInt16 i = 0; i < nLen; ++i) + *pMET << aStr[i]; *pMET << (sal_uInt8)0; } diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index e385a4a8f0ad..369c50fdedaf 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -225,7 +225,7 @@ private: void ImplText( const String& rUniString, const Point& rPos, const sal_Int32* pDXArry, sal_Int32 nWidth, VirtualDevice& rVDev ); void ImplSetAttrForText( const Point & rPoint ); void ImplWriteCharacter( sal_Char ); - void ImplWriteString( const ByteString&, VirtualDevice& rVDev, const sal_Int32* pDXArry = NULL, sal_Bool bStretch = sal_False ); + void ImplWriteString( const rtl::OString&, VirtualDevice& rVDev, const sal_Int32* pDXArry = NULL, sal_Bool bStretch = sal_False ); void ImplDefineFont( const char*, const char* ); void ImplClosePathDraw( sal_uLong nMode = PS_RET ); @@ -306,10 +306,9 @@ sal_Bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Fi // try to get the dialog selection if ( pFilterConfigItem ) { - ByteString aResMgrName( "eps" ); ResMgr* pResMgr; - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); + pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILocale() ); if( pResMgr ) { @@ -454,9 +453,8 @@ sal_Bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Fi if ( mbStatus && mnLevelWarning && pFilterConfigItem ) { - ByteString aResMgrName( "eps" ); ResMgr* pResMgr; - pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); + pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILocale() ); if( pResMgr ) { InfoBox aInfoBox( NULL, String( ResId( KEY_VERSION_CHECK, *pResMgr ) ) ); @@ -1244,7 +1242,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) case META_COMMENT_ACTION: { const MetaCommentAction* pA = (const MetaCommentAction*) pMA; - if ( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL ) + if ( pA->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN")) ) { const MetaGradientExAction* pGradAction = NULL; while( ++nCurAction < nCount ) @@ -1253,7 +1251,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) if( pAction->GetType() == META_GRADIENTEX_ACTION ) pGradAction = (const MetaGradientExAction*) pAction; else if( ( pAction->GetType() == META_COMMENT_ACTION ) && - ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) ) + ( ( (const MetaCommentAction*) pAction )->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END")) ) ) { break; } @@ -1261,7 +1259,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) if( pGradAction ) ImplWriteGradient( pGradAction->GetPolyPolygon(), pGradAction->GetGradient(), rVDev ); } - else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_END" ) ) + else if ( pA->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END")) ) { if ( aFillPath.Count() ) { @@ -1276,11 +1274,11 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) { SvMemoryStream aMemStm( (void*)pData, pA->GetDataSize(), STREAM_READ ); sal_Bool bSkipSequence = sal_False; - ByteString sSeqEnd; + rtl::OString sSeqEnd; - if( pA->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ) ) + if( pA->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM( "XPATHSTROKE_SEQ_BEGIN" )) ) { - sSeqEnd = ByteString( "XPATHSTROKE_SEQ_END" ); + sSeqEnd = rtl::OString(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_END")); SvtGraphicStroke aStroke; aMemStm >> aStroke; @@ -1314,9 +1312,9 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) ImplPolyLine( aPath ); } } - else if( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) ) + else if (pA->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN"))) { - sSeqEnd = ByteString( "XPATHFILL_SEQ_END" ); + sSeqEnd = rtl::OString(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END")); SvtGraphicFill aFill; aMemStm >> aFill; switch( aFill.getFillType() ) @@ -1386,7 +1384,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) break; case META_COMMENT_ACTION : { - if (((const MetaCommentAction*)pAction)->GetComment().Equals( "XPATHFILL_SEQ_END" )) + if (((const MetaCommentAction*)pAction)->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END"))) bOk = sal_False; } break; @@ -1427,8 +1425,8 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev ) pMA = rMtf.GetAction( nCurAction ); if ( pMA->GetType() == META_COMMENT_ACTION ) { - ByteString sComment( ((MetaCommentAction*)pMA)->GetComment() ); - if ( sComment.Equals( sSeqEnd ) ) + rtl::OString sComment( ((MetaCommentAction*)pMA)->GetComment() ); + if ( sComment.equals( sSeqEnd ) ) break; } } @@ -2044,32 +2042,31 @@ void PSWriter::ImplWriteCharacter( sal_Char nChar ) //--------------------------------------------------------------------------------- -void PSWriter::ImplWriteString( const ByteString& rString, VirtualDevice& rVDev, const sal_Int32* pDXArry, sal_Bool bStretch ) +void PSWriter::ImplWriteString( const rtl::OString& rString, VirtualDevice& rVDev, const sal_Int32* pDXArry, sal_Bool bStretch ) { - sal_uInt16 nLen = rString.Len(); + sal_Int32 nLen = rString.getLength(); if ( nLen ) { - sal_uInt16 i; if ( pDXArry ) { double nx = 0; - for( i = 0; i < nLen; i++ ) + for (sal_Int32 i = 0; i < nLen; ++i) { if ( i > 0 ) nx = pDXArry[ i - 1 ]; - ImplWriteDouble( ( bStretch ) ? nx : rVDev.GetTextWidth( rString.GetChar( i ) ) ); + ImplWriteDouble( ( bStretch ) ? nx : rVDev.GetTextWidth( rString[i] ) ); ImplWriteDouble( nx ); ImplWriteLine( "(", PS_NONE ); - ImplWriteCharacter( rString.GetChar( i ) ); + ImplWriteCharacter( rString[i] ); ImplWriteLine( ") bs" ); } } else { ImplWriteByte( '(', PS_NONE ); - for ( i = 0; i < nLen; i++ ) - ImplWriteCharacter( rString.GetChar( i ) ); + for (sal_Int32 i = 0; i < nLen; ++i) + ImplWriteCharacter( rString[i] ); ImplWriteLine( ") sw" ); } } @@ -2130,7 +2127,8 @@ void PSWriter::ImplText( const String& rUniString, const Point& rPos, const sal_ if ( mnTextMode == 2 ) // forcing output one complete text packet, by pDXArry = NULL; // ignoring the kerning array ImplSetAttrForText( rPos ); - ByteString aStr( rUniString, maFont.GetCharSet() ); + rtl::OString aStr(rtl::OUStringToOString(rUniString, + maFont.GetCharSet())); ImplWriteString( aStr, rVDev, pDXArry, nWidth != 0 ); if ( maFont.GetOrientation() ) ImplWriteLine( "gr" ); diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 4ecb41590997..9a1e6e59fcd7 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -380,7 +380,7 @@ static bool RenderAsPNG(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32 nOrigPos, sal_uInt32 nPSSize, sal_uInt32 nPosWMF, sal_uInt32 nSizeWMF, sal_uInt32 nPosTIFF, sal_uInt32 nSizeTIFF ) { - ByteString aComment( (const sal_Char*)"EPSReplacementGraphic" ); + rtl::OString aComment(RTL_CONSTASCII_STRINGPARAM("EPSReplacementGraphic")); if ( nSizeWMF || nSizeTIFF ) { SvMemoryStream aReplacement( nSizeWMF + nSizeTIFF + 28 ); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index bb1e8b3fb650..fc987b8d123c 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1073,12 +1073,10 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi } pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); - if (bAutoFit) + //Autofit text only if there is no auto grow height and width + //See fdo#41245 + if (bAutoFit && !bAutoGrowHeight && !bAutoGrowWidth) { - // disable both, defeats purpose of autofit - // otherwise - bAutoGrowHeight = sal_False; - bAutoGrowWidth = sal_False; pTObj->SetMergedItem( SdrTextFitToSizeTypeItem(SDRTEXTFIT_AUTOFIT) ); } diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 9e1d4efa3487..302909f04c84 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -886,8 +886,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue if ( mxStatusIndicator.is() ) { - ByteString aResMgrName( "pdffilter" ); - ResMgr* pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetSettings().GetUILocale() ); + ResMgr* pResMgr = ResMgr::CreateResMgr( "pdffilter", Application::GetSettings().GetUILocale() ); if ( pResMgr ) { sal_Int32 nTotalPageCount = aRangeEnum.size(); diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 6b66c5081509..07f3a16b2bcf 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -2433,7 +2433,7 @@ struct ShapeRenderingVisitor if( !maCurrState.maFontStyle.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("normal")) ) aFont.SetItalic(ITALIC_NORMAL); // TODO: discriminate - if( !maCurrState.mnFontWeight != 400.0 ) + if( maCurrState.mnFontWeight != 400.0 ) aFont.SetWeight(WEIGHT_BOLD); // TODO: discriminate // extract basic transformations out of CTM diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 66ca7bd5156c..f69fe6038ff9 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1627,7 +1627,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, const MetaCommentAction* pA = (const MetaCommentAction*) pAction; String aSkipComment; - if( ( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL ) && + if( ( pA->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN")) ) && ( nWriteFlags & SVGWRITER_WRITE_FILL ) ) { const MetaGradientExAction* pGradAction = NULL; @@ -1641,7 +1641,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, pGradAction = (const MetaGradientExAction*) pAction; else if( ( pAction->GetType() == META_COMMENT_ACTION ) && ( ( (const MetaCommentAction*) pAction )->GetComment(). - CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) ) + equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END")) ) ) { bDone = sal_True; } @@ -1650,7 +1650,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( pGradAction ) ImplWriteGradientEx( pGradAction->GetPolyPolygon(), pGradAction->GetGradient(), nWriteFlags ); } - else if( ( pA->GetComment().CompareIgnoreCaseToAscii( "XPATHFILL_SEQ_BEGIN" ) == COMPARE_EQUAL ) && + else if( ( pA->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) ) && ( nWriteFlags & SVGWRITER_WRITE_FILL ) && !( nWriteFlags & SVGWRITER_NO_SHAPE_COMMENTS ) && pA->GetDataSize() ) { @@ -1697,7 +1697,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( ( pAction->GetType() == META_COMMENT_ACTION ) && ( ( (const MetaCommentAction*) pAction )->GetComment(). - CompareIgnoreCaseToAscii( "XPATHFILL_SEQ_END" ) == COMPARE_EQUAL ) ) + equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END")) ) ) { bSkip = sal_False; } @@ -1725,13 +1725,13 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( ( pAction->GetType() == META_COMMENT_ACTION ) && ( ( (const MetaCommentAction*) pAction )->GetComment(). - CompareIgnoreCaseToAscii( "XPATHFILL_SEQ_END" ) == COMPARE_EQUAL ) ) + equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END")) ) ) { bSkip = sal_False; } } } - else if( ( pA->GetComment().CompareIgnoreCaseToAscii( "XPATHSTROKE_SEQ_BEGIN" ) == COMPARE_EQUAL ) && + else if( ( pA->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN")) ) && ( nWriteFlags & SVGWRITER_WRITE_FILL ) && !( nWriteFlags & SVGWRITER_NO_SHAPE_COMMENTS ) && pA->GetDataSize() ) { @@ -1781,7 +1781,7 @@ void SVGActionWriter::ImplWriteActions( const GDIMetaFile& rMtf, if( ( pAction->GetType() == META_COMMENT_ACTION ) && ( ( (const MetaCommentAction*) pAction )->GetComment(). - CompareIgnoreCaseToAscii( "XPATHSTROKE_SEQ_END" ) == COMPARE_EQUAL ) ) + equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_END")) ) ) { bSkip = sal_False; } diff --git a/filter/source/xsltdialog/xmlfiltertabpagexslt.src b/filter/source/xsltdialog/xmlfiltertabpagexslt.src index e86111265008..d82bb30cd771 100644 --- a/filter/source/xsltdialog/xmlfiltertabpagexslt.src +++ b/filter/source/xsltdialog/xmlfiltertabpagexslt.src @@ -179,7 +179,7 @@ TabPage RID_XML_FILTER_TABPAGE_XSLT { Pos = MAP_APPFONT ( FIRST_ROW_X , FIRST_ROW_Y + 5 * ROW_HEIGHT + 5 * SPACING + FIXED_TEXT_OFFSET + EDIT_OFFSET ) ; Size = MAP_APPFONT ( FIRST_ROW_WIDTH , 8 ) ; - Text [ en-US ] = "XSLT Tranformation Service"; + Text [ en-US ] = "XSLT Transformation Service"; }; Edit ED_XML_TRANSFORM_SERVICE diff --git a/fpicker/source/office/iodlgimp.hxx b/fpicker/source/office/iodlgimp.hxx index 2cc4f71edcc1..1048bc3092a7 100644 --- a/fpicker/source/office/iodlgimp.hxx +++ b/fpicker/source/office/iodlgimp.hxx @@ -45,7 +45,6 @@ class Accelerator; class CheckBox; class SvtFileDialog; class SvStringsDtor; -class SvUShorts; //***************************************************************************** @@ -242,7 +242,13 @@ for REPO in $DIRS ; do elif [ -d "$DIR" -a "z$LAST_WORKING" != "z" ]; then echo "fetching notes for $REPO ..." (cd $DIR && git fetch origin 'refs/notes/*:refs/notes/*') - # FIXME: we need to grep the git log for a known good note name... + hash=`(cd $DIR && git log --pretty='%H %N' | grep 'win32 working build' | head -n1 | sed 's/ win32.*//')` + if test "z$hash" != "z"; then + echo "update to $hash" + (cd $DIR && git checkout $hash) + else + echo "Warning: missing known working note on repo $REPO" + fi elif [ -d "$DIR" -a "z$SET_LAST_WORKING" != "z" ]; then echo "fetching notes for $REPO ..." (cd $DIR && git fetch origin 'refs/notes/*:refs/notes/*') diff --git a/libxmlsec/makefile.mk b/libxmlsec/makefile.mk index 3ef990f16213..5388580fd960 100644 --- a/libxmlsec/makefile.mk +++ b/libxmlsec/makefile.mk @@ -35,9 +35,9 @@ EXTERNAL_WARNINGS_NOT_ERRORS := TRUE .INCLUDE : settings.mk -.IF "$(ENABLE_NSS_MODULE)" == "NO" && "$(SYSTEM_MOZILLA)" != "YES" +.IF "$(ENABLE_XMLSEC)" == "NO" @all: - @echo "NSS module disabled => no libxmlsec...." + @echo "XMLSec module disabled" .ENDIF # --- Files -------------------------------------------------------- @@ -100,7 +100,7 @@ CONFIGURE_DIR= CONFIGURE_ACTION=.$/configure CONFIGURE_FLAGS=--with-libxslt=no --with-openssl=no --with-gnutls=no --with-mozilla_ver=1.7.5 --enable-mscrypto --disable-crypto-dl --build=i586-pc-mingw32 --host=i586-pc-mingw32 CC="$(xmlsec_CC)" LDFLAGS="-no-undefined -L$(ILIB:s/;/ -L/)" LIBS="$(xmlsec_LIBS)" LIBXML2LIB=$(LIBXML2LIB) ZLIB3RDLIB=$(ZLIB3RDLIB) OBJDUMP="$(WRAPCMD) objdump" -.IF "$(SYSTEM_MOZILLA)" != "YES" +.IF "$(SYSTEM_NSS)" != "YES" CONFIGURE_FLAGS+=--enable-pkgconfig=no .ENDIF BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS) @@ -160,7 +160,7 @@ CONFIGURE_FLAGS=--with-pic --disable-shared --disable-crypto-dl --with-libxslt=n # --with-nss or parse -pkg-config --libs / cflags mozilla-nss since # the lib may a) be in /usr/lib (Debian) and be not in $with_nss/include # $with_nss/lib. -.IF "$(SYSTEM_MOZILLA)" != "YES" +.IF "$(SYSTEM_NSS)" != "YES" CONFIGURE_FLAGS+=--enable-pkgconfig=no .ENDIF BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS) diff --git a/moz/extractfiles.mk b/moz/extractfiles.mk index 4741ff43bdef..793c281b68a4 100644 --- a/moz/extractfiles.mk +++ b/moz/extractfiles.mk @@ -35,7 +35,7 @@ INCLUDE_DIR=$(INCCOM) #If we build the NSS module then we do not need the old nss libs from here -.IF "$(ENABLE_NSS_MODULE)"=="YES" +.IF "$(SYSTEM_NSS)"=="NO" .IF "$(OS)" == "SOLARIS" @@ -95,7 +95,7 @@ BIN_RUNTIMELIST= \ softokn3 \ smime3 \ $(FREEBL_LIB) -.ENDIF # "$(ENABLE_NSS_MODULE)"=="YES" +.ENDIF # "$(SYSTEM_NSS)"=="NO" .IF "$(GUI)"=="WNT" BIN_RUNTIMELIST+= \ @@ -164,7 +164,7 @@ DEFAULTS_RUNTIMELIST= \ greprefs$/all.js \ greprefs$/security-prefs.js -.IF "$(ENABLE_NSS_MODULE)"=="YES" +.IF "$(SYSTEM_NSS)"=="NO" #These headers come from the separate NSS module if enabled NSS_INCLUDE_LIST= @@ -205,7 +205,7 @@ LIBLIST= \ .ENDIF -.ELSE # .IF"$(ENABLE_NSS_MODULE)"=="YES" +.ELSE # .IF"$(SYSTEM_NSS)"=="NO" .IF "$(GUI)"=="WNT" .IF "$(COM)"=="GCC" @@ -258,7 +258,7 @@ LIBLIST= \ libsmime3$(DLLPOST) .ENDIF -.ENDIF # .IF "$(ENABLE_NSS_MODULE)"=="YES" +.ENDIF # .IF "$(SYSTEM_NSS)"=="NO" INCLUDE_PATH=$(MOZ_DIST_DIR)$/include$/ PUBLIC_PATH=$(MOZ_DIST_DIR)$/public$/ @@ -301,14 +301,14 @@ $(MISC)$/build$/so_moz_runtime_files: $(OUT)$/bin$/mozruntime.zip $(foreach,file,$(BIN_RUNTIMELIST) $(COPY) $(MOZ_BIN_DIR)$/$(DLLPRE)$(file)$(DLLPOST) \ $(LIB_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \ echo >& $(NULLDEV) -.IF "$(ENABLE_NSS_MODULE)" == "YES" +.IF "$(SYSTEM_NSS)" == "NO" # We add the libraries from the separate nss module $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARLIBDIR)$/$(file:d:d)/$(DLLPRE)$(file:f)$(DLLPOST) \ $(RUNTIME_DIR)$/$(DLLPRE)$(file:f)$(DLLPOST) &&) \ echo >& $(NULLDEV) .ENDIF .ELSE # .IF "$(GUI)" == "UNX" -.IF "$(ENABLE_NSS_MODULE)" == "YES" +.IF "$(SYSTEM_NSS)" == "NO" # We add the libraries from the separate nss module $(foreach,file,$(NSS_MODULE_RUNTIME_LIST) $(COPY) $(SOLARBINDIR)$/$(DLLPRE)$(file)$(DLLPOST) \ $(RUNTIME_DIR)$/$(DLLPRE)$(file)$(DLLPOST) &&) \ @@ -407,7 +407,7 @@ $(MISC)$/build$/so_moz_include_files: $(INCCOM)$/nsBuildID.h chmod -R 775 $(INCCOM) .ENDIF $(TOUCH) $@ -.IF "$(ENABLE_NSS_MODULE)"=="YES" +.IF "$(SYSTEM_NSS)"=="NO" +$(foreach,dir,$(NSS_INCLUDE_LIST) $(RENAME:s/+//) $(INCLUDE_DIR)$/$(dir) $(INCLUDE_DIR)$/$(dir)_remove_me &&) echo >& $(NULLDEV) $(foreach,dir,$(NSS_INCLUDE_LIST) rm -rf $(INCLUDE_DIR)$/$(dir)_remove_me &&) echo >& $(NULLDEV) -$(MKDIR) $(OUT)$/inc.nss @@ -463,6 +463,6 @@ $(MISC)$/CREATETARBALL: extract_mozab_files .ENDIF cd $(LB) && zip -r ..$/zipped$/$(MOZTARGET)lib.zip * cd $(INCCOM) && zip -r ..$/zipped$/$(MOZTARGET)inc.zip * -.IF "$(ENABLE_NSS_MODULE)"=="YES" +.IF "$(SYSTEM_NSS)"=="NO" cd $(OUT)$/inc.nss && zip -r ..$/zipped$/$(MOZTARGET)inc.zip * .ENDIF diff --git a/moz/makefile.mk b/moz/makefile.mk index 020fa693208a..4487bc11004c 100644 --- a/moz/makefile.mk +++ b/moz/makefile.mk @@ -150,7 +150,7 @@ MOZILLA_CONFIGURE_FLAGS += --disable-tests \ --disable-pango \ --enable-extensions="pref" -.IF "$(ENABLE_NSS_MODULE)"=="YES" +.IF "$(SYSTEM_NSS)"=="NO" MOZILLA_CONFIGURE_FLAGS += \ --with-nss-prefix=$(OUTDIR) \ diff --git a/mysqlc/source/description-en-US.txt b/mysqlc/source/description-en-US.txt new file mode 100644 index 000000000000..d99ac31d4374 --- /dev/null +++ b/mysqlc/source/description-en-US.txt @@ -0,0 +1 @@ +MySQL Connector installs a native MySQL database driver. It is faster, seamless integrated, easier to administrate and there is no need to install and setup a JDBC or ODBC driver separately. It was never easier to use MySQL databases in LibreOffice Base. diff --git a/mysqlc/source/description.xml b/mysqlc/source/description.xml index ca9c1e77613f..53f483b7c5cf 100644 --- a/mysqlc/source/description.xml +++ b/mysqlc/source/description.xml @@ -6,7 +6,7 @@ <version value="#VERSION#" /> <platform value="UPDATED_SUPPORTED_PLATFORM" /> <display-name> - <name lang="en-US">#TITLE#</name> + <name lang="en-US">MySQL Connector</name> </display-name> <dependencies> <OpenOffice.org-minimal-version value="3.1" d:name="OpenOffice.org 3.1"/> @@ -18,6 +18,6 @@ <default xlink:href="images/extension_32.png" /> </icon> <extension-description> - <src lang="#LANG#" xlink:href="description/description_#LANG#.txt"/> + <src lang="en-US" xlink:href="description-en-US.txt"/> </extension-description> </description> diff --git a/mysqlc/source/description/description_de.txt b/mysqlc/source/description/description_de.txt deleted file mode 100644 index acdaea342571..000000000000 --- a/mysqlc/source/description/description_de.txt +++ /dev/null @@ -1 +0,0 @@ -Verbindet OpenOffice.org direkt mit MySQL-Servern
\ No newline at end of file diff --git a/mysqlc/source/description/description_en-US.txt b/mysqlc/source/description/description_en-US.txt deleted file mode 100755 index a8ddd5985cfc..000000000000 --- a/mysqlc/source/description/description_en-US.txt +++ /dev/null @@ -1 +0,0 @@ -The MySQL Connector for OpenOffice.org installs a native MySQL database driver. It is faster, seamless integrated, easier to administrate and there is no need to install and setup a JDBC or ODBC driver separately. It was never easier to use MySQL databases in OpenOffice.org Base. diff --git a/mysqlc/source/description/description_es.txt b/mysqlc/source/description/description_es.txt deleted file mode 100644 index 9e04c85fbd84..000000000000 --- a/mysqlc/source/description/description_es.txt +++ /dev/null @@ -1 +0,0 @@ -Conecta OpenOffice.org directamente con los servidores de MySQL
\ No newline at end of file diff --git a/mysqlc/source/description/description_fr.txt b/mysqlc/source/description/description_fr.txt deleted file mode 100644 index ca3073273834..000000000000 --- a/mysqlc/source/description/description_fr.txt +++ /dev/null @@ -1 +0,0 @@ -Connexion directe d'OpenOffice.org avec les serveurs MySQL.
\ No newline at end of file diff --git a/mysqlc/source/description/description_hu.txt b/mysqlc/source/description/description_hu.txt deleted file mode 100644 index 0b60de706018..000000000000 --- a/mysqlc/source/description/description_hu.txt +++ /dev/null @@ -1 +0,0 @@ -Közvetlen kapcsolatot teremt az OpenOffice.org és a MySQL-kiszolgálók között.
\ No newline at end of file diff --git a/mysqlc/source/description/description_it.txt b/mysqlc/source/description/description_it.txt deleted file mode 100644 index 36326e214bf6..000000000000 --- a/mysqlc/source/description/description_it.txt +++ /dev/null @@ -1 +0,0 @@ -Consente la connessione diretta tra OpenOffice.org e i server MySQL
\ No newline at end of file diff --git a/mysqlc/source/description/description_ja.txt b/mysqlc/source/description/description_ja.txt deleted file mode 100644 index 3d6a70eb9489..000000000000 --- a/mysqlc/source/description/description_ja.txt +++ /dev/null @@ -1 +0,0 @@ -OpenOffice.org を MySQL サーバーと直接に接続させる
\ No newline at end of file diff --git a/mysqlc/source/description/description_ko.txt b/mysqlc/source/description/description_ko.txt deleted file mode 100644 index 6b4ca29be8ce..000000000000 --- a/mysqlc/source/description/description_ko.txt +++ /dev/null @@ -1 +0,0 @@ -MySQL 서버를 통해 OpenOffice.org에 직접 연결합니다.
\ No newline at end of file diff --git a/mysqlc/source/description/description_nl.txt b/mysqlc/source/description/description_nl.txt deleted file mode 100644 index 1405fd0b2ff1..000000000000 --- a/mysqlc/source/description/description_nl.txt +++ /dev/null @@ -1 +0,0 @@ -Verbindt OpenOffice.org direct met MySQL Servers
\ No newline at end of file diff --git a/mysqlc/source/description/description_pl.txt b/mysqlc/source/description/description_pl.txt deleted file mode 100644 index 03e0f23bbc99..000000000000 --- a/mysqlc/source/description/description_pl.txt +++ /dev/null @@ -1 +0,0 @@ -Laczy witryne OpenOffice.org bezposrednio z systemem MySQL Servers
\ No newline at end of file diff --git a/mysqlc/source/description/description_pt-BR.txt b/mysqlc/source/description/description_pt-BR.txt deleted file mode 100644 index 21d3ba28a5da..000000000000 --- a/mysqlc/source/description/description_pt-BR.txt +++ /dev/null @@ -1 +0,0 @@ -Conecta o OpenOffice.org diretamente aos servidores MySQL
\ No newline at end of file diff --git a/mysqlc/source/description/description_pt.txt b/mysqlc/source/description/description_pt.txt deleted file mode 100644 index 1f05c487e03e..000000000000 --- a/mysqlc/source/description/description_pt.txt +++ /dev/null @@ -1 +0,0 @@ -Liga o OpenOffice.org directamente aos servidores MySQL
\ No newline at end of file diff --git a/mysqlc/source/description/description_ru.txt b/mysqlc/source/description/description_ru.txt deleted file mode 100644 index 633b2c9514df..000000000000 --- a/mysqlc/source/description/description_ru.txt +++ /dev/null @@ -1 +0,0 @@ -Подключает OpenOffice.org напрямую к серверам MySQL diff --git a/mysqlc/source/description/description_sv.txt b/mysqlc/source/description/description_sv.txt deleted file mode 100644 index d7fc80975763..000000000000 --- a/mysqlc/source/description/description_sv.txt +++ /dev/null @@ -1 +0,0 @@ -Ansluter OpenOffice.org direkt till MySQL-servrarna
\ No newline at end of file diff --git a/mysqlc/source/description/description_zh-CN.txt b/mysqlc/source/description/description_zh-CN.txt deleted file mode 100644 index c38bc47a41a8..000000000000 --- a/mysqlc/source/description/description_zh-CN.txt +++ /dev/null @@ -1 +0,0 @@ -将 OpenOffice.org 与 MySQL 服务器直接相连
\ No newline at end of file diff --git a/mysqlc/source/description/description_zh-TW.txt b/mysqlc/source/description/description_zh-TW.txt deleted file mode 100644 index de628909d369..000000000000 --- a/mysqlc/source/description/description_zh-TW.txt +++ /dev/null @@ -1 +0,0 @@ -將 OpenOffice.org 直接連線至 MySQL 伺服器
\ No newline at end of file diff --git a/mysqlc/source/makefile.mk b/mysqlc/source/makefile.mk index 9af646c0f383..9405defd4bb6 100644 --- a/mysqlc/source/makefile.mk +++ b/mysqlc/source/makefile.mk @@ -48,13 +48,7 @@ EXTENSION_VERSION_BASE=$(MYSQLC_VERSION_MAJOR).$(MYSQLC_VERSION_MINOR).$(MYSQLC_ EXTENSION_VERSION=$(EXTENSION_VERSION_BASE) #---- extension title package name -.IF "$(MYSQLC_STATUS)" == "final" - EXTENSION_TITLE:=$(MYSQLC_TITLE) - EXTENSION_ZIPNAME:=$(EXTENSIONNAME) -.ELSE - EXTENSION_TITLE:=$(MYSQLC_TITLE) ($(MYSQLC_STATUS)) - EXTENSION_ZIPNAME:=$(EXTENSIONNAME) -.ENDIF +EXTENSION_ZIPNAME:=$(EXTENSIONNAME) #------------------------------------------------------------------- @@ -220,26 +214,10 @@ COMPONENT_IMAGES= \ # ........ component description ........ # one file for each WITH_LANG token -DESC_LANGS=$(WITH_LANG) -.IF "$(DESC_LANGS)" == "" - DESC_LANGS=en-US -.ENDIF -COMPONENT_DESCRIPTIONS=$/$(foreach,lang,$(DESC_LANGS) description$/description_$(lang).txt) +COMPONENT_DESCRIPTIONS=$/$(foreach,lang,$(alllangiso) description-$(lang).txt) COMPONENT_DESCRIPTIONS_PACKDEP= \ $(foreach,i,$(COMPONENT_DESCRIPTIONS) $(EXTENSIONDIR)$/$i) -# WITH_LANG might contain languages which we actually do not have a description for (yet) -# Find those, and treat the specially - -# first, find those locales which we actually have a description file for -EXISTING_DESCRIPTIONS=$(foreach,i,$(shell $(FIND) .$/description -name "description_*.txt") $(i:f)) -EXISTING_LANGS=$(foreach,i,$(EXISTING_DESCRIPTIONS) $(i:s,description_,,:s,.txt,,)) - -# then, create a version of WITH_LANG where we stripped all those locales -EXISTING_LANGS_NORMALIZED=$(strip $(EXISTING_LANGS)) -EXISTING_LANGS_NORMALIZED:=+$(EXISTING_LANGS_NORMALIZED:s/ /+/)+ -MISSING_LANGS=$(foreach,lang,$(WITH_LANG) $(eq,$(EXISTING_LANGS_NORMALIZED:s/+$(lang)+//),$(EXISTING_LANGS_NORMALIZED) $(lang) )) - # ........ dependencies for packaging the extension ........ EXTENSION_PACKDEPS=makefile.mk $(COMPONENT_IMAGES) $(COMPONENT_DESCRIPTIONS_PACKDEP) $(COMPONENT_MERGED_XCU) @@ -260,11 +238,6 @@ $(COMPONENT_IMAGES) : $(SOLARSRC)$/$(RSCDEFIMG)$/desktop$/res$/$$(@:f) @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ -# existing descriptions: just copy -$(EXTENSIONDIR)$/description$/%.txt: .$/description$/%.txt - @@-$(MKDIRHIER) $(@:d) - @$(COPY) $< $@ > $(NULLDEV) - # xcu files: copy # the following is a hack for now - need to find out the generic mechanism later @@ -272,17 +245,19 @@ $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/DataAccess$/Drivers.xc @@-$(MKDIRHIER) $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/DataAccess @$(COPY) $< $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/DataAccess$/Drivers.xcu > $(NULLDEV) -# non-existing descriptions: copy from the English version -.IF "$(strip $(MISSING_LANGS))" != "" -$(foreach,i,$(MISSING_LANGS) $(EXTENSIONDIR)$/description$/description_$i.txt): .$/description$/description_en-US.txt - @echo ------ WARNING: .$/description$/$(@:f) not found, falling back to English description - @@-$(MKDIRHIER) $(@:d) - @$(COPY) $< $@ > $(NULLDEV) -.ENDIF +$(COMPONENT_DESCRIPTIONS_PACKDEP) : $(DESCRIPTION) $(DESCRIPTION_SRC): description.xml +-$(RM) $@ - $(TYPE) description.xml | $(SED) "s/#VERSION#/$(EXTENSION_VERSION)/" | $(SED) "s,#TITLE#,$(EXTENSION_TITLE)," > $@ +.IF "$(WITH_LANG)" != "" + $(XRMEX) -p $(PRJNAME) -i $< -o $@ -m $(LOCALIZESDF) -l all + $(SED) "s/#VERSION#/$(EXTENSION_VERSION)/" < $@ > $@.new + mv $@.new $@ + @$(COPY) $(@:d)/description-*.txt $(EXTENSIONDIR) +.ELSE + $(SED) "s/#VERSION#/$(EXTENSION_VERSION)/" < $< > $@ +.ENDIF + @$(COPY) description-en-US.txt $(EXTENSIONDIR) .IF "$(SYSTEM_MYSQL)" != "YES" # --- the MySQL client lib needs to be copied diff --git a/mysqlc/version.mk b/mysqlc/version.mk index 5713d5265258..1ca2272bdafa 100644 --- a/mysqlc/version.mk +++ b/mysqlc/version.mk @@ -28,11 +28,3 @@ MYSQLC_VERSION_MAJOR=1 MYSQLC_VERSION_MINOR=0 MYSQLC_VERSION_MICRO=1 - -# the title, as displayed in the Extension Manager -MYSQLC_TITLE=MySQL Connector - -# the status of the extension -# if this is different from "final", it will be appended to the title displayed in the Extension Manager -# and also added to the file name of the resulting .oxt file -MYSQLC_STATUS=final diff --git a/nlpsolver/locale/NLPSolverCommon_gd.properties b/nlpsolver/locale/NLPSolverCommon_gd.properties new file mode 100644 index 000000000000..83fa72834fde --- /dev/null +++ b/nlpsolver/locale/NLPSolverCommon_gd.properties @@ -0,0 +1,22 @@ +# x-no-translate +#BaseNLPSolver +NLPSolverCommon.Properties.AssumeNonNegative=Cuir mar fhiacham caochladairean neo-\u00E0icheil +#BaseEvolutionarySolver +NLPSolverCommon.Properties.SwarmSize=Meud an sgaotha +NLPSolverCommon.Properties.LibrarySize=Meud na leabhar-lainn +NLPSolverCommon.Properties.LearningCycles=Cuairtean ionnsachaidh +NLPSolverCommon.Properties.GuessVariableRange=Tomhas air cr\u00ECochan nan caochladairean +NLPSolverCommon.Properties.VariableRangeThreshold=Stairsneach cr\u00ECochan nan caochladairean (nuair a nithear tomhas) +NLPSolverCommon.Properties.UseACRComparator=Cleachd coimeasaiche ACR (an \u00E0ite BCH) +NLPSolverCommon.Properties.UseRandomStartingPoint=Cleachd puing t\u00F2iseachaidh air thuaiream +NLPSolverCommon.Properties.StagnationLimit=Cr\u00ECoch na neo-ghluasadachd +NLPSolverCommon.Properties.Tolerance=Fulangas na neo-ghluasadachd +NLPSolverCommon.Properties.EnhancedSolverStatus=Seall staid mheudaichte an fhuasglair +#DEPS +NLPSolverCommon.Properties.AgentSwitchRate=Reat suidseadh \u00E0idseint (Coltachd DE) +NLPSolverCommon.Properties.DEFactor=DE: Factar sg\u00E8ilidh (0-1.2) +NLPSolverCommon.Properties.DECR=DE: Coltachd Crossover (0-1) +NLPSolverCommon.Properties.PSC1=PS: Cunbhalachan cognatach +NLPSolverCommon.Properties.PSC2=PS: Cunbhalachan s\u00F2isealta +NLPSolverCommon.Properties.PSWeight=PS: Co-\u00E8ifeachd cuingealachaidh +NLPSolverCommon.Properties.PSCL=PS: Coltachd m\u00F9thaidh (0-0.005) diff --git a/nlpsolver/locale/NLPSolverCommon_nb.properties b/nlpsolver/locale/NLPSolverCommon_nb.properties index 3b88d95b50f8..477fea9c0f99 100644 --- a/nlpsolver/locale/NLPSolverCommon_nb.properties +++ b/nlpsolver/locale/NLPSolverCommon_nb.properties @@ -1,6 +1,6 @@ # x-no-translate #BaseNLPSolver -NLPSolverCommon.Properties.AssumeNonNegative=Assume Non-Negative Variables +NLPSolverCommon.Properties.AssumeNonNegative=Anta positive variabler #BaseEvolutionarySolver NLPSolverCommon.Properties.SwarmSize=Size of Swarm NLPSolverCommon.Properties.LibrarySize=Bibliotekst\u00F8rrelse diff --git a/nlpsolver/locale/NLPSolverStatusDialog_gd.properties b/nlpsolver/locale/NLPSolverStatusDialog_gd.properties new file mode 100644 index 000000000000..4bbe57a62118 --- /dev/null +++ b/nlpsolver/locale/NLPSolverStatusDialog_gd.properties @@ -0,0 +1,28 @@ +# x-no-translate +#Dialog +NLPSolverStatusDialog.Dialog.Caption=Staid an fhuasglair +#Controls +NLPSolverStatusDialog.Controls.lblSolution=Am fuasgladh l\u00E0ithreach: +NLPSolverStatusDialog.Controls.lblIteration=Ath-nochdaidhean: +NLPSolverStatusDialog.Controls.lblStagnation=Neo-ghluasadachd: +NLPSolverStatusDialog.Controls.lblRuntime=\u00D9ine ruith: +NLPSolverStatusDialog.Controls.btnStop=Cuir stad air +NLPSolverStatusDialog.Controls.btnOK=Ceart ma-th\u00E0 +NLPSolverStatusDialog.Controls.btnContinue=Lean air adhart +#Messages +NLPSolverStatusDialog.Message.StopIteration=R\u00E0inig thu na tha ceadaichte de ath-nochdaidhean. +NLPSolverStatusDialog.Message.StopStagnation=Stad am pr\u00F2iseas air sg\u00E0th neo-ghluasadachd. +NLPSolverStatusDialog.Message.StopUser=Stad an cleachdaiche am pr\u00F2iseas. +NLPSolverStatusDialog.Message.CurrentIteration=Stad am pr\u00F2iseas aig ath-nochdadh %d \u00E0 %d. +#Time formatting +NLPSolverStatusDialog.Time.Nanoseconds=Nano-dhiogan +NLPSolverStatusDialog.Time.Microseconds=Micreo-dhiogan +NLPSolverStatusDialog.Time.Milliseconds=Mille-dhiogan +NLPSolverStatusDialog.Time.Second=Diog +NLPSolverStatusDialog.Time.Seconds=Diogan +NLPSolverStatusDialog.Time.Minute=Mionaid +NLPSolverStatusDialog.Time.Minutes=Mionaidean +NLPSolverStatusDialog.Time.Hour=Uair a th\u00ECde +NLPSolverStatusDialog.Time.Hours=Uairean a th\u00ECde +NLPSolverStatusDialog.Time.Day=Latha +NLPSolverStatusDialog.Time.Days=L\u00E0ithean diff --git a/nlpsolver/locale/NLPSolverStatusDialog_is.properties b/nlpsolver/locale/NLPSolverStatusDialog_is.properties index 74a8b69a0bc0..f037c9a4fdf2 100644 --- a/nlpsolver/locale/NLPSolverStatusDialog_is.properties +++ b/nlpsolver/locale/NLPSolverStatusDialog_is.properties @@ -25,4 +25,4 @@ NLPSolverStatusDialog.Time.Minutes=M\u00EDn\u00FAtur NLPSolverStatusDialog.Time.Hour=Klukkustund NLPSolverStatusDialog.Time.Hours=Klukkustundir NLPSolverStatusDialog.Time.Day=Dagur -NLPSolverStatusDialog.Time.Days=Days +NLPSolverStatusDialog.Time.Days=Dagur diff --git a/nss/makefile.mk b/nss/makefile.mk index 9fdc9e601074..bc7b827be1ae 100644 --- a/nss/makefile.mk +++ b/nss/makefile.mk @@ -36,9 +36,9 @@ TARGET=nss # --- Files -------------------------------------------------------- -.IF "$(ENABLE_NSS_MODULE)"!="YES" +.IF "$(SYSTEM_NSS)"=="YES" all: - @echo "NSS will not be built. ENABLE_NSS_MODULE is '$(ENABLE_NSS_MODULE)'" + @echo "NSS will not be built. Using system one instead." .ENDIF VER_MAJOR=3 diff --git a/nss/readme.txt b/nss/readme.txt index df65908204c4..21d7d5487221 100755 --- a/nss/readme.txt +++ b/nss/readme.txt @@ -4,7 +4,7 @@ nss containes the security libraries which are also part of moz. However nss is meant to be more current, that is it to be updated more often. This should be easier than doing this with moz. -If nss is build depends on an environment variable (ENABLE_NSS_MODULE=YES) which +If nss is build depends on an environment variable (SYSTEM_NSS=NO) which is per default set to YES. In this case nss is build before moz. The nss libraries/lib files/headers built in moz are then not delivered. Otherwise they would overwrite those from nss. That is, the nss libraries build in moz are diff --git a/offapi/com/sun/star/linguistic2/SingleProofreadingError.idl b/offapi/com/sun/star/linguistic2/SingleProofreadingError.idl index 385b13dd7cbc..d4944e0f98e3 100644 --- a/offapi/com/sun/star/linguistic2/SingleProofreadingError.idl +++ b/offapi/com/sun/star/linguistic2/SingleProofreadingError.idl @@ -66,6 +66,10 @@ struct SingleProofreadingError sequence< string > aSuggestions; // a list of properties + // <ul> + // <li>FullCommentURL: URL to a page providing more details on the + // error.</li> + // </ul> sequence< com::sun::star::beans::PropertyValue > aProperties; }; diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 8a98471abca9..3ed07e6b914a 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -196,7 +196,7 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat PropertySet aPropSet( rxDataSeries->getDataPointByIndex( mrModel.mnIndex ) ); lclConvertLabelFormatting( aPropSet, getFormatter(), mrModel, rTypeGroup, false ); - if( !mrModel.mxLayout->mbAutoLayout ) + if( mrModel.mxLayout && !mrModel.mxLayout->mbAutoLayout ) { // bnc#694340 - nasty hack - chart2 cannot individually // place data labels, let's try to find a useful diff --git a/post_download.in b/post_download.in index 7c5d07f08dcc..6025d38579db 100644 --- a/post_download.in +++ b/post_download.in @@ -50,7 +50,7 @@ dnl Windows builds need gdiplus.dll in external/gdiplus/ dnl =================================================================== if test "$_os" = "WINNT"; then AC_MSG_CHECKING([for gdiplus.dll]) - if test -x ./external/gdiplus/gdiplus.dll; then + if test -f ./external/gdiplus/gdiplus.dll; then AC_MSG_RESULT([found]) else AC_MSG_ERROR([gdiplus.dll is missing in external/gdiplus/. diff --git a/reportbuilder/util/component.txt b/reportbuilder/util/description-en-US.txt index 21a1f1e2d145..21a1f1e2d145 100755..100644 --- a/reportbuilder/util/component.txt +++ b/reportbuilder/util/description-en-US.txt diff --git a/reportbuilder/util/description.xml b/reportbuilder/util/description.xml index 78ae10843da3..f048b86743af 100644 --- a/reportbuilder/util/description.xml +++ b/reportbuilder/util/description.xml @@ -17,7 +17,7 @@ <default xlink:href="images/extension_32.png" /> </icon> <extension-description> - <src xlink:href="component.txt" lang="en-US" /> + <src xlink:href="description-en-US.txt" lang="en-US" /> </extension-description> </description> diff --git a/reportbuilder/util/makefile.mk b/reportbuilder/util/makefile.mk index 8e838e7036dc..99752c22d9a8 100644 --- a/reportbuilder/util/makefile.mk +++ b/reportbuilder/util/makefile.mk @@ -81,17 +81,18 @@ COMPONENT_HTMLFILES = $(EXTENSIONDIR)$/THIRDPARTYREADMELICENSE.html \ COMPONENT_JARFILES = \ $(EXTENSIONDIR)$/sun-report-builder.jar -COMPONENT_HELP= \ - $(EXTENSIONDIR)$/component.txt +COMPONENT_DESCRIPTION= \ + $(foreach,lang,$(alllangiso) $(EXTENSIONDIR)$/description-$(lang).txt) # .jar files from solver COMPONENT_EXTJARFILES = \ - $(EXTENSIONDIR)$/sun-report-builder.jar \ + $(EXTENSIONDIR)$/sun-report-builder.jar +COMPONENT_EXTJARFILES_COPY = \ $(OUTDIR)$/bin$/reportbuilderwizard.jar .IF "$(SYSTEM_JFREEREPORT)" != "YES" .INCLUDE : $(OUTDIR)/bin/jfreereport_version.mk -COMPONENT_EXTJARFILES += \ +COMPONENT_EXTJARFILES_COPY += \ $(OUTDIR)$/bin$/flute-$(FLUTE_VERSION).jar \ $(OUTDIR)$/bin$/libserializer-$(LIBSERIALIZER_VERSION).jar \ $(OUTDIR)$/bin$/libbase-$(LIBBASE_VERSION).jar \ @@ -105,7 +106,7 @@ COMPONENT_EXTJARFILES += \ $(OUTDIR)$/bin$/sac.jar .ENDIF .IF "$(SYSTEM_APACHE_COMMONS)" != "YES" -COMPONENT_EXTJARFILES += \ +COMPONENT_EXTJARFILES_COPY += \ $(OUTDIR)$/bin$/commons-logging-1.1.1.jar .ENDIF @@ -113,7 +114,7 @@ COMPONENT_MANIFEST_GENERIC:=TRUE COMPONENT_MANIFEST_SEARCHDIR:=registry # make sure to add your custom files here -EXTENSION_PACKDEPS=$(COMPONENT_EXTJARFILES) $(COMPONENT_HTMLFILES) $(COMPONENT_OTR_FILES) $(COMPONENT_HELP) $(COMPONENT_IMAGES) +EXTENSION_PACKDEPS=$(COMPONENT_EXTJARFILES) $(MISC)/$(TARGET).copied $(COMPONENT_HTMLFILES) $(COMPONENT_OTR_FILES) $(COMPONENT_DESCRIPTION) $(COMPONENT_IMAGES) .ENDIF # --- Targets ---------------------------------- @@ -137,13 +138,25 @@ $(EXTENSIONDIR)$/THIRDPARTYREADMELICENSE.html : $(PRJ)$/license$/THIRDPARTYREADM @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ -$(COMPONENT_HELP) : $$(@:f) - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ +$(COMPONENT_DESCRIPTION) : $(DESCRIPTION) + $(DESCRIPTION_SRC): description.xml +-$(RM) $@ - $(TYPE) description.xml | $(SED) "s/#VERSION#/$(EXTENSION_VERSION)/" > $@ + $(COPY) description-en-US.txt $(EXTENSIONDIR)/description-en-US.txt +.IF "$(WITH_LANG)" != "" + $(XRMEX) -p $(PRJNAME) -i description.xml -o $@ -m $(LOCALIZESDF) -l all + $(SED) "s/#VERSION#/$(EXTENSION_VERSION)/" < $@ > $@.new + mv $@.new $@ + @$(COPY) $(@:d)/description-*.txt $(EXTENSIONDIR) +.ELSE + $(SED) "s/#VERSION#/$(EXTENSION_VERSION)/" < $< > $@ +.ENDIF + +$(MISC)/$(TARGET).copied: $(COMPONENT_EXTJARFILES_COPY) + @@-$(MKDIRHIER) $(EXTENSIONDIR) + : $(foreach,i,$(COMPONENT_EXTJARFILES_COPY) && $(COPY) $i $(EXTENSIONDIR)/) + $(TOUCH) $@ .ENDIF .ELSE # "$(SOLAR_JAVA)"!="" .INCLUDE : target.mk diff --git a/reportbuilder/util/makefile.pmk b/reportbuilder/util/makefile.pmk index 566132247f9f..566132247f9f 100755..100644 --- a/reportbuilder/util/makefile.pmk +++ b/reportbuilder/util/makefile.pmk diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx index 5092c43265c2..7a1c929873cd 100644 --- a/reportdesign/source/ui/dlg/Formula.cxx +++ b/reportdesign/source/ui/dlg/Formula.cxx @@ -215,7 +215,7 @@ void FormulaDialog::ToggleCollapsed( RefEdit* _pEdit, RefButton* _pButton) SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromAscii( HID_RPT_FIELD_SEL_WIN ) ); if ( aDlgOpt.Exists() ) { - m_pAddField->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) ); + m_pAddField->SetWindowState(::rtl::OUStringToOString(aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US)); } diff --git a/sal/inc/internal/rtllifecycle.h b/sal/inc/internal/rtllifecycle.h new file mode 100644 index 000000000000..6e5ea81f97fd --- /dev/null +++ b/sal/inc/internal/rtllifecycle.h @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * [ Copyright (C) 2011 Stephan Bergmann, Red Hat <sbergman@redhat.com> (initial + * developer) ] + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef INCLUDED_SAL_INTERNAL_RTLLIFECYCLE_H +#define INCLUDED_SAL_INTERNAL_RTLLIFECYCLE_H + +#if defined __cplusplus +extern "C" { +#endif + +void rtl_arena_init(); + +void rtl_arena_fini(); + +void ensureArenaSingleton(); + +void rtl_cache_init(); + +void rtl_cache_fini(); + +void ensureCacheSingleton(); + +void rtl_memory_init(); + +void rtl_memory_fini(); + +void ensureMemorySingleton(); + +void rtl_locale_init(); + +void rtl_locale_fini(); + +void ensureLocaleSingleton(); + +#if defined __cplusplus +} +#endif + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 22de6dd5be5c..ee4101188013 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -397,6 +397,57 @@ public: } /** + Perform a ASCII lowercase comparison of two strings. + + The result is true if and only if second string + represents the same sequence of characters as the first string, + ignoring the case. + Character values between 65 and 90 (ASCII A-Z) are interpreted as + values between 97 and 122 (ASCII a-z). + Since this method is optimized for performance, the ASCII character + values are not converted in any way. The caller has to make sure that + all ASCII characters are in the allowed range between 0 and + 127. The ASCII string must be NULL-terminated. + This function can't be used for language specific comparison. + + @param asciiStr the 8-Bit ASCII character string to be compared. + @return sal_True if the strings are equal; + sal_False, otherwise. + */ + sal_Bool equalsIgnoreAsciiCase( const sal_Char * asciiStr ) const SAL_THROW(()) + { + return rtl_str_compareIgnoreAsciiCase( pData->buffer, asciiStr ) == 0; + } + + /** + Perform a ASCII lowercase comparison of two strings. + + The result is true if and only if second string + represents the same sequence of characters as the first string, + ignoring the case. + Character values between 65 and 90 (ASCII A-Z) are interpreted as + values between 97 and 122 (ASCII a-z). + Since this method is optimized for performance, the ASCII character + values are not converted in any way. The caller has to make sure that + all ASCII characters are in the allowed range between 0 and + 127. The ASCII string must be greater or equal in length as asciiStrLength. + This function can't be used for language specific comparison. + + @param asciiStr the 8-Bit ASCII character string to be compared. + @param asciiStrLength the length of the ascii string + @return sal_True if the strings are equal; + sal_False, otherwise. + */ + sal_Bool equalsIgnoreAsciiCaseL( const sal_Char * asciiStr, sal_Int32 asciiStrLength ) const SAL_THROW(()) + { + if ( pData->length != asciiStrLength ) + return sal_False; + + return rtl_str_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length, + asciiStr, asciiStrLength ) == 0; + } + + /** Match against a substring appearing in this string. The result is true if and only if the second string appears as a substring diff --git a/sal/inc/rtl/tres.h b/sal/inc/rtl/tres.h deleted file mode 100644 index 102c2ee2319b..000000000000 --- a/sal/inc/rtl/tres.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -#ifndef _RTL_TRES_H_ -#define _RTL_TRES_H_ - -#include <osl/diagnose.h> -#include <rtl/string.h> - -#ifdef __cplusplus -extern "C" { -#endif - - /* comandline flags */ -#define rtl_tres_Flag_BOOM 0x00000001 -#define rtl_tres_Flag_VERBOSE 0x00000002 -#define rtl_tres_Flag_SKIP 0x00000004 -#define rtl_tres_Flag_LOG 0x00000010 -#define rtl_tres_Flag_HIS 0x00000100 -#define rtl_tres_Flag_TIME 0x00000200 -#define rtl_tres_Flag_MSG 0x00000400 -#define rtl_tres_Flag_QUIET 0x00000800 - - /* state flags */ -#define rtl_tres_Flag_SUB 0x01000000 -#define rtl_tres_Flag_PASSED 0x10000000 -#define rtl_tres_Flag_OK 0x20000000 - - - - /* forward declaration and type definition */ -struct _rtl_TestResult; -typedef struct _rtl_TestResult rtl_TestResult; - - -typedef void* rtl_funcstate; -typedef void* rtl_cmpstate; - - /* type definitions of function pointers wich can be overloaded */ -typedef sal_Bool (SAL_CALL *rtl_tres_state_ptr)( - rtl_TestResult*, - sal_Bool, - const sal_Char*, - const sal_Char*, - sal_Bool - ); - -typedef void (SAL_CALL *rtl_tres_end_ptr)( rtl_TestResult*, const sal_Char* ); -typedef sal_Bool (SAL_CALL *rtl_tres_ispassed_ptr)( rtl_TestResult* ); -typedef sal_Bool (SAL_CALL *rtl_tres_isok_ptr)( rtl_TestResult* ); -typedef rtl_funcstate (SAL_CALL *rtl_tres_funcstate_ptr)( rtl_TestResult* ); -typedef sal_Bool (SAL_CALL *rtl_tres_isbit_ptr)( rtl_TestResult*, - sal_uInt32 ); - -typedef rtl_funcstate (SAL_CALL *rtl_tres_getnextfuncstate_ptr) - ( rtl_funcstate ); -typedef rtl_funcstate (SAL_CALL *rtl_tres_getprevfuncstate_ptr) - ( rtl_funcstate ); -typedef sal_uInt32 (SAL_CALL *rtl_tres_getflags_ptr)( rtl_funcstate ); -typedef rtl_String* (SAL_CALL *rtl_tres_getname_ptr)( rtl_funcstate ); -typedef sal_uInt32 (SAL_CALL *rtl_tres_getstart_ptr)( rtl_funcstate ); -typedef sal_uInt32 (SAL_CALL *rtl_tres_getstop_ptr)( rtl_funcstate ); -typedef rtl_cmpstate (SAL_CALL *rtl_tres_getcmpstate_ptr)( rtl_funcstate ); - -typedef sal_Bool (SAL_CALL *rtl_tres_getstat_ptr)( rtl_cmpstate ); -typedef rtl_String* (SAL_CALL *rtl_tres_getmsg_ptr)( rtl_cmpstate ); -typedef rtl_cmpstate (SAL_CALL *rtl_tres_getnextcmpstate_ptr)( rtl_cmpstate ); - - /* type definition of vtable structure for testresult */ -typedef struct _rtl_TestResult_vtable -{ - sal_uInt32 vtablesize; - rtl_tres_state_ptr state_; - rtl_tres_end_ptr end_; - rtl_tres_ispassed_ptr ispassed; - rtl_tres_isok_ptr isok; - rtl_tres_funcstate_ptr funcstate; - rtl_tres_isbit_ptr isbit; - rtl_tres_getnextfuncstate_ptr nextfuncstate; - rtl_tres_getprevfuncstate_ptr prevfuncstate; - rtl_tres_getflags_ptr flags; - rtl_tres_getname_ptr name; - rtl_tres_getstart_ptr start; - rtl_tres_getstop_ptr stop; - rtl_tres_getcmpstate_ptr cmpstate; - rtl_tres_getstat_ptr stat; - rtl_tres_getmsg_ptr msg; - rtl_tres_getnextcmpstate_ptr nextcmpstate; - -} rtl_TestResult_vtable; - - /* type definition of testresult structure */ -struct _rtl_TestResult -{ - rtl_TestResult_vtable * pFuncs; - void * pExternalData; - -}; - - - /* exports */ -rtl_TestResult* SAL_CALL rtl_tres_create( const sal_Char* meth, sal_uInt32 flags ); -void SAL_CALL rtl_tres_destroy( rtl_TestResult* res ); - -#ifdef __cplusplus -} -#endif - -#endif /* _RTL_TRES_H_ */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/inc/rtl/tres.hxx b/sal/inc/rtl/tres.hxx deleted file mode 100644 index 2c0ee9906809..000000000000 --- a/sal/inc/rtl/tres.hxx +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _RTL_TRES_HXX_ -#define _RTL_TRES_HXX_ - -#include <rtl/tres.h> - -// <namespace_rtl> -namespace rtl -{ -/*==========================================================================*/ - -// <class_TestResult> -class TestResult -{ - // pointer to testresult structure - rtl_TestResult* pData; - - // <private_ctors> - TestResult(); - TestResult( const TestResult& oRes ); - // </private_ctors> - -public: - - - // <public_ctors> - TestResult( const sal_Char* meth, sal_uInt32 flags = 0 ) - { - pData = rtl_tres_create( meth, flags ); - } // </public_ctors> - - // <dtor> - ~TestResult() - { - rtl_tres_destroy( pData ); - } - // </dtor> - - // <public_methods> - rtl_TestResult* getData() - { - return pData; - } - // <method_state> - sal_Bool state( - sal_Bool tst_state, - const sal_Char* msg = 0, - const sal_Char* sub = 0, - sal_Bool verbose = sal_False - ) - { - return pData->pFuncs->state_( pData, tst_state, msg, sub, verbose ); - } // </method_state> - - void end( sal_Char* msg = 0 ) - { - pData->pFuncs->end_( pData, msg ); - } // </method_state> -}; // </class_TestResult> - -} // </namespace_rtl> -#endif - - - - - - - - - - - - - - - - - - - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/w32/dllentry.c b/sal/osl/w32/dllentry.c index 4d894260446a..0267216f0966 100644 --- a/sal/osl/w32/dllentry.c +++ b/sal/osl/w32/dllentry.c @@ -44,6 +44,8 @@ #include <osl/mutex.h> #include <sal/types.h> +#include "internal/rtllifecycle.h" + //------------------------------------------------------------------------------ // externals //------------------------------------------------------------------------------ @@ -54,11 +56,6 @@ extern CRITICAL_SECTION g_ThreadKeyListCS; extern oslMutex g_Mutex; extern oslMutex g_CurrentDirectoryMutex; -extern void rtl_locale_fini (void); -extern void rtl_memory_fini (void); -extern void rtl_cache_fini (void); -extern void rtl_arena_fini (void); - #ifdef __MINGW32__ typedef void (*func_ptr) (void); diff --git a/sal/rtl/source/alloc_arena.c b/sal/rtl/source/alloc_arena.cxx index 1585273ccffc..20ee962d55c5 100644 --- a/sal/rtl/source/alloc_arena.c +++ b/sal/rtl/source/alloc_arena.cxx @@ -27,10 +27,11 @@ ************************************************************************/ #define _BSD_SOURCE /* sys/mman.h: MAP_ANON */ -#include "alloc_arena.h" +#include "alloc_arena.hxx" -#include "alloc_impl.h" +#include "alloc_impl.hxx" #include "internal/once.h" +#include "internal/rtllifecycle.h" #include "sal/macros.h" #include "osl/diagnose.h" @@ -54,7 +55,7 @@ struct rtl_arena_list_st rtl_arena_type m_arena_head; }; -static struct rtl_arena_list_st g_arena_list; +static rtl_arena_list_st g_arena_list; /** gp_arena_arena @@ -89,7 +90,7 @@ SAL_CALL rtl_machdep_free ( ); static sal_Size -rtl_machdep_pagesize (void); +rtl_machdep_pagesize(); /** gp_default_arena @@ -142,7 +143,8 @@ rtl_arena_segment_populate ( rtl_arena_segment_type *span; sal_Size size = rtl_machdep_pagesize(); - span = rtl_machdep_alloc(gp_machdep_arena, &size); + span = static_cast< rtl_arena_segment_type * >( + rtl_machdep_alloc(gp_machdep_arena, &size)); if (span != 0) { rtl_arena_segment_type *first, *last, *head; @@ -473,7 +475,7 @@ rtl_arena_segment_alloc ( if (!RTL_MEMORY_ISP2(size)) { int msb = highbit(size); - if (RTL_ARENA_FREELIST_SIZE == SAL_INT_CAST(size_t, msb)) + if (RTL_ARENA_FREELIST_SIZE == sal::static_int_cast< size_t >(msb)) { /* highest possible freelist: fall back to first fit */ rtl_arena_segment_type *head, *segment; @@ -708,7 +710,7 @@ rtl_arena_destructor (void * obj) OSL_ASSERT(arena->m_hash_size == RTL_ARENA_HASH_SIZE); OSL_ASSERT( arena->m_hash_shift == - SAL_INT_CAST(unsigned, highbit(arena->m_hash_size) - 1)); + sal::static_int_cast< unsigned >(highbit(arena->m_hash_size) - 1)); } /* ================================================================= */ @@ -748,7 +750,7 @@ rtl_arena_activate ( if (arena->m_qcache_max > 0) { - char name[RTL_ARENA_NAME_LENGTH + 1]; + char namebuf[RTL_ARENA_NAME_LENGTH + 1]; int i, n = (arena->m_qcache_max >> arena->m_quantum_shift); sal_Size size = n * sizeof(rtl_cache_type*); @@ -761,8 +763,8 @@ rtl_arena_activate ( for (i = 1; i <= n; i++) { size = i * arena->m_quantum; - (void) snprintf (name, sizeof(name), "%s_%lu", arena->m_name, size); - arena->m_qcache_ptr[i - 1] = rtl_cache_create(name, size, 0, NULL, NULL, NULL, NULL, arena, RTL_CACHE_FLAG_QUANTUMCACHE); + (void) snprintf (namebuf, sizeof(namebuf), "%s_%lu", arena->m_name, size); + arena->m_qcache_ptr[i - 1] = rtl_cache_create(namebuf, size, 0, NULL, NULL, NULL, NULL, arena, RTL_CACHE_FLAG_QUANTUMCACHE); } } @@ -909,8 +911,6 @@ rtl_arena_deactivate ( * * ================================================================= */ -extern void ensureArenaSingleton(); - /** rtl_arena_create() */ rtl_arena_type * @@ -921,14 +921,12 @@ SAL_CALL rtl_arena_create ( rtl_arena_type * source_arena, void * (SAL_CALL * source_alloc)(rtl_arena_type *, sal_Size *), void (SAL_CALL * source_free) (rtl_arena_type *, void *, sal_Size), - int flags + int ) SAL_THROW_EXTERN_C() { rtl_arena_type * result = 0; sal_Size size = sizeof(rtl_arena_type); - (void) flags; /* unused */ - try_alloc: result = (rtl_arena_type*)rtl_arena_alloc (gp_arena_arena, &size); if (result != 0) @@ -978,7 +976,7 @@ try_alloc: void SAL_CALL rtl_arena_destroy ( rtl_arena_type * arena -) +) SAL_THROW_EXTERN_C() { if (arena != 0) { @@ -1243,7 +1241,7 @@ SAL_CALL rtl_machdep_free ( /** rtl_machdep_pagesize() */ static sal_Size -rtl_machdep_pagesize (void) +rtl_machdep_pagesize() { #if defined(SAL_UNX) #if defined(FREEBSD) || defined(NETBSD) || defined(DRAGONFLY) @@ -1265,7 +1263,7 @@ rtl_machdep_pagesize (void) * ================================================================= */ void -rtl_arena_init (void) +rtl_arena_init() { { /* list of arenas */ @@ -1333,7 +1331,7 @@ rtl_arena_init (void) /* ================================================================= */ void -rtl_arena_fini (void) +rtl_arena_fini() { if (gp_arena_arena != 0) { diff --git a/sal/rtl/source/alloc_arena.h b/sal/rtl/source/alloc_arena.hxx index 8c0f08c0fd4f..6a933a9ed5f9 100644 --- a/sal/rtl/source/alloc_arena.h +++ b/sal/rtl/source/alloc_arena.hxx @@ -26,22 +26,17 @@ * ************************************************************************/ -#ifndef INCLUDED_RTL_ALLOC_ARENA_H -#define INCLUDED_RTL_ALLOC_ARENA_H +#ifndef INCLUDED_RTL_ALLOC_ARENA_HXX +#define INCLUDED_RTL_ALLOC_ARENA_HXX #include "sal/types.h" #include "rtl/alloc.h" -#include "alloc_impl.h" - -#ifdef __cplusplus -extern "C" { -#endif +#include "alloc_impl.hxx" /** rtl_arena_stat_type * @internal */ -typedef struct rtl_arena_stat_st rtl_arena_stat_type; -struct rtl_arena_stat_st +struct rtl_arena_stat_type { sal_uInt64 m_alloc; sal_uInt64 m_free; @@ -59,8 +54,7 @@ struct rtl_arena_stat_st #define RTL_ARENA_SEGMENT_TYPE_FREE ((sal_Size)(0x04)) #define RTL_ARENA_SEGMENT_TYPE_USED ((sal_Size)(0x08)) -typedef struct rtl_arena_segment_st rtl_arena_segment_type; -struct rtl_arena_segment_st +struct rtl_arena_segment_type { /* segment list linkage */ rtl_arena_segment_type * m_snext; @@ -130,11 +124,6 @@ struct rtl_arena_st */ extern rtl_arena_type * gp_default_arena; - -#ifdef __cplusplus -} -#endif - -#endif /* INCLUDED_RTL_ALLOC_ARENA_H */ +#endif /* INCLUDED_RTL_ALLOC_ARENA_HXX */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/rtl/source/alloc_cache.c b/sal/rtl/source/alloc_cache.cxx index 1a4c87e09395..a1d8d5490961 100644 --- a/sal/rtl/source/alloc_cache.c +++ b/sal/rtl/source/alloc_cache.cxx @@ -26,10 +26,11 @@ * ************************************************************************/ -#include "alloc_cache.h" -#include "alloc_impl.h" -#include "alloc_arena.h" +#include "alloc_cache.hxx" +#include "alloc_impl.hxx" +#include "alloc_arena.hxx" #include "internal/once.h" +#include "internal/rtllifecycle.h" #include "sal/macros.h" #include "osl/diagnose.h" @@ -67,7 +68,7 @@ struct rtl_cache_list_st int m_update_done; }; -static struct rtl_cache_list_st g_cache_list; +static rtl_cache_list_st g_cache_list; /** gp_cache_arena @@ -257,12 +258,10 @@ rtl_cache_hash_remove ( /** rtl_cache_slab_constructor() */ static int -rtl_cache_slab_constructor (void * obj, void * arg) +rtl_cache_slab_constructor (void * obj, void *) { rtl_cache_slab_type * slab = (rtl_cache_slab_type*)(obj); - (void) arg; /* unused */ - QUEUE_START_NAMED(slab, slab_); slab->m_ntypes = 0; @@ -273,7 +272,7 @@ rtl_cache_slab_constructor (void * obj, void * arg) /** rtl_cache_slab_destructor() */ static void -rtl_cache_slab_destructor (void * obj, void * arg) +rtl_cache_slab_destructor (void * obj, void *) { #if OSL_DEBUG_LEVEL == 0 (void) obj; /* unused */ @@ -286,8 +285,6 @@ rtl_cache_slab_destructor (void * obj, void * arg) /* assure no longer referenced */ OSL_ASSERT(slab->m_ntypes == 0); #endif /* OSL_DEBUG_LEVEL */ - - (void) arg; /* unused */ } @@ -587,13 +584,11 @@ rtl_cache_slab_free ( /** rtl_cache_magazine_constructor() */ static int -rtl_cache_magazine_constructor (void * obj, void * arg) +rtl_cache_magazine_constructor (void * obj, void *) { rtl_cache_magazine_type * mag = (rtl_cache_magazine_type*)(obj); /* @@@ sal_Size size = (sal_Size)(arg); @@@ */ - (void) arg; /* unused */ - mag->m_mag_next = 0; mag->m_mag_size = RTL_CACHE_MAGAZINE_SIZE; mag->m_mag_used = 0; @@ -605,7 +600,7 @@ rtl_cache_magazine_constructor (void * obj, void * arg) /** rtl_cache_magazine_destructor() */ static void -rtl_cache_magazine_destructor (void * obj, void * arg) +rtl_cache_magazine_destructor (void * obj, void *) { #if OSL_DEBUG_LEVEL == 0 (void) obj; /* unused */ @@ -618,8 +613,6 @@ rtl_cache_magazine_destructor (void * obj, void * arg) /* assure no longer referenced */ OSL_ASSERT(mag->m_mag_used == 0); #endif /* OSL_DEBUG_LEVEL */ - - (void) arg; /* unused */ } @@ -1110,8 +1103,6 @@ rtl_cache_deactivate ( * * ================================================================= */ -extern void ensureCacheSingleton(); - /** rtl_cache_create() */ rtl_cache_type * @@ -1379,7 +1370,7 @@ SAL_CALL rtl_cache_free ( * @precond g_cache_list.m_lock initialized */ static void -rtl_cache_wsupdate_init (void); +rtl_cache_wsupdate_init(); /** rtl_cache_wsupdate_wait() @@ -1395,7 +1386,7 @@ rtl_cache_wsupdate_wait ( * */ static void -rtl_cache_wsupdate_fini (void); +rtl_cache_wsupdate_fini(); /* ================================================================= */ @@ -1407,7 +1398,7 @@ static void * rtl_cache_wsupdate_all (void * arg); static void -rtl_cache_wsupdate_init (void) +rtl_cache_wsupdate_init() { RTL_MEMORY_LOCK_ACQUIRE(&(g_cache_list.m_lock)); g_cache_list.m_update_done = 0; @@ -1426,8 +1417,8 @@ rtl_cache_wsupdate_wait (unsigned int seconds) { if (seconds > 0) { - struct timeval now; - struct timespec wakeup; + timeval now; + timespec wakeup; gettimeofday(&now, 0); wakeup.tv_sec = now.tv_sec + (seconds); @@ -1441,7 +1432,7 @@ rtl_cache_wsupdate_wait (unsigned int seconds) } static void -rtl_cache_wsupdate_fini (void) +rtl_cache_wsupdate_fini() { RTL_MEMORY_LOCK_ACQUIRE(&(g_cache_list.m_lock)); g_cache_list.m_update_done = 1; @@ -1460,7 +1451,7 @@ static DWORD WINAPI rtl_cache_wsupdate_all (void * arg); static void -rtl_cache_wsupdate_init (void) +rtl_cache_wsupdate_init() { DWORD dwThreadId; @@ -1485,7 +1476,7 @@ rtl_cache_wsupdate_wait (unsigned int seconds) } static void -rtl_cache_wsupdate_fini (void) +rtl_cache_wsupdate_fini() { RTL_MEMORY_LOCK_ACQUIRE(&(g_cache_list.m_lock)); g_cache_list.m_update_done = 1; @@ -1572,7 +1563,8 @@ static DWORD WINAPI #endif /* SAL_UNX || SAL_W32 */ rtl_cache_wsupdate_all (void * arg) { - unsigned int seconds = (unsigned int)SAL_INT_CAST(sal_uIntPtr, arg); + unsigned int seconds = sal::static_int_cast< unsigned int >( + reinterpret_cast< sal_uIntPtr >(arg)); RTL_MEMORY_LOCK_ACQUIRE(&(g_cache_list.m_lock)); while (!g_cache_list.m_update_done) @@ -1603,7 +1595,7 @@ rtl_cache_wsupdate_all (void * arg) * ================================================================= */ void -rtl_cache_init (void) +rtl_cache_init() { { /* list of caches */ @@ -1705,7 +1697,7 @@ rtl_cache_init (void) /* ================================================================= */ void -rtl_cache_fini (void) +rtl_cache_fini() { if (gp_cache_arena != 0) { diff --git a/sal/rtl/source/alloc_cache.h b/sal/rtl/source/alloc_cache.hxx index 05efceb980c8..1238981fc022 100644 --- a/sal/rtl/source/alloc_cache.h +++ b/sal/rtl/source/alloc_cache.hxx @@ -26,22 +26,17 @@ * ************************************************************************/ -#ifndef INCLUDED_RTL_ALLOC_CACHE_H -#define INCLUDED_RTL_ALLOC_CACHE_H +#ifndef INCLUDED_RTL_ALLOC_CACHE_HXX +#define INCLUDED_RTL_ALLOC_CACHE_HXX #include "sal/types.h" #include "rtl/alloc.h" -#include "alloc_impl.h" - -#ifdef __cplusplus -extern "C" { -#endif +#include "alloc_impl.hxx" /** rtl_cache_stat_type * @internal */ -typedef struct rtl_cache_stat_st rtl_cache_stat_type; -struct rtl_cache_stat_st +struct rtl_cache_stat_type { sal_uInt64 m_alloc; sal_uInt64 m_free; @@ -54,8 +49,7 @@ struct rtl_cache_stat_st /** rtl_cache_bufctl_type * @internal */ -typedef struct rtl_cache_bufctl_st rtl_cache_bufctl_type; -struct rtl_cache_bufctl_st +struct rtl_cache_bufctl_type { rtl_cache_bufctl_type * m_next; /* linkage */ @@ -67,8 +61,7 @@ struct rtl_cache_bufctl_st /** rtl_cache_slab_type * @internal */ -typedef struct rtl_cache_slab_st rtl_cache_slab_type; -struct rtl_cache_slab_st +struct rtl_cache_slab_type { rtl_cache_slab_type * m_slab_next; /* slab linkage */ rtl_cache_slab_type * m_slab_prev; /* slab linkage */ @@ -86,8 +79,7 @@ struct rtl_cache_slab_st */ #define RTL_CACHE_MAGAZINE_SIZE 61 -typedef struct rtl_cache_magazine_st rtl_cache_magazine_type; -struct rtl_cache_magazine_st +struct rtl_cache_magazine_type { rtl_cache_magazine_type * m_mag_next; /* depot linkage */ @@ -101,8 +93,7 @@ struct rtl_cache_magazine_st /** rtl_cache_depot_type * @internal */ -typedef struct rtl_cache_depot_st rtl_cache_depot_type; -struct rtl_cache_depot_st +struct rtl_cache_depot_type { /* magazine list */ rtl_cache_magazine_type * m_mag_next; /* linkage */ @@ -175,11 +166,6 @@ struct rtl_cache_st rtl_cache_stat_type m_cpu_stats; }; - -#ifdef __cplusplus -} -#endif - -#endif /* INCLUDED_RTL_ALLOC_CACHE_H */ +#endif /* INCLUDED_RTL_ALLOC_CACHE_HXX */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/rtl/source/alloc_fini.cxx b/sal/rtl/source/alloc_fini.cxx index 1c1d30af43d1..ad9ff0881dbe 100644 --- a/sal/rtl/source/alloc_fini.cxx +++ b/sal/rtl/source/alloc_fini.cxx @@ -28,8 +28,8 @@ #include <rtl/instance.hxx> -extern "C" void rtl_memory_fini (void); -extern "C" void rtl_memory_init (void); +#include "internal/rtllifecycle.h" + namespace { struct rtlMemorySingleton @@ -46,13 +46,12 @@ namespace class theMemorySingleton : public rtl::Static<rtlMemorySingleton, theMemorySingleton>{}; } -extern "C" void ensureMemorySingleton() + +void ensureMemorySingleton() { theMemorySingleton::get(); } -extern "C" void rtl_cache_fini (void); -extern "C" void rtl_cache_init (void); namespace { struct rtlCacheSingleton @@ -69,13 +68,12 @@ namespace class theCacheSingleton : public rtl::Static<rtlCacheSingleton, theCacheSingleton>{}; } -extern "C" void ensureCacheSingleton() + +void ensureCacheSingleton() { theCacheSingleton::get(); } -extern "C" void rtl_arena_fini (void); -extern "C" void rtl_arena_init (void); namespace { struct rtlArenaSingleton @@ -92,13 +90,12 @@ namespace class theArenaSingleton : public rtl::Static<rtlArenaSingleton, theArenaSingleton>{}; } -extern "C" void ensureArenaSingleton() + +void ensureArenaSingleton() { theArenaSingleton::get(); } -extern "C" void rtl_locale_fini (void); -extern "C" void rtl_locale_init (void); namespace { struct rtlLocaleSingleton @@ -115,7 +112,8 @@ namespace class theLocaleSingleton : public rtl::Static<rtlLocaleSingleton, theLocaleSingleton>{}; } -extern "C" void ensureLocaleSingleton() + +void ensureLocaleSingleton() { theLocaleSingleton::get(); } diff --git a/sal/rtl/source/alloc_global.c b/sal/rtl/source/alloc_global.cxx index 57728f61ffb4..e48fdd1072c7 100644 --- a/sal/rtl/source/alloc_global.c +++ b/sal/rtl/source/alloc_global.cxx @@ -26,7 +26,7 @@ * ************************************************************************/ -#include "alloc_impl.h" +#include "alloc_impl.hxx" #include "rtl/alloc.h" #include <sal/macros.h> #include <osl/diagnose.h> @@ -34,10 +34,12 @@ #include <string.h> #include <stdio.h> +#include "internal/rtllifecycle.h" + AllocMode alloc_mode = AMode_UNSET; #if !defined(FORCE_SYSALLOC) -static void determine_alloc_mode(void) +static void determine_alloc_mode() { OSL_ASSERT(alloc_mode == AMode_UNSET); alloc_mode = (getenv("G_SLICE") == NULL ? AMode_CUSTOM : AMode_SYSTEM); @@ -92,8 +94,6 @@ static rtl_cache_type * g_alloc_table[RTL_MEMORY_CACHED_LIMIT >> RTL_MEMALIGN_SH static rtl_arena_type * gp_alloc_arena = 0; -extern void ensureMemorySingleton(); - /* ================================================================= * * * custom allocator implemenation. @@ -194,7 +194,7 @@ void * SAL_CALL rtl_reallocateMemory_CUSTOM (void * p, sal_Size n) SAL_THROW_EXT * * ================================================================= */ -void rtl_memory_init (void) +void rtl_memory_init() { #if !defined(FORCE_SYSALLOC) { @@ -239,7 +239,7 @@ void rtl_memory_init (void) /* ================================================================= */ -void rtl_memory_fini (void) +void rtl_memory_fini() { #if !defined(FORCE_SYSALLOC) int i, n; diff --git a/sal/rtl/source/alloc_impl.h b/sal/rtl/source/alloc_impl.hxx index 8ea038496dfa..2e51abe2149b 100644 --- a/sal/rtl/source/alloc_impl.h +++ b/sal/rtl/source/alloc_impl.hxx @@ -26,16 +26,11 @@ * ************************************************************************/ -#ifndef INCLUDED_RTL_ALLOC_IMPL_H -#define INCLUDED_RTL_ALLOC_IMPL_H +#ifndef INCLUDED_RTL_ALLOC_IMPL_HXX +#define INCLUDED_RTL_ALLOC_IMPL_HXX #include "sal/types.h" -#ifdef __cplusplus -extern "C" { -#endif - - /** Alignment macros */ #if SAL_TYPES_ALIGNMENT4 > 1 @@ -98,7 +93,7 @@ extern "C" { static RTL_MEMORY_INLINE int highbit(sal_Size n) { - register int k = 1; + int k = 1; if (n == 0) return (0); @@ -131,7 +126,7 @@ highbit(sal_Size n) static RTL_MEMORY_INLINE int lowbit(sal_Size n) { - register int k = 1; + int k = 1; if (n == 0) return (0); @@ -275,10 +270,6 @@ typedef enum { AMode_CUSTOM, AMode_SYSTEM, AMode_UNSET } AllocMode; extern AllocMode alloc_mode; -#ifdef __cplusplus -} -#endif - -#endif /* INCLUDED_RTL_ALLOC_IMPL_H */ +#endif /* INCLUDED_RTL_ALLOC_IMPL_HXX */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/rtl/source/byteseq.c b/sal/rtl/source/byteseq.cxx index 52c81d8df375..76423f78f1f9 100644 --- a/sal/rtl/source/byteseq.c +++ b/sal/rtl/source/byteseq.cxx @@ -45,7 +45,7 @@ static sal_Sequence aEmpty_rtl_ByteSeq = //================================================================================================== void SAL_CALL rtl_byte_sequence_reference2One( - sal_Sequence ** ppSequence ) + sal_Sequence ** ppSequence ) SAL_THROW_EXTERN_C() { sal_Sequence * pSequence, * pNew; sal_Int32 nElements; @@ -83,7 +83,7 @@ void SAL_CALL rtl_byte_sequence_reference2One( //================================================================================================== void SAL_CALL rtl_byte_sequence_realloc( - sal_Sequence ** ppSequence, sal_Int32 nSize ) + sal_Sequence ** ppSequence, sal_Int32 nSize ) SAL_THROW_EXTERN_C() { sal_Sequence * pSequence, * pNew; sal_Int32 nElements; @@ -133,6 +133,7 @@ void SAL_CALL rtl_byte_sequence_realloc( //================================================================================================== void SAL_CALL rtl_byte_sequence_acquire( sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { OSL_ASSERT( pSequence ); osl_incrementInterlockedCount( &(pSequence->nRefCount) ); @@ -140,6 +141,7 @@ void SAL_CALL rtl_byte_sequence_acquire( sal_Sequence *pSequence ) //================================================================================================== void SAL_CALL rtl_byte_sequence_release( sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { if ( pSequence != 0 ) { @@ -152,6 +154,7 @@ void SAL_CALL rtl_byte_sequence_release( sal_Sequence *pSequence ) //================================================================================================== void SAL_CALL rtl_byte_sequence_construct( sal_Sequence **ppSequence , sal_Int32 nLength ) + SAL_THROW_EXTERN_C() { OSL_ASSERT( ppSequence ); if( *ppSequence ) @@ -179,6 +182,7 @@ void SAL_CALL rtl_byte_sequence_construct( sal_Sequence **ppSequence , sal_Int32 //================================================================================================== void SAL_CALL rtl_byte_sequence_constructNoDefault( sal_Sequence **ppSequence , sal_Int32 nLength ) + SAL_THROW_EXTERN_C() { OSL_ASSERT( ppSequence ); if( *ppSequence ) @@ -199,6 +203,7 @@ void SAL_CALL rtl_byte_sequence_constructNoDefault( sal_Sequence **ppSequence , //================================================================================================== void SAL_CALL rtl_byte_sequence_constructFromArray( sal_Sequence **ppSequence, const sal_Int8 *pData , sal_Int32 nLength ) + SAL_THROW_EXTERN_C() { rtl_byte_sequence_constructNoDefault( ppSequence , nLength ); if ( *ppSequence != 0 ) @@ -207,6 +212,7 @@ void SAL_CALL rtl_byte_sequence_constructFromArray( //================================================================================================== void SAL_CALL rtl_byte_sequence_assign( sal_Sequence **ppSequence , sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { if ( *ppSequence != pSequence) { @@ -224,6 +230,7 @@ void SAL_CALL rtl_byte_sequence_assign( sal_Sequence **ppSequence , sal_Sequence //================================================================================================== sal_Bool SAL_CALL rtl_byte_sequence_equals( sal_Sequence *pSequence1 , sal_Sequence *pSequence2 ) + SAL_THROW_EXTERN_C() { OSL_ASSERT( pSequence1 ); OSL_ASSERT( pSequence2 ); @@ -244,12 +251,14 @@ sal_Bool SAL_CALL rtl_byte_sequence_equals( sal_Sequence *pSequence1 , sal_Seque //================================================================================================== const sal_Int8 *SAL_CALL rtl_byte_sequence_getConstArray( sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { return ((const sal_Int8*)(pSequence->elements)); } //================================================================================================== sal_Int32 SAL_CALL rtl_byte_sequence_getLength( sal_Sequence *pSequence ) + SAL_THROW_EXTERN_C() { return pSequence->nElements; } diff --git a/sal/rtl/source/cipher.c b/sal/rtl/source/cipher.cxx index e6ede4274af6..31c141771724 100644 --- a/sal/rtl/source/cipher.c +++ b/sal/rtl/source/cipher.cxx @@ -98,7 +98,7 @@ typedef void (SAL_CALL cipher_delete_t) (rtlCipher Cipher); /** Cipher_Impl. */ -typedef struct cipher_impl_st +struct Cipher_Impl { rtlCipherAlgorithm m_algorithm; rtlCipherDirection m_direction; @@ -108,7 +108,7 @@ typedef struct cipher_impl_st cipher_update_t *m_encode; cipher_update_t *m_decode; cipher_delete_t *m_delete; -} Cipher_Impl; +}; /*======================================================================== * @@ -120,7 +120,7 @@ typedef struct cipher_impl_st */ rtlCipher SAL_CALL rtl_cipher_create ( rtlCipherAlgorithm Algorithm, - rtlCipherMode Mode) + rtlCipherMode Mode) SAL_THROW_EXTERN_C() { rtlCipher Cipher = (rtlCipher)NULL; switch (Algorithm) @@ -146,7 +146,7 @@ rtlCipherError SAL_CALL rtl_cipher_init ( rtlCipher Cipher, rtlCipherDirection Direction, const sal_uInt8 *pKeyData, sal_Size nKeyLen, - const sal_uInt8 *pArgData, sal_Size nArgLen) + const sal_uInt8 *pArgData, sal_Size nArgLen) SAL_THROW_EXTERN_C() { Cipher_Impl *pImpl = (Cipher_Impl*)Cipher; if (pImpl == NULL) @@ -164,7 +164,7 @@ rtlCipherError SAL_CALL rtl_cipher_init ( rtlCipherError SAL_CALL rtl_cipher_encode ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { Cipher_Impl *pImpl = (Cipher_Impl*)Cipher; if (pImpl == NULL) @@ -181,7 +181,7 @@ rtlCipherError SAL_CALL rtl_cipher_encode ( rtlCipherError SAL_CALL rtl_cipher_decode ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { Cipher_Impl *pImpl = (Cipher_Impl*)Cipher; if (pImpl == NULL) @@ -195,7 +195,7 @@ rtlCipherError SAL_CALL rtl_cipher_decode ( /* * rtl_cipher_destroy. */ -void SAL_CALL rtl_cipher_destroy (rtlCipher Cipher) +void SAL_CALL rtl_cipher_destroy (rtlCipher Cipher) SAL_THROW_EXTERN_C() { Cipher_Impl *pImpl = (Cipher_Impl*)Cipher; if (pImpl && pImpl->m_delete) @@ -209,13 +209,13 @@ void SAL_CALL rtl_cipher_destroy (rtlCipher Cipher) *======================================================================*/ #define CIPHER_ROUNDS_BF 16 -typedef struct cipherBF_key_st +struct CipherKeyBF { sal_uInt32 m_S[4][256]; sal_uInt32 m_P[CIPHER_ROUNDS_BF + 2]; -} CipherKeyBF; +}; -typedef struct cipherBF_context_st +struct CipherContextBF { CipherKeyBF m_key; union @@ -224,13 +224,13 @@ typedef struct cipherBF_context_st sal_uInt8 m_byte[8]; } m_iv; sal_uInt32 m_offset; -} CipherContextBF; +}; -typedef struct cipherBF_impl_st +struct CipherBF_Impl { Cipher_Impl m_cipher; CipherContextBF m_context; -} CipherBF_Impl; +}; /** __rtl_cipherBF_init. */ @@ -1017,7 +1017,7 @@ static sal_uInt32 __rtl_cipherBF (CipherKeyBF *key, sal_uInt32 x) /* * rtl_cipher_createBF. */ -rtlCipher SAL_CALL rtl_cipher_createBF (rtlCipherMode Mode) +rtlCipher SAL_CALL rtl_cipher_createBF (rtlCipherMode Mode) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)NULL; @@ -1046,7 +1046,7 @@ rtlCipherError SAL_CALL rtl_cipher_initBF ( rtlCipher Cipher, rtlCipherDirection Direction, const sal_uInt8 *pKeyData, sal_Size nKeyLen, - const sal_uInt8 *pArgData, sal_Size nArgLen) + const sal_uInt8 *pArgData, sal_Size nArgLen) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)Cipher; @@ -1072,7 +1072,7 @@ rtlCipherError SAL_CALL rtl_cipher_initBF ( rtlCipherError SAL_CALL rtl_cipher_encodeBF ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)Cipher; if (pImpl == NULL) @@ -1098,7 +1098,7 @@ rtlCipherError SAL_CALL rtl_cipher_encodeBF ( rtlCipherError SAL_CALL rtl_cipher_decodeBF ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)Cipher; if (pImpl == NULL) @@ -1121,7 +1121,7 @@ rtlCipherError SAL_CALL rtl_cipher_decodeBF ( /* * rtl_cipher_destroyBF. */ -void SAL_CALL rtl_cipher_destroyBF (rtlCipher Cipher) +void SAL_CALL rtl_cipher_destroyBF (rtlCipher Cipher) SAL_THROW_EXTERN_C() { CipherBF_Impl *pImpl = (CipherBF_Impl*)Cipher; if (pImpl) @@ -1140,17 +1140,17 @@ void SAL_CALL rtl_cipher_destroyBF (rtlCipher Cipher) *======================================================================*/ #define CIPHER_CBLOCK_ARCFOUR 256 -typedef struct cipherARCFOUR_context_st +struct ContextARCFOUR_Impl { unsigned int m_S[CIPHER_CBLOCK_ARCFOUR]; unsigned int m_X, m_Y; -} ContextARCFOUR_Impl; +}; -typedef struct cipherARCFOUR_impl_st +struct CipherARCFOUR_Impl { Cipher_Impl m_cipher; ContextARCFOUR_Impl m_context; -} CipherARCFOUR_Impl; +}; /** rtl_cipherARCFOUR_update_Impl. */ @@ -1207,8 +1207,8 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl ( const sal_uInt8 *pData, sal_Size nDatLen, sal_uInt8 *pBuffer, sal_Size nBufLen) { - register unsigned int *S; - register unsigned int x, y, t; + unsigned int *S; + unsigned int x, y, t; sal_Size k; /* Check arguments. */ @@ -1253,6 +1253,7 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl ( * rtl_cipher_createARCFOUR. */ rtlCipher SAL_CALL rtl_cipher_createARCFOUR (rtlCipherMode Mode) + SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)NULL; @@ -1281,11 +1282,9 @@ rtlCipherError SAL_CALL rtl_cipher_initARCFOUR ( rtlCipher Cipher, rtlCipherDirection Direction, const sal_uInt8 *pKeyData, sal_Size nKeyLen, - const sal_uInt8 *pArgData, sal_Size nArgLen) + const sal_uInt8 *, sal_Size) SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)Cipher; - (void) pArgData; // avoid warning - (void) nArgLen; // avoid warning if ((pImpl == NULL) || (pKeyData == NULL)) return rtl_Cipher_E_Argument; @@ -1307,7 +1306,7 @@ rtlCipherError SAL_CALL rtl_cipher_initARCFOUR ( rtlCipherError SAL_CALL rtl_cipher_encodeARCFOUR ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)Cipher; if (pImpl == NULL) @@ -1330,7 +1329,7 @@ rtlCipherError SAL_CALL rtl_cipher_encodeARCFOUR ( rtlCipherError SAL_CALL rtl_cipher_decodeARCFOUR ( rtlCipher Cipher, const void *pData, sal_Size nDatLen, - sal_uInt8 *pBuffer, sal_Size nBufLen) + sal_uInt8 *pBuffer, sal_Size nBufLen) SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)Cipher; if (pImpl == NULL) @@ -1350,7 +1349,7 @@ rtlCipherError SAL_CALL rtl_cipher_decodeARCFOUR ( /* * rtl_cipher_destroyARCFOUR. */ -void SAL_CALL rtl_cipher_destroyARCFOUR (rtlCipher Cipher) +void SAL_CALL rtl_cipher_destroyARCFOUR (rtlCipher Cipher) SAL_THROW_EXTERN_C() { CipherARCFOUR_Impl *pImpl = (CipherARCFOUR_Impl*)Cipher; if (pImpl) diff --git a/sal/rtl/source/cmdargs.cxx b/sal/rtl/source/cmdargs.cxx index ed44843b11cc..475e5fb76236 100644 --- a/sal/rtl/source/cmdargs.cxx +++ b/sal/rtl/source/cmdargs.cxx @@ -103,7 +103,7 @@ oslProcessError SAL_CALL rtl_getAppCommandArg ( return (result); } -sal_uInt32 SAL_CALL rtl_getAppCommandArgCount (void) +sal_uInt32 SAL_CALL rtl_getAppCommandArgCount() { init(); return g_nCommandArgCount; diff --git a/sal/rtl/source/crc.c b/sal/rtl/source/crc.cxx index fa372aaf4339..942bff7026c6 100644 --- a/sal/rtl/source/crc.c +++ b/sal/rtl/source/crc.cxx @@ -148,12 +148,12 @@ static const sal_uInt32 rtl_crc32Table[256] = */ sal_uInt32 SAL_CALL rtl_crc32 ( sal_uInt32 Crc, - const void *Data, sal_uInt32 DatLen) + const void *Data, sal_uInt32 DatLen) SAL_THROW_EXTERN_C() { if (Data) { - register const sal_uInt8 *p = (const sal_uInt8 *)Data; - register const sal_uInt8 *q = p + DatLen; + const sal_uInt8 *p = (const sal_uInt8 *)Data; + const sal_uInt8 *q = p + DatLen; Crc = ~Crc; while (p < q) diff --git a/sal/rtl/source/digest.c b/sal/rtl/source/digest.cxx index 92736cf4dd95..1bcc1509867c 100644 --- a/sal/rtl/source/digest.c +++ b/sal/rtl/source/digest.cxx @@ -67,7 +67,7 @@ typedef rtlDigestError (SAL_CALL Digest_update_t) ( typedef rtlDigestError (SAL_CALL Digest_get_t) ( void *ctx, sal_uInt8 *Buffer, sal_uInt32 BufLen); -typedef struct digest_impl_st +struct Digest_Impl { rtlDigestAlgorithm m_algorithm; sal_uInt32 m_length; @@ -76,15 +76,15 @@ typedef struct digest_impl_st Digest_delete_t *m_delete; Digest_update_t *m_update; Digest_get_t *m_get; -} Digest_Impl; +}; /* * __rtl_digest_swapLong. */ static void __rtl_digest_swapLong (sal_uInt32 *pData, sal_uInt32 nDatLen) { - register sal_uInt32 *X; - register int i, n; + sal_uInt32 *X; + int i, n; X = pData; n = nDatLen; @@ -102,6 +102,7 @@ static void __rtl_digest_swapLong (sal_uInt32 *pData, sal_uInt32 nDatLen) * rtl_digest_create. */ rtlDigest SAL_CALL rtl_digest_create (rtlDigestAlgorithm Algorithm) + SAL_THROW_EXTERN_C() { rtlDigest Digest = (rtlDigest)NULL; switch (Algorithm) @@ -140,6 +141,7 @@ rtlDigest SAL_CALL rtl_digest_create (rtlDigestAlgorithm Algorithm) * rtl_digest_queryAlgorithm. */ rtlDigestAlgorithm SAL_CALL rtl_digest_queryAlgorithm (rtlDigest Digest) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl) @@ -152,6 +154,7 @@ rtlDigestAlgorithm SAL_CALL rtl_digest_queryAlgorithm (rtlDigest Digest) * rtl_digest_queryLength. */ sal_uInt32 SAL_CALL rtl_digest_queryLength (rtlDigest Digest) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl) @@ -165,6 +168,7 @@ sal_uInt32 SAL_CALL rtl_digest_queryLength (rtlDigest Digest) */ rtlDigestError SAL_CALL rtl_digest_init ( rtlDigest Digest, const sal_uInt8 *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl) @@ -182,6 +186,7 @@ rtlDigestError SAL_CALL rtl_digest_init ( */ rtlDigestError SAL_CALL rtl_digest_update ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl && pImpl->m_update) @@ -195,6 +200,7 @@ rtlDigestError SAL_CALL rtl_digest_update ( */ rtlDigestError SAL_CALL rtl_digest_get ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl && pImpl->m_get) @@ -206,7 +212,7 @@ rtlDigestError SAL_CALL rtl_digest_get ( /* * rtl_digest_destroy. */ -void SAL_CALL rtl_digest_destroy (rtlDigest Digest) +void SAL_CALL rtl_digest_destroy (rtlDigest Digest) SAL_THROW_EXTERN_C() { Digest_Impl *pImpl = (Digest_Impl *)Digest; if (pImpl && pImpl->m_delete) @@ -221,19 +227,19 @@ void SAL_CALL rtl_digest_destroy (rtlDigest Digest) #define DIGEST_CBLOCK_MD2 16 #define DIGEST_LBLOCK_MD2 16 -typedef struct digestMD2_context_st +struct DigestContextMD2 { sal_uInt32 m_nDatLen; sal_uInt8 m_pData[DIGEST_CBLOCK_MD2]; sal_uInt32 m_state[DIGEST_LBLOCK_MD2]; sal_uInt32 m_chksum[DIGEST_LBLOCK_MD2]; -} DigestContextMD2; +}; -typedef struct digestMD2_impl_st +struct DigestMD2_Impl { Digest_Impl m_digest; DigestContextMD2 m_context; -} DigestMD2_Impl; +}; static void __rtl_digest_initMD2 (DigestContextMD2 *ctx); static void __rtl_digest_updateMD2 (DigestContextMD2 *ctx); @@ -302,9 +308,9 @@ static void __rtl_digest_initMD2 (DigestContextMD2 *ctx) */ static void __rtl_digest_updateMD2 (DigestContextMD2 *ctx) { - register sal_uInt8 *X; - register sal_uInt32 *sp1, *sp2; - register sal_uInt32 i, k, t; + sal_uInt8 *X; + sal_uInt32 *sp1, *sp2; + sal_uInt32 i, k, t; sal_uInt32 state[48]; @@ -347,8 +353,8 @@ static void __rtl_digest_updateMD2 (DigestContextMD2 *ctx) */ static void __rtl_digest_endMD2 (DigestContextMD2 *ctx) { - register sal_uInt8 *X; - register sal_uInt32 *C; + sal_uInt8 *X; + sal_uInt32 *C; sal_uInt32 i, n; X = ctx->m_pData; @@ -374,7 +380,7 @@ static void __rtl_digest_endMD2 (DigestContextMD2 *ctx) */ rtlDigestError SAL_CALL rtl_digest_MD2 ( const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestMD2_Impl digest; rtlDigestError result; @@ -393,7 +399,7 @@ rtlDigestError SAL_CALL rtl_digest_MD2 ( /* * rtl_digest_createMD2. */ -rtlDigest SAL_CALL rtl_digest_createMD2 (void) +rtlDigest SAL_CALL rtl_digest_createMD2() SAL_THROW_EXTERN_C() { DigestMD2_Impl *pImpl = (DigestMD2_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestMD2_Impl); @@ -410,6 +416,7 @@ rtlDigest SAL_CALL rtl_digest_createMD2 (void) */ rtlDigestError SAL_CALL rtl_digest_updateMD2 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestMD2_Impl *pImpl = (DigestMD2_Impl *)Digest; const sal_uInt8 *d = (const sal_uInt8 *)pData; @@ -468,6 +475,7 @@ rtlDigestError SAL_CALL rtl_digest_updateMD2 ( */ rtlDigestError SAL_CALL rtl_digest_getMD2 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestMD2_Impl *pImpl = (DigestMD2_Impl *)Digest; sal_uInt32 i; @@ -496,7 +504,7 @@ rtlDigestError SAL_CALL rtl_digest_getMD2 ( /* * rtl_digest_destroyMD2. */ -void SAL_CALL rtl_digest_destroyMD2 (rtlDigest Digest) +void SAL_CALL rtl_digest_destroyMD2 (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestMD2_Impl *pImpl = (DigestMD2_Impl *)Digest; if (pImpl) @@ -516,19 +524,19 @@ void SAL_CALL rtl_digest_destroyMD2 (rtlDigest Digest) #define DIGEST_CBLOCK_MD5 64 #define DIGEST_LBLOCK_MD5 16 -typedef struct digestMD5_context_st +struct DigestContextMD5 { sal_uInt32 m_nDatLen; sal_uInt32 m_pData[DIGEST_LBLOCK_MD5]; sal_uInt32 m_nA, m_nB, m_nC, m_nD; sal_uInt32 m_nL, m_nH; -} DigestContextMD5; +}; -typedef struct digestMD5_impl_st +struct DigestMD5_Impl { Digest_Impl m_digest; DigestContextMD5 m_context; -} DigestMD5_Impl; +}; static void __rtl_digest_initMD5 (DigestContextMD5 *ctx); static void __rtl_digest_updateMD5 (DigestContextMD5 *ctx); @@ -591,8 +599,8 @@ static void __rtl_digest_initMD5 (DigestContextMD5 *ctx) */ static void __rtl_digest_updateMD5 (DigestContextMD5 *ctx) { - register sal_uInt32 A, B, C, D; - register sal_uInt32 *X; + sal_uInt32 A, B, C, D; + sal_uInt32 *X; A = ctx->m_nA; B = ctx->m_nB; @@ -683,10 +691,10 @@ static void __rtl_digest_endMD5 (DigestContextMD5 *ctx) { 0x80, 0x00, 0x00, 0x00 }; - register const sal_uInt8 *p = end; + const sal_uInt8 *p = end; - register sal_uInt32 *X; - register int i; + sal_uInt32 *X; + int i; X = ctx->m_pData; i = (ctx->m_nDatLen >> 2); @@ -739,7 +747,7 @@ static void __rtl_digest_endMD5 (DigestContextMD5 *ctx) */ rtlDigestError SAL_CALL rtl_digest_MD5 ( const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestMD5_Impl digest; rtlDigestError result; @@ -758,7 +766,7 @@ rtlDigestError SAL_CALL rtl_digest_MD5 ( /* * rtl_digest_createMD5. */ -rtlDigest SAL_CALL rtl_digest_createMD5 (void) +rtlDigest SAL_CALL rtl_digest_createMD5() SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestMD5_Impl); @@ -775,6 +783,7 @@ rtlDigest SAL_CALL rtl_digest_createMD5 (void) */ rtlDigestError SAL_CALL rtl_digest_updateMD5 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl *)Digest; const sal_uInt8 *d = (const sal_uInt8 *)pData; @@ -847,6 +856,7 @@ rtlDigestError SAL_CALL rtl_digest_updateMD5 ( */ rtlDigestError SAL_CALL rtl_digest_getMD5 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl *)Digest; sal_uInt8 *p = pBuffer; @@ -879,6 +889,7 @@ rtlDigestError SAL_CALL rtl_digest_getMD5 ( */ rtlDigestError SAL_CALL rtl_digest_rawMD5 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl *)Digest; sal_uInt8 *p = pBuffer; @@ -909,7 +920,7 @@ rtlDigestError SAL_CALL rtl_digest_rawMD5 ( /* * rtl_digest_destroyMD5. */ -void SAL_CALL rtl_digest_destroyMD5 (rtlDigest Digest) +void SAL_CALL rtl_digest_destroyMD5 (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestMD5_Impl *pImpl = (DigestMD5_Impl *)Digest; if (pImpl) @@ -934,20 +945,20 @@ typedef sal_uInt32 DigestSHA_update_t (sal_uInt32 x); static sal_uInt32 __rtl_digest_updateSHA_0 (sal_uInt32 x); static sal_uInt32 __rtl_digest_updateSHA_1 (sal_uInt32 x); -typedef struct digestSHA_context_st +struct DigestContextSHA { DigestSHA_update_t *m_update; sal_uInt32 m_nDatLen; sal_uInt32 m_pData[DIGEST_LBLOCK_SHA]; sal_uInt32 m_nA, m_nB, m_nC, m_nD, m_nE; sal_uInt32 m_nL, m_nH; -} DigestContextSHA; +}; -typedef struct digestSHA_impl_st +struct DigestSHA_Impl { Digest_Impl m_digest; DigestContextSHA m_context; -} DigestSHA_Impl; +}; static void __rtl_digest_initSHA ( DigestContextSHA *ctx, DigestSHA_update_t *fct); @@ -1018,10 +1029,10 @@ static void __rtl_digest_initSHA ( */ static void __rtl_digest_updateSHA (DigestContextSHA *ctx) { - register sal_uInt32 A, B, C, D, E, T; - register sal_uInt32 *X; + sal_uInt32 A, B, C, D, E, T; + sal_uInt32 *X; - register DigestSHA_update_t *U; + DigestSHA_update_t *U; U = ctx->m_update; A = ctx->m_nA; @@ -1131,10 +1142,10 @@ static void __rtl_digest_endSHA (DigestContextSHA *ctx) { 0x80, 0x00, 0x00, 0x00 }; - register const sal_uInt8 *p = end; + const sal_uInt8 *p = end; - register sal_uInt32 *X; - register int i; + sal_uInt32 *X; + int i; X = ctx->m_pData; i = (ctx->m_nDatLen >> 2); @@ -1216,7 +1227,7 @@ static sal_uInt32 __rtl_digest_updateSHA_0 (sal_uInt32 x) */ rtlDigestError SAL_CALL rtl_digest_SHA ( const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestSHA_Impl digest; rtlDigestError result; @@ -1235,7 +1246,7 @@ rtlDigestError SAL_CALL rtl_digest_SHA ( /* * rtl_digest_createSHA. */ -rtlDigest SAL_CALL rtl_digest_createSHA (void) +rtlDigest SAL_CALL rtl_digest_createSHA() SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl); @@ -1252,6 +1263,7 @@ rtlDigest SAL_CALL rtl_digest_createSHA (void) */ rtlDigestError SAL_CALL rtl_digest_updateSHA ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; const sal_uInt8 *d = (const sal_uInt8 *)pData; @@ -1324,6 +1336,7 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA ( */ rtlDigestError SAL_CALL rtl_digest_getSHA ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; sal_uInt8 *p = pBuffer; @@ -1355,7 +1368,7 @@ rtlDigestError SAL_CALL rtl_digest_getSHA ( /* * rtl_digest_destroySHA. */ -void SAL_CALL rtl_digest_destroySHA (rtlDigest Digest) +void SAL_CALL rtl_digest_destroySHA (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; if (pImpl) @@ -1404,7 +1417,7 @@ static sal_uInt32 __rtl_digest_updateSHA_1 (sal_uInt32 x) */ rtlDigestError SAL_CALL rtl_digest_SHA1 ( const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestSHA_Impl digest; rtlDigestError result; @@ -1423,7 +1436,7 @@ rtlDigestError SAL_CALL rtl_digest_SHA1 ( /* * rtl_digest_createSHA1. */ -rtlDigest SAL_CALL rtl_digest_createSHA1 (void) +rtlDigest SAL_CALL rtl_digest_createSHA1() SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl); @@ -1440,6 +1453,7 @@ rtlDigest SAL_CALL rtl_digest_createSHA1 (void) */ rtlDigestError SAL_CALL rtl_digest_updateSHA1 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; const sal_uInt8 *d = (const sal_uInt8 *)pData; @@ -1512,6 +1526,7 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA1 ( */ rtlDigestError SAL_CALL rtl_digest_getSHA1 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; sal_uInt8 *p = pBuffer; @@ -1543,7 +1558,7 @@ rtlDigestError SAL_CALL rtl_digest_getSHA1 ( /* * rtl_digest_destroySHA1. */ -void SAL_CALL rtl_digest_destroySHA1 (rtlDigest Digest) +void SAL_CALL rtl_digest_destroySHA1 (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestSHA_Impl *pImpl = (DigestSHA_Impl *)Digest; if (pImpl) @@ -1562,17 +1577,17 @@ void SAL_CALL rtl_digest_destroySHA1 (rtlDigest Digest) *======================================================================*/ #define DIGEST_CBLOCK_HMAC_MD5 64 -typedef struct _contextHMAC_MD5_st +struct ContextHMAC_MD5 { DigestMD5_Impl m_hash; sal_uInt8 m_opad[DIGEST_CBLOCK_HMAC_MD5]; -} ContextHMAC_MD5; +}; -typedef struct _digestHMAC_MD5_impl_st +struct DigestHMAC_MD5_Impl { Digest_Impl m_digest; ContextHMAC_MD5 m_context; -} DigestHMAC_MD5_Impl; +}; static void __rtl_digest_initHMAC_MD5 (ContextHMAC_MD5 * ctx); static void __rtl_digest_ipadHMAC_MD5 (ContextHMAC_MD5 * ctx); @@ -1610,7 +1625,7 @@ static void __rtl_digest_initHMAC_MD5 (ContextHMAC_MD5 * ctx) */ static void __rtl_digest_ipadHMAC_MD5 (ContextHMAC_MD5 * ctx) { - register sal_uInt32 i; + sal_uInt32 i; for (i = 0; i < DIGEST_CBLOCK_HMAC_MD5; i++) ctx->m_opad[i] ^= 0x36; @@ -1625,7 +1640,7 @@ static void __rtl_digest_ipadHMAC_MD5 (ContextHMAC_MD5 * ctx) */ static void __rtl_digest_opadHMAC_MD5 (ContextHMAC_MD5 * ctx) { - register sal_uInt32 i; + sal_uInt32 i; for (i = 0; i < DIGEST_CBLOCK_HMAC_MD5; i++) ctx->m_opad[i] ^= 0x5c; @@ -1642,7 +1657,7 @@ static void __rtl_digest_opadHMAC_MD5 (ContextHMAC_MD5 * ctx) rtlDigestError SAL_CALL rtl_digest_HMAC_MD5 ( const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen, const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl digest; rtlDigestError result; @@ -1664,7 +1679,7 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_MD5 ( /* * rtl_digest_createHMAC_MD5. */ -rtlDigest SAL_CALL rtl_digest_createHMAC_MD5 (void) +rtlDigest SAL_CALL rtl_digest_createHMAC_MD5() SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestHMAC_MD5_Impl); @@ -1681,6 +1696,7 @@ rtlDigest SAL_CALL rtl_digest_createHMAC_MD5 (void) */ rtlDigestError SAL_CALL rtl_digest_initHMAC_MD5 ( rtlDigest Digest, const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen) + SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)Digest; ContextHMAC_MD5 *ctx; @@ -1719,6 +1735,7 @@ rtlDigestError SAL_CALL rtl_digest_initHMAC_MD5 ( */ rtlDigestError SAL_CALL rtl_digest_updateHMAC_MD5 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)Digest; ContextHMAC_MD5 *ctx; @@ -1740,6 +1757,7 @@ rtlDigestError SAL_CALL rtl_digest_updateHMAC_MD5 ( */ rtlDigestError SAL_CALL rtl_digest_getHMAC_MD5 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)Digest; ContextHMAC_MD5 *ctx; @@ -1772,7 +1790,7 @@ rtlDigestError SAL_CALL rtl_digest_getHMAC_MD5 ( /* * rtl_digest_destroyHMAC_MD5. */ -void SAL_CALL rtl_digest_destroyHMAC_MD5 (rtlDigest Digest) +void SAL_CALL rtl_digest_destroyHMAC_MD5 (rtlDigest Digest) SAL_THROW_EXTERN_C() { DigestHMAC_MD5_Impl *pImpl = (DigestHMAC_MD5_Impl*)Digest; if (pImpl) @@ -1791,17 +1809,17 @@ void SAL_CALL rtl_digest_destroyHMAC_MD5 (rtlDigest Digest) *======================================================================*/ #define DIGEST_CBLOCK_HMAC_SHA1 64 -typedef struct _contextHMAC_SHA1_st +struct ContextHMAC_SHA1 { DigestSHA_Impl m_hash; sal_uInt8 m_opad[DIGEST_CBLOCK_HMAC_SHA1]; -} ContextHMAC_SHA1; +}; -typedef struct _digestHMAC_SHA1_impl_st +struct DigestHMAC_SHA1_Impl { Digest_Impl m_digest; ContextHMAC_SHA1 m_context; -} DigestHMAC_SHA1_Impl; +}; static void __rtl_digest_initHMAC_SHA1 (ContextHMAC_SHA1 * ctx); static void __rtl_digest_ipadHMAC_SHA1 (ContextHMAC_SHA1 * ctx); @@ -1839,7 +1857,7 @@ static void __rtl_digest_initHMAC_SHA1 (ContextHMAC_SHA1 * ctx) */ static void __rtl_digest_ipadHMAC_SHA1 (ContextHMAC_SHA1 * ctx) { - register sal_uInt32 i; + sal_uInt32 i; for (i = 0; i < DIGEST_CBLOCK_HMAC_SHA1; i++) ctx->m_opad[i] ^= 0x36; @@ -1854,7 +1872,7 @@ static void __rtl_digest_ipadHMAC_SHA1 (ContextHMAC_SHA1 * ctx) */ static void __rtl_digest_opadHMAC_SHA1 (ContextHMAC_SHA1 * ctx) { - register sal_uInt32 i; + sal_uInt32 i; for (i = 0; i < DIGEST_CBLOCK_HMAC_SHA1; i++) ctx->m_opad[i] ^= 0x5c; @@ -1871,7 +1889,7 @@ static void __rtl_digest_opadHMAC_SHA1 (ContextHMAC_SHA1 * ctx) rtlDigestError SAL_CALL rtl_digest_HMAC_SHA1 ( const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen, const void *pData, sal_uInt32 nDatLen, - sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl digest; rtlDigestError result; @@ -1893,7 +1911,7 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_SHA1 ( /* * rtl_digest_createHMAC_SHA1. */ -rtlDigest SAL_CALL rtl_digest_createHMAC_SHA1 (void) +rtlDigest SAL_CALL rtl_digest_createHMAC_SHA1() SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)NULL; pImpl = RTL_DIGEST_CREATE(DigestHMAC_SHA1_Impl); @@ -1910,6 +1928,7 @@ rtlDigest SAL_CALL rtl_digest_createHMAC_SHA1 (void) */ rtlDigestError SAL_CALL rtl_digest_initHMAC_SHA1 ( rtlDigest Digest, const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen) + SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)Digest; ContextHMAC_SHA1 *ctx; @@ -1948,6 +1967,7 @@ rtlDigestError SAL_CALL rtl_digest_initHMAC_SHA1 ( */ rtlDigestError SAL_CALL rtl_digest_updateHMAC_SHA1 ( rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) + SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)Digest; ContextHMAC_SHA1 *ctx; @@ -1969,6 +1989,7 @@ rtlDigestError SAL_CALL rtl_digest_updateHMAC_SHA1 ( */ rtlDigestError SAL_CALL rtl_digest_getHMAC_SHA1 ( rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) + SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)Digest; ContextHMAC_SHA1 *ctx; @@ -2002,6 +2023,7 @@ rtlDigestError SAL_CALL rtl_digest_getHMAC_SHA1 ( * rtl_digest_destroyHMAC_SHA1. */ void SAL_CALL rtl_digest_destroyHMAC_SHA1 (rtlDigest Digest) + SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl *pImpl = (DigestHMAC_SHA1_Impl*)Digest; if (pImpl) @@ -2031,7 +2053,7 @@ static void __rtl_digest_updatePBKDF2 ( { /* T_i = F (P, S, c, i) */ sal_uInt8 U[DIGEST_CBLOCK_PBKDF2]; - register sal_uInt32 i, k; + sal_uInt32 i, k; /* U_(1) = PRF (P, S || INDEX) */ rtl_digest_updateHMAC_SHA1 (hDigest, pSaltData, nSaltLen); @@ -2067,7 +2089,7 @@ rtlDigestError SAL_CALL rtl_digest_PBKDF2 ( sal_uInt8 *pKeyData , sal_uInt32 nKeyLen, const sal_uInt8 *pPassData, sal_uInt32 nPassLen, const sal_uInt8 *pSaltData, sal_uInt32 nSaltLen, - sal_uInt32 nCount) + sal_uInt32 nCount) SAL_THROW_EXTERN_C() { DigestHMAC_SHA1_Impl digest; sal_uInt32 i = 1; diff --git a/sal/rtl/source/hash.cxx b/sal/rtl/source/hash.cxx index 4e03dfc2a6d7..8ddf2683ad53 100644 --- a/sal/rtl/source/hash.cxx +++ b/sal/rtl/source/hash.cxx @@ -29,8 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sal.hxx" -#include "hash.h" -#include "strimp.h" +#include "hash.hxx" +#include "strimp.hxx" #include <osl/diagnose.h> #include <sal/macros.h> diff --git a/sal/rtl/source/hash.h b/sal/rtl/source/hash.hxx index 6a6518833dfd..d103efcd64e7 100644 --- a/sal/rtl/source/hash.h +++ b/sal/rtl/source/hash.hxx @@ -1,24 +1,16 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -#ifndef INCLUDED_RTL_SOURCE_HASH_H -#define INCLUDED_RTL_SOURCE_HASH_H +#ifndef INCLUDED_RTL_SOURCE_HASH_HXX +#define INCLUDED_RTL_SOURCE_HASH_HXX #include <sal/types.h> #include <rtl/ustring.h> -#if defined __cplusplus -extern "C" { -#endif /* __cplusplus */ - /* These functions are not multi-thread safe: */ rtl_uString *rtl_str_hash_intern (rtl_uString *pString, int can_return); void rtl_str_hash_remove (rtl_uString *pString); -#if defined __cplusplus -} -#endif /* __cplusplus */ - -#endif /* INCLUDED_RTL_SOURCE_HASH_H */ +#endif /* INCLUDED_RTL_SOURCE_HASH_HXX */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/rtl/source/locale.c b/sal/rtl/source/locale.cxx index 2885b4cc4b68..1d975ad6fd6b 100644 --- a/sal/rtl/source/locale.c +++ b/sal/rtl/source/locale.cxx @@ -32,27 +32,26 @@ #include "rtl/alloc.h" #include "internal/once.h" +#include "internal/rtllifecycle.h" static sal_Int32 RTL_HASHTABLE_SIZE[] = { 7, 31, 127, 251, 509, 1021, 2039, 4093 }; -typedef struct rtl_hashentry RTL_HASHENTRY; - -struct rtl_hashentry +struct RTL_HASHENTRY { rtl_Locale* Entry; RTL_HASHENTRY* Next; }; -typedef struct rtl_hashtable +struct RTL_HASHTABLE { sal_Int8 iSize; sal_Int32 Size; sal_Int32 Elements; RTL_HASHENTRY** Table; -} RTL_HASHTABLE; +}; static RTL_HASHTABLE* g_pLocaleTable = NULL; @@ -60,7 +59,7 @@ static rtl_Locale* g_pDefaultLocale = NULL; /************************************************************************* */ -void rtl_hashentry_destroy(RTL_HASHENTRY* entry) +extern "C" void rtl_hashentry_destroy(RTL_HASHENTRY* entry) { rtl_uString_release(entry->Entry->Language); rtl_uString_release(entry->Entry->Country); @@ -72,7 +71,7 @@ void rtl_hashentry_destroy(RTL_HASHENTRY* entry) rtl_freeMemory(entry); } -void rtl_hashtable_destroy(RTL_HASHTABLE* table) +extern "C" void rtl_hashtable_destroy(RTL_HASHTABLE* table) { sal_Int32 size = 0; @@ -92,7 +91,7 @@ void rtl_hashtable_destroy(RTL_HASHTABLE* table) rtl_freeMemory(table); } -void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex) +extern "C" void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex) { sal_Int32 nSize = RTL_HASHTABLE_SIZE[sizeIndex]; @@ -113,14 +112,14 @@ void rtl_hashtable_init(RTL_HASHTABLE** table, sal_Int8 sizeIndex) } } -sal_Int32 rtl_hashfunc(RTL_HASHTABLE* table, sal_Int32 key) +extern "C" sal_Int32 rtl_hashfunc(RTL_HASHTABLE* table, sal_Int32 key) { return ( (sal_uInt32) key % table->Size); } -sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table); +extern "C" sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table); -rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* value) +extern "C" rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* value) { sal_Int32 key = 0; @@ -201,7 +200,7 @@ sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table) return sal_True; } -sal_Bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal_Int32 hashCode, rtl_Locale** pValue) +extern "C" sal_Bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal_Int32 hashCode, rtl_Locale** pValue) { if (!table) return sal_False; @@ -226,7 +225,7 @@ sal_Bool rtl_hashtable_find(RTL_HASHTABLE * table, sal_Int32 key, sal_Int32 hash /************************************************************************* * rtl_locale_init */ -void rtl_locale_init (void) +void rtl_locale_init() { OSL_ASSERT(g_pLocaleTable == 0); rtl_hashtable_init(&g_pLocaleTable, 1); @@ -235,7 +234,7 @@ void rtl_locale_init (void) /************************************************************************* * rtl_locale_fini */ -void rtl_locale_fini (void) +void rtl_locale_fini() { if (g_pLocaleTable != 0) { @@ -244,8 +243,6 @@ void rtl_locale_fini (void) } } -extern void ensureLocaleSingleton(); - /************************************************************************* * rtl_locale_register */ diff --git a/sal/rtl/source/makefile.mk b/sal/rtl/source/makefile.mk index 2f1f610a5330..07c36d38ed7e 100644 --- a/sal/rtl/source/makefile.mk +++ b/sal/rtl/source/makefile.mk @@ -87,7 +87,6 @@ SLOFILES= \ $(SLO)$/cmdargs.obj \ $(SLO)$/unload.obj \ $(SLO)$/logfile.obj \ - $(SLO)$/tres.obj \ $(SLO)$/debugprint.obj \ $(SLO)$/math.obj \ $(SLO)$/alloc_global.obj\ @@ -116,7 +115,6 @@ OBJFILES= \ $(OBJ)$/cmdargs.obj \ $(OBJ)$/unload.obj \ $(OBJ)$/logfile.obj \ - $(OBJ)$/tres.obj \ $(OBJ)$/math.obj \ $(OBJ)$/alloc_global.obj\ $(OBJ)$/alloc_cache.obj \ diff --git a/sal/rtl/source/memory.c b/sal/rtl/source/memory.cxx index 070b7898d413..857710dcc708 100644 --- a/sal/rtl/source/memory.c +++ b/sal/rtl/source/memory.cxx @@ -57,7 +57,7 @@ sal_Int32 SAL_CALL rtl_compareMemory(const void *MemA, const void *MemB, sal_Siz void* SAL_CALL rtl_findInMemory(const void *MemA, sal_uInt8 ch, sal_Size Bytes) { - return memchr(MemA, ch, Bytes); + return const_cast< void * >(memchr(MemA, ch, Bytes)); } diff --git a/sal/rtl/source/random.c b/sal/rtl/source/random.cxx index 101c7dffdbec..774e8eb72510 100644 --- a/sal/rtl/source/random.c +++ b/sal/rtl/source/random.cxx @@ -58,12 +58,12 @@ /** RandomData_Impl. */ -typedef struct random_data_impl_st +struct RandomData_Impl { sal_Int16 m_nX; sal_Int16 m_nY; sal_Int16 m_nZ; -} RandomData_Impl; +}; /** __rtl_random_data. */ @@ -75,7 +75,7 @@ static double __rtl_random_data (RandomData_Impl *pImpl); #define RTL_RANDOM_SIZE_DIGEST RTL_DIGEST_LENGTH_MD5 #define RTL_RANDOM_SIZE_POOL 1023 -typedef struct random_pool_impl_st +struct RandomPool_Impl { rtlDigest m_hDigest; sal_uInt8 m_pDigest[RTL_RANDOM_SIZE_DIGEST]; @@ -83,7 +83,7 @@ typedef struct random_pool_impl_st sal_uInt32 m_nData; sal_uInt32 m_nIndex; sal_uInt32 m_nCount; -} RandomPool_Impl; +}; /** __rtl_random_initPool. */ @@ -105,7 +105,7 @@ static void __rtl_random_readPool ( */ static double __rtl_random_data (RandomData_Impl *pImpl) { - register double random; + double random; RTL_RANDOM_RNG (pImpl->m_nX, pImpl->m_nY, pImpl->m_nZ); random = (((double)(pImpl->m_nX) / 30328.0) + @@ -277,7 +277,7 @@ static void __rtl_random_readPool ( /* * rtl_random_createPool. */ -rtlRandomPool SAL_CALL rtl_random_createPool (void) +rtlRandomPool SAL_CALL rtl_random_createPool() SAL_THROW_EXTERN_C() { RandomPool_Impl *pImpl = (RandomPool_Impl*)NULL; pImpl = (RandomPool_Impl*)rtl_allocateZeroMemory (sizeof(RandomPool_Impl)); @@ -295,7 +295,7 @@ rtlRandomPool SAL_CALL rtl_random_createPool (void) /* * rtl_random_destroyPool. */ -void SAL_CALL rtl_random_destroyPool (rtlRandomPool Pool) +void SAL_CALL rtl_random_destroyPool (rtlRandomPool Pool) SAL_THROW_EXTERN_C() { RandomPool_Impl *pImpl = (RandomPool_Impl *)Pool; if (pImpl) @@ -309,7 +309,7 @@ void SAL_CALL rtl_random_destroyPool (rtlRandomPool Pool) * rtl_random_addBytes. */ rtlRandomError SAL_CALL rtl_random_addBytes ( - rtlRandomPool Pool, const void *Buffer, sal_Size Bytes) + rtlRandomPool Pool, const void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C() { RandomPool_Impl *pImpl = (RandomPool_Impl *)Pool; const sal_uInt8 *pBuffer = (const sal_uInt8 *)Buffer; @@ -325,7 +325,7 @@ rtlRandomError SAL_CALL rtl_random_addBytes ( * rtl_random_getBytes. */ rtlRandomError SAL_CALL rtl_random_getBytes ( - rtlRandomPool Pool, void *Buffer, sal_Size Bytes) + rtlRandomPool Pool, void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C() { RandomPool_Impl *pImpl = (RandomPool_Impl *)Pool; sal_uInt8 *pBuffer = (sal_uInt8 *)Buffer; diff --git a/sal/rtl/source/rtl_process.c b/sal/rtl/source/rtl_process.c deleted file mode 100644 index 0845f46f5723..000000000000 --- a/sal/rtl/source/rtl_process.c +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include <string.h> -#include <osl/mutex.h> -#include <rtl/uuid.h> - -/* rtl_getCommandArg, rtl_getCommandArgCount see cmdargs.cxx */ - -void SAL_CALL rtl_getGlobalProcessId( sal_uInt8 *pTargetUUID ) -{ - static sal_uInt8 *pUuid = 0; - if( ! pUuid ) - { - osl_acquireMutex( * osl_getGlobalMutex() ); - if( ! pUuid ) - { - static sal_uInt8 aUuid[16]; - rtl_createUuid( aUuid , 0 , sal_False ); - pUuid = aUuid; - } - osl_releaseMutex( * osl_getGlobalMutex() ); - } - memcpy( pTargetUUID , pUuid , 16 ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/plugin.hxx b/sal/rtl/source/rtl_process.cxx index 862e6f6dc85a..e20b3338ba88 100644 --- a/toolkit/workben/layout/plugin.hxx +++ b/sal/rtl/source/rtl_process.cxx @@ -25,35 +25,39 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _LAYOUT_PLUGIN_HXX -#define _LAYOUT_PLUGIN_HXX -#include <layout/layout.hxx> -#include <layout/layout-pre.hxx> +#include "precompiled_sal.hxx" +#include "sal/config.h" -namespace svx { -class DialControl; -} +#include <cstring> -class PluginDialog : public ModalDialog -{ -private: - FixedImage aHeaderImage; - FixedText aHeaderText; - FixedLine aHeaderLine; - Plugin aPlugin; - svx::DialControl& aDialControl; - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; +#include "boost/noncopyable.hpp" +#include "rtl/instance.hxx" +#include "rtl/process.h" +#include "rtl/uuid.h" +#include "sal/types.h" + +namespace { +class Id: private boost::noncopyable { public: - PluginDialog( Window* pParent ); - ~PluginDialog(); + Id() { rtl_createUuid(uuid_, 0, false); } + + void copy(sal_uInt8 * target) const + { std::memcpy(target, uuid_, UUID_SIZE); } + +private: + enum { UUID_SIZE = 16 }; + + sal_uInt8 uuid_[UUID_SIZE]; }; -#include <layout/layout-post.hxx> +struct theId: public rtl::Static< Id, theId > {}; -#endif /* _LAYOUT_PLUGIN_HXX */ +} + +void rtl_getGlobalProcessId(sal_uInt8 * pTargetUUID) { + theId::get().copy(pTargetUUID); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/rtl/source/strbuf.c b/sal/rtl/source/strbuf.cxx index c9a4f3140643..c9a4f3140643 100644 --- a/sal/rtl/source/strbuf.c +++ b/sal/rtl/source/strbuf.cxx diff --git a/sal/rtl/source/strimp.c b/sal/rtl/source/strimp.cxx index ae75249fb4aa..a5b8f827a1b8 100644 --- a/sal/rtl/source/strimp.c +++ b/sal/rtl/source/strimp.cxx @@ -26,7 +26,7 @@ * ************************************************************************/ -#include "strimp.h" +#include "strimp.hxx" sal_Int16 rtl_ImplGetDigit( sal_Unicode ch, sal_Int16 nRadix ) { diff --git a/sal/rtl/source/strimp.h b/sal/rtl/source/strimp.hxx index 3db89cec8145..a9e5a38f6da7 100644 --- a/sal/rtl/source/strimp.h +++ b/sal/rtl/source/strimp.hxx @@ -26,8 +26,8 @@ * ************************************************************************/ -#ifndef INCLUDED_RTL_SOURCE_STRIMP_H -#define INCLUDED_RTL_SOURCE_STRIMP_H +#ifndef INCLUDED_RTL_SOURCE_STRIMP_HXX +#define INCLUDED_RTL_SOURCE_STRIMP_HXX #include <osl/interlck.h> @@ -37,10 +37,6 @@ /* Help functions for String and UString */ /* ======================================================================= */ -#if defined __cplusplus -extern "C" { -#endif /* __cplusplus */ - /* * refCount is opaqueincludes 2 bit-fields; * MSB: 'interned' - is stored in the intern hash @@ -58,10 +54,6 @@ sal_Int16 rtl_ImplGetDigit( sal_Unicode ch, sal_Int16 nRadix ); sal_Bool rtl_ImplIsWhitespace( sal_Unicode c ); -#if defined __cplusplus -} -#endif /* __cplusplus */ - -#endif /* INCLUDED_RTL_SOURCE_STRIMP_H */ +#endif /* INCLUDED_RTL_SOURCE_STRIMP_HXX */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/rtl/source/string.c b/sal/rtl/source/string.cxx index 2ee79611218a..c43b564a2099 100644 --- a/sal/rtl/source/string.c +++ b/sal/rtl/source/string.cxx @@ -35,8 +35,8 @@ #include <osl/diagnose.h> #include <rtl/tencinfo.h> -#include "strimp.h" -#include "surrogates.h" +#include "strimp.hxx" +#include "surrogates.hxx" #include <rtl/string.h> #include "rtl/math.h" @@ -69,9 +69,10 @@ static rtl_String const aImplEmpty_rtl_String = /* Include String/UString template code */ -#include "strtmpl.c" +#include "strtmpl.cxx" sal_Int32 SAL_CALL rtl_str_valueOfFloat(sal_Char * pStr, float f) + SAL_THROW_EXTERN_C() { rtl_String * pResult = NULL; sal_Int32 nLen; @@ -87,6 +88,7 @@ sal_Int32 SAL_CALL rtl_str_valueOfFloat(sal_Char * pStr, float f) } sal_Int32 SAL_CALL rtl_str_valueOfDouble(sal_Char * pStr, double d) + SAL_THROW_EXTERN_C() { rtl_String * pResult = NULL; sal_Int32 nLen; @@ -101,13 +103,13 @@ sal_Int32 SAL_CALL rtl_str_valueOfDouble(sal_Char * pStr, double d) return nLen; } -float SAL_CALL rtl_str_toFloat(sal_Char const * pStr) +float SAL_CALL rtl_str_toFloat(sal_Char const * pStr) SAL_THROW_EXTERN_C() { return (float) rtl_math_stringToDouble(pStr, pStr + rtl_str_getLength(pStr), '.', 0, 0, 0); } -double SAL_CALL rtl_str_toDouble(sal_Char const * pStr) +double SAL_CALL rtl_str_toDouble(sal_Char const * pStr) SAL_THROW_EXTERN_C() { return rtl_math_stringToDouble(pStr, pStr + rtl_str_getLength(pStr), '.', 0, 0, 0); @@ -305,6 +307,7 @@ void SAL_CALL rtl_uString2String( rtl_String** ppThis, sal_Int32 nULen, rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags ) + SAL_THROW_EXTERN_C() { rtl_impl_convertUStringToString(ppThis, pUStr, nULen, eTextEncoding, nCvtFlags, sal_False); @@ -315,6 +318,7 @@ sal_Bool SAL_CALL rtl_convertUStringToString(rtl_String ** pTarget, sal_Int32 nLength, rtl_TextEncoding nEncoding, sal_uInt32 nFlags) + SAL_THROW_EXTERN_C() { return rtl_impl_convertUStringToString(pTarget, pSource, nLength, nEncoding, nFlags, sal_True); diff --git a/sal/rtl/source/strtmpl.c b/sal/rtl/source/strtmpl.cxx index 830521d7b94f..93f91331d376 100644 --- a/sal/rtl/source/strtmpl.c +++ b/sal/rtl/source/strtmpl.cxx @@ -67,6 +67,7 @@ inline void rtl_str_ImplCopy( IMPL_RTL_STRCODE* pDest, /* ======================================================================= */ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( getLength )( const IMPL_RTL_STRCODE* pStr ) + SAL_THROW_EXTERN_C() { const IMPL_RTL_STRCODE* pTempStr = pStr; while( *pTempStr ) @@ -78,6 +79,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( getLength )( const IMPL_RTL_STRCODE* pStr ) sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compare )( const IMPL_RTL_STRCODE* pStr1, const IMPL_RTL_STRCODE* pStr2 ) + SAL_THROW_EXTERN_C() { sal_Int32 nRet; while ( ((nRet = ((sal_Int32)(IMPL_RTL_USTRCODE(*pStr1)))- @@ -97,6 +99,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compare_WithLength )( const IMPL_RTL_STRCOD sal_Int32 nStr1Len, const IMPL_RTL_STRCODE* pStr2, sal_Int32 nStr2Len ) + SAL_THROW_EXTERN_C() { sal_Int32 nRet = nStr1Len - nStr2Len; int nCount = (nRet <= 0) ? nStr1Len : nStr2Len; @@ -119,6 +122,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( shortenedCompare_WithLength )( const IMPL_R const IMPL_RTL_STRCODE* pStr2, sal_Int32 nStr2Len, sal_Int32 nShortenedLength ) + SAL_THROW_EXTERN_C() { const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len; const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len; @@ -147,6 +151,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( reverseCompare_WithLength )( const IMPL_RTL sal_Int32 nStr1Len, const IMPL_RTL_STRCODE* pStr2, sal_Int32 nStr2Len ) + SAL_THROW_EXTERN_C() { const IMPL_RTL_STRCODE* pStr1Run = pStr1+nStr1Len; const IMPL_RTL_STRCODE* pStr2Run = pStr2+nStr2Len; @@ -168,6 +173,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( reverseCompare_WithLength )( const IMPL_RTL sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compareIgnoreAsciiCase )( const IMPL_RTL_STRCODE* pStr1, const IMPL_RTL_STRCODE* pStr2 ) + SAL_THROW_EXTERN_C() { sal_Int32 nRet; sal_Int32 c1; @@ -199,6 +205,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compareIgnoreAsciiCase_WithLength )( const sal_Int32 nStr1Len, const IMPL_RTL_STRCODE* pStr2, sal_Int32 nStr2Len ) + SAL_THROW_EXTERN_C() { const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len; const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len; @@ -232,6 +239,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( shortenedCompareIgnoreAsciiCase_WithLength const IMPL_RTL_STRCODE* pStr2, sal_Int32 nStr2Len, sal_Int32 nShortenedLength ) + SAL_THROW_EXTERN_C() { const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len; const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len; @@ -265,6 +273,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( shortenedCompareIgnoreAsciiCase_WithLength /* ----------------------------------------------------------------------- */ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode )( const IMPL_RTL_STRCODE* pStr ) + SAL_THROW_EXTERN_C() { return IMPL_RTL_STRNAME( hashCode_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ) ); } @@ -273,6 +282,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode )( const IMPL_RTL_STRCODE* pStr ) sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode_WithLength )( const IMPL_RTL_STRCODE* pStr, sal_Int32 nLen ) + SAL_THROW_EXTERN_C() { sal_Int32 h = nLen; @@ -329,6 +339,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode_WithLength )( const IMPL_RTL_STRCO sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfChar )( const IMPL_RTL_STRCODE* pStr, IMPL_RTL_STRCODE c ) + SAL_THROW_EXTERN_C() { const IMPL_RTL_STRCODE* pTempStr = pStr; while ( *pTempStr ) @@ -347,6 +358,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfChar )( const IMPL_RTL_STRCODE* pStr sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfChar_WithLength )( const IMPL_RTL_STRCODE* pStr, sal_Int32 nLen, IMPL_RTL_STRCODE c ) + SAL_THROW_EXTERN_C() { const IMPL_RTL_STRCODE* pTempStr = pStr; while ( nLen > 0 ) @@ -365,6 +377,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfChar_WithLength )( const IMPL_RTL_ST sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfChar )( const IMPL_RTL_STRCODE* pStr, IMPL_RTL_STRCODE c ) + SAL_THROW_EXTERN_C() { return IMPL_RTL_STRNAME( lastIndexOfChar_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ), c ); } @@ -374,6 +387,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfChar )( const IMPL_RTL_STRCODE* sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfChar_WithLength )( const IMPL_RTL_STRCODE* pStr, sal_Int32 nLen, IMPL_RTL_STRCODE c ) + SAL_THROW_EXTERN_C() { pStr += nLen; while ( nLen > 0 ) @@ -392,6 +406,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfChar_WithLength )( const IMPL_RT sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfStr )( const IMPL_RTL_STRCODE* pStr, const IMPL_RTL_STRCODE* pSubStr ) + SAL_THROW_EXTERN_C() { return IMPL_RTL_STRNAME( indexOfStr_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ), pSubStr, IMPL_RTL_STRNAME( getLength )( pSubStr ) ); @@ -403,6 +418,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfStr_WithLength )( const IMPL_RTL_STR sal_Int32 nStrLen, const IMPL_RTL_STRCODE* pSubStr, sal_Int32 nSubLen ) + SAL_THROW_EXTERN_C() { /* faster search for a single character */ if ( nSubLen < 2 ) @@ -464,6 +480,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfStr_WithLength )( const IMPL_RTL_STR sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfStr )( const IMPL_RTL_STRCODE* pStr, const IMPL_RTL_STRCODE* pSubStr ) + SAL_THROW_EXTERN_C() { return IMPL_RTL_STRNAME( lastIndexOfStr_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ), pSubStr, IMPL_RTL_STRNAME( getLength )( pSubStr ) ); @@ -475,6 +492,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfStr_WithLength )( const IMPL_RTL sal_Int32 nStrLen, const IMPL_RTL_STRCODE* pSubStr, sal_Int32 nSubLen ) + SAL_THROW_EXTERN_C() { /* faster search for a single character */ if ( nSubLen < 2 ) @@ -530,6 +548,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfStr_WithLength )( const IMPL_RTL void SAL_CALL IMPL_RTL_STRNAME( replaceChar )( IMPL_RTL_STRCODE* pStr, IMPL_RTL_STRCODE cOld, IMPL_RTL_STRCODE cNew ) + SAL_THROW_EXTERN_C() { while ( *pStr ) { @@ -546,6 +565,7 @@ void SAL_CALL IMPL_RTL_STRNAME( replaceChar_WithLength )( IMPL_RTL_STRCODE* pStr sal_Int32 nLen, IMPL_RTL_STRCODE cOld, IMPL_RTL_STRCODE cNew ) + SAL_THROW_EXTERN_C() { while ( nLen > 0 ) { @@ -560,6 +580,7 @@ void SAL_CALL IMPL_RTL_STRNAME( replaceChar_WithLength )( IMPL_RTL_STRCODE* pStr /* ----------------------------------------------------------------------- */ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase )( IMPL_RTL_STRCODE* pStr ) + SAL_THROW_EXTERN_C() { while ( *pStr ) { @@ -575,6 +596,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase )( IMPL_RTL_STRCODE* pStr ) void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase_WithLength )( IMPL_RTL_STRCODE* pStr, sal_Int32 nLen ) + SAL_THROW_EXTERN_C() { while ( nLen > 0 ) { @@ -590,6 +612,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase_WithLength )( IMPL_RTL_STRCODE* /* ----------------------------------------------------------------------- */ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase )( IMPL_RTL_STRCODE* pStr ) + SAL_THROW_EXTERN_C() { while ( *pStr ) { @@ -605,6 +628,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase )( IMPL_RTL_STRCODE* pStr ) void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase_WithLength )( IMPL_RTL_STRCODE* pStr, sal_Int32 nLen ) + SAL_THROW_EXTERN_C() { while ( nLen > 0 ) { @@ -620,6 +644,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase_WithLength )( IMPL_RTL_STRCODE* /* ----------------------------------------------------------------------- */ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( trim )( IMPL_RTL_STRCODE* pStr ) + SAL_THROW_EXTERN_C() { return IMPL_RTL_STRNAME( trim_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ) ); } @@ -627,6 +652,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( trim )( IMPL_RTL_STRCODE* pStr ) /* ----------------------------------------------------------------------- */ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( trim_WithLength )( IMPL_RTL_STRCODE* pStr, sal_Int32 nLen ) + SAL_THROW_EXTERN_C() { sal_Int32 nPreSpaces = 0; sal_Int32 nPostSpaces = 0; @@ -670,6 +696,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( trim_WithLength )( IMPL_RTL_STRCODE* pStr, /* ----------------------------------------------------------------------- */ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfBoolean )( IMPL_RTL_STRCODE* pStr, sal_Bool b ) + SAL_THROW_EXTERN_C() { if ( b ) { @@ -705,6 +732,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfBoolean )( IMPL_RTL_STRCODE* pStr, s sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfChar )( IMPL_RTL_STRCODE* pStr, IMPL_RTL_STRCODE c ) + SAL_THROW_EXTERN_C() { *pStr++ = c; *pStr = 0; @@ -716,6 +744,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfChar )( IMPL_RTL_STRCODE* pStr, sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfInt32 )( IMPL_RTL_STRCODE* pStr, sal_Int32 n, sal_Int16 nRadix ) + SAL_THROW_EXTERN_C() { sal_Char aBuf[RTL_STR_MAX_VALUEOFINT32]; sal_Char* pBuf = aBuf; @@ -770,6 +799,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfInt32 )( IMPL_RTL_STRCODE* pStr, sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfInt64 )( IMPL_RTL_STRCODE* pStr, sal_Int64 n, sal_Int16 nRadix ) + SAL_THROW_EXTERN_C() { sal_Char aBuf[RTL_STR_MAX_VALUEOFINT64]; sal_Char* pBuf = aBuf; @@ -823,6 +853,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfInt64 )( IMPL_RTL_STRCODE* pStr, /* ----------------------------------------------------------------------- */ sal_Bool SAL_CALL IMPL_RTL_STRNAME( toBoolean )( const IMPL_RTL_STRCODE* pStr ) + SAL_THROW_EXTERN_C() { if ( *pStr == '1' ) return sal_True; @@ -849,6 +880,7 @@ sal_Bool SAL_CALL IMPL_RTL_STRNAME( toBoolean )( const IMPL_RTL_STRCODE* pStr ) sal_Int32 SAL_CALL IMPL_RTL_STRNAME( toInt32 )( const IMPL_RTL_STRCODE* pStr, sal_Int16 nRadix ) + SAL_THROW_EXTERN_C() { sal_Bool bNeg; sal_Int16 nDigit; @@ -895,6 +927,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( toInt32 )( const IMPL_RTL_STRCODE* pStr, sal_Int64 SAL_CALL IMPL_RTL_STRNAME( toInt64 )( const IMPL_RTL_STRCODE* pStr, sal_Int16 nRadix ) + SAL_THROW_EXTERN_C() { sal_Bool bNeg; sal_Int16 nDigit; @@ -944,7 +977,7 @@ sal_Int64 SAL_CALL IMPL_RTL_STRNAME( toInt64 )( const IMPL_RTL_STRCODE* pStr, static IMPL_RTL_STRINGDATA* IMPL_RTL_STRINGNAME( ImplAlloc )( sal_Int32 nLen ) { IMPL_RTL_STRINGDATA * pData - = (SAL_INT_CAST(sal_uInt32, nLen) + = (sal::static_int_cast< sal_uInt32 >(nLen) <= ((SAL_MAX_UINT32 - sizeof (IMPL_RTL_STRINGDATA)) / sizeof (IMPL_RTL_STRCODE))) ? (IMPL_RTL_STRINGDATA *) rtl_allocateMemory( @@ -996,6 +1029,7 @@ static IMPL_RTL_STRCODE* IMPL_RTL_STRINGNAME( ImplNewCopy )( IMPL_RTL_STRINGDATA /* ----------------------------------------------------------------------- */ void SAL_CALL IMPL_RTL_STRINGNAME( acquire )( IMPL_RTL_STRINGDATA* pThis ) + SAL_THROW_EXTERN_C() { IMPL_RTL_AQUIRE( pThis ); } @@ -1003,6 +1037,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( acquire )( IMPL_RTL_STRINGDATA* pThis ) /* ----------------------------------------------------------------------- */ void SAL_CALL IMPL_RTL_STRINGNAME( release )( IMPL_RTL_STRINGDATA* pThis ) + SAL_THROW_EXTERN_C() { if (SAL_STRING_IS_STATIC (pThis)) return; @@ -1026,6 +1061,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( release )( IMPL_RTL_STRINGDATA* pThis ) /* ----------------------------------------------------------------------- */ void SAL_CALL IMPL_RTL_STRINGNAME( new )( IMPL_RTL_STRINGDATA** ppThis ) + SAL_THROW_EXTERN_C() { if ( *ppThis) IMPL_RTL_STRINGNAME( release )( *ppThis ); @@ -1037,6 +1073,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( new )( IMPL_RTL_STRINGDATA** ppThis ) /* ----------------------------------------------------------------------- */ void SAL_CALL IMPL_RTL_STRINGNAME( new_WithLength )( IMPL_RTL_STRINGDATA** ppThis, sal_Int32 nLen ) + SAL_THROW_EXTERN_C() { if ( nLen <= 0 ) IMPL_RTL_STRINGNAME( new )( ppThis ); @@ -1060,6 +1097,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( new_WithLength )( IMPL_RTL_STRINGDATA** ppThi void SAL_CALL IMPL_RTL_STRINGNAME( newFromString )( IMPL_RTL_STRINGDATA** ppThis, const IMPL_RTL_STRINGDATA* pStr ) + SAL_THROW_EXTERN_C() { IMPL_RTL_STRINGDATA* pOrg; @@ -1083,6 +1121,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromString )( IMPL_RTL_STRINGDATA** ppThis void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr )( IMPL_RTL_STRINGDATA** ppThis, const IMPL_RTL_STRCODE* pCharStr ) + SAL_THROW_EXTERN_C() { IMPL_RTL_STRCODE* pBuffer; IMPL_RTL_STRINGDATA* pOrg; @@ -1126,6 +1165,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr )( IMPL_RTL_STRINGDATA** ppThis, void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr_WithLength )( IMPL_RTL_STRINGDATA** ppThis, const IMPL_RTL_STRCODE* pCharStr, sal_Int32 nLen ) + SAL_THROW_EXTERN_C() { IMPL_RTL_STRINGDATA* pOrg; @@ -1149,6 +1189,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr_WithLength )( IMPL_RTL_STRINGDATA* void SAL_CALL IMPL_RTL_STRINGNAME( assign )( IMPL_RTL_STRINGDATA** ppThis, IMPL_RTL_STRINGDATA* pStr ) + SAL_THROW_EXTERN_C() { /* must be done at first, if pStr == *ppThis */ IMPL_RTL_AQUIRE( pStr ); @@ -1162,6 +1203,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( assign )( IMPL_RTL_STRINGDATA** ppThis, /* ----------------------------------------------------------------------- */ sal_Int32 SAL_CALL IMPL_RTL_STRINGNAME( getLength )( const IMPL_RTL_STRINGDATA* pThis ) + SAL_THROW_EXTERN_C() { return pThis->length; } @@ -1169,6 +1211,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRINGNAME( getLength )( const IMPL_RTL_STRINGDATA* /* ----------------------------------------------------------------------- */ IMPL_RTL_STRCODE* SAL_CALL IMPL_RTL_STRINGNAME( getStr )( IMPL_RTL_STRINGDATA * pThis ) + SAL_THROW_EXTERN_C() { return pThis->buffer; } @@ -1178,6 +1221,7 @@ IMPL_RTL_STRCODE* SAL_CALL IMPL_RTL_STRINGNAME( getStr )( IMPL_RTL_STRINGDATA * void SAL_CALL IMPL_RTL_STRINGNAME( newConcat )( IMPL_RTL_STRINGDATA** ppThis, IMPL_RTL_STRINGDATA* pLeft, IMPL_RTL_STRINGDATA* pRight ) + SAL_THROW_EXTERN_C() { IMPL_RTL_STRINGDATA* pOrg = *ppThis; @@ -1213,6 +1257,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newReplaceStrAt )( IMPL_RTL_STRINGDATA** ppTh sal_Int32 nIndex, sal_Int32 nCount, IMPL_RTL_STRINGDATA* pNewSubStr ) + SAL_THROW_EXTERN_C() { /* Append? */ if ( nIndex >= pStr->length ) @@ -1290,6 +1335,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newReplace )( IMPL_RTL_STRINGDATA** ppThis, IMPL_RTL_STRINGDATA* pStr, IMPL_RTL_STRCODE cOld, IMPL_RTL_STRCODE cNew ) + SAL_THROW_EXTERN_C() { IMPL_RTL_STRINGDATA* pOrg = *ppThis; int bChanged = 0; @@ -1347,6 +1393,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newReplace )( IMPL_RTL_STRINGDATA** ppThis, void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( IMPL_RTL_STRINGDATA** ppThis, IMPL_RTL_STRINGDATA* pStr ) + SAL_THROW_EXTERN_C() { IMPL_RTL_STRINGDATA* pOrg = *ppThis; int bChanged = 0; @@ -1407,6 +1454,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( IMPL_RTL_STRINGDATA** void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiUpperCase )( IMPL_RTL_STRINGDATA** ppThis, IMPL_RTL_STRINGDATA* pStr ) + SAL_THROW_EXTERN_C() { IMPL_RTL_STRINGDATA* pOrg = *ppThis; int bChanged = 0; @@ -1467,6 +1515,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiUpperCase )( IMPL_RTL_STRINGDATA** void SAL_CALL IMPL_RTL_STRINGNAME( newTrim )( IMPL_RTL_STRINGDATA** ppThis, IMPL_RTL_STRINGDATA* pStr ) + SAL_THROW_EXTERN_C() { IMPL_RTL_STRINGDATA* pOrg = *ppThis; const IMPL_RTL_STRCODE* pCharStr = pStr->buffer; @@ -1510,6 +1559,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRINGNAME( getToken )( IMPL_RTL_STRINGDATA** ppThis sal_Int32 nToken, IMPL_RTL_STRCODE cTok, sal_Int32 nIndex ) + SAL_THROW_EXTERN_C() { const IMPL_RTL_STRCODE* pCharStr = pStr->buffer; const IMPL_RTL_STRCODE* pCharStrStart; diff --git a/sal/rtl/source/surrogates.h b/sal/rtl/source/surrogates.hxx index c686e181047a..42d4355ade00 100644 --- a/sal/rtl/source/surrogates.h +++ b/sal/rtl/source/surrogates.hxx @@ -26,8 +26,8 @@ * ************************************************************************/ -#ifndef INCLUDED_SAL_RTL_SOURCE_SURROGATES_H -#define INCLUDED_SAL_RTL_SOURCE_SURROGATES_H +#ifndef INCLUDED_SAL_RTL_SOURCE_SURROGATES_HXX +#define INCLUDED_SAL_RTL_SOURCE_SURROGATES_HXX #include "sal/config.h" diff --git a/sal/rtl/source/tres.c b/sal/rtl/source/tres.c deleted file mode 100644 index 2cf429c6a49c..000000000000 --- a/sal/rtl/source/tres.c +++ /dev/null @@ -1,688 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <stdio.h> -#include <rtl/tres.h> -#include <osl/diagnose.h> -#include <osl/time.h> - - /* force an assertion on false state */ -#define TST_BOOM(c, m) OSL_ENSURE(c, m) - - -typedef struct _rtl_CmpState -{ - struct _rtl_CmpState* m_next; - struct _rtl_CmpState* m_prev; - - sal_Bool m_stat; - rtl_String* m_msg; - -} rtl_CmpState; - -typedef struct _rtl_FuncState -{ - struct _rtl_FuncState* m_next; - struct _rtl_FuncState* m_prev; - rtl_String* m_name; - sal_uInt32 m_flags; - sal_uInt32 m_start; - sal_uInt32 m_stop; - struct _rtl_CmpState* m_cmp; - -} rtl_FuncState; - - - -typedef struct _rtl_TestResult_Data -{ - rtl_TestResult_vtable* m_funcs; - void* m_externaldata; - - rtl_FuncState* m_state; - -} rtl_TestResult_Data; - - - /** - * internal helper functions - */ - - /* ...to create, link, unlink and destroy allocated memory */ -rtl_FuncState* SAL_CALL rtl_tres_create_funcstate( const sal_Char* meth ); -rtl_FuncState* SAL_CALL rtl_tres_link_funcstate( rtl_FuncState* ptr, - rtl_FuncState* plink ); -rtl_FuncState* SAL_CALL rtl_tres_unlink_funcstate( rtl_FuncState* plink ); -rtl_CmpState* SAL_CALL rtl_tres_create_cmpstate( - sal_Bool state, - const sal_Char* msg - ); -rtl_CmpState* SAL_CALL rtl_tres_link_cmpstate( rtl_CmpState* ptr, - rtl_CmpState* plink ); -rtl_CmpState* SAL_CALL rtl_tres_unlink_cmpstate( rtl_CmpState* plink ); -sal_uInt32 SAL_CALL rtl_tres_timer(); -void SAL_CALL rtl_tres_destroy_funcstate( rtl_FuncState* pState_ ); -void SAL_CALL rtl_tres_destroy_funcstates( rtl_FuncState* pState_ ); -void SAL_CALL rtl_tres_destroy_cmpstates( rtl_CmpState* pState_ ); -void SAL_CALL rtl_tres_destroy_cmpstate( rtl_CmpState* pState_ ); - - - /* set and clear single bits */ -static void SAL_CALL rtl_tres_setbit( rtl_FuncState* pState_, - sal_uInt32 flag ); -static void SAL_CALL rtl_tres_clearbit( rtl_FuncState* pState_, - sal_uInt32 flag ); - - /** - * forward declarations of concrete function implementations overloadable - * and accessible via vtable - */ -static sal_Bool SAL_CALL rtl_tres_state( - rtl_TestResult* pThis_, - sal_Bool state, - const sal_Char* msg, - const sal_Char* sub, - sal_Bool v - ); - -static void SAL_CALL rtl_tres_end( rtl_TestResult* pThis_, - const sal_Char* msg ); - -static rtl_funcstate SAL_CALL rtl_tres_funcstate( rtl_TestResult* pThis_ ); - -static sal_Bool SAL_CALL rtl_tres_ispassed( rtl_TestResult* pThis_ ); -static sal_Bool SAL_CALL rtl_tres_isok( rtl_TestResult* pThis_ ); - -static sal_Bool SAL_CALL rtl_tres_isbit( rtl_TestResult* pThis_, - sal_uInt32 flag ); - -static rtl_funcstate SAL_CALL rtl_tres_getnextfuncstate( rtl_funcstate ); -static rtl_funcstate SAL_CALL rtl_tres_getprevfuncstate( rtl_funcstate ); -static sal_uInt32 SAL_CALL rtl_tres_getflags( rtl_funcstate ); -sal_uInt32 SAL_CALL rtl_tres_getstarttime( rtl_funcstate ); -sal_uInt32 SAL_CALL rtl_tres_getstoptime( rtl_funcstate ); -static rtl_cmpstate SAL_CALL rtl_tres_getcmpstate( rtl_funcstate ); - -static sal_Bool SAL_CALL rtl_tres_getstat( rtl_cmpstate ); -rtl_String* SAL_CALL rtl_tres_getname( rtl_funcstate ); -rtl_String* SAL_CALL rtl_tres_getmsg( rtl_cmpstate ); -static rtl_cmpstate SAL_CALL rtl_tres_getnextcmpstate( rtl_cmpstate ); - - - /** - * initialize vtable with function pointers - */ -static rtl_TestResult_vtable trVTable = -{ - sizeof(rtl_TestResult_vtable), - rtl_tres_state, - rtl_tres_end, - rtl_tres_ispassed, - rtl_tres_isok, - rtl_tres_funcstate, - rtl_tres_isbit, - rtl_tres_getnextfuncstate, - rtl_tres_getprevfuncstate, - rtl_tres_getflags, - rtl_tres_getname, - rtl_tres_getstarttime, - rtl_tres_getstoptime, - rtl_tres_getcmpstate, - rtl_tres_getstat, - rtl_tres_getmsg, - rtl_tres_getnextcmpstate -}; - - /** - * rtl_tres_create - * create and initialize data struct for TestResult - * - * @param const sal_Char* meth = name of the method (entryname) - * @param sal_uInt32 flags = bitmap of comandline and status flags - * - * @return rtl_TestResult* = pointer to a new allocated testresult struct - */ -rtl_TestResult* rtl_tres_create( const sal_Char* meth, sal_uInt32 flags ) -{ - /* allocate memory for testresult data structure */ - rtl_TestResult_Data* pData = (rtl_TestResult_Data*) malloc( sizeof( - rtl_TestResult_Data ) ); - /* initialize members... */ - pData->m_funcs = &trVTable; /* ...vtableptr to vtbladr */ - pData->m_externaldata = 0; /* ...external data pointer */ - - /* allocate memory for state structure and initialize members */ - pData->m_state = rtl_tres_create_funcstate( meth ); - pData->m_state->m_flags = flags; /* ...option Bitmap */ - - /* set OK flag initial */ - rtl_tres_setbit( pData->m_state, rtl_tres_Flag_OK ); - - return (rtl_TestResult*)pData ; -} - -/** - * rtl_tres_create_funcstate - * allocates and initializes a structure to represent the status of a test - * entry or its substates - * - * @param const sal_Char* meth = the name of the method (entry or sub entry) - * - * @return rtl_FuncState* = pointer to a new allocated funcstate struct - */ -rtl_FuncState* SAL_CALL rtl_tres_create_funcstate( const sal_Char* meth ) -{ - rtl_FuncState* pStat = 0; /* status structure */ - - /* allocate memory for status structure */ - pStat = (rtl_FuncState*) malloc( sizeof( struct _rtl_FuncState ) ); - - if ( pStat ) - { - pStat->m_next = pStat; /* init ptr to next struct */ - pStat->m_prev = pStat; /* init ptr to prev struct */ - - pStat->m_name = 0; /* init name */ - pStat->m_flags = 0; /* init flags */ - pStat->m_start = rtl_tres_timer(); /* init start milliseconds */ - pStat->m_stop = 0; /* init stop milliseconds */ - pStat->m_cmp = 0; /* init ptr to msg struct */ - rtl_string_newFromStr( &pStat->m_name, meth );/* copy meth to name */ - - /* set ok flag initially */ - rtl_tres_setbit(pStat, rtl_tres_Flag_OK); - } - - return ( pStat ); -} - /** - * rtl_tres_link_funcstate - * link initialized funcstate structure to a circular double linked list - * - * @param rtl_FuncState* ptr = pointer to a funcstate where to link in new - * @param rtl_FuncState* plink = pointer to a funcstate to link in list - * - * @return rtl_FuncState* = pointer to structure linked in new - */ -rtl_FuncState* SAL_CALL rtl_tres_link_funcstate( rtl_FuncState* ptr, - rtl_FuncState* plink ) -{ - ptr->m_next->m_prev = plink; - ptr->m_next->m_prev->m_next = ptr->m_next; - ptr->m_next->m_prev->m_prev = ptr; - ptr->m_next = plink; - return ( plink ); -} - - /** - * rtl_tres_unlink_funcstate - * unlink funcstate structure from a circular double linked list - * - * @param rtl_FuncState* plink = pointer to a funcstate to unlink from list - * - * @return rtl_FuncState* = pointer to funcstate struct unlinked from - * list - */ -rtl_FuncState* SAL_CALL rtl_tres_unlink_funcstate( rtl_FuncState* plink ) -{ - plink->m_next->m_prev = plink->m_prev; - plink->m_prev->m_next = plink->m_next; - plink->m_next = plink; - plink->m_prev = plink; - return ( plink ); -} - - /** - * rtl_tres_link_cmpstate - * link initialized cmpstate structure to a circular double linked list - * - * @param rtl_CmpState* ptr = pointer to a cmpstate where to link in new - * @param rtl_CmpState* plink = pointer to a cmpstate to link in list - * - * @return rtl_CmpState* = pointer to cmpstate struct linked in new - */ -rtl_CmpState* SAL_CALL rtl_tres_link_cmpstate( rtl_CmpState* ptr, - rtl_CmpState* plink ) -{ - ptr->m_next->m_prev = plink; - ptr->m_next->m_prev->m_next = ptr->m_next; - ptr->m_next->m_prev->m_prev = ptr; - ptr->m_next = plink; - return ( plink ); -} - /** - * rtl_tres_unlink_cmpstate - * unlink cmpstate structure from a circular double linked list - * - * @param rtl_CmpState* plink = pointer to a cmpstate to unlink from list - * - * @return rtl_CmpState* = pointer to cmpstate struct unlinked from list - */ -rtl_CmpState* SAL_CALL rtl_tres_unlink_cmpstate( rtl_CmpState* plink ) -{ - plink->m_next->m_prev = plink->m_prev; - plink->m_prev->m_next = plink->m_next; - plink->m_next = plink; - plink->m_prev = plink; - return ( plink ); -} - - /** - * rtl_tres_create_cmpstate - * allocates and initializes a structure to represent the status of a test - * comparison - * - * @param sal_Bool state = compare state - * @param sal_Char* msg = message for logging and debug purposes - * - * @return rtl_CmpState* = pointer to the new allocated struct - */ -rtl_CmpState* SAL_CALL rtl_tres_create_cmpstate( - sal_Bool state, - const sal_Char* msg - ) -{ - /* allocate memory for cmpstate struct */ - rtl_CmpState* pStat = (rtl_CmpState*) malloc( sizeof( rtl_CmpState ) ); - - /* initialize if memory could be allocated */ - if ( pStat ) - { - pStat->m_next = pStat; /* init next with this */ - pStat->m_prev = pStat; /* init prev with this */ - pStat->m_msg = 0; - pStat->m_stat = state; /* boolean state */ - rtl_string_newFromStr( &pStat->m_msg, msg ); /* copy message */ - } - return ( pStat ); -} - - /** - * rtl_tres_destroy - * free allocated memory of testresult data struct - * - * @param rtl_TestResult* pThis_ = ponter to a valid testresult struct - */ -void SAL_CALL rtl_tres_destroy( rtl_TestResult* pThis_ ) -{ - /* cast to implementation representation structure */ - rtl_TestResult_Data* pData = (rtl_TestResult_Data*) pThis_; - - /* destroy all funcstates */ - if ( pData->m_state ) - rtl_tres_destroy_funcstates( pData->m_state ); - - /* free allocted memory and reinitialize to zero */ - /* to be able to prevent dangling pointer access*/ - free( pData ); pData = 0; -} - - /** - * rtl_tres_destroy_funcstates - * free allocated memory occupied by the list of funcstate data structs - * (iterates through next pointers) - * - * @param rtl_FuncState* pState_ = pointer to a valid funcstate struct - */ -void SAL_CALL rtl_tres_destroy_funcstates( rtl_FuncState* pState_ ) -{ - rtl_FuncState* plink = pState_->m_next; - while ( plink != plink->m_next ) - { - rtl_tres_destroy_funcstate( rtl_tres_unlink_funcstate( plink ) ); - plink = pState_->m_next; - } - rtl_tres_destroy_funcstate( plink ); -} - - /** - * rtl_tres_destroy_cmpstates - * free allocated memory occupied by the list of cmpstate data structs - * (iterates through next pointers) - * - * @param rtl_CmpState* pState_ = pointer to a valid cmpstate struct - */ -void SAL_CALL rtl_tres_destroy_cmpstates( rtl_CmpState* pState_ ) -{ - rtl_CmpState* plink = pState_->m_next; - while ( plink != plink->m_next ) - { - rtl_tres_destroy_cmpstate( rtl_tres_unlink_cmpstate( plink ) ); - plink = pState_->m_next; - } - rtl_tres_destroy_cmpstate( plink ); -} - - - /** - * rtl_tres_destroy_funcstate - * free allocated memory occupied by one funcstate and it's list - * of cmpstate data structs - * - * @param rtl_FuncState* pState_ = pointer to a valid funcstate struct - */ -void SAL_CALL rtl_tres_destroy_funcstate( rtl_FuncState* pState_ ) -{ - rtl_FuncState* plink = pState_; - - if ( plink->m_cmp ) - rtl_tres_destroy_cmpstates( plink->m_cmp ); - - if ( plink->m_name ) - { - rtl_string_release( plink->m_name ); - plink->m_name = 0; - } - plink->m_flags = 0; - free( plink ); - plink = 0; -} - - /** - * rtl_tres_destroy_cmpstate - * free allocated memory of a cmpstate data struct - * - * @param rtl_CmpState* pState_ = pointer to cmpstate struct to destroy - */ -void SAL_CALL rtl_tres_destroy_cmpstate( rtl_CmpState* pState_ ) -{ - - rtl_CmpState* plink = pState_; - - if ( plink->m_msg ) - { - rtl_string_release( plink->m_msg ); - plink->m_msg = 0; - } - free( plink ); - plink = 0; -} - /** - * central function to call in tests - * - * @param rtl_TestResult* pThis_ = self pointer to TestResult structure - * @param sal_Bool state = boolean result of statement comparison - * @param const sal_Char* msg = message for actual statementcomparison - * @param const sal_Char* sub = name of sub testfunction - * @param sal_Bool v = boolean verbose parameter - * - * @return sal_Bool = determines if statement comparison - * was positive or not - */ -static sal_Bool SAL_CALL rtl_tres_state( - rtl_TestResult* pThis_, - sal_Bool state, - const sal_Char* msg, - const sal_Char* sub, - sal_Bool v - ) -{ - - /* cast pointer to testresult data implementation struct*/ - rtl_TestResult_Data* pData = (rtl_TestResult_Data*)pThis_; - - /* initialize funcstate pointer with masterstate */ - rtl_FuncState* pFunc = pData->m_state; - - /* if substate required */ - if ( sub ) - { - /* link new created function state to last item */ - pFunc = rtl_tres_link_funcstate( pFunc->m_prev, - rtl_tres_create_funcstate( sub ) ); - - /* indicate this state as substate */ - rtl_tres_setbit( pFunc, rtl_tres_Flag_SUB ); - - /* indicate prvious state as passed if no masterstate */ - if ( pFunc->m_prev != pData->m_state ) - rtl_tres_setbit( pFunc->m_prev, rtl_tres_Flag_PASSED ); - } - - - /* test failed */ - if( ! state ) - { - /* determine if assertion should be thrown */ - if ( rtl_tres_isbit( pThis_, rtl_tres_Flag_BOOM ) ) - { - /* if message available */ - if ( msg ) - TST_BOOM( state, msg ); - else - TST_BOOM( state, "no msg available" ); - } - - /* clear this state ok flag and masterstate ok flag */ - rtl_tres_clearbit( pFunc, rtl_tres_Flag_OK ); - rtl_tres_clearbit( pData->m_state, rtl_tres_Flag_OK ); - } - /* message available */ - if( msg ) - { - /* append a new comparison state */ - if (! pFunc->m_cmp ) - pFunc->m_cmp = rtl_tres_create_cmpstate( state, msg ); - else - rtl_tres_link_cmpstate( pFunc->m_cmp, - rtl_tres_create_cmpstate(state, msg ) ); - - /* message to stderr required ? */ - if ( v || ( pFunc->m_next->m_flags & rtl_tres_Flag_VERBOSE ) ) - fprintf( stderr, "%s\n", msg ); - } - - pFunc->m_stop = rtl_tres_timer(); - return ( state ); -} - - /** - * rtl_tres_timer - * function to get actual timevalue - * this has to be replaced by a high resolution timer - */ -sal_uInt32 SAL_CALL rtl_tres_timer() -{ - sal_uInt32 val = 0; - TimeValue* tmv = (TimeValue*)malloc( sizeof( TimeValue ) ); - osl_getSystemTime( tmv ); - val = tmv->Nanosec/1000L; - free( tmv ); - return ( val ); -} - - -static void SAL_CALL rtl_tres_end( rtl_TestResult* pThis_, - const sal_Char* msg ) -{ - rtl_TestResult_Data* pData = (rtl_TestResult_Data*) pThis_; - - if( msg ) - { - if (! pData->m_state->m_cmp ) - pData->m_state->m_cmp = rtl_tres_create_cmpstate( sal_True, msg ); - else - rtl_tres_link_cmpstate( pData->m_state->m_cmp, - rtl_tres_create_cmpstate( sal_True, msg ) ); - } - pData->m_state->m_prev->m_flags |= rtl_tres_Flag_PASSED; - pData->m_state->m_flags |= rtl_tres_Flag_PASSED; - pData->m_state->m_stop = rtl_tres_timer(); -} - - -static sal_Bool SAL_CALL rtl_tres_ispassed( rtl_TestResult* pThis_ ) -{ - return rtl_tres_isbit( pThis_, rtl_tres_Flag_PASSED ); -} - -static sal_Bool SAL_CALL rtl_tres_isok( rtl_TestResult* pThis_ ) -{ - return rtl_tres_isbit( pThis_, rtl_tres_Flag_OK ); -} - /** - * return pointer to funcstate structure - */ -static rtl_funcstate SAL_CALL rtl_tres_funcstate( rtl_TestResult* pThis_ ) -{ - - rtl_TestResult_Data* pThis = (rtl_TestResult_Data*) pThis_; - return (rtl_funcstate)pThis->m_state; -} - - /** - * determine if a flag is set or not - */ -static sal_Bool SAL_CALL rtl_tres_isbit( rtl_TestResult* pThis_, - sal_uInt32 flag ) -{ - return (sal_Bool) - ((((rtl_TestResult_Data *) pThis_)->m_state->m_flags & flag) == flag); -} - /** - * set one single bit - */ -static void SAL_CALL rtl_tres_setbit( rtl_FuncState* pState_, - sal_uInt32 flag ) -{ - pState_->m_flags |= flag; -} - /** - * clear one single bit - */ -static void SAL_CALL rtl_tres_clearbit( rtl_FuncState* pState_, - sal_uInt32 flag ) -{ - pState_->m_flags = pState_->m_flags & ( ~flag ); -} - - /** - * returns next pointer of passed funcstate structure - */ -rtl_funcstate SAL_CALL rtl_tres_getnextfuncstate( rtl_funcstate fstate ) -{ - rtl_FuncState* fs = (rtl_FuncState*)fstate; - return( (rtl_funcstate)fs->m_next ); - -} - /** - * returns previous pointer of passed funcstate structure - */ -rtl_funcstate SAL_CALL rtl_tres_getprevfuncstate( rtl_funcstate fstate ) -{ - rtl_FuncState* fs = (rtl_FuncState*)fstate; - return( (rtl_funcstate)fs->m_prev ); - -} - /** - * returns flag value of passed funcstate structure - */ -sal_uInt32 SAL_CALL rtl_tres_getflags( rtl_funcstate fstate ) -{ - rtl_FuncState* fs = (rtl_FuncState*)fstate; - return( fs->m_flags ); -} - /** - * returns name of passed funcstate structure - */ -rtl_String* SAL_CALL rtl_tres_getname( rtl_funcstate fstate ) -{ - rtl_FuncState* fs = (rtl_FuncState*)fstate; - return( fs->m_name ); -} - /** - * returns starttime of passed funcstate structure - */ -sal_uInt32 SAL_CALL rtl_tres_getstarttime( rtl_funcstate fstate ) -{ - rtl_FuncState* fs = (rtl_FuncState*)fstate; - return( fs->m_start ); -} - - /** - * returns stoptime of passed funcstate structure - */ -sal_uInt32 SAL_CALL rtl_tres_getstoptime( rtl_funcstate fstate ) -{ - rtl_FuncState* fs = (rtl_FuncState*)fstate; - return( fs->m_stop ); -} - - /** - * returns pointer to cmpstate of passed funcstate structure - */ -rtl_cmpstate SAL_CALL rtl_tres_getcmpstate( rtl_funcstate fstate) -{ - rtl_FuncState* fs = (rtl_FuncState*)fstate; - return( (rtl_cmpstate)fs->m_cmp ); - -} - /** - * returns boolean state of passed cmpstate structure - */ -sal_Bool SAL_CALL rtl_tres_getstat( rtl_cmpstate cstate) -{ - rtl_CmpState* cs = (rtl_CmpState*)cstate; - return( cs->m_stat ); -} - /** - * returns message of passed cmpstate structure - */ -rtl_String* SAL_CALL rtl_tres_getmsg( rtl_cmpstate cstate) -{ - rtl_CmpState* cs = (rtl_CmpState*)cstate; - return( cs->m_msg ); -} - /** - * returns next pointer of passed cmpstate structure - */ -rtl_cmpstate SAL_CALL rtl_tres_getnextcmpstate( rtl_cmpstate cstate) -{ - rtl_CmpState* cs = (rtl_CmpState*)cstate; - return( (rtl_cmpstate)cs->m_next ); -} - -/* -// <method_logPrintf> -//inline void logPrintf ( const sal_Bool bTestCaseState, -// const char *pFormatStr, ... -// ) -//{ -// if( m_pFunctions && m_pFunctions->pLogPrintf ) -// { -// va_list vArgumentList; -// va_start ( vArgumentList, pFormatStr ); - -// m_pFunctions->pLogPrintf( this, bTestCaseState, pFormatStr, vArgumentList ); - -// va_end ( vArgumentList ); -// } -//} // </method_logPrintf> - */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/rtl/source/uri.cxx b/sal/rtl/source/uri.cxx index 928614eb32ce..191d319c6474 100644 --- a/sal/rtl/source/uri.cxx +++ b/sal/rtl/source/uri.cxx @@ -31,7 +31,7 @@ #include "rtl/uri.h" -#include "surrogates.h" +#include "surrogates.hxx" #include "osl/diagnose.h" #include "rtl/strbuf.hxx" diff --git a/sal/rtl/source/ustrbuf.c b/sal/rtl/source/ustrbuf.cxx index 374913ae78b8..82b2fcb43d1b 100644 --- a/sal/rtl/source/ustrbuf.c +++ b/sal/rtl/source/ustrbuf.cxx @@ -148,6 +148,7 @@ void SAL_CALL rtl_uStringbuffer_insert( rtl_uString ** This, void rtl_uStringbuffer_insertUtf32( rtl_uString ** pThis, sal_Int32 * capacity, sal_Int32 offset, sal_uInt32 c) + SAL_THROW_EXTERN_C() { sal_Unicode buf[2]; sal_Int32 len; diff --git a/sal/rtl/source/ustring.c b/sal/rtl/source/ustring.cxx index feb597547ae1..a37353c99161 100644 --- a/sal/rtl/source/ustring.c +++ b/sal/rtl/source/ustring.cxx @@ -40,9 +40,9 @@ #include <string.h> #include <sal/alloca.h> -#include "hash.h" -#include "strimp.h" -#include "surrogates.h" +#include "hash.hxx" +#include "strimp.hxx" +#include "surrogates.hxx" #include <rtl/ustring.h> #include "rtl/math.h" @@ -76,11 +76,11 @@ static void internRelease (rtl_uString *pThis); /* Include String/UString template code */ -#include "strtmpl.c" +#include "strtmpl.cxx" sal_Int32 rtl_ustr_indexOfAscii_WithLength( sal_Unicode const * str, sal_Int32 len, - char const * subStr, sal_Int32 subLen) + char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C() { if (subLen > 0 && subLen <= len) { sal_Int32 i; @@ -97,7 +97,7 @@ sal_Int32 rtl_ustr_indexOfAscii_WithLength( sal_Int32 rtl_ustr_lastIndexOfAscii_WithLength( sal_Unicode const * str, sal_Int32 len, - char const * subStr, sal_Int32 subLen) + char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C() { if (subLen > 0 && subLen <= len) { sal_Int32 i; @@ -113,6 +113,7 @@ sal_Int32 rtl_ustr_lastIndexOfAscii_WithLength( } sal_Int32 SAL_CALL rtl_ustr_valueOfFloat(sal_Unicode * pStr, float f) + SAL_THROW_EXTERN_C() { rtl_uString * pResult = NULL; sal_Int32 nLen; @@ -128,6 +129,7 @@ sal_Int32 SAL_CALL rtl_ustr_valueOfFloat(sal_Unicode * pStr, float f) } sal_Int32 SAL_CALL rtl_ustr_valueOfDouble(sal_Unicode * pStr, double d) + SAL_THROW_EXTERN_C() { rtl_uString * pResult = NULL; sal_Int32 nLen; @@ -142,14 +144,14 @@ sal_Int32 SAL_CALL rtl_ustr_valueOfDouble(sal_Unicode * pStr, double d) return nLen; } -float SAL_CALL rtl_ustr_toFloat(sal_Unicode const * pStr) +float SAL_CALL rtl_ustr_toFloat(sal_Unicode const * pStr) SAL_THROW_EXTERN_C() { return (float) rtl_math_uStringToDouble(pStr, pStr + rtl_ustr_getLength(pStr), '.', 0, 0, 0); } -double SAL_CALL rtl_ustr_toDouble(sal_Unicode const * pStr) +double SAL_CALL rtl_ustr_toDouble(sal_Unicode const * pStr) SAL_THROW_EXTERN_C() { return rtl_math_uStringToDouble(pStr, pStr + rtl_ustr_getLength(pStr), '.', 0, 0, 0); @@ -159,6 +161,7 @@ double SAL_CALL rtl_ustr_toDouble(sal_Unicode const * pStr) sal_Int32 SAL_CALL rtl_ustr_ascii_compare( const sal_Unicode* pStr1, const sal_Char* pStr2 ) + SAL_THROW_EXTERN_C() { sal_Int32 nRet; while ( ((nRet = ((sal_Int32)(*pStr1))- @@ -177,6 +180,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_compare( const sal_Unicode* pStr1, sal_Int32 SAL_CALL rtl_ustr_ascii_compare_WithLength( const sal_Unicode* pStr1, sal_Int32 nStr1Len, const sal_Char* pStr2 ) + SAL_THROW_EXTERN_C() { sal_Int32 nRet = 0; while( ((nRet = (nStr1Len ? (sal_Int32)(*pStr1) : 0)- @@ -197,6 +201,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_shortenedCompare_WithLength( const sal_Unicode sal_Int32 nStr1Len, const sal_Char* pStr2, sal_Int32 nShortenedLength ) + SAL_THROW_EXTERN_C() { const sal_Unicode* pStr1End = pStr1 + nStr1Len; sal_Int32 nRet; @@ -240,6 +245,7 @@ sal_Int32 SAL_CALL rtl_ustr_asciil_reverseCompare_WithLength( const sal_Unicode* sal_Int32 nStr1Len, const sal_Char* pStr2, sal_Int32 nStr2Len ) + SAL_THROW_EXTERN_C() { const sal_Unicode* pStr1Run = pStr1+nStr1Len; const sal_Char* pStr2Run = pStr2+nStr2Len; @@ -261,6 +267,7 @@ sal_Int32 SAL_CALL rtl_ustr_asciil_reverseCompare_WithLength( const sal_Unicode* sal_Bool SAL_CALL rtl_ustr_asciil_reverseEquals_WithLength( const sal_Unicode* pStr1, const sal_Char* pStr2, sal_Int32 nStrLen ) + SAL_THROW_EXTERN_C() { const sal_Unicode* pStr1Run = pStr1+nStrLen; const sal_Char* pStr2Run = pStr2+nStrLen; @@ -279,6 +286,7 @@ sal_Bool SAL_CALL rtl_ustr_asciil_reverseEquals_WithLength( const sal_Unicode* p sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase( const sal_Unicode* pStr1, const sal_Char* pStr2 ) + SAL_THROW_EXTERN_C() { sal_Int32 nRet; sal_Int32 c1; @@ -309,6 +317,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase( const sal_Unicode* pSt sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( const sal_Unicode* pStr1, sal_Int32 nStr1Len, const sal_Char* pStr2 ) + SAL_THROW_EXTERN_C() { sal_Int32 nRet; sal_Int32 c1; @@ -340,7 +349,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( const sal_U sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths( sal_Unicode const * first, sal_Int32 firstLen, - char const * second, sal_Int32 secondLen) + char const * second, sal_Int32 secondLen) SAL_THROW_EXTERN_C() { sal_Int32 i; sal_Int32 len = firstLen < secondLen ? firstLen : secondLen; @@ -368,6 +377,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( co sal_Int32 nStr1Len, const sal_Char* pStr2, sal_Int32 nShortenedLength ) + SAL_THROW_EXTERN_C() { const sal_Unicode* pStr1End = pStr1 + nStr1Len; sal_Int32 nRet; @@ -417,6 +427,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( co void SAL_CALL rtl_uString_newFromAscii( rtl_uString** ppThis, const sal_Char* pCharStr ) + SAL_THROW_EXTERN_C() { sal_Int32 nLen; @@ -460,7 +471,7 @@ void SAL_CALL rtl_uString_newFromAscii( rtl_uString** ppThis, void SAL_CALL rtl_uString_newFromCodePoints( rtl_uString ** newString, sal_uInt32 const * codePoints, - sal_Int32 codePointCount) + sal_Int32 codePointCount) SAL_THROW_EXTERN_C() { sal_Int32 n; sal_Int32 i; @@ -724,7 +735,7 @@ void SAL_CALL rtl_string2UString( rtl_uString** ppThis, const sal_Char* pStr, sal_Int32 nLen, rtl_TextEncoding eTextEncoding, - sal_uInt32 nCvtFlags ) + sal_uInt32 nCvtFlags ) SAL_THROW_EXTERN_C() { rtl_string2UString_status( ppThis, pStr, nLen, eTextEncoding, nCvtFlags, NULL ); @@ -732,10 +743,10 @@ void SAL_CALL rtl_string2UString( rtl_uString** ppThis, /* ----------------------------------------------------------------------- */ -typedef enum { +enum StrLifecycle { CANNOT_RETURN, CAN_RETURN = 1 -} StrLifecycle; +}; static oslMutex getInternMutex() @@ -784,7 +795,7 @@ static void rtl_ustring_intern_internal( rtl_uString ** newStr, } void SAL_CALL rtl_uString_intern( rtl_uString ** newStr, - rtl_uString * str) + rtl_uString * str) SAL_THROW_EXTERN_C() { if (SAL_STRING_IS_INTERN(str)) { @@ -830,6 +841,7 @@ void SAL_CALL rtl_uString_internConvert( rtl_uString ** newStr, rtl_TextEncoding eTextEncoding, sal_uInt32 convertFlags, sal_uInt32 * pInfo ) + SAL_THROW_EXTERN_C() { rtl_uString *scratch; @@ -848,8 +860,8 @@ void SAL_CALL rtl_uString_internConvert( rtl_uString ** newStr, { int i; rtl_uString *pScratch; - pScratch = alloca( sizeof( rtl_uString ) - + len * sizeof (IMPL_RTL_STRCODE ) ); + pScratch = static_cast< rtl_uString * >( + alloca(sizeof (rtl_uString) + len * sizeof (IMPL_RTL_STRCODE))); for (i = 0; i < len; i++) { /* Check ASCII range */ @@ -868,7 +880,9 @@ void SAL_CALL rtl_uString_internConvert( rtl_uString ** newStr, sal_Size nSrcBytes; sal_uInt32 nInfo; - pScratch = alloca( sizeof(rtl_uString) + ulen * sizeof (IMPL_RTL_STRCODE) ); + pScratch = static_cast< rtl_uString * >( + alloca( + sizeof (rtl_uString) + ulen * sizeof (IMPL_RTL_STRCODE))); hConverter = rtl_createTextToUnicodeConverter( eTextEncoding ); rtl_convertTextToUnicode( diff --git a/sal/rtl/source/uuid.cxx b/sal/rtl/source/uuid.cxx index 7be3847e6902..8b650cd6aa43 100644 --- a/sal/rtl/source/uuid.cxx +++ b/sal/rtl/source/uuid.cxx @@ -67,7 +67,7 @@ ( ( (sal_uInt32)p[3]) & 0xff);\ } -typedef struct _UUID +struct UUID { sal_uInt32 time_low; sal_uInt16 time_mid; @@ -75,7 +75,7 @@ typedef struct _UUID sal_uInt8 clock_seq_hi_and_reserved; sal_uInt8 clock_seq_low; sal_uInt8 node[6]; -} UUID; +}; static void write_v3( sal_uInt8 *pUuid ) { diff --git a/sal/util/sal.map b/sal/util/sal.map index b1b8892a0bd1..b67e313427b5 100755 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -482,8 +482,6 @@ UDK_3_0_0 { rtl_removeUnloadingListener; rtl_logfile_trace; - rtl_tres_create; - rtl_tres_destroy; osl_getProcessLocale; osl_setProcessLocale; local: diff --git a/sc/CppunitTest_sc_filters_test.mk b/sc/CppunitTest_sc_filters_test.mk index e40ae2e63e33..3260d32d0605 100644 --- a/sc/CppunitTest_sc_filters_test.mk +++ b/sc/CppunitTest_sc_filters_test.mk @@ -99,8 +99,9 @@ $(eval $(call gb_CppunitTest_add_service_rdbs,sc_filters_test,\ $(eval $(call gb_CppunitTest_set_args,sc_filters_test,\ --headless \ --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \ - -env:OOO_CONFIG_REGISTRY_DIR=$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) \ + "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) module:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry/spool)" \ )) + # .../spool is required for the (somewhat strange) filter configuration # we need to # a) explicitly depend on library msword because it is not implied by a link diff --git a/sc/CppunitTest_sc_macros_test.mk b/sc/CppunitTest_sc_macros_test.mk index 0da63485bfe7..5d39769a3f15 100644 --- a/sc/CppunitTest_sc_macros_test.mk +++ b/sc/CppunitTest_sc_macros_test.mk @@ -99,9 +99,9 @@ $(eval $(call gb_CppunitTest_add_service_rdbs,sc_macros_test,\ $(eval $(call gb_CppunitTest_set_args,sc_macros_test,\ --headless \ --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \ - -env:OOO_CONFIG_REGISTRY_DIR=$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) \ - -env:OOO_CONFIG_REGISTRY_EXTRA_DIR=$(call gb_CppunitTarget__make_url,$(OUTDIR)/unittest/user) \ + "-env:CONFIGURATION_LAYERS=xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) module:$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry/spool) xcsxcu:$(call gb_CppunitTarget__make_url,$(OUTDIR)/unittest/user)" \ )) + # .../spool is required for the (somewhat strange) filter configuration # we need to # a) explicitly depend on library msword because it is not implied by a link diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index a7ae1c3bb576..582901cc72e4 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -575,6 +575,9 @@ public: SC_DLLPUBLIC void CreateValidTabName(String& rName) const; SC_DLLPUBLIC void CreateValidTabName(rtl::OUString& rName) const; SC_DLLPUBLIC void CreateValidTabNames(std::vector<rtl::OUString>& aNames, SCTAB nCount) const; + + void AppendTabOnLoad(const rtl::OUString& rName); + SC_DLLPUBLIC sal_Bool InsertTab( SCTAB nPos, const String& rName, sal_Bool bExternalDocument = false ); SC_DLLPUBLIC bool InsertTabs( SCTAB nPos, const std::vector<rtl::OUString>& rNames, diff --git a/sc/qa/unit/data/contentCSV/bugFix_Sheet2.csv b/sc/qa/unit/data/contentCSV/bugFix_Sheet2.csv new file mode 100644 index 000000000000..c6fbdda00504 --- /dev/null +++ b/sc/qa/unit/data/contentCSV/bugFix_Sheet2.csv @@ -0,0 +1,6 @@ +success +fail +success +fail +success +fail diff --git a/sc/qa/unit/data/contentCSV/spreadsheet-functions.csv b/sc/qa/unit/data/contentCSV/spreadsheet-functions.csv index da534337f3ed..83a33b299820 100644 --- a/sc/qa/unit/data/contentCSV/spreadsheet-functions.csv +++ b/sc/qa/unit/data/contentCSV/spreadsheet-functions.csv @@ -1,4 +1,4 @@ $C$2, $A$1, Sheet.B$2, Sheet!R2C2 -2, 4, 4, 5, 6, 15, 15, 6 +2, 4, 4, 5, 6, 15, 15, 6, 9 1, 3, 4, 4, 2, 2 -2, 4, 7, 8 +2, 4, 7, 8, 4 diff --git a/sc/qa/unit/data/ods/bug-fixes.ods b/sc/qa/unit/data/ods/bug-fixes.ods Binary files differindex dcdbd69e66c7..686423527107 100644 --- a/sc/qa/unit/data/ods/bug-fixes.ods +++ b/sc/qa/unit/data/ods/bug-fixes.ods diff --git a/sc/qa/unit/data/ods/functions.ods b/sc/qa/unit/data/ods/functions.ods Binary files differindex 231747370137..cfdd26351808 100644 --- a/sc/qa/unit/data/ods/functions.ods +++ b/sc/qa/unit/data/ods/functions.ods diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 059ef174f988..74a90065201a 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -599,7 +599,11 @@ void ScFiltersTest::testBugFixesODS() CPPUNIT_ASSERT_MESSAGE("Failed to load bugFixes.ods", xDocSh.Is()); ScDocument* pDoc = xDocSh->GetDocument(); - CPPUNIT_ASSERT_MESSAGE("No Document", pDoc); //remove with first test + + rtl::OUString aCSVFileName; + createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bugFix_Sheet2.")), aCSVFileName); + testFile(aCSVFileName, pDoc, 1); + xDocSh->DoClose(); } diff --git a/sc/qa/unit/macros-test.cxx b/sc/qa/unit/macros-test.cxx index aff5bc537e28..22faa26cf915 100644 --- a/sc/qa/unit/macros-test.cxx +++ b/sc/qa/unit/macros-test.cxx @@ -126,7 +126,6 @@ public: void testStarBasic(); void testVba(); CPPUNIT_TEST_SUITE(ScMacrosTest); -#if 0 #ifndef MACOSX //enable this test if you want to play with star basic macros in unit tests //works but does nothing useful yet @@ -135,7 +134,6 @@ public: //does not work, still problems during loading CPPUNIT_TEST(testVba); #endif -#endif CPPUNIT_TEST_SUITE_END(); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 21db934c46e4..a19e300da250 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -127,6 +127,7 @@ public: void testSheetCopy(); void testSheetMove(); void testExternalRef(); + void testExternalRefFunctions(); void testDataArea(); void testAutofilter(); void testCopyPaste(); @@ -169,6 +170,7 @@ public: CPPUNIT_TEST(testSheetCopy); CPPUNIT_TEST(testSheetMove); CPPUNIT_TEST(testExternalRef); + CPPUNIT_TEST(testExternalRefFunctions); CPPUNIT_TEST(testDataArea); CPPUNIT_TEST(testGraphicsInGroup); CPPUNIT_TEST(testStreamValid); @@ -638,6 +640,24 @@ void Test::testMatrix() pMat->And() && pMat->Or()); } + // Test the AND and OR evaluations. + for (int i = 0; i < 2; ++i) + { + pMat = new ScMatrix(2, 2, eDT[i]); + + // Only some of the elements are non-zero. + pMat->PutBoolean(true, 0, 0); + pMat->PutDouble(1.0, 1, 1); + CPPUNIT_ASSERT_MESSAGE("incorrect OR result", pMat->Or()); + CPPUNIT_ASSERT_MESSAGE("incorrect AND result", !pMat->And()); + + // All of the elements are non-zero. + pMat->PutBoolean(true, 0, 1); + pMat->PutDouble(2.3, 1, 0); + CPPUNIT_ASSERT_MESSAGE("incorrect OR result", pMat->Or()); + CPPUNIT_ASSERT_MESSAGE("incorrect AND result", pMat->And()); + } + // Now test the emtpy matrix types. eDT[0] = ScMatrix::FILLED_EMPTY; eDT[1] = ScMatrix::SPARSE_EMPTY; @@ -1498,6 +1518,60 @@ void Test::testExternalRef() m_pDoc->DeleteTab(0); } +void Test::testExternalRefFunctions() +{ + ScDocShellRef xExtDocSh = new ScDocShell; + OUString aExtDocName(RTL_CONSTASCII_USTRINGPARAM("file:///extdata.fake")); + SfxMedium* pMed = new SfxMedium(aExtDocName, STREAM_STD_READWRITE); + xExtDocSh->DoInitNew(pMed); + CPPUNIT_ASSERT_MESSAGE("external document instance not loaded.", + findLoadedDocShellByName(aExtDocName) != NULL); + + // Populate the external source document. + ScDocument* pExtDoc = xExtDocSh->GetDocument(); + pExtDoc->InsertTab(0, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Data"))); + double val = 1; + pExtDoc->SetValue(0, 0, 0, val); + // leave cell B1 empty. + val = 2; + pExtDoc->SetValue(0, 1, 0, val); + pExtDoc->SetValue(1, 1, 0, val); + val = 3; + pExtDoc->SetValue(0, 2, 0, val); + pExtDoc->SetValue(1, 2, 0, val); + val = 4; + pExtDoc->SetValue(0, 3, 0, val); + pExtDoc->SetValue(1, 3, 0, val); + + m_pDoc->InsertTab(0, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Test"))); + + struct { + const char* pFormula; double fResult; + } aChecks[] = { + { "=SUM('file:///extdata.fake'#Data.A1:A4)", 10 }, + { "=SUM('file:///extdata.fake'#Data.B1:B4)", 9 }, + { "=AVERAGE('file:///extdata.fake'#Data.A1:A4)", 2.5 }, + { "=AVERAGE('file:///extdata.fake'#Data.B1:B4)", 3 }, + { "=COUNT('file:///extdata.fake'#Data.A1:A4)", 4 }, + { "=COUNT('file:///extdata.fake'#Data.B1:B4)", 3 } + }; + + for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i) + { + m_pDoc->SetString(0, 0, 0, rtl::OUString::createFromAscii(aChecks[i].pFormula)); + m_pDoc->CalcAll(); + m_pDoc->GetValue(0, 0, 0, val); + CPPUNIT_ASSERT_MESSAGE("unexpected result involving external ranges.", val == aChecks[i].fResult); + } + + // Unload the external document shell. + xExtDocSh->DoClose(); + CPPUNIT_ASSERT_MESSAGE("external document instance should have been unloaded.", + findLoadedDocShellByName(aExtDocName) == NULL); + + m_pDoc->DeleteTab(0); +} + void Test::testDataArea() { m_pDoc->InsertTab(0, OUString(RTL_CONSTASCII_USTRINGPARAM("Data"))); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index b9526d31f272..196bc17fae9b 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -401,6 +401,17 @@ void ScDocument::CreateValidTabNames(std::vector<rtl::OUString>& aNames, SCTAB n } } +void ScDocument::AppendTabOnLoad(const rtl::OUString& rName) +{ + SCTAB nTabCount = static_cast<SCTAB>(maTabs.size()); + + if (ValidTab(nTabCount) && ValidNewTabName(rName)) + { + maTabs.push_back( new ScTable(this, nTabCount, rName) ); + maTabs[nTabCount]->SetCodeName( rName ); + } +} + sal_Bool ScDocument::InsertTab( SCTAB nPos, const String& rName, sal_Bool bExternalDocument ) diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 9470e76a0886..dea2c2896948 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -591,8 +591,10 @@ bool ScMatrixImpl::IsEmpty( SCSIZE nC, SCSIZE nR ) const bool ScMatrixImpl::IsEmptyPath( SCSIZE nC, SCSIZE nR ) const { // 'Empty path' is empty plus non-zero flag. - ValidColRowReplicated( nC, nR ); - return maMat.get_type(nR, nC) == ::mdds::element_empty && maMat.get_flag(nR, nC) != 0; + if (ValidColRowOrReplicated( nC, nR )) + return maMat.get_type(nR, nC) == ::mdds::element_empty && maMat.get_flag(nR, nC) != 0; + else + return true; } bool ScMatrixImpl::IsValue( SCSIZE nIndex ) const @@ -732,7 +734,7 @@ bool EvalMatrix(const MatrixImplType& rMat) for (size_t j = 0; j < nCols; ++j) { matrix_element_t eType = rMat.get_type(i, j); - if (eType != mdds::element_numeric && eType == mdds::element_boolean) + if (eType != mdds::element_numeric && eType != mdds::element_boolean) // assuming a CompareMat this is an error return CreateDoubleError(errIllegalArgument); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 7e6d98a97615..3beef270d01d 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2782,8 +2782,7 @@ public: if ( nUnoType & sheet::NamedRangeFlag::COLUMN_HEADER ) nNewType |= RT_COLHEADER; if ( nUnoType & sheet::NamedRangeFlag::ROW_HEADER ) nNewType |= RT_ROWHEADER; - - if (mpDoc && !mrRangeName.findByName(r.sName)) + if (mpDoc) { // Insert a new name. ScAddress aPos; diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 12d9cad96c88..04f9a8e5daac 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -192,22 +192,8 @@ void ScMyTables::NewSheet(const rtl::OUString& sTableName, const rtl::OUString& { if (nCurrentSheet > 0) { - try - { - xSheets->insertNewByName(sTableName, nCurrentSheet); - } - catch ( uno::RuntimeException& ) - { - ScDocument *pDoc = ScXMLConverter::GetScDocument(rImport.GetModel()); - if (pDoc) - { - ScXMLImport::MutexGuard aGuard(rImport); - String sTabName(String::CreateFromAscii("Table")); - pDoc->CreateValidTabName(sTabName); - rtl::OUString sOUTabName(sTabName); - xSheets->insertNewByName(sOUTabName, nCurrentSheet); - } - } + ScDocument *pDoc = ScXMLConverter::GetScDocument(rImport.GetModel()); + pDoc->AppendTabOnLoad(sTableName); } uno::Reference <container::XIndexAccess> xIndex( xSheets, uno::UNO_QUERY ); if ( xIndex.is() ) diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index c80653193daf..408feb6d6fb5 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1412,8 +1412,8 @@ static ScTokenArray* lcl_convertToTokenArray(const ScDocument* pSrcDoc, ScRange& pUsedRange.reset(new ScRange(nDataCol1, nDataRow1, 0, nDataCol2, nDataRow2, 0)); ScMatrixRef xMat = new ScMatrix( - static_cast<SCSIZE>(nDataCol2-nDataCol1+1), - static_cast<SCSIZE>(nDataRow2-nDataRow1+1)); + static_cast<SCSIZE>(nCol2-nCol1+1), + static_cast<SCSIZE>(nRow2-nRow1+1), ScMatrix::SPARSE_EMPTY); for (SCCOL nCol = nDataCol1; nCol <= nDataCol2; ++nCol) { @@ -1423,53 +1423,52 @@ static ScTokenArray* lcl_convertToTokenArray(const ScDocument* pSrcDoc, ScRange& ScBaseCell* pCell; pSrcDoc->GetCell(nCol, nRow, nTab, pCell); if (!pCell || pCell->HasEmptyData()) - xMat->PutEmpty(nC, nR); - else + // Skip empty cells. Matrix's default values are empty elements. + continue; + + switch (pCell->GetCellType()) { - switch (pCell->GetCellType()) + case CELLTYPE_EDIT: + { + String aStr; + static_cast<ScEditCell*>(pCell)->GetString(aStr); + xMat->PutString(aStr, nC, nR); + } + break; + case CELLTYPE_STRING: + { + String aStr; + static_cast<ScStringCell*>(pCell)->GetString(aStr); + xMat->PutString(aStr, nC, nR); + } + break; + case CELLTYPE_VALUE: + { + double fVal = static_cast<ScValueCell*>(pCell)->GetValue(); + xMat->PutDouble(fVal, nC, nR); + } + break; + case CELLTYPE_FORMULA: { - case CELLTYPE_EDIT: + ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell); + sal_uInt16 nError = pFCell->GetErrCode(); + if (nError) + xMat->PutDouble( CreateDoubleError( nError), nC, nR); + else if (pFCell->IsValue()) { - String aStr; - static_cast<ScEditCell*>(pCell)->GetString(aStr); - xMat->PutString(aStr, nC, nR); + double fVal = pFCell->GetValue(); + xMat->PutDouble(fVal, nC, nR); } - break; - case CELLTYPE_STRING: + else { String aStr; - static_cast<ScStringCell*>(pCell)->GetString(aStr); + pFCell->GetString(aStr); xMat->PutString(aStr, nC, nR); } - break; - case CELLTYPE_VALUE: - { - double fVal = static_cast<ScValueCell*>(pCell)->GetValue(); - xMat->PutDouble(fVal, nC, nR); - } - break; - case CELLTYPE_FORMULA: - { - ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell); - sal_uInt16 nError = pFCell->GetErrCode(); - if (nError) - xMat->PutDouble( CreateDoubleError( nError), nC, nR); - else if (pFCell->IsValue()) - { - double fVal = pFCell->GetValue(); - xMat->PutDouble(fVal, nC, nR); - } - else - { - String aStr; - pFCell->GetString(aStr); - xMat->PutString(aStr, nC, nR); - } - } - break; - default: - OSL_FAIL("attempted to convert an unknown cell type."); } + break; + default: + OSL_FAIL("attempted to convert an unknown cell type."); } } } diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index de2d683d4ad0..fdb0b923bfd9 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -1511,7 +1511,6 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa // Fenster findet (wird aus SetCursor gerufen) UpdateShow(); aViewData.ResetOldCursor(); - SetCursor( aViewData.GetCurX(), aViewData.GetCurY(), true ); SfxBindings& rBindings = aViewData.GetBindings(); ScMarkData& rMark = aViewData.GetMarkData(); @@ -1548,6 +1547,7 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa rBindings.Invalidate( FID_TAB_DESELECTALL ); } + SetCursor( aViewData.GetCurX(), aViewData.GetCurY(), true ); bool bUnoRefDialog = pScMod->IsRefDialogOpen() && pScMod->GetCurRefDlgId() == WID_SIMPLE_REF; // recalc zoom-dependent values (before TabChanged, before UpdateEditViewPos) diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp index 01d0cecc5c77..710cdb8863ad 100644 --- a/scp2/source/ooo/common_brand.scp +++ b/scp2/source/ooo/common_brand.scp @@ -1168,7 +1168,7 @@ ProfileItem gid_Brand_Profileitem_Fundamental_Ure_More_Types ProfileID = gid_Brand_Profile_Fundamental_Ini; Section = "Bootstrap"; Key = "URE_MORE_TYPES"; - Value = "$ORIGIN/offapi.rdb $ORIGIN/oovbaapi.rdb ${${$ORIGIN/" PROFILENAME(uno) ":PKG_UserUnoFile}:UNO_TYPES} ${${$ORIGIN/" PROFILENAME(uno) ":PKG_SharedUnoFile}:UNO_TYPES} ${${$ORIGIN/" PROFILENAME(uno) ":PKG_BundledUnoFile}:UNO_TYPES}"; + Value = "<$ORIGIN/types>* ${${$ORIGIN/" PROFILENAME(uno) ":PKG_UserUnoFile}:UNO_TYPES} ${${$ORIGIN/" PROFILENAME(uno) ":PKG_SharedUnoFile}:UNO_TYPES} ${${$ORIGIN/" PROFILENAME(uno) ":PKG_BundledUnoFile}:UNO_TYPES}"; End ProfileItem gid_Brand_Profileitem_Fundamental_Ure_More_Services @@ -1176,7 +1176,7 @@ ProfileItem gid_Brand_Profileitem_Fundamental_Ure_More_Services ProfileID = gid_Brand_Profile_Fundamental_Ini; Section = "Bootstrap"; Key = "URE_MORE_SERVICES"; - Value = "${${$ORIGIN/" PROFILENAME(uno) ":PKG_UserUnoFile}:UNO_SERVICES} ${${$ORIGIN/" PROFILENAME(uno) ":PKG_SharedUnoFile}:UNO_SERVICES} ${${$ORIGIN/" PROFILENAME(uno) ":PKG_BundledUnoFile}:UNO_SERVICES} $ORIGIN/services.rdb"; + Value = "${${$ORIGIN/" PROFILENAME(uno) ":PKG_UserUnoFile}:UNO_SERVICES} ${${$ORIGIN/" PROFILENAME(uno) ":PKG_SharedUnoFile}:UNO_SERVICES} ${${$ORIGIN/" PROFILENAME(uno) ":PKG_BundledUnoFile}:UNO_SERVICES} <$ORIGIN/services>*"; End ProfileItem gid_Brand_Profileitem_Fundamental_Ure_More_Java_Types @@ -1244,6 +1244,18 @@ ProfileItem gid_Brand_Profileitem_Fundamental_Ure_Lib_Dir #endif End +ProfileItem gid_Brand_Profileitem_Fundamental_Configuration_Layers + ProfileID = gid_Brand_Profile_Fundamental_Ini; + ModuleID = gid_Module_Root_Brand; + Section = "Bootstrap"; + Key = "CONFIGURATION_LAYERS"; + Value = "xcsxcu:${BRAND_BASE_DIR}/share/registry module:${BRAND_BASE_DIR}/share/registry/modules res:${BRAND_BASE_DIR}/share/registry bundledext:${${BRAND_BASE_DIR}/program/" PROFILENAME(uno) ":BUNDLED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini sharedext:${${BRAND_BASE_DIR}/program/" PROFILENAME(uno) ":SHARED_EXTENSIONS_USER}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini xcsxcu:${${BRAND_BASE_DIR}/program/" PROFILENAME(uno) ":UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/registry userext:${${BRAND_BASE_DIR}/program/" PROFILENAME(uno) ":UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/configmgr.ini user:${$BRAND_BASE_DIR/program/" PROFILENAME(bootstrap) ":UserInstallation}/user/registrymodifications.xcu"; + // "xcsxcu:${${BRAND_BASE_DIR}/program/"PROFILENAME(uno) + // ":UNO_USER_PACKAGES_CACHE}/registry/com.sun.star.comp.deployment." + // "configuration.PackageRegistryBackend/registry" can be dropped once + // old UserInstallation format can no longer exist (probably OOo 4) +End + #if !defined MACOSX ProfileItem gid_Brand_Profileitem_Redirect_Ure_Bootstrap ModuleID = gid_Module_Root_Brand; diff --git a/scp2/source/ooo/directory_ooo.scp b/scp2/source/ooo/directory_ooo.scp index a25b2d7f67e4..afd11a98c910 100644 --- a/scp2/source/ooo/directory_ooo.scp +++ b/scp2/source/ooo/directory_ooo.scp @@ -1435,3 +1435,13 @@ Directory gid_Dir_Template_Common_Presnt ParentID = gid_Dir_Template_Common; DosName = "presnt"; End + +Directory gid_Brand_Dir_Program_Services + ParentID = gid_Brand_Dir_Program; + DosName = "services"; +End + +Directory gid_Brand_Dir_Program_Types + ParentID = gid_Brand_Dir_Program; + DosName = "types"; +End diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp index 34ed8a90a9a1..a8e0d88ebc47 100644 --- a/scp2/source/ooo/file_ooo.scp +++ b/scp2/source/ooo/file_ooo.scp @@ -629,14 +629,14 @@ End File gid_File_Rdb_Offapi TXT_FILE_BODY; - Dir = gid_Brand_Dir_Program; + Dir = gid_Brand_Dir_Program_Types; Styles = (PACKED); Name = "offapi.rdb"; End File gid_File_Rdb_TypesVba TXT_FILE_BODY; - Dir = gid_Brand_Dir_Program; + Dir = gid_Brand_Dir_Program_Types; Styles = (PACKED, OVERWRITE); Name = "oovbaapi.rdb"; End @@ -1142,7 +1142,7 @@ End File gid_Starregistry_Services_Rdb TXT_FILE_BODY; Name = "services.rdb"; - Dir = gid_Brand_Dir_Program; + Dir = gid_Brand_Dir_Program_Services; Styles = (PACKED); End diff --git a/scp2/source/ooo/profileitem_ooo.scp b/scp2/source/ooo/profileitem_ooo.scp index 10ab481cc688..3fd83da8e391 100644 --- a/scp2/source/ooo/profileitem_ooo.scp +++ b/scp2/source/ooo/profileitem_ooo.scp @@ -103,67 +103,6 @@ End #endif -ProfileItem gid_Profileitem_Soffice_Logo - ProfileID = gid_Profile_Soffice_Ini; - ModuleID = gid_Module_Root; - Section = "Bootstrap"; - Order = 1; - Key = "Logo"; - Value = "1"; -End - -ProfileItem gid_Profileitem_Soffice_ProgressBarColor - ProfileID = gid_Profile_Soffice_Ini; - ModuleID = gid_Module_Root; - Section = "Bootstrap"; - Order = 2; - Key = "ProgressBarColor"; - Value = "0,0,128"; -End - -ProfileItem gid_Profileitem_Soffice_ProgressSize - ProfileID = gid_Profile_Soffice_Ini; - ModuleID = gid_Module_Root; - Section = "Bootstrap"; - Order = 3; - Key = "ProgressSize"; - Value = "-1,6"; -End - -ProfileItem gid_Profileitem_Soffice_ProgressPosition - ProfileID = gid_Profile_Soffice_Ini; - ModuleID = gid_Module_Root; - Section = "Bootstrap"; - Order = 4; - Key = "ProgressPosition"; - Value = "-1,-1"; -End - -ProfileItem gid_Profileitem_Soffice_NativeProgress - ProfileID = gid_Profile_Soffice_Ini; - ModuleID = gid_Module_Root; - Section = "Bootstrap"; - Order = 6; - Key = "NativeProgress"; - Value = "true"; -End - -#ifdef WNT - -ProfileItem gid_Profileitem_Soffice_Hideeula - ProfileID = gid_Profile_Soffice_Ini; - ModuleID = gid_Module_Root; - Section = "Bootstrap"; - Order = 8; - Key = "HideEula"; - Value = "[HIDEEULA]"; - Inifiletablekey = "HideEula"; - Inifiletableaction = "1"; - Styles = (INIFILETABLE); -End - -#endif - ProfileItem gid_Profileitem_Uno_Uno_Bundled_Extensions ProfileID = gid_Profile_Uno_Ini; ModuleID = gid_Module_Root; diff --git a/scp2/source/python/module_python.scp b/scp2/source/python/module_python.scp index d80bc1663a76..32f0dc8def4b 100644 --- a/scp2/source/python/module_python.scp +++ b/scp2/source/python/module_python.scp @@ -34,7 +34,28 @@ Module gid_Module_Optional_Pyuno MOD_NAME_DESC ( MODULE_OPTIONAL_PYTHON ); ParentID = gid_Module_Optional; Sortkey = "750"; + Dirs = (gid_Dir_PythonFramework, + gid_Dir_PythonFramework_Versions, + gid_Dir_PythonFramework_Versions_ver, + gid_Dir_PythonFramework_Versions_ver_bin, + gid_Dir_PythonFramework_Versions_ver_lib, + gid_Dir_PythonFramework_Versions_ver_lib_pythonver, + gid_Dir_PythonFramework_Versions_ver_lib_pythonver_config); Files = (gid_File_Pyuno,gid_File_Lib_Pyuno,gid_File_Lib_Pythonloader,gid_File_Py_Unohelper,gid_File_Py_Officehelper,gid_File_Py_Uno,gid_File_Py_Pythonloader,gid_File_Py_Python_Core,gid_File_Py_Python_Bin,gid_File_Lib_Python_So,gid_Shortcut_Lib_Python_So,gid_File_Scripts_Python,gid_File_Share_Registry_Pyuno_Xcd); + Unixlinks = (gid_Unixlink_Python_Headers, + gid_Unixlink_Python_Resources, + gid_Unixlink_Python_Versions_Current, + gid_Unixlink_Python_Versions_ver_Headers, + gid_Unixlink_Python_OOoPython, + gid_Unixlink_Python_bin_idle, + gid_Unixlink_Python_bin_pydoc, + gid_Unixlink_Python_bin_python_real, + gid_Unixlink_Python_bin_python, + gid_Unixlink_Python_bin_pythonconfig, + gid_Unixlink_Python_bin_pythonw_real, + gid_Unixlink_Python_bin_pythonw, + gid_Unixlink_Python_bin_smtpdpy, + gid_Unixlink_Python_libpython); Minimal = NO; Default = YES; Styles = ( ); diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 0e79d610ddc0..e862c3c0b7fa 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1897,21 +1897,17 @@ private: ::std::vector<sal_uInt16> aPageIndices; sal_uInt16 nPrinterPageIndex = 0; StringRangeEnumerator::Iterator it = aRangeEnum.begin(), itEnd = aRangeEnum.end(); - bool bLastLoop = false; + bool bLastLoop = (it == itEnd); while (!bLastLoop) { - if (it != itEnd) - { - sal_Int32 nPageIndex = *it; - ++it; - if (GetFilteredPage(nPageIndex, PK_STANDARD) == NULL) - continue; + sal_Int32 nPageIndex = *it; + ++it; + bLastLoop = (it == itEnd); + + if (GetFilteredPage(nPageIndex, PK_STANDARD)) aPageIndices.push_back(nPageIndex); - } - else - { - bLastLoop = true; - } + else if (!bLastLoop) + continue; // Create a printer page when we have found one page for each // placeholder or when this is the last (and special) loop. diff --git a/sdext/source/minimizer/help/component.txt b/sdext/source/minimizer/description-en-US.txt index 98f2687800ff..98f2687800ff 100755..100644 --- a/sdext/source/minimizer/help/component.txt +++ b/sdext/source/minimizer/description-en-US.txt diff --git a/sdext/source/minimizer/description.xml b/sdext/source/minimizer/description.xml index f8762c7fee7b..eef22a750af6 100644 --- a/sdext/source/minimizer/description.xml +++ b/sdext/source/minimizer/description.xml @@ -28,7 +28,7 @@ </icon> <extension-description> - <src xlink:href="help/component.txt" lang="en-US" /> + <src xlink:href="description-en-US.txt" lang="en-US" /> </extension-description> </description> diff --git a/sdext/source/minimizer/makefile.mk b/sdext/source/minimizer/makefile.mk index fcca6aa3a37c..7932e59949fe 100644 --- a/sdext/source/minimizer/makefile.mk +++ b/sdext/source/minimizer/makefile.mk @@ -103,11 +103,15 @@ COMPONENT_IMAGES=\ # rather freestyle or common to all? COMPONENT_HELP= \ $(EXTENSIONDIR)$/help$/help_de.odt \ - $(EXTENSIONDIR)$/help$/help_en-US.odt \ - $(EXTENSIONDIR)$/help$/component.txt + $(EXTENSIONDIR)$/help$/help_en-US.odt + +DESCRIPTION_SRC:=$(MISC)/$(EXTENSIONNAME)_in/description.xml + +COMPONENT_DESCRIPTION= \ + $(foreach,lang,$(alllangiso) $(EXTENSIONDIR)$/description-$(lang).txt) # make sure to add your custom files here -EXTENSION_PACKDEPS=$(COMPONENT_BITMAPS) $(COMPONENT_IMAGES) $(COMPONENT_HELP) +EXTENSION_PACKDEPS=$(COMPONENT_BITMAPS) $(COMPONENT_IMAGES) $(COMPONENT_HELP) $(COMPONENT_DESCRIPTION) ZIP2TARGET= presentation_minimizer_develop .IF "$(WITH_LANG)"!="" @@ -143,4 +147,18 @@ $(COMPONENT_HELP) : help$/$$(@:f) @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ +$(DESCRIPTION_SRC) : description.xml + @@-$(MKDIRHIER) $(@:d) +.IF "$(WITH_LANG)" != "" + $(COMMAND_ECHO)$(XRMEX) -p $(PRJNAME) -i $< -o $@ -m $(LOCALIZESDF) -l all +.ELSE + $(COPY) $< $@ +.ENDIF + +$(COMPONENT_DESCRIPTION) : $(DESCRIPTION) + $(COPY) description-en-US.txt $(EXTENSIONDIR) +.IF "$(WITH_LANG)" != "" + $(COPY) $(MISC)/$(EXTENSIONNAME)_in/description-*.txt $(EXTENSIONDIR) +.ENDIF + .ENDIF # L10N_framework diff --git a/sdext/source/pdfimport/config/component.txt b/sdext/source/pdfimport/description-en-US.txt index 969581ef2fbf..0cde58a8ad50 100644 --- a/sdext/source/pdfimport/config/component.txt +++ b/sdext/source/pdfimport/description-en-US.txt @@ -1 +1 @@ -The PDF Import Extension allows you to import and modify PDF documents. Best results with 100% layout accuracy can be achieved with the "PDF/ODF hybrid file" format, which this extension also enables. A hybrid PDF/ODF file is a PDF file that contains an embedded ODF source file. Hybrid PDF/ODF files will be opened in OpenOffice.org as an ODF file without any layout changes. +The PDF Import Extension allows you to import and modify PDF documents. Best results with 100% layout accuracy can be achieved with the "PDF/ODF hybrid file" format, which this extension also enables. A hybrid PDF/ODF file is a PDF file that contains an embedded ODF source file. Hybrid PDF/ODF files will be opened in LibreOffice as an ODF file without any layout changes. diff --git a/sdext/source/pdfimport/config/description.xml b/sdext/source/pdfimport/description.xml index ac0d50286cab..503753af178c 100644 --- a/sdext/source/pdfimport/config/description.xml +++ b/sdext/source/pdfimport/description.xml @@ -27,7 +27,7 @@ </icon> <extension-description> - <src xlink:href="component.txt" lang="en-US" /> + <src xlink:href="description-en-US.txt" lang="en-US" /> </extension-description> </description> diff --git a/sdext/source/pdfimport/makefile.mk b/sdext/source/pdfimport/makefile.mk index 02d22132efe5..8e0dfa0b48c2 100644 --- a/sdext/source/pdfimport/makefile.mk +++ b/sdext/source/pdfimport/makefile.mk @@ -97,7 +97,7 @@ DEF1NAME=$(SHL1TARGET) # --- Extension packaging ------------------------------------------ -DESCRIPTION_SRC:=config$/description.xml +DESCRIPTION_SRC:=$(MISC)/$(EXTENSIONNAME)_in/description.xml MANIFEST_SRC:=config$/manifest.xml COMPONENT_CONFIGDIR:=config COMPONENT_CONFIGDEST:=. @@ -117,8 +117,8 @@ COMPONENT_DIALOGS= \ $(EXTENSIONDIR)$/basic$/writer.png \ $(EXTENSIONDIR)$/xpdfimport_err.pdf -COMPONENT_HELP= \ - $(EXTENSIONDIR)$/component.txt +COMPONENT_DESCRIPTION= \ + $(foreach,lang,$(alllangiso) $(EXTENSIONDIR)$/description-$(lang).txt) # native libraries COMPONENT_LIBRARIES= \ @@ -127,7 +127,7 @@ COMPONENT_LIBRARIES= \ COMPONENT_IMAGES=\ $(EXTENSIONDIR)$/images$/extension_32.png -EXTENSION_PACKDEPS=$(CONVERTER_FILE) $(COMPONENT_DIALOGS) $(COMPONENT_HELP) $(COMPONENT_IMAGES) makefile.mk +EXTENSION_PACKDEPS=$(CONVERTER_FILE) $(COMPONENT_DIALOGS) $(COMPONENT_DESCRIPTION) $(COMPONENT_IMAGES) makefile.mk .INCLUDE : extension_pre.mk .ENDIF # L10N_framework @@ -135,18 +135,28 @@ EXTENSION_PACKDEPS=$(CONVERTER_FILE) $(COMPONENT_DIALOGS) $(COMPONENT_HELP) $(CO .IF "$(L10N_framework)"=="" .INCLUDE : extension_post.mk -$(CONVERTER_FILE) : $(BIN)$/$$(@:f) +$(DESCRIPTION_SRC) : description.xml @@-$(MKDIRHIER) $(@:d) +.IF "$(WITH_LANG)" != "" + $(COMMAND_ECHO)$(XRMEX) -p $(PRJNAME) -i $< -o $@ -m $(LOCALIZESDF) -l all +.ELSE $(COPY) $< $@ +.ENDIF -$(COMPONENT_DIALOGS) : dialogs$/$$(@:f) +$(CONVERTER_FILE) : $(BIN)$/$$(@:f) @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ -$(COMPONENT_HELP) : config$/$$(@:f) +$(COMPONENT_DIALOGS) : dialogs$/$$(@:f) @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ +$(COMPONENT_DESCRIPTION) : $(DESCRIPTION) + $(COPY) description-en-US.txt $(EXTENSIONDIR) +.IF "$(WITH_LANG)" != "" + $(COPY) $(MISC)/$(EXTENSIONNAME)_in/description-*.txt $(EXTENSIONDIR) +.ENDIF + $(COMPONENT_IMAGES) : $(SOLARSRC)$/$(RSCDEFIMG)$/desktop$/res$/$$(@:f) @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ diff --git a/sdext/source/presenter/help/component.txt b/sdext/source/presenter/description-en-US.txt index 26a10c622fe9..26a10c622fe9 100755..100644 --- a/sdext/source/presenter/help/component.txt +++ b/sdext/source/presenter/description-en-US.txt diff --git a/sdext/source/presenter/description.xml b/sdext/source/presenter/description.xml index bf9ce7260751..22e51199bf09 100644 --- a/sdext/source/presenter/description.xml +++ b/sdext/source/presenter/description.xml @@ -28,7 +28,7 @@ </icon> <extension-description> - <src xlink:href="help/component.txt" lang="en-US" /> + <src xlink:href="description-en-US.txt" lang="en-US" /> </extension-description> </description> diff --git a/sdext/source/presenter/makefile.mk b/sdext/source/presenter/makefile.mk index 1afbb1e68093..9ced62ec2dad 100644 --- a/sdext/source/presenter/makefile.mk +++ b/sdext/source/presenter/makefile.mk @@ -247,9 +247,11 @@ COMPONENT_LIBRARY= \ PLATFORMID:=$(RTL_OS:l)_$(RTL_ARCH:l) COMPONENT_HELP= \ - $(ZIP1DIR)$/help/component.txt \ $(foreach,l,$(alllangiso) $(ZIP1DIR)$/help$/$l$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp) +COMPONENT_DESCRIPTION= \ + $(foreach,lang,$(alllangiso) $(ZIP1DIR)$/description-$(lang).txt) + ZIP1DEPS= \ $(DESCRIPTION) \ $(COMPONENT_MANIFEST) \ @@ -257,6 +259,7 @@ ZIP1DEPS= \ $(COMPONENT_BITMAPS) \ $(COMPONENT_IMAGES) \ $(COMPONENT_LIBRARY) \ + $(COMPONENT_DESCRIPTION) \ $(COMPONENT_HELP) LINKNAME:=help @@ -284,10 +287,6 @@ $(COMPONENT_MANIFEST) : $$(@:f) @-$(MKDIRHIER) $(@:d) +$(TYPE) $< | $(SED) "s/SHARED_EXTENSION/$(DLLPOST)/" > $@ -$(ZIP1DIR)$/help$/component.txt : help$/$$(@:f) - @@-$(MKDIRHIER) $(@:d) - $(COPY) $< $@ - $(ZIP1DIR)$/help$/%$/com.sun.PresenterScreen-$(PLATFORMID)$/presenter.xhp : $(COMMONMISC)$/%$/com.sun.PresenterScreen$/presenter.xhp @echo creating $@ @-$(MKDIRHIER) $(@:d) @@ -351,7 +350,7 @@ $(COMPONENT_LIBRARY) : $(DLLDEST)$/$$(@:f) .ENDIF #"$(COM)"=="GCC" .ENDIF #"$(OS)$(CPU)"=="WNTI" && "$(WITH_EXTENSION_INTEGRATION)"!="YES" - +$(COMPONENT_DESCRIPTION) : $(DESCRIPTION) $(ZIP1DIR)/%.xcu : %.xcu @@-$(MKDIRHIER) $(@:d) @@ -368,7 +367,14 @@ PHONYDESC=.PHONY $(DESCRIPTION) $(PHONYDESC) : $$(@:f) @-$(MKDIRHIER) $(@:d) @echo LAST_WITH_LANG=$(WITH_LANG) > $(ZIP1DIR)_lang_track.mk - $(TYPE) description.xml | sed s/UPDATED_PLATFORM/$(PLATFORMID)/ > $@ + $(GNUCOPY) description-en-US.txt $(ZIP1DIR)/description-en-US.txt +.IF "$(WITH_LANG)" != "" + $(XRMEX) -p $(PRJNAME) -i description.xml -o $@ -m $(LOCALIZESDF) -l all + sed s/UPDATED_PLATFORM/$(PLATFORMID)/ < $@ > $@.new + mv $@.new $@ +.ELSE + sed s/UPDATED_PLATFORM/$(PLATFORMID)/ < description.xml > $@ +.ENDIF ALLTAR: $(MISC)/../bin/presenter-screen.oxt # hotfix to missing localizations diff --git a/set_soenv.in b/set_soenv.in index dc2d996c2b5a..6a97b454a1cc 100755 --- a/set_soenv.in +++ b/set_soenv.in @@ -1476,7 +1476,7 @@ ToFile( "BUILD_MOZAB", "@BUILD_MOZAB@", "e" ); ToFile( "PREBUILD_MOZAB", $PREBUILD_MOZAB, "e" ); ToFile( "MOZILLA_VERSION", $MOZILLA_VERSION, "e" ); ToFile( "DEFAULT_MOZILLA_TOOLKIT", $MOZILLA_TOOLKIT, "e" ); -ToFile( "ENABLE_NSS_MODULE", "@ENABLE_NSS_MODULE@", "e" ); +ToFile( "SYSTEM_NSS", "@SYSTEM_NSS@", "e" ); ToFile( "MOZILLABUILD", "@MOZILLABUILD@", "e" ); ToFile( "BUILD_VER_STRING", "@BUILD_VER_STRING@", "e" ); if ($platform =~ m/linux/ && $platform =~ m/powerpc/) { @@ -1530,6 +1530,8 @@ ToFile( "COMMONS_LOGGING_JAR","@COMMONS_LOGGING_JAR@","e" ); ToFile( "SYSTEM_SERVLETAPI", "@SYSTEM_SERVLETAPI@", "e" ); ToFile( "SERVLETAPI_JAR", "@SERVLETAPI_JAR@", "e" ); ToFile( "ENABLE_DBUS", "@ENABLE_DBUS@", "e" ); +ToFile( "DBUS_CFLAGS", "@DBUS_CFLAGS@", "e" ); +ToFile( "DBUS_LIBS", "@DBUS_LIBS@", "e" ); ToFile( "ENABLE_GCONF", "@ENABLE_GCONF@", "e" ); ToFile( "ENABLE_GNOMEVFS", "@ENABLE_GNOMEVFS@", "e" ); ToFile( "ENABLE_GSTREAMER", "@ENABLE_GSTREAMER@", "e" ); @@ -1805,19 +1807,17 @@ ToFile( "DICT_SYSTEM_DIR", "@DICT_SYSTEM_DIR@", "e"); ToFile( "HYPH_SYSTEM_DIR", "@HYPH_SYSTEM_DIR@", "e"); ToFile( "THES_SYSTEM_DIR", "@THES_SYSTEM_DIR@", "e"); ToFile( "ENABLE_LOCKDOWN", "@ENABLE_LOCKDOWN@", "e" ); +ToFile( "ENABLE_XMLSEC", "@ENABLE_XMLSEC@", "e" ); ToFile( "WITH_LDAP", "@WITH_LDAP@", "e" ); ToFile( "WITH_OPENLDAP", "@WITH_OPENLDAP@", "e" ); ToFile( "WITH_MOZILLA", "@WITH_MOZILLA@", "e" ); ToFile( "SYSTEM_MOZILLA", "@SYSTEM_MOZILLA@", "e" ); ToFile( "MOZ_FLAVOUR", "@MOZ_FLAVOUR@", "e" ); -ToFile( "NSPR_LIB", "@NSPR_LIB@", "e" ); -ToFile( "NSS_LIB", "@NSS_LIB@", "e" ); +ToFile( "NSS_LIBS", "@NSS_LIBS@", "e" ); +ToFile( "NSS_CFLAGS", "@NSS_CFLAGS@", "e" ); ToFile( "MOZ_INC", "@MOZ_INC@", "e" ); ToFile( "MOZ_LIB", "@MOZ_LIB@", "e" ); ToFile( "MOZ_LIB_XPCOM", "@MOZ_LIB_XPCOM@", "e" ); -ToFile( "MOZ_NSPR_CFLAGS", "@MOZ_NSPR_CFLAGS@", "e" ); -ToFile( "MOZ_NSS_CFLAGS", "@MOZ_NSS_CFLAGS@", "e" ); -ToFile( "MOZ_NSS_LIBS", "@MOZ_NSS_LIBS@", "e" ); ToFile( "MOZ_LDAP_CFLAGS", "@MOZ_LDAP_CFLAGS@", "e" ); ToFile( "OOOP_GALLERY_PACK", "@OOOP_GALLERY_PACK@","e" ); ToFile( "OOOP_TEMPLATES_PACK", "@OOOP_TEMPLATES_PACK@","e" ); diff --git a/setup_native/source/mac/ooo/DS_Store b/setup_native/source/mac/ooo/DS_Store Binary files differindex 9431578cebb3..fec0edc61bc5 100644 --- a/setup_native/source/mac/ooo/DS_Store +++ b/setup_native/source/mac/ooo/DS_Store diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx index 87c32f5a3c9d..c255035f8f03 100644 --- a/sfx2/inc/sfx2/app.hxx +++ b/sfx2/inc/sfx2/app.hxx @@ -88,7 +88,6 @@ class SfxViewShellArr_Impl; class StarBASIC; class SfxWorkWindow; class SfxFilterMatcher; -class SvUShorts; class SfxModule; class SfxModuleArr_Impl; class Window; @@ -269,7 +268,7 @@ public: SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl(const SfxViewFrame *pFrame=0) const; // TODO/CLEANUP: still needed? - SAL_DLLPRIVATE SvUShorts* GetDisabledSlotList_Impl(); + SAL_DLLPRIVATE std::vector<sal_uInt16>* GetDisabledSlotList_Impl(); SAL_DLLPRIVATE SfxSlotPool& GetAppSlotPool_Impl() const; SAL_DLLPRIVATE SfxModule* GetModule_Impl(); SAL_DLLPRIVATE ResMgr* GetOffResManager_Impl(); diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx index 0ce4f2ba16c4..0591d1fb5c9a 100644 --- a/sfx2/inc/sfx2/dispatch.hxx +++ b/sfx2/inc/sfx2/dispatch.hxx @@ -34,9 +34,6 @@ #include <stdarg.h> -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> // SvUShorts - #include <sfx2/bindings.hxx> #include <sfx2/viewfrm.hxx> diff --git a/sfx2/inc/sfx2/evntconf.hxx b/sfx2/inc/sfx2/evntconf.hxx index 89fef8d61687..5bb5f17453e9 100644 --- a/sfx2/inc/sfx2/evntconf.hxx +++ b/sfx2/inc/sfx2/evntconf.hxx @@ -35,8 +35,6 @@ #include <vcl/fixed.hxx> #include <vcl/button.hxx> -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> // SvUShorts #include <sfx2/event.hxx> #include <sfx2/sfxsids.hrc> diff --git a/sfx2/inc/sfx2/macrconf.hxx b/sfx2/inc/sfx2/macrconf.hxx index 60692b4c49a6..1957b11f5cac 100644 --- a/sfx2/inc/sfx2/macrconf.hxx +++ b/sfx2/inc/sfx2/macrconf.hxx @@ -32,8 +32,6 @@ #include "sfx2/dllapi.h" #include "sal/types.h" #include <tools/errcode.hxx> -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> // SvUShorts #include <sfx2/evntconf.hxx> class SfxMacroInfo; @@ -106,7 +104,7 @@ friend class SfxEventConfiguration; SAL_DLLPRIVATE static SfxMacroConfig* pMacroConfig; SfxMacroConfig_Impl* pImp; - SvUShorts aIdArray; + std::vector<sal_uInt16> aIdArray; public: SfxMacroConfig(); diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index fffecd3f348e..6e76d4428175 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -170,10 +170,10 @@ SfxProgress* SfxApplication::GetProgress() const //------------------------------------------------------------------------ -SvUShorts* SfxApplication::GetDisabledSlotList_Impl() +std::vector<sal_uInt16>* SfxApplication::GetDisabledSlotList_Impl() { sal_Bool bError = sal_False; - SvUShorts* pList = pAppData_Impl->pDisabledSlotList; + std::vector<sal_uInt16>* pList = pAppData_Impl->pDisabledSlotList; if ( !pList ) { // Is there a slot file? @@ -200,13 +200,13 @@ SvUShorts* SfxApplication::GetDisabledSlotList_Impl() sal_uInt16 nCount; (*pStream) >> nCount; pList = pAppData_Impl->pDisabledSlotList = - new SvUShorts( nCount < 255 ? (sal_Int8) nCount : 255, 255 ); + new std::vector<sal_uInt16>; sal_uInt16 nSlot; for ( sal_uInt16 n=0; n<nCount; n++ ) { (*pStream) >> nSlot; - pList->Insert( nSlot, n ); + pList->push_back( nSlot ); } pStream->ReadByteString(aTitle); @@ -231,13 +231,13 @@ SvUShorts* SfxApplication::GetDisabledSlotList_Impl() delete pStream; } - else if ( pList == (SvUShorts*) -1L ) + else if ( pList == (std::vector<sal_uInt16>*) -1L ) { return NULL; } if ( !pList ) - pAppData_Impl->pDisabledSlotList = (SvUShorts*) -1L; + pAppData_Impl->pDisabledSlotList = (std::vector<sal_uInt16>*) -1L; if ( bError ) { @@ -280,72 +280,12 @@ sal_Bool SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; } SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return pAppData_Impl->pAppDispat; } SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pAppData_Impl->pSlotPool; } -static bool impl_loadBitmap( - const rtl::OUString &rPath, const rtl::OUString &rBmpFileName, - Image &rLogo ) -{ - rtl::OUString uri( rPath ); - rtl::Bootstrap::expandMacros( uri ); - INetURLObject aObj( uri ); - aObj.insertName( rBmpFileName ); - SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ ); - if ( !aStrm.GetError() ) - { - // Use graphic class to also support more graphic formats (bmp,png,...) - Graphic aGraphic; - - GraphicFilter& rGF = GraphicFilter::GetGraphicFilter(); - rGF.ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW ); - - // Default case, we load the intro bitmap from a seperate file - // (e.g. staroffice_intro.bmp or starsuite_intro.bmp) - BitmapEx aBmp = aGraphic.GetBitmapEx(); - rLogo = Image( aBmp ); - return true; - } - return false; -} - /** loads the application logo as used in the about dialog and impress slideshow pause screen */ Image SfxApplication::GetApplicationLogo() { - Image aAppLogo; - - rtl::OUString aAbouts; - bool bLoaded = false; - sal_Int32 nIndex = 0; - do - { - bLoaded = impl_loadBitmap( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program")), - aAbouts.getToken( 0, ',', nIndex ), aAppLogo ); - } - while ( !bLoaded && ( nIndex >= 0 ) ); - - // fallback to "about.bmp" - if ( !bLoaded ) - { - bLoaded = impl_loadBitmap( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/edition")), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about.png")), aAppLogo ); - if ( !bLoaded ) - bLoaded = impl_loadBitmap( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/edition")), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about.bmp")), aAppLogo ); - } - - if ( !bLoaded ) - { - bLoaded = impl_loadBitmap( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program")), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about.png")), aAppLogo ); - if ( !bLoaded ) - bLoaded = impl_loadBitmap( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program")), - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about.bmp")), aAppLogo ); - } - - return aAppLogo; + BitmapEx aBitmap; + Application::LoadBrandBitmap ("about", aBitmap); + return Image( aBitmap ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index bdd2c417a36e..2ea9a9f2d922 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -516,18 +516,18 @@ sal_uInt16 ChildTravelValue( SfxChildAlignment eAlign ) void SfxWorkWindow::Sort_Impl() { - aSortedList.Remove(0, aSortedList.Count()); + aSortedList.clear(); for (sal_uInt16 i=0; i<pChilds->Count(); i++) { SfxChild_Impl *pCli = (*pChilds)[i]; if (pCli) { sal_uInt16 k; - for (k=0; k<aSortedList.Count(); k++) + for (k=0; k<aSortedList.size(); k++) if (ChildAlignValue((*pChilds)[aSortedList[k]]->eAlign) > ChildAlignValue(pCli->eAlign)) break; - aSortedList.Insert (i,k); + aSortedList.insert( aSortedList.begin() + k, i ); } } @@ -825,7 +825,7 @@ SvBorder SfxWorkWindow::Arrange_Impl() Size aSize; Rectangle aTmp( aClientArea ); - for ( sal_uInt16 n=0; n<aSortedList.Count(); ++n ) + for ( sal_uInt16 n=0; n<aSortedList.size(); ++n ) { SfxChild_Impl* pCli = (*pChilds)[aSortedList[n]]; if ( !pCli->pWin ) @@ -1786,7 +1786,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, SfxChild_Impl *pChild = 0; sal_uInt16 n; - for ( n=0; n<aSortedList.Count(); ++n ) + for ( n=0; n<aSortedList.size(); ++n ) { pChild = (*pChilds)[aSortedList[n]]; if ( pChild ) @@ -1794,7 +1794,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, break; } - if ( n < aSortedList.Count() ) + if ( n < aSortedList.size() ) // sometimes called while toggeling float mode nPos = aSortedList[n]; @@ -1812,7 +1812,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, // The current affected window is included in the calculation of // the inner rectangle! - for ( sal_uInt16 m=0; m<aSortedList.Count(); ++m ) + for ( sal_uInt16 m=0; m<aSortedList.size(); ++m ) { sal_uInt16 i=aSortedList[m]; SfxChild_Impl* pCli = (*pChilds)[i]; @@ -2542,7 +2542,7 @@ void SfxWorkWindow::MakeChildsVisible_Impl( sal_Bool bVis ) { if ( !bSorted ) Sort_Impl(); - for ( sal_uInt16 n=0; n<aSortedList.Count(); ++n ) + for ( sal_uInt16 n=0; n<aSortedList.size(); ++n ) { SfxChild_Impl* pCli = (*pChilds)[aSortedList[n]]; if ( (pCli->eAlign == SFX_ALIGN_NOALIGNMENT) || (IsDockingAllowed() && bInternalDockingAllowed) ) @@ -2553,7 +2553,7 @@ void SfxWorkWindow::MakeChildsVisible_Impl( sal_Bool bVis ) { if ( !bSorted ) Sort_Impl(); - for ( sal_uInt16 n=0; n<aSortedList.Count(); ++n ) + for ( sal_uInt16 n=0; n<aSortedList.size(); ++n ) { SfxChild_Impl* pCli = (*pChilds)[aSortedList[n]]; pCli->nVisible &= ~CHILD_ACTIVE; @@ -2761,37 +2761,37 @@ void SfxWorkWindow::SetActiveChild_Impl( Window *pChild ) sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward ) { // Sort all children under list - SvUShorts aList; + std::vector<sal_uInt16> aList; for ( sal_uInt16 i=SFX_OBJECTBAR_MAX; i<pChilds->Count(); i++) { SfxChild_Impl *pCli = (*pChilds)[i]; if ( pCli && pCli->bCanGetFocus && pCli->pWin ) { sal_uInt16 k; - for (k=0; k<aList.Count(); k++) + for (k=0; k<aList.size(); k++) if ( ChildTravelValue((*pChilds)[aList[k]]->eAlign) > ChildTravelValue(pCli->eAlign) ) break; - aList.Insert(i,k); + aList.insert( aList.begin() + k, i ); } } - if ( aList.Count() == 0 ) + if ( aList.empty() ) return sal_False; sal_uInt16 nTopValue = ChildTravelValue( SFX_ALIGN_LOWESTTOP ); - for ( sal_uInt16 i=0; i<aList.Count(); i++ ) + for ( sal_uInt16 i=0; i<aList.size(); i++ ) { SfxChild_Impl* pCli = (*pChilds)[aList[i]]; if ( pCli->pWin && ChildTravelValue( pCli->eAlign ) > nTopValue ) break; } - sal_uInt16 n = bForward ? 0 : aList.Count()-1; + sal_uInt16 n = bForward ? 0 : aList.size()-1; SfxChild_Impl *pAct=NULL; if ( pActiveChild ) { // Look for the active window - for ( n=0; n<aList.Count(); n++ ) + for ( n=0; n<aList.size(); n++ ) { SfxChild_Impl* pCli = (*pChilds)[aList[n]]; if ( pCli && pCli->pWin && ( pCli->pWin == pActiveChild || !pActiveChild ) ) @@ -2803,8 +2803,8 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward ) } // dummy entries for the container window - aList.Insert( 0xFFFF, 0 ); - aList.Insert( 0xFFFF, aList.Count() ); + aList.insert( aList.begin(), 0xFFFF ); + aList.push_back( 0xFFFF ); n = n + 1; if ( pAct ) { @@ -2827,7 +2827,7 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward ) else n = n-1; - if ( n == 0 || n == aList.Count()-1 ) + if ( n == 0 || n == aList.size()-1 ) return sal_False; } @@ -2865,7 +2865,7 @@ sal_Bool SfxWorkWindow::ActivateNextChild_Impl( sal_Bool bForward ) else n = n-1; - if ( n == 0 || n == aList.Count()-1 ) + if ( n == 0 || n == aList.size()-1 ) break; } diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 63add660c327..2d347781f585 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -988,7 +988,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl( { aResult = xTypeCFG->getByName( sType ); } - catch( ::com::sun::star::container::NoSuchElementException& ) + catch (const ::com::sun::star::container::NoSuchElementException&) { aResult = ::com::sun::star::uno::Any(); } @@ -1156,7 +1156,7 @@ void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate ) } } } - catch( ::com::sun::star::uno::Exception& ) + catch(const ::com::sun::star::uno::Exception&) { DBG_ASSERT( sal_False, "SfxFilterContainer::ReadFilter()\nException detected. Possible not all filters could be cached.\n" ); } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 5aa16e163ff7..8df3b4a00a6a 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -164,7 +164,7 @@ struct SfxDispatcher_Impl sal_uInt16 nFilterCount; // Number of SIDs in pFilterSIDs const sal_uInt16* pFilterSIDs; // sorted Array of SIDs sal_uInt16 nStandardMode; // ExecuteMode from PlugInDispatcher - SvUShorts* pDisableList; + std::vector<sal_uInt16>* pDisableList; sal_uInt32 nDisableFlags; }; @@ -2498,8 +2498,8 @@ sal_Bool SfxDispatcher::IsAllowed } // BinSearch in the disable list - SvUShorts& rList = *pImp->pDisableList; - sal_uInt16 nCount = rList.Count(); + std::vector<sal_uInt16>& rList = *pImp->pDisableList; + sal_uInt16 nCount = rList.size(); sal_uInt16 nLow = 0, nMid = 0, nHigh; sal_Bool bFound = sal_False; nHigh = nCount - 1; diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx index 1464ffe0abed..c02dc8fd45a6 100644 --- a/sfx2/source/control/macrconf.cxx +++ b/sfx2/source/control/macrconf.cxx @@ -447,7 +447,7 @@ sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) if (i == nCount) { // Macro still unknown - nCount = aIdArray.Count(); + nCount = aIdArray.size(); sal_uInt16 n; for (n=0; n<nCount; n++) // Seearch for free SlotId if (aIdArray[n] > SID_MACRO_START + n) @@ -456,7 +456,7 @@ sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo) sal_uInt16 nNewSlotId = SID_MACRO_START + n; if ( nNewSlotId > SID_MACRO_END ) return 0; - aIdArray.Insert( SID_MACRO_START + n, n ); + aIdArray.insert( aIdArray.begin() + n, SID_MACRO_START + n ); SfxSlot *pNewSlot = new SfxSlot; pNewSlot->nSlotId = SID_MACRO_START + n; @@ -531,12 +531,12 @@ void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId) pImp->aArr.Remove(i); // Release SlotId again - sal_uInt16 nIdCount = aIdArray.Count(); + sal_uInt16 nIdCount = aIdArray.size(); for (sal_uInt16 n=0; n<nIdCount; n++) { if (aIdArray[n] == nId) { - aIdArray.Remove(n); + aIdArray.erase( aIdArray.begin() + n ); break; } } diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index e1d90733c480..84e9a8a6d1a0 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -148,7 +148,7 @@ void SfxModalDialog::GetDialogData_Impl() if ( aDlgOpt.Exists() ) { // load settings - SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) ); + SetWindowState( rtl::OUStringToOString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) ); Any aUserItem = aDlgOpt.GetUserItem( USERITEM_NAME ); OUString aTemp; if ( aUserItem >>= aTemp ) diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 57e60136b617..2390c005f86d 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -31,12 +31,10 @@ #include <limits.h> #include <stdlib.h> +#include <algorithm> #include <vcl/msgbox.hxx> #include <unotools/viewoptions.hxx> -#define _SVSTDARR_sal_uInt16S -#include <svl/svstdarr.hxx> - #include "appdata.hxx" #include "sfxtypes.hxx" #include <sfx2/minarray.hxx> @@ -738,7 +736,7 @@ void SfxTabDialog::Start_Impl() if ( aDlgOpt.Exists() ) { #if !ENABLE_LAYOUT_SFX_TABDIALOG - SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) ); + SetWindowState(rtl::OUStringToOString(aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US)); #endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */ // initial TabPage from Program/Help/config @@ -1453,19 +1451,6 @@ IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl ) // ----------------------------------------------------------------------- -extern "C" int SAL_CALL TabDlgCmpUS_Impl( const void* p1, const void* p2 ) - -/* [Description] - - Comparison function for qsort -*/ - -{ - return *(sal_uInt16*)p1 - *(sal_uInt16*)p2; -} - -// ----------------------------------------------------------------------- - void SfxTabDialog::ShowPage( sal_uInt16 nId ) /* [Description] @@ -1509,7 +1494,7 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool ) if ( pRanges ) return pRanges; - SvUShorts aUS( 16, 16 ); + std::vector<sal_uInt16> aUS; sal_uInt16 nCount = pImpl->pData->Count(); sal_uInt16 i; @@ -1525,26 +1510,27 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool ) sal_uInt16 nLen; for( nLen = 0; *pIter; ++nLen, ++pIter ) ; - aUS.Insert( pTmpRanges, nLen, aUS.Count() ); + aUS.insert( aUS.end(), pTmpRanges, pTmpRanges + nLen ); } } //! Remove duplicated Ids? { - nCount = aUS.Count(); + nCount = aUS.size(); for ( i = 0; i < nCount; ++i ) aUS[i] = rPool.GetWhich( aUS[i] ); } // sort - if ( aUS.Count() > 1 ) - qsort( (void*)aUS.GetData(), - aUS.Count(), sizeof(sal_uInt16), TabDlgCmpUS_Impl ); + if ( aUS.size() > 1 ) + { + std::sort( aUS.begin(), aUS.end() ); + } - pRanges = new sal_uInt16[aUS.Count() + 1]; - memcpy(pRanges, aUS.GetData(), sizeof(sal_uInt16) * aUS.Count()); - pRanges[aUS.Count()] = 0; + pRanges = new sal_uInt16[aUS.size() + 1]; + std::copy( aUS.begin(), aUS.end(), pRanges ); + pRanges[aUS.size()] = 0; return pRanges; } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index df6f09d76322..c9252483c975 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -2796,7 +2796,7 @@ void SfxTemplateCatalog_Impl::CheckItem(sal_uInt16 nMesId, sal_Bool /*bCheck*/) if ( nMesId > SFX_STYLE_FAMILY_PSEUDO || nMesId < SFX_STYLE_FAMILY_CHAR ) return; sal_uInt16 i; - for ( i = 0; i < aFamIds.Count() && aFamIds[i] != nMesId; i++ ) ; + for ( i = 0; i < aFamIds.size() && aFamIds[i] != nMesId; i++ ) ; aFamList.SelectEntryPos(i); } @@ -2807,7 +2807,7 @@ sal_Bool SfxTemplateCatalog_Impl::IsCheckedItem(sal_uInt16 nMesId) if ( nMesId > SFX_STYLE_FAMILY_PSEUDO || nMesId < SFX_STYLE_FAMILY_CHAR ) return sal_False; sal_uInt16 i; - for ( i = 0; i < aFamIds.Count() && aFamIds[i] != nMesId; i++ ) + for ( i = 0; i < aFamIds.size() && aFamIds[i] != nMesId; i++ ) ; return aFamList.IsEntrySelected( String::CreateFromInt32(i) ); } @@ -2818,10 +2818,10 @@ sal_Bool SfxTemplateCatalog_Impl::IsCheckedItem(sal_uInt16 nMesId) void SfxTemplateCatalog_Impl::EnableFamilyItem( sal_uInt16 nId, sal_Bool bEnable ) { if ( !bEnable ) - for ( sal_uInt16 nPos = aFamIds.Count(); nPos--; ) + for ( sal_uInt16 nPos = aFamIds.size(); nPos--; ) if ( aFamIds[ nPos ] == nId ) { - aFamIds.Remove( nPos ); + aFamIds.erase( aFamIds.begin() + nPos ); aFamList.RemoveEntry( nPos ); } } @@ -2831,13 +2831,13 @@ void SfxTemplateCatalog_Impl::InsertFamilyItem( sal_uInt16 nId, const SfxStyleFa if ( nId > SFX_STYLE_FAMILY_PSEUDO || nId < SFX_STYLE_FAMILY_CHAR ) return; aFamList.InsertEntry( pItem->GetText(), 0 ); - aFamIds.Insert( nId, 0 ); + aFamIds.insert( aFamIds.begin(), nId ); } void SfxTemplateCatalog_Impl::ClearFamilyList() { aFamList.Clear(); - aFamIds.Remove( 0, aFamIds.Count() ); + aFamIds.clear(); } void SfxTemplateCatalog_Impl::PrepareDeleteAction() diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index 0f9609f1c420..26b35dd8e16a 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -381,7 +381,7 @@ void ErrorDelete_Impl(Window *pParent, const String &rName, sal_Bool bFolder = s struct ImpPath_Impl { - SvUShorts aUS; + std::vector<sal_uInt16> aUS; sal_uInt16 nRef; ImpPath_Impl(); @@ -390,7 +390,7 @@ struct ImpPath_Impl //------------------------------------------------------------------------- -ImpPath_Impl::ImpPath_Impl() : aUS(5), nRef(1) +ImpPath_Impl::ImpPath_Impl() : nRef(1) { } @@ -398,14 +398,9 @@ ImpPath_Impl::ImpPath_Impl() : aUS(5), nRef(1) ImpPath_Impl::ImpPath_Impl( const ImpPath_Impl& rCopy ) : - aUS ( (sal_uInt8)rCopy.aUS.Count() ), - nRef( 1 ) + aUS(rCopy.aUS), nRef( 1 ) { - const sal_uInt16 nCount = rCopy.aUS.Count(); - - for ( sal_uInt16 i = 0; i < nCount; ++i ) - aUS.Insert( rCopy.aUS[i], i ); } //========================================================================== @@ -442,7 +437,7 @@ public: if(!--pData->nRef) delete pData; } - sal_uInt16 Count() const { return pData->aUS.Count(); } + sal_uInt16 Count() const { return pData->aUS.size(); } sal_uInt16 operator[]( sal_uInt16 i ) const { return i < Count()? pData->aUS[i]: INDEX_IGNORE; @@ -459,7 +454,8 @@ Path::Path(SvLBox *pBox, SvLBoxEntry *pEntry) : return; SvLBoxEntry *pParent = pBox->GetParent(pEntry); do { - pData->aUS.Insert((sal_uInt16)pBox->GetModel()->GetRelPos(pEntry), 0); + pData->aUS.insert(pData->aUS.begin(), + (sal_uInt16)pBox->GetModel()->GetRelPos(pEntry)); if(0 == pParent) break; pEntry = pParent; diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx index b807f5cd21a7..8783675fc40e 100644 --- a/sfx2/source/inc/appdata.hxx +++ b/sfx2/source/inc/appdata.hxx @@ -38,6 +38,7 @@ #include <com/sun/star/frame/XModel.hpp> #include "bitset.hxx" +#include <vector> class SfxApplication; class SvStrings; @@ -50,7 +51,6 @@ class SfxMacroConfig; class SfxItemPool; class SfxInitLinkList; class SfxFilterMatcher; -class SvUShorts; class ISfxTemplateCommon; class SfxFilterMatcher; class SfxStatusDispatcher; @@ -124,7 +124,7 @@ public: // global pointers SfxItemPool* pPool; - SvUShorts* pDisabledSlotList; + std::vector<sal_uInt16>* pDisabledSlotList; SvStrings* pSecureURLs; SvtSaveOptions* pSaveOptions; SvtUndoOptions* pUndoOptions; diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index 45e00a25a8e8..ea797bed53aa 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -37,9 +37,6 @@ class SfxTemplateControllerItem; #include <svtools/svtreebx.hxx> #include <svl/eitem.hxx> -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> // SvUShorts - #include <rsc/rscsfx.hxx> #include <tools/rtti.hxx> @@ -344,7 +341,7 @@ private: HelpButton aHelpBtn; SfxTemplateCatalog* pReal; - SvUShorts aFamIds; + std::vector<sal_uInt16> aFamIds; SfxModalDefParentHelper aHelper; protected: diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx index eebc3412d11c..347147d2a835 100644 --- a/sfx2/source/inc/workwin.hxx +++ b/sfx2/source/inc/workwin.hxx @@ -38,8 +38,6 @@ #include <cppuhelper/weak.hxx> #include <cppuhelper/propshlp.hxx> -#define _SVSTDARR_sal_uInt16S -#include <svl/svstdarr.hxx> // SvUShorts #include <rtl/ustring.hxx> #include <osl/mutex.hxx> @@ -234,7 +232,7 @@ class SfxWorkWindow friend class LayoutManagerListener; protected: - SvUShorts aSortedList; + std::vector<sal_uInt16> aSortedList; SfxStatBar_Impl aStatBar; std::vector< SfxObjectBar_Impl > aObjBarList; Rectangle aClientArea; diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx index e2492a4ddd3a..153ffb28cd4b 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -1090,9 +1090,8 @@ namespace slideshow MetaCommentAction * pAct = static_cast<MetaCommentAction *>(pCurrAct); // skip comment if not a special XTEXT comment - if (pAct->GetComment().CompareIgnoreCaseToAscii( - RTL_CONSTASCII_STRINGPARAM("FIELD_SEQ_BEGIN") ) == - COMPARE_EQUAL && + if (pAct->GetComment().equalsIgnoreAsciiCaseL( + RTL_CONSTASCII_STRINGPARAM("FIELD_SEQ_BEGIN") ) && // e.g. date field doesn't have data! // currently assuming that only url field, this is // somehow fragile! xxx todo if possible @@ -1117,9 +1116,8 @@ namespace slideshow pAct->GetDataSize() / sizeof(sal_Unicode) ) ) ); } - else if (pAct->GetComment().CompareIgnoreCaseToAscii( - RTL_CONSTASCII_STRINGPARAM("FIELD_SEQ_END")) == - COMPARE_EQUAL && + else if (pAct->GetComment().equalsIgnoreAsciiCaseL( + RTL_CONSTASCII_STRINGPARAM("FIELD_SEQ_END")) && // pending end is expected: !maHyperlinkIndices.empty() && maHyperlinkIndices.back().second == -1) diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx b/slideshow/source/engine/shapes/drawshapesubsetting.cxx index bfe36dcc6c27..919280b56dae 100644 --- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx +++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx @@ -91,14 +91,14 @@ namespace slideshow MetaCommentAction* pAct = static_cast<MetaCommentAction*>(pCurrAct); // skip comment if not a special XTEXT comment - if( pAct->GetComment().CompareIgnoreCaseToAscii( "XTEXT", 5 ) == COMPARE_EQUAL ) + if( pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XTEXT")) ) { // fill classification vector with NOOPs, // then insert corresponding classes at // the given index maActionClassVector.resize( nActionIndex+1, CLASS_NOOP ); - if( pAct->GetComment().CompareIgnoreCaseToAscii( "XTEXT_EOC" ) == COMPARE_EQUAL ) + if( pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOC")) ) { // special, because can happen // in-between of portions - set @@ -112,7 +112,7 @@ namespace slideshow maActionClassVector[ nIndex ] = CLASS_CHARACTER_CELL_END; } - else if( pAct->GetComment().CompareIgnoreCaseToAscii( "XTEXT_EOW" ) == COMPARE_EQUAL ) + else if( pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOW")) ) { // special, because can happen // in-between of portions - set @@ -126,7 +126,7 @@ namespace slideshow maActionClassVector[ nIndex ] = CLASS_WORD_END; } - else if( pAct->GetComment().CompareIgnoreCaseToAscii( "XTEXT_EOS" ) == COMPARE_EQUAL ) + else if( pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM( "XTEXT_EOS" )) ) { // special, because can happen // in-between of portions - set @@ -140,19 +140,19 @@ namespace slideshow maActionClassVector[ nIndex ] = CLASS_SENTENCE_END; } - else if( pAct->GetComment().CompareIgnoreCaseToAscii( "XTEXT_EOL" ) == COMPARE_EQUAL ) + else if( pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOL")) ) { maActionClassVector[ nActionIndex ] = CLASS_LINE_END; } - else if( pAct->GetComment().CompareIgnoreCaseToAscii( "XTEXT_EOP" ) == COMPARE_EQUAL ) + else if( pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XTEXT_EOP")) ) { maActionClassVector[ nActionIndex ] = CLASS_PARAGRAPH_END; } - else if( pAct->GetComment().CompareIgnoreCaseToAscii( "XTEXT_PAINTSHAPE_END" ) == COMPARE_EQUAL ) + else if( pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XTEXT_PAINTSHAPE_END")) ) { maActionClassVector[ nActionIndex ] = CLASS_SHAPE_END; } - else if( pAct->GetComment().CompareIgnoreCaseToAscii( "XTEXT_PAINTSHAPE_BEGIN" ) == COMPARE_EQUAL ) + else if( pAct->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XTEXT_PAINTSHAPE_BEGIN")) ) { maActionClassVector[ nActionIndex ] = CLASS_SHAPE_START; } diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index aed27647642c..77d8a0861bb5 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -481,19 +481,21 @@ bool getRectanglesFromScrollMtf( ::basegfx::B2DRectangle& o_rScrollRect, MetaCommentAction * pAct = static_cast<MetaCommentAction *>(pCurrAct); // skip comment if not a special XTEXT comment - if (pAct->GetComment().CompareIgnoreCaseToAscii( - RTL_CONSTASCII_STRINGPARAM("XTEXT") ) == COMPARE_EQUAL) + if (pAct->GetComment().equalsIgnoreAsciiCaseL( + RTL_CONSTASCII_STRINGPARAM("XTEXT") )) { - if (pAct->GetComment().CompareIgnoreCaseToAscii( - "XTEXT_SCROLLRECT" ) == COMPARE_EQUAL) { + if (pAct->GetComment().equalsIgnoreAsciiCaseL( + RTL_CONSTASCII_STRINGPARAM("XTEXT_SCROLLRECT") )) + { o_rScrollRect = ::vcl::unotools::b2DRectangleFromRectangle( *reinterpret_cast<Rectangle const *>( pAct->GetData() ) ); bScrollRectSet = true; } - else if (pAct->GetComment().CompareIgnoreCaseToAscii( - "XTEXT_PAINTRECT" ) == COMPARE_EQUAL) { + else if (pAct->GetComment().equalsIgnoreAsciiCaseL( + RTL_CONSTASCII_STRINGPARAM("XTEXT_PAINTRECT")) ) + { o_rPaintRect = ::vcl::unotools::b2DRectangleFromRectangle( *reinterpret_cast<Rectangle const *>( pAct->GetData() ) ); diff --git a/smoketestoo_native/makefile.mk b/smoketestoo_native/makefile.mk index cd801847d3a6..8c7d811a71f8 100755 --- a/smoketestoo_native/makefile.mk +++ b/smoketestoo_native/makefile.mk @@ -42,7 +42,7 @@ SHL1IMPLIB = i$(SHL1TARGET) SHL1TARGET = smoketest SHL1OBJS = $(SLO)/smoketest.obj SHL1RPATH = NONE -SHL1STDLIBS = $(CPPUHELPERLIB) $(CPPULIB) $(CPPUNITLIB) $(SALLIB) $(TESTLIB) +SHL1STDLIBS = $(CPPUHELPERLIB) $(CPPULIB) $(CPPUNITLIB) $(SALLIB) $(UNOTESTLIB) SHL1USE_EXPORTS = name DEF1NAME = $(SHL1TARGET) diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl index fd1df27ee834..10dac770fd63 100644 --- a/solenv/bin/make_installer.pl +++ b/solenv/bin/make_installer.pl @@ -1309,7 +1309,8 @@ for ( my $n = 0; $n <= $#installer::globals::languageproducts; $n++ ) my $found_epm = 0; # shuffle array to reduce parallel packaging process in pool - installer::worker::shuffle_array($packages); + installer::worker::shuffle_array($packages) + unless $installer::globals::simple; # iterating over all packages for ( my $k = 0; $k <= $#{$packages}; $k++ ) diff --git a/solenv/gbuild/ComponentsTarget.mk b/solenv/gbuild/ComponentsTarget.mk new file mode 100644 index 000000000000..686a7eea966c --- /dev/null +++ b/solenv/gbuild/ComponentsTarget.mk @@ -0,0 +1,77 @@ +# +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# [ Copyright (C) 2011 Stephan Bergmann, Red Hat <sbergman@redhat.com> (initial +# developer) ] +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +# + +# Create a .components file bundling multiple .component files: + +# $(1): ID of this components entity (a relative pathname without ".components" +# extension) +define gb_ComponentsTarget_ComponentsTarget +$(call gb_ComponentsTarget_get_target,$(1)): \ + $(call gb_ComponentsTarget_get_target,$(1)).input +$(call gb_ComponentsTarget_get_target,$(1)).input: COMPONENTFILES := +$(eval $(call gb_Module_register_target,$(call gb_ComponentsTarget_get_target,$(1)),$(call gb_ComponentsTarget_get_clean_target,$(1)))) + +endef + +# $(1): ID of this components entity +# $(2): absolute .component pathname (must be underneath $(WORKDIR) due to the +# --stringparam prefix approach of $(SOLARENV)/bin/packcomponents.xslt) +define gb_ComponentsTarget_add_componentfile +$(call gb_ComponentsTarget_get_target,$(1)): $(2) +$(call gb_ComponentsTarget_get_target,$(1)).input: COMPONENTFILES += $(2) + +endef + +$(call gb_ComponentsTarget_get_target,%): \ + $(call gb_ComponentsTarget_get_target,%).input + $(call gb_Output_announce,$*,$(true),CPS,1) + $(call gb_Helper_abbreviate_dirs_native, \ + mkdir -p $(dir $@)) + $(call gb_Helper_abbreviate_dirs_native, \ + $(gb_XSLTPROC) --nonet --stringparam prefix $(WORKDIR) -o $@ \ + $(SOLARENV)/bin/packcomponents.xslt $@.input) + +$(call gb_ComponentsTarget_get_clean_target,%): \ + $(call gb_ComponentsTarget_get_clean_target,%).input + $(call gb_Output_announce,$*,$(false),CPS,1) + $(call gb_Helper_abbreviate_dirs_native, \ + rm -f $(call gb_ComponentsTarget_get_target,$*)) + +$(call gb_ComponentsTarget_get_target,%).input: + $(call gb_Output_announce,$*,$(true),CPI,1) + $(call gb_Helper_abbreviate_dirs_native, \ + mkdir -p $(dir $@)) + $(call gb_Helper_abbreviate_dirs_native, \ + printf '<list>%s</list>' \ + "$(foreach i,$(COMPONENTFILES),<filename>$(subst $(WORKDIR),,$i)</filename>)" \ + > $@) + +$(call gb_ComponentsTarget_get_clean_target,%).input: + $(call gb_Output_announce,$*,$(false),CPI,1) + $(call gb_Helper_abbreviate_dirs_native, \ + rm -f $(call gb_ComponentsTarget_get_target,$*).input) diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk index 9d410badf347..54d6a238e30b 100644 --- a/solenv/gbuild/Jar.mk +++ b/solenv/gbuild/Jar.mk @@ -166,9 +166,10 @@ endef gb_Jar_COMPONENTPREFIXES := \ OOO:vnd.sun.star.expand:\dBRAND_BASE_DIR/program/classes/ \ URE:vnd.sun.star.expand:\dURE_INTERNAL_JAVA_DIR/ \ + OXT:./ \ INTERN:vnd.sun.star.expand:\dOOO_INBUILD_JAVA_DIR/ -# get component prefix from layer name ("OOO", "URE", "INTERN") +# get component prefix from layer name ("OOO", "URE", "OXT", "INTERN") gb_Jar__get_componentprefix = \ $(patsubst $(1):%,%,$(or \ $(filter $(1):%,$(gb_Jar_COMPONENTPREFIXES)), \ diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 9205d444c868..fe907b170ce3 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -72,6 +72,7 @@ gb_CObject_get_target = $(WORKDIR)/CObject/$(1).o gb_GenCObject_get_target = $(WORKDIR)/GenCObject/$(1).o gb_ComponentTarget_get_target = $(WORKDIR)/ComponentTarget/$(1).component gb_ComponentTarget_get_inbuild_target = $(WORKDIR)/ComponentTarget/$(1).inbuild.component +gb_ComponentsTarget_get_target = $(WORKDIR)/ComponentsTarget/$(1).components gb_CppunitTest_get_target = $(WORKDIR)/CppunitTest/$(1).test gb_CustomTarget_get_repo_target = $(WORKDIR)/CustomTarget/$(2)_$(1).done gb_CustomTarget_get_target = $(WORKDIR)/CustomTarget/$(1).done @@ -155,6 +156,7 @@ endef $(eval $(call gb_Helper_make_clean_targets,\ AllLangResTarget \ ComponentTarget \ + ComponentsTarget \ Extension \ JavaClassSet \ Jar \ diff --git a/solenv/gbuild/UnoApiTarget.mk b/solenv/gbuild/UnoApiTarget.mk index 35c05c2b6e37..de2dc74306b6 100644 --- a/solenv/gbuild/UnoApiTarget.mk +++ b/solenv/gbuild/UnoApiTarget.mk @@ -53,10 +53,6 @@ $(call gb_UnoApiOutTarget_get_clean_target,$(1)) : $(call gb_UnoApiTarget_get_cl gb_UnoApiTarget_HPPFILES_$(1) := gb_UnoApiTarget_IDLFILES_$(1) := -.DELETE_ON_ERROR : \ - $(call gb_UnoApiTarget_get_clean_target,$(1)) \ - $(call gb_UnoApiTarget_get_target,$(1)) - endef define gb_UnoApiTarget_add_idlfiles diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 4ff643a33f3c..530fd9f646d1 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -46,6 +46,8 @@ # SYSTEM_JPEG (Linux) # SYSTEM_LIBXML (Linux) +.DELETE_ON_ERROR: + SHELL := /bin/sh MAKEFLAGS+=-r true := T @@ -307,6 +309,7 @@ include $(SOLARENV)/inc/minor.mk include $(foreach class, \ ComponentTarget \ + ComponentsTarget \ AllLangResTarget \ WinResTarget \ LinkTarget \ diff --git a/solenv/inc/libs.mk b/solenv/inc/libs.mk index 91161f19ecce..17d482501dc6 100644 --- a/solenv/inc/libs.mk +++ b/solenv/inc/libs.mk @@ -308,7 +308,7 @@ PYUNOLIB=-lpyuno LPSOLVELIB=-llpsolve55 SOFFICELIB=-lsofficeapp UNOPKGAPPLIB=-lunopkgapp -TESTLIB=-lunotest +TESTLIB=-ltest UNOTESTLIB=-lunotest XMLREADERLIB=-lxmlreader diff --git a/soltools/testSHL/inc/tlog.hxx b/soltools/testSHL/inc/tlog.hxx deleted file mode 100644 index fa38483efd38..000000000000 --- a/soltools/testSHL/inc/tlog.hxx +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SOLTOOLS_TESTSHL_TLOG_HXX__ -#define _SOLTOOLS_TESTSHL_TLOG_HXX__ - -#include <osl/file.hxx> -#include <rtl/tres.hxx> - -#include "tutil.hxx" - -#include <iostream> - -using namespace std; - -namespace tstutl { - -class tLog { - - // <private_members> - ::osl::File* m_logfile; // fileobject - ::rtl::OUString m_logname; // name of log - // </private_members> - - // <private_methods> - void initialize( const ::rtl::OString& name ); - // </private_methods> - -public: - - // <public_ctors> - tLog() : m_logfile( 0 ) { - } - - tLog( const sal_Char* name ) { - if( name ) { - initialize( name ); - } - else { - m_logfile = 0; - } - - } - // </public_ctors> - - // <dtor> - virtual ~tLog() { - if ( m_logfile ) { - m_logfile->close(); - delete( m_logfile ); - } - } // </dtor> - - // <public_methods> - inline ::rtl::OUString& getName() { return m_logname; } - inline ::osl::File* getFile() { return m_logfile; } - - // open logfile for overwrite (default) or append - ::osl::FileBase::RC open( sal_Bool append = sal_False ); - ::osl::FileBase::RC close(); - - ::osl::FileBase::RC writeRes( ::rtl::TestResult& oRes, sal_Bool v = sal_False , - sal_Bool xml = sal_False ); - - // write methods without (default) or with echo on display - ::osl::FileBase::RC write( const sal_Char* buf, sal_Bool v = sal_False ); - // </public_methods> - -}; // </class_tLog> - -} // </namespace_tstutl> - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/soltools/testSHL/inc/tstMgr.hxx b/soltools/testSHL/inc/tstMgr.hxx deleted file mode 100644 index cbb8474b68af..000000000000 --- a/soltools/testSHL/inc/tstMgr.hxx +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SOLTOOLS_TESTSHL_TSTMGR_HXX__ -#define _SOLTOOLS_TESTSHL_TSTMGR_HXX__ - -#include <sal/types.h> - -#include <vector> - -using namespace std; - -// <namespace_tstutl> -namespace tstutl { - -// <class_tstMgr> -class tstMgr { - - // <private_members> - struct tstMgr_Impl; - tstMgr_Impl* pImpl; - // </private_members> - - // <private_methods> - void cleanup(); - // </private_methods> - -public: - tstMgr() : pImpl(0) {} - // <dtor> - ~tstMgr(){ - cleanup(); - } // </dtor> - - - // <public_methods> - sal_Bool initialize( sal_Char* moduleName, sal_Bool boom = sal_False ); - sal_Bool test_Entry( sal_Char* entry, sal_Char* logName = 0 ); - sal_Bool test_Entries( vector< sal_Char* > entries, sal_Char* logName = 0 ); - sal_Bool test_EntriesFromFile( sal_Char* fName, sal_Char* logName = 0 ); - // </public_methods> - -}; // </class_tstMgr> - -} // </namespace_tstutl> - -#endif - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/soltools/testSHL/inc/tutil.hxx b/soltools/testSHL/inc/tutil.hxx deleted file mode 100644 index 76c12b314548..000000000000 --- a/soltools/testSHL/inc/tutil.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SOLTOOLS_TESTSHL_TUTIL_HXX_ -#define _SOLTOOLS_TESTSHL_TUTIL_HXX__ - -#include <osl/file.hxx> - -using namespace std; - -#include <vector> - -// <namespace_tstutl> -namespace tstutl { - -sal_uInt32 getEntriesFromFile( sal_Char* fName, vector< sal_Char* >& entries ); -::rtl::OUString cnvrtPth( ::rtl::OString sysPth ); - -// string copy, cat, len methods -sal_Char* cpy( sal_Char** dest, const sal_Char* src ); -sal_Char* cat( const sal_Char* str1, const sal_Char* str2 ); -sal_uInt32 ln( const sal_Char* str ); - -} // </namespace_tstutl> - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/soltools/testSHL/makefile.mk b/soltools/testSHL/makefile.mk deleted file mode 100644 index 0377137b2274..000000000000 --- a/soltools/testSHL/makefile.mk +++ /dev/null @@ -1,52 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=.. - -PRJNAME=soltools -TARGET=testshl -TARGETTYPE=CUI - -# --- Settings ----------------------------------------------------- - -.INCLUDE : $(PRJ)$/util$/makefile.pmk -.INCLUDE : settings.mk - -UWINAPILIB=$(0) -LIBSALCPPRT=$(0) - -# ------------------------------------------------------------------ - -APP1TARGET= $(TARGET) -APP1OBJS= $(OBJ)$/$(TARGET).obj -APP1STDLIBS=$(SALLIB)\ - $(SALHELPERLIB) -APP1DEPN= $(LB)$/tstutil.lib -APP1LIBS= $(LB)$/tstutil.lib - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk diff --git a/soltools/testSHL/testshl.cxx b/soltools/testSHL/testshl.cxx deleted file mode 100644 index c66a238effa6..000000000000 --- a/soltools/testSHL/testshl.cxx +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_soltools.hxx" - -#include <stdio.h> - -#include "inc/tlog.hxx" - -#include "inc/tstMgr.hxx" - -using namespace tstutl; - -void usage(); -void test_shl( vector< sal_Char* > cmdln, sal_Bool boom ); - -#if (defined UNX) -int main( int argc, char* argv[] ) -#else -int _cdecl main( int argc, char* argv[] ) -#endif -{ - if ( argc < 3 ) { - usage(); - } - sal_Bool boom = sal_False; - vector< sal_Char* > cmdln; - - sal_Int32 i; - for ( i = 1; i < argc; i++ ) { - sal_Char* ptr = argv[i]; - if ( ptr[0] == '-' ) { - boom = sal_True; - } - else { - cmdln.push_back( ptr ); - } - } - if ( cmdln.size() < 3 ) { - cmdln.push_back( 0 ); - } - if ( ! cmdln[0] || ! cmdln[1] ) { - usage(); - } - - test_shl( cmdln, boom ); - - return(0); -} - -void test_shl( vector< sal_Char*> cmdln, sal_Bool boom ) { - - tstMgr tst; - - if ( tst.initialize( cmdln[0], boom )) { - tst.test_EntriesFromFile( cmdln[1], cmdln[2] ); - } - else { - sal_Char* msg = "could not find module\n"; - fprintf( stdout, "%s\n", msg ); - } -} - -void usage(){ - fprintf( stdout, - "USAGE: testSHL shlname scename [logname] [-boom]\n" ); - exit(0); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/soltools/testSHL/util/makefile.mk b/soltools/testSHL/util/makefile.mk deleted file mode 100644 index a2582f9c1abd..000000000000 --- a/soltools/testSHL/util/makefile.mk +++ /dev/null @@ -1,45 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/.. - -PRJNAME=soltools -TARGET=tstutil - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# ------------------------------------------------------------------ - -OBJFILES =\ - $(OBJ)$/tlog.obj \ - $(OBJ)$/tutil.obj \ - $(OBJ)$/tstMgr.obj - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk diff --git a/soltools/testSHL/util/tlog.cxx b/soltools/testSHL/util/tlog.cxx deleted file mode 100644 index 65982ae978ec..000000000000 --- a/soltools/testSHL/util/tlog.cxx +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_soltools.hxx" - -#include "tlog.hxx" - -using namespace std; - -// <namespace_tstutl> -namespace tstutl { - -// <method_initialize> -void tLog::initialize( const ::rtl::OString& name ) { - m_logname = cnvrtPth( name ); - m_logfile = new ::osl::File( m_logname ); -} // </method_initialize> - -// <method_open> -::osl::FileBase::RC tLog::open( sal_Bool append ) { - - if ( m_logfile ) { - ::osl::FileBase::RC ret; - - if ( ! append ) { - ret = ::osl::File::remove( m_logname ); - } - - if( m_logfile->open( osl_File_OpenFlag_Write ) == ::osl::FileBase::E_NOENT ) { - ret = m_logfile->open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ); - } - else { - ret = m_logfile->setPos( osl_Pos_End, 0 ); - } - return ret; - } - return ( ::osl::FileBase::E_INVAL ); -} // </method_open> - -// <method_close> -::osl::FileBase::RC tLog::close() { - if ( m_logfile ) { - return m_logfile->close(); - } - return ( ::osl::FileBase::E_INVAL ); -} // </method_close> - -// <method_writeRes> -::osl::FileBase::RC tLog::writeRes( ::rtl::TestResult& oRes, sal_Bool v, sal_Bool xml ) { - ::osl::FileBase::RC ret; - - sal_Char* ptr = oRes.getName(); - ptr = cat( ptr, ";" ); - ptr = cat( ptr, oRes.getResult() ); - ret = write( cat( ptr, "\n" ), v ); - delete [] ptr; - - return( ret ); -} // </method_writeRes> - -// <method_write> -::osl::FileBase::RC tLog::write( const sal_Char* buf, sal_Bool v ) { - - if ( ! m_logfile ) { - fprintf( stderr, "%s", buf ); - return ( ::osl::FileBase::E_NOENT ); - } - sal_uInt64 uBytes=0; - sal_uInt32 len = ln( buf ); - - if ( v ) { - fprintf( stderr, "%s", buf ); - } - return m_logfile->write( buf, len , uBytes ); -} // </method_write> - -} // </namespace_tstutl> - - - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/soltools/testSHL/util/tstMgr.cxx b/soltools/testSHL/util/tstMgr.cxx deleted file mode 100644 index 7fa2bd7e40ad..000000000000 --- a/soltools/testSHL/util/tstMgr.cxx +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_soltools.hxx" -#include "tstMgr.hxx" -#include <osl/module.hxx> -#include <rtl/tres.hxx> - -#include "tlog.hxx" - -#include "tutil.hxx" - -using namespace rtl; - -// <namespace_tstutl> -namespace tstutl { - -typedef void* ( tstFunc )( TestResult* ); -void test_Entry_Impl( ::osl::Module& oMod, TestResult* oRes ); - -// <private_members> -struct tstMgr::tstMgr_Impl { - ::osl::Module m_tstmodule; - sal_Bool m_boom; -}; -// </private_members> - -// <method_initialize> -sal_Bool tstMgr::initialize( sal_Char* modName, sal_Bool boom ) { - - ::rtl::OUString tstMod( ::rtl::OUString::createFromAscii( modName ) ); - pImpl = new tstMgr_Impl; - pImpl->m_boom = boom; - return ( pImpl->m_tstmodule.load( tstMod ) ); -} // <method_initialize> - -// <method_test_Entries> -sal_Bool tstMgr::test_Entries( vector< sal_Char* > entries, - sal_Char* logName ) { - - sal_Bool bOK = sal_False; - if ( ! entries.empty() ) { - - bOK = sal_True; - vector< sal_Char* >::iterator iter = entries.begin(); - - tLog log( logName ); - // open testLog - log.open(); - while ( iter != entries.end() ) { - if ( *iter[0] != '#' ) { - ::rtl::TestResult oRes( *iter, pImpl->m_boom ); - test_Entry_Impl( pImpl->m_tstmodule, &oRes ); - bOK &= oRes.getState(); - log.writeRes( oRes ); - } - ++iter; - } - log.close(); - } - return ( bOK ); -} // </method_test_Entries> - -// <method_test_Entry> -sal_Bool tstMgr::test_Entry( sal_Char* entry, sal_Char* logName ) { - - tLog log( logName ); - // open testLog - log.open(); - ::rtl::TestResult oRes( entry, pImpl->m_boom ); - test_Entry_Impl( pImpl->m_tstmodule, &oRes ); - log.writeRes( oRes, sal_True ); - log.close(); - return ( oRes.getState() ); -} // </method_test_Entry> - -// <method_test_EntriesFromFile> -sal_Bool tstMgr::test_EntriesFromFile( sal_Char* fName, sal_Char* logName ) { - - sal_Bool bOK = sal_False; - vector< sal_Char* > entries; - - if ( getEntriesFromFile( fName, entries ) ) { - sal_Bool bOK = test_Entries( entries, logName ); - - vector< sal_Char* >::iterator iter = entries.begin(); - while ( iter != entries.end() ) { - if ( *iter ) { - delete [] *iter; - } - ++iter; - } - } - else { - bOK = test_Entry( fName ); - } - return ( bOK ); - -} // </method_test_EntriesFromFile> - -// <method_cleanup> -void tstMgr::cleanup() { - if ( pImpl ) { - delete pImpl; - } -} // </method_cleanup> - - -// <function_test_Entry_Impl> -void test_Entry_Impl( ::osl::Module& oMod, ::rtl::TestResult* oRes ) { - - tstFunc* pFunc; // entry pointer - ::rtl::OString entryName( "test_" ); // entryname prefix - - // prefix entryname - entryName += oRes->getName(); - - // get entry pointer - pFunc = (tstFunc*) oMod.getSymbol( - ::rtl::OUString::createFromAscii( entryName.getStr() ) ); - - if ( pFunc ) { - // call entry - pFunc( oRes ); - oRes->end(); - } - else { - oRes->end("symbol not found"); - } - // return - return; - -} // </function_test_Entry_Impl> - -} // </namespace_tstutl> - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/soltools/testSHL/util/tutil.cxx b/soltools/testSHL/util/tutil.cxx deleted file mode 100644 index 81d068917101..000000000000 --- a/soltools/testSHL/util/tutil.cxx +++ /dev/null @@ -1,149 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_soltools.hxx" -#include "tutil.hxx" - -// <namespace_tstutl> -namespace tstutl { - -// getcwd hack is deprecated as soon as normalizePath works as intend -#ifdef WNT -#define _getcwd getcwd -#include <direct.h> // _getcwd -#else -#include <unistd.h> // getcwd -#endif - -// <function_cnvrtPth> -::rtl::OUString cnvrtPth( ::rtl::OString sysPth ) { - - using ::osl::FileBase; - using ::rtl::OUString; - using ::rtl::OString; - - ::rtl::OUString ret; - sysPth = sysPth.replace( '\\','/' ); - OUString pth( OUString::createFromAscii( sysPth.getStr() ) ); - - if ( sysPth.indexOf("..") != -1 ) { - - // <hack> for osl_normalizePath() can't handle relatives - char buffer[256]; - OString curPth(getcwd(buffer,256)); - // </hack> - OUString nrmCurPth; - FileBase::normalizePath( OUString::createFromAscii( curPth ) , - nrmCurPth ); - FileBase::getAbsolutePath( nrmCurPth, pth, ret ); - } - else { - FileBase::normalizePath( pth, ret ); - } - return ret; - -} // </function_cnvrtPth> - -// <function_getEntriesFromFile> -sal_uInt32 getEntriesFromFile( sal_Char* fName, - vector< sal_Char* >& entries ) { - - ::osl::File inFile( cnvrtPth( fName ) ); - if ( inFile.open( osl_File_OpenFlag_Read ) == ::osl::FileBase::E_None) { - ::rtl::ByteSequence byteSeq; - inFile.readLine( byteSeq ); - while ( byteSeq.getLength() ) { - sal_uInt32 len = byteSeq.getLength(); - sal_uInt32 i; - sal_Char* pEnt = new sal_Char[ len+1 ]; - sal_Char* bsPtr = (sal_Char*)byteSeq.getArray(); - for ( i=0; i<len; i++ ) { - pEnt[i] = bsPtr[i]; - } - pEnt[len] = '\0'; - entries.push_back( pEnt ); - - inFile.readLine( byteSeq ); - } - } - return ( entries.size() ); - -} // </function_getEntriesFromFile> - -// <function_cpy> -sal_Char* cpy( sal_Char** dest, const sal_Char* src ) { - - *dest = new sal_Char[ ln(src)+1 ]; - // set pointer - sal_Char* pdest = *dest; - const sal_Char* psrc = src; - - // copy string by char - while( *pdest++ = *psrc++ ); - - return ( *dest ); - -} // </function_cpy> - -// <function_cat> -sal_Char* cat( const sal_Char* str1, const sal_Char* str2 ) { - - // allocate memory for destination string - sal_Char* dest = new sal_Char[ ln(str1)+ln(str2)+1 ]; - - // set pointers - sal_Char* pdest = dest; - const sal_Char* psrc = str1; - - // copy string1 by char to dest - while( *pdest++ = *psrc++ ); - pdest--; - psrc = str2; - while( *pdest++ = *psrc++ ); - - return ( dest ); - -} // </function_cat> - -// <function_ln> -sal_uInt32 ln( const sal_Char* str ) { - - sal_uInt32 len = 0; - const sal_Char* ptr = str; - - if( ptr ) { - while( *ptr++ ) len++; - } - - return(len); -} // <function_ln> - -} // </namespace_tstutl> - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index a0db9033d734..4c8d077421ec 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.hxx @@ -81,7 +81,6 @@ * Sortierung mit Hilfe der Object-operatoren "<" und "==" * * JP 09.10.96: vordefinierte Arrays: -* VarArr: SvUShorts * PtrArr: SvStrings, SvStringsDtor * SortArr: SvStringsSort, SvStringsSortDtor, * SvStringsISort, SvStringsISortDtor diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx index 9df5b4bb0b54..50349f4b9a3a 100644 --- a/svl/inc/svl/svstdarr.hxx +++ b/svl/inc/svl/svstdarr.hxx @@ -32,7 +32,6 @@ * (die defines setzen sich aus "_SVSTDARR_" und dem Namen des Array * ohne "Sv" zusammen) * -* VarArr: SvUShorts * PtrArr: SvStrings, SvStringsDtor * SortArr: SvStringsSort, SvStringsSortDtor, * SvStringsISort, SvStringsISortDtor, @@ -42,11 +41,6 @@ #include <svl/svarray.hxx> #include <deque> -#ifndef _SVSTDARR_USHORTS_DECL -SV_DECL_VARARR_VISIBILITY( SvUShorts, sal_uInt16, 1, 1, SVL_DLLPUBLIC ) -#define _SVSTDARR_USHORTS_DECL -#endif - #include <tools/string.hxx> typedef String* StringPtr; diff --git a/svl/source/memtools/svarray.cxx b/svl/source/memtools/svarray.cxx index 7024640fbf2a..95df58a363a4 100644 --- a/svl/source/memtools/svarray.cxx +++ b/svl/source/memtools/svarray.cxx @@ -61,8 +61,6 @@ sal_uInt16 SvPtrarr::GetPos( const VoidPtr& aElement ) const return ( n >= nA ? USHRT_MAX : n ); } -SV_IMPL_VARARR( SvUShorts, sal_uInt16 ) - SV_IMPL_PTRARR( SvStrings, StringPtr ) SV_IMPL_PTRARR( SvStringsDtor, StringPtr ) SV_IMPL_OP_PTRARR_SORT( SvStringsSort, StringPtr ) diff --git a/svtools/inc/svtools/svparser.hxx b/svtools/inc/svtools/svparser.hxx index b82a5a85e36e..eac4a92a8f47 100644 --- a/svtools/inc/svtools/svparser.hxx +++ b/svtools/inc/svtools/svparser.hxx @@ -34,11 +34,11 @@ #include <tools/ref.hxx> #include <rtl/textenc.h> #include <boost/utility.hpp> +#include <vector> struct SvParser_Impl; class SvStream; -class SvUShorts; enum SvParserState { @@ -174,7 +174,7 @@ public: // Aufbau einer Which-Map 'rWhichMap' aus einem Array von // 'pWhichIds' von Which-Ids. Es hat die Lange 'nWhichIds'. // Die Which-Map wird nicht geloescht. - static void BuildWhichTbl( SvUShorts &rWhichMap, + static void BuildWhichTbl( std::vector<sal_uInt16> &rWhichMap, sal_uInt16 *pWhichIds, sal_uInt16 nWhichIds ); }; diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 5834f59f722f..1a75dd2a4492 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1318,6 +1318,20 @@ void ValueSet::Tracking( const TrackingEvent& rTEvt ) // ----------------------------------------------------------------------- +namespace +{ + +size_t +lcl_gotoLastLine(size_t const nLastPos, size_t const nCols, size_t const nCurPos) +{ + size_t nItemPos = ((((nLastPos+1)/nCols)-1)*nCols)+(nCurPos%nCols); + if ( nItemPos+nCols <= nLastPos ) + nItemPos = nItemPos + nCols; + return nItemPos; +} + +} + void ValueSet::KeyInput( const KeyEvent& rKEvt ) { size_t nLastItem = mpImpl->mpItemList->size(); @@ -1419,16 +1433,17 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) if ( nLastItem+1 <= mnCols ) nItemPos = mnCurCol; else - { - nItemPos = ((((nLastItem+1)/mnCols)-1)*mnCols)+(mnCurCol%mnCols); - if ( nItemPos+mnCols <= nLastItem ) - nItemPos = nItemPos + mnCols; - } + nItemPos = lcl_gotoLastLine(nLastItem, mnCols, mnCurCol); } - else if ( nCalcPos >= ( nLineCount * mnCols ) ) - nItemPos = sal::static_int_cast< sal_uInt16 >( - nCalcPos - ( nLineCount * mnCols )); - else + else if ( nCalcPos >= mnCols ) // we can go up + { + if ( nCalcPos >= ( nLineCount * mnCols ) ) + nItemPos = nCalcPos - ( nLineCount * mnCols ); + else + // Go to the first line. This can only happen for KEY_PAGEUP + nItemPos = nCalcPos % mnCols; + } + else // wrap around { if ( mpNoneItem ) { @@ -1440,11 +1455,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) if ( nLastItem+1 <= mnCols ) nItemPos = nCalcPos; else - { - nItemPos = ((((nLastItem+1)/mnCols)-1)*mnCols)+(nCalcPos%mnCols); - if ( nItemPos+mnCols <= nLastItem ) - nItemPos = nItemPos + mnCols; - } + nItemPos = lcl_gotoLastLine(nLastItem, mnCols, nCalcPos); } } nCalcPos = nItemPos; @@ -1467,10 +1478,15 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt ) { if ( nCalcPos == VALUESET_ITEM_NONEITEM ) nItemPos = mnCurCol; - else if ( nCalcPos + ( nLineCount * mnCols ) <= nLastItem ) - nItemPos = sal::static_int_cast< sal_uInt16 >( - nCalcPos + ( nLineCount * mnCols )); - else + else if ( nCalcPos + mnCols <= nLastItem ) // we can go down + { + if ( nCalcPos + ( nLineCount * mnCols ) <= nLastItem ) + nItemPos = nCalcPos + ( nLineCount * mnCols ); + else + // Go to the last line. This can only happen for KEY_PAGEDOWN + nItemPos = lcl_gotoLastLine(nLastItem, mnCols, nCalcPos); + } + else // wrap around { { if ( mpNoneItem ) diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index 9cb6ba80f9ae..84ebfa492ce6 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -572,7 +572,7 @@ void SvParser::Continue( int ) { } -void SvParser::BuildWhichTbl( SvUShorts &rWhichMap, +void SvParser::BuildWhichTbl( std::vector<sal_uInt16> &rWhichMap, sal_uInt16 *pWhichIds, sal_uInt16 nWhichIds ) { @@ -590,7 +590,7 @@ void SvParser::BuildWhichTbl( SvUShorts &rWhichMap, if( *pWhichIds < rWhichMap[nOfs] - 1 ) { // neuen Range davor - rWhichMap.Insert( aNewRange, 2, nOfs ); + rWhichMap.insert( rWhichMap.begin() + nOfs, aNewRange, aNewRange + 2 ); bIns = sal_False; break; } @@ -607,7 +607,8 @@ void SvParser::BuildWhichTbl( SvUShorts &rWhichMap, { // mit dem naechsten Bereich mergen rWhichMap[nOfs+1] = rWhichMap[nOfs+3]; - rWhichMap.Remove( nOfs+2, 2 ); + rWhichMap.erase( rWhichMap.begin() + nOfs + 2, + rWhichMap.begin() + nOfs + 4 ); } else // diesen Range nach oben erweitern @@ -619,7 +620,10 @@ void SvParser::BuildWhichTbl( SvUShorts &rWhichMap, // einen Range hinten anhaengen if( bIns ) - rWhichMap.Insert( aNewRange, 2, rWhichMap.Count()-1 ); + { + rWhichMap.insert( rWhichMap.begin() + rWhichMap.size() - 1, + aNewRange, aNewRange + 2 ); + } } } diff --git a/svx/inc/svx/svdcrtv.hxx b/svx/inc/svx/svdcrtv.hxx index 3e2993bdfe76..b72b0bea259a 100644 --- a/svx/inc/svx/svdcrtv.hxx +++ b/svx/inc/svx/svdcrtv.hxx @@ -87,7 +87,6 @@ protected: private: SVX_DLLPRIVATE void ImpClearVars(); SVX_DLLPRIVATE void ImpMakeCreateAttr(); - SVX_DLLPRIVATE void ImpDelCreateAttr(); protected: sal_Bool ImpBegCreateObj(sal_uInt32 nInvent, sal_uInt16 nIdent, const Point& rPnt, OutputDevice* pOut, diff --git a/svx/inc/svx/svdedxv.hxx b/svx/inc/svx/svdedxv.hxx index 742473fc1d8b..a383a3723b87 100644 --- a/svx/inc/svx/svdedxv.hxx +++ b/svx/inc/svx/svdedxv.hxx @@ -195,11 +195,6 @@ public: virtual SdrEndTextEditKind SdrEndTextEdit(sal_Bool bDontDeleteReally = sal_False); virtual bool IsTextEdit() const; - // sal_True=Es wird ein Textrahmen (OBJ_TEXT,OBJ_OUTLINETEXT,...) editiert - // ansonsten handelt es sich um ein beschriftetes Zeichenobjekt, an dem - // der Text ja bekanntlich hor. und vert. zentriert wird. - sal_Bool IsTextEditFrame() const; - // Diese Methode liefert sal_True, wenn der Punkt rHit innerhalb der // des Objektbereichs oder der OutlinerView liegt. sal_Bool IsTextEditHit(const Point& rHit, short nTol) const; @@ -213,10 +208,6 @@ public: // MouseButtonUp liefert diese Methode immer TRUE. sal_Bool IsTextEditInSelectionMode() const; - // Folgende Methode addiert einen passenden Offset zum MouseEvent - // um diesen an den Outliner weiterzureichen. - void AddTextEditOfs(MouseEvent& rMEvt) const; - // Wer das z.Zt. im TextEdit befindliche Objekt braucht: SdrObject* GetTextEditObject() const { return mxTextEditObj.get(); } @@ -240,9 +231,6 @@ public: virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt, Window* pWin); virtual sal_Bool MouseMove(const MouseEvent& rMEvt, Window* pWin); virtual sal_Bool Command(const CommandEvent& rCEvt, Window* pWin); - sal_Bool Cut(sal_uIntPtr nFormat=SDR_ANYFORMAT); - sal_Bool Yank(sal_uIntPtr nFormat=SDR_ANYFORMAT); - sal_Bool Paste(Window* pWin=NULL, sal_uIntPtr nFormat=SDR_ANYFORMAT); // #97766# make virtual to change implementation e.g. for SdOutlineView virtual sal_uInt16 GetScriptType() const; diff --git a/svx/inc/svx/svdetc.hxx b/svx/inc/svx/svdetc.hxx index da0d1407f121..9100b5bf9911 100644 --- a/svx/inc/svx/svdetc.hxx +++ b/svx/inc/svx/svdetc.hxx @@ -106,12 +106,6 @@ public: // Default MapFraction ist 1/1. static void SetMapFraction(const Fraction& rMap) { GetDefaults().aMapFraction=rMap; } static Fraction GetMapFraction() { return GetDefaults().aMapFraction; } - // Der Aufruf der folgenden Methode veranlasst die Engine - // ihre sprachabhaengigen Resourcen neu zu initiallisieren. - // Bereits bestehende Undotexte, etc. bleiben jedoch in der - // sprache erhalten, in der sie erzeugt wurden. - static void LanguageHasChanged(); - // Einen Outliner mit den engineglobalen // Defaulteinstellungen auf dem Heap erzeugen. diff --git a/svx/inc/svx/svdxcgv.hxx b/svx/inc/svx/svdxcgv.hxx index f76d5c9ef7c0..30fe9df55e14 100644 --- a/svx/inc/svx/svdxcgv.hxx +++ b/svx/inc/svx/svdxcgv.hxx @@ -57,7 +57,6 @@ protected: void ImpGetPasteObjList(Point& rPos, SdrObjList*& rpLst); void ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Point& rCenter, const Size& rSiz, const MapMode& rMap, sal_uInt32 nOptions); sal_Bool ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerID& rLayer) const; - Point GetPastePos(SdrObjList* pLst, OutputDevice* pOut=NULL); // liefert True, wenn rPt geaendert wurde sal_Bool ImpLimitToWorkArea(Point& rPt) const; @@ -112,9 +111,6 @@ public: */ static Graphic GetObjGraphic( const SdrModel* pModel, const SdrObject* pObj ); - // Bestimmung des View-Mittelpunktes, z.B. zum Pasten - Point GetViewCenter(const OutputDevice* pOut=NULL) const; - // Bei allen Paste-Methoden werden die neuen Draw-Objekte markiert. // Wird der Parameter bAddMark auf sal_True gesetzt, so werden die neuen // DrawObjekte zu einer bereits bestehenden Selektion "hinzumarkiert". @@ -132,16 +128,8 @@ public: // View angezeigt wird. // Gueltige Werte fuer nOptions sind SDRINSERT_DONTMARK und // SDRINSERT_ADDMARK (siehe svdedtv.hxx). - sal_Bool Paste(const GDIMetaFile& rMtf, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rMtf,GetPastePos(pLst,pOut),pLst,nOptions); } - sal_Bool Paste(const GDIMetaFile& rMtf, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0); - sal_Bool Paste(const Bitmap& rBmp, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rBmp,GetPastePos(pLst,pOut),pLst,nOptions); } - sal_Bool Paste(const Bitmap& rBmp, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0); - sal_Bool Paste(const SdrModel& rMod, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rMod,GetPastePos(pLst,pOut),pLst,nOptions); } virtual sal_Bool Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0); - sal_Bool Paste(const String& rStr, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rStr,GetPastePos(pLst,pOut),pLst,nOptions); } sal_Bool Paste(const String& rStr, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0); - // der sal_uInt16 eFormat nimmt Werte des enum EETextFormat entgegen - sal_Bool Paste(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, SdrObjList* pLst=NULL, OutputDevice* pOut=NULL, sal_uInt32 nOptions=0) { return Paste(rInput,rBaseURL,eFormat,GetPastePos(pLst,pOut),pLst,nOptions); } sal_Bool Paste(SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, const Point& rPos, SdrObjList* pLst=NULL, sal_uInt32 nOptions=0); sal_Bool Cut( sal_uIntPtr nFormat = SDR_ANYFORMAT ); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 63dc2348e703..1367c9fc0d27 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -527,8 +527,8 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< ::com::sun::star::awt: if (!getPeer().is()) { mbCreatingPeer = sal_True; - // mbCreatingPeer is virtually the same as m_nPeerCreationLevel, but it's the base class' method - // to prevent recursion. + // mbCreatingPeer is virtually the same as m_nPeerCreationLevel, but it's the base class' method + // to prevent recursion. Window* pParentWin = NULL; if (rParentPeer.is()) @@ -542,19 +542,17 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< ::com::sun::star::awt: DBG_ASSERT(pPeer != NULL, "FmXGridControl::createPeer : imp_CreatePeer didn't return a peer !"); setPeer( pPeer ); - // lesen der properties aus dem model + // reading the properties from the model // ++m_nPeerCreationLevel; updateFromModel(); - // folgendes unschoene Szenario : updateFromModel fuehrt zu einem propertiesChanged am Control, - // das stellt fest, dass sich eine 'kritische' Property geaendert hat (zum Beispiel "Border") und - // legt daraufhin eine neue Peer an, was wieder hier im createPeer landet, wir legen also eine - // zweite FmXGridPeer an und initialisieren die. Dann kommen wir in der ersten Inkarnation aus - // dem updsateFromModel raus und arbeiten dort weiter mit dem pPeer, das jetzt eigentlich schon - // veraltet ist (da ja in der zweiten Inkarnation eine andere Peer angelegt wurde). - // Deswegen also der Aufwand mit dem PeerCreationLevel, das stellt sicher, dass wir die in dem - // tiefsten Level angelegte Peer wirklich verwenden, sie aber erst im top-level - // initialisieren. + // consider the following ugly scenario: updateFromModel leads to a propertiesChanges on the Control, + // which determines, dat a "critical" property has changed (e.g. "Border") and therefore starts a new + // Peer, which lands again here in createPeerm we also start a second FmXGridPeer and initialise it. + // Then we exit from the first incarnation's updateFromModel and continue working with the pPeer, + // that is in fact now already obsolete (as another peer is being started in the second incarnation). + // Therefore the effort with the PeerCreationLevel, which ensures that we really use the Peer + // created at the deepest level, but first initialise it in the top-level. // if (--m_nPeerCreationLevel == 0) { DBG_ASSERT(getPeer().is(), "FmXGridControl::createPeer : something went wrong ... no top level peer !"); @@ -601,9 +599,9 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< ::com::sun::star::awt: // forward the design mode sal_Bool bForceAlivePeer = m_bInDraw && !maComponentInfos.bVisible; - // (we force a alive-mode peer if we're in "draw", cause in this case the peer will be used for drawing in - // foreign devices. We ensure this with the visibility check as an living peer is assumed to be noncritical - // only if invisible) + // (we force an alive-mode peer if we're in "draw", cause in this case the peer will be used for drawing in + // foreign devices. We ensure this with the visibility check as an living peer is assumed to be noncritical + // only if invisible) Any aOldCursorBookmark; if (!mbDesignMode || bForceAlivePeer) { @@ -1145,7 +1143,7 @@ FmXGridPeer::FmXGridPeer(const Reference< XMultiServiceFactory >& _rxFactory) ,m_pGridListener(NULL) ,m_xServiceFactory(_rxFactory) { - // nach diesem Constructor muss Create gerufen werden ! + // Create must be called after this constructure m_pGridListener = new GridListenerDelegator( this ); } @@ -1167,7 +1165,7 @@ void FmXGridPeer::Create(Window* pParent, WinBits nStyle) // want to hear about row selections pWin->setGridListener( m_pGridListener ); - // Init mu immer aufgerufen werden + // Init must always be called pWin->Init(); pWin->SetComponentInterface(this); @@ -1392,7 +1390,7 @@ Sequence< Any > SAL_CALL FmXGridPeer::queryFieldData( sal_Int32 nRow, const Type DbGridRowRef xPaintRow = pGrid->GetPaintRow(); ENSURE_OR_THROW( xPaintRow.Is(), "invalid paint row" ); - // die Columns des Controls brauche ich fuer GetFieldText + // I need the columns of the control for GetFieldText DbGridColumns aColumns = pGrid->GetColumns(); // und durch alle Spalten durch @@ -1428,14 +1426,14 @@ Sequence< Any > SAL_CALL FmXGridPeer::queryFieldData( sal_Int32 nRow, const Type { switch (xType.getTypeClass()) { - // Strings werden direkt ueber das GetFieldText abgehandelt + // Strings are dealt with directly by the GetFieldText case TypeClass_STRING : { String sText = aColumns[ nModelPos ]->GetCellText( xPaintRow, pGrid->getNumberFormatter() ); pReturnArray[i] <<= ::rtl::OUString(sText); } break; - // alles andere wird an der DatabaseVariant erfragt + // everything else is requested in the DatabaseVariant case TypeClass_FLOAT : pReturnArray[i] <<= xFieldContent->getFloat(); break; case TypeClass_DOUBLE : pReturnArray[i] <<= xFieldContent->getDouble(); break; case TypeClass_SHORT : pReturnArray[i] <<= (sal_Int16)xFieldContent->getShort(); break; @@ -1474,13 +1472,13 @@ void FmXGridPeer::propertyChange(const PropertyChangeEvent& evt) throw( RuntimeE if (!pGrid) return; - // DatenbankEvent + // Database event Reference< XRowSet > xCursor(evt.Source, UNO_QUERY); if (evt.PropertyName == FM_PROP_VALUE || m_xCursor == evt.Source) pGrid->propertyChange(evt); else if (pGrid && m_xColumns.is() && m_xColumns->hasElements()) { - // zunaechst raussuchen welche Column sich geaendert hat + // next find which column has changed ::comphelper::InterfaceRef xCurrent; sal_Int32 i; @@ -1541,7 +1539,7 @@ void FmXGridPeer::propertyChange(const PropertyChangeEvent& evt) throw( RuntimeE } else if (evt.PropertyName == FM_PROP_ALIGN) { - // it design mode it doesn't matter + // in design mode it doesn't matter if (!isDesignMode()) { DbGridColumn* pCol = pGrid->GetColumns().at( i ); @@ -2085,8 +2083,8 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V sal_Bool bValue( sal_True ); OSL_VERIFY( Value >>= bValue ); - // Im DesignModus nur das Datenfenster disablen - // Sonst kann das Control nicht mehr konfiguriert werden + // In design mode, disable only the data window. + // Else the control cannot be configured anymore. if (isDesignMode()) pGrid->GetDataWindow().Enable( bValue ); else @@ -2231,7 +2229,7 @@ void FmXGridPeer::startCursorListening() if (xReset.is()) xReset->addResetListener(this); - // alle Listener anmelden + // register all listeners Reference< XPropertySet > xSet(m_xCursor, UNO_QUERY); if (xSet.is()) { @@ -2284,7 +2282,7 @@ void FmXGridPeer::setRowSet(const Reference< XRowSet >& _rDatabaseCursor) throw( FmGridControl* pGrid = (FmGridControl*) GetWindow(); if (!pGrid || !m_xColumns.is() || !m_xColumns->getCount()) return; - // alle Listener abmelden + // unregister all listeners if (m_xCursor.is()) { Reference< XLoadable > xLoadable(m_xCursor, UNO_QUERY); @@ -2370,14 +2368,15 @@ void FmXGridPeer::selectionChanged(const EventObject& evt) throw( RuntimeExcepti break; } } - // fuer das VCL-Control muessen die Columns 1-basiert sein - // die Selektion an das VCL-Control weiterreichen, wenn noetig + // The columns have to be 1-based for the VCL control. + // If necessary, pass on the selection to the VCL control if ( i != pGrid->GetSelectedColumn() ) { // (wenn das nicht greift, wurde das selectionChanged implizit von dem Control selber ausgeloest + // if this does not ?hold?catch?, the selectionChanged is cleared by the Control itself if ( i < nColCount ) { pGrid->SelectColumnPos(pGrid->GetViewColumnPos(pGrid->GetColumnIdFromModelPos( (sal_uInt16)i )) + 1, sal_True); - // SelectColumnPos hat wieder zu einem impliziten ActivateCell gefuehrt + // SelectColumnPos has led to an implicit ActivateCell again if (pGrid->IsEditing()) pGrid->DeactivateCell(); } @@ -2551,8 +2550,8 @@ Reference< ::com::sun::star::frame::XDispatch > FmXGridPeer::queryDispatch(cons if (m_xFirstDispatchInterceptor.is() && !m_bInterceptingDispatch) { m_bInterceptingDispatch = sal_True; - // safety against recursion : as we are master of the first chain element and slave of the last one we would - // have an infinite loop without this if no dispatcher can fullfill the rewuest) + // safety against recursion : as we are master of the first chain element and slave of the last one we would + // have an infinite loop without this if no dispatcher can fullfill the request xResult = m_xFirstDispatchInterceptor->queryDispatch(aURL, aTargetFrameName, nSearchFlags); m_bInterceptingDispatch = sal_False; } diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 8849ca59958b..54e80fbfe262 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -246,10 +246,6 @@ SdrCreateView::~SdrCreateView() SdrObject::Free( pAktCreate ); } -void SdrCreateView::ImpDelCreateAttr() -{ -} - sal_Bool SdrCreateView::IsAction() const { return SdrDragView::IsAction() || pAktCreate!=NULL; diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 18876c50a14d..d4464b6ccdbb 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -461,12 +461,6 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(Window* pWin, sal_Bool /*bNoPa return pOutlView; } -sal_Bool SdrObjEditView::IsTextEditFrame() const -{ - SdrTextObj* pText = dynamic_cast< SdrTextObj* >( mxTextEditObj.get() ); - return pText!=NULL && pText->IsTextFrame(); -} - IMPL_LINK(SdrObjEditView,ImpOutlinerStatusEventHdl,EditStatus*,pEditStat) { if(pTextEditOutliner ) @@ -1124,24 +1118,6 @@ sal_Bool SdrObjEditView::IsTextEditFrameHit(const Point& rHit) const return bOk; } -void SdrObjEditView::AddTextEditOfs(MouseEvent& rMEvt) const -{ - if(mxTextEditObj.is()) - { - Point aPvOfs; - SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( mxTextEditObj.get() ); - - if( pTextObj ) - { - // #108784# - aPvOfs += pTextObj->GetTextEditOffset(); - } - - Point aObjOfs(mxTextEditObj->GetLogicRect().TopLeft()); - (Point&)(rMEvt.GetPosPixel())+=aPvOfs+aObjOfs; - } -} - //////////////////////////////////////////////////////////////////////////////////////////////////// sal_Bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, Window* pWin) @@ -1317,51 +1293,6 @@ sal_Bool SdrObjEditView::Command(const CommandEvent& rCEvt, Window* pWin) return SdrGlueEditView::Command(rCEvt,pWin); } -sal_Bool SdrObjEditView::Cut(sal_uIntPtr nFormat) -{ - if (pTextEditOutliner!=NULL) { - pTextEditOutlinerView->Cut(); -#ifdef DBG_UTIL - if (pItemBrowser!=NULL) pItemBrowser->SetDirty(); -#endif - ImpMakeTextCursorAreaVisible(); - return sal_True; - } else { - return SdrGlueEditView::Cut(nFormat); - } -} - -sal_Bool SdrObjEditView::Yank(sal_uIntPtr nFormat) -{ - if (pTextEditOutliner!=NULL) { - pTextEditOutlinerView->Copy(); - return sal_True; - } else { - return SdrGlueEditView::Yank(nFormat); - } -} - -sal_Bool SdrObjEditView::Paste(Window* pWin, sal_uIntPtr nFormat) -{ - if (pTextEditOutliner!=NULL) { - if (pWin!=NULL) { - OutlinerView* pNewView=ImpFindOutlinerView(pWin); - if (pNewView!=NULL) { - pNewView->Paste(); - } - } else { - pTextEditOutlinerView->Paste(); - } -#ifdef DBG_UTIL - if (pItemBrowser!=NULL) pItemBrowser->SetDirty(); -#endif - ImpMakeTextCursorAreaVisible(); - return sal_True; - } else { - return SdrGlueEditView::Paste(pWin,nFormat); - } -} - //////////////////////////////////////////////////////////////////////////////////////////////////// sal_Bool SdrObjEditView::ImpIsTextEditAllSelected() const diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index 453800ffac0d..d1fc85affb5a 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -487,17 +487,6 @@ SdrEngineDefaults& SdrEngineDefaults::GetDefaults() //////////////////////////////////////////////////////////////////////////////////////////////////// -void SdrEngineDefaults::LanguageHasChanged() -{ - SdrGlobalData& rGlobalData=GetSdrGlobalData(); - if (rGlobalData.pResMgr!=NULL) { - delete rGlobalData.pResMgr; - rGlobalData.pResMgr=NULL; - } -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - SdrOutliner* SdrMakeOutliner( sal_uInt16 nOutlinerMode, SdrModel* pModel ) { //SdrEngineDefaults& rDefaults = SdrEngineDefaults::GetDefaults(); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 0be5e6843903..c3a3fa2503c1 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -956,7 +956,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM { ByteString aSkipComment; - if( rAct.GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL ) + if (rAct.GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN"))) { MetaGradientExAction* pAct = (MetaGradientExAction*) pMtf->NextAction(); @@ -1019,7 +1019,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM while( pSkipAct && ((pSkipAct->GetType() != META_COMMENT_ACTION ) - || (((MetaCommentAction*)pSkipAct)->GetComment().CompareIgnoreCaseToAscii(aSkipComment.GetBuffer()) != COMPARE_EQUAL))) + || !(((MetaCommentAction*)pSkipAct)->GetComment().equalsIgnoreAsciiCase(aSkipComment)))) { pSkipAct = pMtf->NextAction(); } diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 62ee66b233de..abf2b1177c21 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -101,18 +101,10 @@ public: #define INDIVIDUAL_COUNT (4) SdrHdlBitmapSet::SdrHdlBitmapSet(sal_uInt16 nResId) -: maMarkersBitmap(), + : maMarkersBitmap(ResId(nResId, *ImpGetResMgr())), // 14 kinds (BitmapMarkerKind) use index [0..5], 4 extra - maRealMarkers((KIND_COUNT * INDEX_COUNT) + INDIVIDUAL_COUNT) + maRealMarkers((KIND_COUNT * INDEX_COUNT) + INDIVIDUAL_COUNT) { - // #101928# change color used for transparent parts to 0x00ff00ff (ImageList standard) - const Color aColTransparent(0x00ff00ff); - const Bitmap aBitmap(ResId(nResId, *ImpGetResMgr())); - const Bitmap aMask(aBitmap.CreateMask(aColTransparent)); - - // create a real BitmapEx with an AlphaMask - maMarkersBitmap = BitmapEx(aBitmap, aMask); - // maMarkersBitmap = BitmapEx(aBitmap, aColTransparent); } SdrHdlBitmapSet::~SdrHdlBitmapSet() @@ -672,7 +664,7 @@ BitmapEx SdrHdl::ImpGetBitmapEx( BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd eKindOfMarker = GetNextBigger(eKindOfMarker); } - // #97016# II This handle has the focus, visualize it + // This handle has the focus, visualize it if(IsFocusHdl() && pHdlList && pHdlList->GetFocusHdl() == this) { // create animated handle @@ -713,12 +705,12 @@ BitmapEx SdrHdl::ImpGetBitmapEx( BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd if(eKindOfMarker == Anchor || eKindOfMarker == AnchorPressed) { - // #98388# when anchor is used take upper left as reference point inside the handle + // when anchor is used take upper left as reference point inside the handle pRetval = new ::sdr::overlay::OverlayAnimatedBitmapEx(rPos, aBmpEx1, aBmpEx2, nBlinkTime); } else if(eKindOfMarker == AnchorTR || eKindOfMarker == AnchorPressedTR) { - // #101688# AnchorTR for SW, take top right as (0,0) + // AnchorTR for SW, take top right as (0,0) pRetval = new ::sdr::overlay::OverlayAnimatedBitmapEx(rPos, aBmpEx1, aBmpEx2, nBlinkTime, (sal_uInt16)(aBmpEx1.GetSizePixel().Width() - 1), 0, (sal_uInt16)(aBmpEx2.GetSizePixel().Width() - 1), 0); @@ -735,18 +727,17 @@ BitmapEx SdrHdl::ImpGetBitmapEx( BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd } else { - // create normal handle - // #101928# use ImpGetBitmapEx(...) now + // create normal handle: use ImpGetBitmapEx(...) now BitmapEx aBmpEx = ImpGetBitmapEx(eKindOfMarker, (sal_uInt16)eColIndex, bIsFineHdl ); if(eKindOfMarker == Anchor || eKindOfMarker == AnchorPressed) { - // #98388# upper left as reference point inside the handle for AnchorPressed, too + // upper left as reference point inside the handle for AnchorPressed, too pRetval = new ::sdr::overlay::OverlayBitmapEx(rPos, aBmpEx); } else if(eKindOfMarker == AnchorTR || eKindOfMarker == AnchorPressedTR) { - // #101688# AnchorTR for SW, take top right as (0,0) + // AnchorTR for SW, take top right as (0,0) pRetval = new ::sdr::overlay::OverlayBitmapEx(rPos, aBmpEx, (sal_uInt16)(aBmpEx.GetSizePixel().Width() - 1), 0); } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index becc523e27e1..9dd2e62444b5 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -802,12 +802,12 @@ void SdrMarkView::SetMarkHandles() // Drehpunkt/Spiegelachse AddDragModeHdl(eDragMode); - // add custom handles (used by other apps, e.g. AnchorPos) - AddCustomHdl(); - // sort handles aHdl.Sort(); + // add custom handles (used by other apps, e.g. AnchorPos) + AddCustomHdl(); + // #105722# try to restore focus handle index from remembered values if(bSaveOldFocus) { diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 13ea61e2217d..301958f60838 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -72,39 +72,6 @@ SdrExchangeView::SdrExchangeView(SdrModel* pModel1, OutputDevice* pOut): { } -//////////////////////////////////////////////////////////////////////////////////////////////////// - -Point SdrExchangeView::GetViewCenter(const OutputDevice* pOut) const -{ - Point aCenter; - if (pOut==NULL) - { - pOut = GetFirstOutputDevice(); - } - if (pOut!=NULL) { - Point aOfs=pOut->GetMapMode().GetOrigin(); - Size aOutSiz=pOut->GetOutputSize(); - aOutSiz.Width()/=2; - aOutSiz.Height()/=2; - aCenter.X()=aOutSiz.Width() -aOfs.X(); - aCenter.Y()=aOutSiz.Height()-aOfs.Y(); - } - return aCenter; -} - -Point SdrExchangeView::GetPastePos(SdrObjList* pLst, OutputDevice* pOut) -{ - Point aP(GetViewCenter(pOut)); - SdrPage* pPg=NULL; - if (pLst!=NULL) pPg=pLst->GetPage(); - if (pPg!=NULL) { - Size aSiz(pPg->GetSize()); - aP.X()=aSiz.Width()/2; - aP.Y()=aSiz.Height()/2; - } - return aP; -} - sal_Bool SdrExchangeView::ImpLimitToWorkArea(Point& rPt) const { sal_Bool bRet(sal_False); @@ -168,40 +135,6 @@ sal_Bool SdrExchangeView::ImpGetPasteLayer(const SdrObjList* pObjList, SdrLayerI return bRet; } -//////////////////////////////////////////////////////////////////////////////////////////////////// - -sal_Bool SdrExchangeView::Paste(const GDIMetaFile& rMtf, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions) -{ - Point aPos(rPos); - ImpGetPasteObjList(aPos,pLst); - ImpLimitToWorkArea( aPos ); - if (pLst==NULL) return sal_False; - SdrLayerID nLayer; - if (!ImpGetPasteLayer(pLst,nLayer)) return sal_False; - sal_Bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit(); - if (bUnmark) UnmarkAllObj(); - SdrGrafObj* pObj=new SdrGrafObj(Graphic(rMtf)); - pObj->SetLayer(nLayer); - ImpPasteObject(pObj,*pLst,aPos,rMtf.GetPrefSize(),rMtf.GetPrefMapMode(),nOptions); - return sal_True; -} - -sal_Bool SdrExchangeView::Paste(const Bitmap& rBmp, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions) -{ - Point aPos(rPos); - ImpGetPasteObjList(aPos,pLst); - ImpLimitToWorkArea( aPos ); - if (pLst==NULL) return sal_False; - SdrLayerID nLayer; - if (!ImpGetPasteLayer(pLst,nLayer)) return sal_False; - sal_Bool bUnmark=(nOptions&(SDRINSERT_DONTMARK|SDRINSERT_ADDMARK))==0 && !IsTextEdit(); - if (bUnmark) UnmarkAllObj(); - SdrGrafObj* pObj=new SdrGrafObj(Graphic(rBmp)); - pObj->SetLayer(nLayer); - ImpPasteObject(pObj,*pLst,aPos,rBmp.GetSizePixel(),MapMode(MAP_PIXEL),nOptions); - return sal_True; -} - sal_Bool SdrExchangeView::Paste(const XubString& rStr, const Point& rPos, SdrObjList* pLst, sal_uInt32 nOptions) { if(!rStr.Len()) diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 9c47a215fbb0..f7330dc40ec3 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -72,13 +72,12 @@ using ::com::sun::star::lang::XMultiServiceFactory; const MetaCommentAction* ImplCheckForEPS( GDIMetaFile& rMtf ) { - static ByteString aComment( (const sal_Char*)"EPSReplacementGraphic" ); const MetaCommentAction* pComment = NULL; if ( ( rMtf.GetActionSize() >= 2 ) && ( rMtf.FirstAction()->GetType() == META_EPS_ACTION ) && ( ((const MetaAction*)rMtf.GetAction( 1 ))->GetType() == META_COMMENT_ACTION ) - && ( ((const MetaCommentAction*)rMtf.GetAction( 1 ))->GetComment() == aComment ) ) + && ( ((const MetaCommentAction*)rMtf.GetAction( 1 ))->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("EPSReplacementGraphic")) ) ) pComment = (const MetaCommentAction*)rMtf.GetAction( 1 ); return pComment; diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk index b2ce776cd635..a8ee38387d4b 100644 --- a/sw/Library_sw.mk +++ b/sw/Library_sw.mk @@ -615,6 +615,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\ sw/source/ui/frmdlg/frmmgr \ sw/source/ui/globdoc/globdoc \ sw/source/ui/index/idxmrk \ + sw/source/ui/dialog/wordcountwrapper \ sw/source/ui/index/toxmgr \ sw/source/ui/lingu/hhcwrp \ sw/source/ui/lingu/hyp \ diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx index 1dd769912c06..50e80967c5ee 100644 --- a/sw/inc/IDocumentSettingAccess.hxx +++ b/sw/inc/IDocumentSettingAccess.hxx @@ -79,9 +79,10 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd PROTECT_FORM, // #i89181# TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, - INVERT_BORDER_SPACING, + INVERT_BORDER_SPACING, COLLAPSE_EMPTY_CELL_PARA, SMALL_CAPS_PERCENTAGE_66, + TAB_OVERFLOW, // COMPATIBILITY FLAGS END BROWSE_MODE, diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index fae2a9506e09..94d9692bbd21 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -614,7 +614,7 @@ included in c-context files, so c++ style stuff will cause problems. #define FN_TABLE_MODE_FIX (FN_FORMAT + 189) /* table mode */ #define FN_TABLE_MODE_FIX_PROP (FN_FORMAT + 190) /* -"- */ #define FN_TABLE_MODE_VARIABLE (FN_FORMAT + 191) /* -"- */ -#define FN_TABLE_BOX_TEXTDIRECTION (FN_FORMAT + 192) /* text direction of table cells */ +#define FN_TABLE_BOX_TEXTORIENTATION (FN_FORMAT + 192) /* text orientation of table cells */ #define FN_TABLE_AUTOSUM (FN_FORMAT + 195) /* */ #define FN_SET_CONTROL_HANDLER (FN_FORMAT + 199) /* set macro */ diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 3461e6d10b43..656b0b7eb8fe 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -579,6 +579,7 @@ private: bool mbCollapseEmptyCellPara : 1; bool mbTabAtLeftIndentForParagraphsInList; // #i89181# - see above bool mbSmallCapsPercentage66; + bool mbTabOverflow; bool mbLastBrowseMode : 1; diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 597f02e626a1..1ad155504eda 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -47,7 +47,6 @@ // forward declarations // --------------------- -class SvUShorts; class SwCntntFrm; class SwCntntNode; class SwDoc; diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index b92816993740..2c6045ca1e87 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -114,8 +114,8 @@ class AbstractFldInputDlg : public VclAbstractDialog //add for SwFldInputDlg { public: //from class SalFrame - virtual void SetWindowState( const ByteString& rStr ) = 0; - virtual ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const = 0; + virtual void SetWindowState( const rtl::OString & rStr ) = 0; + virtual rtl::OString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const = 0; }; class AbstractInsFootNoteDlg : public VclAbstractDialog //add for SwInsFootNoteDlg @@ -200,10 +200,11 @@ public: virtual void SetSectionData(SwSectionData const& rSect) = 0; }; -class AbstractSwWordCountDialog : public VclAbstractDialog +class AbstractSwWordCountFloatDlg : public VclAbstractDialog { public: - virtual void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) = 0; + virtual void UpdateCounts() = 0; + virtual Window * GetWindow() = 0; //this method is added for return a Window type pointer }; class AbstractSwInsertAbstractDlg : public VclAbstractDialog // add for SwInsertAbstractDlg @@ -256,8 +257,8 @@ public: class AbstractDropDownFieldDialog : public VclAbstractDialog //add for DropDownFieldDialog { public: - virtual ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const = 0; //this method inherit from SystemWindow - virtual void SetWindowState( const ByteString& rStr ) =0;//this method inherit from SystemWindow + virtual rtl::OString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const = 0; //this method inherit from SystemWindow + virtual void SetWindowState( const rtl::OString & rStr ) =0;//this method inherit from SystemWindow }; class AbstractSwLabDlg : public SfxAbstractTabDialog //add for SwLabDlg @@ -353,7 +354,12 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame, sal_uInt32 nResId ) = 0; - virtual AbstractSwWordCountDialog* CreateSwWordCountDialog( Window* pWindow ) = 0; + virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(int nResId, + SfxBindings* pBindings, + SfxChildWindow* pChild, + Window *pParent, + SfxChildWinInfo* pInfo) = 0; + virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg ( Window* pParent, int nResId) = 0; // add for SwInsertAbstractDlg virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh, SvStream* pStream, int nResId ) = 0;// add for SwAsciiFilterDlg diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index ca036da3a048..2b1ee116b6fb 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -57,7 +57,6 @@ namespace utl{ class Size; class ResMgr; class UniString; -class ByteString; class SwPathFinder; class Graphic; class OutputDevice; diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 1dc2c8c99f4e..4c03c4c147a9 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -185,9 +185,9 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/, { (void)r; #if OSL_DEBUG_LEVEL > 1 - ByteString aError( "Runtime exception caught while notifying shape.:\n" ); - aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - OSL_FAIL( aError.GetBuffer() ); + rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM("Runtime exception caught while notifying shape.:\n")); + aError.append(rtl::OUStringToOString(r.Message, RTL_TEXTENCODING_ASCII_US)); + OSL_FAIL( aError.getStr() ); #endif } } diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index aef0e49db0ff..c5128627cf08 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -202,6 +202,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const case INVERT_BORDER_SPACING: return mbInvertBorderSpacing; case COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara; case SMALL_CAPS_PERCENTAGE_66: return mbSmallCapsPercentage66; + case TAB_OVERFLOW: return mbTabOverflow; case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked! case HTML_MODE: return mbHTMLMode; @@ -336,6 +337,10 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) case SMALL_CAPS_PERCENTAGE_66: mbSmallCapsPercentage66 = value; break; + + case TAB_OVERFLOW: + mbTabOverflow = value; + break; // COMPATIBILITY FLAGS END case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx index 00c6d40b5d91..4f621331132c 100644 --- a/sw/source/core/doc/docbasic.cxx +++ b/sw/source/core/doc/docbasic.cxx @@ -128,8 +128,8 @@ sal_Bool SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs Sequence< sal_Int16 > aOutArgsIndex; Sequence< Any > aOutArgs; - OSL_TRACE( "SwDoc::ExecMacro URL is %s", ByteString( rMacro.GetMacName(), - RTL_TEXTENCODING_UTF8).GetBuffer() ); + OSL_TRACE( "SwDoc::ExecMacro URL is %s", rtl::OUStringToOString( rMacro.GetMacName(), + RTL_TEXTENCODING_UTF8).getStr() ); eErr = pDocShell->CallXScript( rMacro.GetMacName(), *pUnoArgs, aRet, aOutArgsIndex, aOutArgs); @@ -242,8 +242,8 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve Sequence< sal_Int16 > aOutArgsIndex; Sequence< Any > aOutArgs; - OSL_TRACE( "SwDoc::CallEvent URL is %s", ByteString( - rMacro.GetMacName(), RTL_TEXTENCODING_UTF8).GetBuffer() ); + OSL_TRACE( "SwDoc::CallEvent URL is %s", rtl::OUStringToOString( + rMacro.GetMacName(), RTL_TEXTENCODING_UTF8).getStr() ); nRet += 0 == pDocShell->CallXScript( rMacro.GetMacName(), *pUnoArgs,aRet, aOutArgsIndex, aOutArgs) ? 1 : 0; diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 239238e23417..3a81493629f9 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -52,7 +52,7 @@ #include <fmtfld.hxx> #include <tox.hxx> #include <txttxmrk.hxx> -#include <docfld.hxx> // fuer Expression-Felder +#include <docfld.hxx> // for expression fields #include <docufld.hxx> #include <ddefld.hxx> #include <usrfld.hxx> @@ -69,7 +69,7 @@ #include <authfld.hxx> #include <txtinet.hxx> #include <fmtcntnt.hxx> -#include <poolfmt.hrc> // fuer InitFldTypes +#include <poolfmt.hrc> // for InitFldTypes #include <SwUndoField.hxx> #include "switerator.hxx" @@ -82,12 +82,11 @@ extern sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, SV_IMPL_OP_PTRARR_SORT( _SetGetExpFlds, _SetGetExpFldPtr ) /*-------------------------------------------------------------------- - Beschreibung: Feldtypen einfuegen + Description: Insert field types --------------------------------------------------------------------*/ /* - * Implementierung der Feldfunktionen am Doc - * Return immer einen gueltigen Pointer auf den Typ. Wenn er also neu - * zugefuegt oder schon vorhanden ist. + * Implementation of field methods at the Doc + * Always returns a pointer to the type, if it's new or already added. */ SwFieldType* SwDoc::InsertFldType(const SwFieldType &rFldTyp) { @@ -99,14 +98,13 @@ SwFieldType* SwDoc::InsertFldType(const SwFieldType &rFldTyp) switch( nFldWhich ) { case RES_SETEXPFLD: - //JP 29.01.96: SequenceFelder beginnen aber bei INIT_FLDTYPES - 3!! - // Sonst gibt es doppelte Nummernkreise!! - //MIB 14.03.95: Ab sofort verlaesst sich auch der SW3-Reader - //beim Aufbau der String-Pools und beim Einlesen von SetExp-Feldern - //hierauf + //JP 29.01.96: SequenceFields start at INIT_FLDTYPES - 3!! + // Or we get doubble number circles!! + //MIB 14.03.95: From now on also the SW3-Reader relies on this, when + //constructing string pools and when reading SetExp fields if( nsSwGetSetExpType::GSE_SEQ & ((SwSetExpFieldType&)rFldTyp).GetType() ) i -= INIT_SEQ_FLDTYPES; - // kein break; + // no break; case RES_DBFLD: case RES_USERFLD: case RES_DDEFLD: @@ -149,7 +147,7 @@ SwFieldType* SwDoc::InsertFldType(const SwFieldType &rFldTyp) case RES_USERFLD: case RES_SETEXPFLD: ((SwValueFieldType*)pNew)->SetDoc( this ); - // JP 29.07.96: opt. FeldListe fuer den Calculator vorbereiten: + // JP 29.07.96: Optionally prepare FieldList for Calculator: pUpdtFlds->InsertFldType( *pNew ); break; case RES_AUTHORITY : @@ -165,18 +163,17 @@ SwFieldType* SwDoc::InsertFldType(const SwFieldType &rFldTyp) void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp ) { - // der FeldTyp wurde als geloescht gekennzeichnet und aus dem - // Array entfernt. Nun muss man nach diesem wieder suchen. - // - Ist der nicht vorhanden, dann kann er eingefuegt werden. - // - Wird genau der gleiche Typ gefunden, dann muss der geloeschte - // einen anderen Namen erhalten. + // The FldType was marked as deleted and removed from the array. + // One has to look this up again, now. + // - If it's not present, it can be re-inserted. + // - If the same type is found, the deleted one has to be renamed. sal_uInt16 nSize = pFldTypes->Count(), nFldWhich = rFldTyp.Which(); sal_uInt16 i = INIT_FLDTYPES; OSL_ENSURE( RES_SETEXPFLD == nFldWhich || RES_USERFLD == nFldWhich || - RES_DDEFLD == nFldWhich, "Falscher FeldTyp" ); + RES_DDEFLD == nFldWhich, "Wrong FldType" ); const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore(); const String& rFldNm = rFldTyp.GetName(); @@ -186,7 +183,7 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp ) if( nFldWhich == (pFnd = (*pFldTypes)[i])->Which() && rSCmp.isEqual( rFldNm, pFnd->GetName() ) ) { - // neuen Namen suchen + // find new name sal_uInt16 nNum = 1; do { String sSrch( rFldNm ); @@ -196,17 +193,17 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp ) rSCmp.isEqual( sSrch, pFnd->GetName() ) ) break; - if( i >= nSize ) // nicht gefunden + if( i >= nSize ) // not found { ((String&)rFldNm) = sSrch; - break; // raus aus der While-Schleife + break; // exit while loop } ++nNum; } while( sal_True ); break; } - // nicht gefunden, also eintragen und Flag loeschen + // not found, so insert and delete flag pFldTypes->Insert( &rFldTyp, nSize ); switch( nFldWhich ) { @@ -223,27 +220,27 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp ) } /*-------------------------------------------------------------------- - Beschreibung: Feldtypen loeschen + Description: Remove field type --------------------------------------------------------------------*/ void SwDoc::RemoveFldType(sal_uInt16 nFld) { - OSL_ENSURE( INIT_FLDTYPES <= nFld, "keine InitFields loeschen" ); + OSL_ENSURE( INIT_FLDTYPES <= nFld, "don't remove InitFlds" ); /* - * Abheangige Felder vorhanden -> ErrRaise + * Dependent fields present -> ErrRaise */ sal_uInt16 nSize = pFldTypes->Count(); if(nFld < nSize) { SwFieldType* pTmp = (*pFldTypes)[nFld]; - // JP 29.07.96: opt. FeldListe fuer den Calculator vorbereiten: + // JP 29.07.96: Optionally prepare FldLst for Calculator sal_uInt16 nWhich = pTmp->Which(); switch( nWhich ) { case RES_SETEXPFLD: case RES_USERFLD: pUpdtFlds->RemoveFldType( *pTmp ); - // kein break; + // no break; case RES_DDEFLD: if( pTmp->GetDepends() && !IsUsed( *pTmp ) ) { @@ -260,8 +257,8 @@ void SwDoc::RemoveFldType(sal_uInt16 nFld) if( nWhich ) { - OSL_ENSURE( !pTmp->GetDepends(), "Abhaengige vorh.!" ); - // Feldtype loschen + OSL_ENSURE( !pTmp->GetDepends(), "Dependent fields present!" ); + // delete field type delete pTmp; } pFldTypes->Remove( nFld ); @@ -275,7 +272,7 @@ const SwFldTypes* SwDoc::GetFldTypes() const } /*-------------------------------------------------------------------- - Beschreibung: Den ersten Typen mit ResId und Namen finden + Description: Find first type with ResId and name --------------------------------------------------------------------*/ SwFieldType* SwDoc::GetFldType( sal_uInt16 nResId, const String& rName, bool bDbFieldMatching // used in some UNO calls for RES_DBFLD @@ -289,11 +286,10 @@ SwFieldType* SwDoc::GetFldType( sal_uInt16 nResId, const String& rName, switch( nResId ) { case RES_SETEXPFLD: - //JP 29.01.96: SequenceFelder beginnen aber bei INIT_FLDTYPES - 3!! - // Sonst gibt es doppelte Nummernkreise!! - //MIB 14.03.95: Ab sofort verlaesst sich auch der SW3-Reader - //beim Aufbau der String-Pools und beim Einlesen von SetExp-Feldern - //hierauf + //JP 29.01.96: SequenceFields start at INIT_FLDTYPES - 3!! + // Or we get doubble number circles!! + //MIB 14.03.95: From now on also the SW3-Reader relies on this, when + //constructing string pools and when reading SetExp fields i = INIT_FLDTYPES - INIT_SEQ_FLDTYPES; break; @@ -325,28 +321,28 @@ SwFieldType* SwDoc::GetFldType( sal_uInt16 nResId, const String& rName, } /************************************************************************* -|* SwDoc::UpdateFlds() -|* Beschreibung Felder updaten +|* SwDoc::UpdateFlds() +|* Description: Update fields *************************************************************************/ /* - * Alle sollen neu evaluiert werden. + * All have to be re-evaluated. */ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB ) { - // Modify() fuer jeden Feldtypen rufen, - // abhaengige SwTxtFld werden benachrichtigt ... + // Call modify() for every field type, + // dependent SwTxtFld get notified ... for( sal_uInt16 i=0; i < pFldTypes->Count(); ++i) { switch( (*pFldTypes)[i]->Which() ) { - // Tabellen-Felder als vorletztes Updaten - // Referenzen als letztes Updaten + // Update table fields second to last + // Update references at last case RES_GETREFFLD: case RES_TABLEFLD: case RES_DBFLD: case RES_JUMPEDITFLD: - case RES_REFPAGESETFLD: // werden nie expandiert! + case RES_REFPAGESETFLD: // are never expanded! break; case RES_DDEFLD: @@ -364,7 +360,7 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB ) case RES_SETEXPFLD: case RES_HIDDENTXTFLD: case RES_HIDDENPARAFLD: - // Expression-Felder werden gesondert behandelt + // Expression fields are treated seperately if( !pNewHt ) break; default: @@ -373,18 +369,18 @@ void SwDoc::UpdateFlds( SfxPoolItem *pNewHt, bool bCloseDB ) } if( !IsExpFldsLocked() ) - UpdateExpFlds( 0, sal_False ); // Expression-Felder Updaten + UpdateExpFlds( 0, sal_False ); // update expression fields - // Tabellen + // Tables UpdateTblFlds(pNewHt); - // Referenzen + // References UpdateRefFlds(pNewHt); if( bCloseDB ) GetNewDBMgr()->CloseAll(); - // Nur bei KomplettUpdate evaluieren + // Only evaluate on CompleteUpdate SetModified(); } @@ -411,7 +407,7 @@ void SwDoc::UpdateUsrFlds() } /*-------------------------------------------------------------------- - Beschreibung: Referenzfelder und TableFelder erneuern + Description: Update reference and table fields --------------------------------------------------------------------*/ void SwDoc::UpdateRefFlds( SfxPoolItem* pHt ) { @@ -424,7 +420,7 @@ void SwDoc::UpdateRefFlds( SfxPoolItem* pHt ) void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) { OSL_ENSURE( !pHt || RES_TABLEFML_UPDATE == pHt->Which(), - "Was ist das fuer ein MessageItem?" ); + "What MessageItem is this?" ); SwFieldType* pFldType(0); @@ -445,7 +441,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) if( pUpdtFld ) { - // bestimme Tabelle, in der das Feld steht + // table where this field is located const SwTableNode* pTblNd; const SwTxtNode& rTxtNd = pFmtFld->GetTxtFld()->GetTxtNode(); if( !rTxtNd.GetNodes().IsDocNodes() || @@ -455,30 +451,30 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) switch( pUpdtFld->eFlags ) { case TBL_CALC: - // setze das Value-Flag zurueck - // JP 17.06.96: interne Darstellung auf alle Formeln - // (Referenzen auf andere Tabellen!!!) + // re-set the value flag + // JP 17.06.96: internal representation of all formulas + // (reference to other table!!!) if( nsSwExtendedSubType::SUB_CMD & pFld->GetSubType() ) pFld->PtrToBoxNm( pUpdtFld->pTbl ); else pFld->ChgValid( sal_False ); break; case TBL_BOXNAME: - // ist es die gesuchte Tabelle ?? + // is this the wanted table? if( &pTblNd->GetTable() == pUpdtFld->pTbl ) - // zur externen Darstellung + // to the external representation pFld->PtrToBoxNm( pUpdtFld->pTbl ); break; case TBL_BOXPTR: - // zur internen Darstellung - // JP 17.06.96: interne Darstellung auf alle Formeln - // (Referenzen auf andere Tabellen!!!) + // to the internal representation + // JP 17.06.96: internal representation on all formulas + // (reference to other table!!!) pFld->BoxNmToPtr( pUpdtFld->pTbl ); break; case TBL_RELBOXNAME: - // ist es die gesuchte Tabelle ?? + // is this the wanted table? if( &pTblNd->GetTable() == pUpdtFld->pTbl ) - // zur relativen Darstellung + // to the relative representation pFld->ToRelBoxNm( pUpdtFld->pTbl ); break; default: @@ -486,7 +482,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) } } else - // setze bei allen das Value-Flag zurueck + // reset the value flag for all pFld->ChgValid( sal_False ); } } @@ -496,7 +492,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) pFldType = 0; } - // und dann noch alle Tabellen Box Formeln abklappern + // process all table box formuals const SfxPoolItem* pItem; sal_uInt32 nMaxItems = GetAttrPool().GetItemCount2( RES_BOXATR_FORMULA ); for (sal_uInt32 i = 0; i < nMaxItems; ++i) @@ -509,7 +505,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) } - // alle Felder/Boxen sind jetzt invalide, also kann das Rechnen anfangen + // all fields/boxes are now invalid, so we can start to calculate if( pHt && ( RES_TABLEFML_UPDATE != pHt->Which() || TBL_CALC != ((SwTableFmlUpdate*)pHt)->eFlags )) return ; @@ -530,10 +526,10 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) (pFld = (SwTblField*)pFmtFld->GetFld())->GetSubType() )) continue; - // muss neu berechnet werden (und ist keine textuelle Anzeige) + // needs to be recalculated (and is no textual note) if( !pFld->IsValid() ) { - // bestimme Tabelle, in der das Feld steht + // table where this field is located const SwTxtNode& rTxtNd = pFmtFld->GetTxtFld()->GetTxtNode(); if( !rTxtNd.GetNodes().IsDocNodes() ) continue; @@ -541,8 +537,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) if( !pTblNd ) continue; - // falls dieses Feld nicht in der zu updatenden - // Tabelle steht, ueberspringen !! + // if this field is not in the to-be-updated table, skip it if( pHt && &pTblNd->GetTable() != ((SwTableFmlUpdate*)pHt)->pTbl ) continue; @@ -550,13 +545,13 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) if( !pCalc ) pCalc = new SwCalc( *this ); - // bestimme die Werte aller SetExpresion Felder, die - // bis zur Tabelle gueltig sind + // get the values of all SetExpresion fields, that are valid + // until the table SwFrm* pFrm = 0; if( pTblNd->GetIndex() < GetNodes().GetEndOfExtras().GetIndex() ) { - // steht im Sonderbereich, wird teuer !! - Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !! + // is in the special section, that's expensive! + Point aPt; // return the first frame of the layout - Tab.Headline!! pFrm = rTxtNd.getLayoutFrm( GetCurrentLayout(), &aPt ); if( pFrm ) { @@ -571,7 +566,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) } if( !pFrm ) { - // einen Index fuers bestimmen vom TextNode anlegen + // create index to determine the TextNode SwNodeIndex aIdx( rTxtNd ); FldsToCalc( *pCalc, _SetGetExpFld( aIdx, pFmtFld->GetTxtFld() )); @@ -586,8 +581,8 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) #if OSL_DEBUG_LEVEL > 1 else { - // mind. ein ASSERT - OSL_ENSURE( !this, "die Kettenformel konnte nicht errechnet werden" ); + // at least one ASSERT + OSL_ENSURE( !this, "the chained formula could no be calculated" ); } #endif } @@ -597,7 +592,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) } } - // dann berechene noch die Formeln an den Boxen + // calculate the formula at the boxes for (sal_uInt32 i = 0; i < nMaxItems; ++i ) { if( 0 != (pItem = GetAttrPool().GetItem2( RES_BOXATR_FORMULA, i ) ) && @@ -617,13 +612,13 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) if( !pCalc ) pCalc = new SwCalc( *this ); - // bestimme die Werte aller SetExpresion Felder, die - // bis zur Tabelle gueltig sind + // get the values of all SetExpresion fields, that are valid + // until the table SwFrm* pFrm = 0; if( pTblNd->GetIndex() < GetNodes().GetEndOfExtras().GetIndex() ) { - // steht im Sonderbereich, wird teuer !! - Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !! + // is in the special section, that's expensive! + Point aPt; // return the first frame of the layout - Tab.Headline!! SwNodeIndex aCNdIdx( *pTblNd, +2 ); SwCntntNode* pCNd = aCNdIdx.GetNode().GetCntntNode(); if( !pCNd ) @@ -640,7 +635,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) } if( !pFrm ) { - // einen Index fuers bestimmen vom TextNode anlegen + // create index to determine the TextNode SwNodeIndex aIdx( *pTblNd ); FldsToCalc( *pCalc, _SetGetExpFld( aIdx )); } @@ -655,8 +650,8 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt ) #if OSL_DEBUG_LEVEL > 1 else { - // mind. ein ASSERT - OSL_ENSURE( !this, "die Kettenformel konnte nicht errechnet werden" ); + // at least one ASSERT + OSL_ENSURE( !this, "the chained formula could no be calculated" ); } #endif } @@ -701,7 +696,7 @@ void SwDoc::UpdatePageFlds( SfxPoolItem* pMsgHnt ) SetNewFldLst(true); } -// ---- Loesche alle nicht referenzierten FeldTypen eines Dokumentes -- +// ---- Remove all unreferenced field types of a document -- void SwDoc::GCFieldTypes() { for( sal_uInt16 n = pFldTypes->Count(); n > INIT_FLDTYPES; ) @@ -740,8 +735,8 @@ void SwDoc::SetNewFldLst(bool bFlag) mbNewFldLst = bFlag; } -// der StartIndex kann optional mit angegeben werden (z.B. wenn dieser -// zuvor schon mal erfragt wurde - ist sonst eine virtuelle Methode !!) +// the StartIndex can be supplied optionally (e.g. if it was queried before - is a virtual +// method otherwise!) _SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx, const SwTxtFld* pFld, const SwIndex* pIdx ) { @@ -768,9 +763,9 @@ _SetGetExpFld::_SetGetExpFld( const SwNodeIndex& rNdIdx, nCntnt = *rINet.GetStart(); } -// Erweiterung fuer Sections: -// diese haben immer als Content-Position 0xffff !! -// Auf dieser steht nie ein Feld, maximal bis STRING_MAXLEN moeglich +// Extension for Sections: +// these always have content position 0xffff! +// There is never a field on this, only up to STRING_MAXLEN possible _SetGetExpFld::_SetGetExpFld( const SwSectionNode& rSectNd, const SwPosition* pPos ) { @@ -884,7 +879,7 @@ void _SetGetExpFld::SetBodyPos( const SwCntntFrm& rFrm ) SwDoc& rDoc = *aIdx.GetNodes().GetDoc(); SwPosition aPos( aIdx ); #if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( ::GetBodyTxtNode( rDoc, aPos, rFrm ), "wo steht das Feld" ); + OSL_ENSURE( ::GetBodyTxtNode( rDoc, aPos, rFrm ), "Where is the field?" ); #else ::GetBodyTxtNode( rDoc, aPos, rFrm ); #endif @@ -903,14 +898,14 @@ sal_Bool _SetGetExpFld::operator<( const _SetGetExpFld& rFld ) const const SwNode *pFirst = GetNodeFromCntnt(), *pNext = rFld.GetNodeFromCntnt(); - // Position gleich: nur weiter wenn beide FeldPointer besetzt sind !! + // Position is the same: continue only if both field pointers are set! if( !pFirst || !pNext ) return sal_False; - // gleiche Section ?? + // same Section? if( pFirst->StartOfSectionNode() != pNext->StartOfSectionNode() ) { - // sollte einer in der Tabelle stehen ? + // is one in the table? const SwNode *pFirstStt, *pNextStt; const SwTableNode* pTblNd = pFirst->FindTableNode(); if( pTblNd ) @@ -935,11 +930,11 @@ sal_Bool _SetGetExpFld::operator<( const _SetGetExpFld& rFld ) const } } - // ist gleiche Section, dann Feld im gleichen Node ? + // if it is the same section, then the field is in the same Node if( pFirst != pNext ) return pFirst->GetIndex() < pNext->GetIndex(); - // gleicher Node in der Section, dann Position im Node + // same Node in the Section, then Position in the Node return GetCntPosFromCntnt() < rFld.GetCntPosFromCntnt(); } @@ -1014,8 +1009,7 @@ _HashStr::_HashStr( const String& rName, const String& rText, pNext = pNxt; } -// suche nach dem Namen, ist er vorhanden, returne seinen String, sonst -// einen LeerString +// Look up the Name, if it is present, return it's String, otherwise return an empty String void LookString( SwHash** ppTbl, sal_uInt16 nSize, const String& rName, String& rRet, sal_uInt16* pPos ) { @@ -1062,10 +1056,10 @@ void lcl_CalcFld( SwDoc& rDoc, SwCalc& rCalc, const _SetGetExpFld& rSGEFld, if( nsSwGetSetExpType::GSE_EXPR & pFld->GetSubType() ) aValue.PutDouble( ((SwSetExpField*)pFld)->GetValue() ); else - // Erweiterung fuers Rechnen mit Strings + // Extension to calculate with Strings aValue.PutString( ((SwSetExpField*)pFld)->GetExpStr() ); - // setze im Calculator den neuen Wert + // set the new value in Calculator rCalc.VarChange( pFld->GetTyp()->GetName(), aValue ); } else if( pMgr ) @@ -1105,7 +1099,7 @@ void lcl_CalcFld( SwDoc& rDoc, SwCalc& rCalc, const _SetGetExpFld& rSGEFld, void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld ) { - // erzeuge die Sortierteliste aller SetFelder + // create the sorted list of all SetFields pUpdtFlds->MakeFldList( *this, mbNewFldLst, GETFLD_CALC ); mbNewFldLst = sal_False; @@ -1129,7 +1123,7 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld ) void SwDoc::FldsToCalc( SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt ) { - // erzeuge die Sortierteliste aller SetFelder + // create the sorted list of all SetFields pUpdtFlds->MakeFldList( *this, mbNewFldLst, GETFLD_CALC ); mbNewFldLst = sal_False; @@ -1152,12 +1146,12 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, sal_uLong nLastNd, sal_uInt16 nLastCnt ) void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize, const _SetGetExpFld& rToThisFld ) { - // erzeuge die Sortierteliste aller SetFelder + // create the sorted list of all SetFields pUpdtFlds->MakeFldList( *this, mbNewFldLst, GETFLD_EXPAND ); mbNewFldLst = sal_False; - // HashTabelle fuer alle String Ersetzungen, wird "one the fly" gefuellt - // (versuche eine "ungerade"-Zahl zu erzeugen) + // Hash table for all string replacements is filled on-the-fly. + // Try to fabricate an uneven number. rTblSize = (( pUpdtFlds->GetSortLst()->Count() / 7 ) + 1 ) * 7; ppHashTbl = new SwHash*[ rTblSize ]; memset( ppHashTbl, 0, sizeof( _HashStr* ) * rTblSize ); @@ -1185,27 +1179,27 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize, case RES_SETEXPFLD: if( nsSwGetSetExpType::GSE_STRING & pFld->GetSubType() ) { - // setze in der HashTabelle den neuen Wert - // ist die "Formel" ein Feld ?? + // set the new value in the hash table + // is the formula a field? SwSetExpField* pSFld = (SwSetExpField*)pFld; LookString( ppHashTbl, rTblSize, pSFld->GetFormula(), aNew ); - if( !aNew.Len() ) // nichts gefunden, dann ist - aNew = pSFld->GetFormula(); // die Formel der neue Wert + if( !aNew.Len() ) // nothing found, then the formula is + aNew = pSFld->GetFormula(); // the new value // #i3141# - update expression of field as in method // <SwDoc::UpdateExpFlds(..)> for string/text fields pSFld->ChgExpStr( aNew ); - // suche den Namen vom Feld + // look up the field's name aNew = ((SwSetExpFieldType*)pSFld->GetTyp())->GetSetRefName(); - // Eintrag vorhanden ? + // Entry present? pFnd = Find( aNew, ppHashTbl, rTblSize, &nPos ); if( pFnd ) - // Eintrag in der HashTabelle aendern + // modify entry in the hash table ((_HashStr*)pFnd)->aSetStr = pSFld->GetExpStr(); else - // neuen Eintrag einfuegen + // insert the new entry *(ppHashTbl + nPos ) = new _HashStr( aNew, pSFld->GetExpStr(), (_HashStr*)*(ppHashTbl + nPos) ); } @@ -1214,18 +1208,18 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize, { const String& rName = pFld->GetTyp()->GetName(); - // Eintrag in den HashTable eintragen - // Eintrag vorhanden ? + // Insert entry in the hash table + // Entry present? pFnd = Find( rName, ppHashTbl, rTblSize, &nPos ); String const value(pFld->ExpandField(IsClipBoard())); if( pFnd ) { - // Eintrag in der HashTabelle aendern + // modify entry in the hash table static_cast<_HashStr*>(pFnd)->aSetStr = value; } else { - // neuen Eintrag einfuegen + // insert the new entry *(ppHashTbl + nPos ) = new _HashStr( rName, value, static_cast<_HashStr *>(*(ppHashTbl + nPos))); } @@ -1258,30 +1252,30 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) sal_uInt16 nWhich, n; - // HashTabelle fuer alle String Ersetzungen, wird "one the fly" gefuellt - // (versuche eine "ungerade"-Zahl zu erzeugen) + // Hash table for all string replacements is filled on-the-fly. + // Try to fabricate an uneven number. sal_uInt16 nStrFmtCnt = (( pFldTypes->Count() / 7 ) + 1 ) * 7; SwHash** pHashStrTbl = new SwHash*[ nStrFmtCnt ]; memset( pHashStrTbl, 0, sizeof( _HashStr* ) * nStrFmtCnt ); { const SwFieldType* pFldType; - // gesondert behandeln: + // process seperately: for( n = pFldTypes->Count(); n; ) switch( ( pFldType = (*pFldTypes)[ --n ] )->Which() ) { case RES_USERFLD: { - // Eintrag vorhanden ? + // Entry present? sal_uInt16 nPos; const String& rNm = pFldType->GetName(); String sExpand(((SwUserFieldType*)pFldType)->Expand(nsSwGetSetExpType::GSE_STRING, 0, 0)); SwHash* pFnd = Find( rNm, pHashStrTbl, nStrFmtCnt, &nPos ); if( pFnd ) - // Eintrag in der HashTabelle aendern ?? + // modify entry in the hash table ((_HashStr*)pFnd)->aSetStr = sExpand; else - // neuen Eintrag einfuegen + // insert the new entry *(pHashStrTbl + nPos ) = new _HashStr( rNm, sExpand, (_HashStr*)*(pHashStrTbl + nPos) ); } @@ -1292,12 +1286,12 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) } } - // Ok, das Array ist soweit mit allen Feldern gefuellt, dann rechne mal + // The array is filled with all fields; start calculation. SwCalc aCalc( *this ); String sDBNumNm( SwFieldType::GetTypeStr( TYP_DBSETNUMBERFLD ) ); - // aktuelle Datensatznummer schon vorher einstellen + // already set the current record number SwNewDBMgr* pMgr = GetNewDBMgr(); pMgr->CloseAll(sal_False); @@ -1319,7 +1313,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) SwTxtFld* pTxtFld = (SwTxtFld*)(*ppSortLst)->GetFld(); if( !pTxtFld ) { - OSL_ENSURE( !this, "was ist es denn nun" ); + OSL_ENSURE( !this, "what's wrong now'" ); continue; } @@ -1336,7 +1330,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) if(!aValue.IsVoidValue()) { pHFld->SetValue( bValue ); - // Feld Evaluieren + // evaluate field pHFld->Evaluate(this); } } @@ -1362,7 +1356,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) break; case RES_DBFLD: { - // Feld Evaluieren + // evaluate field ((SwDBField*)pFld)->Evaluate(); SwDBData aTmpDBData(((SwDBField*)pFld)->GetDBData()); @@ -1372,25 +1366,25 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) const String& rName = pFld->GetTyp()->GetName(); - // Wert fuer den Calculator setzen -//JP 10.02.96: GetValue macht hier doch keinen Sinn + // Set value for Calculator +//JP 10.02.96: GetValue doesn't make sense here // ((SwDBField*)pFld)->GetValue(); //!OK aCalc.VarChange(aName, ((SwDBField*)pFld)->GetValue(aCalc)); - // Eintrag in den HashTable eintragen - // Eintrag vorhanden ? + // Add entry to hash table + // Entry present? sal_uInt16 nPos; SwHash* pFnd = Find( rName, pHashStrTbl, nStrFmtCnt, &nPos ); String const value(pFld->ExpandField(IsClipBoard())); if( pFnd ) { - // Eintrag in der HashTabelle aendern + // Modify entry in the hash table static_cast<_HashStr*>(pFnd)->aSetStr = value; } else { - // neuen Eintrag einfuegen + // insert new entry *(pHashStrTbl + nPos ) = new _HashStr( rName, value, static_cast<_HashStr *>(*(pHashStrTbl + nPos))); } @@ -1399,7 +1393,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) case RES_GETEXPFLD: case RES_SETEXPFLD: { - if( nsSwGetSetExpType::GSE_STRING & pFld->GetSubType() ) // String Ersetzung + if( nsSwGetSetExpType::GSE_STRING & pFld->GetSubType() ) // replace String { if( RES_GETEXPFLD == nWhich ) { @@ -1416,38 +1410,38 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) else { SwSetExpField* pSFld = (SwSetExpField*)pFld; - // ist die "Formel" ein Feld ?? + // is the "formula" a field? LookString( pHashStrTbl, nStrFmtCnt, pSFld->GetFormula(), aNew ); - if( !aNew.Len() ) // nichts gefunden, dann ist die - aNew = pSFld->GetFormula(); // Formel der neue Wert + if( !aNew.Len() ) // nothing found then the formula is the new value + aNew = pSFld->GetFormula(); - // nur ein spezielles FeldUpdaten ? + // only update one field if( !pUpdtFld || pUpdtFld == pTxtFld ) pSFld->ChgExpStr( aNew ); - // suche den Namen vom Feld + // lookup the field's name aNew = ((SwSetExpFieldType*)pSFld->GetTyp())->GetSetRefName(); - // Eintrag vorhanden ? + // Entry present? sal_uInt16 nPos; SwHash* pFnd = Find( aNew, pHashStrTbl, nStrFmtCnt, &nPos ); if( pFnd ) - // Eintrag in der HashTabelle aendern + // Modify entry in the hash table ((_HashStr*)pFnd)->aSetStr = pSFld->GetExpStr(); else - // neuen Eintrag einfuegen + // insert new entry *(pHashStrTbl + nPos ) = pFnd = new _HashStr( aNew, pSFld->GetExpStr(), (_HashStr*)*(pHashStrTbl + nPos) ); - // Erweiterung fuers Rechnen mit Strings + // Extension for calculation with Strings SwSbxValue aValue; aValue.PutString( ((_HashStr*)pFnd)->aSetStr ); aCalc.VarChange( aNew, aValue ); } } - else // Formel neu berechnen + else // recalculate formula { if( RES_GETEXPFLD == nWhich ) { @@ -1475,7 +1469,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) const sal_uInt8 nLvl = pSFldTyp->GetOutlineLvl(); if( MAXLEVEL > nLvl ) { - // dann teste, ob die Nummer neu aufsetzen muss + // test if the Number needs to be updated pSeqNd = GetNodes()[ (*ppSortLst)->GetNode() ]; const SwTxtNode* pOutlNd = pSeqNd-> @@ -1493,7 +1487,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) SwSbxValue aValue = aCalc.Calculate( aNew ); double nErg = aValue.GetDouble(); - // nur ein spezielles Feld updaten ? + // only update one field if( !aValue.IsVoidValue() && (!pUpdtFld || pUpdtFld == pTxtFld) ) { pSFld->SetValue( nErg ); @@ -1506,23 +1500,23 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) } } // switch - pFmtFld->ModifyNotification( 0, 0 ); // Formatierung anstossen + pFmtFld->ModifyNotification( 0, 0 ); // trigger formatting - if( pUpdtFld == pTxtFld ) // sollte nur dieses geupdatet werden + if( pUpdtFld == pTxtFld ) // if only this one is updated { - if( RES_GETEXPFLD == nWhich || // nur GetFeld oder + if( RES_GETEXPFLD == nWhich || // only GetField or RES_HIDDENTXTFLD == nWhich || // HiddenTxt? RES_HIDDENPARAFLD == nWhich) // HiddenParaFld? - break; // beenden - pUpdtFld = 0; // ab jetzt alle Updaten + break; // quit + pUpdtFld = 0; // update all from here on } } pMgr->CloseAll(sal_False); - // HashTabelle wieder loeschen + // delete hash table ::DeleteHashTable( pHashStrTbl, nStrFmtCnt ); - // Referenzfelder updaten + // update reference fields if( bUpdRefFlds ) UpdateRefFlds(NULL); @@ -1545,7 +1539,7 @@ void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc ) if( rDBFld.GetRealDBData().sDataSource.getLength() ) { - // Eine bestimmte Datenbank bearbeiten + // Edit a certain database if( RES_DBNEXTSETFLD == nFldType ) ((SwDBNextSetField&)rDBFld).Evaluate(this); else @@ -1563,9 +1557,9 @@ void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc ) } } -void SwDoc::_InitFieldTypes() // wird vom CTOR gerufen!! +void SwDoc::_InitFieldTypes() // is being called by the CTOR { - // Feldtypen + // Field types sal_uInt16 nFldType = 0; pFldTypes->Insert( new SwDateTimeFieldType(this), nFldType++ ); pFldTypes->Insert( new SwChapterFieldType, nFldType++ ); @@ -1596,10 +1590,10 @@ void SwDoc::_InitFieldTypes() // wird vom CTOR gerufen!! pFldTypes->Insert( new SwCombinedCharFieldType, nFldType++ ); pFldTypes->Insert( new SwDropDownFieldType, nFldType++ ); - // Types muessen am Ende stehen !! - // Im InsertFldType wird davon ausgegangen !!!! - // MIB 14.04.95: Im Sw3StringPool::Setup (sw3imp.cxx) und - // lcl_sw3io_InSetExpField (sw3field.cxx) jetzt auch + // Types have to be at the end! + // We expect this in the InsertFldType! + // MIB 14.04.95: In Sw3StringPool::Setup (sw3imp.cxx) and + // lcl_sw3io_InSetExpField (sw3field.cxx) now also pFldTypes->Insert( new SwSetExpFieldType(this, SW_RESSTR(STR_POOLCOLL_LABEL_ABB), nsSwGetSetExpType::GSE_SEQ), nFldType++); pFldTypes->Insert( new SwSetExpFieldType(this, @@ -1672,7 +1666,7 @@ void SwDoc::SetInitDBFields( sal_Bool b ) } /*-------------------------------------------------------------------- - Beschreibung: Alle von Feldern verwendete Datenbanken herausfinden + Description: Get all databases that are used by fields --------------------------------------------------------------------*/ String lcl_DBDataToString(const SwDBData& rData) { @@ -1740,7 +1734,7 @@ void SwDoc::GetAllUsedDB( SvStringsDtor& rDBNameList, case RES_DBNEXTSETFLD: AddUsedDBToList( rDBNameList, lcl_DBDataToString(((SwDBNameInfField*)pFld)->GetRealDBData() )); - // kein break // JP: ist das so richtig ?? + // no break // JP: is that right like that? case RES_HIDDENTXTFLD: case RES_HIDDENPARAFLD: @@ -1794,7 +1788,7 @@ SvStringsDtor& SwDoc::FindUsedDBs( const SvStringsDtor& rAllDBNames, sFormel.GetChar( nPos + pStr->Len() ) == '.' && (!nPos || !rCC.isLetterNumeric( sFormel, nPos - 1 ))) { - // Tabellenname suchen + // Look up table name xub_StrLen nEndPos; nPos += pStr->Len() + 1; if( STRING_NOTFOUND != (nEndPos = sFormel.Search('.', nPos)) ) @@ -1918,7 +1912,7 @@ void SwDoc::ChangeDBFields( const SvStringsDtor& rOldNames, ((SwDBNameInfField*)pFld)->SetDBData(aNewDBData); bExpand = sal_True; } - // kein break; + // no break; case RES_HIDDENTXTFLD: case RES_HIDDENPARAFLD: sFormel = pFld->GetPar1(); @@ -2020,7 +2014,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) /*1*/ RES_AUTHORFLD, /*2*/ RES_EXTUSERFLD, /*3*/ RES_FILENAMEFLD, - /*4*/ RES_DATETIMEFLD }; // MUSS am Ende stehen!! + /*4*/ RES_DATETIMEFLD }; // MUST be at the end! sal_uInt16 nStt = bOnlyTimeDate ? 4 : 0; @@ -2094,7 +2088,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) break; } - // Formatierung anstossen + // Trigger formatting if( bChgd ) pFld->ModifyNotification( 0, 0 ); } @@ -2107,11 +2101,11 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen ) { - // teste ggfs. mal, ob die angegbenen Nodes ueberhaupt Felder beinhalten. - // wenn nicht, braucht das Flag nicht veraendert werden. + // See if the supplied nodes actually contain fields. + // If they don't, the flag doesn't need to be changed. sal_Bool bFldsFnd = sal_False; if( b && pChk && !GetUpdtFlds().IsFieldsDirty() && !IsInDtor() - // ?? was ist mit Undo, da will man es doch auch haben !! + // ?? what's up with Undo, this is also wanted there! /*&& &pChk->GetNodes() == &GetNodes()*/ ) { b = sal_False; @@ -2125,7 +2119,7 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen ) if( pTNd ) { if( pTNd->GetAttrOutlineLevel() != 0 ) - // Kapitelfelder aktualisieren + // update chapter fields b = sal_True; else if( pTNd->GetpSwpHints() && pTNd->GetSwpHints().Count() ) for( sal_uInt16 n = 0, nEnd = pTNd->GetSwpHints().Count(); @@ -2179,7 +2173,7 @@ void SwDocUpdtFld::InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld ) case RES_DBNEXTSETFLD: case RES_DBSETNUMBERFLD: case RES_GETEXPFLD: - break; // diese muessen ein-/ausgetragen werden! + break; // these have to be added/removed! default: return; @@ -2188,22 +2182,21 @@ void SwDocUpdtFld::InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld ) SetFieldsDirty( sal_True ); if( !pFldSortLst ) { - if( !bIns ) // keine Liste vorhanden und loeschen - return; // dann nichts tun + if( !bIns ) // if list is present and deleted + return; // don't do a thing pFldSortLst = new _SetGetExpFlds( 64, 16 ); } - if( bIns ) // neu einfuegen: + if( bIns ) // insert anew: GetBodyNode( rFld, nWhich ); else { - // ueber den pTxtFld Pointer suchen. Ist zwar eine Sortierte - // Liste, aber nach Node-Positionen sortiert. Bis dieser - // bestimmt ist, ist das Suchen nach dem Pointer schon fertig + // look up via the pTxtFld pointer. It is a sorted list, but it's sorted by node + // position. Until this is found, the search for the pointer is already done. for( sal_uInt16 n = 0; n < pFldSortLst->Count(); ++n ) if( &rFld == (*pFldSortLst)[ n ]->GetPointer() ) pFldSortLst->DeleteAndDestroy( n--, 1 ); - // ein Feld kann mehrfach vorhanden sein! + // one field can occur multiple times } } @@ -2216,7 +2209,7 @@ void SwDocUpdtFld::MakeFldList( SwDoc& rDoc, int bAll, int eGetMode ) void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) { - // neue Version: gehe ueber alle Felder vom Attribut-Pool + // new version: walk all fields of the attribute pool if( pFldSortLst ) delete pFldSortLst; pFldSortLst = new _SetGetExpFlds( 64, 16 ); @@ -2234,12 +2227,11 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) /// have to be known in order to insert the hide condition as a new /// expression field into the sorted field list (<pFldSortLst>). if ( eGetMode == GETFLD_ALL ) - // zuerst die Bereiche einsammeln. Alle die ueber Bedingung - // gehiddet sind, wieder mit Frames versorgen, damit die darin - // enthaltenen Felder richtig einsortiert werden!!! + // Collect the ranges first. Supply all with frames, which are hidden by condition, + // so that the contained fields are not sorted. { - // damit die Frames richtig angelegt werden, muessen sie in der - // Reihenfolgen von oben nach unten expandiert werden + // In order for the frames to be created the right way, they have to be expanded + // from top to bottom std::vector<sal_uLong> aTmpArr; SwSectionFmts& rArr = rDoc.GetSections(); SwSectionNode* pSectNd; @@ -2260,23 +2252,22 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) } std::sort(aTmpArr.begin(), aTmpArr.end()); - // erst alle anzeigen, damit die Frames vorhanden sind. Mit deren - // Position wird das BodyAnchor ermittelt. - // Dafuer erst den ContentBereich, dann die Sonderbereiche!!! + // Display all first so that we have frames. The BodyAnchor is defined by that. + // First the ContentArea, then the special areas! for (sal_uInt16 n = nArrStt; n < aTmpArr.size(); ++n) { pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode(); - OSL_ENSURE( pSectNd, "Wo ist mein SectionNode" ); + OSL_ENSURE( pSectNd, "Where is my SectionNode" ); pSectNd->GetSection().SetCondHidden( sal_False ); } for (sal_uInt16 n = 0; n < nArrStt; ++n) { pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode(); - OSL_ENSURE( pSectNd, "Wo ist mein SectionNode" ); + OSL_ENSURE( pSectNd, "Where is my SectionNode" ); pSectNd->GetSection().SetCondHidden( sal_False ); } - // so, erst jetzt alle sortiert in die Liste eintragen + // add all to the list so that they are sorted for (sal_uInt16 n = 0; n < aTmpArr.size(); ++n) { GetBodyNode( *rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode() ); @@ -2337,7 +2328,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) break; pFormel = 0; - // Formatierung anstossen + // trigger formatting ((SwFmtFld*)pFmtFld)->ModifyNotification( 0, 0 ); } break; @@ -2355,9 +2346,9 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) pFormel = 0; - // Feld Evaluieren + // evaluate field ((SwHiddenTxtField*)pFld)->Evaluate(&rDoc); - // Formatierung anstossen + // trigger formatting ((SwFmtFld*)pFmtFld)->ModifyNotification( 0, 0 ); } break; @@ -2405,7 +2396,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich ) const SwTxtNode& rTxtNd = rTFld.GetTxtNode(); const SwDoc& rDoc = *rTxtNd.GetDoc(); - // immer den ersten !! (in Tab-Headline, Kopf-/Fuss ) + // always the first! (in tab headline, header-/footer) Point aPt; const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, sal_False ); @@ -2414,7 +2405,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich ) if( !pFrm || pFrm->IsInDocBody() ) { - // einen Index fuers bestimmen vom TextNode anlegen + // create index to determine the TextNode SwNodeIndex aIdx( rTxtNd ); bIsInBody = rDoc.GetNodes().GetEndOfExtras().GetIndex() < aIdx.GetIndex(); @@ -2427,7 +2418,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich ) } else { - // einen Index fuers bestimmen vom TextNode anlegen + // create index to determine the TextNode SwPosition aPos( rDoc.GetNodes().GetEndOfPostIts() ); #if OSL_DEBUG_LEVEL > 1 OSL_ENSURE( GetBodyTxtNode( rDoc, aPos, *pFrm ), "wo steht das Feld" ); @@ -2437,7 +2428,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, sal_uInt16 nFldWhich ) pNew = new _SetGetExpFld( aPos.nNode, &rTFld, &aPos.nContent ); } - // bei GetExp.-/DB.-Felder immer das BodyTxtFlag setzen + // always set the BodyTxtFlag in GetExp or DB fields if( RES_GETEXPFLD == nFldWhich ) { SwGetExpField* pGetFld = (SwGetExpField*)rTFld.GetFld().GetFld(); @@ -2463,15 +2454,15 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd ) { do { // middle check loop - // dann muessen wir uns mal den Anker besorgen! - // einen Index fuers bestimmen vom TextNode anlegen + // we need to get the anchor first + // create index to determine the TextNode SwPosition aPos( rSectNd ); - SwCntntNode* pCNd = rDoc.GetNodes().GoNext( &aPos.nNode ); // zum naechsten ContentNode + SwCntntNode* pCNd = rDoc.GetNodes().GoNext( &aPos.nNode ); // to the next ContentNode if( !pCNd || !pCNd->IsTxtNode() ) break; - // immer den ersten !! (in Tab-Headline, Kopf-/Fuss ) + // always the first! (in tab headline, header-/footer) Point aPt; const SwCntntFrm* pFrm = pCNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, sal_False ); if( !pFrm ) @@ -2512,7 +2503,7 @@ void SwDocUpdtFld::InsertFldType( const SwFieldType& rType ) if( sFldName.Len() ) { SetFieldsDirty( sal_True ); - // suchen und aus der HashTabelle entfernen + // look up and remove from the hash table GetAppCharClass().toLower( sFldName ); sal_uInt16 n; @@ -2543,7 +2534,7 @@ void SwDocUpdtFld::RemoveFldType( const SwFieldType& rType ) if( sFldName.Len() ) { SetFieldsDirty( sal_True ); - // suchen und aus der HashTabelle entfernen + // look up and remove from the hash table GetAppCharClass().toLower( sFldName ); sal_uInt16 n; @@ -2654,9 +2645,8 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, case RES_DBFLD: { - // JP 10.02.96: ChgValue aufrufen, damit - //die Format- aenderung den ContentString - //richtig setzt + // JP 10.02.96: call ChgValue, so that the style change sets the + // ContentString correctly SwDBField* pDBFld = (SwDBField*)pNewFld; if (pDBFld->IsInitialized()) pDBFld->ChgValue( pDBFld->GetValue(), sal_True ); @@ -2664,14 +2654,13 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, pDBFld->ClearInitialized(); pDBFld->InitContent(); } - // kein break; + // no break; default: pDstFmtFld->ModifyNotification( 0, pMsgHnt ); } - // Die Felder die wir berechnen koennen werden hier expli. - // zum Update angestossen. + // The fields we can calculate here are being triggered for an update here explicitily. if( nFldWhich == RES_USERFLD ) UpdateUsrFlds(); } diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index aa8aa3a85bfd..f8a0ce293d11 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -357,6 +357,7 @@ SwDoc::SwDoc() mbInvertBorderSpacing = false; // hidden mbCollapseEmptyCellPara = true; // hidden mbSmallCapsPercentage66 = false; // hidden + mbTabOverflow = true; // // COMPATIBILITY FLAGS END diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 5f66a3d17fbd..2067dd31e643 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -1301,7 +1301,7 @@ sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell ) *dieser erhalten, kleinere Wuensche werden ueberschrieben. */ -void lcl_CalcSubColValues( SvUShorts &rToFill, const SwTabCols &rCols, +void lcl_CalcSubColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols &rCols, const SwLayoutFrm *pCell, const SwLayoutFrm *pTab, sal_Bool bWishValues ) { @@ -1361,7 +1361,7 @@ void lcl_CalcSubColValues( SvUShorts &rToFill, const SwTabCols &rCols, * schneidet wird der Minimalwert ermittelt. */ -void lcl_CalcColValues( SvUShorts &rToFill, const SwTabCols &rCols, +void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols &rCols, const SwLayoutFrm *pStart, const SwLayoutFrm *pEnd, sal_Bool bWishValues ) { @@ -1471,14 +1471,14 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, sal_Bool bBalance ) return; const sal_uInt8 nTmp = (sal_uInt8)Max( sal_uInt16(255), sal_uInt16(aTabCols.Count() + 1) ); - SvUShorts aWish( nTmp, nTmp ), + std::vector<sal_uInt16> aWish( nTmp, nTmp ), aMins( nTmp, nTmp ); sal_uInt16 i; for ( i = 0; i <= aTabCols.Count(); ++i ) { - aWish.Insert( sal_uInt16(0), aWish.Count() ); - aMins.Insert( sal_uInt16(0), aMins.Count() ); + aWish.push_back( 0 ); + aMins.push_back( 0 ); } ::lcl_CalcColValues( aWish, aTabCols, pStart, pEnd, sal_True ); @@ -1511,7 +1511,7 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, sal_Bool bBalance ) } } nWish = nWish / nCnt; - for ( i = 0; i < aWish.Count(); ++i ) + for ( i = 0; i < aWish.size(); ++i ) if ( aWish[i] ) aWish[i] = nWish; } diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 1bbf0b3b9e9a..1e26155d2aca 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -385,14 +385,14 @@ void SwEditShell::ApplyAutoMark() while( !rStrm.GetError() && !rStrm.IsEof() ) { - ByteString aRdLine; + rtl::OString aRdLine; rStrm.ReadLine( aRdLine ); // # -> comment // ; -> delimiter between entries -> // Format: TextToSearchFor;AlternativeString;PrimaryKey;SecondaryKey;CaseSensitive;WordOnly // Leading and trailing blanks are ignored - if( aRdLine.Len() && '#' != aRdLine.GetChar(0) ) + if( aRdLine.getLength() && '#' != aRdLine[0] ) { String sLine( aRdLine, eChrSet ); diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 76ab5fc5f3e7..5d0305e2a814 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -557,8 +557,8 @@ sal_uInt16 SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rFld ) if( !GetDepends() || !(nsSwGetSetExpType::GSE_SEQ & nType) ) return USHRT_MAX; -extern void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 ); - SvUShorts aArr( 64 ); +extern void InsertSort( std::vector<sal_uInt16>& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 ); + std::vector<sal_uInt16> aArr; sal_uInt16 n; @@ -577,18 +577,18 @@ extern void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = sal_uInt16 nNum = rFld.GetSeqNumber(); if( USHRT_MAX != nNum ) { - for( n = 0; n < aArr.Count(); ++n ) + for( n = 0; n < aArr.size(); ++n ) if( aArr[ n ] > nNum ) return nNum; // nicht vorhanden -> also benutzen else if( aArr[ n ] == nNum ) break; // schon vorhanden -> neue erzeugen - if( n == aArr.Count() ) + if( n == aArr.size() ) return nNum; // nicht vorhanden -> also benutzen } // alle Nummern entsprechend geflag, also bestimme die richtige Nummer - for( n = 0; n < aArr.Count(); ++n ) + for( n = 0; n < aArr.size(); ++n ) if( n != aArr[ n ] ) break; diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 17f0dd225c42..3b5284965234 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -30,8 +30,6 @@ #include "precompiled_sw.hxx" -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> #include <com/sun/star/text/ReferenceFieldPart.hpp> #include <com/sun/star/text/ReferenceFieldSource.hpp> #include <unotools/localedatawrapper.hxx> @@ -80,7 +78,7 @@ using namespace ::com::sun::star::text; using namespace ::com::sun::star::lang; using ::rtl::OUString; -extern void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 ); +extern void InsertSort( std::vector<sal_uInt16>& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 ); void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr ) { diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index 58e56feadfce..a181532ab8c7 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -559,7 +559,7 @@ void SwXMLTextBlocks::GeneratePackageName ( const String& rShort, String& rPacka rPackageName = rShort; xub_StrLen nPos = 0; sal_Unicode pDelims[] = { '!', '/', ':', '.', '\\', 0 }; - ByteString sByte ( rPackageName, RTL_TEXTENCODING_UTF7); + rtl::OString sByte(rtl::OUStringToOString(rPackageName, RTL_TEXTENCODING_UTF7)); rPackageName = String (sByte, RTL_TEXTENCODING_ASCII_US); while( STRING_NOTFOUND != ( nPos = rPackageName.SearchChar( pDelims, nPos ))) { diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index a76d74689188..5d84e848b363 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1459,7 +1459,7 @@ void SwTxtFormatInfo::Init() // Nicht initialisieren: pRest, nLeft, nRight, nFirst, nRealWidth X(0); bArrowDone = bFull = bFtnDone = bErgoDone = bNumDone = bNoEndHyph = - bNoMidHyph = bStop = bNewLine = bUnderFlow = sal_False; + bNoMidHyph = bStop = bNewLine = bUnderFlow = bTabOverflow = sal_False; // generally we do not allow number portions in follows, except... if ( GetTxtFrm()->IsFollow() ) @@ -1501,7 +1501,8 @@ void SwTxtFormatInfo::Init() * --------------------------------------------------*/ SwTxtFormatInfo::SwTxtFormatInfo( const SwTxtFormatInfo& rInf, - SwLineLayout& rLay, SwTwips nActWidth ) : SwTxtPaintInfo( rInf ) + SwLineLayout& rLay, SwTwips nActWidth ) : SwTxtPaintInfo( rInf ), + bTabOverflow( sal_False ) { pRoot = &rLay; pLast = &rLay; diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index b549cf42e336..b056612f8284 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -565,6 +565,7 @@ class SwTxtFormatInfo : public SwTxtPaintInfo sal_Bool bFakeLineStart: 1; // String has been replaced by field portion // info structure only pretends that we are at // the beginning of a line + sal_Bool bTabOverflow; // Tabs are expanding after the end margin xub_Unicode cTabDecimal; // das _aktuelle_ Dezimalzeichen xub_Unicode cHookChar; // fuer Tabs in Feldern etc. @@ -734,6 +735,9 @@ public: // friend ostream &operator<<( ostream &rOS, const SwTxtFormatInfo &rInf ); friend SvStream &operator<<( SvStream &rOS, const SwTxtFormatInfo &rInf ); + + inline void SetTabOverflow( sal_Bool bOverflow ) { bTabOverflow = bOverflow; } + inline sal_Bool IsTabOverflow( ) { return bTabOverflow; } }; /************************************************************************* diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 965d73e09420..a507526b4188 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -738,6 +738,9 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf ) // 3260, 3860: Fly auf jeden Fall loeschen! ClearFly( rInf ); + + // Reinit the tab overflow flag after the line + rInf.SetTabOverflow( sal_False ); } /************************************************************************* diff --git a/sw/source/core/text/portab.hxx b/sw/source/core/text/portab.hxx index 3cda7b9d1f96..bb5fe9d03968 100644 --- a/sw/source/core/text/portab.hxx +++ b/sw/source/core/text/portab.hxx @@ -38,17 +38,19 @@ class SwTabPortion : public SwFixPortion { const KSHORT nTabPos; const xub_Unicode cFill; + const bool bAutoTabStop; // Das Format() verzweigt entweder in Pre- oder PostFormat() sal_Bool PreFormat( SwTxtFormatInfo &rInf ); public: - SwTabPortion( const KSHORT nTabPos, const xub_Unicode cFill = '\0' ); + SwTabPortion( const KSHORT nTabPos, const xub_Unicode cFill = '\0', const bool bAutoTab = true ); virtual void Paint( const SwTxtPaintInfo &rInf ) const; virtual sal_Bool Format( SwTxtFormatInfo &rInf ); virtual void FormatEOL( SwTxtFormatInfo &rInf ); sal_Bool PostFormat( SwTxtFormatInfo &rInf ); inline sal_Bool IsFilled() const { return 0 != cFill; } inline KSHORT GetTabPos() const { return nTabPos; } + inline sal_Bool IsAutoTabStop() const { return bAutoTabStop; } // Accessibility: pass information about this portion to the PortionHandler virtual void HandlePortion( SwPortionHandler& rPH ) const; @@ -63,8 +65,8 @@ public: class SwTabLeftPortion : public SwTabPortion { public: - inline SwTabLeftPortion( const KSHORT nTabPosVal, const xub_Unicode cFillChar='\0' ) - : SwTabPortion( nTabPosVal, cFillChar ) + inline SwTabLeftPortion( const KSHORT nTabPosVal, const xub_Unicode cFillChar='\0', bool bAutoTab = true ) + : SwTabPortion( nTabPosVal, cFillChar, bAutoTab ) { SetWhichPor( POR_TABLEFT ); } OUTPUT_OPERATOR }; diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 7ed18741304d..341bde27d0c5 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -94,6 +94,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) SvxTabAdjust eAdj; KSHORT nNewTabPos; + bool bAutoTabStop = true; { const bool bRTL = pFrm->IsRightToLeft(); // #i24363# tab stops relative to indent @@ -177,6 +178,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) //calculate default tab position of default tabs in negative indent nNextPos = ( nSearchPos / nNextPos ) * nNextPos; } + bAutoTabStop = false; } else { @@ -312,7 +314,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) { OSL_ENSURE( SVX_TAB_ADJUST_LEFT == eAdj || SVX_TAB_ADJUST_DEFAULT == eAdj, "+SwTxtFormatter::NewTabPortion: unknown adjustment" ); - pTabPor = new SwTabLeftPortion( nNewTabPos, cFill ); + pTabPor = new SwTabLeftPortion( nNewTabPos, cFill, bAutoTabStop ); break; } } @@ -333,8 +335,8 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) // Die Basisklasse wird erstmal ohne alles initialisiert. -SwTabPortion::SwTabPortion( const KSHORT nTabPosition, const xub_Unicode cFillChar ) - : SwFixPortion( 0, 0 ), nTabPos(nTabPosition), cFill(cFillChar) +SwTabPortion::SwTabPortion( const KSHORT nTabPosition, const xub_Unicode cFillChar, const bool bAutoTab ) + : SwFixPortion( 0, 0 ), nTabPos(nTabPosition), cFill(cFillChar), bAutoTabStop( bAutoTab ) { nLineLength = 1; #if OSL_DEBUG_LEVEL > 1 @@ -388,6 +390,7 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf ) Fix( static_cast<sal_uInt16>(rInf.X()) ); const bool bTabCompat = rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT); + const bool bTabOverflow = rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_OVERFLOW); // Die Mindestbreite eines Tabs ist immer mindestens ein Blank // #i37686# In compatibility mode, the minimum width @@ -419,7 +422,7 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf ) // 1. Minmal width does not fit to line anymore. // 2. An underflow event was called for the tab portion. sal_Bool bFull = ( bTabCompat && rInf.IsUnderFlow() ) || - rInf.Width() <= rInf.X() + PrtWidth(); + ( rInf.Width() <= rInf.X() + PrtWidth() && rInf.X() <= rInf.Width() ) ; // #95477# Rotated tab stops get the width of one blank const sal_uInt16 nDir = rInf.GetFont()->GetOrientation( rInf.GetTxtFrm()->IsVertical() ); @@ -447,10 +450,15 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf ) // In tabulator compatibility mode, we reset the bFull flag // if the tabulator is at the end of the paragraph and the // tab stop position is outside the frame: + bool bAtParaEnd = rInf.GetIdx() + GetLen() == rInf.GetTxt().Len(); if ( bFull && bTabCompat && - rInf.GetIdx() + GetLen() == rInf.GetTxt().Len() && + ( ( bTabOverflow && ( rInf.IsTabOverflow() || !IsAutoTabStop() ) ) || bAtParaEnd ) && GetTabPos() >= rInf.GetTxtFrm()->Frm().Width() ) + { bFull = sal_False; + if ( bTabOverflow && !IsAutoTabStop() ) + rInf.SetTabOverflow( sal_True ); + } break; } diff --git a/sw/source/core/tox/toxhlp.cxx b/sw/source/core/tox/toxhlp.cxx index cca45d8f83aa..e28323292a4f 100644 --- a/sw/source/core/tox/toxhlp.cxx +++ b/sw/source/core/tox/toxhlp.cxx @@ -63,9 +63,9 @@ IndexEntrySupplierWrapper::IndexEntrySupplierWrapper() ) { #if OSL_DEBUG_LEVEL > 1 - ByteString aMsg( "IndexEntrySupplierWrapper: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - OSL_FAIL( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("IndexEntrySupplierWrapper: Exception caught\n")); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + OSL_FAIL( aMsg.getStr() ); #endif } } @@ -89,9 +89,9 @@ String IndexEntrySupplierWrapper::GetIndexKey( const String& rTxt, ) { #if OSL_DEBUG_LEVEL > 1 - ByteString aMsg( "getIndexKey: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - OSL_FAIL( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("getIndexKey: Exception caught\n")); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + OSL_FAIL( aMsg.getStr() ); #endif } return sRet; @@ -110,9 +110,9 @@ String IndexEntrySupplierWrapper::GetFollowingText( sal_Bool bMorePages ) const ) { #if OSL_DEBUG_LEVEL > 1 - ByteString aMsg( "getIndexFollowPageWord: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - OSL_FAIL( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("getIndexFollowPageWord: Exception caught\n")); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + OSL_FAIL( aMsg.getStr() ); #endif } return sRet; @@ -133,9 +133,9 @@ IndexEntrySupplierWrapper::GetAlgorithmList( const STAR_NMSPC::lang::Locale& rLc ) { #if OSL_DEBUG_LEVEL > 1 - ByteString aMsg( "getAlgorithmList: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - OSL_FAIL( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("getAlgorithmList: Exception caught\n")); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + OSL_FAIL( aMsg.getStr() ); #endif } return sRet; @@ -156,9 +156,9 @@ sal_Bool IndexEntrySupplierWrapper::LoadAlgorithm( ) { #if OSL_DEBUG_LEVEL > 1 - ByteString aMsg( "loadAlgorithm: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - OSL_FAIL( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("loadAlgorithm: Exception caught\n")); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + OSL_FAIL( aMsg.getStr() ); #endif } return bRet; @@ -182,9 +182,9 @@ sal_Int16 IndexEntrySupplierWrapper::CompareIndexEntry( ) { #if OSL_DEBUG_LEVEL > 1 - ByteString aMsg( "compareIndexEntry: Exception caught\n" ); - aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 ); - OSL_FAIL( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("compareIndexEntry: Exception caught\n")); + aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8)); + OSL_FAIL( aMsg.getStr() ); #endif } return nRet; diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 8f3563f4e694..013566cfed71 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -191,7 +191,7 @@ public: void CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl ); }; -void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 ); +void InsertSort( std::vector<sal_uInt16>& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 ); #if OSL_DEBUG_LEVEL > 1 #include "shellio.hxx" @@ -3175,21 +3175,21 @@ void SwUndoMergeTbl::SaveFormula( SwHistory& rHistory ) ////////////////////////////////////////////////////////////////////////// -void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos ) +void InsertSort( std::vector<sal_uInt16>& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos ) { - sal_uInt16 nO = rArr.Count(), nM, nU = 0; + sal_uInt16 nO = rArr.size(), nM, nU = 0; if( nO > 0 ) { nO--; while( nU <= nO ) { nM = nU + ( nO - nU ) / 2; - if( *(rArr.GetData() + nM) == nIdx ) + if ( rArr[nM] == nIdx ) { OSL_FAIL( "Index already exists. This should never happen." ); return; } - if( *(rArr.GetData() + nM) < nIdx ) + if( rArr[nM] < nIdx ) nU = nM + 1; else if( nM == 0 ) break; @@ -3197,7 +3197,7 @@ void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos ) nO = nM - 1; } } - rArr.Insert( nIdx, nU ); + rArr.insert( rArr.begin() + nU, nIdx ); if( pInsPos ) *pInsPos = nU; } diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 4206c76388db..578a8390751a 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -96,6 +96,7 @@ #include <docsh.hxx> #include <fmtmeta.hxx> // MetaFieldManager #include <switerator.hxx> +#include <rtl/strbuf.hxx> using ::rtl::OUString; using namespace ::com::sun::star; @@ -444,10 +445,10 @@ sal_Bool SwXFieldMaster::supportsService(const OUString& rServiceName) throw( un } if( pEntry ) { - ByteString aTmp( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.text.fieldmaster.")); - aTmp.Append( pEntry ); - bRet = rServiceName.equalsAsciiL(aTmp.GetBuffer(), aTmp.Len()); + rtl::OString aTmp = rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM( + "com.sun.star.text.fieldmaster.")).append(pEntry). + makeStringAndClear(); + bRet = rServiceName.equalsAsciiL(aTmp.getStr(), aTmp.getLength()); } } return bRet; diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 8a8ffca43e64..5ba469f2c31e 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1115,8 +1115,9 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: else if( sTmp.EqualsAscii( sGraphicObjectProtocol, 0, sizeof(sGraphicObjectProtocol)-1 ) ) { - ByteString sId( sTmp.Copy(sizeof(sGraphicObjectProtocol)-1), - RTL_TEXTENCODING_ASCII_US ); + rtl::OString sId(rtl::OUStringToOString( + sTmp.Copy(sizeof(sGraphicObjectProtocol)-1), + RTL_TEXTENCODING_ASCII_US)); pGrfObj = new GraphicObject( sId ); sGrfName.Erase(); } @@ -1184,7 +1185,9 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: ::rtl::OUString aGraphicProtocol( RTL_CONSTASCII_USTRINGPARAM( sGraphicObjectProtocol ) ); if( aGrfUrl.compareTo( aGraphicProtocol, aGraphicProtocol.getLength() ) == 0 ) { - ByteString sId( aGrfUrl.copy(sizeof(sGraphicObjectProtocol)-1).getStr(), RTL_TEXTENCODING_ASCII_US ); + rtl::OString sId(rtl::OUStringToOString( + aGrfUrl.copy(sizeof(sGraphicObjectProtocol)-1), + RTL_TEXTENCODING_ASCII_US)); pGrfObj = new GraphicObject( sId ); aGraphic = pGrfObj->GetGraphic(); bApply = true; @@ -2137,8 +2140,9 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan else if( sGraphicURL.EqualsAscii( sGraphicObjectProtocol, 0, sizeof(sGraphicObjectProtocol)-1 ) ) { - ByteString sId( sGraphicURL.Copy( sizeof(sGraphicObjectProtocol)-1 ), - RTL_TEXTENCODING_ASCII_US ); + rtl::OString sId(rtl::OUStringToOString( + sGraphicURL.Copy( sizeof(sGraphicObjectProtocol)-1 ), + RTL_TEXTENCODING_ASCII_US)); pGrfObj = new GraphicObject( sId ); sGraphicURL.Erase(); } diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index a6ef89445241..7fc91799d7a5 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -208,7 +208,7 @@ class SwHTMLForm_Impl String sText; SvStringsDtor aStringList; SvStringsDtor aValueList; - SvUShorts aSelectedList; + std::vector<sal_uInt16> aSelectedList; public: @@ -269,10 +269,10 @@ public: aValueList.DeleteAndDestroy( 0, aValueList.Count() ); } - SvUShorts& GetSelectedList() { return aSelectedList; } + std::vector<sal_uInt16>& GetSelectedList() { return aSelectedList; } void EraseSelectedList() { - aSelectedList.Remove( 0, aSelectedList.Count() ); + aSelectedList.clear(); } SvKeyValueIterator *GetHeaderAttrs() const { return pHeaderAttrs; } @@ -2544,12 +2544,12 @@ void SwHTMLParser::EndSelect() rPropSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("ListSource")), aAny ); - sal_uInt16 nSelCnt = pFormImpl->GetSelectedList().Count(); + size_t nSelCnt = pFormImpl->GetSelectedList().size(); if( !nSelCnt && 1 == nSelectEntryCnt && nEntryCnt ) { // In einer DropDown-Listbox sollte immer ein Eintrag selektiert // sein. - pFormImpl->GetSelectedList().Insert( (sal_uInt16)0, (sal_uInt16)0 ); + pFormImpl->GetSelectedList().insert( pFormImpl->GetSelectedList().begin(), 0 ); nSelCnt = 1; } Sequence<sal_Int16> aSelList( (sal_Int32)nSelCnt ); @@ -2624,8 +2624,9 @@ void SwHTMLParser::InsertSelectOption() pFormImpl->GetStringList().Insert( new String( aEmptyStr ), nEntryCnt ); pFormImpl->GetValueList().Insert( new String( aValue ), nEntryCnt ); if( bLBEntrySelected ) - pFormImpl->GetSelectedList().Insert( nEntryCnt, - pFormImpl->GetSelectedList().Count() ); + { + pFormImpl->GetSelectedList().push_back( nEntryCnt ); + } } void SwHTMLParser::InsertSelectText() diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 17b54983c842..de92f0755bad 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -398,7 +398,7 @@ class HTMLTable String aDir; SdrObjects *pResizeDrawObjs;// SDR objects - SvUShorts *pDrawObjPrcWidths; // column of draw object and its rel. width + std::vector<sal_uInt16> *pDrawObjPrcWidths; // column of draw object and its rel. width HTMLTableRows *pRows; // table rows HTMLTableColumns *pColumns; // table columns @@ -2810,10 +2810,10 @@ void HTMLTable::RegisterDrawObject( SdrObject *pObj, sal_uInt8 nPrcWidth ) pResizeDrawObjs->C40_INSERT( SdrObject, pObj, pResizeDrawObjs->Count() ); if( !pDrawObjPrcWidths ) - pDrawObjPrcWidths = new SvUShorts; - pDrawObjPrcWidths->Insert( nCurRow, pDrawObjPrcWidths->Count() ); - pDrawObjPrcWidths->Insert( nCurCol, pDrawObjPrcWidths->Count() ); - pDrawObjPrcWidths->Insert( (sal_uInt16)nPrcWidth, pDrawObjPrcWidths->Count() ); + pDrawObjPrcWidths = new std::vector<sal_uInt16>; + pDrawObjPrcWidths->push_back( nCurRow ); + pDrawObjPrcWidths->push_back( nCurCol ); + pDrawObjPrcWidths->push_back( (sal_uInt16)nPrcWidth ); } void HTMLTable::MakeParentContents() @@ -3081,11 +3081,11 @@ _SectionSaveStruct::_SectionSaveStruct( SwHTMLParser& rParser ) : { // Font-Stacks einfrieren nBaseFontStMinSave = rParser.nBaseFontStMin; - rParser.nBaseFontStMin = rParser.aBaseFontStack.Count(); + rParser.nBaseFontStMin = rParser.aBaseFontStack.size(); nFontStMinSave = rParser.nFontStMin; nFontStHeadStartSave = rParser.nFontStHeadStart; - rParser.nFontStMin = rParser.aFontStack.Count(); + rParser.nFontStMin = rParser.aFontStack.size(); // Kontext-Stack einfrieren nContextStMinSave = rParser.nContextStMin; @@ -3105,16 +3105,16 @@ void _SectionSaveStruct::Restore( SwHTMLParser& rParser ) { // Font-Stacks wieder auftauen sal_uInt16 nMin = rParser.nBaseFontStMin; - if( rParser.aBaseFontStack.Count() > nMin ) - rParser.aBaseFontStack.Remove( nMin, - rParser.aBaseFontStack.Count() - nMin ); + if( rParser.aBaseFontStack.size() > nMin ) + rParser.aBaseFontStack.erase( rParser.aBaseFontStack.begin() + nMin, + rParser.aBaseFontStack.end() ); rParser.nBaseFontStMin = nBaseFontStMinSave; nMin = rParser.nFontStMin; - if( rParser.aFontStack.Count() > nMin ) - rParser.aFontStack.Remove( nMin, - rParser.aFontStack.Count() - nMin ); + if( rParser.aFontStack.size() > nMin ) + rParser.aFontStack.erase( rParser.aFontStack.begin() + nMin, + rParser.aFontStack.end() ); rParser.nFontStMin = nFontStMinSave; rParser.nFontStHeadStart = nFontStHeadStartSave; diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 8ad074212094..93b54e154464 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -782,15 +782,15 @@ SvxCSS1Parser::SvxCSS1Parser( SfxItemPool& rPool, const String& rBaseURL, sal_uI aItemIds.nLanguageCTL = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_LANGUAGE, sal_False ); aItemIds.nDirection = rPool.GetTrueWhich( SID_ATTR_FRAMEDIRECTION, sal_False ); - aWhichMap.Insert( (sal_uInt16)0, (sal_uInt16)0 ); + aWhichMap.insert( aWhichMap.begin(), 0 ); SvParser::BuildWhichTbl( aWhichMap, (sal_uInt16 *)&aItemIds, sizeof(aItemIds) / sizeof(sal_uInt16) ); if( pWhichIds && nWhichIds ) SvParser::BuildWhichTbl( aWhichMap, pWhichIds, nWhichIds ); - pSheetItemSet = new SfxItemSet( rPool, aWhichMap.GetData() ); + pSheetItemSet = new SfxItemSet( rPool, &aWhichMap[0] ); pSheetPropInfo = new SvxCSS1PropertyInfo; - pSearchEntry = new SvxCSS1MapEntry( rPool, aWhichMap.GetData() ); + pSearchEntry = new SvxCSS1MapEntry( rPool, &aWhichMap[0] ); } SvxCSS1Parser::~SvxCSS1Parser() diff --git a/sw/source/filter/html/svxcss1.hxx b/sw/source/filter/html/svxcss1.hxx index b90fcdfa91a9..bcd7a283e1f1 100644 --- a/sw/source/filter/html/svxcss1.hxx +++ b/sw/source/filter/html/svxcss1.hxx @@ -245,7 +245,7 @@ class SvxCSS1Parser : public CSS1Parser void ParseProperty( const String& rProperty, const CSS1Expression *pExpr ); - SvUShorts aWhichMap; // Which-Map des Parser + std::vector<sal_uInt16> aWhichMap; // Which-Map des Parser using CSS1Parser::ParseStyleOption; @@ -310,7 +310,7 @@ public: virtual const FontList *GetFontList() const; - const sal_uInt16 *GetWhichMap() const { return aWhichMap.GetData(); } + const sal_uInt16 *GetWhichMap() const { return &aWhichMap[0]; } void InsertMapEntry( const String& rKey, const SfxItemSet& rItemSet, const SvxCSS1PropertyInfo& rProp, CSS1Map& rMap ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 9a8d77af3a9b..29a4da1f0c32 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -3558,7 +3558,7 @@ void SwHTMLParser::NewBasefontAttr() PushContext( pCntxt ); // die Font-Size merken - aBaseFontStack.Insert( nSize, aBaseFontStack.Count() ); + aBaseFontStack.push_back( nSize ); } void SwHTMLParser::EndBasefontAttr() @@ -3566,19 +3566,19 @@ void SwHTMLParser::EndBasefontAttr() EndTag( HTML_BASEFONT_ON ); // Stack-Unterlauf in Tabellen vermeiden - if( aBaseFontStack.Count() > nBaseFontStMin ) - aBaseFontStack.Remove( aBaseFontStack.Count()-1, 1 ); + if( aBaseFontStack.size() > nBaseFontStMin ) + aBaseFontStack.erase( aBaseFontStack.begin() + aBaseFontStack.size() - 1 ); } void SwHTMLParser::NewFontAttr( int nToken ) { sal_uInt16 nBaseSize = - ( aBaseFontStack.Count() > nBaseFontStMin - ? (aBaseFontStack[aBaseFontStack.Count()-1] & FONTSIZE_MASK) + ( aBaseFontStack.size() > nBaseFontStMin + ? (aBaseFontStack[aBaseFontStack.size()-1] & FONTSIZE_MASK) : 3 ); sal_uInt16 nFontSize = - ( aFontStack.Count() > nFontStMin - ? (aFontStack[aFontStack.Count()-1] & FONTSIZE_MASK) + ( aFontStack.size() > nFontStMin + ? (aFontStack[aFontStack.size()-1] & FONTSIZE_MASK) : nBaseSize ); String aFace, aId, aStyle, aClass, aLang, aDir; @@ -3653,7 +3653,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) { // wenn die Schriftgroesse in der Ueberschrift noch // nicht veraendert ist, die aus der Vorlage nehmen - if( nFontStHeadStart==aFontStack.Count() ) + if( nFontStHeadStart==aFontStack.size() ) nFontSize = static_cast< sal_uInt16 >(6 - (nPoolId - RES_POOLCOLL_HEADLINE1)); } else @@ -3786,7 +3786,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) // den Kontext merken PushContext( pCntxt ); - aFontStack.Insert( nSize, aFontStack.Count() ); + aFontStack.push_back( nSize ); } void SwHTMLParser::EndFontAttr( int nToken ) @@ -3794,8 +3794,8 @@ void SwHTMLParser::EndFontAttr( int nToken ) EndTag( nToken ); // Stack-Unterlauf in Tabellen vermeiden - if( aFontStack.Count() > nFontStMin ) - aFontStack.Remove( aFontStack.Count()-1, 1 ); + if( aFontStack.size() > nFontStMin ) + aFontStack.erase( aFontStack.begin() + aFontStack.size() - 1 ); } @@ -4002,7 +4002,7 @@ void SwHTMLParser::NewHeading( int nToken ) // und die Vorlage oder deren Attribute setzen SetTxtCollAttrs( pCntxt ); - nFontStHeadStart = aFontStack.Count(); + nFontStHeadStart = aFontStack.size(); // Laufbalkenanzeige ShowStatline(); diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 127f9129078e..f218c361328b 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -33,9 +33,6 @@ #ifndef _SVSTDARR_XUB_STRLEN_DECL #define _SVSTDARR_XUB_STRLEN #endif -#ifndef _SVSTDARR_USHORTS_DECL -#define _SVSTDARR_USHORTS -#endif #ifndef _SVSTDARR_STRINGSDTOR_DECL #define _SVSTDARR_STRINGSDTOR #endif @@ -394,9 +391,9 @@ class SwHTMLParser : public SfxHTMLParser, public SwClient String aBulletGrfs[MAXLEVEL]; String sJmpMark; - SvUShorts aBaseFontStack; // Stack fuer <BASEFONT> + std::vector<sal_uInt16> aBaseFontStack; // Stack fuer <BASEFONT> // Bit 0-2: Fontgroesse (1-7) - SvUShorts aFontStack; // Stack fuer <FONT>, <BIG>, <SMALL> + std::vector<sal_uInt16> aFontStack; // Stack fuer <FONT>, <BIG>, <SMALL> // Bit 0-2: Fontgroesse (1-7) // Bit 15: Fontfarbe wurde gesetzt diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx index fb5af60f114f..e03467959d9b 100644 --- a/sw/source/filter/rtf/rtffly.cxx +++ b/sw/source/filter/rtf/rtffly.cxx @@ -559,7 +559,7 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet ) SvxFrameDirectionItem aFrmDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR ); sal_uInt16 nCols = USHRT_MAX, nColSpace = USHRT_MAX, nAktCol = 0; - SvUShorts aColumns; + std::vector<sal_uInt16> aColumns; sal_Bool bChkDropCap = 0 == pSet; sal_uInt16 nDropCapLines = 0, nDropCapAnchor = 0; @@ -740,10 +740,10 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet ) else SkipToken( -1 ); // wieder zurueck - if( --nAktCol == ( aColumns.Count() / 2 ) ) + if( --nAktCol == ( aColumns.size() / 2 ) ) { - aColumns.Insert( nWidth + nSpace, aColumns.Count() ); - aColumns.Insert( nSpace, aColumns.Count() ); + aColumns.push_back( nWidth + nSpace ); + aColumns.push_back( nSpace ); } } break; @@ -858,10 +858,10 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet ) else SkipToken( -1 ); // wieder zurueck - if( --nAktCol == ( aColumns.Count() / 2 ) ) + if( --nAktCol == ( aColumns.size() / 2 ) ) { - aColumns.Insert( nWidth + nSpace, aColumns.Count() ); - aColumns.Insert( nSpace, aColumns.Count() ); + aColumns.push_back( nWidth + nSpace ); + aColumns.push_back( nSpace ); } } break; @@ -961,9 +961,9 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet ) sal_uLong nWidth = USHRT_MAX; aCol.Init( nCols, nColSpace, sal_uInt16( nWidth ) ); - if( nCols == ( aColumns.Count() / 2 ) ) + if( nCols == ( aColumns.size() / 2 ) ) { - for( sal_uInt16 n = 0, i = 0; n < aColumns.Count(); n += 2, ++i ) + for( sal_uInt16 n = 0, i = 0; n < aColumns.size(); n += 2, ++i ) { SwColumn* pCol = aCol.GetColumns()[ i ]; sal_uLong nTmp = aColumns[ n ]; diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 6d7085cdbf1f..38236e6ccee8 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -2762,7 +2762,7 @@ void SwRTFParser::MakeStyleTab() } sal_Bool lcl_SetFmtCol( SwFmt& rFmt, sal_uInt16 nCols, sal_uInt16 nColSpace, - const SvUShorts& rColumns ) + const std::vector<sal_uInt16>& rColumns ) { sal_Bool bSet = sal_False; if( nCols && USHRT_MAX != nCols ) @@ -2772,11 +2772,11 @@ sal_Bool lcl_SetFmtCol( SwFmt& rFmt, sal_uInt16 nCols, sal_uInt16 nColSpace, nColSpace = 720; aCol.Init( nCols, nColSpace, USHRT_MAX ); - if( nCols == ( rColumns.Count() / 2 ) ) + if( nCols == ( rColumns.size() / 2 ) ) { aCol._SetOrtho( sal_False ); sal_uInt16 nWishWidth = 0, nHalfPrev = 0; - for( sal_uInt16 n = 0, i = 0; n < rColumns.Count(); n += 2, ++i ) + for( sal_uInt16 n = 0, i = 0; n < rColumns.size(); n += 2, ++i ) { SwColumn* pCol = aCol.GetColumns()[ i ]; pCol->SetLeft( nHalfPrev ); @@ -3262,7 +3262,7 @@ void SwRTFParser::ReadPageDescTbl() SvxFrameDirectionItem aFrmDir(FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR); sal_uInt16 nCols = USHRT_MAX, nColSpace = USHRT_MAX, nAktCol = 0; - SvUShorts aColumns; + std::vector<sal_uInt16> aColumns; while( nNumOpenBrakets && IsParserWorking() ) { @@ -3422,10 +3422,10 @@ void SwRTFParser::ReadPageDescTbl() else SkipToken( -1 ); // wieder zurueck - if( --nAktCol == ( aColumns.Count() / 2 ) ) + if( --nAktCol == ( aColumns.size() / 2 ) ) { - aColumns.Insert( nWidth, aColumns.Count() ); - aColumns.Insert( nSpace, aColumns.Count() ); + aColumns.push_back( nWidth ); + aColumns.push_back( nSpace ); } } break; diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 5c1d220ade60..e7bf299cc5e6 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -874,7 +874,7 @@ void MSWord_SdrAttrIter::NextPara( sal_uInt16 nPar ) // wird, dass am Absatzanfang sowieso die Attribute neu ausgegeben // werden. aChrTxtAtrArr.Remove( 0, aChrTxtAtrArr.Count() ); - aChrSetArr.Remove( 0, aChrSetArr.Count() ); + aChrSetArr.clear(); nAktSwPos = nTmpSwPos = 0; SfxItemSet aSet( pEditObj->GetParaAttribs( nPara )); @@ -892,8 +892,8 @@ void MSWord_SdrAttrIter::NextPara( sal_uInt16 nPar ) rtl_TextEncoding MSWord_SdrAttrIter::GetNextCharSet() const { - if( aChrSetArr.Count() ) - return (rtl_TextEncoding)aChrSetArr[ aChrSetArr.Count() - 1 ]; + if( aChrSetArr.size() ) + return (rtl_TextEncoding)aChrSetArr[ aChrSetArr.size() - 1 ]; return eNdChrSet; } @@ -945,14 +945,14 @@ void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) sal_uInt16 nPos; if( bStart ) { - nPos = aChrSetArr.Count(); - aChrSetArr.Insert( eChrSet, nPos ); + nPos = aChrSetArr.size(); + aChrSetArr.push_back( eChrSet ); aChrTxtAtrArr.Insert( p, nPos ); } else if( USHRT_MAX != ( nPos = aChrTxtAtrArr.GetPos( p )) ) { aChrTxtAtrArr.Remove( nPos ); - aChrSetArr.Remove( nPos ); + aChrSetArr.erase( aChrSetArr.begin() + nPos ); } } } diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 761fc2acfd4a..ed7fe30b4d73 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1373,7 +1373,7 @@ private: const SfxItemPool* pEditPool; EECharAttribArray aTxtAtrArr; SvPtrarr aChrTxtAtrArr; - SvUShorts aChrSetArr; + std::vector<sal_uInt16> aChrSetArr; sal_uInt16 nPara; xub_StrLen nAktSwPos; xub_StrLen nTmpSwPos; // for HasItem() diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 2876172ec21b..0f8f732fe21c 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1579,6 +1579,7 @@ void SwWW8ImplReader::ImportDop() rDoc.set(IDocumentSettingAccess::INVERT_BORDER_SPACING, true); rDoc.set(IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA, true); + rDoc.set(IDocumentSettingAccess::TAB_OVERFLOW, true); // // COMPATIBILITY FLAGS END diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 1b38b33ead64..cb01a45ed91a 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -906,7 +906,10 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet, { rNumFmt.SetIndentAt( aLVL.nDxaLeft ); rNumFmt.SetFirstLineIndent(aLVL.nDxaLeft1); - rNumFmt.SetListtabPos( nTabPos ); + if ( !aLVL.bV6 ) + rNumFmt.SetListtabPos( nTabPos ); + else + rNumFmt.SetListtabPos( aLVL.nV6Indent ); SvxNumberFormat::SvxNumLabelFollowedBy eNumLabelFollowedBy = SvxNumberFormat::LISTTAB; switch ( ixchFollow ) { diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index f47c9df7c9a0..06b95b30a963 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1191,6 +1191,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC aSet.insert(String("PrinterIndependentLayout", RTL_TEXTENCODING_ASCII_US)); aSet.insert(String("PrintEmptyPages", RTL_TEXTENCODING_ASCII_US)); aSet.insert(String("SmallCapsPercentage66", RTL_TEXTENCODING_ASCII_US)); + aSet.insert(String("TabOverflow", RTL_TEXTENCODING_ASCII_US)); sal_Int32 nCount = aConfigProps.getLength(); const PropertyValue* pValues = aConfigProps.getConstArray(); @@ -1220,6 +1221,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC bool bUnixForceZeroExtLeading = false; bool bUseOldPrinterMetrics = false; bool bSmallCapsPercentage66 = false; + bool bTabOverflow = false; OUString sRedlineProtectionKey( RTL_CONSTASCII_USTRINGPARAM( "RedlineProtectionKey" ) ); @@ -1289,6 +1291,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC bUseOldPrinterMetrics = true; else if( pValues->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SmallCapsPercentage66")) ) bSmallCapsPercentage66 = true; + else if( pValues->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TabOverflow")) ) + bTabOverflow = true; } catch( Exception& ) { @@ -1442,6 +1446,12 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC OUString( RTL_CONSTASCII_USTRINGPARAM("SmallCapsPercentage66") ), makeAny( true ) ); } + if ( !bTabOverflow ) + { + xProps->setPropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM("TabOverflow") ), makeAny( false ) ); + } + Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); Reference < XText > xText = xTextDoc->getText(); Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY); diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index 4a663622a10b..e1bdf64e8797 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -122,6 +122,7 @@ #include <sfx2/appuno.hxx> #include <swatrset.hxx> #include <idxmrk.hxx> +#include <wordcountdialog.hxx> #include <dlelstnr.hxx> #include <barcfg.hxx> #include <svx/rubydialog.hxx> @@ -397,6 +398,7 @@ void SwDLL::RegisterControls() SwMailMergeChildWindow::RegisterChildWindow( sal_False, pMod ); SwInsertIdxMarkWrapper::RegisterChildWindow( sal_False, pMod ); SwInsertAuthMarkWrapper::RegisterChildWindow( sal_False, pMod ); + SwWordCountWrapper::RegisterChildWindow( sal_False, pMod ); SvxRubyChildWindow::RegisterChildWindow( sal_False, pMod); SwSpellDialogChildWindow::RegisterChildWindow(sal_False, pMod); diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index e9b21008762d..8c352243fdd3 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1775,7 +1775,7 @@ SwTestTabPage::SwTestTabPage( Window* pParent, lcl_SetPosSize(aTest9CBox , Point(116, 53), Size(74 , 10)); lcl_SetPosSize(aTest10CBox , Point(116, 66), Size(74 , 10)); - aTestFL.SetText( String(ByteString("Einstellungen nur f\xFCr Testzwecke" ), RTL_TEXTENCODING_MS_1252)); + aTestFL.SetText(rtl::OUString(RTL_CONSTASCII_STRINGPARAM("Settings only for testpurposes", RTL_TEXTENCODING_ASCII_US)); aTest1CBox .SetText( C2S("unused")); aTest2CBox .SetText( C2S("dynamic")); aTest3CBox .SetText( C2S("No calm" )); diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index e059ab1114f6..4dc1204d6119 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1179,7 +1179,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, catch (const Exception& rExcept) { #if OSL_DEBUG_LEVEL > 1 - OSL_FAIL(ByteString(String(rExcept.Message), gsl_getSystemTextEncoding()).GetBuffer()); + OSL_FAIL(rtl::OUStringToOString(rExcept.Message, osl_getThreadTextEncoding()).getStr()); #else (void)rExcept; #endif diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 2bdd83ce6f4f..a732303b06f2 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -1207,7 +1207,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, if(pInStream) { pInStream->SetStreamCharSet( eEncoding ); - ByteString sLine; + rtl::OString sLine; sal_Bool bDone = pInStream->ReadLine( sLine ); while ( bDone ) { diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 1c6917b1d568..6e2e5099c1b3 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -1248,7 +1248,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) OSL_FAIL("no output file created?"); continue; } - ByteString sLine; + rtl::OString sLine; sal_Bool bDone = pInStream->ReadLine( sLine ); while ( bDone ) { diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 1b5f9adc1dfe..a46d03b57528 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -112,7 +112,7 @@ using namespace ::com::sun::star; -IMPL_ABSTDLG_BASE(AbstractSwWordCountDialog_Impl); +IMPL_ABSTDLG_BASE(AbstractSwWordCountFloatDlg_Impl); IMPL_ABSTDLG_BASE(AbstractSwInsertAbstractDlg_Impl); IMPL_ABSTDLG_BASE(AbstractSfxDialog_Impl); IMPL_ABSTDLG_BASE(AbstractSwAsciiFilterDlg_Impl); @@ -175,11 +175,6 @@ String AbstractTabDialog_Impl::GetText() const return pDlg->GetText(); } -void AbstractSwWordCountDialog_Impl::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) -{ - pDlg->SetValues(rCurrent, rDoc); -} - sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetLevel() const { return pDlg->GetLevel(); @@ -244,12 +239,12 @@ void AbstractSwInsertDBColAutoPilot_Impl::DataToDoc( const uno::Sequence< uno::A pDlg->DataToDoc(rSelection, rxSource, xConnection, xResultSet); } -ByteString AbstractDropDownFieldDialog_Impl::GetWindowState( sal_uLong nMask ) const +rtl::OString AbstractDropDownFieldDialog_Impl::GetWindowState( sal_uLong nMask ) const { return pDlg->GetWindowState(nMask); } -void AbstractDropDownFieldDialog_Impl::SetWindowState( const ByteString& rStr ) +void AbstractDropDownFieldDialog_Impl::SetWindowState( const rtl::OString& rStr ) { pDlg->SetWindowState(rStr); } @@ -400,12 +395,12 @@ String AbstractGlossaryDlg_Impl::GetCurrShortName() const return pDlg->GetCurrShortName(); } -void AbstractFldInputDlg_Impl::SetWindowState( const ByteString& rStr ) +void AbstractFldInputDlg_Impl::SetWindowState( const rtl::OString& rStr ) { pDlg->SetWindowState( rStr ); } -ByteString AbstractFldInputDlg_Impl::GetWindowState( sal_uLong nMask ) const +rtl::OString AbstractFldInputDlg_Impl::GetWindowState( sal_uLong nMask ) const { return pDlg->GetWindowState( nMask ); } @@ -572,6 +567,18 @@ Window* AbstractAuthMarkFloatDlg_Impl::GetWindow() return (Window*)pDlg; } + +Window* AbstractSwWordCountFloatDlg_Impl::GetWindow() +{ + return (Window*)pDlg; +} + +void AbstractSwWordCountFloatDlg_Impl::UpdateCounts() +{ + pDlg->UpdateCounts(); +} + + AbstractMailMergeWizard_Impl::~AbstractMailMergeWizard_Impl() { delete pDlg; @@ -624,12 +631,6 @@ sal_uInt16 AbstractMailMergeWizard_Impl::GetRestartPage() const return pDlg->GetRestartPage(); } -AbstractSwWordCountDialog* SwAbstractDialogFactory_Impl::CreateSwWordCountDialog(Window* pParent) -{ - SwWordCountDialog* pDlg = new SwWordCountDialog( pParent ); - return new AbstractSwWordCountDialog_Impl( pDlg ); -} - AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstractDlg( Window* pParent, int nResId ) { @@ -1546,6 +1547,26 @@ AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg( int return 0; } +AbstractSwWordCountFloatDlg * SwAbstractDialogFactory_Impl::CreateSwWordCountDialog( int nResId, + SfxBindings* pBindings, + SfxChildWindow* pChild, + Window *pParent, + SfxChildWinInfo* pInfo ) +{ + SwWordCountFloatDlg* pDlg=NULL; + switch ( nResId ) + { + case DLG_WORDCOUNT : + pDlg = new SwWordCountFloatDlg( pBindings, pChild, pParent, pInfo ); + break; + default: + break; + } + if ( pDlg ) + return new AbstractSwWordCountFloatDlg_Impl( pDlg ); + return 0; +} + //add for SwIndexMarkModalDlg begin VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg( int nResId, Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ) //add for SwIndexMarkModalDlg diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index e13ccfd7e84e..66ee0aba9167 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -76,11 +76,12 @@ short Class::Execute() \ return pDlg->Execute(); \ } - -class AbstractSwWordCountDialog_Impl : public AbstractSwWordCountDialog +class SwWordCountFloatDlg; +class AbstractSwWordCountFloatDlg_Impl : public AbstractSwWordCountFloatDlg { - DECL_ABSTDLG_BASE(AbstractSwWordCountDialog_Impl,SwWordCountDialog) - void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc); + DECL_ABSTDLG_BASE(AbstractSwWordCountFloatDlg_Impl,SwWordCountFloatDlg) + virtual void UpdateCounts(); + virtual Window * GetWindow(); //this method is added for return a Window type pointer }; //add for SwInsertAbstractDlg begin @@ -175,8 +176,8 @@ class AbstractSwInsertDBColAutoPilot_Impl : public AbstractSwInsertDBColAutoPil class AbstractDropDownFieldDialog_Impl : public AbstractDropDownFieldDialog //add for DropDownFieldDialog { DECL_ABSTDLG_BASE(AbstractDropDownFieldDialog_Impl, sw::DropDownFieldDialog) - virtual ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const; //this method inherit from SystemWindow - virtual void SetWindowState( const ByteString& rStr );//this method inherit from SystemWindow + virtual rtl::OString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const; //this method inherit from SystemWindow + virtual void SetWindowState( const rtl::OString& rStr );//this method inherit from SystemWindow }; //add for DropDownFieldDialog end @@ -269,8 +270,8 @@ class AbstractFldInputDlg_Impl : public AbstractFldInputDlg { DECL_ABSTDLG_BASE(AbstractFldInputDlg_Impl,SwFldInputDlg) //from class SalFrame - virtual void SetWindowState( const ByteString& rStr ) ; - virtual ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const ; + virtual void SetWindowState( const rtl::OString & rStr ) ; + virtual rtl::OString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const ; }; //for SwFldInputDlg end @@ -437,7 +438,11 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame, sal_uInt32 nResId ); - virtual AbstractSwWordCountDialog* CreateSwWordCountDialog(Window* pParent); + virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(int nResId, + SfxBindings* pBindings, + SfxChildWindow* pChild, + Window *pParent, + SfxChildWinInfo* pInfo); virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg( Window* pParent,int nResId ); virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh, SvStream* pStream, int nResId ); //add for SwAsciiFilterDlg diff --git a/sw/source/ui/dialog/wordcountdialog.cxx b/sw/source/ui/dialog/wordcountdialog.cxx index 4a98a4e19294..2ff37eda90b9 100644 --- a/sw/source/ui/dialog/wordcountdialog.cxx +++ b/sw/source/ui/dialog/wordcountdialog.cxx @@ -34,10 +34,16 @@ #include <swtypes.hxx> #include <wordcountdialog.hxx> #include <docstat.hxx> - #include <dialog.hrc> #include <layout/layout-pre.hxx> #include <wordcountdialog.hrc> +#include <cmdid.h> +#include "vcl/msgbox.hxx" // RET_CANCEL +#include <swmodule.hxx> +#include <wview.hxx> +#include <sfx2/viewfrm.hxx> +#include <swwait.hxx> +#include <wrtsh.hxx> #if ENABLE_LAYOUT #undef SW_RES @@ -49,7 +55,7 @@ #endif /* ENABLE_LAYOUT */ SwWordCountDialog::SwWordCountDialog(Window* pParent) : - SfxModalDialog(pParent, SW_RES(DLG_WORDCOUNT)), + Window(pParent, SW_RES(WINDOW_DLG)), #if defined _MSC_VER #pragma warning (disable : 4355) #endif @@ -79,10 +85,23 @@ SwWordCountDialog::SwWordCountDialog(Window* pParent) : SetHelpId (HID_DLG_WORDCOUNT); #endif /* ENABLE_LAYOUT */ FreeResource(); + + aOK.SetClickHdl(LINK(this,SwWordCountDialog, OkHdl)); +} + +IMPL_LINK( SwWordCountDialog, OkHdl, void*, EMPTYARG ) +{ + SfxViewFrame* pVFrame = ::GetActiveView()->GetViewFrame(); + if (pVFrame != NULL) + { + pVFrame->ToggleChildWindow(FN_WORDCOUNT_DIALOG); + } + return 0; } SwWordCountDialog::~SwWordCountDialog() { + ViewShell::SetCareWin( 0 ); } void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) @@ -95,4 +114,37 @@ void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& r aDocCharacterExcludingSpacesFI.SetText( String::CreateFromInt32(rDoc.nCharExcludingSpaces )); } + +SwWordCountFloatDlg::SwWordCountFloatDlg(SfxBindings* _pBindings, + SfxChildWindow* pChild, + Window *pParent, + SfxChildWinInfo* pInfo) + : SfxModelessDialog(_pBindings, pChild, pParent, SW_RES(DLG_WORDCOUNT)), + aDlg(this) +{ + FreeResource(); + Initialize(pInfo); +} + +void SwWordCountFloatDlg::Activate() +{ + SfxModelessDialog::Activate(); + aDlg.Activate(); +} + +void SwWordCountFloatDlg::UpdateCounts() +{ + SwWrtShell &rSh = ::GetActiveView()->GetWrtShell(); + SwDocStat aCurrCnt; + SwDocStat aDocStat; + { + SwWait aWait( *::GetActiveView()->GetDocShell(), sal_True ); + rSh.StartAction(); + rSh.CountWords( aCurrCnt ); + aDocStat = rSh.GetUpdatedDocStat(); + rSh.EndAction(); + } + aDlg.SetValues(aCurrCnt, aDocStat); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/wordcountdialog.hrc b/sw/source/ui/dialog/wordcountdialog.hrc index af6f3a79c76c..0db5c87b970f 100644 --- a/sw/source/ui/dialog/wordcountdialog.hrc +++ b/sw/source/ui/dialog/wordcountdialog.hrc @@ -43,5 +43,6 @@ #define FL_BOTTOM 15 #define PB_OK 16 #define PB_HELP 17 +#define WINDOW_DLG 18 #endif diff --git a/sw/source/ui/dialog/wordcountdialog.src b/sw/source/ui/dialog/wordcountdialog.src index 767913a0e5c9..a324c45d4d2b 100644 --- a/sw/source/ui/dialog/wordcountdialog.src +++ b/sw/source/ui/dialog/wordcountdialog.src @@ -27,7 +27,7 @@ #include <helpid.h> #include <dialog.hrc> #include <wordcountdialog.hrc> -ModalDialog DLG_WORDCOUNT +ModelessDialog DLG_WORDCOUNT { HelpID = HID_DLG_WORDCOUNT ; OutputSize = TRUE ; @@ -36,6 +36,15 @@ ModalDialog DLG_WORDCOUNT Text [ en-US ] = "Word Count" ; Moveable = TRUE ; + Closeable = TRUE; + Sizeable = FALSE ; + Hide = TRUE ; + + Window WINDOW_DLG + { + Pos = MAP_APPFONT ( 0 , 0 ) ; + Size = MAP_APPFONT ( 170 , 132 ) ; + FixedLine FL_CURRENT { Pos = MAP_APPFONT ( 6 , 3 ) ; @@ -136,4 +145,5 @@ ModalDialog DLG_WORDCOUNT Pos = MAP_APPFONT ( 114 , 112 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; }; + }; }; diff --git a/sw/source/ui/dialog/wordcountwrapper.cxx b/sw/source/ui/dialog/wordcountwrapper.cxx new file mode 100644 index 000000000000..ddecf5a0e96c --- /dev/null +++ b/sw/source/ui/dialog/wordcountwrapper.cxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Matt Pratt <mattpratt.au@gmail.com> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sw.hxx" + +#include <swtypes.hxx> +#include <wordcountdialog.hxx> +#include <docstat.hxx> +#include <dialog.hrc> +#include <layout/layout-pre.hxx> +#include <wordcountdialog.hrc> +#include <cmdid.h> + +SFX_IMPL_CHILDWINDOW(SwWordCountWrapper, FN_WORDCOUNT_DIALOG) + +SwWordCountWrapper::SwWordCountWrapper( Window *pParentWindow, + sal_uInt16 nId, + SfxBindings* pBindings, + SfxChildWinInfo* pInfo ) : + SfxChildWindow(pParentWindow, nId) +{ + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); + pAbstDlg = pFact->CreateSwWordCountDialog( DLG_WORDCOUNT, pBindings, this, pParentWindow, pInfo ); + OSL_ENSURE(pAbstDlg, "Dialog contruction faiedl!"); + pWindow = pAbstDlg->GetWindow(); + + eChildAlignment = SFX_ALIGN_NOALIGNMENT; +} + +SfxChildWinInfo SwWordCountWrapper::GetInfo() const +{ + SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); + return aInfo; +} + +void SwWordCountWrapper::UpdateCounts() +{ + pAbstDlg->UpdateCounts(); +} diff --git a/sw/source/ui/docvw/FrameControlsManager.cxx b/sw/source/ui/docvw/FrameControlsManager.cxx index 62f9b32b1b42..6b00d56f8c62 100644 --- a/sw/source/ui/docvw/FrameControlsManager.cxx +++ b/sw/source/ui/docvw/FrameControlsManager.cxx @@ -83,6 +83,21 @@ const SwFrameControlsManager& SwFrameControlsManager::operator=( const SwFrameCo return *this; } +SwFrameControlPtr SwFrameControlsManager::GetControl( FrameControlType eType, const SwFrm* pFrm ) +{ + SwFrameControlPtr pControl; + + vector< SwFrameControlPtr >& aControls = m_aControls[eType]; + + vector< SwFrameControlPtr >::iterator pIt = find_if( + aControls.begin(), aControls.end( ), FramePredicate( pFrm ) ); + + if ( pIt != aControls.end() ) + pControl = *pIt; + + return pControl; +} + std::vector< SwFrameControlPtr >& SwFrameControlsManager::GetControls( FrameControlType eType ) { return m_aControls[eType]; diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx index b48e450af0e7..2194bd92dba4 100644 --- a/sw/source/ui/docvw/PageBreakWin.cxx +++ b/sw/source/ui/docvw/PageBreakWin.cxx @@ -183,7 +183,8 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm ) m_pPopupMenu( NULL ), m_pLine( NULL ), m_bIsAppearing( false ), - m_nFadeRate( 100 ) + m_nFadeRate( 100 ), + m_bDestroyed( false ) { // Use pixels for the rest of the drawing SetMapMode( MapMode ( MAP_PIXEL ) ); @@ -202,6 +203,9 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm ) SwPageBreakWin::~SwPageBreakWin( ) { + m_bDestroyed = true; + m_aFadeTimer.Stop(); + delete m_pPopupMenu; delete m_pLine; } @@ -290,6 +294,8 @@ void SwPageBreakWin::Paint( const Rectangle& ) void SwPageBreakWin::Select( ) { + SwFrameControlPtr pThis = GetEditWin()->GetFrameControlsManager( ).GetControl( PageBreak, GetFrame() ); + switch( GetCurItemId( ) ) { case FN_PAGEBREAK_EDIT: @@ -298,25 +304,27 @@ void SwPageBreakWin::Select( ) while ( pBodyFrm && !pBodyFrm->IsBodyFrm() ) pBodyFrm = static_cast< const SwLayoutFrm* >( pBodyFrm->GetNext() ); + SwEditWin* pEditWin = GetEditWin(); + if ( pBodyFrm ) { + SwWrtShell& rSh = pEditWin->GetView().GetWrtShell(); + sal_Bool bOldLock = rSh.IsViewLocked(); + rSh.LockView( sal_True ); + if ( pBodyFrm->Lower()->IsTabFrm() ) { - SwWrtShell& rSh = GetEditWin()->GetView().GetWrtShell(); rSh.Push( ); rSh.ClearMark(); - sal_Bool bOldLock = rSh.IsViewLocked(); - rSh.LockView( sal_True ); SwCntntFrm *pCnt = const_cast< SwCntntFrm* >( pBodyFrm->ContainsCntnt() ); SwCntntNode* pNd = pCnt->GetNode(); rSh.SetSelection( *pNd ); - SfxUInt16Item aItem( GetEditWin()->GetView().GetPool( ).GetWhich( FN_FORMAT_TABLE_DLG ), TP_TABLE_TEXTFLOW ); - GetEditWin()->GetView().GetViewFrame()->GetDispatcher()->Execute( + SfxUInt16Item aItem( pEditWin->GetView().GetPool( ).GetWhich( FN_FORMAT_TABLE_DLG ), TP_TABLE_TEXTFLOW ); + pEditWin->GetView().GetViewFrame()->GetDispatcher()->Execute( FN_FORMAT_TABLE_DLG, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aItem, NULL ); - rSh.LockView( bOldLock ); rSh.Pop( sal_False ); } else @@ -325,12 +333,13 @@ void SwPageBreakWin::Select( ) SwCntntNode* pNd = pCnt->GetNode(); SwPaM aPaM( *pNd ); - SwPaMItem aPaMItem( GetEditWin()->GetView().GetPool( ).GetWhich( FN_PARAM_PAM ), &aPaM ); - SfxUInt16Item aItem( GetEditWin()->GetView().GetPool( ).GetWhich( SID_PARA_DLG ), TP_PARA_EXT ); - GetEditWin()->GetView().GetViewFrame()->GetDispatcher()->Execute( + SwPaMItem aPaMItem( pEditWin->GetView().GetPool( ).GetWhich( FN_PARAM_PAM ), &aPaM ); + SfxUInt16Item aItem( pEditWin->GetView().GetPool( ).GetWhich( SID_PARA_DLG ), TP_PARA_EXT ); + pEditWin->GetView().GetViewFrame()->GetDispatcher()->Execute( SID_PARA_DLG, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aItem, &aPaMItem, NULL ); } - GetEditWin()->GrabFocus( ); + rSh.LockView( bOldLock ); + pEditWin->GrabFocus( ); } } break; @@ -343,7 +352,6 @@ void SwPageBreakWin::Select( ) if ( pBodyFrm ) { SwCntntFrm *pCnt = const_cast< SwCntntFrm* >( pBodyFrm->ContainsCntnt() ); - //sal_uInt16 nWhich = pCnt->GetAttrSet()->GetPool()->GetWhich( SID_ATTR_PARA_PAGEBREAK ); SwCntntNode* pNd = pCnt->GetNode(); pNd->GetDoc()->GetIDocumentUndoRedo( ).StartUndo( UNDO_UI_DELETE_PAGE_BREAK, NULL ); @@ -363,7 +371,11 @@ void SwPageBreakWin::Select( ) } break; } - Fade( false ); + + // Only fade if there is more than this temporary shared pointer: + // The main reference has been deleted due to a page break removal + if ( pThis.use_count() > 1 ) + Fade( false ); } void SwPageBreakWin::MouseMove( const MouseEvent& rMEvt ) @@ -480,9 +492,10 @@ void SwPageBreakWin::Fade( bool bFadeIn ) if ( !PopupMenu::IsInExecute() ) { m_bIsAppearing = bFadeIn; - if ( m_aFadeTimer.IsActive( ) ) + if ( !m_bDestroyed && m_aFadeTimer.IsActive( ) ) m_aFadeTimer.Stop(); - m_aFadeTimer.Start( ); + if ( !m_bDestroyed ) + m_aFadeTimer.Start( ); } } diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 05991767b88c..f18433c4b929 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -134,6 +134,9 @@ #include "formatclipboard.hxx" #include <osl/mutex.hxx> #include <vcl/svapp.hxx> +#include <docstat.hxx> +#include <wordcountdialog.hxx> +#include <swwait.hxx> #include <IMark.hxx> #include <doc.hxx> @@ -2602,6 +2605,12 @@ KEYINPUT_CHECKTABLE_INSDEL: ShowAutoTextCorrectQuickHelp(sWord, pACfg, pACorr); } } + + // get the word count dialog to update itself + SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + if (pWrdCnt) + pWrdCnt->UpdateCounts(); + } /*-------------------------------------------------------------------- @@ -3668,6 +3677,13 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } return; } + + { + SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + if (pWrdCnt) + pWrdCnt->UpdateCounts(); + } + case MOUSE_LEFT + KEY_SHIFT: case MOUSE_LEFT + KEY_SHIFT + KEY_MOD1: if ( !bMBPressed ) diff --git a/sw/source/ui/inc/FrameControlsManager.hxx b/sw/source/ui/inc/FrameControlsManager.hxx index 798c0b9ed816..453466ec9cd0 100644 --- a/sw/source/ui/inc/FrameControlsManager.hxx +++ b/sw/source/ui/inc/FrameControlsManager.hxx @@ -60,6 +60,7 @@ class SwFrameControlsManager SwFrameControlsManager( const SwFrameControlsManager& rCopy ); const SwFrameControlsManager& operator=( const SwFrameControlsManager& rCopy ); + SwFrameControlPtr GetControl( FrameControlType eType, const SwFrm* pFrm ); std::vector< SwFrameControlPtr >& GetControls( FrameControlType eType ); void AddControl( FrameControlType eType, SwFrameControlPtr pControl ); void RemoveControls( const SwFrm* pFrm ); diff --git a/sw/source/ui/inc/PageBreakWin.hxx b/sw/source/ui/inc/PageBreakWin.hxx index 263ec56db9e9..bac664c6ac37 100644 --- a/sw/source/ui/inc/PageBreakWin.hxx +++ b/sw/source/ui/inc/PageBreakWin.hxx @@ -46,6 +46,7 @@ class SwPageBreakWin : public MenuButton, public SwFrameControl bool m_bIsAppearing; int m_nFadeRate; Timer m_aFadeTimer; + bool m_bDestroyed; public: SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm ); diff --git a/sw/source/ui/inc/wordcountdialog.hxx b/sw/source/ui/inc/wordcountdialog.hxx index 5c6dbabea04f..d4c996cba40e 100644 --- a/sw/source/ui/inc/wordcountdialog.hxx +++ b/sw/source/ui/inc/wordcountdialog.hxx @@ -33,7 +33,12 @@ #include <layout/layout.hxx> #include <layout/layout-pre.hxx> struct SwDocStat; -class SwWordCountDialog : public SfxModalDialog +#include <sfx2/childwin.hxx> +#include "swabstdlg.hxx" + +class SwWrtShell; + +class SwWordCountDialog : public Window { FixedLine aCurrentFL; FixedText aCurrentWordFT; @@ -56,11 +61,42 @@ class SwWordCountDialog : public SfxModalDialog OKButton aOK; HelpButton aHelp; + void InitControls(); + public: SwWordCountDialog(Window* pParent); ~SwWordCountDialog(); void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc); + + SW_DLLPRIVATE DECL_LINK( OkHdl, void* ); +}; + +class SwWordCountFloatDlg : public SfxModelessDialog +{ + SwWordCountDialog aDlg; + virtual void Activate(); + public: + SwWordCountFloatDlg( SfxBindings* pBindings, + SfxChildWindow* pChild, + Window *pParent, + SfxChildWinInfo* pInfo); + void UpdateCounts(); +}; + +class SwWordCountWrapper : public SfxChildWindow +{ + AbstractSwWordCountFloatDlg* pAbstDlg; +protected: + SwWordCountWrapper( Window *pParentWindow, + sal_uInt16 nId, + SfxBindings* pBindings, + SfxChildWinInfo* pInfo ); + + SFX_DECL_CHILDWINDOW(SwWordCountWrapper); + +public: + void UpdateCounts(); }; #include <layout/layout-post.hxx> diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 3a71ca85ef84..9d6c0a97d5e0 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -400,9 +400,9 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)(); void MoveCrsr( sal_Bool bWithSelect = sal_False ); // update input fields - sal_Bool StartInputFldDlg(SwField*, sal_Bool bNextButton, Window* pParentWin = 0, ByteString* pWindowState = 0); + sal_Bool StartInputFldDlg(SwField*, sal_Bool bNextButton, Window* pParentWin = 0, rtl::OString* pWindowState = 0); // update DropDown fields - sal_Bool StartDropDownFldDlg(SwField*, sal_Bool bNextButton, ByteString* pWindowState = 0); + sal_Bool StartDropDownFldDlg(SwField*, sal_Bool bNextButton, rtl::OString* pWindowState = 0); //"Handler" for changes at DrawView - for controls. virtual void DrawSelChanged( ); diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 4ffc8f7af846..b5c595b31d5e 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -463,7 +463,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( sPropName += String::CreateFromInt32( i ); lcl_SetProp(xInfo, xIdxProps, - ByteString(sPropName, RTL_TEXTENCODING_ASCII_US).GetBuffer(), + rtl::OUStringToOString(sPropName, RTL_TEXTENCODING_ASCII_US).getStr(), pForm->GetTemplate(i + nOffset)); } } diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 8b03568dac8e..6aada30c4655 100644 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -131,6 +131,8 @@ #include <langhelper.hxx> +#include <wordcountdialog.hxx> + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -410,23 +412,16 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) break; case FN_WORDCOUNT_DIALOG: { - SwWrtShell &rSh = rView.GetWrtShell(); - SwDocStat aCurr; - SwDocStat aDocStat; + SfxViewFrame* pVFrame = rView.GetViewFrame(); + if (pVFrame != NULL) { - SwWait aWait( *rView.GetDocShell(), sal_True ); - rSh.StartAction(); - rSh.CountWords( aCurr ); - aDocStat = rSh.GetUpdatedDocStat(); - rSh.EndAction(); - } + pVFrame->ToggleChildWindow(FN_WORDCOUNT_DIALOG); + Invalidate(rReq.GetSlot()); - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( rView.GetWindow() ); - pDialog->SetValues(aCurr, aDocStat ); - pDialog->Execute(); - delete pDialog; + SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)pVFrame->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + if (pWrdCnt) + pWrdCnt->UpdateCounts(); + } } break; case SID_CHAR_DLG: diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx index 695dddc69013..56e0a42515e7 100644 --- a/sw/source/ui/shells/drawsh.cxx +++ b/sw/source/ui/shells/drawsh.cxx @@ -70,6 +70,7 @@ #include <sfx2/msg.hxx> #include "swslots.hxx" #include "swabstdlg.hxx" +#include <wordcountdialog.hxx> #include "misc.hrc" using namespace ::com::sun::star; @@ -232,22 +233,16 @@ void SwDrawShell::Execute(SfxRequest &rReq) break; case FN_WORDCOUNT_DIALOG: { - SwDocStat aCurr; - SwDocStat aDocStat; + SfxViewFrame* pVFrame = GetView().GetViewFrame(); + if (pVFrame != NULL) { - SwWait aWait( *GetView().GetDocShell(), sal_True ); - rSh.StartAction(); - rSh.CountWords( aCurr ); - aDocStat = rSh.GetUpdatedDocStat(); - rSh.EndAction(); - } + pVFrame->ToggleChildWindow(FN_WORDCOUNT_DIALOG); + Invalidate(rReq.GetSlot()); - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() ); - pDialog->SetValues(aCurr, aDocStat ); - pDialog->Execute(); - delete pDialog; + SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)pVFrame->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + if (pWrdCnt) + pWrdCnt->UpdateCounts(); + } } break; case SID_EXTRUSION_TOOGLE: diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index 47a6b1a6caf2..dcbdd6f5f5d2 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -101,6 +101,7 @@ #include <viewopt.hxx> #include <wrtsh.hxx> #include <wview.hxx> +#include <wordcountdialog.hxx> #include "swabstdlg.hxx" #include "chrdlg.hrc" @@ -346,22 +347,16 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) break; case FN_WORDCOUNT_DIALOG: { - SwDocStat aCurr; - SwDocStat aDocStat; + SfxViewFrame* pVFrame = GetView().GetViewFrame(); + if (pVFrame != NULL) { - SwWait aWait( *GetView().GetDocShell(), sal_True ); - rSh.StartAction(); - rSh.CountWords( aCurr ); - aDocStat = rSh.GetUpdatedDocStat(); - rSh.EndAction(); - } + pVFrame->ToggleChildWindow(FN_WORDCOUNT_DIALOG); + Invalidate(rReq.GetSlot()); - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() ); - pDialog->SetValues(aCurr, aDocStat ); - pDialog->Execute(); - delete pDialog; + SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)pVFrame->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + if (pWrdCnt) + pWrdCnt->UpdateCounts(); + } } break; case SID_PARA_DLG: diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx index ce35e494febc..12efea78a63d 100644 --- a/sw/source/ui/shells/frmsh.cxx +++ b/sw/source/ui/shells/frmsh.cxx @@ -95,6 +95,8 @@ #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/uno/Any.h> +#include <wordcountdialog.hxx> + using ::editeng::SvxBorderLine; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -418,22 +420,16 @@ void SwFrameShell::Execute(SfxRequest &rReq) break; case FN_WORDCOUNT_DIALOG: { - SwDocStat aCurr; - SwDocStat aDocStat; + SfxViewFrame* pVFrame = GetView().GetViewFrame(); + if (pVFrame != NULL) { - SwWait aWait( *GetView().GetDocShell(), sal_True ); - rSh.StartAction(); - rSh.CountWords( aCurr ); - aDocStat = rSh.GetUpdatedDocStat(); - rSh.EndAction(); - } + pVFrame->ToggleChildWindow(FN_WORDCOUNT_DIALOG); + Invalidate(rReq.GetSlot()); - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() ); - pDialog->SetValues(aCurr, aDocStat ); - pDialog->Execute(); - delete pDialog; + SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)pVFrame->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + if (pWrdCnt) + pWrdCnt->UpdateCounts(); + } } break; default: bMore = sal_True; diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 44500b80fdac..3c892ad78443 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -140,7 +140,7 @@ const sal_uInt16 aUITableAttrRange[] = FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN, RES_FRAMEDIR, RES_FRAMEDIR, RES_ROW_SPLIT, RES_ROW_SPLIT, - FN_TABLE_BOX_TEXTDIRECTION, FN_TABLE_BOX_TEXTDIRECTION, + FN_TABLE_BOX_TEXTORIENTATION, FN_TABLE_BOX_TEXTORIENTATION, // #i29550# RES_COLLAPSING_BORDERS, RES_COLLAPSING_BORDERS, // <-- collapsing borders @@ -188,7 +188,7 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh ) // text direction in boxes SvxFrameDirectionItem aBoxDirection( FRMDIR_ENVIRONMENT, RES_FRAMEDIR ); if(rSh.GetBoxDirection( aBoxDirection )) - rSet.Put(aBoxDirection, FN_TABLE_BOX_TEXTDIRECTION); + rSet.Put(aBoxDirection, FN_TABLE_BOX_TEXTORIENTATION); sal_Bool bTableSel = rSh.IsTableMode(); if(!bTableSel) @@ -309,7 +309,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, const SfxPoolItem* pSplit = 0; sal_Bool bRowSplit = SFX_ITEM_SET == rSet.GetItemState( RES_ROW_SPLIT, sal_False, &pSplit ); const SfxPoolItem* pBoxDirection = 0; - sal_Bool bBoxDirection = SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_BOX_TEXTDIRECTION, sal_False, &pBoxDirection ); + sal_Bool bBoxDirection = SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_BOX_TEXTORIENTATION, sal_False, &pBoxDirection ); if( bBackground || bBorder || bRowSplit || bBoxDirection) { /* diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 5835e5c169b4..f379a6118d38 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -137,6 +137,7 @@ SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_TEXT)) SFX_CHILDWINDOW_REGISTRATION(FN_INSERT_IDX_ENTRY_DLG); SFX_CHILDWINDOW_REGISTRATION(FN_INSERT_AUTH_ENTRY_DLG); SFX_CHILDWINDOW_REGISTRATION(SID_RUBY_DIALOG); + SFX_CHILDWINDOW_REGISTRATION(FN_WORDCOUNT_DIALOG); } TYPEINIT1(SwTextShell,SwBaseShell) diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 9fdb4b46a907..aeda86e135e7 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -124,6 +124,7 @@ #include <sfx2/objface.hxx> #include <langhelper.hxx> #include <uiitems.hxx> +#include <wordcountdialog.hxx> using namespace ::com::sun::star; @@ -1287,23 +1288,16 @@ void SwTextShell::Execute(SfxRequest &rReq) break; case FN_WORDCOUNT_DIALOG: { - SwWrtShell &rSh = GetShell(); - SwDocStat aCurr; - SwDocStat aDocStat; + SfxViewFrame* pVFrame = GetView().GetViewFrame(); + if (pVFrame != NULL) { - SwWait aWait( *GetView().GetDocShell(), sal_True ); - rSh.StartAction(); - rSh.CountWords( aCurr ); - aDocStat = rSh.GetUpdatedDocStat(); - rSh.EndAction(); - } + pVFrame->ToggleChildWindow(FN_WORDCOUNT_DIALOG); + Invalidate(rReq.GetSlot()); - SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() ); - pDialog->SetValues(aCurr, aDocStat ); - pDialog->Execute(); - delete pDialog; + SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)pVFrame->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + if (pWrdCnt) + pWrdCnt->UpdateCounts(); + } } break; default: diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 25bc3a864017..695c849bbc3d 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -106,8 +106,8 @@ SwFormatTablePage::SwFormatTablePage( Window* pParent, const SfxItemSet& rSet ) aBottomMF(this, SW_RES( ED_BOTTOM_DIST )), aPropertiesFL(this, SW_RES( FL_PROPERTIES )), - aTextDirectionFT(this, SW_RES( FT_TEXTDIRECTION )), - aTextDirectionLB(this, SW_RES( LB_TEXTDIRECTION )), + aTextDirectionFT(this, SW_RES( FT_TEXTORIENTATION )), + aTextDirectionLB(this, SW_RES( LB_TEXTORIENTATION )), pTblData(0), nSaveWidth(0), @@ -1343,8 +1343,8 @@ SwTextFlowPage::SwTextFlowPage( Window* pParent, aRepeatHeaderNF (this, SW_RES(NF_REPEAT_HEADER )), aRepeatHeaderAfterFT (this), aRepeatHeaderCombo (this, SW_RES(WIN_REPEAT_HEADER), aRepeatHeaderNF, aRepeatHeaderBeforeFT, aRepeatHeaderAfterFT), - aTextDirectionFT(this, SW_RES(FT_TEXTDIRECTION )), - aTextDirectionLB(this, SW_RES(LB_TEXTDIRECTION )), + aTextDirectionFT(this, SW_RES(FT_TEXTORIENTATION )), + aTextDirectionLB(this, SW_RES(LB_TEXTORIENTATION )), aVertOrientFL (this, SW_RES(FL_VERT_ORIENT )), aVertOrientFT(this, SW_RES(FT_VERTORIENT )), @@ -1503,7 +1503,7 @@ sal_Bool SwTextFlowPage::FillItemSet( SfxItemSet& rSet ) bModified |= 0 != rSet.Put( SvxFrameDirectionItem( (SvxFrameDirection)(sal_uLong)aTextDirectionLB.GetEntryData(aTextDirectionLB.GetSelectEntryPos()) - , FN_TABLE_BOX_TEXTDIRECTION)); + , FN_TABLE_BOX_TEXTORIENTATION)); } if(aVertOrientLB.GetSelectEntryPos() != aVertOrientLB.GetSavedValue()) @@ -1675,9 +1675,9 @@ void SwTextFlowPage::Reset( const SfxItemSet& rSet ) aRepeatHeaderNF.SetValue( nRep ); aRepeatHeaderNF.SaveValue(); } - if ( rSet.GetItemState(FN_TABLE_BOX_TEXTDIRECTION) > SFX_ITEM_AVAILABLE ) + if ( rSet.GetItemState(FN_TABLE_BOX_TEXTORIENTATION) > SFX_ITEM_AVAILABLE ) { - sal_uLong nDirection = ((const SvxFrameDirectionItem&)rSet.Get(FN_TABLE_BOX_TEXTDIRECTION)).GetValue(); + sal_uLong nDirection = ((const SvxFrameDirectionItem&)rSet.Get(FN_TABLE_BOX_TEXTORIENTATION)).GetValue(); aTextDirectionLB.SelectEntryPos(aTextDirectionLB.GetEntryPos( (const void*)nDirection )); } diff --git a/sw/source/ui/table/tabledlg.hrc b/sw/source/ui/table/tabledlg.hrc index f03aed6afffc..3933cd3fc37f 100644 --- a/sw/source/ui/table/tabledlg.hrc +++ b/sw/source/ui/table/tabledlg.hrc @@ -58,8 +58,8 @@ #define WIN_REPEAT_HEADER 40 #define FL_HEADLINE 41 #define FL_PROPERTIES 42 -#define FT_TEXTDIRECTION 43 -#define LB_TEXTDIRECTION 44 +#define FT_TEXTORIENTATION 43 +#define LB_TEXTORIENTATION 44 #define BT_OK 100 #define BT_CANCEL 101 diff --git a/sw/source/ui/table/tabledlg.src b/sw/source/ui/table/tabledlg.src index 1a0fc0ea55ee..dbaa2a09eb03 100644 --- a/sw/source/ui/table/tabledlg.src +++ b/sw/source/ui/table/tabledlg.src @@ -307,16 +307,16 @@ TabPage TP_FORMAT_TABLE Hide = TRUE ; Text [ en-US ] = "Properties"; }; - FixedText FT_TEXTDIRECTION + FixedText FT_TEXTORIENTATION { Pos = MAP_APPFONT ( 12 , 138 ) ; Size = MAP_APPFONT ( 60 , 8 ) ; Hide = TRUE ; Text [ en-US ] = "Text ~direction"; }; - ListBox LB_TEXTDIRECTION + ListBox LB_TEXTORIENTATION { - HelpID = "sw:ListBox:TP_FORMAT_TABLE:LB_TEXTDIRECTION"; + HelpID = "sw:ListBox:TP_FORMAT_TABLE:LB_TEXTORIENTATION"; Border = TRUE ; Pos = MAP_APPFONT ( 75 , 136 ) ; Size = MAP_APPFONT ( 176 , 50 ) ; @@ -733,23 +733,23 @@ TabPage TP_TABLE_TEXTFLOW Pos = MAP_APPFONT ( 21 , 113 ) ; Size = MAP_APPFONT ( 2 , 1 ) ; }; - FixedText FT_TEXTDIRECTION + FixedText FT_TEXTORIENTATION { Pos = MAP_APPFONT ( 12 , 132 ) ; Size = MAP_APPFONT ( 70 , 10 ) ; - Text [ en-US ] = "Text ~direction" ; + Text [ en-US ] = "Text ~orientation" ; }; - ListBox LB_TEXTDIRECTION + ListBox LB_TEXTORIENTATION { - HelpID = "sw:ListBox:TP_TABLE_TEXTFLOW:LB_TEXTDIRECTION"; + HelpID = "sw:ListBox:TP_TABLE_TEXTFLOW:LB_TEXTORIENTATION"; Pos = MAP_APPFONT ( 85 , 130 ) ; Size = MAP_APPFONT ( 163 , 50 ) ; DropDown = TRUE; Border = TRUE; StringList [ en-US ] = { - < "Left-to-right" ; 0; > ; - < "Right-to-left (vertical)" ; 2; > ; + < "horizontal" ; 0; > ; + < "vertical" ; 2; > ; < "Use superordinate object settings" ; 4; > ; }; }; diff --git a/sw/source/ui/uiview/formatclipboard.cxx b/sw/source/ui/uiview/formatclipboard.cxx index 0fa7a6a00071..a9bfa3f97c39 100644 --- a/sw/source/ui/uiview/formatclipboard.cxx +++ b/sw/source/ui/uiview/formatclipboard.cxx @@ -117,7 +117,7 @@ SfxItemSet* lcl_CreateEmptyItemSet( int nSelectionType, SfxItemPool& rPool RES_KEEP, RES_KEEP, RES_FRAMEDIR, RES_FRAMEDIR, FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE, - FN_TABLE_BOX_TEXTDIRECTION, FN_TABLE_BOX_TEXTDIRECTION, + FN_TABLE_BOX_TEXTORIENTATION, FN_TABLE_BOX_TEXTORIENTATION, FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN, 0); } @@ -158,7 +158,7 @@ void lcl_getTableAttributes( SfxItemSet& rSet, SwWrtShell &rSh ) SvxFrameDirectionItem aBoxDirection( FRMDIR_ENVIRONMENT, RES_FRAMEDIR ); if(rSh.GetBoxDirection( aBoxDirection )) - rSet.Put(aBoxDirection, FN_TABLE_BOX_TEXTDIRECTION); + rSet.Put(aBoxDirection, FN_TABLE_BOX_TEXTORIENTATION); rSet.Put(SfxUInt16Item(FN_TABLE_SET_VERT_ALIGN, rSh.GetBoxAlign())); @@ -255,7 +255,7 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh ) pFrmFmt->SetFmtAttr( *pItem ); } - if( SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_BOX_TEXTDIRECTION, sal_False, &pItem) ) + if( SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_BOX_TEXTORIENTATION, sal_False, &pItem) ) { SvxFrameDirectionItem aDirection( FRMDIR_ENVIRONMENT, RES_FRAMEDIR ); aDirection.SetValue(static_cast< const SvxFrameDirectionItem* >(pItem)->GetValue()); diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx index ca6a1a4b16ef..bbd490f0640b 100644 --- a/sw/source/ui/uiview/viewsrch.cxx +++ b/sw/source/ui/uiview/viewsrch.cxx @@ -374,21 +374,22 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage) RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_WEIGHT }; - SvUShorts aArr( 0, 16 ); - aArr.Insert( aNormalAttr, - SAL_N_ELEMENTS( aNormalAttr ), - 0 ); + std::vector<sal_uInt16> aArr; + aArr.insert( aArr.begin(), aNormalAttr, + aNormalAttr + SAL_N_ELEMENTS( aNormalAttr )); if( SW_MOD()->GetCTLOptions().IsCTLFontEnabled() ) - aArr.Insert( aCTLAttr, - SAL_N_ELEMENTS( aCTLAttr ), - 14 ); + { + aArr.insert( aArr.begin() + 14, aCTLAttr, + aCTLAttr + SAL_N_ELEMENTS( aCTLAttr )); + } SvtCJKOptions aCJKOpt; if( aCJKOpt.IsAnyEnabled() ) - aArr.Insert( aCJKAttr, - SAL_N_ELEMENTS( aCJKAttr ), - 14 ); + { + aArr.insert( aArr.begin() + 14, aCJKAttr, + aCJKAttr + SAL_N_ELEMENTS( aCJKAttr )); + } - SfxItemSet aSet( pWrtShell->GetAttrPool(), aArr.GetData() ); + SfxItemSet aSet( pWrtShell->GetAttrPool(), &aArr[0] ); sal_uInt16 nWhich = SID_SEARCH_SEARCHSET; if ( FID_SEARCH_REPLACESET == nSlot ) diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index b3dbea127dfe..0d42d120c3c6 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -123,7 +123,8 @@ enum SwDocumentSettingsPropertyHandles HANDLE_MATH_BASELINE_ALIGNMENT, HANDLE_INVERT_BORDER_SPACING, HANDLE_COLLAPSE_EMPTY_CELL_PARA, - HANDLE_SMALL_CAPS_PERCENTAGE_66 + HANDLE_SMALL_CAPS_PERCENTAGE_66, + HANDLE_TAB_OVERFLOW }; MasterPropertySetInfo * lcl_createSettingsInfo() @@ -182,6 +183,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo() { RTL_CONSTASCII_STRINGPARAM("InvertBorderSpacing"), HANDLE_INVERT_BORDER_SPACING, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("CollapseEmptyCellPara"), HANDLE_COLLAPSE_EMPTY_CELL_PARA, CPPUTYPE_BOOLEAN, 0, 0}, { RTL_CONSTASCII_STRINGPARAM("SmallCapsPercentage66"), HANDLE_SMALL_CAPS_PERCENTAGE_66, CPPUTYPE_BOOLEAN, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("TabOverflow"), HANDLE_TAB_OVERFLOW, CPPUTYPE_BOOLEAN, 0, 0}, /* * As OS said, we don't have a view when we need to set this, so I have to * find another solution before adding them to this property set - MTG @@ -709,6 +711,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf mpDoc->set(IDocumentSettingAccess::SMALL_CAPS_PERCENTAGE_66, bTmp); } break; + case HANDLE_TAB_OVERFLOW: + { + sal_Bool bTmp = *(sal_Bool*)rValue.getValue(); + mpDoc->set(IDocumentSettingAccess::TAB_OVERFLOW, bTmp); + } + break; default: throw UnknownPropertyException(); } @@ -1059,6 +1067,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue.setValue( &bTmp, ::getBooleanCppuType() ); } break; + case HANDLE_TAB_OVERFLOW: + { + sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::TAB_OVERFLOW ); + rValue.setValue( &bTmp, ::getBooleanCppuType() ); + } + break; default: throw UnknownPropertyException(); } diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx index d0c10642c358..9583155aca89 100644 --- a/sw/source/ui/wrtsh/select.cxx +++ b/sw/source/ui/wrtsh/select.cxx @@ -50,6 +50,7 @@ #include <swevent.hxx> #include <swdtflvr.hxx> #include <crsskip.hxx> +#include <wordcountdialog.hxx> #if OSL_DEBUG_LEVEL > 1 #include <pam.hxx> @@ -70,6 +71,9 @@ void SwWrtShell::Invalidate() // to avoid making the slot volatile, invalidate it everytime if something could have been changed // this is still much cheaper than asking for the state every 200 ms (and avoid background processing) GetView().GetViewFrame()->GetBindings().Invalidate( FN_STAT_SELMODE ); + SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + if (pWrdCnt) + pWrdCnt->UpdateCounts(); } sal_Bool SwWrtShell::SelNearestWrd() @@ -419,14 +423,19 @@ void SwWrtShell::SttSelect() void SwWrtShell::EndSelect() { - if(!bInSelect || bExtMode) - return; - bInSelect = sal_False; - (this->*fnLeaveSelect)(0,sal_False); - if(!bAddMode) { - fnSetCrsr = &SwWrtShell::SetCrsrKillSel; - fnKillSel = &SwWrtShell::ResetSelect; + if(bInSelect && !bExtMode) + { + bInSelect = sal_False; + (this->*fnLeaveSelect)(0,sal_False); + if(!bAddMode) + { + fnSetCrsr = &SwWrtShell::SetCrsrKillSel; + fnKillSel = &SwWrtShell::ResetSelect; + } } + SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId()); + if (pWrdCnt) + pWrdCnt->UpdateCounts(); } /* Methode, um eine bestehende wortweise oder zeilenweise Selektion * zu erweitern. diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx index 172500cd3fd0..9d3118277cb4 100644 --- a/sw/source/ui/wrtsh/wrtsh2.cxx +++ b/sw/source/ui/wrtsh/wrtsh2.cxx @@ -119,7 +119,7 @@ void SwWrtShell::UpdateInputFlds( SwInputFieldList* pLst, sal_Bool bOnlyInSel ) pTmp->PushCrsr(); sal_Bool bCancel = sal_False; - ByteString aDlgPos; + rtl::OString aDlgPos; for( sal_uInt16 i = 0; i < nCnt && !bCancel; ++i ) { pTmp->GotoFieldPos( i ); @@ -147,7 +147,7 @@ void SwWrtShell::UpdateInputFlds( SwInputFieldList* pLst, sal_Bool bOnlyInSel ) sal_Bool SwWrtShell::StartInputFldDlg( SwField* pFld, sal_Bool bNextButton, - Window* pParentWin, ByteString* pWindowState ) + Window* pParentWin, rtl::OString* pWindowState ) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); @@ -155,7 +155,7 @@ sal_Bool SwWrtShell::StartInputFldDlg( SwField* pFld, sal_Bool bNextButton, AbstractFldInputDlg* pDlg = pFact->CreateFldInputDlg( DLG_FLD_INPUT, pParentWin, *this, pFld, bNextButton); OSL_ENSURE(pDlg, "Dialogdiet fail!"); - if(pWindowState && pWindowState->Len()) + if(pWindowState && pWindowState->getLength()) pDlg->SetWindowState(*pWindowState); sal_Bool bRet = RET_CANCEL == pDlg->Execute(); if(pWindowState) @@ -166,14 +166,14 @@ sal_Bool SwWrtShell::StartInputFldDlg( SwField* pFld, sal_Bool bNextButton, return bRet; } -sal_Bool SwWrtShell::StartDropDownFldDlg(SwField* pFld, sal_Bool bNextButton, ByteString* pWindowState) +sal_Bool SwWrtShell::StartDropDownFldDlg(SwField* pFld, sal_Bool bNextButton, rtl::OString* pWindowState) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); AbstractDropDownFieldDialog* pDlg = pFact->CreateDropDownFieldDialog( NULL, *this, pFld, DLG_FLD_DROPDOWN ,bNextButton ); OSL_ENSURE(pDlg, "Dialogdiet fail!"); - if(pWindowState && pWindowState->Len()) + if(pWindowState && pWindowState->getLength()) pDlg->SetWindowState(*pWindowState); sal_uInt16 nRet = pDlg->Execute(); if(pWindowState) diff --git a/swext/Extension_wiki-publisher.mk b/swext/Extension_wiki-publisher.mk index bdf0855660ec..d4c64d505e98 100644 --- a/swext/Extension_wiki-publisher.mk +++ b/swext/Extension_wiki-publisher.mk @@ -53,7 +53,7 @@ $(eval $(call gb_Extension_add_file,wiki-publisher,WikiEditor/script.xlb,$(WIKIS $(eval $(call gb_Extension_add_file,wiki-publisher,WikiEditor/dialog.xlb,$(WIKISRC)/dialogs/dialog.xlb)) $(eval $(call gb_Extension_add_file,wiki-publisher,WikiEditor/SendToMediaWiki.xdl,$(WIKISRC)/dialogs/SendToMediaWiki.xdl)) $(eval $(call gb_Extension_add_file,wiki-publisher,filter/odt2mediawiki.xsl,$(WIKISRC)/src/filter/odt2mediawiki.xsl)) -$(eval $(call gb_Extension_add_file,wiki-publisher,component.txt,$(WIKISRC)/src/component.txt)) +$(eval $(call gb_Extension_add_file,wiki-publisher,description-en-US.txt,$(WIKISRC)/src/description-en-US.txt)) $(eval $(call gb_Extension_add_file,wiki-publisher,help/en-US/com.sun.wiki-publisher/wikisend.xhp,$(WIKISRC)/help/wikisend.xhp)) $(eval $(call gb_Extension_add_file,wiki-publisher,help/en-US/com.sun.wiki-publisher/wikiformats.xhp,$(WIKISRC)/help/wikiformats.xhp)) $(eval $(call gb_Extension_add_file,wiki-publisher,help/en-US/com.sun.wiki-publisher/wikiaccount.xhp,$(WIKISRC)/help/wikiaccount.xhp)) diff --git a/swext/Zip_mediawiki_develop.mk b/swext/Zip_mediawiki_develop.mk index cb99ce894cd1..f682b074e82d 100644 --- a/swext/Zip_mediawiki_develop.mk +++ b/swext/Zip_mediawiki_develop.mk @@ -49,7 +49,7 @@ $(eval $(call gb_Zip_add_file,mediawiki_develop,WikiEditor/script.xlb,$(WIKISRC) $(eval $(call gb_Zip_add_file,mediawiki_develop,WikiEditor/dialog.xlb,$(WIKISRC)/dialogs/dialog.xlb)) $(eval $(call gb_Zip_add_file,mediawiki_develop,WikiEditor/SendToMediaWiki.xdl,$(WIKISRC)/dialogs/SendToMediaWiki.xdl)) $(eval $(call gb_Zip_add_file,mediawiki_develop,filter/odt2mediawiki.xsl,$(WIKISRC)/src/filter/odt2mediawiki.xsl)) -$(eval $(call gb_Zip_add_file,mediawiki_develop,component.txt,$(WIKISRC)/src/component.txt)) +$(eval $(call gb_Zip_add_file,mediawiki_develop,description-en-US.txt,$(WIKISRC)/src/description-en-US.txt)) $(eval $(call gb_Zip_add_file,mediawiki_develop,help/en-US/com.sun.wiki-publisher/wikisend.xhp,$(WIKISRC)/help/wikisend.xhp)) $(eval $(call gb_Zip_add_file,mediawiki_develop,help/en-US/com.sun.wiki-publisher/wikiformats.xhp,$(WIKISRC)/help/wikiformats.xhp)) $(eval $(call gb_Zip_add_file,mediawiki_develop,help/en-US/com.sun.wiki-publisher/wikiaccount.xhp,$(WIKISRC)/help/wikiaccount.xhp)) diff --git a/swext/mediawiki/help/wikiaccount.xhp b/swext/mediawiki/help/wikiaccount.xhp index 3254de7e8128..b27ea09278e4 100644 --- a/swext/mediawiki/help/wikiaccount.xhp +++ b/swext/mediawiki/help/wikiaccount.xhp @@ -49,7 +49,7 @@ <paragraph role="paragraph" id="par_id1113010" xml-lang="en-US" l10n="NEW"><ahelp hid="." visibility="hidden">Enter your password on the MediaWiki server. Leave empty for anonymous access.</ahelp></paragraph><comment>Save password</comment> <bookmark xml-lang="en-US" branch="hid/com.sun.star.wiki.MediaWiki.EditSetting.SaveBox" id="bm_id4558247" localize="false"/> <paragraph role="paragraph" id="par_id656758" xml-lang="en-US" l10n="NEW"><ahelp hid="." visibility="hidden">Enable to store your password between sessions. The master password must be enabled, see <item type="menuitem">Tools - Options - %PRODUCTNAME - Security</item>.</ahelp></paragraph> -<paragraph role="paragraph" id="par_id3112582" xml-lang="en-US" l10n="NEW">Enter the Internet address of a Wiki server in a format like http://wiki.services.openoffice.org/wiki or copy the URL from a web browser.</paragraph> +<paragraph role="paragraph" id="par_id3112582" xml-lang="en-US" l10n="NEW">Enter the Internet address of a Wiki server in a format like http://wiki.documentfoundation.org or copy the URL from a web browser.</paragraph> <paragraph role="paragraph" id="par_id628070" xml-lang="en-US" l10n="NEW">If the Wiki allows anonymous access, you can leave the account text boxes empty. Else enter your user name and password.</paragraph> <paragraph role="paragraph" id="par_id9046601" xml-lang="en-US" l10n="NEW">If you have enabled the master password feature on the Security tab page of the Tools - Options - %PRODUCTNAME dialog, then the software can store your password and automatically insert the data where necessary. Enable the "Save password" checkbox to store your password.</paragraph> </body> diff --git a/swext/mediawiki/src/component.txt b/swext/mediawiki/src/description-en-US.txt index d993ce105691..d993ce105691 100755..100644 --- a/swext/mediawiki/src/component.txt +++ b/swext/mediawiki/src/description-en-US.txt diff --git a/swext/mediawiki/src/description.xml b/swext/mediawiki/src/description.xml index 31dcfe3d9840..11d10b5bb8db 100644 --- a/swext/mediawiki/src/description.xml +++ b/swext/mediawiki/src/description.xml @@ -12,6 +12,6 @@ <name xlink:href="http://www.documentfoundation.org" lang="en-US">The Document Foundation</name> </publisher> <extension-description> - <src xlink:href="component.txt" lang="en-US"/> + <src xlink:href="description-en-US.txt" lang="en-US"/> </extension-description> </description> diff --git a/sysui/desktop/man/unopkg.1 b/sysui/desktop/man/unopkg.1 index b98a30d5f5ea..dad74dd48164 100644 --- a/sysui/desktop/man/unopkg.1 +++ b/sysui/desktop/man/unopkg.1 @@ -25,7 +25,7 @@ LibreOffice is a fully featured office suite for the daily use with all features you would normally expect in an office suite. There exists many LibreOffice extensions all over the word. For example, see -\fBhttp://extensions.services.openoffice.org/\fR +\fBhttp://extensions.libreoffice.org/\fR This tool allows to manage the extensions from the command line. diff --git a/toolkit/inc/layout/layout-post.hxx b/toolkit/inc/layout/layout-post.hxx index 46d4c383a984..da9a052e1b6b 100644 --- a/toolkit/inc/layout/layout-post.hxx +++ b/toolkit/inc/layout/layout-post.hxx @@ -35,45 +35,24 @@ #undef _LAYOUT_PRE_HXX -#undef AdvancedButton -#undef ApplyButton #undef Box #undef Button #undef CancelButton -#undef CheckBox -#undef ComboBox #undef Container #undef Control #undef Dialog #undef Edit -#undef ErrorBox #undef FixedImage -#undef FixedInfo -#undef FixedLine #undef FixedText -#undef HBox #undef HelpButton #undef IgnoreButton -#undef ImageButton -#undef InfoBox #undef ListBox #undef MessBox #undef MessageBox -#undef MetricField #undef MetricFormatter -#undef MoreButton -#undef MultiLineEdit -#undef MultiListBox #undef NoButton -#undef NumericField #undef NumericFormatter -#undef OKButton -#undef Plugin -#undef ProgressBar #undef PushButton -#undef QueryBox -#undef RadioButton -#undef ResetButton #undef RetryButton #undef SfxTabDialog #undef SfxTabPage @@ -84,8 +63,6 @@ #undef TabControl #undef TabPage #undef Table -#undef VBox -#undef WarningBox #undef YesButton #undef SvxFontListBox diff --git a/toolkit/inc/layout/layout-pre.hxx b/toolkit/inc/layout/layout-pre.hxx index 4205a44f1f54..9f6b59e3ab2f 100644 --- a/toolkit/inc/layout/layout-pre.hxx +++ b/toolkit/inc/layout/layout-pre.hxx @@ -34,57 +34,32 @@ ///* Allow re-inclusion for next hxx file. */ #undef _LAYOUT_POST_HXX -#define AdvancedButton layout::AdvancedButton -#define ApplyButton layout::ApplyButton #define Box layout::Box #define Button layout::Button #define CancelButton layout::CancelButton -#define CheckBox layout::CheckBox -#define ComboBox layout::ComboBox #define Container layout::Container #define Control layout::Control #define Dialog layout::Dialog #define Edit layout::Edit -#define ErrorBox layout::ErrorBox #define FixedImage layout::FixedImage -#define FixedInfo layout::FixedInfo -#define FixedLine layout::FixedLine #define FixedText layout::FixedText -#define HBox layout::HBox #define HelpButton layout::HelpButton #define IgnoreButton layout::IgnoreButton -#define ImageButton layout::ImageButton -#define InfoBox layout::InfoBox -#define LocalizedString layout::LocalizedString #define ListBox layout::ListBox #define MessBox layout::MessBox #define MessageBox layout::MessageBox -#define MetricField layout::MetricField #define MetricFormatter layout::MetricFormatter -#define MoreButton layout::MoreButton -#define MultiLineEdit layout::MultiLineEdit -#define MultiListBox layout::MultiListBox #define NoButton layout::NoButton -#define NumericField layout::NumericField #define NumericFormatter layout::NumericFormatter -#define OKButton layout::OKButton -#define Plugin layout::Plugin -#define ProgressBar layout::ProgressBar #define PushButton layout::PushButton -#define QueryBox layout::QueryBox -#define RadioButton layout::RadioButton -#define ResetButton layout::ResetButton #define RetryButton layout::RetryButton #define SfxTabDialog layout::SfxTabDialog #define SfxTabPage layout::SfxTabPage #define SvxFontListBox layout::SvxFontListBox #define SvxLanguageBox layout::SvxLanguageBox -#define SpinField layout::SpinField #define TabControl layout::TabControl #define TabPage layout::TabPage #define Table layout::Table -#define VBox layout::VBox -#define WarningBox layout::WarningBox #define YesButton layout::YesButton #define ModalDialog Dialog @@ -97,12 +72,10 @@ #define Window ::Window -#else +#endif /* ENABLE_LAYOUT */ #define LocalizedString String -#endif /* ENABLE_LAYOUT */ - #endif /* _LAYOUT_PRE_HXX */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/inc/layout/layout.hxx b/toolkit/inc/layout/layout.hxx index de53a4687ddb..e2f8d76d032c 100644 --- a/toolkit/inc/layout/layout.hxx +++ b/toolkit/inc/layout/layout.hxx @@ -38,13 +38,11 @@ #include <tools/link.hxx> #include <tools/string.hxx> #include <vcl/bitmap.hxx> -#include <vcl/combobox.h> #include <tools/fldunit.hxx> #include <vcl/lstbox.h> #include <tools/wintypes.hxx> class Button; -class ComboBox; class Color; class Control; class Dialog; @@ -53,16 +51,12 @@ class Font; class Image; class ListBox; class MapMode; -class MultiListBox; -class NotifyEvent; class Pointer; class PushButton; -class RadioButton; class ResId; struct SfxChildWinInfo; class TabControl; class TabPage; -class VCLXRadioButton; class VCLXWindow; class Window; @@ -89,8 +83,6 @@ public: Context( char const* pPath ); virtual ~Context(); PeerHandle GetPeerHandle( char const* id, sal_uInt32 nId = 0 ) const; - void setToplevel( PeerHandle xToplevel ); - PeerHandle getToplevel(); PeerHandle getRoot(); }; @@ -195,28 +187,16 @@ class TOOLKIT_DLLPUBLIC Control : public Window public: ~Control (); void SetGetFocusHdl (Link const& link); - Link& GetGetFocusHdl (); void SetLoseFocusHdl (Link const& link); - Link& GetLoseFocusHdl (); -}; - -class FixedLineImpl; -class TOOLKIT_DLLPUBLIC FixedLine : public Control -{ - DECL_GET_IMPL( FixedLine ); - DECL_CONSTRUCTORS( FixedLine, Control, WB_HORZ ); - -public: - bool IsEnabled() const; }; class FixedTextImpl; class TOOLKIT_DLLPUBLIC FixedText : public Control { DECL_GET_IMPL( FixedText ); - DECL_CONSTRUCTORS( FixedText, Control, 0 ); public: + FixedText( Context *context, char const* id, sal_uInt32 nId = 0 ); ~FixedText (); void SetText( rtl::OUString const& rStr ); }; @@ -225,16 +205,9 @@ class FixedImageImpl; class TOOLKIT_DLLPUBLIC FixedImage : public Control { DECL_GET_IMPL( FixedImage ); - DECL_CONSTRUCTORS( FixedImage, Control, 0 ); -public: - void setImage( ::Image const& ); -}; -class FixedInfoImpl; -class TOOLKIT_DLLPUBLIC FixedInfo : public FixedText -{ - DECL_GET_IMPL( FixedInfo ); - DECL_CONSTRUCTORS( FixedInfo, FixedText, 0 ); +public: + FixedImage( Context *context, char const* id, sal_uInt32 nId = 0 ); }; class ImageImpl; @@ -242,8 +215,6 @@ class TOOLKIT_DLLPUBLIC Image { ImageImpl *pImpl; public: - Image( char const* pName ); - ~Image(); ImageImpl &getImpl() const { return *pImpl; } }; @@ -258,133 +229,55 @@ public: ~Button (); static String GetStandardText (sal_uInt16 button_type); void SetText( rtl::OUString const& rStr ); - bool SetModeImage (Image const& image); - bool SetModeImage (::Image const& image); - void SetImageAlign( ImageAlign eAlign ); - void SetClickHdl( Link const& rLink ); virtual void Click() /* pure virtual? */; - Link& GetClickHdl (); }; class PushButtonImpl; class TOOLKIT_DLLPUBLIC PushButton : public Button { DECL_GET_IMPL( PushButton ); - DECL_CONSTRUCTORS( PushButton, Button, 0 ); DECL_GET_WINDOW (PushButton); +protected: + explicit PushButton( WindowImpl *pImpl ) : Button( pImpl ) {} + public: ~PushButton (); void Check( bool bCheck=true ); - bool IsChecked() const; - void Toggle(); void SetToggleHdl( Link const& rLink ); }; -class TOOLKIT_DLLPUBLIC OKButton : public PushButton -{ - DECL_CONSTRUCTORS( OKButton, PushButton, WB_DEFBUTTON ); -}; class TOOLKIT_DLLPUBLIC CancelButton : public PushButton { - DECL_CONSTRUCTORS( CancelButton, PushButton, 0 ); +public: + CancelButton( Context *context, char const* id, sal_uInt32 nId = 0 ); }; class TOOLKIT_DLLPUBLIC YesButton : public PushButton { - DECL_CONSTRUCTORS( YesButton, PushButton, WB_DEFBUTTON ); +public: + YesButton( Context *context, char const* id, sal_uInt32 nId = 0 ); }; class TOOLKIT_DLLPUBLIC NoButton : public PushButton { - DECL_CONSTRUCTORS( NoButton, PushButton, 0 ); +public: + NoButton( Context *context, char const* id, sal_uInt32 nId = 0 ); }; class TOOLKIT_DLLPUBLIC RetryButton : public PushButton { - DECL_CONSTRUCTORS( RetryButton, PushButton, 0 ); +public: + RetryButton( Context *context, char const* id, sal_uInt32 nId = 0 ); }; class TOOLKIT_DLLPUBLIC IgnoreButton : public PushButton { - DECL_CONSTRUCTORS( IgnoreButton, PushButton, 0 ); -}; -class TOOLKIT_DLLPUBLIC ResetButton : public PushButton -{ - DECL_CONSTRUCTORS( ResetButton, PushButton, 0 ); -}; -class TOOLKIT_DLLPUBLIC ApplyButton : public PushButton -{ - DECL_CONSTRUCTORS( ApplyButton, PushButton, 0 ); -}; -class TOOLKIT_DLLPUBLIC HelpButton : public PushButton -{ - DECL_CONSTRUCTORS( HelpButton, PushButton, 0 ); -}; -class TOOLKIT_DLLPUBLIC ImageButton : public PushButton -{ - DECL_CONSTRUCTORS( ImageButton, PushButton, 0 ); -}; - -class AdvancedButtonImpl; -class TOOLKIT_DLLPUBLIC AdvancedButton : public PushButton -{ - DECL_CONSTRUCTORS( AdvancedButton, PushButton, 0 ); - DECL_GET_IMPL( AdvancedButton ); - - void AddAdvanced( Window* w ); - void AddSimple( Window* w ); - void RemoveAdvanced( Window* w ); - void RemoveSimple( Window* w ); - - void SetAdvancedText (rtl::OUString const& text); - void SetSimpleText (rtl::OUString const& text); - rtl::OUString GetAdvancedText () const; - rtl::OUString GetSimpleText () const; - void SetDelta (int); -}; - -class MoreButtonImpl; -class TOOLKIT_DLLPUBLIC MoreButton : public AdvancedButton -{ - DECL_CONSTRUCTORS( MoreButton, AdvancedButton, 0 ); - DECL_GET_IMPL( MoreButton ); - void AddWindow( Window* w ); - void RemoveWindow( Window* w ); - - void SetMoreText (rtl::OUString const& text); - void SetLessText (rtl::OUString const& text); - rtl::OUString GetMoreText () const; - rtl::OUString GetLessText () const; -}; - -class RadioButtonImpl; -class TOOLKIT_DLLPUBLIC RadioButton : public Button -{ - DECL_GET_IMPL( RadioButton ); - DECL_CONSTRUCTORS( RadioButton, Button, 0 ); - DECL_GET_WINDOW( RadioButton ); - DECL_GET_VCLXWINDOW( RadioButton ); public: - ~RadioButton (); - void Check( bool bCheck=true ); - bool IsChecked() const; - - void Toggle(); - void SetToggleHdl( Link const& rLink ); + IgnoreButton( Context *context, char const* id, sal_uInt32 nId = 0 ); }; - -class CheckBoxImpl; -class TOOLKIT_DLLPUBLIC CheckBox : public Button +class TOOLKIT_DLLPUBLIC HelpButton : public PushButton { - DECL_GET_IMPL( CheckBox ); - DECL_CONSTRUCTORS( CheckBox, Button, 0 ); - public: - ~CheckBox (); - void Check( bool bCheck=true ); - bool IsChecked() const; - - void Toggle(); - void SetToggleHdl( Link const& rLink ); + HelpButton( Context *context, char const* id, sal_uInt32 nId = 0 ); }; class EditImpl; @@ -396,24 +289,7 @@ class TOOLKIT_DLLPUBLIC Edit : public Control public: ~Edit (); - void SetText( rtl::OUString const& rStr ); - String GetText() const; void SetModifyHdl( Link const& rLink ); - void SetSelection( Selection const& rSelection ); -}; - -class MultiLineEditImpl; -class TOOLKIT_DLLPUBLIC MultiLineEdit : public Edit -{ - DECL_GET_IMPL( MultiLineEdit ); - DECL_CONSTRUCTORS( MultiLineEdit, Edit, WB_LEFT|WB_BORDER ); -}; - -class SpinFieldImpl; -class TOOLKIT_DLLPUBLIC SpinField : public Edit -{ - DECL_GET_IMPL( SpinField ); - DECL_CONSTRUCTORS( SpinField, Edit, 0 ); }; class FormatterBaseImpl; @@ -430,24 +306,6 @@ class TOOLKIT_DLLPUBLIC NumericFormatter : public FormatterBase protected: explicit NumericFormatter( FormatterBaseImpl *pImpl ); NumericFormatterImpl &getFormatImpl() const; -public: - void SetMin( sal_Int64 nNewMin ); - void SetMax( sal_Int64 nNewMax ); - void SetFirst( sal_Int64 nNewFirst ); - void SetLast( sal_Int64 nNewLast ); - void SetSpinSize( sal_Int64 nNewSize ); - - void SetValue( sal_Int64 nNewValue ); - sal_Int64 GetValue() const; -}; - -class NumericFieldImpl; -class TOOLKIT_DLLPUBLIC NumericField : public SpinField, public NumericFormatter -{ - DECL_GET_IMPL( NumericField ); -public: - NumericField( Context *context, char const* id, sal_uInt32 nId=0 ); - NumericField( Window *parent, WinBits nStyle ); }; class MetricFormatterImpl; @@ -457,47 +315,6 @@ class TOOLKIT_DLLPUBLIC MetricFormatter : public FormatterBase protected: explicit MetricFormatter( FormatterBaseImpl *pImpl ); MetricFormatterImpl &getFormatImpl() const; -public: - void SetMin( sal_Int64 nNewMin, FieldUnit nUnit=FUNIT_NONE ); - void SetMax( sal_Int64 nNewMax, FieldUnit nUnit=FUNIT_NONE ); - void SetFirst( sal_Int64 nNewFirst, FieldUnit nUnit=FUNIT_NONE ); - void SetLast( sal_Int64 nNewLast, FieldUnit nUnit=FUNIT_NONE ); - void SetValue( sal_Int64 nNewValue, FieldUnit nUnit=FUNIT_NONE ); - sal_Int64 GetValue( FieldUnit nUnit=FUNIT_NONE ) const; - - void SetSpinSize( sal_Int64 nNewSize ); -}; - -class MetricFieldImpl; -class TOOLKIT_DLLPUBLIC MetricField : public SpinField, public MetricFormatter -{ - DECL_GET_IMPL( MetricField ); -public: - MetricField( Context *context, char const* id, sal_uInt32 nId=0 ); - MetricField( Window *parent, WinBits nStyle ); -}; - -class ComboBoxImpl; -class TOOLKIT_DLLPUBLIC ComboBox : public Edit -{ - DECL_GET_IMPL( ComboBox ); - DECL_GET_WINDOW (ComboBox ); - DECL_CONSTRUCTORS( ComboBox, Edit, 0 ); - -public: - ~ComboBox (); - sal_uInt16 InsertEntry( String const& rStr, sal_uInt16 nPos=COMBOBOX_APPEND ); - void RemoveEntry( String const& rStr ); - void RemoveEntry( sal_uInt16 nPos ); - void Clear(); - - sal_uInt16 GetEntryPos( String const& rStr ) const; - String GetEntry( sal_uInt16 nPos ) const; - sal_uInt16 GetEntryCount() const; - - void SetClickHdl( Link const& rLink ); - void SetSelectHdl( Link const& rLink ); - void EnableAutocomplete (bool enable, bool matchCase=false ); }; class ListBoxImpl; @@ -509,46 +326,17 @@ class TOOLKIT_DLLPUBLIC ListBox : public Control public: ~ListBox (); - sal_uInt16 InsertEntry( String const& rStr, sal_uInt16 nPos=LISTBOX_APPEND ); - - void RemoveEntry( String const& rStr ); - void RemoveEntry( sal_uInt16 nPos ); - void Clear(); sal_uInt16 GetEntryPos( String const& rStr ) const; String GetEntry( sal_uInt16 nPos ) const; - sal_uInt16 GetEntryCount() const; - void SelectEntry( String const& rStr, bool bSelect=true ); void SelectEntryPos( sal_uInt16 nPos, bool bSelect=true ); - sal_uInt16 GetSelectEntryCount() const; - String GetSelectEntry( sal_uInt16 nSelIndex=0 ) const; sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex=0 ) const; - void SetSelectHdl (Link const& link); - Link& GetSelectHdl (); - - void SetClickHdl (Link const& link); - Link& GetClickHdl (); - - void SetDoubleClickHdl (Link const& link); - Link& GetDoubleClickHdl (); - - void SetEntryData (sal_uInt16 pos, void* data); - void* GetEntryData (sal_uInt16 pos) const; - virtual void SetNoSelection (); }; -class MultiListBoxImpl; -class TOOLKIT_DLLPUBLIC MultiListBox : public ListBox -{ - DECL_GET_IMPL( MultiListBox ); - DECL_CONSTRUCTORS( MultiListBox, ListBox, 0 ); - DECL_GET_WINDOW( MultiListBox ); -}; - class DialogImpl; class TOOLKIT_DLLPUBLIC Dialog : public Context, public Window { @@ -556,19 +344,14 @@ class TOOLKIT_DLLPUBLIC Dialog : public Context, public Window public: DECL_GET_IMPL (Dialog); - Dialog( Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 ); Dialog( ::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 ); ~Dialog (); virtual short Execute(); void EndDialog( long nResult=0 ); - void SetText( rtl::OUString const& rStr ); void SetTitle (rtl::OUString const& rStr ); - bool Close (); - long Notify (NotifyEvent & event); // Sxf*Dialog bool bConstruct; - void Initialize (SfxChildWinInfo*); }; #define DECL_MESSAGE_BOX_CTORS(Name)\ @@ -624,8 +407,6 @@ protected: typedef MessageBox MessBox; CLASS_MESSAGE_BOX (Error); CLASS_MESSAGE_BOX (Info); -CLASS_MESSAGE_BOX (Query); -CLASS_MESSAGE_BOX (Warning); #undef CLASS_MESSAGE_BOX @@ -639,27 +420,13 @@ class TOOLKIT_DLLPUBLIC TabControl : public Control //#endif /* !TAB_APPEND */ DECL_GET_IMPL (TabControl); - DECL_CONSTRUCTORS (TabControl, Control, 0); DECL_GET_WINDOW (TabControl); - DECL_GET_LAYOUT_VCLXWINDOW (TabControl); public: ~TabControl (); - void InsertPage (sal_uInt16 id, rtl::OUString const& title, sal_uInt16 pos=TAB_APPEND); - void RemovePage (sal_uInt16 id); - sal_uInt16 GetPageCount () const; - sal_uInt16 GetPageId (sal_uInt16 pos) const; - sal_uInt16 GetPagePos (sal_uInt16 id) const; void SetCurPageId (sal_uInt16 id); - sal_uInt16 GetCurPageId () const; - void SetTabPage (sal_uInt16 id, ::TabPage* page); - ::TabPage* GetTabPage (sal_uInt16 id) const; void SetActivatePageHdl (Link const& link); - Link& GetActivatePageHdl () const; void SetDeactivatePageHdl (Link const& link); - Link& GetDeactivatePageHdl () const; - void SetTabPageSizePixel (Size const& size); - Size GetTabPageSizePixel () const; }; class TabPageImpl; @@ -670,27 +437,12 @@ public: static ::Window* global_parent; static TabControl* global_tabcontrol; - TabPage( Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 ); - TabPage( ::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 ); ~TabPage(); DECL_GET_WINDOW( TabPage ); virtual void ActivatePage(); virtual void DeactivatePage(); }; -class ProgressBarImpl; -class TOOLKIT_DLLPUBLIC ProgressBar : public Control -{ - DECL_GET_IMPL( ProgressBar ); - DECL_CONSTRUCTORS( ProgressBar, Control, WB_BORDER ); -public: - void SetForegroundColor( css::util::Color color ); - void SetBackgroundColor( css::util::Color color ); - void SetValue( sal_Int32 i ); - void SetRange( sal_Int32 min, sal_Int32 max ); - sal_Int32 GetValue(); -}; - // ----------------------------------------------------------------- // layout container / helper wrappers // ----------------------------------------------------------------- @@ -703,18 +455,10 @@ protected: public: Container( Context const* context, char const* id ); - void Add( Window *pWindow ); - void Add( Container *pContainer ); - - void Remove( Window *pWindow ); - void Remove( Container *pContainer ); - void Clear(); // we can't really do a GetChildren() as they don't have a common class, // besides we would need to keep track of children, uh void ShowAll( bool bVisible ); - void Show(); - void Hide(); css::uno::Reference< css::awt::XLayoutContainer > getImpl() { return mxContainer; } @@ -722,16 +466,6 @@ public: class TOOLKIT_DLLPUBLIC Table : public Container { -protected: - Table( sal_Int32 nBorder, sal_Int32 nColumns ); -public: - Table( Context const* context, char const* id ); - void Add( Window *pWindow, bool bXExpand, bool bYExpand, - sal_Int32 nXSpan=1, sal_Int32 nYSpan=1 ); - void Add( Container *pContainer, bool bXExpand, bool bYExpand, - sal_Int32 nXSpan=1, sal_Int32 nYSpan=1 ); - -private: void setProps( css::uno::Reference< css::awt::XLayoutConstrains > xChild, bool bXExpand, bool bYExpand, sal_Int32 nXSpan, sal_Int32 nYSpan ); }; @@ -742,64 +476,18 @@ protected: Box( rtl::OUString const& rName, sal_Int32 nBorder, bool bHomogeneous ); public: Box( Context const* context, char const* id ); - void Add( Window *pWindow, bool bExpand, bool bFill, sal_Int32 nPadding); - void Add( Container *pContainer, bool bExpand, bool bFill, sal_Int32 nPadding); private: void setProps( css::uno::Reference< css::awt::XLayoutConstrains > xChild, bool bXExpand, bool bYExpand, sal_Int32 nPadding ); }; -class TOOLKIT_DLLPUBLIC HBox : public Box -{ -public: - HBox( Context const* context, char const* id ); - HBox( sal_Int32 nBorder, bool bHomogeneous ); -}; -class TOOLKIT_DLLPUBLIC VBox : public Box -{ -public: - VBox( Context const* context, char const* id ); - VBox( sal_Int32 nBorder, bool bHomogeneous ); -}; - -class PluginImpl; -class TOOLKIT_DLLPUBLIC Plugin : public Control -{ - DECL_GET_IMPL( Plugin ); -public: - ::Control *mpPlugin; - Plugin( Context *context, char const* id, ::Control *plugin ); -}; - -class LocalizedStringImpl; -class TOOLKIT_DLLPUBLIC LocalizedString : public Window -{ - DECL_GET_IMPL( LocalizedString ); - -public: - LocalizedString( Context *context, char const* id ); - - rtl::OUString operator= (rtl::OUString const&); - rtl::OUString operator+= (sal_Unicode ); - rtl::OUString operator+= (rtl::OUString const&); - - operator rtl::OUString (); - operator rtl::OUString const& (); - operator String(); - String getString (); - rtl::OUString getOUString (); - String GetToken (sal_uInt16 i, sal_Char c); -}; - class InPlugImpl; class TOOLKIT_DLLPUBLIC InPlug : public Context, public Window { DECL_GET_IMPL (InPlug); public: - InPlug ( Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0); - InPlug ( ::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0); void ParentSet (Window *window); }; diff --git a/toolkit/source/layout/vcl/wbutton.cxx b/toolkit/source/layout/vcl/wbutton.cxx index 5c72b1707f3d..f3272dcc1c85 100644 --- a/toolkit/source/layout/vcl/wbutton.cxx +++ b/toolkit/source/layout/vcl/wbutton.cxx @@ -31,8 +31,6 @@ #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/awt/XActionListener.hpp> #include <com/sun/star/awt/XButton.hpp> -#include <com/sun/star/awt/XCheckBox.hpp> -#include <com/sun/star/awt/XRadioButton.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <cppuhelper/implbase1.hxx> #include <toolkit/awt/vclxwindow.hxx> @@ -69,16 +67,6 @@ class ImageImpl } }; -Image::Image( const char *pName ) - : pImpl( new ImageImpl( pName ) ) -{ -} - -Image::~Image() -{ - delete pImpl; -} - class ButtonImpl : public ControlImpl , public ::cppu::WeakImplHelper1< awt::XActionListener > { @@ -150,38 +138,11 @@ void Button::SetText( OUString const& rStr ) getImpl().mxButton->setLabel( rStr ); } -void Button::SetClickHdl( const Link& link ) -{ - if (&getImpl () && getImpl().mxButton.is ()) - getImpl().SetClickHdl( link ); -} - -Link& Button::GetClickHdl () -{ - return getImpl().GetClickHdl (); -} - -bool Button::SetModeImage (Image const& image) -{ - return getImpl().SetModeImage (image.getImpl().mxGraphic); -} - -bool Button::SetModeImage (::Image const& image) -{ - return GetButton ()->SetModeImage (image); -} - -void Button::SetImageAlign( ImageAlign eAlign ) -{ - getImpl().setProperty( "ImageAlign", uno::Any( (sal_Int16) eAlign ) ); -} - void Button::Click() { } IMPL_GET_IMPL( Button ); -IMPL_CONSTRUCTORS( Button, Control, "button" ); IMPL_GET_WINDOW (Button); class PushButtonImpl : public ButtonImpl @@ -239,16 +200,6 @@ void PushButton::Check( bool bCheck ) getImpl().fireToggle(); } -bool PushButton::IsChecked() const -{ - return !!( getImpl().getProperty( "State" ).get< sal_Int16 >() ); -} - -void PushButton::Toggle() -{ - Check( true ); -} - void PushButton::SetToggleHdl( const Link& link ) { if (&getImpl () && getImpl().mxButton.is ()) @@ -256,173 +207,8 @@ void PushButton::SetToggleHdl( const Link& link ) } IMPL_GET_IMPL( PushButton ); -IMPL_CONSTRUCTORS( PushButton, Button, "pushbutton" ); IMPL_GET_WINDOW (PushButton); -class RadioButtonImpl : public ButtonImpl - , public ::cppu::WeakImplHelper1< awt::XItemListener > -{ - Link maToggleHdl; -public: - uno::Reference< awt::XRadioButton > mxRadioButton; - RadioButtonImpl( Context *context, const PeerHandle &peer, Window *window ) - : ButtonImpl( context, peer, window ) - , mxRadioButton( peer, uno::UNO_QUERY ) - { - } - - void Check( bool bCheck ) - { - if ( !mxRadioButton.is() ) - return; - - // Have setState fire item event for - // RadioGroups::RadioGroup::itemStateChanged () - ::RadioButton *r = static_cast<RadioButton*>(mpWindow)->GetRadioButton (); - bool state = r->IsRadioCheckEnabled (); - r->EnableRadioCheck(); - mxRadioButton->setState( !!bCheck ); - r->EnableRadioCheck (state); - fireToggle(); - } - - bool IsChecked() - { - if ( !mxRadioButton.is() ) - return false; - return mxRadioButton->getState(); - } - - void SetToggleHdl( const Link& link ) - { - if (!link && !!maToggleHdl) - mxRadioButton->removeItemListener( this ); - else if (!!link && !maToggleHdl) - mxRadioButton->addItemListener( this ); - maToggleHdl = link; - } - - inline void fireToggle() - { - maToggleHdl.Call( static_cast<Window *>( mpWindow ) ); - } - - virtual void SetClickHdl( const Link& link ) - { - // Keep RadioGroups::RadioGroup's actionListener at HEAD - // of list. This way, it can handle RadioGroup's button - // states before all other callbacks and make sure the - // client code has the right state. - - // IWBN to add an XRadioButton2 and layout::VCLXRadioButton - // with {get,set}RadioGroup() (and a "radiogroup" property - // even) and handle the grouping here in RadioButtonImpl. - uno::Reference< uno::XInterface > x = static_cast<VCLXRadioButton*> (mpWindow->GetVCLXWindow ())->getFirstActionListener (); - uno::Reference< awt::XActionListener > a = uno::Reference< awt::XActionListener> (x ,uno::UNO_QUERY ); - mxButton->removeActionListener (a); - ButtonImpl::SetClickHdl (link); - mxButton->addActionListener (a); - } - - void SAL_CALL disposing( lang::EventObject const& e ) - throw (uno::RuntimeException) - { - ButtonImpl::disposing (e); - } - - virtual void SAL_CALL itemStateChanged( const awt::ItemEvent& ) - throw (uno::RuntimeException) - { - maToggleHdl.Call( static_cast<Window *>( mpWindow ) ); - } -}; - -RadioButton::~RadioButton () -{ - SetToggleHdl (Link ()); -} - -void RadioButton::Check( bool bCheck ) -{ - getImpl().Check( bCheck ); -} - -bool RadioButton::IsChecked() const -{ - return getImpl().IsChecked(); -} - -void RadioButton::SetToggleHdl( const Link& link ) -{ - if (&getImpl () && getImpl().mxRadioButton.is ()) - getImpl().SetToggleHdl( link ); -} - -IMPL_GET_IMPL( RadioButton ); -IMPL_GET_WINDOW( RadioButton ); -IMPL_GET_VCLXWINDOW( RadioButton ); -IMPL_CONSTRUCTORS( RadioButton, Button, "radiobutton" ); - -class CheckBoxImpl : public ButtonImpl - , public ::cppu::WeakImplHelper1< awt::XItemListener > -{ - Link maToggleHdl; - public: - uno::Reference< awt::XCheckBox > mxCheckBox; - CheckBoxImpl( Context *context, const PeerHandle &peer, Window *window ) - : ButtonImpl( context, peer, window ) - , mxCheckBox( peer, uno::UNO_QUERY ) - { - } - - void SetToggleHdl( const Link& link ) - { - if (!link && !!maToggleHdl) - mxCheckBox->removeItemListener( this ); - else if (!!link && !maToggleHdl) - mxCheckBox->addItemListener( this ); - maToggleHdl = link; - } - void SAL_CALL disposing( lang::EventObject const& e ) - throw (uno::RuntimeException) - { - ButtonImpl::disposing (e); - } - virtual void SAL_CALL itemStateChanged( const awt::ItemEvent& ) - throw (uno::RuntimeException) - { - maToggleHdl.Call( static_cast<Window *>( mpWindow ) ); - } -}; - -CheckBox::~CheckBox () -{ - SetToggleHdl (Link ()); -} - -void CheckBox::Check( bool bCheck ) -{ - if ( !getImpl().mxCheckBox.is() ) - return; - getImpl().mxCheckBox->setState( !!bCheck ); -} - -bool CheckBox::IsChecked() const -{ - if ( !getImpl().mxCheckBox.is() ) - return false; - return getImpl().mxCheckBox->getState() != 0; -} - -void CheckBox::SetToggleHdl( const Link& link ) -{ - if (&getImpl () && getImpl().mxCheckBox.is ()) - getImpl().SetToggleHdl( link ); -} - -IMPL_GET_IMPL( CheckBox ); -IMPL_CONSTRUCTORS( CheckBox, Button, "checkbox" ); - #define BUTTON_IMPL(t, parent, response) \ class t##Impl : public parent##Impl \ { \ @@ -447,232 +233,59 @@ IMPL_CONSTRUCTORS( CheckBox, Button, "checkbox" ); #define BUTTONID_RESET RET_RESET #define BUTTONID_APPLY RET_APPLY -BUTTON_IMPL( OKButton, PushButton, BUTTONID_OK ); BUTTON_IMPL( CancelButton, PushButton, BUTTONID_CANCEL ); BUTTON_IMPL( YesButton, PushButton, BUTTONID_YES ); BUTTON_IMPL( NoButton, PushButton, BUTTONID_NO ); BUTTON_IMPL( RetryButton, PushButton, BUTTONID_RETRY ); BUTTON_IMPL( IgnoreButton, PushButton, BUTTONID_IGNORE ); -BUTTON_IMPL( ResetButton, PushButton, BUTTONID_RESET ); -BUTTON_IMPL( ApplyButton, PushButton, BUTTONID_APPLY ); /* Deprecated? */ BUTTON_IMPL( HelpButton, PushButton, BUTTONID_HELP ); -IMPL_CONSTRUCTORS( OKButton, PushButton, "okbutton" ); -IMPL_CONSTRUCTORS( CancelButton, PushButton, "cancelbutton" ); -IMPL_CONSTRUCTORS( YesButton, PushButton, "yesbutton" ); -IMPL_CONSTRUCTORS( NoButton, PushButton, "nobutton" ); -IMPL_CONSTRUCTORS( RetryButton, PushButton, "retrybutton" ); -IMPL_CONSTRUCTORS( IgnoreButton, PushButton, "ignorebutton" ); -IMPL_CONSTRUCTORS( ResetButton, PushButton, "resetbutton" ); -IMPL_CONSTRUCTORS( ApplyButton, PushButton, "applybutton" ); /* Deprecated? */ -IMPL_CONSTRUCTORS( HelpButton, PushButton, "helpbutton" ); - -IMPL_IMPL (ImageButton, PushButton) - - -IMPL_CONSTRUCTORS( ImageButton, PushButton, "imagebutton" ); - -class AdvancedButtonImpl : public PushButtonImpl -{ -protected: - bool bAdvancedMode; - std::list< Window*> maAdvanced; - std::list< Window*> maSimple; - -public: - rtl::OUString mAdvancedLabel; - rtl::OUString mSimpleLabel; - -protected: - Window* Remove( std::list< Window*> lst, Window* w ) - { - for ( std::list< Window*>::iterator it = maAdvanced.begin(); - it != maAdvanced.end(); ++it ) - if ( *it == w ) - { - it = lst.erase( it ); - return *it; - } - return 0; - } - -public: - AdvancedButtonImpl( Context *context, PeerHandle const& peer, Window *window ) - : PushButtonImpl( context, peer, window ) - , bAdvancedMode( false ) - // TODO: i18n - // Button::GetStandardText( BUTTON_ADVANCED ); - // Button::GetStandardText( BUTTON_SIMPLE ); - , mAdvancedLabel( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Advanced...")) ) - , mSimpleLabel( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Simple...")) ) - { - } - void Click() - { - bAdvancedMode = !bAdvancedMode; - if ( bAdvancedMode ) - advancedMode(); - else - simpleMode(); - } - void setAlign () - { - ::PushButton *b = static_cast<PushButton*> (mpWindow)->GetPushButton (); - b->SetSymbolAlign (SYMBOLALIGN_RIGHT); - b->SetSmallSymbol (); - //mpWindow->SetStyle (mpWindow->GetStyle() | WB_CENTER); - } - void advancedMode() - { - ::PushButton *b = static_cast<PushButton*> (mpWindow)->GetPushButton (); - b->SetSymbol (SYMBOL_PAGEUP); - setAlign (); - if (mSimpleLabel.getLength ()) - b->SetText (mSimpleLabel); - for ( std::list< Window*>::iterator it = maAdvanced.begin(); - it != maAdvanced.end(); ++it ) - ( *it )->Show(); - for ( std::list< Window*>::iterator it = maSimple.begin(); - it != maSimple.end(); ++it ) - ( *it )->Hide(); - - redraw (); - } - void simpleMode() - { - //mxButton->setLabel( mSimpleLabel ); - ::PushButton *b = static_cast<PushButton*> (mpWindow)->GetPushButton (); - b->SetSymbol (SYMBOL_PAGEDOWN); - if (mAdvancedLabel.getLength ()) - b->SetText (mAdvancedLabel); - setAlign (); - for ( std::list< Window*>::iterator it = maAdvanced.begin(); - it != maAdvanced.end(); ++it ) - ( *it )->Hide(); - for ( std::list< Window*>::iterator it = maSimple.begin(); - it != maSimple.end(); ++it ) - ( *it )->Show(); - - redraw (true); - } - void AddAdvanced( Window* w ) - { - maAdvanced.push_back( w ); - if ( !bAdvancedMode ) - w->Hide(); - } - void AddSimple( Window* w ) - { - maSimple.push_back( w ); - if ( bAdvancedMode ) - w->Hide(); - } - void RemoveAdvanced( Window* w ) - { - Remove( maAdvanced, w ); - } - void RemoveSimple( Window* w ) - { - Remove( maSimple, w ); - } -}; - -void AdvancedButton::AddAdvanced( Window* w ) -{ - getImpl().AddAdvanced( w ); -} - -void AdvancedButton::AddSimple( Window* w ) -{ - getImpl().AddSimple( w ); -} - -void AdvancedButton::RemoveAdvanced( Window* w ) -{ - getImpl().RemoveAdvanced( w ); -} - -void AdvancedButton::RemoveSimple( Window* w ) -{ - getImpl().RemoveSimple( w ); -} - -void AdvancedButton::SetAdvancedText (rtl::OUString const& text) -{ - if (text.getLength ()) - getImpl ().mAdvancedLabel = text; -} - -void AdvancedButton::SetSimpleText (rtl::OUString const& text) -{ - if (text.getLength ()) - getImpl ().mSimpleLabel = text; -} - -rtl::OUString AdvancedButton::GetAdvancedText () const -{ - return getImpl ().mAdvancedLabel; -} - -rtl::OUString AdvancedButton::GetSimpleText () const -{ - return getImpl ().mSimpleLabel; -} - -void AdvancedButton::SetDelta (int) -{ -} - -IMPL_CONSTRUCTORS_BODY( AdvancedButton, PushButton, "advancedbutton", getImpl().simpleMode () ); -IMPL_GET_IMPL( AdvancedButton ); - - -class MoreButtonImpl : public AdvancedButtonImpl -{ -public: - MoreButtonImpl( Context *context, PeerHandle const& peer, Window *window ) - : AdvancedButtonImpl( context, peer, window) - { - mSimpleLabel = Button::GetStandardText( BUTTON_MORE ); - mAdvancedLabel = Button::GetStandardText( BUTTON_LESS ); - } - void AddWindow( Window* w ) { AddAdvanced( w ); } - void RemoveWindow( Window* w ) { RemoveAdvanced( w ); } -}; - -// TODO -//BUTTON_IMPL( MoreButton, PushButton, 0 ); -IMPL_CONSTRUCTORS_BODY( MoreButton, AdvancedButton, "morebutton", getImpl().simpleMode () ); -IMPL_GET_IMPL( MoreButton ); - -void MoreButton::AddWindow( Window* w ) +CancelButton::CancelButton ( Context *context, char const* pId, sal_uInt32 nId ) + : PushButton( new CancelButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) ) { - getImpl().AddWindow( w ); + Window *parent = dynamic_cast<Window*> (context); + if (parent) + SetParent (parent); } -void MoreButton::RemoveWindow( Window* w ) +YesButton::YesButton ( Context *context, char const* pId, sal_uInt32 nId ) + : PushButton( new YesButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) ) { - getImpl().RemoveWindow( w ); + Window *parent = dynamic_cast<Window*> (context); + if (parent) + SetParent (parent); } -void MoreButton::SetMoreText (rtl::OUString const& text) +NoButton::NoButton ( Context *context, char const* pId, sal_uInt32 nId ) + : PushButton( new NoButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) ) { - SetAdvancedText (text); + Window *parent = dynamic_cast<Window*> (context); + if (parent) + SetParent (parent); } -void MoreButton::SetLessText (rtl::OUString const& text) +RetryButton::RetryButton ( Context *context, char const* pId, sal_uInt32 nId ) + : PushButton( new RetryButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) ) { - SetSimpleText (text); + Window *parent = dynamic_cast<Window*> (context); + if (parent) + SetParent (parent); } -rtl::OUString MoreButton::GetMoreText () const +IgnoreButton::IgnoreButton ( Context *context, char const* pId, sal_uInt32 nId ) + : PushButton( new IgnoreButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) ) { - return GetAdvancedText (); + Window *parent = dynamic_cast<Window*> (context); + if (parent) + SetParent (parent); } -rtl::OUString MoreButton::GetLessText () const +HelpButton::HelpButton ( Context *context, char const* pId, sal_uInt32 nId ) + : PushButton( new HelpButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) ) { - return GetSimpleText (); + Window *parent = dynamic_cast<Window*> (context); + if (parent) + SetParent (parent); } } // namespace layout diff --git a/toolkit/source/layout/vcl/wcontainer.cxx b/toolkit/source/layout/vcl/wcontainer.cxx index 699a1af14761..868915b33f47 100644 --- a/toolkit/source/layout/vcl/wcontainer.cxx +++ b/toolkit/source/layout/vcl/wcontainer.cxx @@ -57,50 +57,6 @@ Container::Container( rtl::OUString const& rName, sal_Int32 nBorder ) uno::Any( nBorder ) ); } -void Container::Add( Window *pChild ) -{ - if ( pChild ) - { - uno::Reference< awt::XLayoutConstrains > xChild( pChild->GetPeer(), uno::UNO_QUERY ); - mxContainer->addChild( xChild ); - } -} - -void Container::Add( Container *pChild ) -{ - if ( pChild ) - { - uno::Reference< awt::XLayoutConstrains > xChild( pChild->getImpl(), uno::UNO_QUERY ); - mxContainer->addChild( xChild ); - } -} - -void Container::Remove( Window *pChild ) -{ - if ( pChild ) - { - uno::Reference< awt::XLayoutConstrains > xChild( pChild->GetPeer(), uno::UNO_QUERY ); - mxContainer->removeChild( xChild ); - } -} - -void Container::Remove( Container *pChild ) -{ - if ( pChild ) - { - uno::Reference< awt::XLayoutConstrains > xChild( pChild->getImpl(), uno::UNO_QUERY ); - mxContainer->removeChild( xChild ); - } -} - -void Container::Clear() -{ - css::uno::Sequence< css::uno::Reference < css::awt::XLayoutConstrains > > children; - children = mxContainer->getChildren(); - for (int i = 0; i < children.getLength(); i++) - mxContainer->removeChild( children[i] ); -} - void Container::ShowAll( bool bShow ) { struct inner @@ -131,47 +87,6 @@ void Container::ShowAll( bool bShow ) inner::setChildrenVisible( mxContainer, bShow ); } -void Container::Show() -{ - ShowAll( true ); -} - -void Container::Hide() -{ - ShowAll( false ); -} - -Table::Table( sal_Int32 nBorder, sal_Int32 nColumns ) - : Container( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "table" ) ), nBorder ) -{ - uno::Reference< beans::XPropertySet > xProps( mxContainer, uno::UNO_QUERY_THROW ); - xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Columns" ) ), - uno::Any( nColumns ) ); -} - -void Table::Add( Window *window, bool bXExpand, bool bYExpand, - sal_Int32 nXSpan, sal_Int32 nYSpan ) -{ - if ( !window ) - return; - WindowImpl &rImpl = window->getImpl(); - uno::Reference< awt::XLayoutConstrains > xChild( rImpl.mxWindow, - uno::UNO_QUERY ); - mxContainer->addChild( xChild ); - setProps( xChild, bXExpand, bYExpand, nXSpan, nYSpan ); -} - -void Table::Add( Container *pContainer, bool bXExpand, bool bYExpand, - sal_Int32 nXSpan, sal_Int32 nYSpan ) -{ - if ( !pContainer ) - return; - uno::Reference< awt::XLayoutConstrains > xChild( pContainer->getImpl(), - uno::UNO_QUERY ); - mxContainer->addChild( xChild ); - setProps( xChild, bXExpand, bYExpand, nXSpan, nYSpan ); -} - void Table::setProps( uno::Reference< awt::XLayoutConstrains > xChild, bool bXExpand, bool bYExpand, sal_Int32 nXSpan, sal_Int32 nYSpan ) { @@ -195,29 +110,6 @@ Box::Box( rtl::OUString const& rName, sal_Int32 nBorder, bool bHomogeneous ) uno::Any( bHomogeneous ) ); } -void Box::Add( Window *window, bool bExpand, bool bFill, sal_Int32 nPadding) -{ - if ( !window ) - return; - WindowImpl &rImpl = window->getImpl(); - uno::Reference< awt::XLayoutConstrains > xChild( rImpl.mxWindow, - uno::UNO_QUERY ); - - mxContainer->addChild( xChild ); - setProps( xChild, bExpand, bFill, nPadding ); -} - -void Box::Add( Container *pContainer, bool bExpand, bool bFill, sal_Int32 nPadding) -{ - if ( !pContainer ) - return; - - uno::Reference< awt::XLayoutConstrains > xChild( pContainer->getImpl(), - uno::UNO_QUERY ); - mxContainer->addChild( xChild ); - setProps( xChild, bExpand, bFill, nPadding ); -} - void Box::setProps( uno::Reference< awt::XLayoutConstrains > xChild, bool bExpand, bool bFill, sal_Int32 nPadding ) { @@ -232,38 +124,11 @@ void Box::setProps( uno::Reference< awt::XLayoutConstrains > xChild, uno::Any( nPadding ) ); } -Table::Table( Context const* context, char const* pId ) - : Container( context, pId ) -{ -} - Box::Box( Context const* context, char const* pId ) : Container( context, pId ) { } -HBox::HBox( sal_Int32 nBorder, bool bHomogeneous ) - : Box( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hbox" ) ), - nBorder, bHomogeneous ) -{ -} - -HBox::HBox( Context const* context, char const* pId ) - : Box( context, pId ) -{ -} - -VBox::VBox( sal_Int32 nBorder, bool bHomogeneous ) - : Box( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vbox" ) ), - nBorder, bHomogeneous ) -{ -} - -VBox::VBox( Context const* context, char const* pId ) - : Box( context, pId ) -{ -} - } // namespace layout /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/layout/vcl/wfield.cxx b/toolkit/source/layout/vcl/wfield.cxx index ce8b59f6023f..04b0757ca999 100644 --- a/toolkit/source/layout/vcl/wfield.cxx +++ b/toolkit/source/layout/vcl/wfield.cxx @@ -33,7 +33,6 @@ #include <com/sun/star/awt/XNumericField.hpp> #include <com/sun/star/awt/XTextComponent.hpp> #include <com/sun/star/awt/XListBox.hpp> -#include <com/sun/star/awt/XComboBox.hpp> #include <cppuhelper/implbase1.hxx> #include <com/sun/star/awt/XActionListener.hpp> #include <com/sun/star/awt/XItemListener.hpp> @@ -103,89 +102,15 @@ Edit::~Edit () SetModifyHdl (Link ()); } -void Edit::SetSelection( Selection const& rSelection ) -{ -#if LAYOUT_API_CALLS_HANDLER - if ( !getImpl().mxEdit.is() ) - getImpl().mxEdit->setSelection( awt::Selection( rSelection.Min(), rSelection.Max() ) ); -#else /* !LAYOUT_API_CALLS_HANDLER */ - GetEdit ()->SetSelection (rSelection); -#endif /* !LAYOUT_API_CALLS_HANDLER */ -} - -void Edit::SetText( OUString const& rStr ) -{ -#if LAYOUT_API_CALLS_HANDLER - if ( getImpl().mxEdit.is() ) - /// this calls handlers; endless loop in numfmt.cxx - getImpl().mxEdit->setText( rStr ); -#else /* !LAYOUT_API_CALLS_HANDLER */ - GetEdit ()->SetText (rStr); -#endif /* !LAYOUT_API_CALLS_HANDLER */ -} - -String Edit::GetText() const -{ - if ( !getImpl().mxEdit.is() ) - return getImpl().mxEdit->getText(); - return OUString(); -} - void Edit::SetModifyHdl( const Link& link ) { if (&getImpl () && getImpl().mxEdit.is ()) getImpl().SetModifyHdl( link ); } -IMPL_CONSTRUCTORS( Edit, Control, "edit" ); IMPL_GET_IMPL( Edit ); IMPL_GET_WINDOW (Edit); -class MultiLineEditImpl : public EditImpl -{ -public: - MultiLineEditImpl( Context *context, const PeerHandle &peer, Window *window ) - : EditImpl( context, peer, window ) - { - } -}; - -IMPL_CONSTRUCTORS( MultiLineEdit, Edit, "multilineedit" ); -IMPL_GET_IMPL( MultiLineEdit ); - -class SpinFieldImpl : public EditImpl -{ - public: - SpinFieldImpl( Context *context, const PeerHandle &peer, Window *window ) - : EditImpl( context, peer, window ) - { - } -}; - -IMPL_CONSTRUCTORS( SpinField, Edit, "spinfield" ); - -class NumericFieldImpl : public SpinFieldImpl -{ - public: - NumericFieldImpl( Context *context, const PeerHandle &peer, Window *window ) - : SpinFieldImpl( context, peer, window ) - { - } -}; - -class MetricFieldImpl : public SpinFieldImpl -{ - public: - MetricFieldImpl( Context *context, const PeerHandle &peer, Window *window ) - : SpinFieldImpl( context, peer, window ) - { - } -}; - -IMPL_GET_IMPL( SpinField ); -IMPL_GET_IMPL( NumericField ); -IMPL_GET_IMPL( MetricField ); - class FormatterBaseImpl { protected: @@ -252,32 +177,6 @@ NumericFormatterImpl& NumericFormatter::getFormatImpl() const return *( static_cast<NumericFormatterImpl *>( mpFormatImpl ) ); } -#define SET_IMPL(vclmethod, idlmethod) \ - void NumericFormatter::vclmethod( sal_Int64 nValue ) \ - { \ - if ( !getFormatImpl().mxField.is() ) \ - return; \ - getFormatImpl().mxField->idlmethod( getFormatImpl().valueToDouble( nValue ) ); \ - } - -SET_IMPL( SetMin, setMin ) -SET_IMPL( SetMax, setMax ) -SET_IMPL( SetLast, setLast ) -SET_IMPL( SetFirst, setFirst ) -SET_IMPL( SetValue, setValue ) -SET_IMPL( SetSpinSize, setSpinSize ) - -sal_Int64 NumericFormatter::GetValue() const -{ - if ( !getFormatImpl().mxField.is() ) - return 0; - return getFormatImpl().doubleToValue( getFormatImpl().mxField->getValue() ); -} - -#undef SET_IMPL - -IMPL_CONSTRUCTORS_2( NumericField, SpinField, NumericFormatter, "numericfield" ); - MetricFormatter::MetricFormatter( FormatterBaseImpl *pImpl ) : FormatterBase( pImpl ) { @@ -285,225 +184,6 @@ MetricFormatter::MetricFormatter( FormatterBaseImpl *pImpl ) MetricFormatterImpl& MetricFormatter::getFormatImpl() const { return *( static_cast<MetricFormatterImpl *>( mpFormatImpl ) ); } -#define MetricUnitVclToUno(a) ((sal_uInt16)(a)) - -#define SET_IMPL(vclmethod, idlmethod) \ - void MetricFormatter::vclmethod( sal_Int64 nValue, FieldUnit nUnit ) \ - { \ - if ( !getFormatImpl().mxField.is() ) \ - return; \ - getFormatImpl().mxField->idlmethod( nValue, MetricUnitVclToUno( nUnit ) ); \ - } - -SET_IMPL( SetMin, setMin ) -SET_IMPL( SetMax, setMax ) -SET_IMPL( SetLast, setLast ) -SET_IMPL( SetFirst, setFirst ) -SET_IMPL( SetValue, setValue ) - -#undef SET_IMPL - -void MetricFormatter::SetSpinSize( sal_Int64 nValue ) -{ - if ( !getFormatImpl().mxField.is() ) - return; - getFormatImpl().mxField->setSpinSize( nValue ); -} - -sal_Int64 MetricFormatter::GetValue( FieldUnit nUnit ) const -{ - if ( !getFormatImpl().mxField.is() ) - return 0; - return getFormatImpl().mxField->getValue( MetricUnitVclToUno( nUnit ) ); -} - -IMPL_CONSTRUCTORS_2( MetricField, SpinField, MetricFormatter, "metricfield" ); - -class ComboBoxImpl : public EditImpl - , public ::cppu::WeakImplHelper1< awt::XActionListener > - , public ::cppu::WeakImplHelper1< awt::XItemListener > -{ -public: - uno::Reference< awt::XComboBox > mxComboBox; - - Link maClickHdl; - Link maSelectHdl; - - Window *parent; - - ComboBoxImpl( Context *context, const PeerHandle &peer, Window *window ) - : EditImpl( context, peer, window ) - , mxComboBox( peer, uno::UNO_QUERY ) - { - } - - ~ComboBoxImpl (); - - sal_uInt16 InsertEntry( OUString const& rStr, sal_uInt16 nPos ) - { - if ( nPos == COMBOBOX_APPEND ) - nPos = GetEntryCount(); - mxComboBox->addItem( rtl::OUString( rStr ), nPos ); - return nPos; - } - - void RemoveEntry( sal_uInt16 nPos ) - { - mxComboBox->removeItems( nPos, 1 ); - } - - sal_uInt16 GetEntryPos( String const& rStr ) const - { - uno::Sequence< rtl::OUString> aItems( mxComboBox->getItems() ); - rtl::OUString rKey( rStr ); - sal_uInt16 n = sal::static_int_cast< sal_uInt16 >(aItems.getLength()); - for (sal_uInt16 i = 0; i < n; i++) - { - if ( aItems[ i ] == rKey ) - return i; - } - return COMBOBOX_ENTRY_NOTFOUND; - } - - OUString GetEntry( sal_uInt16 nPos ) const - { - return OUString( mxComboBox->getItem( nPos ) ); - } - - sal_uInt16 GetEntryCount() const - { - return mxComboBox->getItemCount(); - } - - void SetClickHdl( Link const& link ) - { - if (!link && !!maClickHdl) - mxComboBox->removeActionListener( this ); - else if (!!link && !maClickHdl) - mxComboBox->addActionListener( this ); - maClickHdl = link; - } - - void SetSelectHdl( Link const& link ) - { - if (!link && !!maSelectHdl) - mxComboBox->removeItemListener( this ); - else if (!!link && !maSelectHdl) - mxComboBox->addItemListener( this ); - maSelectHdl = link; - } - - void SAL_CALL disposing( lang::EventObject const& e ) - throw (uno::RuntimeException); - - void SAL_CALL actionPerformed (const awt::ActionEvent&) - throw (uno::RuntimeException) - { - ComboBox* pComboBox = static_cast<ComboBox*>( mpWindow ); - if ( !pComboBox ) - return; - maClickHdl.Call( pComboBox ); - } - - void SAL_CALL itemStateChanged( awt::ItemEvent const&) - throw (uno::RuntimeException) - { - ComboBox* pComboBox = static_cast<ComboBox*>( mpWindow ); - if ( !pComboBox ) - return; - maSelectHdl.Call( pComboBox ); - } -}; - -ComboBox::~ComboBox () -{ -#ifndef __SUNPRO_CC - OSL_TRACE ("%s: deleting ComboBox for window: %p", __FUNCTION__, GetWindow ()); -#endif -} - -ComboBoxImpl::~ComboBoxImpl () -{ -#ifndef __SUNPRO_CC - OSL_TRACE ("%s: deleting ComboBoxImpl for window: %p", __FUNCTION__, mpWindow ? mpWindow->GetWindow () : 0); - OSL_TRACE ("%s: deleting ComboBoxImpl for listener: %p", __FUNCTION__, static_cast<XFocusListener*> (this)); -#endif -} - -void ComboBoxImpl::disposing( lang::EventObject const& e ) - throw (uno::RuntimeException) -{ - EditImpl::disposing (e); - mxComboBox.clear (); -} - -sal_uInt16 ComboBox::InsertEntry( String const& rStr, sal_uInt16 nPos ) -{ - return getImpl().InsertEntry( rStr, nPos ); -} - -void ComboBox::RemoveEntry( String const& rStr ) -{ - getImpl().RemoveEntry( GetEntryPos( rStr ) ); -} - -void ComboBox::RemoveEntry( sal_uInt16 nPos ) -{ - getImpl().RemoveEntry( nPos ); -} - -void ComboBox::Clear() -{ - uno::Sequence< rtl::OUString> aNoItems; - getImpl().setProperty( "StringItemList", uno::Any( aNoItems ) ); -} - -sal_uInt16 ComboBox::GetEntryPos( String const& rStr ) const -{ - return getImpl().GetEntryPos( rStr ); -} - -String ComboBox::GetEntry( sal_uInt16 nPos ) const -{ - rtl::OUString rItem = getImpl().mxComboBox->getItem( nPos ); - return OUString( rItem ); -} - -sal_uInt16 ComboBox::GetEntryCount() const -{ - return getImpl().GetEntryCount(); -} - -void ComboBox::SetClickHdl( const Link& link ) -{ - if (&getImpl () && getImpl().mxComboBox.is ()) - getImpl().SetClickHdl( link ); -} - -void ComboBox::SetSelectHdl( const Link& link ) -{ - if (&getImpl () && getImpl().mxComboBox.is ()) - getImpl().SetSelectHdl( link ); -} - -void ComboBox::EnableAutocomplete (bool enable, bool matchCase) -{ - GetComboBox ()->EnableAutocomplete (enable, matchCase); -} - -IMPL_CONSTRUCTORS_BODY( ComboBox, Edit, "combobox", getImpl().parent = parent; ); -IMPL_GET_WINDOW (ComboBox); -/// IMPL_GET_IMPL( ComboBox ); - -static ComboBoxImpl* null_combobox_impl = 0; - -ComboBoxImpl &ComboBox::getImpl () const -{ - if (ComboBoxImpl* c = static_cast<ComboBoxImpl *>(mpImpl)) - return *c; - return *null_combobox_impl; -} - class ListBoxImpl : public ControlImpl , public ::cppu::WeakImplHelper1< awt::XActionListener > , public ::cppu::WeakImplHelper1< awt::XItemListener > @@ -671,27 +351,6 @@ ListBox::~ListBox () { } -sal_uInt16 ListBox::InsertEntry (String const& rStr, sal_uInt16 nPos) -{ - return getImpl().InsertEntry(rStr, nPos); -} - -void ListBox::RemoveEntry( sal_uInt16 nPos ) -{ - return getImpl().RemoveEntry( nPos ); -} - -void ListBox::RemoveEntry( String const& rStr ) -{ - return getImpl().RemoveEntry( GetEntryPos( rStr ) ); -} - -void ListBox::Clear() -{ - uno::Sequence< rtl::OUString> aNoItems; - getImpl().setProperty( "StringItemList", uno::Any( aNoItems ) ); -} - sal_uInt16 ListBox::GetEntryPos( String const& rStr ) const { return getImpl().GetEntryPos( rStr ); @@ -702,11 +361,6 @@ String ListBox::GetEntry( sal_uInt16 nPos ) const return getImpl().GetEntry( nPos ); } -sal_uInt16 ListBox::GetEntryCount() const -{ - return getImpl().GetEntryCount(); -} - void ListBox::SelectEntryPos( sal_uInt16 nPos, bool bSelect ) { #if LAYOUT_API_CALLS_HANDLER @@ -716,80 +370,19 @@ void ListBox::SelectEntryPos( sal_uInt16 nPos, bool bSelect ) #endif /* !LAYOUT_API_CALLS_HANDLER */ } -void ListBox::SelectEntry( String const& rStr, bool bSelect ) -{ - SelectEntryPos( GetEntryPos( rStr ), bSelect ); -} - -sal_uInt16 ListBox::GetSelectEntryCount() const -{ - return getImpl().GetSelectEntryCount(); -} - sal_uInt16 ListBox::GetSelectEntryPos( sal_uInt16 nSelIndex ) const { return getImpl().GetSelectEntryPos( nSelIndex ); } -String ListBox::GetSelectEntry( sal_uInt16 nSelIndex ) const -{ - return GetEntry( GetSelectEntryPos( nSelIndex ) ); -} - -Link& ListBox::GetSelectHdl () -{ - return getImpl ().GetSelectHdl (); -} - -void ListBox::SetSelectHdl( Link const& link ) -{ - getImpl().SetSelectHdl( link ); -} - -Link& ListBox::GetClickHdl () -{ - return getImpl ().GetSelectHdl (); -} - -void ListBox::SetClickHdl( Link const& link ) -{ - if (&getImpl () && getImpl().mxListBox.is ()) - getImpl().SetClickHdl( link ); -} - -Link& ListBox::GetDoubleClickHdl () -{ - return getImpl ().GetSelectHdl (); -} - -void ListBox::SetDoubleClickHdl( Link const& link ) -{ - getImpl().SetDoubleClickHdl( link ); -} - -void ListBox::SetEntryData( sal_uInt16 pos, void* data) -{ - GetListBox ()->SetEntryData (pos, data); -} - -void* ListBox::GetEntryData( sal_uInt16 pos) const -{ - return GetListBox ()->GetEntryData (pos); -} - void ListBox::SetNoSelection () { GetListBox ()->SetNoSelection (); } -IMPL_CONSTRUCTORS (ListBox, Control, "listbox"); IMPL_GET_IMPL (ListBox); IMPL_GET_WINDOW (ListBox); -IMPL_IMPL (MultiListBox, ListBox) -IMPL_CONSTRUCTORS_BODY( MultiListBox, ListBox, "multilistbox", GetMultiListBox()->EnableMultiSelection( true ); ); -IMPL_GET_IMPL( MultiListBox ); -IMPL_GET_WINDOW( MultiListBox ); } // namespace layout /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/source/layout/vcl/wrapper.cxx b/toolkit/source/layout/vcl/wrapper.cxx index 9713e04b3e40..b175ea2be0b9 100644 --- a/toolkit/source/layout/vcl/wrapper.cxx +++ b/toolkit/source/layout/vcl/wrapper.cxx @@ -115,10 +115,6 @@ public: { mxTopLevel = xToplevel; } - PeerHandle getRoot() - { - return mxRoot; - } }; Context::Context( const char *pPath ) @@ -131,20 +127,6 @@ Context::~Context() pImpl = NULL; } -void Context::setToplevel( PeerHandle xToplevel ) -{ - pImpl->setTopLevel( xToplevel ); -} - -PeerHandle Context::getToplevel() -{ - return pImpl->getTopLevel(); -} -PeerHandle Context::getRoot() -{ - return pImpl->getRoot(); -} - PeerHandle Context::GetPeerHandle( const char *id, sal_uInt32 nId ) const { PeerHandle xHandle; @@ -558,22 +540,12 @@ void SAL_CALL ControlImpl::focusLost (awt::FocusEvent const&) mLoseFocusHdl.Call (mpWindow); } -Link& Control::GetGetFocusHdl () -{ - return getImpl ().GetGetFocusHdl (); -} - void Control::SetGetFocusHdl (Link const& link) { if (&getImpl () && getImpl().mxWindow.is ()) getImpl ().SetGetFocusHdl (link); } -Link& Control::GetLoseFocusHdl () -{ - return getImpl ().GetLoseFocusHdl (); -} - void Control::SetLoseFocusHdl (Link const& link) { if (&getImpl () && getImpl().mxWindow.is ()) @@ -593,15 +565,6 @@ DialogImpl::DialogImpl( Context *context, const PeerHandle &peer, Window *window { } -Dialog::Dialog( Window *parent, const char *xml_file, const char *id, sal_uInt32 nId ) - : Context( xml_file ) - , Window( new DialogImpl( this, Context::GetPeerHandle( id, nId ), this ) ) - , bConstruct (true) -{ - if ( parent ) - SetParent( parent ); -} - Dialog::Dialog( ::Window *parent, const char *xml_file, const char *id, sal_uInt32 nId ) : Context( xml_file ) , Window( new DialogImpl( this, Context::GetPeerHandle( id, nId ), this ) ) @@ -631,31 +594,11 @@ void Dialog::EndDialog( long result ) MX_DIALOG->endDialog (result); } -void Dialog::SetText( OUString const& str ) -{ - SetTitle (str); -} - void Dialog::SetTitle( OUString const& str ) { MX_DIALOG->setTitle (str); } -bool Dialog::Close () -{ - EndDialog (false); - return true; -} - -long Dialog::Notify (NotifyEvent& event) -{ - return GetDialog ()->Notify (event); -} - -void Dialog::Initialize (SfxChildWinInfo*) -{ -} - #define MESSAGE_BOX_MEMBER_INIT\ Dialog (parent, xml_file, id)\ , imageError (this, "FI_ERROR")\ @@ -809,8 +752,6 @@ void MessageBox::init (OUString const& message, OUString const& yes, OUString co MESSAGE_BOX_IMPL (Error); MESSAGE_BOX_IMPL (Info); -MESSAGE_BOX_IMPL (Query); -MESSAGE_BOX_IMPL (Warning); class TabControlImpl : public ControlImpl @@ -834,11 +775,6 @@ public: mxTabControl.clear (); } - Link& GetActivatePageHdl () - { - return mActivatePageHdl; - } - void SetActivatePageHdl (Link const& link) { if (!mDeactivatePageHdl || !link) @@ -846,11 +782,6 @@ public: mActivatePageHdl = link; } - Link& GetDeactivatePageHdl () - { - return mDeactivatePageHdl; - } - void SetDeactivatePageHdl (Link const& link) { if (!mActivatePageHdl || !link) @@ -895,7 +826,6 @@ public: }; IMPL_GET_WINDOW (TabControl); -IMPL_GET_LAYOUT_VCLXWINDOW (TabControl); #define MX_TABCONTROL if (getImpl ().mxTabControl.is ()) getImpl ().mxTabControl #define RETURN_MX_TABCONTROL if (getImpl ().mxTabControl.is ()) return getImpl ().mxTabControl @@ -906,92 +836,22 @@ TabControl::~TabControl () SetDeactivatePageHdl (Link ()); } -void TabControl::InsertPage (sal_uInt16 id, OUString const& title, sal_uInt16 pos) -{ - (void) pos; - - MX_TABCONTROL->insertTab (); - SetCurPageId (id); - -#if 1 // colour me loc productive -- NOT -#define ADD_PROP( seq, i, name, val )\ - { \ - beans::NamedValue value; \ - value.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( name ) ); \ - value.Value = uno::makeAny( val ); \ - seq[i] = value; \ - } - - uno::Sequence< beans::NamedValue > seq (1); - ADD_PROP ( seq, 0, "Title", OUString (title) ); - MX_TABCONTROL->setTabProps (id, seq); -#else - GetTabPage (id)->SetText (title); -#endif -} -void TabControl::RemovePage (sal_uInt16 id) -{ - GetTabControl ()->RemovePage (id); -} -sal_uInt16 TabControl::GetPageCount () const -{ - return GetTabControl ()->GetPageCount (); -} -sal_uInt16 TabControl::GetPageId (sal_uInt16 pos) const -{ - return GetTabControl ()->GetPageId (pos); -} -sal_uInt16 TabControl::GetPagePos (sal_uInt16 id) const -{ - getImpl ().redraw (); - return GetTabControl ()->GetPagePos (id); -} void TabControl::SetCurPageId (sal_uInt16 id) { getImpl ().redraw (); GetTabControl ()->SetCurPageId (id); } -sal_uInt16 TabControl::GetCurPageId () const -{ - return GetTabControl ()->GetCurPageId (); -} -void TabControl::SetTabPage (sal_uInt16 id, ::TabPage* page) -{ - GetTabControl ()->SetTabPage (id, page); - getImpl ().redraw (); -} -::TabPage* TabControl::GetTabPage (sal_uInt16 id) const -{ - return GetTabControl ()->GetTabPage (id); -} void TabControl::SetActivatePageHdl (Link const& link) { if (&getImpl () && getImpl().mxTabControl.is ()) getImpl ().SetActivatePageHdl (link); } -Link& TabControl::GetActivatePageHdl () const -{ - return getImpl ().GetActivatePageHdl (); -} void TabControl::SetDeactivatePageHdl (Link const& link) { if (&getImpl () && getImpl().mxTabControl.is ()) getImpl ().SetDeactivatePageHdl (link); } -Link& TabControl::GetDeactivatePageHdl () const -{ - return getImpl ().GetDeactivatePageHdl (); -} -void TabControl::SetTabPageSizePixel (Size const& size) -{ - GetTabControl ()->SetTabPageSizePixel (size); -} -Size TabControl::GetTabPageSizePixel () const -{ - return GetTabControl ()->GetTabPageSizePixel (); -} -IMPL_CONSTRUCTORS (TabControl, Control, "tabcontrol"); IMPL_GET_IMPL (TabControl); class TabPageImpl : public WindowImpl @@ -1010,22 +870,6 @@ TabControl* TabPage::global_tabcontrol = 0; IMPL_GET_IMPL( TabPage ); -TabPage::TabPage( Window *parent, const char *xml_file, const char *id, sal_uInt32 nId) - : Context( xml_file ) - , Window( new TabPageImpl( this, Context::GetPeerHandle( id, nId ), this ) ) -{ - if ( parent ) - SetParent( parent ); -} - -TabPage::TabPage( ::Window *parent, const char *xml_file, const char *id, sal_uInt32 nId) - : Context( xml_file ) - , Window( new TabPageImpl( this, Context::GetPeerHandle( id, nId ), this ) ) -{ - if ( parent ) - SetParent( parent ); -} - TabPage::~TabPage() { delete GetTabPage(); @@ -1041,24 +885,6 @@ void TabPage::DeactivatePage() { } -class FixedLineImpl : public ControlImpl -{ -public: - FixedLineImpl( Context *context, const PeerHandle &peer, Window *window ) - : ControlImpl( context, peer, window ) - { - } -}; - -IMPL_CONSTRUCTORS( FixedLine, Control, "hfixedline" ); -IMPL_GET_IMPL( FixedLine ); - -bool FixedLine::IsEnabled() const -{ - //FIXME - return true; -} - class FixedTextImpl : public ControlImpl { public: @@ -1086,11 +912,18 @@ void SAL_CALL FixedTextImpl::disposing( lang::EventObject const& e ) mxFixedText.clear (); } +FixedText::FixedText ( Context *context, char const* pId, sal_uInt32 nId ) + : Control( new FixedTextImpl( context, context->GetPeerHandle( pId, nId ), this ) ) +{ + Window *parent = dynamic_cast<Window*> (context); + if (parent) + SetParent (parent); +} + FixedText::~FixedText () { } -IMPL_CONSTRUCTORS( FixedText, Control, "fixedtext" ); IMPL_GET_IMPL( FixedText ); void FixedText::SetText( OUString const& rStr ) @@ -1100,18 +933,6 @@ void FixedText::SetText( OUString const& rStr ) getImpl().mxFixedText->setText( rStr ); } -class FixedInfoImpl : public FixedTextImpl -{ -public: - FixedInfoImpl( Context *context, const PeerHandle &peer, Window *window ) - : FixedTextImpl( context, peer, window ) - { - } -}; - -IMPL_CONSTRUCTORS( FixedInfo, FixedText, "fixedinfo" ); -IMPL_GET_IMPL( FixedInfo ); - class ProgressBarImpl : public ControlImpl { public: @@ -1146,217 +967,15 @@ public: } }; -IMPL_CONSTRUCTORS( FixedImage, Control, "fixedimage" ); -IMPL_GET_IMPL( FixedImage ) - -void FixedImage::setImage( ::Image const& i ) -{ - (void) i; - if ( !getImpl().mxGraphic.is() ) - return; - //FIXME: hack moved to proplist - //getImpl().mxGraphic = -} - - -IMPL_CONSTRUCTORS( ProgressBar, Control, "ProgressBar" ); -IMPL_GET_IMPL( ProgressBar ); - -void ProgressBar::SetForegroundColor( util::Color color ) -{ - if ( !getImpl().mxProgressBar.is() ) - return; - getImpl().mxProgressBar->setForegroundColor( color ); -} - -void ProgressBar::SetBackgroundColor( util::Color color ) -{ - if ( !getImpl().mxProgressBar.is() ) - return; - getImpl().mxProgressBar->setBackgroundColor( color ); -} - -void ProgressBar::SetValue( sal_Int32 i ) -{ - if ( !getImpl().mxProgressBar.is() ) - return; - getImpl().mxProgressBar->setValue( i ); -} - -void ProgressBar::SetRange( sal_Int32 min, sal_Int32 max ) -{ - if ( !getImpl().mxProgressBar.is() ) - return; - getImpl().mxProgressBar->setRange( min, max ); -} - -sal_Int32 ProgressBar::GetValue() -{ - if ( !getImpl().mxProgressBar.is() ) - return 0; - return getImpl().mxProgressBar->getValue(); -} - -class PluginImpl: public ControlImpl -{ -public: - ::Control *mpPlugin; - - PluginImpl( Context *context, const PeerHandle &peer, Window *window, :: Control *plugin ) - : ControlImpl( context, peer, window ) - , mpPlugin( plugin ) - { - uno::Reference <awt::XWindow> ref( mxWindow, uno::UNO_QUERY ); - layoutimpl::VCLXPlugin *vcl - = static_cast<layoutimpl::VCLXPlugin*>( VCLXWindow::GetImplementation( ref ) ); - ::Window *parent = vcl->mpWindow->GetParent(); - vcl->SetWindow( plugin ); - vcl->SetPlugin( mpPlugin ); - plugin->SetParent( parent ); - plugin->SetStyle( vcl->mStyle ); - plugin->SetCreatedWithToolkit( true ); - plugin->SetComponentInterface( vcl ); - plugin->Show(); - } -}; - -Plugin::Plugin( Context *context, char const *id, ::Control *plugin ) - : Control( new PluginImpl( context, context->GetPeerHandle( id, 0 ), this, plugin ) ) - , mpPlugin( plugin ) -{ -} - -IMPL_GET_IMPL( Plugin ); - -class LocalizedStringImpl : public WindowImpl -{ -public: - layoutimpl::LocalizedString *mpString; - OUString maString; - LocalizedStringImpl( Context *context, const PeerHandle &peer, Window *window ) - : WindowImpl( context, peer, window ) - , mpString( static_cast<layoutimpl::LocalizedString*>( VCLXWindow::GetImplementation( uno::Reference <awt::XWindow> ( mxWindow, uno::UNO_QUERY ) ) ) ) - , maString () - { - } - OUString getText() - { - if (mpString) - maString = mpString->getText (); - return maString; - } - void setText( OUString const& s ) - { - if (mpString) - mpString->setText( s ); - } -}; - -IMPL_GET_IMPL( LocalizedString ); - -LocalizedString::LocalizedString( Context *context, char const* id ) - : Window( new LocalizedStringImpl( context, context->GetPeerHandle( id, 0 ), this ) ) -{ -} - -String LocalizedString::getString () -{ - return getImpl ().getText (); -} - -OUString LocalizedString::getOUString () -{ - return getImpl ().getText (); -} - -LocalizedString::operator OUString () -{ - return getOUString (); -} - -LocalizedString::operator OUString const& () -{ - getOUString (); - return getImpl ().maString; -} - -LocalizedString::operator String() -{ - getOUString (); - return getImpl ().maString; -} - -String LocalizedString::GetToken (sal_uInt16 i, sal_Char c) -{ - return getString ().GetToken (i, c); -} - -OUString LocalizedString::operator= (OUString const& s) -{ - getImpl().setText( s ); - return getImpl().getText(); -} - -OUString LocalizedString::operator+= (OUString const& b) -{ - OUString a = getImpl ().getText (); - a += b; - getImpl ().setText (a); - return getImpl ().getText (); -} - -OUString LocalizedString::operator+= (sal_Unicode const b) -{ - String a = getImpl ().getText (); - a += b; - getImpl ().setText (a); - return getImpl ().getText (); -} - -class InPlugImpl : public WindowImpl -{ -public: - InPlugImpl (Context *context, const PeerHandle &peer, Window *window) - : WindowImpl (context, peer, window) - { - } -}; - -IMPL_GET_IMPL (InPlug); - -static char const *FIXME_set_parent (::Window *parent, char const *xml_file) -{ - layout::TabPage::global_parent = parent; - return xml_file; -} - -InPlug::InPlug (Window *parent, char const* xml_file, char const* id, sal_uInt32 nId) - : Context (FIXME_set_parent (parent ? parent->GetWindow () : 0, xml_file)) - , layout::Window (new InPlugImpl (this, Context::GetPeerHandle (id, nId), this)) +FixedImage::FixedImage ( Context *context, char const* pId, sal_uInt32 nId ) + : Control( new FixedImageImpl( context, context->GetPeerHandle( pId, nId ), this ) ) { + Window *parent = dynamic_cast<Window*> (context); if (parent) SetParent (parent); - if (::Window *w = dynamic_cast< ::Window* > (this)) - w->SetComponentInterface (GetVCLXWindow ()); -} - -InPlug::InPlug (::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId) - : Context (FIXME_set_parent (parent, xml_file)) - , layout::Window (new InPlugImpl (this, Context::GetPeerHandle (id, nId), this)) -{ - if (parent) - layout::Window::SetParent (parent); - if (::Window *w = dynamic_cast< ::Window* > (this)) - w->SetComponentInterface (GetVCLXWindow ()); } -void InPlug::ParentSet (Window *window) -{ - window->SetParent (dynamic_cast< ::Window* > (this)); - - /// FIXME: for standalone run of layout::SfxTabDialog - SetParent (window->GetParent ()); -} +IMPL_GET_IMPL( FixedImage ) } // namespace layout diff --git a/toolkit/workben/controls.cxx b/toolkit/workben/controls.cxx deleted file mode 100644 index 93b68649db82..000000000000 --- a/toolkit/workben/controls.cxx +++ /dev/null @@ -1,272 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_toolkit.hxx" -#include <tools/debug.hxx> - -#include <vcl/window.hxx> -#include <vcl/svapp.hxx> -#include <vcl/wrkwin.hxx> -#include <vcl/msgbox.hxx> - - -#include <stardiv/uno/awt/window.hxx> -#include <stardiv/uno/awt/vclwin.hxx> -#include <stardiv/uno/awt/printer.hxx> -#include <stardiv/uno/repos/serinfo.hxx> -#include <stardiv/uno/lang/factory.hxx> - - -#include <unoctrl.hxx> - -#include <svtools/unoiface.hxx> // InitExtToolkit - -UsrAny UsrAny_UINT16( UINT16 n ) -{ - UsrAny aVal; - aVal.setUINT16( n ); - return aVal; -} - -// ----------------------------------------------------------------------- - -class MyApp : public Application -{ -public: - void Main(); -}; - -MyApp aMyApp; - -// ----------------------------------------------------------------------- - -class MyWin : public WorkWindow -{ - XControlRef xCtrl; - XPropertySetRef xCtrlModel; - XControlContainerRef xCont; - XPropertySetRef xContModel; - XControlRef xDrawCtrl; - XGraphicsRef xG; - -public: - MyWin( Window* pParent, WinBits nWinStyle ); - ~MyWin(); - - void MouseButtonDown( const MouseEvent& rMEvt ); - void Resize(); - void Paint( const Rectangle& r ); -}; - -// ----------------------------------------------------------------------- - -void MyApp::Main() -{ - createAndSetDefaultServiceManager(); - - MyWin aMainWin( NULL, WB_APP | WB_STDWORK ); - aMainWin.SetText( "Uno-Controls - Workbench" ); - aMainWin.Show(); - Execute(); -} - -// ----------------------------------------------------------------------- - -MyWin::MyWin( Window* pParent, WinBits nWinStyle ) : - WorkWindow( pParent, nWinStyle ) -{ -} - -// ----------------------------------------------------------------------- -MyWin::~MyWin() -{ - XComponentRef xC1( xCont, USR_QUERY ); - xC1->dispose(); - XComponentRef xC2( xContModel, USR_QUERY ); - xC2->dispose(); -} - -// ----------------------------------------------------------------------- - -void MyWin::MouseButtonDown( const MouseEvent& rMEvt ) -{ - if( rMEvt.GetClicks() == 2 ) - { - XViewRef xV( xDrawCtrl, USR_QUERY ); - XWindowRef xC( xDrawCtrl, USR_QUERY ); - xV->draw( xC->getPosSize().Left(), xC->getPosSize().Top() ); - } - else if( rMEvt.GetClicks() == 1 ) - { - if( xContModel ) - { - static INT32 nColor = 0x001788ab; - xContModel->setPropertyValue( L"BackgroundColor", UsrAny( nColor ) ); - nColor += 0x00111111; - nColor &= 0xFFFFFF; - } - else - { - XServiceManagerRef xProv = getGlobalServiceManager(); - - XMultiServiceFactoryRef xMSF = NAMESPACE_USR( getProcessServiceManager )(); - - XServiceProviderRef xSSI = xProv->queryServiceProvider( L"stardiv.vcl.VclToolkit" ); - XToolkitRef xToolkit( xMSF->createInstance( L"stardiv.vcl.VclToolkit" ), USR_QUERY ); - DBG_ASSERT( xToolkit, "No Toolkit!" ); - - // Uno Container + Model erzeugen - XServiceProviderRef xModelProv; // = xProv->queryServiceProvider( L"stardiv.vcl.controlmodel.ControlContainer" ); - XInterfaceRef xCMRef( xMSF->createInstance(L"stardiv.vcl.controlmodel.ControlContainer") ); - xCMRef->queryInterface( XPropertySet::getSmartUik(), xContModel ); - xContModel->setPropertyValue( L"Border", UsrAny_UINT16( 1 ) ); - xContModel->setPropertyValue( L"BackgroundColor", UsrAny( (UINT32)0x00CCCCCC) ); - - xModelProv = xProv->queryServiceProvider( L"stardiv.vcl.control.ControlContainer" ); - XInterfaceRef xCCRef( xModelProv->createInstance(), USR_QUERY ); - xCCRef->queryInterface( XControlContainer::getSmartUik(), xCont ); - - XControlModelRef xCM( xContModel, USR_QUERY ); - XControlRef xContControl( xCont, USR_QUERY ); - xContControl->setModel( xCM ); - XWindowRef xContComp( xCont, USR_QUERY ); - xContComp->setPosSize( 0, 0, 500, 600, PosSize_POSSIZE ); - - // Zwei EditControls auf einem Model... -// xModelProv = xProv->queryServiceProvider( L"stardiv.uno.awt.UnoControlEditModel" ); - XInterfaceRef xModel( xMSF->createInstance(L"stardiv.uno.awt.UnoControlEditModel") ); - DBG_ASSERT( xModel, "No Model!" ); - - XPropertySetRef xPSet( xModel, USR_QUERY ); - xPSet->setPropertyValue( L"Text", UsrAny( UString( L"Hallo!" ) ) ); - xPSet->setPropertyValue( L"FontName", UsrAny( UString( L"Times New Roman" ) ) ); -// xPSet->setPropertyValue( L"FontWeight", UsrAny( 200 ) ); - - XServiceProviderRef xEditCtrlProv = xProv->queryServiceProvider( L"stardiv.uno.awt.UnoControlEdit" ); - // Edit1 - XControlRef xEdit1( xMSF->createInstance(L"stardiv.uno.awt.UnoControlEdit"), USR_QUERY ); - xModel->queryInterface( XControlModel::getSmartUik(), xCM ); - xEdit1->setModel( xCM ); - XWindowRef xEditCmp1( xEdit1, USR_QUERY ); - xEditCmp1->setPosSize( 50, 50, 100, 60, PosSize_POSSIZE ); - xCont->addControl( L"", xEdit1 ); - // Edit2 - XControlRef xEdit2( xMSF->createInstance(L"stardiv.uno.awt.UnoControlEdit"), USR_QUERY ); - xModel->queryInterface( XControlModel::getSmartUik(), xCM ); - xEdit2->setModel( xCM ); - XWindowRef xEditCmp2( xEdit2, USR_QUERY ); - XLayoutConstrainsRef xL( xEdit2, USR_QUERY ); - if ( xL.is() ) - { - Size aSz = xL->getPreferredSize(); - xEditCmp2->setPosSize( 100, 180, aSz.Width(), aSz.Height(), PosSize_POSSIZE ); - } - else - xEditCmp2->setPosSize( 100, 180, 100, 40, PosSize_POSSIZE ); - xCont->addControl( L"", xEdit2 ); - - xModelProv = xProv->queryServiceProvider( L"stardiv.vcl.controlmodel.NumericField" ); - XInterfaceRef xNumModel( xModelProv->createInstance(), USR_QUERY ); - DBG_ASSERT( xNumModel, "No Model!" ); - - - XServiceProviderRef xNumFieldProv = xProv->queryServiceProvider( L"stardiv.vcl.control.NumericField" ); - XControlRef xNumField( xNumFieldProv->createInstance(), USR_QUERY ); - xNumModel->queryInterface( XControlModel::getSmartUik(), xCM ); - xNumField->setModel( xCM ); - XWindowRef xNumFieldWin( xNumField, USR_QUERY ); - xNumFieldWin->setPosSize( 50, 250, 100, 60, PosSize_POSSIZE ); - xCont->addControl( L"", xNumField ); - - XMultiPropertySetRef xPSet2( xNumModel, USR_QUERY ); - Sequence<UString> Names( 2 ); - Names.getArray()[0] = L"Value"; - Names.getArray()[1] = L"ValueMin"; - Sequence<UsrAny> Values( 2 ); - Values.getArray()[0] = UsrAny( -2000000.0 ); - Values.getArray()[1] = UsrAny( -2000000.0 ); - xPSet2->setPropertyValues( Names, Values ); - - - // Button... - xModelProv = xProv->queryServiceProvider( L"stardiv.vcl.controlmodel.Button" ); - xModelProv->createInstance()->queryInterface( XInterface::getSmartUik(), xModel ); - DBG_ASSERT( xModel, "No Model!" ); - - xModel->queryInterface( XPropertySet::getSmartUik(), xPSet ); - xPSet->setPropertyValue( L"Label", UsrAny( L"Press!" ) ); - - XServiceProviderRef xButtonCtrlProv = xProv->queryServiceProvider( L"stardiv.vcl.control.Button" ); - XControlRef xButton1( xButtonCtrlProv->createInstance(), USR_QUERY ); - xModel->queryInterface( XControlModel::getSmartUik(), xCM ); - xButton1->setModel( xCM ); - XWindowRef xButtonCmp1( xButton1, USR_QUERY ); - xButtonCmp1->setPosSize( 170, 80, 80, 80, PosSize_POSSIZE ); - // Unsichtbar, nur im MBDown mit DrawRoutine bei Doppel-Klick... - xButtonCmp1->setVisible( FALSE ); - xDrawCtrl = xButton1; - - xCont->addControl( L"", xButton1 ); - - // Container anzeigen... - // Als Child zu diesem Fenster - xContControl->createPeer( XToolkitRef(), GetComponentInterface( TRUE ) ); - - XDeviceRef xD( xContControl->getPeer(), USR_QUERY ); - xG = xD->createGraphics(); - XViewRef xV ( xDrawCtrl, USR_QUERY ); - xV->setGraphics( xG ); - - } - return; - } - WorkWindow::MouseButtonDown( rMEvt ); -} - - -// ----------------------------------------------------------------------- - -void MyWin::Resize() -{ - WorkWindow::Resize(); -} - -void MyWin::Paint( const Rectangle& r ) -{ - // Muss ueber PaintListener geschehen... - if ( xDrawCtrl.is() ) - { - XViewRef xV( xDrawCtrl, USR_QUERY ); - XWindowRef xC( xDrawCtrl, USR_QUERY ); - xV->draw( xC->getPosSize().Left(), xC->getPosSize().Top() ); - } - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/.gitignore b/toolkit/workben/layout/.gitignore deleted file mode 100644 index 142ba57c1444..000000000000 --- a/toolkit/workben/layout/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/de -/en-US -/nl -/ja
\ No newline at end of file diff --git a/toolkit/workben/layout/README b/toolkit/workben/layout/README deleted file mode 100644 index 3ab112e50ff2..000000000000 --- a/toolkit/workben/layout/README +++ /dev/null @@ -1,43 +0,0 @@ -Testing workbench and editor for Layout engine. - -* Configure using --enable-layout. - -* [d]make all - -* export OOO_INSTALL_PREFIX=$(pwd)/ooo-layout - -* [d]make install DESTDIR=$OOO_INSTALL_PREFIX - -* Compile test program in toolkit/workben/layout - - cd toolkit/workben/layout && dmake all - -* FIXME: New three layer install/rpath feature needs these workarounds -| -| test -d $OOO_INSTALL_PREFIX/openoffice.org3 && export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX/openoffice.org3 || export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX -| cp -f ../..$INPATH/lib/libtkx.so $OOO_PREFIX/openoffice.org/program -| export LD_LIBRARY_PATH=$OOO_PREFIX_BRAND/program:$OOO_PREFIX_BRAND/ure-link/lib -| -| (see source/layout/helper.cxx) - -* Run it on any .xml file - - ../../$INPATH/bin/test [--inst $OOO_INSTALL_PREFIX] zoom.xml - -* Run it for specific dialogs, see test.cxx - - ../../$INPATH/bin/test [--inst $OOO_INSTALL_PREFIX] --test zoom - ../../$INPATH/bin/test [--inst $OOO_INSTALL_PREFIX] --test wordcount - -* Or source refresh in workben/layout, do something like - - cd toolkit/workben/layout && . ./refresh [--inst $OOO_INSTALL_PREFIX] - -Integration into OOo: - -* After instaling, run - - cd ooo-cvs/program - ./soffice.bin - - Start a [Writer] document and choose View/Zoom or Extra/Word count. diff --git a/toolkit/workben/layout/TEST b/toolkit/workben/layout/TEST deleted file mode 100755 index e1376e1f2867..000000000000 --- a/toolkit/workben/layout/TEST +++ /dev/null @@ -1,11 +0,0 @@ -#! /bin/sh -for d in $(cd ../../../../.. && pwd)/ooo-svn /usr/lib/ooo3/; do - if test -d $d; then - export OOO_INSTALL_PREFIX=$d - break - fi -done -export SAL_ALLOW_LINKOO_SYMLINKS=1 -test -d $OOO_INSTALL_PREFIX/openoffice.org3 && export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX/openoffice.org3 || export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX -export LD_LIBRARY_PATH="$OOO_PREFIX_BRAND/program:$OOO_PREFIX_BRAND/ure-link/lib" -../../unx*.pro/bin/test "$@" diff --git a/toolkit/workben/layout/adjust.xml b/toolkit/workben/layout/adjust.xml deleted file mode 100644 index 186a94bf5e6a..000000000000 --- a/toolkit/workben/layout/adjust.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - id="window1" title="Text Editor" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox> - <!-- Ver Top --> - <hbox> - <align v-align="0" h-align="0" v-fill="0" h-fill="0"> - <pushbutton label="Top Left" /> - </align> - <align> - <pushbutton label="Top Middle" v-align="0" h-align="0.5" v-fill="0" h-fill="0" /> - </align> - <align> - <pushbutton label="Top Right" v-align="0" h-align="1" v-fill="0" h-fill="0" /> - </align> - </hbox> - <!-- Ver Middle --> - <hbox> - <align> - <pushbutton label="Middle Left" v-align="0.5" h-align="0" v-fill="0" h-fill="0" /> - </align> - <align> - <pushbutton label="Middle Middle" v-align="0.5" h-align="0.5" v-fill="0" h-fill="0" /> - </align> - <align> - <pushbutton label="Middle Right" v-align="0.5" h-align="1" v-fill="0" h-fill="0" /> - </align> - </hbox> - <!-- Ver Bottom --> - <hbox> - <align> - <pushbutton label="Bottom Left" v-align="1" h-align="0" v-fill="0" h-fill="0" /> - </align> - <align> - <pushbutton label="Bottom Middle" v-align="1" h-align="0.5" v-fill="0" h-fill="0" /> - </align> - <align> - <pushbutton label="Bottom Right" v-align="1" h-align="1" v-fill="0" h-fill="0" /> - </align> - </hbox> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/align-test.xml b/toolkit/workben/layout/align-test.xml deleted file mode 100644 index 60c34b4655a5..000000000000 --- a/toolkit/workben/layout/align-test.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated xml files are generated from this template by - transex3/layout/tralay. !--> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Align Test" optimumsize="true" has_border="true" sizeable="true" moveable="true"> - <vbox spacing="5" border="5"> - <fixedline/> - <hbox spacing="0" border="0"> - <vbox spacing="5" border="5"> - <fixedline _text="X" cnt:expand="false"/> - <pushbutton label="foo"/> - <pushbutton label="foo"/> - <pushbutton label="foo"/> - <pushbutton label="foo"/> - <pushbutton label="foo"/> - <pushbutton label="foo"/> - <pushbutton label="foo"/> - </vbox> - <vbox spacing="5" border="5"> - <fixedline _text="X" cnt:expand="false"/> - <pushbutton label="bar"/> - </vbox> - </hbox> - <fixedline/> - <min-size cnt:spacing="0" min-width="200"/> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/align.xml b/toolkit/workben/layout/align.xml deleted file mode 100644 index 85aee220fc78..000000000000 --- a/toolkit/workben/layout/align.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Align Test" optimumsize="true" has_border="true" sizeable="true" moveable="true"> - <vbox> - <!-- Ver Top --> - <hbox> - <align halign="0" valign="0"> - <pushbutton label="Top Left" /> - </align> - <align halign="0.5" valign="0"> - <pushbutton label="Top Middle" /> - </align> - <align halign="1" valign="0"> - <pushbutton label="Top Right" /> - </align> - </hbox> - <!-- Ver Middle --> - <hbox> - <align halign="0" valign="0.5"> - <pushbutton label="Middle Left" /> - </align> - <align halign="0.5" valign="0.5"> - <pushbutton label="Middle Middle" /> - </align> - <align halign="1" valign="0.5"> - <pushbutton label="Middle Right" /> - </align> - </hbox> - <!-- Ver Bottom --> - <hbox> - <align halign="0" valign="1"> - <pushbutton label="Bottom Left" /> - </align> - <align halign="0.5" valign="1"> - <pushbutton label="Bottom Middle" /> - </align> - <align halign="1" valign="1"> - <pushbutton label="Bottom Right" /> - </align> - </hbox> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/boxtest.xml b/toolkit/workben/layout/boxtest.xml deleted file mode 100644 index 24ead837c057..000000000000 --- a/toolkit/workben/layout/boxtest.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Box Test" optimumsize="true" has_border="true" sizeable="true" moveable="true"> - <vbox> - <table> - <vbox> - <hbox cnt:expand="false" cnt:fill="false"> - <pushbutton label="XML Left" - cnt:expand="false" cnt:fill="false"/> - <pushbutton label="XML Middle" - cnt:expand="true" cnt:fill="false"/> - <pushbutton label="XML Right" - cnt:expand="true" cnt:fill="true"/> - </hbox> - <hbox cnt:expand="true" cnt:fill="false"> - <pushbutton label="XML Left" - cnt:expand="false" cnt:fill="false"/> - <pushbutton label="XML Middle" - cnt:expand="true" cnt:fill="false"/> - <pushbutton label="XML Right" - cnt:expand="true" cnt:fill="true"/> - </hbox> - <hbox cnt:expand="true" cnt:fill="true"> - <pushbutton label="XML Left" - cnt:expand="false" cnt:fill="false"/> - <pushbutton label="XML Middle" - cnt:expand="true" cnt:fill="false"/> - <pushbutton label="XML Right" - cnt:expand="true" cnt:fill="true"/> - </hbox> - </vbox> - </table> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/dialogbuttons-ok.xml b/toolkit/workben/layout/dialogbuttons-ok.xml deleted file mode 100644 index 86c7a1b13818..000000000000 --- a/toolkit/workben/layout/dialogbuttons-ok.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Dialog Button Ordering" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox border="5" spacing="5"> - <fixedline text="Platform default"/> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - </dialogbuttonhbox> - <fixedline text="GNOME"/> - <dialogbuttonhbox border="5" spacing="5" ordering="gnome"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - </dialogbuttonhbox> - <fixedline text="KDE"/> - <dialogbuttonhbox border="5" spacing="5" ordering="kde"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - </dialogbuttonhbox> - <fixedline text="MacOS"/> - <dialogbuttonhbox border="5" spacing="5" ordering="macos"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - </dialogbuttonhbox> - <fixedline text="Windows"/> - <dialogbuttonhbox border="5" spacing="5" ordering="windows"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/dialogbuttons-reset.xml b/toolkit/workben/layout/dialogbuttons-reset.xml deleted file mode 100644 index 6c1c613fe96d..000000000000 --- a/toolkit/workben/layout/dialogbuttons-reset.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Dialog Button Ordering" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox border="5" spacing="5"> - <fixedline text="Platform default"/> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - <resetbutton/> - </dialogbuttonhbox> - <fixedline text="GNOME"/> - <dialogbuttonhbox border="5" spacing="5" ordering="gnome"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - <resetbutton/> - </dialogbuttonhbox> - <fixedline text="KDE"/> - <dialogbuttonhbox border="5" spacing="5" ordering="kde"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - <resetbutton/> - </dialogbuttonhbox> - <fixedline text="MacOS"/> - <dialogbuttonhbox border="5" spacing="5" ordering="macos"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - <resetbutton/> - </dialogbuttonhbox> - <fixedline text="Windows"/> - <dialogbuttonhbox border="5" spacing="5" ordering="windows"> - <flow/> - <okbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Alternate"/> - <resetbutton/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/dialogbuttons-save.xml b/toolkit/workben/layout/dialogbuttons-save.xml deleted file mode 100644 index 38bd90773d0e..000000000000 --- a/toolkit/workben/layout/dialogbuttons-save.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Dialog Button Ordering" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox border="5" spacing="5"> - <fixedline text="Platform default"/> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <yesbutton label="~Save"/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Don't save"/> - </dialogbuttonhbox> - <fixedline text="GNOME"/> - <dialogbuttonhbox border="5" spacing="5" ordering="gnome"> - <flow/> - <yesbutton label="~Save"/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Don't save"/> - </dialogbuttonhbox> - <fixedline text="KDE"/> - <dialogbuttonhbox border="5" spacing="5" ordering="kde"> - <flow/> - <yesbutton label="~Save"/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Don't save"/> - </dialogbuttonhbox> - <fixedline text="MacOS"/> - <dialogbuttonhbox border="5" spacing="5" ordering="macos"> - <flow/> - <yesbutton label="~Save"/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Don't save"/> - </dialogbuttonhbox> - <fixedline text="Windows"/> - <dialogbuttonhbox border="5" spacing="5" ordering="windows"> - <flow/> - <yesbutton label="~Save"/> - <cancelbutton/> - <helpbutton/> - <nobutton label="~Don't save"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/dialogbuttons-yes.xml b/toolkit/workben/layout/dialogbuttons-yes.xml deleted file mode 100644 index 78845598bffc..000000000000 --- a/toolkit/workben/layout/dialogbuttons-yes.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Dialog Button Ordering" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox border="5" spacing="5"> - <fixedline text="Platform default"/> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <yesbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton xlabel="~Alternate"/> - </dialogbuttonhbox> - <fixedline text="GNOME"/> - <dialogbuttonhbox border="5" spacing="5" ordering="gnome"> - <flow/> - <yesbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton xlabel="~Alternate"/> - </dialogbuttonhbox> - <fixedline text="KDE"/> - <dialogbuttonhbox border="5" spacing="5" ordering="kde"> - <flow/> - <yesbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton xlabel="~Alternate"/> - </dialogbuttonhbox> - <fixedline text="MacOS"/> - <dialogbuttonhbox border="5" spacing="5" ordering="macos"> - <flow/> - <yesbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton xlabel="~Alternate"/> - </dialogbuttonhbox> - <fixedline text="Windows"/> - <dialogbuttonhbox border="5" spacing="5" ordering="windows"> - <flow/> - <yesbutton/> - <cancelbutton/> - <helpbutton/> - <nobutton xlabel="~Alternate"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/editor-normal.xml b/toolkit/workben/layout/editor-normal.xml deleted file mode 100644 index 7f0dc0b69e74..000000000000 --- a/toolkit/workben/layout/editor-normal.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- Would be cool to have others Editor layouts (e.g. Glade-like with - a window for each function). --> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Layout Editor" sizeable="true" > - <vbox> - <hbox> - <min-size min-width="120" cnt:expand="false"> - <vbox> - <fixedtext label="Layout:" cnt:expand="false" /> - <hbox> - <listbox id="layout-tree" has_border="true" /> - <vbox cnt:expand="false"> - <pushbutton id="layout-up-button" cnt:expand="false" /> - <pushbutton id="layout-down-button" cnt:expand="false" /> - <fixedtext cnt:expand="true" /> - <pushbutton id="layout-remove-button" cnt:expand="false" /> - </vbox> - </hbox> - </vbox> - </min-size> - <min-size min-width="120"> - <vbox> - <fixedtext label="Preview:" cnt:expand="false" /> - <vbox border="50"> - <bin id="preview-box" /> - </vbox> - </vbox> - </min-size> - <min-size min-width="120" cnt:expand="false"> - <vbox> - <fixedtext label="Properties:" cnt:expand="false" /> - <table id="properties-box" columns="3" /> - </vbox> - </min-size> - </hbox> - <hfixedline cnt:expand="false" /> - <vbox cnt:expand="false"> - <fixedtext label="Create widgets:" cnt:expand="false" /> - <flow id="create-widget" homogeneous="true" spacing="2" /> - <fixedtext label="Create containers:" cnt:expand="false" /> - <flow id="create-container" homogeneous="true" spacing="2" /> - </vbox> - <hbox cnt:expand="false"> - <vbox><fixedline /><fixedline /><fixedline /><fixedline /></vbox> -<!-- <pushbutton id="import-button" label="Import..." cnt:expand="false"/>--> - <pushbutton id="export-button" label="Export (stdout)" cnt:expand="false"/> - </hbox> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/editor.cxx b/toolkit/workben/layout/editor.cxx deleted file mode 100644 index f46afb62dfe1..000000000000 --- a/toolkit/workben/layout/editor.cxx +++ /dev/null @@ -1,1856 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "editor.hxx" - -#undef NDEBUG - -/* -#include <stdio.h> -#include <string.h> -*/ - -#include <cassert> -#include <cstdio> -#include <cstring> -#include <list> -#include <vector> - -#include <com/sun/star/awt/WindowAttribute.hpp> -#include <com/sun/star/awt/XLayoutConstrains.hpp> -#include <com/sun/star/awt/XLayoutContainer.hpp> -#include <com/sun/star/awt/XToolkit.hpp> -#include <com/sun/star/awt/XVclWindowPeer.hpp> -#include <com/sun/star/awt/XWindow.hpp> -#include <com/sun/star/awt/XWindowPeer.hpp> -#include <rtl/strbuf.hxx> -#include <rtl/ustrbuf.hxx> -#include <toolkit/helper/property.hxx> -#include <vcl/lstbox.h> - -using namespace layout::css; - -using rtl::OUString; - -// FIXME: -//#define FILEDLG - -#include <layout/core/helper.hxx> -#include <layout/core/root.hxx> -#include <layout/core/helper.hxx> - -// TODO: automatically generated -struct WidgetSpec { - const char *pLabel, *pName, *pIconName; - bool bIsContainer; }; -static const WidgetSpec WIDGETS_SPECS[] = { - { "Label", "fixedtext" , "sc_label.png", false }, - { "Button", "pushbutton" , "sc_pushbutton.png", false }, - { "Radio Button", "radiobutton" , "sc_radiobutton.png", false }, - { "Check Box", "checkbox" , "sc_checkbox.png", false }, - { "Line Edit", "edit" , "sc_edit.png", false }, - { "Numeric Field", "numericfield", "sc_numericfield.png", false }, - { "List Box ", "listbox" , NULL, false }, - // containers - { "Hor Box", "hbox" , NULL, true }, - { "Ver Box", "vbox" , NULL, true }, - { "Table", "table" , NULL, true }, - { "Alignment", "align" , NULL, true }, - { "Tab Control", "tabcontrol" , NULL, true }, - { "Hor Splitter", "hsplitter" , NULL, true }, - { "Ver Splitter", "vsplitter" , NULL, true }, - { "Scroller", "scroller" , NULL, true }, -}; -const int WIDGETS_SPECS_LEN = sizeof (WIDGETS_SPECS) / sizeof (WidgetSpec); - -using namespace layout; -using namespace layoutimpl; -namespace css = ::com::sun::star; - -static rtl::OUString anyToString (uno::Any value) -{ - try - { - switch (value.getValueTypeClass()) { - case uno::TypeClass_STRING: - return value.get<rtl::OUString>(); - case uno::TypeClass_CONSTANT: - return rtl::OUString::valueOf (value.get<sal_Int32>()); - case uno::TypeClass_LONG: - return rtl::OUString::valueOf (value.get<sal_Int64>()); - case uno::TypeClass_SHORT: - // FIXME: seems broken - return rtl::OUString::valueOf ((sal_Int32) value.get<short>()); - - case uno::TypeClass_FLOAT: - return rtl::OUString::valueOf (value.get<float>()); - case uno::TypeClass_DOUBLE: - return rtl::OUString::valueOf (value.get<double>()); - - case uno::TypeClass_BOOLEAN: - { - bool val = value.get<sal_Bool>(); - return rtl::OUString( val ? "1" : "0", 1, RTL_TEXTENCODING_ASCII_US ); -/* if ( val ) - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ); - else - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) );*/ - } - default: - break; - } - } - catch(...) {} - return rtl::OUString(); -} - -static inline long anyToNatural (uno::Any value) -{ return sal::static_int_cast<long>(anyToString( value ).toInt64()); } -static inline double anyToDecimal (uno::Any value) -{ return anyToString( value ).toDouble(); } - -/* XLayoutContainer/XLayoutConstrains are a bit of a hasle to work with. - Let's wrap them. */ -class Widget : public layoutimpl::LayoutWidget -{ - friend class EditorRoot; - - Widget *mpParent; - std::vector< Widget *> maChildren; - bool mbForeign; - - rtl::OUString mrId; - rtl::OUString mrLabel, mrUnoName; - -// TODO: store original properties. And some property handling methods. - long mnOriAttrbs; - layoutimpl::PropList maOriProps, maOriChildProps; - -public: - - // to be used to wrap the root - Widget( uno::Reference< awt::XLayoutConstrains > xImport, const char *label ) - : mpParent( 0 ), mbForeign( true ) - { - mxWidget = xImport; - mxContainer = uno::Reference< awt::XLayoutContainer >( mxWidget, uno::UNO_QUERY ); - - mrLabel = rtl::OUString( label, strlen( label ), RTL_TEXTENCODING_UTF8 ); - } - - Widget( rtl::OUString id, uno::Reference< awt::XToolkit > xToolkit, - uno::Reference< awt::XLayoutContainer > xParent, - rtl::OUString unoName, long nAttrbs ) - : mpParent( 0 ), mbForeign( false ), mrId( id ), - mnOriAttrbs( nAttrbs ) - { - while ( xParent.is() && !uno::Reference< awt::XWindow >( xParent, uno::UNO_QUERY ).is() ) - { - uno::Reference< awt::XLayoutContainer > xContainer( xParent, uno::UNO_QUERY ); - OSL_ASSERT( xContainer.is() ); - xParent = uno::Reference< awt::XLayoutContainer >( xContainer->getParent(), uno::UNO_QUERY ); - } - - mxWidget = WidgetFactory::createWidget( xToolkit, xParent, unoName, nAttrbs ); - OSL_ASSERT( mxWidget.is() ); - mxContainer = uno::Reference< awt::XLayoutContainer >( mxWidget, uno::UNO_QUERY ); - - mrLabel = mrUnoName = unoName; - // try to get a nicer label for the widget - for ( int i = 0; i < WIDGETS_SPECS_LEN; i++ ) - if ( unoName.equalsAscii( WIDGETS_SPECS[ i ].pName ) ) - { - const char *label = WIDGETS_SPECS[ i ].pLabel; - mrLabel = rtl::OUString( label, strlen( label ), RTL_TEXTENCODING_UTF8 ); - break; - } - - // set default Text property - // TODO: disable editing of text fields, check boxes selected, etc... - - - // store original properties - { - PropertyIterator it( this, WINDOW_PROPERTY ); - while ( it.hasNext() ) - { - beans::Property prop = it.next(); - rtl::OUString name( prop.Name ); - rtl::OUString value( getProperty( name, WINDOW_PROPERTY ) ); -#if DEBUG_PRINT - fprintf(stderr, "original property: %s = %s\n", OUSTRING_CSTR(name), OUSTRING_CSTR(value)); -#endif - std::pair< rtl::OUString, rtl::OUString > pair( name, value ); - maOriProps.push_back( pair ); - } - } - - } - - ~Widget() - { - for ( std::vector< Widget *>::const_iterator it = maChildren.begin(); - it != maChildren.end(); ++it ) - delete *it; - if ( !mbForeign ) - { - uno::Reference< lang::XComponent > xComp( mxWidget, uno::UNO_QUERY ); - if ( xComp.is() ) - // some widgets, like our containers, don't implement this interface... - xComp->dispose(); - } - } - - uno::Reference< awt::XLayoutConstrains > impl() - { - return mxWidget; - } - - // LayoutWidget - virtual bool addChild( LayoutWidget *pChild ) - { - return addChild( static_cast< Widget * >( pChild ) ); - } - - virtual void setProperties( const PropList &rProps ) - { -// maOriProps = rProps; - LayoutWidget::setProperties( rProps ); - } - - virtual void setChildProperties( LayoutWidget *pChild, const PropList &rProps ) - { - maOriChildProps = rProps; - LayoutWidget::setChildProperties( pChild, rProps ); - } - - // tree travel - Widget *up() - { - return mpParent; - } - - Widget *down() - { - if ( maChildren.empty() ) - return NULL; - return maChildren.front(); - } - - Widget *next() - { - if ( mpParent ) - { - int pos = mpParent->getChildPos( this ); - return mpParent->getChild( pos+1 ); - } - return NULL; - } - - Widget *prev() - { - if ( mpParent ) - { - int pos = mpParent->getChildPos( this ); - return mpParent->getChild( pos-1 ); - } - return NULL; - } - - // handle - bool addChild( Widget *pChild, int pos = 0xffff ) - { - if ( !mxContainer.is() ) - return false; - - uno::Sequence< uno::Reference < awt::XLayoutConstrains > > aChildren; - aChildren = mxContainer->getChildren(); - int nChildrenLen = aChildren.getLength(); - - // ugly, but let's check if the container is next to full... - try { - mxContainer->addChild( pChild->mxWidget ); - } - catch( awt::MaxChildrenException& rEx) { - fprintf (stderr, "ERROR: MaxChildrenException: '%s'.\n", - rtl::OUStringToOString (rEx.Message, RTL_TEXTENCODING_UTF8).getStr()); - return false; - } - - if ( pos < nChildrenLen ) - { // if its on the middle, we need to make space for it - mxContainer->removeChild( pChild->mxWidget ); - for ( int i = pos; i < nChildrenLen; i++ ) - mxContainer->removeChild( aChildren[ i ] ); - mxContainer->addChild( pChild->mxWidget ); - for ( int i = pos; i < nChildrenLen; i++ ) - mxContainer->addChild( aChildren[ i ] ); - maChildren.insert( maChildren.begin()+pos, pChild ); - } - else - maChildren.push_back( pChild ); - - OSL_ASSERT( pChild->mpParent == NULL ); - pChild->mpParent = this; - - // store container props - { - pChild->maOriChildProps.clear(); - PropertyIterator it( pChild, CONTAINER_PROPERTY ); - while ( it.hasNext() ) - { - beans::Property prop = it.next(); - rtl::OUString name( prop.Name ); - try { - rtl::OUString value( pChild->getProperty( name, CONTAINER_PROPERTY ) ); - std::pair< rtl::OUString, rtl::OUString > pair( name, value ); - pChild->maOriChildProps.push_back( pair ); - } catch ( beans::UnknownPropertyException &rEx ) { - fprintf (stderr, "ERROR: widget reports that it has a property it cannot return: '%s' this normally means that someone screwed up their PROPERTY_SET_INFO macro usage.\n", - rtl::OUStringToOString (rEx.Message, RTL_TEXTENCODING_UTF8).getStr()); - return false; - } - } - } - - return true; - } - - bool removeChild( Widget *pChild ) - { - if ( !mxContainer.is() || pChild->mpParent != this ) - return false; - - mxContainer->removeChild( pChild->mxWidget ); - - unsigned int pos = getChildPos( pChild ); - if ( pos < maChildren.size() ) - maChildren.erase( maChildren.begin()+pos ); - pChild->mpParent = NULL; - - return true; - } - - bool swapWithChild( Widget *pChild ) - { - if ( !pChild->isContainer() ) - return false; - - // remove all child's childrens, and try to add them here - removeChild( pChild ); - - // keep a copy for failure - std::vector< Widget *> aChildren = maChildren; - std::vector< Widget *> aChildChildren = pChild->maChildren; - - for ( std::vector< Widget *>::const_iterator it = aChildChildren.begin(); - it != aChildChildren.end(); ++it ) - pChild->removeChild( *it ); - - for ( std::vector< Widget *>::const_iterator it = aChildChildren.begin(); - it != aChildChildren.end(); ++it ) - if ( !addChild( *it ) ) - { // failure - for ( std::vector< Widget *>::const_iterator jt = aChildChildren.begin(); - jt != it; ++jt ) - removeChild( *jt ); - for ( std::vector< Widget *>::const_iterator jt = aChildChildren.begin(); - jt != aChildChildren.end(); ++jt ) - pChild->addChild( *jt ); - return false; - } - - Widget *pParent = up(); - - if ( pParent ) - { - pParent->removeChild( this ); - pParent->addChild( pChild ); - } - pChild->addChild( this ); - return true; - } - - unsigned int getChildPos( Widget *pChild ) - { - int i = 0; - for ( std::vector< Widget *>::const_iterator it = maChildren.begin(); - it != maChildren.end(); ++it, ++i ) - if ( *it == pChild ) - break; - return i; - } - - Widget *getChild( int pos ) - { - if ( pos >= 0 && pos < (signed) maChildren.size() ) - return *(maChildren.begin() + pos); - return NULL; - } - - bool isContainer() - { return mxContainer.is(); } - unsigned int getChildrenLen() - { return maChildren.size(); } - - rtl::OUString getLabel() const - { return mrLabel; } - rtl::OUString getUnoName() const - { return mrUnoName; } - - int getDepth() - { - int depth = 0; - for ( Widget *pWidget = mpParent; pWidget; pWidget = pWidget->mpParent ) - depth++; - return depth; - } - - enum PropertyKind { - WINDOW_PROPERTY, CONTAINER_PROPERTY, WINBITS_PROPERTY - }; - - static rtl::OUString findProperty( const PropList &props, rtl::OUString propName ) - { - for ( PropList::const_iterator it = props.begin(); it != props.end(); ++it ) - if ( it->first.equalsIgnoreAsciiCase( propName ) ) - return it->second; -#if DEBUG_PRINT - fprintf(stderr, "Serious error: property '%s' not found\n", OUSTRING_CSTR(propName)); -#endif - return rtl::OUString(); - } - - rtl::OUString getOriginalProperty( rtl::OUString rPropName, PropertyKind rKind ) - { - rtl::OUString rValue; - switch ( rKind ) { - case WINDOW_PROPERTY: - rValue = findProperty( maOriProps, rPropName ); - break; - case CONTAINER_PROPERTY: - rValue = findProperty( maOriChildProps, rPropName ); - break; - case WINBITS_PROPERTY: - // TODO - break; - } - - return rValue; - } - - rtl::OUString getProperty( rtl::OUString rPropName, PropertyKind rKind ) - { - rtl::OUString rValue; - switch ( rKind ) { - case WINDOW_PROPERTY: - rValue = anyToString( layoutimpl::prophlp::getProperty( mxWidget, rPropName ) ); - break; - case CONTAINER_PROPERTY: - if ( mpParent ) - rValue = anyToString( layoutimpl::prophlp::getProperty( - mpParent->mxContainer->getChildProperties( mxWidget ), rPropName ) ); - break; - case WINBITS_PROPERTY: - // TODO - break; - } - - return rValue; - } - - bool isPropertyTouched( rtl::OUString propName, PropertyKind rKind ) - { - rtl::OUString oriValue = getOriginalProperty( propName, rKind ); - rtl::OUString newValue = getProperty( propName, rKind ); - bool isTouched = oriValue != newValue; -#if DEBUG_PRINT - fprintf(stderr, "is property '%s' touched? %s (%s vs %s)\n", OUSTRING_CSTR(propName), isTouched ? "yes" : "no", OUSTRING_CSTR(oriValue), OUSTRING_CSTR(newValue)); -#endif - return isTouched; - } - - using LayoutWidget::setProperty; - - void setProperty( rtl::OUString rPropName, PropertyKind rKind, uno::Any rValue ) - { - switch ( rKind ) { - case WINDOW_PROPERTY: - layoutimpl::prophlp::setProperty( mxWidget, rPropName, rValue ); - break; - case CONTAINER_PROPERTY: - if ( mpParent ) - layoutimpl::prophlp::setProperty( - mpParent->mxContainer->getChildProperties( mxWidget ), rPropName, rValue ); - break; - case WINBITS_PROPERTY: - // TODO - break; - } - } - - struct PropertyIterator { - friend class Widget; - PropertyKind mrKind; - uno::Sequence< beans::Property > maProps; - int nPropIt; - - PropertyIterator( Widget *pWidget, PropertyKind rKind ) - : mrKind( rKind ), nPropIt( 0 ) - { - switch ( rKind ) - { - case WINDOW_PROPERTY: - if ( layoutimpl::prophlp::canHandleProps( pWidget->mxWidget ) ) - { - uno::Reference< beans::XPropertySetInfo > xInfo - = layoutimpl::prophlp::queryPropertyInfo( pWidget->mxWidget ); - if ( !xInfo.is() ) - return; - - maProps = xInfo->getProperties(); - } - break; - case CONTAINER_PROPERTY: - if ( pWidget->mpParent ) - { - uno::Reference< beans::XPropertySet >xParentSet( - pWidget->mpParent->mxContainer->getChildProperties( pWidget->mxWidget ) ); - if ( xParentSet.is()) - { - uno::Reference< beans::XPropertySetInfo > xInfo( xParentSet->getPropertySetInfo() ); - if ( xInfo.is() ) - maProps = xInfo->getProperties(); - } - } - break; - case WINBITS_PROPERTY: - // TODO - break; - } - } - - bool hasNext() - { - return nPropIt < maProps.getLength(); - } - - beans::Property next() - { -/* rtl::OUString propName, propValue; - propName = maProps[ nPropIt ]; - propValue = getProperty( propName, mrKind, false); - nPropIt++; - return std::pair< rtl::OUString, rtl::OUString > propPair( propName, propValue );*/ - return maProps[ nPropIt++ ]; - } - }; -}; - -class EditorRoot : public layoutimpl::LayoutRoot { - Widget *mpParent; - -public: - EditorRoot( const uno::Reference< lang::XMultiServiceFactory >& xFactory, - Widget *pParent ) - : layoutimpl::LayoutRoot( xFactory ), mpParent( pParent ) - { - } - - // generation - virtual layoutimpl::LayoutWidget *create( rtl::OUString id, const rtl::OUString unoName, - long attrbs, uno::Reference< awt::XLayoutContainer > xParent ) - { - if ( unoName.compareToAscii( "dialog" ) == 0 ) - return mpParent; - - // TODO: go through specs to map unoName to a more human-readable label - Widget *pWidget = new Widget( id, mxToolkit, xParent, unoName, attrbs ); - if ( !mxWindow.is() ) - mxWindow = uno::Reference< awt::XWindow >( pWidget->getPeer(), uno::UNO_QUERY ); - - if ( pWidget->mxContainer.is() ) - pWidget->mxContainer->setLayoutUnit( mpParent->mxContainer->getLayoutUnit() ); - - return pWidget; - } -}; - -/* Working with the layout in 1D, as if it was a flat list. */ -namespace FlatLayout -{ -Widget *next( Widget *pWidget ) -{ - Widget *pNext; - pNext = pWidget->down(); - if ( pNext ) return pNext; - pNext = pWidget->next(); - if ( pNext ) return pNext; - for ( Widget *pUp = pWidget->up(); pUp != NULL; pUp = pUp->up() ) - if ( (pNext = pUp->next()) != NULL ) - return pNext; - return NULL; -} - -/* - Widget *prev( Widget *pWidget ) - { - Widget *pPrev; - pPrev = pWidget->prev(); - if ( !pPrev ) - return pWidget->up(); - - Widget *pBottom = pPrev->down(); - if ( pBottom ) - { - while ( pBottom->down() || pBottom->next() ) - { - for ( Widget *pNext = pBottom->next(); pNext; pNext = pNext->next() ) - pBottom = pNext; - Widget *pDown = pBottom->down(); - if ( pDown ) - pBottom = pDown; - } - return pBottom; - } - return pPrev; - } -*/ - -bool moveWidget( Widget *pWidget, bool up /*or down*/ ) -{ - // Keep child parent&pos for in case of failure - Widget *pOriContainer = pWidget->up(); - unsigned int oriChildPos = pOriContainer->getChildPos( pWidget ); - - // Get parent&sibling before removing it, since relations get cut - Widget *pSibling = up ? pWidget->prev() : pWidget->next(); - Widget *pContainer = pWidget->up(); - if ( !pContainer ) - return false; - - // try to swap with parent or child - // We need to allow for this at least for the root node... - if ( !pSibling ) - { - if ( up ) - { - if ( pContainer->swapWithChild( pWidget ) ) - return true; - } - else - { - } - } - - pContainer->removeChild( pWidget ); - - // if has up sibling -- append to it, else swap with it - if ( pSibling ) - { - if ( pSibling->addChild( pWidget, up ? 0xffff : 0 ) ) - return true; - - unsigned int childPos = pContainer->getChildPos( pSibling ); - if ( pContainer->addChild( pWidget, childPos + (up ? 0 : 1) ) ) - return true; // should always be succesful - } - // go through parents -- try to get prepended to them - else - { - for ( ; pContainer && pContainer->up(); pContainer = pContainer->up() ) - { - unsigned int childPos = pContainer->up()->getChildPos( pContainer ); - if ( pContainer->up()->addChild( pWidget, childPos + (up ? 0 : 1) ) ) - return true; - } - } - - // failed -- try to get it to its old position - if ( !pOriContainer->addChild( pWidget, oriChildPos ) ) - { - // a parent should never reject a child back. but if it ever - // happens, just kill it, we don't run an orphanate here ;P - delete pWidget; - return true; - } - return false; -} - -// NOTE: root is considered to be number -1 -Widget *get( Widget *pRoot, int nb ) -{ - Widget *it; - for ( it = pRoot; it != NULL && nb >= 0; it = next( it ) ) - nb--; - return it; -} - -int get( Widget *pRoot, Widget *pWidget ) -{ - int nRet = -1; - Widget *it; - for ( it = pRoot; it != NULL && it != pWidget; it = next( it ) ) - nRet++; - return nRet; -} -} - -//** PropertiesList widget - -class PropertiesList : public layout::Table -{ - class PropertyEntry - { - friend class PropertiesList; - - /* wrapper between the widget and Any */ - struct AnyWidget - { - DECL_LINK( ApplyPropertyHdl, layout::Window* ); - DECL_LINK( FlagToggledHdl, layout::CheckBox* ); - - AnyWidget( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind ) - : mpWidget( pWidget ), maPropName( aPropName ), maPropKind( aPropKind ) - { - mpFlag = 0; - mbBlockFlagCallback = false; - bFirstGet = true; - } - - virtual ~AnyWidget() - { -#if DEBUG_PRINT - fprintf(stderr, "~AnyWidget\n"); -#endif - } - - void save( uno::Any aValue ) - { - mpWidget->setProperty( maPropName, maPropKind, aValue ); - checkProperty(); - } - - void checkProperty() - { - bool flag = mpWidget->isPropertyTouched( maPropName, maPropKind ); - - if ( mpFlag && mpFlag->IsChecked() != (BOOL)flag ) - { - CheckFlag( flag, true ); - } - } - - void CheckFlag( bool bValue, bool bBlockCallback ) - { - if ( bBlockCallback ) - mbBlockFlagCallback = true; - mpFlag->Check( bValue ); - mbBlockFlagCallback = false; - } - - bool bFirstGet; // HACK - rtl::OUString getValue() - { -// return mpWidget->getOriProperty( maPropName ); - rtl::OUString value; - if ( bFirstGet ) // king of ugliness - value = mpWidget->getProperty( maPropName, maPropKind ); - else - value = mpWidget->getOriginalProperty( maPropName, maPropKind ); - bFirstGet = false; - return value; - } - - // FIXME: wrapper should have a base class for this... - virtual layout::Window *getWindow() = 0; - virtual layout::Container *getContainer() { return NULL; } - - virtual void load() = 0; - virtual void store() = 0; - - Widget *mpWidget; - rtl::OUString maPropName; - Widget::PropertyKind maPropKind; - layout::CheckBox *mpFlag; - bool mbBlockFlagCallback; - }; - - struct AnyEdit : public AnyWidget, layout::HBox - { - layout::Edit *mpEdit; - bool mbMultiLine; - layout::PushButton *mpExpand; - DECL_LINK( ExpandEditHdl, layout::PushButton* ); - - // so we can create widgets (like transforming the Edit into a - // MultiLineEdit) - layout::Window *mpWinParent; - - AnyEdit( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, layout::Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), layout::HBox( 0, false ), mpWinParent( pWinParent ) - { - mpEdit = NULL; - mpExpand = new layout::PushButton( pWinParent, WB_TOGGLE ); - mpExpand->SetToggleHdl( LINK( this, AnyEdit, ExpandEditHdl ) ); - setAsMultiLine( false ); - - load(); - } - - virtual ~AnyEdit() - { - delete mpEdit; - delete mpExpand; - } - - virtual layout::Window *getWindow() - { return NULL; } - virtual layout::Container *getContainer() - { return this; } - - void setAsMultiLine( bool bMultiLine ) - { - Clear(); - XubString text; - if ( mpEdit ) - { - text = mpEdit->GetText(); - printf("Remove mpEdit and expand\n"); - Remove( mpEdit ); - Remove( mpExpand ); - delete mpEdit; - } - - if ( bMultiLine ) - { - mpEdit = new layout::Edit( mpWinParent, WB_BORDER ); - mpExpand->SetText( String::CreateFromAscii( "-" ) ); - } - else - { - mpEdit = new layout::Edit( mpWinParent, WB_BORDER ); - mpExpand->SetText( String::CreateFromAscii( "+" ) ); - } - - mpEdit->SetText( text ); - mpEdit->SetModifyHdl( LINK( this, AnyEdit, ApplyPropertyHdl ) ); - - Add( mpEdit, true, true, 0 ); - Add( mpExpand, false, true, 0 ); - - mbMultiLine = bMultiLine; - } - - virtual void load() - { - mpEdit->SetText( getValue() ); - checkProperty(); - } - - virtual void store() - { - save( uno::makeAny( (rtl::OUString) mpEdit->GetText() ) ); - } - }; - - struct AnyInteger : public AnyWidget, NumericField - { - AnyInteger( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), NumericField( pWinParent, WB_SPIN|WB_BORDER ) - { - load(); - SetModifyHdl( LINK( this, AnyInteger, ApplyPropertyHdl ) ); - } - - virtual Window *getWindow() - { return this; } - - virtual void load() - { - OUString text = getValue(); - SetText( text.getStr() ); - checkProperty(); - } - - virtual void store() - { -#if DEBUG_PRINT - fprintf(stderr, "store number: %ld\n", rtl::OUString( GetText() ).toInt64()); -#endif - save( uno::makeAny( rtl::OUString( GetText() ).toInt64() ) ); - } - }; - - struct AnyFloat : public AnyInteger - { - AnyFloat( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyInteger( pWidget, aPropName, aPropKind, pWinParent ) - {} - - virtual void store() - { - save( uno::makeAny( rtl::OUString( GetText() ).toDouble() ) ); - } - }; - - struct AnyCheckBox : public AnyWidget, layout::CheckBox - { - AnyCheckBox( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, layout::Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), layout::CheckBox( pWinParent ) - { - // adding some whitespaces to make the hit area larger -// SetText( String::CreateFromAscii( "" ) ); - load(); - SetToggleHdl( LINK( this, AnyWidget, ApplyPropertyHdl ) ); - } - - virtual ~AnyCheckBox() - { -#if DEBUG_PRINT - fprintf(stderr, "~AnyCheckBox\n"); -#endif - } - - virtual layout::Window *getWindow() - { return this; } - - virtual void load() - { -#if DEBUG_PRINT - fprintf(stderr, "loading boolean value\n"); -#endif - Check( getValue().toInt64() != 0 ); - setLabel(); - checkProperty(); - } - - virtual void store() - { - save( uno::makeAny( IsChecked() ) ); - setLabel(); - } - - void setLabel() - { - SetText( String::CreateFromAscii( IsChecked() ? "true" : "false" ) ); - } - }; - - struct AnyListBox : public AnyWidget, layout::ListBox - { - AnyListBox( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), layout::ListBox( pWinParent, WB_DROPDOWN ) - { - SetSelectHdl( LINK( this, AnyWidget, ApplyPropertyHdl ) ); - } - - virtual layout::Window *getWindow() - { return this; } - - virtual void load() - { - SelectEntryPos( sal::static_int_cast< USHORT >( getValue().toInt32() ) ); - checkProperty(); - } - - virtual void store() - { - save( uno::makeAny( (short) GetSelectEntryPos() ) ); - } - }; - - struct AnyAlign : public AnyListBox - { - AnyAlign( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyListBox( pWidget, aPropName, aPropKind, pWinParent ) - { - InsertEntry( XubString::CreateFromAscii( "Left" ) ); - InsertEntry( XubString::CreateFromAscii( "Center" ) ); - InsertEntry( XubString::CreateFromAscii( "Right" ) ); - load(); - } - }; - - /* AnyListBox and AnyComboBox different in that a ComboBox allows the user - to add other options, operating in strings, instead of constants. - (its more like a suggestive AnyEdit) */ - struct AnyComboBox : public AnyWidget, layout::ComboBox - { - AnyComboBox( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), layout::ComboBox( pWinParent, WB_DROPDOWN ) - { - SetModifyHdl( LINK( this, AnyComboBox, ApplyPropertyHdl ) ); - } - - virtual layout::Window *getWindow() - { return this; } - - virtual void load() - { - SetText( getValue() ); - checkProperty(); - } - - virtual void store() - { - save( uno::makeAny( (rtl::OUString) GetText() ) ); - } - }; - - struct AnyFontStyle : public AnyComboBox - { - AnyFontStyle( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyComboBox( pWidget, aPropName, aPropKind, pWinParent ) - { - InsertEntry( XubString::CreateFromAscii( "Bold" ) ); - InsertEntry( XubString::CreateFromAscii( "Italic" ) ); - InsertEntry( XubString::CreateFromAscii( "Bold Italic" ) ); - InsertEntry( XubString::CreateFromAscii( "Fett" ) ); - load(); - } - }; - - layout::FixedText *mpLabel; - layout::CheckBox *mpFlag; - AnyWidget *mpValue; - - public: - PropertyEntry( layout::Window *pWinParent, AnyWidget *pAnyWidget ) - { - mpLabel = new layout::FixedText( pWinParent ); - { - // append ':' to aPropName - rtl::OUStringBuffer buf( pAnyWidget->maPropName ); - buf.append( sal_Unicode (':') ); - mpLabel->SetText( buf.makeStringAndClear() ); - } - mpValue = pAnyWidget; - mpFlag = new layout::CheckBox( pWinParent ); - mpFlag->SetToggleHdl( LINK( mpValue, AnyWidget, FlagToggledHdl ) ); - mpValue->mpFlag = mpFlag; - } - - ~PropertyEntry() - { -#if DEBUG_PRINT - fprintf(stderr, "REMOVING label, flag and value\n"); -#endif - delete mpLabel; - delete mpFlag; - delete mpValue; - } - - // Use this factory rather than the constructor -- check for NULL - static PropertyEntry *construct( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, sal_uInt16 nType, - layout::Window *pWinParent ) - { - AnyWidget *pAnyWidget; - switch (nType) { - case uno::TypeClass_STRING: - if ( aPropName.compareToAscii( "FontStyleName" ) == 0 ) - { - pAnyWidget = new AnyFontStyle( pWidget, aPropName, aPropKind, pWinParent ); - break; - } - pAnyWidget = new AnyEdit( pWidget, aPropName, aPropKind, pWinParent ); - break; - case uno::TypeClass_SHORT: - if ( aPropName.compareToAscii( "Align" ) == 0 ) - { - pAnyWidget = new AnyAlign( pWidget, aPropName, aPropKind, pWinParent ); - break; - } - // otherwise, treat as any other number... - case uno::TypeClass_LONG: - case uno::TypeClass_UNSIGNED_LONG: - pAnyWidget = new AnyInteger( pWidget, aPropName, aPropKind, pWinParent ); - break; - case uno::TypeClass_FLOAT: - case uno::TypeClass_DOUBLE: - pAnyWidget = new AnyFloat( pWidget, aPropName, aPropKind, pWinParent ); - break; - case uno::TypeClass_BOOLEAN: - pAnyWidget = new AnyCheckBox( pWidget, aPropName, aPropKind, pWinParent ); - break; - default: - return NULL; - } - return new PropertyEntry( pWinParent, pAnyWidget ); - } - }; - - layout::Window *mpParentWindow; - - std::list< PropertyEntry* > maPropertiesList; - layout::FixedLine *mpSeparator; - - // some properties are obscure, or simply don't make sense in this - // context. Let's just ignore them. - // Maybe we could offer them in an expander or something... - static bool toIgnore( rtl::OUString prop ) - { - // binary search -- keep the list sorted alphabetically - static char const *toIgnoreList[] = { - "DefaultControl", "FocusOnClick", "FontCharWidth", "FontCharset", - "FontEmphasisMark", "FontFamily", "FontHeight", "FontKerning", "FontName", - "FontOrientation", "FontPitch", "FontRelief", "FontSlant", "FontStrikeout", - "FontType", "FontWordLineMode", "HelpText", "HelpURL", "MultiLine", - "Printable", "Repeat", "RepeatDelay", "Tabstop" - }; - - int min = 0, max = sizeof( toIgnoreList )/sizeof( char * ) - 1, mid, cmp; - do { - mid = min + (max - min)/2; - cmp = prop.compareToAscii( toIgnoreList[ mid ] ); - if ( cmp > 0 ) - min = mid+1; - else if ( cmp < 0 ) - max = mid-1; - else - return true; - } while ( min <= max ); - return false; - } - -public: - PropertiesList( layout::Dialog *dialog ) - : layout::Table( dialog, "properties-box" ) - , mpParentWindow( dialog ), mpSeparator( 0 ) - { - } - - ~PropertiesList() - { - clear(); - } - -private: - // auxiliary, add properties from the peer to the list - void addProperties( Widget *pWidget, Widget::PropertyKind rKind ) - { - Widget::PropertyIterator it( pWidget, rKind ); - while ( it.hasNext() ) - { - beans::Property prop = it.next(); - rtl::OUString name( prop.Name ); - if ( toIgnore( name ) ) - continue; - sal_uInt16 type = static_cast< sal_uInt16 >( prop.Type.getTypeClass() ); - - PropertyEntry *propEntry = PropertyEntry::construct( - pWidget, name, rKind, type, mpParentWindow ); - - if ( propEntry ) - { - Add( propEntry->mpLabel, false, false ); - - // HACK: one of these will return Null... - Add( propEntry->mpValue->getWindow(), true, false ); - Add( propEntry->mpValue->getContainer(), true, false ); - - Add( propEntry->mpFlag, false, false ); - maPropertiesList.push_back( propEntry ); - } - } - } - -public: - void selectedWidget( Widget *pWidget ) - { - clear(); - - if ( !pWidget ) - return; - - addProperties( pWidget, Widget::CONTAINER_PROPERTY ); - - mpSeparator = new layout::FixedLine( mpParentWindow ); - // TODO: we may want to have to separate list widgets here... - Add( mpSeparator, false, false, 3, 1 ); - - addProperties( pWidget, Widget::WINDOW_PROPERTY ); - - ShowAll( true ); - } - - void clear() - { - ///FIXME: crash - Container::Clear(); - - for ( std::list< PropertyEntry* >::iterator it = maPropertiesList.begin(); - it != maPropertiesList.end(); ++it) - delete *it; - maPropertiesList.clear(); - - delete mpSeparator; - mpSeparator = NULL; - } -}; - -IMPL_LINK( PropertiesList::PropertyEntry::AnyWidget, ApplyPropertyHdl, layout::Window *, pWin ) -{ - (void) pWin; - store(); - return 0; -} - -IMPL_LINK( PropertiesList::PropertyEntry::AnyWidget, FlagToggledHdl, layout::CheckBox *, pCheck ) -{ -#if DEBUG_PRINT - fprintf(stderr, "Property flag pressed -- is: %d\n", pCheck->IsChecked()); -#endif - if ( !mbBlockFlagCallback ) - { - bool checked = pCheck->IsChecked(); - if ( !checked ) // revert - { -#if DEBUG_PRINT - fprintf(stderr, "revert\n"); -#endif - load(); - } - else - { -#if DEBUG_PRINT - fprintf(stderr, "user can't dirty the flag!\n"); -#endif - // User can't flag the property as dirty - // Actually, we may want to allow the designer to force a property to be stored. - // Could be useful when the default value of some new property wasn't yet decided... - CheckFlag( false, true ); - } - } -#if DEBUG_PRINT - else - fprintf(stderr, "Property flag pressed -- BLOCKED\n"); -#endif - return 0; -} - -IMPL_LINK( PropertiesList::PropertyEntry::AnyEdit, ExpandEditHdl, layout::PushButton *, pBtn ) -{ - setAsMultiLine( pBtn->IsChecked() ); - return 0; -} - -//** SortListBox auxiliary widget - -class SortListBox -{ // For a manual sort ListBox; asks for a ListBox and Up/Down/Remove - // buttons to wrap - DECL_LINK( ItemSelectedHdl, layout::ListBox* ); - DECL_LINK( UpPressedHdl, layout::Button* ); - DECL_LINK( DownPressedHdl, layout::Button* ); - DECL_LINK( RemovePressedHdl, layout::Button* ); - layout::PushButton *mpUpButton, *mpDownButton, *mpRemoveButton; - -protected: - layout::ListBox *mpListBox; - - virtual void upPressed( USHORT nPos ) - { - XubString str = mpListBox->GetSelectEntry(); - mpListBox->RemoveEntry( nPos ); - nPos = mpListBox->InsertEntry( str, nPos-1 ); - mpListBox->SelectEntryPos( nPos ); - } - - virtual void downPressed( USHORT nPos ) - { - XubString str = mpListBox->GetSelectEntry(); - mpListBox->RemoveEntry( nPos ); - nPos = mpListBox->InsertEntry( str, nPos+1 ); - mpListBox->SelectEntryPos( nPos ); - } - - virtual void removePressed( USHORT nPos ) - { - mpListBox->RemoveEntry( nPos ); - } - - virtual void itemSelected( USHORT nPos ) - { - // if we had some XLayoutContainer::canAdd() or maxChildren() function - // we could make a function to check if we can move selected and enable/ - // /disable the move buttons as appropriate - - if ( nPos == LISTBOX_ENTRY_NOTFOUND ) - { - mpUpButton->Disable(); - mpDownButton->Disable(); - mpRemoveButton->Disable(); - } - else - { - mpUpButton->Enable(); - mpDownButton->Enable(); - mpRemoveButton->Enable(); - } - } - -public: - SortListBox( layout::ListBox *pListBox, layout::PushButton *pUpButton, layout::PushButton *pDownButton, - layout::PushButton *pRemoveButton ) - : mpUpButton( pUpButton), mpDownButton( pDownButton), mpRemoveButton( pRemoveButton ), - mpListBox( pListBox ) - { - mpListBox->SetSelectHdl( LINK( this, SortListBox, ItemSelectedHdl ) ); - - mpUpButton->SetModeImage( layout::Image ( "cmd/lc_moveup.png" ) ); - mpUpButton->SetImageAlign( IMAGEALIGN_LEFT ); - mpUpButton->SetClickHdl( LINK( this, SortListBox, UpPressedHdl ) ); - - mpDownButton->SetModeImage( layout::Image ( "cmd/lc_movedown.png" ) ); - mpDownButton->SetImageAlign( IMAGEALIGN_LEFT ); - mpDownButton->SetClickHdl( LINK( this, SortListBox, DownPressedHdl ) ); - - // "cmd/lch_delete.png", "cmd/lc_delete.png" - mpRemoveButton->SetModeImage( layout::Image ( "cmd/sc_closedoc.png" ) ); - mpRemoveButton->SetImageAlign( IMAGEALIGN_LEFT ); - mpRemoveButton->SetClickHdl( LINK( this, SortListBox, RemovePressedHdl ) ); - - // fire an un-select event - itemSelected( LISTBOX_ENTRY_NOTFOUND ); - } - - virtual ~SortListBox(); -}; - -SortListBox::~SortListBox() -{ - delete mpListBox; - delete mpUpButton; - delete mpDownButton; - delete mpRemoveButton; -} - -IMPL_LINK( SortListBox, UpPressedHdl, layout::Button *, pBtn ) -{ - (void) pBtn; - USHORT pos = mpListBox->GetSelectEntryPos(); - if ( pos > 0 && pos != LISTBOX_ENTRY_NOTFOUND ) - upPressed( pos ); - return 0; -} - -IMPL_LINK( SortListBox, DownPressedHdl, layout::Button *, pBtn ) -{ - (void) pBtn; - USHORT pos = mpListBox->GetSelectEntryPos(); - if ( pos < mpListBox->GetEntryCount() && pos != LISTBOX_ENTRY_NOTFOUND ) - downPressed( pos ); - return 0; -} - -IMPL_LINK( SortListBox, RemovePressedHdl, layout::Button *, pBtn ) -{ - (void) pBtn; - USHORT pos = mpListBox->GetSelectEntryPos(); - if ( pos != LISTBOX_ENTRY_NOTFOUND ) - removePressed( pos ); - return 0; -} - -IMPL_LINK( SortListBox, ItemSelectedHdl, layout::ListBox *, pList ) -{ - (void) pList; - USHORT pos = mpListBox->GetSelectEntryPos(); - itemSelected( pos ); - return 0; -} - -//** LayoutTree widget - -class LayoutTree : public SortListBox -{ -public: - struct Listener - { - virtual void widgetSelected( Widget *pWidget ) = 0; - }; - -private: - Listener *mpListener; - -public: - Widget *mpRootWidget; - - LayoutTree( layout::Dialog *dialog ) - : SortListBox( new layout::ListBox( dialog, "layout-tree" ), - new layout::PushButton( dialog, "layout-up-button" ), - new layout::PushButton( dialog, "layout-down-button" ), - new layout::PushButton( dialog, "layout-remove-button" ) ) - { - layout::PeerHandle handle = dialog->GetPeerHandle( "preview-box" ); - uno::Reference< awt::XLayoutConstrains > xWidget( handle, uno::UNO_QUERY ); - mpRootWidget = new Widget( xWidget, "root" ); - } - - virtual ~LayoutTree(); - - Widget *getWidget( int nPos ) - { - if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - return FlatLayout::get( mpRootWidget, nPos ); - return NULL; - } - - Widget *getSelectedWidget() - { - Widget *pWidget = getWidget( mpListBox->GetSelectEntryPos() ); - if ( !pWidget ) // return root, if none selected - pWidget = mpRootWidget; - return pWidget; - } - - void selectWidget( Widget *pWidget ) - { - int pos = FlatLayout::get( mpRootWidget, pWidget ); - if ( pos == -1 ) - // if asked to select hidden root, select visible root - pos = 0; - mpListBox->SelectEntryPos( sal::static_int_cast< USHORT >( pos ) ); - } - - void rebuild() - { - struct inner - { - // pads a string with whitespaces - static rtl::OUString padString( rtl::OUString name, int depth ) - { - rtl::OStringBuffer aBuf( depth * 4 + name.getLength() + 2 ); - for (int i = 0; i < depth; i++) - aBuf.append( " " ); - aBuf.append( rtl::OUStringToOString( name, RTL_TEXTENCODING_ASCII_US ) ); - return rtl::OUString( aBuf.getStr(), aBuf.getLength(), - RTL_TEXTENCODING_UTF8 ); - } - }; - - mpListBox->Clear(); - for ( Widget *i = FlatLayout::next( mpRootWidget ); i; i = FlatLayout::next( i ) ) - mpListBox->InsertEntry( inner::padString( i->getLabel(), i->getDepth()-1 ) ); - - // any selection, no longer is. ListBox doesn't fire the event on this case; - // force it. - itemSelected( LISTBOX_ENTRY_NOTFOUND ); - } - - void setListener( Listener *pListener ) - { mpListener = pListener; } - - // print in XML format... - - static rtl::OUString toXMLNaming (const rtl::OUString &string) - { - rtl::OUStringBuffer buffer (string.getLength()); - sal_Unicode *str = string.pData->buffer; - for (int i = 0; i < string.getLength(); i++) { - if ( str[i] >= 'A' && str[i] <= 'Z' ) - { - if ( i > 0 ) - buffer.append ((sal_Unicode) '-'); - buffer.append ((sal_Unicode) (str[i] - 'A' + 'a')); - } - else - buffer.append ((sal_Unicode) str[i]); - } - - return buffer.makeStringAndClear(); - } - - void print() - { - printf("\t\tExport:\n"); - printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" - "<dialog xmlns=\"http://openoffice.org/2007/layout\"\n" - " xmlns:cnt=\"http://openoffice.org/2007/layout/container\"\n" - " id=\"dialog\" title=\"Unnamed\" sizeable=\"true\" >\n"); - - for ( Widget *i = FlatLayout::next( mpRootWidget ); i; i = FlatLayout::next( i ) ) - { - for ( int d = i->getDepth(); d > 0; d-- ) - printf(" "); - printf("<%s ", OUSTRING_CSTR( i->getUnoName() ) ); - - for ( int kind = 0; kind < 2; kind++ ) - { - Widget::PropertyKind wKind = kind == 0 ? Widget::WINDOW_PROPERTY - : Widget::CONTAINER_PROPERTY; - Widget::PropertyIterator it( i, wKind ); - while ( it.hasNext() ) - { - beans::Property prop = it.next(); - if ( !i->isPropertyTouched( prop.Name, wKind ) ) - continue; - - rtl::OUString value = i->getProperty( prop.Name, wKind ); - if ( prop.Type.getTypeClass() == uno::TypeClass_BOOLEAN ) - { - if ( value.compareToAscii( "0" ) ) - value = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("false") ); - else - value = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("true") ); - } - - if ( value.getLength() > 0 ) - printf("%s%s=\"%s\" ", - kind == 0 ? "" : "cnt:", - OUSTRING_CSTR( toXMLNaming( prop.Name ) ), OUSTRING_CSTR( value ) - ); - - } - } - printf("/>\n"); - } - printf("</dialog>\n"); - } - -protected: - virtual void upPressed( USHORT nPos ) - { - Widget *pWidget = getWidget( nPos ); - if ( FlatLayout::moveWidget( pWidget, true ) ) - rebuild(); - selectWidget( pWidget ); - } - - virtual void downPressed( USHORT nPos ) - { - Widget *pWidget = getWidget( nPos ); - if ( FlatLayout::moveWidget( pWidget, false ) ) - rebuild(); - selectWidget( pWidget ); - } - - virtual void removePressed( USHORT nPos ) - { - Widget *pWidget = getWidget( nPos ); - if ( pWidget ) - { - pWidget->up()->removeChild( pWidget ); - delete pWidget; - rebuild(); - } - } - - virtual void itemSelected( USHORT nPos ) - { - mpListener->widgetSelected( getWidget( nPos ) ); - SortListBox::itemSelected( nPos ); - } -}; - -LayoutTree::~LayoutTree() -{ - delete mpRootWidget; -} - -//** EditorImpl - -class EditorImpl : public LayoutTree::Listener -{ - void createWidget( const char *unoName ); - - PropertiesList *mpPropertiesList; - LayoutTree *mpLayoutTree; - - layout::PushButton *pImportButton, *pExportButton; -#ifdef FILEDLG - FileDialog *pImportDialog; -#endif - DECL_LINK( ImportButtonHdl, layout::PushButton* ); - DECL_LINK( ExportButtonHdl, layout::PushButton* ); -#ifdef FILEDLG - DECL_LINK( ImportDialogHdl, FileDialog* ); -#endif - - // framework stuff - uno::Reference< lang::XMultiServiceFactory > mxFactory; - uno::Reference< awt::XToolkit > mxToolkit; - uno::Reference< awt::XWindow > mxToplevel; - - virtual void widgetSelected( Widget *pWidget ); - DECL_LINK( CreateWidgetHdl, layout::Button* ); - - std::list< layout::PushButton *> maCreateButtons; - -public: - - EditorImpl( layout::Dialog *dialog, - // we should probable open this channel (or whatever its called) ourselves - uno::Reference< lang::XMultiServiceFactory > xMSF ); - virtual ~EditorImpl(); - - void loadFile( const rtl::OUString &aTestFile ); -}; - -EditorImpl::EditorImpl( layout::Dialog *dialog, - uno::Reference< lang::XMultiServiceFactory > xFactory ) - : mxFactory( xFactory ) - , mxToplevel( dialog->GetPeerHandle( "dialog" ), uno::UNO_QUERY ) - // FIXME: any of these should work - //dialog->getContext()->getRoot(), uno::UNO_QUERY ) - // dialog->GetPeer(), uno::UNO_QUERY ) -{ -#if DEBUG_PRINT - fprintf (stderr, "EditorImpl()\n"); -#endif - // framework - mxToolkit = uno::Reference< awt::XToolkit >( - mxFactory->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ) ), - uno::UNO_QUERY ); - OSL_ASSERT( mxToolkit.is() ); - - // custom widgets -#if DEBUG_PRINT - fprintf (stderr, "custom widgets\n"); -#endif - mpPropertiesList = new PropertiesList( dialog ); - - mpLayoutTree = new LayoutTree( dialog ); - mpLayoutTree->setListener( this ); - -/* if ( xImport.is() ) - mpLayoutTree->getWidget( -1 )->addChild( new Widget( xImport, "import" ) );*/ - - // create buttons - layout::Container aWidgets( dialog, "create-widget" ); - layout::Container aContainers( dialog, "create-container" ); - for ( int i = 0; i < WIDGETS_SPECS_LEN; i++ ) - { - layout::PushButton *pBtn = new layout::PushButton( (layout::Window *) dialog ); - pBtn->SetText( rtl::OUString::createFromAscii( WIDGETS_SPECS[ i ].pLabel ) ); - pBtn->SetClickHdl( LINK( this, EditorImpl, CreateWidgetHdl ) ); - if ( WIDGETS_SPECS[ i ].pIconName != NULL ) - { - rtl::OString aPath ("cmd/"); - aPath += WIDGETS_SPECS[ i ].pIconName; - layout::Image aImg( aPath ); - pBtn->SetModeImage( aImg ); - pBtn->SetImageAlign( IMAGEALIGN_LEFT ); - } - pBtn->Show(); - maCreateButtons.push_back( pBtn ); - layout::Container *pBox = WIDGETS_SPECS[ i ].bIsContainer ? &aContainers : &aWidgets; - pBox->Add( pBtn ); - } - -#ifdef FILEDLG - fprintf(stderr,"creating file dialog\n"); - pImportDialog = new FileDialog( NULL/*(layout::Window *) dialog*/, 0 ); - fprintf(stderr,"connecting it\n"); - pImportDialog->SetFileSelectHdl( LINK( this, EditorImpl, ImportDialogHdl ) ); - fprintf(stderr,"done file dialog\n"); -#endif - -/* pImportButton = new layout::PushButton( dialog, "import-button" ); - pImportButton->SetClickHdl( LINK( this, EditorImpl, ImportButtonHdl ) );*/ - pExportButton = new layout::PushButton( dialog, "export-button" ); - pExportButton->SetClickHdl( LINK( this, EditorImpl, ExportButtonHdl ) ); -} - -EditorImpl::~EditorImpl() -{ - delete mpPropertiesList; - delete mpLayoutTree; - for ( std::list< layout::PushButton * >::const_iterator i = maCreateButtons.begin(); - i != maCreateButtons.end(); ++i) - delete *i; - delete pImportButton; - delete pExportButton; -#ifdef FILEDLG - delete pImportDialog; -#endif -} - -void EditorImpl::loadFile( const rtl::OUString &aTestFile ) -{ - fprintf( stderr, "TEST: layout instance\n" ); - uno::Reference< awt::XLayoutRoot > xRoot - ( new EditorRoot( mxFactory, mpLayoutTree->mpRootWidget ) ); - -/* - mxMSF->createInstance - ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Layout")) ), - uno::UNO_QUERY ); -*/ - if ( !xRoot.is() ) - { - throw uno::RuntimeException( - OUString( RTL_CONSTASCII_USTRINGPARAM("could not create awt Layout component!") ), - uno::Reference< uno::XInterface >() ); - } - -#if DEBUG_PRINT - fprintf( stderr, "TEST: initing root\n" ); -#endif - - uno::Reference< lang::XInitialization > xInit( xRoot, uno::UNO_QUERY ); - if ( !xInit.is() ) - { - throw uno::RuntimeException( - OUString( RTL_CONSTASCII_USTRINGPARAM("Layout has no XInitialization!") ), - uno::Reference< uno::XInterface >() ); - } - -#if DEBUG_PRINT - fprintf( stderr, "TEST: running parser\n" ); -#endif - uno::Sequence< uno::Any > aParams( 1 ); - aParams[0] <<= aTestFile; -#if DEBUG_PRINT - fprintf( stderr, "TEST: do it\n" ); -#endif - xInit->initialize( aParams ); -#if DEBUG_PRINT - fprintf( stderr, "TEST: file loaded\n" ); -#endif - - mpLayoutTree->rebuild(); -} - -void EditorImpl::createWidget( const char *name ) -{ - Widget *pWidget = mpLayoutTree->getSelectedWidget(); - - Widget *pChild = new Widget( rtl::OUString(), mxToolkit, uno::Reference< awt::XLayoutContainer >( mxToplevel, uno::UNO_QUERY ), rtl::OUString::createFromAscii( name ), awt::WindowAttribute::SHOW ); - if ( !pWidget->addChild( pChild ) ) - { - delete pChild; - // we may want to popup an error message - } - else - { - mpLayoutTree->rebuild(); - mpLayoutTree->selectWidget( pWidget ); - } -} - -void EditorImpl::widgetSelected( Widget *pWidget ) -{ - // we know can't add widget to a non-container, so let's disable the create - // buttons then. Would be nice to have a method to check if a container is - // full as well... - if ( !pWidget || pWidget->isContainer() ) - { - for ( std::list< layout::PushButton *>::const_iterator it = maCreateButtons.begin(); - it != maCreateButtons.end(); ++it) - (*it)->Enable(); - } - else - { - for ( std::list< layout::PushButton *>::const_iterator it = maCreateButtons.begin(); - it != maCreateButtons.end(); ++it) - (*it)->Disable(); - } - - mpPropertiesList->selectedWidget( pWidget ); -} - -IMPL_LINK( EditorImpl, CreateWidgetHdl, layout::Button *, pBtn ) -{ - int i = 0; - for ( std::list< layout::PushButton *>::const_iterator it = maCreateButtons.begin(); - it != maCreateButtons.end(); ++it, ++i ) - { - if ( pBtn == *it ) - break; - } - OSL_ASSERT( i < WIDGETS_SPECS_LEN ); - createWidget( WIDGETS_SPECS[i].pName ); - return 0; -} - -IMPL_LINK( EditorImpl, ImportButtonHdl, layout::PushButton *, pBtn ) -{ - (void) pBtn; -#if DEBUG_PRINT - fprintf(stderr, "IMPORT!\n"); -#endif -#ifdef FILEDLG - pImportDialog->Execute(); -#endif - - return 0; -} - -#ifdef FILEDLG -IMPL_LINK( EditorImpl, ImportDialogHdl, FileDialog *, pDialog ) -{ - UniString path = pDialog->GetPath(); -//fprintf(stderr, "Executing import dialog!\n"); - -#if DEBUG_PRINT - fprintf(stderr, "got import file: %s\n",rtl::OUStringToOString( path, RTL_TEXTENCODING_ASCII_US ).getStr() ); -#endif - - return 0; -} -#endif - -IMPL_LINK( EditorImpl, ExportButtonHdl, layout::PushButton *, pBtn ) -{ - (void) pBtn; - mpLayoutTree->print(); - return 0; -} - -//** Editor, the Dialog - -Editor::Editor( uno::Reference< lang::XMultiServiceFactory > xFactory, - rtl::OUString aFile ) - : layout::Dialog( (Window*) (NULL), "editor.xml", "dialog" ) - , mpImpl( new EditorImpl( this, xFactory ) ) -{ - if ( aFile.getLength() ) - mpImpl->loadFile( aFile ); - - // parent: - FreeResource(); -} - -Editor::~Editor() -{ - delete mpImpl; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/editor.hxx b/toolkit/workben/layout/editor.hxx deleted file mode 100644 index c977941703fa..000000000000 --- a/toolkit/workben/layout/editor.hxx +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef EDITOR_HXX -#define EDITOR_HXX - -#include <layout/layout.hxx> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> - -class EditorImpl; - -class Editor : public layout::Dialog -{ -EditorImpl *mpImpl; - -public: - Editor( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xMSF, - rtl::OUString aFile ); - ~Editor(); - - void loadFile( const rtl::OUString &aTestFile ); -}; - -#endif /*EDITOR_HXX*/ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/editor.xml b/toolkit/workben/layout/editor.xml deleted file mode 100644 index 4126dea8b289..000000000000 --- a/toolkit/workben/layout/editor.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- Normal skin --> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Layout Editor" sizeable="true"> - <vbox> - <hbox> - <min-size min-width="120" cnt:expand="false"> - <vbox> - <fixedtext label="Layout:" cnt:expand="false" /> - <hbox> - <listbox id="layout-tree" has_border="true" /> - <vbox cnt:expand="false"> - <pushbutton id="layout-up-button" cnt:expand="false" /> - <pushbutton id="layout-down-button" cnt:expand="false" /> - <fixedtext cnt:expand="true" /> - <pushbutton id="layout-remove-button" cnt:expand="false" /> - </vbox> - </hbox> - </vbox> - </min-size> - <min-size min-width="120"> - <vbox> - <fixedtext label="Preview:" cnt:expand="false" /> - <vbox border="50"> - <bin id="preview-box" /> - </vbox> - </vbox> - </min-size> - <min-size min-width="120" cnt:expand="false"> - <vbox> - <fixedtext label="Properties:" cnt:expand="false" /> - <table id="properties-box" columns="3" /> - </vbox> - </min-size> - </hbox> - <hfixedline cnt:expand="false" /> - <vbox cnt:expand="false"> - <fixedtext label="Create widgets:" cnt:expand="false" /> - <flow id="create-widget" homogeneous="true" spacing="2" /> - <fixedtext label="Create containers:" cnt:expand="false" /> - <flow id="create-container" homogeneous="true" spacing="2" /> - </vbox> - <hbox cnt:expand="false"> - <vbox><fixedline /><fixedline /><fixedline /><fixedline /></vbox> -<!-- <pushbutton id="import-button" label="Import..." cnt:expand="false"/>--> - <pushbutton id="export-button" label="Export (stdout)" cnt:expand="false"/> - </hbox> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/empty.xml b/toolkit/workben/layout/empty.xml deleted file mode 100644 index a8408e55719e..000000000000 --- a/toolkit/workben/layout/empty.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated xml files are generated from this template by - transex3/layout/tralay. !--> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Empty Test" optimumsize="true" has_border="true" sizeable="true" moveable="true"> - <vbox spacing="1" border="10"> - <min-size min-width="200"/> - <fixedline height="1"/> - <vbox spacing="10"> - <vbox show="false"/> - <vbox show="false"/> - <vbox show="false"/> - <vbox show="false"/> - <vbox show="false"/> - <vbox show="false"/> - <vbox show="false"/> - <vbox show="false"/> - <vbox show="false"/> - <vbox show="false"/> - </vbox> - <fixedline height="1"/> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/flow-container.xml b/toolkit/workben/layout/flow-container.xml deleted file mode 100644 index 3d48b1683216..000000000000 --- a/toolkit/workben/layout/flow-container.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Interactable Containers" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox> - <table columns="3" cnt:title="Page 1"> - <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" /> - <pushbutton cnt:y-expand="false" label="1,2" /> - <pushbutton cnt:y-expand="false" label="1,3" /> - <pushbutton cnt:col-span="2" label="2,1" /> - </table> - <flow> - <pushbutton label="label" /> - <pushbutton label="label" /> - <pushbutton label="label" /> - <table columns="3" cnt:title="Page 1"> - <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" /> - <pushbutton cnt:y-expand="false" label="1,2" /> - <pushbutton cnt:y-expand="false" label="1,3" /> - <pushbutton cnt:col-span="2" label="2,1" /> - </table> - <pushbutton label="label" /> - <pushbutton label="label" /> - <pushbutton label="label" /> - <pushbutton label="label" /> - <pushbutton label="label" /> - </flow> - <hbox cnt:expand="false"> - <align> - <okbutton cnt:hfill="0" cnt:halign="0" /> - </align> - <align> - <okbutton cnt:hfill="0" cnt:halign="0.3" /> - </align> - <align> - <okbutton cnt:hfill="0" cnt:halign="0.5" /> - </align> - <align> - <okbutton cnt:hfill="0" cnt:halign="0.7" /> - </align> - <align> - <okbutton cnt:hfill="0" cnt:halign="1" /> - </align> - </hbox> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/flow.xml b/toolkit/workben/layout/flow.xml deleted file mode 100644 index 03e879bb13c1..000000000000 --- a/toolkit/workben/layout/flow.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Flowing" optimumsize="true" has_border="true" sizeable="true" moveable="true"> - <vbox spacing="5"> - <flow> - <pushbutton label="Button 1" /> - <pushbutton label="Button 2" /> - <pushbutton label="Button 3" /> - <pushbutton label="Button 4" /> - <pushbutton label="Button 5" /> - <pushbutton label="Button 6" /> - <pushbutton label="Button 7" /> - </flow> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/insert-sheet.xml b/toolkit/workben/layout/insert-sheet.xml deleted file mode 100644 index 2350da9aec77..000000000000 --- a/toolkit/workben/layout/insert-sheet.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated XML files are generated from this template by - transex3/layout/tralay. !--> - -<modaldialog sizeable="true" closeable="true" moveable="true" output-size="true" id="RID_SCDLG_INSERT_TABLE" sv-look="true" _title="Insert Sheet" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> - <vbox spacing="5" border="5"> - <fixedline id="FL_POSITION" _text="Position"/> - <hbox> - <vbox cnt:padding="13" spacing="5"> - <radiobutton radiogroup="insert-sheet-position" id="RB_BEFORE" tabstop="true" _label="B~efore current sheet"/> - <radiobutton radiogroup="insert-sheet-position" id="RB_BEHIND" tabstop="true" _label="~After current sheet"/> - </vbox> - </hbox> - <fixedline id="FL_TABLE" _text="Sheet"/> - <hbox> - <vbox cnt:padding="13" spacing="5"> - <radiobutton radiogroup="insert-sheet-source" id="RB_NEW" _label="~New sheet"/> - <hbox> - <vbox cnt:padding="13" spacing="5" cnt:fill="false" cnt:expand="false"> - <fixedtext id="FT_COUNT" _label="N~o. of sheets"/> - <fixedtext id="FT_NAME" _label="Na~me"/> - </vbox> - <vbox> - <hbox> - <numericfield has_border="true" maximum="256" minimum="1" repeat="true" id="NF_COUNT" spin="true" spin-size="1" tabstop="true" value="1" cnt:fill="true" cnt:expand="false"/> - </hbox> - <edit has_border="true" id="ED_TABNAME" cnt:fill="true" cnt:expand="true"/> - </vbox> - </hbox> - </vbox> - </hbox> - <hbox> - <vbox cnt:padding="13" spacing="5"> - <radiobutton radiogroup="insert-sheet-source" id="RB_FROMFILE" _label="~From file"/> - <hbox> - <vbox cnt:padding="13" spacing="5"> - <hbox> - <multilistbox auto-hscroll="true" has_border="true" id="LB_TABLES" simple-mode="true" string-item-list=" : : : : " cnt:fill="true" cnt:expand="true"/> - <vbox cnt:fill="false" cnt:expand="false" spacing="5"> - <pushbutton id="BTN_BROWSE" _label="~Browse..." cnt:expand="false"/> - <checkbox id="CB_LINK" _label="Lin~k" cnt:expand="false"/> - <flow/> - </vbox> - </hbox> - <fixedtext id="FT_PATH" label="FT-PATH"/> - </vbox> - </hbox> - </vbox> - </hbox> - <dialogbuttonhbox border="5" spacing="5"> - <okbutton defbutton="true" id="BTN_OK"/> - <cancelbutton id="BTN_CANCEL"/> - <helpbutton id="BTN_HELP"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/interactable-containers.xml b/toolkit/workben/layout/interactable-containers.xml deleted file mode 100644 index afb663951d6c..000000000000 --- a/toolkit/workben/layout/interactable-containers.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Interactable Containers" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <hsplitter> - <scroller> - <vbox> - <pushbutton label="Some Label" /> - <edit has_border="true" text="Some Text" /> - <listbox has_border="true" string-item-list="Item One:Item Two:Item Three:Item Four:Item Five:Item Six:Item Seven" /> - <combobox has_border="true" string-item-list="Item One:Item Two:Item Three" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - <pushbutton label="Some Label" /> - </vbox> - </scroller> - <vsplitter> - <pushbutton label="Corner" /> - <tabcontrol> - <table columns="3" cnt:title="Page 1"> - <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" /> - <pushbutton cnt:y-expand="false" label="1,2" /> - <pushbutton cnt:y-expand="false" label="1,3" /> - <pushbutton cnt:col-span="2" label="2,1" /> - </table> - <vbox cnt:title="Page 2"> - <pushbutton label="1" /> - <pushbutton label="2" /> - <pushbutton label="3" /> - <pushbutton label="4" /> - </vbox> - <pushbutton label="Content 3" cnt:title="Page 3" /> - <pushbutton label="Content 4" cnt:title="Page 4" /> - <pushbutton label="Content 5" cnt:title="Page 5" /> - </tabcontrol> - </vsplitter> - </hsplitter> -</dialog> diff --git a/toolkit/workben/layout/layout-flat.xml b/toolkit/workben/layout/layout-flat.xml deleted file mode 100644 index 0d3b969020fb..000000000000 --- a/toolkit/workben/layout/layout-flat.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<framewindow xmlns="http://openoffice.org/2007/layout" - id="window1" title="Test-Dialog" optimumsize="true" - has_border="true" sizeable="true" moveable="true" - width="800" height="300"> - <pushbutton label="XML Left" toggle="true" show="true" - x="10" y="10" width="400" height="200"/> - <pushbutton label="XML Right" toggle="true" show="true" - x="420" y="10" width="400" height="200"/> - <checkbox label="XML cool ?" enabled="true" show="true" - state="1" tristate="true" align="1" - x="10" y="210" width="800" height="100"/> -</framewindow>
\ No newline at end of file diff --git a/toolkit/workben/layout/layout.xml b/toolkit/workben/layout/layout.xml deleted file mode 100644 index 4d9e71bbc5b9..000000000000 --- a/toolkit/workben/layout/layout.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="window1" title="Test-Dialog" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <hbox border="20" spacing="10" homogeneous="true"> - <pushbutton label="XML Left" - cnt:expand="true" cnt:fill="true" /> - <pushbutton label="XML Center" - cnt:expand="true" cnt:fill="false" /> - <pushbutton label="XML Right" - cnt:expand="false" cnt:fill="false" /> - </hbox> -</dialog> diff --git a/toolkit/workben/layout/message-box.xml b/toolkit/workben/layout/message-box.xml deleted file mode 100644 index 2bd19bbb42fb..000000000000 --- a/toolkit/workben/layout/message-box.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated xml files are generated from this template by - transex3/layout/tralay. !--> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="message-box" _title="" optimumsize="true" - has_border="true" sizeable="true" moveable="true" closeable="true"> - <vbox border="5" spacing="5"> - <hbox border="5" spacing="20"> - <align cnt:expand="false" cnt:fill="true"> - <fixedimage id="FI_ERROR" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="cmd/msgbox-error.png" /> - </align> - <align cnt:expand="false" cnt:fill="true"> - <fixedimage id="FI_INFO" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="cmd/msgbox-info.png" /> - </align> - <align cnt:expand="false" cnt:fill="true"> - <fixedimage id="FI_QUERY" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="cmd/msgbox-query.png" /> - </align> - <align cnt:expand="false" cnt:fill="true"> - <fixedimage id="FI_WARNING" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="cmd/msgbox-warning.png" /> - </align> - <align cnt:expand="false" cnt:fill="true"> - <fixedtext id="FT_MESSAGE" _label="FT-LABEL" cnt:v-align="0.5" cnt:v-fill="0" /> - </align> - <flow/> - </hbox> - <dialogbuttonhbox border="0" spacing="5"> - <flow/> - <!-- deprecoted vcl/MsgBox compatibility !--> - <retrybutton id="BTN_RETRY" /> - <ignorebutton id="BTN_IGNORE" /> - - <yesbutton id="BTN_YES"/> - <cancelbutton id="BTN_CANCEL"/> - <helpbutton id="BTN_HELP"/> - <nobutton id="BTN_NO" xlabel="~Alternate"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/more.xml b/toolkit/workben/layout/more.xml deleted file mode 100644 index 79e9c8214356..000000000000 --- a/toolkit/workben/layout/more.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="RID_SVXDLG_MORE" _title="Test More" optimumsize="true" - help-id="SID_ATTR_RESTORE" - has_border="true" sizeable="true" moveable="true"> - <vbox spacing="5" border="5" width="640"> - <fixedtext id="FT_ONE" _label="One"/> - <fixedtext id="FT_TWO" _label="Two"/> - <hbox border="5"> - <flow/> - <morebutton id="PB_MORE" cnt:expand="false" _label="More..."/> - </hbox> - <fixedtext id="FT_THREE" _label="Three"/> - <fixedtext id="FT_FOUR" _label="Four"/> - </vbox> -</modaldialog> - diff --git a/toolkit/workben/layout/move-copy-sheet.xml b/toolkit/workben/layout/move-copy-sheet.xml deleted file mode 100644 index 3d26db1aa73d..000000000000 --- a/toolkit/workben/layout/move-copy-sheet.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated XML files are generated from this template by - transex3/layout/tralay. !--> - -<modaldialog sizeable="true" closeable="true" help-id="FID_TAB_MOVE" moveable="true" output-size="true" id="RID_SCDLG_MOVETAB" sv-look="true" _title="Move/Copy Sheet" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> - <vbox spacing="5" border="5"> - <string id="STR_NEWDOC" _text="- new document -"/> - <fixedtext id="FT_DEST" _label="To ~document"/> - <listbox has_border="true" dropdown="true" id="LB_DEST" tabstop="true"/> - <fixedtext id="FT_INSERT" _label="~Insert before"/> - <listbox has_border="true" id="LB_INSERT" tabstop="true" string-item-list=" : : : : " /> - <checkbox id="BTN_COPY" tabstop="true" _label="~Copy"/> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <cancelbutton id="BTN_CANCEL" tabstop="true"/> - <helpbutton id="BTN_HELP" tabstop="true"/> - <okbutton defbutton="true" id="BTN_OK" tabstop="true"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/non-interactable-containers.xml b/toolkit/workben/layout/non-interactable-containers.xml deleted file mode 100644 index 29b37b6a7a49..000000000000 --- a/toolkit/workben/layout/non-interactable-containers.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Interactable Containers" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox spacing="10"> - <table columns="3" cnt:title="Page 1"> - <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" /> - <pushbutton cnt:y-expand="false" label="1,2" /> - <pushbutton cnt:y-expand="false" label="1,3" /> - <pushbutton cnt:col-span="2" label="2,1" /> - </table> - <hfixedline/> - <flow cnt:expand="false"> - <pushbutton label="label" /> - <pushbutton label="label" /> - <pushbutton label="label" /> - <table columns="3" cnt:title="Page 1"> - <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" /> - <pushbutton cnt:y-expand="false" label="1,2" /> - <pushbutton cnt:y-expand="false" label="1,3" /> - <pushbutton cnt:col-span="2" label="2,1" /> - </table> - <pushbutton label="label" /> - <pushbutton label="label" /> - <pushbutton label="label" /> - <pushbutton label="label" /> - <pushbutton label="label" /> - </flow> - <hfixedline/> - <hbox cnt:expand="false"> -<!-- <align> - <okbutton cnt:hfill="0.2" cnt:halign="0.2" /> - </align> - <align> - <okbutton cnt:hfill="0.8" cnt:halign="0.2" /> - </align>--> - </hbox> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/number-format.xml b/toolkit/workben/layout/number-format.xml deleted file mode 100644 index 77460ea79ceb..000000000000 --- a/toolkit/workben/layout/number-format.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated XML files are generated from this template by - transex3/layout/tralay. !--> - -<tabpage help-id="HID_NUMBERFORMAT" show="false" id="RID_SVXPAGE_NUMBERFORMAT" _title="Number Format" _text="Number Format" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container" sizeable="true"> - <!-- - <imagelist prefix="nu" id="IL_ICON"> - <maskcolor blue="0xFFFF" green="0x0000" red="0xFFFF" type="Color"/> - <idlist none="IID_INFO"/> - <idcount none="3"/> - </imagelist> - !--> - <vbox spacing="5" border="5"> - <string id="STR_EUROPE" _text="Europe"/> - <string id="STR_AUTO_ENTRY" _text="Automatic"/> - <hbox spacing="5"> - <vbox spacing="5" cnt:fill="true" cnt:expand="true"> - <fixedtext id="FT_CATEGORY" _label="~Category"/> - <listbox line-count="8" auto-hscroll="true" has_border="true" id="LB_CATEGORY" _string-item-list="All:User-defined:Number:Percent:Currency:Date:Time:Scientific:Fraction:Boolean Value:Text"/> - <flow/> - </vbox> - <vbox spacing="5" cnt:fill="true" cnt:expand="true"> - <fixedtext id="FT_FORMAT" _label="F~ormat"/> - <listbox has_border="true" line-count="7" dropdown="true" id="LB_CURRENCY" tabstop="true" _string-item-list="Automatically" cnt:expand="false" cnt:fill="false"/> - <svxfontlistbox line-count="7" dropdown="false" has_border="true" help-id="HID_NUMBERFORMAT_LB_FORMAT" id="LB_FORMAT" tabstop="true" string-item-list=" : : : : : : : : : : : : : : : "/> - </vbox> - <vbox spacing="5" cnt:fill="true" cnt:expand="true"> - <fixedtext id="FT_LANGUAGE" _label="~Language" cnt:expand="false" cnt:fill="false"/> - <svxlanguagebox has_border="true" dropdown="true" id="LB_LANGUAGE" sort="true" string-item-list="Dutch:" cnt:expand="false" cnt:fill="false"/> - <checkbox id="CB_SOURCEFORMAT" show="false" _label="So~urce format" cnt:expand="false" cnt:fill="false"/> - <flow cnt:expand="true" cnt:fill="true"/> - <window has_border="true" help-id="HID_NUMBERFORMAT_WND_NUMBER_PREVIEW" id="WND_NUMBER_PREVIEW" sv-look="true"/> - </vbox> - </hbox> - <fixedline id="FL_OPTIONS" _text="Options"/> - <hbox> - <vbox cnt:padding="13" spacing="5"> - <hbox spacing="5"> - <vbox spacing="5" cnt:fill="false" cnt:expand="false"> - <fixedtext id="FT_DECIMALS" _label="~Decimal places"/> - <fixedtext id="FT_LEADZEROES" _label="Leading ~zeroes"/> - </vbox> - <vbox spacing="5" cnt:fill="false" cnt:expand="false"> - <numericfield has_border="true" first="0" last="15" minimum="0" value="2" maximum="20" repeat="true" id="ED_DECIMALS" spin="true" spin-size="1" strict-format="true" cnt:expand="false"/> - <numericfield has_border="true" first="0" last="15" minimum="0" value="1" maximum="20" repeat="true" id="ED_LEADZEROES" spin="true" spin-size="1" strict-format="true" cnt:fill="false"/> - </vbox> - <vbox spacing="5" cnt:fill="false" cnt:expand="false"> - <checkbox id="BTN_NEGRED" _label="~Negative numbers red"/> - <checkbox id="BTN_THOUSAND" _label="~Thousands separator"/> - </vbox> - </hbox> - </vbox> - </hbox> - <fixedtext id="FT_EDFORMAT" _label="~Format code"/> - <hbox spacing="5" cnt:expand="false"> - <edit has_border="true" id="ED_FORMAT"/> - <imagebutton cnt:expand="false" cnt:fill="false" help-id="HID_NUMBERFORMAT_TBI_ADD" quick-help-text="Add" id="IB_ADD" sv-look="true" graphic="svx/res/nu01.png"/> - <imagebutton cnt:expand="false" help-id="HID_NUMBERFORMAT_TBI_INFO" quick-help-text="Edit Comment" id="IB_INFO" sv-look="true" graphic="svx/res/nu03.png"/> - <imagebutton cnt:expand="false" help-id="HID_NUMBERFORMAT_TBI_REMOVE" quick-help-text="Remove" id="IB_REMOVE" sv-look="true" graphic="svx/res/nu02.png"/> - </hbox> - <fixedtext no-label="true" show="false" id="FT_COMMENT" word-break="true" cnt:expand="false"/> - <edit has_border="true" show="false" id="ED_COMMENT" cnt:expand="false"/> - </vbox> -</tabpage> diff --git a/toolkit/workben/layout/numeric.xml b/toolkit/workben/layout/numeric.xml deleted file mode 100644 index becab18cdf9b..000000000000 --- a/toolkit/workben/layout/numeric.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<framewindow xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="window1" title="Test-Dialog" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox> - <numericfield text="5" spin="true" enforce-format="false" value-min="5.3" value-max="17.8"/> - <pushbutton /> - </vbox> -</framewindow> diff --git a/toolkit/workben/layout/ooo-patch b/toolkit/workben/layout/ooo-patch deleted file mode 100644 index 89fc58db8748..000000000000 --- a/toolkit/workben/layout/ooo-patch +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh -commit=${1-3249db59} # m5 - -git diff $commit layout | sed 's@^\([+-]\{3\}\) \(a\|b\)/@\1 @' > layout-dialogs-layout.diff -git diff $commit config_office scp2 | sed 's@^\([+-]\{3\}\) \(a\|b\)/@\1 @' > layout-dialogs-config_office-scp2.diff -git diff $commit svx sw | sed 's@^\([+-]\{3\}\) \(a\|b\)/@\1 @' > layout-dialogs-svx-sw.diff -git diff $commit transex3 | sed 's@^\([+-]\{3\}\) \(a\|b\)/@\1 @' > layout-dialogs-transex3.diff diff --git a/toolkit/workben/layout/paragraph.xml b/toolkit/workben/layout/paragraph.xml deleted file mode 100644 index 847e04ec0568..000000000000 --- a/toolkit/workben/layout/paragraph.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Paragraph" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> -<vbox> - <tabcontrol> - <vbox cnt:title="Indents and Spacing"> - <hbox cnt:expand="false"> - <fixedtext id="FL_INDENT" label="Indent" cnt:expand="false" /> - <fixedline /> - </hbox> - <table columns="2" cnt:expand="false"> - <fixedtext id="FT_LEFTINDENT" label="Before text" /> - <metricfield id="ED_LEFTINDENT" spin="true" has_border="true"/> - <fixedtext id="FT_RIGHTINDENT" label="After text" /> - <metricfield id="ED_RIGHTINDENT" spin="true" has_border="true"/> - <fixedtext id="FT_FLINEINDENT" label="First line" /> - <metricfield id="ED_FLINEINDENT" spin="true" has_border="true" /> - <checkbox id="CB_AUTO" label="Automatic" cnt:col-span="2" /> - </table> - <hbox cnt:expand="false"> - <fixedtext id="FL_DIST" label="Spacing" cnt:expand="false" /> - <fixedline /> - </hbox> - <table columns="2" cnt:expand="false"> - <fixedtext id="FT_TOPDIST" label="Above paragraph" /> - <numericfield id="ED_TOPDIST" spin="true" has_border="true" /> - <fixedtext id="FT_BOTTOMDIST" label="Below paragraph" /> - <numericfield id="ED_BOTTOMDIST" spin="true" has_border="true" /> - </table> - <hbox cnt:expand="false"> - <fixedtext id="FL_LINEDIST" label="Line spacing" cnt:expand="false" /> - <fixedline /> - </hbox> - <hbox cnt:expand="false"> - <listbox id="LB_LINEDIST" dropdown="true" - string-item-list="Single:1.5 lines:Double:Proportional" - cnt:expand="false"/> - <fixedtext id="FT_LINEDIST" label="of" cnt:expand="true" /> - <numericfield id="ED_LINEDISTPERCENT" value="0" /> - </hbox> - <hbox id="FL_REGISTER" cnt:expand="false"> - <fixedtext label="Register-true" cnt:expand="false" /> - <fixedline /> - </hbox> - <checkbox id="CB_REGISTER" cnt:expand="false" label="Activate" /> - </vbox> - - <vbox cnt:title="Alignment"> - <hbox cnt:expand="false"> - <fixedtext id="FL_ALIGN" label="Options" cnt:expand="false" /> - <fixedline /> - </hbox> - <radiobutton id="BTN_LEFTALIGN" label="Left" cnt:expand="false" /> - <radiobutton id="BTN_RIGHTALIGN" label="Right" cnt:expand="false" /> - <radiobutton id="BTN_CENTERALIGN" label="Center" cnt:expand="false" /> - <radiobutton id="BTN_JUSTIFYALIGN" label="Justify" cnt:expand="false" /> - <hbox cnt:expand="false"> - <fixedtext id="FL_ALIGN" label="Last line" cnt:expand="false" /> - <listbox dropdown="true" string-item-list="Left:Centered:Justified" - id="LB_LASTLINE" /> - </hbox> - </vbox> - </tabcontrol> - - <align cnt:expand="false"> - <hbox cnt:expand="false" cnt:hfill="0" cnt:halign="1"> - <pushbutton label="OK" /> - <pushbutton label="Cancel" /> - <pushbutton label="Help" /> - <pushbutton label="Reset" /> - </hbox> - </align> -</vbox> -</dialog> diff --git a/toolkit/workben/layout/plugin.cxx b/toolkit/workben/layout/plugin.cxx deleted file mode 100644 index 65af2e510021..000000000000 --- a/toolkit/workben/layout/plugin.cxx +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define _LAYOUT_PLUGIN_CXX - -#include "plugin.hxx" - -#include <com/sun/star/awt/XDialog2.hpp> -#include <dialcontrol.hxx> -#include <toolkit/awt/vclxwindow.hxx> - -#include <layout/layout-pre.hxx> - -using namespace com::sun::star; - -#define LAYOUT_RES(x) #x - -#undef ModalDialog -#define ModalDialog( parent, id ) Dialog( parent, "plugin.xml", id ) - -PluginDialog::PluginDialog( Window* pParent ) - : ModalDialog( pParent, LAYOUT_RES( RID_DLG_PLUGIN ) ) - , aHeaderImage( this, LAYOUT_RES( FI_HEADER ) ) - , aHeaderText( this, LAYOUT_RES( FT_HEADER ) ) - , aHeaderLine( this, LAYOUT_RES( FL_HEADER ) ) - , aPlugin( this, LAYOUT_RES( PL_DIAL ), -// FIXME: width=, height=, are not recognized as properties. -// new svx::DialControl( LAYOUT_DIALOG_PARENT, Size( 0, 0 ), 0 ) ) - new svx::DialControl( LAYOUT_DIALOG_PARENT, Size( 80, 80 ), 0 ) ) - //, aDialControl( static_cast<svx::DialControl&> ( aPlugin.GetPlugin() ) ) - , aDialControl( static_cast<svx::DialControl&> ( *aPlugin.mpPlugin ) ) - , aOKBtn( this, LAYOUT_RES( BTN_OK ) ) - , aCancelBtn( this, LAYOUT_RES( BTN_CANCEL ) ) - , aHelpBtn( this, LAYOUT_RES( BTN_HELP ) ) -{ - aDialControl.SetRotation( 425 ); -} - -PluginDialog::~PluginDialog() -{ -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/plugin.xml b/toolkit/workben/layout/plugin.xml deleted file mode 100644 index 5303e3a2329e..000000000000 --- a/toolkit/workben/layout/plugin.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated xml files are generated from this template by - transex3/layout/tralay. !--> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="RID_DLG_PLUGIN" _title="Plugin Test" optimumsize="true" - help-id="SID_ATTR_PLUGIN" - has_border="true" sizeable="true" moveable="true"> - <vbox spacing="5" border="5"> - <hbox spacing="5" cnt:expand="false"> - <fixedimage id="FI_HEADER" cnt:expand="false" graphic="cmd/sc_apply.png" /> - <fixedtext id="FT_HEADER" _label="Plugin Test"/> - </hbox> - <fixedline id="FL_HEADER"/> - <hbox> - <flow cnt:padding="80"/> - <plugin id="PL_DIAL" width="80" height="80"/> - </hbox> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <okbutton defbutton="true" id="BTN_OK"/> - <cancelbutton id="BTN_CANCEL" /> - <helpbutton id="BTN_HELP"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> - diff --git a/toolkit/workben/layout/radio-groups.xml b/toolkit/workben/layout/radio-groups.xml deleted file mode 100644 index 43a1372297ee..000000000000 --- a/toolkit/workben/layout/radio-groups.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Radio Groups Test" - optimumsize="true" has_border="true" sizeable="true" moveable="true"> - <vbox> - <hbox> - <radiobutton group="1" label="Group 1" - cnt:expand="false" cnt:fill="false" /> - <radiobutton group="2" label="Group 2" - cnt:expand="true" cnt:fill="true" /> - <radiobutton group="2" label="Group 2" - cnt:expand="true" cnt:fill="false" /> - <radiobutton group="1" label="Group 1 (default)" state="1" - cnt:expand="false" cnt:fill="false" /> - </hbox> - <radiobutton group="1" label="Group 1" state="0" - cnt:expand="false" cnt:fill="false" /> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/recover.cxx b/toolkit/workben/layout/recover.cxx deleted file mode 100644 index c776ec0bd8d2..000000000000 --- a/toolkit/workben/layout/recover.cxx +++ /dev/null @@ -1,113 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifdef SVX_DLLIMPLEMENTATION -#undef SVX_DLLIMPLEMENTATION -#endif - -#if TEST_LAYOUT -#include <cstdio> -#endif /* TEST_LAYOUT */ -#include <com/sun/star/awt/XDialog2.hpp> -#include <tools/shl.hxx> -#include <svtools/itemset.hxx> -#include <svtools/itempool.hxx> -#include <sfx2/objsh.hxx> -#include <vcl/msgbox.hxx> -#include <toolkit/awt/vclxwindow.hxx> - - -#include <com/sun/star/awt/PosSize.hpp> //redrawAlready - -using namespace com::sun::star; - -#define _SVX_RECOVER_CXX - -#include "recover.hxx" - -#include <layout/layout-pre.hxx> - -#if ENABLE_LAYOUT -#undef SVX_RES -#define SVX_RES(x) #x -#undef SfxModalDialog -#define SfxModalDialog( parent, id ) Dialog( parent, "recover.xml", id ) -#endif /* ENABLE_LAYOUT */ - -#if TEST_LAYOUT -SvxRecoverDialog::SvxRecoverDialog( Window* pParent ) -#else /* !TEST_LAYOUT */ -SvxRecoverDialog::SvxRecoverDialog( Window* pParent, const SfxItemSet& rCoreSet ) -#endif /* !TEST_LAYOUT */ -: SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_RECOVER ) ) - - , aHeaderImage( this, SVX_RES( FI_HEADER ) ) - , aHeaderText( this, SVX_RES( FT_HEADER ) ) - , aHeaderLine( this, SVX_RES( FL_HEADER ) ) - , aRecoverText( this, SVX_RES( FT_RECOVER ) ) - , aTextAdvanced( this, SVX_RES( FT_ADVANCED ) ) - - , aCheckBoxDoc( this, SVX_RES( CB_DOC ) ) - , aImageDoc( this, SVX_RES( FI_DOC ) ) - , aTextDoc( this, SVX_RES( FT_DOC ) ) - - , aCheckBoxSheet( this, SVX_RES( CB_SHEET ) ) - , aImageSheet( this, SVX_RES( FI_SHEET ) ) - , aTextSheet( this, SVX_RES( FT_SHEET ) ) - - , aCheckBoxDraw( this, SVX_RES( CB_DRAW ) ) - , aImageDraw( this, SVX_RES( FI_DRAW ) ) - , aTextDraw( this, SVX_RES( FT_DRAW ) ) - - , aCheckBoxPresent( this, SVX_RES( CB_PRESENT ) ) - , aImagePresent( this, SVX_RES( FI_PRESENT ) ) - , aTextPresent( this, SVX_RES( FT_PRESENT ) ) - - , aButtonAdvanced( this, SVX_RES( PB_ADVANCED ) ) - - , aProgressText( this, SVX_RES( FT_PROGRESS ) ) - , aProgressBar( this, SVX_RES( PB_RECOVER ) ) - , aCheckBoxLogFile( this, SVX_RES( CH_LOGFILE ) ) - , aOKBtn( this, SVX_RES( BTN_OK ) ) - , aCancelBtn( this, SVX_RES( BTN_CANCEL ) ) - , aHelpBtn( this, SVX_RES( BTN_HELP ) ) -{ - aButtonAdvanced.AddAdvanced( &aTextAdvanced ); - aButtonAdvanced.AddAdvanced( &aCheckBoxDoc ); - aButtonAdvanced.AddAdvanced( &aCheckBoxSheet ); - aButtonAdvanced.AddAdvanced( &aCheckBoxDraw ); - aButtonAdvanced.AddAdvanced( &aCheckBoxPresent ); - aButtonAdvanced.AddAdvanced( &aCheckBoxLogFile ); -} - - -SvxRecoverDialog::~SvxRecoverDialog() -{ -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/recover.hxx b/toolkit/workben/layout/recover.hxx deleted file mode 100644 index de3a63c84510..000000000000 --- a/toolkit/workben/layout/recover.hxx +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_RECOVER_HXX -#define _SVX_RECOVER_HXX - -#include <layout/layout.hxx> -#include <vcl/button.hxx> -#include <vcl/field.hxx> -#include <vcl/fixed.hxx> -#include <layout/core/box.hxx> -#include <layout/layout-pre.hxx> - -class SvxRecoverDialog : public SfxModalDialog -{ -private: - FixedImage aHeaderImage; - FixedText aHeaderText; - FixedLine aHeaderLine; - FixedText aRecoverText; - FixedText aTextAdvanced; - - CheckBox aCheckBoxDoc; - FixedImage aImageDoc; - FixedText aTextDoc; - CheckBox aCheckBoxSheet; - FixedImage aImageSheet; - FixedText aTextSheet; - CheckBox aCheckBoxDraw; - FixedImage aImageDraw; - FixedText aTextDraw; - CheckBox aCheckBoxPresent; - FixedImage aImagePresent; - FixedText aTextPresent; - AdvancedButton aButtonAdvanced; - - FixedText aProgressText; - ProgressBar aProgressBar; - CheckBox aCheckBoxLogFile; - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - -public: -#if TEST_LAYOUT - SvxRecoverDialog( Window* pParent ); -#else /* !TEST_LAYOUT */ - SvxRecoverDialog( Window* pParent, const SfxItemSet& rCoreSet ); -#endif /* !TEST_LAYOUT */ - ~SvxRecoverDialog(); -}; - -#include <layout/layout-post.hxx> - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/recover.xml b/toolkit/workben/layout/recover.xml deleted file mode 100644 index 790a6b694658..000000000000 --- a/toolkit/workben/layout/recover.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated xml files are generated from this template by - transex3/layout/tralay. !--> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="RID_SVXDLG_RECOVER" _title="OpenOffice.org Document Restore -- questions to sigi(at)novell.com--" optimumsize="true" - help-id="SID_ATTR_RESTORE" - has_border="true" sizeable="true" moveable="true"> - <vbox spacing="5" border="5" width="640"> - <hbox spacing="5" cnt:expand="false"> - <fixedimage id="FI_HEADER" cnt:expand="false" graphic="cmd/sc_apply.png" /> - <fixedtext id="FT_HEADER" _label="OpenOffice.org Document Restore"/> - </hbox> - <fixedline id="FL_HEADER"/> - <!-- mockup: fixedtext multiline=true" does not work? - <multilineedit id="MLE_RECOVER" has_border="false" foobar="x" _text="At least one document was found that was not stored safely to the media. Uncheck any documents you do not want to restore (information may be lost)."/> - <fixedtext id="FT_RECOVER" has_border="false" multi-line="true" font-word-line-mode="true" word-break="true" _label="At least one document was found that was not stored safely to the media. Uncheck any documents you do not want to restore (information may be lost). -LINE TEST"/> - !--> - <fixedtext id="FT_RECOVER" has_border="false" multi-line="true" font-word-line-mode="true" _label="At least one document was not stored safely and must be recovered."/> - <fixedtext id="FT_ADVANCED" has_border="false" multi-line="true" font-word-line-mode="true" word-break="true" _label="Uncheck any documents you do not want to restore (information may be lost)."/> - <vbox cnt:fill="true" cnt:expand="true" cnt:padding="20" border="20" spacing="20"> - <hbox> - <checkbox id="CB_DOC" state="1" cnt:expand="false" scale="false"/> - <fixedimage id="FI_DOC" cnt:v-align="0.5" image-align="0.5" cnt:expand="false" scale="false" graphic="cmd/lc_insertdoc.png"/> - <fixedtext id="FT_DOC" _label="My document"/> - </hbox> - <hbox> - <checkbox id="CB_SHEET" state="1" cnt:expand="false" scale="false" /> - <fixedimage id="FI_SHEET" cnt:expand="false" scale="false" graphic="cmd/lc_inserttable.png" /> - <fixedtext id="FT_SHEET" _label="My spreadsheet"/> - </hbox> - <hbox> - <checkbox id="CB_DRAW" state="1" cnt:expand="false" scale="false"/> - <fixedimage id="FI_DRAW" cnt:expand="false" scale="false" graphic="cmd/lc_insertdraw.png" /> - <fixedtext id="FT_DRAW" _label="My drawing"/> - </hbox> - <hbox> - <checkbox id="CB_PRESENT" state="1" cnt:expand="false" scale="false" /> - <fixedimage id="FI_PRESENT" cnt:expand="false" scale="false" graphic="cmd/lc_insertvideo.png" /> - <fixedtext id="FT_PRESENT" _label="My presentation"/> - </hbox> - <hbox border="5"> - <flow/> - <advancedbutton id="PB_ADVANCED" cnt:expand="false" _label="Advanced..."/> - </hbox> - </vbox> - <vbox> - <fixedtext id="FT_PROGRESS" _label="Restore progress (idle)"/> - <hbox height="40" cnt:expand="true"> - <progressbar cnt:expand="true" cnt:fill="true" id="PB_RECOVER" has_border="true" border="10" fill-color="#ccccff" background-color="#ffffff" progress-value-min="0" progress-value-max="100" progress-value="50" /> - <!-- FIXME: cannot set progress bar's height, use space as strut... !--> - <fixedtext label="" height="10" cnt:expand="false" cnt:fill="false"/> - </hbox> - </vbox> - <checkbox id="CH_LOGFILE" _label="Open additional text document to display the restore logfile"/> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <okbutton defbutton="true" id="BTN_OK" _label="Restore"/> - <cancelbutton id="BTN_CANCEL" /> - <helpbutton id="BTN_HELP"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> - diff --git a/toolkit/workben/layout/refresh b/toolkit/workben/layout/refresh deleted file mode 100644 index 796999549c36..000000000000 --- a/toolkit/workben/layout/refresh +++ /dev/null @@ -1,7 +0,0 @@ -echo "source me ..." -test -n "${INPATH}" && rm -Rf ../../${INPATH} -build debug=true\ - && cp ../../${INPATH}/lib/*.so ../../../solver/300/${INPATH}/lib \ - && cp -f ../..$INPATH/lib/libtkx.so $OOO_INSTALL_PREFIX/openoffice.org/basis3.0/program \ - && dmake debug=true \ - && ../../${INPATH}/bin/test "$@" diff --git a/toolkit/workben/layout/run-s2x b/toolkit/workben/layout/run-s2x deleted file mode 100644 index 926addf49047..000000000000 --- a/toolkit/workben/layout/run-s2x +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/sh - -SRC=${1-../../svx/source/dialog/zoom.src} -SRC=${1-../../sw/source/ui/dialog/wordcountdialog.src} - -../src2xml/source/src2xml.py --ignore-includes --post-process --output-dir=. $SRC diff --git a/toolkit/workben/layout/scroller.xml b/toolkit/workben/layout/scroller.xml deleted file mode 100644 index 44e63d15df5e..000000000000 --- a/toolkit/workben/layout/scroller.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Scroll Test" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox> - <scroller> - <vbox> - <pushbutton label="Button 1" /> - <edit has_border="true" text="Edit 1" /> - <pushbutton label="Button 2" /> - <pushbutton label="Button 3" /> - <pushbutton label="Button 4" /> - <pushbutton label="Button 5" /> - <pushbutton label="Button 6" /> - <pushbutton label="Button 7" /> - <pushbutton label="Button 8" /> - <pushbutton label="Button 9" /> - <pushbutton label="Button 10" /> - <pushbutton label="Button 11" /> - <pushbutton label="Button 12" /> - <pushbutton label="Button 13" /> - <pushbutton label="Button 14" /> - <pushbutton label="Button 15" /> - <pushbutton label="Button 16" /> - <pushbutton label="Button 17" /> - </vbox> - </scroller> - <okbutton cnt:expand="false" /> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/sequence.xml b/toolkit/workben/layout/sequence.xml deleted file mode 100644 index e89db54db2dc..000000000000 --- a/toolkit/workben/layout/sequence.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<framewindow xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - xmlns:style="http://openoffice.org/2007/layout/style" - title="Sequence Test" style:optimumsize="true" - style:has_border="true" style:sizeable="true" style:moveable="true"> - <vbox> - <multilistbox linecount="5" string-item-list=":a:b::c:::d::::e:as:" - selected-items="0:1" /> - <okbutton cnt:expand="false" /> - </vbox> -</framewindow> diff --git a/toolkit/workben/layout/shutdown.xml b/toolkit/workben/layout/shutdown.xml deleted file mode 100644 index fbe49e046cb4..000000000000 --- a/toolkit/workben/layout/shutdown.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Shutdown Dialog" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox border="5" spacing="5"> - <fixedline text="Platform default"/> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <okbutton label="~Shutdown"/> - <cancelbutton/> - <pushbutton label="Pause"/> - <pushbutton label="Sleep"/> - <pushbutton label="Restart"/> - </dialogbuttonhbox> - <fixedline text="GNOME"/> - <dialogbuttonhbox border="5" spacing="5" ordering="gnome"> - <flow/> - <okbutton label="~Shutdown"/> - <cancelbutton/> - <pushbutton label="Pause"/> - <pushbutton label="Sleep"/> - <pushbutton label="Restart"/> - </dialogbuttonhbox> - <fixedline text="KDE"/> - <dialogbuttonhbox border="5" spacing="5" ordering="kde"> - <flow/> - <okbutton label="~Shutdown"/> - <cancelbutton/> - <pushbutton label="Pause"/> - <pushbutton label="Sleep"/> - <pushbutton label="Restart"/> - </dialogbuttonhbox> - <fixedline text="MacOS"/> - <dialogbuttonhbox border="5" spacing="5" ordering="macos"> - <flow/> - <okbutton label="~Shutdown"/> - <cancelbutton/> - <pushbutton label="Pause"/> - <pushbutton label="Sleep"/> - <pushbutton label="Restart"/> - </dialogbuttonhbox> - <fixedline text="Windows"/> - <dialogbuttonhbox border="5" spacing="5" ordering="windowsg"> - <flow/> - <okbutton label="~Shutdown"/> - <cancelbutton/> - <pushbutton label="Pause"/> - <pushbutton label="Sleep"/> - <pushbutton label="Restart"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/simple-paragraph.cxx b/toolkit/workben/layout/simple-paragraph.cxx deleted file mode 100644 index 4cd204d107f7..000000000000 --- a/toolkit/workben/layout/simple-paragraph.cxx +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifdef SVX_DLLIMPLEMENTATION -#undef SVX_DLLIMPLEMENTATION -#endif - -#include <toolkit/awt/vclxwindow.hxx> - -// include --------------------------------------------------------------- - -#include <cstdio> -#include <tools/shl.hxx> -#include <sfx2/objsh.hxx> -#include <vcl/msgbox.hxx> - -#include <cstdio> - -namespace SVX { -#include <svx/paraprev.hxx> // Preview -}; - -#include "simple-paragraph.hxx" - -#include <assert.h> - - - - - -// StandardTabPage ---------------------------------------------------------- - -#define FT_LEFTINDENT 10 -#define ED_LEFTINDENT 11 -#define FT_FLINEINDENT 12 -#define ED_FLINEINDENT 13 -#define FT_RIGHTINDENT 14 -#define ED_RIGHTINDENT 15 -#define FL_INDENT 16 - -#define FT_TOPDIST 20 -#define ED_TOPDIST 21 -#define FT_BOTTOMDIST 22 -#define ED_BOTTOMDIST 23 -#define FL_DIST 24 - -#define BTN_LEFTALIGN 30 -#define BTN_RIGHTALIGN 31 -#define BTN_CENTERALIGN 32 -#define BTN_JUSTIFYALIGN 33 -#define FL_ALIGN 34 -#define FL_VERTALIGN 35 -#define LB_VERTALIGN 36 -#define FL_VERTEX 37 -#define CB_SNAP 38 -#define FT_VERTALIGN 39 - - -#define LB_LINEDIST 40 -#define FT_LINEDIST 41 -#define ED_LINEDISTPERCENT 42 -#define ED_LINEDISTMETRIC 43 -#define FL_LINEDIST 44 -#define WN_EXAMPLE 46 - -#define CB_AUTO 48 -#define FT_LASTLINE 49 -#define LB_LASTLINE 50 -#define CB_EXPAND 51 -#define ST_LINEDIST_ABS 52 -#define ST_LEFTALIGN_ASIAN 53 -#define ST_RIGHTALIGN_ASIAN 54 - -// ExtendedTabPage ---------------------------------------------------------- - -#define BTN_HYPHEN 50 -#define ED_HYPHENBEFORE 52 -#define FT_HYPHENBEFORE 53 -#define ED_HYPHENAFTER 55 -#define FT_HYPHENAFTER 56 -#define FL_HYPHEN 57 - -#define BTN_PAGEBREAK 60 -#define FT_BREAKTYPE 61 -#define LB_BREAKTYPE 62 -#define FT_BREAKPOSITION 63 -#define LB_BREAKPOSITION 64 -#define BTN_PAGECOLL 65 -#define LB_PAGECOLL 66 -#define BTN_KEEPTOGETHER 67 -#define BTN_WIDOWS 68 -#define ED_WIDOWS 69 -#define FT_WIDOWS 70 -#define BTN_ORPHANS 71 -#define ED_ORPHANS 72 -#define FT_ORPHANS 73 -#define FL_OPTIONS 74 -#define FT_PAGENUM 75 -#define ED_PAGENUM 76 -#define FL_BREAKS 77 - -#define CB_KEEPTOGETHER 80 -#define FT_MAXHYPH 81 -#define ED_MAXHYPH 83 - -#define CB_REGISTER 84 -#define FL_REGISTER 85 -#define FL_PROPERTIES 90 -#define FT_TEXTDIRECTION 91 -#define LB_TEXTDIRECTION 92 - - -//asian typography -#define FL_AS_OPTIONS 1 -#define CB_AS_HANG_PUNC 2 -#define CB_AS_ALLOW_WORD_BREAK 3 -#define CB_AS_FORBIDDEN 4 -#define FL_AS_CHAR_DIST 5 -#define CB_AS_PUNCTUATION 6 -#define CB_AS_SCRIPT_SPACE 7 -#define CB_AS_ADJUST_NUMBERS 8 - - - - - - - - -SvxSimpleParagraphDialog::SvxSimpleParagraphDialog( Window* pParent ) - : SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_STD_PARAGRAPH ), rAttr ) - , Dialog( pParent, "simple-paragraph.xml", "dialog" ) - , aLineSpacingList( this, "line-spacing-list" ) - , pPrevWin(NULL) -{ -fprintf(stderr, "creating res mgr\n"); - pMgr = ResMgr::CreateResMgr("SOME_NAME"); -fprintf(stderr, "getting parent\n"); - VCLXWindow *pCompParent = VCLXWindow::GetImplementation( GetPeer() ); - assert( pCompParent != NULL ); - assert( pCompParent->GetWindow() != NULL ); -fprintf(stderr, "creating foreign vcl widget\n"); -/* pPrevWin = new SVX::SvxParaPrevWindow( - pCompParent->GetWindow(), - ResId(1234, *pMgr) - );*/ - -fprintf(stderr, "done\n"); - FreeResource(); -} - -// ----------------------------------------------------------------------- - -SvxSimpleParagraphDialog::~SvxSimpleParagraphDialog() -{ -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/simple-paragraph.hxx b/toolkit/workben/layout/simple-paragraph.hxx deleted file mode 100644 index d4feff479135..000000000000 --- a/toolkit/workben/layout/simple-paragraph.hxx +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVX_SIMPLE_PARAGRAPH_HXX -#define _SVX_SIMPLE_PARAGRAPH_HXX - -#include <layout/layout.hxx> - -#include <svx/paraprev.hxx> // Preview - -namespace SVX { - class SvxParaPrevWindow; -}; -class ResMgr; - -class SvxSimpleParagraphDialog : public SfxTabPage, public layout::Dialog -{ -private: - ListBox aLineSpacingList; - SVX::SvxParaPrevWindow *pPrevWin; - ResMgr *pMgr; - -public: - SvxSimpleParagraphDialog( Window* pParent ); - ~SvxSimpleParagraphDialog(); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/simple-paragraph.xml b/toolkit/workben/layout/simple-paragraph.xml deleted file mode 100644 index e07909dc8a39..000000000000 --- a/toolkit/workben/layout/simple-paragraph.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Paragraph test" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox> - <listbox id="line-spacing-list" dropdown="true" cnt:expand="false" - string-item-list="Single:1.5 lines:Double:Proportional" /> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/sort-options.xml b/toolkit/workben/layout/sort-options.xml deleted file mode 100644 index a409ac2d530a..000000000000 --- a/toolkit/workben/layout/sort-options.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated XML files are generated from this template by - transex3/layout/tralay. !--> - -<tabpage help-id="HID_SCPAGE_SORT_OPTIONS" - id="RID_SCPAGE_SORT_OPTIONS" - sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container" - optimumsize="true" - sizeable="true" moveable="true"> - <vbox spacing="4" border="5"> - <string id="STR_COL_LABEL" _text="Range contains column la~bels"/> - <string id="STR_ROW_LABEL" _text="Range contains ~row labels"/> - <string id="SCSTR_UNDEFINED" _text="- undefined -"/> - <vbox spacing="4" border="5"> - <checkbox id="BTN_CASESENSITIVE" tabstop="true" _label="Case ~sensitive"/> - <checkbox id="BTN_LABEL" tabstop="true"/> - <checkbox id="BTN_FORMATS" tabstop="true" _label="Include ~formats"/> - <checkbox id="BTN_NATURALSORT" tabstop="true" _label="Enable ~natural sort"/> - <checkbox id="BTN_COPYRESULT" tabstop="true" _label="~Copy sort results to:"/> - <hbox> - <listbox has_border="true" dropdown="true" id="LB_OUTAREA" tabstop="true"/> - <edit has_border="true" disable="true" id="ED_OUTAREA" tabstop="true"/> - </hbox> - <checkbox id="BTN_SORT_USER" tabstop="true" _label="Custom sort ~order"/> - <listbox has_border="true" disable="true" dropdown="true" id="LB_SORT_USER" tabstop="true"/> - <hbox> - <fixedtext id="FT_LANGUAGE" _label="~Language"/> - <fixedtext id="FT_ALGORITHM" _label="O~ptions"/> - </hbox> - <hbox> - <svxlanguagebox has_border="true" dropdown="true" id="LB_LANGUAGE" sort="true" tabstop="true" _string-item-list="Default"/> - <listbox has_border="true" dropdown="true" id="LB_ALGORITHM" tabstop="true"/> - </hbox> - <fixedline id="FL_DIRECTION" _text="Direction"/> - <radiobutton id="BTN_TOP_DOWN" radiogroup="sort-options" tabstop="true" _label="~Top to bottom (sort rows)"/> - <radiobutton id="BTN_LEFT_RIGHT" radiogroup="sort-options" tabstop="true" _label="L~eft to right (sort columns)"/> - </vbox> - </vbox> -</tabpage> diff --git a/toolkit/workben/layout/sortdlg.cxx b/toolkit/workben/layout/sortdlg.cxx deleted file mode 100644 index ecc18da4fbc8..000000000000 --- a/toolkit/workben/layout/sortdlg.cxx +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#if !TEST_LAYOUT -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sc.hxx" -#endif /*! TEST_LAYOUT */ - -#undef SC_DLLIMPLEMENTATION - - - -#include "tpsort.hxx" -#include "sortdlg.hxx" -#include "scresid.hxx" -#include "sortdlg.hrc" - -#if !LAYOUT_SFX_TABDIALOG_BROKEN -#include <layout/layout-pre.hxx> -#endif - -ScSortDlg::ScSortDlg( Window* pParent, - const SfxItemSet* pArgSet ) : - SfxTabDialog( pParent, - ScResId( RID_SCDLG_SORT ), - pArgSet ), - bIsHeaders ( FALSE ), - bIsByRows ( FALSE ) - -{ -#if LAYOUT_SFX_TABDIALOG_BROKEN - AddTabPage( TP_FIELDS, ScTabPageSortFields::Create, 0 ); - AddTabPage( TP_OPTIONS, ScTabPageSortOptions::Create, 0 ); -#else /* !LAYOUT_SFX_TABDIALOG_BROKEN */ - String fields(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("fields"))); - AddTabPage( TP_FIELDS, fields, ScTabPageSortFields::Create, 0, FALSE, TAB_APPEND); - String options(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("options"))); - AddTabPage( TP_OPTIONS, options, ScTabPageSortOptions::Create, 0, FALSE, TAB_APPEND); -#endif /* !LAYOUT_SFX_TABDIALOG_BROKEN */ - FreeResource(); -} - -ScSortDlg::~ScSortDlg() -{ -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/sortdlg.hrc b/toolkit/workben/layout/sortdlg.hrc deleted file mode 100644 index 1b62f3f8cbac..000000000000 --- a/toolkit/workben/layout/sortdlg.hrc +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "sc.hrc" // -> RID_SCDLG_SORT - // -> RID_SCPAGE_SORT_FIELDS - // -> RID_SCPAGE_SORT_OPTIONS - // -> SCSTR_NONAME - // -> SCSTR_UNDEFINED - // -> SCSTR_FIELD - -#define TP_FIELDS 1 -#define TP_OPTIONS 2 - -// TP_SORT_FIELDS: -#define FL_SORT1 1 -#define FL_SORT2 2 -#define FL_SORT3 3 -#define LB_SORT1 4 -#define LB_SORT2 5 -#define LB_SORT3 6 -#define BTN_UP1 7 -#define BTN_UP2 8 -#define BTN_UP3 9 -#define BTN_DOWN1 10 -#define BTN_DOWN2 11 -#define BTN_DOWN3 12 - -// TP_SORT_OPTIONS: -#define FL_DIRECTION 1 -#define LB_SORT_USER 2 -#define LB_OUTAREA 3 -#define ED_OUTAREA 4 -#define BTN_SORT_USER 7 -#define BTN_CASESENSITIVE 8 -#define BTN_LABEL 9 -#define BTN_FORMATS 10 -#define BTN_COPYRESULT 11 -#define BTN_TOP_DOWN 12 -#define BTN_LEFT_RIGHT 13 -#define STR_COL_LABEL 14 -#define STR_ROW_LABEL 15 -#define FT_LANGUAGE 16 -#define LB_LANGUAGE 17 -#define FT_ALGORITHM 18 -#define LB_ALGORITHM 19 -#define BTN_NATURALSORT 20 diff --git a/toolkit/workben/layout/sortdlg.hxx b/toolkit/workben/layout/sortdlg.hxx deleted file mode 100644 index c63f24989aca..000000000000 --- a/toolkit/workben/layout/sortdlg.hxx +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SC_SORTDLG_HXX -#define SC_SORTDLG_HXX - -#include <sfx2/tabdlg.hxx> - -#if TEST_LAYOUT -#define LAYOUT_SFX_TABDIALOG_BROKEN 0 -#else /* !TEST_LAYOUT */ -#ifndef LAYOUT_SFX_TABDIALOG_BROKEN -#define LAYOUT_SFX_TABDIALOG_BROKEN 1 -#endif /* !LAYOUT_SFX_TABDIALOG_BROKEN */ -#endif /* !TEST_LAYOUT */ - -#if !LAYOUT_SFX_TABDIALOG_BROKEN -#include <sfx2/layout.hxx> -#include <layout/layout-pre.hxx> -#endif - -class ScSortDlg : public SfxTabDialog -{ -public: - ScSortDlg( Window* pParent, - const SfxItemSet* pArgSet ); - ~ScSortDlg(); - - void SetHeaders( BOOL bHeaders ); - void SetByRows ( BOOL bByRows ); - BOOL GetHeaders() const; - BOOL GetByRows () const; - - -private: - BOOL bIsHeaders; - BOOL bIsByRows; -}; - -inline void ScSortDlg::SetHeaders( BOOL bHeaders ) { bIsHeaders = bHeaders; } -inline void ScSortDlg::SetByRows ( BOOL bByRows ) { bIsByRows = bByRows; } -inline BOOL ScSortDlg::GetHeaders() const { return bIsHeaders; } -inline BOOL ScSortDlg::GetByRows () const { return bIsByRows; } - -#if !LAYOUT_SFX_TABDIALOG_BROKEN -#include <layout/layout-post.hxx> -#endif - -#endif // SC_SORTDLG_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/sortdlg.src b/toolkit/workben/layout/sortdlg.src deleted file mode 100644 index f52758f61785..000000000000 --- a/toolkit/workben/layout/sortdlg.src +++ /dev/null @@ -1,331 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "sortdlg.hrc" -TabPage RID_SCPAGE_SORT_FIELDS -{ - Hide = TRUE ; - SVLook = TRUE ; - HelpId = HID_SCPAGE_SORT_FIELDS ; - Size = MAP_APPFONT ( 260 , 185 ) ; - ListBox LB_SORT1 - { - HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 19 ) ; - Size = MAP_APPFONT ( 154 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - RadioButton BTN_UP1 - { - HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP1"; - Pos = MAP_APPFONT ( 172 , 14 ) ; - Size = MAP_APPFONT ( 79 , 10 ) ; - Text [ en-US ] = "~Ascending" ; - TabStop = TRUE ; - }; - RadioButton BTN_DOWN1 - { - HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN1"; - Pos = MAP_APPFONT ( 172 , 28 ) ; - Size = MAP_APPFONT ( 79 , 10 ) ; - Text [ en-US ] = "~Descending" ; - TabStop = TRUE ; - }; - FixedLine FL_SORT1 - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Sort ~by" ; - }; - ListBox LB_SORT2 - { - HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 60 ) ; - Size = MAP_APPFONT ( 154 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - RadioButton BTN_UP2 - { - HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP2"; - Pos = MAP_APPFONT ( 172 , 55 ) ; - Size = MAP_APPFONT ( 79 , 10 ) ; - Text [ en-US ] = "A~scending" ; - TabStop = TRUE ; - }; - RadioButton BTN_DOWN2 - { - HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN2"; - Pos = MAP_APPFONT ( 172 , 69 ) ; - Size = MAP_APPFONT ( 79 , 10 ) ; - Text [ en-US ] = "D~escending" ; - TabStop = TRUE ; - }; - FixedLine FL_SORT2 - { - Pos = MAP_APPFONT ( 6 , 44 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Then b~y" ; - }; - ListBox LB_SORT3 - { - HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT3"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 101 ) ; - Size = MAP_APPFONT ( 154 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - RadioButton BTN_UP3 - { - HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP3"; - Pos = MAP_APPFONT ( 172 , 96 ) ; - Size = MAP_APPFONT ( 79 , 10 ) ; - Text [ en-US ] = "As~cending" ; - TabStop = TRUE ; - }; - RadioButton BTN_DOWN3 - { - HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN3"; - Pos = MAP_APPFONT ( 172 , 110 ) ; - Size = MAP_APPFONT ( 79 , 10 ) ; - Text [ en-US ] = "Desce~nding" ; - TabStop = TRUE ; - }; - FixedLine FL_SORT3 - { - Pos = MAP_APPFONT ( 6 , 85 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "T~hen by" ; - }; -}; - -TabPage RID_SCPAGE_SORT_OPTIONS -{ - Hide = TRUE ; - SVLook = TRUE ; - HelpId = HID_SCPAGE_SORT_OPTIONS ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 260 , 185 ) ; - CheckBox BTN_CASESENSITIVE - { - HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_CASESENSITIVE"; - Pos = MAP_APPFONT ( 12 , 6 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "Case ~sensitive" ; - TabStop = TRUE ; - }; - CheckBox BTN_LABEL - { - HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_LABEL"; - Pos = MAP_APPFONT ( 12 , 20 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - TabStop = TRUE ; - }; - String STR_COL_LABEL - { - Text [ en-US ] = "Range contains column la~bels" ; - }; - String STR_ROW_LABEL - { - Text [ en-US ] = "Range contains ~row labels" ; - }; - CheckBox BTN_FORMATS - { - HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_FORMATS"; - Pos = MAP_APPFONT ( 12 , 34 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "Include ~formats" ; - TabStop = TRUE ; - }; - CheckBox BTN_NATURALSORT - { - HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_NATURALSORT"; - Pos = MAP_APPFONT ( 12 , 48 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ de ] = "Enable ~natural sort" ; - Text [ en-US ] = "Enable ~natural sort" ; - Text [ cs ] = "Aktivovat přirozené třídění" ; - Text [ sk ] = "Aktivovať prirodzené triedenie" ; - TabStop = TRUE ; - Text [ x-comment ] = " " ; - }; - CheckBox BTN_COPYRESULT - { - HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_COPYRESULT"; - Pos = MAP_APPFONT ( 12 , 62 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "~Copy sort results to:" ; - TabStop = TRUE ; - }; - ListBox LB_OUTAREA - { - HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_OUTAREA"; - Border = TRUE ; - Pos = MAP_APPFONT ( 20 , 73 ) ; - Size = MAP_APPFONT ( 93 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - Edit ED_OUTAREA - { - HelpID = "toolkit:Edit:RID_SCPAGE_SORT_OPTIONS:ED_OUTAREA"; - Disable = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 119 , 73 ) ; - Size = MAP_APPFONT ( 132 , 12 ) ; - TabStop = TRUE ; - }; - CheckBox BTN_SORT_USER - { - HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_SORT_USER"; - Pos = MAP_APPFONT ( 12 , 89 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "Custom sort ~order" ; - TabStop = TRUE ; - }; - ListBox LB_SORT_USER - { - HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_SORT_USER"; - Disable = TRUE ; - Border = TRUE ; - Pos = MAP_APPFONT ( 20 , 100 ) ; - Size = MAP_APPFONT ( 231 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedText FT_LANGUAGE - { - Pos = MAP_APPFONT ( 12 , 118 ) ; - Size = MAP_APPFONT ( 101 , 8 ) ; - Text [ en-US ] = "~Language"; - }; - ListBox LB_LANGUAGE - { - HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_LANGUAGE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 129 ) ; - Size = MAP_APPFONT ( 101 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - FixedText FT_ALGORITHM - { - Pos = MAP_APPFONT ( 119 , 118 ) ; - Size = MAP_APPFONT ( 132 , 8 ) ; - Text [ en-US ] = "O~ptions"; - }; - ListBox LB_ALGORITHM - { - HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_ALGORITHM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 119 , 129 ) ; - Size = MAP_APPFONT ( 132 , 90 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedLine FL_DIRECTION - { - Pos = MAP_APPFONT ( 6 , 147 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Direction" ; - }; - RadioButton BTN_TOP_DOWN - { - HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_TOP_DOWN"; - Pos = MAP_APPFONT ( 12 , 158 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "~Top to bottom (sort rows)" ; - TabStop = TRUE ; - }; - RadioButton BTN_LEFT_RIGHT - { - HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_LEFT_RIGHT"; - Pos = MAP_APPFONT ( 12 , 172 ) ; - Size = MAP_APPFONT ( 242 , 10 ) ; - Text [ en-US ] = "L~eft to right (sort columns)" ; - TabStop = TRUE ; - }; -}; - -TabDialog RID_SCDLG_SORT -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 220 , 175 ) ; - Text [ en-US ] = "Sort" ; - Moveable = TRUE ; - Closeable = FALSE ; - TabControl 1 - { - OutputSize = TRUE ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( 210 , 170 ) ; - PageList = - { - PageItem - { - Identifier = TP_FIELDS ; - PageResID = TP_FIELDS ; - Text [ en-US ] = "Sort Criteria" ; - }; - PageItem - { - Identifier = TP_OPTIONS ; - PageResID = TP_OPTIONS ; - Text [ en-US ] = "Options" ; - }; - }; - }; - OKButton 1 - { - Pos = MAP_APPFONT ( 3 , 157 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - }; - CancelButton 1 - { - Pos = MAP_APPFONT ( 49 , 157 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - }; - PushButton 1 - { - Pos = MAP_APPFONT ( 137 , 157 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - }; - HelpButton 1 - { - Pos = MAP_APPFONT ( 94 , 157 ) ; - Size = MAP_APPFONT ( 40 , 12 ) ; - TabStop = TRUE ; - }; -}; diff --git a/toolkit/workben/layout/sortdlg.xml b/toolkit/workben/layout/sortdlg.xml deleted file mode 100644 index ce45a60ff1ee..000000000000 --- a/toolkit/workben/layout/sortdlg.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated XML files are generated from this template by - transex3/layout/tralay. !--> - -<tabpage help-id="HID_SCPAGE_SORT_FIELDS" hide="true" id="RID_SCPAGE_SORT_FIELDS" sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> - <vbox> - <fixedline id="FL_SORT1" text="Sort ~by"/> - <radiobutton id="BTN_UP1" tabstop="true" label="~Ascending"/> - <listbox has_border="true" dropdown="true" id="LB_SORT1" tabstop="true"/> - <radiobutton id="BTN_DOWN1" tabstop="true" label="~Descending"/> - <fixedline id="FL_SORT2" text="Then b~y"/> - <radiobutton id="BTN_UP2" tabstop="true" label="A~scending"/> - <listbox has_border="true" dropdown="true" id="LB_SORT2" tabstop="true"/> - <radiobutton id="BTN_DOWN2" tabstop="true" label="D~escending"/> - <fixedline id="FL_SORT3" text="T~hen by"/> - <radiobutton id="BTN_UP3" tabstop="true" label="As~cending"/> - <listbox has_border="true" dropdown="true" id="LB_SORT3" tabstop="true"/> - <radiobutton id="BTN_DOWN3" tabstop="true" label="Desce~nding"/> - </vbox> -</tabpage> -<tabpage help-id="HID_SCPAGE_SORT_OPTIONS" hide="true" id="RID_SCPAGE_SORT_OPTIONS" sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> - <string id="STR_COL_LABEL" text="Range contains column la~bels"/> - <string id="STR_ROW_LABEL" text="Range contains ~row labels"/> - <vbox> - <checkbox id="BTN_CASESENSITIVE" tabstop="true" label="Case ~sensitive"/> - <checkbox id="BTN_LABEL" tabstop="true"/> - <checkbox id="BTN_FORMATS" tabstop="true" label="Include ~formats"/> - <checkbox id="BTN_NATURALSORT" tabstop="true" label=" "/> - <checkbox id="BTN_COPYRESULT" tabstop="true" label="~Copy sort results to:"/> - <hbox> - <listbox has_border="true" dropdown="true" id="LB_OUTAREA" tabstop="true"/> - <edit has_border="true" disable="true" id="ED_OUTAREA" tabstop="true"/> - </hbox> - <checkbox id="BTN_SORT_USER" tabstop="true" label="Custom sort ~order"/> - <listbox has_border="true" disable="true" dropdown="true" id="LB_SORT_USER" tabstop="true"/> - <hbox> - <fixedtext id="FT_LANGUAGE" label="~Language"/> - <fixedtext id="FT_ALGORITHM" label="O~ptions"/> - </hbox> - <hbox> - <listbox has_border="true" dropdown="true" id="LB_LANGUAGE" sort="true" tabstop="true"/> - <listbox has_border="true" dropdown="true" id="LB_ALGORITHM" tabstop="true"/> - </hbox> - <fixedline id="FL_DIRECTION" text="Direction"/> - <radiobutton id="BTN_TOP_DOWN" tabstop="true" label="~Top to bottom (sort rows)"/> - <radiobutton id="BTN_LEFT_RIGHT" tabstop="true" label="L~eft to right (sort columns)"/> - </vbox> -</tabpage> -<tabdialog closeable="false" moveable="true" output-size="true" id="RID_SCDLG_SORT" sv-look="true" text="Sort" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> - <vbox> - <tabcontrol output-size="true" id="1"> - <pagelist> - <pageitem identifier="TP_FIELDS" page-res-id="TP_FIELDS" text="Sort Criteria"/> - <pageitem identifier="TP_OPTIONS" page-res-id="TP_OPTIONS" text="Options"/> - </pagelist> - </tabcontrol> - <hbox> - <okbutton defbutton="true" id="1" tabstop="true"/> - <cancelbutton id="1" tabstop="true"/> - <helpbutton id="1" tabstop="true"/> - <pushbutton id="1" tabstop="true"/> - </hbox> - </vbox> -</tabdialog> diff --git a/toolkit/workben/layout/splitter.xml b/toolkit/workben/layout/splitter.xml deleted file mode 100644 index 634ad829b001..000000000000 --- a/toolkit/workben/layout/splitter.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Splitter Test" optimumsize="true" has_border="true" sizeable="true" moveable="true"> - <vbox> - <hsplitter> - <pushbutton label="Left" /> - <pushbutton label="Right" /> - </hsplitter> - <okbutton cnt:expand="false" /> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/string-input.xml b/toolkit/workben/layout/string-input.xml deleted file mode 100644 index b1aed5197c17..000000000000 --- a/toolkit/workben/layout/string-input.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated XML files are generated from this template by - transex3/layout/tralay. !--> - -<modaldialog sizeable="true" closeable="false" moveable="true" output-size="true" id="RID_SCDLG_STRINPUT" sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container" title="Insert String"> - <vbox spacing="5" border="5"> - <fixedtext id="FT_LABEL" label="FT-LABEL"/> - <edit has_border="true" id="ED_INPUT" tabstop="true"/> - <dialogbuttonhbox border="5" spacing="5"> - <okbutton defbutton="true" id="BTN_OK" tabstop="true"/> - <cancelbutton id="BTN_CANCEL" tabstop="true"/> - <helpbutton id="BTN_HELP" tabstop="true"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/tab-dialog.xml b/toolkit/workben/layout/tab-dialog.xml deleted file mode 100644 index da75f03e9df5..000000000000 --- a/toolkit/workben/layout/tab-dialog.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - _title="layout::TabDialog" optimumsize="true" - id="tab-dialog" - has_border="true" sizeable="true" moveable="true"> - <vbox spacing="5" border="5"> - <tabcontrol id="ID_TABCONTROL"/> - <dialogbuttonhbox border="5" spacing="5" cnt:expand="false"> - <flow/> - <okbutton defbutton="true" id="BTN_OK" show="false"/> - <pushbutton id="BTN_USER" _label="<User>" show="false"/> - <cancelbutton id="BTN_CANCEL" show="false"/> - <helpbutton id="BTN_HELP" show="false"/> - <resetbutton id="BTN_RESET" show="false"/> - <pushbutton id="BTN_BASEFMT" _label="<Base Format>" show="false"/> - </dialogbuttonhbox> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/tabcontrol.xml b/toolkit/workben/layout/tabcontrol.xml deleted file mode 100644 index 2986f1f9e0d9..000000000000 --- a/toolkit/workben/layout/tabcontrol.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="TabControl Test" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <vbox> - <tabcontrol> - <pushbutton label="Child 1" cnt:title="Page 1" /> - <edit has_border="true" text="Child 2" cnt:title="Page 2" /> - <vbox cnt:title="Page 3"> - <pushbutton label="Child 3"/> - <edit has_border="true" text="Child 4" /> - </vbox> - </tabcontrol> - <okbutton cnt:expand="false" /> - </vbox> -</dialog> diff --git a/toolkit/workben/layout/table.xml b/toolkit/workben/layout/table.xml deleted file mode 100644 index 673bd85ddab3..000000000000 --- a/toolkit/workben/layout/table.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Table Test" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <table columns="3"> - <!-- row 0 --> - <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" /> - <pushbutton cnt:y-expand="false" label="1,2" /> - <pushbutton cnt:y-expand="false" label="1,3" /> - <!-- row 1 --> - <pushbutton cnt:col-span="2" label="2,1" /> - </table> -</dialog> diff --git a/toolkit/workben/layout/test.cxx b/toolkit/workben/layout/test.cxx deleted file mode 100644 index f90317a5ae37..000000000000 --- a/toolkit/workben/layout/test.cxx +++ /dev/null @@ -1,369 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include <vcl/svapp.hxx> - -// This works and was used before for standalone test, not sure why -// we'd want it. -#define LAYOUT_WEAK 1 -#include "uno.hxx" - -#include <cstdio> -#include <cstdlib> -#include <sys/stat.h> - -#include <com/sun/star/xml/sax/SAXException.hpp> -#include <comphelper/processfactory.hxx> -#include <cppuhelper/bootstrap.hxx> -#include <rtl/ustring.hxx> -#include <ucbhelper/configurationkeys.hxx> -#include <ucbhelper/contentbroker.hxx> - -#define SORT_DLG 1 /* requires sfx2, svx to be compiled */ -#if SORT_DLG -#include "scitems.hxx" -#include "uiitems.hxx" -#endif /* SORT_DLG */ - -#include "editor.hxx" - -#include "plugin.hxx" -#undef _LAYOUT_POST_HXX - -#include "recover.hxx" -#undef _LAYOUT_POST_HXX - -#if SORT_DLG -#include "sortdlg.hxx" -#undef _LAYOUT_POST_HXX -#endif /* SORT_DLG */ - -#include "wordcountdialog.hxx" -#undef _LAYOUT_POST_HXX - -#include "zoom.hxx" -#undef _LAYOUT_POST_HXX - -#include <layout/layout-pre.hxx> - -using namespace ::rtl; -using namespace ::cppu; -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; - -class LayoutTest : public Application -{ - Reference< XComponentContext > mxContext; - Reference< lang::XMultiServiceFactory > mxMSF; - OUString mInstallDir; - OUString mTestDialog; - bool mEditMode; - std::list< OUString > mFiles; - -public: - LayoutTest( char const* installDir ); - - void RunEditor(); - void RunFiles(); - void ExceptionalMain(); - void Init(); - void InitUCB(); - void LoadFile( OUString const &aName ); - void Main(); - void ParseCommandLine(); -}; - -static void usage() -{ - fprintf (stderr, "usage: test [--inst OOO_INSTALL_PREFIX] [DIALOG.XML]... | --test [DIALOG.XML]\n" ); - exit( 2 ); -} - -static uno::Reference< lang::XSingleServiceFactory > get_factory( char const *service ) -{ - uno::Reference< lang::XSingleServiceFactory > xFactory( - comphelper::createProcessComponent( - rtl::OUString::createFromAscii( service ) ), uno::UNO_QUERY ); - - if ( !xFactory.is() ) - fprintf( stderr, "error loading: %s\n", service ); - return xFactory; -} - -#define GET_FACTORY(x) get_factory( #x ) - -void LayoutTest::LoadFile( const OUString &aTestFile ) -{ - fprintf( stderr, "TEST: layout instance\n" ); - - uno::Reference< lang::XSingleServiceFactory > xFactory - = GET_FACTORY( com.sun.star.awt.Layout ); - if ( !xFactory.is() ) - { - fprintf( stderr, "Layout engine not installed\n" ); - throw uno::RuntimeException( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Layout engine not installed" ) ), - uno::Reference< uno::XInterface >() ); - } - fprintf( stderr, "TEST: initing root\n" ); - - uno::Sequence< uno::Any > aParams( 1 ); - aParams[0] <<= aTestFile; - - uno::Reference< awt::XLayoutRoot > xRoot ( - xFactory->createInstanceWithArguments( aParams ), - uno::UNO_QUERY ); - - fprintf( stderr, "TEST: file loaded\n" ); -} - -void LayoutTest::InitUCB() -{ - OUString aEmpty; - Sequence< Any > aArgs( 6 ); - aArgs[0] - <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY1_LOCAL )); - aArgs[1] - <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY2_OFFICE )); - aArgs[2] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("PIPE")); - aArgs[3] <<= aEmpty; - aArgs[4] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("PORTAL")); - aArgs[5] <<= aEmpty; - - if ( !::ucbhelper::ContentBroker::initialize( mxMSF, aArgs ) ) - { - fprintf( stderr, "Failed to init content broker\n" ); - fprintf( stderr, "arg[0]: %s\n", UCB_CONFIGURATION_KEY1_LOCAL ); - fprintf( stderr, "arg[1]: %s\n", UCB_CONFIGURATION_KEY2_OFFICE ); - } -} - -static void support_upstream_brand_prefix () -{ - if ( char const* inst = getenv( "OOO_INSTALL_PREFIX" ) ) - { - char const *brand_prefix = "/openoffice.org3"; - OUString brand_dir = OUString::createFromAscii( inst ) - + OUString::createFromAscii( brand_prefix ); - struct stat stat_info; - if ( !stat ( OUSTRING_CSTR( brand_dir ), &stat_info ) ) - { - OSL_TRACE( "Appending %s to OOO_INSTALL_PREFIX", brand_prefix ); - setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( brand_dir ), 1 ); - } - } -} - -void LayoutTest::Init() -{ - ParseCommandLine(); - setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( mInstallDir ), 0 ); - support_upstream_brand_prefix (); - OSL_TRACE( "OOO_INSTALL_PREFIX=%s", getenv( "OOO_INSTALL_PREFIX" ) ); - - mxContext = defaultBootstrap_InitialComponentContext(); - mxMSF = new UnoBootstrapLayout( Reference< lang::XMultiServiceFactory >( mxContext->getServiceManager(), UNO_QUERY ) ); - ::comphelper::setProcessServiceFactory( mxMSF ); - InitUCB(); -} - -void LayoutTest::ParseCommandLine() -{ - printf ("%s\n", __PRETTY_FUNCTION__); - for ( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ ) - { - OUString aParam = OUString( GetCommandLineParam( i ) ); - if ( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" ) ) || aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--help" ) ) ) - usage(); - if ( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--inst" ) ) ) - { - if ( i >= GetCommandLineParamCount() - 1) - usage(); - mInstallDir = GetCommandLineParam( ++i ); - setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( mInstallDir ), 1 ); - } - else if ( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--test" ) ) ) - { - mTestDialog = OUString(RTL_CONSTASCII_USTRINGPARAM("zoom")); - if (i + 1 < GetCommandLineParamCount()) - mTestDialog = GetCommandLineParam( ++i ); - } - else if ( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--editor" ) ) ) - mEditMode = true; - else - mFiles.push_back( aParam ); - } - - if ( mFiles.size() <= 0 ) - mFiles.push_back( OUString(RTL_CONSTASCII_USTRINGPARAM("layout.xml")) ); -} - -void LayoutTest::RunEditor() -{ - OUString aFile; - if ( !mFiles.empty() - && mFiles.front().compareToAscii( "layout.xml" ) != 0 ) - aFile = mFiles.front(); - Editor editor( mxMSF, aFile ); - editor.Show(); - editor.Execute(); -} - -short RunDialog( Dialog& dialog ) -{ - dialog.Show(); - short result = dialog.Execute(); - fprintf( stderr, "Done: dialog execute exited:%d\n", result); - return result; -} - -#undef Dialog -short RunDialog( ::Dialog& dialog ) -{ - dialog.Show(); - short result = dialog.Execute(); - fprintf( stderr, "Done: dialog execute exited:%d\n", result); - return result; -} - -#if SORT_DLG -static void LoadSC() -{ - get_factory( "com.sun.star.comp.sfx2.DocumentTemplates" ); - get_factory( "com.sun.star.comp.Calc.SpreadsheetDocument" ); - GET_FACTORY( com.sun.star.i18n.Transliteration.l10n ); -} -#endif /* SORT_DLG */ - -void TestDialog( OUString const& name ) -{ - if ( 0 ) - ; - else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "plugin" ) ) ) - { - PluginDialog plugin ( 0 ); - RunDialog( plugin ); - } - else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "query" ) ) ) - { - QueryBox query ( 0, "Do you want to do?", "do"); - RunDialog( query ); - } - else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "query-compat" ) ) ) - { - QueryBox query ( 0, - WinBits( WB_YES_NO | WB_DEF_YES ), -// WinBits( WB_ABORT_RETRY_IGNORE ), - OUString(RTL_CONSTASCII_USTRINGPARAM ("Do you want to do?"))); - RunDialog( query ); - } - else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "recover" ) ) ) - { - SvxRecoverDialog recover ( 0 ); - RunDialog( recover ); - } -#if SORT_DLG - else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "sort" ) ) ) - { - LoadSC(); - ScSortDlg sort (0, 0); - RunDialog( sort ); - } -#endif /* SORT_DLG */ - else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "wordcount" ) ) ) - { - SwWordCountDialog words ( 0 ); - RunDialog( words ); - } - else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "zoom" ) ) ) - { - SvxZoomDialog zoom( 0 ); - RunDialog( zoom ); - } -} - -void LayoutTest::RunFiles() -{ - fprintf( stderr, "TEST: loading files\n" ); - for ( std::list< OUString >::iterator i = mFiles.begin(); i != mFiles.end(); ++i ) - LoadFile( *i ); - fprintf( stderr, "TEST: executing\n" ); - Execute(); - fprintf( stderr, "TEST: done executing\n" ); -} - -void LayoutTest::ExceptionalMain() -{ - if ( mTestDialog.getLength() ) - TestDialog( mTestDialog ); - else if ( mEditMode ) - RunEditor(); - else - RunFiles(); -} - -void LayoutTest::Main() -{ - try - { - ExceptionalMain(); - } - catch (xml::sax::SAXException & rExc) - { - OString aStr( OUStringToOString( rExc.Message, - RTL_TEXTENCODING_ASCII_US ) ); - uno::Exception exc; - if (rExc.WrappedException >>= exc) - { - aStr += OString( " >>> " ); - aStr += OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ); - } - fprintf (stderr, "Parsing error: '%s'\n", aStr.getStr()); - OSL_FAIL( aStr.getStr() ); - } - catch ( uno::Exception & rExc ) - { - OString aStr( OUStringToOString( rExc.Message, - RTL_TEXTENCODING_ASCII_US ) ); - fprintf (stderr, "UNO error: '%s'\n", aStr.getStr()); - OSL_FAIL( aStr.getStr() ); - } - - Reference< lang::XComponent > xComp( mxContext, UNO_QUERY ); - if ( xComp.is() ) - xComp->dispose(); -} - -LayoutTest::LayoutTest( char const* installDir ) - : mInstallDir( OUString::createFromAscii ( installDir ) ) -{ -} - -LayoutTest layout_test( "/usr/local/lib/ooo" ); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/test.xml b/toolkit/workben/layout/test.xml deleted file mode 100644 index d0b4f9062912..000000000000 --- a/toolkit/workben/layout/test.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="Interactable Containers" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> - <tabcontrol> - <tabpage cnt:title="Page"> - <pushbutton label="Test" /> - </tabpage> - </tabcontrol> -</dialog> diff --git a/toolkit/workben/layout/testrc.in b/toolkit/workben/layout/testrc.in deleted file mode 100644 index b6c232aae60f..000000000000 --- a/toolkit/workben/layout/testrc.in +++ /dev/null @@ -1,8 +0,0 @@ -OOO_INSTALL_PREFIX_URL=file://${OOO_INSTALL_PREFIX} -OOO_BASIS_BIN_URL=${OOO_INSTALL_PREFIX_URL}/program -OOO_URE_URL=${OOO_INSTALL_PREFIX_URL}/ure-link -# -BRAND_BASE_DIR=${OOO_INSTALL_PREFIX_URL} -# -UNO_TYPES=${OOO_URE_URL}/share/misc/types.rdb ${OOO_BASIS_BIN_URL}/offapi.rdb -UNO_SERVICES=${OOO_URE_URL}/share/misc/services.rdb ${OOO_BASIS_BIN_URL}/services.rdb diff --git a/toolkit/workben/layout/tpsort.cxx b/toolkit/workben/layout/tpsort.cxx deleted file mode 100644 index ff8526c890aa..000000000000 --- a/toolkit/workben/layout/tpsort.cxx +++ /dev/null @@ -1,1107 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#if !TEST_LAYOUT -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sc.hxx" -#endif /* !TEST_LAYOUT */ - -#undef SC_DLLIMPLEMENTATION - - - -#include <vcl/msgbox.hxx> -#include <i18npool/mslangid.hxx> -#include <svtools/collatorres.hxx> -#include <unotools/collatorwrapper.hxx> -#include <unotools/localedatawrapper.hxx> -#include <comphelper/processfactory.hxx> - -#include "scitems.hxx" -#include "uiitems.hxx" -#include "viewdata.hxx" -#include "document.hxx" -#include "global.hxx" -#include "dbcolect.hxx" -#include "userlist.hxx" -#include "rangeutl.hxx" -#include "scresid.hxx" -#include "sc.hrc" // -> Slot IDs -#include "globstr.hrc" - -#include "sortdlg.hxx" -#include "sortdlg.hrc" - -#define _TPSORT_CXX -#include "tpsort.hxx" -#undef _TPSORT_CXX - -using namespace com::sun::star; - -// STATIC DATA ----------------------------------------------------------- - -static USHORT pSortRanges[] = -{ - SID_SORT, - SID_SORT, - 0 -}; - -// ----------------------------------------------------------------------- - -/* - * Da sich Einstellungen auf der zweiten TabPage (Optionen) auf - * die erste TabPage auswirken, muss es die Moeglichkeit geben, - * dies der jeweils anderen Seite mitzuteilen. - * - * Im Moment wird dieses Problem ueber zwei Datenmember des TabDialoges - * geloest. Wird eine Seite Aktiviert/Deaktiviert, so gleicht sie diese - * Datenmember mit dem eigenen Zustand ab (->Activate()/Deactivate()). - * - * 31.01.95: - * Die Klasse SfxTabPage bietet mittlerweile ein Verfahren an: - * - * virtual BOOL HasExchangeSupport() const; -> return TRUE; - * virtual void ActivatePage(const SfxItemSet &); - * virtual int DeactivatePage(SfxItemSet * = 0); - * - * muss noch geaendert werden! - */ - -//======================================================================== -//======================================================================== -// Sortierkriterien-Tabpage: - -ScTabPageSortFields::ScTabPageSortFields( Window* pParent, - const SfxItemSet& rArgSet ) - - : SfxTabPage ( pParent, - ScResId( RID_SCPAGE_SORT_FIELDS ), - rArgSet ), - // - aFlSort1 ( this, ScResId( FL_SORT1 ) ), - aLbSort1 ( this, ScResId( LB_SORT1 ) ), - aBtnUp1 ( this, ScResId( BTN_UP1 ) ), - aBtnDown1 ( this, ScResId( BTN_DOWN1 ) ), - // - aFlSort2 ( this, ScResId( FL_SORT2 ) ), - aLbSort2 ( this, ScResId( LB_SORT2 ) ), - aBtnUp2 ( this, ScResId( BTN_UP2 ) ), - aBtnDown2 ( this, ScResId( BTN_DOWN2 ) ), - // - aFlSort3 ( this, ScResId( FL_SORT3 ) ), - aLbSort3 ( this, ScResId( LB_SORT3 ) ), - aBtnUp3 ( this, ScResId( BTN_UP3 ) ), - aBtnDown3 ( this, ScResId( BTN_DOWN3 ) ), - - aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ), - aStrColumn ( ScResId( SCSTR_COLUMN ) ), - aStrRow ( ScResId( SCSTR_ROW ) ), - // -#if !TEST_LAYOUT - nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ), -#else /* TEST_LAYOUT */ - nWhichSort ( 0 ), -#endif /* TEST_LAYOUT */ - pDlg ( (ScSortDlg*)(GetParent()->GetParent()) ), - pViewData ( NULL ), -#if !TEST_LAYOUT - rSortData ( ((const ScSortItem&) - rArgSet.Get( nWhichSort )). - GetSortData() ), -#else /* TEST_LAYOUT */ - rSortData ( *new ScSortParam() ), -#endif /* TEST_LAYOUT */ - nFieldCount ( 0 ), - bHasHeader ( FALSE ), - bSortByRows ( FALSE ) -{ - Init(); - FreeResource(); - SetExchangeSupport(); -} - -// ----------------------------------------------------------------------- - -ScTabPageSortFields::~ScTabPageSortFields() -{ -} - -// ----------------------------------------------------------------------- - -void ScTabPageSortFields::Init() -{ -#if !TEST_LAYOUT - const ScSortItem& rSortItem = (const ScSortItem&) - GetItemSet().Get( nWhichSort ); - - pViewData = rSortItem.GetViewData(); - - DBG_ASSERT( pViewData, "ViewData not found!" ); -#endif /* !TEST_LAYOUT */ - - nFieldArr[0] = 0; - nFirstCol = 0; - nFirstRow = 0; - - aLbSort1.SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) ); - aLbSort2.SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) ); - aLbSort3.SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) ); - aLbSort1.Clear(); - aLbSort2.Clear(); - aLbSort3.Clear(); - - aSortLbArr[0] = &aLbSort1; - aSortLbArr[1] = &aLbSort2; - aSortLbArr[2] = &aLbSort3; - aDirBtnArr[0][0] = &aBtnUp1; - aDirBtnArr[0][1] = &aBtnDown1; - aDirBtnArr[1][0] = &aBtnUp2; - aDirBtnArr[1][1] = &aBtnDown2; - aDirBtnArr[2][0] = &aBtnUp3; - aDirBtnArr[2][1] = &aBtnDown3; - aFlArr[0] = &aFlSort1; - aFlArr[1] = &aFlSort2; - aFlArr[2] = &aFlSort3; -} - -//------------------------------------------------------------------------ - -USHORT* ScTabPageSortFields::GetRanges() -{ - return pSortRanges; -} - -// ----------------------------------------------------------------------- - -SfxTabPage* ScTabPageSortFields::Create( Window* pParent, - const SfxItemSet& rArgSet ) -{ - return ( new ScTabPageSortFields( pParent, rArgSet ) ); -} - -// ----------------------------------------------------------------------- - -void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ ) -{ - bSortByRows = rSortData.bByRow; - bHasHeader = rSortData.bHasHeader; - - if ( aLbSort1.GetEntryCount() == 0 ) - FillFieldLists(); - - // Selektieren der ListBoxen: - - if ( rSortData.bDoSort[0] ) - { - for ( USHORT i=0; i<3; i++ ) - { - if ( rSortData.bDoSort[i] ) - { - aSortLbArr[i]->SelectEntryPos( - GetFieldSelPos( rSortData.nField[i] ) ); - - (rSortData.bAscending[i]) - ? aDirBtnArr[i][0]->Check() // Up - : aDirBtnArr[i][1]->Check(); // Down - } - else - { - aSortLbArr[i]->SelectEntryPos( 0 ); // "keiner" selektieren - aDirBtnArr[i][0]->Check(); // Up - } - } - - EnableField( 1 ); - EnableField( 2 ); - EnableField( 3 ); - if ( aLbSort1.GetSelectEntryPos() == 0 ) - DisableField( 2 ); - if ( aLbSort2.GetSelectEntryPos() == 0 ) - DisableField( 3 ); - } - else - { - aLbSort1.SelectEntryPos( 1 ); - aLbSort2.SelectEntryPos( 0 ); - aLbSort3.SelectEntryPos( 0 ); - aBtnUp1.Check(); - aBtnUp2.Check(); - aBtnUp3.Check(); - EnableField ( 1 ); - EnableField ( 2 ); - DisableField( 3 ); - } - - if ( pDlg ) - { - pDlg->SetByRows ( bSortByRows ); - pDlg->SetHeaders( bHasHeader ); - } -} - -// ----------------------------------------------------------------------- - -BOOL ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet ) -{ - ScSortParam theSortData = rSortData; - if (pDlg) - { - const SfxItemSet* pExample = pDlg->GetExampleSet(); - const SfxPoolItem* pItem; - if ( pExample && pExample->GetItemState( nWhichSort, TRUE, &pItem ) == SFX_ITEM_SET ) - theSortData = ((const ScSortItem*)pItem)->GetSortData(); - } - - USHORT nSort1Pos = aLbSort1.GetSelectEntryPos(); - USHORT nSort2Pos = aLbSort2.GetSelectEntryPos(); - USHORT nSort3Pos = aLbSort3.GetSelectEntryPos(); - - DBG_ASSERT( (nSort1Pos <= SC_MAXFIELDS) - && (nSort2Pos <= SC_MAXFIELDS) - && (nSort3Pos <= SC_MAXFIELDS), - "Array-Range Fehler!" ); - - if ( nSort1Pos == LISTBOX_ENTRY_NOTFOUND ) nSort1Pos = 0; - if ( nSort2Pos == LISTBOX_ENTRY_NOTFOUND ) nSort2Pos = 0; - if ( nSort3Pos == LISTBOX_ENTRY_NOTFOUND ) nSort3Pos = 0; - - if ( nSort1Pos > 0 ) - { - theSortData.bDoSort[0] = (nSort1Pos > 0); - theSortData.bDoSort[1] = (nSort2Pos > 0); - theSortData.bDoSort[2] = (nSort3Pos > 0); - - // wenn auf Optionen-Seite "OK" gewaehlt wurde und - // dabei die Sortierrichtung umgestellt wurde, so - // wird das erste Feld der jeweiligen Richtung als - // Sortierkriterium gewaehlt (steht in nFieldArr[0]): - if ( bSortByRows != pDlg->GetByRows() ) - { - theSortData.nField[0] = - theSortData.nField[1] = - theSortData.nField[2] = ( bSortByRows ? - static_cast<SCCOLROW>(nFirstRow) : - static_cast<SCCOLROW>(nFirstCol) ); - } - else - { - theSortData.nField[0] = nFieldArr[nSort1Pos]; - theSortData.nField[1] = nFieldArr[nSort2Pos]; - theSortData.nField[2] = nFieldArr[nSort3Pos]; - } - - theSortData.bAscending[0] = aBtnUp1.IsChecked(); - theSortData.bAscending[1] = aBtnUp2.IsChecked(); - theSortData.bAscending[2] = aBtnUp3.IsChecked(); - // bHasHeader ist in ScTabPageSortOptions::FillItemSet, wo es hingehoert - } - else - { - theSortData.bDoSort[0] = - theSortData.bDoSort[1] = - theSortData.bDoSort[2] = FALSE; - } - - rArgSet.Put( ScSortItem( SCITEM_SORTDATA, NULL, &theSortData ) ); - - return TRUE; -} - -// ----------------------------------------------------------------------- - -// fuer Datenaustausch ohne Dialog-Umweg: (! noch zu tun !) -// void ScTabPageSortFields::ActivatePage( const SfxItemSet& rSet ) - -void ScTabPageSortFields::ActivatePage() -{ - if ( pDlg ) - { - if ( bHasHeader != pDlg->GetHeaders() - || bSortByRows != pDlg->GetByRows() ) - { - USHORT nCurSel1 = aLbSort1.GetSelectEntryPos(); - USHORT nCurSel2 = aLbSort2.GetSelectEntryPos(); - USHORT nCurSel3 = aLbSort3.GetSelectEntryPos(); - - bHasHeader = pDlg->GetHeaders(); - bSortByRows = pDlg->GetByRows(); - FillFieldLists(); - aLbSort1.SelectEntryPos( nCurSel1 ); - aLbSort2.SelectEntryPos( nCurSel2 ); - aLbSort3.SelectEntryPos( nCurSel3 ); - } - } -} - -// ----------------------------------------------------------------------- - -int ScTabPageSortFields::DeactivatePage( SfxItemSet* pSetP ) -{ - if ( pDlg ) - { - if ( bHasHeader != pDlg->GetHeaders() ) - pDlg->SetHeaders( bHasHeader ); - - if ( bSortByRows != pDlg->GetByRows() ) - pDlg->SetByRows( bSortByRows ); - } - - if ( pSetP ) - FillItemSet( *pSetP ); - - return SfxTabPage::LEAVE_PAGE; -} - -// ----------------------------------------------------------------------- - -void ScTabPageSortFields::DisableField( USHORT nField ) -{ - nField--; - - if ( nField<=2 ) - { - aSortLbArr[nField] ->Disable(); - aDirBtnArr[nField][0]->Disable(); - aDirBtnArr[nField][1]->Disable(); - aFlArr[nField] ->Disable(); - } -} - -// ----------------------------------------------------------------------- - -void ScTabPageSortFields::EnableField( USHORT nField ) -{ - nField--; - - if ( nField<=2 ) - { - aSortLbArr[nField] ->Enable(); - aDirBtnArr[nField][0]->Enable(); - aDirBtnArr[nField][1]->Enable(); - aFlArr[nField] ->Enable(); - } -} - -// ----------------------------------------------------------------------- - -void ScTabPageSortFields::FillFieldLists() -{ - if ( pViewData ) - { - ScDocument* pDoc = pViewData->GetDocument(); - - if ( pDoc ) - { - aLbSort1.Clear(); - aLbSort2.Clear(); - aLbSort3.Clear(); - aLbSort1.InsertEntry( aStrUndefined, 0 ); - aLbSort2.InsertEntry( aStrUndefined, 0 ); - aLbSort3.InsertEntry( aStrUndefined, 0 ); - - SCCOL nFirstSortCol = rSortData.nCol1; - SCROW nFirstSortRow = rSortData.nRow1; - SCTAB nTab = pViewData->GetTabNo(); - USHORT i = 1; - - if ( bSortByRows ) - { - String aFieldName; - SCCOL nMaxCol = rSortData.nCol2; - SCCOL col; - - for ( col=nFirstSortCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ ) - { - pDoc->GetString( col, nFirstSortRow, nTab, aFieldName ); - if ( !bHasHeader || (aFieldName.Len() == 0) ) - { - aFieldName = aStrColumn; - aFieldName += ' '; - aFieldName += ColToAlpha( col ); - } - nFieldArr[i] = col; - aLbSort1.InsertEntry( aFieldName, i ); - aLbSort2.InsertEntry( aFieldName, i ); - aLbSort3.InsertEntry( aFieldName, i ); - i++; - } - } - else - { - String aFieldName; - SCROW nMaxRow = rSortData.nRow2; - SCROW row; - - for ( row=nFirstSortRow; row<=nMaxRow && i<SC_MAXFIELDS; row++ ) - { - pDoc->GetString( nFirstSortCol, row, nTab, aFieldName ); - if ( !bHasHeader || (aFieldName.Len() == 0) ) - { - aFieldName = aStrRow; - aFieldName += ' '; - aFieldName += String::CreateFromInt32( row+1 ); - } - nFieldArr[i] = row; - aLbSort1.InsertEntry( aFieldName, i ); - aLbSort2.InsertEntry( aFieldName, i ); - aLbSort3.InsertEntry( aFieldName, i ); - i++; - } - } - nFieldCount = i; - } - } -} - -//------------------------------------------------------------------------ - -USHORT ScTabPageSortFields::GetFieldSelPos( SCCOLROW nField ) -{ - USHORT nFieldPos = 0; - BOOL bFound = FALSE; - - for ( USHORT n=1; n<nFieldCount && !bFound; n++ ) - { - if ( nFieldArr[n] == nField ) - { - nFieldPos = n; - bFound = TRUE; - } - } - - return nFieldPos; -} - -// ----------------------------------------------------------------------- -// Handler: -//--------- - -IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb ) -{ - String aSelEntry = pLb->GetSelectEntry(); - - if ( pLb == &aLbSort1 ) - { - if ( aSelEntry == aStrUndefined ) - { - aLbSort2.SelectEntryPos( 0 ); - aLbSort3.SelectEntryPos( 0 ); - - if ( aFlSort2.IsEnabled() ) - DisableField( 2 ); - - if ( aFlSort3.IsEnabled() ) - DisableField( 3 ); - } - else - { - if ( !aFlSort2.IsEnabled() ) - EnableField( 2 ); - } - } - else if ( pLb == &aLbSort2 ) - { - if ( aSelEntry == aStrUndefined ) - { - aLbSort3.SelectEntryPos( 0 ); - if ( aFlSort3.IsEnabled() ) - DisableField( 3 ); - } - else - { - if ( !aFlSort3.IsEnabled() ) - EnableField( 3 ); - } - } - return 0; -} - -//======================================================================== -// Sortieroptionen-Tabpage: -//======================================================================== - -#include <layout/layout-pre.hxx> - -#if ENABLE_LAYOUT -#undef ScResId -#define ScResId(x) #x -#undef SfxTabPage -#define SfxTabPage( parent, id, args ) SfxTabPage( parent, "sort-options.xml", id, &args ) -#endif /* ENABLE_LAYOUT */ - -ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent, - const SfxItemSet& rArgSet ) - - : SfxTabPage ( pParent, - ScResId( RID_SCPAGE_SORT_OPTIONS ), - rArgSet ), - // - aBtnCase ( this, ScResId( BTN_CASESENSITIVE ) ), - aBtnHeader ( this, ScResId( BTN_LABEL ) ), - aBtnFormats ( this, ScResId( BTN_FORMATS ) ), - aBtnCopyResult ( this, ScResId( BTN_COPYRESULT ) ), - aBtnNaturalSort ( this, ScResId( BTN_NATURALSORT ) ), - aLbOutPos ( this, ScResId( LB_OUTAREA ) ), - aEdOutPos ( this, ScResId( ED_OUTAREA ) ), - aBtnSortUser ( this, ScResId( BTN_SORT_USER ) ), - aLbSortUser ( this, ScResId( LB_SORT_USER ) ), - aFtLanguage ( this, ScResId( FT_LANGUAGE ) ), - aLbLanguage ( this, ScResId( LB_LANGUAGE ) ), - aFtAlgorithm ( this, ScResId( FT_ALGORITHM ) ), - aLbAlgorithm ( this, ScResId( LB_ALGORITHM ) ), - aLineDirection ( this, ScResId( FL_DIRECTION ) ), - aBtnTopDown ( this, ScResId( BTN_TOP_DOWN ) ), - aBtnLeftRight ( this, ScResId( BTN_LEFT_RIGHT ) ), -// aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ), -// aFtArea ( this, ScResId( FT_AREA ) ), - // -#if ENABLE_LAYOUT -#undef this -#undef ScResId -#define ScResId(x) this, #x -#endif /* ENABLE_LAYOUT */ - aStrRowLabel ( ScResId( STR_ROW_LABEL ) ), - aStrColLabel ( ScResId( STR_COL_LABEL ) ), - aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ), - aStrNoName ( ScGlobal::GetRscString(STR_DB_NONAME) ), - // -#if !TEST_LAYOUT - nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ), - rSortData ( ((const ScSortItem&) - rArgSet.Get( nWhichSort )).GetSortData() ), -#else /* TEST_LAYOUT */ - nWhichSort ( 0 ), - rSortData ( *new ScSortParam() ), -#endif /* TEST_LAYOUT */ - pViewData ( NULL ), - pDoc ( NULL ), - pDlg ( (ScSortDlg*)(GetParent() ? GetParent()->GetParent() : 0 ) ), - pColRes ( NULL ), - pColWrap ( NULL ) -{ -#if TEST_LAYOUT - (void) rArgSet; -#endif /* TEST_LAYOUT */ - Init(); - FreeResource(); - SetExchangeSupport(); -} - -// ----------------------------------------------------------------------- - -ScTabPageSortOptions::~ScTabPageSortOptions() -{ -#if !TEST_LAYOUT - USHORT nEntries = aLbOutPos.GetEntryCount(); - - for ( USHORT i=1; i<nEntries; i++ ) - delete (String*)aLbOutPos.GetEntryData( i ); -#endif /* !TEST_LAYOUT */ - - delete pColRes; - delete pColWrap; //! not if from document -} - -// ----------------------------------------------------------------------- - -void ScTabPageSortOptions::Init() -{ -// aStrAreaLabel = aFtAreaLabel.GetText(); -// aStrAreaLabel.Append( (sal_Unicode) ' ' ); - - // CollatorRessource has user-visible names for sort algorithms - pColRes = new CollatorRessource(); - - //! use CollatorWrapper from document? - pColWrap = new CollatorWrapper( comphelper::getProcessServiceFactory() ); - -#if !TEST_LAYOUT - const ScSortItem& rSortItem = (const ScSortItem&) - GetItemSet().Get( nWhichSort ); -#endif /* !TEST_LAYOUT */ - - aLbOutPos.SetSelectHdl ( LINK( this, ScTabPageSortOptions, SelOutPosHdl ) ); - aBtnCopyResult.SetClickHdl( LINK( this, ScTabPageSortOptions, EnableHdl ) ); - aBtnSortUser.SetClickHdl ( LINK( this, ScTabPageSortOptions, EnableHdl ) ); - aBtnTopDown.SetClickHdl ( LINK( this, ScTabPageSortOptions, SortDirHdl ) ); - aBtnLeftRight.SetClickHdl ( LINK( this, ScTabPageSortOptions, SortDirHdl ) ); - aLbLanguage.SetSelectHdl ( LINK( this, ScTabPageSortOptions, FillAlgorHdl ) ); - -#if !TEST_LAYOUT - pViewData = rSortItem.GetViewData(); -#endif /* TEST_LAYOUT */ - pDoc = pViewData ? pViewData->GetDocument() : NULL; - - DBG_ASSERT( pViewData, "ViewData not found! :-/" ); - -#if !TEST_LAYOUT - if ( pViewData && pDoc ) - { - String theArea; - ScDBCollection* pDBColl = pDoc->GetDBCollection(); - String theDbArea; - String theDbName = aStrNoName; - const SCTAB nCurTab = pViewData->GetTabNo(); - const ScAddress::Convention eConv = pDoc->GetAddressConvention(); -#endif /* !TEST_LAYOUT */ - - aLbOutPos.Clear(); - aLbOutPos.InsertEntry( aStrUndefined, 0 ); - aLbOutPos.Disable(); - -#if !TEST_LAYOUT - ScAreaNameIterator aIter( pDoc ); - String aName; - ScRange aRange; - String aRefStr; - while ( aIter.Next( aName, aRange ) ) - { - USHORT nInsert = aLbOutPos.InsertEntry( aName ); - - aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv ); - aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) ); - } -#endif /* !TEST_LAYOUT */ - - aLbOutPos.SelectEntryPos( 0 ); - aEdOutPos.SetText( EMPTY_STRING ); - -#if !TEST_LAYOUT - /* - * Ueberpruefen, ob es sich bei dem uebergebenen - * Bereich um einen Datenbankbereich handelt: - */ - - ScAddress aScAddress( rSortData.nCol1, rSortData.nRow1, nCurTab ); - ScRange( aScAddress, - ScAddress( rSortData.nCol2, rSortData.nRow2, nCurTab ) - ).Format( theArea, SCR_ABS, pDoc, eConv ); - - if ( pDBColl ) - { - ScDBData* pDBData - = pDBColl->GetDBAtArea( nCurTab, - rSortData.nCol1, rSortData.nRow1, - rSortData.nCol2, rSortData.nRow2 ); - if ( pDBData ) - { - pDBData->GetName( theDbName ); - aBtnHeader.Check( pDBData->HasHeader() ); - } - } - - theArea.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" (")); - theArea += theDbName; - theArea += ')'; - - //aFtArea.SetText( theArea ); - //theArea.Insert( aStrAreaLabel, 0 ); - //aFtAreaLabel.SetText( theArea ); - - aBtnHeader.SetText( aStrColLabel ); - } -#endif /* TEST_LAYOUT */ - - FillUserSortListBox(); - - // get available languages - - aLbLanguage.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE ); - aLbLanguage.InsertLanguage( LANGUAGE_SYSTEM ); -} - -//------------------------------------------------------------------------ - -USHORT* ScTabPageSortOptions::GetRanges() -{ - return pSortRanges; -} - -// ----------------------------------------------------------------------- - -#if ENABLE_LAYOUT -#undef SfxTabPage -#endif /* ENABLE_LAYOUT */ -SfxTabPage* ScTabPageSortOptions::Create( - Window* pParent, - const SfxItemSet& rArgSet ) -{ - return ( new ScTabPageSortOptions( pParent, rArgSet ) ); -} - -// ----------------------------------------------------------------------- - -void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ ) -{ - if ( rSortData.bUserDef ) - { - aBtnSortUser.Check( TRUE ); - aLbSortUser.Enable(); - aLbSortUser.SelectEntryPos( rSortData.nUserIndex ); - } - else - { - aBtnSortUser.Check( FALSE ); - aLbSortUser.Disable(); - aLbSortUser.SelectEntryPos( 0 ); - } - - aBtnCase.Check ( rSortData.bCaseSens ); - aBtnFormats.Check ( rSortData.bIncludePattern ); - aBtnHeader.Check ( rSortData.bHasHeader ); - aBtnNaturalSort.Check ( rSortData.bNaturalSort ); - - if ( rSortData.bByRow ) - { - aBtnTopDown.Check(); - aBtnHeader.SetText( aStrColLabel ); - } - else - { - aBtnLeftRight.Check(); - aBtnHeader.SetText( aStrRowLabel ); - } - - LanguageType eLang = MsLangId::convertLocaleToLanguage( rSortData.aCollatorLocale ); - if ( eLang == LANGUAGE_DONTKNOW ) - eLang = LANGUAGE_SYSTEM; - aLbLanguage.SelectLanguage( eLang ); - FillAlgorHdl( &aLbLanguage ); // get algorithms, select default - if ( rSortData.aCollatorAlgorithm.Len() ) - aLbAlgorithm.SelectEntry( pColRes->GetTranslation( rSortData.aCollatorAlgorithm ) ); - - if ( pDoc && !rSortData.bInplace ) - { - String aStr; - USHORT nFormat = (rSortData.nDestTab != pViewData->GetTabNo()) - ? SCR_ABS_3D - : SCR_ABS; - - theOutPos.Set( rSortData.nDestCol, - rSortData.nDestRow, - rSortData.nDestTab ); - - theOutPos.Format( aStr, nFormat, pDoc, pDoc->GetAddressConvention() ); - aBtnCopyResult.Check(); - aLbOutPos.Enable(); - aEdOutPos.Enable(); - aEdOutPos.SetText( aStr ); - EdOutPosModHdl( &aEdOutPos ); - aEdOutPos.GrabFocus(); - aEdOutPos.SetSelection( Selection( 0, SELECTION_MAX ) ); - } - else - { - aBtnCopyResult.Check( FALSE ); - aLbOutPos.Disable(); - aEdOutPos.Disable(); - aEdOutPos.SetText( EMPTY_STRING ); - } -} - -// ----------------------------------------------------------------------- - -BOOL ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) -{ - ScSortParam theSortData = rSortData; - if (pDlg) - { - const SfxItemSet* pExample = pDlg->GetExampleSet(); - const SfxPoolItem* pItem; - if ( pExample && pExample->GetItemState( nWhichSort, TRUE, &pItem ) == SFX_ITEM_SET ) - theSortData = ((const ScSortItem*)pItem)->GetSortData(); - } - - theSortData.bByRow = aBtnTopDown.IsChecked(); - theSortData.bHasHeader = aBtnHeader.IsChecked(); - theSortData.bCaseSens = aBtnCase.IsChecked(); - theSortData.bNaturalSort = aBtnNaturalSort.IsChecked(); - theSortData.bIncludePattern = aBtnFormats.IsChecked(); - theSortData.bInplace = !aBtnCopyResult.IsChecked(); - theSortData.nDestCol = theOutPos.Col(); - theSortData.nDestRow = theOutPos.Row(); - theSortData.nDestTab = theOutPos.Tab(); - theSortData.bUserDef = aBtnSortUser.IsChecked(); - theSortData.nUserIndex = (aBtnSortUser.IsChecked()) - ? aLbSortUser.GetSelectEntryPos() - : 0; - - // get locale - LanguageType eLang = aLbLanguage.GetSelectLanguage(); - theSortData.aCollatorLocale = MsLangId::convertLanguageToLocale( eLang, false ); - - // get algorithm - String sAlg; - if ( eLang != LANGUAGE_SYSTEM ) - { - uno::Sequence<rtl::OUString> aAlgos = pColWrap->listCollatorAlgorithms( - theSortData.aCollatorLocale ); - USHORT nSel = aLbAlgorithm.GetSelectEntryPos(); - if ( nSel < aAlgos.getLength() ) - sAlg = aAlgos[nSel]; - } - theSortData.aCollatorAlgorithm = sAlg; - -#if !TEST_LAYOUT - rArgSet.Put( ScSortItem( SCITEM_SORTDATA, &theSortData ) ); -#endif /* TEST_LAYOUT */ - return TRUE; -} - -// ----------------------------------------------------------------------- - -// fuer Datenaustausch ohne Dialog-Umweg: (! noch zu tun !) -// void ScTabPageSortOptions::ActivatePage( const SfxItemSet& rSet ) -void ScTabPageSortOptions::ActivatePage() -{ - if ( pDlg ) - { - if ( aBtnHeader.IsChecked() != pDlg->GetHeaders() ) - { - aBtnHeader.Check( pDlg->GetHeaders() ); - } - - if ( aBtnTopDown.IsChecked() != pDlg->GetByRows() ) - { - aBtnTopDown.Check( pDlg->GetByRows() ); - aBtnLeftRight.Check( !pDlg->GetByRows() ); - } - - aBtnHeader.SetText( (pDlg->GetByRows()) - ? aStrColLabel - : aStrRowLabel ); - } -} - -// ----------------------------------------------------------------------- - -int ScTabPageSortOptions::DeactivatePage( SfxItemSet* pSetP ) -{ - BOOL bPosInputOk = TRUE; - - if ( aBtnCopyResult.IsChecked() ) - { - String thePosStr = aEdOutPos.GetText(); - ScAddress thePos; - xub_StrLen nColonPos = thePosStr.Search( ':' ); - - if ( STRING_NOTFOUND != nColonPos ) - thePosStr.Erase( nColonPos ); - - if ( pViewData ) - { - // visible table is default for input without table - // must be changed to GetRefTabNo when sorting has RefInput! - thePos.SetTab( pViewData->GetTabNo() ); - } - - USHORT nResult = thePos.Parse( thePosStr, pDoc, pDoc->GetAddressConvention() ); - - bPosInputOk = ( SCA_VALID == (nResult & SCA_VALID) ); - - if ( !bPosInputOk ) - { -#if !ENABLE_LAYOUT - ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ), - ScGlobal::GetRscString( STR_INVALID_TABREF ) - ).Execute(); -#endif /* ENABLE_LAYOUT */ - aEdOutPos.GrabFocus(); - aEdOutPos.SetSelection( Selection( 0, SELECTION_MAX ) ); - theOutPos.Set(0,0,0); - } - else - { - aEdOutPos.SetText( thePosStr ); - theOutPos = thePos; - } - } - - if ( pDlg && bPosInputOk ) - { - pDlg->SetHeaders( aBtnHeader.IsChecked() ); - pDlg->SetByRows ( aBtnTopDown.IsChecked() ); - } - - if ( pSetP && bPosInputOk ) - FillItemSet( *pSetP ); - - return bPosInputOk ? SfxTabPage::LEAVE_PAGE : SfxTabPage::KEEP_PAGE; -} - -// ----------------------------------------------------------------------- - -void ScTabPageSortOptions::FillUserSortListBox() -{ - ScUserList* pUserLists = ScGlobal::GetUserList(); - - aLbSortUser.Clear(); - if ( pUserLists ) - { - USHORT nCount = pUserLists->GetCount(); - if ( nCount > 0 ) - for ( USHORT i=0; i<nCount; i++ ) - aLbSortUser.InsertEntry( (*pUserLists)[i]->GetString() ); - } -} - -// ----------------------------------------------------------------------- -// Handler: - -IMPL_LINK( ScTabPageSortOptions, EnableHdl, CheckBox *, pBox ) -{ - if ( pBox == &aBtnCopyResult ) - { - if ( pBox->IsChecked() ) - { - aLbOutPos.Enable(); - aEdOutPos.Enable(); - aEdOutPos.GrabFocus(); - } - else - { - aLbOutPos.Disable(); - aEdOutPos.Disable(); - } - } - else if ( pBox == &aBtnSortUser ) - { - if ( pBox->IsChecked() ) - { - aLbSortUser.Enable(); - aLbSortUser.GrabFocus(); - } - else - aLbSortUser.Disable(); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( ScTabPageSortOptions, SelOutPosHdl, ListBox *, pLb ) -{ - if ( pLb == &aLbOutPos ) - { - String aString; - USHORT nSelPos = aLbOutPos.GetSelectEntryPos(); - - if ( nSelPos > 0 ) - aString = *(String*)aLbOutPos.GetEntryData( nSelPos ); - - aEdOutPos.SetText( aString ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( ScTabPageSortOptions, SortDirHdl, RadioButton *, pBtn ) -{ - if ( pBtn == &aBtnTopDown ) - { - aBtnHeader.SetText( aStrColLabel ); - } - else if ( pBtn == &aBtnLeftRight ) - { - aBtnHeader.SetText( aStrRowLabel ); - } - return 0; -} - -// ----------------------------------------------------------------------- - -void ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd ) -{ - if ( pEd == &aEdOutPos ) - { - String theCurPosStr = aEdOutPos.GetText(); - USHORT nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() ); - - if ( SCA_VALID == (nResult & SCA_VALID) ) - { - String* pStr = NULL; - BOOL bFound = FALSE; - USHORT i = 0; - USHORT nCount = aLbOutPos.GetEntryCount(); - - for ( i=2; i<nCount && !bFound; i++ ) - { - pStr = (String*)aLbOutPos.GetEntryData( i ); - bFound = (theCurPosStr == *pStr); - } - - if ( bFound ) - aLbOutPos.SelectEntryPos( --i ); - else - aLbOutPos.SelectEntryPos( 0 ); - } - } -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG ) -{ - aLbAlgorithm.SetUpdateMode( FALSE ); - aLbAlgorithm.Clear(); - - LanguageType eLang = aLbLanguage.GetSelectLanguage(); - if ( eLang == LANGUAGE_SYSTEM ) - { - // for LANGUAGE_SYSTEM no algorithm can be selected because - // it wouldn't necessarily exist for other languages - // -> leave list box empty if LANGUAGE_SYSTEM is selected - aFtAlgorithm.Enable( FALSE ); // nothing to select - aLbAlgorithm.Enable( FALSE ); // nothing to select - } - else - { - lang::Locale aLocale( MsLangId::convertLanguageToLocale( eLang )); - uno::Sequence<rtl::OUString> aAlgos = pColWrap->listCollatorAlgorithms( aLocale ); - - long nCount = aAlgos.getLength(); - const rtl::OUString* pArray = aAlgos.getConstArray(); - for (long i=0; i<nCount; i++) - { - String sAlg = pArray[i]; - String sUser = pColRes->GetTranslation( sAlg ); - aLbAlgorithm.InsertEntry( sUser, LISTBOX_APPEND ); - } - aLbAlgorithm.SelectEntryPos( 0 ); // first entry is default - aFtAlgorithm.Enable( nCount > 1 ); // enable only if there is a choice - aLbAlgorithm.Enable( nCount > 1 ); // enable only if there is a choice - } - - aLbAlgorithm.SetUpdateMode( TRUE ); - return 0; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/tpsort.hxx b/toolkit/workben/layout/tpsort.hxx deleted file mode 100644 index 64e4f4b6de42..000000000000 --- a/toolkit/workben/layout/tpsort.hxx +++ /dev/null @@ -1,219 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SC_TPSORT_HXX -#define SC_TPSORT_HXX - - -#include <sfx2/tabdlg.hxx> -#include <vcl/edit.hxx> -#include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> -#include <svtools/stdctrl.hxx> -#include <svx/langbox.hxx> - - -#include "global.hxx" -#include "address.hxx" - -//------------------------------------------------------------------------ - -// +1 because one field is reserved for the "- undefined -" entry -#define SC_MAXFIELDS MAXCOLCOUNT+1 - -class ScViewData; -class ScSortDlg; -struct ScSortParam; - -//======================================================================== -// Kriterien (Sort Criteria) - -class ScTabPageSortFields : public SfxTabPage -{ -public: - ScTabPageSortFields( Window* pParent, - const SfxItemSet& rArgSet ); - ~ScTabPageSortFields(); - - static SfxTabPage* Create ( Window* pParent, - const SfxItemSet& rArgSet ); - static USHORT* GetRanges (); - virtual BOOL FillItemSet ( SfxItemSet& rArgSet ); - virtual void Reset ( const SfxItemSet& rArgSet ); - -protected: -// fuer Datenaustausch (sollte noch umgestellt werden!) -// virtual void ActivatePage ( const SfxItemSet& rSet ); - using SfxTabPage::ActivatePage; - using SfxTabPage::DeactivatePage; - virtual void ActivatePage (); - virtual int DeactivatePage ( SfxItemSet* pSet = 0); - -private: - FixedLine aFlSort1; - ListBox aLbSort1; - RadioButton aBtnUp1; - RadioButton aBtnDown1; - - FixedLine aFlSort2; - ListBox aLbSort2; - RadioButton aBtnUp2; - RadioButton aBtnDown2; - - FixedLine aFlSort3; - ListBox aLbSort3; - RadioButton aBtnUp3; - RadioButton aBtnDown3; - - String aStrUndefined; - String aStrColumn; - String aStrRow; - - const USHORT nWhichSort; - ScSortDlg* pDlg; - ScViewData* pViewData; - const ScSortParam& rSortData; - SCCOLROW nFieldArr[SC_MAXFIELDS]; - USHORT nFieldCount; - SCCOL nFirstCol; - SCROW nFirstRow; - BOOL bHasHeader; - BOOL bSortByRows; - - ListBox* aSortLbArr[3]; - RadioButton* aDirBtnArr[3][2]; - FixedLine* aFlArr[3]; - -#ifdef _TPSORT_CXX -private: - void Init (); - void DisableField ( USHORT nField ); - void EnableField ( USHORT nField ); - void FillFieldLists (); - USHORT GetFieldSelPos ( SCCOLROW nField ); - - // Handler ------------------------ - DECL_LINK( SelectHdl, ListBox * ); -#endif -}; - -//======================================================================== -// Sortieroptionen (Sort Options) - -class ScDocument; -class ScRangeData; -class CollatorRessource; -class CollatorWrapper; - -#include <sfx2/layout.hxx> -#include <layout/layout-pre.hxx> - -class ScTabPageSortOptions : public SfxTabPage -{ -public: - ScTabPageSortOptions( Window* pParent, - const SfxItemSet& rArgSet ); - ~ScTabPageSortOptions(); - -#undef SfxTabPage -#define SfxTabPage ::SfxTabPage - static SfxTabPage* Create ( Window* pParent, - const SfxItemSet& rArgSet ); - static USHORT* GetRanges (); - virtual BOOL FillItemSet ( SfxItemSet& rArgSet ); - virtual void Reset ( const SfxItemSet& rArgSet ); - -protected: -// fuer Datenaustausch (sollte noch umgestellt werden!) -// virtual void ActivatePage ( const SfxItemSet& rSet ); - using SfxTabPage::ActivatePage; - using SfxTabPage::DeactivatePage; - virtual void ActivatePage (); - virtual int DeactivatePage ( SfxItemSet* pSet = 0); - -private: - - CheckBox aBtnCase; - CheckBox aBtnHeader; - CheckBox aBtnFormats; - CheckBox aBtnCopyResult; - - CheckBox aBtnNaturalSort; - ListBox aLbOutPos; - Edit aEdOutPos; - - CheckBox aBtnSortUser; - ListBox aLbSortUser; - - FixedText aFtLanguage; - SvxLanguageBox aLbLanguage; - FixedText aFtAlgorithm; - ListBox aLbAlgorithm; - - FixedLine aLineDirection; - RadioButton aBtnTopDown; - RadioButton aBtnLeftRight; - -// FixedText aFtAreaLabel; -// FixedInfo aFtArea; - LocalizedString aStrRowLabel; - LocalizedString aStrColLabel; - LocalizedString aStrUndefined; - String aStrNoName; - String aStrAreaLabel; - - const USHORT nWhichSort; - const ScSortParam& rSortData; - ScViewData* pViewData; - ScDocument* pDoc; - ScSortDlg* pDlg; - ScAddress theOutPos; - - CollatorRessource* pColRes; - CollatorWrapper* pColWrap; - -#ifdef _TPSORT_CXX -private: - void Init (); - void FillUserSortListBox (); - void FillOutPosList (); - - // Handler ------------------------ - DECL_LINK( EnableHdl, CheckBox * ); - DECL_LINK( SelOutPosHdl, ListBox * ); - void EdOutPosModHdl ( Edit* pEd ); - DECL_LINK( SortDirHdl, RadioButton * ); - DECL_LINK( FillAlgorHdl, void * ); -#endif -}; - -#include <layout/layout-post.hxx> - -#endif // SC_TPSORT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/un-test.sh b/toolkit/workben/layout/un-test.sh deleted file mode 100644 index ef2518ffa1b8..000000000000 --- a/toolkit/workben/layout/un-test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /bin/sh - -# un-test.sh: remove TEST_LAYOUT code from OO.o implementation - -sed -e 's!^#!@!' < $1\ - -e 's!$! /*$*/!' \ - -e 's!^@\(.*TEST_LAYOUT\)!#\1!'\ - | tee i \ - | cpp -traditional -C -CC -DNON_LAYOUT_COMPILE_FIXES=1 \ - | grep -F '/*$*/' \ - | sed -e 's! /\*\$\*/!!' \ - -e 's!^@!#!' \ - -e 's!#define 1 1!#define NON_LAYOUT_COMPILE_FIXES 1!' - diff --git a/toolkit/workben/layout/uno.hxx b/toolkit/workben/layout/uno.hxx deleted file mode 100644 index 94a70e9fdc1e..000000000000 --- a/toolkit/workben/layout/uno.hxx +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _LAYOUT_UNO_HXX -#define _LAYOUT_UNO_HXX - -#include <cstdio> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> - -#include <layout/core/root.hxx> -#include <layout/core/factory.hxx> - -#if LAYOUT_WEAK -#include <cppuhelper/implbase1.hxx> -class UnoBootstrapLayout : public ::cppu::WeakImplHelper1< com::sun::star::lang::XMultiServiceFactory > -#else /* !LAYOUT_WEAK */ -class UnoBootstrapLayout : public com::sun::star::lang::XMultiServiceFactory -#endif /* LAYOUT_WEAK */ -{ -public: - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF; - UnoBootstrapLayout( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xMSF ) - : mxMSF( xMSF ) - { - fprintf( stderr, "UnoBootstrap Layout\n" ); - } - virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL - createInstance( const rtl::OUString& aServiceSpecifier ) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) - { - if ( aServiceSpecifier.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.awt.Layout" ) ) ) - { - fprintf( stderr, "UnoBootstrapLayout: create service '%s'\n", - rtl::OUStringToOString (aServiceSpecifier, RTL_TEXTENCODING_UTF8 ).getStr() ); - return com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory >( new ::LayoutFactory( this ) ); - } - else - { - fprintf( stderr, "UnoBootstrapLayout: create service '%s'\n", - rtl::OUStringToOString (aServiceSpecifier, RTL_TEXTENCODING_UTF8 ).getStr() ); - try - { - return mxMSF->createInstance( aServiceSpecifier ); - } - catch ( const com::sun::star::uno::Exception &rExc ) - { - rtl::OString aStr( rtl::OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) ); - fprintf( stderr, "service construction exception '%s'\n", aStr.getStr()); - throw rExc; - } - } - } - virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL - createInstanceWithArguments( const rtl::OUString& ServiceSpecifier, const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& Arguments ) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException) - { - return mxMSF->createInstanceWithArguments( ServiceSpecifier, Arguments ); - } - virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL - getAvailableServiceNames() throw (com::sun::star::uno::RuntimeException) - { - return mxMSF->getAvailableServiceNames(); - } - -#if !LAYOUT_WEAK - // XInterface - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) - { - return mxMSF->queryInterface( rType ); - } - virtual void SAL_CALL acquire() throw() - { - mxMSF->acquire(); - } - virtual void SAL_CALL release() throw() - { - mxMSF->release(); - } -#endif /* !LAYOUT_WEAK */ -}; - -#endif /* _LAYOUT_UNO_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/wordcount-plain.xml b/toolkit/workben/layout/wordcount-plain.xml deleted file mode 100644 index 5adce42acdbd..000000000000 --- a/toolkit/workben/layout/wordcount-plain.xml +++ /dev/null @@ -1,37 +0,0 @@ - - -<modaldialog sizeable="true" height="132" help-id="HID_DLG_WORDCOUNT" moveable="true" output-size="true" id="DLG_WORDCOUNT" sv-look="true" text="Word Count" width="170" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> - <vbox> - <fixedline height="8" id="FL_CURRENT" text="Current selection" width="158" x="6" y="3"/> - <hbox> - <fixedtext height="8" id="FT_CURRENTWORD" label="Words:" width="80" x="12" y="14"/> - <fixedtext height="8" id="FI_CURRENTWORD" right="true" width="50" x="111" y="14"/> - </hbox> - <hbox> - <fixedtext height="8" id="FT_CURRENTCHARACTER" label="Characters:" width="80" x="12" y="26"/> - <fixedtext height="8" id="FI_CURRENTCHARACTER" right="true" width="50" x="111" y="26"/> - </hbox> - <hbox> - <fixedtext height="8" id="FT_CURRENTCHARACTEREXCLUDINGSPACES" label="Characters excluding spaces:" width="80" x="12" y="38"/> - <fixedtext height="8" id="FI_CURRENTCHARACTEREXCLUDINGSPACES" right="true" width="50" x="111" y="38"/> - </hbox> - <fixedline height="8" id="FL_DOC" text="Whole document" width="158" x="6" y="52"/> - <hbox> - <fixedtext height="8" id="FT_DOCWORD" label="Words:" width="80" x="12" y="63"/> - <fixedtext height="8" id="FI_DOCWORD" right="true" width="50" x="111" y="63"/> - </hbox> - <hbox> - <fixedtext height="8" id="FT_DOCCHARACTER" label="Characters:" width="80" x="12" y="75"/> - <fixedtext height="8" id="FI_DOCCHARACTER" right="true" width="50" x="111" y="75"/> - </hbox> - <hbox> - <fixedtext height="8" id="FT_DOCCHARACTEREXCLUDINGSPACES" label="Characters excluding spaces:" width="80" x="12" y="87"/> - <fixedtext height="8" id="FI_DOCCHARACTEREXCLUDINGSPACES" right="true" width="50" x="111" y="87"/> - </hbox> - <fixedline height="8" id="FL_BOTTOM" width="158" x="6" y="101"/> - <hbox> - <okbutton defbutton="true" height="14" id="PB_OK" width="50" x="61" y="112"/> - <helpbutton height="14" id="PB_HELP" width="50" x="114" y="112"/> - </hbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/wordcount-tight.xml b/toolkit/workben/layout/wordcount-tight.xml deleted file mode 100644 index bcf6a6d86fca..000000000000 --- a/toolkit/workben/layout/wordcount-tight.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - help-id="HID_DLG_WORDCOUNT" - id="dialog" - sizeable="true" moveable="true" optimumsize="true" - has_border="true" sv-look="true" title="Word Count"> - <vbox border="5" spacing="5"> - <fixedline id="FL_CURRENT" text="Current selection"/> - <hbox> - <fixedtext id="FT_CURRENTWORD" label="Words:" cnt:padding="13"/> - <fixedinfo id="FI_CURRENTWORD" right="true" label="0" cnt:padding="13"/> - </hbox> - <hbox> - <fixedtext id="FT_CURRENTCHARACTER" label="Characters:" cnt:padding="13"/> - <fixedinfo id="FI_CURRENTCHARACTER" right="true" label="00" cnt:padding="13"/> - </hbox> - <hbox> - <fixedtext id="FT_CURRENTCHARACTEREXCLUDINGSPACES" label="Characters excluding spaces:" cnt:padding="13"/> - <fixedinfo id="FI_CURRENTCHARACTEREXCLUDINGSPACES" right="true" label="000" cnt:padding="13"/> - </hbox> - <fixedline id="FL_DOC" text="Whole document"/> - <hbox> - <fixedtext id="FT_DOCWORD" label="Words:" cnt:padding="13"/> - <fixedinfo id="FI_DOCWORD" right="true" label="0000" cnt:padding="13"/> - </hbox> - <hbox> - <fixedtext id="FT_DOCCHARACTER" label="Characters:" cnt:padding="13"/> - <fixedinfo id="FI_DOCCHARACTER" right="true" label="00000" cnt:padding="13"/> - </hbox> - <hbox> - <fixedtext id="FT_DOCCHARACTEREXCLUDINGSPACES" label="Characters excluding spaces:" cnt:padding="13"/> - <fixedinfo id="FI_DOCCHARACTEREXCLUDINGSPACES" right="true" label="000000" cnt:padding="13"/> - </hbox> - <fixedline cnt:padding="1" id="FL_BOTTOM"/> - <hbox border="5"> - <flow homogeneous="true"/> - <okbutton id="PB_OK" cnt:expand="false" defbutton="true"/> - <helpbutton id="PB_HELP" cnt:expand="false"/> - </hbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/wordcount.xml b/toolkit/workben/layout/wordcount.xml deleted file mode 100644 index 4b4e362e8583..000000000000 --- a/toolkit/workben/layout/wordcount.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated xml files are generated from this template by - transex3/layout/tralay. !--> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - help-id="HID_DLG_WORDCOUNT" - id="DLG_WORDCOUNT" - sizeable="true" moveable="true" optimumsize="true" closeable="true" - has_border="true" sv-look="true" _title="Word Count"> - <vbox border="12" spacing="6"> - <fixedline id="FL_CURRENT" _text="Current selection"/> - <hbox> - <vbox cnt:padding="12" spacing="6"> - <hbox> - <fixedtext id="FT_CURRENTWORD" _label="Words:"/> - <flow cnt:padding="60"/> - <fixedtext id="FI_CURRENTWORD" right="true" _label="0"/> - </hbox> - <hbox> - <fixedtext id="FT_CURRENTCHARACTER" _label="Characters:"/> - <flow cnt:padding="60"/> - <fixedtext id="FI_CURRENTCHARACTER" right="true" _label="00"/> - </hbox> - <hbox> - <fixedtext id="FT_CURRENTCHARACTEREXCLUDINGSPACES" _label="Characters excluding spaces:"/> - <flow cnt:padding="60"/> - <fixedtext id="FI_CURRENTCHARACTEREXCLUDINGSPACES" right="true" _label="000"/> - </hbox> - </vbox> - </hbox> - <!-- if we could do cnt:cnt:padding="-12" here, we would not have to close - and reopen the hbox/vbox thing !--> - <fixedline id="FL_DOC" _text="Whole document"/> - <hbox> - <vbox cnt:padding="12" spacing="6"> - <hbox> - <fixedtext id="FT_DOCWORD" _label="Words:"/> - <fixedtext id="FI_DOCWORD" right="true" _label="0000"/> - </hbox> - <hbox> - <fixedtext id="FT_DOCCHARACTER" _label="Characters:"/> - <fixedtext id="FI_DOCCHARACTER" right="true" _label="00000"/> - </hbox> - <hbox> - <fixedtext id="FT_DOCCHARACTEREXCLUDINGSPACES" _label="Characters excluding spaces:"/> - <fixedtext id="FI_DOCCHARACTEREXCLUDINGSPACES" right="true" _label="000000"/> - </hbox> - </vbox> - </hbox> - <fixedline cnt:padding="1" id="FL_BOTTOM"/> - <dialogbuttonhbox spacing="12"> - <flow/> - <okbutton defbutton="true" id="PB_OK"/> - <helpbutton id="PB_HELP"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/wordcountdialog.cxx b/toolkit/workben/layout/wordcountdialog.cxx deleted file mode 100644 index da0083e09456..000000000000 --- a/toolkit/workben/layout/wordcountdialog.cxx +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#if !TEST_LAYOUT -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" -#ifdef SW_DLLIMPLEMENTATION -#undef SW_DLLIMPLEMENTATION -#endif -#include <swtypes.hxx> -#endif /* !TEST_LAYOUT */ -#include <wordcountdialog.hxx> -#if !TEST_LAYOUT -#include <docstat.hxx> - -#include <dialog.hrc> -#endif /* !TEST_LAYOUT */ -#include <layout/layout-pre.hxx> -#if !TEST_LAYOUT -#include <wordcountdialog.hrc> -#endif /* !TEST_LAYOUT */ - -#if ENABLE_LAYOUT -#undef SW_RES -#define SW_RES(x) #x -#undef SfxModalDialog -#define SfxModalDialog( parent, id ) Dialog( parent, "wordcount.xml", id ) -#define SW_WORDCOUNTDIALOG_HRC -#include <helpid.h> -#endif /* ENABLE_LAYOUT */ - -SwWordCountDialog::SwWordCountDialog(Window* pParent) : - SfxModalDialog(pParent, SW_RES(DLG_WORDCOUNT)), -#if defined _MSC_VER -#pragma warning (disable : 4355) -#endif - aCurrentFL( this, SW_RES( FL_CURRENT )), - aCurrentWordFT( this, SW_RES( FT_CURRENTWORD )), - aCurrentWordFI( this, SW_RES( FI_CURRENTWORD )), - aCurrentCharacterFT( this, SW_RES( FT_CURRENTCHARACTER )), - aCurrentCharacterFI( this, SW_RES( FI_CURRENTCHARACTER )), - aCurrentCharacterExcludingSpacesFT( this, SW_RES( FT_CURRENTCHARACTEREXCLUDINGSPACES )), - aCurrentCharacterExcludingSpacesFI( this, SW_RES( FI_CURRENTCHARACTEREXCLUDINGSPACES )), - - aDocFL( this, SW_RES( FL_DOC )), - aDocWordFT( this, SW_RES( FT_DOCWORD )), - aDocWordFI( this, SW_RES( FI_DOCWORD )), - aDocCharacterFT( this, SW_RES( FT_DOCCHARACTER )), - aDocCharacterFI( this, SW_RES( FI_DOCCHARACTER )), - aDocCharacterExcludingSpacesFT( this, SW_RES( FT_DOCCHARACTEREXCLUDINGSPACES )), - aDocCharacterExcludingSpacesFI( this, SW_RES( FI_DOCCHARACTEREXCLUDINGSPACES )), - aBottomFL(this, SW_RES( FL_BOTTOM )), - aOK( this, SW_RES( PB_OK )), - aHelp( this, SW_RES( PB_HELP )) -#if defined _MSC_VER -#pragma warning (default : 4355) -#endif -{ -#if ENABLE_LAYOUT - SetHelpId (HID_DLG_WORDCOUNT); -#endif /* ENABLE_LAYOUT */ - FreeResource(); -} - -SwWordCountDialog::~SwWordCountDialog() -{ -} - -void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) -{ -#if TEST_LAYOUT - (void) rCurrent; - (void) rDoc; -#else /* !TEST_LAYOUT */ - aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord )); - aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar )); - aCurrentCharacterExcludingSpacesFI.SetText(String::CreateFromInt32(rCurrent.nCharExcludingSpaces )); - aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord )); - aDocCharacterFI.SetText( String::CreateFromInt32(rDoc.nChar )); - aDocCharacterExcludingSpacesFI.SetText( String::CreateFromInt32(rDoc.nCharExcludingSpaces )); -#endif /* !TEST_LAYOUT */ -} - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/wordcountdialog.hxx b/toolkit/workben/layout/wordcountdialog.hxx deleted file mode 100644 index 5c6dbabea04f..000000000000 --- a/toolkit/workben/layout/wordcountdialog.hxx +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef SW_WORDCOUNTDIALOG_HXX -#define SW_WORDCOUNTDIALOG_HXX -#include <sfx2/basedlgs.hxx> -#include <svtools/stdctrl.hxx> -#include <vcl/button.hxx> -#include <layout/layout.hxx> -#include <layout/layout-pre.hxx> -struct SwDocStat; -class SwWordCountDialog : public SfxModalDialog -{ - FixedLine aCurrentFL; - FixedText aCurrentWordFT; - FixedInfo aCurrentWordFI; - FixedText aCurrentCharacterFT; - FixedInfo aCurrentCharacterFI; - FixedText aCurrentCharacterExcludingSpacesFT; - FixedInfo aCurrentCharacterExcludingSpacesFI; - - FixedLine aDocFL; - FixedText aDocWordFT; - FixedInfo aDocWordFI; - FixedText aDocCharacterFT; - FixedInfo aDocCharacterFI; - FixedText aDocCharacterExcludingSpacesFT; - FixedInfo aDocCharacterExcludingSpacesFI; - - FixedLine aBottomFL; - - OKButton aOK; - HelpButton aHelp; - -public: - SwWordCountDialog(Window* pParent); - ~SwWordCountDialog(); - - void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc); -}; - -#include <layout/layout-post.hxx> - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/zoom-1.xml b/toolkit/workben/layout/zoom-1.xml deleted file mode 100644 index 5fe06a3f270e..000000000000 --- a/toolkit/workben/layout/zoom-1.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" optimumsize="true" - help-id="SID_ATTR_ZOOM" - has_border="true" sizeable="true" moveable="true"> - <title id="tit" xml-lang="en-US">Set Zoom</title> - <vbox spacing="5" border="5"> - <fixedline id="FL_ZOOM" cnt:expand="true" xml-lang="en-US">Zoom factor</fixedline> - <radiobutton radiogroup="zoom" id="BTN_WHOLE_PAGE" xml-lang="en-US">Whole Page</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_PAGE_WIDTH" xml-lang="en-US">Page Width</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_OPTIMAL" xml-lang="en-US">Optimal</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_200" xml-lang="en-US">200 %</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_150" xml-lang="en-US">15~0 %</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_100" xml-lang="en-US">100 %</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_75" xml-lang="en-US">75 %</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_50" xml-lang="en-US">50 %</radiobutton> - <hbox cnt:expand="false" cnt:fill="true"> - <align cnt:expand="false" cnt:fill="true"> - <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom" id="BTN_USER" xml-lang="en-US">Variable</radiobutton> - </align> - <flow cnt:padding="10" cnt:expand="false"/> - <metricfield id="ED_USER" value-step="1" - repeat="true" has_border="true" spin="true" - text="100%" unit="13" custom-unit-text="%" - right="true" - cnt:expand="false"/> - </hbox> - <fixedline cnt:padding="1" id="FL_BOTTOM"/> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <okbutton id="BTN_ZOOM_OK"/> - <cancelbutton id="BTN_ZOOM_CANCEL"/> - <helpbutton id="BTN_ZOOM_HELP"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/zoom-2.xml b/toolkit/workben/layout/zoom-2.xml deleted file mode 100644 index c74e0c9a9da7..000000000000 --- a/toolkit/workben/layout/zoom-2.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" optimumsize="true" - help-id="SID_ATTR_ZOOM" - has_border="true" sizeable="true" moveable="true" - xml-lang="en-US"> - Set Zoom - <vbox spacing="5" border="5"> - <fixedline id="FL_ZOOM" cnt:expand="true" xml-lang="en-US">Zoom factor</fixedline> - <radiobutton radiogroup="zoom" id="BTN_WHOLE_PAGE" xml-lang="en-US">Whole Page</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_PAGE_WIDTH" xml-lang="en-US">Page Width</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_OPTIMAL" xml-lang="en-US">Optimal</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_200" xml-lang="en-US">200 %</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_150" xml-lang="en-US">15~0 %</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_100" xml-lang="en-US">100 %</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_75" xml-lang="en-US">75 %</radiobutton> - <radiobutton radiogroup="zoom" id="BTN_50" xml-lang="en-US">50 %</radiobutton> - <hbox cnt:expand="false" cnt:fill="true"> - <align cnt:expand="false" cnt:fill="true"> - <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom" id="BTN_USER" xml-lang="en-US">Variable</radiobutton> - </align> - <flow cnt:padding="10" cnt:expand="false"/> - <metricfield id="ED_USER" value-step="1" - repeat="true" has_border="true" spin="true" - text="100%" unit="13" custom-unit-text="%" - right="true" - cnt:expand="false"/> - </hbox> - <fixedline cnt:padding="1" id="FL_BOTTOM"/> - <dialogbuttonhbox border="5" spacing="5"> - <flow/> - <okbutton id="BTN_ZOOM_OK"/> - <cancelbutton id="BTN_ZOOM_CANCEL"/> - <helpbutton id="BTN_ZOOM_HELP"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/zoom-indent.xml b/toolkit/workben/layout/zoom-indent.xml deleted file mode 100644 index bd5853acdce4..000000000000 --- a/toolkit/workben/layout/zoom-indent.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="dialog" title="Set Zoom" optimumsize="true" - help-id="SID_ATTR_ZOOM" - has_border="true" sizeable="true" moveable="true"> - <hbox border="5" spacing="0"> - <vbox spacing="0"> - <fixedline id="FixedLine" text="Zoom factor" cnt:expand="true"/> - <hbox> <!-- for left margin !--> - <vbox cnt:padding="13" spacing="4" cnt:expand="true"> - <radiobutton radiogroup="zoom" id="WholePage" label="Whole Page"/> - <radiobutton radiogroup="zoom" id="PageWidth" label="Page Width"/> - <radiobutton radiogroup="zoom" id="Optimal" label="Optimal"/> - <radiobutton radiogroup="zoom" id="Zoom200" label="~200 %"/> - <radiobutton radiogroup="zoom" id="Zoom150" label="15~0 %"/> - <radiobutton radiogroup="zoom" id="Zoom100" label="~100 %"/> - <radiobutton radiogroup="zoom" id="Zoom75" label="~75 %"/> - <radiobutton radiogroup="zoom" id="Zoom50" label="~50 %"/> - <hbox cnt:expand="false"> - <align cnt:expand="false"> - <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom" id="BtnUser" label="~Variable"/> - </align> - <flow cnt:padding="10" cnt:expand="false"/> - <metricfield id="User" value-step="1" - repeat="true" has_border="true" spin="true" - text="100%" unit="11" custom-unit-text="%" - right="true"/> - <flow cnt:padding="10" cnt:expand="true"/> - </hbox> - </vbox> - </hbox> - </vbox> - <vbox border="6" spacing="4"> - <okbutton id="OkButton" cnt:expand="false" defbutton="true"/> - <cancelbutton id="CancelButton" cnt:expand="false"/> - <helpbutton id="HelpButton" cnt:expand="false"/> - </vbox> - </hbox> -</modaldialog> diff --git a/toolkit/workben/layout/zoom-plain.xml b/toolkit/workben/layout/zoom-plain.xml deleted file mode 100644 index c8383b8767a7..000000000000 --- a/toolkit/workben/layout/zoom-plain.xml +++ /dev/null @@ -1,20 +0,0 @@ - - -<modaldialog sizeable="true" height="142" help-id="SID_ATTR_ZOOM" moveable="true" output-size="true" id="RID_SVXDLG_ZOOM" sv-look="true" text="Zoom" width="160" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> - <vbox> - <fixedline height="8" id="FL_ZOOM" text="Zoom factor" width="92" x="6" y="3"/> - <okbutton defbutton="true" height="14" id="BTN_ZOOM_OK" width="50" x="104" y="6"/> - <radiobutton height="10" id="BTN_WHOLE_PAGE" width="80" x="12" y="14"/> - <cancelbutton height="14" id="BTN_ZOOM_CANCEL" width="50" x="104" y="23"/> - <radiobutton height="10" id="BTN_PAGE_WIDTH" width="80" x="12" y="27"/> - <radiobutton height="10" id="BTN_OPTIMAL" width="80" x="12" y="40"/> - <helpbutton height="14" id="BTN_ZOOM_HELP" width="50" x="104" y="43"/> - <radiobutton height="10" id="BTN_200" label="~200 %" width="80" x="12" y="53"/> - <radiobutton height="10" id="BTN_150" label="15~0 %" width="80" x="12" y="66"/> - <radiobutton height="10" id="BTN_100" label="~100 %" width="80" x="12" y="79"/> - <radiobutton height="10" id="BTN_75" label="~75 %" width="80" x="12" y="92"/> - <radiobutton height="10" id="BTN_50" label="~50 %" width="80" x="12" y="105"/> - <metricfield has_border="true" custom-unit-text="%" group="true" height="12" left="true" repeat="true" id="ED_USER" spin="true" step-size="1" unit="FUNIT_CUSTOM" width="36" x="56" y="120"/> - <radiobutton height="10" id="BTN_USER" label="~Variable" width="42" x="12" y="121"/> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/zoom.cxx b/toolkit/workben/layout/zoom.cxx deleted file mode 100644 index d05074908475..000000000000 --- a/toolkit/workben/layout/zoom.cxx +++ /dev/null @@ -1,614 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#if !TEST_LAYOUT -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svx.hxx" -#endif /* !TEST_LAYOUT */ - -#ifdef SVX_DLLIMPLEMENTATION -#undef SVX_DLLIMPLEMENTATION -#endif - -// include --------------------------------------------------------------- - -#if TEST_LAYOUT -#include <cstdio> -#endif /* TEST_LAYOUT */ -#include <tools/shl.hxx> -#include <svtools/itemset.hxx> -#include <svtools/itempool.hxx> -#include <sfx2/objsh.hxx> -#include <vcl/msgbox.hxx> - -#define _SVX_ZOOM_CXX - -#include <svx/dialogs.hrc> -#if !TEST_LAYOUT -#include "zoom.hrc" -#endif /* !TEST_LAYOUT */ - -#include "zoom.hxx" -#if TEST_LAYOUT -#define SVX_ZOOM_OPTIMAL "Zoom optimal" -#define SVX_ZOOM_PAGEWIDTH "Zoom page width" -#define SVX_ZOOM_WHOLEPAGE "Zoom whole page" -struct SvxZoomItem -{ - void SetType( char const* s ) - { - fputs( s, stderr ); - } - - void SetValue( int n ) - { - fprintf( stderr, "Zoom factor: %d\n", int( n ) ); - } -}; -#define SfxPoolItem LAYOUT_SfxPoolItem -class LAYOUT_SfxPoolItem -{ -}; -struct SvxViewLayoutItem : public LAYOUT_SfxPoolItem -{ - bool IsBookMode() - { - return false; - } - USHORT GetValue() - { - return 0; - } - - void SetValue( int n ) - { - fprintf( stderr, "Zoom factor: %d\n", int( n ) ); - } - void SetBookMode( bool ) - { - } -}; -#else /* !TEST_LAYOUT */ -#include <svx/zoomitem.hxx> -#include <svx/viewlayoutitem.hxx> -#include <svx/dialmgr.hxx> -#endif /* !TEST_LAYOUT */ -#include "zoom_def.hxx" - -#include <layout/layout-pre.hxx> - -#if ENABLE_LAYOUT -#undef SVX_RES -#define SVX_RES(x) #x -#undef SfxModalDialog -#define SfxModalDialog( parent, id ) Dialog( parent, "zoom.xml", id ) -#endif /* ENABLE_LAYOUT */ - -// static ---------------------------------------------------------------- - -static USHORT pRanges[] = -{ - SID_ATTR_ZOOM, - SID_ATTR_ZOOM, - 0 -}; - -#define SPECIAL_FACTOR ((USHORT)0xFFFF) - -// class SvxZoomDialog --------------------------------------------------- - -USHORT SvxZoomDialog::GetFactor() const -{ - if ( a100Btn.IsChecked() ) - return 100; - if ( aUserBtn.IsChecked() ) - return (USHORT)aUserEdit.GetValue(); - else - return SPECIAL_FACTOR; -} - -// ----------------------------------------------------------------------- - -void SvxZoomDialog::SetFactor( USHORT nNewFactor, USHORT nBtnId ) -{ -#if TEST_LAYOUT - printf ("\t\t set factor %d\n", (int)nNewFactor); -#endif /* !TEST_LAYOUT */ - aUserEdit.Disable(); - - if ( !nBtnId ) - { - if ( nNewFactor == 100 ) - { - a100Btn.Check(); - a100Btn.GrabFocus(); - } - else - { - aUserBtn.Check(); - aUserEdit.Enable(); - aUserEdit.SetValue( (long)nNewFactor ); - aUserEdit.GrabFocus(); - } - } - else - { - aUserEdit.SetValue( (long)nNewFactor ); - - if ( ZOOMBTN_OPTIMAL == nBtnId ) - { - aOptimalBtn.Check(); - aOptimalBtn.GrabFocus(); - } - else if ( ZOOMBTN_PAGEWIDTH == nBtnId ) - { - aPageWidthBtn.Check(); - aPageWidthBtn.GrabFocus(); - } - else if ( ZOOMBTN_WHOLEPAGE == nBtnId ) - { - aWholePageBtn.Check(); - aWholePageBtn.GrabFocus(); - } - } -} - -// ----------------------------------------------------------------------- - -void SvxZoomDialog::SetButtonText( USHORT nBtnId, const String& rNewTxt ) -{ - switch ( nBtnId ) - { - case ZOOMBTN_OPTIMAL: // Optimal-Button - aOptimalBtn.SetText( rNewTxt ); - break; - - case ZOOMBTN_PAGEWIDTH: // Seitenbreite-Button - aPageWidthBtn.SetText( rNewTxt ); - break; - - case ZOOMBTN_WHOLEPAGE: // Ganze Seite-Button - aWholePageBtn.SetText( rNewTxt ); - break; - - default: - OSL_FAIL( "wrong button number" ); - } -} - -// ----------------------------------------------------------------------- - -void SvxZoomDialog::HideButton( USHORT nBtnId ) -{ - switch ( nBtnId ) - { - case ZOOMBTN_OPTIMAL: // Optimal-Button - aOptimalBtn.Hide(); - break; - - case ZOOMBTN_PAGEWIDTH: // Seitenbreite-Button - aPageWidthBtn.Hide(); - break; - - case ZOOMBTN_WHOLEPAGE: // Ganze Seite-Button - aWholePageBtn.Hide(); - break; - - default: - OSL_FAIL( "Falsche Button-Nummer!!!" ); - } -} - -// ----------------------------------------------------------------------- - -void SvxZoomDialog::SetLimits( USHORT nMin, USHORT nMax ) -{ - DBG_ASSERT( nMin < nMax, "invalid limits" ); - aUserEdit.SetMin( nMin ); - aUserEdit.SetFirst( nMin ); - aUserEdit.SetMax( nMax ); - aUserEdit.SetLast( nMax ); -} - -// ----------------------------------------------------------------------- - -void SvxZoomDialog::SetSpinSize( USHORT nNewSpin ) -{ - aUserEdit.SetSpinSize( nNewSpin ); -} - -// ----------------------------------------------------------------------- - -#if TEST_LAYOUT -SvxZoomDialog::SvxZoomDialog( Window* pParent ) : -#else /* !TEST_LAYOUT */ -SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) : -#endif /* !TEST_LAYOUT */ - - SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_ZOOM ) ), - - aZoomFl ( this, SVX_RES( FL_ZOOM ) ), - aOptimalBtn ( this, SVX_RES( BTN_OPTIMAL ) ), - aWholePageBtn ( this, SVX_RES( BTN_WHOLE_PAGE ) ), - aPageWidthBtn ( this, SVX_RES( BTN_PAGE_WIDTH ) ), - a100Btn ( this, SVX_RES( BTN_100 ) ), - aUserBtn ( this, SVX_RES( BTN_USER ) ), - aUserEdit ( this, SVX_RES( ED_USER ) ), - - aViewLayoutFl ( this, SVX_RES( FL_VIEWLAYOUT ) ), - aAutomaticBtn ( this, SVX_RES( BTN_AUTOMATIC ) ), - aSingleBtn ( this, SVX_RES( BTN_SINGLE ) ), - aColumnsBtn ( this, SVX_RES( BTN_COLUMNS ) ), - aColumnsEdit ( this, SVX_RES( ED_COLUMNS ) ), - aBookModeChk ( this, SVX_RES( CHK_BOOK ) ), - - aBottomFl ( this, SVX_RES( FL_BOTTOM ) ), - aOKBtn ( this, SVX_RES( BTN_ZOOM_OK ) ), - aCancelBtn ( this, SVX_RES( BTN_ZOOM_CANCEL ) ), - aHelpBtn ( this, SVX_RES( BTN_ZOOM_HELP ) ), - -#if !TEST_LAYOUT - rSet ( rCoreSet ), -#endif /* !TEST_LAYOUT */ - pOutSet ( NULL ), - bModified ( FALSE ) - -{ -#if ENABLE_LAYOUT - SetHelpId (SID_ATTR_ZOOM); -#endif /* ENABLE_LAYOUT */ - Link aLink = LINK( this, SvxZoomDialog, UserHdl ); - a100Btn.SetClickHdl( aLink ); - aOptimalBtn.SetClickHdl( aLink ); - aPageWidthBtn.SetClickHdl( aLink ); - aWholePageBtn.SetClickHdl( aLink ); - aUserBtn.SetClickHdl( aLink ); - - Link aViewLayoutLink = LINK( this, SvxZoomDialog, ViewLayoutUserHdl ); - aAutomaticBtn.SetClickHdl( aViewLayoutLink ); - aSingleBtn.SetClickHdl( aViewLayoutLink ); - aColumnsBtn.SetClickHdl( aViewLayoutLink ); - - Link aViewLayoutSpinLink = LINK( this, SvxZoomDialog, ViewLayoutSpinHdl ); - aColumnsEdit.SetModifyHdl( aViewLayoutSpinLink ); - - Link aViewLayoutCheckLink = LINK( this, SvxZoomDialog, ViewLayoutCheckHdl ); - aBookModeChk.SetClickHdl( aViewLayoutCheckLink ); - - aOKBtn.SetClickHdl( LINK( this, SvxZoomDialog, OKHdl ) ); - aUserEdit.SetModifyHdl( LINK( this, SvxZoomDialog, SpinHdl ) ); - - // Default-Werte - USHORT nValue = 100; - USHORT nMin = 10; - USHORT nMax = 1000; - -#if !TEST_LAYOUT - // ggf. erst den alten Wert besorgen - const SfxUInt16Item* pOldUserItem = 0; - SfxObjectShell* pSh = SfxObjectShell::Current(); - - if ( pSh ) - pOldUserItem = (const SfxUInt16Item*)pSh->GetItem( SID_ATTR_ZOOM_USER ); - - if ( pOldUserItem ) - nValue = pOldUserItem->GetValue(); - - // UserEdit initialisieren - if ( nMin > nValue ) - nMin = nValue; - if ( nMax < nValue ) - nMax = nValue; -#endif /* !TEST_LAYOUT */ - aUserEdit.SetMin( nMin ); - aUserEdit.SetFirst( nMin ); - aUserEdit.SetMax( nMax ); - aUserEdit.SetLast( nMax ); - aUserEdit.SetValue( nValue ); - -#if TEST_LAYOUT - USHORT nZoom = 100; - SetFactor( nZoom ); -#else /* !TEST_LAYOUT */ - const SfxPoolItem& rItem = rSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) ); - - if ( rItem.ISA(SvxZoomItem) ) - { - const SvxZoomItem& rZoomItem = (const SvxZoomItem&)rItem; - const USHORT nZoom = rZoomItem.GetValue(); - const SvxZoomType eType = rZoomItem.GetType(); - const USHORT nValSet = rZoomItem.GetValueSet(); - USHORT nBtnId = 0; - - switch ( eType ) - { - case SVX_ZOOM_OPTIMAL: - nBtnId = ZOOMBTN_OPTIMAL; - break; - case SVX_ZOOM_PAGEWIDTH: - nBtnId = ZOOMBTN_PAGEWIDTH; - break; - case SVX_ZOOM_WHOLEPAGE: - nBtnId = ZOOMBTN_WHOLEPAGE; - break; - case SVX_ZOOM_PERCENT: - break; - case SVX_ZOOM_PAGEWIDTH_NOBORDER: - break; - } - - if ( !(SVX_ZOOM_ENABLE_100 & nValSet) ) - a100Btn.Disable(); - if ( !(SVX_ZOOM_ENABLE_OPTIMAL & nValSet) ) - aOptimalBtn.Disable(); - if ( !(SVX_ZOOM_ENABLE_PAGEWIDTH & nValSet) ) - aPageWidthBtn.Disable(); - if ( !(SVX_ZOOM_ENABLE_WHOLEPAGE & nValSet) ) - aWholePageBtn.Disable(); - SetFactor( nZoom, nBtnId ); - } - else - { - const USHORT nZoom = ( (const SfxUInt16Item&)rItem ).GetValue(); - SetFactor( nZoom ); - } - - const SfxPoolItem* pViewLayoutItem = 0; - if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_VIEWLAYOUT, FALSE, &pViewLayoutItem ) ) - { - const USHORT nColumns = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->GetValue(); - const bool bBookMode = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->IsBookMode(); - - if ( 0 == nColumns ) - { - aAutomaticBtn.Check(); - aColumnsEdit.SetValue( 2 ); - aColumnsEdit.Disable(); - aBookModeChk.Disable(); - } - else if ( 1 == nColumns) - { - aSingleBtn.Check(); - aColumnsEdit.SetValue( 2 ); - aColumnsEdit.Disable(); - aBookModeChk.Disable(); - } - else - { - aColumnsBtn.Check(); - if ( !bBookMode ) - { - aColumnsEdit.SetValue( nColumns ); - if ( 0 != nColumns % 2 ) - aBookModeChk.Disable(); - } - else - { - aColumnsEdit.SetValue( nColumns ); - aBookModeChk.Check(); - } - } - } - else - { - // hide view layout related controls: - aViewLayoutFl.Disable(); - aAutomaticBtn.Disable(); - aSingleBtn.Disable(); - aColumnsBtn.Disable(); - aColumnsEdit.Disable(); - aBookModeChk.Disable(); - } -#endif /* !TEST_LAYOUT */ - - FreeResource(); -} - -// ----------------------------------------------------------------------- - -SvxZoomDialog::~SvxZoomDialog() -{ - delete pOutSet; - pOutSet = 0; -} - -// ----------------------------------------------------------------------- - -USHORT* SvxZoomDialog::GetRanges() -{ - return pRanges; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxZoomDialog, UserHdl, RadioButton *, pBtn ) -{ -#if TEST_LAYOUT - fprintf( stderr, "SvxZoomDialog::UserHdl\n" ); -#endif /* TEST_LAYOUT */ - bModified |= TRUE; - - if ( pBtn == &aUserBtn ) - { - aUserEdit.Enable(); - aUserEdit.GrabFocus(); - } - else - aUserEdit.Disable(); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxZoomDialog, SpinHdl, MetricField *, EMPTYARG ) -{ - if ( !aUserBtn.IsChecked() ) - return 0; - bModified |= TRUE; - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxZoomDialog, ViewLayoutUserHdl, RadioButton *, pBtn ) -{ - bModified |= TRUE; - - if ( pBtn == &aAutomaticBtn ) - { - aColumnsEdit.Disable(); - aBookModeChk.Disable(); - } - else if ( pBtn == &aSingleBtn ) - { - aColumnsEdit.Disable(); - aBookModeChk.Disable(); - } - else if ( pBtn == &aColumnsBtn ) - { - aColumnsEdit.Enable(); - aColumnsEdit.GrabFocus(); - if ( 0 == aColumnsEdit.GetValue() % 2 ) - aBookModeChk.Enable(); - } - else - { - OSL_FAIL( "Wrong Button" ); - return 0; - } - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxZoomDialog, ViewLayoutSpinHdl, MetricField *, pEdt ) -{ - if ( pEdt == &aColumnsEdit && !aColumnsBtn.IsChecked() ) - return 0; - - if ( 0 == aColumnsEdit.GetValue() % 2 ) - aBookModeChk.Enable(); - else - { - aBookModeChk.Check( sal_False ); - aBookModeChk.Disable(); - } - - bModified |= TRUE; - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxZoomDialog, ViewLayoutCheckHdl, CheckBox *, pChk ) -{ - if ( pChk == &aBookModeChk && !aColumnsBtn.IsChecked() ) - return 0; - - bModified |= TRUE; - - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn ) -{ - if ( bModified || &aOKBtn != pBtn ) - { -#if TEST_LAYOUT - SvxZoomItem aZoomItem; - SvxViewLayoutItem aViewLayoutItem; -#else /* !TEST_LAYOUT */ - SvxZoomItem aZoomItem( SVX_ZOOM_PERCENT, 0, rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) ); - SvxViewLayoutItem aViewLayoutItem( 0, false, rSet.GetPool()->GetWhich( SID_ATTR_VIEWLAYOUT ) ); -#endif /* !TEST_LAYOUT */ - - if ( &aOKBtn == pBtn ) - { - USHORT nFactor = GetFactor(); - - if ( SPECIAL_FACTOR == nFactor ) - { - if ( aOptimalBtn.IsChecked() ) - aZoomItem.SetType( SVX_ZOOM_OPTIMAL ); - else if ( aPageWidthBtn.IsChecked() ) - aZoomItem.SetType( SVX_ZOOM_PAGEWIDTH ); - else if ( aWholePageBtn.IsChecked() ) - aZoomItem.SetType( SVX_ZOOM_WHOLEPAGE ); - } - else - aZoomItem.SetValue( nFactor ); - - if ( aAutomaticBtn.IsChecked() ) - { - aViewLayoutItem.SetValue( 0 ); - aViewLayoutItem.SetBookMode( false ); - } - if ( aSingleBtn.IsChecked() ) - { - aViewLayoutItem.SetValue( 1 ); - aViewLayoutItem.SetBookMode( false ); - } - else if ( aColumnsBtn.IsChecked() ) - { - aViewLayoutItem.SetValue( static_cast<USHORT>(aColumnsEdit.GetValue()) ); - aViewLayoutItem.SetBookMode( aBookModeChk.IsChecked() ); - } - } - else - { - OSL_FAIL( "Wrong Button" ); - return 0; - } -#if !TEST_LAYOUT - pOutSet = new SfxItemSet( rSet ); - pOutSet->Put( aZoomItem ); - - // don't set attribute in case the whole viewlayout stuff is disabled: - if ( aViewLayoutFl.IsEnabled() ) - pOutSet->Put( aViewLayoutItem ); - - // Wert aus dem UserEdit "uber den Dialog hinaus merken - SfxObjectShell* pSh = SfxObjectShell::Current(); - - if ( pSh ) - pSh->PutItem( SfxUInt16Item( SID_ATTR_ZOOM_USER, - (UINT16)aUserEdit.GetValue() ) ); -#endif /* !TEST_LAYOUT */ - EndDialog( RET_OK ); - } - else - EndDialog( RET_CANCEL ); - return 0; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/zoom.hrc b/toolkit/workben/layout/zoom.hrc deleted file mode 100644 index 49412ad085f0..000000000000 --- a/toolkit/workben/layout/zoom.hrc +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_ZOOM_HRC -#define _SVX_ZOOM_HRC - -// defines ------------------------------------------------------------------ - -#define FL_ZOOM 14 -#define BTN_OPTIMAL 15 -#define BTN_WHOLE_PAGE 16 -#define BTN_PAGE_WIDTH 17 -#define BTN_100 18 -#define BTN_USER 19 -#define ED_USER 20 - -#define FL_VIEWLAYOUT 21 -#define BTN_AUTOMATIC 22 -#define BTN_SINGLE 23 -#define BTN_COLUMNS 24 -#define ED_COLUMNS 25 -#define CHK_BOOK 26 - -#define FL_BOTTOM 27 -#define BTN_ZOOM_OK 28 -#define BTN_ZOOM_CANCEL 29 -#define BTN_ZOOM_HELP 30 - -#endif - diff --git a/toolkit/workben/layout/zoom.hxx b/toolkit/workben/layout/zoom.hxx deleted file mode 100644 index 0fab50eb1ced..000000000000 --- a/toolkit/workben/layout/zoom.hxx +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SVX_ZOOM_HXX -#define _SVX_ZOOM_HXX - -// include --------------------------------------------------------------- - -#include <layout/layout.hxx> -#include <sfx2/basedlgs.hxx> -#include <vcl/button.hxx> -#include <vcl/field.hxx> -#include <vcl/fixed.hxx> - -// define ---------------------------------------------------------------- -/* CHINA001 -#define ZOOMBTN_OPTIMAL ((USHORT)0x0001) -#define ZOOMBTN_PAGEWIDTH ((USHORT)0x0002) -#define ZOOMBTN_WHOLEPAGE ((USHORT)0x0004) -*/ -#include "zoom_def.hxx" -// class SvxZoomDialog --------------------------------------------------- -/* - {k:\svx\prototyp\dialog\zoom.bmp} - - [Beschreibung] - Mit diesem Dialog wird ein Zoom-Faktor eingestellt. - - [Items] - SvxZoomItem <SID_ATTR_ZOOM> -*/ - -#include <layout/layout-pre.hxx> - -class SvxZoomDialog : public SfxModalDialog -{ -private: - FixedLine aZoomFl; - RadioButton aOptimalBtn; - RadioButton aWholePageBtn; - RadioButton aPageWidthBtn; - RadioButton a100Btn; - RadioButton aUserBtn; - MetricField aUserEdit; - - FixedLine aViewLayoutFl; - RadioButton aAutomaticBtn; - RadioButton aSingleBtn; - RadioButton aColumnsBtn; - MetricField aColumnsEdit; - CheckBox aBookModeChk; - - FixedLine aBottomFl; - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - -#if !TEST_LAYOUT - const SfxItemSet& rSet; -#endif /* !TEST_LAYOUT */ - SfxItemSet* pOutSet; - BOOL bModified; - -#ifdef _SVX_ZOOM_CXX - DECL_LINK( UserHdl, RadioButton* ); - DECL_LINK( SpinHdl, MetricField* ); - DECL_LINK( ViewLayoutUserHdl, RadioButton* ); - DECL_LINK( ViewLayoutSpinHdl, MetricField* ); - DECL_LINK( ViewLayoutCheckHdl, CheckBox* ); - DECL_LINK( OKHdl, Button* ); -#endif - -public: -#if TEST_LAYOUT - SvxZoomDialog( Window* pParent ); -#else /* !TEST_LAYOUT */ - SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ); -#endif /* !TEST_LAYOUT */ - ~SvxZoomDialog(); - - static USHORT* GetRanges(); - const SfxItemSet* GetOutputItemSet() const { return pOutSet; } - - USHORT GetFactor() const; - void SetFactor( USHORT nNewFactor, USHORT nBtnId = 0 ); - - void SetButtonText( USHORT nBtnId, const String& aNewTxt ); - void HideButton( USHORT nBtnId ); - void SetLimits( USHORT nMin, USHORT nMax ); - void SetSpinSize( USHORT nNewSpin ); -}; - -#include <layout/layout-post.hxx> - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/layout/zoom.xml b/toolkit/workben/layout/zoom.xml deleted file mode 100644 index 5cc376168a27..000000000000 --- a/toolkit/workben/layout/zoom.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- This is a template. i18n translation is not performed in-place; - i18n translated xml files are generated from this template by - transex3/layout/tralay. !--> - -<modaldialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - id="RID_SVXDLG_ZOOM" _title="Zoom & View Layout" optimumsize="true" - help-id="SID_ATTR_ZOOM" - has_border="true" sizeable="true" moveable="true" closeable="true"> - <vbox spacing="0" border="12"> - <hbox spacing="0" border="0"> - <vbox spacing="6" border="0"> - <fixedline id="FL_ZOOM" _text="Zoom factor" cnt:expand="false"/> - <radiobutton radiogroup="zoom-factor" id="BTN_OPTIMAL" _label="Optimal"/> - <radiobutton radiogroup="zoom-factor" id="BTN_WHOLE_PAGE" _label="Whole Page"/> - <radiobutton radiogroup="zoom-factor" id="BTN_PAGE_WIDTH" _label="Page Width"/> - <radiobutton radiogroup="zoom-factor" id="BTN_100" _label="100 %"/> - <hbox cnt:expand="false" cnt:fill="true"> - <align cnt:expand="false" cnt:fill="true"> - <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom-factor" id="BTN_USER" _label="Variable"/> - </align> - <flow cnt:padding="12" cnt:expand="false"/> - <metricfield id="ED_USER" value-step="1" - repeat="true" has_border="true" spin="true" - _text="100%" unit="11" custom-unit-text="%" - right="true" - cnt:expand="false"/> - </hbox> - </vbox> - <flow/> - <vbox spacing="6" border="0"> - <fixedline id="FL_VIEWLAYOUT" _text="View layout" cnt:expand="false"/> - <radiobutton radiogroup="zoom-layout" id="BTN_AUTOMATIC" _label="~Automatic"/> - <radiobutton radiogroup="zoom-layout" id="BTN_SINGLE" _label="~Single page"/> - <hbox cnt:expand="false" cnt:fill="true"> - <align cnt:expand="false" cnt:fill="true"> - <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom-layout" id="BTN_COLUMNS" _label="~Columns"/> - </align> - <flow cnt:padding="12" cnt:expand="false"/> - <metricfield id="ED_COLUMNS" value-step="1" - repeat="true" has_border="true" spin="true" - _text="100%" - right="true" - spin-value-min="1" - spin-value="1" - cnt:expand="false"/> - </hbox> - <hbox><flow cnt:expand="false" cnt:padding="12"/><checkbox id="CHK_BOOK" _label="~Book mode"/></hbox> - </vbox> - </hbox> - <fixedline cnt:padding="6" id="FL_BOTTOM"/> - <dialogbuttonhbox border="0" spacing="12"> - <flow/> - <okbutton defbutton="true" id="BTN_ZOOM_OK"/> - <cancelbutton id="BTN_ZOOM_CANCEL"/> - <helpbutton id="BTN_ZOOM_HELP"/> - </dialogbuttonhbox> - </vbox> -</modaldialog> diff --git a/toolkit/workben/layout/zoom_def.hxx b/toolkit/workben/layout/zoom_def.hxx deleted file mode 100644 index 84b2db945a6e..000000000000 --- a/toolkit/workben/layout/zoom_def.hxx +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVX_ZOOM_DEF_HXX -#define _SVX_ZOOM_DEF_HXX - -#define ZOOMBTN_OPTIMAL ((USHORT)0x0001) -#define ZOOMBTN_PAGEWIDTH ((USHORT)0x0002) -#define ZOOMBTN_WHOLEPAGE ((USHORT)0x0004) - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/toolkit/workben/no_localization b/toolkit/workben/no_localization deleted file mode 100644 index 3ce3aa0ec048..000000000000 --- a/toolkit/workben/no_localization +++ /dev/null @@ -1 +0,0 @@ -Touch me to prevent that the localisation process extracts strings #i85733# diff --git a/toolkit/workben/unodialog.cxx b/toolkit/workben/unodialog.cxx deleted file mode 100644 index 4652457766c2..000000000000 --- a/toolkit/workben/unodialog.cxx +++ /dev/null @@ -1,270 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_toolkit.hxx" -#include <sal/main.h> -#include <com/sun/star/awt/XToolkit.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/container/XNameContainer.hpp> -#include <com/sun/star/awt/XControlModel.hpp> -#include <com/sun/star/awt/XControlContainer.hpp> -#include <com/sun/star/awt/XControl.hpp> -#include <com/sun/star/awt/XDialog.hpp> - - -#include <tools/debug.hxx> -#include <vcl/svapp.hxx> -#include <vcl/wrkwin.hxx> - -#include <svtools/unoiface.hxx> // InitExtToolkit -#include <comphelper/processfactory.hxx> - -#include <cppuhelper/servicefactory.hxx> -#include <cppuhelper/bootstrap.hxx> -#include <comphelper/regpathhelper.hxx> - -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/registry/XSimpleRegistry.hpp> - - -using namespace ::com::sun::star; -using namespace ::com::sun::star::connection; -using namespace ::rtl; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::registry; -using namespace ::com::sun::star::lang; - - - -::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > createApplicationServiceManager() -{ - try - { - ::rtl::OUString localRegistry = ::comphelper::getPathToUserRegistry(); - ::rtl::OUString systemRegistry = ::comphelper::getPathToSystemRegistry(); - - Reference< XSimpleRegistry > xLocalRegistry( ::cppu::createSimpleRegistry() ); - Reference< XSimpleRegistry > xSystemRegistry( ::cppu::createSimpleRegistry() ); - if ( xLocalRegistry.is() && (localRegistry.getLength() > 0) ) - { - try - { - xLocalRegistry->open( localRegistry, sal_False, sal_True); - } - catch ( InvalidRegistryException& ) - { - } - - if ( !xLocalRegistry->isValid() ) - xLocalRegistry->open(localRegistry, sal_True, sal_True); - } - - if ( xSystemRegistry.is() && (systemRegistry.getLength() > 0) ) - xSystemRegistry->open( systemRegistry, sal_True, sal_False); - - if ( (xLocalRegistry.is() && xLocalRegistry->isValid()) && - (xSystemRegistry.is() && xSystemRegistry->isValid()) ) - { - Reference < XSimpleRegistry > xReg( ::cppu::createNestedRegistry() ); - Sequence< Any > seqAnys(2); - seqAnys[0] <<= xLocalRegistry ; - seqAnys[1] <<= xSystemRegistry ; - Reference< XInitialization > xInit( xReg, UNO_QUERY ); - xInit->initialize( seqAnys ); - - Reference< XComponentContext > xContext( ::cppu::bootstrap_InitialComponentContext( xReg ) ); - return Reference< XMultiServiceFactory >( xContext->getServiceManager(), UNO_QUERY ); - } - } - catch( ::com::sun::star::uno::Exception& ) - { - } - - return ::cppu::createServiceFactory(); -} - - -// ----------------------------------------------------------------------- -void Main( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & ); - -SAL_IMPLEMENT_MAIN() -{ - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = createApplicationServiceManager(); - //SVInit( xMSF ); - ::Main( xMSF ); - //SVDeinit(); - return NULL; -} - -/* -class MyApp : public Application -{ -public: - void Main() - { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = createApplicationServiceManager(); - ::Main( xMSF ); - } -}; - -MyApp aMyApp; -*/ - - -class MyWin : public WorkWindow -{ -private: - uno::Reference< awt::XView > mxView; - -public: - MyWin() : WorkWindow( NULL, WB_APP|WB_STDWORK ) {;} - void Paint( const Rectangle& r ); - void SetXView( uno::Reference< awt::XView > xV ) { mxView = xV; } -}; - - -// ----------------------------------------------------------------------- - -void Main( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMSF ) -{ - ::comphelper::setProcessServiceFactory( xMSF ); - - //uno::Reference< awt::XToolkit> xToolkit( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.ExtToolkit" ) ) ), uno::UNO_QUERY ); - uno::Reference< awt::XToolkit> xToolkit( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ) ), uno::UNO_QUERY ); - - // Create a DialogModel - uno::Reference< container::XNameContainer > xC( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ) ), uno::UNO_QUERY ); - uno::Reference< lang::XMultiServiceFactory > xModFact( xC, uno::UNO_QUERY ); - - // Create a ButtonModel - uno::Reference< awt::XControlModel > xCtrl1( xModFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlButtonModel" ) ) ), uno::UNO_QUERY ); - uno::Reference< beans::XPropertySet > xPSet( xCtrl1, uno::UNO_QUERY ); - uno::Any aValue; - aValue <<= (sal_Int32) 10; - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ), aValue ); - aValue <<= (sal_Int32) 10; - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ), aValue ); - aValue <<= (sal_Int32) 40; - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Width" ) ), aValue ); - aValue <<= (sal_Int32) 12; - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Height" ) ), aValue ); - aValue <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Test!" ) ); - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Label" ) ), aValue ); - uno::Any aAny; - aAny <<= xCtrl1; - xC->insertByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Control1" ) ), aAny ); - - uno::Reference< beans::XPropertySet > xDlgPSet( xC, uno::UNO_QUERY ); - aValue <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Test-Dialog" ) ); - xDlgPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), aValue ); - aValue <<= (sal_Int32) 200; - xDlgPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Width" ) ), aValue ); - aValue <<= (sal_Int32) 200; - xDlgPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Height" ) ), aValue ); - - // Create a Dialog - uno::Reference< awt::XControl > xDlg( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialog" ) ) ), uno::UNO_QUERY ); - uno::Reference< awt::XControlModel > xDlgMod( xC, uno::UNO_QUERY ); - xDlg->setModel( xDlgMod ); - - // Create a EditModel - uno::Reference< awt::XControlModel > xCtrl2( xModFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlEditModel" ) ) ), uno::UNO_QUERY ); - xPSet = uno::Reference< beans::XPropertySet >( xCtrl2, uno::UNO_QUERY ); - aValue <<= (sal_Int32) 10; - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ), aValue ); - aValue <<= (sal_Int32) 40; - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ), aValue ); - aValue <<= (sal_Int32) 80; - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Width" ) ), aValue ); - aValue <<= (sal_Int32) 12; - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Height" ) ), aValue ); - aValue <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Text..." ) ); - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Text" ) ), aValue ); - aAny <<= xCtrl2; - xC->insertByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Control2" ) ), aAny ); - - // test if listener works... - aValue <<= (sal_Int32) 20; - xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ), aValue ); - - MyWin * pWindow; - ::SolarMutexGuard aVclGuard; - - pWindow = new MyWin(); - pWindow->Show(); - - xDlg->setDesignMode( sal_True ); - - uno::Reference< awt::XWindow > xWindow( xDlg, uno::UNO_QUERY ); - xWindow->setVisible( sal_False ); - - xDlg->createPeer( xToolkit, pWindow->GetComponentInterface() ); - - uno::Reference< awt::XView > xView( xDlg, uno::UNO_QUERY ); - pWindow->SetXView( xView ); - - uno::Reference< awt::XDialog > xD( xDlg, uno::UNO_QUERY ); - - //static BOOL bExecute = FALSE; - //if ( bExecute ) - xD->execute(); - //Execute(); - Reference< XComponent > xDT( xD, uno::UNO_QUERY ); - xDT->dispose(); - delete pWindow; - - Reference< XComponent > xT( xToolkit, uno::UNO_QUERY ); - xT->dispose(); - - Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY ); - if (xProps.is()) - { - try - { - Reference< lang::XComponent > xComp; - if (xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xComp) - { - xComp->dispose(); - } - } - catch (beans::UnknownPropertyException &) - { - } - } -} - -void MyWin::Paint( const Rectangle& r ) -{ - static BOOL bDraw = TRUE; - if ( bDraw && mxView.is() ) - mxView->draw( 50, 50 ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 34dc93d66bd7..2b9295b436a4 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1308,10 +1308,8 @@ SvStream& SvStream::operator>>(double& r) #if defined UNX if (bSwap) SwapDouble(n); - r = n; -#else - (void) r; #endif + r = n; } return *this; } diff --git a/unotools/inc/unotools/lingucfg.hxx b/unotools/inc/unotools/lingucfg.hxx index 4ae102007dde..668cb267107b 100644 --- a/unotools/inc/unotools/lingucfg.hxx +++ b/unotools/inc/unotools/lingucfg.hxx @@ -225,7 +225,6 @@ public: std::vector< SvtLinguConfigDictionaryEntry > GetActiveDictionariesByFormat( const rtl::OUString &rFormatName ); // functions returning file URLs to the respective images (if found) and empty string otherwise - ::rtl::OUString GetSpellAndGrammarDialogImage( const ::rtl::OUString &rServiceImplName ) const; ::rtl::OUString GetSpellAndGrammarContextSuggestionImage( const ::rtl::OUString &rServiceImplName ) const; ::rtl::OUString GetSpellAndGrammarContextDictionaryImage( const ::rtl::OUString &rServiceImplName ) const; ::rtl::OUString GetThesaurusDialogImage( const ::rtl::OUString &rServiceImplName ) const; diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index cc08afdc934f..fcf9f7653c30 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -1253,21 +1253,6 @@ rtl::OUString SvtLinguConfig::GetVendorImageUrl_Impl( } -rtl::OUString SvtLinguConfig::GetSpellAndGrammarDialogImage( - const rtl::OUString &rServiceImplName -) const -{ - rtl::OUString aRes; - if (rServiceImplName.getLength() > 0) - { - rtl::OUString aImageName( A2OU( "SpellAndGrammarDialogImage" )); - rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) ); - aRes = aPath; - } - return aRes; -} - - rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextSuggestionImage( const rtl::OUString &rServiceImplName ) const diff --git a/unusedcode.easy b/unusedcode.easy index 319cb240807f..e895bbc097e9 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -84,7 +84,6 @@ CommunicationLinkList::Insert(CommunicationLink const**, unsigned short) CommunicationLinkList::Insert(CommunicationLinkList const*, unsigned short, unsigned short) CommunicationLinkList::Remove(CommunicationLink const*&, unsigned short) Control::GetLineCount() const -ControlItem::ControlItem(ControlData*) CurrencyBox::CurrencyBox(Window*, ResId const&) CurrencyBox::GetValue(unsigned short) const CurrencyBox::GetValuePos(long) const @@ -139,11 +138,8 @@ EditEngine::SetBigTextObjectStart(unsigned short) EditEngine::SetGroupChars(String const&) EditEngine::SetText(unsigned short, EditTextObject const&) EditEngine::StopSelectionMode() -EditView::Drop(DropEvent const&) -EditView::GetDropPos() EditView::GetSelectionMode() const EditView::MatchGroup() -EditView::QueryDrop(DropEvent&) EditView::SetCursor(Cursor const&) EditView::SetParaAttribs(SfxItemSet const&, unsigned short) EditView::SetPointer(Pointer const&) @@ -216,7 +212,6 @@ IconChoiceDialog::RemoveResetButton() IconChoiceDialog::RemoveTabPage(unsigned short) ImageButton::ImageButton(unsigned short) ImageList::Clear() -ImageList::GetImageIds(std::__debug::vector<unsigned short, std::allocator<unsigned short> >&) const ImageList::RemoveImage(rtl::OUString const&) ImageList::ReplaceImage(rtl::OUString const&, rtl::OUString const&) ImageList::ReplaceImage(unsigned short, Image const&) @@ -342,9 +337,9 @@ OutputDevice::PixelToLogic(basegfx::B2DPolyPolygon const&) const OutputDevice::PixelToLogic(basegfx::B2DPolygon const&) const PageSpan::getMarginLeft() const PageSpan::getMarginRight() const -ParaPortion::DbgCheckTextPortions() ParaPortionList::DbgCheck(EditDoc&) ParagraphObj::ParagraphObj(ParagraphObj&) +ParagraphStyleManager::get(WPXString const&) const PathDialog::SetPath(Edit const&) PatternBox::GetString(unsigned short) const PatternBox::GetStringPos(String const&) const @@ -571,16 +566,11 @@ ScrollableWindow::ScrollableWindow(Window*, ResId const&, unsigned short) ScrollableWindow::SetLineSize(unsigned long, unsigned long) ScrollableWindow::SetVisibleSize(Size const&) SdFilterDetect::impl_createFactory(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&) -SdrCreateView::ImpDelCreateAttr() SdrCustomShapeDataItem::SdrCustomShapeDataItem(String const&) SdrCustomShapeEngineItem::SdrCustomShapeEngineItem(String const&) SdrCustomShapeGeometryItem::ClearPropertyValue(rtl::OUString const&, rtl::OUString const&) SdrCustomShapeReplacementURLItem::SdrCustomShapeReplacementURLItem(String const&) SdrEditView::MoveLayer(String const&, unsigned short) -SdrEngineDefaults::LanguageHasChanged() -SdrExchangeView::GetPastePos(SdrObjList*, OutputDevice*) -SdrExchangeView::Paste(Bitmap const&, Point const&, SdrObjList*, unsigned int) -SdrExchangeView::Paste(GDIMetaFile const&, Point const&, SdrObjList*, unsigned int) SdrGlobalData::GetCharClass() SdrGlobalData::~SdrGlobalData() SdrGluePoint::Draw(OutputDevice&, SdrObject const*) const @@ -608,11 +598,6 @@ SdrModel::CheckConsistence() const SdrModel::GetNumberFormatter() const SdrModel::HasTransparentObjects(bool) const SdrModel::IsAllowShapePropertyChangeListener() const -SdrObjEditView::AddTextEditOfs(MouseEvent&) const -SdrObjEditView::Cut(unsigned long) -SdrObjEditView::IsTextEditFrame() const -SdrObjEditView::Paste(Window*, unsigned long) -SdrObjEditView::Yank(unsigned long) SdrObjFactory::MakeNewObjUserData(unsigned int, unsigned short, SdrObject*) SdrObject::ClearObjectItem(unsigned short) SdrObject::FreeGlobalDrawObjectItemPool() @@ -753,6 +738,7 @@ SotFactory::TestInvariant() SotObject::RemoveOwnerLock() SotStorage::GetProperty(String const&, String const&, com::sun::star::uno::Any&) SourceTreeIterator::EndExecute() +SpanStyleManager::get(WPXString const&) const SpinButton::SpinButton(Window*, ResId const&) SplitWindow::CalcWindowSizePixel(Size const&, WindowAlign, long, unsigned char) SplitWindow::GetItemWindow(unsigned short) const @@ -818,10 +804,6 @@ SvStringsSortDtor::Insert(SvStringsSortDtor const*, unsigned short, unsigned sho SvStringsSortDtor::Remove(String* const&, unsigned short) SvStringsSortDtor::Remove(unsigned short, unsigned short) SvTabListBox::GetTabJustify(unsigned short) const -SvUShorts::Insert(SvUShorts const*, unsigned short, unsigned short, unsigned short) -SvUShorts::Replace(unsigned short const&, unsigned short) -SvUShorts::Replace(unsigned short const*, unsigned short, unsigned short) -SvUShorts::_ForEach(unsigned short, unsigned short, unsigned char (*)(unsigned short const&, void*), void*) SvUnoAttributeContainer::getImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>) SvXMLAutoStylePoolNamesP_Impl::GetPos(rtl::OUString const*) const SvXMLAutoStylePoolNamesP_Impl::Remove(rtl::OUString*) @@ -1285,6 +1267,7 @@ VCLUnoHelper::CreatePointer() VCLXDevice::IsCreatedWithToolkit() const VCLXPrinterServer::getImplementationId() VCLXPrinterServer::getTypes() +VCLXRadioButton::getFirstActionListener() VbaFontBase::getUnderline() VbaFontBase::setUnderline(com::sun::star::uno::Any const&) VbaFoundFilesEnum::SetFileList(com::sun::star::uno::Sequence<rtl::OUString>&) @@ -1368,7 +1351,6 @@ XMLTextListAutoStylePoolNames_Impl::Remove(rtl::OUString*) XMLTextListAutoStylePool_Impl::GetPos(XMLTextListAutoStylePoolEntry_Impl const*) const XMLTextListAutoStylePool_Impl::Remove(XMLTextListAutoStylePoolEntry_Impl*) XMLTextParagraphExport::FindTextStyle(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&, unsigned char&) const -XMLTextParagraphExport::GetHeadingLevel(rtl::OUString const&) XMLVisAreaContext::XMLVisAreaContext(SvXMLImport&, unsigned short, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> const&, Rectangle&, short) XPropertyList::Clear() XSecController::collectToSign(int, rtl::OUString const&) @@ -1996,7 +1978,6 @@ codemaker::cpp::typeToPrefix(TypeManager const&, rtl::OString const&) comphelper::AccessibleEventNotifier::getEventListeners(unsigned int) comphelper::AttributeList::AppendAttributeList(com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList> const&) comphelper::AttributeList::Clear() -comphelper::EmbeddedObjectContainer::CopyEmbeddedObject(comphelper::EmbeddedObjectContainer&, com::sun::star::uno::Reference<com::sun::star::embed::XEmbeddedObject> const&, rtl::OUString&) comphelper::EventLogger::addLogHandler(com::sun::star::uno::Reference<com::sun::star::logging::XLogHandler> const&) comphelper::EventLogger::getLogLevel() const comphelper::EventLogger::getName() const @@ -2005,7 +1986,6 @@ comphelper::EventLogger::setLogLevel(int) const comphelper::FastPropertySetInfo::FastPropertySetInfo() comphelper::FastPropertySetInfo::addProperty(com::sun::star::beans::Property const&) comphelper::MimeConfigurationHelper::AddFilterNameCheckOwnFile(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>&) -comphelper::MimeConfigurationHelper::GetSequenceClassIDFromObjectName(rtl::OUString const&) comphelper::OAccessibleImplementationAccess::setForeignControlledState(com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessibleContext> const&, short, unsigned char) comphelper::OAccessibleSelectionHelper::OAccessibleSelectionHelper() comphelper::OAccessibleTextHelper::OAccessibleTextHelper() @@ -2155,224 +2135,40 @@ graphite2::TtfUtil::GlyfLookup(unsigned short, void const*, void const*, unsigne jfw_plugin::VendorBase::createInstance() jfw_plugin::VendorBase::getJavaExePaths(int*) jvmaccess::ClassPath::doLoadClass(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, void*, rtl::OUString const&, rtl::OUString const&) -layout::AdvancedButton::AddAdvanced(layout::Window*) -layout::AdvancedButton::AddSimple(layout::Window*) -layout::AdvancedButton::AdvancedButton(layout::Context*, char const*, unsigned int) -layout::AdvancedButton::AdvancedButton(layout::Window*, ResId const&) -layout::AdvancedButton::AdvancedButton(layout::Window*, long) -layout::AdvancedButton::RemoveAdvanced(layout::Window*) -layout::AdvancedButton::RemoveSimple(layout::Window*) -layout::AdvancedButton::SetDelta(int) -layout::ApplyButton::ApplyButton(layout::Context*, char const*, unsigned int) -layout::ApplyButton::ApplyButton(layout::Window*, ResId const&) -layout::ApplyButton::ApplyButton(layout::Window*, long) -layout::Box::Add(layout::Container*, bool, bool, int) -layout::Box::Add(layout::Window*, bool, bool, int) -layout::Button::Button(layout::Context*, char const*, unsigned int) -layout::Button::Button(layout::Window*, ResId const&) -layout::Button::Button(layout::Window*, long) -layout::Button::GetClickHdl() -layout::Button::SetClickHdl(Link const&) -layout::Button::SetImageAlign(ImageAlign) -layout::Button::SetModeImage(Image const&) -layout::Button::SetModeImage(layout::Image const&) -layout::CancelButton::CancelButton(layout::Window*, ResId const&) -layout::CancelButton::CancelButton(layout::Window*, long) -layout::CheckBox::Check(bool) -layout::CheckBox::CheckBox(layout::Context*, char const*, unsigned int) -layout::CheckBox::CheckBox(layout::Window*, ResId const&) -layout::CheckBox::CheckBox(layout::Window*, long) -layout::CheckBox::IsChecked() const -layout::ComboBox::Clear() -layout::ComboBox::ComboBox(layout::Context*, char const*, unsigned int) -layout::ComboBox::ComboBox(layout::Window*, ResId const&) -layout::ComboBox::ComboBox(layout::Window*, long) -layout::ComboBox::EnableAutocomplete(bool, bool) -layout::ComboBox::GetEntry(unsigned short) const -layout::ComboBox::GetEntryCount() const -layout::ComboBox::InsertEntry(String const&, unsigned short) -layout::ComboBox::RemoveEntry(String const&) -layout::ComboBox::RemoveEntry(unsigned short) -layout::ComboBox::SetClickHdl(Link const&) -layout::ComboBox::SetSelectHdl(Link const&) -layout::Container::Add(layout::Container*) -layout::Container::Add(layout::Window*) -layout::Container::Clear() -layout::Container::Hide() -layout::Container::Remove(layout::Container*) -layout::Container::Remove(layout::Window*) -layout::Container::Show() -layout::Context::getRoot() -layout::Context::getToplevel() -layout::Context::setToplevel(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>) -layout::Control::GetGetFocusHdl() -layout::Control::GetLoseFocusHdl() -layout::Dialog::Close() -layout::Dialog::Dialog(layout::Window*, char const*, char const*, unsigned int) -layout::Dialog::Initialize(SfxChildWinInfo*) -layout::Dialog::Notify(NotifyEvent&) -layout::Dialog::SetText(rtl::OUString const&) -layout::Edit::Edit(layout::Context*, char const*, unsigned int) -layout::Edit::Edit(layout::Window*, ResId const&) -layout::Edit::Edit(layout::Window*, long) -layout::Edit::GetText() const -layout::Edit::SetSelection(Selection const&) -layout::Edit::SetText(rtl::OUString const&) +layout::Box::Box(layout::Context const*, char const*) +layout::Box::Box(rtl::OUString const&, int, bool) +layout::Box::setProps(com::sun::star::uno::Reference<com::sun::star::awt::XLayoutConstrains>, bool, bool, int) +layout::Button::GetButton() const +layout::Container::ShowAll(bool) +layout::ControlImpl::GetGetFocusHdl() +layout::ControlImpl::GetLoseFocusHdl() +layout::Dialog::GetDialog() const +layout::Edit::GetEdit() const layout::ErrorBox::ErrorBox(Window*, char const*, char const*, char const*, rtl::OString const&, char const*, char const*) layout::ErrorBox::ErrorBox(Window*, long, char const*, char const*, char const*, rtl::OString const&, char const*, char const*) layout::ErrorBox::ErrorBox(Window*, long, rtl::OUString const&, rtl::OUString, rtl::OUString, rtl::OString const&, char const*, char const*) layout::ErrorBox::ErrorBox(Window*, rtl::OUString const&, rtl::OUString, rtl::OUString, rtl::OString const&, char const*, char const*) -layout::FixedImage::FixedImage(layout::Window*, ResId const&) -layout::FixedImage::FixedImage(layout::Window*, long) -layout::FixedImage::setImage(Image const&) -layout::FixedInfo::FixedInfo(layout::Context*, char const*, unsigned int) -layout::FixedInfo::FixedInfo(layout::Window*, ResId const&) -layout::FixedInfo::FixedInfo(layout::Window*, long) -layout::FixedLine::FixedLine(layout::Context*, char const*, unsigned int) -layout::FixedLine::FixedLine(layout::Window*, ResId const&) -layout::FixedLine::FixedLine(layout::Window*, long) -layout::FixedLine::IsEnabled() const -layout::FixedText::FixedText(layout::Window*, ResId const&) -layout::FixedText::FixedText(layout::Window*, long) -layout::HBox::HBox(int, bool) -layout::HBox::HBox(layout::Context const*, char const*) -layout::HelpButton::HelpButton(layout::Window*, ResId const&) -layout::HelpButton::HelpButton(layout::Window*, long) -layout::IgnoreButton::IgnoreButton(layout::Window*, ResId const&) -layout::IgnoreButton::IgnoreButton(layout::Window*, long) -layout::Image::Image(char const*) -layout::Image::~Image() -layout::ImageButton::ImageButton(layout::Context*, char const*, unsigned int) -layout::ImageButton::ImageButton(layout::Window*, ResId const&) -layout::ImageButton::ImageButton(layout::Window*, long) -layout::InPlug::InPlug(Window*, char const*, char const*, unsigned int) -layout::InPlug::InPlug(layout::Window*, char const*, char const*, unsigned int) layout::InfoBox::InfoBox(Window*, char const*, char const*, char const*, rtl::OString const&, char const*, char const*) layout::InfoBox::InfoBox(Window*, long, char const*, char const*, char const*, rtl::OString const&, char const*, char const*) layout::InfoBox::InfoBox(Window*, long, rtl::OUString const&, rtl::OUString, rtl::OUString, rtl::OString const&, char const*, char const*) layout::InfoBox::InfoBox(Window*, rtl::OUString const&, rtl::OUString, rtl::OUString, rtl::OString const&, char const*, char const*) -layout::ListBox::Clear() -layout::ListBox::GetClickHdl() -layout::ListBox::GetDoubleClickHdl() -layout::ListBox::GetEntryCount() const -layout::ListBox::GetEntryData(unsigned short) const -layout::ListBox::GetSelectEntry(unsigned short) const -layout::ListBox::GetSelectEntryCount() const -layout::ListBox::GetSelectHdl() -layout::ListBox::InsertEntry(String const&, unsigned short) -layout::ListBox::ListBox(layout::Context*, char const*, unsigned int) -layout::ListBox::ListBox(layout::Window*, ResId const&) -layout::ListBox::ListBox(layout::Window*, long) -layout::ListBox::RemoveEntry(String const&) -layout::ListBox::RemoveEntry(unsigned short) -layout::ListBox::SelectEntry(String const&, bool) -layout::ListBox::SetClickHdl(Link const&) -layout::ListBox::SetDoubleClickHdl(Link const&) -layout::ListBox::SetEntryData(unsigned short, void*) -layout::ListBox::SetSelectHdl(Link const&) -layout::LocalizedString::GetToken(unsigned short, char) -layout::LocalizedString::LocalizedString(layout::Context*, char const*) -layout::MetricField::MetricField(layout::Context*, char const*, unsigned int) -layout::MetricField::MetricField(layout::Window*, long) -layout::MetricFormatter::GetValue(FieldUnit) const -layout::MetricFormatter::SetFirst(long, FieldUnit) -layout::MetricFormatter::SetLast(long, FieldUnit) -layout::MetricFormatter::SetMax(long, FieldUnit) -layout::MetricFormatter::SetMin(long, FieldUnit) -layout::MetricFormatter::SetSpinSize(long) -layout::MetricFormatter::SetValue(long, FieldUnit) -layout::MoreButton::AddWindow(layout::Window*) -layout::MoreButton::GetLessText() const -layout::MoreButton::GetMoreText() const -layout::MoreButton::MoreButton(layout::Context*, char const*, unsigned int) -layout::MoreButton::MoreButton(layout::Window*, ResId const&) -layout::MoreButton::MoreButton(layout::Window*, long) -layout::MoreButton::RemoveWindow(layout::Window*) -layout::MoreButton::SetLessText(rtl::OUString const&) -layout::MoreButton::SetMoreText(rtl::OUString const&) -layout::MultiLineEdit::MultiLineEdit(layout::Context*, char const*, unsigned int) -layout::MultiLineEdit::MultiLineEdit(layout::Window*, ResId const&) -layout::MultiLineEdit::MultiLineEdit(layout::Window*, long) -layout::MultiListBox::MultiListBox(layout::Context*, char const*, unsigned int) -layout::MultiListBox::MultiListBox(layout::Window*, ResId const&) -layout::MultiListBox::MultiListBox(layout::Window*, long) -layout::NoButton::NoButton(layout::Window*, ResId const&) -layout::NoButton::NoButton(layout::Window*, long) -layout::NumericField::NumericField(layout::Context*, char const*, unsigned int) -layout::NumericField::NumericField(layout::Window*, long) -layout::NumericFormatter::GetValue() const -layout::NumericFormatter::SetFirst(long) -layout::NumericFormatter::SetLast(long) -layout::NumericFormatter::SetMax(long) -layout::NumericFormatter::SetMin(long) -layout::NumericFormatter::SetSpinSize(long) -layout::NumericFormatter::SetValue(long) -layout::OKButton::OKButton(layout::Context*, char const*, unsigned int) -layout::OKButton::OKButton(layout::Window*, ResId const&) -layout::OKButton::OKButton(layout::Window*, long) -layout::Plugin::Plugin(layout::Context*, char const*, Control*) -layout::ProgressBar::GetValue() -layout::ProgressBar::ProgressBar(layout::Context*, char const*, unsigned int) -layout::ProgressBar::ProgressBar(layout::Window*, ResId const&) -layout::ProgressBar::ProgressBar(layout::Window*, long) -layout::ProgressBar::SetBackgroundColor(int) -layout::ProgressBar::SetForegroundColor(int) -layout::ProgressBar::SetRange(int, int) -layout::ProgressBar::SetValue(int) -layout::PushButton::IsChecked() const -layout::PushButton::PushButton(layout::Context*, char const*, unsigned int) -layout::PushButton::PushButton(layout::Window*, ResId const&) -layout::PushButton::PushButton(layout::Window*, long) -layout::PushButton::Toggle() -layout::QueryBox::QueryBox(Window*, char const*, char const*, char const*, rtl::OString const&, char const*, char const*) -layout::QueryBox::QueryBox(Window*, long, char const*, char const*, char const*, rtl::OString const&, char const*, char const*) -layout::QueryBox::QueryBox(Window*, long, rtl::OUString const&, rtl::OUString, rtl::OUString, rtl::OString const&, char const*, char const*) -layout::QueryBox::QueryBox(Window*, rtl::OUString const&, rtl::OUString, rtl::OUString, rtl::OString const&, char const*, char const*) -layout::RadioButton::Check(bool) -layout::RadioButton::GetVCLXRadioButton() const -layout::RadioButton::IsChecked() const -layout::RadioButton::RadioButton(layout::Context*, char const*, unsigned int) -layout::RadioButton::RadioButton(layout::Window*, ResId const&) -layout::RadioButton::RadioButton(layout::Window*, long) -layout::ResetButton::ResetButton(layout::Context*, char const*, unsigned int) -layout::ResetButton::ResetButton(layout::Window*, ResId const&) -layout::ResetButton::ResetButton(layout::Window*, long) -layout::RetryButton::RetryButton(layout::Window*, ResId const&) -layout::RetryButton::RetryButton(layout::Window*, long) -layout::SpinField::SpinField(layout::Context*, char const*, unsigned int) -layout::SpinField::SpinField(layout::Window*, ResId const&) -layout::SpinField::SpinField(layout::Window*, long) -layout::TabControl::GetActivatePageHdl() const -layout::TabControl::GetCurPageId() const -layout::TabControl::GetDeactivatePageHdl() const -layout::TabControl::GetPageCount() const -layout::TabControl::GetPageId(unsigned short) const -layout::TabControl::GetPagePos(unsigned short) const -layout::TabControl::GetTabPage(unsigned short) const -layout::TabControl::GetTabPageSizePixel() const -layout::TabControl::GetVCLXTabControl() const -layout::TabControl::InsertPage(unsigned short, rtl::OUString const&, unsigned short) -layout::TabControl::RemovePage(unsigned short) -layout::TabControl::SetTabPage(unsigned short, TabPage*) -layout::TabControl::SetTabPageSizePixel(Size const&) -layout::TabControl::TabControl(layout::Context*, char const*, unsigned int) -layout::TabControl::TabControl(layout::Window*, ResId const&) -layout::TabControl::TabControl(layout::Window*, long) -layout::TabPage::TabPage(Window*, char const*, char const*, unsigned int) -layout::TabPage::TabPage(layout::Window*, char const*, char const*, unsigned int) -layout::Table::Add(layout::Container*, bool, bool, int, int) -layout::Table::Add(layout::Window*, bool, bool, int, int) -layout::Table::Table(int, int) -layout::Table::Table(layout::Context const*, char const*) -layout::VBox::VBox(int, bool) -layout::VBox::VBox(layout::Context const*, char const*) -layout::WarningBox::WarningBox(Window*, char const*, char const*, char const*, rtl::OString const&, char const*, char const*) -layout::WarningBox::WarningBox(Window*, long, char const*, char const*, char const*, rtl::OString const&, char const*, char const*) -layout::WarningBox::WarningBox(Window*, long, rtl::OUString const&, rtl::OUString, rtl::OUString, rtl::OString const&, char const*, char const*) -layout::WarningBox::WarningBox(Window*, rtl::OUString const&, rtl::OUString, rtl::OUString, rtl::OString const&, char const*, char const*) -layout::YesButton::YesButton(layout::Window*, ResId const&) -layout::YesButton::YesButton(layout::Window*, long) +layout::ListBox::GetEntry(unsigned short) const +layout::ListBox::GetEntryPos(String const&) const +layout::ListBox::GetSelectEntryPos(unsigned short) const +layout::ListBox::SelectEntryPos(unsigned short, bool) +layout::MetricFormatter::MetricFormatter(layout::FormatterBaseImpl*) +layout::MetricFormatter::getFormatImpl() const +layout::NumericFormatter::NumericFormatter(layout::FormatterBaseImpl*) +layout::NumericFormatter::getFormatImpl() const +layout::PushButton::Check(bool) +layout::PushButton::GetPushButton() const +layout::TabControl::SetCurPageId(unsigned short) +layout::Table::setProps(com::sun::star::uno::Reference<com::sun::star::awt::XLayoutConstrains>, bool, bool, int, int) +layout::Window::CreatePeer(layout::Window*, long, char const*) +layout::Window::getContext() +layout::WindowImpl::getProperty(char const*) layoutimpl::LayoutRoot::addItem(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::awt::XLayoutConstrains> const&) +layoutimpl::VCLXPlugin::SetPlugin(Control*) layoutimpl::VCLXTabControl::AddChild(com::sun::star::uno::Reference<com::sun::star::awt::XLayoutConstrains> const&) layoutimpl::WidgetFactory::sfx2CreateWindow(VCLXWindow**, Window*, rtl::OUString const&, long&) layoutimpl::getParent(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>) @@ -2570,7 +2366,6 @@ psp::PrinterGfx::SetFallbackFont(int) psp::PrinterJob::GetDocumentHeader() psp::PrinterJob::GetDocumentTrailer() psp::PrinterJob::GetErrorCode() -psp::appendStr(char const*, char*, int) pyuno::Runtime::finalize() pyuno::importToGlobal(_object*, _object*, _object*) rptui::OFieldExpressionControl::LinkStubAsynchActivate(void*, void*) diff --git a/ure/source/README b/ure/source/README index 64fa40bdb169..1463e04fdbbb 100644 --- a/ure/source/README +++ b/ure/source/README @@ -273,6 +273,11 @@ types.rdb and services.rdb files. That is, you cannot store additional types.rdb and services.rdb files in a Documents and Settings\All Users\Application Data\URE directory. +URE_MORE_TYPES and URE_MORE_SERVICES each contain zero or more space-separated +URI descriptors. A URI descriptor is either a URI (denoting an individual file) +or a URI embeded in "<" and ">*" (denoting all the files contained non- +recursively within the directory denoted by the given URI). + The Java UNO environment needs type information in the form of Java class files instead of rdb files. Additional types are searched for in any URLs listed in the public deployment variable URE_MORE_JAVA_TYPES. diff --git a/vcl/Library_vclplug_gtk.mk b/vcl/Library_vclplug_gtk.mk index 2e1983ecdb84..e2f9b8d68479 100644 --- a/vcl/Library_vclplug_gtk.mk +++ b/vcl/Library_vclplug_gtk.mk @@ -41,20 +41,6 @@ $(eval $(call gb_Library_add_defs,vclplug_gtk,\ -DVERSION=\"$(UPD)$(LAST_MINOR)\" \ )) -ifneq ($(ENABLE_DBUS),) -# FIXME: pkg-config calls should be done in configure, and this should be _use_external -$(eval $(call gb_Library_set_include,vclplug_gtk,\ - $$(INCLUDE) \ - $(filter -I%,$(shell pkg-config --cflags dbus-glib-1)) \ -)) -$(eval $(call gb_Library_add_defs,vclplug_gtk,\ - -DENABLE_DBUS \ -)) -$(eval $(call gb_Library_add_libs,vclplug_gtk,\ - $(shell pkg-config --libs dbus-glib-1)\ -)) -endif - $(eval $(call gb_Library_add_api,vclplug_gtk,\ offapi \ udkapi \ @@ -84,6 +70,7 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_gtk,\ )) $(eval $(call gb_Library_use_externals,vclplug_gtk,\ + dbus \ gtk \ gthread \ icule \ diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk index 72e7a7596754..9c589ff71606 100644 --- a/vcl/Library_vclplug_gtk3.mk +++ b/vcl/Library_vclplug_gtk3.mk @@ -51,19 +51,6 @@ $(eval $(call gb_Library_add_api,vclplug_gtk3,\ udkapi \ )) -ifneq ($(ENABLE_DBUS),) -$(eval $(call gb_Library_set_include,vclplug_gtk3,\ - $$(INCLUDE) \ - $(filter -I%,$(shell pkg-config --cflags dbus-glib-1)) \ -)) -$(eval $(call gb_Library_add_defs,vclplug_gtk3,\ - -DENABLE_DBUS \ -)) -$(eval $(call gb_Library_add_libs,vclplug_gtk3,\ - $(shell pkg-config --libs dbus-glib-1)\ -)) -endif - $(eval $(call gb_Library_add_libs,vclplug_gtk3,\ $$(GTK3_LIBS) \ $$(GTHREAD_LIBS) \ @@ -92,6 +79,10 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_gtk3,\ $(gb_STDLIBS) \ )) +$(eval $(call gb_Library_use_externals,vclplug_gtk,\ + dbus \ +)) + $(eval $(call gb_Library_add_exception_objects,vclplug_gtk3,\ vcl/unx/gtk3/a11y/gtk3atkaction \ vcl/unx/gtk3/a11y/gtk3atkbridge \ diff --git a/vcl/generic/print/psputil.cxx b/vcl/generic/print/psputil.cxx index 2664bac8d022..7f60cdb48726 100644 --- a/vcl/generic/print/psputil.cxx +++ b/vcl/generic/print/psputil.cxx @@ -142,14 +142,6 @@ appendStr (const sal_Char* pSrc, sal_Char* pDst) return nBytes; } -sal_Int32 -appendStr (const sal_Char* pSrc, sal_Char* pDst, sal_Int32 nBytes) -{ - strncpy (pDst, pSrc, nBytes); - pDst [nBytes] = '\0'; - return nBytes; -} - /* * copy strings to file */ diff --git a/vcl/generic/print/psputil.hxx b/vcl/generic/print/psputil.hxx index 2aaffda6519f..718e46d5a5b7 100644 --- a/vcl/generic/print/psputil.hxx +++ b/vcl/generic/print/psputil.hxx @@ -49,7 +49,6 @@ sal_Int32 getHexValueOf (sal_Int32 nValue, sal_Char* pBuffer); sal_Int32 getAlignedHexValueOf (sal_Int32 nValue, sal_Char* pBuffer); sal_Int32 getValueOf (sal_Int32 nValue, sal_Char* pBuffer); sal_Int32 appendStr (const sal_Char* pSrc, sal_Char* pDst); -sal_Int32 appendStr (const sal_Char* pSrc, sal_Char* pDst, sal_Int32 nBytes); sal_Bool WritePS (osl::File* pFile, const sal_Char* pString); sal_Bool WritePS (osl::File* pFile, const sal_Char* pString, sal_uInt64 nInLength); diff --git a/vcl/inc/unx/salunx.h b/vcl/inc/unx/salunx.h index e4150f0f7467..5082519b334d 100644 --- a/vcl/inc/unx/salunx.h +++ b/vcl/inc/unx/salunx.h @@ -33,9 +33,6 @@ #include <unx/svunx.h> #include <unx/salstd.hxx> -// -=-= #defines -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -#define capacityof(a) (sizeof(a)/sizeof(*a)) - // -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= inline long Divide( long nDividend, long nDivisor ) { return (nDividend + nDivisor/2) / nDivisor; } diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx index 32227345fb89..b2b812c03f53 100644 --- a/vcl/inc/vcl/button.hxx +++ b/vcl/inc/vcl/button.hxx @@ -94,7 +94,6 @@ public: void EnableTextDisplay( sal_Bool bEnable ); void SetFocusRect( const Rectangle& rFocusRect ); - void SetSmallSymbol (bool bSmall=true); bool IsSmallSymbol () const; }; diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx index 301af44bead9..3c96eea4d6c7 100644 --- a/vcl/inc/vcl/image.hxx +++ b/vcl/inc/vcl/image.hxx @@ -148,7 +148,6 @@ public: sal_uInt16 GetImagePos( const ::rtl::OUString& rImageName ) const; sal_uInt16 GetImageId( sal_uInt16 nPos ) const; - void GetImageIds( ::std::vector< sal_uInt16 >& rIds ) const; ::rtl::OUString GetImageName( sal_uInt16 nPos ) const; void GetImageNames( ::std::vector< ::rtl::OUString >& rNames ) const; diff --git a/vcl/inc/vcl/metaact.hxx b/vcl/inc/vcl/metaact.hxx index 87bc75fab2a0..64800fd6d0c8 100644 --- a/vcl/inc/vcl/metaact.hxx +++ b/vcl/inc/vcl/metaact.hxx @@ -1489,10 +1489,10 @@ class VCL_DLLPUBLIC MetaCommentAction : public MetaAction { private: - ByteString maComment; + rtl::OString maComment; sal_Int32 mnValue; sal_uInt32 mnDataSize; - sal_uInt8* mpData; + sal_uInt8* mpData; SAL_DLLPRIVATE void ImplInitDynamicData( const sal_uInt8* pData, sal_uInt32 nDataSize ); virtual sal_Bool Compare( const MetaAction& ) const; @@ -1503,7 +1503,7 @@ protected: public: MetaCommentAction( sal_Int32 nValue = 0L ); MetaCommentAction( const MetaCommentAction& rAct ); - MetaCommentAction( const ByteString& rComment, sal_Int32 nValue = 0L, const sal_uInt8* pData = NULL, sal_uInt32 nDataSize = 0UL ); + MetaCommentAction( const rtl::OString& rComment, sal_Int32 nValue = 0L, const sal_uInt8* pData = NULL, sal_uInt32 nDataSize = 0UL ); MetaCommentAction( const sal_uInt8* pData, sal_uInt32 nDataSize ); virtual void Move( long nHorzMove, long nVertMove ); @@ -1514,7 +1514,7 @@ public: virtual void Write( SvStream& rOStm, ImplMetaWriteData* pData ); virtual void Read( SvStream& rIStm, ImplMetaReadData* pData ); - const ByteString& GetComment() const { return maComment; } + const rtl::OString& GetComment() const { return maComment; } sal_Int32 GetValue() const { return mnValue; } sal_uInt32 GetDataSize() const { return mnDataSize; } const sal_uInt8* GetData() const { return mpData; } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 52eb43ee56ad..c5e1a46a933e 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -620,12 +620,6 @@ void Button::EnableTextDisplay( sal_Bool bEnable ) mpButtonData->mnButtonState |= BUTTON_DRAW_NOTEXT; } -// ----------------------------------------------------------------------- -void Button::SetSmallSymbol (bool small) -{ - ImplSetSmallSymbol (small); -} - bool Button::IsSmallSymbol () const { return mpButtonData->mbSmallSymbol; diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index fffde0472b75..7ab555db7880 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -556,7 +556,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos ) { MetaCommentAction* pCommentAct = static_cast<MetaCommentAction*>(pAction); if( pAction->GetType() == META_COMMENT_ACTION && - pCommentAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") ) + pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("DELEGATE_PLUGGABLE_RENDERER")) ) { ImplDelegate2PluggableRenderer(pCommentAct, pOut); } @@ -658,7 +658,7 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut ) { - OSL_ASSERT( pAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") ); + OSL_ASSERT( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("DELEGATE_PLUGGABLE_RENDERER")) ); // read payload - string of service name, followed by raw render input const sal_uInt8* pData = pAct->GetData(); @@ -1534,7 +1534,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) case( META_COMMENT_ACTION ): { MetaCommentAction* pCommentAct = (MetaCommentAction*) pAction; - if( pCommentAct->GetComment().Equals( "XGRAD_SEQ_BEGIN" ) ) + if( pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN")) ) { int nBeginComments( 1 ); pAction = NextAction(); @@ -1555,7 +1555,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) else if( META_COMMENT_ACTION == nType) { MetaCommentAction* pAct = (MetaCommentAction*) pAction; - if( pAct->GetComment().Equals( "XGRAD_SEQ_END" ) ) + if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END")) ) { // handle nested blocks --nBeginComments; @@ -1564,7 +1564,7 @@ void GDIMetaFile::Rotate( long nAngle10 ) if( !nBeginComments ) break; } - else if( pAct->GetComment().Equals( "XGRAD_SEQ_BEGIN" ) ) + else if( pAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN")) ) { // handle nested blocks ++nBeginComments; @@ -1577,8 +1577,8 @@ void GDIMetaFile::Rotate( long nAngle10 ) } else { - sal_Bool bPathStroke = pCommentAct->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ); - if ( bPathStroke || pCommentAct->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) ) + sal_Bool bPathStroke = pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN")); + if ( bPathStroke || pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) ) { if ( pCommentAct->GetDataSize() ) { @@ -1608,8 +1608,8 @@ void GDIMetaFile::Rotate( long nAngle10 ) } } } - else if ( pCommentAct->GetComment().Equals( "XPATHSTROKE_SEQ_END" ) - || pCommentAct->GetComment().Equals( "XPATHFILL_SEQ_END" ) ) + else if ( pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_END")) + || pCommentAct->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END")) ) { pAction->Execute( &aMapVDev ); pAction->Duplicate(); diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index f587bc29d2e9..ad7f84d48eb5 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -824,23 +824,6 @@ sal_uInt16 ImageList::GetImageId( sal_uInt16 nPos ) const // ----------------------------------------------------------------------- -void ImageList::GetImageIds( ::std::vector< sal_uInt16 >& rIds ) const -{ - RTL_LOGFILE_CONTEXT( aLog, "vcl: ImageList::GetImageIds" ); - - DBG_CHKTHIS( ImageList, NULL ); - - rIds = ::std::vector< sal_uInt16 >(); - - if( mpImplData ) - { - for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); i++ ) - rIds.push_back( mpImplData->maImages[i]->mnId ); - } -} - -// ----------------------------------------------------------------------- - ::rtl::OUString ImageList::GetImageName( sal_uInt16 nPos ) const { DBG_CHKTHIS( ImageList, NULL ); diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 99e56ece49ad..03c5390e6f36 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -4019,7 +4019,7 @@ MetaCommentAction::MetaCommentAction( const MetaCommentAction& rAct ) : // ------------------------------------------------------------------------ -MetaCommentAction::MetaCommentAction( const ByteString& rComment, sal_Int32 nValue, const sal_uInt8* pData, sal_uInt32 nDataSize ) : +MetaCommentAction::MetaCommentAction( const rtl::OString& rComment, sal_Int32 nValue, const sal_uInt8* pData, sal_uInt32 nDataSize ) : MetaAction ( META_COMMENT_ACTION ), maComment ( rComment ), mnValue ( nValue ) @@ -4086,8 +4086,8 @@ void MetaCommentAction::Move( long nXMove, long nYMove ) { if ( mnDataSize && mpData ) { - sal_Bool bPathStroke = maComment.Equals( "XPATHSTROKE_SEQ_BEGIN" ); - if ( bPathStroke || maComment.Equals( "XPATHFILL_SEQ_BEGIN" ) ) + sal_Bool bPathStroke = maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN")); + if ( bPathStroke || maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) ) { SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ ); SvMemoryStream aDest; @@ -4129,8 +4129,8 @@ void MetaCommentAction::Scale( double fXScale, double fYScale ) { if ( mnDataSize && mpData ) { - sal_Bool bPathStroke = maComment.Equals( "XPATHSTROKE_SEQ_BEGIN" ); - if ( bPathStroke || maComment.Equals( "XPATHFILL_SEQ_BEGIN" ) ) + sal_Bool bPathStroke = maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN")); + if ( bPathStroke || maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) ) { SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ ); SvMemoryStream aDest; @@ -4156,7 +4156,7 @@ void MetaCommentAction::Scale( double fXScale, double fYScale ) } delete[] mpData; ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() ); - } else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) { + } else if( maComment.equalsL(RTL_CONSTASCII_STRINGPARAM("EMF_PLUS_HEADER_INFO")) ){ SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ ); SvMemoryStream aDest; @@ -4213,7 +4213,10 @@ void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* ) { COMPAT( rIStm ); - rIStm >> maComment >> mnValue >> mnDataSize; + ByteString sTmp; + rIStm >> sTmp; + maComment = sTmp; + rIStm >> mnValue >> mnDataSize; if( mpData ) delete[] mpData; diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index f7a1ad5bcb56..852e7ffac16c 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -523,7 +523,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa const MetaCommentAction* pA = (const MetaCommentAction*) pAction; String aSkipComment; - if( pA->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_BEGIN" ) == COMPARE_EQUAL ) + if( pA->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_BEGIN"))) { const MetaGradientExAction* pGradAction = NULL; sal_Bool bDone = sal_False; @@ -535,7 +535,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa if( pAction->GetType() == META_GRADIENTEX_ACTION ) pGradAction = (const MetaGradientExAction*) pAction; else if( ( pAction->GetType() == META_COMMENT_ACTION ) && - ( ( (const MetaCommentAction*) pAction )->GetComment().CompareIgnoreCaseToAscii( "XGRAD_SEQ_END" ) == COMPARE_EQUAL ) ) + ( ( (const MetaCommentAction*) pAction )->GetComment().equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("XGRAD_SEQ_END"))) ) { bDone = sal_True; } @@ -559,7 +559,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa sal_Bool bSkipSequence = sal_False; rtl::OString sSeqEnd; - if( pA->GetComment().Equals( "XPATHSTROKE_SEQ_BEGIN" ) ) + if( pA->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_BEGIN")) ) { sSeqEnd = rtl::OString(RTL_CONSTASCII_STRINGPARAM("XPATHSTROKE_SEQ_END")); SvtGraphicStroke aStroke; @@ -644,7 +644,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa } } } - else if ( pA->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) ) + else if ( pA->GetComment().equalsL(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_BEGIN")) ) { sSeqEnd = rtl::OString(RTL_CONSTASCII_STRINGPARAM("XPATHFILL_SEQ_END")); SvtGraphicFill aFill; diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx index 8eb660202483..3f88f359f575 100644 --- a/vcl/unx/generic/app/saldata.cxx +++ b/vcl/unx/generic/app/saldata.cxx @@ -513,7 +513,7 @@ static void PrintXError( Display *pDisplay, XErrorEvent *pEvent ) XGetErrorText( pDisplay, pEvent->error_code, msg, sizeof( msg ) ); #endif std::fprintf( stderr, "X-Error: %s\n", msg ); - if( pEvent->request_code < capacityof( XRequest ) ) + if( pEvent->request_code < SAL_N_ELEMENTS( XRequest ) ) { const char* pName = XRequest[pEvent->request_code]; if( !pName ) diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 4599ec4ee317..17f179623544 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -836,13 +836,9 @@ extern "C" { GTimeVal aTimeNow; g_source_get_current_time( pSource, &aTimeNow ); - if( pTSource->aFireTime.tv_sec > aTimeNow.tv_sec ) - return FALSE; - if( pTSource->aFireTime.tv_sec < aTimeNow.tv_sec ) - return TRUE; - if( pTSource->aFireTime.tv_usec < aTimeNow.tv_usec ) - return FALSE; - return TRUE; + return ( pTSource->aFireTime.tv_sec < aTimeNow.tv_sec || + ( pTSource->aFireTime.tv_sec == aTimeNow.tv_sec && + pTSource->aFireTime.tv_usec < aTimeNow.tv_usec ) ); } static gboolean sal_gtk_timeout_dispatch( GSource *pSource, GSourceFunc, gpointer ) @@ -921,7 +917,7 @@ bool GtkSalTimer::Expired() void GtkSalTimer::Start( sal_uLong nMS ) { m_nTimeoutMS = nMS; // for restarting - Stop(); + Stop(); // FIXME: ideally re-use an existing m_pTimeout m_pTimeout = create_sal_gtk_timeout( this ); } diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx index b752cce84891..dbe1c47c7e89 100644 --- a/vcl/unx/gtk/app/gtksys.cxx +++ b/vcl/unx/gtk/app/gtksys.cxx @@ -118,7 +118,7 @@ static int _fallback_get_primary_monitor (GdkScreen *pScreen) for (int i = 0; i < max && ret < 0; i++) { char *name = gdk_screen_get_monitor_plug_name (pScreen, i); - if (!g_ascii_strncasecmp (name, "LVDS", 4)) + if (name && !g_ascii_strncasecmp (name, "LVDS", 4)) ret = i; g_free (name); } diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx index a5804b39b5e4..56150cf93105 100644 --- a/vcl/unx/kde4/KDEXLib.cxx +++ b/vcl/unx/kde4/KDEXLib.cxx @@ -57,7 +57,7 @@ #include <stdio.h> -#if QT_VERSION >= QT_VERSION_CHECK( 4, 8, 1 ) +#if QT_VERSION >= QT_VERSION_CHECK( 4, 9, 0 ) #define QT_UNIX_EVENT_LOOP_SUPPORT #ifdef KDE_HAVE_GLIB #define GLIB_EVENT_LOOP_SUPPORT diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index e17b4b5b302a..bdbd3f483a5d 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2006,9 +2006,10 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) } else { - RTFValue::Pointer_t pValue(new RTFValue(std::find(m_aFontIndexes.begin(), m_aFontIndexes.end(), nParam) - m_aFontIndexes.begin())); + int nFontIndex = std::find(m_aFontIndexes.begin(), m_aFontIndexes.end(), nParam) - m_aFontIndexes.begin(); + RTFValue::Pointer_t pValue(new RTFValue(nFontIndex)); m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CRgFtc0, pValue)); - m_aStates.top().nCurrentEncoding = getEncodingTable(nParam); + m_aStates.top().nCurrentEncoding = getEncodingTable(nFontIndex); } break; case RTF_RED: diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx index 17b0b3d65dae..cb095ebcfc75 100644 --- a/xmloff/inc/xmloff/txtparae.hxx +++ b/xmloff/inc/xmloff/txtparae.hxx @@ -673,8 +673,6 @@ public: SinglePropertySetInfoCache& GetCharStyleNamesPropInfoCache() { return aCharStyleNamesPropInfoCache; } - sal_Int32 GetHeadingLevel( const ::rtl::OUString& rStyleName ); - void PushNewTextListsHelper(); void PopTextListsHelper(); diff --git a/xmloff/inc/xmloff/xmlexppr.hxx b/xmloff/inc/xmloff/xmlexppr.hxx index b7a2c684c81c..fb5851e36e76 100644 --- a/xmloff/inc/xmloff/xmlexppr.hxx +++ b/xmloff/inc/xmloff/xmlexppr.hxx @@ -39,7 +39,6 @@ namespace rtl { class OUString; } class SvXMLUnitConverter; class SvXMLAttributeList; class SvXMLNamespaceMap; -class SvUShorts; class FilterPropertiesInfos_Impl; class SvXMLExport; @@ -85,7 +84,7 @@ protected: const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, sal_uInt16 nFlags, - SvUShorts* pIndexArray, + std::vector<sal_uInt16>* pIndexArray, sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const; void _exportXML( SvXMLAttributeList& rAttrList, @@ -100,7 +99,7 @@ protected: SvXMLExport& rExport, const ::std::vector< XMLPropertyState >& rProperties, sal_uInt16 nFlags, - const SvUShorts& rIndexArray ) const; + const std::vector<sal_uInt16>& rIndexArray ) const; public: diff --git a/xmloff/inc/xmloff/xmlnume.hxx b/xmloff/inc/xmloff/xmlnume.hxx index 473bec6d5dec..7edda8ca02ae 100644 --- a/xmloff/inc/xmloff/xmlnume.hxx +++ b/xmloff/inc/xmloff/xmlnume.hxx @@ -98,11 +98,6 @@ public: const ::rtl::OUString& rName, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > & xNumRule ); - - static sal_Bool GetOutlineStyles( XMLStringVector& rStyleNames, - const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel > & rModel ); - }; #endif // _XMLOFF_XMLNUME_HXX diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 2b83ec2c6b48..47d5777b0158 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -49,11 +49,6 @@ #include <xmloff/PropertySetInfoHash.hxx> #include <comphelper/stl_types.hxx> -#ifndef _SVSTDARR_USHORTS -#define _SVSTDARR_USHORTS -#include <svl/svstdarr.hxx> -#endif - using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -830,7 +825,7 @@ void SvXMLExportPropertyMapper::exportXML( sal_uInt16 nPropType = aPropTokens[i].nType; if( 0==i || (nPropTypeFlags & (1 << nPropType)) != 0 ) { - SvUShorts aIndexArray; + std::vector<sal_uInt16> aIndexArray; _exportXML( nPropType, nPropTypeFlags, rExport.GetAttrList(), rProperties, @@ -841,7 +836,7 @@ void SvXMLExportPropertyMapper::exportXML( if( rExport.GetAttrList().getLength() > 0L || (nFlags & XML_EXPORT_FLAG_EMPTY) != 0 || - aIndexArray.Count() != 0 ) + !aIndexArray.empty() ) { SvXMLElementExport aElem( rExport, XML_NAMESPACE_STYLE, aPropTokens[i].eToken, @@ -898,7 +893,7 @@ void SvXMLExportPropertyMapper::_exportXML( const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap, sal_uInt16 nFlags, - SvUShorts* pIndexArray, + std::vector<sal_uInt16>* pIndexArray, sal_Int32 nPropMapStartIdx, sal_Int32 nPropMapEndIdx ) const { const sal_uInt32 nCount = rProperties.size(); @@ -928,7 +923,9 @@ void SvXMLExportPropertyMapper::_exportXML( // element items do not add any properties, // we export it later if( pIndexArray ) - pIndexArray->Insert( (sal_uInt16)nIndex, pIndexArray->Count() ); + { + pIndexArray->push_back( (sal_uInt16)nIndex ); + } } else { @@ -1092,15 +1089,15 @@ void SvXMLExportPropertyMapper::exportElementItems( SvXMLExport& rExport, const ::std::vector< XMLPropertyState >& rProperties, sal_uInt16 nFlags, - const SvUShorts& rIndexArray ) const + const std::vector<sal_uInt16>& rIndexArray ) const { - const sal_uInt16 nCount = rIndexArray.Count(); + const sal_uInt16 nCount = rIndexArray.size(); sal_Bool bItemsExported = sal_False; OUString sWS( GetXMLToken(XML_WS) ); for( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ ) { - const sal_uInt16 nElement = rIndexArray.GetObject( nIndex ); + const sal_uInt16 nElement = rIndexArray[nIndex]; OSL_ENSURE( 0 != ( maPropMapper->GetEntryFlags( rProperties[nElement].mnIndex ) & MID_FLAG_ELEMENT_ITEM_EXPORT), diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx index 58145c4d1378..954587bcdea0 100644 --- a/xmloff/source/style/xmlnume.cxx +++ b/xmloff/source/style/xmlnume.cxx @@ -871,46 +871,4 @@ void SvxXMLNumRuleExport::exportStyles( sal_Bool bUsed, } } -sal_Bool SvxXMLNumRuleExport::GetOutlineStyles( XMLStringVector& rStyleNames, - const ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel > & rModel ) -{ - Reference< XChapterNumberingSupplier > xCNSupplier( rModel, - UNO_QUERY ); - sal_Int32 nLevels = 0; - Reference< XIndexReplace > xNumRule; - if( xCNSupplier.is() ) - { - xNumRule = xCNSupplier->getChapterNumberingRules(); - if( xNumRule.is() ) - nLevels = xNumRule->getCount(); - } - - rStyleNames.resize( nLevels ); - for( sal_Int32 i=0; i<nLevels; i++ ) - { - uno::Any aEntry( xNumRule->getByIndex( i ) ); - uno::Sequence<beans::PropertyValue> aSeq; - if( aEntry >>= aSeq ) - { - const sal_Int32 nCount = aSeq.getLength(); - const beans::PropertyValue* pPropArray = aSeq.getConstArray(); - for( sal_Int32 j=0; j<nCount; j++ ) - { - const beans::PropertyValue& rProp = pPropArray[j]; - - if( rProp.Name.equalsAsciiL( - XML_UNO_NAME_NRULE_HEADING_STYLE_NAME, - sizeof(XML_UNO_NAME_NRULE_HEADING_STYLE_NAME)-1 ) ) - { - rProp.Value >>= rStyleNames[i]; - break; - } - } - } - } - - return nLevels != 0; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 14501ae9f498..dac0b8e5afc5 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -3695,22 +3695,6 @@ void XMLTextParagraphExport::PreventExportOfControlsInMuteSections( // else: no control shape -> nothing to do } } -sal_Int32 XMLTextParagraphExport::GetHeadingLevel( const OUString& rStyleName ) -{ - if( !pHeadingStyles ) - { - pHeadingStyles = new XMLStringVector; - SvxXMLNumRuleExport::GetOutlineStyles( *pHeadingStyles, - GetExport().GetModel() ); - } - for( XMLStringVector::size_type i=0; i < pHeadingStyles->size(); ++i ) - { - if( (*pHeadingStyles)[i] == rStyleName ) - return static_cast < sal_Int32 >( i ); - } - - return -1; -} void XMLTextParagraphExport::PushNewTextListsHelper() { diff --git a/xmlsecurity/Library_xsec_xmlsec.mk b/xmlsecurity/Library_xsec_xmlsec.mk index f51fd9d9143c..90dcad0ee939 100644 --- a/xmlsecurity/Library_xsec_xmlsec.mk +++ b/xmlsecurity/Library_xsec_xmlsec.mk @@ -148,12 +148,11 @@ $(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\ endif # ifeq ($(GUI),WNT) -ifeq ($(SYSTEM_MOZILLA),YES) +ifeq ($(SYSTEM_NSS),YES) $(eval $(call gb_Library_set_include,xsec_xmlsec,\ $$(INCLUDE) \ - $(MOZ_NSPR_CFLAGS) \ - $(MOZ_NSS_CFLAGS) \ + $(NSS_CFLAGS) \ )) $(eval $(call gb_Library_add_defs,xsec_xmlsec,\ @@ -161,9 +160,7 @@ $(eval $(call gb_Library_add_defs,xsec_xmlsec,\ )) $(eval $(call gb_Library_add_libs,xsec_xmlsec,\ - $(NSPR_LIB) \ - $(NSS_LIB) \ - $(MOZ_NSS_LIBS) \ + $(NSS_LIBS) \ )) else @@ -179,7 +176,7 @@ $(eval $(call gb_Library_add_linked_libs,xsec_xmlsec,\ nss3 \ )) -endif # ifeq ($(SYSTEM_MOZILLA),YES) +endif # ifeq ($(SYSTEM_NSS),YES) ifeq ($(OS),SOLARIS) $(eval $(call gb_Library_add_linked_libs,xsec_xmlsec,\ diff --git a/xmlsecurity/Module_xmlsecurity.mk b/xmlsecurity/Module_xmlsecurity.mk index b32ff3b8fbbe..2e6e8d9bb571 100644 --- a/xmlsecurity/Module_xmlsecurity.mk +++ b/xmlsecurity/Module_xmlsecurity.mk @@ -32,7 +32,7 @@ $(eval $(call gb_Module_add_targets,xmlsecurity,\ AllLangResTarget_xsec \ Library_xmlsecurity \ Library_xsec_fw \ - $(if $(filter YES,$(ENABLE_NSS_MODULE) $(SYSTEM_MOZILLA)),Library_xsec_xmlsec) \ + Library_xsec_xmlsec \ )) # failing |