diff options
author | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
commit | 06ec1c089519ef3249464aa09eadf03a8db93a39 (patch) | |
tree | 85b2eb6d8ba6ca95e18e1ff82151224cb14106f6 /sw | |
parent | 8e0d67bed54633d555a4601a5d79e2d5ba7ab2bb (diff) | |
parent | 3f899eae02eaad0b967de749fe09b869ba93ad6d (diff) |
Merge branch 'master' into feature/killsdf
Conflicts:
Repository.mk
RepositoryFixes.mk
connectivity/prj/build.lst
extensions/prj/build.lst
filter/prj/build.lst
fpicker/prj/build.lst
l10ntools/StaticLibrary_transex.mk
saxon/build.xml
shell/prj/build.lst
solenv/gbuild/AllLangResTarget.mk
solenv/gbuild/Configuration.mk
solenv/gbuild/UI.mk
ucb/source/ucp/webdav/webdavcontent.cxx
Diffstat (limited to 'sw')
459 files changed, 7465 insertions, 7031 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index 8d7f4f8cf886..5bb8873e0f86 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -156,7 +156,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/misc/glosbib.src \ sw/source/ui/misc/glossary.src \ sw/source/ui/misc/insfnote.src \ - sw/source/ui/misc/insrule.src \ sw/source/ui/misc/num.src \ sw/source/ui/misc/numberingtypelistbox.src \ sw/source/ui/misc/outline.src \ diff --git a/sw/CppunitTest_sw_filters_test.mk b/sw/CppunitTest_sw_filters_test.mk index e49b46719135..ee57d879e03c 100644 --- a/sw/CppunitTest_sw_filters_test.mk +++ b/sw/CppunitTest_sw_filters_test.mk @@ -72,6 +72,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_filters_test,\ $(eval $(call gb_CppunitTest_use_ure,sw_filters_test)) $(eval $(call gb_CppunitTest_use_components,sw_filters_test,\ + basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ dbaccess/util/dba \ @@ -79,6 +80,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_filters_test,\ forms/util/frm \ framework/util/fwk \ i18npool/util/i18npool \ + package/source/xstor/xstor \ package/util/package2 \ sax/source/expatwrap/expwrap \ sfx2/util/sfx \ @@ -90,6 +92,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_filters_test,\ ucb/source/ucp/file/ucpfile1 \ unoxml/source/service/unoxml \ $(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \ + xmloff/source/transform/xof \ )) $(eval $(call gb_CppunitTest_use_configuration,sw_filters_test)) diff --git a/sw/CppunitTest_sw_regression_test.mk b/sw/CppunitTest_sw_regression_test.mk deleted file mode 100644 index 32d2bdb46c55..000000000000 --- a/sw/CppunitTest_sw_regression_test.mk +++ /dev/null @@ -1,126 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -#************************************************************************* -# 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 Red Hat, Inc., Caolán McNamara <caolanm@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. -#************************************************************************* - -$(eval $(call gb_CppunitTest_CppunitTest,sw_regression_test)) - -$(eval $(call gb_CppunitTest_add_exception_objects,sw_regression_test, \ - sw/qa/extras/regression-test \ -)) - -$(eval $(call gb_CppunitTest_use_libraries,sw_regression_test, \ - avmedia \ - basegfx \ - comphelper \ - cppu \ - cppuhelper \ - drawinglayer \ - editeng \ - fileacc \ - for \ - forui \ - i18nisolang1 \ - msfilter \ - oox \ - sal \ - salhelper \ - sax \ - sb \ - sw \ - sfx \ - sot \ - svl \ - svt \ - svx \ - svxcore \ - test \ - tl \ - tk \ - ucbhelper \ - unotest \ - utl \ - vbahelper \ - vcl \ - xo \ - $(gb_UWINAPI) \ -)) - -$(eval $(call gb_CppunitTest_set_include,sw_regression_test,\ - -I$(SRCDIR)/sw/source/ui/inc \ - -I$(SRCDIR)/sw/inc \ - $$(INCLUDE) \ -)) - -$(eval $(call gb_CppunitTest_use_api,sw_regression_test,\ - offapi \ - oovbaapi \ - udkapi \ -)) - -$(eval $(call gb_CppunitTest_use_ure,sw_regression_test)) - -$(eval $(call gb_CppunitTest_use_components,sw_regression_test,\ - basic/util/sb \ - comphelper/util/comphelp \ - configmgr/source/configmgr \ - dbaccess/util/dba \ - fileaccess/source/fileacc \ - filter/source/config/cache/filterconfig1 \ - forms/util/frm \ - framework/util/fwk \ - i18npool/util/i18npool \ - oox/util/oox \ - package/source/xstor/xstor \ - package/util/package2 \ - sax/source/expatwrap/expwrap \ - sax/source/fastparser/fastsax \ - sw/util/sw \ - sw/util/swd \ - sw/util/msword \ - sw/util/vbaswobj \ - scripting/source/basprov/basprov \ - scripting/util/scriptframe \ - sfx2/util/sfx \ - sot/util/sot \ - svl/source/fsstor/fsstorage \ - toolkit/util/tk \ - ucb/source/core/ucb1 \ - ucb/source/ucp/file/ucpfile1 \ - ucb/source/ucp/tdoc/ucptdoc1 \ - unotools/util/utl \ - unoxml/source/rdf/unordf \ - unoxml/source/service/unoxml \ -)) - -$(eval $(call gb_CppunitTest_use_configuration,sw_regression_test)) - -$(eval $(call gb_CppunitTest_use_filter_configuration,sw_regression_test)) - -$(eval $(call gb_CppunitTest_use_unittest_configuration,sw_regression_test)) - -# vim: set noet sw=4 ts=4: diff --git a/sw/CppunitTest_sw_subsequent_odfexport.mk b/sw/CppunitTest_sw_subsequent_odfexport.mk index ed559ba069cd..51496594faa1 100644 --- a/sw/CppunitTest_sw_subsequent_odfexport.mk +++ b/sw/CppunitTest_sw_subsequent_odfexport.mk @@ -65,12 +65,14 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_odfexport,\ $(eval $(call gb_CppunitTest_use_ure,sw_subsequent_odfexport)) $(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfexport,\ + basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ fileaccess/source/fileacc \ filter/source/config/cache/filterconfig1 \ framework/util/fwk \ i18npool/util/i18npool \ + linguistic/source/lng \ package/util/package2 \ package/source/xstor/xstor \ sw/util/sw \ diff --git a/sw/CppunitTest_sw_subsequent_odfimport.mk b/sw/CppunitTest_sw_subsequent_odfimport.mk index 9cd82706f2cf..189817e5c68e 100644 --- a/sw/CppunitTest_sw_subsequent_odfimport.mk +++ b/sw/CppunitTest_sw_subsequent_odfimport.mk @@ -64,12 +64,14 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_odfimport,\ $(eval $(call gb_CppunitTest_use_ure,sw_subsequent_odfimport)) $(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfimport,\ + basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ fileaccess/source/fileacc \ filter/source/config/cache/filterconfig1 \ framework/util/fwk \ i18npool/util/i18npool \ + linguistic/source/lng \ package/util/package2 \ package/source/xstor/xstor \ sw/util/sw \ diff --git a/sw/CppunitTest_sw_subsequent_ooxmlexport.mk b/sw/CppunitTest_sw_subsequent_ooxmlexport.mk index 9eff7dd68dd4..288795e479b2 100644 --- a/sw/CppunitTest_sw_subsequent_ooxmlexport.mk +++ b/sw/CppunitTest_sw_subsequent_ooxmlexport.mk @@ -65,6 +65,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_ooxmlexport,\ $(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ooxmlexport)) $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmlexport,\ + basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ embeddedobj/util/embobj \ @@ -72,6 +73,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmlexport,\ filter/source/config/cache/filterconfig1 \ framework/util/fwk \ i18npool/util/i18npool \ + linguistic/source/lng \ oox/util/oox \ package/source/xstor/xstor \ package/util/package2 \ diff --git a/sw/CppunitTest_sw_subsequent_ooxmlimport.mk b/sw/CppunitTest_sw_subsequent_ooxmlimport.mk index d8b9bc428383..48e08c58b4b2 100644 --- a/sw/CppunitTest_sw_subsequent_ooxmlimport.mk +++ b/sw/CppunitTest_sw_subsequent_ooxmlimport.mk @@ -64,6 +64,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_ooxmlimport,\ $(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ooxmlimport)) $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmlimport,\ + basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ embeddedobj/util/embobj \ @@ -71,6 +72,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmlimport,\ filter/source/config/cache/filterconfig1 \ framework/util/fwk \ i18npool/util/i18npool \ + linguistic/source/lng \ oox/util/oox \ package/source/xstor/xstor \ package/util/package2 \ diff --git a/sw/CppunitTest_sw_subsequent_rtfexport.mk b/sw/CppunitTest_sw_subsequent_rtfexport.mk index d6d2a290845f..f5ac911628b9 100644 --- a/sw/CppunitTest_sw_subsequent_rtfexport.mk +++ b/sw/CppunitTest_sw_subsequent_rtfexport.mk @@ -64,6 +64,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_rtfexport,\ $(eval $(call gb_CppunitTest_use_ure,sw_subsequent_rtfexport)) $(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfexport,\ + basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ embeddedobj/util/embobj \ @@ -71,6 +72,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfexport,\ filter/source/config/cache/filterconfig1 \ framework/util/fwk \ i18npool/util/i18npool \ + linguistic/source/lng \ package/source/xstor/xstor \ package/util/package2 \ sax/source/expatwrap/expwrap \ diff --git a/sw/CppunitTest_sw_subsequent_rtfimport.mk b/sw/CppunitTest_sw_subsequent_rtfimport.mk index 2cc2110594eb..599c96182c8f 100644 --- a/sw/CppunitTest_sw_subsequent_rtfimport.mk +++ b/sw/CppunitTest_sw_subsequent_rtfimport.mk @@ -43,6 +43,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_subsequent_rtfimport, \ unotest \ vcl \ tl \ + utl \ $(gb_UWINAPI) \ )) @@ -65,12 +66,14 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_rtfimport,\ $(eval $(call gb_CppunitTest_use_ure,sw_subsequent_rtfimport)) $(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfimport,\ + basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ fileaccess/source/fileacc \ filter/source/config/cache/filterconfig1 \ framework/util/fwk \ i18npool/util/i18npool \ + linguistic/source/lng \ package/util/package2 \ sax/source/expatwrap/expwrap \ sw/util/sw \ diff --git a/sw/CppunitTest_sw_subsequent_ww8export.mk b/sw/CppunitTest_sw_subsequent_ww8export.mk index 5fccb5d848a1..68fd485c9873 100644 --- a/sw/CppunitTest_sw_subsequent_ww8export.mk +++ b/sw/CppunitTest_sw_subsequent_ww8export.mk @@ -69,11 +69,13 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ww8export,\ comphelper/util/comphelp \ configmgr/source/configmgr \ dbaccess/util/dba \ + embeddedobj/util/embobj \ fileaccess/source/fileacc \ filter/source/config/cache/filterconfig1 \ forms/util/frm \ framework/util/fwk \ i18npool/util/i18npool \ + linguistic/source/lng \ package/source/xstor/xstor \ package/util/package2 \ sax/source/expatwrap/expwrap \ diff --git a/sw/CppunitTest_sw_subsequent_ww8import.mk b/sw/CppunitTest_sw_subsequent_ww8import.mk index c00f966ae7d8..b59f32be5b72 100644 --- a/sw/CppunitTest_sw_subsequent_ww8import.mk +++ b/sw/CppunitTest_sw_subsequent_ww8import.mk @@ -63,6 +63,7 @@ $(eval $(call gb_CppunitTest_use_api,sw_subsequent_ww8import,\ $(eval $(call gb_CppunitTest_use_ure,sw_subsequent_ww8import)) $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ww8import,\ + basic/util/sb \ comphelper/util/comphelp \ configmgr/source/configmgr \ dbaccess/util/dba \ @@ -71,6 +72,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ww8import,\ forms/util/frm \ framework/util/fwk \ i18npool/util/i18npool \ + linguistic/source/lng \ package/util/package2 \ sw/util/msword \ sw/util/sw \ diff --git a/sw/README b/sw/README index dc844a678c3f..6bfac0258ab6 100644 --- a/sw/README +++ b/sw/README @@ -1 +1,5 @@ Writer application code. + +Exakt history ist lost before Sept. 18th, 2000, but old source code +comments show that Writer core dates back until at least November +1990. diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk index fc53c25e062a..034d6b7e1ac4 100644 --- a/sw/UI_swriter.mk +++ b/sw/UI_swriter.mk @@ -11,9 +11,14 @@ $(eval $(call gb_UI_UI,modules/swriter)) $(eval $(call gb_UI_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/autoformattable \ + sw/uiconfig/swriter/ui/bibliographyentry \ sw/uiconfig/swriter/ui/charurlpage \ sw/uiconfig/swriter/ui/columnwidth \ sw/uiconfig/swriter/ui/converttexttable \ + sw/uiconfig/swriter/ui/endnotepage \ + sw/uiconfig/swriter/ui/footnotepage \ + sw/uiconfig/swriter/ui/horizontalrule \ + sw/uiconfig/swriter/ui/indexentry \ sw/uiconfig/swriter/ui/insertbreak \ sw/uiconfig/swriter/ui/inserttable \ sw/uiconfig/swriter/ui/linenumbering \ diff --git a/sw/inc/IDocumentLinksAdministration.hxx b/sw/inc/IDocumentLinksAdministration.hxx index 76342120963f..d3b1c167b83c 100644 --- a/sw/inc/IDocumentLinksAdministration.hxx +++ b/sw/inc/IDocumentLinksAdministration.hxx @@ -53,7 +53,7 @@ namespace sfx2 { class SvLinkSource; class LinkManager; } /** #i42634# Moved common code of SwReader::Read() and SwDocShell::UpdateLinks() to new SwDoc::UpdateLinks(): */ - virtual void UpdateLinks(sal_Bool bUI) = 0; + virtual void UpdateLinks(bool bUI) = 0; /** SS fuers Linken von Dokumentteilen / ?? for linking of parts of documents. */ diff --git a/sw/inc/acmplwrd.hxx b/sw/inc/acmplwrd.hxx index 6d86722442c4..b26721330d39 100644 --- a/sw/inc/acmplwrd.hxx +++ b/sw/inc/acmplwrd.hxx @@ -61,8 +61,6 @@ public: bool InsertWord( const String& rWord, SwDoc& rDoc ); - sal_Bool GetRange( const String& rWord, sal_uInt16& rStt, sal_uInt16& rEnd ) const; - const String& operator[](size_t n) const { return m_WordList[n]->GetAutoCompleteString(); } @@ -93,7 +91,7 @@ public: // Returns all words matching a given prefix aMatch. If bIgnoreCurrentPos is set, the current // position within the tree is ignored and replaced by aMatch. - bool GetWordsMatching(String aMatch, std::vector<String>& aWords, sal_Bool bIgnoreCurrentPos) const; + bool GetWordsMatching(String aMatch, std::vector<String>& aWords, bool bIgnoreCurrentPos) const; }; diff --git a/sw/inc/bparr.hxx b/sw/inc/bparr.hxx index e5035a805547..7ce0880f11d7 100644 --- a/sw/inc/bparr.hxx +++ b/sw/inc/bparr.hxx @@ -54,7 +54,7 @@ protected: typedef BigPtrEntry* ElementPtr; -typedef sal_Bool (*FnForEach)( const ElementPtr&, void* pArgs ); +typedef bool (*FnForEach)( const ElementPtr&, void* pArgs ); // 1000 entries per Block = a bit less then 4K #define MAXENTRY 1000 @@ -75,13 +75,14 @@ struct BlockInfo { // block info: class SW_DLLPUBLIC BigPtrArray { - BlockInfo** ppInf; // block info + BlockInfo** ppInf; // block info sal_uLong nSize; ///< number of elements sal_uInt16 nMaxBlock; ///< current max. number of blocks sal_uInt16 nBlock; ///< number of blocks - sal_uInt16 nCur; ///< last block + mutable + sal_uInt16 nCur; ///< last used block - sal_uInt16 Index2Block( sal_uLong ) const; ///< block search + sal_uInt16 Index2Block( sal_uLong ) const; ///< block search BlockInfo* InsBlock( sal_uInt16 ); ///< insert block void BlockDel( sal_uInt16 ); ///< some blocks were deleted void UpdIndex( sal_uInt16 ); ///< recalculate indices diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index d360c510dbaf..75e3ead5b9f3 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -118,7 +118,7 @@ public: TYPEINFO(); // get information about attribute - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; }; inline SwClient::SwClient() : @@ -165,7 +165,7 @@ public: const SwClient* GetDepends() const { return pRoot; } // get information about attribute - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; void LockModify() { bModifyLocked = sal_True; } void UnlockModify() { bModifyLocked = sal_False; } @@ -199,7 +199,7 @@ public: SwClient* GetToTell() { return pToTell; } /** get Client information */ - virtual sal_Bool GetInfo( SfxPoolItem & ) const; + virtual bool GetInfo( SfxPoolItem & ) const; protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNewValue ); virtual void SwClientNotify( const SwModify& rModify, const SfxHint& rHint ); diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index e090d88fda99..7bb7098d07c5 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ /****************************************************************************** Attention : "In this file C++ style // comments are not allowed as it will be @@ -666,6 +657,8 @@ included in c-context files, so c++ style stuff will cause problems. #define FN_UNO_FOOTER_FIRST (FN_EXTRA2 + 119) #define FN_UNO_TABLE_BORDER2 (FN_EXTRA2 + 120) +#define FN_UNO_REPLACEMENT_GRAPHIC_U_R_L (FN_EXTRA2 + 121) + /*------------------------------------------------ -------------------- Area: Help -------------------------------------------------- ------------------*/ diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index fc421d2358c4..138e94ddf7b0 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -594,8 +594,8 @@ public: inline const SwPaM* GetTblCrs() const; inline SwPaM* GetTblCrs(); - sal_Bool IsTblComplex() const; - sal_Bool IsTblComplexForChart(); + bool IsTblComplex() const; + bool IsTblComplexForChart(); // get current table selection as text String GetBoxNms() const; @@ -603,7 +603,7 @@ public: sal_Bool GoNextCell( sal_Bool bAppendLine = sal_True ); sal_Bool GoPrevCell(); // go to this box (if available and inside of table) - sal_Bool GotoTable( const String& rName ); + bool GotoTable( const String& rName ); // select a table row, column or box (based on the current cursor) sal_Bool SelTblRow() { return _SelTblRowOrCol( true ); } @@ -612,10 +612,10 @@ public: sal_Bool SelTbl(); - sal_Bool GotoNextNum(); - sal_Bool GotoPrevNum(); + bool GotoNextNum(); + bool GotoPrevNum(); - sal_Bool GotoOutline( const String& rName ); + bool GotoOutline( const String& rName ); // to the next/previous or the given OutlineNode void GotoOutline( sal_uInt16 nIdx ); // find the "outline position" in the nodes array of the current chapter @@ -752,7 +752,7 @@ public: sal_Bool BasicActionPend() const { return nBasicActionCnt != nStartAction; } - sal_Bool GotoRegion( const String& rName ); + bool GotoRegion( const String& rName ); // show the current selection virtual void MakeSelVisible(); @@ -782,7 +782,7 @@ public: sal_Bool IsPageAtPos( const Point &rPt ) const; sal_Bool SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand, const SwTxtAttr* pAttr = 0 ); - sal_Bool GotoINetAttr( const SwTxtINetFmt& rAttr ); + bool GotoINetAttr( const SwTxtINetFmt& rAttr ); const SwFmtINetFmt* FindINetAttr( const String& rName ) const; sal_Bool CheckTblBoxCntnt( const SwPosition* pPos = 0 ); @@ -805,7 +805,7 @@ public: const SwRedline* GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect = sal_False ); // is cursor or the point in/over a vertical formatted text? - sal_Bool IsInVerticalText( const Point* pPt = 0 ) const; + bool IsInVerticalText( const Point* pPt = 0 ) const; // is cursor or the point in/over a right to left formatted text? sal_Bool IsInRightToLeftText( const Point* pPt = 0 ) const; diff --git a/sw/inc/dlelstnr.hxx b/sw/inc/dlelstnr.hxx index e8620f5f2e10..88ee1ccaaba8 100644 --- a/sw/inc/dlelstnr.hxx +++ b/sw/inc/dlelstnr.hxx @@ -31,7 +31,7 @@ namespace com { namespace sun { namespace star { namespace linguistic2 { class XDictionaryList; - class XLinguServiceManager; + class XLinguServiceManager2; class XProofreadingIterator; } namespace frame { @@ -56,7 +56,7 @@ class SwLinguServiceEventListener : com::sun::star::uno::Reference< com::sun::star::frame::XDesktop > xDesktop; com::sun::star::uno::Reference< - com::sun::star::linguistic2::XLinguServiceManager > xLngSvcMgr; + com::sun::star::linguistic2::XLinguServiceManager2 > xLngSvcMgr; com::sun::star::uno::Reference< com::sun::star::linguistic2::XProofreadingIterator > xGCIterator; diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 76a7ef4767dd..ca5efc9dd9f8 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -601,7 +601,7 @@ private: // COMPATIBILITY FLAGS END // - sal_Bool mbStartIdleTimer; ///< idle timer mode start/stop + bool mbStartIdleTimer; ///< idle timer mode start/stop bool mbSetDrawDefaults; ///< set draw pool defaults for freshly created documents @@ -635,9 +635,9 @@ private: const xub_StrLen nEndContentIndex, const SwNodeIndex& rStartIdx, const bool bCopyFlyAtFly = false ) const; - sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, sal_Bool bNewFrms ); + sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, bool bNewFrms ); - typedef SwFmt* (SwDoc:: *FNCopyFmt)( const String&, SwFmt*, sal_Bool, sal_Bool ); + typedef SwFmt* (SwDoc:: *FNCopyFmt)( const String&, SwFmt*, bool, bool ); SwFmt* CopyFmt( const SwFmt& rFmt, const SwFmtsBase& rFmtArr, FNCopyFmt fnCopyFmt, const SwFmt& rDfltFmt ); void CopyFmtArr( const SwFmtsBase& rSourceArr, SwFmtsBase& rDestArr, @@ -665,7 +665,7 @@ private: void AddUsedDBToList( std::vector<String>& rDBNameList, const std::vector<String>& rUsedDBNames ); void AddUsedDBToList( std::vector<String>& rDBNameList, const String& rDBName ); - sal_Bool IsNameInArray( const std::vector<String>& rOldNames, const String& rName ); + bool IsNameInArray( const std::vector<String>& rOldNames, const String& rName ); void GetAllDBNames( std::vector<String>& rAllDBNames ); void ReplaceUsedDBs( const std::vector<String>& rUsedDBNames, const String& rNewName, String& rFormel ); @@ -697,9 +697,9 @@ private: void DoUpdateAllCharts(); DECL_LINK( DoUpdateModifiedOLE, Timer * ); - SwFmt *_MakeCharFmt(const String &, SwFmt *, sal_Bool, sal_Bool ); - SwFmt *_MakeFrmFmt(const String &, SwFmt *, sal_Bool, sal_Bool ); - SwFmt *_MakeTxtFmtColl(const String &, SwFmt *, sal_Bool, sal_Bool ); + SwFmt *_MakeCharFmt(const String &, SwFmt *, bool, bool ); + SwFmt *_MakeFrmFmt(const String &, SwFmt *, bool, bool ); + SwFmt *_MakeTxtFmtColl(const String &, SwFmt *, bool, bool ); void InitTOXTypes(); void Paste( const SwDoc& ); @@ -809,7 +809,7 @@ public: virtual void SetVisibleLinks(bool bFlag); virtual sfx2::LinkManager& GetLinkManager(); virtual const sfx2::LinkManager& GetLinkManager() const; - virtual void UpdateLinks(sal_Bool bUI); + virtual void UpdateLinks(bool bUI); virtual bool GetData(const rtl::OUString& rItem, const String& rMimeType, ::com::sun::star::uno::Any& rValue) const; virtual bool SetData(const rtl::OUString& rItem, const String& rMimeType, const ::com::sun::star::uno::Any& rValue); virtual ::sfx2::SvLinkSource* CreateLinkSource(const rtl::OUString& rItem); @@ -1046,8 +1046,8 @@ public: ( Start < Pos < End ) !!! (Required for Writers.) */ void GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, const SwPaM* = 0, - sal_Bool bDrawAlso = sal_False, - sal_Bool bAsCharAlso = sal_False ) const; + bool bDrawAlso = false, + bool bAsCharAlso = false ) const; /// Because swrtf.cxx and define private public here now. SwFlyFrmFmt *MakeFlyFrmFmt (const String &rFmtName, SwFrmFmt *pDerivedFrom); @@ -1070,7 +1070,7 @@ public: const SwPosition* pAnchorPos, const SfxItemSet* pSet = 0, SwFrmFmt *pParent = 0, - sal_Bool bCalledFromShell = sal_False ); + bool bCalledFromShell = false ); SwFlyFrmFmt* MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet, const SwSelBoxes* pSelBoxes = 0, SwFrmFmt *pParent = 0 ); @@ -1082,10 +1082,10 @@ public: sal_Bool bDelRedlines = sal_True, sal_Bool bCopyFlyAtFly = sal_False ) const; - sal_Bool SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet ); + bool SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet ); - sal_Bool SetFrmFmtToFly( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFmt, - SfxItemSet* pSet = 0, sal_Bool bKeepOrient = sal_False ); + bool SetFrmFmtToFly( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFmt, + SfxItemSet* pSet = 0, bool bKeepOrient = false ); void SetFlyFrmTitle( SwFlyFrmFmt& rFlyFrmFmt, const String& sNewTitle ); void SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt, @@ -1125,15 +1125,15 @@ public: void SetGlossDoc( bool bGlssDc = true ) { mbGlossDoc = bGlssDc; } bool IsInsOnlyTextGlossary() const { return mbInsOnlyTxtGlssry; } - void Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool bImpress ); + void Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress ); void ChangeAuthorityData(const SwAuthEntry* pNewData); bool IsInCallModified() const { return mbInCallModified; } - sal_Bool IsInHeaderFooter( const SwNodeIndex& rIdx ) const; + bool IsInHeaderFooter( const SwNodeIndex& rIdx ) const; short GetTextDirection( const SwPosition& rPos, const Point* pPt = 0 ) const; - sal_Bool IsInVerticalText( const SwPosition& rPos, + bool IsInVerticalText( const SwPosition& rPos, const Point* pPt = 0 ) const; /** Database and DB-Manager @@ -1175,10 +1175,10 @@ public: Introduce new optional parameter <bSendDataChangedEvents> in order to control, if the side effect "send data changed events" is triggered or not. */ void ResetAttrs( const SwPaM &rRg, - sal_Bool bTxtAttr = sal_True, + bool bTxtAttr = true, const std::set<sal_uInt16> &rAttrs = std::set<sal_uInt16>(), const bool bSendDataChangedEvents = true ); - void RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark = sal_False ); + void RstTxtAttrs(const SwPaM &rRg, bool bInclRefToxMark = false ); /** Set attribute in given format. If Undo is activated, the old one is listed in Undo-History. */ @@ -1198,7 +1198,7 @@ public: const SfxPoolItem& GetDefault( sal_uInt16 nFmtHint ) const; /// Do not expand text attributes. - sal_Bool DontExpandFmt( const SwPosition& rPos, sal_Bool bFlag = sal_True ); + bool DontExpandFmt( const SwPosition& rPos, bool bFlag = true ); /* Formats */ const SwFrmFmts* GetFrmFmts() const { return pFrmFmtTbl; } @@ -1225,16 +1225,16 @@ public: void RemoveAllFmtLanguageDependencies(); SwFrmFmt *MakeFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom, - sal_Bool bBroadcast = sal_False, sal_Bool bAuto = sal_True); - void DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast = sal_False ); + bool bBroadcast = false, bool bAuto = true); + void DelFrmFmt( SwFrmFmt *pFmt, bool bBroadcast = false ); SwFrmFmt* FindFrmFmtByName( const String& rName ) const { return (SwFrmFmt*)FindFmtByName( (SwFmtsBase&)*pFrmFmtTbl, rName ); } SwCharFmt *MakeCharFmt(const String &rFmtName, SwCharFmt *pDerivedFrom, - sal_Bool bBroadcast = sal_False, - sal_Bool bAuto = sal_True ); - void DelCharFmt(sal_uInt16 nFmt, sal_Bool bBroadcast = sal_False); - void DelCharFmt(SwCharFmt* pFmt, sal_Bool bBroadcast = sal_False); + bool bBroadcast = false, + bool bAuto = true ); + void DelCharFmt(sal_uInt16 nFmt, bool bBroadcast = false); + void DelCharFmt(SwCharFmt* pFmt, bool bBroadcast = false); SwCharFmt* FindCharFmtByName( const String& rName ) const { return (SwCharFmt*)FindFmtByName( (SwFmtsBase&)*pCharFmtTbl, rName ); } @@ -1244,13 +1244,13 @@ public: const SwTxtFmtColls *GetTxtFmtColls() const { return pTxtFmtCollTbl; } SwTxtFmtColl *MakeTxtFmtColl( const String &rFmtName, SwTxtFmtColl *pDerivedFrom, - sal_Bool bBroadcast = sal_False, - sal_Bool bAuto = sal_True ); + bool bBroadcast = false, + bool bAuto = true ); SwConditionTxtFmtColl* MakeCondTxtFmtColl( const String &rFmtName, SwTxtFmtColl *pDerivedFrom, - sal_Bool bBroadcast = sal_False); - void DelTxtFmtColl(sal_uInt16 nFmt, sal_Bool bBroadcast = sal_False); - void DelTxtFmtColl( SwTxtFmtColl* pColl, sal_Bool bBroadcast = sal_False ); + bool bBroadcast = false); + void DelTxtFmtColl(sal_uInt16 nFmt, bool bBroadcast = false); + void DelTxtFmtColl( SwTxtFmtColl* pColl, bool bBroadcast = false ); /** Add 4th optional parameter <bResetListAttrs>. 'side effect' of <SetTxtFmtColl> with <bReset = true> is that the hard attributes of the affected text nodes are cleared, except the break @@ -1258,7 +1258,7 @@ public: The new parameter <bResetListAttrs> indicates, if the list attributes (list style, restart at and restart with) are cleared as well in case that <bReset = true> and the paragraph style has a list style attribute set. */ - sal_Bool SetTxtFmtColl( const SwPaM &rRg, SwTxtFmtColl *pFmt, + bool SetTxtFmtColl( const SwPaM &rRg, SwTxtFmtColl *pFmt, bool bReset = true, bool bResetListAttrs = false ); SwTxtFmtColl* FindTxtFmtCollByName( const String& rName ) const @@ -1276,8 +1276,8 @@ public: /// Table formating const SwFrmFmts* GetTblFrmFmts() const { return pTblFrmFmtTbl; } SwFrmFmts* GetTblFrmFmts() { return pTblFrmFmtTbl; } - sal_uInt16 GetTblFrmFmtCount( sal_Bool bUsed ) const; - SwFrmFmt& GetTblFrmFmt(sal_uInt16 nFmt, sal_Bool bUsed ) const; + sal_uInt16 GetTblFrmFmtCount( bool bUsed ) const; + SwFrmFmt& GetTblFrmFmt(sal_uInt16 nFmt, bool bUsed ) const; SwTableFmt* MakeTblFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom); void DelTblFrmFmt( SwTableFmt* pFmt ); SwTableFmt* FindTblFmtByName( const String& rName, sal_Bool bAll = sal_False ) const; @@ -1326,7 +1326,7 @@ public: void SetGlossaryDoc( SwDoc* pDoc ) { pGlossaryDoc = pDoc; } /// travel over PaM Ring - sal_Bool InsertGlossary( SwTextBlocks& rBlock, const String& rEntry, + bool InsertGlossary( SwTextBlocks& rBlock, const String& rEntry, SwPaM& rPaM, SwCrsrShell* pShell = 0); /** get the set of printable pages for the XRenderable API by @@ -1348,7 +1348,7 @@ public: /** Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFmtId, -HlpId can be prevented. */ void CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc, - sal_Bool bCopyPoolIds = sal_True ); + bool bCopyPoolIds = true ); /** Copy header (with contents) from SrcFmt to DestFmt (can also be copied into other document). */ @@ -1365,13 +1365,13 @@ public: SwPageDesc * GetPageDesc( const String & rName ); void ChgPageDesc( const String & rName, const SwPageDesc& ); void ChgPageDesc( sal_uInt16 i, const SwPageDesc& ); - sal_Bool FindPageDesc( const String & rName, sal_uInt16 * pFound ); - void DelPageDesc( const String & rName, sal_Bool bBroadcast = sal_False); - void DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast = sal_False ); + bool FindPageDesc( const String & rName, sal_uInt16 * pFound ); + void DelPageDesc( const String & rName, bool bBroadcast = false); + void DelPageDesc( sal_uInt16 i, bool bBroadcast = false ); void PreDelPageDesc(SwPageDesc * pDel); sal_uInt16 MakePageDesc( const String &rName, const SwPageDesc* pCpy = 0, - sal_Bool bRegardLanguage = sal_True, - sal_Bool bBroadcast = sal_False); + bool bRegardLanguage = true, + bool bBroadcast = false); void BroadcastStyleOperation(String rName, SfxStyleFamily eFamily, sal_uInt16 nOp); @@ -1391,18 +1391,18 @@ public: const SwTOXBaseSection* InsertTableOf( const SwPosition& rPos, const SwTOXBase& rTOX, const SfxItemSet* pSet = 0, - sal_Bool bExpand = sal_False ); + bool bExpand = false ); const SwTOXBaseSection* InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd, const SwTOXBase& rTOX, const SfxItemSet* pSet = 0 ); const SwTOXBase* GetCurTOX( const SwPosition& rPos ) const; const SwAttrSet& GetTOXBaseAttrSet(const SwTOXBase& rTOX) const; - sal_Bool DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes = sal_False ); + bool DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes = false ); String GetUniqueTOXBaseName( const SwTOXType& rType, const String* pChkStr = 0 ) const; - sal_Bool SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName); + bool SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName); void SetTOXBaseProtection(const SwTOXBase& rTOXBase, sal_Bool bProtect); /// After reading file update all tables/indices. @@ -1433,15 +1433,15 @@ public: const SwTOXType* InsertTOXType( const SwTOXType& rTyp ); const SwTOXTypes& GetTOXTypes() const { return *pTOXTypes; } - const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate = sal_False ); + const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, bool bCreate = false ); void SetDefaultTOXBase(const SwTOXBase& rBase); /// Key for management of index. sal_uInt16 GetTOIKeys( SwTOIKeyType eTyp, std::vector<String>& rArr ) const; /// Sort table text. - sal_Bool SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions&); - sal_Bool SortText(const SwPaM&, const SwSortOptions&); + bool SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions&); + bool SortText(const SwPaM&, const SwSortOptions&); // Correct the SwPosition-Objects that are registered with the document // e. g. ::com::sun::star::text::Bookmarks or tables/indices. @@ -1472,12 +1472,12 @@ public: void PropagateOutlineRule(); /// Outline - promote / demote. - sal_Bool OutlineUpDown( const SwPaM& rPam, short nOffset = 1 ); + bool OutlineUpDown( const SwPaM& rPam, short nOffset = 1 ); /// Ountline - move up / move down. - sal_Bool MoveOutlinePara( const SwPaM& rPam, short nOffset = 1); + bool MoveOutlinePara( const SwPaM& rPam, short nOffset = 1); - sal_Bool GotoOutline( SwPosition& rPos, const String& rName ) const; + bool GotoOutline( SwPosition& rPos, const String& rName ) const; /** Accept changes of outline styles for OUtlineRule. re-use unused 3rd parameter @@ -1492,7 +1492,7 @@ public: const SwNumRule&, const bool bCreateNewList, const String sContinuedListId = String(), - sal_Bool bSetItem = sal_True, + bool bSetItem = true, const bool bResetIndentAttrs = false ); void SetCounted( const SwPaM&, bool bCounted); @@ -1515,27 +1515,27 @@ public: /// add optional parameter <eDefaultNumberFormatPositionAndSpaceMode> sal_uInt16 MakeNumRule( const String &rName, const SwNumRule* pCpy = 0, - sal_Bool bBroadcast = sal_False, + bool bBroadcast = false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode = SvxNumberFormat::LABEL_WIDTH_AND_POSITION ); sal_uInt16 FindNumRule( const String& rName ) const; SwNumRule* FindNumRulePtr( const String& rName ) const; /// Deletion only possible if ::com::sun::star::chaos::Rule is not used! - sal_Bool RenameNumRule(const String & aOldName, const String & aNewName, - sal_Bool bBroadcast = sal_False); - sal_Bool DelNumRule( const String& rName, sal_Bool bBroadCast = sal_False ); - String GetUniqueNumRuleName( const String* pChkStr = 0, sal_Bool bAutoNum = sal_True ) const; + bool RenameNumRule(const String & aOldName, const String & aNewName, + bool bBroadcast = false); + bool DelNumRule( const String& rName, bool bBroadCast = false ); + String GetUniqueNumRuleName( const String* pChkStr = 0, bool bAutoNum = true ) const; void UpdateNumRule(); /// Update all invalids. void ChgNumRuleFmts( const SwNumRule& rRule, const String * pOldName = 0 ); - sal_Bool ReplaceNumRule( const SwPosition& rPos, const String& rOldRule, + bool ReplaceNumRule( const SwPosition& rPos, const String& rOldRule, const String& rNewRule ); /// Goto next/previous on same level. - sal_Bool GotoNextNum( SwPosition&, sal_Bool bOverUpper = sal_True, + bool GotoNextNum( SwPosition&, bool bOverUpper = true, sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 ); - sal_Bool GotoPrevNum( SwPosition&, sal_Bool bOverUpper = sal_True, + bool GotoPrevNum( SwPosition&, bool bOverUpper = true, sal_uInt8* pUpper = 0, sal_uInt8* pLower = 0 ); /** Searches for a text node with a numbering rule. @@ -1570,7 +1570,7 @@ public: const bool bInvestigateStartNode = false ); /// Paragraphs without numbering but with indents. - sal_Bool NoNum( const SwPaM& ); + bool NoNum( const SwPaM& ); /// Delete, splitting of numbering list. void DelNumRules( const SwPaM& ); @@ -1578,13 +1578,13 @@ public: /// Invalidates all numrules void InvalidateNumRules(); - sal_Bool NumUpDown( const SwPaM&, sal_Bool bDown = sal_True ); + bool NumUpDown( const SwPaM&, bool bDown = true ); /** Move selected paragraphes (not only numberings) according to offsets. (if negative: go to doc start). */ - sal_Bool MoveParagraph( const SwPaM&, long nOffset = 1, sal_Bool bIsOutlMv = sal_False ); + bool MoveParagraph( const SwPaM&, long nOffset = 1, bool bIsOutlMv = false ); - sal_Bool NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel = sal_False); + bool NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel = sal_False); void StopNumRuleAnimations( OutputDevice* ); @@ -1753,7 +1753,7 @@ public: SwSectionFmts& GetSections() { return *pSectionFmtTbl; } const SwSectionFmts& GetSections() const { return *pSectionFmtTbl; } SwSectionFmt *MakeSectionFmt( SwSectionFmt *pDerivedFrom ); - void DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes = sal_False ); + void DelSectionFmt( SwSectionFmt *pFmt, bool bDelNodes = false ); void UpdateSection(sal_uInt16 const nSect, SwSectionData &, SfxItemSet const*const = 0, bool const bPreventLinkUpdate = false); String GetUniqueSectionName( const String* pChkStr = 0 ) const; @@ -1783,7 +1783,7 @@ public: bool IsInLoadAsynchron() const { return mbInLoadAsynchron; } void SetInLoadAsynchron( bool bFlag ) { mbInLoadAsynchron = bFlag; } - sal_Bool SelectServerObj( const String& rStr, SwPaM*& rpPam, + bool SelectServerObj( const String& rStr, SwPaM*& rpPam, SwNodeRange*& rpRange ) const; /// For Drag&Move: (e.g. allow "moving" of RefMarks) @@ -1792,10 +1792,10 @@ public: SwDrawContact* GroupSelection( SdrView& ); void UnGroupSelection( SdrView& ); - sal_Bool DeleteSelection( SwDrawView& ); + bool DeleteSelection( SwDrawView& ); /// Invalidates OnlineSpell-WrongLists. - void SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong, sal_Bool bSmartTags ); + void SpellItAgainSam( bool bInvalid, bool bOnlyWrong, bool bSmartTags ); void InvalidateAutoCompleteFlag(); void SetCalcFieldValueHdl(Outliner* pOutliner); @@ -1803,7 +1803,7 @@ public: // Query if ::com::sun::star::util::URL was visited. // Query via Doc, if only a ::com::sun::star::text::Bookmark has been given. // In this case the document name has to be set in front. - sal_Bool IsVisitedURL( const String& rURL ) const; + bool IsVisitedURL( const String& rURL ) const; /// Save current values for automatic registration of exceptions in Autocorrection. void SetAutoCorrExceptWord( SwAutoCorrExceptWord* pNew ); @@ -1812,18 +1812,18 @@ public: const SwFmtINetFmt* FindINetAttr( const String& rName ) const; /// Call into intransparent Basic; expect possible Return String. - sal_Bool ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 ); + bool ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 ); /// Call into intransparent Basic / JavaScript. sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent, - sal_Bool bChkPtr = sal_False, SbxArray* pArgs = 0, + bool bChkPtr = false, SbxArray* pArgs = 0, const Link* pCallBack = 0 ); /** Adjust left margin via object bar (similar to adjustment of numerations). One can either change the margin "by" adding or substracting a given - offset or set it "to" this position (bModulus = sal_True). */ - void MoveLeftMargin( const SwPaM& rPam, sal_Bool bRight = sal_True, - sal_Bool bModulus = sal_True ); + offset or set it "to" this position (bModulus = true). */ + void MoveLeftMargin( const SwPaM& rPam, bool bRight = true, + bool bModulus = true ); /// Query NumberFormatter. inline SvNumberFormatter* GetNumberFormatter( sal_Bool bCreate = sal_True ); @@ -1887,10 +1887,10 @@ public: // -------------------- FeShell - Interfaces ----------------------- // !!! These assume always an existing layout !!! - sal_Bool ChgAnchor( const SdrMarkList& _rMrkList, + bool ChgAnchor( const SdrMarkList& _rMrkList, RndStdIds _eAnchorType, - const sal_Bool _bSameOnly, - const sal_Bool _bPosCorr ); + const bool _bSameOnly, + const bool _bPosCorr ); void SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew ); void GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) const; @@ -1925,8 +1925,8 @@ public: void Unchain( SwFrmFmt &rFmt ); // For Copy/Move from FrmShell. - SdrObject* CloneSdrObj( const SdrObject&, sal_Bool bMoveWithinDoc = sal_False, - sal_Bool bInsInPage = sal_True ); + SdrObject* CloneSdrObj( const SdrObject&, bool bMoveWithinDoc = false, + bool bInsInPage = true ); // // -------------------- FeShell - Interface end ------------------ @@ -1971,12 +1971,12 @@ public: @param sListId list Id of the list whose level has to be marked/unmarked @param nListLevel level to mark - @param bValue - sal_True mark the level - - sal_False unmark the level + @param bValue - true mark the level + - false unmark the level */ void MarkListLevel( const String& sListId, const int nListLevel, - const sal_Bool bValue ); + const bool bValue ); /** Marks/Unmarks a list level of a certain list @@ -1984,18 +1984,18 @@ public: @param rList list whose level has to be marked/unmarked @param nListLevel level to mark - @param bValue - sal_True mark the level - - sal_False unmark the level + @param bValue - true mark the level + - false unmark the level */ void MarkListLevel( SwList& rList, const int nListLevel, - const sal_Bool bValue ); + const bool bValue ); /// Change a format undoable. void ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet); void RenameFmt(SwFmt & rFmt, const String & sNewName, - sal_Bool bBroadcast = sal_False); + bool bBroadcast = false); /// Change a TOX undoable. void ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew); @@ -2019,7 +2019,7 @@ public: */ String GetPaMDescr(const SwPaM & rPaM) const; - sal_Bool IsFirstOfNumRule(SwPosition & rPos); + bool IsFirstOfNumRule(SwPosition & rPos); // access methods for XForms model(s) diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 0f6158bb19a3..23233cde48c5 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -152,7 +152,7 @@ class SwPageNumberFieldType : public SwFieldType { sal_Int16 nNumberingType; sal_uInt16 nNum, nMax; - sal_Bool bVirtuell; + bool bVirtuell; public: SwPageNumberFieldType(); diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index ba5fcbd3d133..a0c0ebbeaa23 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -234,7 +234,7 @@ public: /** If Cursor is at the end of a character style in which the DontExpand-flag is not yet set, the latter will be set (==> return TRUE). */ - sal_Bool DontExpandFmt(); + bool DontExpandFmt(); /** Apply / remove attributes. @return attributs in required AttributeSet. @@ -296,8 +296,8 @@ public: sal_uInt16 GetCurLang() const; /// TABLE - sal_uInt16 GetTblFrmFmtCount( sal_Bool bUsed = sal_False ) const; - SwFrmFmt& GetTblFrmFmt(sal_uInt16 nFmt, sal_Bool bUsed = sal_False ) const; + sal_uInt16 GetTblFrmFmtCount( bool bUsed = false ) const; + SwFrmFmt& GetTblFrmFmt(sal_uInt16 nFmt, bool bUsed = false ) const; String GetUniqueTblName() const; /// CHAR @@ -435,7 +435,7 @@ public: sal_Bool UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0); const SwTOXBase* GetCurTOX() const; - const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate = sal_False ); + const SwTOXBase* GetDefaultTOXBase( TOXTypes eTyp, bool bCreate = false ); void SetDefaultTOXBase(const SwTOXBase& rBase); sal_Bool IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const; @@ -443,7 +443,7 @@ public: sal_uInt16 GetTOXCount() const; const SwTOXBase* GetTOX( sal_uInt16 nPos ) const; - sal_Bool DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes = sal_False ); + bool DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes = false ); /// After reading file update all content tables. void SetUpdateTOX( sal_Bool bFlag = sal_True ); @@ -465,9 +465,9 @@ public: void SetOutlineNumRule(const SwNumRule&); const SwNumRule* GetOutlineNumRule() const; - sal_Bool OutlineUpDown( short nOffset = 1 ); + bool OutlineUpDown( short nOffset = 1 ); - sal_Bool MoveOutlinePara( short nOffset = 1); + bool MoveOutlinePara( short nOffset = 1); sal_Bool IsProtectedOutlinePara() const; @@ -491,18 +491,18 @@ public: const bool bResetIndentAttrs = false ); /// Paragraphs without enumeration but with indents. - sal_Bool NoNum(); + bool NoNum(); /// Delete, split enumeration list. void DelNumRules(); - sal_Bool NumUpDown( sal_Bool bDown = sal_True ); + bool NumUpDown( bool bDown = true ); - sal_Bool MoveParagraph( long nOffset = 1); - sal_Bool MoveNumParas( sal_Bool bUpperLower, sal_Bool bUpperLeft ); + bool MoveParagraph( long nOffset = 1); + bool MoveNumParas( bool bUpperLower, bool bUpperLeft ); /// Switch on/off of numbering via Delete/Backspace. - sal_Bool NumOrNoNum( sal_Bool bDelete = sal_False, sal_Bool bChkStart = sal_True); + bool NumOrNoNum( sal_Bool bDelete = sal_False, bool bChkStart = true); // #i23726# // #i90078# @@ -511,8 +511,8 @@ public: void ChangeIndentOfAllListLevels( short nDiff ); // Adjust method name void SetIndent(short nIndent, const SwPosition & rPos); - sal_Bool IsFirstOfNumRule() const; - sal_Bool IsFirstOfNumRule(const SwPaM & rPaM) const; + bool IsFirstOfNumRule() const; + bool IsFirstOfNumRule(const SwPaM & rPaM) const; sal_Bool IsNoNum( sal_Bool bChkStart = sal_True ) const; @@ -532,7 +532,7 @@ public: sal_Bool HasNumber() const; sal_Bool HasBullet() const; - String GetUniqueNumRuleName( const String* pChkStr = 0, sal_Bool bAutoNum = sal_True ) const; + String GetUniqueNumRuleName( const String* pChkStr = 0, bool bAutoNum = true ) const; void ChgNumRuleFmts( const SwNumRule& rRule ); /// Set (and query if) a numbering with StartFlag starts at current PointPos. @@ -542,7 +542,7 @@ public: sal_uInt16 GetNodeNumStart( SwPaM* pPaM = NULL ) const; - sal_Bool ReplaceNumRule( const String& rOldRule, const String& rNewRule ); + bool ReplaceNumRule( const String& rOldRule, const String& rNewRule ); /** Searches for a text node with a numbering rule. in case a list style is found, <sListId> holds the list id, to which the @@ -872,9 +872,9 @@ public: /** Adjust left margin via object bar (similar to adjustment of numerations). One can either change the margin "by" adding or substracting a given - offset or set it "to" this position @param (bModulus = sal_True). */ - sal_Bool IsMoveLeftMargin( sal_Bool bRight = sal_True, sal_Bool bModulus = sal_True ) const; - void MoveLeftMargin( sal_Bool bRight = sal_True, sal_Bool bModulus = sal_True ); + offset or set it "to" this position @param (bModulus = true). */ + bool IsMoveLeftMargin( bool bRight = true, bool bModulus = true ) const; + void MoveLeftMargin( bool bRight = true, bool bModulus = true ); /// Query NumberFormater from document. SvNumberFormatter* GetNumberFormatter(); diff --git a/sw/inc/fchrfmt.hxx b/sw/inc/fchrfmt.hxx index 0a911f054bb5..7253ec56aa8b 100644 --- a/sw/inc/fchrfmt.hxx +++ b/sw/inc/fchrfmt.hxx @@ -76,7 +76,7 @@ public: virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; + virtual bool GetInfo( SfxPoolItem& rInfo ) const; void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); } SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); } diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index 17f465598428..6c8faeee8475 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -355,7 +355,7 @@ public: sal_Bool IsFrmSelected() const; sal_Bool GetFlyFrmAttr( SfxItemSet &rSet ) const; - sal_Bool SetFlyFrmAttr( SfxItemSet &rSet ); + bool SetFlyFrmAttr( SfxItemSet &rSet ); sal_Bool ResetFlyFrmAttr( sal_uInt16 nWhich, const SfxItemSet* pSet = 0 ); const SwFrmFmt *NewFlyFrm( const SfxItemSet &rSet, sal_Bool bAnchValid = sal_False, SwFrmFmt *pParent = 0 ); @@ -368,7 +368,7 @@ public: sal_Bool IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRightToLeft, sal_Bool& bVertL2R) const; SwFrmFmt* GetCurFrmFmt() const; ///< If frame then frame style, else 0. - void SetFrmFmt( SwFrmFmt *pFmt, sal_Bool bKeepOrient = sal_False, Point* pDocPos = 0 ); ///< If frame then set frame style. + void SetFrmFmt( SwFrmFmt *pFmt, bool bKeepOrient = false, Point* pDocPos = 0 ); ///< If frame then set frame style. const SwFlyFrm *GetCurrFlyFrm() const { return FindFlyFrm(); } /// Find/delete fly containing the cursor. @@ -508,8 +508,8 @@ public: /** frmatr.hxx. Here no enum because of dependencies. bool value only for internal use! Anchor is newly set according to current document position. Anchor is not re-set. */ - void ChgAnchor( int eAnchorId, sal_Bool bSameOnly = sal_False, - sal_Bool bPosCorr = sal_True ); + void ChgAnchor( int eAnchorId, bool bSameOnly = false, + bool bPosCorr = true ); sal_Bool SetDrawingAttr( SfxItemSet &rSet ); diff --git a/sw/inc/fmtcol.hxx b/sw/inc/fmtcol.hxx index 941e20c9c760..5cb721bf750b 100644 --- a/sw/inc/fmtcol.hxx +++ b/sw/inc/fmtcol.hxx @@ -103,7 +103,7 @@ public: inline void SetNextTxtFmtColl(SwTxtFmtColl& rNext); SwTxtFmtColl& GetNextTxtFmtColl() const { return *pNextTxtFmtColl; } - sal_Bool IsAtDocNodeSet() const; + bool IsAtDocNodeSet() const; void SetAttrOutlineLevel( int ); int GetAttrOutlineLevel() const; @@ -117,9 +117,9 @@ public: /** Override to recognize changes on the <SwNumRuleItem> and register/unregister the paragragh style at the corresponding <SwNumRule> instance. */ - virtual sal_Bool SetFmtAttr( const SfxPoolItem& rAttr ); - virtual sal_Bool SetFmtAttr( const SfxItemSet& rSet ); - virtual sal_Bool ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 ); + virtual bool SetFmtAttr( const SfxPoolItem& rAttr ); + virtual bool SetFmtAttr( const SfxItemSet& rSet ); + virtual bool ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 ); /// Override <ResetAllFmtAttr()> to stay assigned to list level of outline style. virtual sal_uInt16 ResetAllFmtAttr(); @@ -256,7 +256,7 @@ public: const SwCollCondition* HasCondition( const SwCollCondition& rCond ) const; const SwFmtCollConditions& GetCondColls() const { return aCondColls; } void InsertCondition( const SwCollCondition& rCond ); - sal_Bool RemoveCondition( const SwCollCondition& rCond ); + bool RemoveCondition( const SwCollCondition& rCond ); void SetConditions( const SwFmtCollConditions& ); }; diff --git a/sw/inc/fmtfld.hxx b/sw/inc/fmtfld.hxx index 5cc7ddb6df7c..850de3fe1e3b 100644 --- a/sw/inc/fmtfld.hxx +++ b/sw/inc/fmtfld.hxx @@ -75,7 +75,7 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; - virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; + virtual bool GetInfo( SfxPoolItem& rInfo ) const; const SwField *GetFld() const { return pField; } SwField *GetFld() { return pField; } diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index 883165f62cf3..51cea190af81 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -55,7 +55,7 @@ class SW_DLLPUBLIC SwFmt : public SwModify sal_uInt16 nPoolHelpId; ///< HelpId for this Pool-style. sal_uInt8 nPoolHlpFileId; ///< FilePos to Doc to these style helps. sal_Bool bWritten : 1; ///< TRUE: already written. - sal_Bool bAutoFmt : 1; /**< FALSE: it is a template. + bool bAutoFmt : 1; /**< FALSE: it is a template. default is true! */ sal_Bool bFmtInDTOR : 1; /**< TRUE: Format becomes deleted. In order to be able to recognize this in FmtChg-message!! */ @@ -81,7 +81,7 @@ public: /// Query format information. - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; /// Copy attributes even among documents. void CopyAttrs( const SwFmt&, sal_Bool bReplace=sal_True ); @@ -98,9 +98,9 @@ public: sal_Bool bInParents = sal_True ) const; inline SfxItemState GetItemState( sal_uInt16 nWhich, sal_Bool bSrchInParent = sal_True, const SfxPoolItem **ppItem = 0 ) const; - virtual sal_Bool SetFmtAttr( const SfxPoolItem& rAttr ); - virtual sal_Bool SetFmtAttr( const SfxItemSet& rSet ); - virtual sal_Bool ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 ); + virtual bool SetFmtAttr( const SfxPoolItem& rAttr ); + virtual bool SetFmtAttr( const SfxItemSet& rSet ); + virtual bool ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 ); /** Takes all hints from Delta-Array, @return count of deleted hints. */ @@ -161,8 +161,8 @@ public: void ResetWritten() { bWritten = sal_False; } /// Query / set AutoFmt-flag. - sal_Bool IsAuto() const { return bAutoFmt; } - void SetAuto( sal_Bool bNew = sal_False ) { bAutoFmt = bNew; } + bool IsAuto() const { return bAutoFmt; } + void SetAuto( bool bNew = false ) { bAutoFmt = bNew; } /// Query / set bAutoUpdateFmt-flag. sal_Bool IsAutoUpdateFmt() const { return bAutoUpdateFmt; } diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index 0a139fc0f10a..cd544d9bea0c 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -183,7 +183,7 @@ public: virtual Graphic MakeGraphic( ImageMap* pMap = NULL ); - virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; + virtual bool GetInfo( SfxPoolItem& rInfo ) const; const String GetObjTitle() const; void SetObjTitle( const String& rTitle, diff --git a/sw/inc/ftninfo.hxx b/sw/inc/ftninfo.hxx index cccd6f76838d..b72338d851b7 100644 --- a/sw/inc/ftninfo.hxx +++ b/sw/inc/ftninfo.hxx @@ -69,7 +69,7 @@ public: SwClient *GetAnchorCharFmtDep() const { return (SwClient*)&aAnchorCharFmtDep; } SwEndNoteInfo & operator=(const SwEndNoteInfo&); - sal_Bool operator==( const SwEndNoteInfo &rInf ) const; + bool operator==( const SwEndNoteInfo &rInf ) const; SwEndNoteInfo( SwTxtFmtColl *pTxtColl = 0); SwEndNoteInfo(const SwEndNoteInfo&); @@ -107,7 +107,7 @@ public: SwFtnInfo& operator=(const SwFtnInfo&); - sal_Bool operator==( const SwFtnInfo &rInf ) const; + bool operator==( const SwFtnInfo &rInf ) const; SwFtnInfo(SwTxtFmtColl* pTxtColl = 0); SwFtnInfo(const SwFtnInfo&); diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index a9151084a0e4..5f8d56c24781 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -68,8 +68,6 @@ #define HID_VS_NUM "SW_HID_VS_NUM" #define HID_VS_BULLET "SW_HID_VS_BULLET" #define HID_VS_NUMBMP "SW_HID_VS_NUMBMP" -#define HID_VS_RULER "SW_HID_VS_RULER" -#define HID_RULER_DIALOG "SW_HID_RULER_DIALOG" #define HID_INSERT_ABSTRACT "SW_HID_INSERT_ABSTRACT" #define HID_NAVI_TBX1 "SW_HID_NAVI_TBX1" #define HID_NAVI_TBX2 "SW_HID_NAVI_TBX2" @@ -191,8 +189,6 @@ #define HID_OPTSHDWCRSR "SW_HID_OPTSHDWCRSR" #define HID_NUM_POSITION "SW_HID_NUM_POSITION" #define HID_NUMPARA "SW_HID_NUMPARA" -#define HID_FOOTNOTE_OPTIONS "SW_HID_FOOTNOTE_OPTIONS" -#define HID_ENDNOTE_OPTIONS "SW_HID_ENDNOTE_OPTIONS" #define HID_REDLINE_OPT "SW_HID_REDLINE_OPT" #define HID_REDLINE_ACCEPT "SW_HID_REDLINE_ACCEPT" #define HID_EDIT_FLD_DB "SW_HID_EDIT_FLD_DB" @@ -384,26 +380,6 @@ #define HID_TOX_ENTRY_EDIT "SW_HID_TOX_ENTRY_EDIT" #define HID_DLG_NEW_USER_IDX "SW_HID_DLG_NEW_USER_IDX" -#define HID_INSERT_IDX_MRK_OK "SW_HID_INSERT_IDX_MRK_OK" -#define HID_INSERT_IDX_MRK_CLOSE "SW_HID_INSERT_IDX_MRK_CLOSE" -#define HID_INSERT_AUTH_MRK_OK "SW_HID_INSERT_AUTH_MRK_OK" -#define HID_INSERT_AUTH_MRK_CLOSE "SW_HID_INSERT_AUTH_MRK_CLOSE" -#define HID_INSERT_IDX_MRK_DELETE "SW_HID_INSERT_IDX_MRK_DELETE" -#define HID_INSERT_IDX_MRK_NEW "SW_HID_INSERT_IDX_MRK_NEW" -#define HID_INSERT_IDX_MRK_PREV "SW_HID_INSERT_IDX_MRK_PREV" -#define HID_INSERT_IDX_MRK_PREV_SAME "SW_HID_INSERT_IDX_MRK_PREV_SAME" -#define HID_INSERT_IDX_MRK_NEXT "SW_HID_INSERT_IDX_MRK_NEXT" -#define HID_INSERT_IDX_MRK_NEXT_SAME "SW_HID_INSERT_IDX_MRK_NEXT_SAME" -#define HID_INSERT_IDX_MRK_TYPE "SW_HID_INSERT_IDX_MRK_TYPE" -#define HID_INSERT_IDX_MRK_ENTRY "SW_HID_INSERT_IDX_MRK_ENTRY" -#define HID_INSERT_IDX_MRK_PRIM_KEY "SW_HID_INSERT_IDX_MRK_PRIM_KEY" -#define HID_INSERT_IDX_MRK_SEC_KEY "SW_HID_INSERT_IDX_MRK_SEC_KEY" -#define HID_INSERT_IDX_MRK_LEVEL "SW_HID_INSERT_IDX_MRK_LEVEL" -#define HID_INSERT_IDX_MRK_MAIN_ENTRY "SW_HID_INSERT_IDX_MRK_MAIN_ENTRY" -#define HID_INSERT_IDX_MRK_APPLY_ALL "SW_HID_INSERT_IDX_MRK_APPLY_ALL" -#define HID_INSERT_AUTH_MRK_ENTRY "SW_HID_INSERT_AUTH_MRK_ENTRY" -#define HID_INSERT_AUTH_MRK_CREATE_ENTRY "SW_HID_INSERT_AUTH_MRK_CREATE_ENTRY" -#define HID_INSERT_AUTH_MRK_EDIT_ENTRY "SW_HID_INSERT_AUTH_MRK_EDIT_ENTRY" #define HID_TOKEN_WINDOW "SW_HID_TOKEN_WINDOW" #define HID_AUTH_FIELD_IDENTIFIER "SW_HID_AUTH_FIELD_IDENTIFIER" @@ -438,13 +414,7 @@ #define HID_AUTH_FIELD_CUSTOM5 "SW_HID_AUTH_FIELD_CUSTOM5" #define HID_AUTH_FIELD_ISBN "SW_HID_AUTH_FIELD_ISBN" -#define HID_AUTH_MARK_DLG_FROM_COMP_RB "SW_HID_AUTH_MARK_DLG_FROM_COMP_RB" -#define HID_AUTH_MARK_DLG_FROM_DOC_RB "SW_HID_AUTH_MARK_DLG_FROM_DOC_RB" -#define HID_AUTH_MARK_DLG_ID_LISTBOX "SW_HID_AUTH_MARK_DLG_ID_LISTBOX" - #define HID_INSERT_INDEX_ENTRY_LEVEL_LB "SW_HID_INSERT_INDEX_ENTRY_LEVEL_LB" -#define HID_INSERT_IDX_MRK_SRCH_CASESENSITIVE "SW_HID_INSERT_IDX_MRK_SRCH_CASESENSITIVE" -#define HID_INSERT_IDX_MRK_SRCH_WORDONLY "SW_HID_INSERT_IDX_MRK_SRCH_WORDONLY" #define HID_DLG_CREATE_AUTOMARK "SW_HID_DLG_CREATE_AUTOMARK" #define HID_BUSINESS_CARD_CONTENT "SW_HID_BUSINESS_CARD_CONTENT" #define HID_SAVE_LABEL_DLG "SW_HID_SAVE_LABEL_DLG" @@ -471,7 +441,6 @@ #define HID_SEND_HTML_CTRL_CHECKBOX_AUTOEXTENSION "SW_HID_SEND_HTML_CTRL_CHECKBOX_AUTOEXTENSION" #define HID_SEND_HTML_CTRL_LISTBOX_TEMPLATE "SW_HID_SEND_HTML_CTRL_LISTBOX_TEMPLATE" -#define HID_INSERT_IDX_MRK_PHONETIC_READING "SW_HID_INSERT_IDX_MRK_PHONETIC_READING" #define HID_COLUMN_VALUESET "SW_HID_COLUMN_VALUESET" #define HID_PVIEW_ZOOM_LB "SW_HID_PVIEW_ZOOM_LB" #define HID_MAIL_MERGE_SELECT "SW_HID_MAIL_MERGE_SELECT" diff --git a/sw/inc/htmltbl.hxx b/sw/inc/htmltbl.hxx index a3c06d2780c8..2f027e9c9297 100644 --- a/sw/inc/htmltbl.hxx +++ b/sw/inc/htmltbl.hxx @@ -64,12 +64,12 @@ class SwHTMLTableLayoutCnts sal_uInt8 nPass1Done; ///< How many times has Pass 1 been called? sal_uInt8 nWidthSet; ///< How many times has the width been set? - sal_Bool bNoBreakTag; ///< <NOBR>-Tag over complete content. + bool bNoBreakTag; ///< <NOBR>-Tag over complete content. public: SwHTMLTableLayoutCnts( const SwStartNode* pSttNd, SwHTMLTableLayout* pTab, - sal_Bool bNoBreakTag, SwHTMLTableLayoutCnts* pNxt ); + bool bNoBreakTag, SwHTMLTableLayoutCnts* pNxt ); ~SwHTMLTableLayoutCnts(); @@ -89,7 +89,7 @@ public: void SetPass1Done( sal_uInt8 nRef ) { nPass1Done = nRef; } sal_Bool IsPass1Done( sal_uInt8 nRef ) const { return nRef==nPass1Done; } - sal_Bool HasNoBreakTag() const { return bNoBreakTag; } + bool HasNoBreakTag() const { return bNoBreakTag; } }; class SwHTMLTableLayoutCell diff --git a/sw/inc/index.hrc b/sw/inc/index.hrc index 6d07ec14da36..0d23e1d95e8d 100644 --- a/sw/inc/index.hrc +++ b/sw/inc/index.hrc @@ -32,15 +32,12 @@ #define STR_ALPHA (RC_INDEX_BEGIN + 7) #define STR_LEVEL (RC_INDEX_BEGIN + 8) -#define DLG_INSAUTHMARK (RC_INDEX_BEGIN + 9) #define DLG_CREATE_AUTH_ENTRY (RC_INDEX_BEGIN + 10) #define DLG_EDIT_IDXMARK (RC_INDEX_BEGIN + 11) #define DLG_EDIT_AUTHMARK (RC_INDEX_BEGIN + 12) #define STR_IDXMRK_INSERT (RC_INDEX_BEGIN + 13) #define STR_IDXMRK_EDIT (RC_INDEX_BEGIN + 14) -#define STR_AUTHMRK_EDIT (RC_INDEX_BEGIN + 15) -#define STR_AUTHMRK_INSERT (RC_INDEX_BEGIN + 16) #define DLG_NEW_USER_IDX (RC_INDEX_BEGIN + 17) diff --git a/sw/inc/lineinfo.hxx b/sw/inc/lineinfo.hxx index 8dcb73255bc6..22bb1a9167a8 100644 --- a/sw/inc/lineinfo.hxx +++ b/sw/inc/lineinfo.hxx @@ -57,7 +57,7 @@ public: SwLineNumberInfo(const SwLineNumberInfo&); SwLineNumberInfo& operator=(const SwLineNumberInfo&); - sal_Bool operator==( const SwLineNumberInfo& rInf ) const; + bool operator==( const SwLineNumberInfo& rInf ) const; SwCharFmt *GetCharFmt( IDocumentStylePoolAccess& rIDSPA ) const; void SetCharFmt( SwCharFmt* ); diff --git a/sw/inc/list.hxx b/sw/inc/list.hxx index e30a5ad0ad4e..f21a32f38ed8 100644 --- a/sw/inc/list.hxx +++ b/sw/inc/list.hxx @@ -48,7 +48,7 @@ class SwList void ValidateListTree(); void MarkListLevel( const int nListLevel, - const sal_Bool bValue ); + const bool bValue ); bool IsListLevelMarked( const int nListLevel ) const; diff --git a/sw/inc/mdiexp.hxx b/sw/inc/mdiexp.hxx index 08211a269831..a50cef4373df 100644 --- a/sw/inc/mdiexp.hxx +++ b/sw/inc/mdiexp.hxx @@ -72,7 +72,7 @@ void DelAllGrfCacheEntries( SwDoc* pDoc ); // Read ChgMode for tables from configuration. TblChgMode GetTblChgDefaultMode(); -sal_Bool JumpToSwMark( ViewShell* pVwSh, const rtl::OUString& rMark ); +bool JumpToSwMark( ViewShell* pVwSh, const rtl::OUString& rMark ); #endif diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index 2f393af73bd0..a7401a02badc 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -79,7 +79,7 @@ struct SwPosition; // -------------------- typedef SwNode * SwNodePtr; -typedef sal_Bool (*FnForEach_SwNodes)( const SwNodePtr&, void* pArgs ); +typedef bool (*FnForEach_SwNodes)( const SwNodePtr&, void* pArgs ); typedef struct _xmlTextWriter *xmlTextWriterPtr; struct CompareSwOutlineNodes diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx index ddb859bc69ba..7bc20283de88 100644 --- a/sw/inc/ndgrf.hxx +++ b/sw/inc/ndgrf.hxx @@ -1,30 +1,22 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + #ifndef _NDGRF_HXX #define _NDGRF_HXX #include <sfx2/lnkbase.hxx> @@ -46,6 +38,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode friend class SwNodes; GraphicObject aGrfObj; + GraphicObject *mpReplacementGraphic; ::sfx2::SvBaseLinkRef refLink; ///< If graphics only as link then pointer is set. Size nGrfSize; String aNewStrmName; /**< SW3/XML: new stream name (either SW3 stream @@ -138,6 +131,7 @@ public: const Graphic& GetGrf() const { return aGrfObj.GetGraphic(); } const GraphicObject& GetGrfObj() const { return aGrfObj; } GraphicObject& GetGrfObj() { return aGrfObj; } + const GraphicObject* GetReplacementGrfObj() const; virtual SwCntntNode *SplitCntntNode( const SwPosition & ); @@ -190,11 +184,11 @@ public: #ifndef _FESHVIEW_ONLY_INLINE_NEEDED /// Query link-data. - sal_Bool IsGrfLink() const { return refLink.Is(); } - inline sal_Bool IsLinkedFile() const; - inline sal_Bool IsLinkedDDE() const; + bool IsGrfLink() const { return refLink.Is(); } + inline bool IsLinkedFile() const; + inline bool IsLinkedDDE() const; ::sfx2::SvBaseLinkRef GetLink() const { return refLink; } - sal_Bool GetFileFilterNms( String* pFileNm, String* pFilterNm ) const; + bool GetFileFilterNms( String* pFileNm, String* pFilterNm ) const; void ReleaseLink(); /** Scale an image-map: the image-map becomes zoomed in / out by @@ -227,11 +221,11 @@ inline const SwGrfNode *SwNode::GetGrfNode() const } #ifndef _FESHVIEW_ONLY_INLINE_NEEDED -inline sal_Bool SwGrfNode::IsLinkedFile() const +inline bool SwGrfNode::IsLinkedFile() const { return refLink.Is() && OBJECT_CLIENT_GRF == refLink->GetObjType(); } -inline sal_Bool SwGrfNode::IsLinkedDDE() const +inline bool SwGrfNode::IsLinkedDDE() const { return refLink.Is() && OBJECT_CLIENT_DDE == refLink->GetObjType(); } diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 603522cd0583..895ff87d60de 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -348,8 +348,8 @@ public: SwCntntNode *AppendNode( const SwPosition & ); /// When appropriate set DontExpand-flag at INet or character styles respectively. - sal_Bool DontExpandFmt( const SwIndex& rIdx, bool bFlag = true, - sal_Bool bFmtToTxtAttributes = sal_True ); + bool DontExpandFmt( const SwIndex& rIdx, bool bFlag = true, + bool bFmtToTxtAttributes = true ); enum GetTxtAttrMode { DEFAULT, /// DEFAULT: (Start < nIndex <= End) diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 9ac30455dcc2..f12e760a8b06 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -91,17 +91,17 @@ class SW_DLLPUBLIC SwNode { friend class SwNodes; -#ifdef DBG_UTIL - static long s_nSerial; - long m_nSerial; -#endif - sal_uInt8 nNodeType; /// For text nodes: level of auto format. Was put here because we had still free bits. sal_uInt8 nAFmtNumLvl : 3; - sal_Bool bSetNumLSpace : 1; ///< For numbering: TRUE: set indent. - sal_Bool bIgnoreDontExpand : 1; ///< for Text Attributes - ignore the flag + bool bSetNumLSpace : 1; ///< For numbering: TRUE: set indent. + bool bIgnoreDontExpand : 1; ///< for Text Attributes - ignore the flag + +#ifdef DBG_UTIL + static long s_nSerial; + long m_nSerial; +#endif protected: SwStartNode* pStartOfSection; @@ -133,11 +133,11 @@ public: inline sal_uInt8 GetAutoFmtLvl() const { return nAFmtNumLvl; } inline void SetAutoFmtLvl( sal_uInt8 nVal ) { nAFmtNumLvl = nVal; } - inline sal_Bool IsSetNumLSpace() const { return bSetNumLSpace; } - inline void SetNumLSpace( sal_Bool bFlag ) { bSetNumLSpace = bFlag; } + inline bool IsSetNumLSpace() const { return bSetNumLSpace; } + inline void SetNumLSpace( bool bFlag ) { bSetNumLSpace = bFlag; } - inline sal_Bool IsIgnoreDontExpand() const { return bIgnoreDontExpand; } - inline void SetIgnoreDontExpand( sal_Bool bNew ) { bIgnoreDontExpand = bNew; } + inline bool IsIgnoreDontExpand() const { return bIgnoreDontExpand; } + inline void SetIgnoreDontExpand( bool bNew ) { bIgnoreDontExpand = bNew; } sal_uInt8 GetNodeType() const { return nNodeType; } @@ -440,7 +440,7 @@ public: virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const = 0; /// Get information from Client. - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; /// SS for PoolItems: hard attributation. diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index a7f8f3b92aba..1de256149b86 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -238,7 +238,7 @@ public: void SetPoolHlpFileId( sal_uInt8 nId ) { aMaster.SetPoolHlpFileId( nId ); } /// Query information from Client. - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; const SwFrmFmt* GetPageFmtOfNode( const SwNode& rNd, sal_Bool bCheckForThisPgDc = sal_True ) const; diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx index f03b39bc6da1..2035d897b6de 100644 --- a/sw/inc/paratr.hxx +++ b/sw/inc/paratr.hxx @@ -99,7 +99,7 @@ public: inline SwCharFmt *GetCharFmt() { return (SwCharFmt*)GetRegisteredIn(); } void SetCharFmt( SwCharFmt *pNew ); /// Get information from Client. - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; /// Get and set Modify pointer. inline const SwModify* GetDefinedIn() const { return pDefinedIn; } diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index e095d6f8bcc0..252d00c396ae 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -323,7 +323,7 @@ public: virtual void MakeFrms(); // Get information from Format. - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; SwSection* GetSection() const; inline SwSectionFmt* GetParent() const; diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 5f12fa8d5423..6bc093c2b182 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -357,7 +357,7 @@ public: virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo) = 0; - virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg ( Window* pParent, int nResId) = 0; // add for SwInsertAbstractDlg + virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg(Window* pParent) = 0; // add for SwInsertAbstractDlg virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh, SvStream* pStream, int nResId ) = 0;// add for SwAsciiFilterDlg virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId ) = 0;// add for SwInsertBookmarkDlg @@ -444,8 +444,7 @@ public: virtual VclAbstractDialog* CreateTitlePageDlg ( Window * pParent ) = 0; virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId, SwView& rView, sal_Bool bCol = sal_False ) = 0; //add for SwInsRowColDlg, SwLineNumberingDlg - virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId, - Window * pParent ) = 0; //add for SwInsertGrfRulerDlg + virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg(Window * pParent) = 0; //add for SwInsertGrfRulerDlg virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView) = 0; //add for SwInsTableDlg virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId, Window* pParent, SwWrtShell* pWrtSh ) = 0; //add for SwJavaEditDialog @@ -475,20 +474,20 @@ public: Window* pParent, SwWrtShell& rWrtSh ) = 0; //add for SwEditRegionDlg virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog( int nResId, Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh ) = 0; //add for SwInsertSectionTabDialog - virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg( int nResId, + virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo, sal_Bool bNew=sal_True) = 0; //add for SwIndexMarkFloatDlg - virtual AbstractMarkFloatDlg* CreateAuthMarkFloatDlg( int nResId, + virtual AbstractMarkFloatDlg* CreateAuthMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo, sal_Bool bNew=sal_True) = 0; //add for SwAuthMarkFloatDlg - virtual VclAbstractDialog * CreateIndexMarkModalDlg( int nResId, - Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ) = 0; //add for SwIndexMarkModalDlg + virtual VclAbstractDialog * CreateIndexMarkModalDlg( + Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark) = 0; //add for SwIndexMarkModalDlg virtual AbstractMailMergeWizard* CreateMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rConfigItem) = 0; diff --git a/sw/inc/swcalwrp.hxx b/sw/inc/swcalwrp.hxx index 31579428f88f..0d150bccdb5b 100644 --- a/sw/inc/swcalwrp.hxx +++ b/sw/inc/swcalwrp.hxx @@ -32,8 +32,8 @@ class SwCalendarWrapper : public CalendarWrapper public: SwCalendarWrapper( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory > & xMSF = ::comphelper::getProcessServiceFactory() ) - : CalendarWrapper( xMSF ), nLang( LANGUAGE_SYSTEM ) + ::com::sun::star::uno::XComponentContext > & rxContext = ::comphelper::getProcessComponentContext() ) + : CalendarWrapper( rxContext ), nLang( LANGUAGE_SYSTEM ) {} void LoadDefaultCalendar( sal_uInt16 nLang ); diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index 30901f3b2b4e..7b946d923c39 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -180,9 +180,9 @@ public: { return LeftRight( sal_False, nCnt, nMode, bAllowVisual, bSkipHidden, sal_False ); } sal_Bool GoNextCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( sal_True, nCnt ); } sal_Bool GoPrevCell( sal_uInt16 nCnt = 1 ) { return GoPrevNextCell( sal_False, nCnt ); } - virtual sal_Bool GotoTable( const String& rName ); + virtual bool GotoTable( const String& rName ); sal_Bool GotoTblBox( const String& rName ); - sal_Bool GotoRegion( const String& rName ); + bool GotoRegion( const String& rName ); sal_Bool GotoFtnAnchor(); sal_Bool GotoFtnTxt(); sal_Bool GotoNextFtnAnchor(); @@ -283,7 +283,7 @@ public: virtual sal_Bool LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, sal_Bool bAllowVisual, sal_Bool bSkipHidden, sal_Bool bInsertCrsr ); - virtual sal_Bool GotoTable( const String& rName ); + virtual bool GotoTable( const String& rName ); void InsertBox( const SwTableBox& rTblBox ); void DeleteBox(size_t nPos); diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 64584f5651f3..e11ac4759b4d 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -232,8 +232,8 @@ public: void RemoveAttrPool(); // Invalidates online spell-wrong-lists if necessary. - void CheckSpellChanges( sal_Bool bOnlineSpelling, - sal_Bool bIsSpellWrongAgain, sal_Bool bIsSpellAllAgain, sal_Bool bSmartTags ); + void CheckSpellChanges( bool bOnlineSpelling, + bool bIsSpellWrongAgain, bool bIsSpellAllAgain, bool bSmartTags ); inline ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XLinguServiceEventListener > diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx index f2b620884f67..4cebc24f1a76 100644 --- a/sw/inc/swrect.hxx +++ b/sw/inc/swrect.hxx @@ -31,7 +31,7 @@ #include <tools/gen.hxx> class SvStream; -class SwRect +class SAL_WARN_UNUSED SwRect { Point m_Point; Size m_Size; diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 709fce4bc861..c1f81a6d4838 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -299,11 +299,11 @@ public: const SwTableBox* GetTblBox( sal_uLong nSttIdx ) const { return ((SwTable*)this)->GetTblBox( nSttIdx ); } - // Returns sal_True if table contains nestings. - sal_Bool IsTblComplex() const; + // Returns true if table contains nestings. + bool IsTblComplex() const; - // Returns sal_True if table or selection is balanced. - sal_Bool IsTblComplexForChart( const String& rSel ) const; + // Returns true if table or selection is balanced. + bool IsTblComplexForChart( const String& rSel ) const; // Search all content-bearing boxes of the base line on which this box stands. // rBoxes as a return value for immediate use. @@ -313,7 +313,7 @@ public: SwSelBoxes& rBoxes, sal_Bool bToTop = sal_True ) const; // Get information from client. - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; // Search in format for registered table. static SwTable * FindTable( SwFrmFmt const*const pFmt ); diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 0368e3a8ed61..c7e3cc4970b5 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -489,7 +489,7 @@ public: SwTOXBase( const SwTOXBase& rCopy, SwDoc* pDoc = 0 ); virtual ~SwTOXBase(); - virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; + virtual bool GetInfo( SfxPoolItem& rInfo ) const; // a kind of CopyCtor - check if the TOXBase is at TOXType of the doc. // If not, so create it an copy all other used things. The return is this @@ -560,7 +560,7 @@ public: SwCaptionDisplay GetCaptionDisplay() const { return eCaptionDisplay;} void SetCaptionDisplay(SwCaptionDisplay eSet) {eCaptionDisplay = eSet;} - sal_Bool IsTOXBaseInReadonly() const; + bool IsTOXBaseInReadonly() const; const SfxItemSet* GetAttrSet() const; void SetAttrSet( const SfxItemSet& ); diff --git a/sw/inc/txatritr.hxx b/sw/inc/txatritr.hxx index fd2c2fec1d4b..05ed48fb3dbf 100644 --- a/sw/inc/txatritr.hxx +++ b/sw/inc/txatritr.hxx @@ -36,13 +36,13 @@ class SwScriptIterator const String& rText; xub_StrLen nChgPos; sal_uInt16 nCurScript; - sal_Bool bForward; + bool bForward; public: SwScriptIterator( const String& rStr, xub_StrLen nStart = 0, - sal_Bool bFrwrd = sal_True ); + bool bFrwrd = true ); - sal_Bool Next(); + bool Next(); sal_uInt16 GetCurrScript() const { return nCurScript; } xub_StrLen GetScriptChgPos() const { return nChgPos; } @@ -58,16 +58,16 @@ class SwTxtAttrIterator const SfxPoolItem *pParaItem, *pCurItem; xub_StrLen nChgPos; sal_uInt16 nAttrPos, nWhichId; - sal_Bool bIsUseGetWhichOfScript; + bool bIsUseGetWhichOfScript; void AddToStack( const SwTxtAttr& rAttr ); void SearchNextChg(); public: SwTxtAttrIterator( const SwTxtNode& rTxtNd, sal_uInt16 nWhichId, - xub_StrLen nStart = 0, sal_Bool bUseGetWhichOfScript = sal_True ); + xub_StrLen nStart = 0, bool bUseGetWhichOfScript = true ); - sal_Bool Next(); + bool Next(); const SfxPoolItem& GetAttr() const { return *pCurItem; } xub_StrLen GetChgPos() const { return nChgPos; } @@ -79,7 +79,7 @@ class SwLanguageIterator : public SwTxtAttrIterator public: SwLanguageIterator( const SwTxtNode& rTxtNode, xub_StrLen nStart = 0, sal_uInt16 nWhich = RES_CHRATR_LANGUAGE, - sal_Bool bUseGetWhichOfScript = sal_True ) + bool bUseGetWhichOfScript = true ) : SwTxtAttrIterator( rTxtNode, nWhich, nStart, bUseGetWhichOfScript ) {} diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index f15e4e75c0f0..b8a34f9ceb8d 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -105,7 +105,7 @@ public: virtual ~SwTxtRuby(); TYPEINFO(); - virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; + virtual bool GetInfo( SfxPoolItem& rInfo ) const; SW_DLLPRIVATE void InitRuby(SwTxtNode & rNode); diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx index f6e35addb183..6008496628b0 100644 --- a/sw/inc/txtinet.hxx +++ b/sw/inc/txtinet.hxx @@ -51,7 +51,7 @@ public: virtual ~SwTxtINetFmt(); TYPEINFO(); - virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const; + virtual bool GetInfo( SfxPoolItem& rInfo ) const; SW_DLLPRIVATE void InitINetFmt(SwTxtNode & rNode); diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 01922d1ef526..2f3c2d33801b 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -1,30 +1,22 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + #ifndef _UNOPRNMS_HXX #define _UNOPRNMS_HXX @@ -823,7 +815,9 @@ enum SwPropNameIds /* 0754 */ UNO_NAME_INITIALS, /* 0755 */ UNO_NAME_TABLE_BORDER2, -/* 0756 */ SW_PROPNAME_END +/* 0756 */ UNO_NAME_REPLACEMENT_GRAPHIC_URL, + +/* 0757 */ SW_PROPNAME_END // new items in this array must match SwPropNameTab aPropNameTab }; diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx index 117c79a96623..d295238d4172 100644 --- a/sw/qa/core/Test-BigPtrArray.cxx +++ b/sw/qa/core/Test-BigPtrArray.cxx @@ -78,7 +78,7 @@ namespace /* private */ sal_uLong count_; }; - sal_Bool AddToCount(const ElementPtr& rElem, void* pArgs) + bool AddToCount(const ElementPtr& rElem, void* pArgs) { BigPtrEntryMock* const pbem = static_cast<BigPtrEntryMock* const>(rElem); pbem->setCount(pbem->getCount() + *((sal_uLong*)pArgs)); diff --git a/sw/qa/core/data/odt/fail/.gitignore b/sw/qa/core/data/odt/fail/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sw/qa/core/data/odt/fail/.gitignore diff --git a/sw/qa/core/data/odt/indeterminate/.gitignore b/sw/qa/core/data/odt/indeterminate/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sw/qa/core/data/odt/indeterminate/.gitignore diff --git a/sw/qa/core/data/odt/pass/.gitignore b/sw/qa/core/data/odt/pass/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/sw/qa/core/data/odt/pass/.gitignore diff --git a/sw/qa/core/data/odt/pass/CVE-2012-4233-1.odt b/sw/qa/core/data/odt/pass/CVE-2012-4233-1.odt Binary files differnew file mode 100644 index 000000000000..9d3c3dc97f84 --- /dev/null +++ b/sw/qa/core/data/odt/pass/CVE-2012-4233-1.odt diff --git a/sw/qa/core/data/ww8/pass/EDB-22215-1.doc b/sw/qa/core/data/ww8/pass/EDB-22215-1.doc Binary files differnew file mode 100644 index 000000000000..f4429f6059a1 --- /dev/null +++ b/sw/qa/core/data/ww8/pass/EDB-22215-1.doc diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index 4df9b0760c65..ed2e3efd336e 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -62,7 +62,9 @@ class SwFiltersTest , public test::BootstrapFixture { public: - bool load(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData); + virtual bool load( const rtl::OUString &rFilter, const rtl::OUString &rURL, + const rtl::OUString &rUserData, unsigned int nFilterFlags, + unsigned int nClipboardID, unsigned int nFilterVersion); virtual void setUp(); // Ensure CVEs remain unbroken @@ -77,12 +79,14 @@ private: }; bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL, - const rtl::OUString &rUserData) + const rtl::OUString &rUserData, unsigned int nFilterFlags, + unsigned int nClipboardID, unsigned int nFilterVersion) { SfxFilter* pFilter = new SfxFilter( - rFilter, - rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(), - rUserData, rtl::OUString() ); + rFilter, rtl::OUString(), nFilterFlags, + nClipboardID, rtl::OUString(), 0, rtl::OUString(), + rUserData, rtl::OUString()); + pFilter->SetVersion(nFilterVersion); SwDocShellRef xDocShRef = new SwDocShell; SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ); @@ -100,11 +104,21 @@ bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL return bLoaded; } +#define isstorage 1 + void SwFiltersTest::testCVEs() { testDir(rtl::OUString("Staroffice XML (Writer)"), getURLFromSrc("/sw/qa/core/data/xml/"), - rtl::OUString(FILTER_XML)); + rtl::OUString(FILTER_XML), + SFX_FILTER_IMPORT | SFX_FILTER_OWN | SFX_FILTER_DEFAULT, + isstorage, SOFFICE_FILEFORMAT_CURRENT); + + testDir(rtl::OUString("writer8"), + getURLFromSrc("/sw/qa/core/data/odt/"), + rtl::OUString(FILTER_XML), + SFX_FILTER_IMPORT | SFX_FILTER_OWN | SFX_FILTER_DEFAULT, + isstorage, SOFFICE_FILEFORMAT_CURRENT); testDir(rtl::OUString("MS Word 97"), getURLFromSrc("/sw/qa/core/data/ww8/"), diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 032da03cd640..7964ea9a1303 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -37,34 +37,44 @@ public: CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testFdo38244); - CPPUNIT_TEST(testFirstHeaderFooter); + CPPUNIT_TEST(run); #endif CPPUNIT_TEST_SUITE_END(); private: - void roundtrip(const OUString& rURL); + void run(); }; -void Test::roundtrip(const OUString& rFilename) +void Test::run() { - uno::Reference<lang::XComponent> xImported = loadFromDesktop(getURLFromSrc("/sw/qa/extras/odfexport/data/") + rFilename); - uno::Reference<frame::XStorable> xStorable(xImported, uno::UNO_QUERY); - uno::Sequence<beans::PropertyValue> aArgs(1); - aArgs[0].Name = "FilterName"; - aArgs[0].Value <<= OUString("writer8"); - utl::TempFile aTempFile; - aTempFile.EnableKillingFile(); - xStorable->storeToURL(aTempFile.GetURL(), aArgs); - uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY); - xComponent->dispose(); - mxComponent = loadFromDesktop(aTempFile.GetURL()); + MethodEntry<Test> aMethods[] = { + {"fdo38244.odt", &Test::testFdo38244}, + {"first-header-footer.odt", &Test::testFirstHeaderFooter}, + }; + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) + { + MethodEntry<Test>& rEntry = aMethods[i]; + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/odfexport/data/") + OUString::createFromAscii(rEntry.pName)); + // If the testcase is stored in some other format, it's pointless to test. + if (OString(rEntry.pName).endsWith(".odt")) + (this->*rEntry.pMethod)(); + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aArgs(1); + aArgs[0].Name = "FilterName"; + aArgs[0].Value <<= OUString("writer8"); + utl::TempFile aTempFile; + aTempFile.EnableKillingFile(); + xStorable->storeToURL(aTempFile.GetURL(), aArgs); + uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY); + xComponent->dispose(); + mxComponent = loadFromDesktop(aTempFile.GetURL()); + (this->*rEntry.pMethod)(); + } } void Test::testFdo38244() { // See ooxmlexport's testFdo38244(). - roundtrip("fdo38244.odt"); // Test comment range feature. uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); @@ -91,7 +101,6 @@ void Test::testFdo38244() void Test::testFirstHeaderFooter() { // Test import and export of the header-first token. - roundtrip("first-header-footer.odt"); // The document has 6 pages, two page styles for the first and second half of pages. CPPUNIT_ASSERT_EQUAL(OUString("First header"), parseDump("/root/page[1]/header/txt/text()")); diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index d7a6c0e966c7..23328263fa9c 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -42,32 +42,37 @@ public: CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testEmptySvgFamilyName); - CPPUNIT_TEST(testHideAllSections); - CPPUNIT_TEST(testOdtBorders); + CPPUNIT_TEST(run); #endif CPPUNIT_TEST_SUITE_END(); private: - /// Load an ODF file and make the document available via mxComponent. - void load(const OUString& rURL); + void run(); }; -void Test::load(const OUString& rFilename) +void Test::run() { - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/odfimport/data/") + rFilename); + MethodEntry<Test> aMethods[] = { + {"empty-svg-family-name.odt", &Test::testEmptySvgFamilyName}, + {"fdo53210.odt", &Test::testHideAllSections}, + {"borders_ooo33.odt", &Test::testOdtBorders}, + }; + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) + { + MethodEntry<Test>& rEntry = aMethods[i]; + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/odfimport/data/") + OUString::createFromAscii(rEntry.pName)); + (this->*rEntry.pMethod)(); + } } void Test::testEmptySvgFamilyName() { // .odt import did crash on the empty font list (which I think is valid according SVG spec) - load( "empty-svg-family-name.odt" ); } void Test::testHideAllSections() { // This document has a section that is conditionally hidden, but has no empty paragraph after it. - load("fdo53210.odt"); uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XNameAccess> xMasters = xTextFieldsSupplier->getTextFieldMasters(); // Set _CS_Allgemein to 0 @@ -79,7 +84,6 @@ void Test::testHideAllSections() void Test::testOdtBorders() { - load("borders_ooo33.odt"); AllBordersMap map; uno::Sequence< table::BorderLine > tempSequence(4); diff --git a/sw/qa/extras/ooxmlexport/data/fdo51550.odt b/sw/qa/extras/ooxmlexport/data/fdo51550.odt Binary files differnew file mode 100644 index 000000000000..4cade5b21b9c --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo51550.odt diff --git a/sw/qa/extras/ooxmlexport/data/table-borders.docx b/sw/qa/extras/ooxmlexport/data/table-borders.docx Binary files differnew file mode 100644 index 000000000000..a18a93e79034 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/table-borders.docx diff --git a/sw/qa/extras/ooxmlimport/data/n779957.docx b/sw/qa/extras/ooxmlexport/data/table-position.docx Binary files differindex 4347854442c9..4347854442c9 100644 --- a/sw/qa/extras/ooxmlimport/data/n779957.docx +++ b/sw/qa/extras/ooxmlexport/data/table-position.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 2d7f49d83562..1a1c15791b16 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -64,56 +64,75 @@ public: void testMathVerticalStacks(); void testTablePosition(); void testFdo47669(); + void testTableBorders(); + void testFdo51550(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testZoom); - CPPUNIT_TEST(defaultTabStopNotInStyles); - CPPUNIT_TEST(testFdo38244); - CPPUNIT_TEST(testMathEscape); - CPPUNIT_TEST(testFdo51034); - CPPUNIT_TEST(testMathAccents); - CPPUNIT_TEST(testMathD); - CPPUNIT_TEST(testMathEscaping); - CPPUNIT_TEST(testMathLim); - CPPUNIT_TEST(testMathMalformedXml); - CPPUNIT_TEST(testMathMatrix); - CPPUNIT_TEST(testMathMso2k7); - CPPUNIT_TEST(testMathNary); - CPPUNIT_TEST(testMathOverbraceUnderbrace); - CPPUNIT_TEST(testMathOverstrike); - CPPUNIT_TEST(testMathPlaceholders); - CPPUNIT_TEST(testMathRad); - CPPUNIT_TEST(testMathSubscripts); - CPPUNIT_TEST(testMathVerticalStacks); - CPPUNIT_TEST(testTablePosition); - CPPUNIT_TEST(testFdo47669); + CPPUNIT_TEST(run); #endif CPPUNIT_TEST_SUITE_END(); private: - void roundtrip(const OUString& rURL); + void run(); }; -void Test::roundtrip(const OUString& rFilename) +void Test::run() { - uno::Reference<lang::XComponent> xImported = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ooxmlexport/data/") + rFilename); - uno::Reference<frame::XStorable> xStorable(xImported, uno::UNO_QUERY); - uno::Sequence<beans::PropertyValue> aArgs(1); - aArgs[0].Name = "FilterName"; - aArgs[0].Value <<= OUString("Office Open XML Text"); - utl::TempFile aTempFile; - aTempFile.EnableKillingFile(); - xStorable->storeToURL(aTempFile.GetURL(), aArgs); - uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY); - xComponent->dispose(); - mxComponent = loadFromDesktop(aTempFile.GetURL()); + MethodEntry<Test> aMethods[] = { + {"zoom.docx", &Test::testZoom}, + {"empty.odt", &Test::defaultTabStopNotInStyles}, + {"fdo38244.docx", &Test::testFdo38244}, + {"math-escape.docx", &Test::testMathEscape}, + {"fdo51034.odt", &Test::testFdo51034}, + {"math-accents.docx", &Test::testMathAccents}, + {"math-d.docx", &Test::testMathD}, + {"math-escaping.docx", &Test::testMathEscaping}, + {"math-lim.docx", &Test::testMathLim}, + {"math-malformed_xml.docx", &Test::testMathMalformedXml}, + {"math-matrix.docx", &Test::testMathMatrix}, + {"math-mso2k7.docx", &Test::testMathMso2k7}, + {"math-nary.docx", &Test::testMathNary}, + {"math-overbrace_underbrace.docx", &Test::testMathOverbraceUnderbrace}, + {"math-overstrike.docx", &Test::testMathOverstrike}, + {"math-placeholders.docx", &Test::testMathPlaceholders}, + {"math-rad.docx", &Test::testMathRad}, + {"math-subscripts.docx", &Test::testMathSubscripts}, + {"math-vertical_stacks.docx", &Test::testMathVerticalStacks}, + {"table-position.docx", &Test::testTablePosition}, + {"fdo47669.docx", &Test::testFdo47669}, + {"table-borders.docx", &Test::testTableBorders}, + {"fdo51550.odt", &Test::testFdo51550}, + }; + // Don't test the first import of these, for some reason those tests fail + const char* aBlacklist[] = { + "math-escape.docx", + "math-mso2k7.docx", + }; + std::vector<const char*> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist)); + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) + { + MethodEntry<Test>& rEntry = aMethods[i]; + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ooxmlexport/data/") + OUString::createFromAscii(rEntry.pName)); + // If the testcase is stored in some other format, it's pointless to test. + if (OString(rEntry.pName).endsWith(".docx") && std::find(vBlacklist.begin(), vBlacklist.end(), rEntry.pName) == vBlacklist.end()) + (this->*rEntry.pMethod)(); + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aArgs(1); + aArgs[0].Name = "FilterName"; + aArgs[0].Value <<= OUString("Office Open XML Text"); + utl::TempFile aTempFile; + aTempFile.EnableKillingFile(); + xStorable->storeToURL(aTempFile.GetURL(), aArgs); + uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY); + xComponent->dispose(); + mxComponent = loadFromDesktop(aTempFile.GetURL()); + (this->*rEntry.pMethod)(); + } } void Test::testZoom() { - roundtrip("zoom.docx"); - uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<view::XViewSettingsSupplier> xViewSettingsSupplier(xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xViewSettingsSupplier->getViewSettings()); @@ -124,7 +143,6 @@ void Test::testZoom() void Test::defaultTabStopNotInStyles() { - roundtrip( "empty.odt" ); // The default tab stop was mistakenly exported to a style. // xray ThisComponent.StyleFamilies(1)(0).ParaTabStop uno::Reference< container::XNameAccess > paragraphStyles = getStyles( "ParagraphStyles" ); @@ -138,8 +156,6 @@ void Test::defaultTabStopNotInStyles() void Test::testFdo38244() { - roundtrip("fdo38244.docx"); - /* * Comments attached to a range was imported without the range, check for the fieldmark start/end positions. * @@ -204,14 +220,12 @@ void Test::testFdo38244() void Test::testMathEscape() { - roundtrip("math-escape.docx"); CPPUNIT_ASSERT_EQUAL(OUString("\\{ left [ right ] left ( right ) \\}"), getFormula(getRun(getParagraph(1), 1))); } void Test::testFdo51034() { // The problem was that the 'l' param of the HYPERLINK field was parsed with = "#", not += "#". - roundtrip("fdo51034.odt"); CPPUNIT_ASSERT_EQUAL(OUString("http://Www.google.com/#a"), getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); } @@ -226,7 +240,6 @@ void Test::testFdo51034() void Test::testMathAccents() { - roundtrip( "math-accents.docx" ); CHECK_FORMULA( "acute {a} grave {a} check {a} breve {a} circle {a} widevec {a} widetilde {a}" " widehat {a} dot {a} widevec {a} widevec {a} widetilde {a} underline {a}", @@ -235,7 +248,6 @@ void Test::testMathAccents() void Test::testMathD() { - roundtrip( "math-d.docx" ); CHECK_FORMULA( "left (x mline y mline z right )", getFormula( getRun( getParagraph( 1 ), 1 ))); CHECK_FORMULA( "left (1 right )", getFormula( getRun( getParagraph( 1 ), 2 ))); CHECK_FORMULA( "left [2 right ]", getFormula( getRun( getParagraph( 1 ), 3 ))); @@ -249,31 +261,26 @@ void Test::testMathD() void Test::testMathEscaping() { - roundtrip( "math-escaping.docx" ); CHECK_FORMULA( "− ∞ < x < ∞", getFormula( getRun( getParagraph( 1 ), 1 ))); } void Test::testMathLim() { - roundtrip( "math-lim.docx" ); CHECK_FORMULA( "lim from {x → 1} {x}", getFormula( getRun( getParagraph( 1 ), 1 ))); } void Test::testMathMalformedXml() { - roundtrip( "math-malformed_xml.docx" ); CPPUNIT_ASSERT_EQUAL( 0, getLength()); } void Test::testMathMatrix() { - roundtrip( "math-matrix.docx" ); CHECK_FORMULA( "left [matrix {1 # 2 ## 3 # 4} right ]", getFormula( getRun( getParagraph( 1 ), 1 ))); } void Test::testMathMso2k7() { - roundtrip( "math-mso2k7.docx" ); CHECK_FORMULA( "A = π {r} ^ {2}", getFormula( getRun( getParagraph( 1 ), 1 ))); // TODO check the stack/binom difference // CHECK_FORMULA( "{left (x+a right )} ^ {n} = sum from {k=0} to {n} {left (binom {n} {k} right ) {x} ^ {k} {a} ^ {n-k}}", @@ -305,7 +312,6 @@ void Test::testMathMso2k7() void Test::testMathNary() { - roundtrip( "math-nary.docx" ); CHECK_FORMULA( "lllint from {1} to {2} {x + 1}", getFormula( getRun( getParagraph( 1 ), 1 ))); CHECK_FORMULA( "prod from {a} {b}", getFormula( getRun( getParagraph( 1 ), 2 ))); CHECK_FORMULA( "sum to {2} {x}", getFormula( getRun( getParagraph( 1 ), 3 ))); @@ -313,33 +319,28 @@ void Test::testMathNary() void Test::testMathOverbraceUnderbrace() { - roundtrip( "math-overbrace_underbrace.docx" ); CHECK_FORMULA( "{abcd} overbrace {4}", getFormula( getRun( getParagraph( 1 ), 1 ))); CHECK_FORMULA( "{xyz} underbrace {3}", getFormula( getRun( getParagraph( 2 ), 1 ))); } void Test::testMathOverstrike() { - roundtrip( "math-overstrike.docx" ); CHECK_FORMULA( "overstrike {abc}", getFormula( getRun( getParagraph( 1 ), 1 ))); } void Test::testMathPlaceholders() { - roundtrip( "math-placeholders.docx" ); CHECK_FORMULA( "sum from <?> to <?> <?>", getFormula( getRun( getParagraph( 1 ), 1 ))); } void Test::testMathRad() { - roundtrip( "math-rad.docx" ); CHECK_FORMULA( "sqrt {4}", getFormula( getRun( getParagraph( 1 ), 1 ))); CHECK_FORMULA( "nroot {3} {x + 1}", getFormula( getRun( getParagraph( 1 ), 2 ))); } void Test::testMathSubscripts() { - roundtrip( "math-subscripts.docx" ); CHECK_FORMULA( "{x} ^ {y} + {e} ^ {x}", getFormula( getRun( getParagraph( 1 ), 1 ))); CHECK_FORMULA( "{x} ^ {b}", getFormula( getRun( getParagraph( 1 ), 2 ))); CHECK_FORMULA( "{x} rsub {b}", getFormula( getRun( getParagraph( 1 ), 3 ))); @@ -351,7 +352,6 @@ void Test::testMathSubscripts() void Test::testMathVerticalStacks() { - roundtrip( "math-vertical_stacks.docx" ); CHECK_FORMULA( "{a} over {b}", getFormula( getRun( getParagraph( 1 ), 1 ))); CHECK_FORMULA( "{a} / {b}", getFormula( getRun( getParagraph( 2 ), 1 ))); // TODO check these @@ -361,11 +361,6 @@ void Test::testMathVerticalStacks() void Test::testTablePosition() { - // This is the reverse test of n779957 from ooxmlimport - // We want to verify that a full round-trip does not break formatting - // Of course if import code is wrong, this tests will fail regardless of export code. - roundtrip( "../../ooxmlimport/data/n779957.docx" ); - sal_Int32 xCoordsFromOffice[] = { 2500, -1000, 0, 0 }; sal_Int32 cellLeftMarginFromOffice[] = { 250, 100, 0, 0 }; @@ -401,8 +396,6 @@ void Test::testTablePosition() void Test::testFdo47669() { - roundtrip("fdo47669.docx"); - /* * Problem: we created imbalance </w:hyperlink> which shouldn't be there, * resulting in loading error: missing last character of hyperlink text @@ -413,6 +406,82 @@ void Test::testFdo47669() CPPUNIT_ASSERT_EQUAL(OUString("http://www.google.com/#a"), getProperty<OUString>(getRun(getParagraph(1), 2), "HyperLinkURL")); } +struct SingleLineBorders { + sal_Int16 top, bottom, left, right; + SingleLineBorders(int t=0, int b=0, int l=0, int r=0) + : top(t), bottom(b), left(l), right(r) {} + sal_Int16 getBorder(int i) const + { + switch (i) { + case 0: return top; + case 1: return bottom; + case 2: return left; + case 3: return right; + default: assert(false); return 0; + } + } +}; +void Test::testTableBorders() { + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); + uno::Reference<text::XTextTable> xTextTable (xTables->getByIndex(0), uno::UNO_QUERY); + + std::map<OUString, SingleLineBorders> cellBorders; + cellBorders[OUString("A1")] = SingleLineBorders(106, 106, 106, 106); + cellBorders[OUString("B1")] = SingleLineBorders(106, 0, 106, 35); + cellBorders[OUString("C1")] = SingleLineBorders(106, 106, 35, 106); + cellBorders[OUString("A2")] = SingleLineBorders(106, 35, 106, 0); + cellBorders[OUString("B2")] = SingleLineBorders(0, 0, 0, 0); + cellBorders[OUString("C2")] = SingleLineBorders(106, 106, 0, 106); + cellBorders[OUString("A3")] = SingleLineBorders(35, 35, 106, 106); + cellBorders[OUString("B3")] = SingleLineBorders(0, 106, 106, 106); + cellBorders[OUString("C3")] = SingleLineBorders(106, 106, 106, 106); + cellBorders[OUString("A4")] = SingleLineBorders(35, 106, 106, 35); + cellBorders[OUString("B4")] = SingleLineBorders(106, 106, 35, 106); + cellBorders[OUString("C4")] = SingleLineBorders(106, 106, 106, 106); + + const OUString borderNames[] = { + OUString("TopBorder"), + OUString("BottomBorder"), + OUString("LeftBorder"), + OUString("RightBorder"), + }; + + uno::Sequence<OUString> const cells = xTextTable->getCellNames(); + sal_Int32 nLength = cells.getLength(); + CPPUNIT_ASSERT_EQUAL((sal_Int32)cellBorders.size(), nLength); + + for (sal_Int32 i = 0; i < nLength; ++i) + { + uno::Reference<table::XCell> xCell = xTextTable->getCellByName(cells[i]); + uno::Reference< beans::XPropertySet > xPropSet(xCell, uno::UNO_QUERY_THROW); + const SingleLineBorders& borders = cellBorders[cells[i]]; + + for (sal_Int32 j = 0; j < 4; ++j) + { + uno::Any aBorder = xPropSet->getPropertyValue(borderNames[j]); + table::BorderLine aBorderLine; + if (aBorder >>= aBorderLine) + { + std::stringstream message; + message << cells[i] << "'s " << borderNames[j] << " is incorrect"; + CPPUNIT_ASSERT_EQUAL_MESSAGE(message.str(), + borders.getBorder(j), aBorderLine.OuterLineWidth); + } + } + } +} + +void Test::testFdo51550() +{ + // The problem was that we lacked the fallback to export the replacement graphic for OLE objects. + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/ooxmlimport/data/fdo52208.docx b/sw/qa/extras/ooxmlimport/data/fdo52208.docx Binary files differnew file mode 100644 index 000000000000..be842ad2acbc --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/fdo52208.docx diff --git a/sw/qa/extras/ooxmlimport/data/n773061.docx b/sw/qa/extras/ooxmlimport/data/n773061.docx Binary files differnew file mode 100644 index 000000000000..e0d60019d45d --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/n773061.docx diff --git a/sw/qa/extras/ooxmlimport/data/n785767.docx b/sw/qa/extras/ooxmlimport/data/n785767.docx Binary files differnew file mode 100755 index 000000000000..db356769bc8b --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/n785767.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index ea6b66778e95..a36bdb7c0260 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/SetVariableType.hpp> +#include <com/sun/star/text/TableColumnSeparator.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/WrapTextMode.hpp> @@ -96,7 +97,6 @@ public: void testN779834(); void testN779627(); void testN779941(); - void testN779957(); void testFdo55187(); void testN780563(); void testN780853(); @@ -105,70 +105,80 @@ public: void testN782061(); void testN782345(); void testN783638(); + void testFdo52208(); + void testN785767(); + void testN773061(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testN751054); - CPPUNIT_TEST(testN751117); - CPPUNIT_TEST(testN751017); - CPPUNIT_TEST(testN750935); - CPPUNIT_TEST(testN757890); - CPPUNIT_TEST(testFdo49940); - CPPUNIT_TEST(testN751077); - CPPUNIT_TEST(testN705956_1); - CPPUNIT_TEST(testN705956_2); - CPPUNIT_TEST(testN747461); - CPPUNIT_TEST(testN750255); - CPPUNIT_TEST(testN652364); - CPPUNIT_TEST(testN760764); - CPPUNIT_TEST(testN764005); - CPPUNIT_TEST(testSmartart); - CPPUNIT_TEST(testN764745); - CPPUNIT_TEST(testN766477); - CPPUNIT_TEST(testN758883); - CPPUNIT_TEST(testN766481); - CPPUNIT_TEST(testN766487); - CPPUNIT_TEST(testN693238); - CPPUNIT_TEST(testNumbering1); - CPPUNIT_TEST(testBnc773061); - CPPUNIT_TEST(testAllGapsWord); - CPPUNIT_TEST(testN775906); - CPPUNIT_TEST(testN775899); - CPPUNIT_TEST(testN777345); - CPPUNIT_TEST(testN777337); - CPPUNIT_TEST(testN778836); - CPPUNIT_TEST(testN778140); - CPPUNIT_TEST(testN778828); - CPPUNIT_TEST(testInk); - CPPUNIT_TEST(testN779834); - CPPUNIT_TEST(testN779627); - CPPUNIT_TEST(testN779941); - CPPUNIT_TEST(testN779957); - CPPUNIT_TEST(testFdo55187); - CPPUNIT_TEST(testN780563); - CPPUNIT_TEST(testN780853); - CPPUNIT_TEST(testN780843); - CPPUNIT_TEST(testShadow); - CPPUNIT_TEST(testN782061); - CPPUNIT_TEST(testN782345); - CPPUNIT_TEST(testN783638); + CPPUNIT_TEST(run); #endif CPPUNIT_TEST_SUITE_END(); private: - /// Load an OOXML file and make the document available via mxComponent. - void load(const OUString& rURL); + void run(); }; -void Test::load(const OUString& rFilename) +void Test::run() { - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ooxmlimport/data/") + rFilename); + MethodEntry<Test> aMethods[] = { + {"n751054.docx", &Test::testN751054}, + {"n751117.docx", &Test::testN751117}, + {"n751017.docx", &Test::testN751017}, + {"n750935.docx", &Test::testN750935}, + {"n757890.docx", &Test::testN757890}, + {"fdo49940.docx", &Test::testFdo49940}, + {"n751077.docx", &Test::testN751077}, + {"n705956-1.docx", &Test::testN705956_1}, + {"n705956-2.docx", &Test::testN705956_2}, + {"n747461.docx", &Test::testN747461}, + {"n750255.docx", &Test::testN750255}, + {"n652364.docx", &Test::testN652364}, + {"n760764.docx", &Test::testN760764}, + {"n764005.docx", &Test::testN764005}, + {"smartart.docx", &Test::testSmartart}, + {"n764745-alignment.docx", &Test::testN764745}, + {"n766477.docx", &Test::testN766477}, + {"n758883.docx", &Test::testN758883}, + {"n766481.docx", &Test::testN766481}, + {"n766487.docx", &Test::testN766487}, + {"n693238.docx", &Test::testN693238}, + {"numbering1.docx", &Test::testNumbering1}, + {"bnc773061.docx", &Test::testBnc773061}, + {"all_gaps_word.docx", &Test::testAllGapsWord}, + {"n775906.docx", &Test::testN775906}, + {"n775899.docx", &Test::testN775899}, + {"n777345.docx", &Test::testN777345}, + {"n777337.docx", &Test::testN777337}, + {"n778836.docx", &Test::testN778836}, + {"n778140.docx", &Test::testN778140}, + {"n778828.docx", &Test::testN778828}, + {"ink.docx", &Test::testInk}, + {"n779834.docx", &Test::testN779834}, + {"n779627.docx", &Test::testN779627}, + {"n779941.docx", &Test::testN779941}, + {"fdo55187.docx", &Test::testFdo55187}, + {"n780563.docx", &Test::testN780563}, + {"n780853.docx", &Test::testN780853}, + {"n780843.docx", &Test::testN780843}, + {"imgshadow.docx", &Test::testShadow}, + {"n782061.docx", &Test::testN782061}, + {"n782345.docx", &Test::testN782345}, + {"n783638.docx", &Test::testN783638}, + {"fdo52208.docx", &Test::testFdo52208}, + {"n785767.docx", &Test::testN785767}, + {"n773061.docx", &Test::testN773061}, + }; + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) + { + MethodEntry<Test>& rEntry = aMethods[i]; + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ooxmlimport/data/") + OUString::createFromAscii(rEntry.pName)); + (this->*rEntry.pMethod)(); + } } void Test::testN751054() { - load("n751054.docx"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); @@ -179,8 +189,6 @@ void Test::testN751054() void Test::testN751117() { - load("n751117.docx"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); @@ -205,7 +213,6 @@ void Test::testN751117() void Test::testN751017() { - load("n751017.docx"); uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XNameAccess> xMasters(xTextFieldsSupplier->getTextFieldMasters()); // Make sure we have a variable named foo. @@ -252,7 +259,6 @@ void Test::testN751017() void Test::testN750935() { - load("n750935.docx"); uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); @@ -275,8 +281,6 @@ void Test::testN750935() void Test::testN757890() { - load("n757890.docx"); - // The w:pStyle token affected the text outside the textbox. uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); @@ -297,8 +301,6 @@ void Test::testN757890() void Test::testFdo49940() { - load("fdo49940.docx"); - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -310,8 +312,6 @@ void Test::testFdo49940() void Test::testN751077() { - load( "n751077.docx" ); - /* enum = ThisComponent.Text.createEnumeration enum.NextElement @@ -328,7 +328,6 @@ xray para.PageStyleName void Test::testN705956_1() { - load( "n705956-1.docx" ); /* Get the first image in the document and check it's the one image in the document. It should be also anchored inline (as character). @@ -356,7 +355,6 @@ xray image.AnchorType void Test::testN705956_2() { - load( "n705956-2.docx" ); /* <v:shapetype> must be global, reachable even from <v:shape> inside another <w:pict> image = ThisComponent.DrawPage.getByIndex(0) @@ -375,7 +373,6 @@ xray image.FillColor void Test::testN747461() { - load( "n747461.docx" ); /* The document contains 3 images (Red, Black, Green, in this order), with explicit w:relativeHeight (300, 0, 225763766). Check that they are in the right ZOrder @@ -409,7 +406,6 @@ after they are loaded. void Test::testN750255() { - load( "n750255.docx" ); /* Column break without columns on the page is a page break, so check those paragraphs @@ -435,8 +431,6 @@ xray para2.PageStyleName void Test::testN652364() { - load( "n652364.docx" ); - /* Related to 750255 above, column break with columns on the page however should be a column break. enum = ThisComponent.Text.createEnumeration @@ -461,8 +455,6 @@ xray para2.PageStyleName void Test::testN760764() { - load("n760764.docx"); - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration()); @@ -480,8 +472,6 @@ void Test::testN760764() void Test::testN764005() { - load("n764005.docx"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); @@ -497,8 +487,6 @@ void Test::testN764005() void Test::testSmartart() { - load("smartart.docx"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); // One groupshape in the doc @@ -523,7 +511,6 @@ void Test::testSmartart() void Test::testN764745() { - load( "n764745-alignment.docx" ); /* shape = ThisComponent.DrawPage.getByIndex(0) xray shape.AnchorType @@ -563,7 +550,6 @@ void Test::testN766477() * oRun = oRuns.nextElement * xray oRun.Bookmark.Parameters.ElementNames(0) 'Checkbox_Checked */ - load("n766477.docx"); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration()); @@ -578,8 +564,6 @@ void Test::testN766477() void Test::testN758883() { - load("n758883.docx"); - /* * The problem was that direct formatting of the paragraph was not applied * to the numbering. This is easier to test using a layout dump. @@ -637,7 +621,6 @@ void Test::testN766481() * oPara = oParas.nextElement * xray oParas.hasMoreElements ' should be false */ - load("n766481.docx"); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration()); @@ -659,7 +642,6 @@ void Test::testN766487() * oPara = oParas.nextElement * xray oPara.ParaFirstLineIndent ' -635, was 0 */ - load("n766487.docx"); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum(xParaEnumAccess->createEnumeration()); @@ -684,7 +666,6 @@ void Test::testN693238() * * xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin ' was 2000, should be 635 */ - load("n693238.docx"); uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); sal_Int32 nValue = 0; xPropertySet->getPropertyValue("LeftMargin") >>= nValue; @@ -693,7 +674,6 @@ void Test::testN693238() void Test::testNumbering1() { - load( "numbering1.docx" ); /* <w:numPr> in the paragraph itself was overriden by <w:numpr> introduced by the paragraph's <w:pStyle> enum = ThisComponent.Text.createEnumeration para = enum.NextElement @@ -740,7 +720,6 @@ note that the indexes may get off as the implementation evolves, C++ code seache void Test::testBnc773061() { - load( "bnc773061.docx" ); uno::Reference< text::XTextRange > paragraph = getParagraph( 1 ); uno::Reference< text::XTextRange > normal = getRun( paragraph, 1, "Normal " ); uno::Reference< text::XTextRange > raised = getRun( paragraph, 2, "Raised" ); @@ -755,7 +734,6 @@ void Test::testBnc773061() void Test::testAllGapsWord() { - load("all_gaps_word.docx"); BorderTest borderTest; borderTest.testTheBorders(mxComponent); } @@ -770,8 +748,6 @@ void Test::testN775906() * xray oPara.ParaFirstLineIndent ' was 0 * xray oPara.ParaLeftMargin ' was 0 */ - load("n775906.docx"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent")); CPPUNIT_ASSERT_EQUAL(sal_Int32(1905), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); } @@ -787,8 +763,6 @@ void Test::testN775899() * oPara.supportsService("com.sun.star.text.TextTable") 'was a fake paragraph * oParas.hasMoreElements 'was true */ - load("n775899.docx"); - uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); @@ -805,8 +779,6 @@ void Test::testN775899() void Test::testN777345() { // The problem was that v:imagedata inside v:rect was ignored. - load("n777345.docx"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<document::XEmbeddedObjectSupplier2> xSupplier(xDraws->getByIndex(0), uno::UNO_QUERY); @@ -826,8 +798,6 @@ void Test::testN777337() * xray oFirst.TopMargin * xray oFirst.BottomMargin */ - load("n777337.docx"); - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("First Page"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty<sal_Int32>(xPropertySet, "TopMargin")); CPPUNIT_ASSERT_EQUAL(sal_Int32(1702), getProperty<sal_Int32>(xPropertySet, "BottomMargin")); @@ -839,8 +809,6 @@ void Test::testN778836() * The problem was that the paragraph inherited margins from the numbering * and parent paragraph styles and the result was incorrect. */ - load("n778836.docx"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1270), getProperty<sal_Int32>(getParagraph(0), "ParaRightMargin")); CPPUNIT_ASSERT_EQUAL(sal_Int32(3810), getProperty<sal_Int32>(getParagraph(0), "ParaLeftMargin")); CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), getProperty<sal_Int32>(getParagraph(0), "ParaFirstLineIndent")); @@ -852,8 +820,6 @@ void Test::testN778140() * The problem was that the paragraph top/bottom margins were incorrect due * to unhandled w:doNotUseHTMLParagraphAutoSpacing. */ - load("n778140.docx"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(176), getProperty<sal_Int32>(getParagraph(0), "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(sal_Int32(176), getProperty<sal_Int32>(getParagraph(0), "ParaBottomMargin")); } @@ -864,8 +830,6 @@ void Test::testN778828() * The problem was that a page break after a continous section break caused * double page break on title page. */ - load("n778828.docx"); - uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); @@ -880,7 +844,6 @@ void Test::testInk() * * xray ThisComponent.DrawPage(0).supportsService("com.sun.star.drawing.OpenBezierShape") */ - load("ink.docx"); uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<lang::XServiceInfo> xServiceInfo(xDraws->getByIndex(0), uno::UNO_QUERY); @@ -890,7 +853,6 @@ void Test::testInk() void Test::testN779834() { // This document simply crashed the importer. - load("n779834.docx"); } void Test::testN779627() @@ -899,7 +861,6 @@ void Test::testN779627() * The problem was that the table left position was based on the tableCellMar left value * even for nested tables, while it shouldn't. */ - load("n779627.docx"); uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xTableProperties(xTables->getByIndex(0), uno::UNO_QUERY); @@ -930,7 +891,6 @@ void Test::testN779627() void Test::testFdo55187() { // 0x010d was imported as a newline. - load("fdo55187.docx"); getParagraph(1, OUString("lupčka", 7, RTL_TEXTENCODING_UTF8)); } @@ -939,7 +899,6 @@ void Test::testN780563() /* * Make sure we have the table in the fly frame created */ - load("n780563.docx"); uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount( )); @@ -952,7 +911,6 @@ void Test::testN780853() * * xray ThisComponent.TextTables.Count 'was 0 */ - load("n780853.docx"); uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); @@ -971,7 +929,6 @@ void Test::testN780843() * oStyle = ThisComponent.StyleFamilies.PageStyles.getByName(sStyle) * xray oStyle.FooterText.String ' was "hidden footer" */ - load("n780843.docx"); uno::Reference< text::XTextRange > xPara = getParagraph(3); OUString aStyleName = getProperty<OUString>(xPara, "PageStyleName"); uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(aStyleName), uno::UNO_QUERY); @@ -985,7 +942,6 @@ void Test::testShadow() * The problem was that drop shadows on inline images were not being * imported and applied. */ - load("imgshadow.docx"); uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(1), uno::UNO_QUERY); @@ -1000,8 +956,6 @@ void Test::testN782061() /* * The problem was that the character escapement in the second run was -58. */ - load("n782061.docx"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(-9), getProperty<sal_Int32>(getRun(getParagraph(1), 2), "CharEscapement")); } @@ -1010,8 +964,6 @@ void Test::testN782345() /* * The problem was that the page break was inserted before the 3rd para, instead of before the 2nd para. */ - load("n782345.docx"); - CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); } @@ -1020,7 +972,6 @@ void Test::testN779941() /* * Make sure top/bottom margins of tables are set to 0 (problem was: bottom margin set to 0.35cm) */ - load("n779941.docx"); uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xTableProperties(xTables->getByIndex(0), uno::UNO_QUERY); @@ -1038,58 +989,48 @@ void Test::testN779941() } } -void Test::testN779957() -{ - /* - * n779957.docx contains 4 tables. This test verifies their X position. - * We compare cursor position in LibreOffice to table indentation in Office, because it's - * where text starts in tables. - */ - sal_Int32 xCoordsFromOffice[] = { 2500, -1000, 0, 0 }; - sal_Int32 cellLeftMarginFromOffice[] = { 250, 100, 0, 0 }; - - load("n779957.docx"); - uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - - for (int i=0; i<4; i++) { - uno::Reference<text::XTextTable> xTable1 (xTables->getByIndex(i), uno::UNO_QUERY); - // Verify X coord - uno::Reference<view::XSelectionSupplier> xCtrl(xModel->getCurrentController(), uno::UNO_QUERY); - xCtrl->select(uno::makeAny(xTable1)); - uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xCtrl, uno::UNO_QUERY); - uno::Reference<text::XTextViewCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - awt::Point pos = xCursor->getPosition(); - CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect X coord computed from docx", - xCoordsFromOffice[i], pos.X, 1); - - // Verify left margin of 1st cell : - // * Office left margins are measured relative to the right of the border - // * LO left spacing is measured from the center of the border - uno::Reference<table::XCell> xCell = xTable1->getCellByName("A1"); - uno::Reference< beans::XPropertySet > xPropSet(xCell, uno::UNO_QUERY_THROW); - sal_Int32 aLeftMargin = -1; - xPropSet->getPropertyValue("LeftBorderDistance") >>= aLeftMargin; - uno::Any aLeftBorder = xPropSet->getPropertyValue("LeftBorder"); - table::BorderLine2 aLeftBorderLine; - aLeftBorder >>= aLeftBorderLine; - CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect left spacing computed from docx cell margin", - cellLeftMarginFromOffice[i], aLeftMargin - 0.5 * aLeftBorderLine.LineWidth, 1); - } -} - void Test::testN783638() { // The problem was that the margins of inline images were not zero. - load("n783638.docx"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "LeftMargin")); } +void Test::testFdo52208() +{ + // The problem was that the document had 2 pages instead of 1. + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); +} + +void Test::testN785767() +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY); + // Check the A1 and B1 cells, the width of both of them was the default value (10000 / 9, as there were 9 cells in the row). + CPPUNIT_ASSERT_MESSAGE("A1 must not have default width", sal_Int16(10000 / 9) != getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators")[0].Position); + CPPUNIT_ASSERT_MESSAGE("B1 must not have default width", sal_Int16(10000 / 9) != getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position); +} + +void Test::testN773061() +{ +// xray ThisComponent.TextFrames(0).LeftBorderDistance + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "LeftBorderDistance" ), sal_Int32( 0 )); + CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "TopBorderDistance" ), sal_Int32( 0 )); + CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "RightBorderDistance" ), sal_Int32( 0 )); + CPPUNIT_ASSERT_EQUAL( getProperty< sal_Int32 >( xFrame, "BottomBorderDistance" ), sal_Int32( 0 )); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/regression-test.cxx b/sw/qa/extras/regression-test.cxx deleted file mode 100644 index 910d4867c9a6..000000000000 --- a/sw/qa/extras/regression-test.cxx +++ /dev/null @@ -1,170 +0,0 @@ -/* -*- 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) 2012 Markus Mohrhard <markus.mohrhard@googlemail.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. - */ - -#include <sal/config.h> -#include <test/bootstrapfixture.hxx> -#include <unotest/macros_test.hxx> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/document/XFilter.hpp> -#include <com/sun/star/frame/XStorable.hpp> - -#include <sfx2/app.hxx> -#include <sfx2/docfilt.hxx> -#include <sfx2/docfile.hxx> -#include <sfx2/sfxmodelfactory.hxx> -#include <svl/stritem.hxx> - -#include <rtl/strbuf.hxx> -#include <osl/file.hxx> - -#include <com/sun/star/frame/XDesktop.hpp> - -#include <string> -#include <iostream> - -using namespace com::sun::star; -using namespace com::sun::star::uno; - -namespace { - -bool compareFiles( const rtl::OUString& aFileNameOne, const rtl::OUString& aFileNameTwo) -{ - rtl::OString aOFileNameOne = rtl::OUStringToOString(aFileNameOne, RTL_TEXTENCODING_UTF8); - std::ifstream aFileOne(aOFileNameOne.getStr()); - rtl::OString aOFileNameTwo = rtl::OUStringToOString(aFileNameTwo, RTL_TEXTENCODING_UTF8); - std::ifstream aFileTwo(aOFileNameTwo.getStr()); - - CPPUNIT_ASSERT_MESSAGE("files not open", aFileOne.is_open() && aFileTwo.is_open()); - - sal_Int32 nLine = 1; - while(!aFileOne.eof() && !aFileTwo.eof()) - { - std::string aLineFileOne; - std::string aLineFileTwo; - - std::getline(aFileOne, aLineFileOne); - std::getline(aFileTwo, aLineFileTwo); - - if( aLineFileOne != aLineFileTwo) - { - rtl::OStringBuffer aErrorMessage("Mismatch between reference file and exported file in line "); - aErrorMessage.append(nLine).append(".\nExpected: "); - aErrorMessage.append(aLineFileOne.c_str()).append("\nFound : ").append(aLineFileTwo.c_str()); - CPPUNIT_ASSERT_MESSAGE(aErrorMessage.getStr(), false); - } - nLine++; - } - return true; -} - -} - -class SwRegressionTest : public test::BootstrapFixture, unotest::MacrosTest -{ -public: - SwRegressionTest(); - - virtual void setUp(); - virtual void tearDown(); - - void test(); - - CPPUNIT_TEST_SUITE(SwRegressionTest); - CPPUNIT_TEST(test); - CPPUNIT_TEST_SUITE_END(); - -private: - uno::Reference<uno::XInterface> m_xWriterComponent; - ::rtl::OUString m_aBaseString; -}; - -void SwRegressionTest::test() -{ - uno::Reference< lang::XComponent > xComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/data/odt/test.odt")); - CPPUNIT_ASSERT(xComponent.is()); - - uno::Reference< frame::XStorable > xStorable(xComponent, UNO_QUERY_THROW); - CPPUNIT_ASSERT(xStorable.is()); - - uno::Sequence< beans::PropertyValue > aArgs(2); - - beans::PropertyValue aValue; - uno::Any aAny; - - aAny <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("writer_layout_dump")); - - aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); - aValue.Value = aAny; - aValue.State = beans::PropertyState_DIRECT_VALUE; - aArgs[0] = aValue; - - beans::PropertyValue aValue2; - uno::Any aAny2; - - aAny2 <<= (sal_Bool)sal_True; - - aValue2.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Overwrite")); - aValue2.Value = aAny2; - aValue2.State = beans::PropertyState_DIRECT_VALUE; - - aArgs[1] = aValue2; - - xStorable->storeToURL(getURLFromSolver("/unittest/sw/test.xml"), aArgs); -} - -SwRegressionTest::SwRegressionTest() - : m_aBaseString(RTL_CONSTASCII_USTRINGPARAM("/sw/qa/core/data")) -{ -} - -void SwRegressionTest::setUp() -{ - test::BootstrapFixture::setUp(); - - // This is a bit of a fudge, we do this to ensure that SwGlobals::ensure, - // which is a private symbol to us, gets called - m_xWriterComponent = - getMultiServiceFactory()->createInstance(rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.TextDocument"))); - CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xWriterComponent.is()); - mxDesktop = Reference<com::sun::star::frame::XDesktop>( getMultiServiceFactory()->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); - CPPUNIT_ASSERT_MESSAGE("", mxDesktop.is()); -} - -void SwRegressionTest::tearDown() -{ - uno::Reference< lang::XComponent >( m_xWriterComponent, UNO_QUERY_THROW )->dispose(); - test::BootstrapFixture::tearDown(); -} - -CPPUNIT_TEST_SUITE_REGISTRATION(SwRegressionTest); - -CPPUNIT_PLUGIN_IMPLEMENT(); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/rtfexport/data/fdo55939.odt b/sw/qa/extras/rtfexport/data/fdo55939.odt Binary files differnew file mode 100644 index 000000000000..53584035beaf --- /dev/null +++ b/sw/qa/extras/rtfexport/data/fdo55939.odt diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index af4b50cdc59f..960147140808 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -37,6 +37,8 @@ #include <unotools/tempfile.hxx> #include <vcl/svapp.hxx> +using rtl::OUStringBuffer; + class Test : public SwModelTestBase { public: @@ -66,59 +68,82 @@ public: void testMathVerticalstacks(); void testMathRuns(); void testFdo53113(); + void testFdo55939(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testZoom); - CPPUNIT_TEST(testFdo38176); - CPPUNIT_TEST(testFdo49683); - CPPUNIT_TEST(testFdo44174); - CPPUNIT_TEST(testFdo50087); - CPPUNIT_TEST(testFdo50831); - CPPUNIT_TEST(testFdo48335); - CPPUNIT_TEST(testFdo38244); - CPPUNIT_TEST(testMathAccents); - CPPUNIT_TEST(testMathEqarray); - CPPUNIT_TEST(testMathD); - CPPUNIT_TEST(testMathEscaping); - CPPUNIT_TEST(testMathLim); - CPPUNIT_TEST(testMathMatrix); - CPPUNIT_TEST(testMathBox); - CPPUNIT_TEST(testMathMso2007); - CPPUNIT_TEST(testMathNary); - CPPUNIT_TEST(testMathLimupp); - CPPUNIT_TEST(testMathStrikeh); - CPPUNIT_TEST(testMathPlaceholders); - CPPUNIT_TEST(testMathRad); - CPPUNIT_TEST(testMathSepchr); - CPPUNIT_TEST(testMathSubscripts); - CPPUNIT_TEST(testMathVerticalstacks); - CPPUNIT_TEST(testMathRuns); - CPPUNIT_TEST(testFdo53113); + CPPUNIT_TEST(run); #endif CPPUNIT_TEST_SUITE_END(); private: - void roundtrip(const OUString& rURL); + void run(); }; -void Test::roundtrip(const OUString& rFilename) +void Test::run() { - uno::Reference<lang::XComponent> xImported = loadFromDesktop(getURLFromSrc("/sw/qa/extras/rtfexport/data/") + rFilename); - uno::Reference<frame::XStorable> xStorable(xImported, uno::UNO_QUERY); - uno::Sequence<beans::PropertyValue> aArgs(1); - aArgs[0].Name = "FilterName"; - aArgs[0].Value <<= OUString("Rich Text Format"); - utl::TempFile aTempFile; - aTempFile.EnableKillingFile(); - xStorable->storeToURL(aTempFile.GetURL(), aArgs); - mxComponent = loadFromDesktop(aTempFile.GetURL()); + MethodEntry<Test> aMethods[] = { + {"zoom.rtf", &Test::testZoom}, + {"fdo38176.rtf", &Test::testFdo38176}, + {"fdo49683.rtf", &Test::testFdo49683}, + {"fdo44174.rtf", &Test::testFdo44174}, + {"fdo50087.rtf", &Test::testFdo50087}, + {"fdo50831.rtf", &Test::testFdo50831}, + {"fdo48335.odt", &Test::testFdo48335}, + {"fdo38244.rtf", &Test::testFdo38244}, + {"math-accents.rtf", &Test::testMathAccents}, + {"math-eqarray.rtf", &Test::testMathEqarray}, + {"math-d.rtf", &Test::testMathD}, + {"math-escaping.rtf", &Test::testMathEscaping}, + {"math-lim.rtf", &Test::testMathLim}, + {"math-matrix.rtf", &Test::testMathMatrix}, + {"math-mbox.rtf", &Test::testMathBox}, + {"math-mso2007.rtf", &Test::testMathMso2007}, + {"math-nary.rtf", &Test::testMathNary}, + {"math-limupp.rtf", &Test::testMathLimupp}, + {"math-strikeh.rtf", &Test::testMathStrikeh}, + {"math-placeholders.rtf", &Test::testMathPlaceholders}, + {"math-rad.rtf", &Test::testMathRad}, + {"math-sepchr.rtf", &Test::testMathSepchr}, + {"math-subscripts.rtf", &Test::testMathSubscripts}, + {"math-vertical-stacks.rtf", &Test::testMathVerticalstacks}, + {"math-runs.rtf", &Test::testMathRuns}, + {"fdo53113.odt", &Test::testFdo53113}, + {"fdo55939.odt", &Test::testFdo55939}, + }; + // Don't test the first import of these, for some reason those tests fail + const char* aBlacklist[] = { + "math-eqarray.rtf", + "math-escaping.rtf", + "math-lim.rtf", + "math-mso2007.rtf", + "math-nary.rtf", + "math-rad.rtf", + "math-vertical-stacks.rtf", + "math-runs.rtf", + }; + std::vector<const char*> vBlacklist(aBlacklist, aBlacklist + SAL_N_ELEMENTS(aBlacklist)); + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) + { + MethodEntry<Test>& rEntry = aMethods[i]; + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/rtfexport/data/") + OUString::createFromAscii(rEntry.pName)); + // If the testcase is stored in some other format, it's pointless to test. + if (OString(rEntry.pName).endsWith(".rtf") && std::find(vBlacklist.begin(), vBlacklist.end(), rEntry.pName) == vBlacklist.end()) + (this->*rEntry.pMethod)(); + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aArgs(1); + aArgs[0].Name = "FilterName"; + aArgs[0].Value <<= OUString("Rich Text Format"); + utl::TempFile aTempFile; + aTempFile.EnableKillingFile(); + xStorable->storeToURL(aTempFile.GetURL(), aArgs); + mxComponent = loadFromDesktop(aTempFile.GetURL()); + (this->*rEntry.pMethod)(); + } } void Test::testZoom() { - roundtrip("zoom.rtf"); - uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<view::XViewSettingsSupplier> xViewSettingsSupplier(xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xViewSettingsSupplier->getViewSettings()); @@ -129,14 +154,11 @@ void Test::testZoom() void Test::testFdo38176() { - roundtrip("fdo38176.rtf"); CPPUNIT_ASSERT_EQUAL(9, getLength()); } void Test::testFdo49683() { - roundtrip("fdo49683.rtf"); - uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<document::XDocumentProperties> xDocumentProperties(xDocumentPropertiesSupplier->getDocumentProperties()); uno::Sequence<OUString> aKeywords(xDocumentProperties->getKeywords()); @@ -147,8 +169,6 @@ void Test::testFdo49683() void Test::testFdo44174() { - roundtrip("fdo44174.rtf"); - uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); @@ -159,8 +179,6 @@ void Test::testFdo44174() void Test::testFdo50087() { - roundtrip("fdo50087.rtf"); - uno::Reference<document::XDocumentPropertiesSupplier> xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<document::XDocumentProperties> xDocumentProperties(xDocumentPropertiesSupplier->getDocumentProperties()); CPPUNIT_ASSERT_EQUAL(OUString("Title"), xDocumentProperties->getTitle()); @@ -170,8 +188,6 @@ void Test::testFdo50087() void Test::testFdo50831() { - roundtrip("fdo50831.rtf"); - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -194,8 +210,6 @@ void Test::testFdo48335() * oRun = oRuns.nextElement * xray oRun.TextPortionType 'was Text, should be SoftPageBreak */ - roundtrip("fdo48335.odt"); - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -212,8 +226,6 @@ void Test::testFdo48335() void Test::testFdo38244() { // See ooxmlexport's testFdo38244(). - roundtrip("fdo38244.rtf"); - // Test comment range feature. uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); @@ -237,7 +249,6 @@ void Test::testFdo38244() void Test::testMathAccents() { - roundtrip("math-accents.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("acute {a} grave {a} check {a} breve {a} circle {a} widevec {a} widetilde {a} widehat {a} dot {a} widevec {a} widevec {a} widetilde {a} underline {a}"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -245,7 +256,6 @@ void Test::testMathAccents() void Test::testMathEqarray() { - roundtrip("math-eqarray.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("y = left lbrace stack { 0, x < 0 # 1, x = 0 # {x} ^ {2} , x > 0 } right none"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -253,7 +263,6 @@ void Test::testMathEqarray() void Test::testMathD() { - roundtrip("math-d.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("left (x mline y mline z right ) left (1 right ) left [2 right ] left ldbracket 3 right rdbracket left lline 4 right rline left ldline 5 right rdline left langle 6 right rangle left langle a mline b right rangle left ({x} over {y} right )"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -261,7 +270,6 @@ void Test::testMathD() void Test::testMathEscaping() { - roundtrip("math-escaping.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("á \\{", 5, RTL_TEXTENCODING_UTF8); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -269,7 +277,6 @@ void Test::testMathEscaping() void Test::testMathLim() { - roundtrip("math-lim.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("lim from {x → 1} {x}", 22, RTL_TEXTENCODING_UTF8); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -277,7 +284,6 @@ void Test::testMathLim() void Test::testMathMatrix() { - roundtrip("math-matrix.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("left [matrix {1 # 2 ## 3 # 4} right ]"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -285,7 +291,6 @@ void Test::testMathMatrix() void Test::testMathBox() { - roundtrip("math-mbox.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("a"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -293,7 +298,6 @@ void Test::testMathBox() void Test::testMathMso2007() { - roundtrip("math-mso2007.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("A = π {r} ^ {2}", 16, RTL_TEXTENCODING_UTF8); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -334,7 +338,6 @@ void Test::testMathMso2007() void Test::testMathNary() { - roundtrip("math-nary.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("lllint from {1} to {2} {x + 1} prod from {a} {b} sum to {2} {x}"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -342,7 +345,6 @@ void Test::testMathNary() void Test::testMathLimupp() { - roundtrip("math-limupp.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL(OUString("{abcd} overbrace {4}"), aActual); @@ -352,35 +354,30 @@ void Test::testMathLimupp() void Test::testMathStrikeh() { - roundtrip("math-strikeh.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL(OUString("overstrike {abc}"), aActual); } void Test::testMathPlaceholders() { - roundtrip("math-placeholders.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL(OUString("sum from <?> to <?> <?>"), aActual); } void Test::testMathRad() { - roundtrip("math-rad.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL(OUString("sqrt {4} nroot {3} {x + 1}"), aActual); } void Test::testMathSepchr() { - roundtrip("math-sepchr.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); CPPUNIT_ASSERT_EQUAL(OUString("AxByBzC"), aActual); } void Test::testMathSubscripts() { - roundtrip("math-subscripts.rtf"); OUString aActual = getFormula(getRun(getParagraph(1), 1)); OUString aExpected("{x} ^ {y} + {e} ^ {x} {x} ^ {b} {x} rsub {b} {a} rsub {c} rsup {b} {x} lsub {2} lsup {1} {{x csup {6} csub {3}} lsub {4} lsup {5}} rsub {2} rsup {1}"); CPPUNIT_ASSERT_EQUAL(aExpected, aActual); @@ -388,7 +385,6 @@ void Test::testMathSubscripts() void Test::testMathVerticalstacks() { - roundtrip("math-vertical-stacks.rtf"); CPPUNIT_ASSERT_EQUAL(OUString("{a} over {b}"), getFormula(getRun(getParagraph(1), 1))); CPPUNIT_ASSERT_EQUAL(OUString("{a} / {b}"), getFormula(getRun(getParagraph(2), 1))); CPPUNIT_ASSERT_EQUAL(OUString("stack { a # b }"), getFormula(getRun(getParagraph(3), 1))); @@ -397,7 +393,6 @@ void Test::testMathVerticalstacks() void Test::testMathRuns() { - roundtrip("math-runs.rtf"); // was [](){}, i.e. first curly bracket had an incorrect position CPPUNIT_ASSERT_EQUAL(OUString("\\{ left [ right ] left ( right ) \\}"), getFormula(getRun(getParagraph(1), 1))); } @@ -414,7 +409,6 @@ void Test::testFdo53113() * xray oCoordinates(1).Second.Value ' 102 */ - roundtrip("fdo53113.odt"); uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xDraws->getByIndex(0), "CustomShapeGeometry"); @@ -436,6 +430,17 @@ void Test::testFdo53113() CPPUNIT_ASSERT_EQUAL(sal_Int32(102), aPairs[1].Second.Value.get<sal_Int32>()); } +void Test::testFdo55939() +{ + // The problem was that the exported RTF was invalid. + uno::Reference<text::XTextRange> xParagraph(getParagraph(1)); + getRun(xParagraph, 1, "Main text before footnote."); + // Why the tab has to be removed here? + CPPUNIT_ASSERT_EQUAL(OUString("Footnote text."), + getProperty< uno::Reference<text::XTextRange> >(getRun(xParagraph, 2), "Footnote")->getText()->getString().replaceAll("\t", "")); + getRun(xParagraph, 3, " Text after the footnote."); // However, this leading space is intentional and OK. +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/rtfimport/data/copypaste-pagestyle-paste.rtf b/sw/qa/extras/rtfimport/data/copypaste-pagestyle-paste.rtf new file mode 100644 index 000000000000..3eca5f0275f2 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/copypaste-pagestyle-paste.rtf @@ -0,0 +1,17 @@ +{\rtf\ansi +{\fonttbl +{\f0\froman\fprq2\fcharset0 Times New Roman;} +{\f1\fprq2\fcharset0 Arial;} +{\f2\fprq2\fcharset0 Arial;} +{\f3\fswiss\fprq2\fcharset0 Arial;} +{\f4\fprq2\fcharset0 Droid Sans Fallback;} +} +{\colortbl\red255\green255\blue255;} +{\*\EditEnginePoolDefaults\ltrpar\fi0\li0\ri0\fi0\li0\ri0\sb0\sa0\sl0\slmult0\ql\cf0\f0\fs13\b0\ulnone\strike0\i0\outl0\shad0\kerning0\expndtw0\f1\f1\fs13\fs13\b0\b0\i0\i0\accnone\olnone} +\deftab408 +{ +\ltrpar\f3\fs20\b0\ulnone\strike0\i0\outl0\shad0\f4\f1\fs20\fs20\b0\b0\i0\i0\accnone\olnone +{\f3\fs20\b0\i0 1} +\par\pard\plain +} +} diff --git a/sw/qa/extras/rtfimport/data/copypaste-pagestyle.rtf b/sw/qa/extras/rtfimport/data/copypaste-pagestyle.rtf new file mode 100644 index 000000000000..6ab0e635f3f8 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/copypaste-pagestyle.rtf @@ -0,0 +1,3 @@ +{\rtf1 +\paperh16838\paperw11906\margl1134\margr1134\margt1134\margb1134 +\par } diff --git a/sw/qa/extras/rtfimport/data/do-dhgt.rtf b/sw/qa/extras/rtfimport/data/do-dhgt.rtf new file mode 100644 index 000000000000..d46c6c7a1918 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/do-dhgt.rtf @@ -0,0 +1,9 @@ +{\rtf1
+{\*\do\dobxcolumn\dobypara\dodhgt251658240\dprect\dpx1275\dpy-135\dpxsize1770\dpysize855
+\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr79\dpfillbgcg129\dpfillbgcb189\dpfillpat1\dplinew60\dplinecor242\dplinecog242\dplinecob242}
+{\*\do\dobxcolumn\dobypara\dodhgt251657727\dprect\dpx2475\dpy150\dpxsize2025\dpysize1080
+\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr155\dpfillbgcg187\dpfillbgcb89\dpfillpat1\dplinew60\dplinecor242\dplinecog242\dplinecob242}
+{\*\do\dobxcolumn\dobypara\dodhgt251657215\dprect\dpx1560\dpy420\dpxsize2325\dpysize1365
+\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr192\dpfillbgcg80\dpfillbgcb77\dpfillpat1\dplinew60\dplinecor242\dplinecog242\dplinecob242}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/data/dplinehollow.rtf b/sw/qa/extras/rtfimport/data/dplinehollow.rtf new file mode 100644 index 000000000000..fdfddbf4da01 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/dplinehollow.rtf @@ -0,0 +1,7 @@ +{\rtf1\ansi\ansicpg1255\fbidis\deff0\deflang1037\deftab720 +\paperw11906\paperh16838\ltrdoc +{\*\do\dobxpage\dobypara\dodhgt8192\dptxbx\dptxbxmar0 +{\dptxbxtext\ltrpar\f8\fs50\cf1\vertalc\qc\ltrch textbox without border\par} +\dpx929\dpy340\dpxsize10556\dpysize561\dplinehollow0} +\par +} diff --git a/sw/qa/extras/rtfimport/data/dppolyline.rtf b/sw/qa/extras/rtfimport/data/dppolyline.rtf new file mode 100644 index 000000000000..0f6b8ce3d626 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/dppolyline.rtf @@ -0,0 +1,6 @@ +{\rtf1 +{\*\do\dobxpage\dobypara\dodhgt8192\dppolyline\dppolycount2\dpptx11\dppty11\dpptx11\dppty209\dpx10885\dpy8458\dpxsize22\dpysize221} +{\*\do\dobxpage\dobypara\dodhgt8192\dppolyline\dppolycount2\dpptx1258\dppty11\dpptx11\dppty11\dpx9637\dpy8657\dpxsize1269\dpysize22} +{\*\do\dobxpage\dobypara\dodhgt8192\dppolyline\dppolycount2\dpptx11\dppty11\dpptx294\dppty68\dpx9637\dpy8657\dpxsize306\dpysize79} +{\*\do\dobxpage\dobypara\dodhgt8192\dppolyline\dppolycount2\dpptx11\dppty68\dpptx294\dppty11\dpx9637\dpy8600\dpxsize306\dpysize79} +} diff --git a/sw/qa/extras/rtfimport/data/fdo48442.rtf b/sw/qa/extras/rtfimport/data/fdo48442.rtf new file mode 100644 index 000000000000..5b1a728b0b1a --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo48442.rtf @@ -0,0 +1,10 @@ +{\rtf1\adeflang1025\ansi\ansicpg1251\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1049\deflangfe1049\themelang1049\themelangfe0\themelangcs0
+\pard \ltrpar\qc \li0\ri0\sb40\sl-180\slmult0\nowidctlpar\phmrg\posx8900\posy11660\absh280\absw1460\wrapdefault\faauto\rin0\lin0\itap0
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid3501281
+}
+{\rtlch\fcs1 \ab\af0\afs18 \ltrch\fcs0 \b\f0\fs18\insrsid3501281
+\hich\af0\dbch\af31505\loch\f0 02.04.2012}
+{\rtlch\fcs1 \af1\afs24 \ltrch\fcs0 \f1\fs24\insrsid3501281
+\par }
+\pard\par
+}
diff --git a/sw/qa/extras/rtfimport/data/fdo52989.rtf b/sw/qa/extras/rtfimport/data/fdo52989.rtf new file mode 100644 index 000000000000..513f868e0c5c --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo52989.rtf @@ -0,0 +1,12 @@ +{\rtf1 +{\*\shppict +{\pict\picw1\pich2\jpegblip +89504e470d0a1a0a0000000d4948445200000010000000100802000000909168360000015049444154789c9592c14a02511486bf99714ccb322d7521140541cb +6a11448b164150fb8a363d41f4083d40cba0655044d0a637a837682fd1a6a2488b10b23475bcb77b671c491dc1cee23077e67cf7fcff39139252f29f08b59e3e +1dae8b4c45998ff501a82e070f5cbd3366733acb5c6fa609fc0872651236df0deeca7d002a6cc33d1b941a146ab49ca937e37610e0c590c5c92b67f926a07243 +b293613f8b1108a8a84aadb01575c9799edd0c895010a0ae71048e77b99b6a92e53861a387a48a6033c5d208c297a43ca8a3697601d217b010632dd9a9f34be0 +9968021698bea4c76ab72f5dd0d6216c3211e1bec2a0c5e59bce9303baa770c7bd38aca7d729692bcd4d512b53bb3b7cc2f45dd604ab098e67b499366025ce5e +96a317fd2162e2d76bbbb725bdcd80b12a603aca4581e7aade97e14ec2916ca719ed96e4c54692f5241f755de7019641eacfaff10b469261dc6a800dd30000000049454e44ae426082 +} +} +} diff --git a/sw/qa/extras/rtfimport/data/fdo56512.rtf b/sw/qa/extras/rtfimport/data/fdo56512.rtf new file mode 100644 index 000000000000..bc400cf0adfb --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo56512.rtf @@ -0,0 +1,5 @@ +{\rtf1\ansi\ansicpg1255 +{\*\do\dobxpage\dobypara\dodhgt8192\dptxbx\dptxbxmar0 +{\dptxbxtext\ltrpar\f0\fs20\cf1\vertalc\qr\rtlch \par} +\dpx929\dpy1700\dpxsize10556\dpysize221\dplinehollow0} +} diff --git a/sw/qa/extras/rtfimport/data/leftmargin-default.rtf b/sw/qa/extras/rtfimport/data/leftmargin-default.rtf new file mode 100644 index 000000000000..cf3ffd385c47 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/leftmargin-default.rtf @@ -0,0 +1,5 @@ +{\rtf1 +\margt0 +foo +\par +} diff --git a/sw/qa/extras/rtfimport/data/shptxt-pard.rtf b/sw/qa/extras/rtfimport/data/shptxt-pard.rtf new file mode 100644 index 000000000000..31c9df556bc6 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/shptxt-pard.rtf @@ -0,0 +1,19 @@ +{\rtf1 +first par +\par +{\shp +{\*\shpinst\shpleft1371\shptop6712\shpright2453\shpbottom6887\shpfhdr0\shpbxpage\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1026 +{\sp +{\sn shapeType} +{\sv 1} +} +{\shptxt \ltrpar +\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033 +\rtlch\fcs1 +\af0\afs16\alang1037 \ltrch\fcs0 \f0\fs16\insrsid11286377 \hich\af0\dbch\af31505\loch\f0 shape text +\par +} +} +} +second par\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 28517ee7dad1..5d2c183ea89d 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -28,7 +28,10 @@ #include "../swmodeltestbase.hxx" #include "bordertest.hxx" +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XImporter.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp> +#include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/graphic/GraphicType.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -54,6 +57,8 @@ #include <rtl/ustring.hxx> #include <vcl/outdev.hxx> #include <vcl/svapp.hxx> +#include <unotools/ucbstreamhelper.hxx> +#include <unotools/streamwrap.hxx> #define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) @@ -110,72 +115,116 @@ public: void testFdo49655(); void testFdo52475(); void testFdo55493(); + void testCopyPastePageStyle(); + void testShptxtPard(); + void testDoDhgt(); + void testDplinehollow(); + void testLeftmarginDefault(); + void testDppolyline(); + void testFdo56512(); + void testFdo52989(); + void testFdo48442(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testFdo45553); - CPPUNIT_TEST(testN192129); - CPPUNIT_TEST(testFdo45543); - CPPUNIT_TEST(testN695479); - CPPUNIT_TEST(testFdo42465); - CPPUNIT_TEST(testFdo45187); - CPPUNIT_TEST(testFdo46662); - CPPUNIT_TEST(testN750757); - CPPUNIT_TEST(testFdo45563); - CPPUNIT_TEST(testFdo43965); - CPPUNIT_TEST(testN751020); - CPPUNIT_TEST(testFdo47326); - CPPUNIT_TEST(testFdo47036); - CPPUNIT_TEST(testFdo46955); - CPPUNIT_TEST(testFdo45394); - CPPUNIT_TEST(testFdo48104); - CPPUNIT_TEST(testFdo47107); - CPPUNIT_TEST(testFdo45182); - CPPUNIT_TEST(testFdo44176); - CPPUNIT_TEST(testFdo39053); - CPPUNIT_TEST(testFdo48356); - CPPUNIT_TEST(testFdo48023); - CPPUNIT_TEST(testFdo48876); - CPPUNIT_TEST(testFdo48193); - CPPUNIT_TEST(testFdo44211); - CPPUNIT_TEST(testFdo48037); - CPPUNIT_TEST(testFdo47764); - CPPUNIT_TEST(testFdo38786); - CPPUNIT_TEST(testN757651); - CPPUNIT_TEST(testFdo49501); - CPPUNIT_TEST(testFdo49271); - CPPUNIT_TEST(testFdo49692); - CPPUNIT_TEST(testFdo45190); - CPPUNIT_TEST(testFdo50539); - CPPUNIT_TEST(testFdo50665); - CPPUNIT_TEST(testFdo49659); - CPPUNIT_TEST(testFdo46966); - CPPUNIT_TEST(testFdo52066); - CPPUNIT_TEST(testFdo48033); - CPPUNIT_TEST(testFdo36089); - CPPUNIT_TEST(testFdo49892); - CPPUNIT_TEST(testFdo48446); - CPPUNIT_TEST(testFdo47495); - CPPUNIT_TEST(testAllGapsWord); - CPPUNIT_TEST(testFdo52052); - CPPUNIT_TEST(testInk); - CPPUNIT_TEST(testFdo52389); - CPPUNIT_TEST(testFdo49655); - CPPUNIT_TEST(testFdo52475); - CPPUNIT_TEST(testFdo55493); + CPPUNIT_TEST(run); #endif CPPUNIT_TEST_SUITE_END(); private: - /// Load an RTF file and make the document available via mxComponent. - void load(const OUString& rURL); + void run(); /// Get page count. int getPages(); }; -void Test::load(const OUString& rFilename) -{ - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + rFilename); +void Test::run() +{ + MethodEntry<Test> aMethods[] = { + {"fdo45553.rtf", &Test::testFdo45553}, + {"n192129.rtf", &Test::testN192129}, + {"fdo45543.rtf", &Test::testFdo45543}, + {"n695479.rtf", &Test::testN695479}, + {"fdo42465.rtf", &Test::testFdo42465}, + {"fdo45187.rtf", &Test::testFdo45187}, + {"fdo46662.rtf", &Test::testFdo46662}, + {"n750757.rtf", &Test::testN750757}, + {"fdo45563.rtf", &Test::testFdo45563}, + {"fdo43965.rtf", &Test::testFdo43965}, + {"n751020.rtf", &Test::testN751020}, + {"fdo47326.rtf", &Test::testFdo47326}, + {"fdo47036.rtf", &Test::testFdo47036}, + {"fdo46955.rtf", &Test::testFdo46955}, + {"fdo45394.rtf", &Test::testFdo45394}, + {"fdo48104.rtf", &Test::testFdo48104}, + {"fdo47107.rtf", &Test::testFdo47107}, + {"fdo45182.rtf", &Test::testFdo45182}, + {"fdo44176.rtf", &Test::testFdo44176}, + {"fdo39053.rtf", &Test::testFdo39053}, + {"fdo48356.rtf", &Test::testFdo48356}, + {"fdo48023.rtf", &Test::testFdo48023}, + {"fdo48876.rtf", &Test::testFdo48876}, + {"fdo48193.rtf", &Test::testFdo48193}, + {"fdo44211.rtf", &Test::testFdo44211}, + {"fdo48037.rtf", &Test::testFdo48037}, + {"fdo47764.rtf", &Test::testFdo47764}, + {"fdo38786.rtf", &Test::testFdo38786}, + {"n757651.rtf", &Test::testN757651}, + {"fdo49501.rtf", &Test::testFdo49501}, + {"fdo49271.rtf", &Test::testFdo49271}, + {"fdo49692.rtf", &Test::testFdo49692}, + {"fdo45190.rtf", &Test::testFdo45190}, + {"fdo50539.rtf", &Test::testFdo50539}, + {"fdo50665.rtf", &Test::testFdo50665}, + {"fdo49659.rtf", &Test::testFdo49659}, + {"fdo46966.rtf", &Test::testFdo46966}, + {"fdo52066.rtf", &Test::testFdo52066}, + {"fdo48033.rtf", &Test::testFdo48033}, + {"fdo36089.rtf", &Test::testFdo36089}, + {"fdo49892.rtf", &Test::testFdo49892}, + {"fdo48446.rtf", &Test::testFdo48446}, + {"fdo47495.rtf", &Test::testFdo47495}, + {"all_gaps_word.rtf", &Test::testAllGapsWord}, + {"fdo52052.rtf", &Test::testFdo52052}, + {"ink.rtf", &Test::testInk}, + {"fdo52389.rtf", &Test::testFdo52389}, + {"fdo49655.rtf", &Test::testFdo49655}, + {"fdo52475.rtf", &Test::testFdo52475}, + {"fdo55493.rtf", &Test::testFdo55493}, + {"copypaste-pagestyle.rtf", &Test::testCopyPastePageStyle}, + {"shptxt-pard.rtf", &Test::testShptxtPard}, + {"do-dhgt.rtf", &Test::testDoDhgt}, + {"dplinehollow.rtf", &Test::testDplinehollow}, + {"leftmargin-default.rtf", &Test::testLeftmarginDefault}, + {"dppolyline.rtf", &Test::testDppolyline}, + {"fdo56512.rtf", &Test::testFdo56512}, + {"fdo52989.rtf", &Test::testFdo52989}, + {"fdo48442.rtf", &Test::testFdo48442}, + }; + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) + { + MethodEntry<Test>& rEntry = aMethods[i]; + AllSettings aSavedSettings(Application::GetSettings()); + if (OString(rEntry.pName) == "fdo48023.rtf") + { + AllSettings aSettings(aSavedSettings); + lang::Locale aLocale; + aLocale.Language = "ru"; + aSettings.SetLocale(aLocale); + Application::SetSettings(aSettings); + } + else if (OString(rEntry.pName) == "fdo44211.rtf") + { + AllSettings aSettings(aSavedSettings); + lang::Locale aLocale; + aLocale.Language = "lt"; + aSettings.SetLocale(aLocale); + Application::SetSettings(aSettings); + } + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + OUString::createFromAscii(rEntry.pName)); + if (OString(rEntry.pName) == "fdo48023.rtf" || OString(rEntry.pName) == "fdo44211.rtf") + Application::SetSettings(aSavedSettings); + (this->*rEntry.pMethod)(); + } } int Test::getPages() @@ -189,8 +238,6 @@ int Test::getPages() void Test::testFdo45553() { - load("fdo45553.rtf"); - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -212,8 +259,6 @@ void Test::testFdo45553() void Test::testN192129() { - load("n192129.rtf"); - // We expect that the result will be 16x16px. Size aExpectedSize(16, 16); MapMode aMap(MAP_100TH_MM); @@ -230,14 +275,11 @@ void Test::testN192129() void Test::testFdo45543() { - load("fdo45543.rtf"); CPPUNIT_ASSERT_EQUAL(5, getLength()); } void Test::testN695479() { - load("n695479.rtf"); - uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xIndexAccess->getByIndex(0), uno::UNO_QUERY); @@ -280,14 +322,11 @@ void Test::testN695479() void Test::testFdo42465() { - load("fdo42465.rtf"); CPPUNIT_ASSERT_EQUAL(3, getLength()); } void Test::testFdo45187() { - load("fdo45187.rtf"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); // There should be two shapes. @@ -298,8 +337,6 @@ void Test::testFdo45187() void Test::testFdo46662() { - load("fdo46662.rtf"); - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum3"), uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aProps; @@ -318,7 +355,6 @@ void Test::testFdo46662() void Test::testN750757() { - load("n750757.rtf"); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -329,7 +365,6 @@ void Test::testN750757() void Test::testFdo45563() { - load("fdo45563.rtf"); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -344,7 +379,6 @@ void Test::testFdo45563() void Test::testFdo43965() { - load("fdo43965.rtf"); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -365,7 +399,6 @@ void Test::testFdo43965() void Test::testN751020() { - load("n751020.rtf"); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -375,15 +408,12 @@ void Test::testN751020() void Test::testFdo47326() { - load("fdo47326.rtf"); // This was 15 only, as \super buffered text, then the contents of it got lost. CPPUNIT_ASSERT_EQUAL(19, getLength()); } void Test::testFdo47036() { - load("fdo47036.rtf"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); int nAtCharacter = 0; @@ -403,8 +433,6 @@ void Test::testFdo47036() void Test::testFdo46955() { - load("fdo46955.rtf"); - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -419,8 +447,6 @@ void Test::testFdo46955() void Test::testFdo45394() { - load("fdo45394.rtf"); - uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("Default"), "HeaderText"); OUString aActual = xHeaderText->getString(); // Encoding in the header was wrong. @@ -434,14 +460,11 @@ void Test::testFdo45394() void Test::testFdo48104() { - load("fdo48104.rtf"); CPPUNIT_ASSERT_EQUAL(2, getPages()); } void Test::testFdo47107() { - load("fdo47107.rtf"); - uno::Reference<container::XNameAccess> xNumberingStyles(getStyles("NumberingStyles")); // Make sure numbered and bullet legacy syntax is recognized, this used to throw a NoSuchElementException xNumberingStyles->getByName("WWNum1"); @@ -450,8 +473,6 @@ void Test::testFdo47107() void Test::testFdo45182() { - load("fdo45182.rtf"); - uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); uno::Reference<text::XTextRange> xTextRange(xFootnotes->getByIndex(0), uno::UNO_QUERY); @@ -462,8 +483,6 @@ void Test::testFdo45182() void Test::testFdo44176() { - load("fdo44176.rtf"); - uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles")); uno::Reference<beans::XPropertySet> xFirstPage(xPageStyles->getByName("First Page"), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xDefault(xPageStyles->getByName("Default"), uno::UNO_QUERY); @@ -476,8 +495,6 @@ void Test::testFdo44176() void Test::testFdo39053() { - load("fdo39053.rtf"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); int nAsCharacter = 0; @@ -490,8 +507,6 @@ void Test::testFdo39053() void Test::testFdo48356() { - load("fdo48356.rtf"); - uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -508,14 +523,6 @@ void Test::testFdo48356() void Test::testFdo48023() { - lang::Locale aLocale; - aLocale.Language = "ru"; - AllSettings aSettings(Application::GetSettings()); - AllSettings aSavedSettings(aSettings); - aSettings.SetLocale(aLocale); - Application::SetSettings(aSettings); - load("fdo48023.rtf"); - Application::SetSettings(aSavedSettings); uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); // Implicit encoding detection based on locale was missing @@ -525,7 +532,6 @@ void Test::testFdo48023() void Test::testFdo48876() { - load("fdo48876.rtf"); uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); @@ -535,20 +541,11 @@ void Test::testFdo48876() void Test::testFdo48193() { - load("fdo48193.rtf"); CPPUNIT_ASSERT_EQUAL(7, getLength()); } void Test::testFdo44211() { - lang::Locale aLocale; - aLocale.Language = "lt"; - AllSettings aSettings(Application::GetSettings()); - AllSettings aSavedSettings(aSettings); - aSettings.SetLocale(aLocale); - Application::SetSettings(aSettings); - load("fdo44211.rtf"); - Application::SetSettings(aSavedSettings); uno::Reference<text::XTextRange> xTextRange = getRun(getParagraph(1), 1); OUString aExpected("ąčę", 6, RTL_TEXTENCODING_UTF8); @@ -557,8 +554,6 @@ void Test::testFdo44211() void Test::testFdo48037() { - load("fdo48037.rtf"); - uno::Reference<util::XNumberFormatsSupplier> xNumberSupplier(mxComponent, uno::UNO_QUERY_THROW); lang::Locale aUSLocale, aFRLocale; aUSLocale.Language = "en"; @@ -577,16 +572,12 @@ void Test::testFdo48037() void Test::testFdo47764() { - load("fdo47764.rtf"); - // \cbpat with zero argument should mean the auto (-1) color, not a default color (black) CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getParagraph(1), "ParaBackColor")); } void Test::testFdo38786() { - load("fdo38786.rtf"); - uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); @@ -596,8 +587,6 @@ void Test::testFdo38786() void Test::testN757651() { - load("n757651.rtf"); - // The bug was that due to buggy layout the text expanded to two pages. if (Application::GetDefaultDevice()->IsFontAvailable(OUString("Times New Roman"))) CPPUNIT_ASSERT_EQUAL(1, getPages()); @@ -605,8 +594,6 @@ void Test::testN757651() void Test::testFdo49501() { - load("fdo49501.rtf"); - uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_True, getProperty<sal_Bool>(xStyle, "IsLandscape")); @@ -619,15 +606,11 @@ void Test::testFdo49501() void Test::testFdo49271() { - load("fdo49271.rtf"); - CPPUNIT_ASSERT_EQUAL(25.f, getProperty<float>(getParagraph(2), "CharHeight")); } void Test::testFdo49692() { - load("fdo49692.rtf"); - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aProps; @@ -644,8 +627,6 @@ void Test::testFdo49692() void Test::testFdo45190() { - load("fdo45190.rtf"); - // inherited \fi should be reset CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent")); @@ -655,15 +636,12 @@ void Test::testFdo45190() void Test::testFdo50539() { - load("fdo50539.rtf"); - // \chcbpat with zero argument should mean the auto (-1) color, not a default color (black) CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getRun(getParagraph(1), 1), "CharBackColor")); } void Test::testFdo50665() { - load("fdo50665.rtf"); // Access the second run, which is a textfield uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1), 2), uno::UNO_QUERY); // This used to be the default, as character properties were ignored. @@ -672,8 +650,6 @@ void Test::testFdo50665() void Test::testFdo49659() { - load("fdo49659.rtf"); - // Both tables were ignored: 1) was in the header, 2) was ignored due to missing empty par at the end of the doc uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); @@ -693,8 +669,6 @@ void Test::testFdo46966() * * xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin */ - load("fdo46966.rtf"); - uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(720)), getProperty<sal_Int32>(xPropertySet, "TopMargin")); } @@ -706,8 +680,6 @@ void Test::testFdo52066() * * xray ThisComponent.DrawPage(0).Size.Height */ - load("fdo52066.rtf"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<drawing::XShape> xShape(xDraws->getByIndex(0), uno::UNO_QUERY); @@ -726,7 +698,6 @@ void Test::testFdo48033() * oRun = oRuns.nextElement * xray oRun.TextPortionType ' Frame, was Text */ - load("fdo48033.rtf"); uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); @@ -739,13 +710,11 @@ void Test::testFdo48033() void Test::testFdo36089() { - load("fdo36089.rtf"); CPPUNIT_ASSERT_EQUAL(sal_Int16(-50), getProperty<sal_Int16>(getRun(getParagraph(1), 2), "CharEscapement")); } void Test::testFdo49892() { - load("fdo49892.rtf"); uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); for (int i = 0; i < xDraws->getCount(); ++i) @@ -767,29 +736,24 @@ void Test::testFdo49892() void Test::testFdo48446() { - load("fdo48446.rtf"); - OUString aExpected("Имя", 6, RTL_TEXTENCODING_UTF8); getParagraph(1, aExpected); } void Test::testFdo47495() { - load("fdo47495.rtf"); // Used to have 4 paragraphs, as a result the original bugdoc had 2 pages instead of 1. CPPUNIT_ASSERT_EQUAL(2, getParagraphs()); } void Test::testAllGapsWord() { - load("all_gaps_word.rtf"); BorderTest borderTest; borderTest.testTheBorders(mxComponent); } void Test::testFdo52052() { - load("fdo52052.rtf"); // Make sure the textframe containing the text "third" appears on the 3rd page. CPPUNIT_ASSERT_EQUAL(OUString("third"), parseDump("/root/page[3]/body/txt/anchored/fly/txt/text()")); } @@ -805,8 +769,6 @@ void Test::testInk() * msgbox oSegments(1).Count ' was 0x2000 | 10, should be 10 * msgbox oShape.Surround ' was 2, should be 1 */ - load("ink.rtf"); - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xDraws->getByIndex(0), "CustomShapeGeometry"); @@ -830,7 +792,6 @@ void Test::testInk() void Test::testFdo52389() { // The last '!' character at the end of the document was lost - load("fdo52389.rtf"); CPPUNIT_ASSERT_EQUAL(6, getLength()); } @@ -841,7 +802,6 @@ void Test::testFdo49655() * * xray ThisComponent.TextTables.Count 'was 0 */ - load("fdo49655.rtf"); uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); @@ -850,20 +810,113 @@ void Test::testFdo49655() void Test::testFdo52475() { // The problem was that \chcbpat0 resulted in no color, instead of COL_AUTO. - load("fdo52475.rtf"); CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(getRun(getParagraph(1), 3), "CharBackColor")); } void Test::testFdo55493() { // The problem was that the width of the PNG was detected as 15,24cm, instead of 3.97cm - load("fdo55493.rtf"); uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<drawing::XShape> xShape(xDraws->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(3969), xShape->getSize().Width); } +void Test::testCopyPastePageStyle() +{ + // The problem was that RTF import during copy&paste did not ignore page styles. + // Once we have more copy&paste tests, makes sense to refactor this to some helper method. + uno::Reference<uno::XInterface> xInterface(m_xSFactory->createInstance("com.sun.star.comp.Writer.RtfFilter"), uno::UNO_QUERY_THROW); + uno::Reference<document::XImporter> xImporter(xInterface, uno::UNO_QUERY_THROW); + xImporter->setTargetDocument(mxComponent); + uno::Reference<document::XFilter> xFilter(xInterface, uno::UNO_QUERY_THROW); + uno::Sequence<beans::PropertyValue> aDescriptor(2); + aDescriptor[0].Name = "InputStream"; + SvStream* pStream = utl::UcbStreamHelper::CreateStream(getURLFromSrc("/sw/qa/extras/rtfimport/data/") + "copypaste-pagestyle-paste.rtf", STREAM_WRITE); + uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStream)); + aDescriptor[0].Value <<= xStream; + aDescriptor[1].Name = "IsNewDoc"; + aDescriptor[1].Value <<= sal_False; + xFilter->filter(aDescriptor); + + uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), getProperty<sal_Int32>(xPropertySet, "Width")); // Was letter, i.e. 21590 +} + +void Test::testShptxtPard() +{ + // The problem was that \pard inside \shptxt caused loss of shape text + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<text::XText> xText(xDraws->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("shape text"), xText->getString()); +} + +void Test::testDoDhgt() +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + for (int i = 0; i < xDraws->getCount(); ++i) + { + sal_Int32 nFillColor = getProperty<sal_Int32>(xDraws->getByIndex(i), "FillColor"); + if (nFillColor == 0xc0504d) // red + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder")); + else if (nFillColor == 0x9bbb59) // green + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder")); + else if (nFillColor == 0x4f81bd) // blue + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xDraws->getByIndex(i), "ZOrder")); + } +} + +void Test::testDplinehollow() +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(drawing::LineStyle_NONE, getProperty<drawing::LineStyle>(xPropertySet, "LineStyle")); +} + +void Test::testLeftmarginDefault() +{ + // The default left/right margin was incorrect when the top margin was set to zero. + CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), getProperty<sal_Int32>(getStyles("PageStyles")->getByName("Default"), "LeftMargin")); +} + +void Test::testDppolyline() +{ + // This was completely ignored, for now, just make sure we have all 4 lines. + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), xDraws->getCount()); +} + +void Test::testFdo56512() +{ + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xTextRange(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + OUString aExpected("עוסק מורשה ", 20, RTL_TEXTENCODING_UTF8); + CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange->getString()); +} + +void Test::testFdo52989() +{ + // Same as n#192129, but for JPEG files. + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShape(xDraws->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(423), xShape->getSize().Width); +} + +void Test::testFdo48442() +{ + // The problem was that \pvmrg is the default in RTF, but not in Writer. + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<drawing::XShape> xShape(xDraws->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, getProperty<sal_Int16>(xShape, "VertOrientRelation")); // was FRAME +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/swmodeltestbase.hxx b/sw/qa/extras/swmodeltestbase.hxx index e4e2a9b7cb0d..2a7f4d68c7b2 100644 --- a/sw/qa/extras/swmodeltestbase.hxx +++ b/sw/qa/extras/swmodeltestbase.hxx @@ -226,6 +226,13 @@ protected: uno::Reference<lang::XComponent> mxComponent; xmlBufferPtr mpXmlBuffer; + + template< typename T > + struct MethodEntry + { + const char* pName; + void (T::*pMethod)(); + }; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 470028cd9635..7a205f123dcc 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -45,28 +45,39 @@ public: CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testN325936); - CPPUNIT_TEST(testFdo45724); - CPPUNIT_TEST(testFdo46020); - CPPUNIT_TEST(testFirstHeaderFooter); + CPPUNIT_TEST(run); #endif CPPUNIT_TEST_SUITE_END(); private: - void roundtrip(const OUString& rURL); + void run(); }; -void Test::roundtrip(const OUString& rFilename) +void Test::run() { - uno::Reference<lang::XComponent> xImported = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ww8export/data/") + rFilename); - uno::Reference<frame::XStorable> xStorable(xImported, uno::UNO_QUERY); - uno::Sequence<beans::PropertyValue> aArgs(1); - aArgs[0].Name = "FilterName"; - aArgs[0].Value <<= OUString("MS Word 97"); - utl::TempFile aTempFile; - aTempFile.EnableKillingFile(); - xStorable->storeToURL(aTempFile.GetURL(), aArgs); - mxComponent = loadFromDesktop(aTempFile.GetURL()); + MethodEntry<Test> aMethods[] = { + {"n325936.doc", &Test::testN325936}, + {"fdo45724.odt", &Test::testFdo45724}, + {"fdo46020.odt", &Test::testFdo46020}, + {"first-header-footer.doc", &Test::testFirstHeaderFooter}, + }; + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) + { + MethodEntry<Test>& rEntry = aMethods[i]; + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ww8export/data/") + OUString::createFromAscii(rEntry.pName)); + // If the testcase is stored in some other format, it's pointless to test. + if (OString(rEntry.pName).endsWith(".doc")) + (this->*rEntry.pMethod)(); + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aArgs(1); + aArgs[0].Name = "FilterName"; + aArgs[0].Value <<= OUString("MS Word 97"); + utl::TempFile aTempFile; + aTempFile.EnableKillingFile(); + xStorable->storeToURL(aTempFile.GetURL(), aArgs); + mxComponent = loadFromDesktop(aTempFile.GetURL()); + (this->*rEntry.pMethod)(); + } } void Test::testN325936() @@ -78,7 +89,6 @@ void Test::testN325936() * xray ThisComponent.DrawPage(0).BackColorTransparency */ - roundtrip("n325936.doc"); uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); @@ -88,19 +98,22 @@ void Test::testN325936() void Test::testFdo45724() { - roundtrip("fdo45724.odt"); + // The text and background color of the control shape was not correct. uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); uno::Reference<drawing::XControlShape> xControlShape(xDraws->getByIndex(0), uno::UNO_QUERY); - uno::Reference<form::validation::XValidatableFormComponent> xComponent(xControlShape->getControl(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(COL_WHITE, getProperty<sal_uInt32>(xComponent, "BackgroundColor")); - CPPUNIT_ASSERT_EQUAL(OUString("xxx"), xComponent->getCurrentValue().get<OUString>()); + // This should not happen (the shape was there before the fix as well), but let's avoid a segfault in some random cases... + if (xControlShape.is()) + { + uno::Reference<form::validation::XValidatableFormComponent> xComponent(xControlShape->getControl(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(COL_WHITE, getProperty<sal_uInt32>(xComponent, "BackgroundColor")); + CPPUNIT_ASSERT_EQUAL(OUString("xxx"), xComponent->getCurrentValue().get<OUString>()); + } } void Test::testFdo46020() { // The footnote in that document wasn't exported, check that it is actually exported - roundtrip("fdo46020.odt"); uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xFootnotes->getCount()); @@ -109,7 +122,6 @@ void Test::testFdo46020() void Test::testFirstHeaderFooter() { // Test import and export of a section's headerf/footerf properties. - roundtrip("first-header-footer.doc"); // The document has 6 pages. Note that we don't test if 4 or just 2 page // styles are created, the point is that layout should be correct. diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 49c3ec08c493..13fea52d7fb9 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -50,30 +50,35 @@ public: CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) - CPPUNIT_TEST(testN757910); - CPPUNIT_TEST(testN760294); - CPPUNIT_TEST(testN750255); - CPPUNIT_TEST(testN652364); - CPPUNIT_TEST(testN757118); - CPPUNIT_TEST(testN757905); - CPPUNIT_TEST(testAllGapsWord); + CPPUNIT_TEST(run); #endif CPPUNIT_TEST_SUITE_END(); private: - /// Load a WW8 file and make the document available via mxComponent. - void load(const OUString& rURL); + void run(); }; -void Test::load(const OUString& rFilename) +void Test::run() { - mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ww8import/data/") + rFilename); + MethodEntry<Test> aMethods[] = { + {"n757910.doc", &Test::testN757910}, + {"n760294.doc", &Test::testN760294}, + {"n750255.doc", &Test::testN750255}, + {"n652364.doc", &Test::testN652364}, + {"n757118.doc", &Test::testN757118}, + {"n757905.doc", &Test::testN757905}, + {"all_gaps_word.doc", &Test::testAllGapsWord}, + }; + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) + { + MethodEntry<Test>& rEntry = aMethods[i]; + mxComponent = loadFromDesktop(getURLFromSrc("/sw/qa/extras/ww8import/data/") + OUString::createFromAscii(rEntry.pName)); + (this->*rEntry.pMethod)(); + } } void Test::testN757910() { - load("n757910.doc"); - // The internal margin was larger than 0.28cm uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); @@ -90,8 +95,6 @@ void Test::testN757910() void Test::testN760294() { - load("n760294.doc"); - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xTable(xIndexAccess->getByIndex(0), uno::UNO_QUERY); @@ -103,8 +106,6 @@ void Test::testN760294() void Test::testN750255() { - load( "n750255.doc" ); - /* Column break without columns on the page is a page break, so check those paragraphs are on page 2 (page style 'Convert 1') and page 3 (page style 'Convert 2') @@ -142,8 +143,6 @@ xray para2.PageStyleName void Test::testN652364() { - load( "n652364.doc" ); - /* Related to 750255 above, column break with columns on the page however should be a column break. enum = ThisComponent.Text.createEnumeration @@ -181,7 +180,6 @@ xray para2.PageStyleName void Test::testN757118() { - load( "n757118.doc" ); /* Two pairs of horizontal rules (one absolute width, one relative width) have the same width (full page width, half page width). @@ -216,15 +214,12 @@ void Test::testN757905() // paragraph height. When in Word-compat mode, we should take the max of // the two, not just the height of the fly. - load("n757905.doc"); - OUString aHeight = parseDump("/root/page/body/txt/infos/bounds", "height"); CPPUNIT_ASSERT(sal_Int32(31) < aHeight.toInt32()); } void Test::testAllGapsWord() { - load("all_gaps_word.doc"); BorderTest borderTest; borderTest.testTheBorders(mxComponent); } diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 8fb9339ae1b6..3f2941b9766a 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -10302,7 +10302,7 @@ SfxVoidItem NavigateBack FN_NAVIGATION_BACK FastCall = FALSE, HasCoreId = FALSE, HasDialog = FALSE, - ReadOnlyDoc = FALSE, + ReadOnlyDoc = TRUE, Toggle = FALSE, Container = FALSE, RecordAbsolute = FALSE, @@ -10327,7 +10327,7 @@ SfxVoidItem NavigateForward FN_NAVIGATION_FORWARD FastCall = FALSE, HasCoreId = FALSE, HasDialog = FALSE, - ReadOnlyDoc = FALSE, + ReadOnlyDoc = TRUE, Toggle = FALSE, Container = FALSE, RecordAbsolute = FALSE, diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index 51c43b20d381..c2def731581b 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -378,7 +378,7 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum ) aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_ISCOUNTED ); aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_NUMRULE ); SwPaM aPam( *pTxtNode ); - pTxtNode->GetDoc()->ResetAttrs( aPam, sal_False, + pTxtNode->GetDoc()->ResetAttrs( aPam, false, aResetAttrsArray, false ); } diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 44373ed95c03..6b25b726e8ef 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -88,9 +88,9 @@ SwClient::~SwClient() pRegisteredIn->Remove( this ); } -sal_Bool SwClient::GetInfo( SfxPoolItem& ) const +bool SwClient::GetInfo( SfxPoolItem& ) const { - return sal_True; + return true; } // ---------- @@ -207,9 +207,9 @@ void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* p UnlockModify(); } -sal_Bool SwModify::GetInfo( SfxPoolItem& rInfo ) const +bool SwModify::GetInfo( SfxPoolItem& rInfo ) const { - sal_Bool bRet = sal_True; // means: continue with next + bool bRet = true; // means: continue with next if( pRoot ) { @@ -218,7 +218,7 @@ sal_Bool SwModify::GetInfo( SfxPoolItem& rInfo ) const SwClient* pLast = aIter.GoStart(); if( pLast ) { - while( 0 != ( bRet = pLast->GetInfo( rInfo ) ) && + while( ( bRet = pLast->GetInfo( rInfo ) ) && 0 != ( pLast = aIter++ ) ) ; } @@ -392,9 +392,9 @@ void SwDepend::SwClientNotify( const SwModify& rMod, const SfxHint& rHint ) pToTell->SwClientNotifyCall( rMod, rHint ); } -sal_Bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const +bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const { - return pToTell ? pToTell->GetInfo( rInfo ) : sal_True; + return pToTell ? pToTell->GetInfo( rInfo ) : true; } // ------------ diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index c2e4fbece23e..65b3d0022837 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -386,7 +386,7 @@ sal_Bool SwFmt::SetDerivedFrom(SwFmt *pDerFrom) return sal_True; } -sal_Bool SwFmt::SetFmtAttr( const SfxPoolItem& rAttr ) +bool SwFmt::SetFmtAttr( const SfxPoolItem& rAttr ) { if ( IsInCache() || IsInSwFntCache() ) { @@ -396,14 +396,14 @@ sal_Bool SwFmt::SetFmtAttr( const SfxPoolItem& rAttr ) // if Modify is locked then no modifications will be sent; // but call Modify always for FrmFmts - sal_Bool bRet = sal_False; + bool bRet = false; const sal_uInt16 nFmtWhich = Which(); if( IsModifyLocked() || ( !GetDepends() && (RES_GRFFMTCOLL == nFmtWhich || RES_TXTFMTCOLL == nFmtWhich ) ) ) { - if( 0 != ( bRet = (0 != aSet.Put( rAttr ))) ) + if( ( bRet = (0 != aSet.Put( rAttr ))) ) aSet.SetModifyAtAttr( this ); // #i71574# if ( nFmtWhich == RES_TXTFMTCOLL && rAttr.Which() == RES_PARATR_NUMRULE ) @@ -431,10 +431,10 @@ sal_Bool SwFmt::SetFmtAttr( const SfxPoolItem& rAttr ) return bRet; } -sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet ) +bool SwFmt::SetFmtAttr( const SfxItemSet& rSet ) { if( !rSet.Count() ) - return sal_False; + return false; if ( IsInCache() ) { @@ -445,14 +445,14 @@ sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet ) // if Modify is locked then no modifications will be sent; // but call Modify always for FrmFmts - sal_Bool bRet = sal_False; + bool bRet = false; const sal_uInt16 nFmtWhich = Which(); if ( IsModifyLocked() || ( !GetDepends() && ( RES_GRFFMTCOLL == nFmtWhich || RES_TXTFMTCOLL == nFmtWhich ) ) ) { - if( 0 != ( bRet = (0 != aSet.Put( rSet ))) ) + if( ( bRet = (0 != aSet.Put( rSet ))) ) aSet.SetModifyAtAttr( this ); // #i71574# if ( nFmtWhich == RES_TXTFMTCOLL ) @@ -478,10 +478,10 @@ sal_Bool SwFmt::SetFmtAttr( const SfxItemSet& rSet ) } // remove Hint using nWhich from array with delta -sal_Bool SwFmt::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) +bool SwFmt::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) { if( !aSet.Count() ) - return sal_False; + return false; if( !nWhich2 || nWhich2 < nWhich1 ) nWhich2 = nWhich1; // then set to 1st ID, only this item @@ -500,7 +500,7 @@ sal_Bool SwFmt::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) SwAttrSet aOld( *aSet.GetPool(), aSet.GetRanges() ), aNew( *aSet.GetPool(), aSet.GetRanges() ); - sal_Bool bRet = 0 != aSet.ClearItem_BC( nWhich1, nWhich2, &aOld, &aNew ); + bool bRet = 0 != aSet.ClearItem_BC( nWhich1, nWhich2, &aOld, &aNew ); if( bRet ) { SwAttrSetChg aChgOld( aSet, aOld ); @@ -539,10 +539,9 @@ sal_uInt16 SwFmt::ResetAllFmtAttr() return aNew.Count(); } -sal_Bool SwFmt::GetInfo( SfxPoolItem& rInfo ) const +bool SwFmt::GetInfo( SfxPoolItem& rInfo ) const { - sal_Bool bRet = SwModify::GetInfo( rInfo ); - return bRet; + return SwModify::GetInfo( rInfo ); } void SwFmt::DelDiffs( const SfxItemSet& rSet ) diff --git a/sw/source/core/bastyp/SwSmartTagMgr.cxx b/sw/source/core/bastyp/SwSmartTagMgr.cxx index b2caf307a1cb..c35b6464ba9f 100644 --- a/sw/source/core/bastyp/SwSmartTagMgr.cxx +++ b/sw/source/core/bastyp/SwSmartTagMgr.cxx @@ -62,7 +62,7 @@ void SwSmartTagMgr::modified( const lang::EventObject& rEO ) throw( RuntimeExcep SolarMutexGuard aGuard; // Installed recognizers have changed. We remove all existing smart tags: - SW_MOD()->CheckSpellChanges( sal_False, sal_True, sal_True, sal_True ); + SW_MOD()->CheckSpellChanges( false, true, true, true ); SmartTagMgr::modified( rEO ); } @@ -72,7 +72,7 @@ void SwSmartTagMgr::changesOccurred( const util::ChangesEvent& rEvent ) throw( R SolarMutexGuard aGuard; // Configuration has changed. We remove all existing smart tags: - SW_MOD()->CheckSpellChanges( sal_False, sal_True, sal_True, sal_True ); + SW_MOD()->CheckSpellChanges( false, true, true, true ); SmartTagMgr::changesOccurred( rEvent ); } diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx index 72d066e0ed10..49d196dc512e 100644 --- a/sw/source/core/bastyp/bparr.cxx +++ b/sw/source/core/bastyp/bparr.cxx @@ -128,11 +128,8 @@ void BigPtrArray::ForEach( sal_uLong nStart, sal_uLong nEnd, ElementPtr BigPtrArray::operator[]( sal_uLong idx ) const { assert(idx < nSize); // operator[]: Index out of bounds - // because this function is not <const>: - BigPtrArray* pThis = (BigPtrArray*) this; - sal_uInt16 cur = Index2Block( idx ); - BlockInfo* p = ppInf[ cur ]; - pThis->nCur = cur; + nCur = Index2Block( idx ); + BlockInfo* p = ppInf[ nCur ]; return p->pData[ idx - p->nStart ]; } @@ -337,8 +334,8 @@ void BigPtrArray::Insert( const ElementPtr& rElem, sal_uLong pos ) ++( *--pTo = *--pFrom )->nOffset; } // insert element and update indices - ((ElementPtr&)rElem)->nOffset = sal_uInt16(pos); - ((ElementPtr&)rElem)->pBlock = p; + rElem->nOffset = sal_uInt16(pos); + rElem->pBlock = p; p->pData[ pos ] = rElem; p->nEnd++; p->nElem++; @@ -437,13 +434,10 @@ void BigPtrArray::Remove( sal_uLong pos, sal_uLong n ) void BigPtrArray::Replace( sal_uLong idx, const ElementPtr& rElem) { assert(idx < nSize); // Index out of bounds - // because this function ist not <const>: - BigPtrArray* pThis = (BigPtrArray*) this; - sal_uInt16 cur = Index2Block( idx ); - BlockInfo* p = ppInf[ cur ]; - pThis->nCur = cur; - ((ElementPtr&)rElem)->nOffset = sal_uInt16(idx - p->nStart); - ((ElementPtr&)rElem)->pBlock = p; + nCur = Index2Block( idx ); + BlockInfo* p = ppInf[ nCur ]; + rElem->nOffset = sal_uInt16(idx - p->nStart); + rElem->pBlock = p; p->pData[ idx - p->nStart ] = rElem; } diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx index 805b34210ecb..7ed2c5749ba6 100644 --- a/sw/source/core/bastyp/breakit.cxx +++ b/sw/source/core/bastyp/breakit.cxx @@ -31,11 +31,13 @@ #include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/i18n/CharacterIteratorMode.hpp> +#include <com/sun/star/i18n/BreakIterator.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <editeng/unolingu.hxx> #include <editeng/scripttypeitem.hxx> #include <unicode/uchar.h> #include <unotools/localedatawrapper.hxx> +#include <comphelper/processfactory.hxx> using namespace com::sun::star; @@ -75,9 +77,7 @@ SwBreakIt::~SwBreakIt() void SwBreakIt::createBreakIterator() const { if ( m_xMSF.is() && !xBreak.is() ) - xBreak.set(m_xMSF->createInstance(::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator"))), - uno::UNO_QUERY); + xBreak.set( i18n::BreakIterator::create(comphelper::getComponentContext(m_xMSF)) ); } void SwBreakIt::_GetLocale( const LanguageType aLang ) diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 450d29070267..434069dbe116 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -260,7 +260,7 @@ SwCalc::SwCalc( SwDoc& rD ) ::com::sun::star::lang::Locale aLocale( SvxCreateLocale( eLang )); ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() ); - pCharClass = new CharClass( xMSF, aLocale ); + pCharClass = new CharClass( ::comphelper::getProcessComponentContext(), aLocale ); pLclData = new LocaleDataWrapper( xMSF, aLocale ); } @@ -421,8 +421,9 @@ SwSbxValue SwCalc::Calculate( const String& rStr ) String SwCalc::GetStrResult( const SwSbxValue& rVal, sal_Bool bRound ) { if( !rVal.IsDouble() ) - return rVal.GetString(); - + { + return rVal.GetOUString(); + } return GetStrResult( rVal.GetDouble(), bRound ); } @@ -1285,7 +1286,7 @@ SwSbxValue SwCalc::Prim() nErg = Prim(); if( SbxSTRING == nErg.GetType() ) { - nErg.PutBool( 0 == nErg.GetString().Len() ); + nErg.PutBool( nErg.GetOUString().isEmpty() ); } else if(SbxBOOL == nErg.GetType() ) { @@ -1507,7 +1508,7 @@ namespace const LocaleDataWrapper* const pLclData ) { OSL_ASSERT(pLclData); - const xub_Unicode nCurrCmdPos = rCommandPos; + const sal_Unicode nCurrCmdPos = rCommandPos; rtl_math_ConversionStatus eStatus; const sal_Unicode* pEnd; rVal = rtl_math_uStringToDouble( rCommand.GetBuffer() + rCommandPos, @@ -1612,7 +1613,7 @@ SwSbxValue::~SwSbxValue() sal_Bool SwSbxValue::GetBool() const { - return SbxSTRING == GetType() ? 0 != GetString().Len() + return SbxSTRING == GetType() ? !GetOUString().isEmpty() : 0 != SbxValue::GetBool(); } @@ -1622,7 +1623,7 @@ double SwSbxValue::GetDouble() const if( SbxSTRING == GetType() ) { xub_StrLen nStt = 0; - SwCalc::Str2Double( GetString(), nStt, nRet ); + SwCalc::Str2Double( GetOUString(), nStt, nRet ); } else if (IsBool()) { diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 71a5a8942ace..117b7e02f3ef 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -810,9 +810,9 @@ CharClass& GetAppCharClass() { if ( !pAppCharClass ) { - uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); pAppCharClass = new CharClass( - xMSF, SwBreakIt::Get()->GetLocale( (LanguageType)GetAppLanguage() )); + ::comphelper::getProcessComponentContext(), + SwBreakIt::Get()->GetLocale( (LanguageType)GetAppLanguage() )); } return *pAppCharClass; } @@ -865,9 +865,9 @@ namespace public: TransWrp() { - uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - xTransWrp.reset(new ::utl::TransliterationWrapper( xMSF, + xTransWrp.reset(new ::utl::TransliterationWrapper( xContext, i18n::TransliterationModules_IGNORE_CASE | i18n::TransliterationModules_IGNORE_KANA | i18n::TransliterationModules_IGNORE_WIDTH )); diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx index d900998f661f..4c77853f7ffe 100644 --- a/sw/source/core/bastyp/swcache.cxx +++ b/sw/source/core/bastyp/swcache.cxx @@ -37,8 +37,8 @@ void SwCache::Check() return; // consistency check - SAL_WARN_IF( pLast->GetNext(), "sw", "Last but not last." ); - SAL_WARN_IF( pRealFirst->GetPrev(), "sw", "First but not first." ); + SAL_WARN_IF( pLast->GetNext(), "sw.core", "Last but not last." ); + SAL_WARN_IF( pRealFirst->GetPrev(), "sw.core", "First but not first." ); sal_uInt16 nCnt = 0; bool bFirstFound = false; SwCacheObj *pObj = pRealFirst; @@ -49,20 +49,20 @@ void SwCache::Check() SwCacheObj *pTmp = pLast; while ( pTmp && pTmp != pObj ) pTmp = pTmp->GetPrev(); - SAL_WARN_IF( !pTmp, "sw", "Objekt not found." ); + SAL_WARN_IF( !pTmp, "sw.core", "Objekt not found." ); ++nCnt; if ( pObj == pFirst ) bFirstFound = true; if ( !pObj->GetNext() ) - SAL_WARN_IF( pObj != pLast, "sw", "Last not Found." ); + SAL_WARN_IF( pObj != pLast, "sw.core", "Last not Found." ); pObj = pObj->GetNext(); - SAL_WARN_IF( pObj == pRekursive, "sw", "Recursion in SwCache." ); + SAL_WARN_IF( pObj == pRekursive, "sw.core", "Recursion in SwCache." ); } - SAL_WARN_IF( !bFirstFound, "sw", "First not Found." ); - SAL_WARN_IF( nCnt + aFreePositions.size() != size(), "sw", "Lost Chain." ); + SAL_WARN_IF( !bFirstFound, "sw.core", "First not Found." ); + SAL_WARN_IF( nCnt + aFreePositions.size() != size(), "sw.core", "Lost Chain." ); SAL_WARN_IF( - size() == nCurMax && nCurMax != aFreePositions.size() + nCnt, "sw", + size() == nCurMax && nCurMax != aFreePositions.size() + nCnt, "sw.core", "Lost FreePositions." ); } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 2e4b70905588..0b78ab99c144 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -409,11 +409,11 @@ void SwCrsrShell::MarkListLevel( const String& sListId, nListLevel != nMarkedListLevel) { if ( sMarkedListId.Len() > 0 ) - pDoc->MarkListLevel( sMarkedListId, nMarkedListLevel, sal_False ); + pDoc->MarkListLevel( sMarkedListId, nMarkedListLevel, false ); if ( sListId.Len() > 0 ) { - pDoc->MarkListLevel( sListId, nListLevel, sal_True ); + pDoc->MarkListLevel( sListId, nListLevel, true ); } sMarkedListId = sListId; @@ -2988,7 +2988,7 @@ short SwCrsrShell::GetTextDirection( const Point* pPt ) const return pDoc->GetTextDirection( aPos, &aPt ); } -sal_Bool SwCrsrShell::IsInVerticalText( const Point* pPt ) const +bool SwCrsrShell::IsInVerticalText( const Point* pPt ) const { const short nDir = GetTextDirection( pPt ); return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir; diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 2e44aeabca9c..9c30d1182f1e 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -77,9 +77,9 @@ using namespace ::com::sun::star; /// go to next/previous point on the same level -sal_Bool SwCrsrShell::GotoNextNum() +bool SwCrsrShell::GotoNextNum() { - sal_Bool bRet = GetDoc()->GotoNextNum( *pCurCrsr->GetPoint() ); + bool bRet = GetDoc()->GotoNextNum( *pCurCrsr->GetPoint() ); if( bRet ) { SwCallLink aLk( *this ); // watch Crsr-Moves @@ -117,9 +117,9 @@ sal_Bool SwCrsrShell::GotoNextNum() } -sal_Bool SwCrsrShell::GotoPrevNum() +bool SwCrsrShell::GotoPrevNum() { - sal_Bool bRet = GetDoc()->GotoPrevNum( *pCurCrsr->GetPoint() ); + bool bRet = GetDoc()->GotoPrevNum( *pCurCrsr->GetPoint() ); if( bRet ) { SwCallLink aLk( *this ); // watch Crsr-Moves @@ -798,7 +798,7 @@ void SwCrsrShell::GotoOutline( sal_uInt16 nIdx ) } -sal_Bool SwCrsrShell::GotoOutline( const String& rName ) +bool SwCrsrShell::GotoOutline( const String& rName ) { SwCursor* pCrsr = getShellCrsr( true ); @@ -806,11 +806,11 @@ sal_Bool SwCrsrShell::GotoOutline( const String& rName ) SwCallLink aLk( *this ); // watch Crsr-Moves SwCrsrSaveState aSaveState( *pCrsr ); - sal_Bool bRet = sal_False; + bool bRet = false; if( pDoc->GotoOutline( *pCrsr->GetPoint(), rName ) && !pCrsr->IsSelOvr() ) { UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY); - bRet = sal_True; + bRet = true; } return bRet; } @@ -1644,9 +1644,9 @@ sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand, } -sal_Bool SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr ) +bool SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr ) { - sal_Bool bRet = sal_False; + bool bRet = false; if( rAttr.GetpTxtNode() ) { SwCursor* pCrsr = getShellCrsr( true ); @@ -1743,7 +1743,7 @@ sal_Bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode ) while( aEnd.GetNode().IsEndNode() && (const SwNode*)&aEnd.GetNode() != pSectNd->EndOfSectionNode() ) - aEnd++; + ++aEnd; if( aEnd.GetNode().IsEndNode() && pCNd->Len() == aPos.nContent.GetIndex() ) @@ -1797,19 +1797,13 @@ sal_Bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode ) case FILL_TAB: case FILL_SPACE: { - String sInsert; - if( aFPos.nTabCnt ) - sInsert.Fill( aFPos.nTabCnt, '\t' ); - if( aFPos.nSpaceCnt ) - { - String sSpace; - sSpace.Fill( aFPos.nSpaceCnt ); - sInsert += sSpace; - } - if( sInsert.Len() ) - { - GetDoc()->InsertString( *pCurCrsr, sInsert ); - } + rtl::OUStringBuffer sInsert; + if (aFPos.nTabCnt) + comphelper::string::padToLength(sInsert, aFPos.nTabCnt, '\t'); + if (aFPos.nSpaceCnt) + comphelper::string::padToLength(sInsert, sInsert.getLength() + aFPos.nSpaceCnt, ' '); + if (sInsert.getLength()) + GetDoc()->InsertString( *pCurCrsr, sInsert.makeStringAndClear()); } // no break - still need to set orientation case FILL_MARGIN: diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 1ef6f04f75cd..0a21e66cfffe 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -1049,7 +1049,7 @@ String SwPaM::GetTxt() const { if (! bFirst) { - aNodeIndex++; + ++aNodeIndex; } bFirst = false; diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 434bf3473387..aa2c602f8e21 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -560,7 +560,7 @@ GoNextCell: do { if( !IDX.GetNode().IsStartNode() ) break; - IDX++; + ++IDX; if( 0 == ( pCNd = IDX.GetNode().GetCntntNode() )) pCNd = IDX.GetNodes().GoNext( &IDX ); if( 0 == ( bProt = pCNd->IsProtect() )) @@ -585,7 +585,7 @@ SetNextCrsr: nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ); } // end of table, so go to next node - IDX++; + ++IDX; SwNode* pNd; if( ( pNd = &IDX.GetNode())->IsEndNode() || HasMark()) { @@ -1955,7 +1955,7 @@ sal_Bool SwCursor::GoPrevNextCell( sal_Bool bNext, sal_uInt16 nCnt ) } } - rPtIdx++; + ++rPtIdx; if( !rPtIdx.GetNode().IsCntntNode() ) GetDoc()->GetNodes().GoNextSection( &rPtIdx, sal_True, sal_False ); GetPoint()->nContent.Assign( GetCntntNode(), 0 ); @@ -1963,14 +1963,14 @@ sal_Bool SwCursor::GoPrevNextCell( sal_Bool bNext, sal_uInt16 nCnt ) return !IsInProtectTable( sal_True ); } -sal_Bool SwTableCursor::GotoTable( const String& ) +bool SwTableCursor::GotoTable( const String& ) { - return sal_False; // invalid action + return false; // invalid action } -sal_Bool SwCursor::GotoTable( const String& rName ) +bool SwCursor::GotoTable( const String& rName ) { - sal_Bool bRet = sal_False; + bool bRet = false; if ( !HasMark() ) { SwTable* pTmpTbl = SwTable::FindTable( GetDoc()->FindTblFmtByName( rName ) ); diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx index bfef7e09e58a..c9174131cea1 100644 --- a/sw/source/core/crsr/trvlreg.cxx +++ b/sw/source/core/crsr/trvlreg.cxx @@ -96,7 +96,7 @@ sal_Bool GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, do { while( aIdx.GetIndex() < nEndCount && 0 == ( pNd = aIdx.GetNode().GetSectionNode()) ) - aIdx++; + ++aIdx; if( pNd ) // is there another section node? { @@ -126,7 +126,7 @@ sal_Bool GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, sal_True, !bInReadOnly ); if( !pCNd ) { - aIdx++; + ++aIdx; continue; } rCurCrsr.GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); @@ -240,9 +240,9 @@ sal_Bool SwCrsrShell::MoveRegion( SwWhichRegion fnWhichRegion, SwPosRegion fnPos } -sal_Bool SwCursor::GotoRegion( const String& rName ) +bool SwCursor::GotoRegion( const String& rName ) { - sal_Bool bRet = sal_False; + bool bRet = false; const SwSectionFmts& rFmts = GetDoc()->GetSections(); for( sal_uInt16 n = rFmts.size(); n; ) { @@ -265,10 +265,10 @@ sal_Bool SwCursor::GotoRegion( const String& rName ) return bRet; } -sal_Bool SwCrsrShell::GotoRegion( const String& rName ) +bool SwCrsrShell::GotoRegion( const String& rName ) { SwCallLink aLk( *this ); // watch Crsr-Moves;call Link if needed - sal_Bool bRet = !pTblCrsr && pCurCrsr->GotoRegion( rName ); + bool bRet = !pTblCrsr && pCurCrsr->GotoRegion( rName ); if( bRet ) UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE | SwCrsrShell::READONLY ); diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index 07fc9a4b8ab4..c93b7a159dff 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -571,7 +571,7 @@ sal_Bool GotoNextTable( SwPaM& rCurCrsr, SwPosTable fnPosTbl, do { while( aIdx.GetIndex() < nLastNd && 0 == ( pTblNd = aIdx.GetNode().GetTableNode()) ) - aIdx++; + ++aIdx; if( pTblNd ) // any further table node? { if( fnPosTbl == fnMoveForward ) // at the beginning? @@ -706,18 +706,18 @@ sal_Bool SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) } -sal_Bool SwCrsrShell::IsTblComplex() const +bool SwCrsrShell::IsTblComplex() const { SwFrm *pFrm = GetCurrFrm( sal_False ); if ( pFrm && pFrm->IsInTab() ) return pFrm->FindTabFrm()->GetTable()->IsTblComplex(); - return sal_False; + return false; } -sal_Bool SwCrsrShell::IsTblComplexForChart() +bool SwCrsrShell::IsTblComplexForChart() { - sal_Bool bRet = sal_False; + bool bRet = false; // Here we may trigger table formatting so we better do that inside an action StartAction(); @@ -786,10 +786,10 @@ String SwCrsrShell::GetBoxNms() const } -sal_Bool SwCrsrShell::GotoTable( const String& rName ) +bool SwCrsrShell::GotoTable( const String& rName ) { SwCallLink aLk( *this ); // watch Crsr-Moves - sal_Bool bRet = !pTblCrsr && pCurCrsr->GotoTable( rName ); + bool bRet = !pTblCrsr && pCurCrsr->GotoTable( rName ); if( bRet ) { pCurCrsr->GetPtPos() = Point(); diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 5b86147a61f0..80bf708cc6a4 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -381,7 +381,7 @@ void SwAutoCompleteWord::goBack() // Returns all words matching a given prefix aMatch. If bIgnoreCurrentPos is set, the current // position within the tree is ignored and replaced by aMatch. -bool SwAutoCompleteWord::GetWordsMatching(String aMatch, std::vector<String>& aWords, sal_Bool bIgnoreCurrentPos) const +bool SwAutoCompleteWord::GetWordsMatching(String aMatch, std::vector<String>& aWords, bool bIgnoreCurrentPos) const { OUString aStringRoot = OUString( aMatch ); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index fc7b9bf9920d..bfdfca27403c 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -871,7 +871,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart ) { // move all bookmarks, TOXMarks, FlyAtCnt if( !aBkmkArr.empty() ) - _RestoreCntntIdx( this, aBkmkArr, rPos.nNode.GetIndex()-1, 0, sal_True ); + _RestoreCntntIdx( this, aBkmkArr, rPos.nNode.GetIndex()-1, 0, true ); if( IsRedlineOn() || (!IsIgnoreRedline() && !pRedlineTbl->empty() )) { @@ -1632,7 +1632,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting( // just one page is special ... if ( 1 == aVec.size() ) - aVec.insert( aVec.begin() + 1, 0 ); // insert a second empty page + aVec.insert( aVec.begin() + 1, (SwPageFrm *)0 ); // insert a second empty page else { // now extend the number of pages to fit a multiple of 4 @@ -1979,7 +1979,7 @@ void SwDoc::ReRead( SwPaM& rPam, const String& rGrfName, } } -static sal_Bool lcl_SpellAndGrammarAgain( const SwNodePtr& rpNd, void* pArgs ) +static bool lcl_SpellAndGrammarAgain( const SwNodePtr& rpNd, void* pArgs ) { SwTxtNode *pTxtNode = (SwTxtNode*)rpNd->GetTxtNode(); sal_Bool bOnlyWrong = *(sal_Bool*)pArgs; @@ -2004,10 +2004,10 @@ static sal_Bool lcl_SpellAndGrammarAgain( const SwNodePtr& rpNd, void* pArgs ) pTxtNode->GetGrammarCheck()->SetInvalid( 0, STRING_LEN ); } } - return sal_True; + return true; } -static sal_Bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* ) +static bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* ) { SwTxtNode *pTxtNode = (SwTxtNode*)rpNd->GetTxtNode(); // sal_Bool bOnlyWrong = *(sal_Bool*)pArgs; @@ -2022,18 +2022,16 @@ static sal_Bool lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* ) pTxtNode->SetSmartTags( NULL ); } } - return sal_True; + return true; } /************************************************************************* - * SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong ) - * * Re-triggers spelling in the idle handler. - * If bInvalid is passed with sal_True, the WrongLists in all nodes are invalidated + * If bInvalid is passed with true, the WrongLists in all nodes are invalidated * and the SpellInvalid flag is set on all pages. * bOnlyWrong controls whether only the areas with wrong words are checked or the whole area. ************************************************************************/ -void SwDoc::SpellItAgainSam( sal_Bool bInvalid, sal_Bool bOnlyWrong, sal_Bool bSmartTags ) +void SwDoc::SpellItAgainSam( bool bInvalid, bool bOnlyWrong, bool bSmartTags ) { std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080307 OSL_ENSURE( GetCurrentLayout(), "SpellAgain: Where's my RootFrm?" ); @@ -2086,7 +2084,7 @@ const SwFmtINetFmt* SwDoc::FindINetAttr( const String& rName ) const return 0; } -void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, sal_Bool bImpress ) +void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress ) { const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds(); if( pExtDoc && !rOutNds.empty() ) @@ -2420,12 +2418,12 @@ bool SwDoc::ConvertFieldsToText() // skip fields that are currently not in the document // e.g. fields in undo or redo array - sal_Bool bSkip = !pTxtFld || + bool bSkip = !pTxtFld || !pTxtFld->GetpTxtNode()->GetNodes().IsDocNodes(); if (!bSkip) { - sal_Bool bInHeaderFooter = IsInHeaderFooter(SwNodeIndex(*pTxtFld->GetpTxtNode())); + bool bInHeaderFooter = IsInHeaderFooter(SwNodeIndex(*pTxtFld->GetpTxtNode())); const SwFmtFld& rFmtFld = pTxtFld->GetFld(); const SwField* pField = rFmtFld.GetFld(); diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx index 8c502cccf2ff..232c0b282908 100644 --- a/sw/source/core/doc/docbasic.cxx +++ b/sw/source/core/doc/docbasic.cxx @@ -60,7 +60,7 @@ static Sequence<Any> *lcl_docbasic_convertArgs( SbxArray& rArgs ) switch( pVar->GetType() ) { case SbxSTRING: - pUnoArgs[i] <<= OUString( pVar->GetString() ); + pUnoArgs[i] <<= OUString( pVar->GetOUString() ); break; case SbxCHAR: pUnoArgs[i] <<= (sal_Int16)pVar->GetChar() ; @@ -81,7 +81,7 @@ static Sequence<Any> *lcl_docbasic_convertArgs( SbxArray& rArgs ) return pRet; } -sal_Bool SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs ) +bool SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs ) { ErrCode eErr = 0; switch( rMacro.GetScriptType() ) @@ -97,8 +97,10 @@ sal_Bool SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs if( pRet && SbxNULL < pRetValue->GetType() && SbxVOID != pRetValue->GetType() ) + { // valid value, so set it - *pRet = pRetValue->GetString(); + *pRet = pRetValue->GetOUString(); + } } break; case JAVASCRIPT: @@ -141,7 +143,7 @@ sal_Bool SwDoc::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArgs sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent, - sal_Bool bCheckPtr, SbxArray* pArgs, const Link* ) + bool bCheckPtr, SbxArray* pArgs, const Link* ) { if( !pDocShell ) // we can't do that without a DocShell! return 0; @@ -159,7 +161,7 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve if( 0 != (pItem = GetAttrPool().GetItem2( RES_TXTATR_INETFMT, n ) ) && rCallEvent.PTR.pINetAttr == pItem ) { - bCheckPtr = sal_False; // misuse as a flag + bCheckPtr = false; // misuse as a flag break; } } @@ -174,7 +176,7 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve if( bCheckPtr ) { if ( GetSpzFrmFmts()->Contains( pFmt ) ) - bCheckPtr = sal_False; // misuse as a flag + bCheckPtr = false; // misuse as a flag } if( !bCheckPtr ) pTbl = &pFmt->GetMacro().GetMacroTable(); @@ -194,7 +196,7 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve for( sal_uInt16 nPos = pIMap->GetIMapObjectCount(); nPos; ) if( pIMapObj == pIMap->GetIMapObject( --nPos )) { - bCheckPtr = sal_False; // misuse as a flag + bCheckPtr = false; // misuse as a flag break; } } diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 64b171f921c0..9704241566ca 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -485,7 +485,7 @@ namespace sw { namespace mark bool isSortingNeeded = false; for(iterator_t ppMark = m_vMarks.begin(); ppMark != m_vMarks.end(); - ppMark++) + ++ppMark) { // is on position ?? bool bChangedPos = false, bChangedOPos = false; @@ -521,7 +521,7 @@ namespace sw { namespace mark bool isSortingNeeded = false; for(iterator_t ppMark = m_vMarks.begin(); ppMark != m_vMarks.end(); - ppMark++) + ++ppMark) { // is on position ?? bool bChangedPos = false, bChangedOPos = false; @@ -566,7 +566,7 @@ namespace sw { namespace mark // reassignment is performed after the move for(iterator_t ppMark = m_vMarks.begin(); ppMark != m_vMarks.end(); - ppMark++) + ++ppMark) { // navigator marks should not be moved // TODO: Check if this might make them invalid @@ -982,10 +982,10 @@ namespace static void lcl_ChkPaM( std::vector<sal_uLong> &rSaveArr, sal_uLong nNode, xub_StrLen nCntnt, const SwPaM& rPam, _SwSaveTypeCountContent& rSave, - sal_Bool bChkSelDirection ) + bool bChkSelDirection ) { // Respect direction of selection - bool bBound1IsStart = !bChkSelDirection ? sal_True : + bool bBound1IsStart = !bChkSelDirection ? true : ( *rPam.GetPoint() < *rPam.GetMark() ? rPam.GetPoint() == &rPam.GetBound() : rPam.GetMark() == &rPam.GetBound()); @@ -1182,11 +1182,11 @@ void _DelBookmarks( pRStt->nContent = *pEndIdx; else { - sal_Bool bStt = sal_True; + bool bStt = true; SwCntntNode* pCNd = pRStt->nNode.GetNode().GetCntntNode(); if( !pCNd && 0 == ( pCNd = pDoc->GetNodes().GoNext( &pRStt->nNode )) ) { - bStt = sal_False; + bStt = false; pRStt->nNode = rStt; if( 0 == ( pCNd = pDoc->GetNodes().GoPrevious( &pRStt->nNode )) ) { @@ -1205,11 +1205,11 @@ void _DelBookmarks( pREnd->nContent = *pSttIdx; else { - sal_Bool bStt = sal_False; + bool bStt = false; SwCntntNode* pCNd = pREnd->nNode.GetNode().GetCntntNode(); if( !pCNd && 0 == ( pCNd = pDoc->GetNodes().GoPrevious( &pREnd->nNode )) ) { - bStt = sal_True; + bStt = true; pREnd->nNode = rEnd; if( 0 == ( pCNd = pDoc->GetNodes().GoNext( &pREnd->nNode )) ) { @@ -1309,7 +1309,7 @@ void _SaveCntntIdx(SwDoc* pDoc, SwFrm* pFrm = pNode->getLayoutFrm( pDoc->GetCurrentLayout() ); #if OSL_DEBUG_LEVEL > 1 - static sal_Bool bViaDoc = sal_False; + static bool bViaDoc = false; if( bViaDoc ) pFrm = NULL; #endif @@ -1403,14 +1403,14 @@ void _SaveCntntIdx(SwDoc* pDoc, if( _pStkCrsr ) do { lcl_ChkPaM( rSaveArr, nNode, nCntnt, *_pStkCrsr, - aSave, sal_False ); + aSave, false ); aSave.IncCount(); } while ( (_pStkCrsr != 0 ) && ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); FOREACHPAM_START( PCURSH->_GetCrsr() ) lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, - aSave, sal_False ); + aSave, false ); aSave.IncCount(); FOREACHPAM_END() @@ -1425,7 +1425,7 @@ void _SaveCntntIdx(SwDoc* pDoc, it != rTbl.end(); ++it) { FOREACHPAM_START( *it ) - lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, sal_False ); + lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, false ); aSave.IncCount(); FOREACHPAM_END() @@ -1434,7 +1434,7 @@ void _SaveCntntIdx(SwDoc* pDoc, if( pUnoTblCrsr ) { FOREACHPAM_START( &pUnoTblCrsr->GetSelRing() ) - lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, sal_False ); + lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, aSave, false ); aSave.IncCount(); FOREACHPAM_END() } @@ -1447,7 +1447,7 @@ void _RestoreCntntIdx(SwDoc* pDoc, std::vector<sal_uLong> &rSaveArr, sal_uLong nNode, xub_StrLen nOffset, - sal_Bool bAuto) + bool bAuto) { SwCntntNode* pCNd = pDoc->GetNodes()[ nNode ]->GetCntntNode(); const SwRedlineTbl& rRedlTbl = pDoc->GetRedlineTbl(); diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx index ae2307935674..651807565fc0 100644 --- a/sw/source/core/doc/docchart.cxx +++ b/sw/source/core/doc/docchart.cxx @@ -62,7 +62,7 @@ void SwTable::UpdateCharts() const GetFrmFmt()->GetDoc()->UpdateCharts( GetFrmFmt()->GetName() ); } -sal_Bool SwTable::IsTblComplexForChart( const String& rSelection ) const +bool SwTable::IsTblComplexForChart( const String& rSelection ) const { const SwTableBox* pSttBox, *pEndBox; if( 2 < rSelection.Len() ) @@ -132,7 +132,7 @@ void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); while( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) { - aIdx++; + ++aIdx; if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) && aName.Equals( pONd->GetChartTblName() ) && pONd->getLayoutFrm( rVSh.GetLayout() ) ) @@ -162,11 +162,9 @@ void SwDoc::UpdateCharts( const String &rName ) const void SwDoc::SetTableName( SwFrmFmt& rTblFmt, const String &rNewName ) { -// sal_Bool bStop = 1; - const String aOldName( rTblFmt.GetName() ); - sal_Bool bNameFound = 0 == rNewName.Len(); + bool bNameFound = 0 == rNewName.Len(); if( !bNameFound ) { SwFrmFmt* pFmt; @@ -175,7 +173,7 @@ void SwDoc::SetTableName( SwFrmFmt& rTblFmt, const String &rNewName ) if( !( pFmt = rTbl[ --i ] )->IsDefault() && pFmt->GetName() == rNewName && IsUsed( *pFmt ) ) { - bNameFound = sal_True; + bNameFound = true; break; } } @@ -189,7 +187,7 @@ void SwDoc::SetTableName( SwFrmFmt& rTblFmt, const String &rNewName ) SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) { - aIdx++; + ++aIdx; SwOLENode *pNd = aIdx.GetNode().GetOLENode(); if( pNd && aOldName == pNd->GetChartTblName() ) { @@ -236,7 +234,7 @@ void SwDoc::CreateChartInternalDataProviders( const SwTable *pTable ) SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); while (0 != (pStNd = aIdx.GetNode().GetStartNode())) { - aIdx++; + ++aIdx; if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) && aName.Equals( pONd->GetChartTblName() ) /* OLE node is chart? */ && 0 != (pONd->getLayoutFrm( GetCurrentLayout() )) /* chart frame is not hidden */ ) diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 02db609042aa..91bcfd335606 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -65,7 +65,7 @@ public: virtual ~CompareLine(); virtual sal_uLong GetHashValue() const = 0; - virtual sal_Bool Compare( const CompareLine& rLine ) const = 0; + virtual bool Compare( const CompareLine& rLine ) const = 0; }; class CompareData @@ -85,7 +85,7 @@ public: virtual ~CompareData(); // Are there differences? - sal_Bool HasDiffs( const CompareData& rData ) const; + bool HasDiffs( const CompareData& rData ) const; // Triggers the comparison and creation of two documents void CompareLines( CompareData& rData ); @@ -413,9 +413,9 @@ sal_uLong CompareData::ShowDiffs( const CompareData& rData ) return nCnt; } -sal_Bool CompareData::HasDiffs( const CompareData& rData ) const +bool CompareData::HasDiffs( const CompareData& rData ) const { - sal_Bool bRet = sal_False; + bool bRet = false; sal_uLong nLen1 = rData.GetLineCount(), nLen2 = GetLineCount(); sal_uLong nStt1 = 0, nStt2 = 0; @@ -423,7 +423,7 @@ sal_Bool CompareData::HasDiffs( const CompareData& rData ) const { if( rData.GetChanged( nStt1 ) || GetChanged( nStt2 ) ) { - bRet = sal_True; + bRet = true; break; } ++nStt1, ++nStt2; @@ -962,14 +962,14 @@ public: virtual ~SwCompareLine(); virtual sal_uLong GetHashValue() const; - virtual sal_Bool Compare( const CompareLine& rLine ) const; + virtual bool Compare( const CompareLine& rLine ) const; static sal_uLong GetTxtNodeHashValue( const SwTxtNode& rNd, sal_uLong nVal ); - static sal_Bool CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ); - static sal_Bool CompareTxtNd( const SwTxtNode& rDstNd, + static bool CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ); + static bool CompareTxtNd( const SwTxtNode& rDstNd, const SwTxtNode& rSrcNd ); - sal_Bool ChangesInLine( const SwCompareLine& rLine, + bool ChangesInLine( const SwCompareLine& rLine, SwPaM *& rpInsRing, SwPaM*& rpDelRing ) const; const SwNode& GetNode() const { return rNode; } @@ -1030,7 +1030,7 @@ sal_uLong SwCompareLine::GetHashValue() const { if( aIdx.GetNode().IsTxtNode() ) nRet = GetTxtNodeHashValue( (SwTxtNode&)aIdx.GetNode(), nRet ); - aIdx++; + ++aIdx; } } break; @@ -1072,7 +1072,7 @@ const SwNode& SwCompareLine::GetEndNode() const return *pNd; } -sal_Bool SwCompareLine::Compare( const CompareLine& rLine ) const +bool SwCompareLine::Compare( const CompareLine& rLine ) const { return CompareNode( rNode, ((SwCompareLine&)rLine).rNode ); } @@ -1094,18 +1094,18 @@ namespace } sRet.Append( aIdx.GetNode().GetTxtNode()->GetExpandTxt() ); } - aIdx++; + ++aIdx; } return sRet; } } -sal_Bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ) +bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ) { if( rSrcNd.GetNodeType() != rDstNd.GetNodeType() ) - return sal_False; + return false; - sal_Bool bRet = sal_False; + bool bRet = false; switch( rDstNd.GetNodeType() ) { @@ -1262,23 +1262,23 @@ sal_uLong SwCompareLine::GetTxtNodeHashValue( const SwTxtNode& rNd, sal_uLong nV return nVal; } -sal_Bool SwCompareLine::CompareTxtNd( const SwTxtNode& rDstNd, +bool SwCompareLine::CompareTxtNd( const SwTxtNode& rDstNd, const SwTxtNode& rSrcNd ) { - sal_Bool bRet = sal_False; + bool bRet = false; // Very simple at first if( rDstNd.GetTxt() == rSrcNd.GetTxt() ) { // The text is the same, but are the "special attributes" (0xFF) also the same? - bRet = sal_True; + bRet = true; } return bRet; } -sal_Bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine, +bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine, SwPaM *& rpInsRing, SwPaM*& rpDelRing ) const { - sal_Bool bRet = sal_False; + bool bRet = false; // Only compare textnodes if( ND_TEXTNODE == rNode.GetNodeType() && @@ -1358,7 +1358,7 @@ sal_Bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine, // Don't compare if there aren't enough similarities if ( nAvgLen >= 8 && nSqSum*32 < nAvgLen*nAvgLen ) { - return sal_False; + return false; } // Show the differences @@ -1412,7 +1412,7 @@ sal_Bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine, delete[] pLcsDst; delete[] pLcsSrc; - bRet = sal_True; + bRet = true; } return bRet; @@ -1566,7 +1566,7 @@ void SwCompareData::ShowDelete( const CompareData& rData, sal_uLong nStt, ((SwCompareData&)rData).rDoc.CopyWithFlyInFly( aRg, 0, aInsPos ); rDoc.SetModified(); - aSavePos++; + ++aSavePos; // #i65201#: These SwPaMs are calculated when the (old) delete-redlines are hidden, // they will be inserted when the delete-redlines are shown again. @@ -1905,7 +1905,7 @@ sal_uInt16 _SaveMergeRedlines::InsertRedline() pDoc->SetRedlineMode_intern( eOld ); pDestRedl->SetMark(); - aSaveNd++; + ++aSaveNd; pDestRedl->GetMark()->nNode = aSaveNd; pDestRedl->GetMark()->nContent.Assign( aSaveNd.GetNode().GetCntntNode(), nSaveCnt ); diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx index 7023c8d77f4c..ab861842edb5 100644 --- a/sw/source/core/doc/docdde.cxx +++ b/sw/source/core/doc/docdde.cxx @@ -58,7 +58,7 @@ namespace const ::rtl::OUString sNameLc = bCaseSensitive ? rName : GetAppCharClass().lowercase(rName); for(IDocumentMarkAccess::const_iterator_t ppMark = rMarkAccess.getMarksBegin(); ppMark != rMarkAccess.getMarksEnd(); - ppMark++) + ++ppMark) { if (::sw::mark::DdeBookmark* const pBkmk = dynamic_cast< ::sw::mark::DdeBookmark*>(ppMark->get())) { @@ -295,7 +295,7 @@ bool SwDoc::SetData( const rtl::OUString& rItem, const String& rMimeType, return pObj; } -sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam, +bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam, SwNodeRange*& rpRange ) const { // Do we actually have the Item? @@ -314,7 +314,7 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam, // but also frames (text!), tables, outlines: if( STRING_NOTFOUND != nPos ) { - sal_Bool bWeiter = sal_False; + bool bWeiter = false; String sName( sItem.Copy( 0, nPos ) ); String sCmp( sItem.Copy( nPos + 1 )); sItem = rCC.lowercase( sItem ); @@ -333,7 +333,7 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam, { rpRange = new SwNodeRange( *aPara.pTblNd, 0, *aPara.pTblNd->EndOfSectionNode(), 1 ); - return sal_True; + return true; } } else if( sCmp.EqualsAscii( pMarkToFrame ) ) @@ -346,13 +346,13 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam, !( pNd = &pIdx->GetNode())->IsNoTxtNode() ) { rpRange = new SwNodeRange( *pNd, 1, *pNd->EndOfSectionNode() ); - return sal_True; + return true; } } else if( sCmp.EqualsAscii( pMarkToRegion ) ) { sItem = sName; // Is being dealt with further down! - bWeiter = sal_True; + bWeiter = true; } else if( sCmp.EqualsAscii( pMarkToOutline ) ) { @@ -381,12 +381,12 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam, rpRange->aEnd = *rOutlNds[ nTmpPos ]; else rpRange->aEnd = GetNodes().GetEndOfContent(); - return sal_True; + return true; } } if( !bWeiter ) - return sal_False; + return false; } // search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive @@ -417,7 +417,7 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam, { rpRange = new SwNodeRange( *aPara.pSectNd, 1, *aPara.pSectNd->EndOfSectionNode() ); - return sal_True; + return true; } } @@ -425,7 +425,7 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam, break; bCaseSensitive = false; } - return sal_False; + return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 6319d4248d89..fe1e12a6dbc3 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -130,7 +130,7 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId, |*************************************************************************/ static void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest, - const sal_Bool bPage = sal_True ) + const bool bPage = true ) { // We should actually use ItemSet's Intersect here, but that doesn't work // correctly if we have different WhichRanges. @@ -194,7 +194,7 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, SwFmtHeader aHead( MakeLayoutFmt( RND_STD_HEADERL, 0 ) ); rDescFrmFmt.SetFmtAttr( aHead ); // take over additional attributes (margins, borders ...) - ::lcl_DescSetAttr( *rHead.GetHeaderFmt(), *aHead.GetHeaderFmt(), sal_False); + ::lcl_DescSetAttr( *rHead.GetHeaderFmt(), *aHead.GetHeaderFmt(), false); } else { @@ -210,7 +210,7 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, { SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? "Left header" : "First header"), GetDfltFrmFmt() ); - ::lcl_DescSetAttr( *pRight, *pFmt, sal_False ); + ::lcl_DescSetAttr( *pRight, *pFmt, false ); // The section which the right header attribute is pointing // is copied, and the Index to the StartNode is set to // the left or first header attribute. @@ -226,7 +226,7 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, } else ::lcl_DescSetAttr( *pRight, - *(SwFrmFmt*)rFmtHead.GetHeaderFmt(), sal_False ); + *(SwFrmFmt*)rFmtHead.GetHeaderFmt(), false ); } } @@ -249,7 +249,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, SwFmtFooter aFoot( MakeLayoutFmt( RND_STD_FOOTER, 0 ) ); rDescFrmFmt.SetFmtAttr( aFoot ); // Take over additional attributes (margins, borders ...). - ::lcl_DescSetAttr( *rFoot.GetFooterFmt(), *aFoot.GetFooterFmt(), sal_False); + ::lcl_DescSetAttr( *rFoot.GetFooterFmt(), *aFoot.GetFooterFmt(), false); } else { @@ -265,7 +265,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, { SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? "Left footer" : "First footer"), GetDfltFrmFmt() ); - ::lcl_DescSetAttr( *pRight, *pFmt, sal_False ); + ::lcl_DescSetAttr( *pRight, *pFmt, false ); // The section to which the right footer attribute is pointing // is copied, and the Index to the StartNode is set to // the left footer attribute. @@ -281,7 +281,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, } else ::lcl_DescSetAttr( *pRight, - *(SwFrmFmt*)rFmtFoot.GetFooterFmt(), sal_False ); + *(SwFrmFmt*)rFmtFoot.GetFooterFmt(), false ); } } } @@ -379,22 +379,22 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) pDesc->SetRegisterFmtColl( rChged.GetRegisterFmtColl() ); // If UseOn or the Follow change, the paragraphs need to know about it. - sal_Bool bUseOn = sal_False; - sal_Bool bFollow = sal_False; + bool bUseOn = false; + bool bFollow = false; if ( pDesc->GetUseOn() != rChged.GetUseOn() ) { pDesc->SetUseOn( rChged.GetUseOn() ); - bUseOn = sal_True; + bUseOn = true; } if ( pDesc->GetFollow() != rChged.GetFollow() ) { if ( rChged.GetFollow() == &rChged ) { if ( pDesc->GetFollow() != pDesc ) { pDesc->SetFollow( pDesc ); - bFollow = sal_True; + bFollow = true; } } else { pDesc->SetFollow( rChged.pFollow ); - bFollow = sal_True; + bFollow = true; } } @@ -505,7 +505,7 @@ void SwDoc::BroadcastStyleOperation(String rName, SfxStyleFamily eFamily, } } -void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast ) +void SwDoc::DelPageDesc( sal_uInt16 i, bool bBroadcast ) { OSL_ENSURE( i < aPageDescs.size(), "PageDescs is out of range." ); OSL_ENSURE( i != 0, "You cannot delete the default Pagedesc."); @@ -540,7 +540,7 @@ void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast ) |*************************************************************************/ sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy, - sal_Bool bRegardLanguage, sal_Bool bBroadcast) + bool bRegardLanguage, bool bBroadcast) { SwPageDesc *pNew; if( pCpy ) @@ -613,12 +613,12 @@ void SwDoc::PrtDataChanged() 0 != getPrinter( sal_False ), "PrtDataChanged will be called recursively!" ); SwRootFrm* pTmpRoot = GetCurrentLayout(); SwWait *pWait = 0; - sal_Bool bEndAction = sal_False; + bool bEndAction = false; if( GetDocShell() ) GetDocShell()->UpdateFontList(); - sal_Bool bDraw = sal_True; + bool bDraw = true; if ( pTmpRoot ) { ViewShell *pSh = GetCurrentViewShell(); @@ -630,9 +630,9 @@ void SwDoc::PrtDataChanged() pWait = new SwWait( *GetDocShell(), sal_True ); pTmpRoot->StartAllAction(); - bEndAction = sal_True; + bEndAction = true; - bDraw = sal_False; + bDraw = false; if( pDrawModel ) { pDrawModel->SetAddExtLeading( get(IDocumentSettingAccess::ADD_EXT_LEADING) ); @@ -735,7 +735,7 @@ void SwDoc::PrtOLENotify( sal_Bool bAll ) // aName = ???? } - sal_Bool bFound = sal_False; + bool bFound = false; for ( sal_uInt16 j = 0; j < pGlobalOLEExcludeList->size() && !bFound; ++j ) @@ -796,16 +796,16 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, ) return 0; } -sal_Bool SwDoc::FindPageDesc( const String & rName, sal_uInt16 * pFound) +bool SwDoc::FindPageDesc( const String & rName, sal_uInt16 * pFound) { - sal_Bool bResult = sal_False; + bool bResult = false; sal_uInt16 nI; for (nI = 0; nI < aPageDescs.size(); nI++) { if (aPageDescs[nI]->GetName() == rName) { *pFound = nI; - bResult = sal_True; + bResult = true; break; } } @@ -825,7 +825,7 @@ SwPageDesc * SwDoc::GetPageDesc( const String & rName ) return aResult; } -void SwDoc::DelPageDesc( const String & rName, sal_Bool bBroadcast ) +void SwDoc::DelPageDesc( const String & rName, bool bBroadcast ) { sal_uInt16 nI; diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 25b81e071626..7898e59e8af9 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -210,7 +210,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView ) const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList(); SwDrawFrmFmt *pFmt = 0L; SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj(); - sal_Bool bNoGroup = ( 0 == pObj->GetUpGroup() ); + bool bNoGroup = ( 0 == pObj->GetUpGroup() ); SwDrawContact* pNewContact = 0; if( bNoGroup ) { @@ -399,15 +399,15 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView ) |* |*************************************************************************/ -sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView ) +bool SwDoc::DeleteSelection( SwDrawView& rDrawView ) { - sal_Bool bCallBase = sal_False; + bool bCallBase = false; const SdrMarkList &rMrkList = rDrawView.GetMarkedObjectList(); if( rMrkList.GetMarkCount() ) { GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL); sal_uInt16 i; - sal_Bool bDelMarked = sal_True; + bool bDelMarked = true; if( 1 == rMrkList.GetMarkCount() ) { @@ -419,7 +419,7 @@ sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView ) if( pFrmFmt ) { DelLayoutFmt( pFrmFmt ); - bDelMarked = sal_False; + bDelMarked = false; } } } @@ -484,7 +484,7 @@ sal_Bool SwDoc::DeleteSelection( SwDrawView& rDrawView ) GetIDocumentUndoRedo().AppendUndo( pUndo ); } } - bCallBase = sal_True; + bCallBase = true; } SetModified(); diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index ad533694f48c..9bd01962f210 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -178,7 +178,7 @@ static void lcl_SkipAttr( const SwTxtNode *pNode, SwIndex &rIdx, xub_StrLen &rSt { // skip all special attributes do { - rIdx++; + ++rIdx; } while( (rStart = rIdx.GetIndex()) < pNode->GetTxt().Len() && !lcl_MayOverwrite(pNode, rStart) ); } @@ -229,7 +229,7 @@ void _SaveFlyInRange( const SwNodeRange& rRg, _SaveFlyArr& rArr ) rRg.aStart <= pAPos->nNode && pAPos->nNode < rRg.aEnd ) { _SaveFly aSave( pAPos->nNode.GetIndex() - rRg.aStart.GetIndex(), - pFmt, sal_False ); + pFmt, false ); rArr.push_back( aSave ); pFmt->DelFrms(); rFmts.erase( rFmts.begin() + n-- ); @@ -259,7 +259,7 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos, for( sal_uInt16 n = 0; n < rFmts.size(); ++n ) { - sal_Bool bInsPos = sal_False; + bool bInsPos = false; pFmt = (SwFrmFmt*)rFmts[n]; pAnchor = &pFmt->GetAnchor(); const SwPosition* pAPos = pAnchor->GetCntntAnchor(); @@ -304,7 +304,7 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos, void DelFlyInRange( const SwNodeIndex& rMkNdIdx, const SwNodeIndex& rPtNdIdx ) { - const sal_Bool bDelFwrd = rMkNdIdx.GetIndex() <= rPtNdIdx.GetIndex(); + const bool bDelFwrd = rMkNdIdx.GetIndex() <= rPtNdIdx.GetIndex(); SwDoc* pDoc = rMkNdIdx.GetNode().GetDoc(); SwFrmFmts& rTbl = *pDoc->GetSpzFrmFmts(); @@ -688,7 +688,7 @@ _SaveRedlEndPosForRestore::~_SaveRedlEndPosForRestore() void _SaveRedlEndPosForRestore::_Restore() { - (*pSavIdx)++; + ++(*pSavIdx); SwCntntNode* pNode = pSavIdx->GetNode().GetCntntNode(); // If there's no content node at the remembered position, we will not restore the old position // This may happen if a table (or section?) will be inserted. @@ -760,8 +760,8 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr ) sal_Unicode c; String aStr; - sal_Bool bOldExpFlg = pNode->IsIgnoreDontExpand(); - pNode->SetIgnoreDontExpand( sal_True ); + bool bOldExpFlg = pNode->IsIgnoreDontExpand(); + pNode->SetIgnoreDontExpand( true ); for( xub_StrLen nCnt = 0; nCnt < rStr.Len(); ++nCnt ) { @@ -796,13 +796,13 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr ) { // start behind the characters (to fix the attributes!) if( nStart < pNode->GetTxt().Len() ) - rIdx++; + ++rIdx; pNode->InsertText( rtl::OUString(c), rIdx, INS_EMPTYEXPAND ); if( nStart+1 < rIdx.GetIndex() ) { rIdx = nStart; pNode->EraseText( rIdx, 1 ); - rIdx++; + ++rIdx; } } } @@ -845,7 +845,7 @@ bool SwDoc::MoveAndJoin( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags ) if( bRet && !bOneNode ) { if( bJoinTxt ) - aIdx++; + ++aIdx; SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode(); SwNodeIndex aNxtIdx( aIdx ); if( pTxtNd && pTxtNd->CanJoinNext( &aNxtIdx ) ) @@ -939,7 +939,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags ) pTNd = static_cast<SwTxtNode*>(pTNd->SplitCntntNode( rPos )); if( !aBkmkArr.empty() ) - _RestoreCntntIdx( this, aBkmkArr, rPos.nNode.GetIndex()-1, 0, sal_True ); + _RestoreCntntIdx( this, aBkmkArr, rPos.nNode.GetIndex()-1, 0, true ); // correct the PaM! if( rPos.nNode == rPaM.GetMark()->nNode ) @@ -1170,9 +1170,9 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos, sal_Bool bNoDelFrms = 0 != (DOC_NO_DELFRMS & eMvFlags); if( GetNodes()._MoveNodes( rRange, GetNodes(), rPos, !bNoDelFrms ) ) { - aIdx++; // again back to old position + ++aIdx; // again back to old position if( pSaveInsPos ) - (*pSaveInsPos)++; + ++(*pSaveInsPos); } else { @@ -1733,7 +1733,7 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam) if( bOneNd ) // that's it break; - aSttIdx++; + ++aSttIdx; } else { @@ -1873,7 +1873,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, if( nCurrNd <= nEndNd ) { SwCntntFrm* pCntFrm; - sal_Bool bGoOn = sal_True; + bool bGoOn = true; while( bGoOn ) { SwNode* pNd = GetNodes()[ nCurrNd ]; @@ -2100,7 +2100,7 @@ void SwHyphArgs::SetPam( SwPaM *pPam ) const } // Returns sal_True if we can proceed. -static sal_Bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs ) +static bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs ) { // Hyphenate returns true if there is a hyphenation point and sets pPam SwTxtNode *pNode = rpNd->GetTxtNode(); @@ -2129,12 +2129,12 @@ static sal_Bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs ) if( pNode->Hyphenate( *pHyphArgs ) ) { pHyphArgs->SetNode( rpNd ); - return sal_False; + return false; } } } pHyphArgs->NextNode(); - return sal_True; + return true; } uno::Reference< XHyphenatedWord > SwDoc::Hyphenate( @@ -2154,9 +2154,9 @@ uno::Reference< XHyphenatedWord > SwDoc::Hyphenate( return aHyphArg.GetHyphWord(); // will be set by lcl_HyphenateNode } -static sal_Bool lcl_GetTokenToParaBreak( String& rStr, String& rRet, sal_Bool bRegExpRplc ) +static bool lcl_GetTokenToParaBreak( String& rStr, String& rRet, bool bRegExpRplc ) { - sal_Bool bRet = sal_False; + bool bRet = false; if( bRegExpRplc ) { xub_StrLen nPos = 0; @@ -2173,7 +2173,7 @@ static sal_Bool lcl_GetTokenToParaBreak( String& rStr, String& rRet, sal_Bool bR { rRet = rStr.Copy( 0, nPos ); rStr.Erase( 0, nPos + sPara.getLength() ); - bRet = sal_True; + bRet = true; break; } } @@ -2344,7 +2344,7 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr, SwNodeIndex aPtNd( aDelPam.GetPoint()->nNode, -1 ); xub_StrLen nPtCnt = aDelPam.GetPoint()->nContent.GetIndex(); - sal_Bool bFirst = sal_True; + bool bFirst = true; String sIns; while ( lcl_GetTokenToParaBreak( sRepl, sIns, bRegExReplace ) ) { @@ -2356,11 +2356,11 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr, SplitNode( *aDelPam.GetPoint(), false ); - aMkNd++; + ++aMkNd; aDelPam.GetMark()->nNode = aMkNd; aDelPam.GetMark()->nContent.Assign( aMkNd.GetNode().GetCntntNode(), nMkCnt ); - bFirst = sal_False; + bFirst = false; } else SplitNode( *aDelPam.GetPoint(), false ); @@ -2373,7 +2373,7 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const String& rStr, SwPaM aTmpRange( *aDelPam.GetPoint() ); aTmpRange.SetMark(); - aPtNd++; + ++aPtNd; aDelPam.GetPoint()->nNode = aPtNd; aDelPam.GetPoint()->nContent.Assign( aPtNd.GetNode().GetCntntNode(), nPtCnt); @@ -2441,7 +2441,7 @@ SetRedlineMode( eOld ); nEnd = bOneNode ? pEnd->nContent.GetIndex() : pTxtNd->GetTxt().Len(); - sal_Bool bFirst = sal_True; + bool bFirst = true; String sIns; while ( lcl_GetTokenToParaBreak( sRepl, sIns, bRegExReplace ) ) { @@ -2454,7 +2454,7 @@ SetRedlineMode( eOld ); pTxtNd->ReplaceText( pStt->nContent, nEnd - nStt, sIns ); } SplitNode( *pStt, false); - bFirst = sal_False; + bFirst = false; } if( bFirst || sIns.Len() ) @@ -2471,7 +2471,7 @@ SetRedlineMode( eOld ); *rPam.GetMark() = *aDelPam.GetMark(); - aPtNd++; + ++aPtNd; rPam.GetMark()->nNode = aPtNd; rPam.GetMark()->nContent.Assign( aPtNd.GetNode().GetCntntNode(), nPtCnt ); @@ -2683,12 +2683,12 @@ void SwDoc::TransliterateText( SwNodeIndex aIdx( pStt->nNode ); if( nSttCnt ) { - aIdx++; + ++aIdx; if( pTNd ) pTNd->TransliterateText( rTrans, nSttCnt, pTNd->GetTxt().Len(), pUndo ); } - for( ; aIdx.GetIndex() < nEndNd; aIdx++ ) + for( ; aIdx.GetIndex() < nEndNd; ++aIdx ) { if( 0 != ( pTNd = aIdx.GetNode().GetTxtNode() )) pTNd->TransliterateText( rTrans, 0, pTNd->GetTxt().Len(), pUndo ); @@ -2759,12 +2759,12 @@ void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const SwNodeIndex aIdx( pStt->nNode ); if( nSttCnt ) { - aIdx++; + ++aIdx; if( pTNd ) pTNd->CountWords( rStat, nSttCnt, pTNd->GetTxt().Len() ); } - for( ; aIdx.GetIndex() < nEndNd; aIdx++ ) + for( ; aIdx.GetIndex() < nEndNd; ++aIdx ) if( 0 != ( pTNd = aIdx.GetNode().GetTxtNode() )) pTNd->CountWords( rStat, 0, pTNd->GetTxt().Len() ); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 2e277a50f70d..18953ad12e4f 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -70,7 +70,7 @@ using namespace ::com::sun::star::uno; -extern sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, +extern bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, const SwTxtNode& rBehindNd, sal_uInt16 nSttPos ); /*-------------------------------------------------------------------- @@ -1227,8 +1227,8 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) if( IsExpFldsLocked() || IsInReading() ) return; - sal_Bool bOldInUpdateFlds = pUpdtFlds->IsInUpdateFlds(); - pUpdtFlds->SetInUpdateFlds( sal_True ); + bool bOldInUpdateFlds = pUpdtFlds->IsInUpdateFlds(); + pUpdtFlds->SetInUpdateFlds( true ); pUpdtFlds->MakeFldList( *this, sal_True, GETFLD_ALL ); mbNewFldLst = sal_False; @@ -1239,7 +1239,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) UpdateRefFlds(NULL); pUpdtFlds->SetInUpdateFlds( bOldInUpdateFlds ); - pUpdtFlds->SetFieldsDirty( sal_False ); + pUpdtFlds->SetFieldsDirty( false ); return ; } @@ -1538,7 +1538,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) UpdateRefFlds(NULL); pUpdtFlds->SetInUpdateFlds( bOldInUpdateFlds ); - pUpdtFlds->SetFieldsDirty( sal_False ); + pUpdtFlds->SetFieldsDirty( false ); } void SwDoc::UpdateDBNumFlds( SwDBNameInfField& rDBFld, SwCalc& rCalc ) @@ -1886,7 +1886,7 @@ void SwDoc::ChangeDBFields( const std::vector<String>& rOldNames, continue; SwField* pFld = pFmtFld->GetFld(); - sal_Bool bExpand = sal_False; + bool bExpand = false; switch( pFld->GetTyp()->Which() ) { @@ -1904,7 +1904,7 @@ void SwDoc::ChangeDBFields( const std::vector<String>& rOldNames, ((SwDBField*)pFld)->ClearInitialized(); ((SwDBField*)pFld)->InitContent(); - bExpand = sal_True; + bExpand = true; } break; @@ -1914,7 +1914,7 @@ void SwDoc::ChangeDBFields( const std::vector<String>& rOldNames, lcl_DBDataToString(((SwDBNameInfField*)pFld)->GetRealDBData()))) { ((SwDBNameInfField*)pFld)->SetDBData(aNewDBData); - bExpand = sal_True; + bExpand = true; } break; @@ -1924,7 +1924,7 @@ void SwDoc::ChangeDBFields( const std::vector<String>& rOldNames, lcl_DBDataToString(((SwDBNameInfField*)pFld)->GetRealDBData()))) { ((SwDBNameInfField*)pFld)->SetDBData(aNewDBData); - bExpand = sal_True; + bExpand = true; } // no break; case RES_HIDDENTXTFLD: @@ -1932,7 +1932,7 @@ void SwDoc::ChangeDBFields( const std::vector<String>& rOldNames, sFormel = pFld->GetPar1(); ReplaceUsedDBs( rOldNames, rNewName, sFormel); pFld->SetPar1( sFormel ); - bExpand = sal_True; + bExpand = true; break; case RES_SETEXPFLD: @@ -1941,7 +1941,7 @@ void SwDoc::ChangeDBFields( const std::vector<String>& rOldNames, sFormel = pFld->GetFormula(); ReplaceUsedDBs( rOldNames, rNewName, sFormel); pFld->SetPar2( sFormel ); - bExpand = sal_True; + bExpand = true; break; } @@ -1991,19 +1991,19 @@ void SwDoc::ReplaceUsedDBs( const std::vector<String>& rUsedDBNames, } } -sal_Bool SwDoc::IsNameInArray( const std::vector<String>& rArr, const String& rName ) +bool SwDoc::IsNameInArray( const std::vector<String>& rArr, const String& rName ) { #ifdef UNX for( sal_uInt16 i = 0; i < rArr.size(); ++i ) if( rName == rArr[ i ] ) - return sal_True; + return true; #else const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore(); for( sal_uInt16 i = 0; i < rArr.size(); ++i ) if( rSCmp.isEqual( rName, rArr[ i] )) - return sal_True; + return true; #endif - return sal_False; + return false; } void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) @@ -2039,13 +2039,13 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) { if( pFld && pFld->GetTxtFld() ) { - sal_Bool bChgd = sal_False; + bool bChgd = false; switch( aTypes[ nStt ] ) { case RES_DOCINFOFLD: if( ((SwDocInfoField*)pFld->GetFld())->IsFixed() ) { - bChgd = sal_True; + bChgd = true; SwDocInfoField* pDocInfFld = (SwDocInfoField*)pFld->GetFld(); pDocInfFld->SetExpansion( ((SwDocInfoFieldType*) pDocInfFld->GetTyp())->Expand( @@ -2059,7 +2059,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) case RES_AUTHORFLD: if( ((SwAuthorField*)pFld->GetFld())->IsFixed() ) { - bChgd = sal_True; + bChgd = true; SwAuthorField* pAuthorFld = (SwAuthorField*)pFld->GetFld(); pAuthorFld->SetExpansion( ((SwAuthorFieldType*) pAuthorFld->GetTyp())->Expand( @@ -2070,7 +2070,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) case RES_EXTUSERFLD: if( ((SwExtUserField*)pFld->GetFld())->IsFixed() ) { - bChgd = sal_True; + bChgd = true; SwExtUserField* pExtUserFld = (SwExtUserField*)pFld->GetFld(); pExtUserFld->SetExpansion( ((SwExtUserFieldType*) pExtUserFld->GetTyp())->Expand( @@ -2082,7 +2082,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) case RES_DATETIMEFLD: if( ((SwDateTimeField*)pFld->GetFld())->IsFixed() ) { - bChgd = sal_True; + bChgd = true; ((SwDateTimeField*)pFld->GetFld())->SetDateTime( DateTime(Date(nDate), Time(nTime)) ); } @@ -2091,7 +2091,7 @@ void SwDoc::SetFixFields( bool bOnlyTimeDate, const DateTime* pNewDateTime ) case RES_FILENAMEFLD: if( ((SwFileNameField*)pFld->GetFld())->IsFixed() ) { - bChgd = sal_True; + bChgd = true; SwFileNameField* pFileNameFld = (SwFileNameField*)pFld->GetFld(); pFileNameFld->SetExpansion( ((SwFileNameFieldType*) @@ -2116,12 +2116,12 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen ) { // 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; + bool bFldsFnd = false; if( b && pChk && !GetUpdtFlds().IsFieldsDirty() && !IsInDtor() // ?? what's up with Undo, this is also wanted there! /*&& &pChk->GetNodes() == &GetNodes()*/ ) { - b = sal_False; + b = false; if( !nLen ) ++nLen; sal_uLong nStt = pChk->GetIndex(); @@ -2133,7 +2133,7 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen ) { if( pTNd->GetAttrOutlineLevel() != 0 ) // update chapter fields - b = sal_True; + b = true; else if( pTNd->GetpSwpHints() && pTNd->GetSwpHints().Count() ) for( sal_uInt16 n = 0, nEnd = pTNd->GetSwpHints().Count(); n < nEnd; ++n ) @@ -2141,7 +2141,7 @@ bool SwDoc::SetFieldsDirty( bool b, const SwNode* pChk, sal_uLong nLen ) const SwTxtAttr* pAttr = pTNd->GetSwpHints()[ n ]; if( RES_TXTATR_FIELD == pAttr->Which() ) { - b = sal_True; + b = true; break; } } @@ -2173,7 +2173,7 @@ void SwDoc::ChangeAuthorityData( const SwAuthEntry* pNewData ) } -void SwDocUpdtFld::InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld ) +void SwDocUpdtFld::InsDelFldInFldLst( bool bIns, const SwTxtFld& rFld ) { sal_uInt16 nWhich = rFld.GetFld().GetFld()->GetTyp()->Which(); switch( nWhich ) @@ -2192,7 +2192,7 @@ void SwDocUpdtFld::InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld ) return; } - SetFieldsDirty( sal_True ); + SetFieldsDirty( true ); if( !pFldSortLst ) { if( !bIns ) // if list is present and deleted @@ -2291,7 +2291,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode ) rtl::OUString sTrue("TRUE"), sFalse("FALSE"); - sal_Bool bIsDBMgr = 0 != rDoc.GetNewDBMgr(); + bool bIsDBMgr = 0 != rDoc.GetNewDBMgr(); sal_uInt16 nWhich, n; const rtl::OUString* pFormel = 0; const SfxPoolItem* pItem; @@ -2510,7 +2510,7 @@ void SwDocUpdtFld::InsertFldType( const SwFieldType& rType ) if( sFldName.Len() ) { - SetFieldsDirty( sal_True ); + SetFieldsDirty( true ); // look up and remove from the hash table sFldName = GetAppCharClass().lowercase( sFldName ); sal_uInt16 n; @@ -2541,7 +2541,7 @@ void SwDocUpdtFld::RemoveFldType( const SwFieldType& rType ) if( sFldName.Len() ) { - SetFieldsDirty( sal_True ); + SetFieldsDirty( true ); // look up and remove from the hash table sFldName = GetAppCharClass().lowercase( sFldName ); sal_uInt16 n; @@ -2585,7 +2585,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, { OSL_ENSURE(pDstTxtFld, "no field to update!"); - sal_Bool bTblSelBreak = sal_False; + bool bTblSelBreak = false; SwFmtFld * pDstFmtFld = (SwFmtFld*)&pDstTxtFld->GetFld(); SwField * pDstFld = pDstFmtFld->GetFld(); @@ -2631,7 +2631,7 @@ bool SwDoc::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld, pNewFld->GetTyp()->ModifyNotification(0, &aTblUpdate); if (! bUpdateFlds) - bTblSelBreak = sal_True; + bTblSelBreak = true; } } break; diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 2dc8f3ebd25b..dce06ddebc8a 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -214,7 +214,7 @@ static Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, #define IGNOREANCHOR 1 #define DONTMAKEFRMS 2 -sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNewFrms ) +sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, bool bNewFrms ) { // Changing anchors is almost always allowed. // Exception: Paragraph and character bound frames must not become @@ -291,7 +291,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNew if( SFX_ITEM_SET != rSet.GetItemState( RES_VERT_ORIENT, sal_False, &pItem )) { SwFmtVertOrient aOldV( rFmt.GetVertOrient() ); - sal_Bool bSet = sal_True; + bool bSet = true; switch( aOldV.GetVertOrient() ) { case text::VertOrientation::LINE_TOP: aOldV.SetVertOrient( text::VertOrientation::TOP ); break; @@ -299,7 +299,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNew case text::VertOrientation::LINE_BOTTOM: aOldV.SetVertOrient( text::VertOrientation::BOTTOM); break; case text::VertOrientation::NONE: aOldV.SetVertOrient( text::VertOrientation::CENTER); break; default: - bSet = sal_False; + bSet = false; } if( bSet ) rSet.Put( aOldV ); @@ -370,7 +370,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, sal_Bool bNew static bool lcl_SetFlyFrmAttr(SwDoc & rDoc, - sal_Int8 (SwDoc::*pSetFlyFrmAnchor)(SwFrmFmt &, SfxItemSet &, sal_Bool), + sal_Int8 (SwDoc::*pSetFlyFrmAnchor)(SwFrmFmt &, SfxItemSet &, bool), SwFrmFmt & rFlyFmt, SfxItemSet & rSet) { // #i32968# Inserting columns in the frame causes MakeFrmFmt to put two @@ -382,7 +382,7 @@ lcl_SetFlyFrmAttr(SwDoc & rDoc, // if the Fly needs to be created anew, because we e.g change the FlyType. sal_Int8 const nMakeFrms = (SFX_ITEM_SET == rSet.GetItemState( RES_ANCHOR, sal_False )) - ? (rDoc.*pSetFlyFrmAnchor)( rFlyFmt, rSet, sal_False ) + ? (rDoc.*pSetFlyFrmAnchor)( rFlyFmt, rSet, false ) : DONTMAKEFRMS; const SfxPoolItem* pItem; @@ -428,10 +428,10 @@ lcl_SetFlyFrmAttr(SwDoc & rDoc, return aTmpSet.Count() || MAKEFRMS == nMakeFrms; } -sal_Bool SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet ) +bool SwDoc::SetFlyFrmAttr( SwFrmFmt& rFlyFmt, SfxItemSet& rSet ) { if( !rSet.Count() ) - return sal_False; + return false; ::std::auto_ptr<SwUndoFmtAttrHelper> pSaveUndo; @@ -504,10 +504,10 @@ void SwDoc::SetFlyFrmDescription( SwFlyFrmFmt& rFlyFrmFmt, SetModified(); } -sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, - SfxItemSet* pSet, sal_Bool bKeepOrient ) +bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, + SfxItemSet* pSet, bool bKeepOrient ) { - sal_Bool bChgAnchor = sal_False, bFrmSz = sal_False; + bool bChgAnchor = false, bFrmSz = false; const SwFmtFrmSize aFrmSz( rFmt.GetFrmSize() ); const SwFmtVertOrient aVert( rFmt.GetVertOrient() ); @@ -540,7 +540,7 @@ sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, if( SFX_ITEM_SET == rNewFmt.GetAttrSet().GetItemState( RES_FRM_SIZE, sal_False )) { rFmt.ResetFmtAttr( RES_FRM_SIZE ); - bFrmSz = sal_True; + bFrmSz = true; } const SfxItemSet* pAsk = pSet; @@ -550,7 +550,7 @@ sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, rFmt.GetAnchor().GetAnchorId() ) { if( pSet ) - bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, *pSet, sal_False ); + bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, *pSet, false ); else { // Needs to have the FlyFmt range, because we set attributes in it, @@ -558,7 +558,7 @@ sal_Bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, SfxItemSet aFlySet( *rNewFmt.GetAttrSet().GetPool(), rNewFmt.GetAttrSet().GetRanges() ); aFlySet.Put( *pItem ); - bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, aFlySet, sal_False); + bChgAnchor = MAKEFRMS == SetFlyFrmAnchor( rFmt, aFlySet, false); } } } @@ -602,10 +602,10 @@ void SwDoc::GetGrfNms( const SwFlyFrmFmt& rFmt, String* pGrfName, pGrfNd->GetFileFilterNms( pGrfName, pFltName ); } -sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, +bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, RndStdIds _eAnchorType, - const sal_Bool _bSameOnly, - const sal_Bool _bPosCorr ) + const bool _bSameOnly, + const bool _bPosCorr ) { OSL_ENSURE( GetCurrentLayout(), "No layout!" ); @@ -617,7 +617,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, GetIDocumentUndoRedo().StartUndo( UNDO_INSATTR, NULL ); - sal_Bool bUnmark = sal_False; + bool bUnmark = false; for ( sal_uInt16 i = 0; i < _rMrkList.GetMarkCount(); ++i ) { SdrObject* pObj = _rMrkList.GetMark( i )->GetMarkedSdrObj(); @@ -912,13 +912,13 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest ) const SwFmtAnchor &rSrcAnchor = rSource.GetAnchor(), &rDstAnchor = rDest.GetAnchor(); sal_uLong nEndOfExtras = GetNodes().GetEndOfExtras().GetIndex(); - sal_Bool bAllowed = sal_False; + bool bAllowed = false; if ( FLY_AT_PAGE == rSrcAnchor.GetAnchorId() ) { if ( (FLY_AT_PAGE == rDstAnchor.GetAnchorId()) || ( rDstAnchor.GetCntntAnchor() && rDstAnchor.GetCntntAnchor()->nNode.GetIndex() > nEndOfExtras )) - bAllowed = sal_True; + bAllowed = true; } else if( rSrcAnchor.GetCntntAnchor() && rDstAnchor.GetCntntAnchor() ) { @@ -937,7 +937,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest ) pSttNd == rDstIdx.GetNode().FindHeaderStartNode() ) || ( !pSttNd && rDstIdx.GetIndex() > nEndOfExtras && rSrcIdx.GetIndex() > nEndOfExtras )) - bAllowed = sal_True; + bAllowed = true; } return bAllowed ? SW_CHAIN_OK : SW_CHAIN_WRONG_AREA; diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 833ece4c1fe1..94e2758c0bc5 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -143,7 +143,7 @@ struct ParaRstFmt * Is need for selections at the beginning/end and with no SSelection. */ -static sal_Bool lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs ) +static bool lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs ) { ParaRstFmt* pPara = (ParaRstFmt*)pArgs; SwTxtNode * pTxtNode = (SwTxtNode*)rpNd->GetTxtNode(); @@ -173,10 +173,10 @@ static sal_Bool lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs ) pTxtNode->RstAttr( aSt, nEnd - aSt.GetIndex(), pPara->nWhich, pPara->pDelSet, pPara->bInclRefToxMark ); } - return sal_True; + return true; } -static sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs ) +static bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs ) { ParaRstFmt* pPara = (ParaRstFmt*)pArgs; SwCntntNode* pNode = (SwCntntNode*)rpNd->GetCntntNode(); @@ -307,10 +307,10 @@ static sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs ) pNode->UnlockModify(); } } - return sal_True; + return true; } -void SwDoc::RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark ) +void SwDoc::RstTxtAttrs(const SwPaM &rRg, bool bInclRefToxMark ) { SwHistory* pHst = 0; SwDataChanged aTmp( rRg ); @@ -322,20 +322,20 @@ void SwDoc::RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark ) } const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End(); ParaRstFmt aPara( pStt, pEnd, pHst ); - aPara.bInclRefToxMark = ( bInclRefToxMark == sal_True ); + aPara.bInclRefToxMark = bInclRefToxMark; GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1, lcl_RstTxtAttr, &aPara ); SetModified(); } void SwDoc::ResetAttrs( const SwPaM &rRg, - sal_Bool bTxtAttr, + bool bTxtAttr, const std::set<sal_uInt16> &rAttrs, const bool bSendDataChangedEvents ) { SwPaM* pPam = (SwPaM*)&rRg; if( !bTxtAttr && !rAttrs.empty() && RES_TXTATR_END > *(rAttrs.begin()) ) - bTxtAttr = sal_True; + bTxtAttr = true; if( !rRg.HasMark() ) { @@ -375,7 +375,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, { nPtPos = nMkPos = rSt.GetIndex(); if( bTxtAttr ) - pTxtNd->DontExpandFmt( rSt, sal_True ); + pTxtNd->DontExpandFmt( rSt, true ); } } @@ -433,7 +433,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, aPara.pDelSet = &aDelSet; } - sal_Bool bAdd = sal_True; + bool bAdd = true; SwNodeIndex aTmpStt( pStt->nNode ); SwNodeIndex aTmpEnd( pEnd->nNode ); if( pStt->nContent.GetIndex() ) // just one part @@ -453,11 +453,11 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, } } - aTmpStt++; + ++aTmpStt; } if( pEnd->nContent.GetIndex() == pEnd->nNode.GetNode().GetCntntNode()->Len() ) // set up a later, and all CharFmtAttr -> TxtFmtAttr - aTmpEnd++, bAdd = sal_False; + aTmpEnd++, bAdd = false; else if( pStt->nNode != pEnd->nNode || !pStt->nContent.GetIndex() ) { SwTxtNode* pTNd = aTmpEnd.GetNode().GetTxtNode(); @@ -487,7 +487,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, if( bTxtAttr ) { if( bAdd ) - aTmpEnd++; + ++aTmpEnd; GetNodes().ForEach( pStt->nNode, aTmpEnd, lcl_RstTxtAttr, &aPara ); } @@ -971,11 +971,11 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, pDoc->GetNodes().ForEach( aSt, aEnd, lcl_RstTxtAttr, &aPara ); } - sal_Bool bCreateSwpHints = pCharSet && ( + bool bCreateSwpHints = pCharSet && ( SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_CHARFMT, sal_False ) || SFX_ITEM_SET == pCharSet->GetItemState( RES_TXTATR_INETFMT, sal_False ) ); - for(; aSt < aEnd; aSt++ ) + for(; aSt < aEnd; ++aSt ) { pNode = aSt.GetNode().GetCntntNode(); if( !pNode ) @@ -1167,7 +1167,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet ) SfxItemPool* pSdrPool = GetAttrPool().GetSecondaryPool(); while( sal_True ) { - sal_Bool bCheckSdrDflt = sal_False; + bool bCheckSdrDflt = false; nWhich = pItem->Which(); aOld.Put( GetAttrPool().GetDefaultItem( nWhich ) ); GetAttrPool().SetPoolDefaultItem( *pItem ); @@ -1282,7 +1282,7 @@ const SfxPoolItem& SwDoc::GetDefault( sal_uInt16 nFmtHint ) const /* * Delete the formats */ -void SwDoc::DelCharFmt(sal_uInt16 nFmt, sal_Bool bBroadcast) +void SwDoc::DelCharFmt(sal_uInt16 nFmt, bool bBroadcast) { SwCharFmt * pDel = (*pCharFmtTbl)[nFmt]; @@ -1304,14 +1304,14 @@ void SwDoc::DelCharFmt(sal_uInt16 nFmt, sal_Bool bBroadcast) SetModified(); } -void SwDoc::DelCharFmt( SwCharFmt *pFmt, sal_Bool bBroadcast ) +void SwDoc::DelCharFmt( SwCharFmt *pFmt, bool bBroadcast ) { sal_uInt16 nFmt = pCharFmtTbl->GetPos( pFmt ); OSL_ENSURE( USHRT_MAX != nFmt, "Fmt not found," ); DelCharFmt( nFmt, bBroadcast ); } -void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, sal_Bool bBroadcast ) +void SwDoc::DelFrmFmt( SwFrmFmt *pFmt, bool bBroadcast ) { if( pFmt->ISA( SwTableBoxFmt ) || pFmt->ISA( SwTableLineFmt )) { @@ -1384,7 +1384,7 @@ SwDrawFrmFmt *SwDoc::MakeDrawFrmFmt( const String &rFmtName, } -sal_uInt16 SwDoc::GetTblFrmFmtCount(sal_Bool bUsed) const +sal_uInt16 SwDoc::GetTblFrmFmtCount(bool bUsed) const { sal_uInt16 nCount = pTblFrmFmtTbl->size(); if(bUsed) @@ -1401,7 +1401,7 @@ sal_uInt16 SwDoc::GetTblFrmFmtCount(sal_Bool bUsed) const } -SwFrmFmt& SwDoc::GetTblFrmFmt(sal_uInt16 nFmt, sal_Bool bUsed ) const +SwFrmFmt& SwDoc::GetTblFrmFmt(sal_uInt16 nFmt, bool bUsed ) const { sal_uInt16 nRemoved = 0; if(bUsed) @@ -1430,7 +1430,7 @@ SwTableFmt* SwDoc::MakeTblFrmFmt( const String &rFmtName, SwFrmFmt *SwDoc::MakeFrmFmt(const String &rFmtName, SwFrmFmt *pDerivedFrom, - sal_Bool bBroadcast, sal_Bool bAuto) + bool bBroadcast, bool bAuto) { SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), rFmtName, pDerivedFrom ); @@ -1457,7 +1457,7 @@ SwFrmFmt *SwDoc::MakeFrmFmt(const String &rFmtName, SwFmt *SwDoc::_MakeFrmFmt(const String &rFmtName, SwFmt *pDerivedFrom, - sal_Bool bBroadcast, sal_Bool bAuto) + bool bBroadcast, bool bAuto) { SwFrmFmt *pFrmFmt = dynamic_cast<SwFrmFmt*>(pDerivedFrom); pFrmFmt = MakeFrmFmt( rFmtName, pFrmFmt, bBroadcast, bAuto ); @@ -1468,12 +1468,12 @@ SwFmt *SwDoc::_MakeFrmFmt(const String &rFmtName, // #i40550# - add parameter <bAuto> - not relevant SwCharFmt *SwDoc::MakeCharFmt( const String &rFmtName, SwCharFmt *pDerivedFrom, - sal_Bool bBroadcast, - sal_Bool ) + bool bBroadcast, + bool ) { SwCharFmt *pFmt = new SwCharFmt( GetAttrPool(), rFmtName, pDerivedFrom ); pCharFmtTbl->push_back( pFmt ); - pFmt->SetAuto( sal_False ); + pFmt->SetAuto( false ); SetModified(); if (GetIDocumentUndoRedo().DoesUndo()) @@ -1494,7 +1494,7 @@ SwCharFmt *SwDoc::MakeCharFmt( const String &rFmtName, SwFmt *SwDoc::_MakeCharFmt(const String &rFmtName, SwFmt *pDerivedFrom, - sal_Bool bBroadcast, sal_Bool bAuto) + bool bBroadcast, bool bAuto) { SwCharFmt *pCharFmt = dynamic_cast<SwCharFmt*>(pDerivedFrom); pCharFmt = MakeCharFmt( rFmtName, pCharFmt, bBroadcast, bAuto ); @@ -1509,13 +1509,13 @@ SwFmt *SwDoc::_MakeCharFmt(const String &rFmtName, // #i40550# - add parameter <bAuto> - not relevant SwTxtFmtColl* SwDoc::MakeTxtFmtColl( const String &rFmtName, SwTxtFmtColl *pDerivedFrom, - sal_Bool bBroadcast, - sal_Bool ) + bool bBroadcast, + bool ) { SwTxtFmtColl *pFmtColl = new SwTxtFmtColl( GetAttrPool(), rFmtName, pDerivedFrom ); pTxtFmtCollTbl->push_back(pFmtColl); - pFmtColl->SetAuto( sal_False ); + pFmtColl->SetAuto( false ); SetModified(); if (GetIDocumentUndoRedo().DoesUndo()) @@ -1534,7 +1534,7 @@ SwTxtFmtColl* SwDoc::MakeTxtFmtColl( const String &rFmtName, SwFmt *SwDoc::_MakeTxtFmtColl(const String &rFmtName, SwFmt *pDerivedFrom, - sal_Bool bBroadcast, sal_Bool bAuto) + bool bBroadcast, bool bAuto) { SwTxtFmtColl *pTxtFmtColl = dynamic_cast<SwTxtFmtColl*>(pDerivedFrom); pTxtFmtColl = MakeTxtFmtColl( rFmtName, pTxtFmtColl, bBroadcast, bAuto ); @@ -1545,12 +1545,12 @@ SwFmt *SwDoc::_MakeTxtFmtColl(const String &rFmtName, //FEATURE::CONDCOLL SwConditionTxtFmtColl* SwDoc::MakeCondTxtFmtColl( const String &rFmtName, SwTxtFmtColl *pDerivedFrom, - sal_Bool bBroadcast) + bool bBroadcast) { SwConditionTxtFmtColl*pFmtColl = new SwConditionTxtFmtColl( GetAttrPool(), rFmtName, pDerivedFrom ); pTxtFmtCollTbl->push_back(pFmtColl); - pFmtColl->SetAuto( sal_False ); + pFmtColl->SetAuto( false ); SetModified(); if (bBroadcast) @@ -1569,12 +1569,12 @@ SwGrfFmtColl* SwDoc::MakeGrfFmtColl( const String &rFmtName, SwGrfFmtColl *pFmtColl = new SwGrfFmtColl( GetAttrPool(), rFmtName, pDerivedFrom ); pGrfFmtCollTbl->push_back( pFmtColl ); - pFmtColl->SetAuto( sal_False ); + pFmtColl->SetAuto( false ); SetModified(); return pFmtColl; } -void SwDoc::DelTxtFmtColl(sal_uInt16 nFmtColl, sal_Bool bBroadcast) +void SwDoc::DelTxtFmtColl(sal_uInt16 nFmtColl, bool bBroadcast) { OSL_ENSURE( nFmtColl, "Remove fuer Coll 0." ); @@ -1604,14 +1604,14 @@ void SwDoc::DelTxtFmtColl(sal_uInt16 nFmtColl, sal_Bool bBroadcast) SetModified(); } -void SwDoc::DelTxtFmtColl( SwTxtFmtColl *pColl, sal_Bool bBroadcast ) +void SwDoc::DelTxtFmtColl( SwTxtFmtColl *pColl, bool bBroadcast ) { sal_uInt16 nFmt = pTxtFmtCollTbl->GetPos( pColl ); OSL_ENSURE( USHRT_MAX != nFmt, "Collection not found," ); DelTxtFmtColl( nFmt, bBroadcast ); } -static sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs ) +static bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs ) { // ParaSetFmtColl * pPara = (ParaSetFmtColl*)pArgs; SwCntntNode* pCNd = (SwCntntNode*)rpNode->GetTxtNode(); @@ -1681,10 +1681,10 @@ static sal_Bool lcl_SetTxtFmtColl( const SwNodePtr& rpNode, void* pArgs ) pPara->nWhich++; } - return sal_True; + return true; } -sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg, +bool SwDoc::SetTxtFmtColl( const SwPaM &rRg, SwTxtFmtColl *pFmt, bool bReset, bool bResetListAttrs ) @@ -1692,7 +1692,7 @@ sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg, SwDataChanged aTmp( rRg ); const SwPosition *pStt = rRg.Start(), *pEnd = rRg.End(); SwHistory* pHst = 0; - sal_Bool bRet = sal_True; + bool bRet = true; if (GetIDocumentUndoRedo().DoesUndo()) { @@ -1712,7 +1712,7 @@ sal_Bool SwDoc::SetTxtFmtColl( const SwPaM &rRg, GetNodes().ForEach( pStt->nNode.GetIndex(), pEnd->nNode.GetIndex()+1, lcl_SetTxtFmtColl, &aPara ); if( !aPara.nWhich ) - bRet = sal_False; // didn't find a valid Node + bRet = false; // didn't find a valid Node if( bRet ) SetModified(); @@ -1744,7 +1744,7 @@ SwFmt* SwDoc::CopyFmt( const SwFmt& rFmt, // Create the format and copy the attributes // #i40550# - SwFmt* pNewFmt = (this->*fnCopyFmt)( rFmt.GetName(), pParent, sal_False, sal_True ); + SwFmt* pNewFmt = (this->*fnCopyFmt)( rFmt.GetName(), pParent, false, true ); pNewFmt->SetAuto( rFmt.IsAuto() ); pNewFmt->CopyAttrs( rFmt, sal_True ); // copy the attributes @@ -1795,7 +1795,7 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl ) pNewColl = new SwConditionTxtFmtColl( GetAttrPool(), rColl.GetName(), pParent); pTxtFmtCollTbl->push_back( pNewColl ); - pNewColl->SetAuto( sal_False ); + pNewColl->SetAuto( false ); SetModified(); // copy the conditions @@ -1905,7 +1905,7 @@ void SwDoc::CopyFmtArr( const SwFmtsBase& rSourceArr, MakeCondTxtFmtColl( pSrc->GetName(), (SwTxtFmtColl*)&rDfltFmt ); else // #i40550# - (this->*fnCopyFmt)( pSrc->GetName(), &rDfltFmt, sal_False, sal_True ); + (this->*fnCopyFmt)( pSrc->GetName(), &rDfltFmt, false, true ); } } @@ -1917,7 +1917,7 @@ void SwDoc::CopyFmtArr( const SwFmtsBase& rSourceArr, continue; pDest = FindFmtByName( rDestArr, pSrc->GetName() ); - pDest->SetAuto( sal_False ); + pDest->SetAuto( false ); pDest->DelDiffs( *pSrc ); // #i94285#: existing <SwFmtPageDesc> instance, before copying attributes @@ -2034,7 +2034,7 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader, } void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc, - sal_Bool bCopyPoolIds ) + bool bCopyPoolIds ) { bool bNotifyLayout = false; SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219 @@ -2219,7 +2219,7 @@ SwFmt* SwDoc::FindFmtByName( const SwFmtsBase& rFmtArr, return pFnd; } -void SwDoc::MoveLeftMargin( const SwPaM& rPam, sal_Bool bRight, sal_Bool bModulus ) +void SwDoc::MoveLeftMargin( const SwPaM& rPam, bool bRight, bool bModulus ) { SwHistory* pHistory = 0; if (GetIDocumentUndoRedo().DoesUndo()) @@ -2275,14 +2275,14 @@ void SwDoc::MoveLeftMargin( const SwPaM& rPam, sal_Bool bRight, sal_Bool bModulu SwRegHistory aRegH( pTNd, *pTNd, pHistory ); pTNd->SetAttr( aLS ); } - aIdx++; + ++aIdx; } SetModified(); } -sal_Bool SwDoc::DontExpandFmt( const SwPosition& rPos, sal_Bool bFlag ) +bool SwDoc::DontExpandFmt( const SwPosition& rPos, bool bFlag ) { - sal_Bool bRet = sal_False; + bool bRet = false; SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); if( pTxtNd ) { @@ -2457,7 +2457,7 @@ void SwDoc::ChgFmt(SwFmt & rFmt, const SfxItemSet & rSet) } void SwDoc::RenameFmt(SwFmt & rFmt, const String & sNewName, - sal_Bool bBroadcast) + bool bBroadcast) { SfxStyleFamily eFamily = SFX_STYLE_FAMILY_ALL; diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index 353ddeefe389..0c845c340753 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -77,7 +77,7 @@ SwEndNoteInfo& SwEndNoteInfo::operator=(const SwEndNoteInfo& rInfo) } -sal_Bool SwEndNoteInfo::operator==( const SwEndNoteInfo& rInfo ) const +bool SwEndNoteInfo::operator==( const SwEndNoteInfo& rInfo ) const { return aPageDescDep.GetRegisteredIn() == rInfo.aPageDescDep.GetRegisteredIn() && @@ -231,7 +231,7 @@ SwFtnInfo& SwFtnInfo::operator=(const SwFtnInfo& rInfo) } -sal_Bool SwFtnInfo::operator==( const SwFtnInfo& rInfo ) const +bool SwFtnInfo::operator==( const SwFtnInfo& rInfo ) const { return ePos == rInfo.ePos && eNum == rInfo.eNum && @@ -275,17 +275,17 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo) GetIDocumentUndoRedo().AppendUndo( new SwUndoFootNoteInfo(rOld) ); } - sal_Bool bFtnPos = rInfo.ePos != rOld.ePos; - sal_Bool bFtnDesc = rOld.ePos == FTNPOS_CHAPTER && + bool bFtnPos = rInfo.ePos != rOld.ePos; + bool bFtnDesc = rOld.ePos == FTNPOS_CHAPTER && rInfo.GetPageDesc( *this ) != rOld.GetPageDesc( *this ); - sal_Bool bExtra = rInfo.aQuoVadis != rOld.aQuoVadis || + bool bExtra = rInfo.aQuoVadis != rOld.aQuoVadis || rInfo.aErgoSum != rOld.aErgoSum || rInfo.aFmt.GetNumberingType() != rOld.aFmt.GetNumberingType() || rInfo.GetPrefix() != rOld.GetPrefix() || rInfo.GetSuffix() != rOld.GetSuffix(); SwCharFmt *pOldChrFmt = rOld.GetCharFmt( *this ), *pNewChrFmt = rInfo.GetCharFmt( *this ); - sal_Bool bFtnChrFmts = pOldChrFmt != pNewChrFmt; + bool bFtnChrFmts = pOldChrFmt != pNewChrFmt; *pFtnInfo = rInfo; @@ -346,7 +346,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo) GetIDocumentUndoRedo().AppendUndo(pUndo); } - sal_Bool bNumChg = rInfo.nFtnOffset != GetEndNoteInfo().nFtnOffset; + bool bNumChg = rInfo.nFtnOffset != GetEndNoteInfo().nFtnOffset; // this seems to be an optimization: UpdateAllFtn() is only called // if the offset changes; if the offset is the same, // but type/prefix/suffix changes, just set new numbers. @@ -356,11 +356,11 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo) || (rInfo.GetPrefix() != GetEndNoteInfo().GetPrefix()) || (rInfo.GetSuffix() != GetEndNoteInfo().GetSuffix()) ); - sal_Bool bFtnDesc = rInfo.GetPageDesc( *this ) != + bool bFtnDesc = rInfo.GetPageDesc( *this ) != GetEndNoteInfo().GetPageDesc( *this ); SwCharFmt *pOldChrFmt = GetEndNoteInfo().GetCharFmt( *this ), *pNewChrFmt = rInfo.GetCharFmt( *this ); - sal_Bool bFtnChrFmts = pOldChrFmt != pNewChrFmt; + bool bFtnChrFmts = pOldChrFmt != pNewChrFmt; *pEndNoteInfo = rInfo; @@ -429,8 +429,8 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr, SwTxtFtn* pTxtFtn; sal_uLong nIdx; - sal_Bool bChg = sal_False; - sal_Bool bTypeChgd = sal_False; + bool bChg = false; + bool bTypeChgd = false; sal_uInt16 n = nPos; // save while( nPos < rFtnArr.size() && (( nIdx = _SwTxtFtn_GetIndex((pTxtFtn = rFtnArr[ nPos++ ] ))) @@ -443,7 +443,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr, if( rFtn.GetNumStr() != rNumStr || rFtn.IsEndNote() != bIsEndNote ) { - bChg = sal_True; + bChg = true; if ( pUndo ) { pUndo->GetHistory().Add( *pTxtFtn ); @@ -453,7 +453,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr, if( rFtn.IsEndNote() != bIsEndNote ) { ((SwFmtFtn&)rFtn).SetEndNote( bIsEndNote ); - bTypeChgd = sal_True; + bTypeChgd = true; pTxtFtn->CheckCondColl(); //#i11339# dispose UNO wrapper when a footnote is changed to an endnote or vice versa SwPtrMsgPoolItem aMsgHint( RES_FOOTNOTE_DELETED, (void*)&pTxtFtn->GetAttr() ); @@ -474,7 +474,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr, if( rFtn.GetNumStr() != rNumStr || rFtn.IsEndNote() != bIsEndNote ) { - bChg = sal_True; + bChg = true; if ( pUndo ) { pUndo->GetHistory().Add( *pTxtFtn ); @@ -484,7 +484,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr, if( rFtn.IsEndNote() != bIsEndNote ) { ((SwFmtFtn&)rFtn).SetEndNote( bIsEndNote ); - bTypeChgd = sal_True; + bTypeChgd = true; pTxtFtn->CheckCondColl(); } } diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx index 42d2be595005..1a76b2eb4e21 100644 --- a/sw/source/core/doc/docglos.cxx +++ b/sw/source/core/doc/docglos.cxx @@ -107,14 +107,14 @@ static void lcl_copyDocumentProperties( /* -------------------------------------------------- Description: inserts an AutoText block --------------------------------------------------*/ -sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry, +bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry, SwPaM& rPaM, SwCrsrShell* pShell ) { - sal_Bool bRet = sal_False; + bool bRet = false; sal_uInt16 nIdx = rBlock.GetIndex( rEntry ); if( (sal_uInt16) -1 != nIdx ) { - sal_Bool bSav_IsInsGlossary = mbInsOnlyTxtGlssry; + bool bSav_IsInsGlossary = mbInsOnlyTxtGlssry; mbInsOnlyTxtGlssry = rBlock.IsOnlyTextBlock( nIdx ); if( rBlock.BeginGetDoc( nIdx ) ) @@ -188,7 +188,7 @@ sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry, UnlockExpFlds(); if( !IsExpFldsLocked() ) UpdateExpFlds(NULL, true); - bRet = sal_True; + bRet = true; } mbInsOnlyTxtGlssry = bSav_IsInsGlossary; } diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 3215bb2004c7..9d94145e0dba 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -133,7 +133,7 @@ SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet ) { SwFrmFmt *pFmt = 0; const sal_Bool bMod = IsModified(); - sal_Bool bHeader = sal_False; + bool bHeader = false; switch ( eRequest ) { @@ -141,7 +141,7 @@ SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet ) case RND_STD_HEADERL: case RND_STD_HEADERR: { - bHeader = sal_True; + bHeader = true; // no break, we continue further down } case RND_STD_FOOTER: @@ -522,8 +522,8 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource, return pDest; } -SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, sal_Bool bMoveWithinDoc, - sal_Bool bInsInPage ) +SdrObject* SwDoc::CloneSdrObj( const SdrObject& rObj, bool bMoveWithinDoc, + bool bInsInPage ) { // #i52858# - method name changed SdrPage *pPg = GetOrCreateDrawModel()->GetPage( 0 ); @@ -706,10 +706,10 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType, const SwPosition* pAnchorPos, const SfxItemSet* pFlySet, - SwFrmFmt* pFrmFmt, sal_Bool bCalledFromShell ) + SwFrmFmt* pFrmFmt, bool bCalledFromShell ) { SwFlyFrmFmt* pFmt = 0; - sal_Bool bCallMake = sal_True; + bool bCallMake = true; if ( !pAnchorPos && (FLY_AT_PAGE != eAnchorType) ) { const SwFmtAnchor* pAnch; @@ -723,7 +723,7 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType, pAnchorPos = pAnch->GetCntntAnchor(); if (pAnchorPos) { - bCallMake = sal_False; + bCallMake = false; } } } @@ -839,10 +839,10 @@ if( GetIDocumentUndoRedo().DoesUndo() ) { // copy all Pams and then delete all SwPaM* pTmp = (SwPaM*)&rPam; - sal_Bool bOldFlag = mbCopyIsMove; + bool bOldFlag = mbCopyIsMove; bool const bOldUndo = GetIDocumentUndoRedo().DoesUndo(); bool const bOldRedlineMove(IsRedlineMove()); - mbCopyIsMove = sal_True; + mbCopyIsMove = true; GetIDocumentUndoRedo().DoUndo(false); SetRedlineMove(true); do { @@ -867,7 +867,7 @@ if( GetIDocumentUndoRedo().DoesUndo() ) pTmp = static_cast<SwPaM*>(pTmp->GetNext()); } while ( &rPam != pTmp ); } - } while( sal_False ); + } while( false ); } SetModified(); @@ -984,10 +984,10 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg, frames at character - o.k. if the PaM starts at least at the same position as the frame ---------------------------------------------------------------------------*/ -sal_Bool TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos, +static bool lcl_TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos, RndStdIds nAnchorId ) { - sal_Bool bOk = sal_False; + bool bOk = false; const SwPaM* pTmp = pPam; do { const sal_uInt32 nFlyIndex = pFlyPos->nNode.GetIndex(); @@ -1019,8 +1019,8 @@ sal_Bool TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos, } void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, - const SwPaM* pCmpRange, sal_Bool bDrawAlso, - sal_Bool bAsCharAlso ) const + const SwPaM* pCmpRange, bool bDrawAlso, + bool bAsCharAlso ) const { SwPosFlyFrm *pFPos = 0; SwFrmFmt *pFly; @@ -1042,7 +1042,7 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, ((FLY_AS_CHAR == rAnchor.GetAnchorId()) && bAsCharAlso))) { if( pCmpRange && - !TstFlyRange( pCmpRange, pAPos, rAnchor.GetAnchorId() )) + !lcl_TstFlyRange( pCmpRange, pAPos, rAnchor.GetAnchorId() )) continue; // not a valid FlyFrame pFPos = new SwPosFlyFrm( pAPos->nNode, pFly, rPosFlyFmts.size() ); rPosFlyFmts.insert( pFPos ); @@ -1164,7 +1164,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, { ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo()); - sal_Bool bTable = sal_False; // To save some code. + bool bTable = false; // To save some code. // Get the field first, beause we retrieve the TxtColl via the field's name OSL_ENSURE( nId == USHRT_MAX || nId < rDoc.GetFldTypes()->size(), @@ -1197,7 +1197,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, switch ( eType ) { case LTYPE_TABLE: - bTable = sal_True; + bTable = true; // no break here case LTYPE_FLY: // At the FlySection's Beginning/End insert the corresponding Node with it's Field. @@ -1802,14 +1802,14 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( |*************************************************************************/ void SwDoc::StartIdling() { - mbStartIdleTimer = sal_True; + mbStartIdleTimer = true; if( !mIdleBlockCount ) aIdleTimer.Start(); } void SwDoc::StopIdling() { - mbStartIdleTimer = sal_False; + mbStartIdleTimer = false; aIdleTimer.Stop(); } @@ -1888,7 +1888,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) /* && !pStartSh->GetViewOptions()->IsFldName()*/ ) { // Action brackets! - GetUpdtFlds().SetInUpdateFlds( sal_True ); + GetUpdtFlds().SetInUpdateFlds( true ); pTmpRoot->StartAllAction(); @@ -1905,8 +1905,8 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) pStartSh->LockView( bOldLockView ); - GetUpdtFlds().SetInUpdateFlds( sal_False ); - GetUpdtFlds().SetFieldsDirty( sal_False ); + GetUpdtFlds().SetInUpdateFlds( false ); + GetUpdtFlds().SetFieldsDirty( false ); } } //swmod 080219 #ifdef TIMELOG @@ -2055,7 +2055,7 @@ void SwDoc::SetAllUniqueFlyNames() SwFrmFmts aArr; aArr.reserve( n ); SwFrmFmt* pFlyFmt; - sal_Bool bLoadedFlag = sal_True; // something for the Layout + bool bLoadedFlag = true; // something for the Layout for( n = GetSpzFrmFmts()->size(); n; ) { @@ -2093,7 +2093,7 @@ void SwDoc::SetAllUniqueFlyNames() SFX_ITEM_SET == pFlyFmt->GetItemState( RES_HORI_ORIENT ))) ) { - bLoadedFlag = sal_False; + bLoadedFlag = false; } } } @@ -2148,7 +2148,7 @@ void SwDoc::SetAllUniqueFlyNames() SetLoaded( sal_True ); } -sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const +bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const { // If there's a Layout, use it! // That can also be a Fly in a Fly in the Header. @@ -2170,9 +2170,9 @@ sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const pUp = pUp->GetUpper(); } if ( pUp ) - return sal_True; + return true; - return sal_False; + return false; } } @@ -2192,7 +2192,7 @@ sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const if ((FLY_AT_PAGE == rAnchor.GetAnchorId()) || !rAnchor.GetCntntAnchor() ) { - return sal_False; + return false; } pNd = &rAnchor.GetCntntAnchor()->nNode.GetNode(); @@ -2203,7 +2203,7 @@ sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const if( n >= GetSpzFrmFmts()->size() ) { OSL_ENSURE( mbInReading, "Found a FlySection but not a Format!" ); - return sal_False; + return false; } } @@ -2265,7 +2265,7 @@ short SwDoc::GetTextDirection( const SwPosition& rPos, return nRet; } -sal_Bool SwDoc::IsInVerticalText( const SwPosition& rPos, const Point* pPt ) const +bool SwDoc::IsInVerticalText( const SwPosition& rPos, const Point* pPt ) const { const short nDir = GetTextDirection( rPos, pPt ); return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir; diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 92b6edc74fb5..0adddef63923 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -256,67 +256,96 @@ SwDoc::SwDoc() pStyleAccess( 0 ), pLayoutCache( 0 ), pUnoCallBack(new SwModify(0)), - mpGrammarContact( 0 ), + mpGrammarContact(createGrammarContact()), aChartDataProviderImplRef(), pChartControllerHelper( 0 ), mpListItemsList( new tImplSortedNodeNumList() ), // #i83479# m_pXmlIdRegistry(), nAutoFmtRedlnCommentNo( 0 ), nLinkUpdMode( GLOBALSETTING ), - eFldUpdMode( AUTOUPD_GLOBALSETTING ), + eFldUpdMode( AUTOUPD_GLOBALSETTING ), eRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE)), eChrCmprType( CHARCOMPRESS_NONE ), mReferenceCount(0), mIdleBlockCount(0), nLockExpFld( 0 ), + mbGlossDoc(false), + mbModified(false), + mbDtor(false), + mbPageNums(false), + mbLoaded(false), + mbUpdateExpFld(false), + mbNewDoc(false), + mbNewFldLst(true), + mbCopyIsMove(false), + mbVisibleLinks(true), + mbInReading(false), + mbInXMLImport(false), + mbUpdateTOX(false), + mbInLoadAsynchron(false), + mbHTMLMode(false), + mbInCallModified(false), + mbIsGlobalDoc(false), + mbGlblDocSaveLinks(false), + mbIsLabelDoc(false), + mbIsAutoFmtRedline(false), + mbOLEPrtNotifyPending(false), + mbAllOLENotify(false), + mbIsRedlineMove(false), + mbInsOnlyTxtGlssry(false), + mbContains_MSVBasic(false), + mbPurgeOLE(true), + mbKernAsianPunctuation(false), mbReadlineChecked(false), - mbLinksUpdated( sal_False ), //#i38810# + mbLinksUpdated( false ), //#i38810# mbClipBoard( false ), mbColumnSelection( false ), +#ifdef DBG_UTIL + mbXMLExport(false), +#endif + + mbApplyWorkaroundForB6375613(false), + + // COMPATIBILITY FLAGS START + + mbAddFlyOffsets(false), + mbUseHiResolutionVirtualDevice(true), + mbMathBaselineAlignment(false), // default for *old* documents is 'off' + mbStylesNoDefault(false), + mbFloattableNomargins(false), + mEmbedFonts(false), + mEmbedSystemFonts(false), + mbOldNumbering(false), + mbIgnoreFirstLineIndentInNumbering(false), + mbDoNotResetParaAttrsForNumFont(false), + mbTableRowKeep(false), + mbIgnoreTabsAndBlanksForLineCalculation(false), + mbDoNotCaptureDrawObjsOnPage(false), + mbOutlineLevelYieldsOutlineRule(false), + mbClipAsCharacterAnchoredWriterFlyFrames(false), + mbUnixForceZeroExtLeading(false), + mbOldPrinterMetrics(false), + mbTabRelativeToIndent(true), mbProtectForm(false), // i#78591# + mbInvertBorderSpacing (false), + mbCollapseEmptyCellPara(true), + mbTabAtLeftIndentForParagraphsInList(false), //#i89181# + mbSmallCapsPercentage66(false), + mbTabOverflow(true), + mbUnbreakableNumberings(false), + mbClippedPictures(false), + mbBackgroundParaOverDrawings(false), mbLastBrowseMode( false ), n32DummyCompatabilityOptions1(0), n32DummyCompatabilityOptions2(0), - mbStartIdleTimer(sal_False), + + // COMPATIBILITY FLAGS END + + mbStartIdleTimer(false), mbSetDrawDefaults(false) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::SwDoc" ); - mbGlossDoc = - mbModified = - mbDtor = - mbPageNums = - mbLoaded = - mbUpdateExpFld = - mbNewDoc = - mbCopyIsMove = - mbInReading = - mbInXMLImport = - mbUpdateTOX = - mbInLoadAsynchron = - mbHTMLMode = - mbInCallModified = - mbIsGlobalDoc = - mbGlblDocSaveLinks = - mbIsLabelDoc = - mbIsAutoFmtRedline = - mbOLEPrtNotifyPending = - mbAllOLENotify = - mbIsRedlineMove = - mbInsOnlyTxtGlssry = - mbContains_MSVBasic = - mbKernAsianPunctuation = -#ifdef DBG_UTIL - mbXMLExport = -#endif - mbApplyWorkaroundForB6375613 = - false; - - mbNewFldLst = - mbVisibleLinks = - mbPurgeOLE = - true; - // // COMPATIBILITY FLAGS START // @@ -335,40 +364,13 @@ SwDoc::SwDoc() mbUseFormerObjectPos = aOptions.IsUseObjectPositioning(); mbUseFormerTextWrapping = aOptions.IsUseOurTextWrapping(); mbConsiderWrapOnObjPos = aOptions.IsConsiderWrappingStyle(); - mbMathBaselineAlignment = false; // default for *old* documents is 'off' - mbStylesNoDefault = false; - mbAddFlyOffsets = false; // hidden - mbOldNumbering = false; // hidden - mbUseHiResolutionVirtualDevice = true; // hidden - mbIgnoreFirstLineIndentInNumbering = false; // hidden + mbDoNotJustifyLinesWithManualBreak = !aOptions.IsExpandWordSpace(); - mbDoNotResetParaAttrsForNumFont = false; // hidden - mbOutlineLevelYieldsOutlineRule = false; // hidden - mbTableRowKeep = false; // hidden - mbIgnoreTabsAndBlanksForLineCalculation = false; // hidden - mbDoNotCaptureDrawObjsOnPage = false; // hidden - mbClipAsCharacterAnchoredWriterFlyFrames= false; // hidden - mbUnixForceZeroExtLeading = false; // hidden - mbOldPrinterMetrics = false; // hidden - mbTabRelativeToIndent = true; // hidden - mbTabAtLeftIndentForParagraphsInList = false; // hidden #i89181# - mbInvertBorderSpacing = false; // hidden - mbCollapseEmptyCellPara = true; // hidden - mbSmallCapsPercentage66 = false; // hidden - mbTabOverflow = true; - mbUnbreakableNumberings = false; - mbFloattableNomargins = false; - mbClippedPictures = false; - mbBackgroundParaOverDrawings = false; - mEmbedFonts = false; - mEmbedSystemFonts = false; // // COMPATIBILITY FLAGS END // - mpGrammarContact = ::createGrammarContact(); - /* * DefaultFormats and DefaultFormatCollections (FmtColl) * are inserted at position 0 at the respective array. @@ -530,7 +532,7 @@ SwDoc::~SwDoc() delete pLayouter; pLayouter = 0L; - // Deactivate Undo notification from the Draw + // Deactivate Undo notification from Draw if( pDrawModel ) { DrawNotifyUndoHdl(); @@ -539,7 +541,7 @@ SwDoc::~SwDoc() delete pPgPViewPrtData; - mbDtor = sal_True; + mbDtor = true; delete pRedlineTbl; delete pUnoCrsrTbl; @@ -558,7 +560,7 @@ SwDoc::~SwDoc() pLinkMgr->Remove( 0, pLinkMgr->GetLinks().size() ); } - // The ChapterNumbers/Numbers need to be deleted before the Templates + // The ChapterNumbers/Numbers need to be deleted before the styles // or we update all the time! m_pNodes->pOutlineNds->clear(); SwNodes & rUndoNodes( GetUndoManager().GetUndoNodes() ); @@ -603,12 +605,10 @@ SwDoc::~SwDoc() BOOST_FOREACH( SwSectionFmt* pFmt, *pSectionFmtTbl ) lcl_DelFmtIndizes( pFmt ); - // The formattings that come hereafter depend on the default formattings. - // [Destroy] these only after destroying the FmtIndices, because the content + // The formats/styles that follow depend on the default formats. + // Destroy these only after destroying the FmtIndices, because the content // of headers/footers has to be deleted as well. If in the headers/footers // there are still Flys registered at that point, we have a problem. - // (This comment might have been translated incorrectly. Blame the bad - // German original) BOOST_FOREACH(SwPageDesc *pPageDesc, aPageDescs) delete pPageDesc; aPageDescs.clear(); @@ -631,7 +631,7 @@ SwDoc::~SwDoc() // Optimization: Based on the fact that Standard is always 2nd in the // array, we should delete it as the last. With this we avoid - // remangling the Formats all the time! + // reparenting the Formats all the time! if( 2 < pTxtFmtCollTbl->size() ) DeleteAndDestroy(*pTxtFmtCollTbl, 2, pTxtFmtCollTbl->size()); DeleteAndDestroy(*pTxtFmtCollTbl, 1, pTxtFmtCollTbl->size()); @@ -641,8 +641,6 @@ SwDoc::~SwDoc() "DefaultGrfCollection must always be at the start" ); DeleteAndDestroy(*pGrfFmtCollTbl, 1, pGrfFmtCollTbl->size()); - // Is the result anyway - no _DEL array! - // pGrfFmtCollTbl->Remove( 0, n ); delete pGrfFmtCollTbl; /* @@ -654,7 +652,6 @@ SwDoc::~SwDoc() pFrmFmtTbl->erase( pFrmFmtTbl->begin() ); pCharFmtTbl->erase( pCharFmtTbl->begin() ); - // Delete for pPrt DELETEZ( pPrt ); DELETEZ( pNewDBMgr ); @@ -665,15 +662,14 @@ SwDoc::~SwDoc() // Only now destroy the Model, the drawing objects - which are also // contained in the Undo - need to remove their attributes from the - // Model. Also, DrawContacts could exist before that. + // Model. Also, DrawContacts could exist before this. ReleaseDrawModel(); // Destroy DrawModel before the LinkManager, because it's always set // in the DrawModel. DELETEZ( pLinkMgr ); - // Clear the Tables before deleting them, or we crash due to - // definition dependencies. - // We also convert the arrays (due to includes) to pointers. + // Clear the Tables before deleting the defaults, or we crash due to + // dependencies on defaults. delete pFrmFmtTbl; delete pSpzFrmFmtTbl; @@ -802,7 +798,7 @@ void SwDoc::ClearDoc() GetIDocumentUndoRedo().DelAllUndoObj(); ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); - // Deactivate Undo notification from the Draw + // Deactivate Undo notification from Draw if( pDrawModel ) { DrawNotifyUndoHdl(); @@ -830,7 +826,7 @@ void SwDoc::ClearDoc() SwPageDesc* pDummyPgDsc = aPageDescs[ nDummyPgDsc ]; SwNodeIndex aSttIdx( *GetNodes().GetEndOfContent().StartOfSectionNode(), 1 ); - // create the first one over and over again (without Attribute/Templates etc. + // create the first one over and over again (without attributes/style etc. SwTxtNode* pFirstNd = GetNodes().MakeTxtNode( aSttIdx, pDfltTxtFmtColl ); if( pCurrentView ) //swmod 071029//swmod 071225 @@ -875,7 +871,7 @@ void SwDoc::ClearDoc() // Optimization: Based on the fact that Standard is always 2nd in the // array, we should delete it as the last. With this we avoid - // remangling the Formats all the time! + // reparenting the Formats all the time! if( 2 < pTxtFmtCollTbl->size() ) DeleteAndDestroy(*pTxtFmtCollTbl, 2, pTxtFmtCollTbl->size()); DeleteAndDestroy(*pTxtFmtCollTbl, 1, pTxtFmtCollTbl->size()); @@ -961,7 +957,7 @@ IGrammarContact* getGrammarContact( const SwTxtNode& rTxtNode ) // #i42634# Moved common code of SwReader::Read() and SwDocShell::UpdateLinks() // to new SwDoc::UpdateLinks(): -void SwDoc::UpdateLinks( sal_Bool bUI ) +void SwDoc::UpdateLinks( bool bUI ) { SfxObjectCreateMode eMode; sal_uInt16 nLinkMode = getLinkUpdateMode( true ); @@ -976,13 +972,13 @@ void SwDoc::UpdateLinks( sal_Bool bUI ) !GetDocShell()->IsPreview() ) { ViewShell* pVSh = 0; - sal_Bool bAskUpdate = nLinkMode == MANUAL; - sal_Bool bUpdate = sal_True; + bool bAskUpdate = nLinkMode == MANUAL; + bool bUpdate = true; switch(nUpdateDocMode) { - case document::UpdateDocMode::NO_UPDATE: bUpdate = sal_False;break; - case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate = sal_False; break; - case document::UpdateDocMode::FULL_UPDATE: bAskUpdate = sal_True; break; + case document::UpdateDocMode::NO_UPDATE: bUpdate = false;break; + case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate = false; break; + case document::UpdateDocMode::FULL_UPDATE: bAskUpdate = true; break; } if( bUpdate && (bUI || !bAskUpdate) ) { @@ -994,10 +990,10 @@ void SwDoc::UpdateLinks( sal_Bool bUI ) ViewShell aVSh( *this, 0, 0 ); SET_CURR_SHELL( &aVSh ); - GetLinkManager().UpdateAllLinks( bAskUpdate , sal_True, sal_False, pDlgParent ); + GetLinkManager().UpdateAllLinks( bAskUpdate , true, false, pDlgParent ); } else - GetLinkManager().UpdateAllLinks( bAskUpdate, sal_True, sal_False, pDlgParent ); + GetLinkManager().UpdateAllLinks( bAskUpdate, true, false, pDlgParent ); } } } @@ -1200,7 +1196,7 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const } /*------------------------------------------------------------------------- - copy document content - code from SwFEShell::Paste( SwDoc* , sal_Bool ) + copy document content - code from SwFEShell::Paste( SwDoc* ) -----------------------------------------------------------------------*/ void SwDoc::Paste( const SwDoc& rSource ) { @@ -1232,7 +1228,7 @@ void SwDoc::Paste( const SwDoc& rSource ) rSource.CopyRange( aCpyPam, rInsPos, true ); { - aIndexBefore++; + ++aIndexBefore; SwPaM aPaM(SwPosition(aIndexBefore), SwPosition(rInsPos.nNode)); @@ -1252,10 +1248,7 @@ void SwDoc::Paste( const SwDoc& rSource ) { for ( sal_uInt16 i = 0; i < rSource.GetSpzFrmFmts()->size(); ++i ) { - sal_Bool bInsWithFmt = sal_True; const SwFrmFmt& rCpyFmt = *(*rSource.GetSpzFrmFmts())[i]; - if( bInsWithFmt ) - { SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() ); if (FLY_AT_PAGE == aAnchor.GetAnchorId()) { @@ -1264,7 +1257,6 @@ void SwDoc::Paste( const SwDoc& rSource ) else continue; this->CopyLayoutFmt( rCpyFmt, aAnchor, true, true ); - } } } } diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 67dee01c8a4c..0ae339d47a62 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -80,11 +80,11 @@ namespace { rPam.End()->nNode ); aPam.Start()->nContent = 0; aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len(); - pDoc->ResetAttrs( aPam, sal_False, aResetAttrsArray ); + pDoc->ResetAttrs( aPam, false, aResetAttrsArray ); } else { - pDoc->ResetAttrs( rPam, sal_False, aResetAttrsArray ); + pDoc->ResetAttrs( rPam, false, aResetAttrsArray ); } } } @@ -148,7 +148,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule ) pOutlineRule->SetInvalidRule(sal_True); UpdateNumRule(); - // update if we have foot notes && chapter-wise numbering + // update if we have foot notes && numbering by chapter if( !GetFtnIdxs().empty() && FTNNUM_CHAPTER == GetFtnInfo().eNum ) GetFtnIdxs().UpdateAllFtn(); @@ -185,12 +185,12 @@ void SwDoc::PropagateOutlineRule() } // Increase/Decrease -sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) +bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) { if( GetNodes().GetOutLineNds().empty() || !nOffset ) - return sal_False; + return false; - // calculate the area + // calculate the range const SwOutlineNodes& rOutlNds = GetNodes().GetOutLineNds(); const SwNodePtr pSttNd = (SwNodePtr)&rPam.Start()->nNode.GetNode(); const SwNodePtr pEndNd = (SwNodePtr)&rPam.End()->nNode.GetNode(); @@ -199,18 +199,18 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) if( !rOutlNds.Seek_Entry( pSttNd, &nSttPos ) && !nSttPos-- ) // we're not in an "Outline section" - return sal_False; + return false; if( rOutlNds.Seek_Entry( pEndNd, &nEndPos ) ) ++nEndPos; - // We now have the wanted area in the OutlineNodes array, + // We now have the wanted range in the OutlineNodes array, // so check now if we're not invalidating sublevels // (stepping over the limits) sal_uInt16 n; // Here we go: - // 1. Create the Template array: + // 1. Create the style array: SwTxtFmtColl* aCollArr[ MAXLEVEL ]; memset( aCollArr, 0, sizeof( SwTxtFmtColl* ) * MAXLEVEL ); @@ -371,7 +371,7 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) } if (! bMoveApplicable ) - return sal_False; + return false; if (GetIDocumentUndoRedo().DoesUndo()) { @@ -380,7 +380,7 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) GetIDocumentUndoRedo().AppendUndo(pUndoOLR); } - // 2. Apply the new Template to all Nodes + // 2. Apply the new style to all Nodes n = nSttPos; while( n < nEndPos) @@ -424,13 +424,13 @@ sal_Bool SwDoc::OutlineUpDown( const SwPaM& rPam, short nOffset ) ChkCondColls(); SetModified(); - return sal_True; + return true; } // Move up/down -sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) +bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) { - // Do not move to special areas + // Do not move to special sections in the nodes array const SwPosition& rStt = *rPam.Start(), & rEnd = &rStt == rPam.GetPoint() ? *rPam.GetMark() : *rPam.GetPoint(); @@ -438,7 +438,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) (rStt.nNode.GetIndex() < GetNodes().GetEndOfExtras().GetIndex()) || (rEnd.nNode.GetIndex() < GetNodes().GetEndOfExtras().GetIndex())) { - return sal_False; + return false; } sal_uInt16 nAktPos = 0; @@ -453,11 +453,11 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) if( !GetNodes().GetOutLineNds().Seek_Entry( pSrch, &nAktPos ) ) { if( !nAktPos ) - return sal_False; // Promoting or demoting before the first outline => no. + return false; // Promoting or demoting before the first outline => no. if( --nAktPos ) aSttRg = *GetNodes().GetOutLineNds()[ nAktPos ]; else if( 0 > nOffset ) - return sal_False; // Promoting at the top of document?! + return false; // Promoting at the top of document?! else aSttRg = *GetNodes().GetEndOfContent().StartOfSectionNode(); } @@ -482,7 +482,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) if( aEndRg == aSttRg ) { OSL_FAIL( "Moving outlines: Surprising selection" ); - aEndRg++; + ++aEndRg; } const SwNode* pNd; @@ -499,7 +499,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) break; aSttRg--; } - aSttRg++; + ++aSttRg; aEndRg--; while( aEndRg.GetNode().IsStartNode() ) @@ -511,7 +511,7 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) break; aEndRg--; } - aEndRg++; + ++aEndRg; // calculation of the new position if( nOffset < 0 && nAktPos < sal_uInt16(-nOffset) ) @@ -556,29 +556,28 @@ sal_Bool SwDoc::MoveOutlinePara( const SwPaM& rPam, short nOffset ) } } // We do not want to move into tables (at the moment) - aInsertPos++; + ++aInsertPos; pNd = &aInsertPos.GetNode(); if( pNd->IsTableNode() ) pNd = pNd->StartOfSectionNode(); if( pNd->FindTableNode() ) - return sal_False; + return false; OSL_ENSURE( aSttRg.GetIndex() > nNewPos || nNewPos >= aEndRg.GetIndex(), - "Position lies within MoveArea" ); + "Position lies within Move range" ); - // If a Position was calculated for the special area, we set it - // to document start instead. - // Areas or Tables at the document start will be moved to the - // back. + // If a Position inside the special nodes array sections was calculated, + // set it to document start instead. + // Sections or Tables at the document start will be pushed backwards. nNewPos = Max( nNewPos, GetNodes().GetEndOfExtras().GetIndex() + 2 ); long nOffs = nNewPos - ( 0 < nOffset ? aEndRg.GetIndex() : aSttRg.GetIndex()); SwPaM aPam( aSttRg, aEndRg, 0, -1 ); - return MoveParagraph( aPam, nOffs, sal_True ); + return MoveParagraph( aPam, nOffs, true ); } static sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const String& rName, - sal_Bool bExact ) + bool bExact ) { sal_uInt16 nSavePos = USHRT_MAX; const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds(); @@ -705,7 +704,7 @@ static sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName ) // found, we got the right entry. Or else we use the one found by // searching for the Number. // If we don't have a Number, we search via the Text only. -sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const +bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const { if( rName.Len() ) { @@ -733,7 +732,7 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const if( !sExpandedText.Equals( sName ) ) { - sal_uInt16 nTmp = ::lcl_FindOutlineName( GetNodes(), sName, sal_True ); + sal_uInt16 nTmp = ::lcl_FindOutlineName( GetNodes(), sName, true ); if( USHRT_MAX != nTmp ) // found via the Name { nFndPos = nTmp; @@ -742,32 +741,32 @@ sal_Bool SwDoc::GotoOutline( SwPosition& rPos, const String& rName ) const } rPos.nNode = *pNd; rPos.nContent.Assign( pNd, 0 ); - return sal_True; + return true; } - nFndPos = ::lcl_FindOutlineName( GetNodes(), rName, sal_False ); + nFndPos = ::lcl_FindOutlineName( GetNodes(), rName, false ); if( USHRT_MAX != nFndPos ) { SwTxtNode* pNd = rOutlNds[ nFndPos ]->GetTxtNode(); rPos.nNode = *pNd; rPos.nContent.Assign( pNd, 0 ); - return sal_True; + return true; } // #i68289# additional search on hyperlink URL without its outline numbering part if ( !sName.Equals( rName ) ) { - nFndPos = ::lcl_FindOutlineName( GetNodes(), sName, sal_False ); + nFndPos = ::lcl_FindOutlineName( GetNodes(), sName, false ); if( USHRT_MAX != nFndPos ) { SwTxtNode* pNd = rOutlNds[ nFndPos ]->GetTxtNode(); rPos.nNode = *pNd; rPos.nContent.Assign( pNd, 0 ); - return sal_True; + return true; } } } - return sal_False; + return false; } static void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& rRule ) @@ -839,7 +838,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam, const SwNumRule& rRule, const bool bCreateNewList, const String sContinuedListId, - sal_Bool bSetItem, + bool bSetItem, const bool bResetIndentAttrs ) { SwUndoInsNum * pUndo = NULL; @@ -916,7 +915,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam, if (pRule && pRule->GetName() == pNew->GetName()) { - bSetItem = sal_False; + bSetItem = false; if ( !pTxtNd->IsInList() ) { @@ -934,7 +933,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam, if ( pCollRule && pCollRule->GetName() == pNew->GetName() ) { pTxtNd->ResetAttr( RES_PARATR_NUMRULE ); - bSetItem = sal_False; + bSetItem = false; } } } @@ -1017,14 +1016,14 @@ void SwDoc::SetNodeNumStart( const SwPosition& rPos, sal_uInt16 nStt ) } // We can only delete if the Rule is unused! -sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast ) +bool SwDoc::DelNumRule( const String& rName, bool bBroadcast ) { sal_uInt16 nPos = FindNumRule( rName ); if ( (*pNumRuleTbl)[ nPos ] == GetOutlineNumRule() ) { OSL_FAIL( "<SwDoc::DelNumRule(..)> - No deletion of outline list style. This is serious defect - please inform OD" ); - return sal_False; + return false; } if( USHRT_MAX != nPos && !IsUsed( *(*pNumRuleTbl)[ nPos ] )) @@ -1070,9 +1069,9 @@ sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast ) maNumRuleMap.erase(aTmpName); SetModified(); - return sal_True; + return true; } - return sal_False; + return false; } void SwDoc::ChgNumRuleFmts( const SwNumRule& rRule, const String * pName ) @@ -1096,10 +1095,10 @@ void SwDoc::ChgNumRuleFmts( const SwNumRule& rRule, const String * pName ) } } -sal_Bool SwDoc::RenameNumRule(const String & rOldName, const String & rNewName, - sal_Bool bBroadcast) +bool SwDoc::RenameNumRule(const String & rOldName, const String & rNewName, + bool bBroadcast) { - sal_Bool bResult = sal_False; + bool bResult = false; SwNumRule * pNumRule = FindNumRulePtr(rOldName); if (pNumRule) @@ -1124,7 +1123,7 @@ sal_Bool SwDoc::RenameNumRule(const String & rOldName, const String & rNewName, pTxtNd->SetAttr(aItem); } - bResult = sal_True; + bResult = true; if (bBroadcast) BroadcastStyleOperation(rOldName, SFX_STYLE_FAMILY_PSEUDO, @@ -1152,10 +1151,10 @@ void SwDoc::StopNumRuleAnimations( OutputDevice* pOut ) } } -sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos, +bool SwDoc::ReplaceNumRule( const SwPosition& rPos, const String& rOldRule, const String& rNewRule ) { - sal_Bool bRet = sal_False; + bool bRet = false; SwNumRule *pOldRule = FindNumRulePtr( rOldRule ), *pNewRule = FindNumRulePtr( rNewRule ); if( pOldRule && pNewRule && pOldRule != pNewRule ) @@ -1206,7 +1205,7 @@ sal_Bool SwDoc::ReplaceNumRule( const SwPosition& rPos, GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); SetModified(); - bRet = sal_True; + bRet = true; } } @@ -1295,10 +1294,10 @@ void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM) } } -sal_Bool SwDoc::NoNum( const SwPaM& rPam ) +bool SwDoc::NoNum( const SwPaM& rPam ) { - sal_Bool bRet = SplitNode( *rPam.GetPoint(), false ); + bool bRet = SplitNode( *rPam.GetPoint(), false ); // Do we actually use Numbering at all? if( bRet ) { @@ -1313,7 +1312,7 @@ sal_Bool SwDoc::NoNum( const SwPaM& rPam ) SetModified(); } else - bRet = sal_False; // no Numbering or just always sal_True? + bRet = false; // no Numbering or just always sal_True? } return bRet; } @@ -1390,16 +1389,16 @@ void SwDoc::InvalidateNumRules() } // To the next/preceding Bullet at the same Level -static sal_Bool lcl_IsNumOk( sal_uInt8 nSrchNum, sal_uInt8& rLower, sal_uInt8& rUpper, - sal_Bool bOverUpper, sal_uInt8 nNumber ) +static bool lcl_IsNumOk( sal_uInt8 nSrchNum, sal_uInt8& rLower, sal_uInt8& rUpper, + bool bOverUpper, sal_uInt8 nNumber ) { OSL_ENSURE( nNumber < MAXLEVEL, "<lcl_IsNumOk(..)> - misusage of method" ); - sal_Bool bRet = sal_False; + bool bRet = false; { if( bOverUpper ? nSrchNum == nNumber : nSrchNum >= nNumber ) - bRet = sal_True; + bRet = true; else if( nNumber > rLower ) rLower = nNumber; else if( nNumber < rUpper ) @@ -1408,9 +1407,9 @@ static sal_Bool lcl_IsNumOk( sal_uInt8 nSrchNum, sal_uInt8& rLower, sal_uInt8& r return bRet; } -static sal_Bool lcl_IsValidPrevNextNumNode( const SwNodeIndex& rIdx ) +static bool lcl_IsValidPrevNextNumNode( const SwNodeIndex& rIdx ) { - sal_Bool bRet = sal_False; + bool bRet = false; const SwNode& rNd = rIdx.GetNode(); switch( rNd.GetNodeType() ) { @@ -1424,19 +1423,19 @@ static sal_Bool lcl_IsValidPrevNextNumNode( const SwNodeIndex& rIdx ) break; case ND_SECTIONNODE: // that one's valid, so proceed - bRet = sal_True; + bRet = true; break; } return bRet; } -static sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext, - sal_Bool bOverUpper, sal_uInt8* pUpper, sal_uInt8* pLower ) +static bool lcl_GotoNextPrevNum( SwPosition& rPos, bool bNext, + bool bOverUpper, sal_uInt8* pUpper, sal_uInt8* pLower ) { const SwTxtNode* pNd = rPos.nNode.GetNode().GetTxtNode(); const SwNumRule* pRule; if( !pNd || 0 == ( pRule = pNd->GetNumRule())) - return sal_False; + return false; sal_uInt8 nSrchNum = static_cast<sal_uInt8>(pNd->GetActualListLevel()); @@ -1444,7 +1443,7 @@ static sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext, if( ! pNd->IsCountedInList() ) { // If NO_NUMLEVEL is switched on, we search the preceding Node with Numbering - sal_Bool bError = sal_False; + bool bError = false; do { aIdx--; if( aIdx.GetNode().IsTxtNode() ) @@ -1462,18 +1461,18 @@ static sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext, break; // found it! } else - bError = sal_True; + bError = true; } else bError = !lcl_IsValidPrevNextNumNode( aIdx ); } while( !bError ); if( bError ) - return sal_False; + return false; } sal_uInt8 nLower = nSrchNum, nUpper = nSrchNum; - sal_Bool bRet = sal_False; + bool bRet = false; const SwTxtNode* pLast; if( bNext ) @@ -1495,7 +1494,7 @@ static sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext, { rPos.nNode = aIdx; rPos.nContent.Assign( (SwTxtNode*)pNd, 0 ); - bRet = sal_True; + bRet = true; break; } else @@ -1508,7 +1507,7 @@ static sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext, break; if( bNext ) - aIdx++; + ++aIdx; else aIdx--; } @@ -1526,7 +1525,7 @@ static sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext, rPos.nNode.Assign( *pLast ); rPos.nContent.Assign( (SwTxtNode*)pLast, 0 ); } - bRet = sal_True; + bRet = true; } if( bRet ) @@ -1539,10 +1538,10 @@ static sal_Bool lcl_GotoNextPrevNum( SwPosition& rPos, sal_Bool bNext, return bRet; } -sal_Bool SwDoc::GotoNextNum( SwPosition& rPos, sal_Bool bOverUpper, +bool SwDoc::GotoNextNum( SwPosition& rPos, bool bOverUpper, sal_uInt8* pUpper, sal_uInt8* pLower ) { - return ::lcl_GotoNextPrevNum( rPos, sal_True, bOverUpper, pUpper, pLower ); + return ::lcl_GotoNextPrevNum( rPos, true, bOverUpper, pUpper, pLower ); } const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos, @@ -1568,7 +1567,7 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos, if ( !bInvestigateStartNode ) { if (bForward) - aIdx++; + ++aIdx; else aIdx--; } @@ -1606,7 +1605,7 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos, if ( bInvestigateStartNode ) { if (bForward) - aIdx++; + ++aIdx; else aIdx--; } @@ -1621,13 +1620,13 @@ const SwNumRule * SwDoc::SearchNumRule(const SwPosition & rPos, } -sal_Bool SwDoc::GotoPrevNum( SwPosition& rPos, sal_Bool bOverUpper, +bool SwDoc::GotoPrevNum( SwPosition& rPos, bool bOverUpper, sal_uInt8* pUpper, sal_uInt8* pLower ) { - return ::lcl_GotoNextPrevNum( rPos, sal_False, bOverUpper, pUpper, pLower ); + return ::lcl_GotoNextPrevNum( rPos, false, bOverUpper, pUpper, pLower ); } -sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown ) +bool SwDoc::NumUpDown( const SwPaM& rPam, bool bDown ) { sal_uLong nStt = rPam.GetPoint()->nNode.GetIndex(), nEnd = rPam.GetMark()->nNode.GetIndex(); @@ -1657,7 +1656,7 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown ) } } - sal_Bool bRet = sal_True; + bool bRet = true; sal_Int8 nDiff = bDown ? 1 : -1; if (bOnlyOutline) @@ -1685,7 +1684,7 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown ) sal_uInt8 nLevel = static_cast<sal_uInt8>(pTNd->GetActualListLevel()); if( (-1 == nDiff && 0 >= nLevel) || (1 == nDiff && MAXLEVEL - 1 <= nLevel)) - bRet = sal_False; + bRet = false; } } } @@ -1726,7 +1725,7 @@ sal_Bool SwDoc::NumUpDown( const SwPaM& rPam, sal_Bool bDown ) return bRet; } -sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutlMv ) +bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, bool bIsOutlMv ) { const SwPosition *pStt = rPam.Start(), *pEnd = rPam.End(); @@ -1741,31 +1740,31 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl if( bIsOutlMv ) { // For moving chapters (outline) the following reason will deny the move: - // if a start node is inside the moved area and its end node outside or vice versa. + // if a start node is inside the moved range and its end node outside or vice versa. // If a start node is the first moved paragraph, its end node has to be within the moved - // area, too (e.g. as last node). - // If an end node is the last node of the moved area, its start node has to be a part of + // range, too (e.g. as last node). + // If an end node is the last node of the moved range, its start node has to be a part of // the moved section, too. pTmp1 = GetNodes()[ nStIdx ]; if( pTmp1->IsStartNode() ) { // First is a start node pTmp2 = pTmp1->EndOfSectionNode(); if( pTmp2->GetIndex() > nEndIdx ) - return sal_False; // Its end node is behind the moved range + return false; // Its end node is behind the moved range } pTmp1 = pTmp1->StartOfSectionNode()->EndOfSectionNode(); if( pTmp1->GetIndex() <= nEndIdx ) - return sal_False; // End node inside but start node before moved range => no. + return false; // End node inside but start node before moved range => no. pTmp1 = GetNodes()[ nEndIdx ]; if( pTmp1->IsEndNode() ) { // The last one is an end node pTmp1 = pTmp1->StartOfSectionNode(); if( pTmp1->GetIndex() < nStIdx ) - return sal_False; // Its start node is before the moved range. + return false; // Its start node is before the moved range. } pTmp1 = pTmp1->StartOfSectionNode(); if( pTmp1->GetIndex() >= nStIdx ) - return sal_False; // A start node which ends behind the moved area => no. + return false; // A start node which ends behind the moved range => no. } sal_uLong nInStIdx, nInEndIdx; @@ -1780,7 +1779,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl { // Impossible to move to negative index if( sal_uLong(abs( nOffset )) > nStIdx) - return sal_False; + return false; nInEndIdx = nStIdx - 1; nStIdx += nOffset; @@ -1790,7 +1789,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl // Swap [ nStIdx, nInEndIdx ] with [ nInStIdx, nEndIdx ] if( nEndIdx >= GetNodes().GetEndOfContent().GetIndex() ) - return sal_False; + return false; if( !bIsOutlMv ) { // And here the restrictions for moving paragraphs other than chapters (outlines) @@ -1801,7 +1800,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl pTmp1 = GetNodes()[ nStIdx ]->StartOfSectionNode(); pTmp2 = GetNodes()[ nInStIdx ]->StartOfSectionNode(); if( pTmp1 != pTmp2 ) - return sal_False; // "start" nodes in different sections + return false; // "start" nodes in different sections pTmp1 = GetNodes()[ nEndIdx ]; bool bIsEndNode = pTmp1->IsEndNode(); if( !pTmp1->IsStartNode() ) @@ -1821,7 +1820,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl } pTmp2 = pTmp2->EndOfSectionNode(); if( pTmp1 != pTmp2 ) - return sal_False; // The "end" notes are in different sections + return false; // The "end" notes are in different sections } // Test for Redlining - Can the Selection be moved at all, actually? @@ -1834,9 +1833,9 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl aStPos.nContent = 0; SwCntntNode* pCNd = pEnd->nNode.GetNode().GetCntntNode(); aEndPos.nContent = pCNd ? pCNd->Len() : 1; - sal_Bool bCheckDel = sal_True; + bool bCheckDel = true; - // There is a some Redline Delete Object for the Area + // There is a some Redline Delete Object for the range for( ; nRedlPos < GetRedlineTbl().size(); ++nRedlPos ) { const SwRedline* pTmp = GetRedlineTbl()[ nRedlPos ]; @@ -1855,14 +1854,14 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl break; case POS_INSIDE: // Pos1 is completely inside Pos2 // that's valid, but check all following for overlapping - bCheckDel = sal_False; + bCheckDel = false; break; case POS_OUTSIDE: // Pos2 is completely inside Pos1 - case POS_EQUAL: // Pos1 is as big as Pos2 + case POS_EQUAL: // Pos1 is equal to Pos2 case POS_OVERLAP_BEFORE: // Pos1 overlaps Pos2 in the beginning case POS_OVERLAP_BEHIND: // Pos1 overlaps Pos2 at the end - return sal_False; + return false; } } } @@ -1871,7 +1870,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl { // Send DataChanged before moving. We then can detect - // which objects are still in the Area. + // which objects are still in the range. // After the move they could come before/after the // Position. SwDataChanged aTmp( rPam ); @@ -1883,7 +1882,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl SwRedline* pOwnRedl = 0; if( IsRedlineOn() ) { - // If the Area is completely in the own Redline, we can move it! + // If the range is completely in the own Redline, we can move it! sal_uInt16 nRedlPos = GetRedlinePos( pStt->nNode.GetNode(), nsRedlineType_t::REDLINE_INSERT ); if( USHRT_MAX != nRedlPos ) { @@ -1891,7 +1890,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl const SwPosition *pRStt = pTmp->Start(), *pREnd = pTmp->End(); SwRedline aTmpRedl( nsRedlineType_t::REDLINE_INSERT, rPam ); const SwCntntNode* pCEndNd = pEnd->nNode.GetNode().GetCntntNode(); - // Is completely in the Area and is the own Redline too? + // Is completely in the range and is the own Redline too? if( aTmpRedl.IsOwnRedline( *pTmp ) && (pRStt->nNode < pStt->nNode || (pRStt->nNode == pStt->nNode && !pRStt->nContent.GetIndex()) ) && @@ -1932,7 +1931,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl rOrigPam.DeleteMark(); rOrigPam.GetPoint()->nNode = aIdx.GetIndex() - 1; - sal_Bool bDelLastPara = !aInsPos.nNode.GetNode().IsCntntNode(); + bool bDelLastPara = !aInsPos.nNode.GetNode().IsCntntNode(); /* When copying to a non-content node Copy will insert a paragraph before that node and insert before @@ -2019,7 +2018,7 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); SetModified(); - return sal_True; + return true; } } @@ -2077,12 +2076,12 @@ sal_Bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, sal_Bool bIsOutl } SetModified(); - return sal_True; + return true; } -sal_Bool SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel ) +bool SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel ) { - sal_Bool bResult = sal_False; + bool bResult = false; SwTxtNode * pTxtNd = rIdx.GetNode().GetTxtNode(); if (pTxtNd && pTxtNd->GetNumRule() != NULL && @@ -2096,7 +2095,7 @@ sal_Bool SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel ) SetModified(); - bResult = sal_True; + bResult = true; if (GetIDocumentUndoRedo().DoesUndo()) { @@ -2114,7 +2113,7 @@ sal_Bool SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, sal_Bool bDel ) DelNumRules(aPam); - bResult = sal_True; + bResult = true; } } @@ -2181,7 +2180,7 @@ void SwDoc::AddNumRule(SwNumRule * pRule) sal_uInt16 SwDoc::MakeNumRule( const String &rName, const SwNumRule* pCpy, - sal_Bool bBroadcast, + bool bBroadcast, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode ) { SwNumRule* pNew; @@ -2223,7 +2222,7 @@ sal_uInt16 SwDoc::MakeNumRule( const String &rName, return nRet; } -String SwDoc::GetUniqueNumRuleName( const String* pChkStr, sal_Bool bAutoNum ) const +String SwDoc::GetUniqueNumRuleName( const String* pChkStr, bool bAutoNum ) const { String aName; if( bAutoNum ) @@ -2309,7 +2308,7 @@ void SwDoc::UpdateNumRule() void SwDoc::MarkListLevel( const String& sListId, const int nListLevel, - const sal_Bool bValue ) + const bool bValue ) { SwList* pList = getListByName( sListId ); @@ -2321,15 +2320,15 @@ void SwDoc::MarkListLevel( const String& sListId, void SwDoc::MarkListLevel( SwList& rList, const int nListLevel, - const sal_Bool bValue ) + const bool bValue ) { // Set new marked list level and notify all affected nodes of the changed mark. rList.MarkListLevel( nListLevel, bValue ); } -sal_Bool SwDoc::IsFirstOfNumRule(SwPosition & rPos) +bool SwDoc::IsFirstOfNumRule(SwPosition & rPos) { - sal_Bool bResult = sal_False; + bool bResult = false; SwTxtNode * pTxtNode = rPos.nNode.GetNode().GetTxtNode(); if (pTxtNode) diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 743fff315ee9..0b3996997137 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -364,9 +364,9 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) ( pNewRedl->GetContentIdx() == NULL ) ) { // Do not insert empty redlines delete pNewRedl; - return sal_False; + return false; } - sal_Bool bCompress = sal_False; + bool bCompress = false; sal_uInt16 n = 0; // look up the first Redline for the starting position if( !GetRedline( *pStt, &n ) && n ) @@ -466,7 +466,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) if( bDelete ) { delete pNewRedl, pNewRedl = 0; - bCompress = sal_True; + bCompress = true; } } else if( POS_INSIDE == eCmpPos ) @@ -666,7 +666,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) case POS_INSIDE: case POS_EQUAL: delete pNewRedl, pNewRedl = 0; - bCompress = sal_True; + bCompress = true; break; case POS_OVERLAP_BEFORE: @@ -755,7 +755,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) switch( eCmpPos ) { case POS_EQUAL: - bCompress = sal_True; + bCompress = true; pRedlineTbl->DeleteAndDestroy( n ); bDec = true; // no break! @@ -782,7 +782,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) else DeleteAndJoin( *pNewRedl ); - bCompress = sal_True; + bCompress = true; } delete pNewRedl, pNewRedl = 0; break; @@ -879,7 +879,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) delete pNewRedl, pNewRedl = 0; if( IsHideChanges( eRedlineMode )) pRedl->Hide(); - bCompress = sal_True; + bCompress = true; } break; @@ -929,7 +929,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) pNew->SetEnd( *pRStt ); pNewRedl->SetStart( *pREnd, pStt ); } - bCompress = sal_True; + bCompress = true; } break; @@ -1295,7 +1295,7 @@ void SwDoc::CompressRedlines() bool SwDoc::SplitRedline( const SwPaM& rRange ) { - sal_Bool bChg = sal_False; + bool bChg = false; sal_uInt16 n = 0; const SwPosition* pStt = rRange.Start(), * pEnd = pStt == rRange.GetPoint() ? rRange.GetMark() @@ -1310,7 +1310,7 @@ bool SwDoc::SplitRedline( const SwPaM& rRange ) if( *pTStt <= *pStt && *pStt <= *pTEnd && *pTStt <= *pEnd && *pEnd <= *pTEnd ) { - bChg = sal_True; + bChg = true; int nn = 0; if( *pStt == *pTStt ) nn += 1; @@ -1362,7 +1362,7 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo, !rRange.HasMark() || *rRange.GetMark() == *rRange.GetPoint() ) return sal_False; - sal_Bool bChg = sal_False; + bool bChg = false; if (bSaveInUndo && GetIDocumentUndoRedo().DoesUndo()) { @@ -1395,7 +1395,7 @@ bool SwDoc::DeleteRedline( const SwPaM& rRange, bool bSaveInUndo, case POS_OUTSIDE: pRedl->InvalidateRange(); pRedlineTbl->DeleteAndDestroy( n-- ); - bChg = sal_True; + bChg = true; break; case POS_OVERLAP_BEFORE: @@ -1593,7 +1593,7 @@ static sal_Bool lcl_AcceptRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, case nsRedlineType_t::REDLINE_INSERT: case nsRedlineType_t::REDLINE_FORMAT: { - sal_Bool bCheck = sal_False, bReplace = sal_False; + bool bCheck = false, bReplace = false; switch( eCmp ) { case POS_INSIDE: @@ -1609,18 +1609,18 @@ static sal_Bool lcl_AcceptRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, rArr.Insert( pNew ); ++rPos; } pRedl->SetEnd( *pSttRng, pREnd ); - bCheck = sal_True; + bCheck = true; } break; case POS_OVERLAP_BEFORE: pRedl->SetStart( *pEndRng, pRStt ); - bReplace = sal_True; + bReplace = true; break; case POS_OVERLAP_BEHIND: pRedl->SetEnd( *pSttRng, pREnd ); - bCheck = sal_True; + bCheck = true; break; case POS_OUTSIDE: @@ -1644,7 +1644,7 @@ static sal_Bool lcl_AcceptRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, { SwDoc& rDoc = *pRedl->GetDoc(); const SwPosition *pDelStt = 0, *pDelEnd = 0; - sal_Bool bDelRedl = sal_False; + bool bDelRedl = false; switch( eCmp ) { case POS_INSIDE: @@ -1674,7 +1674,7 @@ static sal_Bool lcl_AcceptRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, case POS_EQUAL: { rArr.Remove( rPos-- ); - bDelRedl = sal_True; + bDelRedl = true; if( bCallDelete ) { pDelStt = pRedl->Start(); @@ -1753,7 +1753,7 @@ static sal_Bool lcl_RejectRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, { SwDoc& rDoc = *pRedl->GetDoc(); const SwPosition *pDelStt = 0, *pDelEnd = 0; - sal_Bool bDelRedl = sal_False; + bool bDelRedl = false; switch( eCmp ) { case POS_INSIDE: @@ -1783,7 +1783,7 @@ static sal_Bool lcl_RejectRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, { // delete the range again rArr.Remove( rPos-- ); - bDelRedl = sal_True; + bDelRedl = true; if( bCallDelete ) { pDelStt = pRedl->Start(); @@ -1831,7 +1831,7 @@ static sal_Bool lcl_RejectRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, case nsRedlineType_t::REDLINE_DELETE: { SwRedline* pNew = 0; - sal_Bool bCheck = sal_False, bReplace = sal_False; + bool bCheck = false, bReplace = false; switch( eCmp ) { @@ -1845,7 +1845,7 @@ static sal_Bool lcl_RejectRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, if( *pSttRng == *pRStt ) { pRedl->SetStart( *pEndRng, pRStt ); - bReplace = sal_True; + bReplace = true; if( pNew ) pNew->SetEnd( *pEndRng ); } @@ -1862,7 +1862,7 @@ static sal_Bool lcl_RejectRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, } pRedl->SetEnd( *pSttRng, pREnd ); - bCheck = sal_True; + bCheck = true; if( pNew ) pNew->SetStart( *pSttRng ); } @@ -1876,7 +1876,7 @@ static sal_Bool lcl_RejectRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, pNew->PopData(); } pRedl->SetStart( *pEndRng, pRStt ); - bReplace = sal_True; + bReplace = true; if( pNew ) pNew->SetEnd( *pEndRng ); break; @@ -1888,7 +1888,7 @@ static sal_Bool lcl_RejectRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, pNew->PopData(); } pRedl->SetEnd( *pSttRng, pREnd ); - bCheck = sal_True; + bCheck = true; if( pNew ) pNew->SetStart( *pSttRng ); break; @@ -1936,7 +1936,7 @@ static sal_Bool lcl_RejectRedline( SwRedlineTbl& rArr, sal_uInt16& rPos, static const SwRedline* lcl_FindCurrRedline( const SwPosition& rSttPos, sal_uInt16& rPos, - sal_Bool bNext = sal_True ) + bool bNext = true ) { const SwRedline* pFnd = 0; const SwRedlineTbl& rArr = rSttPos.nNode.GetNode().GetDoc()->GetRedlineTbl(); @@ -1973,7 +1973,7 @@ static int lcl_AcceptRejectRedl( Fn_AcceptReject fn_AcceptReject, const SwPosition* pStt = rPam.Start(), * pEnd = pStt == rPam.GetPoint() ? rPam.GetMark() : rPam.GetPoint(); - const SwRedline* pFnd = lcl_FindCurrRedline( *pStt, n, sal_True ); + const SwRedline* pFnd = lcl_FindCurrRedline( *pStt, n, true ); if( pFnd && // Is new a part of it? ( *pFnd->Start() != *pStt || *pFnd->End() > *pEnd )) { @@ -2273,12 +2273,12 @@ const SwRedline* SwDoc::SelNextRedline( SwPaM& rPam ) const SwPosition& rSttPos = *rPam.GetPoint(); SwPosition aSavePos( rSttPos ); - sal_Bool bRestart; + bool bRestart; // If the starting positon points to the last valid ContentNode, // we take the next Redline in any case. sal_uInt16 n = 0; - const SwRedline* pFnd = lcl_FindCurrRedline( rSttPos, n, sal_True ); + const SwRedline* pFnd = lcl_FindCurrRedline( rSttPos, n, true ); if( pFnd ) { const SwPosition* pEnd = pFnd->End(); @@ -2295,7 +2295,7 @@ const SwRedline* SwDoc::SelNextRedline( SwPaM& rPam ) const } do { - bRestart = sal_False; + bRestart = false; for( ; !pFnd && n < pRedlineTbl->size(); ++n ) { @@ -2367,7 +2367,7 @@ const SwRedline* SwDoc::SelNextRedline( SwPaM& rPam ) const { if( n < pRedlineTbl->size() ) { - bRestart = sal_True; + bRestart = true; *rPam.GetPoint() = *pSaveFnd->End(); } else @@ -2390,12 +2390,12 @@ const SwRedline* SwDoc::SelPrevRedline( SwPaM& rPam ) const SwPosition& rSttPos = *rPam.GetPoint(); SwPosition aSavePos( rSttPos ); - sal_Bool bRestart; + bool bRestart; // If the starting positon points to the last valid ContentNode, // we take the previous Redline in any case. sal_uInt16 n = 0; - const SwRedline* pFnd = lcl_FindCurrRedline( rSttPos, n, sal_False ); + const SwRedline* pFnd = lcl_FindCurrRedline( rSttPos, n, false ); if( pFnd ) { const SwPosition* pStt = pFnd->Start(); @@ -2412,7 +2412,7 @@ const SwRedline* SwDoc::SelPrevRedline( SwPaM& rPam ) const } do { - bRestart = sal_False; + bRestart = false; while( !pFnd && 0 < n ) { @@ -2486,7 +2486,7 @@ const SwRedline* SwDoc::SelPrevRedline( SwPaM& rPam ) const { if( n ) { - bRestart = sal_True; + bRestart = true; *rPam.GetPoint() = *pSaveFnd->Start(); } else @@ -2505,16 +2505,16 @@ const SwRedline* SwDoc::SelPrevRedline( SwPaM& rPam ) const // Set comment at the Redline bool SwDoc::SetRedlineComment( const SwPaM& rPaM, const String& rS ) { - sal_Bool bRet = sal_False; + bool bRet = false; const SwPosition* pStt = rPaM.Start(), * pEnd = pStt == rPaM.GetPoint() ? rPaM.GetMark() : rPaM.GetPoint(); sal_uInt16 n = 0; - if( lcl_FindCurrRedline( *pStt, n, sal_True ) ) + if( lcl_FindCurrRedline( *pStt, n, true ) ) { for( ; n < pRedlineTbl->size(); ++n ) { - bRet = sal_True; + bRet = true; SwRedline* pTmp = (*pRedlineTbl)[ n ]; if( pStt != pEnd && *pTmp->Start() > *pEnd ) break; @@ -3519,19 +3519,19 @@ void SwRedline::DelCopyOfSection() const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl(); sal_uInt16 n = rTbl.GetPos( this ); OSL_ENSURE( n != USHRT_MAX, "How strange. We don't exist!" ); - for( sal_Bool bBreak = sal_False; !bBreak && n > 0; ) + for( bool bBreak = false; !bBreak && n > 0; ) { --n; - bBreak = sal_True; + bBreak = true; if( rTbl[ n ]->GetBound(sal_True) == *aPam.GetPoint() ) { rTbl[ n ]->GetBound(sal_True) = *pEnd; - bBreak = sal_False; + bBreak = false; } if( rTbl[ n ]->GetBound(sal_False) == *aPam.GetPoint() ) { rTbl[ n ]->GetBound(sal_False) = *pEnd; - bBreak = sal_False; + bBreak = false; } } @@ -3567,36 +3567,36 @@ void SwRedline::MoveFromSection() std::vector<SwPosition*> aBeforeArr, aBehindArr; sal_uInt16 nMyPos = rTbl.GetPos( this ); OSL_ENSURE( this, "this is not in the array?" ); - sal_Bool bBreak = sal_False; + bool bBreak = false; sal_uInt16 n; for( n = nMyPos+1; !bBreak && n < rTbl.size(); ++n ) { - bBreak = sal_True; + bBreak = true; if( rTbl[ n ]->GetBound(sal_True) == *GetPoint() ) { aBehindArr.push_back( &rTbl[ n ]->GetBound(sal_True) ); - bBreak = sal_False; + bBreak = false; } if( rTbl[ n ]->GetBound(sal_False) == *GetPoint() ) { aBehindArr.push_back( &rTbl[ n ]->GetBound(sal_False) ); - bBreak = sal_False; + bBreak = false; } } - for( bBreak = sal_False, n = nMyPos; !bBreak && n ; ) + for( bBreak = false, n = nMyPos; !bBreak && n ; ) { --n; - bBreak = sal_True; + bBreak = true; if( rTbl[ n ]->GetBound(sal_True) == *GetPoint() ) { aBeforeArr.push_back( &rTbl[ n ]->GetBound(sal_True) ); - bBreak = sal_False; + bBreak = false; } if( rTbl[ n ]->GetBound(sal_False) == *GetPoint() ) { aBeforeArr.push_back( &rTbl[ n ]->GetBound(sal_False) ); - bBreak = sal_False; + bBreak = false; } } diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx index 4513f580640b..98f2fd8f0735 100644 --- a/sw/source/core/doc/docruby.cxx +++ b/sw/source/core/doc/docruby.cxx @@ -62,7 +62,7 @@ sal_uInt16 SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList, { const SwPaM *_pStartCrsr = (SwPaM*)rPam.GetNext(), *__pStartCrsr = _pStartCrsr; - sal_Bool bCheckEmpty = &rPam != _pStartCrsr; + bool bCheckEmpty = &rPam != _pStartCrsr; do { const SwPosition* pStt = _pStartCrsr->Start(), * pEnd = pStt == _pStartCrsr->GetPoint() @@ -114,7 +114,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, const SwPaM *_pStartCrsr = (SwPaM*)rPam.GetNext(), *__pStartCrsr = _pStartCrsr; - sal_Bool bCheckEmpty = &rPam != _pStartCrsr; + bool bCheckEmpty = &rPam != _pStartCrsr; do { const SwPosition* pStt = _pStartCrsr->Start(), * pEnd = pStt == _pStartCrsr->GetPoint() @@ -143,7 +143,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, } else { - ResetAttrs( aPam, sal_True, aDelArr ); + ResetAttrs( aPam, true, aDelArr ); } } @@ -254,7 +254,7 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_ } } - sal_Bool bAlphaNum = sal_False; + bool bAlphaNum = false; long nWordEnd = nEnd; CharClass& rCC = GetAppCharClass(); while( nStart < nEnd ) @@ -274,14 +274,14 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_ } sal_Int32 nChType = rCC.getType( *pTxt, nStart ); - sal_Bool bIgnoreChar = sal_False, bIsAlphaNum = sal_False, bChkNxtWrd = sal_False; + bool bIgnoreChar = false, bIsAlphaNum = false, bChkNxtWrd = false; switch( nChType ) { case UnicodeType::UPPERCASE_LETTER: case UnicodeType::LOWERCASE_LETTER: case UnicodeType::TITLECASE_LETTER: case UnicodeType::DECIMAL_DIGIT_NUMBER: - bChkNxtWrd = bIsAlphaNum = sal_True; + bChkNxtWrd = bIsAlphaNum = true; break; case UnicodeType::SPACE_SEPARATOR: @@ -289,15 +289,15 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_ /*??*/ case UnicodeType::PRIVATE_USE: case UnicodeType::START_PUNCTUATION: case UnicodeType::END_PUNCTUATION: - bIgnoreChar = sal_True; + bIgnoreChar = true; break; case UnicodeType::OTHER_LETTER: - bChkNxtWrd = sal_True; + bChkNxtWrd = true; default: - bIsAlphaNum = sal_False; + bIsAlphaNum = false; break; } diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 0f23d50cfff3..d028a30e9ff2 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -173,15 +173,15 @@ int SwSortElement::keycompare(const SwSortElement& rCmp, sal_uInt16 nKey) const /*-------------------------------------------------------------------- Description: Comparison operators --------------------------------------------------------------------*/ -sal_Bool SwSortElement::operator==(const SwSortElement& ) const +bool SwSortElement::operator==(const SwSortElement& ) const { - return sal_False; + return false; } /*-------------------------------------------------------------------- Description: Less-than operator for sorting --------------------------------------------------------------------*/ -sal_Bool SwSortElement::operator<(const SwSortElement& rCmp) const +bool SwSortElement::operator<(const SwSortElement& rCmp) const { // The actual comparison for(sal_uInt16 nKey = 0; nKey < pOptions->aKeys.size(); ++nKey) @@ -194,7 +194,7 @@ sal_Bool SwSortElement::operator<(const SwSortElement& rCmp) const return nCmp < 0; } - return sal_False; + return false; } double SwSortElement::GetValue( sal_uInt16 nKey ) const @@ -317,7 +317,7 @@ double SwSortBoxElement::GetValue( sal_uInt16 nKey ) const /*-------------------------------------------------------------------- Description: Sort Text in the Document --------------------------------------------------------------------*/ -sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) +bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) { // Check if Frame is in the Text const SwPosition *pStart = rPaM.Start(), *pEnd = rPaM.End(); @@ -331,7 +331,7 @@ sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) if (pAPos && (FLY_AT_PARA == pAnchor->GetAnchorId()) && pStart->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode ) - return sal_False; + return false; } // Check if only TextNodes are within the Selection @@ -339,9 +339,9 @@ sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) sal_uLong nStart = pStart->nNode.GetIndex(), nEnd = pEnd->nNode.GetIndex(); while( nStart <= nEnd ) - // Iterate over a selected Area + // Iterate over a selected range if( !GetNodes()[ nStart++ ]->IsTxtNode() ) - return sal_False; + return false; } bool const bUndo = GetIDocumentUndoRedo().DoesUndo(); @@ -368,12 +368,12 @@ sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) pRedlUndo = new SwUndoRedlineSort( *pRedlPam,rOpt ); GetIDocumentUndoRedo().DoUndo(false); } - // First copy the area + // First copy the range SwNodeIndex aEndIdx( pEnd->nNode, 1 ); SwNodeRange aRg( pStart->nNode, aEndIdx ); GetNodes()._Copy( aRg, aEndIdx ); - // Area is new from pEnd->nNode+1 to aEndIdx + // range is new from pEnd->nNode+1 to aEndIdx DeleteRedline( *pRedlPam, true, USHRT_MAX ); pRedlPam->GetMark()->nNode.Assign( pEnd->nNode.GetNode(), 1 ); @@ -406,10 +406,10 @@ sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) SwSortTxtElements aSortSet; while( aStart <= pEnd->nNode ) { - // Iterate over a selected Area + // Iterate over a selected range SwSortTxtElement* pSE = new SwSortTxtElement( aStart ); aSortSet.insert(pSE); - aStart++; + ++aStart; } // Now comes the tricky part: Move Nodes (and always keep Undo in mind) @@ -497,19 +497,19 @@ sal_Bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } - return sal_True; + return true; } /*-------------------------------------------------------------------- Description: Sort Table in the Document --------------------------------------------------------------------*/ -sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt) +bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt) { // Via SwDoc for Undo! OSL_ENSURE( !rBoxes.empty(), "no valid Box list" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) - return sal_False; + return false; // We begin sorting // Find all Boxes/Lines @@ -520,7 +520,7 @@ sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt) } if(aFndBox.GetLines().empty()) - return sal_False; + return false; if( !IsIgnoreRedline() && !GetRedlineTbl().empty() ) DeleteRedline( *pTblNd, true, USHRT_MAX ); @@ -558,7 +558,7 @@ sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt) FlatFndBox aFlatBox(this, aFndBox); if(!aFlatBox.IsSymmetric()) - return sal_False; + return false; // Delete HTML layout pTblNd->GetTable().SetHTMLTableLayout( 0 ); @@ -628,7 +628,7 @@ sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt) SwSortElement::Finit(); SetModified(); - return sal_True; + return true; } /*-------------------------------------------------------------------- @@ -647,7 +647,7 @@ void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT, const SwTableBox* pT = pTarget->GetBox(); const SwTableBox* pS = pSource->GetBox(); - sal_Bool bMoved = rMovedList.GetPos(pT) != USHRT_MAX; + bool bMoved = rMovedList.GetPos(pT) != USHRT_MAX; // and move it MoveCell(pDoc, pS, pT, bMoved, pUD); @@ -695,7 +695,7 @@ void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT, const SwTableBox* pS = pSource->GetBox(); // and move it - sal_Bool bMoved = rMovedList.GetPos(pT) != USHRT_MAX; + bool bMoved = rMovedList.GetPos(pT) != USHRT_MAX; MoveCell(pDoc, pS, pT, bMoved, pUD); rMovedList.push_back(pS); @@ -727,7 +727,7 @@ void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT, Description: Move a single Cell --------------------------------------------------------------------*/ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar, - sal_Bool bMovedBefore, SwUndoSort* pUD) + bool bMovedBefore, SwUndoSort* pUD) { OSL_ENSURE(pSource && pTar,"Source or target missing"); @@ -750,12 +750,12 @@ void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, const SwTableBox* pTar, aRg.aEnd = *pNd->EndOfSectionNode(); // If the Target is empty (there is one empty Node) - // -> delete it and move the Target + // -> move and delete it SwNodeIndex aTar( *pTar->GetSttNd() ); pNd = pDoc->GetNodes().GoNext( &aTar ); // next ContentNode sal_uLong nCount = pNd->EndOfSectionIndex() - pNd->StartOfSectionIndex(); - sal_Bool bDelFirst = sal_False; + bool bDelFirst = false; if( nCount == 2 ) { OSL_ENSURE( pNd->GetCntntNode(), "No ContentNode"); @@ -789,7 +789,7 @@ FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox) : nRow(0), nCol(0) { // If the array is symmetric - if((bSym = CheckLineSymmetry(rBoxRef)) != 0) + if( (bSym = CheckLineSymmetry(rBoxRef)) ) { // Determine column/row count nCols = GetColCount(rBoxRef); @@ -815,54 +815,52 @@ FlatFndBox::~FlatFndBox() } /*-------------------------------------------------------------------- - Description: All Lines of a Box need to have as many Boxes + Description: All Lines of a Box need to have same number of Boxes --------------------------------------------------------------------*/ -sal_Bool FlatFndBox::CheckLineSymmetry(const _FndBox& rBox) +bool FlatFndBox::CheckLineSymmetry(const _FndBox& rBox) { const _FndLines &rLines = rBox.GetLines(); sal_uInt16 nBoxes(0); - // Iterate over Lines for(sal_uInt16 i=0; i < rLines.size(); ++i) - { // A List's Box + { const _FndLine* pLn = &rLines[i]; const _FndBoxes& rBoxes = pLn->GetBoxes(); - // Amount of Boxes of all Lines is uneven -> no symmetry + // Number of Boxes of all Lines is unequal -> no symmetry if( i && nBoxes != rBoxes.size()) - return sal_False; + return false; nBoxes = rBoxes.size(); if( !CheckBoxSymmetry( *pLn ) ) - return sal_False; + return false; } - return sal_True; + return true; } /*-------------------------------------------------------------------- Description: Check Box for symmetry - All Boxes of a Line need to have as many Lines + All Boxes of a Line need to have same number of Lines --------------------------------------------------------------------*/ -sal_Bool FlatFndBox::CheckBoxSymmetry(const _FndLine& rLn) +bool FlatFndBox::CheckBoxSymmetry(const _FndLine& rLn) { const _FndBoxes &rBoxes = rLn.GetBoxes(); sal_uInt16 nLines(0); - // Iterate over Boxes for(sal_uInt16 i=0; i < rBoxes.size(); ++i) - { // The Boxes of a Line + { _FndBox const*const pBox = &rBoxes[i]; const _FndLines& rLines = pBox->GetLines(); - // Amount of Boxes of all Lines is uneven -> no symmetry + // Number of Lines of all Boxes is unequal -> no symmetry if( i && nLines != rLines.size() ) - return sal_False; + return false; nLines = rLines.size(); if( nLines && !CheckLineSymmetry( *pBox ) ) - return sal_False; + return false; } - return sal_True; + return true; } /*-------------------------------------------------------------------- @@ -919,9 +917,9 @@ sal_uInt16 FlatFndBox::GetRowCount(const _FndBox& rBox) /*-------------------------------------------------------------------- Description: Create a linear array of atmoic FndBoxes --------------------------------------------------------------------*/ -void FlatFndBox::FillFlat(const _FndBox& rBox, sal_Bool bLastBox) +void FlatFndBox::FillFlat(const _FndBox& rBox, bool bLastBox) { - sal_Bool bModRow = sal_False; + bool bModRow = false; const _FndLines& rLines = rBox.GetLines(); // Iterate over Lines @@ -960,7 +958,7 @@ void FlatFndBox::FillFlat(const _FndBox& rBox, sal_Bool bLastBox) *(ppItemSets + nOff ) = pSet; } - bModRow = sal_True; + bModRow = true; } else { diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 180db6130c81..0d04f3d131bd 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -345,7 +345,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark, const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos, const SwTOXBase& rTOX, const SfxItemSet* pSet, - sal_Bool bExpand ) + bool bExpand ) { GetIDocumentUndoRedo().StartUndo( UNDO_INSTOX, NULL ); @@ -467,7 +467,7 @@ const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const return pFmt->GetAttrSet(); } -const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate ) +const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, bool bCreate ) { SwTOXBase** prBase = 0; switch(eTyp) @@ -510,10 +510,10 @@ void SwDoc::SetDefaultTOXBase(const SwTOXBase& rBase) /*-------------------------------------------------------------------- Description: Delete table of contents --------------------------------------------------------------------*/ -sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes ) +bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes ) { // We only delete the TOX, not the Nodes - sal_Bool bRet = sal_False; + bool bRet = false; OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase; @@ -592,7 +592,7 @@ sal_Bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes ) DelSectionFmt( pFmt, bDelNodes ); GetIDocumentUndoRedo().EndUndo( UNDO_CLEARTOXRANGE, NULL ); - bRet = sal_True; + bRet = true; } return bRet; @@ -680,14 +680,14 @@ String SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType, return aName += String::CreateFromInt32( ++nNum ); } -sal_Bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName) +bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const String& rName) { OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOXBase; String sTmp = GetUniqueTOXBaseName(*rTOXBase.GetTOXType(), &rName); - sal_Bool bRet = sTmp == rName; + bool bRet = sTmp == rName; if(bRet) { pTOX->SetTOXName(rName); @@ -732,9 +732,9 @@ SwTOXBaseSection::~SwTOXBaseSection() { } -sal_Bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart ) const +bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, bool bAtStart ) const { - sal_Bool bRet = sal_False; + bool bRet = false; const SwSectionNode* pSectNd = GetFmt()->GetSectionNode(); if( pSectNd ) { @@ -752,7 +752,7 @@ sal_Bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart if( pCNd ) nC = pCNd->Len(); } rPos.nContent.Assign( pCNd, nC ); - bRet = sal_True; + bRet = true; } return bRet; } @@ -1430,7 +1430,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType, case nsSwTOXElement::TOX_OLE: if( pNd->IsOLENode() ) { - sal_Bool bInclude = sal_True; + bool bInclude = true; if(TOX_OBJECTS == SwTOXBase::GetType()) { SwOLENode* pOLENode = pNd->GetOLENode(); @@ -1447,7 +1447,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType, else { OSL_FAIL("OLE Object no loaded?"); - bInclude = sal_False; + bInclude = false; } } @@ -1547,7 +1547,7 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode ) Description: Generate String according to the Form and remove the special characters 0-31 and 255 --------------------------------------------------------------------*/ -static String lcl_GetNumString( const SwTOXSortTabBase& rBase, sal_Bool bUsePrefix, sal_uInt8 nLevel ) +static String lcl_GetNumString( const SwTOXSortTabBase& rBase, bool bUsePrefix, sal_uInt8 nLevel ) { String sRet; @@ -1619,7 +1619,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, case TOKEN_ENTRY: { // for TOC numbering - rTxt.Insert( lcl_GetNumString( rBase, sal_True, MAXLEVEL )); + rTxt.Insert( lcl_GetNumString( rBase, true, MAXLEVEL )); SwIndex aIdx( pTOXNd, rTxt.Len() ); rBase.FillText( *pTOXNd, aIdx ); @@ -1649,7 +1649,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, const SwPageDesc* pPageDesc = ((SwFmtPageDesc&)pTOXNd-> SwCntntNode::GetAttr( RES_PAGEDESC )).GetPageDesc(); - sal_Bool bCallFindRect = sal_True; + bool bCallFindRect = true; long nRightMargin; if( pPageDesc ) { @@ -1657,7 +1657,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, if( !pFrm || 0 == ( pFrm = pFrm->FindPageFrm() ) || pPageDesc != ((SwPageFrm*)pFrm)->GetPageDesc() ) // we have to go via the PageDesc here - bCallFindRect = sal_False; + bCallFindRect = false; } SwRect aNdRect; @@ -1966,12 +1966,12 @@ void SwTOXBaseSection::UpdatePageNum() Description: Replace the PageNumber place holders --------------------------------------------------------------------*/ // search for the page no in the array of main entry page numbers -static sal_Bool lcl_HasMainEntry( const std::vector<sal_uInt16>* pMainEntryNums, sal_uInt16 nToFind ) +static bool lcl_HasMainEntry( const std::vector<sal_uInt16>* pMainEntryNums, sal_uInt16 nToFind ) { for(sal_uInt16 i = 0; pMainEntryNums && i < pMainEntryNums->size(); ++i) if(nToFind == (*pMainEntryNums)[i]) - return sal_True; - return sal_False; + return true; + return false; } void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, @@ -2035,7 +2035,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, // Add up all following // break up if main entry starts or ends and // insert a char style index - sal_Bool bMainEntryChanges = lcl_HasMainEntry(pMainEntryNums, nOld) + bool bMainEntryChanges = lcl_HasMainEntry(pMainEntryNums, nOld) != lcl_HasMainEntry(pMainEntryNums, rNums[i]); if(nOld == rNums[i]-1 && !bMainEntryChanges && @@ -2294,10 +2294,10 @@ Range SwTOXBaseSection::GetKeyRange(const String& rStr, const String& rStrReadin return Range(nStart, nEnd); } -sal_Bool SwTOXBase::IsTOXBaseInReadonly() const +bool SwTOXBase::IsTOXBaseInReadonly() const { const SwTOXBaseSection *pSect = dynamic_cast<const SwTOXBaseSection*>(this); - sal_Bool bRet = sal_False; + bool bRet = false; const SwSectionNode* pSectNode; if(pSect && pSect->GetFmt() && 0 != (pSectNode = pSect->GetFmt()->GetSectionNode())) @@ -2327,7 +2327,7 @@ void SwTOXBase::SetAttrSet( const SfxItemSet& rSet ) pSect->GetFmt()->SetFmtAttr( rSet ); } -sal_Bool SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const +bool SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const { switch( rInfo.Which() ) { @@ -2337,9 +2337,9 @@ sal_Bool SwTOXBase::GetInfo( SfxPoolItem& rInfo ) const if( pSect && pSect->GetFmt() ) pSect->GetFmt()->GetInfo( rInfo ); } - return sal_False; + return false; } - return sal_True; + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 0e65267f7e15..7058d8b6c00c 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -335,18 +335,18 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) SwFmtColl::Modify( pOld, pNew ); } -sal_Bool SwTxtFmtColl::IsAtDocNodeSet() const +bool SwTxtFmtColl::IsAtDocNodeSet() const { SwIterator<SwCntntNode,SwFmtColl> aIter( *this ); const SwNodes& rNds = GetDoc()->GetNodes(); for( SwCntntNode* pNode = aIter.First(); pNode; pNode = aIter.Next() ) if( &(pNode->GetNodes()) == &rNds ) - return sal_True; + return true; - return sal_False; + return false; } -sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr ) +bool SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr ) { const bool bIsNumRuleItem = rAttr.Which() == RES_PARATR_NUMRULE; if ( bIsNumRuleItem ) @@ -354,7 +354,7 @@ sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr ) TxtFmtCollFunc::RemoveFromNumRule( *this ); } - const sal_Bool bRet = SwFmtColl::SetFmtAttr( rAttr ); + const bool bRet = SwFmtColl::SetFmtAttr( rAttr ); if ( bIsNumRuleItem ) { @@ -364,7 +364,7 @@ sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxPoolItem& rAttr ) return bRet; } -sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxItemSet& rSet ) +bool SwTxtFmtColl::SetFmtAttr( const SfxItemSet& rSet ) { const bool bIsNumRuleItemAffected = rSet.GetItemState( RES_PARATR_NUMRULE, sal_False ) == SFX_ITEM_SET; @@ -373,7 +373,7 @@ sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxItemSet& rSet ) TxtFmtCollFunc::RemoveFromNumRule( *this ); } - const sal_Bool bRet = SwFmtColl::SetFmtAttr( rSet ); + const bool bRet = SwFmtColl::SetFmtAttr( rSet ); if ( bIsNumRuleItemAffected ) { @@ -383,7 +383,7 @@ sal_Bool SwTxtFmtColl::SetFmtAttr( const SfxItemSet& rSet ) return bRet; } -sal_Bool SwTxtFmtColl::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) +bool SwTxtFmtColl::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) { const bool bIsNumRuleItemAffected = ( nWhich2 != 0 && nWhich2 > nWhich1 ) @@ -395,7 +395,7 @@ sal_Bool SwTxtFmtColl::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) TxtFmtCollFunc::RemoveFromNumRule( *this ); } - const sal_Bool bRet = SwFmtColl::ResetFmtAttr( nWhich1, nWhich2 ); + const bool bRet = SwFmtColl::ResetFmtAttr( nWhich1, nWhich2 ); return bRet; } @@ -597,14 +597,14 @@ void SwConditionTxtFmtColl::InsertCondition( const SwCollCondition& rCond ) } -sal_Bool SwConditionTxtFmtColl::RemoveCondition( const SwCollCondition& rCond ) +bool SwConditionTxtFmtColl::RemoveCondition( const SwCollCondition& rCond ) { - sal_Bool bRet = sal_False; + bool bRet = false; for( sal_uInt16 n = 0; n < aCondColls.size(); ++n ) if( aCondColls[ n ] == rCond ) { aCondColls.erase( aCondColls.begin() + n ); - bRet = sal_True; + bRet = true; } return bRet; diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx index 50e7bdec8bd8..6b60f6d9b00f 100644 --- a/sw/source/core/doc/ftnidx.cxx +++ b/sw/source/core/doc/ftnidx.cxx @@ -121,7 +121,7 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt ) SwUpdFtnEndNtAtEnd aNumArr; // unless we have per-document numbering, only look at endnotes here - const sal_Bool bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum; + const bool bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum; sal_uInt16 nPos, nFtnNo = 1, nEndNo = 1; sal_uLong nUpdNdIdx = rStt.GetIndex(); @@ -225,8 +225,8 @@ void SwFtnIdxs::UpdateAllFtn() } - // We use sal_Bool here, so that we also iterate through the Endnotes with a chapter setting. - const sal_Bool bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum; + // We use bool here, so that we also iterate through the Endnotes with a chapter setting. + const bool bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum; sal_uInt16 nFtnNo = 0, nEndNo = 0; for( sal_uInt16 nPos = 0; nPos < size(); ++nPos ) { diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx index a039c706833a..2a2e31290b15 100644 --- a/sw/source/core/doc/gctable.cxx +++ b/sw/source/core/doc/gctable.cxx @@ -35,13 +35,13 @@ using namespace ::editeng; -inline const SvxBorderLine* GetLineTB( const SvxBoxItem* pBox, sal_Bool bTop ) +inline const SvxBorderLine* GetLineTB( const SvxBoxItem* pBox, bool bTop ) { return bTop ? pBox->GetTop() : pBox->GetBottom(); } -sal_Bool _SwGCBorder_BoxBrd::CheckLeftBorderOfFormat( const SwFrmFmt& rFmt ) +bool _SwGCBorder_BoxBrd::CheckLeftBorderOfFormat( const SwFrmFmt& rFmt ) { const SvxBorderLine* pBrd; const SfxPoolItem* pItem; @@ -49,10 +49,10 @@ sal_Bool _SwGCBorder_BoxBrd::CheckLeftBorderOfFormat( const SwFrmFmt& rFmt ) 0 != ( pBrd = ((SvxBoxItem*)pItem)->GetLeft() ) ) { if( *pBrdLn == *pBrd ) - bAnyBorderFnd = sal_True; - return sal_True; + bAnyBorderFnd = true; + return true; } - return sal_False; + return false; } @@ -104,7 +104,7 @@ static void lcl_GCBorder_GetLastBox_B( const SwTableBox* pBox, SwTableBoxes* pPa // Find the "end" of the passed BorderLine. Returns the "Layout"Pos! static sal_uInt16 lcl_FindEndPosOfBorder( const SwCollectTblLineBoxes& rCollTLB, - const SvxBorderLine& rBrdLn, sal_uInt16& rStt, sal_Bool bTop ) + const SvxBorderLine& rBrdLn, sal_uInt16& rStt, bool bTop ) { sal_uInt16 nPos, nLastPos = 0; for( sal_uInt16 nEnd = rCollTLB.Count(); rStt < nEnd; ++rStt ) @@ -123,7 +123,7 @@ static sal_uInt16 lcl_FindEndPosOfBorder( const SwCollectTblLineBoxes& rCollTLB, } static inline const SvxBorderLine* lcl_GCBorder_GetBorder( const SwTableBox& rBox, - sal_Bool bTop, + bool bTop, const SfxPoolItem** ppItem ) { return SFX_ITEM_SET == rBox.GetFrmFmt()->GetItemState( RES_BOX, sal_True, ppItem ) @@ -132,7 +132,7 @@ static inline const SvxBorderLine* lcl_GCBorder_GetBorder( const SwTableBox& rBo } static void lcl_GCBorder_DelBorder( const SwCollectTblLineBoxes& rCollTLB, - sal_uInt16& rStt, sal_Bool bTop, + sal_uInt16& rStt, bool bTop, const SvxBorderLine& rLine, const SfxPoolItem* pItem, sal_uInt16 nEndPos, @@ -166,7 +166,7 @@ static void lcl_GCBorder_DelBorder( const SwCollectTblLineBoxes& rCollTLB, pLn = lcl_GCBorder_GetBorder( *pBox, bTop, &pItem ); - } while( sal_True ); + } while( true ); } static void lcl_GC_Box_Border( const SwTableBox* pBox, _SwGCLineBorder* pPara ); @@ -234,23 +234,23 @@ void sw_GC_Line_Border( const SwTableLine* pLine, _SwGCLineBorder* pGCPara ) *pTopBox = &aTop.GetBox( nSttTop++, &nTopPos ); const SfxPoolItem *pBtmItem = 0, *pTopItem = 0; const SvxBorderLine *pBtmLine(0), *pTopLine(0); - sal_Bool bGetTopItem = sal_True, bGetBtmItem = sal_True; + bool bGetTopItem = true, bGetBtmItem = true; do { if( bGetBtmItem ) - pBtmLine = lcl_GCBorder_GetBorder( *pBtmBox, sal_False, &pBtmItem ); + pBtmLine = lcl_GCBorder_GetBorder( *pBtmBox, false, &pBtmItem ); if( bGetTopItem ) - pTopLine = lcl_GCBorder_GetBorder( *pTopBox, sal_True, &pTopItem ); + pTopLine = lcl_GCBorder_GetBorder( *pTopBox, true, &pTopItem ); if( pTopLine && pBtmLine && *pTopLine == *pBtmLine ) { // We can remove one, but which one? sal_uInt16 nSavSttBtm = nSttBtm, nSavSttTop = nSttTop; sal_uInt16 nBtmEndPos = ::lcl_FindEndPosOfBorder( aBottom, - *pTopLine, nSttBtm, sal_False ); + *pTopLine, nSttBtm, false ); if( !nBtmEndPos ) nBtmEndPos = nBtmPos; sal_uInt16 nTopEndPos = ::lcl_FindEndPosOfBorder( aTop, - *pTopLine, nSttTop, sal_True ); + *pTopLine, nSttTop, true ); if( !nTopEndPos ) nTopEndPos = nTopPos; @@ -259,7 +259,7 @@ void sw_GC_Line_Border( const SwTableLine* pLine, _SwGCLineBorder* pGCPara ) // Delete the TopBorders until BottomEndPos nSttTop = nSavSttTop; if( nTopPos <= nBtmEndPos ) - lcl_GCBorder_DelBorder( aTop, --nSttTop, sal_True, + lcl_GCBorder_DelBorder( aTop, --nSttTop, true, *pBtmLine, pTopItem, nBtmEndPos, pGCPara->pShareFmts ); else @@ -270,7 +270,7 @@ void sw_GC_Line_Border( const SwTableLine* pLine, _SwGCLineBorder* pGCPara ) // Else delete the BottomBorders until TopEndPos nSttBtm = nSavSttBtm; if( nBtmPos <= nTopEndPos ) - lcl_GCBorder_DelBorder( aBottom, --nSttBtm, sal_False, + lcl_GCBorder_DelBorder( aBottom, --nSttBtm, false, *pTopLine, pBtmItem, nTopEndPos, pGCPara->pShareFmts ); else @@ -286,26 +286,26 @@ void sw_GC_Line_Border( const SwTableLine* pLine, _SwGCLineBorder* pGCPara ) pBtmBox = &aBottom.GetBox( nSttBtm++, &nBtmPos ); pTopBox = &aTop.GetBox( nSttTop++, &nTopPos ); - bGetTopItem = bGetBtmItem = sal_True; + bGetTopItem = bGetBtmItem = true; } else if( nTopPos < nBtmPos ) { if( nSttTop >= nEndTop ) break; pTopBox = &aTop.GetBox( nSttTop++, &nTopPos ); - bGetTopItem = sal_True; - bGetBtmItem = sal_False; + bGetTopItem = true; + bGetBtmItem = false; } else { if( nSttBtm >= nEndBtm ) break; pBtmBox = &aBottom.GetBox( nSttBtm++, &nBtmPos ); - bGetTopItem = sal_False; - bGetBtmItem = sal_True; + bGetTopItem = false; + bGetBtmItem = true; } - } while( sal_True ); + } while( true ); } for( SwTableBoxes::const_iterator it = pLine->GetTabBoxes().begin(); diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 4dea4f718a43..409ae1c3ea50 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -88,7 +88,7 @@ public: SwHTMLTableLayoutCnts::SwHTMLTableLayoutCnts( const SwStartNode *pSttNd, SwHTMLTableLayout* pTab, - sal_Bool bNoBrTag, + bool bNoBrTag, SwHTMLTableLayoutCnts* pNxt ) : pNext( pNxt ), pBox( 0 ), pTable( pTab ), pStartNode( pSttNd ), nPass1Done( 0 ), nWidthSet( 0 ), bNoBreakTag( bNoBrTag ) @@ -437,7 +437,7 @@ SwFrmFmt *SwHTMLTableLayout::FindFlyFrmFmt() const static void lcl_GetMinMaxSize( sal_uLong& rMinNoAlignCnts, sal_uLong& rMaxNoAlignCnts, sal_uLong& rAbsMinNoAlignCnts, - SwTxtNode *pTxtNd, sal_uLong nIdx, sal_Bool bNoBreak ) + SwTxtNode *pTxtNd, sal_uLong nIdx, bool bNoBreak ) { pTxtNd->GetMinMaxSize( nIdx, rMinNoAlignCnts, rMaxNoAlignCnts, rAbsMinNoAlignCnts ); diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx index 00552a91c8bd..5aa327083d4e 100644 --- a/sw/source/core/doc/lineinfo.cxx +++ b/sw/source/core/doc/lineinfo.cxx @@ -107,7 +107,7 @@ SwLineNumberInfo& SwLineNumberInfo::operator=(const SwLineNumberInfo &rCpy) return *this; } -sal_Bool SwLineNumberInfo::operator==( const SwLineNumberInfo& rInf ) const +bool SwLineNumberInfo::operator==( const SwLineNumberInfo& rInf ) const { return GetRegisteredIn() == rInf.GetRegisteredIn() && aType.GetNumberingType() == rInf.GetNumType().GetNumberingType() && diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx index df6a7d494a21..941f94c5bf5d 100644 --- a/sw/source/core/doc/list.cxx +++ b/sw/source/core/doc/list.cxx @@ -51,7 +51,7 @@ class SwListImpl void ValidateListTree(); void MarkListLevel( const int nListLevel, - const sal_Bool bValue ); + const bool bValue ); bool IsListLevelMarked( const int nListLevel ) const; @@ -177,7 +177,7 @@ void SwListImpl::ValidateListTree() } void SwListImpl::MarkListLevel( const int nListLevel, - const sal_Bool bValue ) + const bool bValue ) { if ( bValue ) { @@ -270,7 +270,7 @@ void SwList::ValidateListTree() } void SwList::MarkListLevel( const int nListLevel, - const sal_Bool bValue ) + const bool bValue ) { mpListImpl->MarkListLevel( nListLevel, bValue ); } diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index c4f0ad5b6cb6..423dc355d2a9 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -1,30 +1,21 @@ /* -*- 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 the LibreOffice project. * - * This file is part of OpenOffice.org. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * 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. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ #include <hintids.hxx> #include <tools/urlobj.hxx> @@ -75,17 +66,22 @@ #include <com/sun/star/embed/EmbedStates.hpp> #include <svtools/embedhlp.hxx> -#include <svtools/chartprettypainter.hxx> +#include <svx/charthelper.hxx> #include <dview.hxx> // #i99665# +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <drawinglayer/processor2d/processorfromoutputdevice.hxx> +#include <drawinglayer/processor2d/baseprocessor2d.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> + using namespace com::sun::star; extern void ClrContourCache( const SdrObject *pObj ); // TxtFly.Cxx -inline sal_Bool GetRealURL( const SwGrfNode& rNd, String& rTxt ) +inline bool GetRealURL( const SwGrfNode& rNd, String& rTxt ) { - sal_Bool bRet = rNd.GetFileFilterNms( &rTxt, 0 ); + bool bRet = rNd.GetFileFilterNms( &rTxt, 0 ); if( bRet ) rTxt = URIHelper::removePassword( rTxt, INetURLObject::WAS_ENCODED, INetURLObject::DECODE_UNAMBIGUOUS); @@ -94,7 +90,7 @@ inline sal_Bool GetRealURL( const SwGrfNode& rNd, String& rTxt ) static void lcl_PaintReplacement( const SwRect &rRect, const String &rText, const ViewShell &rSh, const SwNoTxtFrm *pFrm, - sal_Bool bDefect ) + bool bDefect ) { static Font *pFont = 0; if ( !pFont ) @@ -112,7 +108,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, const String &rText, const SwFmtURL &rURL = pFrm->FindFlyFrm()->GetFmt()->GetURL(); if( rURL.GetURL().Len() || rURL.GetMap() ) { - sal_Bool bVisited = sal_False; + bool bVisited = false; if ( rURL.GetMap() ) { ImageMap *pMap = (ImageMap*)rURL.GetMap(); @@ -121,7 +117,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, const String &rText, IMapObject *pObj = pMap->GetIMapObject( i ); if( rSh.GetDoc()->IsVisitedURL( pObj->GetURL() ) ) { - bVisited = sal_True; + bVisited = true; break; } } @@ -138,7 +134,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, const String &rText, pFont->SetUnderline( eUnderline ); pFont->SetColor( aCol ); - const BitmapEx& rBmp = ViewShell::GetReplacementBitmap( bDefect != sal_False ); + const BitmapEx& rBmp = ViewShell::GetReplacementBitmap( bDefect ); Graphic::DrawEx( rSh.GetOut(), rText, *pFont, rBmp, rRect.Pos(), rRect.SSize() ); } @@ -253,7 +249,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const GetRealURL( *(SwGrfNode*)pNd, aTxt ); if( !aTxt.Len() ) aTxt = FindFlyFrm()->GetFmt()->GetName(); - lcl_PaintReplacement( Frm(), aTxt, *pSh, this, sal_False ); + lcl_PaintReplacement( Frm(), aTxt, *pSh, this, false ); } return; } @@ -267,7 +263,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const OutputDevice *pOut = pSh->GetOut(); pOut->Push(); - sal_Bool bClip = sal_True; + bool bClip = true; PolyPolygon aPoly; SwNoTxtNode& rNoTNd = *(SwNoTxtNode*)GetNode(); @@ -284,7 +280,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ) { pOut->SetClipRegion( aPoly ); - bClip = sal_False; + bClip = false; } SwRect aOrigPaint( rRect ); @@ -373,7 +369,7 @@ static void lcl_CalcRect( Point& rPt, Size& rDim, sal_uInt16 nMirror ) *************************************************************************/ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, - sal_Bool ) const + bool ) const { // Currently only used for scaling, cropping and mirroring the contour of graphics! // Everything else is handled by GraphicObject @@ -636,7 +632,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) SwCntntFrm::Modify( pOld, pNew ); } - sal_Bool bComplete = sal_True; + bool bComplete = true; switch( nWhich ) { @@ -646,7 +642,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) case RES_GRF_REREAD_AND_INCACHE: if( ND_GRFNODE == GetNode()->GetNodeType() ) { - bComplete = sal_False; + bComplete = false; SwGrfNode* pNd = (SwGrfNode*) GetNode(); ViewShell *pVSh = 0; @@ -701,7 +697,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) case RES_LINKED_GRAPHIC_STREAM_ARRIVED: if ( GetNode()->GetNodeType() == ND_GRFNODE ) { - bComplete = sal_False; + bComplete = false; SwGrfNode* pNd = (SwGrfNode*) GetNode(); CLEARCACHE( pNd ) @@ -774,6 +770,92 @@ static void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInAr } } +bool paintUsingPrimitivesHelper( + OutputDevice& rOutputDevice, + const drawinglayer::primitive2d::Primitive2DSequence& rSequence, + const basegfx::B2DRange& rSourceRange, + const basegfx::B2DRange& rTargetRange, + const sal_Int32 nLeftCrop = 0, + const sal_Int32 nTopCrop = 0, + const sal_Int32 nRightCrop = 0, + const sal_Int32 nBottomCrop = 0, + const bool bMirrorX = false, + const bool bMirrorY = false) +{ + const double fSourceWidth(rSourceRange.getWidth()); + const double fSourceHeight(rSourceRange.getHeight()); + + if(rSequence.hasElements() && !basegfx::fTools::equalZero(fSourceWidth) && !basegfx::fTools::equalZero(fSourceHeight)) + { + // copy target range and apply evtl. cropping + basegfx::B2DRange aTargetRange(rTargetRange); + + if(nLeftCrop || nTopCrop || nRightCrop || nBottomCrop) + { + // calculate original TargetRange + const double fFactor100thmmToTwips(72.0 / 127.0); + + aTargetRange = basegfx::B2DRange( + aTargetRange.getMinX() - (nLeftCrop * fFactor100thmmToTwips), + aTargetRange.getMinY() - (nTopCrop * fFactor100thmmToTwips), + aTargetRange.getMaxX() + (nRightCrop * fFactor100thmmToTwips), + aTargetRange.getMaxY() + (nBottomCrop * fFactor100thmmToTwips)); + } + + const double fTargetWidth(aTargetRange.getWidth()); + const double fTargetHeight(aTargetRange.getHeight()); + + if(!basegfx::fTools::equalZero(fTargetWidth) && !basegfx::fTools::equalZero(fTargetHeight)) + { + // map graphic range to target range. This will automatically include + // tme mapping from Svg 1/100th mm content to twips since the target + // range is twips already + basegfx::B2DHomMatrix aMappingTransform( + basegfx::tools::createTranslateB2DHomMatrix( + -rSourceRange.getMinX(), + -rSourceRange.getMinY())); + + aMappingTransform.scale(fTargetWidth / fSourceWidth, fTargetHeight / fSourceHeight); + aMappingTransform.translate(aTargetRange.getMinX(), aTargetRange.getMinY()); + + // apply mirrorings + if(bMirrorX || bMirrorY) + { + aMappingTransform.translate(-aTargetRange.getCenterX(), -aTargetRange.getCenterY()); + aMappingTransform.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0); // #119176# small typo with X/Y + aMappingTransform.translate(aTargetRange.getCenterX(), aTargetRange.getCenterY()); + } + + // Fill ViewInformation. Use MappingTransform here, so there is no need to + // embed the primitives to it. Use original TargetRange here so there is also + // no need to embed the primitives to a MaskPrimitive for cropping. This works + // only in this case where the graphic object cannot be rotated, though. + const drawinglayer::geometry::ViewInformation2D aViewInformation2D( + aMappingTransform, + rOutputDevice.GetViewTransformation(), + aTargetRange, + 0, + 0.0, + uno::Sequence< beans::PropertyValue >()); + + // get a primitive processor for rendering + drawinglayer::processor2d::BaseProcessor2D* pProcessor2D = + drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice( + rOutputDevice, aViewInformation2D); + + if(pProcessor2D) + { + // render and cleanup + pProcessor2D->process(rSequence); + delete pProcessor2D; + return true; + } + } + } + + return false; +} + // Paint the graphic. // We require either a QuickDraw-Bitmap or a graphic here. If we do not have // either, we return a replacement. @@ -791,7 +873,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons const sal_Bool bPrn = pOut == rNoTNd.getIDocumentDeviceAccess()->getPrinter( false ) || pOut->GetConnectMetaFile(); - const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() ); + const bool bIsChart = pOLENd && ChartHelper::IsChart( pOLENd->GetOLEObj().GetObject() ); // calculate aligned rectangle from parameter <rGrfArea>. // Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in @@ -824,7 +906,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons pOut->SetAntialiasing( nFormerAntialiasingAtOutput | ANTIALIASING_ENABLE_B2DDRAW ); } - sal_Bool bForceSwap = sal_False, bContinue = sal_True; + bool bForceSwap = false, bContinue = true; GraphicObject& rGrfObj = pGrfNd->GetGrfObj(); GraphicAttr aGrfAttr; @@ -856,8 +938,8 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons String aTxt( pGrfNd->GetTitle() ); if ( !aTxt.Len() ) GetRealURL( *pGrfNd, aTxt ); - ::lcl_PaintReplacement( aAlignedGrfArea, aTxt, *pShell, this, sal_False ); - bContinue = sal_False; + ::lcl_PaintReplacement( aAlignedGrfArea, aTxt, *pShell, this, false ); + bContinue = false; } else if( rGrfObj.IsCached( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr )) @@ -865,17 +947,17 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons rGrfObj.DrawWithPDFHandling( *pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr ); - bContinue = sal_False; + bContinue = false; } } if( bContinue ) { const sal_Bool bSwapped = rGrfObj.IsSwappedOut(); - const sal_Bool bSwappedIn = 0 != pGrfNd->SwapIn( bPrn ); + const bool bSwappedIn = 0 != pGrfNd->SwapIn( bPrn ); if( bSwappedIn && rGrfObj.GetGraphic().IsSupportedGraphic()) { - const sal_Bool bAnimate = rGrfObj.IsAnimated() && + const bool bAnimate = rGrfObj.IsAnimated() && !pShell->IsPreView() && !pShell->GetAccessibilityOptions()->IsStopAnimatedGraphics() && // #i9684# Stop animation during printing/pdf export @@ -902,9 +984,37 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons 0, GRFMGR_DRAW_STANDARD, pVout ); } else - rGrfObj.DrawWithPDFHandling( *pOut, - aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), - &aGrfAttr ); + { + const SvgDataPtr& rSvgDataPtr = rGrfObj.GetGraphic().getSvgData(); + bool bDone(false); + + if(rSvgDataPtr.get()) + { + // Graphic is Svg and can be painted as primitives (vector graphic) + const basegfx::B2DRange aTargetRange( + aAlignedGrfArea.Left(), aAlignedGrfArea.Top(), + aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom()); + const bool bCropped(aGrfAttr.IsCropped()); + + bDone = paintUsingPrimitivesHelper( + *pOut, + rSvgDataPtr->getPrimitive2DSequence(), + rSvgDataPtr->getRange(), + aTargetRange, + bCropped ? aGrfAttr.GetLeftCrop() : 0, + bCropped ? aGrfAttr.GetTopCrop() : 0, + bCropped ? aGrfAttr.GetRightCrop() : 0, + bCropped ? aGrfAttr.GetBottomCrop() : 0, + aGrfAttr.GetMirrorFlags() & BMP_MIRROR_HORZ, + aGrfAttr.GetMirrorFlags() & BMP_MIRROR_VERT); + } + + if(!bDone) + { + // fallback paint, uses replacement image + rGrfObj.DrawWithPDFHandling(*pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), &aGrfAttr); + } + } } else { @@ -927,12 +1037,12 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons if ( nResId ) aText = SW_RESSTR( nResId ); - ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, sal_True ); + ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, true ); } // When printing, we must not collect the graphics if( bSwapped && bPrn ) - bForceSwap = sal_True; + bForceSwap = true; } if( bForceSwap ) @@ -941,16 +1051,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons if ( pShell->Imp()->GetDrawView()->IsAntiAliasing() ) pOut->SetAntialiasing( nFormerAntialiasingAtOutput ); } - else if( bIsChart - // Charts must be painted resolution dependent!! #i82893#, #i75867# - && ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( pOut ) - && svt::EmbeddedObjectRef::TryRunningState( pOLENd->GetOLEObj().GetOleRef() ) - && ChartPrettyPainter::DoPrettyPaintChart( uno::Reference< frame::XModel >( - pOLENd->GetOLEObj().GetOleRef()->getComponent(), uno::UNO_QUERY), pOut, aAlignedGrfArea.SVRect() ) ) - { - (void)(0);// all was done in if statement - } - else if( pOLENd ) + else // bIsChart || pOLENd { // Fix for bug fdo#33781 const sal_uInt16 nFormerAntialiasingAtOutput( pOut->GetAntialiasing() ); @@ -966,49 +1067,87 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons pOut->SetAntialiasing( nNewAntialiasingAtOutput ); } - Point aPosition(aAlignedGrfArea.Pos()); - Size aSize(aAlignedGrfArea.SSize()); + bool bDone(false); - // We do not have a printer in the BrowseMode and thus no JobSetup, so we create one ... - const JobSetup* pJobSetup = pOLENd->getIDocumentDeviceAccess()->getJobsetup(); - sal_Bool bDummyJobSetup = 0 == pJobSetup; - if( bDummyJobSetup ) - pJobSetup = new JobSetup(); + if(bIsChart) + { + const uno::Reference< frame::XModel > aXModel(pOLENd->GetOLEObj().GetOleRef()->getComponent(), uno::UNO_QUERY); - // #i42323# - //TODO/LATER: is it a problem that the JopSetup isn't used? - //xRef->DoDraw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), *pJobSetup ); + if(aXModel.is()) + { + basegfx::B2DRange aSourceRange; - Graphic* pGraphic = pOLENd->GetGraphic(); + const drawinglayer::primitive2d::Primitive2DSequence aSequence( + ChartHelper::tryToGetChartContentAsPrimitive2DSequence( + aXModel, + aSourceRange)); - if ( pGraphic && pGraphic->GetType() != GRAPHIC_NONE ) - { - pGraphic->Draw( pOut, aPosition, aSize ); + if(aSequence.hasElements() && !aSourceRange.isEmpty()) + { + const basegfx::B2DRange aTargetRange( + aAlignedGrfArea.Left(), aAlignedGrfArea.Top(), + aAlignedGrfArea.Right(), aAlignedGrfArea.Bottom()); + + bDone = paintUsingPrimitivesHelper( + *pOut, + aSequence, + aSourceRange, + aTargetRange); + } + } + } - // shade the representation if the object is activated outplace - uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef(); - if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE ) + if(!bDone && pOLENd) + { + Point aPosition(aAlignedGrfArea.Pos()); + Size aSize(aAlignedGrfArea.SSize()); + + // Im BrowseModus gibt es nicht unbedingt einen Drucker und + // damit kein JobSetup, also legen wir eines an ... + const JobSetup* pJobSetup = pOLENd->getIDocumentDeviceAccess()->getJobsetup(); + sal_Bool bDummyJobSetup = 0 == pJobSetup; + if( bDummyJobSetup ) + pJobSetup = new JobSetup(); + + // #i42323# + // The reason for #114233# is gone, so i remove it again + //TODO/LATER: is it a problem that the JobSetup isn't used? + //xRef->DoDraw( pOut, aAlignedGrfArea.Pos(), aAlignedGrfArea.SSize(), *pJobSetup ); + + Graphic* pGraphic = pOLENd->GetGraphic(); + if ( pGraphic && pGraphic->GetType() != GRAPHIC_NONE ) { - ::svt::EmbeddedObjectRef::DrawShading( Rectangle( aPosition, aSize ), pOut ); + pGraphic->Draw( pOut, aPosition, aSize ); + + // shade the representation if the object is activated outplace + uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef(); + if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::ACTIVE ) + { + ::svt::EmbeddedObjectRef::DrawShading( Rectangle( aPosition, aSize ), pOut ); + } } - } - else - ::svt::EmbeddedObjectRef::DrawPaintReplacement( Rectangle( aPosition, aSize ), pOLENd->GetOLEObj().GetCurrentPersistName(), pOut ); + else + ::svt::EmbeddedObjectRef::DrawPaintReplacement( Rectangle( aPosition, aSize ), pOLENd->GetOLEObj().GetCurrentPersistName(), pOut ); - if( bDummyJobSetup ) - delete pJobSetup; // ... and clean it up again + if( bDummyJobSetup ) + delete pJobSetup; - sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() ); - if ( !bPrn && pShell->ISA( SwCrsrShell ) && - nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE ) - { - const SwFlyFrm *pFly = FindFlyFrm(); - OSL_ENSURE( pFly, "OLE not in FlyFrm" ); - ((SwFEShell*)pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frm()); + sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() ); + if ( !bPrn && pShell->ISA( SwCrsrShell ) && + nMiscStatus & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE ) + { + const SwFlyFrm *pFly = FindFlyFrm(); + assert( pFly != NULL ); + ((SwFEShell*)pShell)->ConnectObj( pOLENd->GetOLEObj().GetObject(), pFly->Prt(), pFly->Frm()); + } } - if ( pShell->Imp()->GetDrawView()->IsAntiAliasing() ) + // see #i99665# + if ( pOLENd->IsChart() && + pShell->Imp()->GetDrawView()->IsAntiAliasing() ) + { pOut->SetAntialiasing( nFormerAntialiasingAtOutput ); + } } } diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 5a97789e931e..b6a71fe65891 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -353,7 +353,7 @@ sal_Int16 SwNumFmt::GetVertOrient() const void SwNumFmt::UpdateNumNodes( SwDoc* pDoc ) { sal_Bool bDocIsModified = pDoc->IsModified(); - sal_Bool bFnd = sal_False; + bool bFnd = false; const SwNumRule* pRule; for( sal_uInt16 n = pDoc->GetNumRuleTbl().size(); !bFnd && n; ) { @@ -368,7 +368,7 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc ) { lcl_SetRuleChgd( *(*aIter), i ); } - bFnd = sal_True; + bFnd = true; break; } } @@ -749,7 +749,7 @@ String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum, if ( rNodeNum.GetLevelInListTree() >= 0 ) { - sal_Bool bOldHadPrefix = sal_True; + bool bOldHadPrefix = true; bool bFirstIteration = true; ::rtl::OUString sOldPrefix; @@ -773,7 +773,6 @@ String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum, String aPrevStr = MakeNumString( pWorkingNodeNum->GetNumberVector(), sal_True, sal_False, MAXLEVEL, &aExtremities); - int nLen = aPrevStr.Len(); int nStrip = 0; sal_Unicode c; @@ -789,7 +788,6 @@ String SwNumRule::MakeRefNumString( const SwNodeNum& rNodeNum, { aPrevStr.Erase( 0, nStrip ); aExtremities.nPrefixChars -= nStrip; - nLen -= nStrip; } if ((bFirstIteration || bOldHadPrefix) && diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index 948df56df0ab..03ea2f86b443 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -106,7 +106,7 @@ static const sal_uInt16 aHeadlineSizes[ 2 * MAXLEVEL ] = { static long lcl_GetRightMargin( SwDoc& rDoc ) { // Make sure that the printer settings are taken over to the standard - // page template + // page style const SwFrmFmt& rPgDscFmt = rDoc.GetPageDesc( 0 ).GetMaster(); const SvxLRSpaceItem& rLR = rPgDscFmt.GetLRSpace(); const long nLeft = rLR.GetLeft(); @@ -198,7 +198,7 @@ static void lcl_SetDfltFont( sal_uInt16 nLatinFntType, sal_uInt16 nCJKFntType, static void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl, SfxItemSet& rSet, - sal_uInt16 nOutLvlBits, sal_uInt8 nLevel, sal_Bool bItalic ) + sal_uInt16 nOutLvlBits, sal_uInt8 nLevel, bool bItalic ) { SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); SvxFontHeightItem aHItem(240, 100, RES_CHRATR_FONTSIZE); @@ -257,7 +257,7 @@ static void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl, static void lcl_SetRegister( SwDoc* pDoc, SfxItemSet& rSet, sal_uInt16 nFact, - sal_Bool bHeader, sal_Bool bTab ) + bool bHeader, bool bTab ) { SvxLRSpaceItem aLR( RES_LR_SPACE ); sal_uInt16 nLeft = nFact ? GetMetricVal( CM_05 ) * nFact : 0; @@ -303,7 +303,7 @@ static void lcl_SetNumBul( SwDoc* pDoc, SwTxtFmtColl* pColl, // Return the AutoCollection by it's Id. If it doesn't // exist yet, create it. // If the String pointer is defined, then only query for -// the Attribute descriptions. It doesn't create a template! +// the Attribute descriptions. It doesn't create a style! SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage) { SvxFrameDirection eResult = (MsLangId::isRightToLeft( static_cast<LanguageType>(nLanguage)) ? @@ -498,7 +498,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) break; case RES_POOLCOLL_GREETING: // Greeting - case RES_POOLCOLL_REGISTER_BASE: // Base directories + case RES_POOLCOLL_REGISTER_BASE: // Base indexes case RES_POOLCOLL_SIGNATURE: // Signatures case RES_POOLCOLL_TABLE: // Tabele content { @@ -508,38 +508,38 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) break; case RES_POOLCOLL_HEADLINE1: // Headinline 1 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 0, sal_False ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 0, false ); break; case RES_POOLCOLL_HEADLINE2: // Headinline 2 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 1, sal_True ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 1, true ); break; case RES_POOLCOLL_HEADLINE3: // Headinline 3 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 2, sal_False ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 2, false ); break; case RES_POOLCOLL_HEADLINE4: // Headinline 4 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 3, sal_True ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 3, true ); break; case RES_POOLCOLL_HEADLINE5: // Headinline 5 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 4, sal_False ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 4, false ); break; case RES_POOLCOLL_HEADLINE6: // Headinline 6 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 5, sal_False ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 5, false ); break; case RES_POOLCOLL_HEADLINE7: // Headinline 7 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 6, sal_False ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 6, false ); break; case RES_POOLCOLL_HEADLINE8: // Headinline 8 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 7, sal_False ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 7, false ); break; case RES_POOLCOLL_HEADLINE9: // Headinline 9 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 8, sal_False ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 8, false ); break; case RES_POOLCOLL_HEADLINE10: // Headinline 10 - lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 9, sal_False ); + lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 9, false ); break; - // Special areas: + // Special sections: // Header case RES_POOLCOLL_HEADER: case RES_POOLCOLL_HEADERL: @@ -584,7 +584,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) } break; - case RES_POOLCOLL_LABEL: // Base label + case RES_POOLCOLL_LABEL: // basic caption { SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetUpper( PT_6 ); aUL.SetLower( PT_6 ); aSet.Put( aUL ); @@ -596,13 +596,13 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) break; case RES_POOLCOLL_FRAME: // Frame content - case RES_POOLCOLL_LABEL_ABB: // Label projection - case RES_POOLCOLL_LABEL_TABLE: // Label table - case RES_POOLCOLL_LABEL_FRAME: // Label frame - case RES_POOLCOLL_LABEL_DRAWING: // Label drawing + case RES_POOLCOLL_LABEL_ABB: // caption image + case RES_POOLCOLL_LABEL_TABLE: // caption table + case RES_POOLCOLL_LABEL_FRAME: // caption frame + case RES_POOLCOLL_LABEL_DRAWING: // caption drawing break; - case RES_POOLCOLL_JAKETADRESS: // Jaket address + case RES_POOLCOLL_JAKETADRESS: // envelope address { SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 ); aSet.Put( aUL ); @@ -625,110 +625,110 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) } break; - // User directories: + // User defined indexes: case RES_POOLCOLL_TOX_USERH: // Header - lcl_SetRegister( this, aSet, 0, sal_True, sal_False ); + lcl_SetRegister( this, aSet, 0, true, false ); { SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); aSet.Put( aLN ); } break; case RES_POOLCOLL_TOX_USER1: // 1. Level - lcl_SetRegister( this, aSet, 0, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 0, false, true ); break; case RES_POOLCOLL_TOX_USER2: // 2. Level - lcl_SetRegister( this, aSet, 1, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 1, false, true ); break; case RES_POOLCOLL_TOX_USER3: // 3. Level - lcl_SetRegister( this, aSet, 2, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 2, false, true ); break; case RES_POOLCOLL_TOX_USER4: // 4. Level - lcl_SetRegister( this, aSet, 3, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 3, false, true ); break; case RES_POOLCOLL_TOX_USER5: // 5. Level - lcl_SetRegister( this, aSet, 4, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 4, false, true ); break; case RES_POOLCOLL_TOX_USER6: // 6. Level - lcl_SetRegister( this, aSet, 5, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 5, false, true ); break; case RES_POOLCOLL_TOX_USER7: // 7. Level - lcl_SetRegister( this, aSet, 6, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 6, false, true ); break; case RES_POOLCOLL_TOX_USER8: // 8. Level - lcl_SetRegister( this, aSet, 7, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 7, false, true ); break; case RES_POOLCOLL_TOX_USER9: // 9. Level - lcl_SetRegister( this, aSet, 8, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 8, false, true ); break; case RES_POOLCOLL_TOX_USER10: // 10. Level - lcl_SetRegister( this, aSet, 9, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 9, false, true ); break; - // Index directories + // Index case RES_POOLCOLL_TOX_IDXH: // Header - lcl_SetRegister( this, aSet, 0, sal_True, sal_False ); + lcl_SetRegister( this, aSet, 0, true, false ); { SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); aSet.Put( aLN ); } break; case RES_POOLCOLL_TOX_IDX1: // 1. Level - lcl_SetRegister( this, aSet, 0, sal_False, sal_False ); + lcl_SetRegister( this, aSet, 0, false, false ); break; case RES_POOLCOLL_TOX_IDX2: // 2. Level - lcl_SetRegister( this, aSet, 1, sal_False, sal_False ); + lcl_SetRegister( this, aSet, 1, false, false ); break; case RES_POOLCOLL_TOX_IDX3: // 3. Level - lcl_SetRegister( this, aSet, 2, sal_False, sal_False ); + lcl_SetRegister( this, aSet, 2, false, false ); break; case RES_POOLCOLL_TOX_IDXBREAK: // Trenner - lcl_SetRegister( this, aSet, 0, sal_False, sal_False ); + lcl_SetRegister( this, aSet, 0, false, false ); break; - // Content directories + // Table of Content case RES_POOLCOLL_TOX_CNTNTH: // Header - lcl_SetRegister( this, aSet, 0, sal_True, sal_False ); + lcl_SetRegister( this, aSet, 0, true, false ); { SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); aSet.Put( aLN ); } break; case RES_POOLCOLL_TOX_CNTNT1: // 1. Level - lcl_SetRegister( this, aSet, 0, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 0, false, true ); break; case RES_POOLCOLL_TOX_CNTNT2: // 2. Level - lcl_SetRegister( this, aSet, 1, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 1, false, true ); break; case RES_POOLCOLL_TOX_CNTNT3: // 3. Level - lcl_SetRegister( this, aSet, 2, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 2, false, true ); break; case RES_POOLCOLL_TOX_CNTNT4: // 4. Level - lcl_SetRegister( this, aSet, 3, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 3, false, true ); break; case RES_POOLCOLL_TOX_CNTNT5: // 5. Level - lcl_SetRegister( this, aSet, 4, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 4, false, true ); break; case RES_POOLCOLL_TOX_CNTNT6: // 6. Level - lcl_SetRegister( this, aSet, 5, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 5, false, true ); break; case RES_POOLCOLL_TOX_CNTNT7: // 7. Level - lcl_SetRegister( this, aSet, 6, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 6, false, true ); break; case RES_POOLCOLL_TOX_CNTNT8: // 8. Level - lcl_SetRegister( this, aSet, 7, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 7, false, true ); break; case RES_POOLCOLL_TOX_CNTNT9: // 9. Level - lcl_SetRegister( this, aSet, 8, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 8, false, true ); break; case RES_POOLCOLL_TOX_CNTNT10: // 10. Level - lcl_SetRegister( this, aSet, 9, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 9, false, true ); break; case RES_POOLCOLL_TOX_ILLUSH: case RES_POOLCOLL_TOX_OBJECTH: case RES_POOLCOLL_TOX_TABLESH: case RES_POOLCOLL_TOX_AUTHORITIESH: - lcl_SetRegister( this, aSet, 0, sal_True, sal_False ); + lcl_SetRegister( this, aSet, 0, true, false ); { SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); aSet.Put( aLN ); @@ -738,7 +738,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) case RES_POOLCOLL_TOX_OBJECT1: case RES_POOLCOLL_TOX_TABLES1: case RES_POOLCOLL_TOX_AUTHORITIES1: - lcl_SetRegister( this, aSet, 0, sal_False, sal_True ); + lcl_SetRegister( this, aSet, 0, false, true ); break; @@ -1062,16 +1062,16 @@ bool SwDoc::IsPoolTxtCollUsed( sal_uInt16 nId ) const "Wrong AutoFormat Id" ); SwTxtFmtColl* pNewColl = 0; - sal_Bool bFnd = sal_False; + bool bFnd = false; for( sal_uInt16 n = 0; !bFnd && n < pTxtFmtCollTbl->size(); ++n ) { pNewColl = (*pTxtFmtCollTbl)[ n ]; if( nId == pNewColl->GetPoolFmtId() ) - bFnd = sal_True; + bFnd = true; } if( !bFnd || !pNewColl->GetDepends() ) - return sal_False; + return false; SwAutoFmtGetDocNode aGetHt( &GetNodes() ); return !pNewColl->GetInfo( aGetHt ); @@ -1156,10 +1156,10 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId ) switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) ) { case POOLGRP_CHARFMT: - pNewFmt = _MakeCharFmt(aNm, pDeriveFmt, sal_False, sal_True); + pNewFmt = _MakeCharFmt(aNm, pDeriveFmt, false, true); break; case POOLGRP_FRAMEFMT: - pNewFmt = _MakeFrmFmt(aNm, pDeriveFmt, sal_False, sal_True); + pNewFmt = _MakeFrmFmt(aNm, pDeriveFmt, false, true); break; default: break; @@ -1169,7 +1169,7 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId ) if( !bIsModified ) ResetModified(); pNewFmt->SetPoolFmtId( nId ); - pNewFmt->SetAuto( sal_False ); // no AutoFormat + pNewFmt->SetAuto( false ); // no AutoFormat } switch( nId ) @@ -1374,7 +1374,7 @@ bool SwDoc::IsPoolFmtUsed( sal_uInt16 nId ) const SwFmt *pNewFmt = 0; const SwFmtsBase* pArray[ 2 ]; sal_uInt16 nArrCnt = 1; - sal_Bool bFnd = sal_True; + bool bFnd = true; if( RES_POOLCHR_BEGIN <= nId && nId < RES_POOLCHR_END ) { @@ -1389,17 +1389,17 @@ bool SwDoc::IsPoolFmtUsed( sal_uInt16 nId ) const else { OSL_FAIL( "invalid Id" ); - bFnd = sal_False; + bFnd = false; } if( bFnd ) { - bFnd = sal_False; + bFnd = false; while( nArrCnt-- && !bFnd ) for( sal_uInt16 n = 0; !bFnd && n < (*pArray[nArrCnt]).GetFmtCount(); ++n ) if( nId == ( pNewFmt = (*pArray[ nArrCnt ] ).GetFmt( n ) )-> GetPoolFmtId() ) - bFnd = sal_True; + bFnd = true; } // Not found or no dependecies? @@ -1411,7 +1411,7 @@ bool SwDoc::IsPoolFmtUsed( sal_uInt16 nId ) const bFnd = !pNewFmt->GetInfo( aGetHt ); } else - bFnd = sal_False; + bFnd = false; return bFnd; } @@ -1445,7 +1445,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) return pNewPgDsc; } - // Fault: unknown Pool template + // error: unknown Pool style if( RES_POOLPAGE_BEGIN > nId || nId >= RES_POOLPAGE_END ) { OSL_ENSURE( !this, "invalid Id" ); @@ -1477,7 +1477,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) aUL.SetLower( (sal_uInt16)aLR.GetLeft() ); SwAttrSet aSet( GetAttrPool(), aPgFrmFmtSetRange ); - sal_Bool bSetLeft = sal_True; + bool bSetLeft = true; switch( nId ) { @@ -1491,7 +1491,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) break; case RES_POOLPAGE_FIRST: // First page - case RES_POOLPAGE_REGISTER: // Register + case RES_POOLPAGE_REGISTER: // ToX { lcl_GetStdPgSize( this, aSet ); aSet.Put( aLR ); @@ -1505,12 +1505,12 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) } break; - case RES_POOLPAGE_LEFT: // Link page + case RES_POOLPAGE_LEFT: // Left page { lcl_GetStdPgSize( this, aSet ); aSet.Put( aLR ); aSet.Put( aUL ); - bSetLeft = sal_False; + bSetLeft = false; if( pNewPgDsc ) { pNewPgDsc->SetUseOn( nsUseOnPage::PD_LEFT ); @@ -1525,7 +1525,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) lcl_GetStdPgSize( this, aSet ); aSet.Put( aLR ); aSet.Put( aUL ); - bSetLeft = sal_False; + bSetLeft = false; if( pNewPgDsc ) { pNewPgDsc->SetUseOn( nsUseOnPage::PD_RIGHT ); @@ -1534,7 +1534,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) } break; - case RES_POOLPAGE_JAKET: // Jaket + case RES_POOLPAGE_JAKET: // envelope { aLR.SetLeft( 0 ); aLR.SetRight( 0 ); aUL.SetUpper( 0 ); aUL.SetLower( 0 ); @@ -1625,7 +1625,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId ) return pNewRule; } - // Fault: unknown Pool template + // error: unknown Pool style if( RES_POOLNUMRULE_BEGIN > nId || nId >= RES_POOLNUMRULE_END ) { OSL_ENSURE( !this, "invalid Id" ); @@ -1642,7 +1642,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId ) { sal_Bool bIsModified = IsModified(); - n = MakeNumRule( aNm, 0, sal_False, eNumberFormatPositionAndSpaceMode ); + n = MakeNumRule( aNm, 0, false, eNumberFormatPositionAndSpaceMode ); pNewRule = GetNumRuleTbl()[ n ]; pNewRule->SetPoolFmtId( nId ); @@ -2276,17 +2276,17 @@ bool SwDoc::IsPoolPageDescUsed( sal_uInt16 nId ) const OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END, "Wrong AutoFormat Id" ); SwPageDesc *pNewPgDsc = 0; - sal_Bool bFnd = sal_False; + bool bFnd = false; for( sal_uInt16 n = 0; !bFnd && n < aPageDescs.size(); ++n ) { pNewPgDsc = aPageDescs[ n ]; if( nId == pNewPgDsc->GetPoolFmtId() ) - bFnd = sal_True; + bFnd = true; } // Not found or no dependencies? if( !bFnd || !pNewPgDsc->GetDepends() ) // ?????? - return sal_False; + return false; // Check if we have dependent ContentNodes in the Nodes array // (also indirect ones for derived Formats) @@ -2294,7 +2294,7 @@ bool SwDoc::IsPoolPageDescUsed( sal_uInt16 nId ) const return !pNewPgDsc->GetInfo( aGetHt ); } -// See if the Paragraph/Character/Frame/Page Template is in use +// See if the Paragraph/Character/Frame/Page style is in use sal_Bool SwDoc::IsUsed( const SwModify& rModify ) const { // Check if we have dependent ContentNodes in the Nodes array @@ -2312,11 +2312,11 @@ sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const return bUsed; } -// Look for the Template name's position. If it doesn't exist, +// Look for the style name's position. If it doesn't exist, // insert a anew sal_uInt16 SwDoc::SetDocPattern( const String& rPatternName ) { - OSL_ENSURE( rPatternName.Len(), "no Document Template name" ); + OSL_ENSURE( rPatternName.Len(), "no Document style name" ); size_t nNewPos = aPatternNms.size(); for(size_t n = 0; n < aPatternNms.size(); ++n) diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index 4fd021b38eaf..9083b127cf4d 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -548,13 +548,13 @@ static void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox, pCpyDoc->CopyWithFlyInFly( *pRg, 0, aInsIdx, sal_False ); else pDoc->GetNodes().MakeTxtNode( aInsIdx, (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() ); - aSavePos++; + ++aSavePos; SwTableLine* pLine = pDstBox->GetUpper(); while( pLine->GetUpper() ) pLine = pLine->GetUpper()->GetUpper(); - sal_Bool bReplaceColl = sal_True; + bool bReplaceColl = true; if( bDelCntnt && !bUndoRedline ) { // Delete the Fly first, then the corresponding Nodes @@ -598,7 +598,7 @@ static void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox, if( pCNd && RES_POOLCOLL_TABLE_HDLN != pCNd->GetFmtColl()->GetPoolFmtId() ) - bReplaceColl = sal_False; + bReplaceColl = false; } pDoc->GetNodes().Delete( aInsIdx, aEndNdIdx.GetIndex() - aInsIdx.GetIndex() ); diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index d4c54b47d33b..6e065aed918e 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -2259,7 +2259,7 @@ sal_Bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos, SwNodeIndex aIdx( rPos.nNode, -1 ); SwTableNode* pTblNd = aIdx.GetNode().FindTableNode(); - aIdx++; + ++aIdx; OSL_ENSURE( pTblNd, "Where is the TableNode now?" ); pTblNd->GetTable().SetRowsToRepeat( GetRowsToRepeat() ); diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index 0c95d5b74ff8..1036634a750f 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -64,7 +64,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) pDoc->GetDocShell()->GetMedium()->GetName().equals(sURL) ) (sBkmk = pIURL->GetMark()).Insert( INET_MARK_TOKEN, 0 ); - sal_Bool bAction = sal_False, bUnLockView = sal_False; + bool bAction = false, bUnLockView = false; const SwFmtINetFmt* pItem; const SwTxtINetFmt* pTxtAttr; const SwTxtNode* pTxtNd; @@ -80,7 +80,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) if( !bAction && pESh ) { pESh->StartAllAction(); - bAction = sal_True; + bAction = true; bUnLockView = !pESh->IsViewLocked(); pESh->LockView( sal_True ); } @@ -101,9 +101,9 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) // Check if the URL has been visited before. Via the Doc, if only one Bookmark is set // We need to put the Doc's name before it! -sal_Bool SwDoc::IsVisitedURL( const String& rURL ) const +bool SwDoc::IsVisitedURL( const String& rURL ) const { - sal_Bool bRet = sal_False; + bool bRet = false; if( rURL.Len() ) { INetURLHistory *pHist = INetURLHistory::GetOrCreate(); diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 20fe09fdf83a..a2b015f11fc1 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -88,7 +88,7 @@ namespace if( ( rNode.IsSectionNode() && rNode.EndOfSectionIndex() >= nEnd ) || ( rNode.IsEndNode() && rNode.StartOfSectionNode()->GetIndex() < nStart ) ) ++rDelCount; - rLastIdx++; + ++rLastIdx; } while( rLastIdx.GetIndex() < nNewIdx ); } @@ -146,7 +146,7 @@ namespace mark_vector_t vMarksToCopy; for(IDocumentMarkAccess::const_iterator_t ppMark = pSrcMarkAccess->getMarksBegin(); ppMark != pSrcMarkAccess->getMarksEnd(); - ppMark++) + ++ppMark) { const ::sw::mark::IMark* const pMark = ppMark->get(); const SwPosition& rMarkStart = pMark->GetMarkStart(); @@ -836,7 +836,7 @@ static bool lcl_ContainsOnlyParagraphsInList( const SwPaM& rPam ) do { - aIdx++; + ++aIdx; pTxtNd = aIdx.GetNode().GetTxtNode(); if ( !pTxtNd || !pTxtNd->IsInList() ) @@ -1090,7 +1090,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos, // If we didn't split a textnode, the PaM should start at the inserted table node if( rPos.nContent.GetIndex() == pDestTxtNd->Len() ) { // Insertion at the last position of a textnode (empty or not) - aInsPos++; // The table will be inserted behind the text node + ++aInsPos; // The table will be inserted behind the text node } else if( rPos.nContent.GetIndex() ) { // Insertion in the middle of a text node, it has to be split @@ -1232,7 +1232,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos, { SwNodeIndex aSaveIdx( aInsPos, -1 ); CopyWithFlyInFly( aRg, 0,aInsPos, bMakeNewFrms, sal_False ); - aSaveIdx++; + ++aSaveIdx; pEnd->nNode = aSaveIdx; pEnd->nContent.Assign( aSaveIdx.GetNode().GetTxtNode(), 0 ); } @@ -1324,7 +1324,7 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndConte SwNodeIndex aSavePos( rInsPos, -1 ); sal_Bool bEndIsEqualEndPos = rInsPos == rRg.aEnd; GetNodes()._CopyNodes( rRg, rInsPos, bMakeNewFrms, sal_True ); - aSavePos++; + ++aSavePos; if( bEndIsEqualEndPos ) ((SwNodeIndex&)rRg.aEnd) = aSavePos; diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 27c1b7ff952b..23f6744b6fc6 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -118,7 +118,7 @@ static bool lcl_IsInSameTblBox( SwNodes& _rNds, } while ( !bFound ); } - // dann suche den StartNode der Box + // Find the Box's StartNode const SwTableSortBoxes& rSortBoxes = pTblNd->GetTable().GetTabSortBoxes(); sal_uLong nIdx = _rNd.GetIndex(); for (size_t n = 0; n < rSortBoxes.size(); ++n) @@ -126,7 +126,7 @@ static bool lcl_IsInSameTblBox( SwNodes& _rNds, const SwStartNode* pNd = rSortBoxes[ n ]->GetSttNd(); if ( pNd->GetIndex() < nIdx && nIdx < pNd->EndOfSectionIndex() ) { - // dann muss der andere Index in derselben Section liegen + // The other index needs to be within the same Section nIdx = aChkIdx.GetIndex(); return pNd->GetIndex() < nIdx && nIdx < pNd->EndOfSectionIndex(); } @@ -171,8 +171,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, return 0; } - // Teste ob das gesamte Dokument versteckt werden soll, - // koennen wir zur Zeit nicht !!!! + // See if the whole Document should be hidden, which we currently are not able to do. if (rNewData.IsHidden() && rRange.HasMark()) { const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End(); @@ -213,14 +212,14 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, *pEndPos = (SwPosition*)rRange.End(); if( pPrvNd && 3 == nRegionRet ) { - OSL_ENSURE( pPrvNd, "der SectionNode fehlt" ); + OSL_ENSURE( pPrvNd, "The SectionNode is missing" ); SwNodeIndex aStt( pSttPos->nNode ), aEnd( pEndPos->nNode, +1 ); while( pPrvNd != aStt.GetNode().StartOfSectionNode() ) aStt--; while( pPrvNd != aEnd.GetNode().StartOfSectionNode() ) - aEnd++; + ++aEnd; - --aEnd; // im InsertSection ist Ende inclusive + --aEnd; // End is inclusive in the InsertSection pNewSectNode = GetNodes().InsertTextSection( aStt, *pFmt, rNewData, pTOXBase, & aEnd); } @@ -285,7 +284,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, } else { - // wieder ans Ende vom vorherigen setzen + // Set to the end of the previous pEndPos->nNode--; pTNd = pEndPos->nNode.GetNode().GetTxtNode(); } @@ -342,10 +341,10 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, } } - // ist eine Condition gesetzt + // Is a Condition set? if (rNewData.IsHidden() && rNewData.GetCondition().Len()) { - // dann berechne bis zu dieser Position + // The calculate up to that position SwCalc aCalc( *this ); if( ! IsInReading() ) { @@ -397,7 +396,7 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, sal_uInt16 nRet = 1; if( rRange.HasMark() ) { - // teste ob es sich um eine gueltige Selektion handelt + // See if we have a valid Section const SwPosition* pStt = rRange.Start(), * pEnd = rRange.End(); @@ -407,9 +406,8 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, const SwSectionNode* pEndSectNd = pCNd ? pCNd->FindSectionNode() : 0; if( pSectNd && pEndSectNd && pSectNd != pEndSectNd ) { - // versuche eine umschliessende Section zu erzeugen - // Aber, nur wenn der Start am Sectionanfang und das Ende am - // Section Ende liegt! + // Try to create an enclosing Section, but only if Start is + // located at the Section's beginning and End at it's end nRet = 0; if( !pStt->nContent.GetIndex() && pSectNd->GetIndex() == pStt->nNode.GetIndex() - 1 && pEnd->nContent.GetIndex() == @@ -436,7 +434,7 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, !( pNxtNd->StartOfSectionIndex() < nCmp && nCmp < aIdx.GetIndex() ) ) { - aIdx++; + ++aIdx; } if( !pNxtNd ) pNxtNd = pNd->EndOfSectionNode(); @@ -452,8 +450,8 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, } else if( !pSectNd && pEndSectNd ) { - // versuche eine umschliessende Section zu erzeugen - // Aber, nur wenn das Ende am Section Ende liegt! + // Try to create an enclosing Section, but only if the End + // is at the Section's end. nRet = 0; if( pEnd->nContent.GetIndex() == pCNd->Len() ) { @@ -462,7 +460,7 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, 0 != aIdx.GetNode().FindSectionNode() ) { do { - aIdx++; + ++aIdx; } while( aIdx.GetNode().IsEndNode() && 0 != aIdx.GetNode().FindSectionNode() ); { @@ -478,8 +476,8 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, } else if( pSectNd && !pEndSectNd ) { - // versuche eine umschliessende Section zu erzeugen - // Aber, nur wenn der Start am Section Anfang liegt! + // Try to create an enclosing Section, but only if Start + // is at the Section's start. nRet = 0; if( !pStt->nContent.GetIndex() ) { @@ -494,7 +492,7 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, nRet = 1; if( ppSttNd ) { - aIdx++; + ++aIdx; *ppSttNd = &aIdx.GetNode(); } } @@ -522,7 +520,7 @@ SwSectionFmt* SwDoc::MakeSectionFmt( SwSectionFmt *pDerivedFrom ) return pNew; } -void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes ) +void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, bool bDelNodes ) { SwSectionFmts::iterator itFmtPos = std::find( pSectionFmtTbl->begin(), pSectionFmtTbl->end(), pFmt ); @@ -575,13 +573,12 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes ) pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); } - // A ClearRedo could result in a rekursive call of this function and delete some section - // formats => the position iside the SectionFmtTbl could have changed + // A ClearRedo could result in a recursive call of this function and delete some section + // formats, thus the position inside the SectionFmtTbl could have changed itFmtPos = std::find( pSectionFmtTbl->begin(), pSectionFmtTbl->end(), pFmt ); - // ACHTUNG: erst aus dem Array entfernen und dann loeschen. - // Der Section-DTOR versucht selbst noch sein Format - // zu loeschen! + // WARNING: First remove from the array and then delete, + // as the Section DTOR tries to delete it's format itself. pSectionFmtTbl->erase( itFmtPos ); //FEATURE::CONDCOLL sal_uLong nCnt = 0, nSttNd = 0; @@ -626,7 +623,7 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData, if (pSection->DataEquals(rNewData)) { - // die Attribute ueberpruefen + // Check Attributes sal_Bool bOnlyAttrChg = sal_False; if( pAttr && pAttr->Count() ) { @@ -663,8 +660,8 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData, return; } - // Teste ob eine gesamte Content-Section (Dokument/TabellenBox/Fly) - // versteckt werden soll, koennen wir zur Zeit nicht !!!! + // Test if the whole Content Section (Document/TableBox/Fly) should be hidden, + // which we're currently not able to do. const SwNodeIndex* pIdx = 0; { if (rNewData.IsHidden()) @@ -691,14 +688,14 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData, // objects of type SwUndoFrmFmt on the undo stack. We don't want them. ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); - // Der LinkFileName koennte auch nur aus Separatoren bestehen + // The LinkFileName could only consist of separators String sCompareString = rtl::OUString(sfx2::cTokenSeperator); sCompareString += sfx2::cTokenSeperator; const bool bUpdate = (!pSection->IsLinkType() && rNewData.IsLinkType()) - || ( rNewData.GetLinkFileName().Len() - && (rNewData.GetLinkFileName() != sCompareString) - && (rNewData.GetLinkFileName() != pSection->GetLinkFileName())); + || (rNewData.GetLinkFileName().Len() + && (rNewData.GetLinkFileName() != sCompareString) + && (rNewData.GetLinkFileName() != pSection->GetLinkFileName())); String sSectName( rNewData.GetSectionName() ); if (sSectName != pSection->GetSectionName()) @@ -722,10 +719,10 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData, pSection->SetSectionName( sSectName ); } - // ist eine Condition gesetzt + // Is a Condition set if( pSection->IsHidden() && pSection->GetCondition().Len() ) { - // dann berechne bis zu dieser Position + // Then calculate up to that position SwCalc aCalc( *this ); if( !pIdx ) pIdx = pFmt->GetCntnt().GetCntntIdx(); @@ -758,16 +755,6 @@ void SwDoc::UpdateSection(sal_uInt16 const nPos, SwSectionData & rNewData, SetModified(); } -/* -------------------------------------------------- - * LockFrms wurde im InsertSection genutzt, um zu verhindern, dass - * SectionFrms durch das DelFrms zerstoert werden. Dies ist durch - * den Destroy-Listen-Mechanismus ueberfluessig geworden. - * Falls diese Methode doch noch einmal reanimiert wird, bietet es - * sich vielleicht an, beim Entlocken die SectionFrms auf Inhalt zu - * pruefen und dann ggf. zur Zerstoerung anzumelden. - * --------------------------------------------------*/ - -// und dann waren da noch die Fussnoten: void sw_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ) { SwFtnIdxs& rFtnArr = pNd->GetDoc()->GetFtnIdxs(); @@ -777,13 +764,12 @@ void sw_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ) rFtnArr.SeekEntry( SwNodeIndex( *pNd ), &nPos ); SwTxtFtn* pSrch; - // loesche erstmal alle, die dahinter stehen + // Delete all succeeding Footnotes while( nPos < rFtnArr.size() && _SwTxtFtn_GetIndex( (pSrch = rFtnArr[ nPos ]) ) <= nEnd ) { - // Werden die Nodes nicht geloescht mussen sie bei den Seiten - // abmeldet (Frms loeschen) werden, denn sonst bleiben sie - // stehen (Undo loescht sie nicht!) + // If the Nodes are not deleted, they need to deregister at the Pages + // (delete Frms) or else they will remain there (Undo does not delete them!) pSrch->DelFrms(0); ++nPos; } @@ -791,9 +777,8 @@ void sw_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ) while( nPos-- && _SwTxtFtn_GetIndex( (pSrch = rFtnArr[ nPos ]) ) >= nStt ) { - // Werden die Nodes nicht geloescht mussen sie bei den Seiten - // abmeldet (Frms loeschen) werden, denn sonst bleiben sie - // stehen (Undo loescht sie nicht!) + // If the Nodes are not deleted, they need to deregister at the Pages + // (delete Frms) or else they will remain there (Undo does not delete them!) pSrch->DelFrms(0); } } @@ -813,7 +798,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, bool const bInsAtStart, bool const bCreateFrms) { SwNodeIndex aInsPos( rNdIdx ); - if( !pEnde ) // kein Bereich also neue Section davor/hinter anlegen + if( !pEnde ) // No Area, thus create a new Section before/after it { // #i26762# OSL_ENSURE(!pEnde || rNdIdx <= *pEnde, @@ -826,20 +811,20 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, do { aInsPos--; } while( aInsPos.GetNode().IsSectionNode() ); - aInsPos++; + ++aInsPos; } } else { SwNode* pNd; - aInsPos++; + ++aInsPos; if (!lcl_IsTOXSection(rSectionData)) { while( aInsPos.GetIndex() < Count() - 1 && ( pNd = &aInsPos.GetNode())->IsEndNode() && pNd->StartOfSectionNode()->IsSectionNode()) { - aInsPos++; + ++aInsPos; } } } @@ -849,7 +834,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, new SwSectionNode(aInsPos, rSectionFmt, pTOXBase); if( pEnde ) { - // Sonderfall fuer die Reader/Writer + // Special case for the Reader/Writer if( &pEnde->GetNode() != &GetEndOfContent() ) aInsPos = pEnde->GetIndex()+1; // #i58710: We created a RTF document with a section break inside a table cell @@ -886,8 +871,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, SwTxtNode* pTNd = new SwTxtNode( aInsPos, pCpyTNd->GetTxtColl() ); if( pCpyTNd->HasSwAttrSet() ) { - // Task 70955 - move PageDesc/Break to the first Node of the - // section + // Move PageDesc/Break to the first Node of the section const SfxItemSet& rSet = *pCpyTNd->GetpSwAttrSet(); if( SFX_ITEM_SET == rSet.GetItemState( RES_BREAK ) || SFX_ITEM_SET == rSet.GetItemState( RES_PAGEDESC )) @@ -905,7 +889,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, else pTNd->SetAttr( rSet ); } - // den Frame anlegen nicht vergessen !! + // Do not forget to create the Frame! pCpyTNd->MakeFrms( *pTNd ); } else @@ -916,20 +900,20 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, pSectNd->GetSection().SetSectionData(rSectionData); SwSectionFmt* pSectFmt = pSectNd->GetSection().GetFmt(); - // Hier bietet sich als Optimierung an, vorhandene Frames nicht zu - // zerstoeren und wieder neu anzulegen, sondern nur umzuhaengen. + // We could optimize this, by not removing already contained Frames and recreating them, + // but by simply rewiring them sal_Bool bInsFrm = bCreateFrms && !pSectNd->GetSection().IsHidden() && - GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225 + GetDoc()->GetCurrentViewShell(); SwNode2Layout *pNode2Layout = NULL; if( bInsFrm ) { SwNodeIndex aTmp( *pSectNd ); if( !pSectNd->GetNodes().FindPrvNxtFrmNode( aTmp, pSectNd->EndOfSectionNode() ) ) - // dann sammel mal alle Uppers ein + // Collect all Uppers pNode2Layout = new SwNode2Layout( *pSectNd ); } - // jetzt noch bei allen im Bereich den richtigen StartNode setzen + // Set the right StartNode for all in this Area sal_uLong nEnde = pSectNd->EndOfSectionIndex(); sal_uLong nStart = pSectNd->GetIndex()+1; sal_uLong nSkipIdx = ULONG_MAX; @@ -937,8 +921,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, { SwNode* pNd = (*this)[n]; - //JP 30.04.99: Bug 65644 - alle in der NodeSection liegenden - // Sections unter die neue haengen + // Attach all Sections in the NodeSection underneath the new one if( ULONG_MAX == nSkipIdx ) pNd->pStartOfSection = pSectNd; else if( n >= nSkipIdx ) @@ -946,7 +929,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, if( pNd->IsStartNode() ) { - // die Verschachtelung der Formate herstellen! + // Make up the Format's nesting if( pNd->IsSectionNode() ) { ((SwSectionNode*)pNd)->GetSection().GetFmt()-> @@ -1007,7 +990,7 @@ lcl_initParent(SwSectionNode & rThis, SwSectionFmt & rFmt) rThis.StartOfSectionNode()->FindSectionNode(); if( pParent ) { - // das Format beim richtigen Parent anmelden. + // Register the Format at the right Parent rFmt.SetDerivedFrom( pParent->GetSection().GetFmt() ); } return rFmt; @@ -1021,8 +1004,8 @@ SwSectionNode::SwSectionNode(SwNodeIndex const& rIdx, : new SwSection( CONTENT_SECTION, rFmt.GetName(), lcl_initParent(*this, rFmt) ) ) { - // jetzt noch die Verbindung von Format zum Node setzen - // Modify unterdruecken, interresiert keinen + // Set the connection from Format to Node + // Suppress Modify; no one's interessted anyway rFmt.LockModify(); rFmt.SetFmtAttr( SwFmtCntnt( this ) ); rFmt.UnlockModify(); @@ -1066,8 +1049,8 @@ SwSectionNode::~SwSectionNode() SwSectionFmt* pFmt = m_pSection->GetFmt(); if( pFmt ) { - // das Attribut entfernen, weil die Section ihr Format loescht - // und falls das Cntnt-Attribut vorhanden ist, die Section aufhebt. + // Remove the Attributei, because the Section deletes it's Format + // and it will neutralize the Section, if the Cntnt Attribute is set pFmt->LockModify(); pFmt->ResetFmtAttr( RES_CNTNT ); pFmt->UnlockModify(); @@ -1081,14 +1064,13 @@ SwFrm *SwSectionNode::MakeFrm( SwFrm *pSib ) return new SwSectionFrm( *m_pSection, pSib ); } -//Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom -//Dokument. Die erzeugten Contentframes werden in das entsprechende -//Layout gehaengt. +// Creates all Document Views for the precedeing Node. +// The created ContentFrames are attached to the corresponding Layout void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) { - // also nehme meinen nachfolgenden oder vorhergehenden ContentFrame: + // Take my succsessive or preceding ContentFrame SwNodes& rNds = GetNodes(); - if( rNds.IsDocNodes() && rNds.GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225 + if( rNds.IsDocNodes() && rNds.GetDoc()->GetCurrentViewShell() ) { if( GetSection().IsHidden() || IsCntntHidden() ) { @@ -1109,7 +1091,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) SwFrm *pFrm, *pNew; while( 0 != (pFrm = aNode2Layout.NextFrm()) ) { - OSL_ENSURE( pFrm->IsSctFrm(), "Depend von Section keine Section." ); + OSL_ENSURE( pFrm->IsSctFrm(), "Depend of Section not a Section." ); pNew = rIdx.GetNode().GetCntntNode()->MakeFrm( pFrm ); SwSectionNode* pS = rIdx.GetNode().FindSectionNode(); @@ -1161,12 +1143,12 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) pNew = pSct; } - // wird ein Node vorher oder nachher mit Frames versehen + // If a Node got Frames attached before or after if ( rIdx < GetIndex() ) - // der neue liegt vor mir + // the new one precedes me pNew->Paste( pFrm->GetUpper(), pFrm ); else - // der neue liegt hinter mir + // the new one succeeds me pNew->Paste( pFrm->GetUpper(), pFrm->GetNext() ); // #i27138# // notify accessibility paragraphs objects about changed @@ -1191,12 +1173,11 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) } } -//Fuer jedes vorkommen im Layout einen SectionFrm anlegen und vor den -//entsprechenden CntntFrm pasten. - +// Create a new SectionFrm for every occurence in the Layout and insert before +// the corresponding CntntFrm void SwSectionNode::MakeFrms( SwNodeIndex* pIdxBehind, SwNodeIndex* pEndIdx ) { - OSL_ENSURE( pIdxBehind, "kein Index" ); + OSL_ENSURE( pIdxBehind, "no Index" ); SwNodes& rNds = GetNodes(); SwDoc* pDoc = rNds.GetDoc(); @@ -1226,13 +1207,12 @@ void SwSectionNode::DelFrms() SwNodes& rNds = GetNodes(); m_pSection->GetFmt()->DelFrms(); - // unser Flag muessen wir noch aktualisieren + // Update our Flag m_pSection->m_Data.SetHiddenFlag(true); - // Bug 30582: falls der Bereich in Fly oder TabellenBox ist, dann - // kann er nur "gehiddet" werden, wenn weiterer Content - // vorhanden ist, der "Frames" haelt. Sonst hat der - // Fly/TblBox-Frame keinen Lower !!! + // If the Area is within a Fly or TableBox, we can only hide it if + // there is more Content which has Frames. + // Or else the Fly/TblBox Frame does not have a Lower! { SwNodeIndex aIdx( *this ); if( !rNds.GoPrevSection( &aIdx, sal_True, sal_False ) || @@ -1254,10 +1234,10 @@ void SwSectionNode::DelFrms() SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const { - // in welchen Array steht ich denn: Nodes, UndoNodes ?? + // In which array am I: Nodes, UndoNodes? const SwNodes& rNds = GetNodes(); - // das SectionFrmFmt kopieren + // Copy the das SectionFrmFmt SwSectionFmt* pSectFmt = pDoc->MakeSectionFmt( 0 ); pSectFmt->CopyAttrs( *GetSection().GetFmt() ); @@ -1277,12 +1257,12 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c SwEndNode* pEndNd = new SwEndNode( rIdx, *pSectNd ); SwNodeIndex aInsPos( *pEndNd ); - // Werte uebertragen + // Take over values SwSection *const pNewSect = pSectNd->m_pSection.get(); if (TOX_CONTENT_SECTION != GetSection().GetType()) { - // beim Move den Namen beibehalten + // Keep the Name for Move if( rNds.GetDoc() == pDoc && pDoc->IsCopyIsMove() ) { pNewSect->SetSectionName( GetSection().GetSectionName() ); @@ -1306,19 +1286,18 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c if( !pNewSect->IsEditInReadonlyFlag() && GetSection().IsEditInReadonly() ) pNewSect->SetEditInReadonly( sal_True ); - SwNodeRange aRg( *this, +1, *EndOfSectionNode() ); // (wo stehe in denn nun ??) + SwNodeRange aRg( *this, +1, *EndOfSectionNode() ); // Where am I? rNds._Copy( aRg, aInsPos, sal_False ); - // loesche alle Frames vom kopierten Bereich, diese werden beim - // erzeugen des SectionFrames angelegt ! + // Delete all Frames from the copied Area. They are created when creating + // the SectionFrames. pSectNd->DelFrms(); - // dann kopiere auch noch die Links/Server - if( pNewSect->IsLinkType() ) // den Link eintragen - pNewSect->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108//swmod 071225 - : CREATE_NONE ); + // Copy the Links/Server + if( pNewSect->IsLinkType() ) // Add the Link + pNewSect->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT : CREATE_NONE ); - // falls als Server aus dem Undo kopiert wird, wieder eintragen + // If we copy from the Undo as Server, enter it again if (m_pSection->IsServer() && pDoc->GetIDocumentUndoRedo().IsUndoNodes(rNds)) { @@ -1344,18 +1323,18 @@ sal_Bool SwSectionNode::IsCntntHidden() const { const SwSection& rSect = ((SwSectionNode&)aTmp.GetNode()).GetSection(); if( rSect.IsHiddenFlag() ) - // dann diese Section ueberspringen + // Skip this Section aTmp = *aTmp.GetNode().EndOfSectionNode(); } else { if( aTmp.GetNode().IsCntntNode() || aTmp.GetNode().IsTableNode() ) - return sal_False; // Nicht versteckter Inhalt wurde gefunden + return sal_False; // We found non-hidden content OSL_ENSURE( aTmp.GetNode().IsEndNode(), "EndNode expected" ); } - aTmp++; + ++aTmp; } - return sal_True; // Alles versteckt + return sal_True; // Hide everything } @@ -1382,40 +1361,34 @@ void SwSectionNode::NodesArrChgd() pFmt->SetDerivedFrom( pSectNd ? pSectNd->GetSection().GetFmt() : pDoc->GetDfltFrmFmt() ); - // jetzt noch bei allen im Bereich den richtigen StartNode setzen + // Set the right StartNode for all in this Area sal_uLong nStart = GetIndex()+1, nEnde = EndOfSectionIndex(); for( sal_uLong n = nStart; n < nEnde; ++n ) - // die Verschachtelung der Formate herstellen! + // Make up the Format's nesting if( 0 != ( pSectNd = rNds[ n ]->GetSectionNode() ) ) { pSectNd->GetSection().GetFmt()->SetDerivedFrom( pFmt ); n = pSectNd->EndOfSectionIndex(); } - // verschieben vom Nodes- ins UndoNodes-Array? + // Moving Nodes to the UndoNodes array? if( rNds.IsDocNodes() ) { OSL_ENSURE( pDoc == GetDoc(), - "verschieben in unterschiedliche Documente?" ); - if( m_pSection->IsLinkType() ) // den Link austragen - m_pSection->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108 - : CREATE_NONE );//swmod 071225 + "Moving to different Documents?" ); + if( m_pSection->IsLinkType() ) // Remove the Link + m_pSection->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT : CREATE_NONE ); + if (m_pSection->IsServer()) - { pDoc->GetLinkManager().InsertServer( m_pSection->GetObject() ); - } } else { if (CONTENT_SECTION != m_pSection->GetType()) - { pDoc->GetLinkManager().Remove( &m_pSection->GetBaseLink() ); - } if (m_pSection->IsServer()) - { pDoc->GetLinkManager().RemoveServer( m_pSection->GetObject() ); - } } } } @@ -1441,7 +1414,7 @@ String SwDoc::GetUniqueSectionName( const String* pChkStr ) const const String& rNm = pSectNd->GetSection().GetSectionName(); if( rNm.Match( aName ) == nNmLen ) { - // Nummer bestimmen und das Flag setzen + // Calculate the Number and reset the Flag nNum = static_cast<sal_uInt16>(rNm.Copy( nNmLen ).ToInt32()); if( nNum-- && nNum < pSectionFmtTbl->size() ) pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 )); @@ -1452,12 +1425,12 @@ String SwDoc::GetUniqueSectionName( const String* pChkStr ) const if( !pChkStr ) { - // alle Nummern entsprechend geflag, also bestimme die richtige Nummer + // Flagged all Numbers accordingly, so get the right Number nNum = pSectionFmtTbl->size(); for( n = 0; n < nFlagSize; ++n ) if( 0xff != ( nTmp = pSetFlags[ n ] )) { - // also die Nummer bestimmen + // Calculate the Number nNum = n * 8; while( nTmp & 1 ) ++nNum, nTmp >>= 1; diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 228aa68d309d..0aff3651af6a 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -109,7 +109,7 @@ const sal_Unicode T2T_PARA = 0x0a; extern void ClearFEShellTabCols(); -// steht im gctable.cxx +// Located in gctable.cxx extern sal_Bool sw_GC_Line_Border( const SwTableLine*& , void* pPara ); static void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, sal_uInt8 nId ) @@ -231,10 +231,9 @@ SwTableNode* SwDoc::IsIdxInTbl(const SwNodeIndex& rIdx) } -// --------------- einfuegen einer neuen Box -------------- - - // fuege in der Line, vor der InsPos eine neue Box ein. - +/** + * Insert a new Box before the InsPos + */ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd, SwTableLine* pLine, SwTableBoxFmt* pBoxFmt, @@ -245,9 +244,9 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd, { if( !nCnt ) return sal_False; - OSL_ENSURE( pLine, "keine gueltige Zeile" ); + OSL_ENSURE( pLine, "No valid Line" ); - // Index hinter die letzte Box der Line + // Move Index after the Line's last Box sal_uLong nIdxPos = 0; SwTableBox *pPrvBox = 0, *pNxtBox = 0; if( !pLine->GetTabBoxes().empty() ) @@ -279,7 +278,7 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd, if( pTblNd->GetTable().GetTabLines()[ 0 ] == pTblLn ) { - // also vor die erste Box der Tabelle + // Before the Table's first Box while( ( pNxtBox = pLine->GetTabBoxes()[0])->GetTabLines().size() ) pLine = pNxtBox->GetTabLines()[0]; nIdxPos = pNxtBox->GetSttIdx(); @@ -287,12 +286,12 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd, } } if( bSetIdxPos ) - // Tabelle ohne irgendeinen Inhalt oder am Ende, also vors Ende + // Tables without content or at the end; move before the End nIdxPos = pTblNd->EndOfSectionIndex(); } - else if( pNxtBox ) // es gibt einen Nachfolger + else if( pNxtBox ) // There is a successor nIdxPos = pNxtBox->GetSttIdx(); - else // es gibt einen Vorgaenger + else // There is a predecessor nIdxPos = pPrvBox->GetSttNd()->EndOfSectionIndex() + 1; SwNodeIndex aEndIdx( *this, nIdxPos ); @@ -312,7 +311,7 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd, rTabBoxes.insert( rTabBoxes.begin() + nRealInsPos, pPrvBox ); - if( ! pTxtColl->IsAssignedToListLevelOfOutlineStyle()//<-end,zhaojianwei + if( ! pTxtColl->IsAssignedToListLevelOfOutlineStyle() //FEATURE::CONDCOLL && RES_CONDTXTFMTCOLL != pTxtColl->Which() //FEATURE::CONDCOLL @@ -321,7 +320,7 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd, pTxtColl, pAutoAttr ); else { - // Outline-Numerierung richtig behandeln !!! + // Handle Outline numbering correctly! SwTxtNode* pTNd = new SwTxtNode( SwNodeIndex( *pSttNd->EndOfSectionNode() ), (SwTxtFmtColl*)GetDoc()->GetDfltTxtFmtColl(), @@ -332,8 +331,9 @@ sal_Bool SwNodes::InsBoxen( SwTableNode* pTblNd, return sal_True; } -// --------------- einfuegen einer neuen Tabelle -------------- - +/** + * Insert a new Table + */ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, const SwPosition& rPos, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdjust, @@ -346,12 +346,12 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, OSL_ENSURE( nCols, "Tabelle ohne Spalten?" ); { - // nicht in Fussnoten kopieren !! + // Do not copy into Footnotes! if( rPos.nNode < GetNodes().GetEndOfInserts().GetIndex() && rPos.nNode >= GetNodes().GetEndOfInserts().StartOfSectionIndex() ) return 0; - // sollte das ColumnArray die falsche Anzahl haben wird es ignoriert! + // If the ColumnArray has a wrong count, ignore it! if( pColArr && (size_t)(nCols + ( text::HoriOrientation::NONE == eAdjust ? 2 : 1 )) != pColArr->size() ) pColArr = 0; @@ -367,8 +367,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, aTblName)); } - // fuege erstmal die Nodes ein - // hole das Auto-Format fuer die Tabelle + // Start with inserting the Nodes and get the AutoFormat for the Table SwTxtFmtColl *pBodyColl = GetTxtCollFromPool( RES_POOLCOLL_TABLE ), *pHeadColl = pBodyColl; @@ -398,7 +397,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, pHeadColl, bCalledFromShell ? &pCntntNd->GetSwAttrSet() : 0 ); - // dann erstelle die Box/Line/Table-Struktur + // Create the Box/Line/Table construct SwTableLineFmt* pLineFmt = MakeTableLineFmt(); SwTableFmt* pTableFmt = MakeTblFrmFmt( aTblName, GetDfltFrmFmt() ); @@ -416,12 +415,12 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, } } - //Orientation am Fmt der Table setzen + // Set Orientation at the Table's Fmt pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) ); - // alle Zeilen haben die Fill-Order von links nach rechts ! + // All lines use the left-to-right Fill-Order! pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT )); - // die Tabelle bekommt USHRT_MAX als default SSize + // Set USHRT_MAX as the Table's default SSize SwTwips nWidth = USHRT_MAX; if( pColArr ) { @@ -444,7 +443,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) ) pTableFmt->SetFmtAttr( SwFmtLayoutSplit( sal_False )); - // verschiebe ggfs. die harten PageDesc/PageBreak Attribute: + // Move the hard PageDesc/PageBreak Attributes if needed SwCntntNode* pNextNd = GetNodes()[ pTblNd->EndOfSectionIndex()+1 ] ->GetCntntNode(); if( pNextNd && pNextNd->HasSwAttrSet() ) @@ -486,7 +485,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, } SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 ); - SwNodeIndex aNdIdx( *pTblNd, 1 ); // auf den ersten Box-StartNode + SwNodeIndex aNdIdx( *pTblNd, 1 ); // Set to StartNode of first Box SwTableLines& rLines = pNdTbl->GetTabLines(); for( sal_uInt16 n = 0; n < nRows; ++n ) { @@ -505,7 +504,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, pBoxF = ::lcl_CreateAFmtBoxFmt( *this, aBoxFmtArr, *pTAFmt, nCols, nId ); - // ggfs. noch die Absatz/ZeichenAttribute setzen + // Set the Paragraph/Character Attributes if needed if( pTAFmt->IsFont() || pTAFmt->IsJustify() ) { aCharSet.ClearItem(); @@ -524,15 +523,14 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, else pBoxF = pBoxFmt; - // fuer AutoFormat bei der Eingabe: beim Einfuegen der Tabelle - // werden gleich die Spalten gesetzt. Im Array stehen die - // Positionen der Spalten!! (nicht deren Breite!) + // For AutoFormat on input: the columns are set when inserting the Table + // The Array contains the columns positions and not their widths! if( pColArr ) { nWidth = (*pColArr)[ i + 1 ] - (*pColArr)[ i ]; if( pBoxF->GetFrmSize().GetWidth() != nWidth ) { - if( pBoxF->GetDepends() ) // neues Format erzeugen! + if( pBoxF->GetDepends() ) // Create new Format { SwTableBoxFmt *pNewFmt = MakeTableBoxFmt(); *pNewFmt = *pBoxF; @@ -544,11 +542,11 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, SwTableBox *pBox = new SwTableBox( pBoxF, aNdIdx, pLine); rBoxes.insert( rBoxes.begin() + i, pBox ); - aNdIdx += 3; // StartNode, TextNode, EndNode == 3 Nodes + aNdIdx += 3; // StartNode, TextNode, EndNode == 3 Nodes } } - // und Frms einfuegen. - GetNodes().GoNext( &aNdIdx ); // zum naechsten ContentNode + // Insert Frms + GetNodes().GoNext( &aNdIdx ); // Go to the next ContentNode pTblNd->MakeFrms( &aNdIdx ); if( IsRedlineOn() || (!IsIgnoreRedline() && !pRedlineTbl->empty() )) @@ -576,14 +574,14 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx, if( !nBoxes ) return 0; - // wenn Lines angegeben, erzeuge die Matrix aus Lines & Boxen + // If Lines is given, create the Matrix from Lines and Boxes if( !pHeadlineTxtColl || !nLines ) pHeadlineTxtColl = pCntntTxtColl; SwTableNode * pTblNd = new SwTableNode( rNdIdx ); SwEndNode* pEndNd = new SwEndNode( rNdIdx, *pTblNd ); - if( !nLines ) // fuer die FOR-Schleife + if( !nLines ) // For the for loop ++nLines; SwNodeIndex aIdx( *pEndNd ); @@ -627,14 +625,15 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx, } -//---------------- Text -> Tabelle ----------------------- - +/** + * Text to Table + */ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, const SwPaM& rRange, sal_Unicode cCh, sal_Int16 eAdjust, const SwTableAutoFmt* pTAFmt ) { - // pruefe ob in der Selection eine Tabelle liegt + // See if the selection contains a Table const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End(); { sal_uLong nCnt = pStt->nNode.GetIndex(); @@ -643,7 +642,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, return 0; } - /* Save first node in the selection if it is a context node. */ + // Save first node in the selection if it is a context node SwCntntNode * pSttCntntNd = pStt->nNode.GetNode().GetCntntNode(); SwPaM aOriginal( *pStt, *pEnd ); @@ -658,19 +657,20 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, static_cast<sal_uInt16>(eAdjust), pTAFmt ); GetIDocumentUndoRedo().AppendUndo( pUndo ); - // das Splitten vom TextNode nicht in die Undohistory aufnehmen + // Do not add splitting the TextNode to the Undo history GetIDocumentUndoRedo().DoUndo( false ); } ::PaMCorrAbs( aOriginal, *pEnd ); - // sorge dafuer, das der Bereich auf Node-Grenzen liegt + // Make sure that the range is on Node Edges SwNodeRange aRg( pStt->nNode, pEnd->nNode ); if( pStt->nContent.GetIndex() ) SplitNode( *pStt, false ); sal_Bool bEndCntnt = 0 != pEnd->nContent.GetIndex(); - // nicht splitten am Ende der Zeile (aber am Ende vom Doc!!) + + // Do not split at the End of a Line (except at the End of the Doc) if( bEndCntnt ) { if( pEnd->nNode.GetNode().GetCntntNode()->Len() != pEnd->nContent.GetIndex() @@ -680,7 +680,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, ((SwNodeIndex&)pEnd->nNode)--; ((SwIndex&)pEnd->nContent).Assign( pEnd->nNode.GetNode().GetCntntNode(), 0 ); - // ein Node und am Ende ?? + // A Node and at the End? if( pStt->nNode.GetIndex() >= pEnd->nNode.GetIndex() ) aRg.aStart--; } @@ -691,23 +691,23 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, if( aRg.aEnd.GetIndex() == aRg.aStart.GetIndex() ) { - OSL_FAIL( "Kein Bereich" ); + OSL_FAIL( "empty range" ); aRg.aEnd++; } - // Wir gehen jetzt immer ueber die Upper, um die Tabelle einzufuegen: + // We always use Upper to insert the Table SwNode2Layout aNode2Layout( aRg.aStart.GetNode() ); GetIDocumentUndoRedo().DoUndo( 0 != pUndo ); - // dann erstelle die Box/Line/Table-Struktur + // Create the Box/Line/Table construct SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt(); SwTableLineFmt* pLineFmt = MakeTableLineFmt(); SwTableFmt* pTableFmt = MakeTblFrmFmt( GetUniqueTblName(), GetDfltFrmFmt() ); - // alle Zeilen haben die Fill-Order von links nach rechts ! + // All Lines have a left-to-right Fill Order pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT )); - // die Tabelle bekommt USHRT_MAX als default SSize + // The Table's SSize is USHRT_MAX pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX )); if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) ) pTableFmt->SetFmtAttr( SwFmtLayoutSplit( sal_False )); @@ -732,7 +732,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, GetTxtCollFromPool( RES_POOLCOLL_STANDARD ), pUndo ); SwTable * pNdTbl = &pTblNd->GetTable(); - OSL_ENSURE( pNdTbl, "kein Tabellen-Node angelegt." ); + OSL_ENSURE( pNdTbl, "No Table Node created" ); const sal_uInt16 nRowsToRepeat = tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ? @@ -743,15 +743,15 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, sal_Bool bUseBoxFmt = sal_False; if( !pBoxFmt->GetDepends() ) { - // die Formate an den Boxen haben schon die richtige Size, es darf - // also nur noch die richtige Umrandung/AutoFmt gesetzt werden. + // The Box's Formats already have the right size, we must only set + // the right Border/AutoFmt. bUseBoxFmt = sal_True; pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() ); delete pBoxFmt; eAdjust = text::HoriOrientation::NONE; } - //Orientation am Fmt der Table setzen + // Set Orientation in the Table's Fmt pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) ); pNdTbl->RegisterToFormat( *pTableFmt ); @@ -801,7 +801,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, *pTAFmt, USHRT_MAX, nId ); } - // ggfs. noch die Absatz/ZeichenAttribute setzen + // Set Paragraph/Character Attributes if needed if( pTAFmt->IsFont() || pTAFmt->IsJustify() ) { aCharSet.ClearItem(); @@ -859,7 +859,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, } } - // JP 03.04.97: Inhalt der Boxen auf Zahlen abpruefen + // Check the Boxes' for Numbers if( IsInsTblFormatNum() ) { for (size_t nBoxes = pNdTbl->GetTabSortBoxes().size(); nBoxes; ) @@ -872,7 +872,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 ); { - SwPaM& rTmp = (SwPaM&)rRange; // Point immer an den Anfang + SwPaM& rTmp = (SwPaM&)rRange; // Point always at the Start rTmp.DeleteMark(); rTmp.GetPoint()->nNode = *pTblNd; SwCntntNode* pCNd = GetNodes().GoNext( &rTmp.GetPoint()->nNode ); @@ -928,12 +928,14 @@ static void lcl_RemoveBreaks(SwCntntNode & rNode, SwTableFmt *const pTableFmt) } } +/** + * balance lines in table, insert empty boxes so all lines have the size + */ static void lcl_BalanceTable(SwTable & rTable, size_t const nMaxBoxes, SwTableNode & rTblNd, SwTableBoxFmt & rBoxFmt, SwTxtFmtColl & rTxtColl, SwUndoTxtToTbl *const pUndo, std::vector<sal_uInt16> *const pPositions) { - // balance lines in table, insert empty boxes so all lines have the size for (size_t n = 0; n < rTable.GetTabLines().size(); ++n) { SwTableLine *const pCurrLine = rTable.GetTabLines()[ n ]; @@ -976,8 +978,8 @@ lcl_SetTableBoxWidths(SwTable & rTable, size_t const nMaxBoxes, SwFmtFrmSize(ATT_VAR_SIZE, (*pPositions)[n] - nLastPos)); for (size_t nTmpLine = 0; nTmpLine < rLns.size(); ++nTmpLine) { - //JP 24.06.98: have to do an Add here, because the BoxFormat is - // still needed by the caller + // Have to do an Add here, because the BoxFormat + // is still needed by the caller pNewFmt->Add( rLns[ nTmpLine ]->GetTabBoxes()[ n ] ); } @@ -1022,16 +1024,15 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, aSttIdx += 2, nLines++, nBoxes = 0 ) { SwTxtNode* pTxtNd = aSttIdx.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "nur TextNodes in der Tabelle aufnehmen" ); + OSL_ENSURE( pTxtNd, "Only add TextNodes to the Table" ); if( !nLines && 0x0b == cCh ) { cCh = 0x09; - // JP 28.10.96: vom 1. Node die Positionen des Trenners besorgen, - // damit die Boxen entsprechend eingestellt werden + // Get the separator's position from the first Node, in order for the Boxes to be set accordingly SwTxtFrmInfo aFInfo( (SwTxtFrm*)pTxtNd->getLayoutFrm( pTxtNd->GetDoc()->GetCurrentLayout() ) ); - if( aFInfo.IsOneLine() ) // nur dann sinnvoll! + if( aFInfo.IsOneLine() ) // only makes sense in this case { const sal_Unicode* pTxt = pTxtNd->GetTxt().GetBuffer(); for( xub_StrLen nChPos = 0; *pTxt; ++nChPos, ++pTxt ) @@ -1053,8 +1054,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, lcl_RemoveBreaks(*pTxtNd, (0 == nLines) ? pTblFmt : 0); - // setze den bei allen TextNode in der Tabelle den TableNode - // als StartNode + // Set the TableNode as StartNode for all TextNodes in the Table pTxtNd->pStartOfSection = pTblNd; pLine = new SwTableLine( pLineFmt, 1, 0 ); @@ -1079,26 +1079,25 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, _RestoreCntntIdx( aBkmkArr, *pNewNd, nChPos, nChPos + 1 ); - // Trennzeichen loeschen und SuchString korrigieren + // Delete separator and correct search string pTxtNd->EraseText( aCntPos.nContent, 1 ); pTxt = pTxtNd->GetTxt().GetBuffer(); nChPos = 0; - --nChPos, --pTxt; // for the ++ in the for loop !!! + --nChPos, --pTxt; // for the ++ in the for loop !!! - // setze bei allen TextNodes in der Tabelle den TableNode - // als StartNode + // Set the TableNode as StartNode for all TextNodes in the Table const SwNodeIndex aTmpIdx( aCntPos.nNode, -1 ); pSttNd = new SwStartNode( aTmpIdx, ND_STARTNODE, SwTableBoxStartNode ); new SwEndNode( aCntPos.nNode, *pSttNd ); pNewNd->pStartOfSection = pSttNd; - // Section der Box zuweisen + // Assign Section to the Box pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine ); pLine->GetTabBoxes().insert( pLine->GetTabBoxes().begin() + nBoxes++, pBox ); } - // und jetzt den letzten Teil-String + // Now for the last substring if( !aBkmkArr.empty() ) _RestoreCntntIdx( aBkmkArr, *pTxtNd, pTxtNd->GetTxt().Len(), pTxtNd->GetTxt().Len()+1 ); @@ -1152,19 +1151,20 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > bool const bUndo(GetIDocumentUndoRedo().DoesUndo()); if (bUndo) { - // das Splitten vom TextNode nicht in die Undohistory aufnehmen + // Do not add splitting the TextNode to the Undo history GetIDocumentUndoRedo().DoUndo(false); } ::PaMCorrAbs( aOriginal, *pEnd ); - // sorge dafuer, das der Bereich auf Node-Grenzen liegt + // make sure that the range is on Node Edges SwNodeRange aRg( pStt->nNode, pEnd->nNode ); if( pStt->nContent.GetIndex() ) SplitNode( *pStt, false ); sal_Bool bEndCntnt = 0 != pEnd->nContent.GetIndex(); - // nicht splitten am Ende der Zeile (aber am Ende vom Doc!!) + + // Do not split at the End of a Line (except at the End of the Doc) if( bEndCntnt ) { if( pEnd->nNode.GetNode().GetCntntNode()->Len() != pEnd->nContent.GetIndex() @@ -1174,7 +1174,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > ((SwNodeIndex&)pEnd->nNode)--; ((SwIndex&)pEnd->nContent).Assign( pEnd->nNode.GetNode().GetCntntNode(), 0 ); - // ein Node und am Ende ?? + // A Node and at the End? if( pStt->nNode.GetIndex() >= pEnd->nNode.GetIndex() ) aRg.aStart--; } @@ -1185,23 +1185,23 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > if( aRg.aEnd.GetIndex() == aRg.aStart.GetIndex() ) { - OSL_FAIL( "Kein Bereich" ); + OSL_FAIL( "empty range" ); aRg.aEnd++; } - // Wir gehen jetzt immer ueber die Upper, um die Tabelle einzufuegen: + // We always use Upper to insert the Table SwNode2Layout aNode2Layout( aRg.aStart.GetNode() ); GetIDocumentUndoRedo().DoUndo(bUndo); - // dann erstelle die Box/Line/Table-Struktur + // Create the Box/Line/Table construct SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt(); SwTableLineFmt* pLineFmt = MakeTableLineFmt(); SwTableFmt* pTableFmt = MakeTblFrmFmt( GetUniqueTblName(), GetDfltFrmFmt() ); - // alle Zeilen haben die Fill-Order von links nach rechts ! + // All Lines have a left-to-right Fill Order pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT )); - // die Tabelle bekommt USHRT_MAX als default SSize + // The Table's SSize is USHRT_MAX pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX )); /* If the first node in the selection is a context node and if it @@ -1224,13 +1224,13 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > GetTxtCollFromPool( RES_POOLCOLL_STANDARD )/*, pUndo*/ ); SwTable * pNdTbl = &pTblNd->GetTable(); - OSL_ENSURE( pNdTbl, "kein Tabellen-Node angelegt." ); + OSL_ENSURE( pNdTbl, "No Table Node created" ); pNdTbl->RegisterToFormat( *pTableFmt ); if( !pBoxFmt->GetDepends() ) { - // die Formate an den Boxen haben schon die richtige Size, es darf - // also nur noch die richtige Umrandung/AutoFmt gesetzt werden. + // The Box's Formats already have the right size, we must only set + // the right Border/AutoFmt. pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() ); delete pBoxFmt; } @@ -1421,9 +1421,9 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, } -//---------------- Tabelle -> Text ----------------------- - - +/** + * Table to Text + */ sal_Bool SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh ) { if( !pTblNd ) @@ -1466,8 +1466,10 @@ sal_Bool SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh ) return bRet; } -// -- benutze die ForEach Methode vom PtrArray um aus einer Tabelle wieder -// Text zuerzeugen. (Die Boxen koennen auch noch Lines enthalten !!) +/** + * Use the ForEach method from PtrArray to recreate Text from a Table. + * The Boxes can also contain Lines! + */ struct _DelTabPara { SwTxtNode* pLastNd; @@ -1482,28 +1484,27 @@ struct _DelTabPara pUndo( rPara.pUndo ), cCh( rPara.cCh ) {} }; -// forward deklarieren damit sich die Lines und Boxen rekursiv aufrufen -// koennen. +// Forward declare so that the Lines and Boxes can use recursion static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ); static void lcl_DelLine( SwTableLine* pLine, _DelTabPara* pPara ) { - OSL_ENSURE( pPara, "die Parameter fehlen" ); + OSL_ENSURE( pPara, "The parameters are missing!" ); _DelTabPara aPara( *pPara ); for( SwTableBoxes::iterator it = pLine->GetTabBoxes().begin(); it != pLine->GetTabBoxes().end(); ++it) lcl_DelBox(*it, &aPara ); - if( pLine->GetUpper() ) // gibt es noch eine uebergeordnete Box ?? - // dann gebe den letzten TextNode zurueck + if( pLine->GetUpper() ) // Is there a parent Box? + // Return the last TextNode pPara->pLastNd = aPara.pLastNd; } static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) { - OSL_ENSURE( pDelPara, "die Parameter fehlen" ); + OSL_ENSURE( pDelPara, "The parameters are missing" ); - // loesche erstmal die Lines der Box + // Delete the Box's Lines if( !pBox->GetTabLines().empty() ) BOOST_FOREACH( SwTableLine* pLine, pBox->GetTabLines() ) lcl_DelLine( pLine, pDelPara ); @@ -1512,7 +1513,7 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) SwDoc* pDoc = pDelPara->rNds.GetDoc(); SwNodeRange aDelRg( *pBox->GetSttNd(), 0, *pBox->GetSttNd()->EndOfSectionNode() ); - // loesche die Section + // Delete the Section pDelPara->rNds.SectionUp( &aDelRg ); const SwTxtNode* pCurTxtNd; if( T2T_PARA != pDelPara->cCh && pDelPara->pLastNd && @@ -1523,7 +1524,7 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) aDelRg.aStart--; if( pDelPara->pLastNd == &aDelRg.aStart.GetNode() ) { - // Inserting the seperator + // Inserting the separator SwIndex aCntIdx( pDelPara->pLastNd, pDelPara->pLastNd->GetTxt().Len()); pDelPara->pLastNd->InsertText( rtl::OUString(pDelPara->cCh), aCntIdx, IDocumentContentOperations::INS_EMPTYEXPAND ); @@ -1554,8 +1555,7 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) aDelRg.aEnd--; pDelPara->pLastNd = aDelRg.aEnd.GetNode().GetTxtNode(); - //JP 03.04.97: die Ausrichtung der ZahlenFormatierung auf - // keinen Fall uebernehmen + // Do not take over the NumberFormatting's adjustment if( pDelPara->pLastNd && pDelPara->pLastNd->HasSwAttrSet() ) pDelPara->pLastNd->ResetAttr( RES_PARATR_ADJUST ); } @@ -1565,39 +1565,38 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) sal_Bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, SwUndoTblToTxt* pUndo ) { - // ist eine Tabelle selektiert ? + // Is a Table selected? SwTableNode* pTblNd; if( rRange.aStart.GetIndex() >= rRange.aEnd.GetIndex() || 0 == ( pTblNd = rRange.aStart.GetNode().GetTableNode()) || &rRange.aEnd.GetNode() != pTblNd->EndOfSectionNode() ) return sal_False; - // stand die Tabelle ganz alleine in einer Section ? - // dann ueber den Upper der Tabelle die Frames anlegen + // If the Table was alone in a Section, create the Frames via the Table's Upper SwNode2Layout* pNode2Layout = 0; SwNodeIndex aFrmIdx( rRange.aStart ); SwNode* pFrmNd = FindPrvNxtFrmNode( aFrmIdx, &rRange.aEnd.GetNode() ); if( !pFrmNd ) - // dann sammel mal alle Uppers ein + // Collect all Uppers pNode2Layout = new SwNode2Layout( *pTblNd ); - // loesche schon mal die Frames + // Delete the Frames pTblNd->DelFrms(); - // dann "loeschen" die Tabellen und fasse alle Lines/Boxen zusammen + // "Delete" the Table and merge all Lines/Boxes _DelTabPara aDelPara( *this, cCh, pUndo ); BOOST_FOREACH( SwTableLine *pLine, pTblNd->pTable->GetTabLines() ) lcl_DelLine( pLine, &aDelPara ); - // jetzt ist aus jeder TableLine ein TextNode mit dem entsprechenden - // Trenner erzeugt worden. Es braucht nur noch die Table-Section - // geloescht und fuer die neuen TextNode die Frames erzeugt werden. + // We just created a TextNode with fitting separator for every TableLine. + // Now we only need to delete the TableSection and create the Frames for the + // new TextNode. SwNodeRange aDelRg( rRange.aStart, rRange.aEnd ); - // JP 14.01.97: hat die Tabelle PageDesc-/Break-Attribute? Dann in den - // ersten TextNode uebernehmen + // If the Table has PageDesc/Break Attributes, carry them over to the + // first Text Node { -// was ist mit UNDO??? + // What about UNDO? const SfxItemSet& rTblSet = pTblNd->pTable->GetFrmFmt()->GetAttrSet(); const SfxPoolItem *pBreak, *pDesc; if( SFX_ITEM_SET != rTblSet.GetItemState( RES_PAGEDESC, sal_False, &pDesc )) @@ -1616,7 +1615,7 @@ sal_Bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, } } - SectionUp( &aDelRg ); // loesche die Section und damit die Tabelle + SectionUp( &aDelRg ); // Delete this Section and by that the Table // #i28006# sal_uLong nStt = aDelRg.aStart.GetIndex(), nEnd = aDelRg.aEnd.GetIndex(); if( !pFrmNd ) @@ -1677,14 +1676,15 @@ sal_Bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, } -// ----- einfuegen von Spalten/Zeilen ------------------------ - +/** + * Inserting Columns/Rows + */ sal_Bool SwDoc::InsertCol( const SwCursor& rCursor, sal_uInt16 nCnt, sal_Bool bBehind ) { if( !::CheckSplitCells( rCursor, nCnt + 1, nsSwTblSearchType::TBLSEARCH_COL ) ) return sal_False; - // lasse ueber das Layout die Boxen suchen + // Find the Boxes via the Layout SwSelBoxes aBoxes; ::GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_COL ); @@ -1696,8 +1696,7 @@ sal_Bool SwDoc::InsertCol( const SwCursor& rCursor, sal_uInt16 nCnt, sal_Bool bB sal_Bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool bBehind ) { - // uebers SwDoc fuer Undo !! - OSL_ENSURE( !rBoxes.empty(), "keine gueltige Box-Liste" ); + OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return sal_False; @@ -1747,7 +1746,7 @@ sal_Bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool b sal_Bool SwDoc::InsertRow( const SwCursor& rCursor, sal_uInt16 nCnt, sal_Bool bBehind ) { - // lasse ueber das Layout die Boxen suchen + // Find the Boxes via the Layout SwSelBoxes aBoxes; GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_ROW ); @@ -1759,8 +1758,7 @@ sal_Bool SwDoc::InsertRow( const SwCursor& rCursor, sal_uInt16 nCnt, sal_Bool bB sal_Bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool bBehind ) { - // uebers SwDoc fuer Undo !! - OSL_ENSURE( !rBoxes.empty(), "keine gueltige Box-Liste" ); + OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return sal_False; @@ -1809,28 +1807,28 @@ sal_Bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, sal_Bool b } -// ----- loeschen von Spalten/Zeilen ------------------------ - +/** + * Deleting Columns/Rows + */ sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor ) { - // lasse ueber das Layout die Boxen suchen + // Find the Boxes via the Layout SwSelBoxes aBoxes; GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_ROW ); if( ::HasProtectedCells( aBoxes )) return sal_False; - // die Crsr aus dem Loeschbereich entfernen. - // Der Cursor steht danach: - // - es folgt noch eine Zeile, in dieser - // - vorher steht noch eine Zeile, in dieser - // - sonst immer dahinter + // Remove the Crsr from the to-be-deleted Section. + // The Cursor is placed after the table, except for + // - when there's another Line, we place it in that one + // - when a Line preceeds it, we place it in that one { SwTableNode* pTblNd = rCursor.GetNode()->FindTableNode(); if( pTblNd->GetTable().ISA( SwDDETable )) return sal_False; - // suche alle Boxen / Lines + // Find all Boxes/Lines _FndBox aFndBox( 0, 0 ); { _FndPara aPara( aBoxes, &aFndBox ); @@ -1844,7 +1842,7 @@ sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor ) if( pESh ) { pESh->KillPams(); - // JP: eigentlich sollte man ueber alle Shells iterieren!! + // FIXME: Actually we should be interating over all Shells! } _FndBox* pFndBox = &aFndBox; @@ -1853,7 +1851,7 @@ sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor ) { _FndBox *const pTmp = & pFndBox->GetLines().front().GetBoxes()[0]; if( pTmp->GetBox()->GetSttNd() ) - break; // das ist sonst zu weit + break; // Else it gets too far pFndBox = pTmp; } @@ -1871,7 +1869,7 @@ sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor ) pNextBox->GetFrmFmt()->GetProtect().IsCntntProtected() ) pNextBox = pNextBox->FindNextBox( pTblNd->GetTable(), pNextBox ); - if( !pNextBox ) // keine nachfolgende? dann die vorhergehende + if( !pNextBox ) // No succeeding Boxes? Then take the preceeding one { pDelLine = pFndBox->GetLines().front().GetLine(); pDelBox = pDelLine->GetTabBoxes()[ 0 ]; @@ -1885,9 +1883,9 @@ sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor ) } sal_uLong nIdx; - if( pNextBox ) // dann den Cursor hier hinein + if( pNextBox ) // Place the Cursor here nIdx = pNextBox->GetSttIdx() + 1; - else // ansonsten hinter die Tabelle + else // Else after the Table nIdx = pTblNd->EndOfSectionIndex() + 1; SwNodeIndex aIdx( GetNodes(), nIdx ); @@ -1897,17 +1895,16 @@ sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor ) if( pCNd ) { - // die Cursor von der Shell oder den uebergebenen Cursor aendern? + // Change the Shell's Cursor or the one passed? SwPaM* pPam = (SwPaM*)&rCursor; pPam->GetPoint()->nNode = aIdx; pPam->GetPoint()->nContent.Assign( pCNd, 0 ); - pPam->SetMark(); // beide wollen etwas davon haben + pPam->SetMark(); // Both want a part of it pPam->DeleteMark(); } } - // dann loesche doch die Zeilen - + // Thus delete the Rows GetIDocumentUndoRedo().StartUndo(UNDO_ROW_DELETE, NULL); sal_Bool bResult = DeleteRowCol( aBoxes ); GetIDocumentUndoRedo().EndUndo(UNDO_ROW_DELETE, NULL); @@ -1917,15 +1914,15 @@ sal_Bool SwDoc::DeleteRow( const SwCursor& rCursor ) sal_Bool SwDoc::DeleteCol( const SwCursor& rCursor ) { - // lasse ueber das Layout die Boxen suchen + // Find the Boxes via the Layout SwSelBoxes aBoxes; GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_COL ); if( ::HasProtectedCells( aBoxes )) return sal_False; - // die Crsr muessen noch aus dem Loesch Bereich entfernt - // werden. Setze sie immer hinter/auf die Tabelle; ueber die - // Dokument-Position werden sie dann immer an die alte Position gesetzt. + // The Cursors need to be removed from the to-be-deleted range. + // Always place them after/on top of the Table; they are always set + // to the old position via the document position. SwEditShell* pESh = GetEditShell(); if( pESh ) { @@ -1933,7 +1930,7 @@ sal_Bool SwDoc::DeleteCol( const SwCursor& rCursor ) pESh->ParkCrsr( SwNodeIndex( *pNd ) ); } - // dann loesche doch die Spalten + // Thus delete the Columns GetIDocumentUndoRedo().StartUndo(UNDO_COL_DELETE, NULL); sal_Bool bResult = DeleteRowCol( aBoxes, true ); GetIDocumentUndoRedo().EndUndo(UNDO_COL_DELETE, NULL); @@ -1946,8 +1943,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) if( ::HasProtectedCells( rBoxes )) return sal_False; - // uebers SwDoc fuer Undo !! - OSL_ENSURE( !rBoxes.empty(), "keine gueltige Box-Liste" ); + OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return sal_False; @@ -1968,7 +1964,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) rTable.FindSuperfluousRows( aSelBoxes ); } - // soll die gesamte Tabelle geloescht werden ?? + // Are we deleting the whole Table? const sal_uLong nTmpIdx1 = pTblNd->GetIndex(); const sal_uLong nTmpIdx2 = aSelBoxes.back()->GetSttNd()->EndOfSectionIndex() + 1; if( pTblNd->GetTable().GetTabSortBoxes().size() == aSelBoxes.size() && @@ -1976,7 +1972,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) nTmpIdx2 == pTblNd->EndOfSectionIndex() ) { sal_Bool bNewTxtNd = sal_False; - // steht diese auch noch alleine in einem FlyFrame ? + // Is it alone in a FlyFrame? SwNodeIndex aIdx( *pTblNd, -1 ); const SwStartNode* pSttNd = aIdx.GetNode().GetStartNode(); if( pSttNd ) @@ -1990,21 +1986,19 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) SwFrmFmt* pFmt = pSttNd->GetFlyFmt(); if( pFmt ) { - // Ok, das ist das gesuchte FlyFormat + // That's the FlyFormat we're looking for DelLayoutFmt( pFmt ); return sal_True; } } - // kein Fly ?? also Kopf- oder Fusszeile: dann immer einen - // TextNode ueberig lassen. - // Undo koennen wir dann vergessen !! + // No Fly? Thus Header or Footer: always leave a TextNode + // We can forget about Undo then! bNewTxtNd = sal_True; } } - // kein Fly ?? also Kopf- oder Fusszeile: dann immer einen - // TextNode ueberig lassen. - aIdx++; + // No Fly? Thus Header or Footer: always leave a TextNode + ++aIdx; if (GetIDocumentUndoRedo().DoesUndo()) { GetIDocumentUndoRedo().ClearRedo(); @@ -2017,7 +2011,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) ); } - // save the cursors (UNO and otherwise) + // Save the cursors (UNO and otherwise) SwPaM aSavePaM( SwNodeIndex( *pTblNd->EndOfSectionNode() ) ); if( ! aSavePaM.Move( fnMoveForward, fnGoNode ) ) { @@ -2029,7 +2023,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) ::PaMCorrAbs(tmpPaM, *aSavePaM.GetMark()); } - // harte SeitenUmbrueche am nachfolgenden Node verschieben + // Move hard PageBreaks to the succeeding Node sal_Bool bSavePageBreak = sal_False, bSavePageDesc = sal_False; sal_uLong nNextNd = pTblNd->EndOfSectionIndex()+1; SwCntntNode* pNextNd = GetNodes()[ nNextNd ]->GetCntntNode(); @@ -2069,7 +2063,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) ); } - // save the cursors (UNO and otherwise) + // Save the cursors (UNO and otherwise) SwPaM aSavePaM( SwNodeIndex( *pTblNd->EndOfSectionNode() ) ); if( ! aSavePaM.Move( fnMoveForward, fnGoNode ) ) { @@ -2081,7 +2075,7 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) ::PaMCorrAbs(tmpPaM, *aSavePaM.GetMark()); } - // harte SeitenUmbrueche am nachfolgenden Node verschieben + // Move hard PageBreaks to the succeeding Node SwCntntNode* pNextNd = GetNodes()[ pTblNd->EndOfSectionIndex()+1 ]->GetCntntNode(); if( pNextNd ) { @@ -2149,13 +2143,13 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) } -// ---------- teilen / zusammenfassen von Boxen in der Tabelle -------- - +/** + * Split up/merge Boxes in the Table + */ sal_Bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, sal_uInt16 nCnt, sal_Bool bSameHeight ) { - // uebers SwDoc fuer Undo !! - OSL_ENSURE( !rBoxes.empty() && nCnt, "keine gueltige Box-Liste" ); + OSL_ENSURE( !rBoxes.empty() && nCnt, "No valid Box list" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return sal_False; @@ -2224,7 +2218,7 @@ sal_Bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, sal_uInt16 n sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam ) { - // pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen + // Check if the current cursor's Point/Mark are inside a Table SwTableNode* pTblNd = rPam.GetNode()->FindTableNode(); if( !pTblNd ) return TBLMERGE_NOSELECTION; @@ -2250,13 +2244,13 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam ) ? new SwUndoTblMerge( rPam ) : 0 ); - // lasse ueber das Layout die Boxen suchen + // Find the Boxes via the Layout SwSelBoxes aBoxes; SwSelBoxes aMerged; SwTableBox* pMergeBox; if( !rTable.PrepareMerge( rPam, aBoxes, aMerged, &pMergeBox, pUndo ) ) - { // no cells found to merge + { // No cells found to merge SetRedlineMode_intern( eOld ); if( pUndo ) { @@ -2281,11 +2275,11 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam ) } else { - // die PaMs muessen noch aus dem Loesch Bereich entfernt - // werden. Setze sie immer hinter/auf die Tabelle; ueber die - // Dokument-Position werden sie dann immer an die alte Position gesetzt. - // Erstmal einen Index auf die Parkposition merken, denn nach GetMergeSel - // komme ich nicht mehr dran. + // The PaMs need to be removed from the to-be-deleted range. Thus always place + // them at the end of/on top of the Table; it's always set to the old position via + // the Document Position. + // For a start remember an index for the temporary position, because we cannot + // access it after GetMergeSel { rPam.DeleteMark(); rPam.GetPoint()->nNode = *pMergeBox->GetSttNd(); @@ -2299,7 +2293,7 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam ) pTmp->GetBound( (sal_Bool)i ) = *rPam.GetPoint(); } - // dann fuege sie zusammen + // Merge them SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); aMsgHnt.eFlags = TBL_BOXPTR; UpdateTblFlds( &aMsgHnt ); @@ -2329,12 +2323,10 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam ) -// ------------------------------------------------------- - -//--------- -// SwTableNode -//--------- - +/** + * SwTableNode + * + */ SwTableNode::SwTableNode( const SwNodeIndex& rIdx ) : SwStartNode( rIdx, ND_TABLENODE ) { @@ -2343,7 +2335,7 @@ SwTableNode::SwTableNode( const SwNodeIndex& rIdx ) SwTableNode::~SwTableNode() { - //don't forget to notify uno wrappers + // Notify UNO wrappers SwFrmFmt* pTblFmt = GetTable().GetFrmFmt(); SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pTblFmt ); @@ -2357,18 +2349,19 @@ SwTabFrm *SwTableNode::MakeFrm( SwFrm* pSib ) return new SwTabFrm( *pTable, pSib ); } -//Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom -//Dokument. Die erzeugten Contentframes werden in das entsprechende -//Layout gehaengt. +/** + * Creates all Views from the Document for the preceeding Node. The resulting ContentFrames + * are added to the corresponding Layout. + */ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx ) { - if( !GetTable().GetFrmFmt()->GetDepends())//gibt es ueberhaupt Frames ?? + if( !GetTable().GetFrmFmt()->GetDepends()) // Do we actually have Frame? return; SwFrm *pFrm, *pNew; SwCntntNode * pNode = rIdx.GetNode().GetCntntNode(); - OSL_ENSURE( pNode, "Kein Contentnode oder Copy-Node und neuer Node identisch."); + OSL_ENSURE( pNode, "No ContentNode or CopyNode and new Node is identical"); sal_Bool bBefore = rIdx < GetIndex(); @@ -2377,22 +2370,22 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx ) while( 0 != (pFrm = aNode2Layout.NextFrm()) ) { pNew = pNode->MakeFrm( pFrm ); - // wird ein Node vorher oder nachher mit Frames versehen + // Will the Node receive Frames before or after? if ( bBefore ) - // der neue liegt vor mir + // The new one preceeds me pNew->Paste( pFrm->GetUpper(), pFrm ); else - // der neue liegt hinter mir + // The new one succeeds me pNew->Paste( pFrm->GetUpper(), pFrm->GetNext() ); } } -//Fuer jede Shell einen TblFrm anlegen und vor den entsprechenden -//CntntFrm pasten. - +/** + * Create a TblFrm for every Shell and insert before the corresponding CntntFrm. + */ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind ) { - OSL_ENSURE( pIdxBehind, "kein Index" ); + OSL_ENSURE( pIdxBehind, "No Index" ); *pIdxBehind = *this; SwNode *pNd = GetNodes().FindPrvNxtFrmNode( *pIdxBehind, EndOfSectionNode() ); if( !pNd ) @@ -2426,11 +2419,9 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind ) void SwTableNode::DelFrms() { - //Erstmal die TabFrms ausschneiden und deleten, die Columns und Rows - //nehmen sie mit in's Grab. - //Die TabFrms haengen am FrmFmt des SwTable. - //Sie muessen etwas umstaendlich zerstort werden, damit die Master - //die Follows mit in's Grab nehmen. + /* For a start, cut out and delete the TabFrms (which will also delete the Columns and Rows) + The TabFrms are attached to the FrmFmt of the SwTable. + We need to delete them in a more cumbersome way, for the Master to also delete the Follows. */ SwIterator<SwTabFrm,SwFmt> aIter( *(pTable->GetFrmFmt()) ); SwTabFrm *pFrm = aIter.First(); @@ -2513,11 +2504,11 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr, } else if( !pCrsr && !pBoxFrm ) { - OSL_ENSURE( !this, "einer von beiden muss angegeben werden!" ); + OSL_ENSURE( !this, "One of them needs to be specified!" ); return ; } - //Fix-Punkte setzen, LeftMin in Dokumentkoordinaten die anderen relativ. + // Set fixed points, LeftMin in Document coordinates, all others relative SWRECTFN( pTab ) const SwPageFrm* pPage = pTab->FindPageFrm(); const sal_uLong nLeftMin = (pTab->Frm().*fnRect->fnGetLeft)() - @@ -2602,7 +2593,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , const SwFrm* pFrm = pTab->GetNextLayoutLeaf(); - //Fix-Punkte setzen, LeftMin in Dokumentkoordinaten die anderen relativ. + // Set fixed points, LeftMin in Document coordinates, all others relative SWRECTFN( pTab ) const SwPageFrm* pPage = pTab->FindPageFrm(); const long nLeftMin = ( bVert ? @@ -2733,12 +2724,12 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly, } else if( !pCrsr && !pBoxFrm ) { - OSL_ENSURE( !this, "einer von beiden muss angegeben werden!" ); + OSL_ENSURE( !this, "One of them needs to be specified!" ); return ; } - // sollte die Tabelle noch auf relativen Werten (USHRT_MAX) stehen - // dann muss es jetzt auf absolute umgerechnet werden. + // If the Table is still using relative values (USHRT_MAX) + // we need to switch to absolute ones. SwTable& rTab = *pTab->GetTable(); const SwFmtFrmSize& rTblFrmSz = rTab.GetFrmFmt()->GetFrmSize(); SWRECTFN( pTab ) @@ -2766,7 +2757,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, sal_Bool bCurRowOnly, const sal_uLong nRightMax = (pTab->Frm().*fnRect->fnGetRight)() - (pPage->Frm().*fnRect->fnGetLeft)(); - //Fix-Punkte setzen, LeftMin in Dokumentkoordinaten die anderen relativ. + // Set fixed points, LeftMin in Document coordinates, all others relative aOld.SetLeftMin ( nLeftMin ); aOld.SetLeft ( (pTab->Prt().*fnRect->fnGetLeft)() ); aOld.SetRight ( (pTab->Prt().*fnRect->fnGetRight)()); @@ -2787,12 +2778,12 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCur pTab = ((SwFrm*)pBoxFrm)->ImplFindTabFrm(); pBox = pBoxFrm->GetTabBox(); - // sollte die Tabelle noch auf relativen Werten (USHRT_MAX) stehen - // dann muss es jetzt auf absolute umgerechnet werden. + // If the Table is still using relative values (USHRT_MAX) + // we need to switch to absolute ones. SWRECTFN( pTab ) SwTabCols aOld( rNew.Count() ); - //Fix-Punkte setzen, LeftMin in Dokumentkoordinaten die anderen relativ. + // Set fixed points, LeftMin in Document coordinates, all others relative const SwPageFrm* pPage = pTab->FindPageFrm(); aOld.SetRight( (pTab->Prt().*fnRect->fnGetHeight)() ); @@ -2902,9 +2893,9 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, sal_Bool bCurColOnly, const SwCur ::ClearFEShellTabCols(); } -/* -------------------------------------------------- - * Direktzugriff fuer UNO - * --------------------------------------------------*/ +/** + * Direct access for UNO + */ void SwDoc::SetTabCols(SwTable& rTab, const SwTabCols &rNew, const SwTabCols &rOld, const SwTableBox *pStart, sal_Bool bCurRowOnly ) { @@ -2937,13 +2928,6 @@ void SwDoc::SetRowsToRepeat( SwTable &rTable, sal_uInt16 nSet ) - -// Splittet eine Tabelle in der Grund-Zeile, in der der Index steht. -// Alle GrundZeilen dahinter wandern in eine neue Tabelle/-Node. -// Ist das Flag bCalcNewSize auf sal_True, wird fuer beide neuen Tabellen -// die neue Size aus dem Max der Boxen errechnet; vorrausgesetzt, -// die Size ist "absolut" gesetzt (USHRT_MAX) - void SwCollectTblLineBoxes::AddToUndoHistory( const SwCntntNode& rNd ) { if( pHst ) @@ -3005,7 +2989,7 @@ sal_Bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth aPosArr.erase( aPosArr.begin(), aPosArr.begin() + n ); m_Boxes.erase(m_Boxes.begin(), m_Boxes.begin() + n); - // dann die Positionen der neuen Size anpassen + // Adapt the positions to the new Size for( n = 0; n < aPosArr.size(); ++n ) { sal_uLong nSize = nWidth; @@ -3036,7 +3020,7 @@ void sw_Box_CollectBox( const SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara sal_uInt16 nLen = pBox->GetTabLines().size(); if( nLen ) { - // dann mit der richtigen Line weitermachen + // Continue with the actual Line if( pSplPara->IsGetFromTop() ) nLen = 0; else @@ -3054,7 +3038,7 @@ void sw_BoxSetSplitBoxFmts( SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara ) sal_uInt16 nLen = pBox->GetTabLines().size(); if( nLen ) { - // dann mit der richtigen Line weitermachen + // Continue with the actual Line if( pSplPara->IsGetFromTop() ) nLen = 0; else @@ -3102,7 +3086,7 @@ sal_uInt16 aTableSplitBoxSetRange[] = { aIdx = *pBox->GetSttNd(); SwCntntNode* pDNd = aIdx.GetNodes().GoNext( &aIdx ); - // nur wenn der Node alleine in der Section steht + // If the Node is alone in the Section if( 2 == pDNd->EndOfSectionIndex() - pDNd->StartOfSectionIndex() ) { @@ -3117,7 +3101,15 @@ sal_uInt16 aTableSplitBoxSetRange[] = { } } - +/** + * Splits a Table in the top-level Line which contains the Index. + * All succeeding top-level Lines go into a new Table/Node. + * + * @param bCalcNewSize true + * Calculate the new Size for both from the + * Boxes' Max; but only if Size is using absolute + * values (USHRT_MAX) + */ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, sal_Bool bCalcNewSize ) { @@ -3130,7 +3122,7 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, return sal_False; SwTable& rTbl = pTNd->GetTable(); - rTbl.SetHTMLTableLayout( 0 ); // MIB 9.7.97: HTML-Layout loeschen + rTbl.SetHTMLTableLayout( 0 ); // Delete HTML Layout SwTableFmlUpdate aMsgHnt( &rTbl ); @@ -3143,7 +3135,7 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, { sal_uLong nSttIdx = pNd->FindTableBoxStartNode()->GetIndex(); - // Suche die Grund-Line dieser Box: + // Find top-level Line SwTableBox* pBox = rTbl.GetTblBox( nSttIdx ); if( pBox ) { @@ -3151,7 +3143,7 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, while( pLine->GetUpper() ) pLine = pLine->GetUpper()->GetUpper(); - // in pLine steht jetzt die GrundLine. + // pLine contains the top-level Line now aMsgHnt.nSplitLine = rTbl.GetTabLines().GetPos( pLine ); } @@ -3161,7 +3153,7 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, UpdateTblFlds( &aMsgHnt ); } - //Lines fuer das Layout-Update heraussuchen. + // Find Lines for the Layout update _FndBox aFndBox( 0, 0 ); aFndBox.SetTableLines( rTbl ); aFndBox.DelFrms( rTbl ); @@ -3183,8 +3175,8 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, switch( eHdlnMode ) { - // setze die untere Border der vorherige Line, - // an der aktuellen als obere + // Set the lower Border of the preceeding Line to + // the upper Border of the current one case HEADLINE_BORDERCOPY: { SwCollectTblLineBoxes aPara( sal_False, eHdlnMode ); @@ -3200,12 +3192,12 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, it != pLn->GetTabBoxes().end(); ++it) sw_BoxSetSplitBoxFmts(*it, &aPara ); - // Kopfzeile wiederholen abschalten + // Switch off repeating Header pNew->GetTable().SetRowsToRepeat( 0 ); } break; - // setze die Attributierung der ersten Line an der neuen ersten + // Take over the Attributes of the first Line to the new one case HEADLINE_BOXATTRCOPY: case HEADLINE_BOXATRCOLLCOPY: { @@ -3234,22 +3226,22 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, break; case HEADLINE_NONE: - // Kopfzeile wiederholen abschalten + // Switch off repeating the Header pNew->GetTable().SetRowsToRepeat( 0 ); break; } - // und Frms einfuegen. + // And insert Frms SwNodeIndex aNdIdx( *pNew->EndOfSectionNode() ); - GetNodes().GoNext( &aNdIdx ); // zum naechsten ContentNode + GetNodes().GoNext( &aNdIdx ); // To the next ContentNode pNew->MakeFrms( &aNdIdx ); - //Zwischen die Tabellen wird ein Absatz geschoben + // Insert a paragraph between the Table GetNodes().MakeTxtNode( SwNodeIndex( *pNew ), GetTxtCollFromPool( RES_POOLCOLL_TEXT ) ); } - //Layout updaten + // Update Layout aFndBox.MakeFrms( rTbl ); // TL_CHART2: need to inform chart of probably changed cell names @@ -3262,9 +3254,9 @@ sal_Bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, static sal_Bool lcl_ChgTblSize( SwTable& rTbl ) { - // das Attribut darf nicht ueber das Modify an der - // Tabelle gesetzt werden, denn sonst werden alle - // Boxen wieder auf 0 zurueck gesetzt. Also locke das Format + // The Attribute must not be set via the Modify or else all Boxes are + // set back to 0. + // So lock the Format. SwFrmFmt* pFmt = rTbl.GetFrmFmt(); SwFmtFrmSize aTblMaxSz( pFmt->GetFrmSize() ); @@ -3288,7 +3280,7 @@ static sal_Bool lcl_ChgTblSize( SwTable& rTbl ) aTblMaxSz.SetWidth( nMaxLnWidth ); } pFmt->SetFmtAttr( aTblMaxSz ); - if( !bLocked ) // und gegebenenfalls Lock wieder freigeben + if( !bLocked ) // Release the Lock if appropriate pFmt->UnlockModify(); return sal_True; @@ -3367,7 +3359,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter, sal_uLong nSttIdx = pNd->FindTableBoxStartNode()->GetIndex(); - // Suche die Grund-Line dieser Box: + // Find this Box/top-level line SwTable& rTbl = pTNd->GetTable(); SwTableBox* pBox = rTbl.GetTblBox( nSttIdx ); if( !pBox ) @@ -3377,23 +3369,23 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter, while( pLine->GetUpper() ) pLine = pLine->GetUpper()->GetUpper(); - // in pLine steht jetzt die GrundLine. + // pLine now contains the top-level line sal_uInt16 nLinePos = rTbl.GetTabLines().GetPos( pLine ); if( USHRT_MAX == nLinePos || ( bAfter ? ++nLinePos >= rTbl.GetTabLines().size() : !nLinePos )) - return 0; // nicht gefunden oder letze Line !! + return 0; // Not found or last Line! - // Suche jetzt die 1. Box der nachfolgenden Line + // Find the first Box of the succeeding Line SwTableLine* pNextLine = rTbl.GetTabLines()[ nLinePos ]; pBox = pNextLine->GetTabBoxes()[0]; while( !pBox->GetSttNd() ) pBox = pBox->GetTabLines()[0]->GetTabBoxes()[0]; - // dann fuege mal einen End- und TabelleNode ins Nodes-Array ein. + // Insert an EndNode and TableNode into the Nodes Array SwTableNode * pNewTblNd; { SwEndNode* pOldTblEndNd = (SwEndNode*)pTNd->EndOfSectionNode()->GetEndNode(); - OSL_ENSURE( pOldTblEndNd, "wo ist der EndNode?" ); + OSL_ENSURE( pOldTblEndNd, "Where is the EndNode?" ); SwNodeIndex aIdx( *pBox->GetSttNd() ); new SwEndNode( aIdx, *pTNd ); @@ -3405,22 +3397,21 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter, SwNode* pBoxNd = aIdx.GetNode().GetStartNode(); do { - OSL_ENSURE( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" ); + OSL_ENSURE( pBoxNd->IsStartNode(), "This needs to be a StartNode!" ); pBoxNd->pStartOfSection = pNewTblNd; pBoxNd = (*this)[ pBoxNd->EndOfSectionIndex() + 1 ]; } while( pBoxNd != pOldTblEndNd ); } { - // die Lines ruebermoven... + // Move the Lines SwTable& rNewTbl = pNewTblNd->GetTable(); rNewTbl.GetTabLines().insert( rNewTbl.GetTabLines().begin(), rTbl.GetTabLines().begin() + nLinePos, rTbl.GetTabLines().end() ); - // - // von hinten (unten-rechts) nach vorn (oben-links) alle Boxen - // beim chart data provider austragen (das modified event wird dann - // in der aufrufenden Funktion getriggert. - // TL_CHART2: + + /* From the back (bottom right) to the front (top left) deregister all Boxes from the + Chart Data Provider. The Modify event is triggered in the calling function. + TL_CHART2: */ SwChartDataProvider *pPCD = rTbl.GetFrmFmt()->getIDocumentChartDataProviderAccess()->GetChartDataProvider(); if( pPCD ) { @@ -3435,13 +3426,12 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter, } } } - // - // ...und loeschen + + // Delete sal_uInt16 nDeleted = rTbl.GetTabLines().size() - nLinePos; rTbl.GetTabLines().erase( rTbl.GetTabLines().begin() + nLinePos, rTbl.GetTabLines().end() ); - // und die betr. Boxen verschieben. Dabei die Formate eindeutig - // machen und die StartNodes korrigieren + // Move the affected Boxes. Make the Formats unique and correct the StartNodes _SplitTable_Para aPara( pNewTblNd, rTbl ); BOOST_FOREACH( SwTableLine* pNewLine, rNewTbl.GetTabLines() ) lcl_SplitTable_CpyLine( pNewLine, &aPara ); @@ -3449,7 +3439,7 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter, } { - // Das Tabellen-FrmFormat kopieren + // Copy the Table FrmFormat SwFrmFmt* pOldTblFmt = rTbl.GetFrmFmt(); SwFrmFmt* pNewTblFmt = pOldTblFmt->GetDoc()->MakeTblFrmFmt( pOldTblFmt->GetDoc()->GetUniqueTblName(), @@ -3458,8 +3448,9 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter, *pNewTblFmt = *pOldTblFmt; pNewTblNd->GetTable().RegisterToFormat( *pNewTblFmt ); - // neue Size errechnen ? (lcl_ChgTblSize nur das 2. aufrufen, wenn es - // beim 1. schon geklappt hat; also absolute Groesse hat) + // Calculate a new Size? + // lcl_ChgTblSize: Only execute the second call if the first call was + // successful, thus has an absolute Size if( bCalcNewSize && lcl_ChgTblSize( rTbl ) ) lcl_ChgTblSize( pNewTblNd->GetTable() ); } @@ -3467,12 +3458,15 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, sal_Bool bAfter, // TL_CHART2: need to inform chart of probably changed cell names rTbl.UpdateCharts(); - return pNewTblNd; // das wars + return pNewTblNd; // That's it! } -// und die Umkehrung davon. rPos muss in der Tabelle stehen, die bestehen -// bleibt. Das Flag besagt ob die aktuelle mit der davor oder dahinter -// stehenden vereint wird. +/** + * rPos needs to be in the Table that remains + * + * @param bWithPrev merge the current Table with the preceeding + * or succeeding one + */ sal_Bool SwDoc::MergeTable( const SwPosition& rPos, sal_Bool bWithPrev, sal_uInt16 nMode ) { SwTableNode* pTblNd = rPos.nNode.GetNode().FindTableNode(), *pDelTblNd; @@ -3491,11 +3485,11 @@ sal_Bool SwDoc::MergeTable( const SwPosition& rPos, sal_Bool bWithPrev, sal_uInt pDelTblNd->GetTable().ISA( SwDDETable )) return sal_False; - // MIB 9.7.97: HTML-Layout loeschen + // Delete HTML Layout pTblNd->GetTable().SetHTMLTableLayout( 0 ); pDelTblNd->GetTable().SetHTMLTableLayout( 0 ); - // beide Tabellen vorhanden, also kanns losgehen + // Both Tables are present; we can start SwUndoMergeTbl* pUndo = 0; SwHistory* pHistory = 0; if (GetIDocumentUndoRedo().DoesUndo()) @@ -3505,14 +3499,14 @@ sal_Bool SwDoc::MergeTable( const SwPosition& rPos, sal_Bool bWithPrev, sal_uInt pHistory = new SwHistory; } - // alle "Tabellenformeln" anpassen + // Adapt all "TableFormulas" SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); aMsgHnt.DATA.pDelTbl = &pDelTblNd->GetTable(); aMsgHnt.eFlags = TBL_MERGETBL; aMsgHnt.pHistory = pHistory; UpdateTblFlds( &aMsgHnt ); - // das eigentliche Mergen + // The actual merge SwNodeIndex aIdx( bWithPrev ? *pTblNd : *pDelTblNd ); sal_Bool bRet = rNds.MergeTable( aIdx, !bWithPrev, nMode, pHistory ); @@ -3534,10 +3528,10 @@ sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev, sal_uInt16 nMode, SwHistory* ) { SwTableNode* pDelTblNd = rPos.GetNode().GetTableNode(); - OSL_ENSURE( pDelTblNd, "wo ist der TableNode geblieben?" ); + OSL_ENSURE( pDelTblNd, "Where did the TableNode go?" ); SwTableNode* pTblNd = (*this)[ rPos.GetIndex() - 1]->FindTableNode(); - OSL_ENSURE( pTblNd, "wo ist der TableNode geblieben?" ); + OSL_ENSURE( pTblNd, "Where did the TableNode go?" ); if( !pDelTblNd || !pTblNd ) return sal_False; @@ -3547,7 +3541,7 @@ sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev, SwTable& rDelTbl = pDelTblNd->GetTable(); SwTable& rTbl = pTblNd->GetTable(); - //Lines fuer das Layout-Update herausuchen. + // Find Lines for the Layout update _FndBox aFndBox( 0, 0 ); aFndBox.SetTableLines( rTbl ); aFndBox.DelFrms( rTbl ); @@ -3563,13 +3557,13 @@ sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev, // tell the charts about the table to be deleted and have them use their own data GetDoc()->CreateChartInternalDataProviders( &rDelTbl ); - // die Breite der TabellenFormate abgleichen: + // Sync the TableFormat's Width { const SwFmtFrmSize& rTblSz = rTbl.GetFrmFmt()->GetFrmSize(); const SwFmtFrmSize& rDelTblSz = rDelTbl.GetFrmFmt()->GetFrmSize(); if( rTblSz != rDelTblSz ) { - // dann sollten die mal schleunigst korrigiert werden + // The needs correction if( bWithPrev ) rDelTbl.GetFrmFmt()->SetFmtAttr( rTblSz ); else @@ -3579,20 +3573,19 @@ sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev, if( !bWithPrev ) { - // dann mussen alle Attruibute der hinteren Tabelle auf die - // vordere uebertragen werden, weil die hintere ueber das loeschen - // des Node geloescht wird. + // Transfer all Attributes of the succeeding Table to the preceeding one + // We do this, because the succeeding one is deleted when deleting the Node rTbl.SetRowsToRepeat( rDelTbl.GetRowsToRepeat() ); rTbl.SetTblChgMode( rDelTbl.GetTblChgMode() ); rTbl.GetFrmFmt()->LockModify(); *rTbl.GetFrmFmt() = *rDelTbl.GetFrmFmt(); - // auch den Namen umsetzen! + // Also switch the Name rTbl.GetFrmFmt()->SetName( rDelTbl.GetFrmFmt()->GetName() ); rTbl.GetFrmFmt()->UnlockModify(); } - // die Lines und Boxen ruebermoven + // Move the Lines and Boxes sal_uInt16 nOldSize = rTbl.GetTabLines().size(); rTbl.GetTabLines().insert( rTbl.GetTabLines().begin() + nOldSize, rDelTbl.GetTabLines().begin(), rDelTbl.GetTabLines().end() ); @@ -3601,7 +3594,7 @@ sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev, rTbl.GetTabSortBoxes().insert( rDelTbl.GetTabSortBoxes() ); rDelTbl.GetTabSortBoxes().clear(); - // die vordere Tabelle bleibt immer stehen, die hintere wird geloescht + // The preceeding Table always remains, while the succeeding one is deleted SwEndNode* pTblEndNd = pDelTblNd->EndOfSectionNode(); pTblNd->pEndOfSection = pTblEndNd; @@ -3609,7 +3602,7 @@ sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev, SwNode* pBoxNd = aIdx.GetNode().GetStartNode(); do { - OSL_ENSURE( pBoxNd->IsStartNode(), "das muss ein StartNode sein!" ); + OSL_ENSURE( pBoxNd->IsStartNode(), "This needs to be a StartNode!" ); pBoxNd->pStartOfSection = pTblNd; pBoxNd = (*this)[ pBoxNd->EndOfSectionIndex() + 1 ]; } while( pBoxNd != pTblEndNd ); @@ -3618,16 +3611,16 @@ sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev, aIdx -= 2; DelNodes( aIdx, 2 ); - // jetzt an der 1. eingefuegten Line die bedingten Vorlagen umschubsen + // tweak the conditional styles at the first inserted Line const SwTableLine* pFirstLn = rTbl.GetTabLines()[ nOldSize ]; - if( 1 == nMode ) // + if( 1 == nMode ) { - // Header-Vorlagen in der Zeile setzen - // und ggfs. in der History speichern fuers Undo!!! + // Set Header Template in the Line and save in the History + // if needed for Undo! } sw_LineSetHeadCondColl( pFirstLn ); - // und die Borders "aufrauemen" + // Clean up the Borders if( nOldSize ) { _SwGCLineBorder aPara( rTbl ); @@ -3636,16 +3629,14 @@ sal_Bool SwNodes::MergeTable( const SwNodeIndex& rPos, sal_Bool bWithPrev, sw_GC_Line_Border( pFirstLn, &aPara ); } - //Layout updaten + // Update Layout aFndBox.MakeFrms( rTbl ); return sal_True; } -// ------------------------------------------------------------------- - -// -- benutze die ForEach Methode vom PtrArray +// Use the PtrArray's ForEach method struct _SetAFmtTabPara { SwTableAutoFmt& rTblFmt; @@ -3659,8 +3650,7 @@ struct _SetAFmtTabPara {} }; -// forward deklarieren damit sich die Lines und Boxen rekursiv aufrufen -// koennen. +// Forward declare so that the Lines and Boxes can use recursion static sal_Bool lcl_SetAFmtBox(_FndBox &, _SetAFmtTabPara *pSetPara); static sal_Bool lcl_SetAFmtLine(_FndLine &, _SetAFmtTabPara *pPara); @@ -3676,7 +3666,7 @@ static sal_Bool lcl_SetAFmtLine(_FndLine & rLine, _SetAFmtTabPara *pPara) static sal_Bool lcl_SetAFmtBox( _FndBox & rBox, _SetAFmtTabPara *pSetPara ) { - if (!rBox.GetUpper()->GetUpper()) // Box on first level? + if (!rBox.GetUpper()->GetUpper()) // Box on first level? { if( !pSetPara->nCurBox ) pSetPara->nAFmtBox = 0; @@ -3723,21 +3713,23 @@ static sal_Bool lcl_SetAFmtBox( _FndBox & rBox, _SetAFmtTabPara *pSetPara ) BOOST_FOREACH( _FndLine& rFndLine, rBox.GetLines() ) lcl_SetAFmtLine( rFndLine, pSetPara ); - if (!rBox.GetUpper()->GetUpper()) // a BaseLine + if (!rBox.GetUpper()->GetUpper()) // a BaseLine ++pSetPara->nCurBox; return sal_True; } - // AutoFormat fuer die Tabelle/TabellenSelection +/** + * AutoFormat for the Table/TableSelection + */ sal_Bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew ) { - OSL_ENSURE( !rBoxes.empty(), "keine gueltige Box-Liste" ); + OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return sal_False; - // suche alle Boxen / Lines + // Find all Boxes/Lines _FndBox aFndBox( 0, 0 ); { _FndPara aPara( rBoxes, &aFndBox ); @@ -3756,11 +3748,11 @@ sal_Bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& pFndBox = &pFndBox->GetLines().front().GetBoxes()[0]; } - if( pFndBox->GetLines().empty() ) // eine zu weit? (nur 1 sel.Box) + if( pFndBox->GetLines().empty() ) // One too far? (only one sel. Box) pFndBox = pFndBox->GetUpper()->GetUpper(); - // Undo abschalten, Attribute werden sich vorher gemerkt + // Disable Undo, but first store parameters SwUndoTblAutoFmt* pUndo = 0; bool const bUndo(GetIDocumentUndoRedo().DoesUndo()); if (bUndo) @@ -3780,7 +3772,7 @@ sal_Bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& { pLine = &rFLns[n]; - // Upper auf 0 setzen (Base-Line simulieren!) + // Set Upper to 0 (thus simulate BaseLine) _FndBox* pSaveBox = pLine->GetUpper(); pLine->SetUpper( 0 ); @@ -3816,15 +3808,17 @@ sal_Bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& } - // Erfrage wie attributiert ist +/** + * Find out who has the Attributes + */ sal_Bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet ) { - OSL_ENSURE( !rBoxes.empty(), "keine gueltige Box-Liste" ); + OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); if( !pTblNd ) return sal_False; - // suche alle Boxen / Lines + // Find all Boxes/Lines _FndBox aFndBox( 0, 0 ); { _FndPara aPara( rBoxes, &aFndBox ); @@ -3844,7 +3838,7 @@ sal_Bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet pFndBox = &pFndBox->GetLines().front().GetBoxes()[0]; } - if( pFndBox->GetLines().empty() ) // eine zu weit? (nur 1 sel.Box) + if( pFndBox->GetLines().empty() ) // One too far? (only one sel. Box) pFndBox = pFndBox->GetUpper()->GetUpper(); _FndLines& rFLns = pFndBox->GetLines(); @@ -3868,7 +3862,7 @@ sal_Bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet for( sal_uInt8 nBox = 0; nBox < 4; ++nBox ) { SwTableBox* pFBox = rLine.GetBoxes()[ aBoxArr[ nBox ] ].GetBox(); - // immer auf die 1. runterfallen + // Always apply to the first ones while( !pFBox->GetSttNd() ) pFBox = pFBox->GetTabLines()[0]->GetTabBoxes()[0]; @@ -3908,19 +3902,19 @@ String SwDoc::GetUniqueTblName() const if( !pFmt->IsDefault() && IsUsed( *pFmt ) && pFmt->GetName().Match( aName ) == nNmLen ) { - // Nummer bestimmen und das Flag setzen + // Get number and set the Flag nNum = static_cast<sal_uInt16>(pFmt->GetName().Copy( nNmLen ).ToInt32()); if( nNum-- && nNum < pTblFrmFmtTbl->size() ) pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 )); } } - // alle Nummern entsprechend geflag, also bestimme die richtige Nummer + // All numbers are flagged properly, thus calculate the right number nNum = pTblFrmFmtTbl->size(); for( n = 0; n < nFlagSize; ++n ) if( 0xff != ( nTmp = pSetFlags[ n ] )) { - // also die Nummer bestimmen + // Calculate the number nNum = n * 8; while( nTmp & 1 ) ++nNum, nTmp >>= 1; @@ -3938,7 +3932,7 @@ SwTableFmt* SwDoc::FindTblFmtByName( const String& rName, sal_Bool bAll ) const pRet = FindFmtByName( *pTblFrmFmtTbl, rName ); else { - // dann nur die, die im Doc gesetzt sind + // Only the ones set in the Doc for( sal_uInt16 n = 0; n < pTblFrmFmtTbl->size(); ++n ) { const SwFrmFmt* pFmt = (*pTblFrmFmtTbl)[ n ]; @@ -4008,8 +4002,7 @@ sal_Bool SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType, void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool bCallUpdate ) { - //JP 09.07.97: Optimierung: wenn die Box schon sagt, das es Text - // sein soll, dann bleibt das auch Text! + // Optimization: If the Box says it's Text, it remains Text const SfxPoolItem* pNumFmtItem = 0; if( SFX_ITEM_SET == rBox.GetFrmFmt()->GetItemState( RES_BOXATR_FORMAT, sal_False, &pNumFmtItem ) && GetNumberFormatter()->IsTextFormat( @@ -4053,12 +4046,12 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool bCallUpdate ) short nFmtType = pNumFmtr->GetType( nFmtIdx ); if( nFmtType == pNumFmtr->GetType( nOldNumFmt ) || NUMBERFORMAT_NUMBER == nFmtType ) - // eingstelltes und vorgegebenes NumFormat - // stimmen ueberein -> altes Format beibehalten + // Current and specified NumFormat match + // -> keep old Format nFmtIdx = nOldNumFmt; else - // eingstelltes und vorgegebenes NumFormat - // stimmen nicht ueberein -> als Text einfuegen + // Current and specified NumFormat do not match + // -> insert as Text bLockModify = bSetNumFmt = sal_False; } } @@ -4072,15 +4065,12 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool bCallUpdate ) } } - // JP 28.04.98: Nur Formel zuruecksetzen reicht nicht. - // Sorge dafuer, das der Text auch entsprechend - // formatiert wird! - + // It's not enough to only reset the Formula. + // Make sure that the Text is formatted accordingly if( !bSetNumFmt && !bIsEmptyTxtNd && pNumFmtItem ) { - // JP 15.01.99: Nur Attribute zuruecksetzen reicht nicht. - // Sorge dafuer, das der Text auch entsprechend - // formatiert wird! + // Just resetting Attributes is not enough + // Make sure that the Text is formatted accordingly pBoxFmt->SetFmtAttr( *GetDfltAttr( RES_BOXATR_FORMAT )); } @@ -4094,7 +4084,7 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool bCallUpdate ) } else { - // es ist keine Zahl + // It's not a number const SfxPoolItem* pValueItem = 0, *pFmtItem = 0; SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rBox.GetFrmFmt(); if( SFX_ITEM_SET == pBoxFmt->GetItemState( RES_BOXATR_FORMAT, @@ -4110,15 +4100,14 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, sal_Bool bCallUpdate ) pBoxFmt = (SwTableBoxFmt*)rBox.ClaimFrmFmt(); - // alle Zahlenformate entfernen + // Remove all number formats sal_uInt16 nWhich1 = RES_BOXATR_FORMULA; if( !bIsEmptyTxtNd ) { nWhich1 = RES_BOXATR_FORMAT; - // JP 15.01.99: Nur Attribute zuruecksetzen reicht nicht. - // Sorge dafuer, das der Text auch entsprechend - // formatiert wird! + // Just resetting Attributes is not enough + // Make sure that the Text is formatted accordingly pBoxFmt->SetFmtAttr( *GetDfltAttr( nWhich1 )); } pBoxFmt->ResetFmtAttr( nWhich1, RES_BOXATR_VALUE ); @@ -4239,15 +4228,14 @@ void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode ) SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt(); - //JP 01.09.97: TextFormate bleiben erhalten! + // Keep TextFormats! sal_uInt16 nWhich1 = RES_BOXATR_FORMAT; if( pFmtItem && GetNumberFormatter()->IsTextFormat( ((SwTblBoxNumFormat*)pFmtItem)->GetValue() )) nWhich1 = RES_BOXATR_FORMULA; else - // JP 15.01.99: Nur Attribute zuruecksetzen reicht nicht. - // Sorge dafuer, das der Text auch entsprechend - // formatiert wird! + // Just resetting Attributes is not enough + // Make sure that the Text is formatted accordingly pBoxFmt->SetFmtAttr( *GetDfltAttr( RES_BOXATR_FORMAT )); pBoxFmt->ResetFmtAttr( nWhich1, RES_BOXATR_VALUE ); @@ -4256,12 +4244,13 @@ void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode ) } } -// kopiert eine Tabelle aus dem selben oder einem anderen Doc in sich -// selbst. Dabei wird eine neue Tabelle angelegt oder eine bestehende -// mit dem Inhalt gefuellt; wobei entweder der Inhalt ab einer Box oder -// in eine bestehende TblSelektion gefuellt wird. -// Gerufen wird es von: edglss.cxx/fecopy.cxx - +/** + * Copies a Table from the same or another Doc into itself + * We create a new Table or an existing one is filled with the Content. + * We either fill in the Content from a certain Box or a certain TblSelection + * + * This method is called by edglss.cxx/fecopy.cxx + */ sal_Bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, const SwTable* pCpyTbl, sal_Bool bCpyName, sal_Bool bCorrPos ) { @@ -4326,7 +4315,7 @@ sal_Bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, if( bDelCpyDoc ) { - // kopiere die Tabelle erstmal in ein temp. Doc + // Copy the Table into a temporary Doc pCpyDoc = new SwDoc; pCpyDoc->acquire(); @@ -4344,7 +4333,7 @@ sal_Bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, } return sal_False; } - aPos.nNode -= 1; // auf den EndNode der Tabelle + aPos.nNode -= 1; // Set to the Table's EndNode pSrcTblNd = aPos.nNode.GetNode().FindTableNode(); } @@ -4356,7 +4345,7 @@ sal_Bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, if( ( !pSrcTblNd->GetTable().IsTblComplex() || pInsTblNd->GetTable().IsNewModel() ) && ( bDelCpyDoc || !rBoxes.empty() ) ) { - // dann die Tabelle "relativ" kopieren + // Copy the Table "relatively" const SwSelBoxes* pBoxes; SwSelBoxes aBoxes; @@ -4364,14 +4353,14 @@ sal_Bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, { SwTableBox* pBox = pInsTblNd->GetTable().GetTblBox( pSttNd->GetIndex() ); - OSL_ENSURE( pBox, "Box steht nicht in dieser Tabelle" ); + OSL_ENSURE( pBox, "Box is not in this Table" ); aBoxes.insert( pBox ); pBoxes = &aBoxes; } else pBoxes = &rBoxes; - // kopiere die Tabelle in die selktierten Zellen. + // Copy Table to the selected Lines bRet = pInsTblNd->GetTable().InsTable( pSrcTblNd->GetTable(), *pBoxes, pUndo ); } @@ -4390,8 +4379,7 @@ sal_Bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, if( pUndo ) { - // falls die Tabelle nicht kopiert werden konnte, das Undo-Object - // wieder loeschen + // If the Table could not be copied, delete the Undo object GetIDocumentUndoRedo().DoUndo(bUndo); if( !bRet && pUndo->IsEmpty() ) delete pUndo; @@ -4523,7 +4511,7 @@ sal_Bool SwDoc::UnProtectTbls( const SwPaM& rPam ) { sal_uLong nTblIdx = pTblNd->GetIndex(); - // dann ueberpruefe ob Tabelle in der Selection liegt + // Check whether the Table is within the Selection if( bHasSel ) { int bFound = sal_False; @@ -4536,10 +4524,10 @@ sal_Bool SwDoc::UnProtectTbls( const SwPaM& rPam ) } while( !bFound && &rPam != ( pTmp = (SwPaM*)pTmp->GetNext() ) ); if( !bFound ) - continue; // weitersuchen + continue; // Continue searching } - // dann mal den Schutz aufheben + // Lift the protection bChgd |= _UnProtectTblCells( *pTbl ); } diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 7c80a5faa0de..779dad583ff6 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -260,27 +260,21 @@ sal_uInt16 ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, } /******************************************************************* +|* Returns the section level at the position given by aIndex. |* -|* SwNode::GetSectionLevel -|* -|* Beschreibung -|* Die Funktion liefert den Sectionlevel an der durch -|* aIndex bezeichneten Position. -|* -|* Die Logik ist wie folgt: ( S -> Start, E -> End, C -> CntntNode) -|* Level 0 E -|* 1 S E -|* 2 SC -|* -|* alle EndNodes der GrundSection haben den Level 0 -|* alle StartNodes der GrundSection haben den Level 1 +|* We use the following logic: +|* S = Start, E = End, C = CntntNode +|* Level 0 = E +|* 1 = S E +|* 2 = SC |* +|* All EndNodes of the BaseSection have level 0 +|* All StartNodes of the BaseSection have level 1 *******************************************************************/ - sal_uInt16 SwNode::GetSectionLevel() const { - // EndNode einer Grund-Section ?? diese sind immer 0 !! + // EndNode of a BaseSection? They are always 0! if( IsEndNode() && 0 == pStartOfSection->StartOfSectionIndex() ) return 0; @@ -292,25 +286,18 @@ sal_uInt16 SwNode::GetSectionLevel() const } /******************************************************************* +|* Inserts a node into the rNodes array at the rWhere position +|* For the theEndOfSection it is passed the EndOfSection index of +|* the preceding node. If it is at position 0 of the variable array +|* theEndOfSection becomes 0 (itsef the new one). |* -|* SwNode::SwNode -|* -|* Beschreibung -|* Konstruktor; dieser fuegt einen Node in das Array rNodes -|* an der Position rWhere ein. Dieser bekommt als -|* theEndOfSection den EndOfSection-Index des Nodes -|* unmittelbar vor ihm. Falls er sich an der Position 0 -|* innerhalb des variablen Arrays befindet, wird -|* theEndOfSection 0 (der neue selbst). -|* -|* Parameter +|* Parameters |* IN -|* rNodes bezeichnet das variable Array, in das der Node -|* eingefuegt werden soll +|* rNodes is the variable array in which the node will be +|* inserted |* IN -|* rWhere bezeichnet die Position innerhalb dieses Arrays, -|* an der der Node eingefuegt werden soll -|* +|* rWhere is the position within the array where the node will +|* be inserted *******************************************************************/ #ifdef DBG_UTIL @@ -318,21 +305,24 @@ long SwNode::s_nSerial = 0; #endif SwNode::SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType ) - : nNodeType( nNdType ), pStartOfSection( 0 ) + : nNodeType( nNdType ) + , nAFmtNumLvl( 0 ) + , bSetNumLSpace( false ) + , bIgnoreDontExpand( false) +#ifdef DBG_UTIL + , m_nSerial( s_nSerial++) +#endif + , pStartOfSection( 0 ) { - bSetNumLSpace = bIgnoreDontExpand = sal_False; - nAFmtNumLvl = 0; - - SwNodes& rNodes = (SwNodes&)rWhere.GetNodes(); - SwNode* pInsNd = this; // der MAC kann this nicht einfuegen !! + SwNodes& rNodes = const_cast<SwNodes&> (rWhere.GetNodes()); if( rWhere.GetIndex() ) { SwNode* pNd = rNodes[ rWhere.GetIndex() -1 ]; - rNodes.InsertNode( pInsNd, rWhere ); + rNodes.InsertNode( this, rWhere ); if( 0 == ( pStartOfSection = pNd->GetStartNode()) ) { pStartOfSection = pNd->pStartOfSection; - if( pNd->GetEndNode() ) // EndNode ? Section ueberspringen! + if( pNd->GetEndNode() ) // Skip EndNode ? Section { pNd = pStartOfSection; pStartOfSection = pNd->pStartOfSection; @@ -341,31 +331,29 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType ) } else { - rNodes.InsertNode( pInsNd, rWhere ); + rNodes.InsertNode( this, rWhere ); pStartOfSection = (SwStartNode*)this; } - -#ifdef DBG_UTIL - m_nSerial = s_nSerial; - s_nSerial++; -#endif } SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNdType ) - : nNodeType( nNdType ), pStartOfSection( 0 ) + : nNodeType( nNdType ) + , nAFmtNumLvl( 0 ) + , bSetNumLSpace( false ) + , bIgnoreDontExpand( false) +#ifdef DBG_UTIL + , m_nSerial( s_nSerial++) +#endif + , pStartOfSection( 0 ) { - bSetNumLSpace = bIgnoreDontExpand = sal_False; - nAFmtNumLvl = 0; - - SwNode* pInsNd = this; // der MAC kann this nicht einfuegen !! if( nPos ) { SwNode* pNd = rNodes[ nPos - 1 ]; - rNodes.InsertNode( pInsNd, nPos ); + rNodes.InsertNode( this, nPos ); if( 0 == ( pStartOfSection = pNd->GetStartNode()) ) { pStartOfSection = pNd->pStartOfSection; - if( pNd->GetEndNode() ) // EndNode ? Section ueberspringen! + if( pNd->GetEndNode() ) // Skip EndNode ? Section! { pNd = pStartOfSection; pStartOfSection = pNd->pStartOfSection; @@ -374,23 +362,17 @@ SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNdType ) } else { - rNodes.InsertNode( pInsNd, nPos ); + rNodes.InsertNode( this, nPos ); pStartOfSection = (SwStartNode*)this; } - -#ifdef DBG_UTIL - m_nSerial = s_nSerial; - s_nSerial++; -#endif } SwNode::~SwNode() { } -// suche den TabellenNode, in dem dieser steht. Wenn in keiner -// Tabelle wird 0 returnt. - +// Find the TableNode in which it is located. +// If we're not in a table: return 0 SwTableNode* SwNode::FindTableNode() { @@ -403,7 +385,7 @@ SwTableNode* SwNode::FindTableNode() } -// liegt der Node im Sichtbarenbereich der Shell ? +// Is the node located in the visible area of the Shell? sal_Bool SwNode::IsInVisibleArea( ViewShell* pSh ) const { sal_Bool bRet = sal_False; @@ -423,7 +405,7 @@ sal_Bool SwNode::IsInVisibleArea( ViewShell* pSh ) const pNd = GetCntntNode(); if( !pSh ) - // dann die Shell vom Doc besorgen: + // Get the Shell from the Doc GetDoc()->GetEditShell( &pSh ); if( pSh ) @@ -455,9 +437,9 @@ bool SwNode::IsInProtectSect() const return pSectNd && pSectNd->GetSection().IsProtectFlag(); } - // befindet sich der Node in irgendetwas geschuetzten ? - // (Bereich/Rahmen/Tabellenzellen/... incl. des Ankers bei - // Rahmen/Fussnoten/..) +// Does the node contain anything protected? +// I.e.: Area/Frame/Table rows/... including the Anchor for +// Frames/Footnotes/... sal_Bool SwNode::IsProtect() const { const SwNode* pNd = ND_SECTIONNODE == nNodeType ? pStartOfSection : this; @@ -500,9 +482,8 @@ sal_Bool SwNode::IsProtect() const return sal_False; } - // suche den PageDesc, mit dem dieser Node formatiert ist. Wenn das - // Layout vorhanden ist wird ueber das gesucht, ansonsten gibt es nur - // die harte Tour ueber die Nodes nach vorne suchen!! +// Find the PageDesc that is used to format this node. If the Layout is available, +// we search through that. Else we can only do it the hard way by searching onwards through the nodes. const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, sal_uInt32* pPgDescNdIdx ) const { @@ -531,7 +512,7 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, pPgDesc = ((SwFmtPageDesc&)pNode->GetAttr( RES_PAGEDESC )).GetPageDesc(); } - // geht es uebers Layout? + // Are we going through the Layout? if( !pPgDesc ) { const SwFrm* pFrm; @@ -549,14 +530,14 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, if( !pPgDesc ) { - // dann also uebers Nodes-Array + // Thus via the nodes array const SwDoc* pDoc = GetDoc(); const SwNode* pNd = this; const SwStartNode* pSttNd; if( pNd->GetIndex() < GetNodes().GetEndOfExtras().GetIndex() && 0 != ( pSttNd = pNd->FindFlyStartNode() ) ) { - // dann erstmal den richtigen Anker finden + // Find the right Anchor first const SwFrmFmt* pFmt = 0; const SwFrmFmts& rFmts = *pDoc->GetSpzFrmFmts(); sal_uInt16 n; @@ -583,7 +564,7 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, const SwNode* pFlyNd = pNd->FindFlyStartNode(); while( pFlyNd ) { - // dann ueber den Anker nach oben "hangeln" + // Get up through the Anchor for( n = 0; n < rFmts.size(); ++n ) { const SwFrmFmt* pFrmFmt = rFmts[ n ]; @@ -612,14 +593,13 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, } if( n >= rFmts.size() ) { - OSL_ENSURE( !this, "Fly-Section aber kein Format gefunden" ); + OSL_ENSURE( !this, "FlySection, but no Format found" ); return 0; } } } } - // in pNd sollte jetzt der richtige Anker Node stehen oder - // immer noch der this + // pNd should now contain the correct Anchor or it's still this } if( pNd->GetIndex() < GetNodes().GetEndOfExtras().GetIndex() ) @@ -631,11 +611,11 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, } else { - // suche den Body Textnode + // Find the Body Textnode if( 0 != ( pSttNd = pNd->FindHeaderStartNode() ) || 0 != ( pSttNd = pNd->FindFooterStartNode() )) { - // dann in den PageDescs diesen StartNode suchen + // Then find this StartNode in the PageDescs sal_uInt16 nId; UseOnPage eAskUse; if( SwHeaderStartNode == pSttNd->GetStartNodeType()) @@ -681,7 +661,7 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, } else if( 0 != ( pSttNd = pNd->FindFootnoteStartNode() )) { - // der Anker kann nur im Bodytext sein + // iThe Anchor can only be in the Bodytext const SwTxtFtn* pTxtFtn; const SwFtnIdxs& rFtnArr = pDoc->GetFtnIdxs(); for( sal_uInt16 n = 0; n < rFtnArr.size(); ++n ) @@ -695,11 +675,10 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, } else { - // kann jetzt nur noch ein Seitengebundener Fly sein - // oder irgendetwas neueres. - // Hier koennen wir nur noch den Standard returnen + // Can only be a page-bound Fly (or something newer). + // WE can only return the standard here OSL_ENSURE( pNd->FindFlyStartNode(), - "wo befindet sich dieser Node?" ); + "Where is this Node?" ); pPgDesc = &pDoc->GetPageDesc( 0 ); pNd = 0; @@ -710,7 +689,7 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, if( pNd ) { SwFindNearestNode aInfo( *pNd ); - // dann ueber alle Nodes aller PageDesc + // Over all Nodes of all PageDescs const SfxPoolItem* pItem; sal_uInt32 i, nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_PAGEDESC ); for( i = 0; i < nMaxItems; ++i ) @@ -748,8 +727,7 @@ const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, } - // falls der Node in einem Fly steht, dann wird das entsprechende Format - // returnt +// If the node is located in a Fly, we return it formatted accordingly SwFrmFmt* SwNode::GetFlyFmt() const { SwFrmFmt* pRet = 0; @@ -764,7 +742,7 @@ SwFrmFmt* SwNode::GetFlyFmt() const } if( !pRet ) { - // dann gibts noch harten steinigen Weg uebers Dokument: + // The hard way through the Doc is our last way out const SwFrmFmts& rFrmFmtTbl = *GetDoc()->GetSpzFrmFmts(); for( sal_uInt16 n = 0; n < rFrmFmtTbl.size(); ++n ) { @@ -820,9 +798,8 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const if( bCheckFirst ) { - // der 1.GliederungsNode liegt hinter dem Fragenden. Dann - // teste mal, ob dieser auf der gleichen Seite steht. Wenn - // nicht, ist das ein ungueltiger. Bug 61865 + // The first OutlineNode comes after the one asking. Test if it points to the same node. + // If not it's invalid. pRet = rONds[0]->GetTxtNode(); const SwCntntNode* pCNd = GetCntntNode(); @@ -834,19 +811,19 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const if( pPgFrm && pMyFrm && pPgFrm->Frm().Top() > pMyFrm->Frm().Top() ) { - // der Fragende liegt vor der Seite, also ist er ungueltig + // The one asking precedes the Page, thus its invalid pRet = 0; } } else { - // oder ans Feld und von dort holen !! + // Or at the Field and get it from there! while( nPos && nLvl < ( pRet = rONds[nPos]->GetTxtNode() ) - ->GetAttrOutlineLevel() - 1 ) //<-end,zhaojianwei + ->GetAttrOutlineLevel() - 1 ) --nPos; - if( !nPos ) // bei 0 gesondert holen !! + if( !nPos ) // Get seperately when 0 pRet = rONds[0]->GetTxtNode(); } } @@ -893,32 +870,25 @@ sal_uInt8 SwNode::HasPrevNextLayNode() const } /******************************************************************* +|* Retruns the node's StartOfSection |* -|* SwNode::StartOfSection -|* -|* Beschreibung -|* Die Funktion liefert die StartOfSection des Nodes. -|* -|* Parameter +|* Parameters |* IN -|* rNodes bezeichnet das variable Array, in dem sich der Node -|* befindet -|* +|* rNodes is the variable array in which the node is contained *******************************************************************/ - SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType, SwStartNodeType eSttNd ) : SwNode( rWhere, nNdType ), eSttNdTyp( eSttNd ) { - // erstmal temporaer, bis der EndNode eingefuegt wird. + // Just do this temporarily until the EndNode is inserted pEndOfSection = (SwEndNode*)this; } SwStartNode::SwStartNode( SwNodes& rNodes, sal_uLong nPos ) : SwNode( rNodes, nPos, ND_STARTNODE ), eSttNdTyp( SwNormalStartNode ) { - // erstmal temporaer, bis der EndNode eingefuegt wird. + // Just do this temporarily until the EndNode is inserted pEndOfSection = (SwEndNode*)this; } @@ -936,30 +906,19 @@ void SwStartNode::CheckSectionCondColl() const } /******************************************************************* +|* Inserts a node into the array rNodes at the position aWhere. +|* The theStartOfSection pointer is set accordingly. +|* The EndOfSection pointer of the corresponding StartNodes (identified +|* by rStartOfSection) is set to this node. |* -|* SwEndNode::SwEndNode -|* -|* Beschreibung -|* Konstruktor; dieser fuegt einen Node in das Array rNodes -|* an der Position aWhere ein. Der -|* theStartOfSection-Pointer wird entsprechend gesetzt, -|* und der EndOfSection-Pointer des zugehoerigen -|* Startnodes -- durch rStartOfSection bezeichnet -- -|* wird auf diesen Node gesetzt. -|* -|* Parameter +|* Parameters |* IN -|* rNodes bezeichnet das variable Array, in das der Node -|* eingefuegt werden soll +|* rNodes is the variable array in which the node is contained |* IN -|* aWhere bezeichnet die Position innerhalb dieses Arrays, -|* an der der Node eingefuegt werden soll -|* !!!!!!!!!!!! -|* Es wird eine Kopie uebergeben! -|* +|* aWhere is the position where the node is inserted +|* We pass a copy! *******************************************************************/ - SwEndNode::SwEndNode( const SwNodeIndex &rWhere, SwStartNode& rSttNd ) : SwNode( rWhere, ND_ENDNODE ) { @@ -993,9 +952,8 @@ SwCntntNode::SwCntntNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType, SwCntntNode::~SwCntntNode() { - // Die Basisklasse SwClient vom SwFrm nimmt sich aus - // der Abhaengikeitsliste raus! - // Daher muessen alle Frames in der Abhaengigkeitsliste geloescht werden. + // The base class SwClient of SwFrm excludes itself from the dependency list! + // Thus, we need to delete all Frames in the the dependency list. if( GetDepends() ) DelFrms(); @@ -1016,19 +974,19 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV { SwFmt * pFmt = (SwFmt *) ((SwPtrMsgPoolItem *)pNewValue)->pObject; - // nicht umhaengen wenn dieses das oberste Format ist !! + // Do not mangle pointers if it is the upper-most format! if( GetRegisteredIn() == pFmt ) { if( pFmt->GetRegisteredIn() ) { - // wenn Parent, dann im neuen Parent wieder anmelden + // If Parent, register anew in the new Parent ((SwModify*)pFmt->GetRegisteredIn())->Add( this ); if ( GetpSwAttrSet() ) AttrSetHandleHelper::SetParent( mpAttrSet, *this, GetFmtColl(), GetFmtColl() ); } else { - // sonst auf jeden Fall beim sterbenden abmelden + // Else register anyways when dying ((SwModify*)GetRegisteredIn())->Remove( this ); if ( GetpSwAttrSet() ) AttrSetHandleHelper::SetParent( mpAttrSet, *this, 0, 0 ); @@ -1039,14 +997,12 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV case RES_FMT_CHG: - // falls mein Format Parent umgesetzt wird, dann melde ich - // meinen Attrset beim Neuen an. - - // sein eigenes Modify ueberspringen !! + // If the Format parent was switched, register the Attrset at the new one + // Skip own Modify! if( GetpSwAttrSet() && ((SwFmtChg*)pNewValue)->pChangedFmt == GetRegisteredIn() ) { - // den Set an den neuen Parent haengen + // Attach Set to the new parent AttrSetHandleHelper::SetParent( mpAttrSet, *this, GetFmtColl(), GetFmtColl() ); } break; @@ -1057,7 +1013,7 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV { ChkCondColl(); } - return ; // nicht an die Basisklasse / Frames weitergeben + return ; // Do not pass through to the base class/Frames //FEATURE::CONDCOLL case RES_ATTRSET_CHG: @@ -1077,7 +1033,7 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV const sal_uInt16 nTmp = ((SwUpdateAttr*)pNewValue)->nWhichAttr; if ( RES_ATTRSET_CHG == nTmp ) { - // anybody wants to do some optimization here? + // TODO: anybody wants to do some optimization here? ((SwTxtNode*)this)->SetCalcHiddenCharFlags(); } } @@ -1137,21 +1093,19 @@ xub_StrLen SwCntntNode::Len() const { return 0; } SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl ) { - OSL_ENSURE( pNewColl, "Collectionpointer ist 0." ); + OSL_ENSURE( pNewColl, "Collectionpointer is 0." ); SwFmtColl *pOldColl = GetFmtColl(); if( pNewColl != pOldColl ) { pNewColl->Add( this ); - // setze den Parent von unseren Auto-Attributen auf die neue - // Collection: + // Set the Parent of out AutoAttributes to the new Collection if( GetpSwAttrSet() ) AttrSetHandleHelper::SetParent( mpAttrSet, *this, pNewColl, pNewColl ); //FEATURE::CONDCOLL - // HACK: hier muss die entsprechend der neuen Vorlage die Bedingungen - // neu ueberprueft werden! + // TODO: HACK: We need to recheck this condition according to the new template! if( sal_True /*pNewColl */ ) { SetCondFmtColl( 0 ); @@ -1180,7 +1134,7 @@ sal_Bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const if( pIdx->GetIndex() < Len() ) { if( !IsTxtNode() ) - (*pIdx)++; + ++(*pIdx); else { const SwTxtNode& rTNd = *GetTxtNode(); @@ -1211,7 +1165,7 @@ sal_Bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const bRet = sal_False; } else if( nPos < rTNd.GetTxt().Len() ) - (*pIdx)++; + ++(*pIdx); else bRet = sal_False; } @@ -1271,23 +1225,21 @@ sal_Bool SwCntntNode::GoPrevious(SwIndex * pIdx, sal_uInt16 nMode ) const /* - * Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom - * Dokument. Die erzeugten Contentframes werden in das entsprechende - * Layout gehaengt. + * Creates all Views for the Doc for this Node. + * The created ContentFrames are attached to the corresponding Layout. */ - void SwCntntNode::MakeFrms( SwCntntNode& rNode ) { OSL_ENSURE( &rNode != this, - "Kein Contentnode oder Copy-Node und neuer Node identisch." ); + "No ContentNode or CopyNode and new Node identical." ); - if( !GetDepends() || &rNode == this ) // gibt es ueberhaupt Frames ?? + if( !GetDepends() || &rNode == this ) // Do we actually have Frames? return; SwFrm *pFrm, *pNew; SwLayoutFrm *pUpper; - // Frames anlegen fuer Nodes, die vor oder hinter der Tabelle stehen ?? + // Create Frames for Nodes which come after the Table? OSL_ENSURE( FindTableNode() == rNode.FindTableNode(), "Table confusion" ); SwNode2Layout aNode2Layout( *this, rNode.GetIndex() ); @@ -1316,12 +1268,10 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode ) } /* - * Methode loescht fuer den Node alle Ansichten vom - * Dokument. Die Contentframes werden aus dem entsprechenden - * Layout ausgehaengt. + * Deletes all Views from the Doc for this Node. + * The ContentFrames are removed from the corresponding Layout. */ - void SwCntntNode::DelFrms() { if( !GetDepends() ) @@ -1358,8 +1308,8 @@ SwCntntNode *SwCntntNode::JoinPrev() - // erfrage vom Modify Informationen -sal_Bool SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const +// Get info from Modify +bool SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const { switch( rInfo.Which() ) { @@ -1367,34 +1317,34 @@ sal_Bool SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const if( &GetNodes() == ((SwAutoFmtGetDocNode&)rInfo).pNodes ) { ((SwAutoFmtGetDocNode&)rInfo).pCntntNode = this; - return sal_False; + return false; } break; case RES_FINDNEARESTNODE: if( ((SwFmtPageDesc&)GetAttr( RES_PAGEDESC )).GetPageDesc() ) ((SwFindNearestNode&)rInfo).CheckNode( *this ); - return sal_True; + return true; case RES_CONTENT_VISIBLE: { ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwCntntNode>::FirstElement(*this); } - return sal_False; + return false; } return SwModify::GetInfo( rInfo ); } - // setze ein Attribut +// Set an Attribute sal_Bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) { - if( !GetpSwAttrSet() ) // lasse von den entsprechenden Nodes die - NewAttrSet( GetDoc()->GetAttrPool() ); // AttrSets anlegen + if( !GetpSwAttrSet() ) // Have the Nodes created by the corresponding AttrSets + NewAttrSet( GetDoc()->GetAttrPool() ); - OSL_ENSURE( GetpSwAttrSet(), "warum wurde kein AttrSet angelegt?" ); + OSL_ENSURE( GetpSwAttrSet(), "Why did't we create an AttrSet?"); if ( IsInCache() ) { @@ -1403,7 +1353,7 @@ sal_Bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) } sal_Bool bRet = sal_False; - // wenn Modify gelockt ist, werden keine Modifies verschickt + // If Modify is locked, we do not send any Modifys if( IsModifyLocked() || ( !GetDepends() && RES_PARATR_NUMRULE != rAttr.Which() )) { @@ -1417,7 +1367,7 @@ sal_Bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) { SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // Send all changed ones } } return bRet; @@ -1472,16 +1422,16 @@ sal_Bool SwCntntNode::SetAttr( const SfxItemSet& rSet ) return sal_True; } - if( !GetpSwAttrSet() ) // lasse von den entsprechenden Nodes die - NewAttrSet( GetDoc()->GetAttrPool() ); // AttrSets anlegen + if( !GetpSwAttrSet() ) // Have the AttrsSets created by the corresponding Nodes + NewAttrSet( GetDoc()->GetAttrPool() ); sal_Bool bRet = sal_False; - // wenn Modify gelockt ist, werden keine Modifies verschickt + // If Modify is locked, do not send any Modifys if ( IsModifyLocked() || ( !GetDepends() && SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_NUMRULE, sal_False ) ) ) { - // einige Sonderbehandlungen fuer Attribute + // Some special treatment for Attributes bRet = 0 != AttrSetHandleHelper::Put( mpAttrSet, *this, rSet ); } else @@ -1490,18 +1440,16 @@ sal_Bool SwCntntNode::SetAttr( const SfxItemSet& rSet ) aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ); if( 0 != (bRet = 0 != AttrSetHandleHelper::Put_BC( mpAttrSet, *this, rSet, &aOld, &aNew )) ) { - // einige Sonderbehandlungen fuer Attribute + // Some special treatment for Attributes SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // Send out all changed ones } } return bRet; } -// Nimmt den Hint mit nWhich aus dem Delta-Array - - +// With nWhich it takes the Hint from the Delta array sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) { if( !GetpSwAttrSet() ) @@ -1513,7 +1461,7 @@ sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) SetInCache( sal_False ); } - // wenn Modify gelockt ist, werden keine Modifies verschickt + // If Modify is locked, do not send out any Modifys if( IsModifyLocked() ) { sal_uInt16 nDel = 0; @@ -1526,14 +1474,14 @@ sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) else nDel = AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, nWhich1, nWhich2, 0, 0 ); - if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen - mpAttrSet.reset();//DELETEZ( mpAttrSet ); + if( !GetpSwAttrSet()->Count() ) // Empt? Delete + mpAttrSet.reset(); return 0 != nDel; } - // sollte kein gueltiger Bereich definiert sein ? + // No valid area defined? if( !nWhich2 || nWhich2 < nWhich1 ) - nWhich2 = nWhich1; // dann setze auf 1. Id, nur dieses Item + nWhich2 = nWhich1; // Then set only this Item to 1st Id SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ), aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ); @@ -1543,10 +1491,10 @@ sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) { SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // All changed ones are sent - if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen - mpAttrSet.reset();//DELETEZ( mpAttrSet ); + if( !GetpSwAttrSet()->Count() ) // Empty?, delete it + mpAttrSet.reset(); } return bRet; } @@ -1561,7 +1509,7 @@ sal_Bool SwCntntNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr ) SetInCache( sal_False ); } - // wenn Modify gelockt ist, werden keine Modifies verschickt + // If Modify is locked, do not send out any Modifys sal_uInt16 nDel = 0; if( IsModifyLocked() ) { @@ -1582,11 +1530,11 @@ sal_Bool SwCntntNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr ) { SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // All changed ones are sent } } - if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen - mpAttrSet.reset();//DELETEZ( mpAttrSet ); + if( !GetpSwAttrSet()->Count() ) // Empty?, delete it + mpAttrSet.reset(); return 0 != nDel ; } @@ -1602,14 +1550,14 @@ sal_uInt16 SwCntntNode::ResetAllAttr() SetInCache( sal_False ); } - // wenn Modify gelockt ist, werden keine Modifies verschickt + // If Modify is locked, do not send out any Modifys if( IsModifyLocked() ) { std::vector<sal_uInt16> aClearWhichIds; aClearWhichIds.push_back(0); sal_uInt16 nDel = ClearItemsFromAttrSet( aClearWhichIds ); - if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen - mpAttrSet.reset(); // DELETEZ( mpAttrSet ); + if( !GetpSwAttrSet()->Count() ) // Empty? Delete + mpAttrSet.reset(); return nDel; } @@ -1621,10 +1569,10 @@ sal_uInt16 SwCntntNode::ResetAllAttr() { SwAttrSetChg aChgOld( *GetpSwAttrSet(), aOld ); SwAttrSetChg aChgNew( *GetpSwAttrSet(), aNew ); - ModifyNotification( &aChgOld, &aChgNew ); // alle veraenderten werden verschickt + ModifyNotification( &aChgOld, &aChgNew ); // All changed ones are sent - if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen - mpAttrSet.reset();//DELETEZ( mpAttrSet ); + if( !GetpSwAttrSet()->Count() ) // Empty? Delete + mpAttrSet.reset(); } return aNew.Count(); } @@ -1684,8 +1632,8 @@ const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich, return pFnd; } - // koennen 2 Nodes zusammengefasst werden ? - // in pIdx kann die 2. Position returnt werden. +// Can we join two Nodes? +// We can return the 2nd position in pIdx. int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const { const SwNodes& rNds = GetNodes(); @@ -1696,7 +1644,7 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const while( aIdx < rNds.Count()-1 && (( pNd = &aIdx.GetNode())->IsSectionNode() || ( pNd->IsEndNode() && pNd->StartOfSectionNode()->IsSectionNode() ))) - aIdx++; + ++aIdx; if( pNd->GetNodeType() != nNdType || rNds.Count()-1 == aIdx.GetIndex() ) return sal_False; @@ -1714,9 +1662,8 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const return sal_True; } - - // koennen 2 Nodes zusammengefasst werden ? - // in pIdx kann die 2. Position returnt werden. +// Can we join two Nodes? +// We can return the 2nd position in pIdx. int SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const { sal_uInt8 nNdType = GetNodeType(); @@ -1860,7 +1807,7 @@ sal_Bool SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const void SwCntntNode::ChkCondColl() { - // zur Sicherheit abfragen + // Check, just to be sure if( RES_CONDTXTFMTCOLL == GetFmtColl()->Which() ) { SwCollCondition aTmp( 0, 0, 0 ); @@ -1884,8 +1831,7 @@ void SwCntntNode::ChkCondColl() { if( IsTxtNode() && ((SwTxtNode*)this)->GetNumRule()) { - // steht in einer Numerierung - // welcher Level? + // Is at which Level in a list? aTmp.SetCondition( PARA_IN_LIST, ((SwTxtNode*)this)->GetActualListLevel() ); pCColl = ((SwConditionTxtFmtColl*)GetFmtColl())-> diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index b5ff192c3c41..013b478d57a3 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -41,25 +41,25 @@ #include "section.hxx" #include "node2lay.hxx" -/* -------------------------------------------------- - * Die SwNode2LayImpl-Klasse erledigt die eigentliche Arbeit, - * die SwNode2Layout-Klasse ist nur die der Oefffentlichkeit bekannte Schnittstelle - * --------------------------------------------------*/ +/** + * The SwNode2LayImpl class does the actual work, the SwNode2Layout class is + * just the public interface. + */ class SwNode2LayImpl { SwIterator<SwFrm,SwModify>* pIter; SwModify* pMod; - std::vector<SwFrm*>* pUpperFrms;// Zum Einsammeln der Upper - sal_uLong nIndex; // Der Index des einzufuegenden Nodes - sal_Bool bMaster : 1; // sal_True => nur Master , sal_False => nur Frames ohne Follow - sal_Bool bInit : 1; // Ist am SwClient bereits ein First()-Aufruf erfolgt? + std::vector<SwFrm*>* pUpperFrms; // To collect the Upper + sal_uLong nIndex; // The Index of the to-be-inserted Nodes + sal_Bool bMaster : 1; // sal_True => only Master, sal_False => only Frames without Follow + sal_Bool bInit : 1; // Did we already call First() at SwClient? public: SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bSearch ); ~SwNode2LayImpl() { delete pIter; delete pUpperFrms; } - SwFrm* NextFrm(); // liefert den naechsten "sinnvollen" Frame + SwFrm* NextFrm(); // Returns the next "useful" Frame SwLayoutFrm* UpperFrm( SwFrm* &rpFrm, const SwNode &rNode ); - void SaveUpperFrms(); // Speichert (und lockt ggf.) die pUpper - // Fuegt unter jeden pUpper des Arrays einen Frame ein. + void SaveUpperFrms(); // Saves (and locks if needed) the pUpper + // Inserts a Frame under every pUpper of the array void RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong nEnd ); SwFrm* GetFrm( const Point* pDocPos = 0, @@ -67,15 +67,15 @@ public: const sal_Bool bCalcFrm = sal_True ) const; }; -/* -------------------------------------------------- - * Hauptaufgabe des Ctor: Das richtige SwModify zu ermitteln, - * ueber das iteriert wird. - * Uebergibt man bSearch == sal_True, so wird der naechste Cntnt- oder TableNode - * gesucht, der Frames besitzt ( zum Einsammeln der pUpper ), ansonsten wird - * erwartet, das rNode bereits auf einem solchen Cntnt- oder TableNode sitzt, - * vor oder hinter den eingefuegt werden soll. - * --------------------------------------------------*/ - +/** + * The main purpose of this ctor is to find the right SwModify to iterate over. + * + * @param bSearch sal_True: find the next Content or TableNode which contains + * Frames (to collect the pUpper). + * Else we assume that rNode points already to such a + * Content or TableNode. + * We insert before or after it. + */ SwNode* GoNextWithFrm(const SwNodes& rNodes, SwNodeIndex *pIdx) { if( pIdx->GetIndex() >= rNodes.Count() - 1 ) @@ -98,7 +98,7 @@ SwNode* GoNextWithFrm(const SwNodes& rNodes, SwNodeIndex *pIdx) } if ( bFound ) break; - aTmp++; + ++aTmp; } if( aTmp == rNodes.Count()-1 ) @@ -147,14 +147,14 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS const SwNode* pNd; if( bSearch || rNode.IsSectionNode() ) { - // Suche den naechsten Cntnt/TblNode, der einen Frame besitzt, - // damit wir uns vor/hinter ihn haengen koennen + // Find the next Cntnt/TableNode that contains a Frame, so that we can add + // ourselves before/after it if( !bSearch && rNode.GetIndex() < nIndex ) { SwNodeIndex aTmp( *rNode.EndOfSectionNode(), +1 ); pNd = GoPreviousWithFrm( &aTmp ); if( !bSearch && pNd && rNode.GetIndex() > pNd->GetIndex() ) - pNd = NULL; // Nicht ueber den Bereich hinausschiessen + pNd = NULL; // Do not go over the limits bMaster = sal_False; } else @@ -163,7 +163,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS pNd = GoNextWithFrm( rNode.GetNodes(), &aTmp ); bMaster = sal_True; if( !bSearch && pNd && rNode.EndOfSectionIndex() < pNd->GetIndex() ) - pNd = NULL; // Nicht ueber den Bereich hinausschiessen + pNd = NULL; // Do not go over the limits } } else @@ -189,17 +189,20 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, sal_Bool bS } } -/* -------------------------------------------------- - * SwNode2LayImpl::NextFrm() liefert den naechsten "sinnvollen" Frame, - * beim ersten Aufruf wird am eigentlichen Iterator ein First gerufen, - * danach die Next-Methode. Das Ergebnis wird auf Brauchbarkeit untersucht, - * so werden keine Follows akzeptiert, ein Master wird beim Einsammeln der - * pUpper und beim Einfuegen vor ihm akzeptiert. Beim Einfuegen dahinter - * wird vom Master ausgehend der letzte Follow gesucht und zurueckgegeben. - * Wenn der Frame innerhalb eines SectionFrms liegt, wird noch festgestellt, - * ob statt des Frames der SectionFrm der geeignete Rueckgabewert ist, dies - * ist der Fall, wenn der neu einzufuegende Node ausserhalb des Bereichs liegt. - * --------------------------------------------------*/ +/** + * Returns the next "useful" Frame. + * + * When calling this method for the first time, a First is triggered at the + * actual Iterator. The result is check for suitability: Follows are not + * accepted, a Master is accepted when collecting the pUpper and when + * inserting before it. + * When inserting after it, we find and return the last Follow starting + * from the Master. + * + * If the Frame is located in a SectionFrm, we check to see whether the + * SectionFrame is the suitable return value (instead of the Frame itself). + * This is the case if the to-be-inserted Node is outside of the Section. + */ SwFrm* SwNode2LayImpl::NextFrm() { SwFrm* pRet; @@ -216,9 +219,9 @@ SwFrm* SwNode2LayImpl::NextFrm() { SwFlowFrm* pFlow = SwFlowFrm::CastFlowFrm( pRet ); OSL_ENSURE( pFlow, "Cntnt or Table expected?!" ); - // Follows sind fluechtige Gestalten, deshalb werden sie ignoriert. - // Auch wenn wir hinter dem Frame eingefuegt werden sollen, nehmen wir - // zunaechst den Master, hangeln uns dann aber zum letzten Follow durch. + // Follows are pretty volatile, thus we ignore them. + // Even if we insert after the Frame, we start from the Master + // and iterate through it until the last Follow if( !pFlow->IsFollow() ) { if( !bMaster ) @@ -230,19 +233,19 @@ SwFrm* SwNode2LayImpl::NextFrm() if( pRet->IsInSct() ) { SwSectionFrm* pSct = pRet->FindSctFrm(); - // Vorsicht: Wenn wir in einer Fussnote sind, so kann diese - // Layoutmaessig in einem spaltigen Bereich liegen, obwohl - // sie nodemaessig ausserhalb liegt. Deshalb muss bei Fussnoten - // ueberprueft werden, ob auch der SectionFrm in der Fussnote - // und nicht ausserhalb liegt. + // ATTENTION: If we are in a Footnote, from a Layout point of view + // it could be located in a Section with columns, although it + // should be outside of it when looking at the Nodes. + // Thus, when dealing with Footnotes, we need to check whether the + // SectionFrm is also located within the Footnote and not outside of it. if( !pRet->IsInFtn() || pSct->IsInFtn() ) { OSL_ENSURE( pSct && pSct->GetSection(), "Where's my section?" ); SwSectionNode* pNd = pSct->GetSection()->GetFmt()->GetSectionNode(); OSL_ENSURE( pNd, "Lost SectionNode" ); - // Wenn der erhaltene Frame in einem Bereichsframe steht, - // dessen Bereich den Ausgangsnode nicht umfasst, so kehren - // wir mit dem SectionFrm zurueck, sonst mit dem Cntnt/TabFrm + // If the result Frame is located within a Section Frame + // whose Section does not contain the Node, we return with + // the SectionFrm, else we return with the Cntnt/TabFrm if( bMaster ) { if( pNd->GetIndex() >= nIndex ) @@ -382,7 +385,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong else pNxt = pUp->Lower(); pNew = ((SwTableNode*)pNd)->MakeFrm( pUp ); - OSL_ENSURE( pNew->IsTabFrm(), "Table exspected" ); + OSL_ENSURE( pNew->IsTabFrm(), "Table expected" ); pNew->Paste( pUp, pNxt ); ((SwTabFrm*)pNew)->RegistFlys(); (*pUpperFrms)[x-2] = pNew; @@ -425,7 +428,7 @@ SwFrm* SwNode2LayImpl::GetFrm( const Point* pDocPos, const SwPosition *pPos, const sal_Bool bCalcFrm ) const { - // mba: test if change of member pIter -> pMod broke anything + // test if change of member pIter -> pMod broke anything return pMod ? ::GetFrmOfModify( 0, *pMod, USHRT_MAX, pDocPos, pPos, bCalcFrm ) : 0; } diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 400fe2d60025..0abaab8b4c05 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -124,7 +124,7 @@ SwNodes::~SwNodes() if( pNode == pEndOfContent ) break; - aNdIdx++; + ++aNdIdx; delete pNode; } } @@ -142,7 +142,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, //JP 03.02.99: alle Felder als invalide erklaeren, aktu. erfolgt im // Idle-Handler des Docs - if( GetDoc()->SetFieldsDirty( sal_True, &rDelPos.GetNode(), nSz ) && + if( GetDoc()->SetFieldsDirty( true, &rDelPos.GetNode(), nSz ) && rNds.GetDoc() != GetDoc() ) rNds.GetDoc()->SetFieldsDirty( true, NULL, 0 ); @@ -404,7 +404,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, ((SwCntntNode*)pFrmNd)->MakeFrms( *pCNd ); pFrmNd = pCNd; } - aIdx++; + ++aIdx; } } } @@ -758,7 +758,7 @@ sal_Bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, SwNodeIndex aTmpEIdx( aOrigInsPos.aEnd ); new SwEndNode( aTmpEIdx, *pTmpStt ); aTmpEIdx--; - aTmpSIdx++; + ++aTmpSIdx; // setze die StartOfSection richtig aRg.aEnd++; @@ -1054,7 +1054,7 @@ void SwNodes::SectionUp(SwNodeRange *pRange) if( pAktNode->IsStartNode() ) aTmpIdx = pAktNode->EndOfSectionIndex() + 1; else - aTmpIdx++; + ++aTmpIdx; } return ; } @@ -1108,7 +1108,7 @@ void SwNodes::SectionUpDown( const SwNodeIndex & aStart, const SwNodeIndex & aEn // durchlaufe bis der erste zu aendernde Start-Node gefunden wurde // ( Es wird vom eingefuegten EndNode bis nach vorne die Indexe gesetzt ) - for( ;; aTmpIdx++ ) + for( ;; ++aTmpIdx ) { pAktNode = &aTmpIdx.GetNode(); pAktNode->pStartOfSection = aSttNdStack[ aSttNdStack.size()-1 ]; @@ -1406,7 +1406,7 @@ SwCntntNode* SwNodes::GoNext(SwNodeIndex *pIdx) const SwNodeIndex aTmp(*pIdx, +1); SwNode* pNd = 0; while( aTmp < Count()-1 && 0 == ( pNd = &aTmp.GetNode())->IsCntntNode() ) - aTmp++; + ++aTmp; if( aTmp == Count()-1 ) pNd = 0; @@ -1567,7 +1567,7 @@ struct HighLevel }; -sal_Bool _HighestLevel( const SwNodePtr& rpNode, void * pPara ) +static bool lcl_HighestLevel( const SwNodePtr& rpNode, void * pPara ) { HighLevel * pHL = (HighLevel*)pPara; if( rpNode->GetStartNode() ) @@ -1576,14 +1576,14 @@ sal_Bool _HighestLevel( const SwNodePtr& rpNode, void * pPara ) pHL->nLevel--; if( pHL->nTop > pHL->nLevel ) pHL->nTop = pHL->nLevel; - return sal_True; + return true; } sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange ) { HighLevel aPara( rNodes.GetSectionLevel( rRange.aStart )); - rNodes.ForEach( rRange.aStart, rRange.aEnd, _HighestLevel, &aPara ); + rNodes.ForEach( rRange.aStart, rRange.aEnd, lcl_HighestLevel, &aPara ); return aPara.nTop; } @@ -1708,7 +1708,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) return; } - aSttIdx++; + ++aSttIdx; } else if( pDestNd ) { @@ -1790,7 +1790,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) { if ( pSrcNd && aEndIdx.GetNode().IsCntntNode() ) { - aEndIdx++; + ++aEndIdx; } if( !bSplitDestNd ) { @@ -2014,7 +2014,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, if( nLevel ) // vollstaendige Section { --nLevel; - aInsPos++; // EndNode schon vorhanden + ++aInsPos; // EndNode schon vorhanden } else if( !pAktNode->pStartOfSection->IsSectionNode() ) { @@ -2045,7 +2045,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, SwNode *const pTmpNd = & aInsPos.GetNode(); if( pTmpNd->IsSectionNode() || pTmpNd->StartOfSectionNode()->IsSectionNode() ) - aInsPos++; // ueberspringen + ++aInsPos; // ueberspringen } else { OSL_FAIL( "wie kommt diser Node ins Nodes-Array??" ); @@ -2067,7 +2067,7 @@ void SwNodes::_DelDummyNodes( const SwNodeRange& rRg ) if( ND_SECTIONDUMMY == aIdx.GetNode().GetNodeType() ) RemoveNode( aIdx.GetIndex(), 1, sal_True ); else - aIdx++; + ++aIdx; } } @@ -2140,7 +2140,7 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx, return (SwCntntNode*)pNd; } } - aTmp++; + ++aTmp; bFirst = sal_False; } return 0; @@ -2319,7 +2319,7 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx, if( rSect.IsHiddenFlag() ) aIdx = aIdx.GetNode().EndOfSectionIndex()+1; else - aIdx++; + ++aIdx; } if( aIdx.GetNode().IsTableNode() ) { diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index c21e4c5b0e49..1625561d0921 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -230,14 +230,14 @@ SwSection::~SwSection() SwDoc* pDoc = pFmt->GetDoc(); if( pDoc->IsInDtor() ) { - // dann melden wir noch schnell unser Format um ans dflt FrameFmt, - // damit es keine Abhaengigkeiten gibt + // We reattach our Format to the default FrameFmt + // to not get any dependencies if( pFmt->DerivedFrom() != pDoc->GetDfltFrmFmt() ) pFmt->RegisterToFormat( *pDoc->GetDfltFrmFmt() ); } else { - pFmt->Remove( this ); // austragen, + pFmt->Remove( this ); // remove if (CONTENT_SECTION != m_Data.GetType()) { @@ -249,16 +249,14 @@ SwSection::~SwSection() pDoc->GetLinkManager().RemoveServer( &m_RefObj ); } - // ist die Section der letzte Client im Format, kann dieses - // geloescht werden + // If the Section is the last Client in the Format we can delete it SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt ); pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); if( !pFmt->GetDepends() ) { - // Bug: 28191 - nicht ins Undo aufnehmen, sollte schon vorher - // geschehen sein!! + // Do not add to the Undo. This should've happened earlier. ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); - pDoc->DelSectionFmt( pFmt ); // und loeschen + pDoc->DelSectionFmt( pFmt ); } } if (m_RefObj.Is()) @@ -271,7 +269,7 @@ void SwSection::SetSectionData(SwSectionData const& rData) { bool const bOldHidden( m_Data.IsHidden() ); m_Data = rData; - // next 2 may actually overwrite m_Data.m_b{Protect,EditInReadonly}Flag + // The next two may actually overwrite the m_Data.m_bProtect or EditInReadonly Flag // in Modify, which should result in same flag value as the old code! SetProtect(m_Data.IsProtectFlag()); SetEditInReadonly(m_Data.IsEditInReadonlyFlag()); @@ -310,27 +308,25 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition) { if (!m_Data.IsHiddenFlag()) // is not hidden { - // wie sieht es mit dem Parent aus, ist der versteckt ? - // (eigentlich muesste das vom bHiddenFlag angezeigt werden!) + // Is the Parent hidden? + // This should be shown by the bHiddenFlag. - // erstmal allen Children sagen, das sie versteckt sind + // Tell all Children that they are hidden SwMsgPoolItem aMsgItem( RES_SECTION_HIDDEN ); pFmt->ModifyNotification( &aMsgItem, &aMsgItem ); - // alle Frames loeschen + // Delete all Frames pFmt->DelFrms(); } } else if (m_Data.IsHiddenFlag()) // show Nodes again { - // alle Frames sichtbar machen ( Children Sections werden vom - // MakeFrms beruecksichtigt). Aber nur wenn die ParentSection - // nichts dagegen hat ! + // Show all Frames (Child Sections are accounted for by MakeFrms) + // Only if the Parent Section is not restricting us! SwSection* pParentSect = pFmt->GetParentSection(); if( !pParentSect || !pParentSect->IsHiddenFlag() ) { - // erstmal allen Children sagen, das der Parent nicht mehr - // versteckt ist + // Tell all Children that the Parent is not hidden anymore SwMsgPoolItem aMsgItem( RES_SECTION_NOT_HIDDEN ); pFmt->ModifyNotification( &aMsgItem, &aMsgItem ); @@ -466,8 +462,8 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) static_cast<const SvxProtectItem*>(pNew)->IsCntntProtected(); if( !bNewFlag ) { - // Abschalten: teste ob nicht vielleich ueber die Parents - // doch ein Schutzt besteht! + // Switching off: See if there is protection transferred + // by the Parents const SwSection* pSect = this; do { if( pSect->IsProtect() ) @@ -502,7 +498,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) return; case RES_COL: - /* wird ggf. vom Layout erledigt */ + // Is handeled by the Layout, if appropriate break; case RES_FTN_AT_TXTEND: @@ -554,7 +550,7 @@ void SwSection::SetCondHidden(bool const bFlag) } -// setze/erfrage den gelinkten FileNamen +// Set/remove the linked FileName const String& SwSection::GetLinkFileName() const { if (m_RefLink.Is()) @@ -578,9 +574,9 @@ const String& SwSection::GetLinkFileName() const } else if( GetFmt() && !GetFmt()->GetSectionNode() ) { - // ist die Section im UndoNodesArray, dann steht - // der Link nicht im LinkManager, kann also auch nicht - // erfragt werden. Dann returne den akt. Namen + // If the Section is in the UndoNodesArray, the LinkManager + // does not contain the Link, thus it cannot be queried for it. + // Thus return the current Name. return m_Data.GetLinkFileName(); } } @@ -606,8 +602,7 @@ void SwSection::SetLinkFileName(const String& rNew, String const*const pPassWd) } } -// falls es ein gelinkter Bereich war, dann muessen alle -// Child-Verknuepfungen sichtbar bemacht werden. +// If it was a Linked Section, we need to make all Child Links visible void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd ) { const SwNode* pNd; @@ -619,15 +614,14 @@ void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd ) pBLnk->ISA( SwBaseLink ) && 0 != ( pNd = ((SwBaseLink*)pBLnk)->GetAnchor() ) ) { - pNd = pNd->StartOfSectionNode(); // falls SectionNode ist! + pNd = pNd->StartOfSectionNode(); // If it's a SectionNode const SwSectionNode* pParent; while( 0 != ( pParent = pNd->FindSectionNode() ) && ( CONTENT_SECTION == pParent->GetSection().GetType() || pNd == &rSectNd )) pNd = pParent->StartOfSectionNode(); - // steht nur noch in einer normalen Section, also - // wieder anzeigen + // It's within a normal Section, so show again if( !pParent ) pBLnk->SetVisible( sal_True ); } @@ -662,19 +656,18 @@ SwSectionFmt::~SwSectionFmt() 0 != (pSectNd = pIdx->GetNode().GetSectionNode() )) { SwSection& rSect = pSectNd->GetSection(); - // falls es ein gelinkter Bereich war, dann muessen alle - // Child-Verknuepfungen sichtbar bemacht werden. + // If it was a linked Section, we need to make all Child Links + // visible again if( rSect.IsConnected() ) rSect.MakeChildLinksVisible( *pSectNd ); - // vorm loeschen der Nodes pruefe, ob wir uns nicht - // noch anzeigen muessen! + // Check whether we need to be visible, before deleting the Nodes if( rSect.IsHiddenFlag() ) { SwSection* pParentSect = rSect.GetParent(); if( !pParentSect || !pParentSect->IsHiddenFlag() ) { - // Nodes wieder anzeigen + // Make Nodes visible again rSect.SetHidden(false); } } @@ -682,7 +675,7 @@ SwSectionFmt::~SwSectionFmt() // use hint which allows to specify, if the content shall be saved or not CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( sal_True ) ); - // hebe die Section doch mal auf + // Raise he Section up SwNodeRange aRg( *pSectNd, 0, *pSectNd->EndOfSectionNode() ); GetDoc()->GetNodes().SectionUp( &aRg ); } @@ -700,7 +693,7 @@ SwSection * SwSectionFmt::GetSection() const extern void sw_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ); -//Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt). +// Do not destroy all Frms in aDepend (Frms are recognized with a PTR_CAST). void SwSectionFmt::DelFrms() { SwSectionNode* pSectNd; @@ -728,10 +721,9 @@ void SwSectionFmt::DelFrms() } if( pIdx ) { - //Hint fuer Pagedesc versenden. Das mueste eigntlich das Layout im - //Paste der Frames selbst erledigen, aber das fuehrt dann wiederum - //zu weiteren Folgefehlern, die mit Laufzeitkosten geloest werden - //muesten. + // Send Hint for PageDesc. Actually the Layout contained in the + // Paste of the Framei tself would need to do this. But that leads + // to subsequent errors, which we'd need to solve at run-time. SwNodeIndex aNextNd( *pIdx ); SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection( &aNextNd, sal_True, sal_False ); if( pCNd ) @@ -743,7 +735,7 @@ void SwSectionFmt::DelFrms() } -//Erzeugt die Ansichten +// Create the Views void SwSectionFmt::MakeFrms() { SwSectionNode* pSectNd; @@ -824,20 +816,20 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) case RES_PROTECT: case RES_EDIT_IN_READONLY: // edit in readonly sections - // diese Messages bis zum Ende des Baums durchreichen ! + // Pass through these Messages until the End of the tree! if( GetDepends() ) { ModifyBroadcast( pOld, pNew ); } - return; // das wars + return; // That's it! case RES_OBJECTDYING: if( !GetDoc()->IsInDtor() && ((SwPtrMsgPoolItem *)pOld)->pObject == (void*)GetRegisteredIn() ) { - // mein Parent wird vernichtet, dann an den Parent vom Parent - // umhaengen und wieder aktualisieren - SwFrmFmt::Modify( pOld, pNew ); // erst umhaengen !!! + // My Parents will be destroyed, so get the Parent's Parent + // and update + SwFrmFmt::Modify( pOld, pNew ); // Rewire first! UpdateParent(); return; } @@ -848,8 +840,8 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) ((SwFmtChg*)pNew)->pChangedFmt == (void*)GetRegisteredIn() && ((SwFmtChg*)pNew)->pChangedFmt->IsA( TYPE( SwSectionFmt )) ) { - // mein Parent wird veraendert, muss mich aktualisieren - SwFrmFmt::Modify( pOld, pNew ); // erst umhaengen !!! + // My Parent will be changed, thus I need to update + SwFrmFmt::Modify( pOld, pNew ); // Rewire first! UpdateParent(); return; } @@ -863,8 +855,8 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) } } - // erfrage vom Format Informationen -sal_Bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const +// Get info from the Format +bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const { switch( rInfo.Which() ) { @@ -875,7 +867,7 @@ sal_Bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const if( pNd ) ((SwFindNearestNode&)rInfo).CheckNode( *pNd ); } - return sal_True; + return true; case RES_CONTENT_VISIBLE: { @@ -893,7 +885,7 @@ sal_Bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const } ((SwPtrMsgPoolItem&)rInfo).pObject = pFrm; } - return sal_False; + return false; } return SwModify::GetInfo( rInfo ); } @@ -912,13 +904,13 @@ static bool lcl_SectionCmpPos( const SwSection *pFirst, const SwSection *pSecond static bool lcl_SectionCmpNm( const SwSection *pFSect, const SwSection *pSSect) { - OSL_ENSURE( pFSect && pSSect, "ungueltige Sections" ); + OSL_ENSURE( pFSect && pSSect, "Invalid Sections" ); StringCompare const eCmp = pFSect->GetSectionName().CompareTo( pSSect->GetSectionName() ); return eCmp == COMPARE_LESS; } - // alle Sections, die von dieser abgeleitet sind +// Alle Sections which have been derived from this one sal_uInt16 SwSectionFmt::GetChildSections( SwSections& rArr, SectionSort eSort, sal_Bool bAllSections ) const @@ -938,7 +930,7 @@ sal_uInt16 SwSectionFmt::GetChildSections( SwSections& rArr, rArr.push_back( pDummy ); } - // noch eine Sortierung erwuenscht ? + // Do we need any sorting? if( 1 < rArr.size() ) switch( eSort ) { @@ -955,16 +947,15 @@ sal_uInt16 SwSectionFmt::GetChildSections( SwSections& rArr, return rArr.size(); } - // erfrage, ob sich die Section im Nodes-Array oder UndoNodes-Array - // befindet. +// See whether the Section is within the Nodes or the UndoNodes array sal_Bool SwSectionFmt::IsInNodesArr() const { const SwNodeIndex* pIdx = GetCntnt(sal_False).GetCntntIdx(); return pIdx && &pIdx->GetNodes() == &GetDoc()->GetNodes(); } - -void SwSectionFmt::UpdateParent() // Parent wurde veraendert +// Parent was changed +void SwSectionFmt::UpdateParent() { if( !GetDepends() ) return; @@ -977,7 +968,7 @@ void SwSectionFmt::UpdateParent() // Parent wurde veraendert SwClientIter aIter( *this ); // TODO ::SwClient * pLast = aIter.GoStart(); - if( pLast ) // konnte zum Anfang gesprungen werden ?? + if( pLast ) // Could we jump to the beginning? do { if( pLast->IsA( TYPE(SwSectionFmt) ) ) { @@ -1055,7 +1046,7 @@ SwSectionNode* SwSectionFmt::GetSectionNode(bool const bAlways) return 0; } - // ist die Section eine gueltige fuers GlobalDocument? +// Is this Section valid for the GlobalDocument? const SwSection* SwSectionFmt::GetGlobalDocSection() const { const SwSectionNode* pNd = GetSectionNode(); @@ -1158,7 +1149,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) SwBaseLink* pBLink; String sMimeType( SotExchange::GetFormatMimeType( FORMAT_FILE )); uno::Any aValue; - aValue <<= ::rtl::OUString( sName ); // beliebiger Name + aValue <<= ::rtl::OUString( sName ); // Arbitrary name const ::sfx2::SvBaseLinks& rLnks = pDoc->GetLinkManager().GetLinks(); for( sal_uInt16 n = rLnks.size(); n; ) @@ -1170,22 +1161,20 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) ( pBLink = (SwBaseLink*)pLnk )->IsInRange( rSectNd.GetIndex(), rSectNd.EndOfSectionIndex() ) ) { - // liegt in dem Bereich: also updaten. Aber nur wenns nicht - // im gleichen File liegt + // It's in the Section, so update. But only if it's not in the same File! String sFName; pDoc->GetLinkManager().GetDisplayNames( pBLink, 0, &sFName, 0, 0 ); if( sFName != sName ) { pBLink->DataChanged( sMimeType, aValue ); - // ggfs. neu den Link-Pointer wieder suchen, damit nicht einer - // ausgelassen oder doppelt gerufen wird. + // If needed find the Link pointer to avoid skipping one or calling one twice if( n >= rLnks.size() && 0 != ( n = rLnks.size() )) --n; if( n && pLnk != &(*rLnks[ n ]) ) { - // suchen - kann nur davor liegen!! + // Find - it can only precede it! while( n ) if( pLnk == &(*rLnks[ --n ] ) ) break; @@ -1196,12 +1185,12 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) } -// sucht sich die richtige DocShell raus oder erzeugt eine neue: -// Der Return-Wert gibt an, was mit der Shell zu geschehen hat: -// 0 - Fehler, konnte DocShell nicht finden -// 1 - DocShell ist ein existieren Document -// 2 - DocShell wurde neu angelegt, muss also wieder geschlossen werden ( will be assigned to xLockRef additionaly ) - +// Find the right DocShell and create a new one: +// The return value specifies what should happen to the Shell +// 0 - Error, could not find the DocShell +// 1 - DocShell is an existing Document +// 2 - DocShell was created anew, thus it needs to be closed again +// (will be assigned to xLockRef additionally) int sw_FindDocShell( SfxObjectShellRef& xDocSh, SfxObjectShellLock& xLockRef, const String& rFileName, @@ -1213,25 +1202,23 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, if( !rFileName.Len() ) return 0; - // 1. existiert die Datei schon in der Liste aller Dokumente? + // 1. Does the file already exist in the list of all Documents? INetURLObject aTmpObj( rFileName ); aTmpObj.SetMark( aEmptyStr ); - // erstmal nur ueber die DocumentShells laufen und die mit dem - // Namen heraussuchen: + // Iterate over the DocShell and get the ones with the name TypeId aType( TYPE(SwDocShell) ); SfxObjectShell* pShell = pDestSh; sal_Bool bFirst = 0 != pShell; if( !bFirst ) - // keine DocShell uebergeben, also beginne mit der ersten aus der - // DocShell Liste + // No DocShell passed, starting with the first from the DocShell list pShell = SfxObjectShell::GetFirst( &aType ); while( pShell ) { - // die wollen wir haben + // We want this one SfxMedium* pMed = pShell->GetMedium(); if( pMed && pMed->GetURLObject() == aTmpObj ) { @@ -1241,7 +1228,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, ? (nVersion == ((SfxInt16Item*)pItem)->GetValue()) : !nVersion ) { - // gefunden also returnen + // Found, thus return xDocSh = pShell; return 1; } @@ -1256,11 +1243,11 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, pShell = SfxObjectShell::GetNext( *pShell, &aType ); } - // 2. selbst die Date oeffnen + // 2. Open the file ourselves SfxMedium* pMed = new SfxMedium( aTmpObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); if( INET_PROT_FILE == aTmpObj.GetProtocol() ) - pMed->DownLoad(); // nur mal das Medium anfassen (DownLoaden) + pMed->DownLoad(); // Touch the medium (download it) const SfxFilter* pSfxFlt = 0; if( !pMed->GetError() ) @@ -1268,8 +1255,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, String sFactory(rtl::OUString::createFromAscii(SwDocShell::Factory().GetShortName())); SfxFilterMatcher aMatcher( sFactory ); - // kein Filter, dann suche ihn. Ansonsten teste, ob der angegebene - // ein gueltiger ist + // No Filter, so search for it. Else test if the one passed is a valid one if( rFilter.Len() ) { pSfxFlt = aMatcher.GetFilter4FilterName( rFilter ); @@ -1286,10 +1272,10 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, if( pSfxFlt ) { - // ohne Filter geht gar nichts + // We cannot do anything without a Filter pMed->SetFilter( pSfxFlt ); - // if the new shell is created, SfxObjectShellLock should be used to let it be closed later for sure + // If the new shell is created, SfxObjectShellLock should be used to let it be closed later for sure xLockRef = new SwDocShell( SFX_CREATE_MODE_INTERNAL ); xDocSh = (SfxObjectShell*)xLockRef; if( xDocSh->DoLoad( pMed ) ) @@ -1297,10 +1283,10 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, } } - if( !xDocSh.Is() ) // Medium muss noch geloescht werden + if( !xDocSh.Is() ) // Medium still needs to be deleted delete pMed; - return 0; // das war wohl nichts + return 0; } @@ -1316,7 +1302,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, if( !pSectNd || !pDoc || pDoc->IsInDtor() || ChkNoDataFlag() || sfx2::LinkManager::RegisterStatusInfoId() == nDataFormat ) { - // sollten wir schon wieder im Undo stehen? + // Should we be in the Undo already? return SUCCESS; } @@ -1327,7 +1313,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, // during load. pDoc->SetLinksUpdated( sal_True ); - // Undo immer abschalten + // Always switch off Undo bool const bWasUndo = pDoc->GetIDocumentUndoRedo().DoesUndo(); pDoc->GetIDocumentUndoRedo().DoUndo(false); sal_Bool bWasVisibleLinks = pDoc->IsVisibleLinks(); @@ -1338,7 +1324,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, SwEditShell* pESh = pDoc->GetEditShell( &pVSh ); pDoc->LockExpFlds(); { - // am Anfang des Bereichs einen leeren TextNode einfuegen + // Insert an empty TextNode at the Section's start SwNodeIndex aIdx( *pSectNd, +1 ); SwNodeIndex aEndIdx( *pSectNd->EndOfSectionNode() ); SwTxtNode* pNewNd = pDoc->GetNodes().MakeTxtNode( aIdx, @@ -1355,11 +1341,11 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, pPam = new SwPaM( aPos ); - //und alles dahinter liegende loeschen + // Delete everything succeeding it aIdx--; DelFlyInRange( aIdx, aEndIdx ); _DelBookmarks(aIdx, aEndIdx); - aIdx++; + ++aIdx; pDoc->GetNodes().Delete( aIdx, aEndIdx.GetIndex() - aIdx.GetIndex() ); } @@ -1429,7 +1415,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, if( sRange.Len() ) { - // Rekursionen abfangen + // Catch recursion sal_Bool bRecursion = sal_False; if( pSrcDoc == pDoc ) { @@ -1472,7 +1458,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, if ( pSrcDoc != pDoc && rSection.IsProtectFlag() ) { - pSrcDoc->GetLinkManager().UpdateAllLinks( sal_False, sal_True, sal_False, 0 ); + pSrcDoc->GetLinkManager().UpdateAllLinks( false, true, false, 0 ); } if( pCpyRg ) @@ -1485,19 +1471,18 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, SwTblNumFmtMerge aTNFM( *pSrcDoc, *pDoc ); pSrcDoc->CopyWithFlyInFly( *pCpyRg, 0, rInsPos, bCreateFrm ); - aSave++; + ++aSave; if( !bCreateFrm ) ::MakeFrms( pDoc, aSave, rInsPos ); - // den letzten Node noch loeschen, aber nur wenn - // erfolgreich kopiert werden konnte, also der Bereich - // mehr als 1 Node enthaelt + // Delete last Node, only if it was copied successfully + // (the Section contains more than one Node) if( 2 < pSectNd->EndOfSectionIndex() - pSectNd->GetIndex() ) { aSave = rInsPos; pPam->Move( fnMoveBackward, fnGoNode ); - pPam->SetMark(); // beide SwPositions ummelden! + pPam->SetMark(); // Rewire both SwPositions pDoc->CorrAbs( aSave, *pPam->GetPoint(), 0, sal_True ); pDoc->GetNodes().Delete( aSave, 1 ); @@ -1507,7 +1492,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, lcl_BreakSectionLinksInSect( *pSectNd ); - // update alle Links in diesem Bereich + // Update all Links in this Section lcl_UpdateLinksInSect( *this, *pSectNd ); } if( xDocSh.Is() ) @@ -1522,7 +1507,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, break; } - // !!!! DDE nur updaten wenn Shell vorhanden ist?? + // Only create DDE if Shell is available! uno::Sequence< sal_Int8 > aSeq; if( pRead && rValue.hasValue() && ( rValue >>= aSeq ) ) { @@ -1550,7 +1535,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, if( pESh ) { pESh->Pop( sal_False ); - pPam = 0; // pam is deleted before + pPam = 0; // pam was deleted earlier } } @@ -1568,7 +1553,7 @@ int sw_FindDocShell( SfxObjectShellRef& xDocSh, pESh->EndAllAction(); else if( pVSh ) pVSh->EndAction(); - delete pPam; // wurde am Anfang angelegt + delete pPam; // Was created at the start return SUCCESS; } @@ -1579,9 +1564,8 @@ void SwIntrnlSectRefLink::Closed() SwDoc* pDoc = rSectFmt.GetDoc(); if( pDoc && !pDoc->IsInDtor() ) { - // Advise verabschiedet sich, den Bereich als nicht geschuetzt - // kennzeichnen und das Flag umsetzen - + // Advise says goodbye: mark the Section as not protected + // and change the Flag const SwSectionFmts& rFmts = pDoc->GetSections(); for( sal_uInt16 n = rFmts.size(); n; ) if( rFmts[ --n ] == &rSectFmt ) @@ -1606,7 +1590,7 @@ void SwIntrnlSectRefLink::Closed() pDoc->UpdateSection( n, aSectionData ); - // alle in der Section liegenden Links werden sichtbar + // Make all Links within the Section visible again SwSectionNode* pSectNd = rSectFmt.GetSectionNode( sal_False ); if( pSectNd ) pSectNd->GetSection().MakeChildLinksVisible( *pSectNd ); @@ -1671,16 +1655,16 @@ void SwSection::CreateLink( LinkCreateType eCreateType ) } break; default: - OSL_ENSURE( !this, "Was ist das fuer ein Link?" ); + OSL_ENSURE( !this, "What kind of Link is this?" ); } switch( eCreateType ) { - case CREATE_CONNECT: // Link gleich connecten + case CREATE_CONNECT: // Connect Link right away pLnk->Connect(); break; - case CREATE_UPDATE: // Link connecten und updaten + case CREATE_UPDATE: // Connect Link and update pLnk->Update(); break; case CREATE_NONE: break; @@ -1698,7 +1682,7 @@ void SwSection::BreakLink() return; } - // release link, if it exists + // Release link, if it exists if (m_RefLink.Is()) { SwSectionFmt *const pFormat( GetFmt() ); diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index b4ffc38ae8dd..585ac2f14878 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -38,7 +38,7 @@ #include <sfx2/lnkbase.hxx> #include <sfx2/objsh.hxx> #include <editeng/boxitem.hxx> -#include <svx/svxids.hrc> // fuer die EventIds +#include <svx/svxids.hrc> // For the EventIds #include <sfx2/linkmgr.hxx> #include <svtools/soerr.hxx> #include <fmtfsize.hxx> @@ -80,7 +80,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) for( int n = 0; n < 2; ++n ) { SwClient * pLast = aIter.GoStart(); - if( pLast ) // konnte zum Anfang gesprungen werden ?? + if( pLast ) // Were we able to jump to the beginning? { do { if( (0 == n) ^ ( 0 != pLast->ISA( SwCntntFrm )) ) @@ -97,7 +97,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) { if( !pCntntNode ) { - OSL_ENSURE(!this, "DataChanged ohne ContentNode" ); + OSL_ENSURE(!this, "DataChanged without ContentNode" ); return ERROR_GENERAL; } @@ -113,7 +113,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) if( pCntntNode->IsNoTxtNode() && nFmt == sfx2::LinkManager::RegisterStatusInfoId() ) { - // nur eine Statusaenderung - Events bedienen ? + // Only a status change - serve Events? ::rtl::OUString sState; if( rValue.hasValue() && ( rValue >>= sState )) { @@ -133,7 +133,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) pDoc->CallEvent( nEvent, aCallEvent ); } } - return SUCCESS; // das wars! + return SUCCESS; // That's it! } sal_Bool bUpdate = sal_False; @@ -175,10 +175,9 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) if( bGraphicPieceArrived && GRAPHIC_DEFAULT != aGrf.GetType() && ( !aSz.Width() || !aSz.Height() ) ) { - // wenn nur ein Teil ankommt, aber die Groesse nicht - // gesetzt ist, dann muss "unten" der Teil von - // bGraphicArrived durchlaufen werden! - // (ansonten wird die Grafik in deft. Size gepaintet) + // If only a part arrives, but the size is not set + // we need to go through bGraphicArrived down there. + // Or else the graphic is painted at its definitive size bGraphicArrived = sal_True; bGraphicPieceArrived = sal_False; } @@ -186,12 +185,12 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) rGrfObj.SetGraphic( aGrf, rGrfObj.GetLink() ); bUpdate = sal_True; - // Bug 33999: damit der Node den Transparent-Status - // richtig gesetzt hat, ohne auf die Grafik - // zugreifen zu muessen (sonst erfolgt ein SwapIn!). + // In order for the Node to have the right transparency status + // without having to access the graphic. + // Or else we cause a SwapIn. if( bGraphicArrived ) { - // immer mit der korrekten Grafik-Size arbeiten + // Always use the correct graphic size if( aGrfSz.Height() && aGrfSz.Width() && aSz.Height() && aSz.Width() && aGrfSz != aSz ) @@ -209,7 +208,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) if ( bUpdate && bGraphicPieceArrived && !(bSwapIn || bDontNotify) ) { - //Hint ohne Actions verschicken, loest direktes Paint aus. + // Send hint without Actions; triggers direct paint if ( (!pSh || !pSh->ActionPend()) && (!pESh || !pESh->ActionPend()) ) { SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED ); @@ -239,7 +238,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) if ( bGraphicArrived ) { - //Alle benachrichtigen, die am gleichen Link horchen. + // Notify all who are listening at the same link bInNotifyLinks = sal_True; const ::sfx2::SvBaseLinks& rLnks = pDoc->GetLinkManager().GetLinks(); @@ -263,13 +262,13 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) pGrfNd->SetGrafikArrived( ((SwGrfNode*)pCntntNode)-> IsGrafikArrived() ); - // Fly der Grafik anpassen ! + // Adjust the Fly's graphic if( !::SetGrfFlySize( aGrfSz, aFrmFmtSz, pGrfNd ) ) ::lcl_CallModify( *pGrfNd, aMsgHint ); } else if( pBLink == this && !::SetGrfFlySize( aGrfSz, aFrmFmtSz, pGrfNd ) ) - // Fly der Grafik anpassen ! + // Adjust the Fly's graphic ::lcl_CallModify( *pGrfNd, aMsgHint ); } } @@ -317,15 +316,15 @@ sal_Bool SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfN { Size aCalcSz( aSz ); if ( !aSz.Height() && aSz.Width() ) - //passende Hoehe ausrechnen. + // Calculate the right height aCalcSz.Height() = rFrmSz.Height() * aSz.Width() / rFrmSz.Width(); else if ( !aSz.Width() && aSz.Height() ) - //passende Breite ausrechnen + // Calculate the right width aCalcSz.Width() = rFrmSz.Width() * aSz.Height() / rFrmSz.Height(); else - //Hoehe und Breite uebernehmen + // Take over height and width aCalcSz = rFrmSz; const SvxBoxItem &rBox = pFmt->GetBox(); @@ -344,8 +343,8 @@ sal_Bool SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfN if( !aSz.Width() ) { - // Wenn die Grafik in einer Tabelle verankert ist, muess - // die Tabellen-Spalten neu berechnet werden + // If the graphic is anchored in a table, we need to recalculate + // the table rows const SwDoc *pDoc = pGrfNd->GetDoc(); const SwPosition* pAPos = pFmt->GetAnchor().GetCntntAnchor(); SwNode *pANd; @@ -372,8 +371,8 @@ sal_Bool SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfN } } - // SetTwipSize skaliert ggf. eine ImageMap neu und - // braucht dazu das Frame-Format + // SetTwipSize rescales an ImageMap if needed for which + // it requires the Frame Format pGrfNd->SetTwipSize( rGrfSz ); } @@ -414,14 +413,13 @@ sal_Bool SwBaseLink::SwapIn( sal_Bool bWaitForData, sal_Bool bNativFormat ) if( bWaitForData && !GetObj() ) { - OSL_ENSURE( !this, "das SvxFileObject wurde in einem GetData geloescht!" ); + OSL_ENSURE( !this, "The SvxFileObject was deleted in a GetData!" ); bRes = sal_False; } else if( 0 != ( bRes = aValue.hasValue() ) ) { - //JP 14.04.99: Bug 64820 - das Flag muss beim SwapIn natuerlich - // zurueckgesetzt werden. Die Daten sollen ja neu - // uebernommen werden + // The Flag needs to be reset on a SwapIn, because + // we want to reapply the data. bIgnoreDataChanged = sal_False; DataChanged( aMimeType, aValue ); } @@ -443,7 +441,7 @@ void SwBaseLink::Closed() { if( pCntntNode && !pCntntNode->GetDoc()->IsInDtor() ) { - // wir heben die Verbindung auf + // Delete the connection if( pCntntNode->IsGrfNode() ) ((SwGrfNode*)pCntntNode)->ReleaseLink(); } @@ -471,7 +469,7 @@ const SwNode* SwBaseLink::GetAnchor() const } } - OSL_ENSURE( !this, "GetAnchor nicht ueberlagert" ); + OSL_ENSURE( !this, "GetAnchor is not shadowed" ); return 0; } @@ -480,9 +478,8 @@ sal_Bool SwBaseLink::IsRecursion( const SwBaseLink* pChkLnk ) const SwServerObjectRef aRef( (SwServerObject*)GetObj() ); if( aRef.Is() ) { - // es ist ein ServerObject, also frage nach allen darin - // befindlichen Links, ob wir darin enthalten sind. Ansonsten - // handelt es sich um eine Rekursion. + // As it's a ServerObject, we query all contained Links + // if we are contained in them. Else we have a recursion. return aRef->IsLinkInServer( pChkLnk ); } return sal_False; @@ -490,8 +487,8 @@ sal_Bool SwBaseLink::IsRecursion( const SwBaseLink* pChkLnk ) const sal_Bool SwBaseLink::IsInRange( sal_uLong, sal_uLong, xub_StrLen, xub_StrLen ) const { - // Grafik oder OLE-Links nicht, - // Felder oder Sections haben eigene Ableitung! + // Not Graphic or OLE Links + // Fields or Sections have their own derivation! return sal_False; } diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index 62547c5089f4..1d1916d46ea2 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -397,7 +397,7 @@ sal_Bool SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPo if( ppPara ) { - (*pIdx)++; + ++(*pIdx); pTxtNd = pIdx->GetNode().GetTxtNode(); } bRet = sal_True; diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 2abc9304ec2e..9364a1ce670e 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1657,7 +1657,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) } pAktTxtNd->SetAttrListLevel(nLvl); - pAktTxtNd->SetNumLSpace( sal_True ); + pAktTxtNd->SetNumLSpace( true ); // start new list pDoc->SetNumRule( aDelPam, aRule, true ); diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx index 56dfdffcf1e7..5f66a04ecad9 100644 --- a/sw/source/core/edit/edatmisc.cxx +++ b/sw/source/core/edit/edatmisc.cxx @@ -56,7 +56,7 @@ void SwEditShell::ResetAttr( const std::set<sal_uInt16> &attrs, SwPaM* pPaM ) SwPaM* pStartCrsr = pCrsr; do { - GetDoc()->ResetAttrs(*pCrsr, sal_True, attrs); + GetDoc()->ResetAttrs(*pCrsr, true, attrs); } while ( ( pCrsr = ( SwPaM* ) pCrsr->GetNext() ) != pStartCrsr ); if( bUndoGroup ) diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 71f7127eb438..14206cd8fdf1 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -377,15 +377,15 @@ sal_uInt16 SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes ) // Adjust left margin via object bar (similar to adjustment of numerations). -sal_Bool SwEditShell::IsMoveLeftMargin( sal_Bool bRight, sal_Bool bModulus ) const +bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const { - sal_Bool bRet = sal_True; + bool bRet = true; const SvxTabStopItem& rTabItem = (SvxTabStopItem&)GetDoc()-> GetDefault( RES_PARATR_TABSTOP ); sal_uInt16 nDefDist = static_cast<sal_uInt16>(rTabItem.Count() ? rTabItem[0].GetTabPos() : 1134); if( !nDefDist ) - return sal_False; + return false; FOREACHPAM_START(this) @@ -415,7 +415,7 @@ sal_Bool SwEditShell::IsMoveLeftMargin( sal_Bool bRight, sal_Bool bModulus ) con bRet = nFrmWidth > ( nNext + MM50 ); } else - bRet = sal_False; + bRet = false; } } @@ -426,7 +426,7 @@ sal_Bool SwEditShell::IsMoveLeftMargin( sal_Bool bRight, sal_Bool bModulus ) con return bRet; } -void SwEditShell::MoveLeftMargin( sal_Bool bRight, sal_Bool bModulus ) +void SwEditShell::MoveLeftMargin( bool bRight, bool bModulus ) { StartAllAction(); StartUndo( UNDO_START ); @@ -583,7 +583,7 @@ sal_uInt16 SwEditShell::GetScriptType() const { sal_uLong nEndIdx = pEnd->nNode.GetIndex(); SwNodeIndex aIdx( pStt->nNode ); - for( ; aIdx.GetIndex() <= nEndIdx; aIdx++ ) + for( ; aIdx.GetIndex() <= nEndIdx; ++aIdx ) if( aIdx.GetNode().IsTxtNode() ) { const SwTxtNode* pTNd = aIdx.GetNode().GetTxtNode(); diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx index 38ba4be3720e..e47e68ffe4cc 100644 --- a/sw/source/core/edit/edfmt.cxx +++ b/sw/source/core/edit/edfmt.cxx @@ -123,12 +123,12 @@ void SwEditShell::FillByEx(SwCharFmt* pCharFmt, sal_Bool bReset) } // Frm -sal_uInt16 SwEditShell::GetTblFrmFmtCount(sal_Bool bUsed) const +sal_uInt16 SwEditShell::GetTblFrmFmtCount(bool bUsed) const { return GetDoc()->GetTblFrmFmtCount(bUsed); } -SwFrmFmt& SwEditShell::GetTblFrmFmt(sal_uInt16 nFmt, sal_Bool bUsed ) const +SwFrmFmt& SwEditShell::GetTblFrmFmt(sal_uInt16 nFmt, bool bUsed ) const { return GetDoc()->GetTblFrmFmt(nFmt, bUsed ); } diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx index 57af9c83a4bb..7881d5d113ff 100644 --- a/sw/source/core/edit/edglbldc.cxx +++ b/sw/source/core/edit/edglbldc.cxx @@ -295,14 +295,14 @@ sal_Bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr , case GLBLDOC_TOXBASE: { SwTOXBaseSection* pTOX = (SwTOXBaseSection*)rDelPos.GetTOX(); - pMyDoc->DeleteTOX( *pTOX, sal_True ); + pMyDoc->DeleteTOX( *pTOX, true ); } break; case GLBLDOC_SECTION: { SwSectionFmt* pSectFmt = (SwSectionFmt*)rDelPos.GetSection()->GetFmt(); - pMyDoc->DelSectionFmt( pSectFmt, sal_True ); + pMyDoc->DelSectionFmt( pSectFmt, true ); } break; } diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index 50f479fe68d1..3f66b05eab40 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -266,7 +266,7 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) // die gemerkte Node-Position wieder auf den richtigen Node if( bRet && pSttNd ) - (*pSttNd)++; + ++(*pSttNd); return bRet; diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 3ef955c1dcd2..9199073aea5f 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -440,7 +440,7 @@ sal_Bool SwEditShell::HasOLEObj( const String &rName ) const SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) { - aIdx++; + ++aIdx; SwNode& rNd = aIdx.GetNode(); if( rNd.IsOLENode() && rName == ((SwOLENode&)rNd).GetChartTblName() && @@ -812,12 +812,12 @@ sal_Bool SwEditShell::DelINetAttrWithText() // setzen an den Textzeichenattributen das DontExpand-Flag -sal_Bool SwEditShell::DontExpandFmt() +bool SwEditShell::DontExpandFmt() { - sal_Bool bRet = sal_False; + bool bRet = false; if( !IsTableMode() && GetDoc()->DontExpandFmt( *GetCrsr()->GetPoint() )) { - bRet = sal_True; + bRet = true; CallChgLnk(); } return bRet; @@ -1126,7 +1126,7 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData ) void SwEditShell::TransliterateText( sal_uInt32 nType ) { - utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType ); + utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), nType ); StartAllAction(); SET_CURR_SHELL( this ); diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index f986e756735c..9c9c3709d327 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1820,7 +1820,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, bool bField = false; //read the character at the current position to check if it's a field - xub_Unicode cChar = pTxtNode->GetTxt().GetChar( pCrsr->GetMark()->nContent.GetIndex() ); + sal_Unicode cChar = pTxtNode->GetTxt().GetChar( pCrsr->GetMark()->nContent.GetIndex() ); if( CH_TXTATR_BREAKWORD == cChar || CH_TXTATR_INWORD == cChar) { const SwTxtAttr* pTxtAttr = pTxtNode->GetTxtAttrForCharAt( diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 2597538e9a39..1f0294ef7580 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -144,9 +144,9 @@ const SwNumRule* SwEditShell::GetOutlineNumRule() const // Absaetze ohne Numerierung, aber mit Einzuegen -sal_Bool SwEditShell::NoNum() +bool SwEditShell::NoNum() { - sal_Bool bRet = sal_True; + bool bRet = true; StartAllAction(); SwPaM* pCrsr = GetCrsr(); @@ -241,11 +241,11 @@ void SwEditShell::DelNumRules() // Hoch-/Runterstufen -sal_Bool SwEditShell::NumUpDown( sal_Bool bDown ) +bool SwEditShell::NumUpDown( bool bDown ) { StartAllAction(); - sal_Bool bRet = sal_True; + bool bRet = true; SwPaM* pCrsr = GetCrsr(); if( pCrsr->GetNext() == pCrsr ) // keine Mehrfachselektion ? bRet = GetDoc()->NumUpDown( *pCrsr, bDown ); @@ -270,9 +270,9 @@ sal_Bool SwEditShell::NumUpDown( sal_Bool bDown ) return bRet; } // -> #i23726# -sal_Bool SwEditShell::IsFirstOfNumRule() const +bool SwEditShell::IsFirstOfNumRule() const { - sal_Bool bResult = sal_False; + bool bResult = false; SwPaM * pCrsr = GetCrsr(); if (pCrsr->GetNext() == pCrsr) @@ -283,9 +283,9 @@ sal_Bool SwEditShell::IsFirstOfNumRule() const return bResult; } -sal_Bool SwEditShell::IsFirstOfNumRule(const SwPaM & rPaM) const +bool SwEditShell::IsFirstOfNumRule(const SwPaM & rPaM) const { - sal_Bool bResult = sal_False; + bool bResult = false; SwPosition aPos(*rPaM.GetPoint()); bResult = GetDoc()->IsFirstOfNumRule(aPos); @@ -354,7 +354,7 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos) } // <- #i23725# -sal_Bool SwEditShell::MoveParagraph( long nOffset ) +bool SwEditShell::MoveParagraph( long nOffset ) { StartAllAction(); @@ -366,7 +366,7 @@ sal_Bool SwEditShell::MoveParagraph( long nOffset ) pCrsr->DeleteMark(); } - sal_Bool bRet = GetDoc()->MoveParagraph( *pCrsr, nOffset ); + bool bRet = GetDoc()->MoveParagraph( *pCrsr, nOffset ); GetDoc()->SetModified(); EndAllAction(); @@ -393,11 +393,11 @@ void SwEditShell::GetCurrentOutlineLevels( sal_uInt8& rUpper, sal_uInt8& rLower aCrsr.SetMark(); if( pCrsr->HasMark() ) *aCrsr.GetPoint() = *pCrsr->End(); - GetDoc()->GotoNextNum( *aCrsr.GetPoint(), sal_False, + GetDoc()->GotoNextNum( *aCrsr.GetPoint(), false, &rUpper, &rLower ); } -sal_Bool SwEditShell::MoveNumParas( sal_Bool bUpperLower, sal_Bool bUpperLeft ) +bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) { StartAllAction(); @@ -411,7 +411,7 @@ sal_Bool SwEditShell::MoveNumParas( sal_Bool bUpperLower, sal_Bool bUpperLeft ) sal_Bool bRet = sal_False; sal_uInt8 nUpperLevel, nLowerLevel; - if( GetDoc()->GotoNextNum( *aCrsr.GetPoint(), sal_False, + if( GetDoc()->GotoNextNum( *aCrsr.GetPoint(), false, &nUpperLevel, &nLowerLevel )) { if( bUpperLower ) @@ -423,7 +423,7 @@ sal_Bool SwEditShell::MoveNumParas( sal_Bool bUpperLower, sal_Bool bUpperLeft ) if( bUpperLeft ) // verschiebe nach oben { SwPosition aPos( *aCrsr.GetMark() ); - if( GetDoc()->GotoPrevNum( aPos, sal_False ) ) + if( GetDoc()->GotoPrevNum( aPos, false ) ) nOffset = aPos.nNode.GetIndex() - aCrsr.GetMark()->nNode.GetIndex(); else @@ -490,11 +490,11 @@ sal_Bool SwEditShell::MoveNumParas( sal_Bool bUpperLower, sal_Bool bUpperLeft ) return bRet; } -sal_Bool SwEditShell::OutlineUpDown( short nOffset ) +bool SwEditShell::OutlineUpDown( short nOffset ) { StartAllAction(); - sal_Bool bRet = sal_True; + bool bRet = true; SwPaM* pCrsr = GetCrsr(); if( pCrsr->GetNext() == pCrsr ) // keine Mehrfachselektion ? bRet = GetDoc()->OutlineUpDown( *pCrsr, nOffset ); @@ -514,10 +514,10 @@ sal_Bool SwEditShell::OutlineUpDown( short nOffset ) } -sal_Bool SwEditShell::MoveOutlinePara( short nOffset ) +bool SwEditShell::MoveOutlinePara( short nOffset ) { StartAllAction(); - sal_Bool bRet = GetDoc()->MoveOutlinePara( *GetCrsr(), nOffset ); + bool bRet = GetDoc()->MoveOutlinePara( *GetCrsr(), nOffset ); EndAllAction(); return bRet; } @@ -597,9 +597,9 @@ sal_Bool SwEditShell::IsOutlineCopyable( sal_uInt16 nIdx ) const } -sal_Bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, sal_Bool bChkStart ) +bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, bool bChkStart ) { - sal_Bool bRet = sal_False; + bool bRet = false; SwPaM* pCrsr = GetCrsr(); if( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark() && ( !bChkStart || !pCrsr->GetPoint()->nContent.GetIndex()) ) @@ -680,7 +680,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, aRangeArr.SetPam( n, aPam ); GetDoc()->SetNumRule( aPam, rRule, bCreateNewList, sContinuedListId, - sal_True, bResetIndentAttrs ); + true, bResetIndentAttrs ); GetDoc()->SetCounted( aPam, true ); } } @@ -688,7 +688,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, { GetDoc()->SetNumRule( *pCrsr, rRule, bCreateNewList, sContinuedListId, - sal_True, bResetIndentAttrs ); + true, bResetIndentAttrs ); GetDoc()->SetCounted( *pCrsr, true ); } GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); @@ -696,7 +696,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, EndAllAction(); } -String SwEditShell::GetUniqueNumRuleName( const String* pChkStr, sal_Bool bAutoNum ) const +String SwEditShell::GetUniqueNumRuleName( const String* pChkStr, bool bAutoNum ) const { return GetDoc()->GetUniqueNumRuleName( pChkStr, bAutoNum ); } @@ -708,10 +708,10 @@ void SwEditShell::ChgNumRuleFmts( const SwNumRule& rRule ) EndAllAction(); } -sal_Bool SwEditShell::ReplaceNumRule( const String& rOldRule, const String& rNewRule ) +bool SwEditShell::ReplaceNumRule( const String& rOldRule, const String& rNewRule ) { StartAllAction(); - sal_Bool bRet = GetDoc()->ReplaceNumRule( *GetCrsr()->GetPoint(), rOldRule, rNewRule ); + bool bRet = GetDoc()->ReplaceNumRule( *GetCrsr()->GetPoint(), rOldRule, rNewRule ); EndAllAction(); return bRet; } diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx index cc6900500a03..07f11b4eb755 100644 --- a/sw/source/core/edit/edsect.cxx +++ b/sw/source/core/edit/edsect.cxx @@ -236,7 +236,7 @@ void SwEditShell::SetSectionAttr( const SfxItemSet& rSet, StartOfSectionNode()->GetSectionNode())) ) _SetSectionAttr( *pSttSectNd->GetSection().GetFmt(), rSet ); - aSIdx++; + ++aSIdx; } } } @@ -387,10 +387,10 @@ static const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos) if( rCurrentNode.IsCntntNode() && ( pCurrentPos->nContent.GetIndex() == rCurrentNode.GetCntntNode()->Len() ) ) - aEnd++; + ++aEnd; while( (aEnd != pInnermostNode->EndOfSectionNode()->GetIndex()) && aEnd.GetNode().IsEndNode() ) - aEnd++; + ++aEnd; bool bEnd = ( aEnd == pInnermostNode->EndOfSectionNode()->GetIndex() ); // evalutate result: if both start + end, end is preferred diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index fe8826a5b077..a0273d7a8b89 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -132,7 +132,7 @@ void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, sal_Bool bReadon UpdateSection( GetSectionFmtPos( *rTOXSect.GetFmt() ), aSectionData, 0 ); } -const SwTOXBase* SwEditShell::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate ) +const SwTOXBase* SwEditShell::GetDefaultTOXBase( TOXTypes eTyp, bool bCreate ) { return GetDoc()->GetDefaultTOXBase( eTyp, bCreate ); } @@ -157,7 +157,7 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) // Einfuegen des Verzeichnisses const SwTOXBaseSection* pTOX = pDoc->InsertTableOf( - *GetCrsr()->GetPoint(), rTOX, pSet, sal_True ); + *GetCrsr()->GetPoint(), rTOX, pSet, true ); OSL_ENSURE(pTOX, "Kein aktuelles Verzeichnis"); // Formatierung anstossen @@ -231,7 +231,7 @@ const SwTOXBase* SwEditShell::GetCurTOX() const return GetDoc()->GetCurTOX( *GetCrsr()->GetPoint() ); } -sal_Bool SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes ) +bool SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes ) { return GetDoc()->DeleteTOX( (SwTOXBase&)rTOXBase, bDelNodes ); } diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 311e59e930b4..bb488fa25221 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -27,7 +27,7 @@ ************************************************************************/ #include <hintids.hxx> - +#include <comphelper/string.hxx> #include <editeng/unolingu.hxx> #include <editeng/langitem.hxx> #include <swtypes.hxx> @@ -675,8 +675,9 @@ bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ ) if(!(rAny >>= aParam)) return false; - String sToSet; - sToSet.Fill(AUTH_FIELD_ISBN, TOX_STYLE_DELIMITER); + rtl::OUStringBuffer sBuf; + comphelper::string::padToLength(sBuf, AUTH_FIELD_ISBN, TOX_STYLE_DELIMITER); + String sToSet(sBuf.makeStringAndClear()); const PropertyValue* pParam = aParam.getConstArray(); for(sal_Int32 i = 0; i < aParam.getLength(); i++) { diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 181f474a1038..d3550fd200bf 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -118,7 +118,7 @@ SwPageNumberFieldType::SwPageNumberFieldType() nNumberingType( SVX_NUM_ARABIC ), nNum( 0 ), nMax( USHRT_MAX ), - bVirtuell( sal_False ) + bVirtuell( false ) { } @@ -162,7 +162,7 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt16 nPage, if( pNumFmt ) nNumberingType = *pNumFmt; - bVirtuell = sal_False; + bVirtuell = false; if( bVirt ) { // dann muss das Flag ueberprueft werden, denn das Layout setzt @@ -178,7 +178,7 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt16 nPage, if( pNd ) { if ( SwIterator<SwFrm,SwCntntNode>::FirstElement(*pNd) ) - bVirtuell = sal_True; + bVirtuell = true; } else if( pDesc->GetDefinedIn()->ISA( SwFmt )) { diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx index d8cd5356ab61..08140f7b9ac4 100644 --- a/sw/source/core/fields/macrofld.cxx +++ b/sw/source/core/fields/macrofld.cxx @@ -32,7 +32,7 @@ #include <docufld.hxx> #include <unofldmid.h> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/uri/XUriReferenceFactory.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp> #include <comphelper/processfactory.hxx> @@ -235,23 +235,18 @@ void SwMacroField::CreateMacroString( sal_Bool SwMacroField::isScriptURL( const String& str ) { - uno::Reference< lang::XMultiServiceFactory > xSMgr = - ::comphelper::getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = + ::comphelper::getProcessComponentContext(); uno::Reference< uri::XUriReferenceFactory > - xFactory( xSMgr->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.uri.UriReferenceFactory")) ), uno::UNO_QUERY ); + xFactory = uri::UriReferenceFactory::create( xContext ); - if ( xFactory.is() ) - { - uno::Reference< uri::XVndSunStarScriptUrl > - xUrl( xFactory->parse( str ), uno::UNO_QUERY ); + uno::Reference< uri::XVndSunStarScriptUrl > + xUrl( xFactory->parse( str ), uno::UNO_QUERY ); - if ( xUrl.is() ) - { - return sal_True; - } + if ( xUrl.is() ) + { + return sal_True; } return sal_False; } diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index e811cfd42417..485a72411b5d 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -101,7 +101,7 @@ static void lcl_GetLayTree( const SwFrm* pFrm, std::vector<const SwFrm*>& rArr ) } -sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, +bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, const SwTxtNode& rBehindNd, sal_uInt16 nSttPos ) { const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.getLayoutFrm( rMyNd.GetDoc()->GetCurrentLayout(), 0,0,sal_False), @@ -113,7 +113,7 @@ sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, pMyFrm = (SwTxtFrm*)pMyFrm->GetFollow(); if( !pFrm || !pMyFrm || pFrm == pMyFrm ) - return sal_False; + return false; std::vector<const SwFrm*> aRefArr, aArr; ::lcl_GetLayTree( pFrm, aRefArr ); @@ -145,7 +145,7 @@ sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos, const SwFrm* pFldFrm = aArr[ nCnt ]; // unterschiedliche Frames, dann ueberpruefe deren Y-/X-Position - sal_Bool bRefIsLower = sal_False; + bool bRefIsLower = false; if( ( FRM_COLUMN | FRM_CELL ) & pFldFrm->GetType() || ( FRM_COLUMN | FRM_CELL ) & pRefFrm->GetType() ) { diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index d3326a987d23..5a7ea52e1915 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1,30 +1,21 @@ /* -*- 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. +/* + * This file is part of the LibreOffice project. * - * 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). + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * 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. + * This file incorporates work covered by the following license notice: * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ #include <hintids.hxx> @@ -201,7 +192,7 @@ sal_Bool SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt ) aSet.Put( aAnchor ); SdrObject *const pNew = - pClpDoc->CloneSdrObj( *pObj, sal_False, sal_True ); + pClpDoc->CloneSdrObj( *pObj, false, true ); SwPaM aTemp(aPos); pClpDoc->Insert(aTemp, *pNew, &aSet, NULL); @@ -325,7 +316,7 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, { SdrObject* pNew = pDestDoc->CloneSdrObj( *pObj, bIsMove && - GetDoc() == pDestDoc, sal_False ); + GetDoc() == pDestDoc, false ); pNew->NbcMove( aSiz ); pDestDrwView->InsertObjectAtView( pNew, *pDestPgView ); bInsWithFmt = sal_False; @@ -387,7 +378,7 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, SfxItemSet aSet( pDestDoc->GetAttrPool(),aFrmFmtSetRange); aSet.Put( aAnchor ); SdrObject* pNew = pDestDoc->CloneSdrObj( *pObj, bIsMove && - GetDoc() == pDestDoc, sal_True ); + GetDoc() == pDestDoc, true ); pFmt = pDestDoc->Insert( *pDestShell->GetCrsr(), *pNew, &aSet, NULL ); } @@ -818,7 +809,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames ) aIndexBefore--; pClpDoc->CopyRange( rCopy, rInsPos, false ); { - aIndexBefore++; + ++aIndexBefore; SwPaM aPaM(SwPosition(aIndexBefore), SwPosition(rInsPos.nNode)); aPaM.GetDoc()->MakeUniqueNumRules(aPaM); @@ -913,7 +904,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames ) if( pSdrObj ) { SdrObject* pNew = GetDoc()->CloneSdrObj( *pSdrObj, - sal_False, sal_False ); + false, false ); // Insert object sets any anchor position to 0. // Therefore we calculate the absolute position here @@ -1050,7 +1041,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames ) pClpDoc->CopyRange( aCpyPam, rInsPos, false ); { - aIndexBefore++; + ++aIndexBefore; SwPaM aPaM(SwPosition(aIndexBefore), SwPosition(rInsPos.nNode)); @@ -1294,9 +1285,9 @@ sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const } } else if( SOT_FORMAT_GDIMETAFILE == nFmt ) - rGrf = Imp()->GetDrawView()->GetAllMarkedMetaFile(); + rGrf = Imp()->GetDrawView()->GetMarkedObjMetaFile(); else if( SOT_FORMAT_BITMAP == nFmt ) - rGrf = Imp()->GetDrawView()->GetAllMarkedBitmap(); + rGrf = Imp()->GetDrawView()->GetMarkedObjBitmapEx(); } return bConvert; } diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index a6e73a1518de..c57ddf0348a2 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -752,7 +752,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali /* If called from a shell try to propagate an existing adjust item from rPos to the content node of the new frame. */ - pRet = GetDoc()->MakeFlySection( eRndId, &rPos, &rSet, pParent, sal_True ); + pRet = GetDoc()->MakeFlySection( eRndId, &rPos, &rSet, pParent, true ); if( pRet ) { @@ -1071,10 +1071,10 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const #* Description : Attributes of the current fly will change. #***********************************************************************/ -sal_Bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet ) +bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet ) { SET_CURR_SHELL( this ); - sal_Bool bRet = sal_False; + bool bRet = false; if( rSet.Count() ) { @@ -1096,7 +1096,7 @@ sal_Bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet ) if( GetDoc()->SetFlyFrmAttr( *pFlyFmt, rSet )) { - bRet = sal_True; + bRet = true; SwFlyFrm* pFrm = pFlyFmt->GetFrm( &aPt ); if( pFrm ) SelectFlyFrm( *pFrm, sal_True ); @@ -1222,7 +1222,7 @@ SwFrmFmt* SwFEShell::GetCurFrmFmt() const * Description : ******************************************************************************/ -void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocPos ) +void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, bool bKeepOrient, Point* pDocPos ) { SwFlyFrm *pFly = 0; if(pDocPos) diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index e12430a324ee..84f8d9a2a64c 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -690,7 +690,7 @@ long SwFEShell::EndDrag( const Point *, sal_Bool ) // DrawUndo on to flyframes are not stored // The flys change the flag. GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true); - ChgAnchor( 0, sal_True ); + ChgAnchor( 0, true ); EndUndo( UNDO_END ); @@ -1634,7 +1634,7 @@ sal_Bool SwFEShell::ImpEndCreate() // default for controls character bound, otherwise paragraph bound. SwFmtAnchor aAnch; const SwFrm *pAnch = 0; - sal_Bool bCharBound = sal_False; + bool bCharBound = false; if( rSdrObj.ISA( SdrUnoObj ) ) { SwPosition aPos( GetDoc()->GetNodes() ); @@ -1650,7 +1650,7 @@ sal_Bool SwFEShell::ImpEndCreate() pAnch->GetCharRect( aTmp, aPos ); // The crsr should not be too far away - bCharBound = sal_True; + bCharBound = true; Rectangle aRect( aTmp.SVRect() ); aRect.Left() -= MM50*2; aRect.Top() -= MM50*2; @@ -1658,7 +1658,7 @@ sal_Bool SwFEShell::ImpEndCreate() aRect.Bottom()+= MM50*2; if( !aRect.IsOver( rBound ) && !::GetHtmlMode( GetDoc()->GetDocShell() )) - bCharBound = sal_False; + bCharBound = false; // anchor in header/footer also not allowed. if( bCharBound ) @@ -2115,7 +2115,7 @@ short SwFEShell::GetAnchorId() const |* *************************************************************************/ -void SwFEShell::ChgAnchor( int eAnchorId, sal_Bool bSameOnly, sal_Bool bPosCorr ) +void SwFEShell::ChgAnchor( int eAnchorId, bool bSameOnly, bool bPosCorr ) { OSL_ENSURE( Imp()->HasDrawView(), "ChgAnchor without DrawView?" ); const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 4c2e798c484f..256543669cb3 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -575,7 +575,7 @@ sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt) } // call sorting on document - bRet = pDoc->SortTbl(aBoxes, rOpt); + bRet = pDoc->SortTbl(aBoxes, rOpt) ? sal_True : sal_False; } else { @@ -592,7 +592,7 @@ sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt) xub_StrLen nCntStt = pStart->nContent.GetIndex(); // Sorting - bRet = pDoc->SortText(*pPam, rOpt); + bRet = pDoc->SortText(*pPam, rOpt) ? sal_True : sal_False; // put selection again pPam->DeleteMark(); diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index abc8aad73147..43e38e02a15e 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -1380,7 +1380,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, pDoc->GetIDocumentUndoRedo().DoUndo(bUndo); } SwNodeRange aRg( aSttNdIdx, aPam.GetPoint()->nNode ); - rInsPosNd++; + ++rInsPosNd; if( pUndo ) pUndo->MoveBoxCntnt( pDoc, aRg, rInsPosNd ); else diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 20bbfe202a2e..31c3debd4ec9 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ #include <hintids.hxx> #include <tools/helpers.hxx> @@ -73,6 +64,8 @@ SwGrfNode::SwGrfNode( SwGrfFmtColl *pGrfColl, SwAttrSet* pAutoAttr ) : SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ), + aGrfObj(), + mpReplacementGraphic(0), // #i73788# mbLinkedInputStreamReady( false ), mbIsStreamReadOnly( sal_False ) @@ -89,6 +82,8 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, const GraphicObject& rGrfObj, SwGrfFmtColl *pGrfColl, SwAttrSet* pAutoAttr ) : SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ), + aGrfObj(), + mpReplacementGraphic(0), // #i73788# mbLinkedInputStreamReady( false ), mbIsStreamReadOnly( sal_False ) @@ -111,6 +106,8 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, SwGrfFmtColl *pGrfColl, SwAttrSet* pAutoAttr ) : SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ), + aGrfObj(), + mpReplacementGraphic(0), // #i73788# mbLinkedInputStreamReady( false ), mbIsStreamReadOnly( sal_False ) @@ -143,6 +140,8 @@ sal_Bool SwGrfNode::ReRead( sal_Bool bNewGrf ) { sal_Bool bReadGrf = sal_False, bSetTwipSize = sal_True; + delete mpReplacementGraphic; + mpReplacementGraphic = 0; OSL_ENSURE( pGraphic || pGrfObj || rGrfName.Len(), "GraphicNode without a name, Graphic or GraphicObject" ); @@ -307,6 +306,9 @@ sal_Bool SwGrfNode::ReRead( SwGrfNode::~SwGrfNode() { + delete mpReplacementGraphic; + mpReplacementGraphic = 0; + // #i73788# mpThreadConsumer.reset(); @@ -338,6 +340,21 @@ SwGrfNode::~SwGrfNode() } +const GraphicObject* SwGrfNode::GetReplacementGrfObj() const +{ + if(!mpReplacementGraphic) + { + const SvgDataPtr& rSvgDataPtr = GetGrfObj().GetGraphic().getSvgData(); + + if(rSvgDataPtr.get()) + { + const_cast< SwGrfNode* >(this)->mpReplacementGraphic = new GraphicObject(rSvgDataPtr->getReplacement()); + } + } + + return mpReplacementGraphic; +} + SwCntntNode *SwGrfNode::SplitCntntNode( const SwPosition & ) { return this; @@ -379,16 +396,18 @@ Size SwGrfNode::GetTwipSize() const return nGrfSize; } - - sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm ) { Graphic aGraphic; - const String aGraphicURL( aGrfObj.GetUserData() ); - if( !GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, aGraphicURL, rStrm ) ) + const String aURL(aGrfObj.GetUserData()); + + if(!GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aURL, rStrm)) { + delete mpReplacementGraphic; + mpReplacementGraphic = 0; + aGrfObj.SetGraphic( aGraphic ); - aGrfObj.SetUserData( aGraphicURL ); + aGrfObj.SetUserData( aURL ); return sal_True; } @@ -421,6 +440,9 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData ) else if( GRAPHIC_DEFAULT == aGrfObj.GetType() ) { // keine default Bitmap mehr, also neu Painten! + delete mpReplacementGraphic; + mpReplacementGraphic = 0; + aGrfObj.SetGraphic( Graphic() ); SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED ); ModifyNotification( &aMsgHint, &aMsgHint ); @@ -507,9 +529,9 @@ short SwGrfNode::SwapOut() } -sal_Bool SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const +bool SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const { - sal_Bool bRet = sal_False; + bool bRet = false; if( refLink.Is() && refLink->GetLinkManager() ) { sal_uInt16 nType = refLink->GetObjType(); @@ -526,7 +548,7 @@ sal_Bool SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const ( *pFileNm += sTopic ) += sfx2::cTokenSeperator; *pFileNm += sItem; pFilterNm->AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DDE" )); - bRet = sal_True; + bRet = true; } } } @@ -876,15 +898,15 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const SvStream* pStrm = _GetStreamForEmbedGrf( refPics, aStrmName ); if ( pStrm ) { - const String aGraphicURL( aGrfObj.GetUserData() ); - GraphicFilter::GetGraphicFilter().ImportGraphic( aTmpGrf, aGraphicURL, *pStrm ); + const String aURL(aGrfObj.GetUserData()); + GraphicFilter::GetGraphicFilter().ImportGraphic(aTmpGrf, aURL, *pStrm); delete pStrm; } } catch (const uno::Exception& e) { // #i48434# - SAL_WARN("sw", "<SwGrfNode::MakeCopy(..)> - unhandled exception!" << e.Message); + SAL_WARN("sw.core", "<SwGrfNode::MakeCopy(..)> - unhandled exception!" << e.Message); } } else diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx index a380c9d879bb..b2614d528737 100644 --- a/sw/source/core/inc/UndoAttribute.hxx +++ b/sw/source/core/inc/UndoAttribute.hxx @@ -200,7 +200,7 @@ class SwUndoMoveLeftMargin : public SwUndo, private SwUndRng const bool m_bModulus; public: - SwUndoMoveLeftMargin( const SwPaM&, sal_Bool bRight, sal_Bool bModulus ); + SwUndoMoveLeftMargin( const SwPaM&, sal_Bool bRight, bool bModulus ); virtual ~SwUndoMoveLeftMargin(); diff --git a/sw/source/core/inc/UndoNumbering.hxx b/sw/source/core/inc/UndoNumbering.hxx index 58a1169a748d..c3a2ef6f67d0 100644 --- a/sw/source/core/inc/UndoNumbering.hxx +++ b/sw/source/core/inc/UndoNumbering.hxx @@ -97,7 +97,7 @@ class SwUndoMoveNum : public SwUndo, private SwUndRng long nOffset; public: - SwUndoMoveNum( const SwPaM& rPam, long nOffset, sal_Bool bIsOutlMv = sal_False ); + SwUndoMoveNum( const SwPaM& rPam, long nOffset, bool bIsOutlMv = false ); virtual void UndoImpl( ::sw::UndoRedoContext & ); virtual void RedoImpl( ::sw::UndoRedoContext & ); diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx index e0a99a8a13b5..cc16adbba283 100644 --- a/sw/source/core/inc/UndoSort.hxx +++ b/sw/source/core/inc/UndoSort.hxx @@ -77,7 +77,7 @@ class SwUndoSort : public SwUndo, private SwUndRng public: SwUndoSort( const SwPaM&, const SwSortOptions& ); SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode&, - const SwSortOptions&, sal_Bool bSaveTable ); + const SwSortOptions&, bool bSaveTable ); virtual ~SwUndoSort(); diff --git a/sw/source/core/inc/docfld.hxx b/sw/source/core/inc/docfld.hxx index ee8ede68e611..4ded5ccda92a 100644 --- a/sw/source/core/inc/docfld.hxx +++ b/sw/source/core/inc/docfld.hxx @@ -156,8 +156,8 @@ class SwDocUpdtFld sal_uLong nNodes; // if the node count is different sal_uInt8 nFldLstGetMode; - sal_Bool bInUpdateFlds : 1; // currently there is an UpdateFlds - sal_Bool bFldsDirty : 1; // some fields are invalid + bool bInUpdateFlds : 1; // currently there is an UpdateFlds + bool bFldsDirty : 1; // some fields are invalid void _MakeFldList( SwDoc& pDoc, int eGetMode ); void GetBodyNode( const SwTxtFld& , sal_uInt16 nFldWhich ); @@ -171,16 +171,16 @@ public: void MakeFldList( SwDoc& rDoc, int bAll, int eGetMode ); - void InsDelFldInFldLst( sal_Bool bIns, const SwTxtFld& rFld ); + void InsDelFldInFldLst( bool bIns, const SwTxtFld& rFld ); void InsertFldType( const SwFieldType& rType ); void RemoveFldType( const SwFieldType& rType ); - sal_Bool IsInUpdateFlds() const { return bInUpdateFlds; } - void SetInUpdateFlds( sal_Bool b ) { bInUpdateFlds = b; } + bool IsInUpdateFlds() const { return bInUpdateFlds; } + void SetInUpdateFlds( bool b ) { bInUpdateFlds = b; } - sal_Bool IsFieldsDirty() const { return bFldsDirty; } - void SetFieldsDirty( sal_Bool b ) { bFldsDirty = b; } + bool IsFieldsDirty() const { return bFldsDirty; } + void SetFieldsDirty( bool b ) { bFldsDirty = b; } SwHash** GetFldTypeTable() const { return (SwHash**)aFldTypeTable; } }; diff --git a/sw/source/core/inc/docsort.hxx b/sw/source/core/inc/docsort.hxx index 7236e0edb492..130c128076c7 100644 --- a/sw/source/core/inc/docsort.hxx +++ b/sw/source/core/inc/docsort.hxx @@ -65,7 +65,7 @@ void MoveCol(SwDoc* pDoc, const FlatFndBox& rBox, void MoveRow(SwDoc* pDoc, const FlatFndBox& rBox, sal_uInt16 nS, sal_uInt16 nT, SwMovedBoxes& rMovedList, SwUndoSort* pUD=0); void MoveCell(SwDoc* pDoc, const SwTableBox* pSource, - const SwTableBox* pTar, sal_Bool bMovedBefore, SwUndoSort* pUD=0); + const SwTableBox* pTar, bool bMovedBefore, SwUndoSort* pUD=0); // Elements for sorting text and table content struct SwSortElement @@ -86,8 +86,8 @@ struct SwSortElement virtual String GetKey(sal_uInt16 nKey ) const = 0; virtual double GetValue(sal_uInt16 nKey ) const; - sal_Bool operator==(const SwSortElement& ) const; - sal_Bool operator<(const SwSortElement& ) const; + bool operator==(const SwSortElement& ) const; + bool operator<(const SwSortElement& ) const; double StrToDouble(const String& rStr) const; private: @@ -125,21 +125,21 @@ public: FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox); ~FlatFndBox(); - sal_Bool IsSymmetric() const { return bSym; } + bool IsSymmetric() const { return bSym; } sal_uInt16 GetRows() const { return nRows; } sal_uInt16 GetCols() const { return nCols; } const _FndBox* GetBox(sal_uInt16 nCol, sal_uInt16 nRow) const; - inline sal_Bool HasItemSets() const; + inline bool HasItemSets() const; const SfxItemSet* GetItemSet(sal_uInt16 nCol, sal_uInt16 nRow) const; private: - sal_Bool CheckLineSymmetry(const _FndBox& rBox); - sal_Bool CheckBoxSymmetry(const _FndLine& rLn); + bool CheckLineSymmetry(const _FndBox& rBox); + bool CheckBoxSymmetry(const _FndLine& rLn); sal_uInt16 GetColCount(const _FndBox& rBox); sal_uInt16 GetRowCount(const _FndBox& rBox); - void FillFlat(const _FndBox&, sal_Bool bLastBox=sal_False); + void FillFlat(const _FndBox&, bool bLastBox=false); SwDoc* pDoc; const _FndBox& rBoxRef; @@ -151,10 +151,10 @@ private: sal_uInt16 nRow; sal_uInt16 nCol; - sal_Bool bSym; + bool bSym; }; -inline sal_Bool FlatFndBox::HasItemSets() const { return 0 != ppItemSets; } +inline bool FlatFndBox::HasItemSets() const { return 0 != ppItemSets; } #endif diff --git a/sw/source/core/inc/doctxm.hxx b/sw/source/core/inc/doctxm.hxx index 676743053bf1..e70dc893e3c3 100644 --- a/sw/source/core/inc/doctxm.hxx +++ b/sw/source/core/inc/doctxm.hxx @@ -95,7 +95,7 @@ public: void UpdatePageNum(); // insert page numbering TYPEINFO(); // for rtti - sal_Bool SetPosAtStartEnd( SwPosition& rPos, sal_Bool bAtStart = sal_True ) const; + bool SetPosAtStartEnd( SwPosition& rPos, bool bAtStart = true ) const; }; struct SwDefTOXBase_Impl diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index 5373eb3119f8..d3f62a6dc7f7 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -162,7 +162,7 @@ public: virtual ~SwFlyFrm(); // get client information - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const; virtual Size ChgSize( const Size& aNewSize ); diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index 9c5656612e02..0f1050d1d62e 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -93,7 +93,7 @@ void _SaveCntntIdx( SwDoc* pDoc, sal_uLong nNode, xub_StrLen nCntnt, std::vector<sal_uLong>& rSaveArr, sal_uInt8 nSaveFly = 0 ); void _RestoreCntntIdx( SwDoc* pDoc, std::vector<sal_uLong>& rSaveArr, sal_uLong nNode, xub_StrLen nOffset = 0, - sal_Bool bAuto = sal_False ); + bool bAuto = false ); void _RestoreCntntIdx( std::vector<sal_uLong>& rSaveArr, const SwNode& rNd, xub_StrLen nLen, xub_StrLen nCorrLen ); @@ -104,9 +104,9 @@ struct _SaveFly { sal_uLong nNdDiff; /// relative node difference SwFrmFmt* pFrmFmt; /// the fly's frame format - sal_Bool bInsertPosition; /// if true, anchor _at_ insert position + bool bInsertPosition; /// if true, anchor _at_ insert position - _SaveFly( sal_uLong nNodeDiff, SwFrmFmt* pFmt, sal_Bool bInsert ) + _SaveFly( sal_uLong nNodeDiff, SwFrmFmt* pFmt, bool bInsert ) : nNdDiff( nNodeDiff ), pFrmFmt( pFmt ), bInsertPosition( bInsert ) { } }; diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx index db8e158e9051..cc680df185a7 100644 --- a/sw/source/core/inc/notxtfrm.hxx +++ b/sw/source/core/inc/notxtfrm.hxx @@ -63,7 +63,7 @@ public: SwCrsrMoveState* = 0) const; const Size &GetGrfSize() const { return GetSize(); } - void GetGrfArea( SwRect &rRect, SwRect * = 0, sal_Bool bMirror = sal_True ) const; + void GetGrfArea( SwRect &rRect, SwRect * = 0, bool bMirror = true ) const; sal_Bool IsTransparent() const; diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx index ea2ee13e4d69..271e161a88e7 100644 --- a/sw/source/core/inc/pagefrm.hxx +++ b/sw/source/core/inc/pagefrm.hxx @@ -182,7 +182,7 @@ public: virtual sal_Bool GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const; // erfrage vom Client Informationen - virtual sal_Bool GetInfo( SfxPoolItem& ) const; + virtual bool GetInfo( SfxPoolItem& ) const; virtual void Cut(); virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ); diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index bd7242195425..fafdb0c762ff 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -163,7 +163,7 @@ public: void AllInvalidateAutoCompleteWords() const;//swmod 080305 void AllAddPaintRect() const; void AllRemoveFtns() ;//swmod 080305 - void AllInvalidateSmartTagsOrSpelling(sal_Bool bSmartTags) const;//swmod 080307 + void AllInvalidateSmartTagsOrSpelling(bool bSmartTags) const;//swmod 080307 //Virtuelles Device ausgeben (z.B. wenn Animationen ins Spiel kommen) static sal_Bool FlushVout(); //Clipping sparen, wenn im Vout eh genau das Cliprechteck ausgegeben wird diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx index df22ffaf372b..20398b49c1f5 100644 --- a/sw/source/core/inc/scriptinfo.hxx +++ b/sw/source/core/inc/scriptinfo.hxx @@ -202,7 +202,7 @@ public: */ static sal_uInt16 MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText, const xub_StrLen nStt, const xub_StrLen nEnd, - const xub_Unicode cChar ); + const sal_Unicode cChar ); /** Hidden text attribute handling diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 4bcb98f3f7dd..8379a35590c0 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -43,11 +43,11 @@ class SwScriptInfo; // _GetTxtSize class ViewShell; class IDocumentSettingAccess; -const xub_Unicode CH_BLANK = ' '; // ' ' Leerzeichen -const xub_Unicode CH_BREAK = 0x0A; // -const xub_Unicode CH_TAB = '\t'; // \t -const xub_Unicode CH_PAR = 0xB6; // Paragraph -const xub_Unicode CH_BULLET = 0xB7; // mittiger Punkt +const sal_Unicode CH_BLANK = ' '; // ' ' Leerzeichen +const sal_Unicode CH_BREAK = 0x0A; // +const sal_Unicode CH_TAB = '\t'; // \t +const sal_Unicode CH_PAR = 0xB6; // Paragraph +const sal_Unicode CH_BULLET = 0xB7; // mittiger Punkt class SwSubFont : public SvxFont { diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx index 18066808f540..47f33216812d 100644 --- a/sw/source/core/inc/tabfrm.hxx +++ b/sw/source/core/inc/tabfrm.hxx @@ -127,7 +127,7 @@ public: inline SwTabFrm *GetFollow(); SwTabFrm* FindMaster( bool bFirstMaster = false ) const; - virtual sal_Bool GetInfo( SfxPoolItem &rHnt ) const; + virtual bool GetInfo( SfxPoolItem &rHnt ) const; virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const; virtual void CheckDirection( sal_Bool bVert ); diff --git a/sw/source/core/inc/tblrwcl.hxx b/sw/source/core/inc/tblrwcl.hxx index e50098d31879..16f415cbcee5 100644 --- a/sw/source/core/inc/tblrwcl.hxx +++ b/sw/source/core/inc/tblrwcl.hxx @@ -139,18 +139,18 @@ struct _SwGCLineBorder class _SwGCBorder_BoxBrd { const editeng::SvxBorderLine* pBrdLn; - sal_Bool bAnyBorderFnd; + bool bAnyBorderFnd; public: - _SwGCBorder_BoxBrd() : pBrdLn( 0 ), bAnyBorderFnd( sal_False ) {} + _SwGCBorder_BoxBrd() : pBrdLn( 0 ), bAnyBorderFnd( false ) {} void SetBorder( const editeng::SvxBorderLine& rBorderLine ) - { pBrdLn = &rBorderLine; bAnyBorderFnd = sal_False; } + { pBrdLn = &rBorderLine; bAnyBorderFnd = false; } // checke, ob die linke Border dieselbe wie die gesetzte ist - // returnt sal_False falls gar keine Border gesetzt ist - sal_Bool CheckLeftBorderOfFormat( const SwFrmFmt& rFmt ); + // returnt false falls gar keine Border gesetzt ist + bool CheckLeftBorderOfFormat( const SwFrmFmt& rFmt ); - sal_Bool IsAnyBorderFound() const { return bAnyBorderFnd; } + bool IsAnyBorderFound() const { return bAnyBorderFnd; } }; void sw_GC_Line_Border( const SwTableLine* pLine, _SwGCLineBorder* pGCPara ); diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx index e707741cadec..a3a9ee9f3b43 100644 --- a/sw/source/core/inc/txmsrt.hxx +++ b/sw/source/core/inc/txmsrt.hxx @@ -87,7 +87,7 @@ public: const String& rTxt2, const String& rTxtReading2, const ::com::sun::star::lang::Locale& rLocale2 ) const; - inline sal_Bool IsEqual( const String& rTxt1, const String& rTxtReading1, + inline bool IsEqual( const String& rTxt1, const String& rTxtReading1, const ::com::sun::star::lang::Locale& rLocale1, const String& rTxt2, const String& rTxtReading2, const ::com::sun::star::lang::Locale& rLocale2 ) const @@ -96,7 +96,7 @@ public: rTxt2, rTxtReading2, rLocale2 ); } - inline sal_Bool IsLess( const String& rTxt1, const String& rTxtReading1, + inline bool IsLess( const String& rTxt1, const String& rTxtReading1, const ::com::sun::star::lang::Locale& rLocale1, const String& rTxt2, const String& rTxtReading2, const ::com::sun::star::lang::Locale& rLocale2 ) const @@ -142,8 +142,8 @@ struct SwTOXSortTabBase virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField = 0) const; virtual sal_uInt16 GetLevel() const = 0; - virtual sal_Bool operator==( const SwTOXSortTabBase& ); - virtual sal_Bool operator<( const SwTOXSortTabBase& ); + virtual bool operator==( const SwTOXSortTabBase& ); + virtual bool operator<( const SwTOXSortTabBase& ); virtual String GetURL() const; @@ -191,8 +191,8 @@ struct SwTOXIndex : public SwTOXSortTabBase virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField = 0 ) const; virtual sal_uInt16 GetLevel() const; - virtual sal_Bool operator==( const SwTOXSortTabBase& ); - virtual sal_Bool operator<( const SwTOXSortTabBase& ); + virtual bool operator==( const SwTOXSortTabBase& ); + virtual bool operator<( const SwTOXSortTabBase& ); private: virtual void GetText_Impl( String&, String& ) const; @@ -208,8 +208,8 @@ struct SwTOXCustom : public SwTOXSortTabBase virtual ~SwTOXCustom() {} virtual sal_uInt16 GetLevel() const; - virtual sal_Bool operator==( const SwTOXSortTabBase& ); - virtual sal_Bool operator<( const SwTOXSortTabBase& ); + virtual bool operator==( const SwTOXSortTabBase& ); + virtual bool operator<( const SwTOXSortTabBase& ); private: virtual void GetText_Impl( String&, String& ) const; @@ -286,8 +286,8 @@ public: SwFmtFld& GetFldFmt() {return m_rField;} - virtual sal_Bool operator==( const SwTOXSortTabBase& ); - virtual sal_Bool operator<( const SwTOXSortTabBase& ); + virtual bool operator==( const SwTOXSortTabBase& ); + virtual bool operator<( const SwTOXSortTabBase& ); virtual sal_uInt16 GetLevel() const; }; diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index f056fd717384..3942759dc1d1 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -288,7 +288,7 @@ public: SwRect Paint(); virtual void Paint( SwRect const&, SwPrintData const*const pPrintData = NULL ) const; - virtual sal_Bool GetInfo( SfxPoolItem & ) const; + virtual bool GetInfo( SfxPoolItem & ) const; //Layoutorientiertes Cursortravelling: Linker, rechter Rand, //vorhergehende/naechste Zeile, gleiche horizontale Position. diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index da3abe4a3093..8d180aee3426 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -220,7 +220,7 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt ) aIdx = nEnd-1; } } - aIdx++; + ++aIdx; pNode = & aIdx.GetNode(); } } @@ -2933,7 +2933,7 @@ SwAnchoredObject* SwFlyFrmFmt::GetAnchoredObj( const Point* pPoint, const sal_Bo } -sal_Bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const +bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const { switch( rInfo.Which() ) { @@ -2941,7 +2941,7 @@ sal_Bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const { ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwFmt>::FirstElement( *this ); } - return sal_False; + return false; default: return SwFrmFmt::GetInfo( rInfo ); diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 555ac8acf807..fa07f8f22161 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -334,9 +334,9 @@ const SwLayoutFrm *SwFrm::ImplGetNextLayoutLeaf( bool bFwd ) const bool bGoingUp = !bFwd; // false for forward, true for backward do { - bool bGoingFwdOrBwd = false, bGoingDown = false; + bool bGoingFwdOrBwd = false; - bGoingDown = ( !bGoingUp && ( 0 != (p = lcl_GetLower( pFrm, bFwd ) ) ) ); + bool bGoingDown = ( !bGoingUp && ( 0 != (p = lcl_GetLower( pFrm, bFwd ) ) ) ); if ( !bGoingDown ) { // I cannot go down, because either I'm currently going up or @@ -394,9 +394,9 @@ const SwCntntFrm* SwCntntFrm::ImplGetNextCntntFrm( bool bFwd ) const sal_Bool bGoingUp = sal_False; do { const SwFrm *p = 0; - sal_Bool bGoingFwdOrBwd = sal_False, bGoingDown = sal_False; + sal_Bool bGoingFwdOrBwd = sal_False; - bGoingDown = ( !bGoingUp && ( 0 != ( p = lcl_GetLower( pFrm, true ) ) ) ); + sal_Bool bGoingDown = ( !bGoingUp && ( 0 != ( p = lcl_GetLower( pFrm, true ) ) ) ); if ( !bGoingDown ) { bGoingFwdOrBwd = ( 0 != ( p = lcl_FindLayoutFrame( pFrm, bFwd ) ) ); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 2172dbe8ec10..fb8096275efa 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1148,11 +1148,11 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, *************************************************************************/ // erfrage vom Modify Informationen -sal_Bool SwFlyFrm::GetInfo( SfxPoolItem & rInfo ) const +bool SwFlyFrm::GetInfo( SfxPoolItem & rInfo ) const { if( RES_AUTOFMT_DOCNODE == rInfo.Which() ) - return sal_False; // es gibt einen FlyFrm also wird er benutzt - return sal_True; // weiter suchen + return false; // es gibt einen FlyFrm also wird er benutzt + return true; // weiter suchen } /************************************************************************* @@ -2652,7 +2652,7 @@ sal_Bool SwFlyFrm::GetContour( PolyPolygon& rContour, SwRect aClip; SwRect aOrig; Lower()->Calc(); - ((SwNoTxtFrm*)Lower())->GetGrfArea( aClip, &aOrig, sal_False ); + ((SwNoTxtFrm*)Lower())->GetGrfArea( aClip, &aOrig, false ); // OD 16.04.2003 #i13147# - copy method code <SvxContourDlg::ScaleContour(..)> // in order to avoid that graphic has to be loaded for contour scale. //SvxContourDlg::ScaleContour( rContour, aGrf, MAP_TWIP, aOrig.SSize() ); diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index ad5ae9e43c38..baa7be1ca7d3 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -795,9 +795,8 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn ) { //Der Vorgaenger fuer eine Fussnote ist falls moeglich der Master //in der Fussnoteneigenen Verkettung. - SwLayoutFrm *pRet = 0; SwFtnFrm *pFtn = FindFtnFrm(); - pRet = pFtn->GetMaster(); + SwLayoutFrm *pRet = pFtn->GetMaster(); SwFtnBossFrm* pOldBoss = FindFtnBossFrm(); SwPageFrm *pOldPage = pOldBoss->FindPageFrm(); diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index 1f496c5231f6..1944d7b94a4c 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -74,11 +74,10 @@ static SwTwips lcl_GetFrmMinHeight(const SwLayoutFrm & rFrm) static SwTwips lcl_CalcContentHeight(SwLayoutFrm & frm) { - SwFrm* pFrm = frm.Lower(); - SwTwips nRemaining = 0; sal_uInt16 nNum = 0; - pFrm = frm.Lower(); + SwFrm* pFrm = frm.Lower(); + while ( pFrm ) { SwTwips nTmp; diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index f639d7a818a2..8752828b7d70 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -114,19 +114,19 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream ) // height of fly frames bUseFlyCache = aIo.GetMinorVersion() >= 1; - sal_uInt8 cFlags; - sal_uInt32 nIndex, nOffset; - aIo.OpenRec( SW_LAYCACHE_IO_REC_PAGES ); aIo.OpenFlagRec(); aIo.CloseFlagRec(); while( aIo.BytesLeft() && !aIo.HasError() ) { + sal_uInt32 nIndex(0), nOffset(0); + switch( aIo.Peek() ) { case SW_LAYCACHE_IO_REC_PARA: + { aIo.OpenRec( SW_LAYCACHE_IO_REC_PARA ); - cFlags = aIo.OpenFlagRec(); + sal_uInt8 cFlags = aIo.OpenFlagRec(); aIo.GetStream() >> nIndex; if( (cFlags & 0x01) != 0 ) aIo.GetStream() >> nOffset; @@ -136,6 +136,7 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream ) Insert( SW_LAYCACHE_IO_REC_PARA, nIndex, (xub_StrLen)nOffset ); aIo.CloseRec( SW_LAYCACHE_IO_REC_PARA ); break; + } case SW_LAYCACHE_IO_REC_TABLE: aIo.OpenRec( SW_LAYCACHE_IO_REC_TABLE ); aIo.OpenFlagRec(); @@ -150,8 +151,8 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream ) aIo.OpenRec( SW_LAYCACHE_IO_REC_FLY ); aIo.OpenFlagRec(); aIo.CloseFlagRec(); - sal_Int32 nX, nY, nW, nH; - sal_uInt16 nPgNum; + sal_Int32 nX(0), nY(0), nW(0), nH(0); + sal_uInt16 nPgNum(0); aIo.GetStream() >> nPgNum >> nIndex >> nX >> nY >> nW >> nH; SwFlyCache* pFly = new SwFlyCache( nPgNum, nIndex, nX, nY, nW, nH ); @@ -1188,7 +1189,7 @@ sal_Bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType ) } else { - sal_uInt32 nVal; + sal_uInt32 nVal(0); *pStream >> nVal; sal_uInt8 cRecTyp = (sal_uInt8)nVal; if( !nVal || cRecTyp != cType || @@ -1266,7 +1267,7 @@ sal_uInt32 SwLayCacheIoImpl::BytesLeft() sal_uInt8 SwLayCacheIoImpl::Peek() { - sal_uInt8 c = 0; + sal_uInt8 c(0); if( !bError ) { sal_uInt32 nPos = pStream->Tell(); @@ -1292,7 +1293,7 @@ void SwLayCacheIoImpl::SkipRec() sal_uInt8 SwLayCacheIoImpl::OpenFlagRec() { OSL_ENSURE( !bWriteMode, "OpenFlagRec illegal in write mode" ); - sal_uInt8 cFlags; + sal_uInt8 cFlags(0); *pStream >> cFlags; nFlagRecEnd = pStream->Tell() + ( cFlags & 0x0F ); return (cFlags >> 4); diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 14f8ecff180a..307c724c4f72 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -679,7 +679,7 @@ void SwRootFrm::AllRemoveFtns() { RemoveFtns(); } -void SwRootFrm::AllInvalidateSmartTagsOrSpelling(sal_Bool bSmartTags) const +void SwRootFrm::AllInvalidateSmartTagsOrSpelling(bool bSmartTags) const { SwPageFrm *pPage = (SwPageFrm*)this->Lower(); while ( pPage ) diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 53a329f5e7cf..40b3b7a0a611 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -752,14 +752,14 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, |* *************************************************************************/ // erfrage vom Modify Informationen -sal_Bool SwPageFrm::GetInfo( SfxPoolItem & rInfo ) const +bool SwPageFrm::GetInfo( SfxPoolItem & rInfo ) const { if( RES_AUTOFMT_DOCNODE == rInfo.Which() ) { // es gibt einen PageFrm also wird er benutzt - return sal_False; + return false; } - return sal_True; // weiter suchen + return true; // weiter suchen } /************************************************************************* diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index 1fa5c3186818..d48517ee7cd8 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -162,10 +162,10 @@ void SwPageDesc::ResetAllAttr( sal_Bool bLeft ) // gets information from Modify -sal_Bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const +bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const { if( !aMaster.GetInfo( rInfo ) ) - return sal_False; // found + return false; // found return aLeft.GetInfo( rInfo ); } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index a0f40cc3fd71..fc50baf54a6d 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1,31 +1,21 @@ /* -*- 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. +/* + * This file is part of the LibreOffice project. * - * 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). + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * 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. + * This file incorporates work covered by the following license notice: * - ************************************************************************/ - + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ #include <com/sun/star/text/HoriOrientation.hpp> #include <hintids.hxx> @@ -93,7 +83,7 @@ // <-- #include <ndole.hxx> -#include <svtools/chartprettypainter.hxx> +#include <svx/charthelper.hxx> #include <PostItMgr.hxx> #include <vcl/svapp.hxx> @@ -3792,6 +3782,10 @@ sal_Bool SwFlyFrm::IsPaint( SdrObject *pObj, const ViewShell *pSh ) { //The paint may be prevented by the superior Flys. SwFrm *pAnch = 0; + if ( pObj->ISA(SwFlyDrawObj) ) // i#117962# + { + bPaint = false; + } if ( pObj->ISA(SwVirtFlyDrawObj) ) { SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm(); @@ -3922,7 +3916,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const if( pNoTNd ) { SwOLENode* pOLENd = const_cast<SwOLENode*>(pNoTNd->GetOLENode()); - if( pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() ) ) + if( pOLENd && ChartHelper::IsChart( pOLENd->GetOLEObj().GetObject() ) ) bIsChart = true; } } @@ -7236,7 +7230,7 @@ Graphic SwDrawFrmFmt::MakeGraphic( ImageMap* ) SdrView *pView = new SdrView( pMod ); SdrPageView *pPgView = pView->ShowSdrPage(pView->GetModel()->GetPage(0)); pView->MarkObj( pObj, pPgView ); - aRet = pView->GetMarkedObjBitmap(); + aRet = pView->GetMarkedObjBitmapEx(); pView->HideSdrPage(); delete pView; } diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index a0f14130a8dd..e9df7332b7a9 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -612,9 +612,9 @@ static SwCntntFrm* lcl_GetNextCntntFrm( const SwLayoutFrm* pLay, bool bFwd ) sal_Bool bGoingUp = sal_True; do { const SwFrm *p = 0; - sal_Bool bGoingFwdOrBwd = sal_False, bGoingDown = sal_False; + sal_Bool bGoingFwdOrBwd = sal_False; - bGoingDown = !bGoingUp && ( 0 != ( p = pFrm->IsLayoutFrm() ? ((SwLayoutFrm*)pFrm)->Lower() : 0 ) ); + sal_Bool bGoingDown = !bGoingUp && ( 0 != ( p = pFrm->IsLayoutFrm() ? ((SwLayoutFrm*)pFrm)->Lower() : 0 ) ); if ( !bGoingDown ) { bGoingFwdOrBwd = ( 0 != ( p = pFrm->IsFlyFrm() ? diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 57b880113787..7e217694e951 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -3278,7 +3278,7 @@ void SwTabFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew, |* SwTabFrm::GetInfo() |* |*************************************************************************/ -sal_Bool SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const +bool SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const { if ( RES_VIRTPAGENUM_INFO == rHnt.Which() && IsInDocBody() && !IsFollow() ) { @@ -3291,7 +3291,7 @@ sal_Bool SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const //Here it should be (can temporary be different, should we be // concerned about this?) rInfo.SetInfo( pPage, this ); - return sal_False; + return false; } if ( pPage->GetPhyPageNum() < rInfo.GetOrigPage()->GetPhyPageNum() && (!rInfo.GetPage() || pPage->GetPhyPageNum() > rInfo.GetPage()->GetPhyPageNum())) @@ -3301,7 +3301,7 @@ sal_Bool SwTabFrm::GetInfo( SfxPoolItem &rHnt ) const } } } - return sal_True; + return true; } /************************************************************************* @@ -5524,10 +5524,9 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const return (Frm().*fnRect->fnGetHeight)(); } - SwRowFrm* pFirstRow = 0; SwTwips nTmpHeight = 0; - pFirstRow = GetFirstNonHeadlineRow(); + SwRowFrm* pFirstRow = GetFirstNonHeadlineRow(); OSL_ENSURE( !IsFollow() || pFirstRow, "FollowTable without Lower" ); // NEW TABLES diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx index 2b8138d7fec6..dc07e9fcebcf 100644 --- a/sw/source/core/para/paratr.cxx +++ b/sw/source/core/para/paratr.cxx @@ -126,9 +126,9 @@ void SwFmtDrop::Modify( const SfxPoolItem*, const SfxPoolItem * ) } } -sal_Bool SwFmtDrop::GetInfo( SfxPoolItem& ) const +bool SwFmtDrop::GetInfo( SfxPoolItem& ) const { - return sal_True; // weiter + return true; // weiter } int SwFmtDrop::operator==( const SfxPoolItem& rAttr ) const diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx index 714de20465f3..0bdb4ec4d771 100644 --- a/sw/source/core/swg/SwXMLTextBlocks1.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/xml/sax/InputSource.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/xml/sax/Parser.hpp> +#include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/document/XStorageBasedDocument.hpp> #include <doc.hxx> #include <docsh.hxx> @@ -380,6 +381,8 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const String& rShort, const String& , uno::Reference< lang::XMultiServiceFactory > xServiceFactory = comphelper::getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = + comphelper::getProcessComponentContext(); OSL_ENSURE( xServiceFactory.is(), "XMLReader::Read: got no service manager" ); if( !xServiceFactory.is() ) @@ -387,9 +390,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const String& rShort, const String& , // Throw an exception ? } - uno::Reference < XInterface > xWriter (xServiceFactory->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")))); - OSL_ENSURE(xWriter.is(),"com.sun.star.xml.sax.Writer service missing"); + uno::Reference < xml::sax::XWriter > xWriter = xml::sax::Writer::create(xContext); sal_uLong nRes = 0; try @@ -512,6 +513,8 @@ void SwXMLTextBlocks::WriteInfo( void ) { uno::Reference< lang::XMultiServiceFactory > xServiceFactory = comphelper::getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = + comphelper::getProcessComponentContext(); OSL_ENSURE( xServiceFactory.is(), "XMLReader::Read: got no service manager" ); if( !xServiceFactory.is() ) @@ -519,9 +522,7 @@ void SwXMLTextBlocks::WriteInfo( void ) // Throw an exception ? } - uno::Reference < XInterface > xWriter (xServiceFactory->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")))); - OSL_ENSURE(xWriter.is(),"com.sun.star.xml.sax.Writer service missing"); + uno::Reference < xml::sax::XWriter > xWriter = xml::sax::Writer::create(xContext); OUString sDocName( RTL_CONSTASCII_USTRINGPARAM( XMLN_BLOCKLIST ) ); /* @@ -580,6 +581,8 @@ sal_uLong SwXMLTextBlocks::SetMacroTable( uno::Reference< lang::XMultiServiceFactory > xServiceFactory = comphelper::getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = + comphelper::getProcessComponentContext(); OSL_ENSURE( xServiceFactory.is(), "XML autotext event write:: got no service manager" ); if( !xServiceFactory.is() ) @@ -619,51 +622,43 @@ sal_uLong SwXMLTextBlocks::SetMacroTable( uno::Reference < io::XOutputStream > xOutputStream = xDocStream->getOutputStream(); // get XML writer - uno::Reference< io::XActiveDataSource > xSaxWriter( - xServiceFactory->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")) ), - UNO_QUERY ); - OSL_ENSURE( xSaxWriter.is(), "can't instantiate XML writer" ); - if( xSaxWriter.is() ) + uno::Reference< xml::sax::XWriter > xSaxWriter = + xml::sax::Writer::create( xContext ); + + // connect XML writer to output stream + xSaxWriter->setOutputStream( xOutputStream ); + uno::Reference<xml::sax::XDocumentHandler> xDocHandler( + xSaxWriter, UNO_QUERY); + + // construct events object + uno::Reference<XNameAccess> xEvents = + new SvMacroTableEventDescriptor(rMacroTbl,aAutotextEvents); + + // prepare arguments (prepend doc handler to given arguments) + Sequence<Any> aParams(2); + aParams[0] <<= xDocHandler; + aParams[1] <<= xEvents; + + + // get filter component + OUString sFilterComponent = bOasis + ? OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter")) + : OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.XMLAutotextEventsExporter")); + uno::Reference< document::XExporter > xExporter( + xServiceFactory->createInstanceWithArguments( + sFilterComponent, aParams), UNO_QUERY); + OSL_ENSURE( xExporter.is(), + "can't instantiate export filter component" ); + if( xExporter.is() ) { - - // connect XML writer to output stream - xSaxWriter->setOutputStream( xOutputStream ); - uno::Reference<xml::sax::XDocumentHandler> xDocHandler( - xSaxWriter, UNO_QUERY); - - // construct events object - uno::Reference<XNameAccess> xEvents = - new SvMacroTableEventDescriptor(rMacroTbl,aAutotextEvents); - - // prepare arguments (prepend doc handler to given arguments) - Sequence<Any> aParams(2); - aParams[0] <<= xDocHandler; - aParams[1] <<= xEvents; - - - // get filter component - OUString sFilterComponent = bOasis - ? OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter")) - : OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.XMLAutotextEventsExporter")); - uno::Reference< document::XExporter > xExporter( - xServiceFactory->createInstanceWithArguments( - sFilterComponent, aParams), UNO_QUERY); - OSL_ENSURE( xExporter.is(), - "can't instantiate export filter component" ); - if( xExporter.is() ) - { - // connect model and filter - xExporter->setSourceDocument( xModelComp ); - - // filter! - Sequence<beans::PropertyValue> aFilterProps( 0 ); - uno::Reference < document::XFilter > xFilter( xExporter, - UNO_QUERY ); - xFilter->filter( aFilterProps ); - } - else - nRes = ERR_SWG_WRITE_ERROR; + // connect model and filter + xExporter->setSourceDocument( xModelComp ); + + // filter! + Sequence<beans::PropertyValue> aFilterProps( 0 ); + uno::Reference < document::XFilter > xFilter( xExporter, + UNO_QUERY ); + xFilter->filter( aFilterProps ); } else nRes = ERR_SWG_WRITE_ERROR; diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index f51d9c6d9e3d..b790bbe66207 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1515,19 +1515,19 @@ SwTableBox* SwTable::GetTblBox( sal_uLong nSttIdx ) return pRet; } -sal_Bool SwTable::IsTblComplex() const +bool SwTable::IsTblComplex() const { - // Returns sal_True for complex tables, i.e. tables that contain nestings, + // Returns true for complex tables, i.e. tables that contain nestings, // like containing boxes not part of the first line, e.g. results of // splits/merges which lead to more complex structures. for (size_t n = 0; n < m_TabSortContentBoxes.size(); ++n) { if (m_TabSortContentBoxes[ n ]->GetUpper()->GetUpper()) { - return sal_True; + return true; } } - return sal_False; + return false; } @@ -1951,7 +1951,7 @@ sal_uLong SwTableBox::GetSttIdx() const } // retrieve informations from the client -sal_Bool SwTable::GetInfo( SfxPoolItem& rInfo ) const +bool SwTable::GetInfo( SfxPoolItem& rInfo ) const { switch( rInfo.Which() ) { @@ -1966,7 +1966,7 @@ sal_Bool SwTable::GetInfo( SfxPoolItem& rInfo ) const ((SwAutoFmtGetDocNode&)rInfo).pCntntNode = GetFrmFmt()->GetDoc()->GetNodes().GoNext( &aIdx ); } - return sal_False; + return false; } break; } @@ -1983,9 +1983,9 @@ sal_Bool SwTable::GetInfo( SfxPoolItem& rInfo ) const { ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwFmt>::FirstElement( *GetFrmFmt() ); } - return sal_False; + return false; } - return sal_True; + return true; } SwTable * SwTable::FindTable( SwFrmFmt const*const pFmt ) @@ -2101,7 +2101,7 @@ void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol, // Reset DontExpand-Flags before exchange, to retrigger expansion { SwIndex aResetIdx( aIdx, n ); - pTNd->DontExpandFmt( aResetIdx, sal_False, sal_False ); + pTNd->DontExpandFmt( aResetIdx, false, false ); } if( !pDoc->IsIgnoreRedline() && !pDoc->GetRedlineTbl().empty() ) @@ -2154,7 +2154,7 @@ void ChgNumToText( SwTableBox& rBox, sal_uLong nFmt ) // exchange text SwIndex aIdx( pTNd, sTxt.Len() ); // Reset DontExpand-Flags before exchange, to retrigger expansion - pTNd->DontExpandFmt( aIdx, sal_False, sal_False ); + pTNd->DontExpandFmt( aIdx, false, false ); aIdx = 0; pTNd->EraseText( aIdx, STRING_LEN, IDocumentContentOperations::INS_EMPTYEXPAND ); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 5133878402b4..324eb742977b 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -2064,7 +2064,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() IDocumentMarkAccess* const pMarkAccess = mrSh.GetDoc()->getIDocumentMarkAccess(); for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin(); ppMark != pMarkAccess->getBookmarksEnd(); - ppMark++) + ++ppMark) { //get the name const ::sw::mark::IMark* pBkmk = ppMark->get(); diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx index 36f733629f18..65e8872d9a4a 100644 --- a/sw/source/core/text/frminf.cxx +++ b/sw/source/core/text/frminf.cxx @@ -43,7 +43,7 @@ xub_StrLen SwTxtMargin::GetTxtStart() const for( i = nTmpPos; i < nEnd; ++i ) { - const xub_Unicode aChar = rTxt.GetChar( i ); + const sal_Unicode aChar = rTxt.GetChar( i ); if( CH_TAB != aChar && ' ' != aChar ) return i; } @@ -62,7 +62,7 @@ xub_StrLen SwTxtMargin::GetTxtEnd() const long i; for( i = nEnd - 1; i >= nTmpPos; --i ) { - xub_Unicode aChar = rTxt.GetChar( static_cast<xub_StrLen>(i) ); + sal_Unicode aChar = rTxt.GetChar( static_cast<xub_StrLen>(i) ); if( CH_TAB != aChar && CH_BREAK != aChar && ' ' != aChar ) return static_cast<xub_StrLen>(i + 1); } @@ -347,7 +347,7 @@ KSHORT SwTxtFrmInfo::GetBigIndent( xub_StrLen& rFndPos, // Is on front of a non-space const XubString& rTxt = aInf.GetTxt(); - xub_Unicode aChar = rTxt.GetChar( rFndPos ); + sal_Unicode aChar = rTxt.GetChar( rFndPos ); if( CH_TAB == aChar || CH_BREAK == aChar || ' ' == aChar || (( CH_TXTATR_BREAKWORD == aChar || CH_TXTATR_INWORD == aChar ) && aInf.HasHint( rFndPos ) ) ) diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index ca99ba6c2b45..e548cdf540e7 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -551,7 +551,7 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const // Don't show the paragraph mark for collapsed paragraphs, when they are hidden if ( EmptyHeight( ) > 1 ) { - const rtl::OUString aTmp( CH_PAR ); + const OUString aTmp( CH_PAR ); SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 ); aDrawInf.SetLeft( rRect.Left() ); aDrawInf.SetRight( rRect.Right() ); diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx index b7545c8dfe6c..161d5e9a72cb 100644 --- a/sw/source/core/text/guess.cxx +++ b/sw/source/core/text/guess.cxx @@ -217,7 +217,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf, xub_StrLen nPorLen = 0; // do not call the break iterator nCutPos is a blank - xub_Unicode cCutChar = rInf.GetTxt().GetChar( nCutPos ); + sal_Unicode cCutChar = rInf.GetTxt().GetChar( nCutPos ); if( CH_BLANK == cCutChar || CH_FULL_BLANK == cCutChar ) { nBreakPos = nCutPos; @@ -258,7 +258,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf, // the field portion, we trigger an underflow. xub_StrLen nOldIdx = rInf.GetIdx(); - xub_Unicode cFldChr = 0; + sal_Unicode cFldChr = 0; #if OSL_DEBUG_LEVEL > 0 XubString aDebugString; diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 32bb3ab29fbd..1a1c28677b27 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -823,7 +823,7 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP } // check if char fits into rectangle - const rtl::OUString aTmp( cChar ); + const OUString aTmp( cChar ); aFontSize = rInf.GetTxtSize( aTmp ).SvLSize(); while ( aFontSize.Width() > nMaxWidth ) { @@ -1100,7 +1100,7 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const if(pFieldmark) { OSL_TRACE("Found Fieldmark"); #if OSL_DEBUG_LEVEL > 1 - rtl::OUString str = pFieldmark->ToString( ); + OUString str = pFieldmark->ToString( ); fprintf( stderr, "%s\n", rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr( ) ); #endif } @@ -1123,7 +1123,7 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const SwTxtAttr* pTxtAttr = pNd->GetTxtAttrForCharAt(nEndIdx, RES_TXTATR_FIELD); const SwFmtFld& rPostItField = pTxtAttr->GetFld(); // Look up the author name - const rtl::OUString& rAuthor = rPostItField.GetFld()->GetPar1(); + const OUString& rAuthor = rPostItField.GetFld()->GetPar1(); sal_uInt16 nIndex = pNd->GetDoc()->InsertRedlineAuthor(rAuthor); pOutDev->SetFillColor( SwPostItMgr::GetColorLight(nIndex) ); pOutDev->SetLineColor( SwPostItMgr::GetColorAnchor(nIndex) ); @@ -1482,17 +1482,17 @@ xub_StrLen SwTxtFormatInfo::ScanPortionEnd( const xub_StrLen nStart, // // Used for decimal tab handling: // - const xub_Unicode cTabDec = GetLastTab() ? (sal_Unicode)GetTabDecimal() : 0; - const xub_Unicode cThousandSep = ',' == cTabDec ? '.' : ','; + const sal_Unicode cTabDec = GetLastTab() ? (sal_Unicode)GetTabDecimal() : 0; + const sal_Unicode cThousandSep = ',' == cTabDec ? '.' : ','; // #i45951# German (Switzerland) uses ' as thousand separator - const xub_Unicode cThousandSep2 = ',' == cTabDec ? '.' : '\''; + const sal_Unicode cThousandSep2 = ',' == cTabDec ? '.' : '\''; bool bNumFound = false; const bool bTabCompat = GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT); for( ; i < nEnd; ++i ) { - const xub_Unicode cPos = GetChar( i ); + const sal_Unicode cPos = GetChar( i ); switch( cPos ) { case CH_TXTATR_BREAKWORD: @@ -1558,7 +1558,7 @@ xub_StrLen SwTxtFormatInfo::ScanPortionEnd( const xub_StrLen nStart, // to become the hook: if ( i == nEnd && i < GetTxt().Len() && bNumFound ) { - const xub_Unicode cPos = GetChar( i ); + const sal_Unicode cPos = GetChar( i ); if ( cPos != cTabDec && cPos != cThousandSep && cPos !=cThousandSep2 && ( 0x2F >= cPos || cPos >= 0x3A ) ) { cHookChar = GetChar( i ); @@ -1636,7 +1636,7 @@ SwTxtSlot::SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor, else if( !pTempList && nPos < pOldSmartTagList->Count() && nListPos < nIdx && aTxt.Len() ) { pTempList = new SwWrongList( WRONGLIST_SMARTTAG ); - pTempList->Insert( rtl::OUString(), 0, 0, aTxt.Len(), 0 ); + pTempList->Insert( OUString(), 0, 0, aTxt.Len(), 0 ); ((SwTxtPaintInfo*)pInf)->SetSmartTags( pTempList ); } else @@ -1652,7 +1652,7 @@ SwTxtSlot::SwTxtSlot( const SwTxtSizeInfo *pNew, const SwLinePortion *pPor, else if( !pTempList && nPos < pOldGrammarCheckList->Count() && nListPos < nIdx && aTxt.Len() ) { pTempList = new SwWrongList( WRONGLIST_GRAMMAR ); - pTempList->Insert( rtl::OUString(), 0, 0, aTxt.Len(), 0 ); + pTempList->Insert( OUString(), 0, 0, aTxt.Len(), 0 ); ((SwTxtPaintInfo*)pInf)->SetGrammarCheckList( pTempList ); } else diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index a975d04776a4..d750eb3c1c3c 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -273,7 +273,7 @@ public: inline const SwViewOption &GetOpt() const { return *pOpt; } inline const XubString &GetTxt() const { return *pTxt; } - inline xub_Unicode GetChar( const xub_StrLen nPos ) const + inline sal_Unicode GetChar( const xub_StrLen nPos ) const { return pTxt->GetChar( nPos ); } inline KSHORT GetTxtHeight() const; @@ -404,7 +404,8 @@ protected: SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pSmartTags = 0; pSpaceAdd = 0; pBrushItem = ((SvxBrushItem*)-1);} #else - SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pWrongList = 0; pSmartTags = 0; pSpaceAdd = 0; pBrushItem = 0;} + SwTxtPaintInfo() { pFrm = 0; pWrongList = 0; pGrammarCheckList = 0; pSmartTags = 0; pSpaceAdd = 0; + pBrushItem = 0;} #endif public: SwTxtPaintInfo( const SwTxtPaintInfo &rInf ); @@ -553,8 +554,8 @@ class SwTxtFormatInfo : public SwTxtPaintInfo // the beginning of a line sal_Bool bTabOverflow; // Tabs are expanding after the end margin - xub_Unicode cTabDecimal; // the current decimal delimiter - xub_Unicode cHookChar; // For tabs in fields etc. + sal_Unicode cTabDecimal; // the current decimal delimiter + sal_Unicode cHookChar; // For tabs in fields etc. sal_uInt8 nMaxHyph; // Max. line count of followup hyphenations sal_Bool bTestFormat; // Test formatting from WouldFit, no notification etc. @@ -660,16 +661,16 @@ public: // Tabs inline SwTabPortion *GetLastTab() { return pLastTab; } inline void SetLastTab( SwTabPortion *pNew ) { pLastTab = pNew; } - inline xub_Unicode GetTabDecimal() const { return cTabDecimal; } - inline void SetTabDecimal( const xub_Unicode cNew ) { cTabDecimal = cNew;} + inline sal_Unicode GetTabDecimal() const { return cTabDecimal; } + inline void SetTabDecimal( const sal_Unicode cNew ) { cTabDecimal = cNew;} // Last* inline SwFldPortion *GetLastFld() { return pLastFld; } inline void SetLastFld( SwFldPortion *pNew ) { pLastFld = pNew; } inline void ClearHookChar() { cHookChar = 0; } - inline void SetHookChar( const xub_Unicode cNew ) { cHookChar = cNew; } - inline xub_Unicode GetHookChar() const { return cHookChar; } + inline void SetHookChar( const sal_Unicode cNew ) { cHookChar = cNew; } + inline sal_Unicode GetHookChar() const { return cHookChar; } // Done-Flags inline sal_Bool IsFtnDone() const { return bFtnDone; } diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index bc043b7cf6a4..13f171a9361f 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -643,7 +643,7 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa if( nNextChg > nStop ) nNextChg = nStop; SwTxtAttr *pHint = NULL; - xub_Unicode cChar = CH_BLANK; + sal_Unicode cChar = CH_BLANK; nStop = nIdx; while( nStop < nLen && nStop < nNextChg && CH_TAB != ( cChar = m_Text.GetChar( nStop ) ) && @@ -684,7 +684,7 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa case CHAR_HARDBLANK: case CHAR_HARDHYPHEN: { - rtl::OUString sTmp( cChar ); + OUString sTmp( cChar ); SwDrawTextInfo aDrawInf( const_cast<ViewShell *>(getIDocumentLayoutAccess()->GetCurrentViewShell()), *pOut, 0, sTmp, 0, 1, 0, sal_False );//swmod 080311 nAktWidth = aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width(); @@ -890,7 +890,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd nNextChg = nStop; nStop = nIdx; - xub_Unicode cChar = CH_BLANK; + sal_Unicode cChar = CH_BLANK; SwTxtAttr* pHint = NULL; // stop at special characters in [ nIdx, nNextChg ] @@ -934,7 +934,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd else if ( cChar == CH_TAB ) { // tab receives width of one space - rtl::OUString sTmp( CH_BLANK ); + OUString sTmp( CH_BLANK ); SwDrawTextInfo aDrawInf( pSh, *pOut, 0, sTmp, 0, 1 ); nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width(); nIdx++; @@ -943,7 +943,7 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ++nIdx; else if ( cChar == CHAR_HARDBLANK || cChar == CHAR_HARDHYPHEN ) { - rtl::OUString sTmp( cChar ); + OUString sTmp( cChar ); SwDrawTextInfo aDrawInf( pSh, *pOut, 0, sTmp, 0, 1 ); nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width(); nIdx++; diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 763f459402e9..22c087fc1545 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1271,7 +1271,7 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf ) } } // 5010: Tabs und Felder - xub_Unicode cChar = rInf.GetHookChar(); + sal_Unicode cChar = rInf.GetHookChar(); if( cChar ) { @@ -1990,7 +1990,7 @@ sal_Bool SwTxtFormatter::AllowRepaintOpt() const const xub_StrLen nReformat = GetInfo().GetReformatStart(); if( bOptimizeRepaint && STRING_LEN != nReformat ) { - const xub_Unicode cCh = GetInfo().GetTxt().GetChar( nReformat ); + const sal_Unicode cCh = GetInfo().GetTxt().GetChar( nReformat ); bOptimizeRepaint = ( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh ) || ! GetInfo().HasHint( nReformat ); } diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx index 3624ec042d0e..0bb0f7d158e0 100644 --- a/sw/source/core/text/porexp.cxx +++ b/sw/source/core/text/porexp.cxx @@ -156,7 +156,7 @@ MSHORT SwBlankPortion::MayUnderFlow( const SwTxtFormatInfo &rInf, xub_StrLen nBlank = nIdx; while( --nBlank > rInf.GetLineStart() ) { - const xub_Unicode cCh = rInf.GetChar( nBlank ); + const sal_Unicode cCh = rInf.GetChar( nBlank ); if( CH_BLANK == cCh || (( CH_TXTATR_BREAKWORD == cCh || CH_TXTATR_INWORD == cCh ) && rInf.HasHint( nBlank ) ) ) @@ -166,7 +166,7 @@ MSHORT SwBlankPortion::MayUnderFlow( const SwTxtFormatInfo &rInf, return 0; } } - xub_Unicode cCh; + sal_Unicode cCh; if( nIdx < 2 || CH_BLANK == (cCh = rInf.GetChar( nIdx - 1 )) ) return 1; if( CH_BREAK == cCh ) @@ -243,7 +243,7 @@ sal_Bool SwBlankPortion::GetExpTxt( const SwTxtSizeInfo&, XubString &rTxt ) cons void SwBlankPortion::HandlePortion( SwPortionHandler& rPH ) const { - rtl::OUString aString( cChar ); + OUString aString( cChar ); rPH.Special( GetLen(), aString, GetWhichPor() ); } diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx index 087c610889be..b5a9add5f083 100644 --- a/sw/source/core/text/porexp.hxx +++ b/sw/source/core/text/porexp.hxx @@ -49,10 +49,10 @@ public: class SwBlankPortion : public SwExpandPortion { - xub_Unicode cChar; + sal_Unicode cChar; sal_Bool bMulti; // For multiportion brackets public: - inline SwBlankPortion( xub_Unicode cCh, sal_Bool bMult = sal_False ) + inline SwBlankPortion( sal_Unicode cCh, sal_Bool bMult = sal_False ) : cChar( cCh ), bMulti( bMult ) { cChar = cCh; SetLen(1); SetWhichPor( POR_BLANK ); } diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 4ef411dcbaaf..1ede147f5ef7 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -133,7 +133,7 @@ KSHORT SwFldPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const !rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() ) { if( !nViewWidth ) - pThis->nViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width(); + pThis->nViewWidth = rInf.GetTxtSize(OUString(' ')).Width(); } else pThis->nViewWidth = 0; @@ -242,7 +242,9 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf ) const sal_uInt8 nFldDir = ( IsNumberPortion() || IsFtnNumPortion() ) ? rSI.GetDefaultDir() : rSI.DirType( IsFollow() ? rInf.GetIdx() - 1 : rInf.GetIdx() ); - if ( UBIDI_RTL == nFldDir ) + + bool bPerformUBA = UBIDI_LTR != nFldDir ? true : i18n::ScriptType::COMPLEX == nScript; + if (bPerformUBA) { UErrorCode nError = U_ZERO_ERROR; UBiDi* pBidi = ubidi_openSized( aTxt.Len(), 0, &nError ); @@ -272,8 +274,16 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf ) } } - if ( nCurrDir == UBIDI_RTL ) + if (nCurrDir == UBIDI_RTL) + { nTmp = SW_CTL; + //If we decided that this range was RTL after all and the + //previous range was complex but clipped to the start of this + //range, then extend it to be complex over the additional RTL + //range + if (nScript == i18n::ScriptType::COMPLEX) + nNextScriptChg = nNextDirChg; + } } // #i98418# @@ -780,7 +790,7 @@ static sal_Char const sDoubleSpace[] = " "; * class SwBulletPortion *************************************************************************/ -SwBulletPortion::SwBulletPortion( const xub_Unicode cBullet, +SwBulletPortion::SwBulletPortion( const sal_Unicode cBullet, const XubString& rBulletFollowedBy, SwFont *pFont, const sal_Bool bLft, diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx index 32198e7cf4fb..cdccfa4aaee6 100644 --- a/sw/source/core/text/porfld.hxx +++ b/sw/source/core/text/porfld.hxx @@ -174,7 +174,7 @@ public: class SwBulletPortion : public SwNumberPortion { public: - SwBulletPortion( const xub_Unicode cCh, + SwBulletPortion( const sal_Unicode cCh, const XubString& rBulletFollowedBy, SwFont *pFnt, const sal_Bool bLeft, diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index 80ce9dc018c9..c0516424102c 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -92,7 +92,7 @@ sal_Bool SwFlyPortion::Format( SwTxtFormatInfo &rInf ) && ' ' != rInf.GetChar( rInf.GetIdx() - 1 ) && ( !rInf.GetLast() || !rInf.GetLast()->IsBreakPortion() ) ) { - SetBlankWidth( rInf.GetTxtSize(rtl::OUString(' ')).Width() ); + SetBlankWidth( rInf.GetTxtSize(OUString(' ')).Width() ); SetLen( 1 ); } diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx index 6cd9dfcc8e84..80659b00bb27 100644 --- a/sw/source/core/text/porglue.cxx +++ b/sw/source/core/text/porglue.cxx @@ -30,11 +30,11 @@ #include "paratr.hxx" // pTabStop, ADJ* #include "viewopt.hxx" // SwViewOptions #include <SwPortionHandler.hxx> - #include "porglue.hxx" #include "inftxt.hxx" #include "porlay.hxx" // SwParaPortion, SetFull #include "porfly.hxx" // SwParaPortion, SetFull +#include <comphelper/string.hxx> /************************************************************************* * class SwGluePortion @@ -97,8 +97,9 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const if( rInf.GetFont()->IsPaintBlank() ) { - XubString aTxt; - aTxt.Fill( GetFixWidth() / GetLen(), ' ' ); + rtl::OUStringBuffer aBuf; + comphelper::string::padToLength(aBuf, GetFixWidth() / GetLen(), ' '); + String aTxt(aBuf.makeStringAndClear()); SwTxtPaintInfo aInf( rInf, aTxt ); aInf.DrawText( *this, aTxt.Len(), sal_True ); } @@ -106,13 +107,13 @@ void SwGluePortion::Paint( const SwTxtPaintInfo &rInf ) const if( rInf.OnWin() && rInf.GetOpt().IsBlank() && rInf.IsNoSymbol() ) { #if OSL_DEBUG_LEVEL > 0 - const xub_Unicode cChar = rInf.GetChar( rInf.GetIdx() ); + const sal_Unicode cChar = rInf.GetChar( rInf.GetIdx() ); OSL_ENSURE( CH_BLANK == cChar || CH_BULLET == cChar, "SwGluePortion::Paint: blank expected" ); #endif if( 1 == GetLen() ) { - rtl::OUString aBullet( CH_BULLET ); + OUString aBullet( CH_BULLET ); SwPosSize aBulletSize( rInf.GetTxtSize( aBullet ) ); Point aPos( rInf.GetPos() ); aPos.X() += (Width()/2) - (aBulletSize.Width()/2); diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index aa135949865f..f3c956560159 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -88,7 +88,7 @@ using namespace i18n::ScriptType; #endif #define isSeenOrSadChar(c) (IS_JOINING_GROUP((c), SAD) || IS_JOINING_GROUP((c), SEEN)) -sal_Bool isTransparentChar ( xub_Unicode cCh ) +sal_Bool isTransparentChar ( sal_Unicode cCh ) { return u_getIntPropertyValue( cCh, UCHAR_JOINING_TYPE ) == U_JT_TRANSPARENT; } @@ -99,7 +99,7 @@ sal_Bool isTransparentChar ( xub_Unicode cCh ) * Checks if cCh + cNectCh builds a ligature (used for Kashidas) *************************************************************************/ -static sal_Bool lcl_IsLigature( xub_Unicode cCh, xub_Unicode cNextCh ) +static sal_Bool lcl_IsLigature( sal_Unicode cCh, sal_Unicode cNextCh ) { // Lam + Alef return ( isLamChar ( cCh ) && isAlefChar ( cNextCh )); @@ -111,7 +111,7 @@ static sal_Bool lcl_IsLigature( xub_Unicode cCh, xub_Unicode cNextCh ) * Checks if cCh is connectable to cPrevCh (used for Kashidas) *************************************************************************/ -static sal_Bool lcl_ConnectToPrev( xub_Unicode cCh, xub_Unicode cPrevCh ) +static sal_Bool lcl_ConnectToPrev( sal_Unicode cCh, sal_Unicode cPrevCh ) { const int32_t nJoiningType = u_getIntPropertyValue( cPrevCh, UCHAR_JOINING_TYPE ); sal_Bool bRet = nJoiningType != U_JT_RIGHT_JOINING && nJoiningType != U_JT_NON_JOINING; @@ -277,7 +277,7 @@ static bool lcl_HasOnlyBlanks( const XubString& rTxt, xub_StrLen nStt, xub_StrLe bool bBlankOnly = true; while ( nStt < nEnd ) { - const xub_Unicode cChar = rTxt.GetChar( nStt++ ); + const sal_Unicode cChar = rTxt.GetChar( nStt++ ); if ( ' ' != cChar && 0x3000 != cChar ) { bBlankOnly = false; @@ -932,7 +932,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) while ( nLastCompression < nChg ) { - xub_Unicode cChar = rTxt.GetChar( nLastCompression ); + sal_Unicode cChar = rTxt.GetChar( nLastCompression ); // examine current character switch ( cChar ) @@ -1000,8 +1000,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) xub_StrLen nIdx = 0; xub_StrLen nKashidaPos = STRING_LEN; - xub_Unicode cCh; - xub_Unicode cPrevCh = 0; + sal_Unicode cCh; + sal_Unicode cPrevCh = 0; sal_uInt16 nPriorityLevel = 7; // 0..6 = level found // 7 not found @@ -1082,7 +1082,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL ) if ( isBaaChar ( cCh )) // Bah { // check if next character is Reh, Yeh or Alef Maksura - xub_Unicode cNextCh = rWord.GetChar( nIdx + 1 ); + sal_Unicode cNextCh = rWord.GetChar( nIdx + 1 ); if ( isRehChar ( cNextCh ) || isYehChar ( cNextCh )) { SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" ); @@ -1369,7 +1369,7 @@ sal_uInt8 SwScriptInfo::DirType( const xub_StrLen nPos ) const sal_uInt16 SwScriptInfo::MaskHiddenRanges( const SwTxtNode& rNode, XubString& rText, const xub_StrLen nStt, const xub_StrLen nEnd, - const xub_Unicode cChar ) + const sal_Unicode cChar ) { assert(rNode.GetTxt().Len() == rText.Len()); @@ -1821,7 +1821,7 @@ sal_uInt16 SwScriptInfo::KashidaJustify( sal_Int32* pKernArray, * character has to be checked because a ctl portion only contains one * script, see NewTxtPortion *************************************************************************/ -bool SwScriptInfo::IsArabicText( const rtl::OUString& rTxt, sal_Int32 nStt, sal_Int32 nLen ) +bool SwScriptInfo::IsArabicText( const OUString& rTxt, sal_Int32 nStt, sal_Int32 nLen ) { using namespace ::com::sun::star::i18n; static ScriptTypeList typeList[] = { @@ -1850,7 +1850,7 @@ bool SwScriptInfo::IsArabicText( const rtl::OUString& rTxt, sal_Int32 nStt, sal_ if( nIdx >= 0 ) { - const xub_Unicode cCh = rTxt[nIdx]; + const sal_Unicode cCh = rTxt[nIdx]; const sal_Int16 type = unicode::getUnicodeScriptType( cCh, typeList, UnicodeScript_kScriptCount ); return type == UnicodeScript_kArabic; } @@ -2034,7 +2034,7 @@ bool SwScriptInfo::MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen* pKashidaPo return true; } -sal_Int32 SwScriptInfo::ThaiJustify( const rtl::OUString& rTxt, sal_Int32* pKernArray, +sal_Int32 SwScriptInfo::ThaiJustify( const OUString& rTxt, sal_Int32* pKernArray, sal_Int32* pScrArray, sal_Int32 nStt, sal_Int32 nLen, sal_Int32 nNumberOfBlanks, long nSpaceAdd ) @@ -2049,7 +2049,7 @@ sal_Int32 SwScriptInfo::ThaiJustify( const rtl::OUString& rTxt, sal_Int32* pKern for (sal_Int32 nI = 0; nI < nLen; ++nI) { - const xub_Unicode cCh = rTxt[nStt + nI]; + const sal_Unicode cCh = rTxt[nStt + nI]; // check if character is not above or below base if ( ( 0xE34 > cCh || cCh > 0xE3A ) && diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index 5f5ec1fecdcf..fea58effdf8c 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -328,14 +328,14 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwMultiCreator& rCreate, sal_uInt8 nTmp = SW_SCRIPTS; if( pBracket->cPre > 255 ) { - String aTxt = rtl::OUString(pBracket->cPre); + String aTxt = OUString(pBracket->cPre); nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 ); } pBracket->nPreScript = nTmp; nTmp = SW_SCRIPTS; if( pBracket->cPost > 255 ) { - String aTxt = rtl::OUString(pBracket->cPost); + String aTxt = OUString(pBracket->cPost); nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 ); } pBracket->nPostScript = nTmp; @@ -428,7 +428,7 @@ void SwDoubleLinePortion::FormatBrackets( SwTxtFormatInfo &rInf, SwTwips& nMaxWi pBracket->nHeight = 0; if( pBracket->cPre ) { - rtl::OUString aStr( pBracket->cPre ); + OUString aStr( pBracket->cPre ); sal_uInt8 nActualScr = pTmpFnt->GetActual(); if( SW_SCRIPTS > pBracket->nPreScript ) pTmpFnt->SetActual( pBracket->nPreScript ); @@ -453,7 +453,7 @@ void SwDoubleLinePortion::FormatBrackets( SwTxtFormatInfo &rInf, SwTwips& nMaxWi pBracket->nPreWidth = 0; if( pBracket->cPost ) { - rtl::OUString aStr( pBracket->cPost ); + OUString aStr( pBracket->cPost ); if( SW_SCRIPTS > pBracket->nPostScript ) pTmpFnt->SetActual( pBracket->nPostScript ); SwFontSave aSave( rInf, pTmpFnt ); diff --git a/sw/source/core/text/porref.cxx b/sw/source/core/text/porref.cxx index b8dbc14b1cb5..7c619e67229b 100644 --- a/sw/source/core/text/porref.cxx +++ b/sw/source/core/text/porref.cxx @@ -70,7 +70,7 @@ KSHORT SwIsoRefPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const !rInf.GetOpt().IsReadonly() && !rInf.GetOpt().IsPagePreview() ) { if( !nViewWidth ) - pThis->nViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width(); + pThis->nViewWidth = rInf.GetTxtSize(OUString(' ')).Width(); } else pThis->nViewWidth = 0; diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index a992d41939bd..26b1910099ce 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -79,7 +79,7 @@ void SwTmpEndPortion::Paint( const SwTxtPaintInfo &rInf ) const if( rInf.OnWin() && rInf.GetOpt().IsParagraph() ) { SwDefFontSave aSave( rInf ); - const rtl::OUString aTmp( CH_PAR ); + const OUString aTmp( CH_PAR ); rInf.DrawText( aTmp, *this ); } } @@ -588,7 +588,7 @@ sal_Bool SwControlCharPortion::Format( SwTxtFormatInfo &rInf ) KSHORT SwControlCharPortion::GetViewWidth( const SwTxtSizeInfo& rInf ) const { if( !mnViewWidth ) - mnViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width(); + mnViewWidth = rInf.GetTxtSize(OUString(' ')).Width(); return mnViewWidth; } diff --git a/sw/source/core/text/portab.hxx b/sw/source/core/text/portab.hxx index 7159c6088ce6..3740a431d3c9 100644 --- a/sw/source/core/text/portab.hxx +++ b/sw/source/core/text/portab.hxx @@ -37,13 +37,13 @@ class SwTabPortion : public SwFixPortion { const KSHORT nTabPos; - const xub_Unicode cFill; + const sal_Unicode cFill; const bool bAutoTabStop; // Format() branches either into PreFormat() or PostFormat() sal_Bool PreFormat( SwTxtFormatInfo &rInf ); public: - SwTabPortion( const KSHORT nTabPos, const xub_Unicode cFill = '\0', const bool bAutoTab = true ); + SwTabPortion( const KSHORT nTabPos, const sal_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 ); @@ -65,7 +65,7 @@ public: class SwTabLeftPortion : public SwTabPortion { public: - inline SwTabLeftPortion( const KSHORT nTabPosVal, const xub_Unicode cFillChar='\0', bool bAutoTab = true ) + inline SwTabLeftPortion( const KSHORT nTabPosVal, const sal_Unicode cFillChar='\0', bool bAutoTab = true ) : SwTabPortion( nTabPosVal, cFillChar, bAutoTab ) { SetWhichPor( POR_TABLEFT ); } OUTPUT_OPERATOR @@ -78,7 +78,7 @@ public: class SwTabRightPortion : public SwTabPortion { public: - inline SwTabRightPortion( const KSHORT nTabPosVal, const xub_Unicode cFillChar='\0' ) + inline SwTabRightPortion( const KSHORT nTabPosVal, const sal_Unicode cFillChar='\0' ) : SwTabPortion( nTabPosVal, cFillChar ) { SetWhichPor( POR_TABRIGHT ); } OUTPUT_OPERATOR @@ -91,7 +91,7 @@ public: class SwTabCenterPortion : public SwTabPortion { public: - inline SwTabCenterPortion( const KSHORT nTabPosVal, const xub_Unicode cFillChar='\0' ) + inline SwTabCenterPortion( const KSHORT nTabPosVal, const sal_Unicode cFillChar='\0' ) : SwTabPortion( nTabPosVal, cFillChar ) { SetWhichPor( POR_TABCENTER ); } OUTPUT_OPERATOR @@ -103,7 +103,7 @@ public: class SwTabDecimalPortion : public SwTabPortion { - const xub_Unicode mcTab; + const sal_Unicode mcTab; /* * During text formatting, we already store the width of the portions @@ -113,14 +113,14 @@ class SwTabDecimalPortion : public SwTabPortion sal_uInt16 mnWidthOfPortionsUpTpDecimalPosition; public: - inline SwTabDecimalPortion( const KSHORT nTabPosVal, const xub_Unicode cTab, - const xub_Unicode cFillChar = '\0' ) + inline SwTabDecimalPortion( const KSHORT nTabPosVal, const sal_Unicode cTab, + const sal_Unicode cFillChar = '\0' ) : SwTabPortion( nTabPosVal, cFillChar ), mcTab(cTab), mnWidthOfPortionsUpTpDecimalPosition( USHRT_MAX ) { SetWhichPor( POR_TABDECIMAL ); } - inline xub_Unicode GetTabDecimal() const { return mcTab; } + inline sal_Unicode GetTabDecimal() const { return mcTab; } inline void SetWidthOfPortionsUpToDecimalPosition( sal_uInt16 nNew ) { @@ -142,8 +142,8 @@ public: class SwAutoTabDecimalPortion : public SwTabDecimalPortion { public: - inline SwAutoTabDecimalPortion( const KSHORT nTabPosVal, const xub_Unicode cTab, - const xub_Unicode cFillChar = '\0' ) + inline SwAutoTabDecimalPortion( const KSHORT nTabPosVal, const sal_Unicode cTab, + const sal_Unicode cFillChar = '\0' ) : SwTabDecimalPortion( nTabPosVal, cTab, cFillChar ) { SetLen( 0 ); } virtual void Paint( const SwTxtPaintInfo &rInf ) const; diff --git a/sw/source/core/text/portox.cxx b/sw/source/core/text/portox.cxx index df10d88f69d8..d940fa96d7fb 100644 --- a/sw/source/core/text/portox.cxx +++ b/sw/source/core/text/portox.cxx @@ -72,7 +72,7 @@ KSHORT SwIsoToxPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const !rInf.GetOpt().IsReadonly() && SwViewOption::IsFieldShadings() ) { if( !nViewWidth ) - pThis->nViewWidth = rInf.GetTxtSize(rtl::OUString(' ')).Width(); + pThis->nViewWidth = rInf.GetTxtSize(OUString(' ')).Width(); } else pThis->nViewWidth = 0; diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 0a8212b57b05..b42f016f8123 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -521,7 +521,7 @@ void SwTxtPortion::FormatEOL( SwTxtFormatInfo &rInf ) if( nHoleLen == GetLen() ) nBlankSize = Width(); else - nBlankSize = nHoleLen * rInf.GetTxtSize(rtl::OUString(' ')).Width(); + nBlankSize = nHoleLen * rInf.GetTxtSize(OUString(' ')).Width(); Width( Width() - nBlankSize ); rInf.X( rInf.X() - nBlankSize ); SetLen( GetLen() - nHoleLen ); @@ -559,13 +559,13 @@ void SwTxtPortion::Paint( const SwTxtPaintInfo &rInf ) const if (rInf.OnWin() && 1==rInf.GetLen() && CH_TXT_ATR_FIELDEND==rInf.GetTxt().GetChar(rInf.GetIdx())) { rInf.DrawBackBrush( *this ); - const rtl::OUString aTxt(CH_TXT_ATR_SUBST_FIELDEND); + const OUString aTxt(CH_TXT_ATR_SUBST_FIELDEND); rInf.DrawText( aTxt, *this, 0, aTxt.getLength(), false ); } else if (rInf.OnWin() && 1==rInf.GetLen() && CH_TXT_ATR_FIELDSTART==rInf.GetTxt().GetChar(rInf.GetIdx())) { rInf.DrawBackBrush( *this ); - const rtl::OUString aTxt(CH_TXT_ATR_SUBST_FIELDSTART); + const OUString aTxt(CH_TXT_ATR_SUBST_FIELDSTART); rInf.DrawText( aTxt, *this, 0, aTxt.getLength(), false ); } else if( GetLen() ) @@ -728,7 +728,7 @@ void SwHolePortion::Paint( const SwTxtPaintInfo &rInf ) const // #i16816# tagged pdf support if( rInf.GetVsh() && rInf.GetVsh()->GetViewOptions()->IsPDFExport() ) { - const rtl::OUString aTxt( ' ' ); + const OUString aTxt( ' ' ); rInf.DrawText( aTxt, *this, 0, 1, false ); } } @@ -768,19 +768,19 @@ sal_Bool SwFieldMarkPortion::Format( SwTxtFormatInfo & ) namespace { static sal_Int32 getCurrentListIndex( IFieldmark* pBM, - ::rtl::OUString* io_pCurrentText = NULL ) + OUString* io_pCurrentText = NULL ) { const IFieldmark::parameter_map_t* const pParameters = pBM->GetParameters(); sal_Int32 nCurrentIdx = 0; - const IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_RESULT))); + const IFieldmark::parameter_map_t::const_iterator pResult = pParameters->find(OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_RESULT))); if(pResult != pParameters->end()) pResult->second >>= nCurrentIdx; if(io_pCurrentText) { - const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_LISTENTRY))); + const IFieldmark::parameter_map_t::const_iterator pListEntries = pParameters->find(OUString(RTL_CONSTASCII_USTRINGPARAM(ODF_FORMDROPDOWN_LISTENTRY))); if(pListEntries != pParameters->end()) { - uno::Sequence< ::rtl::OUString > vListEntries; + uno::Sequence< OUString > vListEntries; pListEntries->second >>= vListEntries; if(nCurrentIdx < vListEntries.getLength()) *io_pCurrentText = vListEntries[nCurrentIdx]; @@ -814,7 +814,7 @@ void SwFieldFormPortion::Paint( const SwTxtPaintInfo& rInf ) const } else if ( pBM->GetFieldname( ) == ODF_FORMDROPDOWN ) { // a list... - rtl::OUString aTxt; + OUString aTxt; getCurrentListIndex( pBM, &aTxt ); rInf.DrawViewOpt( *this, POR_FLD ); rInf.DrawText( aTxt, *this, 0, aTxt.getLength(), false ); @@ -845,7 +845,7 @@ sal_Bool SwFieldFormPortion::Format( SwTxtFormatInfo & rInf ) } else if ( pBM->GetFieldname( ) == ODF_FORMDROPDOWN ) { - ::rtl::OUString aTxt; + OUString aTxt; getCurrentListIndex( pBM, &aTxt ); SwPosSize aPosSize = rInf.GetTxtSize( aTxt ); Width( aPosSize.Width( ) ); diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index a75cfa483970..c58cf8eb6fde 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -190,7 +190,7 @@ MSHORT SwTxtNode::GetDropLen( MSHORT nWishLen ) const xub_StrLen i = 0; for( ; i < nEnd; ++i ) { - xub_Unicode cChar = GetTxt().GetChar( i ); + sal_Unicode cChar = GetTxt().GetChar( i ); if( CH_TAB == cChar || CH_BREAK == cChar || (( CH_TXTATR_BREAKWORD == cChar || CH_TXTATR_INWORD == cChar ) && SwTxtSizeInfo::_HasHint( this, i ) ) ) diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 7e831542b90d..675d41009bbe 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -298,7 +298,7 @@ static SwFldPortion * lcl_NewMetaPortion(SwTxtAttr & rHint, const bool bPrefix) { ::sw::Meta *const pMeta( static_cast<SwFmtMeta &>(rHint.GetAttr()).GetMeta() ); - ::rtl::OUString fix; + OUString fix; ::sw::MetaField *const pField( dynamic_cast< ::sw::MetaField * >(pMeta) ); OSL_ENSURE(pField, "lcl_NewMetaPortion: no meta field?"); if (pField) diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index bc47cf41fa50..27b034b1bf8b 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -519,7 +519,7 @@ bool sw_HideObj( const SwTxtFrm& _rFrm, pIDSA->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) && _rFrm.IsInDocBody() && !_rFrm.FindNextCnt() ) { - const xub_Unicode cAnchorChar = + const sal_Unicode cAnchorChar = _rFrm.GetTxtNode()->GetTxt().GetChar( _nObjAnchorPos ); if ( cAnchorChar == CH_TXTATR_BREAKWORD ) { @@ -533,7 +533,7 @@ bool sw_HideObj( const SwTxtFrm& _rFrm, if ( pFrmFmt->Which() == RES_FLYFRMFMT ) { SwNodeIndex nCntntIndex = *(pFrmFmt->GetCntnt().GetCntntIdx()); - nCntntIndex++; + ++nCntntIndex; if ( nCntntIndex.GetNode().IsNoTxtNode() ) { bRet = false; @@ -1352,13 +1352,13 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) } // switch if( bSetFldsDirty ) - GetNode()->getIDocumentFieldsAccess()->SetFieldsDirty( sal_True, GetNode(), 1 ); + GetNode()->getIDocumentFieldsAccess()->SetFieldsDirty( true, GetNode(), 1 ); if ( bRecalcFtnFlag ) CalcFtnFlag(); } -sal_Bool SwTxtFrm::GetInfo( SfxPoolItem &rHnt ) const +bool SwTxtFrm::GetInfo( SfxPoolItem &rHnt ) const { if ( RES_VIRTPAGENUM_INFO == rHnt.Which() && IsInDocBody() && ! IsFollow() ) { @@ -1371,7 +1371,7 @@ sal_Bool SwTxtFrm::GetInfo( SfxPoolItem &rHnt ) const //Das sollte er sein (kann allenfalls temporaer anders sein, // sollte uns das beunruhigen?) rInfo.SetInfo( pPage, this ); - return sal_False; + return false; } if ( pPage->GetPhyPageNum() < rInfo.GetOrigPage()->GetPhyPageNum() && (!rInfo.GetPage() || pPage->GetPhyPageNum() > rInfo.GetPage()->GetPhyPageNum())) @@ -1381,7 +1381,7 @@ sal_Bool SwTxtFrm::GetInfo( SfxPoolItem &rHnt ) const } } } - return sal_True; + return true; } /************************************************************************* diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 9f24123fa791..6adc16637583 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -1517,7 +1517,7 @@ sal_Bool SwQuoVadisPortion::Format( SwTxtFormatInfo &rInf ) if( bFull ) { // zweiter Versuch, wir kuerzen den String: - aExpand = rtl::OUString("..."); + aExpand = OUString("..."); bFull = SwFldPortion::Format( rInf ); SetLen( 0 ); if( bFull ) @@ -1582,7 +1582,7 @@ void SwQuoVadisPortion::Paint( const SwTxtPaintInfo &rInf ) const SwFldPortion *SwErgoSumPortion::Clone( const XubString &rExpand ) const { - return new SwErgoSumPortion( rExpand, rtl::OUString() ); + return new SwErgoSumPortion( rExpand, OUString() ); } SwErgoSumPortion::SwErgoSumPortion( const XubString &rExp, const XubString& rStr ) diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index 66c601f62ee1..d6d767d2639e 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -399,7 +399,7 @@ sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) void SwHyphPortion::HandlePortion( SwPortionHandler& rPH ) const { - rtl::OUString aString( '-' ); + OUString aString( '-' ); rPH.Special( GetLen(), aString, GetWhichPor() ); } @@ -467,7 +467,7 @@ KSHORT SwSoftHyphPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const { if( !nViewWidth ) ((SwSoftHyphPortion*)this)->nViewWidth - = rInf.GetTxtSize(rtl::OUString('-')).Width(); + = rInf.GetTxtSize(OUString('-')).Width(); } else ((SwSoftHyphPortion*)this)->nViewWidth = 0; @@ -626,7 +626,7 @@ sal_Bool SwSoftHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTx void SwSoftHyphPortion::HandlePortion( SwPortionHandler& rPH ) const { - const rtl::OUString aString( '-' ); + const OUString aString( '-' ); const sal_uInt16 nWhich = ! Width() ? POR_SOFTHYPH_COMP : GetWhichPor(); diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index 0bd8b9ae95ee..6342731f25f4 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -83,8 +83,8 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) { SwTabPortion *pTabPor = 0; - xub_Unicode cFill = 0; - xub_Unicode cDec = 0; + sal_Unicode cFill = 0; + sal_Unicode cDec = 0; SvxTabAdjust eAdj; KSHORT nNewTabPos; @@ -329,7 +329,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto ) // Die Basisklasse wird erstmal ohne alles initialisiert. -SwTabPortion::SwTabPortion( const KSHORT nTabPosition, const xub_Unicode cFillChar, const bool bAutoTab ) +SwTabPortion::SwTabPortion( const KSHORT nTabPosition, const sal_Unicode cFillChar, const bool bAutoTab ) : SwFixPortion( 0, 0 ), nTabPos(nTabPosition), cFill(cFillChar), bAutoTabStop( bAutoTab ) { nLineLength = 1; @@ -401,7 +401,7 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf ) static_cast<SwNumberPortion*>(rInf.GetLast())->GetFont(); pSave.reset( new SwFontSave( rInf, const_cast<SwFont*>(pNumberPortionFont) ) ); } - rtl::OUString aTmp( ' ' ); + OUString aTmp( ' ' ); SwTxtSizeInfo aInf( rInf, aTmp ); nMinimumTabWidth = aInf.GetTxtSize().Width(); } @@ -617,7 +617,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const if( rInf.GetFont()->IsPaintBlank() ) { // tabs with filling / filled tabs - UniString aTxt = rtl::OUString(' '); + UniString aTxt = OUString(' '); const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width(); // robust: if( nCharWidth ) @@ -632,7 +632,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const if( IsFilled() ) { // tabs with filling / filled tabs - UniString aTxt = rtl::OUString(cFill); + UniString aTxt = OUString(cFill); const KSHORT nCharWidth = rInf.GetTxtSize( aTxt ).Width(); OSL_ENSURE( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" ); // robust: diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx index 550bf4f3a503..385d974c20bf 100644 --- a/sw/source/core/text/wrong.cxx +++ b/sw/source/core/text/wrong.cxx @@ -504,7 +504,7 @@ void SwWrongList::InsertSubList( xub_StrLen nNewPos, xub_StrLen nNewLen, sal_uIn i = maList.end(); // robust else i += nWhere; - maList.insert(i, SwWrongArea( rtl::OUString(), 0, nNewPos, nNewLen, pSubList ) ); + maList.insert(i, SwWrongArea( OUString(), 0, nNewPos, nNewLen, pSubList ) ); } @@ -597,7 +597,7 @@ bool SwWrongList::LookForEntry( xub_StrLen nBegin, xub_StrLen nEnd ) { return false; } -void SwWrongList::Insert( const rtl::OUString& rType, +void SwWrongList::Insert( const OUString& rType, com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag, xub_StrLen nNewPos, xub_StrLen nNewLen ) { diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index e3ae11ad8208..dc4c7c4fc9b6 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -177,8 +177,8 @@ class XmlPortionDumper:public SwPortionHandler xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "nType" ), "%s", getTypeName( nType ) ); - rtl::OUString sText( rText ); - rtl::OString sText8 =::rtl::OUStringToOString( sText, + OUString sText( rText ); + OString sText8 =::rtl::OUStringToOString( sText, RTL_TEXTENCODING_UTF8 ); xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "rText" ), "%s", sText8.getStr( ) ); @@ -326,12 +326,12 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer ) if ( IsTxtFrm( ) ) { SwTxtFrm *pTxtFrm = ( SwTxtFrm * ) this; - rtl::OUString aTxt = pTxtFrm->GetTxt( ); + OUString aTxt = pTxtFrm->GetTxt( ); for ( int i = 0; i < 32; i++ ) { aTxt = aTxt.replace( i, '*' ); } - rtl::OString aTxt8 =::rtl::OUStringToOString( aTxt, + OString aTxt8 =::rtl::OUStringToOString( aTxt, RTL_TEXTENCODING_UTF8 ); xmlTextWriterWriteString( writer, ( const xmlChar * ) aTxt8.getStr( ) ); @@ -382,7 +382,7 @@ void SwFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer ) if (IsHeaderFrm() || IsFooterFrm()) { SwHeadFootFrm *pHeadFootFrm = (SwHeadFootFrm*)this; - rtl::OUString aFmtName = pHeadFootFrm->GetFmt()->GetName(); + OUString aFmtName = pHeadFootFrm->GetFmt()->GetName(); xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "fmtName" ), "%s", BAD_CAST(rtl::OUStringToOString(aFmtName, RTL_TEXTENCODING_UTF8).getStr())); xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "fmtPtr" ), "%p", pHeadFootFrm->GetFmt()); } diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index a515b1665987..135572f0e10d 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -52,7 +52,7 @@ #include <comcore.hrc> #include <numrule.hxx> -extern sal_Bool IsFrameBehind( const SwTxtNode& rMyNd, xub_StrLen nMySttPos, +extern bool IsFrameBehind( const SwTxtNode& rMyNd, xub_StrLen nMySttPos, const SwTxtNode& rBehindNd, xub_StrLen nSttPos ); using namespace ::com::sun::star; @@ -213,9 +213,9 @@ void SwTOXSortTabBase::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, rNd.InsertText( sMyTxt, rInsPos ); } -sal_Bool SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp ) +bool SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp ) { - sal_Bool bRet = nPos == rCmp.nPos && nCntPos == rCmp.nCntPos && + bool bRet = nPos == rCmp.nPos && nCntPos == rCmp.nCntPos && (!aTOXSources[0].pNd || !rCmp.aTOXSources[0].pNd || aTOXSources[0].pNd == rCmp.aTOXSources[0].pNd ); @@ -247,15 +247,15 @@ sal_Bool SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp ) return bRet; } -sal_Bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) +bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) { if( nPos < rCmp.nPos ) - return sal_True; + return true; if( nPos == rCmp.nPos ) { if( nCntPos < rCmp.nCntPos ) - return sal_True; + return true; if( nCntPos == rCmp.nCntPos ) { @@ -267,7 +267,7 @@ sal_Bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) if( TOX_SORT_CONTENT == nType && pTxtMark && rCmp.pTxtMark ) { if( *pTxtMark->GetStart() < *rCmp.pTxtMark->GetStart() ) - return sal_True; + return true; if( *pTxtMark->GetStart() == *rCmp.pTxtMark->GetStart() ) { @@ -289,7 +289,7 @@ sal_Bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) sOtherTxt, sOtherTxtReading, rCmp.GetLocale() ); if( pEnd && !pEndCmp ) - return sal_True; + return true; } } } @@ -299,7 +299,7 @@ sal_Bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) *(SwTxtNode*)pFirst, nCntPos ); } } - return sal_False; + return false; } /*-------------------------------------------------------------------- @@ -324,13 +324,13 @@ SwTOXIndex::SwTOXIndex( const SwTxtNode& rNd, // -sal_Bool SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase ) +bool SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase ) { SwTOXIndex& rCmp = (SwTOXIndex&)rCmpBase; // Respect case taking dependencies into account if(GetLevel() != rCmp.GetLevel() || nKeyLevel != rCmp.nKeyLevel) - return sal_False; + return false; OSL_ENSURE(pTxtMark, "pTxtMark == 0, No keyword"); @@ -342,7 +342,7 @@ sal_Bool SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase ) String sOtherTxtReading; rCmp.GetTxt( sOtherTxt, sOtherTxtReading ); - sal_Bool bRet = pTOXIntl->IsEqual( sMyTxt, sMyTxtReading, GetLocale(), + bool bRet = pTOXIntl->IsEqual( sMyTxt, sMyTxtReading, GetLocale(), sOtherTxt, sOtherTxtReading, rCmp.GetLocale() ); // If we don't summarize we need to evaluate the Pos @@ -355,7 +355,7 @@ sal_Bool SwTOXIndex::operator==( const SwTOXSortTabBase& rCmpBase ) // // operator, only depends on the text -sal_Bool SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase ) +bool SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase ) { SwTOXIndex& rCmp = (SwTOXIndex&)rCmpBase; @@ -369,7 +369,7 @@ sal_Bool SwTOXIndex::operator<( const SwTOXSortTabBase& rCmpBase ) String sOtherTxtReading; rCmp.GetTxt( sOtherTxt, sOtherTxtReading ); - sal_Bool bRet = GetLevel() == rCmp.GetLevel() && + bool bRet = GetLevel() == rCmp.GetLevel() && pTOXIntl->IsLess( sMyTxt, sMyTxtReading, GetLocale(), sOtherTxt, sOtherTxtReading, rCmp.GetLocale() ); @@ -476,7 +476,7 @@ SwTOXCustom::SwTOXCustom(const String& rStr, const String& rReading, } -sal_Bool SwTOXCustom::operator==(const SwTOXSortTabBase& rCmpBase) +bool SwTOXCustom::operator==(const SwTOXSortTabBase& rCmpBase) { String sMyTxt; String sMyTxtReading; @@ -492,7 +492,7 @@ sal_Bool SwTOXCustom::operator==(const SwTOXSortTabBase& rCmpBase) } -sal_Bool SwTOXCustom::operator < (const SwTOXSortTabBase& rCmpBase) +bool SwTOXCustom::operator < (const SwTOXSortTabBase& rCmpBase) { String sMyTxt; String sMyTxtReading; @@ -826,16 +826,16 @@ void SwTOXAuthority::FillText( SwTxtNode& rNd, rNd.InsertText( sText, rInsPos ); } -sal_Bool SwTOXAuthority::operator==( const SwTOXSortTabBase& rCmp) +bool SwTOXAuthority::operator==( const SwTOXSortTabBase& rCmp) { return nType == rCmp.nType && ((SwAuthorityField*)m_rField.GetFld())->GetHandle() == ((SwAuthorityField*)((SwTOXAuthority&)rCmp).m_rField.GetFld())->GetHandle(); } -sal_Bool SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase) +bool SwTOXAuthority::operator<( const SwTOXSortTabBase& rBase) { - sal_Bool bRet = sal_False; + bool bRet = false; SwAuthorityField* pField = (SwAuthorityField*)m_rField.GetFld(); SwAuthorityFieldType* pType = (SwAuthorityFieldType*) pField->GetTyp(); diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index b0b07573f187..dccc014a7b75 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -248,16 +248,16 @@ void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) pTxtAttr->Expand(); } -sal_Bool SwFmtFld::GetInfo( SfxPoolItem& rInfo ) const +bool SwFmtFld::GetInfo( SfxPoolItem& rInfo ) const { const SwTxtNode* pTxtNd; if( RES_AUTOFMT_DOCNODE != rInfo.Which() || !pTxtAttr || 0 == ( pTxtNd = pTxtAttr->GetpTxtNode() ) || &pTxtNd->GetNodes() != ((SwAutoFmtGetDocNode&)rInfo).pNodes ) - return sal_True; + return true; ((SwAutoFmtGetDocNode&)rInfo).pCntntNode = pTxtNd; - return sal_False; + return false; } diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 6000271685f8..ab78c1565991 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -388,7 +388,7 @@ void SwTxtFtn::CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const // before: Src: SxxxE, Dst: SnE // now: Src: SxxxE, Dst: SnxxxE // after: Src: SxxxE, Dst: SxxxE - aStart++; + ++aStart; rDstNodes.Delete( aStart, nDestLen ); } diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index c8f8f0129ee2..6c53257c47b9 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -119,9 +119,9 @@ void SwFmtCharFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) // weiterleiten an das TextAttribut -sal_Bool SwFmtCharFmt::GetInfo( SfxPoolItem& rInfo ) const +bool SwFmtCharFmt::GetInfo( SfxPoolItem& rInfo ) const { - return pTxtAttr ? pTxtAttr->GetInfo( rInfo ) : sal_False; + return pTxtAttr ? pTxtAttr->GetInfo( rInfo ) : false; } bool SwFmtCharFmt::QueryValue( uno::Any& rVal, sal_uInt8 ) const { diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index e7e1e1855c16..289708b407ba 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -632,7 +632,7 @@ void SwFntObj::SetDevFont( const ViewShell *pSh, OutputDevice& rOut ) * *************************************************************************/ -static sal_uInt8 lcl_WhichPunctuation( xub_Unicode cChar ) +static sal_uInt8 lcl_WhichPunctuation( sal_Unicode cChar ) { if ( ( cChar < 0x3001 || cChar > 0x3002 ) && ( cChar < 0x3008 || cChar > 0x3011 ) && @@ -655,8 +655,8 @@ static sal_uInt8 lcl_WhichPunctuation( xub_Unicode cChar ) static sal_Bool lcl_IsMonoSpaceFont( const OutputDevice& rOut ) { - const rtl::OUString aStr1( xub_Unicode( 0x3008 ) ); - const rtl::OUString aStr2( xub_Unicode( 0x307C ) ); + const rtl::OUString aStr1( sal_Unicode( 0x3008 ) ); + const rtl::OUString aStr2( sal_Unicode( 0x307C ) ); const long nWidth1 = rOut.GetTextWidth( aStr1 ); const long nWidth2 = rOut.GetTextWidth( aStr2 ); return nWidth1 == nWidth2; @@ -991,7 +991,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) long nNextFix; // punctuation characters are not centered - xub_Unicode cChar = rInf.GetText().GetChar( rInf.GetIdx() ); + sal_Unicode cChar = rInf.GetText().GetChar( rInf.GetIdx() ); sal_uInt8 nType = lcl_WhichPunctuation( cChar ); switch ( nType ) { @@ -1558,7 +1558,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) nCnt = nCnt - rInf.GetIdx(); nCnt = Min( nCnt, rInf.GetLen() ); long nKernSum = rInf.GetKern(); - xub_Unicode cChPrev = rInf.GetText().GetChar( rInf.GetIdx() ); + sal_Unicode cChPrev = rInf.GetText().GetChar( rInf.GetIdx() ); // In case of a single underlined space in justified text, // have to output 2 spaces: @@ -1582,7 +1582,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) } else { - xub_Unicode nCh; + sal_Unicode nCh; // In case of Pair Kerning the printer influence on the positioning // grows @@ -1936,9 +1936,9 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) else nCnt = nCnt - rInf.GetIdx(); nCnt = Min (nCnt, nLn); - xub_Unicode nChPrev = rInf.GetText().GetChar( rInf.GetIdx() ); + sal_Unicode nChPrev = rInf.GetText().GetChar( rInf.GetIdx() ); - xub_Unicode nCh; + sal_Unicode nCh; // In case of Pair Kerning the printer influence on the positioning // grows diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 44fe54d81ae6..4cd6c6264d4f 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1032,7 +1032,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen, for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); ppMark != pMarkAccess->getMarksEnd(); - ppMark++) + ++ppMark) { // Bookmarks must never grow to either side, when // editing (directly) to the left or right (#i29942#)! @@ -1108,8 +1108,8 @@ void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl, // Wenn man sich genau am Ende einer Text- bzw. INetvorlage befindet, // bekommt diese das DontExpand-Flag verpasst -sal_Bool SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag, - sal_Bool bFmtToTxtAttributes ) +bool SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag, + bool bFmtToTxtAttributes ) { const xub_StrLen nIdx = rIdx.GetIndex(); if ( bFmtToTxtAttributes && nIdx == m_Text.Len() ) @@ -1117,7 +1117,7 @@ sal_Bool SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag, FmtToTxtAttr( this ); } - sal_Bool bRet = sal_False; + bool bRet = false; if ( HasHints() ) { const sal_uInt16 nEndCnt = m_pSwpHints->GetEndCount(); @@ -1133,7 +1133,7 @@ sal_Bool SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag, else if( bFlag != pTmp->DontExpand() && !pTmp->IsLockExpandFlag() && *pEnd > *pTmp->GetStart()) { - bRet = sal_True; + bRet = true; m_pSwpHints->NoteInHistory( pTmp ); pTmp->SetDontExpand( bFlag ); } @@ -1727,10 +1727,10 @@ void SwTxtNode::InsertText( const XubString & rStr, const SwIndex & rIdx, if ( !nLen ) return; - sal_Bool bOldExpFlg = IsIgnoreDontExpand(); + bool bOldExpFlg = IsIgnoreDontExpand(); if (nMode & IDocumentContentOperations::INS_FORCEHINTEXPAND) { - SetIgnoreDontExpand( sal_True ); + SetIgnoreDontExpand( true ); } Update( rIdx, nLen ); // text content changed! @@ -2967,7 +2967,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, sTmpText.SearchAndReplaceAll('\t', ' '); // mask hidden characters - const xub_Unicode cChar = CH_TXTATR_BREAKWORD; + const sal_Unicode cChar = CH_TXTATR_BREAKWORD; sal_uInt16 nHiddenChrs = SwScriptInfo::MaskHiddenRanges( *this, sTmpText, 0, sTmpText.Len(), cChar ); @@ -3015,7 +3015,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, ->ExpandField(true)); if( aExpand.Len() ) { - aDestIdx++; // dahinter einfuegen; + ++aDestIdx; // dahinter einfuegen; rDestNd.InsertText( aExpand, aDestIdx ); aDestIdx = nInsPos + nAttrStartIdx; nInsPos = nInsPos + aExpand.Len(); @@ -3041,7 +3041,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, GetNumStr( rFtn.GetNumber() ); if( sExpand.Len() ) { - aDestIdx++; // insert behind + ++aDestIdx; // insert behind SvxEscapementItem aItem( SVX_ESCAPEMENT_SUPERSCRIPT ); rDestNd.InsertItem(aItem, @@ -3330,8 +3330,8 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen, } } - sal_Bool bOldExpFlg = IsIgnoreDontExpand(); - SetIgnoreDontExpand( sal_True ); + bool bOldExpFlg = IsIgnoreDontExpand(); + SetIgnoreDontExpand( true ); if( nLen && rText.Len() ) { @@ -3339,7 +3339,7 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen, // Dadurch wird die Attributierung des 1. Zeichen expandiert! m_Text.SetChar( nStartPos, rText.GetChar( 0 ) ); - ((SwIndex&)rStart)++; + ++((SwIndex&)rStart); m_Text.Erase( rStart.GetIndex(), nLen - 1 ); Update( rStart, nLen - 1, true ); @@ -3376,7 +3376,7 @@ namespace { SwPaM aPam( rTxtNode ); // #i96644# // suppress side effect "send data changed events" - rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False, aAttrs, false ); + rTxtNode.GetDoc()->ResetAttrs( aPam, false, aAttrs, false ); } // Helper method for special handling of modified attributes at text node. diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 10a78df2fdb6..8d179e3a87b1 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1146,7 +1146,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) case RES_DBNUMSETFLD: case RES_DBNEXTSETFLD: if( !pDoc->IsNewFldLst() && GetNodes().IsDocNodes() ) - pDoc->InsDelFldInFldLst( sal_False, *(SwTxtFld*)pAttr ); + pDoc->InsDelFldInFldLst( false, *(SwTxtFld*)pAttr ); break; case RES_DDEFLD: if( GetNodes().IsDocNodes() && @@ -2122,7 +2122,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_uInt16 nLength, { // insert dummy span covering the gap o_rSpanMap.insert(AttrSpanMap_t::value_type( - AttrSpan_t(nLastEnd, aSpan.first), 0)); + AttrSpan_t(nLastEnd, aSpan.first), (const SwTxtAttr *)0)); } nLastEnd = aSpan.second; @@ -2133,7 +2133,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_uInt16 nLength, if (nLastEnd != nLength && nLength != 0) { o_rSpanMap.insert( - AttrSpanMap_t::value_type(AttrSpan_t(nLastEnd, nLength), 0)); + AttrSpanMap_t::value_type(AttrSpan_t(nLastEnd, nLength), (const SwTxtAttr *)0)); } } @@ -2627,9 +2627,9 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, case RES_DBNEXTSETFLD: { if( bDelFirst ) - pDoc->InsDelFldInFldLst( sal_False, *(SwTxtFld*)pHint ); + pDoc->InsDelFldInFldLst( false, *(SwTxtFld*)pHint ); if( rNode.GetNodes().IsDocNodes() ) - pDoc->InsDelFldInFldLst( sal_True, *(SwTxtFld*)pHint ); + pDoc->InsDelFldInFldLst( true, *(SwTxtFld*)pHint ); } break; case RES_DDEFLD: diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx index 53912958df97..cdb40b77c954 100644 --- a/sw/source/core/txtnode/txatritr.cxx +++ b/sw/source/core/txtnode/txatritr.cxx @@ -32,7 +32,7 @@ using namespace ::com::sun::star::i18n; -SwScriptIterator::SwScriptIterator( const String& rStr, xub_StrLen nStt, sal_Bool bFrwrd ) +SwScriptIterator::SwScriptIterator( const String& rStr, xub_StrLen nStt, bool bFrwrd ) : rText( rStr ), nChgPos( rStr.Len() ), nCurScript( ScriptType::WEAK ), @@ -65,9 +65,9 @@ SwScriptIterator::SwScriptIterator( const String& rStr, xub_StrLen nStt, sal_Boo } } -sal_Bool SwScriptIterator::Next() +bool SwScriptIterator::Next() { - sal_Bool bRet = sal_False; + bool bRet = false; if( pBreakIt->GetBreakIter().is() ) { if ( bForward && nChgPos < rText.Len() ) @@ -75,7 +75,7 @@ sal_Bool SwScriptIterator::Next() nCurScript = pBreakIt->GetBreakIter()->getScriptType( rText, nChgPos ); nChgPos = (xub_StrLen)pBreakIt->GetBreakIter()->endOfScript( rText, nChgPos, nCurScript ); - bRet = sal_True; + bRet = true; } else if ( ! bForward && nChgPos ) { @@ -83,7 +83,7 @@ sal_Bool SwScriptIterator::Next() nCurScript = pBreakIt->GetBreakIter()->getScriptType( rText, nChgPos ); nChgPos = (xub_StrLen)pBreakIt->GetBreakIter()->beginOfScript( rText, nChgPos, nCurScript ); - bRet = sal_True; + bRet = true; } } else @@ -95,7 +95,7 @@ sal_Bool SwScriptIterator::Next() SwTxtAttrIterator::SwTxtAttrIterator( const SwTxtNode& rTNd, sal_uInt16 nWhchId, xub_StrLen nStt, - sal_Bool bUseGetWhichOfScript ) + bool bUseGetWhichOfScript ) : aSIter( rTNd.GetTxt(), nStt ), rTxtNd( rTNd ), pParaItem( 0 ), nChgPos( nStt ), nAttrPos( 0 ), nWhichId( nWhchId ), bIsUseGetWhichOfScript( bUseGetWhichOfScript ) @@ -103,12 +103,12 @@ SwTxtAttrIterator::SwTxtAttrIterator( const SwTxtNode& rTNd, sal_uInt16 nWhchId, SearchNextChg(); } -sal_Bool SwTxtAttrIterator::Next() +bool SwTxtAttrIterator::Next() { - sal_Bool bRet = sal_False; + bool bRet = false; if( nChgPos < aSIter.GetText().Len() ) { - bRet = sal_True; + bRet = true; if( !aStack.empty() ) { do { diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 8e5b65d57c18..73df9bf7c71b 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -199,16 +199,16 @@ void SwTxtINetFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) } // erfrage vom Modify Informationen -sal_Bool SwTxtINetFmt::GetInfo( SfxPoolItem& rInfo ) const +bool SwTxtINetFmt::GetInfo( SfxPoolItem& rInfo ) const { if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode || &m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes ) { - return sal_True; + return true; } static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = m_pTxtNode; - return sal_False; + return false; } sal_Bool SwTxtINetFmt::IsProtect( ) const @@ -247,16 +247,16 @@ void SwTxtRuby::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) } } -sal_Bool SwTxtRuby::GetInfo( SfxPoolItem& rInfo ) const +bool SwTxtRuby::GetInfo( SfxPoolItem& rInfo ) const { if( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTxtNode || &m_pTxtNode->GetNodes() != static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes ) { - return sal_True; + return true; } static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = m_pTxtNode; - return sal_False; + return false; } SwCharFmt* SwTxtRuby::GetCharFmt() diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 97e680aa4abe..f0d6980d3a9b 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -105,7 +105,7 @@ extern SwTxtFrm *pLinguFrm; static sal_uInt16 lcl_MaskRedlines( const SwTxtNode& rNode, XubString& rText, const xub_StrLen nStt, const xub_StrLen nEnd, - const xub_Unicode cChar ) + const sal_Unicode cChar ) { sal_uInt16 nNumOfMaskedRedlines = 0; @@ -150,7 +150,7 @@ static sal_uInt16 lcl_MaskRedlines( const SwTxtNode& rNode, XubString& rText, static sal_uInt16 lcl_MaskRedlinesAndHiddenText( const SwTxtNode& rNode, XubString& rText, const xub_StrLen nStt, const xub_StrLen nEnd, - const xub_Unicode cChar = CH_TXTATR_INWORD, + const sal_Unicode cChar = CH_TXTATR_INWORD, bool bCheckShowHiddenChar = true ) { sal_uInt16 nRedlinesMasked = 0; @@ -1139,7 +1139,6 @@ sal_uInt16 SwTxtNode::Convert( SwConversionArgs &rArgs ) if (bFound && bInSelection) // convertible text found within selection/range? { - const XubString aTxtPortion = m_Text.Copy( nBegin, nLen ); OSL_ENSURE( m_Text.Len() > 0, "convertible text portion missing!" ); rArgs.aConvText = m_Text.Copy( nBegin, nLen ); rArgs.nConvTextLang = nLangFound; diff --git a/sw/source/core/undo/SwUndoFmt.cxx b/sw/source/core/undo/SwUndoFmt.cxx index 3dfb373cb3d6..794638570e26 100644 --- a/sw/source/core/undo/SwUndoFmt.cxx +++ b/sw/source/core/undo/SwUndoFmt.cxx @@ -177,7 +177,7 @@ void SwUndoRenameFmt::UndoImpl(::sw::UndoRedoContext &) if (pFmt) { - pDoc->RenameFmt(*pFmt, sOldName, sal_True); + pDoc->RenameFmt(*pFmt, sOldName, true); } } @@ -187,7 +187,7 @@ void SwUndoRenameFmt::RedoImpl(::sw::UndoRedoContext &) if (pFmt) { - pDoc->RenameFmt(*pFmt, sNewName, sal_True); + pDoc->RenameFmt(*pFmt, sNewName, true); } } @@ -215,7 +215,7 @@ SwFmt * SwUndoTxtFmtCollCreate::Create(SwFmt * pDerivedFrom) void SwUndoTxtFmtCollCreate::Delete() { - pDoc->DelTxtFmtColl((SwTxtFmtColl *) pNew, sal_True); + pDoc->DelTxtFmtColl((SwTxtFmtColl *) pNew, true); } SwFmt * SwUndoTxtFmtCollCreate::Find(const String & rName) const @@ -236,7 +236,7 @@ SwFmt * SwUndoTxtFmtCollDelete::Create(SwFmt * pDerivedFrom) void SwUndoTxtFmtCollDelete::Delete(SwFmt * pOld) { - pDoc->DelTxtFmtColl((SwTxtFmtColl *) pOld, sal_True); + pDoc->DelTxtFmtColl((SwTxtFmtColl *) pOld, true); } SwFmt * SwUndoTxtFmtCollDelete::Find(const String & rName) const @@ -265,12 +265,12 @@ SwUndoCharFmtCreate::SwUndoCharFmtCreate(SwCharFmt * pNewFmt, SwFmt * SwUndoCharFmtCreate::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeCharFmt(sNewName, (SwCharFmt *) pDerivedFrom, sal_True); + return pDoc->MakeCharFmt(sNewName, (SwCharFmt *) pDerivedFrom, true); } void SwUndoCharFmtCreate::Delete() { - pDoc->DelCharFmt((SwCharFmt *) pNew, sal_True); + pDoc->DelCharFmt((SwCharFmt *) pNew, true); } SwFmt * SwUndoCharFmtCreate::Find(const String & rName) const @@ -285,12 +285,12 @@ SwUndoCharFmtDelete::SwUndoCharFmtDelete(SwCharFmt * pOld, SwDoc * pDocument) SwFmt * SwUndoCharFmtDelete::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeCharFmt(sOldName, (SwCharFmt *) pDerivedFrom, sal_True); + return pDoc->MakeCharFmt(sOldName, (SwCharFmt *) pDerivedFrom, true); } void SwUndoCharFmtDelete::Delete(SwFmt * pFmt) { - pDoc->DelCharFmt((SwCharFmt *) pFmt, sal_True); + pDoc->DelCharFmt((SwCharFmt *) pFmt, true); } SwFmt * SwUndoCharFmtDelete::Find(const String & rName) const @@ -320,12 +320,12 @@ SwUndoFrmFmtCreate::SwUndoFrmFmtCreate(SwFrmFmt * pNewFmt, SwFmt * SwUndoFrmFmtCreate::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeFrmFmt(sNewName, (SwFrmFmt *) pDerivedFrom, sal_True, bAuto); + return pDoc->MakeFrmFmt(sNewName, (SwFrmFmt *) pDerivedFrom, true, bAuto); } void SwUndoFrmFmtCreate::Delete() { - pDoc->DelFrmFmt((SwFrmFmt *) pNew, sal_True); + pDoc->DelFrmFmt((SwFrmFmt *) pNew, true); } SwFmt * SwUndoFrmFmtCreate::Find(const String & rName) const @@ -340,12 +340,12 @@ SwUndoFrmFmtDelete::SwUndoFrmFmtDelete(SwFrmFmt * pOld, SwDoc * pDocument) SwFmt * SwUndoFrmFmtDelete::Create(SwFmt * pDerivedFrom) { - return pDoc->MakeFrmFmt(sOldName, (SwFrmFmt *) pDerivedFrom, sal_True); + return pDoc->MakeFrmFmt(sOldName, (SwFrmFmt *) pDerivedFrom, true); } void SwUndoFrmFmtDelete::Delete(SwFmt * pFmt) { - pDoc->DelFrmFmt((SwFrmFmt *) pFmt, sal_True); + pDoc->DelFrmFmt((SwFrmFmt *) pFmt, true); } SwFmt * SwUndoFrmFmtDelete::Find(const String & rName) const @@ -380,12 +380,12 @@ void SwUndoNumruleCreate::UndoImpl(::sw::UndoRedoContext &) bInitialized = true; } - pDoc->DelNumRule(aNew.GetName(), sal_True); + pDoc->DelNumRule(aNew.GetName(), true); } void SwUndoNumruleCreate::RedoImpl(::sw::UndoRedoContext &) { - pDoc->MakeNumRule(aNew.GetName(), &aNew, sal_True); + pDoc->MakeNumRule(aNew.GetName(), &aNew, true); } SwRewriter SwUndoNumruleCreate::GetRewriter() const @@ -411,12 +411,12 @@ SwUndoNumruleDelete::SwUndoNumruleDelete(const SwNumRule & rRule, void SwUndoNumruleDelete::UndoImpl(::sw::UndoRedoContext &) { - pDoc->MakeNumRule(aOld.GetName(), &aOld, sal_True); + pDoc->MakeNumRule(aOld.GetName(), &aOld, true); } void SwUndoNumruleDelete::RedoImpl(::sw::UndoRedoContext &) { - pDoc->DelNumRule(aOld.GetName(), sal_True); + pDoc->DelNumRule(aOld.GetName(), true); } SwRewriter SwUndoNumruleDelete::GetRewriter() const @@ -438,12 +438,12 @@ SwUndoNumruleRename::SwUndoNumruleRename(const String & _aOldName, void SwUndoNumruleRename::UndoImpl(::sw::UndoRedoContext &) { - pDoc->RenameNumRule(aNewName, aOldName, sal_True); + pDoc->RenameNumRule(aNewName, aOldName, true); } void SwUndoNumruleRename::RedoImpl(::sw::UndoRedoContext &) { - pDoc->RenameNumRule(aOldName, aNewName, sal_True); + pDoc->RenameNumRule(aOldName, aNewName, true); } SwRewriter SwUndoNumruleRename::GetRewriter() const diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx index abe49e44c639..04adadd1daa2 100644 --- a/sw/source/core/undo/SwUndoPageDesc.cxx +++ b/sw/source/core/undo/SwUndoPageDesc.cxx @@ -356,13 +356,13 @@ void SwUndoPageDescCreate::UndoImpl(::sw::UndoRedoContext &) } // <- #116530# - pDoc->DelPageDesc(aNew.GetName(), sal_True); + pDoc->DelPageDesc(aNew.GetName(), true); } void SwUndoPageDescCreate::DoImpl() { SwPageDesc aPageDesc = aNew; - pDoc->MakePageDesc(aNew.GetName(), &aPageDesc, sal_False, sal_True); // #116530# + pDoc->MakePageDesc(aNew.GetName(), &aPageDesc, false, true); // #116530# } void SwUndoPageDescCreate::RedoImpl(::sw::UndoRedoContext &) @@ -403,12 +403,12 @@ SwUndoPageDescDelete::~SwUndoPageDescDelete() void SwUndoPageDescDelete::UndoImpl(::sw::UndoRedoContext &) { SwPageDesc aPageDesc = aOld; - pDoc->MakePageDesc(aOld.GetName(), &aPageDesc, sal_False, sal_True); // #116530# + pDoc->MakePageDesc(aOld.GetName(), &aPageDesc, false, true); // #116530# } void SwUndoPageDescDelete::DoImpl() { - pDoc->DelPageDesc(aOld.GetName(), sal_True); // #116530# + pDoc->DelPageDesc(aOld.GetName(), true); // #116530# } void SwUndoPageDescDelete::RedoImpl(::sw::UndoRedoContext &) diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 1dbce4397ffc..f7a1894840fb 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -656,7 +656,7 @@ void SwUndoResetAttr::UndoImpl(::sw::UndoRedoContext & rContext) if( pTNd ) { SwIndex aIdx( pTNd, nSttCntnt ); - pTNd->DontExpandFmt( aIdx, sal_False ); + pTNd->DontExpandFmt( aIdx, false ); } } @@ -674,10 +674,10 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext) rDoc.RstTxtAttrs(rPam); break; case RES_TXTFMTCOLL: - rDoc.ResetAttrs(rPam, sal_False, m_Ids ); + rDoc.ResetAttrs(rPam, false, m_Ids ); break; case RES_CONDTXTFMTCOLL: - rDoc.ResetAttrs(rPam, sal_True, m_Ids ); + rDoc.ResetAttrs(rPam, true, m_Ids ); break; case RES_TXTATR_TOXMARK: @@ -1021,7 +1021,7 @@ void SwUndoDefaultAttr::RedoImpl(::sw::UndoRedoContext & rContext) } SwUndoMoveLeftMargin::SwUndoMoveLeftMargin( - const SwPaM& rPam, sal_Bool bFlag, sal_Bool bMod ) + const SwPaM& rPam, sal_Bool bFlag, bool bMod ) : SwUndo( bFlag ? UNDO_INC_LEFTMARGIN : UNDO_DEC_LEFTMARGIN ) , SwUndRng( rPam ) , m_pHistory( new SwHistory ) @@ -1168,7 +1168,7 @@ void SwUndoDontExpandFmt::UndoImpl(::sw::UndoRedoContext & rContext) SwPosition& rPos = *pPam->GetPoint(); rPos.nNode = m_nNodeIndex; rPos.nContent.Assign( rPos.nNode.GetNode().GetCntntNode(), m_nContentIndex); - pDoc->DontExpandFmt( rPos, sal_False ); + pDoc->DontExpandFmt( rPos, false ); } void SwUndoDontExpandFmt::RedoImpl(::sw::UndoRedoContext & rContext) diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx index 7d1b59c1f0dd..d279278e3520 100644 --- a/sw/source/core/undo/unmove.cxx +++ b/sw/source/core/undo/unmove.cxx @@ -306,7 +306,7 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext) if( nSttNode != nEndNode && bJoinTxt ) { - aIdx++; + ++aIdx; SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode(); if( pTxtNd && pTxtNd->CanJoinNext() ) { diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx index e1b9da720012..bb9e71af0d29 100644 --- a/sw/source/core/undo/unnum.cxx +++ b/sw/source/core/undo/unnum.cxx @@ -226,7 +226,7 @@ void SwUndoDelNum::AddNode( const SwTxtNode& rNd, sal_Bool ) } } -SwUndoMoveNum::SwUndoMoveNum( const SwPaM& rPam, long nOff, sal_Bool bIsOutlMv ) +SwUndoMoveNum::SwUndoMoveNum( const SwPaM& rPam, long nOff, bool bIsOutlMv ) : SwUndo( bIsOutlMv ? UNDO_OUTLINE_UD : UNDO_MOVENUM ), SwUndRng( rPam ), nNewStt( 0 ), nOffset( nOff ) @@ -271,7 +271,7 @@ void SwUndoMoveNum::RepeatImpl(::sw::RepeatContext & rContext) } else { - rDoc.MoveParagraph(rContext.GetRepeatPaM(), nOffset, sal_False); + rDoc.MoveParagraph(rContext.GetRepeatPaM(), nOffset, false); } } @@ -338,11 +338,11 @@ void SwUndoNumOrNoNum::RepeatImpl(::sw::RepeatContext & rContext) SwDoc & rDoc = rContext.GetDoc(); if (mbOldNum && ! mbNewNum) { - rDoc.NumOrNoNum(rContext.GetRepeatPaM().GetPoint()->nNode, sal_False); + rDoc.NumOrNoNum(rContext.GetRepeatPaM().GetPoint()->nNode, false); } else if ( ! mbOldNum && mbNewNum ) { - rDoc.NumOrNoNum(rContext.GetRepeatPaM().GetPoint()->nNode, sal_True); + rDoc.NumOrNoNum(rContext.GetRepeatPaM().GetPoint()->nNode, true); } } diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index c76b5b02482c..3c4899bdef07 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -82,8 +82,8 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, bInsChar = sal_False; } - sal_Bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); - pTxtNd->SetIgnoreDontExpand( sal_True ); + bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); + pTxtNd->SetIgnoreDontExpand( true ); pTxtNd->InsertText( rtl::OUString(cIns), rPos.nContent, IDocumentContentOperations::INS_EMPTYEXPAND ); @@ -160,8 +160,8 @@ sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, bInsChar = sal_True; } - sal_Bool bOldExpFlg = pDelTxtNd->IsIgnoreDontExpand(); - pDelTxtNd->SetIgnoreDontExpand( sal_True ); + bool bOldExpFlg = pDelTxtNd->IsIgnoreDontExpand(); + pDelTxtNd->SetIgnoreDontExpand( true ); pDelTxtNd->InsertText( rtl::OUString(cIns), rPos.nContent, IDocumentContentOperations::INS_EMPTYEXPAND ); @@ -211,10 +211,10 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext) String aTmpStr = rtl::OUString('1'); sal_Unicode* pTmpStr = aTmpStr.GetBufferAccess(); - sal_Bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); - pTxtNd->SetIgnoreDontExpand( sal_True ); + bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); + pTxtNd->SetIgnoreDontExpand( true ); - rIdx++; + ++rIdx; for( xub_StrLen n = 0; n < aDelStr.Len(); n++ ) { // do it individually, to keep the attributes! @@ -282,8 +282,8 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext) } rIdx.Assign( pTxtNd, aDelStr.Len() ? nSttCntnt+1 : nSttCntnt ); - sal_Bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); - pTxtNd->SetIgnoreDontExpand( sal_True ); + bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); + pTxtNd->SetIgnoreDontExpand( true ); for( xub_StrLen n = 0; n < aInsStr.Len(); n++ ) { @@ -382,7 +382,7 @@ void SwUndoTransliterate::RepeatImpl(::sw::RepeatContext & rContext) void SwUndoTransliterate::DoTransliterate(SwDoc & rDoc, SwPaM & rPam) { - utl::TransliterationWrapper aTrans( ::comphelper::getProcessServiceFactory(), nType ); + utl::TransliterationWrapper aTrans( ::comphelper::getProcessComponentContext(), nType ); rDoc.TransliterateText( rPam, aTrans ); } diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx index 9be5f6aa9701..0eb10427eed4 100644 --- a/sw/source/core/undo/unsort.cxx +++ b/sw/source/core/undo/unsort.cxx @@ -61,7 +61,7 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt) } SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTblNd, - const SwSortOptions& rOpt, sal_Bool bSaveTable ) + const SwSortOptions& rOpt, bool bSaveTable ) : SwUndo(UNDO_SORT_TBL), pUndoTblAttr( 0 ), pRedlData( 0 ) { nSttNode = nStt; diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx index 5fb481478a57..c10122336866 100644 --- a/sw/source/core/undo/unspnd.cxx +++ b/sw/source/core/undo/unspnd.cxx @@ -141,7 +141,7 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext) rPam.SetMark(); rPam.GetPoint()->nContent = pTNd->GetTxt().Len(); - pDoc->RstTxtAttrs( rPam, sal_True ); + pDoc->RstTxtAttrs( rPam, true ); pHistory->TmpRollback( pDoc, 0, false ); } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index cfe3b3c1204f..aab7ebd24d4f 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -653,7 +653,7 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext) rDoc.TableToText( pTblNd, cTrenner ); - aSaveIdx++; + ++aSaveIdx; SwCntntNode* pCNd = aSaveIdx.GetNode().GetCntntNode(); if( !pCNd && 0 == ( pCNd = rDoc.GetNodes().GoNext( &aSaveIdx ) ) && 0 == ( pCNd = rDoc.GetNodes().GoPrevious( &aSaveIdx )) ) @@ -2097,8 +2097,8 @@ void SwUndoTblMerge::MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& r pDoc->MoveNodeRange( rRg, rPos, (pSaveTbl->IsNewModel()) ? IDocumentContentOperations::DOC_NO_DELFRMS : IDocumentContentOperations::DOC_MOVEDEFAULT ); - aTmp++; - aTmp2++; + ++aTmp; + ++aTmp2; pUndo->SetDestRange( aTmp2, rPos, aTmp ); pMoves->push_back( pUndo ); diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index bebaeb21737f..aa029c9f5ba9 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -223,7 +223,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) if( !pTxtFmtColl ) // if 0 than it's no TextNode -> delete { SwNodeIndex aDelIdx( rIdx ); - rIdx++; + ++rIdx; SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); xub_StrLen nCnt = 0; if( pCNd ) diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx index 6397eebc2830..080d278dd7cb 100644 --- a/sw/source/core/unocore/swunohelper.cxx +++ b/sw/source/core/unocore/swunohelper.cxx @@ -123,19 +123,14 @@ sal_Bool UCB_IsCaseSensitiveFileName( const String& rURL ) sal_Bool bCaseSensitive; try { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = - comphelper::getProcessServiceFactory(); - INetURLObject aTempObj( rURL ); aTempObj.SetBase( aTempObj.GetBase().toAsciiLowerCase() ); ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xRef1 = new - ucbhelper::ContentIdentifier( xMSF, - aTempObj.GetMainURL( INetURLObject::NO_DECODE )); + ucbhelper::ContentIdentifier( aTempObj.GetMainURL( INetURLObject::NO_DECODE )); aTempObj.SetBase(aTempObj.GetBase().toAsciiUpperCase()); ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xRef2 = new - ucbhelper::ContentIdentifier( xMSF, - aTempObj.GetMainURL( INetURLObject::NO_DECODE )); + ucbhelper::ContentIdentifier( aTempObj.GetMainURL( INetURLObject::NO_DECODE )); ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XUniversalContentBroker > xUcb = com::sun::star::ucb::UniversalContentBroker::create(comphelper::getProcessComponentContext()); diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index d0ef2d838fef..6930e35e2618 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -1,31 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ - + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ #include <memory> #include <algorithm> @@ -36,7 +26,7 @@ #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <svl/zforlist.hxx> // SvNumberFormatter -#include <svtools/chartprettypainter.hxx> +#include <svx/charthelper.hxx> #include <XMLRangeHelper.hxx> #include <unochart.hxx> @@ -88,9 +78,9 @@ void SwChartHelper::DoUpdateAllCharts( SwDoc* pDoc ) SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); while( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) { - aIdx++; + ++aIdx; if (0 != ( pONd = aIdx.GetNode().GetOLENode() ) && - ChartPrettyPainter::IsChart( pONd->GetOLEObj().GetObject() ) ) + ChartHelper::IsChart( pONd->GetOLEObj().GetObject() ) ) { // Load the object and set modified @@ -164,7 +154,7 @@ void SwChartLockController_Helper::LockUnlockAllCharts( sal_Bool bLock ) SwNodeIndex aIdx( *pDoc->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); while( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) { - aIdx++; + ++aIdx; if (0 != ( pONd = aIdx.GetNode().GetOLENode() ) && pONd->GetChartTblName().Len() > 0 /* is chart object? */) { @@ -372,10 +362,10 @@ static void GetTableByName( const SwDoc &rDoc, const String &rTableName, // find frame format of table //! see SwXTextTables::getByName - sal_uInt16 nCount = rDoc.GetTblFrmFmtCount(sal_True); + sal_uInt16 nCount = rDoc.GetTblFrmFmtCount(true); for (sal_uInt16 i = 0; i < nCount && !pTblFmt; ++i) { - SwFrmFmt& rTblFmt = rDoc.GetTblFrmFmt(i, sal_True); + SwFrmFmt& rTblFmt = rDoc.GetTblFrmFmt(i, true); if(rTableName == rTblFmt.GetName()) pTblFmt = &rTblFmt; } diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 912bc40cef3b..846d7d20e6d0 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -123,10 +123,11 @@ public: { uno::Reference< beans::XPropertySet > xProps( mpDocShell->GetModel(), uno::UNO_QUERY_THROW ); uno::Reference< container::XNameAccess > xLibContainer( xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY_THROW ); - rtl::OUString sProjectName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Standard") ) ); - if ( mpDocShell->GetBasicManager()->GetName().Len() ) + rtl::OUString sProjectName( "Standard"); + if ( !mpDocShell->GetBasicManager()->GetName().isEmpty() ) + { sProjectName = mpDocShell->GetBasicManager()->GetName(); - + } uno::Reference< container::XNameAccess > xLib( xLibContainer->getByName( sProjectName ), uno::UNO_QUERY_THROW ); uno::Sequence< rtl::OUString > sModuleNames = xLib->getElementNames(); uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY ); @@ -878,7 +879,7 @@ sal_Int32 SwXTextTables::getCount(void) throw( uno::RuntimeException ) SolarMutexGuard aGuard; sal_Int32 nRet = 0; if(IsValid()) - nRet = GetDoc()->GetTblFrmFmtCount(sal_True); + nRet = GetDoc()->GetTblFrmFmtCount(true); return nRet; } @@ -889,9 +890,9 @@ uno::Any SAL_CALL SwXTextTables::getByIndex(sal_Int32 nIndex) uno::Any aRet; if(IsValid()) { - if(0 <= nIndex && GetDoc()->GetTblFrmFmtCount(sal_True) > nIndex) + if(0 <= nIndex && GetDoc()->GetTblFrmFmtCount(true) > nIndex) { - SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt( static_cast< xub_StrLen >(nIndex), sal_True); + SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt( static_cast< xub_StrLen >(nIndex), true); uno::Reference< XTextTable > xTbl = SwXTextTables::GetObject(rFmt); aRet.setValue( &xTbl, ::getCppuType((uno::Reference< XTextTable>*)0)); @@ -911,12 +912,12 @@ uno::Any SwXTextTables::getByName(const OUString& rItemName) uno::Any aRet; if(IsValid()) { - sal_uInt16 nCount = GetDoc()->GetTblFrmFmtCount(sal_True); + sal_uInt16 nCount = GetDoc()->GetTblFrmFmtCount(true); uno::Reference< XTextTable > xTbl; for( sal_uInt16 i = 0; i < nCount; i++) { String aName(rItemName); - SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt(i, sal_True); + SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt(i, true); if(aName == rFmt.GetName()) { xTbl = SwXTextTables::GetObject(rFmt); @@ -939,14 +940,14 @@ uno::Sequence< OUString > SwXTextTables::getElementNames(void) SolarMutexGuard aGuard; if(!IsValid()) throw uno::RuntimeException(); - sal_uInt16 nCount = GetDoc()->GetTblFrmFmtCount(sal_True); + sal_uInt16 nCount = GetDoc()->GetTblFrmFmtCount(true); uno::Sequence<OUString> aSeq(nCount); if(nCount) { OUString* pArray = aSeq.getArray(); for( sal_uInt16 i = 0; i < nCount; i++) { - SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt(i, sal_True); + SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt(i, true); pArray[i] = OUString(rFmt.GetName()); } @@ -961,11 +962,11 @@ sal_Bool SwXTextTables::hasByName(const OUString& rName) sal_Bool bRet= sal_False; if(IsValid()) { - sal_uInt16 nCount = GetDoc()->GetTblFrmFmtCount(sal_True); + sal_uInt16 nCount = GetDoc()->GetTblFrmFmtCount(true); for( sal_uInt16 i = 0; i < nCount; i++) { String aName(rName); - SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt(i, sal_True); + SwFrmFmt& rFmt = GetDoc()->GetTblFrmFmt(i, true); if(aName == rFmt.GetName()) { bRet = sal_True; @@ -990,7 +991,7 @@ sal_Bool SwXTextTables::hasElements(void) throw( uno::RuntimeException ) SolarMutexGuard aGuard; if(!IsValid()) throw uno::RuntimeException(); - return 0 != GetDoc()->GetTblFrmFmtCount(sal_True); + return 0 != GetDoc()->GetTblFrmFmtCount(true); } OUString SwXTextTables::getImplementationName(void) throw( uno::RuntimeException ) diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 130fd2a335b0..55127b130112 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -765,7 +765,7 @@ void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPa { std::set<sal_uInt16> aWhichIds; aWhichIds.insert( RES_TXTATR_CHARFMT); - pDoc->ResetAttrs(rPam, sal_True, aWhichIds); + pDoc->ResetAttrs(rPam, true, aWhichIds); } break; } @@ -899,7 +899,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, if(!nErrno) { - aSave++; + ++aSave; pUnoCrsr->SetMark(); pUnoCrsr->GetMark()->nNode = aSave; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 8605b97bdf11..f3e87cba0925 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -790,7 +790,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(), FLY_AT_PARA/*int eAnchorId*/, - sal_True, sal_False ); + true, false ); pPage->GetDrawView()->UnmarkAll(); if(pContact) @@ -824,7 +824,7 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG pDoc->UnGroupSelection( *pPage->GetDrawView() ); pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(), FLY_AT_PARA/*int eAnchorId*/, - sal_True, sal_False ); + true, false ); pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } pPage->RemovePageView(); @@ -1257,7 +1257,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A sal_Int32 nAnchor = 0; cppu::enum2int( nAnchor, aValue ); pDoc->ChgAnchor( aList, (RndStdIds)nAnchor, - sal_False, sal_True ); + false, true ); } else { diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index a3d2fe28ee08..71eb9debac2a 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1,31 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ - /************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ - + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> #include <com/sun/star/container/XChild.hpp> @@ -1072,7 +1062,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: // if document is currently in reading mode. if ( !pFmt->GetDoc()->IsInReading() ) { - // see SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, sal_Bool bKeepOrient, Point* pDocPos ) + // see SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, bool bKeepOrient, Point* pDocPos ) SwFlyFrm *pFly = 0; { const :: SwFrmFmt* pFmtXX = pFmt; @@ -1092,7 +1082,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: } } - pFmt->GetDoc()->SetFrmFmtToFly( *pFmt, *pFrmFmt, pSet, sal_False ); + pFmt->GetDoc()->SetFrmFmtToFly( *pFmt, *pFrmFmt, pSet, false ); delete pSet; } else @@ -1506,6 +1496,29 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) } aAny <<= OUString(sGrfName); } + else if( FN_UNO_REPLACEMENT_GRAPHIC_U_R_L == pEntry->nWID) + { + String sGrfName; + const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx(); + + if(pIdx) + { + SwNodeIndex aIdx(*pIdx, 1); + SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode(); + if(!pGrfNode) + throw uno::RuntimeException(); + + const GraphicObject* pGraphicObject = pGrfNode->GetReplacementGrfObj(); + + if(pGraphicObject) + { + OUString sPrefix( sGraphicObjectProtocol ); + (sGrfName = sPrefix) += OStringToOUString( pGraphicObject->GetUniqueID(), RTL_TEXTENCODING_ASCII_US ); + } + } + + aAny <<= OUString(sGrfName); + } else if( FN_UNO_GRAPHIC_FILTER == pEntry->nWID ) { String sFltName; diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 9e4b49bf2d45..d15b5cfc4a9e 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1302,7 +1302,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) } //TODO: apply Section attributes (columns and background) SwTOXBaseSection const*const pTOX = - pDoc->InsertTableOf( *aPam.GetPoint(), rTOXBase, 0, sal_False ); + pDoc->InsertTableOf( *aPam.GetPoint(), rTOXBase, 0, false ); pDoc->SetTOXBaseName(*pTOX, m_pImpl->m_pProps->GetTOXBase().GetTOXName()); @@ -1351,7 +1351,7 @@ void SAL_CALL SwXDocumentIndex::dispose() throw (uno::RuntimeException) { pSectionFmt->GetDoc()->DeleteTOX( *static_cast<SwTOXBaseSection*>(pSectionFmt->GetSection()), - sal_True); + true); } } diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index a6832a9e1c20..d99789532884 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ #include <hintids.hxx> @@ -1090,6 +1081,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { SW_PROP_NMID(UNO_NAME_HORI_MIRRORED_ON_ODD_PAGES), RES_GRFATR_MIRRORGRF, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_MIRROR_HORZ_ODD_PAGES }, { SW_PROP_NMID(UNO_NAME_VERT_MIRRORED), RES_GRFATR_MIRRORGRF, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_MIRROR_VERT }, { SW_PROP_NMID(UNO_NAME_GRAPHIC_URL), FN_UNO_GRAPHIC_U_R_L, CPPU_E2T(CPPUTYPE_OUSTRING), 0, 0 }, + { SW_PROP_NMID(UNO_NAME_REPLACEMENT_GRAPHIC_URL), FN_UNO_REPLACEMENT_GRAPHIC_U_R_L, CPPU_E2T(CPPUTYPE_OUSTRING), 0, 0 }, { SW_PROP_NMID(UNO_NAME_GRAPHIC_FILTER), FN_UNO_GRAPHIC_FILTER, CPPU_E2T(CPPUTYPE_OUSTRING), 0, 0 }, { SW_PROP_NMID(UNO_NAME_GRAPHIC), FN_UNO_GRAPHIC, CPPU_E2T(CPPUTYPE_REFXGRAPHIC), 0, 0 }, { SW_PROP_NMID(UNO_NAME_ACTUAL_SIZE), FN_UNO_ACTUAL_SIZE, CPPU_E2T(CPPUTYPE_AWTSIZE), PropertyAttribute::READONLY, CONVERT_TWIPS}, diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index d85983f2216d..c3a74f28504d 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2048,7 +2048,7 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc, { pTemp->MovePara(fnParaCurr, fnParaEnd); } - rDoc.ResetAttrs(*pTemp, sal_True, rWhichIds); + rDoc.ResetAttrs(*pTemp, true, rWhichIds); } void SwUnoCursorHelper::SetPropertyToDefault( @@ -2079,7 +2079,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) aWhichIds.insert( pEntry->nWID ); if (pEntry->nWID < RES_PARATR_BEGIN) { - rDoc.ResetAttrs(rPaM, sal_True, aWhichIds); + rDoc.ResetAttrs(rPaM, true, aWhichIds); } else { @@ -2346,7 +2346,7 @@ throw (uno::RuntimeException) } if (!aWhichIds.empty()) { - rUnoCursor.GetDoc()->ResetAttrs(rUnoCursor, sal_True, aWhichIds); + rUnoCursor.GetDoc()->ResetAttrs(rUnoCursor, true, aWhichIds); } } @@ -2416,7 +2416,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) } if (!aWhichIds.empty()) { - rDoc.ResetAttrs(rUnoCursor, sal_True, aWhichIds); + rDoc.ResetAttrs(rUnoCursor, true, aWhichIds); } } } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index c61eca6ade59..2bc703de73d7 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1887,7 +1887,7 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration( { SwPosFlyFrms aFlyFrms; //get all frames that are bound at paragraph or at character - rPaM.GetDoc()->GetAllFlyFmts(aFlyFrms, m_pImpl->GetCursor(), sal_False, sal_True); + rPaM.GetDoc()->GetAllFlyFmts(aFlyFrms, m_pImpl->GetCursor(), false, true); for(SwPosFlyFrms::iterator it = aFlyFrms.begin(); it != aFlyFrms.end(); ++it) { SwPosFlyFrm* pPosFly = *it; diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 278202f86b4f..9041348eaa76 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -1018,7 +1018,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) aWhichIds.insert( pEntry->nWID ); if (pEntry->nWID < RES_PARATR_BEGIN) { - aCursor.GetDoc()->ResetAttrs(aCursor, sal_True, aWhichIds); + aCursor.GetDoc()->ResetAttrs(aCursor, true, aWhichIds); } else { @@ -1040,7 +1040,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) { pTemp->MovePara(fnParaCurr, fnParaEnd); } - pTemp->GetDoc()->ResetAttrs(*pTemp, sal_True, aWhichIds); + pTemp->GetDoc()->ResetAttrs(*pTemp, true, aWhichIds); } } else diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 86b60f639395..f3e9ac9deb67 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -1108,7 +1108,7 @@ lcl_CreatePortions( lcl_FillSoftPageBreakArray(*pUnoCrsr, SoftPageBreaks); PortionStack_t PortionStack; - PortionStack.push( PortionList_t(&i_rPortions, 0) ); + PortionStack.push( PortionList_t(&i_rPortions, (const SwTxtAttr *)0) ); bool bAtEnd( false ); while (!bAtEnd) // every iteration consumes at least current character! diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index 28ff13eb7367..b4ea5b9f9794 100644 --- a/sw/source/core/unocore/unoprnms.cxx +++ b/sw/source/core/unocore/unoprnms.cxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ #include <svl/itemprop.hxx> #include <unoprnms.hxx> @@ -781,11 +772,11 @@ const SwPropNameTab aPropNameTab = { /* 0742 UNO_NAME_SEPARATOR_LINE_STYLE */ {MAP_CHAR_LEN("SeparatorLineStyle")}, /* 0743 UNO_NAME_FOOTNOTE_LINE_STYLE */ {MAP_CHAR_LEN("FootnoteLineStyle")}, /* 0744 UNO_NAME_EMBEDDED_OBJECT */ {MAP_CHAR_LEN("EmbeddedObject")}, -/* 0745 UNO_NAME_RSID */ {MAP_CHAR_LEN("Rsid")}, -/* 0746 UNO_NAME_PARRSID */ {MAP_CHAR_LEN("ParRsid")}, +/* 0745 UNO_NAME_RSID */ {MAP_CHAR_LEN("Rsid")}, +/* 0746 UNO_NAME_PARRSID */ {MAP_CHAR_LEN("ParRsid")}, -/* 0747 UNO_NAME_LINE_STYLE */ {MAP_CHAR_LEN("LineStyle")}, -/* 0748 UNO_NAME_LINE_WIDTH */ {MAP_CHAR_LEN("LineWidth")}, +/* 0747 UNO_NAME_LINE_STYLE */ {MAP_CHAR_LEN("LineStyle")}, +/* 0748 UNO_NAME_LINE_WIDTH */ {MAP_CHAR_LEN("LineWidth")}, /* 0749 PARA_CONTEXT_MARGIN */ {MAP_CHAR_LEN("ParaContextMargin")}, /* 0750 PARAGRAPH_STYLE_NAME */ {MAP_CHAR_LEN("ParagraphStyleName")}, @@ -794,6 +785,7 @@ const SwPropNameTab aPropNameTab = { /* 0753 FOOTER_TEXT_FIRST */ {MAP_CHAR_LEN("FooterTextFirst")}, /* 0754 UNO_NAME_INITIALS */ {MAP_CHAR_LEN("Initials")}, /* 0755 UNO_NAME_INITIALS */ {MAP_CHAR_LEN("TableBorder2")}, +/* 0756 UNO_NAME_REPLACEMENT_GRAPHIC_URL */ {MAP_CHAR_LEN("ReplacementGraphicURL")}, // new items in this array must match enum SwPropNameIds }; diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 7f7049825500..dca596874013 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1220,7 +1220,7 @@ SwXNumberingRules::SwXNumberingRules(SwDoc& rDoc) : #if OSL_DEBUG_LEVEL > 1 sal_uInt16 nIndex = #endif - rDoc.MakeNumRule( sCreatedNumRuleName, 0, sal_False, + rDoc.MakeNumRule( sCreatedNumRuleName, 0, false, // #i89178# numfunc::GetDefaultPositionAndSpaceMode() ); #if OSL_DEBUG_LEVEL > 1 diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 65186e0e63d6..6d5c49c57f96 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -3229,7 +3229,6 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, } else if(bIsDescriptor) { - String aPropertyName(rPropertyName); pTableProps->SetProperty( pEntry->nWID, pEntry->nMemberId, aValue); } else @@ -3463,7 +3462,6 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be else if(bIsDescriptor) { const uno::Any* pAny = 0; - String aPropertyName(rPropertyName); if(!pTableProps->GetProperty(pEntry->nWID, pEntry->nMemberId, pAny)) throw lang::IllegalArgumentException(); else if(pAny) @@ -3547,7 +3545,7 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException ) SwNodeIndex aIdx( *pFmt->GetDoc()->GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) { - aIdx++; + ++aIdx; SwNode *const pNd = & aIdx.GetNode(); if ( pNd->IsOLENode() && aOldName == ((SwOLENode*)pNd)->GetChartTblName() ) diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 353384cce7ec..68e67c2bd81a 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -960,7 +960,7 @@ SwXText::setString(const OUString& rString) throw (uno::RuntimeException) SwNodeIndex aStartIdx(*pStartNode); do { - aStartIdx++; + ++aStartIdx; SwNode& rCurrentNode = aStartIdx.GetNode(); if(rCurrentNode.GetNodeType() == ND_SECTIONNODE ||rCurrentNode.GetNodeType() == ND_TABLENODE) diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 631f8d3d70b7..220cd4f4686e 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -660,7 +660,7 @@ sal_Bool ViewShell::HasCharts() const StartOfSectionNode(), 1 ); while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) { - aIdx++; + ++aIdx; const SwOLENode *pNd = aIdx.GetNode().GetOLENode(); if( pNd && pNd->GetChartTblName().Len() ) { diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 62eaf72ad4df..e841f7844064 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -354,7 +354,7 @@ ViewShell::~ViewShell() SwNodeIndex aIdx( *rNds.GetEndOfAutotext().StartOfSectionNode(), 1 ); while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) { - aIdx++; + ++aIdx; if ( 0 != ( pGNd = aIdx.GetNode().GetGrfNode() ) ) { if( pGNd->IsAnimated() ) diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 13fb977523bf..7c2fa60f4632 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -534,7 +534,7 @@ void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor, pTxtNd->GetMinMaxSize( aIdx.GetIndex(), nMinFrm, nMaxFrm, nAbsMinCnts ); } - aIdx++; + ++aIdx; } if( bOnlyOneNode ) diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 98942c85669a..77a2cc9d82bd 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -379,7 +379,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) // #i42634# Moved common code of SwReader::Read() and // SwDocShell::UpdateLinks() to new SwDoc::UpdateLinks(): // ATM still with Update - pDoc->UpdateLinks( sal_True ); + pDoc->UpdateLinks( true ); // not insert: set the redline mode read from settings.xml eOld = static_cast<RedlineMode_t>( diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index b53bc4857010..9ff6576a85a1 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1123,7 +1123,7 @@ sal_Bool SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, if( !pCFmt ) { pCFmt = pDoc->MakeCharFmt( aName, pParentCFmt ); - pCFmt->SetAuto( sal_False ); + pCFmt->SetAuto( false ); } } @@ -1209,7 +1209,7 @@ SwCharFmt* SwCSS1Parser::GetChrFmt( sal_uInt16 nToken2, const String& rClass ) c if( !pCFmt ) { pCFmt = pDoc->MakeCharFmt( sCName, pDoc->GetDfltCharFmt() ); - pCFmt->SetAuto( sal_False ); + pCFmt->SetAuto( false ); } } @@ -1234,7 +1234,7 @@ SwCharFmt* SwCSS1Parser::GetChrFmt( sal_uInt16 nToken2, const String& rClass ) c if( pClass ) { pCFmt = pDoc->MakeCharFmt( aTmp, pCFmt ); - pCFmt->SetAuto( sal_False ); + pCFmt->SetAuto( false ); SfxItemSet aItemSet( pClass->GetItemSet() ); SetCharFmtAttrs( pCFmt, aItemSet ); } @@ -1404,7 +1404,7 @@ const SwPageDesc *SwCSS1Parser::GetPageDesc( sal_uInt16 nPoolId, sal_Bool bCreat pPageDesc = FindPageDesc( pDoc, nPoolId, nPage ); OSL_ENSURE( pPageDesc==pNewPageDesc, "Seitenvorlage nicht gefunden" ); - pDoc->CopyPageDesc( *pMasterPageDesc, *pNewPageDesc, sal_False ); + pDoc->CopyPageDesc( *pMasterPageDesc, *pNewPageDesc, false ); // Die Vorlagen an ihren neuen Zweck anpassen. const SwPageDesc *pFollow = 0; @@ -1569,7 +1569,7 @@ void SwCSS1Parser::FillDropCap( SwFmtDrop& rDrop, if( !pCFmt ) { pCFmt = pDoc->MakeCharFmt( aName, pDoc->GetDfltCharFmt() ); - pCFmt->SetAuto( sal_False ); + pCFmt->SetAuto( false ); } SetCharFmtAttrs( pCFmt, rItemSet ); diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index adc4aa9b0155..36e5b4215200 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -375,6 +375,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld, SwHTMLWriter::GetCSS1ScriptForScriptType( nScriptType ); xub_StrLen nEndPos = (xub_StrLen)pBreakIt->GetBreakIter()->endOfScript( sExpand, nPos, nScriptType ); + xub_StrLen nChunkLen = nEndPos - nPos; if( nScript != CSS1_OUTMODE_ANY_SCRIPT && /* #108791# */ nScript != rHTMLWrt.nCSS1Script ) { @@ -404,7 +405,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld, } } - HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.Copy( nPos, nEndPos ), + HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.Copy( nPos, nChunkLen ), rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); rHTMLWrt.bTagOn = sal_False; @@ -414,7 +415,7 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pFld, } else { - HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.Copy( nPos, nEndPos ), + HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.Copy( nPos, nChunkLen ), rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ); } nPos = nEndPos; diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index d75dc528140c..74e7d9f93f57 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -311,7 +311,7 @@ void SwHTMLWriter::CollectFlyFrms() "number of browser configurations has changed" ); SwPosFlyFrms aFlyPos; - pDoc->GetAllFlyFmts( aFlyPos, bWriteAll ? 0 : pCurPam, sal_True ); + pDoc->GetAllFlyFmts( aFlyPos, bWriteAll ? 0 : pCurPam, true ); for(SwPosFlyFrms::iterator it = aFlyPos.begin(); it != aFlyPos.end(); ++it) { diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 5781084a2965..c6d8554005e6 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -1283,7 +1283,7 @@ sal_Bool SwHTMLParser::HasCurrentParaBookmarks( sal_Bool bIgnoreStack ) const IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); ppMark != pMarkAccess->getMarksEnd(); - ppMark++) + ++ppMark) { const ::sw::mark::IMark* pBookmark = ppMark->get(); sal_uLong nBookNdIdx = pBookmark->GetMarkPos().nNode.GetIndex(); @@ -1351,7 +1351,7 @@ void SwHTMLParser::StripTrailingPara() IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); ppMark != pMarkAccess->getMarksEnd(); - ppMark++) + ++ppMark) { ::sw::mark::IMark* pMark = ppMark->get(); sal_uLong nBookNdIdx = pMark->GetMarkPos().nNode.GetIndex(); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index a63d7db0a2e1..4c2d5e346871 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -445,7 +445,7 @@ SwHTMLParser::~SwHTMLParser() if( nLinkMode != NEVER && bAsync && SFX_CREATE_MODE_INTERNAL!=pDoc->GetDocShell()->GetCreateMode() ) pDoc->GetLinkManager().UpdateAllLinks( nLinkMode == MANUAL, - sal_True, sal_False ); + true, false ); if ( pDoc->GetDocShell()->IsLoading() ) { diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx index 74f00b764d87..61f37f002f1c 100644 --- a/sw/source/filter/rtf/rtfnum.cxx +++ b/sw/source/filter/rtf/rtfnum.cxx @@ -364,10 +364,10 @@ void SwRTFParser::ReadListTable() lcl_ExpandNumFmts( *pCurRule ); String sTmp(rtl::OUString(RTF_NUMRULE_NAME " 1")); - aEntry.nListDocPos = pDoc->MakeNumRule( sTmp, 0, sal_False, SvxNumberFormat::LABEL_ALIGNMENT ); + aEntry.nListDocPos = pDoc->MakeNumRule( sTmp, 0, false, SvxNumberFormat::LABEL_ALIGNMENT ); pCurRule = pDoc->GetNumRuleTbl()[ aEntry.nListDocPos ]; // #i91400# - pCurRule->SetName( pDoc->GetUniqueNumRuleName( &sTmp, sal_False ), + pCurRule->SetName( pDoc->GetUniqueNumRuleName( &sTmp, false ), *pDoc ); pCurRule->SetAutoRule( sal_False ); @@ -567,7 +567,7 @@ void SwRTFParser::ReadListOverrideTable() aEntry.nListDocPos = pDoc->MakeNumRule( sTmp, pRule ); pRule = pDoc->GetNumRuleTbl()[ aEntry.nListDocPos ]; // #i91400# - pRule->SetName( pDoc->GetUniqueNumRuleName( &sTmp, sal_False ), + pRule->SetName( pDoc->GetUniqueNumRuleName( &sTmp, false ), *pDoc ); pRule->SetAutoRule( sal_False ); @@ -818,7 +818,7 @@ SwNumRule *SwRTFParser::ReadNumSecLevel( int nToken ) aListArr.push_back( aEntry ); pCurRule = pDoc->GetNumRuleTbl()[ aEntry.nListDocPos ]; // #i91400# - pCurRule->SetName( pDoc->GetUniqueNumRuleName( &sTmp, sal_False ), *pDoc ); + pCurRule->SetName( pDoc->GetUniqueNumRuleName( &sTmp, false ), *pDoc ); pCurRule->SetAutoRule( sal_False ); pCurRule->SetContinusNum( bContinus ); diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx index 884878be1902..6e90c94a0a7f 100644 --- a/sw/source/filter/rtf/rtftbl.cxx +++ b/sw/source/filter/rtf/rtftbl.cxx @@ -907,7 +907,7 @@ void SwRTFParser::NewTblLine() SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode(); if( pCNd && pCNd->HasSwAttrSet() ) pCNd->ResetAllAttr(); - aIdx++; + ++aIdx; } } pPam->Exchange(); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 875beef7b176..d4d59c0b62b2 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -151,10 +151,12 @@ sal_uLong SwRTFReader::Read( SwDoc &rDoc, const String& /*rBaseURL*/, SwPaM& /*r xImporter->setTargetDocument(xDstDoc); uno::Reference<document::XFilter> xFilter(xInterface, uno::UNO_QUERY_THROW); - uno::Sequence<beans::PropertyValue> aDescriptor(1); + uno::Sequence<beans::PropertyValue> aDescriptor(2); aDescriptor[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")); uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStrm)); aDescriptor[0].Value <<= xStream; + aDescriptor[1].Name = "IsNewDoc"; + aDescriptor[1].Value <<= sal_False; xFilter->filter(aDescriptor); return 0; @@ -2229,7 +2231,7 @@ void SwRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) if( pTxtNd ) { // Update vom LR-Space abschalten - pTxtNd->SetNumLSpace( sal_False ); + pTxtNd->SetNumLSpace( false ); } } } diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index b3e129a96a91..5e23c0205e4a 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -325,6 +325,8 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos, myEIter aI = maEntries.begin(); while (aI != maEntries.end()) { + bool bLastEntry = aI == maEntries.end() - 1; + SwFltStackEntry& rEntry = *aI; if (rEntry.bOpen) { @@ -350,7 +352,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos, { rEntry.bConsumedByField = consumedByField; rEntry.SetEndPos(rPos); - if (nAttrId == rEntry.pAttr->Which()) + if (bLastEntry && nAttrId == rEntry.pAttr->Which()) { //potential candidate for merging with an identical //property beginning at rPos @@ -377,7 +379,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos, //we advance to the next node, or finish processing the document if (rEntry.m_aPtPos.m_nNode.GetIndex() == aFltPos.m_nNode.GetIndex()) { - if (nAttrId == rEntry.pAttr->Which() && + if (bLastEntry && nAttrId == rEntry.pAttr->Which() && rEntry.m_aPtPos.m_nCntnt == aFltPos.m_nCntnt) { //potential candidate for merging with an identical @@ -441,12 +443,12 @@ static sal_Bool IterateNumrulePiece( const SwNodeIndex& rEnd, { while( ( rTmpStart <= rEnd ) && !( rTmpStart.GetNode().IsTxtNode() ) ) // suche gueltigen Anfang - rTmpStart++; + ++rTmpStart; rTmpEnd = rTmpStart; while( ( rTmpEnd <= rEnd ) && ( rTmpEnd.GetNode().IsTxtNode() ) ) // suche gueltiges Ende + 1 - rTmpEnd++; + ++rTmpEnd; rTmpEnd--; // gueltiges Ende @@ -504,7 +506,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, pDoc->SetNumRule( aTmpPam, *pRul, false ); aTmpStart = aTmpEnd; // Start fuer naechstes Teilstueck - aTmpStart++; + ++aTmpStart; } } else @@ -2037,7 +2039,7 @@ SwPageDesc* SwFltShell::MakePageDesc(SwPageDesc* pFirstPageDesc) nPos = GetDoc().MakePageDesc( ViewShell::GetShellRes()->GetPageDescName( GetDoc().GetPageDescCnt(), bFollow ? ShellResource::FOLLOW_PAGE : ShellResource::NORMAL_PAGE), - pFirstPageDesc, sal_False ); + pFirstPageDesc, false ); pNewPD = &GetDoc().GetPageDesc(nPos); if (bFollow) diff --git a/sw/source/filter/ww1/w1class.cxx b/sw/source/filter/ww1/w1class.cxx index 787e2fbfe945..202b48f10a00 100644 --- a/sw/source/filter/ww1/w1class.cxx +++ b/sw/source/filter/ww1/w1class.cxx @@ -892,7 +892,7 @@ Ww1Bookmarks::Ww1Bookmarks(Ww1Fib& rInFib) // vor- und zurueckspringen, wobei ein weiterer Index oder ein Bitfeld // oder etwas aehnliches zum Merken der bereits abgearbeiteten Bookmarks // noetig wird. -void Ww1Bookmarks::operator ++( int ) +void Ww1Bookmarks::operator++() { if( bOK ) { @@ -1061,7 +1061,7 @@ Ww1Pap::Ww1Pap(Ww1Fib& _rFib) void Ww1Pap::Seek(sal_uLong ulSeek) { while (ulSeek > Where()) - (*this)++; + ++(*this); } // SH: Where hat einen Parameter mitbekommen, der sagt, ob bei Neuanlegen eines @@ -1085,7 +1085,7 @@ sal_uLong Ww1Pap::Where( sal_Bool bSetIndex ) return ulRet; } -void Ww1Pap::operator++(int) +void Ww1Pap::operator++() { if (pPap != NULL) if (++nFkpIndex > pPap->Count()) @@ -1160,7 +1160,7 @@ Ww1Chp::Ww1Chp(Ww1Fib& _rFib) void Ww1Chp::Seek(sal_uLong ulSeek) { while (ulSeek > Where()) - (*this)++; + ++(*this); } // SH: Where hat einen Parameter mitbekommen, der sagt, ob bei Neuanlegen eines @@ -1185,7 +1185,7 @@ sal_uLong Ww1Chp::Where( sal_Bool bSetIndex ) return ulRet; } -void Ww1Chp::operator++(int) +void Ww1Chp::operator++() { if (pChp != NULL) if (++nFkpIndex > pChp->Count()) diff --git a/sw/source/filter/ww1/w1class.hxx b/sw/source/filter/ww1/w1class.hxx index 9710b1bf0a1e..f372d3ff68eb 100644 --- a/sw/source/filter/ww1/w1class.hxx +++ b/sw/source/filter/ww1/w1class.hxx @@ -168,7 +168,7 @@ public: if (ulCountBytes > ulNew) ulCountBytes = ulNew; } - void operator++(int) + void operator++() { OSL_ENSURE(ulSeek+1<ulCountBytes, "Ww1PlainText"); ulSeek++; @@ -1138,7 +1138,7 @@ public: if (grpfIhdt & 0x0020) nFirstFootL = nextIhdd++; OSL_ENSURE(nextIhdd<=Count(), "Ww1HeaderFooter"); } - sal_Bool operator++(int) + sal_Bool operator++() { sal_Bool bRet = sal_True; eHeaderFooterMode = (HeaderFooterMode)((short)eHeaderFooterMode + 1); @@ -1231,7 +1231,7 @@ public: {} // innerhalb des textes sal_uLong Where() { return Where(nPlcIndex); } - void operator++(int) + void operator++() { OSL_ENSURE(nPlcIndex+1 <= Count(), "Ww1Fields"); nPlcIndex++; @@ -1303,7 +1303,7 @@ public: delete pPos[0]; } sal_uLong Where() const { return pPos[nIsEnd]->WhereCP(nPlcIdx[nIsEnd]); } - void operator++(int); + void operator++(); sal_Bool GetError() const { return !bOK; } long GetHandle() const; sal_Bool GetIsEnd() const { return ( nIsEnd ) ? sal_True : sal_False; } @@ -1333,7 +1333,7 @@ public: ulRet = Ww1PlcFootnoteRef::Where(nPlcIndex); return ulRet; } - void operator++(int) + void operator++() { OSL_ENSURE(nPlcIndex+1 <= Count(), "Ww1Footnotes"); nPlcIndex++; @@ -1352,7 +1352,7 @@ public: : Ww1PlcSep(rFibL), aHdd(rFibL, grpfIhdt), nPlcIndex(0) {} Ww1HeaderFooter& GetHdd() { return aHdd; } - void operator++(int) { nPlcIndex++; } + void operator++() { nPlcIndex++; } sal_uInt8* GetData() { return Ww1PlcSep::GetData(nPlcIndex); } // innerhalb des textes sal_uLong Where() { return Ww1PlcSep::Where(nPlcIndex); } @@ -1393,7 +1393,7 @@ public: Ww1Pap(Ww1Fib& rFib); ~Ww1Pap() { delete pPap; } sal_uLong Where( sal_Bool bSetIndex = sal_True ); // innerhalb des textes - void operator++(int); + void operator++(); sal_Bool FillStart(sal_uInt8*& pB, sal_uInt16& nSize) { UpdateIdx(); @@ -1460,7 +1460,7 @@ public: Ww1Chp( Ww1Fib& rFib ); ~Ww1Chp() { delete pChp; } sal_uLong Where( sal_Bool bSetIndex = sal_True ); // innerhalb des textes - void operator++(int); + void operator++(); sal_Bool FillStart(W1_CHP& rChp) { UpdateIdx(); diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx index 14e978ce04c0..a0c9eaebab53 100644 --- a/sw/source/filter/ww1/w1filter.cxx +++ b/sw/source/filter/ww1/w1filter.cxx @@ -354,7 +354,7 @@ void Ww1Bookmarks::Start(Ww1Shell& rOut, Ww1Manager& rMan) if (rMan.Where() >= Where()) { Out(rOut, rMan); - (*this)++; + ++(*this); } } @@ -390,7 +390,7 @@ void Ww1Footnotes::Start(Ww1Shell& rOut, Ww1Manager& rMan) rOut.EndFootnote(); } else - (*this)++; + ++(*this); } } @@ -400,7 +400,7 @@ void Ww1Footnotes::Stop(Ww1Shell& /*rOut*/, Ww1Manager& rMan, sal_Unicode& c) { OSL_ENSURE(nPlcIndex < Count(), "Ww1Footnotes"); c = ' '; - (*this)++; + ++(*this); } } @@ -412,7 +412,7 @@ void Ww1Fields::Start(Ww1Shell& rOut, Ww1Manager& rMan) if (GetData()->chGet() == 19) Out(rOut, rMan); else - (*this)++; // ignore + ++(*this); // ignore } } @@ -425,7 +425,7 @@ void Ww1Fields::Stop( Ww1Shell& rOut, Ww1Manager& rMan, sal_Unicode& c) { rMan.Fill( c ); OSL_ENSURE(c==21, "Ww1Fields"); - (*this)++; + ++(*this); c = ' '; if (pField) // haben wir ein fertiges feld da, das eingefuegt werden soll? @@ -575,7 +575,7 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth) // zuende ist oder der ergebnisteil beginnt. dabei koennen // natuerlich neue felder beginnen (word unterstuetzt felder, // die wiederum felder beinhalten). - (*this)++; + ++(*this); pData = GetData(); if (pData->chGet()==19) // nested field { @@ -608,7 +608,7 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth) c = rMan.Fill(sErgebnis, GetLength()); if (!Ww1PlainText::IsChar(c)) sErgebnis += c; //~ mdt: sonderzeichenbenhandlung - (*this)++; + ++(*this); pData = GetData(); } OSL_ENSURE(pData->chGet()==21, "Ww1PlainText"); @@ -982,7 +982,7 @@ oncemore: this->sErgebnis = sErgebnis; } else // oops: we are terribly wrong: skip this - (*this)++; + ++(*this); } sal_uLong Ww1Fields::GetLength() @@ -1022,7 +1022,7 @@ void Ww1Sep::Start(Ww1Shell& rOut, Ww1Manager& rMan) Ww1SprmSep aSprm(rFib, SVBT32ToUInt32(pByte + 2)); aSprm.Start(rOut, rMan); aSprm.Stop(rOut, rMan); - (*this)++; + ++(*this); aHdd.Start(rOut, rMan); } } @@ -1041,7 +1041,7 @@ void Ww1Pap::Start(Ww1Shell& rOut, Ww1Manager& rMan) // und ausgeben: aSprm.Start(rOut, rMan); } - (*this)++; + ++(*this); } } @@ -1162,7 +1162,7 @@ void Ww1Chp::Start(Ww1Shell& rOut, Ww1Manager& rMan) aPic.Out(rOut, rMan); } } - (*this)++; + ++(*this); } } @@ -1245,7 +1245,7 @@ sal_Unicode Ww1PlainText::Out( Ww1Shell& rOut, sal_uLong& ulEnd ) while (ulSeek < ulEnd) { sal_Unicode c = (*this)[ulSeek]; - (*this)++; + ++(*this); if (Ww1PlainText::IsChar(c)) rOut << c; else @@ -1263,7 +1263,7 @@ sal_Unicode Ww1PlainText::Out( String& rStr, sal_uLong ulEnd ) while (ulSeek < ulEnd) { sal_Unicode c = (*this)[ulSeek]; - (*this)++; + ++(*this); if( Ww1PlainText::IsChar(c) ) rStr += c; else @@ -1278,7 +1278,7 @@ sal_Unicode Ww1PlainText::Out( String& rStr, sal_uLong ulEnd ) sal_Unicode Ww1PlainText::Out( sal_Unicode& rRead ) { rRead = (*this)[ulSeek]; - (*this)++; + ++(*this); return rRead; } @@ -1933,7 +1933,7 @@ void Ww1HeaderFooter::Start(Ww1Shell& rOut, Ww1Manager& rMan) // noetig: if (!rMan.Pushed()) { - while ((*this)++) + while (++(*this)) switch (eHeaderFooterMode) { case FtnSep: diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx index 4280a0a09a0d..5762722f54c8 100644 --- a/sw/source/filter/ww8/WW8Sttbf.cxx +++ b/sw/source/filter/ww8/WW8Sttbf.cxx @@ -98,14 +98,8 @@ namespace ww8 #endif } -#if OSL_DEBUG_LEVEL > 1 - char sBuffer[256]; - snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"", - nOffset, nCount); - ::std::clog << "<WW8Struct-getUString" << sBuffer << ">" - << rtl::OUStringToOString( aResult, RTL_TEXTENCODING_UTF8 ).getStr() << "</WW8Struct-getUString>" - << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "<WW8Struct-getUString" << " offset=\"" << nOffset + << "\" count=\"" << nCount << "\"" << ">" << aResult << "</WW8Struct-getUString>" ); return aResult; diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 41920e67193f..c8b4636c731f 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -366,7 +366,7 @@ WW8TableNodeInfo::~WW8TableNodeInfo() WW8TableNodeInfoInner::Pointer_t pInner = aIt->second; sResult += pInner->toString(); - aIt++; + ++aIt; } sResult += dbg_out(*mpNode); sResult += "</tableNodeInfo>"; @@ -393,8 +393,7 @@ void WW8TableNodeInfo::setEndOfLine(bool bEndOfLine) pInner->setEndOfLine(bEndOfLine); #ifdef DBG_UTIL - ::std::clog << "<endOfLine depth=\"" << mnDepth << "\">" - << toString() << "</endOfLine>" << ::std::endl; + SAL_INFO( "sw.ww8", "<endOfLine depth=\"" << mnDepth << "\">" << toString() << "</endOfLine>" ); #endif } @@ -404,8 +403,7 @@ void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell) pInner->setEndOfCell(bEndOfCell); #ifdef DBG_UTIL - ::std::clog << "<endOfCell depth=\"" << mnDepth << "\">" - << toString() << "</endOfCell>" << ::std::endl; + SAL_INFO( "sw.ww8", "<endOfCell depth=\"" << mnDepth << "\">" << toString() << "</endOfCell>" ); #endif } @@ -416,8 +414,7 @@ void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable) pInner->setFirstInTable(bFirstInTable); #ifdef DBG_UTIL - ::std::clog << "<firstInTable depth=\"" << mnDepth << "\">" - << toString() << "</firstInTable>" << ::std::endl; + SAL_INFO( "sw.ww8", "<firstInTable depth=\"" << mnDepth << "\">" << toString() << "</firstInTable>" ); #endif } @@ -427,10 +424,8 @@ void WW8TableNodeInfo::setVertMerge(bool bVertMerge) pInner->setVertMerge(bVertMerge); - #ifdef DBG_UTIL - ::std::clog << "<vertMerge depth=\"" << mnDepth << "\">" - << toString() << "</vertMerge>" << ::std::endl; + SAL_INFO( "sw.ww8", "<vertMerge depth=\"" << mnDepth << "\">" << toString() << "</vertMerge>" ); #endif } @@ -449,9 +444,7 @@ void WW8TableNodeInfo::setNext(WW8TableNodeInfo * pNext) mpNext = pNext; #ifdef DBG_UTIL - ::std::clog << "<setnext><from>" << toString() << "</from><to>" - << pNext->toString() << "</to></setnext>" - << ::std::endl; + SAL_INFO( "sw.ww8", "<setnext><from>" << toString() << "</from><to>" << pNext->toString() << "</to></setnext>" ); #endif } @@ -576,15 +569,9 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable) { SwRect aRect = aTableCellInfo.getRect(); -#ifdef DBG_UTIL - static char sBuffer[1024]; - ::std::clog << "<CellFrm>" << ::std::endl; - - snprintf(sBuffer, sizeof(sBuffer), - "<rect top=\"%ld\" bottom=\"%ld\" left=\"%ld\" right=\"%ld\"/>", - aRect.Top(), aRect.Bottom(), aRect.Left(), aRect.Right()); - ::std::clog << sBuffer << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "<CellFrm>" ); + SAL_INFO( "sw.ww8", "<rect top=\"" << aRect.Top() << "\" bottom=\"" << aRect.Bottom() + << "\" left=\"" << aRect.Left() << "\" right=\"" << aRect.Right() << "\"/>" ); const SwTableBox * pTableBox = aTableCellInfo.getTableBox(); const SwStartNode * pSttNd = pTableBox->GetSttNd(); @@ -613,9 +600,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable) while (!bDone); } -#ifdef DBG_UTIL - ::std::clog << "</CellFrm>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "</CellFrm>" ); } pPrev = reorderByLayout(pTable); @@ -625,9 +610,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable) void WW8TableInfo::processSwTable(const SwTable * pTable) { -#ifdef DBG_UTIL - ::std::clog << "<processSwTable>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "<processSwTable>" ); WW8TableNodeInfo * pPrev = NULL; @@ -636,8 +619,7 @@ void WW8TableInfo::processSwTable(const SwTable * pTable) pPrev = processSwTableByLayout(pTable); #ifdef DBG_UTIL - WW8TableCellGrid::Pointer_t pCellGrid(getCellGridForTable(pTable)); - ::std::clog << pCellGrid->toString() << ::std::endl; + SAL_INFO( "sw.ww8", getCellGridForTable(pTable)->toString()); #endif } else @@ -660,9 +642,7 @@ void WW8TableInfo::processSwTable(const SwTable * pTable) pPrev->setNextNode(pEndNode); } -#ifdef DBG_UTIL - ::std::clog << "</processSwTable>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "</processSwTable>" ); } WW8TableNodeInfo * @@ -671,10 +651,7 @@ WW8TableInfo::processTableLine(const SwTable * pTable, sal_uInt32 nRow, sal_uInt32 nDepth, WW8TableNodeInfo * pPrev) { -#ifdef DBG_UTIL - ::std::clog << "<processTableLine row=\"" << nRow << "\" depth=\"" - << nDepth << "\">" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "<processTableLine row=\"" << nRow << "\" depth=\"" << nDepth << "\">" ); const SwTableBoxes & rBoxes = pTableLine->GetTabBoxes(); @@ -687,9 +664,7 @@ WW8TableInfo::processTableLine(const SwTable * pTable, pPrev = processTableBox(pTable, pBox, nRow, n, nDepth, n == rBoxes.size() - 1, pPrev); } -#ifdef DBG_UTIL - ::std::clog << "</processTableLine>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "</processTableLine>" ); return pPrev; } @@ -702,10 +677,8 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox, sal_uInt32 nCell, sal_uInt32 nDepth) { -#ifdef DBG_UTIL - ::std::clog << "<processTableBoxLines depth=\"" << nDepth - << "\" row=\"" << nRow << "\" cell=\"" << nCell << "\">" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "<processTableBoxLines depth=\"" << nDepth << "\" row=\"" << nRow + << "\" cell=\"" << nCell << "\">" ); const SwTableLines & rLines = pBox->GetTabLines(); WW8TableNodeInfo::Pointer_t pNodeInfo; @@ -742,9 +715,7 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox, } } -#ifdef DBG_UTIL - ::std::clog << "</processTableBoxLines>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "</processTableBoxLines>" ); return pNodeInfo; } @@ -758,10 +729,8 @@ WW8TableInfo::processTableBox(const SwTable * pTable, bool bEndOfLine, WW8TableNodeInfo * pPrev) { -#ifdef DBG_UTIL - ::std::clog << "<processTableBox row=\"" << nRow << "\" cell=\"" << nCell - << "\" depth=\"" << nDepth << "\">" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "<processTableBox row=\"" << nRow << "\" cell=\"" << nCell + << "\" depth=\"" << nDepth << "\">" ); WW8TableNodeInfo::Pointer_t pNodeInfo; const SwTableLines & rLines = pBox->GetTabLines(); @@ -837,9 +806,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable, } } -#ifdef DBG_UTIL - ::std::clog << "</processTableBox>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "</processTableBox>" ); return pPrev; } @@ -889,9 +856,8 @@ WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo } #ifdef DBG_UTIL - ::std::clog << pNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pNodeInfo->toString()); #endif - return pNodeInfo; } @@ -1035,7 +1001,7 @@ WW8TableNodeInfo * WW8TableInfo::reorderByLayout(const SwTable * pTable) WW8TableCellGrid::Pointer_t pCellGrid = getCellGridForTable(pTable); #ifdef DBG_UTIL - ::std::clog << pCellGrid->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pCellGrid->toString()); #endif pCellGrid->addShadowCells(); @@ -1108,9 +1074,7 @@ void WW8TableCellGrid::insert(const SwRect & rRect, void WW8TableCellGrid::addShadowCells() { -#ifdef DBG_UTIL - ::std::clog << "<addShadowCells>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "<addShadowCells>" ); RowTops_t::const_iterator aTopsIt = getRowTopsBegin(); @@ -1183,9 +1147,7 @@ void WW8TableCellGrid::addShadowCells() ++aTopsIt; } -#ifdef DBG_UTIL - ::std::clog << "</addShadowCells>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "</addShadowCells>" ); } WW8TableNodeInfo * WW8TableCellGrid::connectCells() @@ -1440,10 +1402,7 @@ void WW8TableCellGridRow::insert(const CellInfo & rCellInfo) m_pCellInfos->insert(rCellInfo); #ifdef DBG_UTIL - ::std::clog << "<gridRowInsert>" - << rCellInfo.toString() - << "</gridRowInsert>" - << ::std::endl; + SAL_INFO( "sw.ww8", "<gridRowInsert>" << rCellInfo.toString() << "</gridRowInsert>" ); #endif } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 1fc43871c9a0..45abbf61e6ca 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -650,7 +650,7 @@ void DocxAttributeOutput::WriteFFData( const FieldInfos& rInfos ) } else if ( rInfos.eType == ww::eFORMCHECKBOX ) { - rtl::OUString sName, sDefault; + rtl::OUString sName; bool bChecked = false; FieldMarkParamsHelper params( rFieldmark ); @@ -984,7 +984,7 @@ void DocxAttributeOutput::WritePostponedGraphic() for( std::list< PostponedGraphic >::const_iterator it = m_postponedGraphic->begin(); it != m_postponedGraphic->end(); ++it ) - FlyFrameGraphic( *( it->grfNode ), it->size ); + FlyFrameGraphic( it->grfNode, it->size ); delete m_postponedGraphic; m_postponedGraphic = NULL; } @@ -1349,7 +1349,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co // thickThinMediumGap, thickThinLargeGap, thickThinSmallGap // thinThickLargeGap, thinThickMediumGap, thinThickSmallGap const char* pVal = "none"; - if ( !pBorderLine->isEmpty( ) ) + if ( pBorderLine && !pBorderLine->isEmpty( ) ) { switch (pBorderLine->GetBorderLineStyle()) { @@ -1403,7 +1403,7 @@ static void impl_borderLine( FSHelperPtr pSerializer, sal_Int32 elementToken, co pAttr->add( FSNS( XML_w, XML_val ), OString( pVal ) ); - if ( !pBorderLine->isEmpty() ) + if ( pBorderLine && !pBorderLine->isEmpty() ) { // Compute the sz attribute @@ -1452,32 +1452,29 @@ static void impl_pageBorders( FSHelperPtr pSerializer, const SvxBoxItem& rBox, s for( int i = 0; i < 4; ++i, ++pBrd ) { const SvxBorderLine* pLn = rBox.GetLine( *pBrd ); - if ( pLn ) + if ( pDefaultBorders && pLn ) { - if ( pDefaultBorders ) - { - const SvxBorderLine* pRefLn = pDefaultBorders->GetLine( *pBrd ); + const SvxBorderLine* pRefLn = pDefaultBorders->GetLine( *pBrd ); - // If border is equal to default border: do not output - if ( pRefLn && *pLn == *pRefLn) { - continue; - } + // If border is equal to default border: do not output + if ( pRefLn && *pLn == *pRefLn) { + continue; } + } - if (!tagWritten && bWriteTag) { - pSerializer->startElementNS( XML_w, tag, FSEND ); - tagWritten = true; - } + if (!tagWritten && bWriteTag) { + pSerializer->startElementNS( XML_w, tag, FSEND ); + tagWritten = true; + } - impl_borderLine( pSerializer, aXmlElements[i], pLn, 0 ); + impl_borderLine( pSerializer, aXmlElements[i], pLn, 0 ); - // When exporting default borders, we need to export these 2 attr - if ( pDefaultBorders == 0 ) { - if ( i == 2 ) - impl_borderLine( pSerializer, XML_insideH, pLn, 0 ); - else if ( i == 3 ) - impl_borderLine( pSerializer, XML_insideV, pLn, 0 ); - } + // When exporting default borders, we need to export these 2 attr + if ( pDefaultBorders == 0 ) { + if ( i == 2 ) + impl_borderLine( pSerializer, XML_insideH, pLn, 0 ); + else if ( i == 3 ) + impl_borderLine( pSerializer, XML_insideV, pLn, 0 ); } } if (tagWritten && bWriteTag) { @@ -1991,17 +1988,20 @@ void DocxAttributeOutput::DefaultStyle( sal_uInt16 nStyle ) #endif } -void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize ) +void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrmFmt* pOLEFrmFmt, SwOLENode* pOLENode ) { - OSL_TRACE( "TODO DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize ) - some stuff still missing" ); + OSL_TRACE( "TODO DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrmFmt* pOLEFrmFmt, SwOLENode* pOLENode ) - some stuff still missing" ); + // detect mis-use of the API + assert(pGrfNode || (pOLEFrmFmt && pOLENode)); + const SwFrmFmt* pFrmFmt = pGrfNode ? pGrfNode->GetFlyFmt() : pOLEFrmFmt; // create the relation ID OString aRelId; sal_Int32 nImageType; - if ( rGrfNode.IsLinkedFile() ) + if ( pGrfNode && pGrfNode->IsLinkedFile() ) { // linked image, just create the relation String aFileName; - rGrfNode.GetFileFilterNms( &aFileName, 0 ); + pGrfNode->GetFileFilterNms( &aFileName, 0 ); // TODO Convert the file name to relative for better interoperability @@ -2014,10 +2014,14 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size else { // inline, we also have to write the image itself - Graphic& rGraphic = const_cast< Graphic& >( rGrfNode.GetGrf() ); + Graphic* pGraphic = 0; + if (pGrfNode) + pGraphic = &const_cast< Graphic& >( pGrfNode->GetGrf() ); + else + pGraphic = pOLENode->GetGraphic(); m_rDrawingML.SetFS( m_pSerializer ); // to be sure that we write to the right stream - OUString aImageId = m_rDrawingML.WriteImage( rGraphic ); + OUString aImageId = m_rDrawingML.WriteImage( *pGraphic ); aRelId = OUStringToOString( aImageId, RTL_TEXTENCODING_UTF8 ); @@ -2029,11 +2033,11 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size m_pSerializer->startElementNS( XML_w, XML_drawing, FSEND ); - bool isAnchor = rGrfNode.GetFlyFmt()->GetAnchor().GetAnchorId() != FLY_AS_CHAR; + bool isAnchor = pFrmFmt->GetAnchor().GetAnchorId() != FLY_AS_CHAR; if( isAnchor ) { ::sax_fastparser::FastAttributeList* attrList = m_pSerializer->createAttrList(); - attrList->add( XML_behindDoc, rGrfNode.GetFlyFmt()->GetOpaque().GetValue() ? "0" : "1" ); + attrList->add( XML_behindDoc, pFrmFmt->GetOpaque().GetValue() ? "0" : "1" ); attrList->add( XML_distT, "0" ); attrList->add( XML_distB, "0" ); attrList->add( XML_distL, "0" ); @@ -2042,13 +2046,13 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size attrList->add( XML_locked, "0" ); attrList->add( XML_layoutInCell, "1" ); attrList->add( XML_allowOverlap, "1" ); // TODO - if( const SdrObject* pObj = rGrfNode.GetFlyFmt()->FindRealSdrObject()) + if( const SdrObject* pObj = pFrmFmt->FindRealSdrObject()) attrList->add( XML_relativeHeight, OString::valueOf( sal_Int32( pObj->GetOrdNum()))); m_pSerializer->startElementNS( XML_wp, XML_anchor, XFastAttributeListRef( attrList )); m_pSerializer->singleElementNS( XML_wp, XML_simplePos, XML_x, "0", XML_y, "0", FSEND ); // required, unused const char* relativeFromH; const char* relativeFromV; - switch( rGrfNode.GetFlyFmt()->GetAnchor().GetAnchorId()) + switch( pFrmFmt->GetAnchor().GetAnchorId()) { case FLY_AT_PAGE: relativeFromV = relativeFromH = "page"; @@ -2064,7 +2068,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size break; }; Point pos( 0, 0 ); - if( SwFlyFrmFmt* flyfmt = dynamic_cast<SwFlyFrmFmt*>(rGrfNode.GetFlyFmt())) // TODO is always true? + if( const SwFlyFrmFmt* flyfmt = dynamic_cast<const SwFlyFrmFmt*>(pFrmFmt)) // TODO is always true? pos = flyfmt->GetAnchoredObj()->GetCurrRelPos(); OString x( OString::valueOf( TwipsToEMU( pos.X()))); OString y( OString::valueOf( TwipsToEMU( pos.Y()))); @@ -2100,7 +2104,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size if( isAnchor ) { - switch( rGrfNode.GetFlyFmt()->GetSurround().GetValue()) + switch( pFrmFmt->GetSurround().GetValue()) { case SURROUND_NONE: m_pSerializer->singleElementNS( XML_wp, XML_wrapTopAndBottom, FSEND ); @@ -2123,9 +2127,9 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size ::sax_fastparser::FastAttributeList* docPrattrList = m_pSerializer->createAttrList(); docPrattrList->add( XML_id, OString::valueOf( sal_Int32( m_anchorId++ )).getStr()); docPrattrList->add( XML_name, "Picture" ); - docPrattrList->add( XML_descr, OUStringToOString( rGrfNode.GetDescription(), RTL_TEXTENCODING_UTF8 ).getStr()); + docPrattrList->add( XML_descr, OUStringToOString( pGrfNode ? pGrfNode->GetDescription() : pOLEFrmFmt->GetObjDescription(), RTL_TEXTENCODING_UTF8 ).getStr()); if( GetExport().GetFilter().getVersion( ) != oox::core::ECMA_DIALECT ) - docPrattrList->add( XML_title, OUStringToOString( rGrfNode.GetTitle(), RTL_TEXTENCODING_UTF8 ).getStr()); + docPrattrList->add( XML_title, OUStringToOString( pGrfNode ? pGrfNode->GetTitle() : pOLEFrmFmt->GetObjTitle(), RTL_TEXTENCODING_UTF8 ).getStr()); XFastAttributeListRef docPrAttrListRef( docPrattrList ); m_pSerializer->startElementNS( XML_wp, XML_docPr, docPrAttrListRef ); // TODO hyperlink @@ -2227,7 +2231,7 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size m_pSerializer->endElementNS( XML_a, XML_ln ); // Output effects - SvxShadowItem aShadowItem = rGrfNode.GetFlyFmt()->GetShadow(); + SvxShadowItem aShadowItem = pFrmFmt->GetShadow(); if ( aShadowItem.GetLocation() != SVX_SHADOW_NONE ) { // Distance is measured diagonally from corner @@ -2268,12 +2272,14 @@ void DocxAttributeOutput::FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size m_pSerializer->endElementNS( XML_w, XML_drawing ); } -void DocxAttributeOutput::WriteOLE2Obj( const SdrObject* pSdrObj, const SwOLENode& rOLENode, const Size& rSize ) +void DocxAttributeOutput::WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rOLENode, const Size& rSize, const SwFlyFrmFmt* pFlyFrmFmt ) { if( WriteOLEChart( pSdrObj, rSize )) return; if( WriteOLEMath( pSdrObj, rOLENode, rSize )) return; + // Then we fall back to just export the object as a graphic. + FlyFrameGraphic( 0, rSize, pFlyFrmFmt, &rOLENode ); } bool DocxAttributeOutput::WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize ) @@ -2394,7 +2400,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po if ( pGrfNode ) { if( m_postponedGraphic == NULL ) - FlyFrameGraphic( *pGrfNode, rFrame.GetLayoutSize() ); + FlyFrameGraphic( pGrfNode, rFrame.GetLayoutSize() ); else // we are writting out attributes, but w:drawing should not be inside w:rPr, { // so write it out later m_postponedGraphic->push_back( PostponedGraphic( pGrfNode, rFrame.GetLayoutSize())); @@ -2446,7 +2452,7 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po { SwNodeIndex aIdx(*rFrmFmt.GetCntnt().GetCntntIdx(), 1); SwOLENode& rOLENd = *aIdx.GetNode().GetOLENode(); - WriteOLE2Obj( pSdrObj, rOLENd, rFrame.GetLayoutSize() ); + WriteOLE2Obj( pSdrObj, rOLENd, rFrame.GetLayoutSize(), dynamic_cast<const SwFlyFrmFmt*>( &rFrmFmt )); } } break; diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index be0c361a3d0f..b1302b69fd30 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -299,9 +299,14 @@ private: /// @see InitCollectedRunProperies(), WriteCollectedParagraphProperties() void WriteCollectedRunProperties(); - /// Output graphic fly frames. - void FlyFrameGraphic( const SwGrfNode& rGrfNode, const Size& rSize ); - void WriteOLE2Obj( const SdrObject* pSdrObj, const SwOLENode& rNode, const Size& rSize ); + /// Output graphic fly frames or replacement graphics for OLE nodes. + /// + /// For graphic frames, just use the first two parameters, for OLE + /// replacement graphics, set the first as 0, and pass the remaining three. + /// + /// @see WriteOLE2Obj() + void FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrmFmt* pOLEFrmFmt = 0, SwOLENode* pOLENode = 0); + void WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rNode, const Size& rSize, const SwFlyFrmFmt* pFlyFrmFmt); bool WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize ); bool WriteOLEMath( const SdrObject* pSdrObj, const SwOLENode& rNode, const Size& rSize ); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 00558fe5afe0..b9315295a5f0 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -2331,17 +2331,20 @@ void RtfAttributeOutput::TextFootnote_Impl( const SwFmtFtn& rFootnote ) /* * The footnote contains a whole paragraph, so we have to: - * 1) Reset, then later restore the contents of our run buffer. + * 1) Reset, then later restore the contents of our run buffer and run state. * 2) Buffer the output of the whole paragraph, as we do so for section headers already. */ const SwNodeIndex* pIndex = rFootnote.GetTxtFtn()->GetStartNode(); RtfStringBuffer aRun = m_aRun; m_aRun.clear(); + bool bInRunOrig = m_bInRun; + m_bInRun = false; m_bBufferSectionHeaders = true; m_rExport.WriteSpecialText( pIndex->GetIndex() + 1, pIndex->GetNode().EndOfSectionIndex(), !rFootnote.IsEndNote() ? TXT_FTN : TXT_EDN); m_bBufferSectionHeaders = false; + m_bInRun = bInRunOrig; m_aRun = aRun; m_aRun->append(m_aSectionHeaders.makeStringAndClear()); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 4ae68d2be8f0..33ab00928488 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -468,13 +468,6 @@ void RtfExport::WritePageDescTable() void RtfExport::ExportDocument_Impl() { -#if OSL_DEBUG_LEVEL > 1 - // MSWordExportBase::WriteText and others write debug messages to std::clog - // which is not interesting while debugging RtfExport - std::ostringstream aOss; - std::streambuf *pOldBuf = std::clog.rdbuf(aOss.rdbuf()); -#endif - // Make the header Strm() << '{' << OOO_STRING_SVTOOLS_RTF_RTF << '1' << OOO_STRING_SVTOOLS_RTF_ANSI; @@ -681,10 +674,6 @@ void RtfExport::ExportDocument_Impl() WriteMainText(); Strm() << '}'; - -#if OSL_DEBUG_LEVEL > 1 - std::clog.rdbuf(pOldBuf); -#endif } void RtfExport::PrepareNewPageDesc( const SfxItemSet* pSet, diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index ae461a3ed1ee..b4ab86aaa18d 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -2775,10 +2775,15 @@ sal_uInt32 SwEscherEx::QueryTextID( } SwMSConvertControls::SwMSConvertControls( SfxObjectShell *pDSh,SwPaM *pP ) : oox -::ole::MSConvertOCXControls( pDSh ? pDSh->GetModel() : NULL ), pPaM( pP ) +::ole::MSConvertOCXControls( pDSh ? pDSh->GetModel() : NULL ), pPaM( pP ), mnObjectId(0) { } +sal_uInt32 SwMSConvertControls::GenerateObjectID() +{ + return ++mnObjectId; +} + // in transitioning away old filter for ole/ocx controls, ReadOCXStream has been made pure virtual in // filter/source/msocximex.cxx, so.. we need an implementation here sal_Bool SwMSConvertControls::ReadOCXStream( SotStorageRef& rSrc1, @@ -2821,7 +2826,8 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pOb //Create a destination storage for the microsoft control rtl::OUStringBuffer sStorageName; - sStorageName.append('_').append(reinterpret_cast<sal_Int64>(pObj)); + sal_uInt32 nObjId = GenerateObjectID(); + sStorageName.append('_').append( static_cast<sal_Int64>( nObjId )); SvStorageRef xOleStg = xObjPool->OpenSotStorage(sStorageName.makeStringAndClear(), STREAM_READWRITE|STREAM_SHARE_DENYALL); @@ -2844,7 +2850,7 @@ bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pOb }; //Set the obj id into the sprmCPicLocation sal_uInt8 *pData = aSpecOLE+2; - Set_UInt32(pData,(sal_uInt32)(sal_uIntPtr)pObj); + Set_UInt32(pData,nObjId ); String sFld(FieldString(ww::eCONTROL)); sFld.APPEND_CONST_ASC("Forms."); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index e0713fa5a2c9..9159ba6e8c93 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1556,9 +1556,8 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rS if ( pTextNodeInfo.get() != NULL ) { #ifdef DBG_UTIL - ::std::clog << pTextNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pTextNodeInfo->toString()); #endif - TableInfoCell( pTextNodeInfoInner ); } @@ -1744,9 +1743,7 @@ void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nA void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) { -#ifdef DBG_UTIL - ::std::clog << "<OutWW8_SwTxtNode>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "<OutWW8_SwTxtNode>" ); ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo( mpTableInfo->getTableNodeInfo( &rNode ) ); @@ -2056,7 +2053,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) if ( pTextNodeInfo.get() != NULL ) { #ifdef DBG_UTIL - ::std::clog << pTextNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pTextNodeInfo->toString()); #endif AttrOutput().TableInfoCell( pTextNodeInfoInner ); @@ -2357,9 +2354,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) AttrOutput().EndParagraph( pTextNodeInfoInner ); -#ifdef DBG_UTIL - ::std::clog << "</OutWW8_SwTxtNode>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "</OutWW8_SwTxtNode>" ); } void WW8AttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo ) diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index ab70d5b34ae6..2141e28c8275 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -2034,13 +2034,13 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp, nTTyp ); { SwNodeIndex aContentIdx = *pNdIdx; - aContentIdx++; + ++aContentIdx; if ( aContentIdx.GetNode().IsTableNode() ) { bool bContainsOnlyTables = true; do { aContentIdx = *(aContentIdx.GetNode().EndOfSectionNode()); - aContentIdx++; + ++aContentIdx; if ( !aContentIdx.GetNode().IsTableNode() && aContentIdx.GetIndex() != pNdIdx->GetNode().EndOfSectionIndex() ) { diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 112d4ab4b71f..4f2f6bc427e4 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1637,9 +1637,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, xub_StrLen nLen, bool bUnicode, rtl_TextEncoding eChrSet) { -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "<OutSwString>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "<OutSwString>" ); if( nLen ) { @@ -1650,9 +1648,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, { String sOut( rStr.Copy( nStt, nLen ) ); -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << ::rtl::OUStringToOString(sOut, RTL_TEXTENCODING_ASCII_US).getStr() << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", sOut ); if (bUnicode) SwWW8Writer::WriteString16(Strm(), sOut, false); @@ -1661,9 +1657,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, } else { -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << ::rtl::OUStringToOString(rStr, RTL_TEXTENCODING_ASCII_US).getStr() << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", rStr ); if (bUnicode) SwWW8Writer::WriteString16(Strm(), rStr, false); @@ -1672,9 +1666,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, } } -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "</OutSwString>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "</OutSwString>" ); } void WW8Export::WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) @@ -1855,7 +1847,7 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTa } } -static sal_uInt16 lcl_TCFlags(const SwTableBox * pBox, long nRowSpan) +static sal_uInt16 lcl_TCFlags(const SwTableBox * pBox, sal_Int32 nRowSpan) { sal_uInt16 nFlags = 0; @@ -2140,9 +2132,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t for( aIt = pTableBoxes->begin(); aIt != aItEnd; ++aIt, ++aItRowSpans) { -#if OSL_DEBUG_LEVEL > 1 sal_uInt16 npOCount = m_rWW8Export.pO->size(); -#endif const SwTableBox * pTabBox1 = *aIt; const SwFrmFmt * pBoxFmt = NULL; @@ -2168,10 +2158,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t else m_rWW8Export.Out_SwFmtTableBox( *m_rWW8Export.pO, NULL); // 8/16 Byte -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "<tclength>" << m_rWW8Export.pO->size() - npOCount << "</tclength>" - << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "<tclength>" << ( m_rWW8Export.pO->size() - npOCount ) << "</tclength>" ); } } @@ -2444,16 +2431,12 @@ void MSWordExportBase::WriteText() ::SetProgressState( nPos, pCurPam->GetDoc()->GetDocShell() ); } -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "</WriteText>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "</WriteText>" ); } void WW8Export::WriteMainText() { -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "<WriteMainText>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "<WriteMainText>" ); pFib->fcMin = Strm().Tell(); @@ -2476,9 +2459,7 @@ void WW8Export::WriteMainText() if( pLastNd ) nLastFmtId = GetId( (SwTxtFmtColl&)pLastNd->GetAnyFmtColl() ); -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "</WriteMainText>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "</WriteMainText>" ); } bool MSWordExportBase::IsInTable() const @@ -3608,7 +3589,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer ShortToSVBT16( m_rWW8Export.nStyleBeforeFly, nStyle ); #ifdef DBG_UTIL - ::std::clog << "<OutWW8_TableNodeInfoInner>" << pNodeInfoInner->toString(); + SAL_INFO( "sw.ww8", "<OutWW8_TableNodeInfoInner>" << pNodeInfoInner->toString()); #endif m_rWW8Export.pO->clear(); @@ -3637,9 +3618,8 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer if (pNodeInfoInner->isEndOfCell()) { -#ifdef DBG_UTIL - ::std::clog << "<endOfCell/>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "<endOfCell/>" ); + m_rWW8Export.WriteCR(pNodeInfoInner); m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nStyle, (sal_uInt8*)&nStyle+2 ); // Style # @@ -3672,9 +3652,8 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer if (pNodeInfoInner->isEndOfLine()) { -#ifdef DBG_UTIL - ::std::clog << "<endOfLine/>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "<endOfLine/>" ); + TableRowEnd(pNodeInfoInner->getDepth()); ShortToSVBT16(0, nStyle); @@ -3684,9 +3663,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer m_rWW8Export.pO->clear(); } -#ifdef DBG_UTIL - ::std::clog << "</OutWW8_TableNodeInfoInner>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "</OutWW8_TableNodeInfoInner>" ); } void MSWordExportBase::OutputStartNode( const SwStartNode & rNode) @@ -3698,9 +3675,8 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode) if (pNodeInfo.get() != NULL) { #ifdef DBG_UTIL - ::std::clog << pNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pNodeInfo->toString()); #endif - const ww8::WW8TableNodeInfo::Inners_t aInners = pNodeInfo->getInners(); ww8::WW8TableNodeInfo::Inners_t::const_reverse_iterator aIt(aInners.rbegin()); ww8::WW8TableNodeInfo::Inners_t::const_reverse_iterator aEnd(aInners.rend()); @@ -3712,25 +3688,21 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode) ++aIt; } } -#ifdef DBG_UTIL - ::std::clog << "</OutWW8_SwStartNode>" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "</OutWW8_SwStartNode>" ); } void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) { #ifdef DBG_UTIL -// whoever has need of the missing function should go and implement it! -// This piece of code always breaks builds... -// ::std::clog << "<OutWW8_SwEndNode>" << dbg_out(&rNode) << ::std::endl; + SAL_INFO( "sw.ww8", "<OutWW8_SwEndNode>" << dbg_out(&rNode)); #endif ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = mpTableInfo->getTableNodeInfo( &rNode ); if (pNodeInfo.get() != NULL) - { + { #ifdef DBG_UTIL - ::std::clog << pNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pNodeInfo->toString()); #endif const ww8::WW8TableNodeInfo::Inners_t aInners = pNodeInfo->getInners(); @@ -3742,10 +3714,8 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) AttrOutput().TableNodeInfoInner(pInner); ++aIt; } - } -#ifdef DBG_UTIL - ::std::clog << "</OutWW8_SwEndNode>" << ::std::endl; -#endif + } + SAL_INFO( "sw.ww8", "</OutWW8_SwEndNode>" ); } const NfKeywordTable & MSWordExportBase::GetNfKeywordTable() diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 3b4de1e1d61f..9f2fe0a36891 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -436,7 +436,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame) { const SwTxtNode* pTxtNd = (const SwTxtNode*)pOutFmtNode; SwPosition aPos(*pTxtNd); - bVert = pDoc->IsInVerticalText(aPos) ? true : false; + bVert = pDoc->IsInVerticalText(aPos); } if (!bVert) { diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index bdaded82da3a..1ee64765002b 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -112,7 +112,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, while( !( aStart.GetNode().IsStartNode() && SwNormalStartNode == aStart.GetNode().GetStartNode()->GetStartNodeType()) && aStart < aDocEnd ) - aStart++; + ++aStart; if( aStart < aDocEnd ) { @@ -124,7 +124,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, SwPaM aPam( aStart ); { SwNodeIndex& rIdx = aPam.GetPoint()->nNode; - rIdx++; + ++rIdx; if( 0 == ( pCNd = rIdx.GetNode().GetTxtNode() ) ) { pCNd = pD->GetNodes().MakeTxtNode( rIdx, pColl ); @@ -139,7 +139,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks, if(( 0 == ( pCNd = rIdx.GetNode().GetCntntNode() ) ) || HasBareGraphicEnd(pD,rIdx)) { - rIdx++; + ++rIdx; pCNd = pD->GetNodes().MakeTxtNode( rIdx, pColl ); rIdx = *pCNd; } diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 26b1483f387e..ab53845a0a68 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -678,10 +678,10 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long nStartCp, long nEndCp, if (bSymbol == false && bDoingSymbol) { bDoingSymbol = false; - String sTemp; - sTemp.Fill(writer_cast<xub_StrLen>( - nTxtStart - nStartReplace), cReplaceSymbol); - mpDrawEditEngine->QuickInsertText(sTemp, + rtl::OUStringBuffer sTemp; + comphelper::string::padToLength(sTemp, + nTxtStart - nStartReplace, cReplaceSymbol); + mpDrawEditEngine->QuickInsertText(sTemp.makeStringAndClear(), GetESelection(nStartReplace - nStartCp, nTxtStart - nStartCp ) ); } diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index 0bafbd21cdc7..81bab22639fd 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -529,7 +529,6 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, SdrObject* pObject = 0; WW8PicDesc aPD( aPic ); - String aGrName; if (!pMSDffManager) pMSDffManager = new SwMSDffManager(*this); /* diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index a0501a10c81b..b78b59e28b8a 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3183,11 +3183,9 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) if (!maFtnStack.empty()) cInsert = 0x2; break; -#if OSL_DEBUG_LEVEL > 1 default: - ::std::clog << "<unknownValue val=\"" << nWCharVal << "\">" << ::std::endl; + SAL_INFO( "sw.ww8.level2", "<unknownValue val=\"" << nWCharVal << "\">" ); break; -#endif } if( '\x0' != cInsert ) diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 9215369e061f..44f6511369fb 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -656,7 +656,9 @@ public: com::sun::star::drawing::XShape > *pShapeRef=0, sal_Bool bFloatingCtrl=false ); private: + sal_uInt32 GenerateObjectID(); SwPaM *pPaM; + sal_uInt32 mnObjectId; }; class SwMSDffManager : public SvxMSDffManager diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 83db83e8b71e..283300f0bf20 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -687,16 +687,19 @@ void SwWW8ImplReader::SetAnlvStrings(SwNumFmt &rNum, WW8_ANLV &rAV, if( bOutline ) { // Gliederung if( !rNum.GetIncludeUpperLevels() // es sind <= 1 Nummern anzuzeigen - || rNum.GetNumberingType() == SVX_NUM_NUMBER_NONE ){ // oder dieser Level hat keine + || rNum.GetNumberingType() == SVX_NUM_NUMBER_NONE ) // oder dieser Level hat keine + { // eigenen Ziffern bInsert = true; // -> dann uebernehme Zeichen // replace by simple Bullet ? if( bListSymbol ) + { //cBulletChar benutzen, damit auf dem MAC richtig gemappt wird sTxt.Fill( SVBT8ToByte( rAV.cbTextBefore ) + SVBT8ToByte( rAV.cbTextAfter ), cBulletChar ); } + } } else { // Nummerierung / Aufzaehlung @@ -779,7 +782,7 @@ SwNumRule* SwWW8ImplReader::GetStyRule() const String aName( rDoc.GetUniqueNumRuleName( &aBaseName, false) ); // #i86652# - sal_uInt16 nRul = rDoc.MakeNumRule( aName, 0, sal_False, + sal_uInt16 nRul = rDoc.MakeNumRule( aName, 0, false, SvxNumberFormat::LABEL_ALIGNMENT ); pStyles->pStyRule = rDoc.GetNumRuleTbl()[nRul]; // Auto == false-> Nummerierungsvorlage @@ -997,7 +1000,7 @@ void SwWW8ImplReader::StartAnl(const sal_uInt8* pSprm13) { // #i86652# pNumRule = rDoc.GetNumRuleTbl()[ - rDoc.MakeNumRule( sNumRule, 0, sal_False, + rDoc.MakeNumRule( sNumRule, 0, false, SvxNumberFormat::LABEL_ALIGNMENT ) ]; } if (pTableDesc) diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 14b0ea40e285..c76c7f33b9b7 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -1039,7 +1039,7 @@ SwNumRule* WW8ListManager::CreateNextRule(bool bSimple) sPrefix += String::CreateFromInt32(nUniqueList++); // #i86652# sal_uInt16 nRul = - rDoc.MakeNumRule( rDoc.GetUniqueNumRuleName(&sPrefix), 0, sal_False, + rDoc.MakeNumRule( rDoc.GetUniqueNumRuleName(&sPrefix), 0, false, SvxNumberFormat::LABEL_ALIGNMENT ); SwNumRule* pMyNumRule = rDoc.GetNumRuleTbl()[nRul]; pMyNumRule->SetAutoRule(false); @@ -1595,8 +1595,7 @@ bool SwWW8ImplReader::SetTxtFmtCollAndListLevel(const SwPaM& rRg, bool bRes = true; if( rStyleInfo.pFmt && rStyleInfo.bColl ) { - bRes = rDoc.SetTxtFmtColl(rRg, (SwTxtFmtColl*)rStyleInfo.pFmt) - ? true : false; + bRes = rDoc.SetTxtFmtColl(rRg, (SwTxtFmtColl*)rStyleInfo.pFmt); SwTxtNode* pTxtNode = pPaM->GetNode()->GetTxtNode(); OSL_ENSURE( pTxtNode, "No Text-Node at PaM-Position" ); // make code robust @@ -2183,8 +2182,8 @@ void WW8FormulaControl::FormulaRead(SwWw8ControlType nWhich, // xstzStatText sToolTip = read_uInt16_BeltAndBracesString(*pDataStream); - String sEntryMacro = read_uInt16_BeltAndBracesString(*pDataStream); - String sExitMcr = read_uInt16_BeltAndBracesString(*pDataStream); + /*String sEntryMacro =*/ read_uInt16_BeltAndBracesString(*pDataStream); + /*String sExitMcr =*/ read_uInt16_BeltAndBracesString(*pDataStream); if (nWhich == WW8_CT_DROPDOWN) { diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index cc9990ebf767..f53d35439645 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2813,7 +2813,6 @@ static void EnsureMaxLevelForTemplates(SwTOXBase& rBase) { for (sal_uInt16 nI = MAXLEVEL; nI > 0; --nI) { - String sStyles(rBase.GetStyleNames(nI-1)); if (rBase.GetStyleNames(nI-1).Len()) { rBase.SetLevel(nI); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 042ef68cb2fa..9d9aaed3853c 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2200,11 +2200,11 @@ SwTwips SwWW8ImplReader::MoveOutsideFly(SwFrmFmt *pFlyFmt, { SwTableNode *pTable = aIdx.GetNode().GetTableNode(); aIdx = *aIdx.GetNode().EndOfSectionNode(); - aIdx++; + ++aIdx; if ( (aIdx < aEnd) && aIdx.GetNode().IsTxtNode() ) { SwTxtNode *pNd = aIdx.GetNode().GetTxtNode(); - aIdx++; + ++aIdx; if (aIdx == aEnd && pNd && !pNd->GetTxt().Len()) { //An extra pre-created by writer unused paragraph diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index 80af530197ee..310818d25aa3 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -162,11 +162,11 @@ sal_Int32 ReadThroughComponent( RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" ); // get filter + OUString aFilterName(OUString::createFromAscii(pFilterName)); uno::Reference< xml::sax::XDocumentHandler > xFilter( - rFactory->createInstanceWithArguments( - OUString::createFromAscii(pFilterName), rFilterArguments), - UNO_QUERY ); - OSL_ENSURE( xFilter.is(), "Can't instantiate filter component." ); + rFactory->createInstanceWithArguments(aFilterName, rFilterArguments), + UNO_QUERY); + SAL_WARN_IF(!xFilter.is(), "sw", "Can't instantiate filter component: " << aFilterName); if( !xFilter.is() ) return ERR_SWG_READ_ERROR; RTL_LOGFILE_CONTEXT_TRACE1( aLog, "%s created", pFilterName ); diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 9dd317aa7e9f..48f7953c32ed 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -33,7 +33,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/task/XStatusIndicatorFactory.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/Writer.hpp> #include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/frame/XModule.hpp> @@ -57,6 +57,7 @@ #include <statstr.hrc> #include <rtl/logfile.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/documentconstants.hxx> #include <comphelper/makesequence.hxx> #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp> @@ -609,13 +610,7 @@ sal_Bool SwXMLWriter::WriteThroughComponent( "SwXMLWriter::WriteThroughComponent" ); // get component - uno::Reference< io::XActiveDataSource > xSaxWriter( - rFactory->createInstance(rtl::OUString("com.sun.star.xml.sax.Writer")), - UNO_QUERY ); - OSL_ENSURE( xSaxWriter.is(), "can't instantiate XML writer" ); - if(!xSaxWriter.is()) - return sal_False; - + uno::Reference< xml::sax::XWriter > xSaxWriter = xml::sax::Writer::create(comphelper::getComponentContext(rFactory)); RTL_LOGFILE_CONTEXT_TRACE( aFilterLog, "SAX-Writer created" ); // connect XML writer to output stream diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src index 99d63e95169f..75c534048557 100644 --- a/sw/source/ui/app/app.src +++ b/sw/source/ui/app/app.src @@ -655,6 +655,23 @@ String STR_COL Text [ en-US ] = "Column" ; }; +String STR_SIMPLE +{ + Text [ en-US ] = "Plain" ; +}; + +String STR_AUTHMRK_EDIT +{ + + Text [ en-US ] = "Edit Bibliography Entry"; +}; + +String STR_AUTHMRK_INSERT +{ + + Text [ en-US ] = "Insert Bibliography Entry"; +}; + ToolBox RID_MODULE_TOOLBOX { HelpID = HID_MODULE_TOOLBOX ; diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 459b561a8f88..fdf197c1b891 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -1212,7 +1212,7 @@ void SwDocShell::CalcLayoutForOLEObjects() // read by the binary filter: void SwDocShell::UpdateLinks() { - GetDoc()->UpdateLinks(sal_True); + GetDoc()->UpdateLinks(true); // #i50703# Update footnote numbers SwTxtFtn::SetUniqueSeqRefNo( *GetDoc() ); SwNodeIndex aTmp( GetDoc()->GetNodes() ); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 2422085d4154..af61d561bdfa 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -982,7 +982,7 @@ void SwDocShell::Execute(SfxRequest& rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - AbstractSwInsertAbstractDlg* pDlg = pFact->CreateSwInsertAbstractDlg(0, DLG_INSERT_ABSTRACT ); + AbstractSwInsertAbstractDlg* pDlg = pFact->CreateSwInsertAbstractDlg(0); OSL_ENSURE(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) { @@ -992,7 +992,7 @@ void SwDocShell::Execute(SfxRequest& rReq) SfxObjectShellLock xDocSh( new SwDocShell( pSmryDoc, SFX_CREATE_MODE_STANDARD)); xDocSh->DoInitNew( 0 ); - sal_Bool bImpress = FN_ABSTRACT_STARIMPRESS == nWhich; + bool bImpress = FN_ABSTRACT_STARIMPRESS == nWhich; pDoc->Summary( pSmryDoc, nLevel, nPara, bImpress ); if( bImpress ) { @@ -1124,8 +1124,8 @@ void SwDocShell::Execute(SfxRequest& rReq) } break; case SID_SPELLCHECKER_CHANGED: - //! sal_False, sal_True, sal_True is on the save side but a probably overdone - SW_MOD()->CheckSpellChanges(sal_False, sal_True, sal_True, sal_False ); + //! false, true, true is on the save side but a probably overdone + SW_MOD()->CheckSpellChanges(false, true, true, false ); break; case SID_MAIL_PREPAREEXPORT: diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index 8f90a15323ec..be9eb6d8ad1f 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -1008,7 +1008,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr pFrm->SetFmtAttr( aSet ); // also apply template to remove hard set attributes - pCurrWrtShell->SetFrmFmt( pFrm, sal_True ); + pCurrWrtShell->SetFrmFmt( pFrm, true ); pCurrWrtShell->EndAllAction(); } } diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index 43b25474488b..e7a08e18989d 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -1709,7 +1709,7 @@ void SwDocStyleSheet::Create() if( !pCharFmt ) pCharFmt = rDoc.MakeCharFmt(aName, rDoc.GetDfltCharFmt()); - pCharFmt->SetAuto( sal_False ); + pCharFmt->SetAuto( false ); break; case SFX_STYLE_FAMILY_PARA : @@ -1727,7 +1727,7 @@ void SwDocStyleSheet::Create() case SFX_STYLE_FAMILY_FRAME: pFrmFmt = lcl_FindFrmFmt( rDoc, aName ); if( !pFrmFmt ) - pFrmFmt = rDoc.MakeFrmFmt(aName, rDoc.GetDfltFrmFmt(), sal_False, sal_False); + pFrmFmt = rDoc.MakeFrmFmt(aName, rDoc.GetDfltFrmFmt(), false, false); break; @@ -1749,7 +1749,7 @@ void SwDocStyleSheet::Create() sTmpNm = rDoc.GetUniqueNumRuleName(); SwNumRule* pRule = rDoc.GetNumRuleTbl()[ - rDoc.MakeNumRule( sTmpNm, 0, sal_False, + rDoc.MakeNumRule( sTmpNm, 0, false, // #i89178# numfunc::GetDefaultPositionAndSpaceMode() ) ]; pRule->SetAutoRule( sal_False ); diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index eb98808b6aa7..b0621bdb2681 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -84,11 +84,11 @@ static void lcl_SetUIPrefs(const SwViewOption &rPref, SwView* pView, ViewShell* // Scrollbars on / off if(bVScrollChanged) { - pView->ShowVScrollbar(pNewPref->IsViewVScrollBar()); + pView->EnableVScrollbar(pNewPref->IsViewVScrollBar()); } if(bHScrollChanged) { - pView->ShowHScrollbar( pNewPref->IsViewHScrollBar() || pNewPref->getBrowseMode() ); + pView->EnableHScrollbar( pNewPref->IsViewHScrollBar() || pNewPref->getBrowseMode() ); } //if only the position of the vertical ruler has been changed initiate an update if(bVAlignChanged && !bHScrollChanged && !bVScrollChanged) @@ -163,8 +163,8 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView, { if(!bViewOnly) pPref->SetUIOptions( rUsrPref ); - pPPView->ShowVScrollbar(pPref->IsViewVScrollBar()); - pPPView->ShowHScrollbar(pPref->IsViewHScrollBar()); + pPPView->EnableVScrollbar(pPref->IsViewVScrollBar()); + pPPView->EnableHScrollbar(pPref->IsViewHScrollBar()); if(!bViewOnly) { pPref->SetPagePrevRow(rUsrPref.GetPagePrevRow()); @@ -613,11 +613,11 @@ void SwModule::ApplyLinkMode(sal_Int32 nNewLinkMode) pUsrPref->SetUpdateLinkMode(nNewLinkMode); } -void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling, - sal_Bool bIsSpellWrongAgain, sal_Bool bIsSpellAllAgain, sal_Bool bSmartTags ) +void SwModule::CheckSpellChanges( bool bOnlineSpelling, + bool bIsSpellWrongAgain, bool bIsSpellAllAgain, bool bSmartTags ) { - sal_Bool bOnlyWrong = bIsSpellWrongAgain && !bIsSpellAllAgain; - sal_Bool bInvalid = bOnlyWrong || bIsSpellAllAgain; + bool bOnlyWrong = bIsSpellWrongAgain && !bIsSpellAllAgain; + bool bInvalid = bOnlyWrong || bIsSpellAllAgain; if( bOnlineSpelling || bInvalid ) { TypeId aType = TYPE(SwDocShell); diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx index 18c2ac42fa1e..7844f068b300 100644 --- a/sw/source/ui/cctrl/actctrl.cxx +++ b/sw/source/ui/cctrl/actctrl.cxx @@ -129,7 +129,7 @@ void ReturnActionEdit::KeyInput( const KeyEvent& rEvt) extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeTableNameEdit(Window *pParent, VclBuilder::stringmap &) { TableNameEdit* pTableNameEdit = new TableNameEdit(pParent); - pTableNameEdit->SetMaxWidthInChars(25); + pTableNameEdit->SetWidthInChars(25); return pTableNameEdit; } diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index f96a2e7cd6fc..cd44c3c258f8 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -44,7 +44,7 @@ #include <sfx2/printer.hxx> #include <com/sun/star/i18n/ScriptType.hpp> #include <editeng/scripttypeitem.hxx> -#include <com/sun/star/i18n/XBreakIterator.hpp> +#include <com/sun/star/i18n/BreakIterator.hpp> #include <comphelper/processfactory.hxx> #include "charatr.hxx" @@ -411,34 +411,30 @@ void SwDropCapsPict::CheckScript( void ) maScriptChanges.clear(); if( !xBreak.is() ) { - Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); - xBreak = Reference< I18N::XBreakIterator >(xMSF->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) ),UNO_QUERY); + Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + xBreak = I18N::BreakIterator::create(xContext); } - if( xBreak.is() ) + sal_uInt16 nScript = xBreak->getScriptType( maText, 0 ); + sal_uInt16 nChg = 0; + if( I18N_SCRIPTTYPE::WEAK == nScript ) { - sal_uInt16 nScript = xBreak->getScriptType( maText, 0 ); - sal_uInt16 nChg = 0; - if( I18N_SCRIPTTYPE::WEAK == nScript ) - { - nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript ); - if( nChg < maText.Len() ) - nScript = xBreak->getScriptType( maText, nChg ); - else - nScript = I18N_SCRIPTTYPE::LATIN; - } + nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript ); + if( nChg < maText.Len() ) + nScript = xBreak->getScriptType( maText, nChg ); + else + nScript = I18N_SCRIPTTYPE::LATIN; + } - do - { - nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript ); - maScriptChanges.push_back( _ScriptInfo(0, nScript, nChg) ); + do + { + nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript ); + maScriptChanges.push_back( _ScriptInfo(0, nScript, nChg) ); - if( nChg < maText.Len() ) - nScript = xBreak->getScriptType( maText, nChg ); - else - break; - } while( sal_True ); - } + if( nChg < maText.Len() ) + nScript = xBreak->getScriptType( maText, nChg ); + else + break; + } while( sal_True ); } Size SwDropCapsPict::CalcTextSize( void ) diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index ae6ed562a063..627dce855c4d 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -218,7 +218,7 @@ void SwCondCollPage::Reset(const SfxItemSet &/*rSet*/) aEntry += pCond->GetTxtFmtColl()->GetName(); } - SvLBoxEntry* pE = aTbLinks.InsertEntryToColumn( aEntry, n ); + SvTreeListEntry* pE = aTbLinks.InsertEntryToColumn( aEntry, n ); if(0 == n) aTbLinks.Select(pE); } @@ -248,7 +248,7 @@ IMPL_LINK( SwCondCollPage, OnOffHdl, CheckBox*, pBox ) IMPL_LINK( SwCondCollPage, AssignRemoveHdl, PushButton*, pBtn) { - SvLBoxEntry* pE = aTbLinks.FirstSelected(); + SvTreeListEntry* pE = aTbLinks.FirstSelected(); sal_uLong nPos; if( !pE || LISTBOX_ENTRY_NOTFOUND == ( nPos = aTbLinks.GetModel()->GetAbsPos( pE ) ) ) @@ -299,7 +299,7 @@ IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox) else { String sTbEntry; - SvLBoxEntry* pE = aTbLinks.FirstSelected(); + SvTreeListEntry* pE = aTbLinks.FirstSelected(); if(pE) sTbEntry = aTbLinks.GetEntryText(pE); sTbEntry = sTbEntry.GetToken(1, '\t'); diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index 430312c0883e..197259a2e4ef 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -548,7 +548,7 @@ IMPL_LINK_NOARG(SwAuthenticationSettingsDialog, RadioButtonHdl_Impl) { sal_Bool bSeparate = m_aSeparateAuthenticationRB.IsChecked(); sal_Bool bIsEnabled = m_aSeparateAuthenticationRB.IsEnabled(); - sal_Bool bNotSeparate = !bSeparate & bIsEnabled; + sal_Bool bNotSeparate = !bSeparate && bIsEnabled; bSeparate &= bIsEnabled; m_aOutgoingServerFT.Enable(bSeparate); diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index c008302ed1e8..e7f725fc17ce 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -137,7 +137,7 @@ SwCompatibilityOptPage::SwCompatibilityOptPage( Window* pParent, const SfxItemSe STR_USE_OBJPOSITIONING == nResId || STR_USE_OURTEXTWRAPPING == nResId ) ReplaceFormatName( sEntry ); - SvLBoxEntry* pEntry = m_aOptionsLB.SvTreeListBox::InsertEntry( sEntry ); + SvTreeListEntry* pEntry = m_aOptionsLB.SvTreeListBox::InsertEntry( sEntry ); if ( pEntry ) { m_aOptionsLB.SetCheckButtonState( pEntry, SV_BUTTON_UNCHECKED ); diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 760cf2035103..4bd16dbca1f0 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -527,7 +527,7 @@ sal_Bool SwCaptionOptPage::FillItemSet( SfxItemSet& ) SaveEntry(aCheckLB.FirstSelected()); // apply current entry - SvLBoxEntry* pEntry = aCheckLB.First(); + SvTreeListEntry* pEntry = aCheckLB.First(); while (pEntry) { @@ -609,7 +609,7 @@ void SwCaptionOptPage::SetOptions(const sal_uInt16 nPos, void SwCaptionOptPage::DelUserData() { - SvLBoxEntry* pEntry = aCheckLB.First(); + SvTreeListEntry* pEntry = aCheckLB.First(); while (pEntry) { @@ -621,7 +621,7 @@ void SwCaptionOptPage::DelUserData() IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) { - SvLBoxEntry* pSelEntry = aCheckLB.FirstSelected(); + SvTreeListEntry* pSelEntry = aCheckLB.FirstSelected(); if (pSelEntry) { @@ -746,7 +746,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) IMPL_LINK_NOARG(SwCaptionOptPage, SaveEntryHdl) { - SvLBoxEntry* pEntry = aCheckLB.GetHdlEntry(); + SvTreeListEntry* pEntry = aCheckLB.GetHdlEntry(); if (pEntry) // save all SaveEntry(pEntry); @@ -754,7 +754,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, SaveEntryHdl) return 0; } -void SwCaptionOptPage::SaveEntry(SvLBoxEntry* pEntry) +void SwCaptionOptPage::SaveEntry(SvTreeListEntry* pEntry) { if (pEntry) { diff --git a/sw/source/ui/config/optload.src b/sw/source/ui/config/optload.src index 5dc8dd05fd2c..e849b75e3e27 100644 --- a/sw/source/ui/config/optload.src +++ b/sw/source/ui/config/optload.src @@ -138,13 +138,14 @@ TabPage TP_OPTLOAD_PAGE CheckBox CB_USE_SQUARE_PAGE_MODE { HelpID = "sw:CheckBox:TP_OPTLOAD_PAGE:CB_USE_SQUARE_PAGE_MODE"; - Pos = MAP_APPFONT ( 12 , 111) ; + Pos = MAP_APPFONT ( 12 , 130) ; Size = MAP_APPFONT ( 248 , 10 ) ; Text [ en-US ] = "Use square page mode for text grid"; }; CheckBox CB_USE_CHAR_UNIT { - Pos = MAP_APPFONT ( 12 , 130) ; + HelpID = "sw:CheckBox:TP_OPTLOAD_PAGE:CB_USE_CHAR_UNIT"; + Pos = MAP_APPFONT ( 12 , 111) ; Size = MAP_APPFONT ( 109 , 10 ) ; Text [ en-US ] = "Enable char unit"; }; diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx index 4e39c9da3a41..bfbf126eb70f 100644 --- a/sw/source/ui/config/uinums.cxx +++ b/sw/source/ui/config/uinums.cxx @@ -560,7 +560,7 @@ void SwNumRulesWithName::_SwNumFmtGlobal::ChgNumFmt( SwWrtShell& rSh, if( IsPoolUserFmt( nCharPoolId ) ) { pFmt = rSh.MakeCharFmt( sCharFmtName ); - pFmt->SetAuto( sal_False ); + pFmt->SetAuto( false ); } else pFmt = rSh.GetCharFmtFromPool( nCharPoolId ); diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 70b954e3b63f..c38b3f3baae8 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -231,7 +231,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) : { if ( pNames[nName] == sBibliography ) continue; - SvLBoxEntry* pEntry = m_aListLB.InsertEntry(pNames[nName]); + SvTreeListEntry* pEntry = m_aListLB.InsertEntry(pNames[nName]); AddressUserData_Impl* pUserData = new AddressUserData_Impl(); pEntry->SetUserData(pUserData); if(pNames[nName] == rCurrentData.sDataSource) @@ -270,7 +270,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) : SwAddressListDialog::~SwAddressListDialog() { - SvLBoxEntry* pEntry = m_aListLB.First(); + SvTreeListEntry* pEntry = m_aListLB.First(); while(pEntry) { AddressUserData_Impl* pUserData = static_cast<AddressUserData_Impl*>(pEntry->GetUserData()); @@ -281,7 +281,7 @@ SwAddressListDialog::~SwAddressListDialog() IMPL_LINK_NOARG(SwAddressListDialog, FilterHdl_Impl) { - SvLBoxEntry* pSelect = m_aListLB.FirstSelected(); + SvTreeListEntry* pSelect = m_aListLB.FirstSelected(); uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); if(pSelect && xMgr.is()) { @@ -350,7 +350,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, LoadHdl_Impl) String sNewSource = SwNewDBMgr::LoadAndRegisterDataSource(); if(sNewSource.Len()) { - SvLBoxEntry* pNewSource = m_aListLB.InsertEntry(sNewSource); + SvTreeListEntry* pNewSource = m_aListLB.InsertEntry(sNewSource); pNewSource->SetUserData(new AddressUserData_Impl()); m_aListLB.Select(pNewSource); } @@ -449,7 +449,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton) IMPL_LINK(SwAddressListDialog, EditHdl_Impl, PushButton*, pButton) { - SvLBoxEntry* pEntry = m_aListLB.FirstSelected(); + SvTreeListEntry* pEntry = m_aListLB.FirstSelected(); AddressUserData_Impl* pUserData = pEntry ? static_cast<AddressUserData_Impl*>(pEntry->GetUserData()) : 0; if(pUserData && !pUserData->sURL.isEmpty()) { @@ -481,13 +481,13 @@ IMPL_LINK(SwAddressListDialog, EditHdl_Impl, PushButton*, pButton) IMPL_LINK_NOARG(SwAddressListDialog, ListBoxSelectHdl_Impl) { - SvLBoxEntry* pSelect = m_aListLB.FirstSelected(); + SvTreeListEntry* pSelect = m_aListLB.FirstSelected(); Application::PostUserEvent( STATIC_LINK( this, SwAddressListDialog, StaticListBoxSelectHdl_Impl ), pSelect ); return 0; } -IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*, pSelect) +IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvTreeListEntry*, pSelect) { //prevent nested calls of the select handler if(pThis->m_bInSelectHdl) @@ -547,7 +547,7 @@ IMPL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*, // detect the number of tables for a data source // if only one is available then set it at the entry void SwAddressListDialog::DetectTablesAndQueries( - SvLBoxEntry* pSelect, + SvTreeListEntry* pSelect, bool bWidthDialog) { try @@ -645,7 +645,7 @@ void SwAddressListDialog::DetectTablesAndQueries( IMPL_LINK(SwAddressListDialog, TableSelectHdl_Impl, PushButton*, pButton) { EnterWait(); - SvLBoxEntry* pSelect = m_aListLB.FirstSelected(); + SvTreeListEntry* pSelect = m_aListLB.FirstSelected(); if(pSelect) { AddressUserData_Impl* pUserData = static_cast<AddressUserData_Impl*>(pSelect->GetUserData()); @@ -671,7 +671,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, OKHdl_Impl) uno::Reference< XDataSource> SwAddressListDialog::GetSource() { uno::Reference< XDataSource> xRet; - SvLBoxEntry* pSelect = m_aListLB.FirstSelected(); + SvTreeListEntry* pSelect = m_aListLB.FirstSelected(); if(pSelect) { AddressUserData_Impl* pUserData = static_cast<AddressUserData_Impl*>(pSelect->GetUserData()); @@ -684,7 +684,7 @@ uno::Reference< XDataSource> SwAddressListDialog::GetSource() SharedConnection SwAddressListDialog::GetConnection() { SharedConnection xRet; - SvLBoxEntry* pSelect = m_aListLB.FirstSelected(); + SvTreeListEntry* pSelect = m_aListLB.FirstSelected(); if(pSelect) { AddressUserData_Impl* pUserData = static_cast<AddressUserData_Impl*>(pSelect->GetUserData()); @@ -696,7 +696,7 @@ SharedConnection SwAddressListDialog::GetConnection() uno::Reference< XColumnsSupplier> SwAddressListDialog::GetColumnsSupplier() { uno::Reference< XColumnsSupplier> xRet; - SvLBoxEntry* pSelect = m_aListLB.FirstSelected(); + SvTreeListEntry* pSelect = m_aListLB.FirstSelected(); if(pSelect) { AddressUserData_Impl* pUserData = static_cast<AddressUserData_Impl*>(pSelect->GetUserData()); @@ -708,7 +708,7 @@ uno::Reference< XColumnsSupplier> SwAddressListDialog::GetColumnsSupplier() ::rtl::OUString SwAddressListDialog::GetFilter() { ::rtl::OUString sRet; - SvLBoxEntry* pSelect = m_aListLB.FirstSelected(); + SvTreeListEntry* pSelect = m_aListLB.FirstSelected(); if(pSelect) { AddressUserData_Impl* pUserData = static_cast<AddressUserData_Impl*>(pSelect->GetUserData()); diff --git a/sw/source/ui/dbui/addresslistdialog.hxx b/sw/source/ui/dbui/addresslistdialog.hxx index 704682270a54..f87e6be660ce 100644 --- a/sw/source/ui/dbui/addresslistdialog.hxx +++ b/sw/source/ui/dbui/addresslistdialog.hxx @@ -78,7 +78,7 @@ class SwAddressListDialog : public SfxModalDialog String m_sConnecting; String m_sCreatedURL; - SvLBoxEntry* m_pCreatedDataSource; + SvTreeListEntry* m_pCreatedDataSource; bool m_bInSelectHdl; @@ -88,7 +88,7 @@ class SwAddressListDialog : public SfxModalDialog SwDBData m_aDBData; - void DetectTablesAndQueries(SvLBoxEntry* pSelect, bool bWidthDialog); + void DetectTablesAndQueries(SvTreeListEntry* pSelect, bool bWidthDialog); DECL_LINK(FilterHdl_Impl, void *); DECL_LINK(LoadHdl_Impl, void *); @@ -98,7 +98,7 @@ class SwAddressListDialog : public SfxModalDialog DECL_LINK(TableSelectHdl_Impl, PushButton*); DECL_LINK(OKHdl_Impl, void *); - DECL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvLBoxEntry*); + DECL_STATIC_LINK(SwAddressListDialog, StaticListBoxSelectHdl_Impl, SvTreeListEntry*); public: SwAddressListDialog(SwMailMergeAddressBlockPage* pParent); diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx index 8180724b5fa0..8a9e6dc5d49e 100644 --- a/sw/source/ui/dbui/dbmgr.cxx +++ b/sw/source/ui/dbui/dbmgr.cxx @@ -807,7 +807,7 @@ static void lcl_CopyFollowPageDesc( sal_uInt16 nNewDesc = pTargetDoc->MakePageDesc( sNewFollowPageDesc ); SwPageDesc& rTargetFollowPageDesc = pTargetDoc->GetPageDesc( nNewDesc ); - pTargetDoc->CopyPageDesc( *pFollowPageDesc, rTargetFollowPageDesc, sal_False ); + pTargetDoc->CopyPageDesc( *pFollowPageDesc, rTargetFollowPageDesc, false ); SwPageDesc aDesc( rTargetPageDesc ); aDesc.SetFollow( &rTargetFollowPageDesc ); pTargetDoc->ChgPageDesc( rTargetPageDesc.GetName(), aDesc ); @@ -1100,7 +1100,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell, SwPageDesc* pTargetPageDesc = pTargetShell->FindPageDescByName( sNewPageDescName ); if(pSourcePageDesc && pTargetPageDesc) { - pTargetDoc->CopyPageDesc( *pSourcePageDesc, *pTargetPageDesc, sal_False ); + pTargetDoc->CopyPageDesc( *pSourcePageDesc, *pTargetPageDesc, false ); sModifiedStartingPageDesc = sNewPageDescName; lcl_CopyFollowPageDesc( *pTargetShell, *pSourcePageDesc, *pTargetPageDesc, nDocNo ); } @@ -2857,7 +2857,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig, if(pWorkPageDesc && pTargetPageDesc) { - pTargetDoc->CopyPageDesc( *pWorkPageDesc, *pTargetPageDesc, sal_False ); + pTargetDoc->CopyPageDesc( *pWorkPageDesc, *pTargetPageDesc, false ); sModifiedStartingPageDesc = sNewPageDescName; lcl_CopyFollowPageDesc( *pTargetShell, *pWorkPageDesc, *pTargetPageDesc, nDocNo ); } diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx index e1b593969562..f0ddabff3e71 100644 --- a/sw/source/ui/dbui/dbtree.cxx +++ b/sw/source/ui/dbui/dbtree.cxx @@ -238,7 +238,7 @@ void SwDBTreeList::InitTreeList() void SwDBTreeList::AddDataSource(const String& rSource) { Image aImg = aImageList.GetImage(IMG_DB); - SvLBoxEntry* pEntry = InsertEntry(rSource, aImg, aImg, NULL, sal_True); + SvTreeListEntry* pEntry = InsertEntry(rSource, aImg, aImg, NULL, sal_True); SvTreeListBox::Select(pEntry); } @@ -252,14 +252,14 @@ void SwDBTreeList::ShowColumns(sal_Bool bShowCol) SetUpdateMode(sal_False); - SvLBoxEntry* pEntry = First(); + SvTreeListEntry* pEntry = First(); while (pEntry) { - pEntry = (SvLBoxEntry*)GetRootLevelParent( pEntry ); + pEntry = (SvTreeListEntry*)GetRootLevelParent( pEntry ); Collapse(pEntry); // zuklappen - SvLBoxEntry* pChild; + SvTreeListEntry* pChild; while ((pChild = FirstChild(pEntry)) != 0L) GetModel()->Remove(pChild); @@ -274,7 +274,7 @@ void SwDBTreeList::ShowColumns(sal_Bool bShowCol) } } -void SwDBTreeList::RequestingChildren(SvLBoxEntry* pParent) +void SwDBTreeList::RequestingChildren(SvTreeListEntry* pParent) { if (!pParent->HasChildren()) { @@ -369,7 +369,7 @@ void SwDBTreeList::RequestingChildren(SvLBoxEntry* pParent) for (long i = 0; i < nCount; i++) { sTableName = pTblNames[i]; - SvLBoxEntry* pTableEntry = InsertEntry(sTableName, aImg, aImg, pParent, bShowColumns); + SvTreeListEntry* pTableEntry = InsertEntry(sTableName, aImg, aImg, pParent, bShowColumns); //to discriminate between queries and tables the user data of table entries is set pTableEntry->SetUserData((void*)0); } @@ -387,7 +387,7 @@ void SwDBTreeList::RequestingChildren(SvLBoxEntry* pParent) for (long i = 0; i < nCount; i++) { sQueryName = pQueryNames[i]; - SvLBoxEntry* pQueryEntry = InsertEntry(sQueryName, aImg, aImg, pParent, bShowColumns); + SvTreeListEntry* pQueryEntry = InsertEntry(sQueryName, aImg, aImg, pParent, bShowColumns); pQueryEntry->SetUserData((void*)1); } } @@ -402,7 +402,7 @@ void SwDBTreeList::RequestingChildren(SvLBoxEntry* pParent) IMPL_LINK( SwDBTreeList, DBCompare, SvSortData*, pData ) { - SvLBoxEntry* pRight = (SvLBoxEntry*)(pData->pRight ); + SvTreeListEntry* pRight = (SvTreeListEntry*)(pData->pRight ); if (GetParent(pRight) && GetParent(GetParent(pRight))) return COMPARE_GREATER; // don't sort column names @@ -413,7 +413,7 @@ IMPL_LINK( SwDBTreeList, DBCompare, SvSortData*, pData ) String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Bool* pbIsTable) { String sDBName; - SvLBoxEntry* pEntry = FirstSelected(); + SvTreeListEntry* pEntry = FirstSelected(); if (pEntry && GetParent(pEntry)) { @@ -437,8 +437,8 @@ String SwDBTreeList::GetDBName(String& rTableName, String& rColumnName, sal_Boo ------------------------------------------------------------------------*/ void SwDBTreeList::Select(const String& rDBName, const String& rTableName, const String& rColumnName) { - SvLBoxEntry* pParent; - SvLBoxEntry* pChild; + SvTreeListEntry* pParent; + SvTreeListEntry* pChild; sal_uInt16 nParent = 0; sal_uInt16 nChild = 0; diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 997d63e3a593..7fcf1d8b5f97 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -583,7 +583,7 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog( { m_aFieldFT.Show(); m_aFieldCB.Show(); - SvLBoxEntry* pEntry = m_aAddressElementsLB.InsertEntry(String(SW_RES(ST_SALUTATION ))); + SvTreeListEntry* pEntry = m_aAddressElementsLB.InsertEntry(String(SW_RES(ST_SALUTATION ))); pEntry->SetUserData((void*)(sal_Int32)USER_DATA_SALUTATION ); pEntry = m_aAddressElementsLB.InsertEntry(String(SW_RES(ST_PUNCTUATION))); pEntry->SetUserData((void*)(sal_Int32)USER_DATA_PUNCTUATION ); @@ -624,7 +624,7 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog( for(sal_uInt16 i = 0; i < rHeaders.Count(); ++i) { const XubString& rHeader = rHeaders.GetString( i ); - SvLBoxEntry* pEntry = m_aAddressElementsLB.InsertEntry(rHeader); + SvTreeListEntry* pEntry = m_aAddressElementsLB.InsertEntry(rHeader); pEntry->SetUserData((void*)(sal_IntPtr)i); } m_aOK.SetClickHdl(LINK(this, SwCustomizeAddressBlockDialog, OKHdl_Impl)); @@ -676,7 +676,7 @@ IMPL_LINK(SwCustomizeAddressBlockDialog, ImageButtonHdl_Impl, ImageButton*, pBut { if(&m_aInsertFieldIB == pButton) { - SvLBoxEntry* pEntry = m_aAddressElementsLB.GetCurEntry(); + SvTreeListEntry* pEntry = m_aAddressElementsLB.GetCurEntry(); if(pEntry) { String sEntry = m_aAddressElementsLB.GetEntryText(pEntry); @@ -711,7 +711,7 @@ sal_Int32 SwCustomizeAddressBlockDialog::GetSelectedItem_Impl() if(sSelected.Len()) for(sal_uLong i = 0; i < m_aAddressElementsLB.GetEntryCount(); ++i) { - SvLBoxEntry* pEntry = m_aAddressElementsLB.GetEntry(i); + SvTreeListEntry* pEntry = m_aAddressElementsLB.GetEntry(i); String sEntry = m_aAddressElementsLB.GetEntryText(pEntry); if( sSelected.Equals( sEntry, 1, sSelected.Len() - 2 ) ) { @@ -728,7 +728,7 @@ bool SwCustomizeAddressBlockDialog::HasItem_Impl(sal_Int32 nUserData) String sEntry; for(sal_uLong i = 0; i < m_aAddressElementsLB.GetEntryCount(); ++i) { - SvLBoxEntry* pEntry = m_aAddressElementsLB.GetEntry(i); + SvTreeListEntry* pEntry = m_aAddressElementsLB.GetEntry(i); if((sal_Int32)(sal_IntPtr)pEntry->GetUserData() == nUserData) { sEntry = m_aAddressElementsLB.GetEntryText(pEntry); @@ -827,7 +827,7 @@ void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl() m_aRightIB.Enable(nMove & MOVE_ITEM_RIGHT ); m_aDownIB.Enable(nMove & MOVE_ITEM_DOWN); m_aRemoveFieldIB.Enable(m_aDragED.HasCurrentItem() ? sal_True : sal_False); - SvLBoxEntry* pEntry = m_aAddressElementsLB.GetCurEntry(); + SvTreeListEntry* pEntry = m_aAddressElementsLB.GetCurEntry(); m_aInsertFieldIB.Enable( pEntry && (0 < (sal_Int32)(sal_IntPtr)pEntry->GetUserData() || m_aFieldCB.GetText().Len())); } @@ -847,7 +847,7 @@ void SwCustomizeAddressBlockDialog::SetAddress(const ::rtl::OUString& rAddress) { for(sal_uLong i = 0; i < m_aAddressElementsLB.GetEntryCount(); ++i) { - SvLBoxEntry* pEntry = m_aAddressElementsLB.GetEntry(i); + SvTreeListEntry* pEntry = m_aAddressElementsLB.GetEntry(i); String sEntry = m_aAddressElementsLB.GetEntryText(pEntry); sEntry += '>'; sEntry.Insert('<', 0); @@ -1358,7 +1358,7 @@ DDListBox::~DDListBox() void DDListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) { - SvLBoxEntry* pEntry = GetCurEntry(); + SvTreeListEntry* pEntry = GetCurEntry(); if(pEntry) { ReleaseMouse(); diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 06b60f1471ba..1d028764d0fa 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -487,7 +487,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig else while(nMoves) { - sal_Bool bMoved = rShell.MoveParagraph( 1 ); + bool bMoved = rShell.MoveParagraph( 1 ); if(!bMoved) { //insert a new paragraph before the greeting line @@ -758,7 +758,7 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, ChangeAddressHdl_Impl) IMPL_LINK(SwMailMergeLayoutPage, GreetingsHdl_Impl, PushButton*, pButton) { bool bDown = pButton == &m_aDownPB; - sal_Bool bMoved = m_pExampleWrtShell->MoveParagraph( bDown ? 1 : -1 ); + bool bMoved = m_pExampleWrtShell->MoveParagraph( bDown ? 1 : -1 ); if (bMoved || bDown) m_pWizard->GetConfigItem().MoveGreeting(bDown ? 1 : -1 ); if(!bMoved && bDown) diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index a8b9fab9b2cd..8e912fac17ea 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -118,7 +118,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(Window* pParent, String sEntry = pTbls[i]; sEntry += '\t'; sEntry += m_sTable; - SvLBoxEntry* pEntry = m_aTableLB.InsertEntry(sEntry); + SvTreeListEntry* pEntry = m_aTableLB.InsertEntry(sEntry); pEntry->SetUserData((void*)0); } } @@ -133,7 +133,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(Window* pParent, String sEntry = pQueries[i]; sEntry += '\t'; sEntry += m_sQuery; - SvLBoxEntry* pEntry = m_aTableLB.InsertEntry(sEntry); + SvTreeListEntry* pEntry = m_aTableLB.InsertEntry(sEntry); pEntry->SetUserData((void*)1); } } @@ -145,7 +145,7 @@ SwSelectDBTableDialog::~SwSelectDBTableDialog() IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton) { - SvLBoxEntry* pEntry = m_aTableLB.FirstSelected(); + SvTreeListEntry* pEntry = m_aTableLB.FirstSelected(); if(pEntry) { ::rtl::OUString sTableOrQuery = m_aTableLB.GetEntryText(pEntry, 0); @@ -184,14 +184,14 @@ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton) String SwSelectDBTableDialog::GetSelectedTable(bool& bIsTable) { - SvLBoxEntry* pEntry = m_aTableLB.FirstSelected(); + SvTreeListEntry* pEntry = m_aTableLB.FirstSelected(); bIsTable = pEntry->GetUserData() ? false : true; return pEntry ? m_aTableLB.GetEntryText(pEntry, 0) : String(); } void SwSelectDBTableDialog::SetSelectedTable(const String& rTable, bool bIsTable) { - SvLBoxEntry* pEntry = m_aTableLB.First(); + SvTreeListEntry* pEntry = m_aTableLB.First(); while(pEntry) { if((m_aTableLB.GetEntryText(pEntry, 0) == rTable) && diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 09dbd3fd3568..51e1b809afaa 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -623,22 +623,10 @@ sal_uInt16 AbstractMailMergeWizard_Impl::GetRestartPage() const return pDlg->GetRestartPage(); } -AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstractDlg( Window* pParent, - int nResId ) +AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstractDlg(Window* pParent) { - SwInsertAbstractDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSERT_ABSTRACT : - pDlg = new SwInsertAbstractDlg( pParent); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractSwInsertAbstractDlg_Impl( pDlg ); - return 0; + SwInsertAbstractDlg* pDlg = new SwInsertAbstractDlg( pParent); + return new AbstractSwInsertAbstractDlg_Impl(pDlg); } SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSfxDialog( Window* pParent, @@ -918,7 +906,6 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( Wind case DLG_ROW_HEIGHT : pDlg = new SwTableHeightDlg( pParent, rSh); break; - case DLG_SORTING : pDlg = new SwSortDlg( pParent, rSh); break; @@ -1243,22 +1230,11 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog( int nRe return 0; } -AbstractInsertGrfRulerDlg * SwAbstractDialogFactory_Impl::CreateInsertGrfRulerDlg( int nResId, - Window * pParent ) //add for SwInsertGrfRulerDlg +//add for SwInsertGrfRulerDlg +AbstractInsertGrfRulerDlg * SwAbstractDialogFactory_Impl::CreateInsertGrfRulerDlg(Window * pParent) { - SwInsertGrfRulerDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSERT_RULER : - pDlg = new SwInsertGrfRulerDlg( pParent ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractInsertGrfRulerDlg_Impl( pDlg ); - return 0; + SwInsertGrfRulerDlg* pDlg = new SwInsertGrfRulerDlg(pParent); + return new AbstractInsertGrfRulerDlg_Impl(pDlg); } AbstractInsTableDlg * SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwView& rView) //add for SwInsTableDlg @@ -1434,47 +1410,26 @@ AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSecti return 0; } -AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg( int nResId, +AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo, sal_Bool bNew ) //add for SwIndexMarkFloatDlg { - SwIndexMarkFloatDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSIDXMARK_CJK : - case DLG_INSIDXMARK : - pDlg = new SwIndexMarkFloatDlg( pBindings, pChild, pParent, pInfo, bNew ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractIndexMarkFloatDlg_Impl( pDlg ); - return 0; + SwIndexMarkFloatDlg* pDlg = new SwIndexMarkFloatDlg(pBindings, pChild, pParent, pInfo, bNew); + return new AbstractIndexMarkFloatDlg_Impl(pDlg); } -AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg( int nResId, +AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo, - sal_Bool bNew ) //add for SwAuthMarkFloatDlg + sal_Bool bNew) //add for SwAuthMarkFloatDlg { - SwAuthMarkFloatDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSAUTHMARK : - pDlg = new SwAuthMarkFloatDlg( pBindings, pChild, pParent, pInfo, bNew ); - break; - default: - break; - } - if ( pDlg ) - return new AbstractAuthMarkFloatDlg_Impl( pDlg ); - return 0; + SwAuthMarkFloatDlg* pDlg = new SwAuthMarkFloatDlg( pBindings, pChild, pParent, pInfo, bNew ); + return new AbstractAuthMarkFloatDlg_Impl( pDlg ); } AbstractSwWordCountFloatDlg * SwAbstractDialogFactory_Impl::CreateSwWordCountDialog( @@ -1488,24 +1443,11 @@ AbstractSwWordCountFloatDlg * SwAbstractDialogFactory_Impl::CreateSwWordCountDia } //add for SwIndexMarkModalDlg begin -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg( int nResId, +VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg( Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ) //add for SwIndexMarkModalDlg { - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_EDIT_IDXMARK_CJK : - case DLG_EDIT_IDXMARK : - pDlg = new SwIndexMarkModalDlg( pParent, rSh, pCurTOXMark ); - break; - - default: - break; - } - - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; + Dialog* pDlg = new SwIndexMarkModalDlg( pParent, rSh, pCurTOXMark ); + return new VclAbstractDialog_Impl( pDlg ); } //add for SwIndexMarkModalDlg end diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index f1764397bb6e..cbadc6ecb602 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -441,7 +441,7 @@ public: ); virtual AbstractSwWordCountFloatDlg* CreateSwWordCountDialog(SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo); - virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg( Window* pParent,int nResId ); + virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg(Window* pParent); virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh, SvStream* pStream, int nResId ); //add for SwAsciiFilterDlg virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId );//add for SwInsertBookmarkDlg @@ -523,8 +523,7 @@ public: virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent ); virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId, SwView& rView, sal_Bool bCol = sal_False ); //add for SwInsRowColDlg, SwLineNumberingDlg - virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId, - Window * pParent ); //add for SwInsertGrfRulerDlg + virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg(Window * pParent); //add for SwInsertGrfRulerDlg virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView); //add for SwInsTableDlg virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId, Window* pParent, SwWrtShell* pWrtSh ); //add for SwJavaEditDialog @@ -554,19 +553,19 @@ public: Window* pParent, SwWrtShell& rWrtSh ); //add for SwEditRegionDlg virtual AbstractInsertSectionTabDialog* CreateInsertSectionTabDialog( int nResId, Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh); //add for SwInsertSectionTabDialog - virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg( int nResId, + virtual AbstractMarkFloatDlg* CreateIndexMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo, sal_Bool bNew=sal_True); //add for SwIndexMarkFloatDlg - virtual AbstractMarkFloatDlg* CreateAuthMarkFloatDlg( int nResId, + virtual AbstractMarkFloatDlg* CreateAuthMarkFloatDlg( SfxBindings* pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo, sal_Bool bNew=sal_True); //add for SwAuthMarkFloatDlg - virtual VclAbstractDialog * CreateIndexMarkModalDlg( int nResId, + virtual VclAbstractDialog * CreateIndexMarkModalDlg( Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ); //add for SwIndexMarkModalDlg virtual AbstractMailMergeWizard* CreateMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rConfigItem); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 9ff1bc82cc85..3be654ee003c 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -128,7 +128,7 @@ static void lcl_FillSubRegionList( SwWrtShell& rSh, ComboBox& rSubRegions, Combo IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess(); for( IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); ppMark != pMarkAccess->getMarksEnd(); - ppMark++) + ++ppMark) { const ::sw::mark::IMark* pBkmk = ppMark->get(); if( pBkmk->IsExpanded() ) @@ -431,7 +431,7 @@ sal_Bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox) if(bDontCheckPasswd) return sal_True; sal_Bool bRet = sal_True; - SvLBoxEntry* pEntry = aTree.FirstSelected(); + SvTreeListEntry* pEntry = aTree.FirstSelected(); while( pEntry ) { SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData(); @@ -474,10 +474,10 @@ sal_Bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox) /*--------------------------------------------------------------------- Description: recursively look for child-sections ---------------------------------------------------------------------*/ -void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry ) +void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvTreeListEntry* pEntry ) { SwSection* pSect = 0; - SvLBoxEntry* pSelEntry = 0; + SvTreeListEntry* pSelEntry = 0; if (!pFmt) { @@ -506,7 +506,7 @@ void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry else { SwSections aTmpArr; - SvLBoxEntry* pNEntry; + SvTreeListEntry* pNEntry; sal_uInt16 nCnt = pFmt->GetChildSections(aTmpArr,SORTSECT_POS); if( nCnt ) { @@ -555,7 +555,7 @@ sal_uInt16 SwEditRegionDlg::FindArrPos(const SwSectionFmt* pFmt ) SwEditRegionDlg::~SwEditRegionDlg( ) { - SvLBoxEntry* pEntry = aTree.First(); + SvTreeListEntry* pEntry = aTree.First(); while( pEntry ) { delete (SectRepr*)pEntry->GetUserData(); @@ -567,7 +567,7 @@ SwEditRegionDlg::~SwEditRegionDlg( ) void SwEditRegionDlg::SelectSection(const String& rSectionName) { - SvLBoxEntry* pEntry = aTree.First(); + SvTreeListEntry* pEntry = aTree.First(); while(pEntry) { SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData(); @@ -591,7 +591,7 @@ void SwEditRegionDlg::SelectSection(const String& rSectionName) IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox ) { bDontCheckPasswd = sal_True; - SvLBoxEntry* pEntry=pBox->FirstSelected(); + SvTreeListEntry* pEntry=pBox->FirstSelected(); aHideCB .Enable(sal_True); // edit in readonly sections aEditInReadonlyCB.Enable(sal_True); @@ -803,7 +803,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OkHdl) rSh.StartAllAction(); rSh.StartUndo(); rSh.ResetSelect( 0,sal_False ); - SvLBoxEntry* pEntry = aTree.First(); + SvTreeListEntry* pEntry = aTree.First(); while( pEntry ) { @@ -873,7 +873,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeProtectHdl, TriStateBox *, pBox ) if(!CheckPasswd(pBox)) return 0; pBox->EnableTriState( sal_False ); - SvLBoxEntry* pEntry=aTree.FirstSelected(); + SvTreeListEntry* pEntry=aTree.FirstSelected(); OSL_ENSURE(pEntry,"no entry found"); sal_Bool bCheck = STATE_CHECK == pBox->GetState(); while( pEntry ) @@ -899,7 +899,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeHideHdl, TriStateBox *, pBox ) if(!CheckPasswd(pBox)) return 0; pBox->EnableTriState( sal_False ); - SvLBoxEntry* pEntry=aTree.FirstSelected(); + SvTreeListEntry* pEntry=aTree.FirstSelected(); OSL_ENSURE(pEntry,"no entry found"); while( pEntry ) { @@ -928,7 +928,7 @@ IMPL_LINK( SwEditRegionDlg, ChangeEditInReadonlyHdl, TriStateBox *, pBox ) if(!CheckPasswd(pBox)) return 0; pBox->EnableTriState( sal_False ); - SvLBoxEntry* pEntry=aTree.FirstSelected(); + SvTreeListEntry* pEntry=aTree.FirstSelected(); OSL_ENSURE(pEntry,"no entry found"); while( pEntry ) { @@ -948,9 +948,9 @@ IMPL_LINK_NOARG(SwEditRegionDlg, ChangeDismissHdl) { if(!CheckPasswd()) return 0; - SvLBoxEntry* pEntry = aTree.FirstSelected(); - SvLBoxEntry* pChild; - SvLBoxEntry* pParent; + SvTreeListEntry* pEntry = aTree.FirstSelected(); + SvTreeListEntry* pChild; + SvTreeListEntry* pParent; // at first mark all selected while(pEntry) { @@ -963,7 +963,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, ChangeDismissHdl) while(pEntry) { const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); - SvLBoxEntry* pRemove = 0; + SvTreeListEntry* pRemove = 0; sal_Bool bRestart = sal_False; if(pSectRepr->IsSelected()) { @@ -985,7 +985,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, ChangeDismissHdl) aTree.GetModel()->Remove( pRemove ); } - if ( (pEntry=aTree.FirstSelected()) == 0 ) + if ( aTree.FirstSelected() == 0 ) { aConditionFT. Enable(sal_False); aConditionED. Enable(sal_False); @@ -1015,7 +1015,7 @@ IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox ) { if(!CheckPasswd(pBox)) return 0; - SvLBoxEntry* pEntry = aTree.FirstSelected(); + SvTreeListEntry* pEntry = aTree.FirstSelected(); pBox->EnableTriState(sal_False); sal_Bool bMulti = 1 < aTree.GetSelectionCount(); sal_Bool bFile = pBox->IsChecked(); @@ -1098,7 +1098,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl) { if(!CheckPasswd()) return 0; - SvLBoxEntry* pEntry = aTree.FirstSelected(); + SvTreeListEntry* pEntry = aTree.FirstSelected(); if(pEntry) { @@ -1165,7 +1165,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl) SFX_ITEM_SET == eFrmDirState|| SFX_ITEM_SET == eLRState) { - SvLBoxEntry* pSelEntry = aTree.FirstSelected(); + SvTreeListEntry* pSelEntry = aTree.FirstSelected(); while( pSelEntry ) { SectReprPtr pRepr = (SectReprPtr)pSelEntry->GetUserData(); @@ -1204,7 +1204,7 @@ IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit ) if(!CheckPasswd()) return 0; pEdit->SetSelection(aSelect); - SvLBoxEntry* pEntry=aTree.FirstSelected(); + SvTreeListEntry* pEntry=aTree.FirstSelected(); OSL_ENSURE(pEntry,"no entry found"); SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData(); if(pEdit == &aFileNameED) @@ -1251,7 +1251,7 @@ IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox ) { if(!CheckPasswd(pBox)) return 0; - SvLBoxEntry* pEntry=aTree.FirstSelected(); + SvTreeListEntry* pEntry=aTree.FirstSelected(); if(pEntry) { sal_Bool bFile = aFileCB.IsChecked(); @@ -1307,7 +1307,7 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox ) aPasswdCB.Check(!aPasswdCB.IsChecked()); return 0; } - SvLBoxEntry* pEntry=aTree.FirstSelected(); + SvTreeListEntry* pEntry=aTree.FirstSelected(); sal_Bool bSet = bChange ? bChange : aPasswdCB.IsChecked(); OSL_ENSURE(pEntry,"no entry found"); while( pEntry ) @@ -1360,7 +1360,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, NameEditHdl) { if(!CheckPasswd(0)) return 0; - SvLBoxEntry* pEntry=aTree.FirstSelected(); + SvTreeListEntry* pEntry=aTree.FirstSelected(); OSL_ENSURE(pEntry,"no entry found"); if (pEntry) { @@ -1380,7 +1380,7 @@ IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit ) if(!CheckPasswd(0)) return 0; pEdit->SetSelection(aSelect); - SvLBoxEntry* pEntry = aTree.FirstSelected(); + SvTreeListEntry* pEntry = aTree.FirstSelected(); OSL_ENSURE(pEntry,"no entry found"); while( pEntry ) { @@ -1409,7 +1409,7 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg ) } } - SvLBoxEntry* pEntry = aTree.FirstSelected(); + SvTreeListEntry* pEntry = aTree.FirstSelected(); OSL_ENSURE( pEntry, "no entry found" ); if ( pEntry ) { diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx index 9cba41c344e7..5672147f81b6 100644 --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -568,7 +568,7 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName, /*------------------------------------------------------------------------ Description: add autotext ------------------------------------------------------------------------*/ -sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName) +bool SwGlossaryHdl::InsertGlossary(const String &rName) { OSL_ENSURE(pWrtShell->CanInsert(), "illegal"); @@ -576,7 +576,7 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName) pCurGrp? pCurGrp: rStatGlossaries.GetGroupDoc(aCurGrp); if (!pGlos) - return sal_False; + return false; SvxMacro aStartMacro(aEmptyStr, aEmptyStr, STARBASIC); SvxMacro aEndMacro(aEmptyStr, aEmptyStr, STARBASIC); @@ -608,7 +608,7 @@ sal_Bool SwGlossaryHdl::InsertGlossary(const String &rName) if(!pCurGrp) rStatGlossaries.PutGroupDoc(pGlos); - return sal_True; + return true; } /*------------------------------------------------------------------------ diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index da2faf187eba..d8519514b7e9 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -840,7 +840,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut ) // find all DDE-Bookmarks for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); ppMark != pMarkAccess->getMarksEnd(); - ppMark++) + ++ppMark) { if(IDocumentMarkAccess::DDE_BOOKMARK == IDocumentMarkAccess::GetType(**ppMark)) vDdeMarks.push_back(ppMark->get()); diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx index 6b96627f3005..25e291384ed9 100644 --- a/sw/source/ui/docvw/HeaderFooterWin.cxx +++ b/sw/source/ui/docvw/HeaderFooterWin.cxx @@ -74,7 +74,6 @@ using namespace basegfx; using namespace basegfx::tools; using namespace drawinglayer::attribute; -using namespace drawinglayer::primitive2d; namespace { @@ -265,7 +264,7 @@ bool SwHeaderFooterWin::Contains( const Point &rDocPt ) const void SwHeaderFooterWin::Paint( const Rectangle& ) { const Rectangle aRect( Rectangle( Point( 0, 0 ), PixelToLogic( GetSizePixel() ) ) ); - Primitive2DSequence aSeq( 3 ); + drawinglayer::primitive2d::Primitive2DSequence aSeq( 3 ); B2DPolygon aPolygon = lcl_GetPolygon( aRect, m_bIsHeader ); @@ -277,12 +276,10 @@ void SwHeaderFooterWin::Paint( const Rectangle& ) const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); if ( rSettings.GetHighContrastMode() ) { - aLineColor = rSettings.GetDialogTextColor().getBColor(); - aFillColor = rSettings.GetDialogColor( ).getBColor(); aLineColor = rSettings.GetDialogTextColor( ).getBColor(); - aSeq[0] = Primitive2DReference( new PolyPolygonColorPrimitive2D( + aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( B2DPolyPolygon( aPolygon ), aFillColor ) ); } else @@ -293,17 +290,17 @@ void SwHeaderFooterWin::Paint( const Rectangle& ) nAngle = 0; FillGradientAttribute aFillAttrs( GRADIENTSTYLE_LINEAR, 0.0, 0.0, 0.0, nAngle, aLighterColor, aFillColor, 10 ); - aSeq[0] = Primitive2DReference( new FillGradientPrimitive2D( + aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::FillGradientPrimitive2D( aGradientRect, aFillAttrs ) ); } // Create the border lines primitive - aSeq[1] = Primitive2DReference( new PolygonHairlinePrimitive2D( + aSeq[1] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolygonHairlinePrimitive2D( aPolygon, aLineColor ) ); // Create the text primitive B2DVector aFontSize; - FontAttribute aFontAttr = getFontAttributeFromVclFont( + FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont( aFontSize, GetFont(), false, false ); Rectangle aTextRect; @@ -317,7 +314,7 @@ void SwHeaderFooterWin::Paint( const Rectangle& ) aFontSize.getX(), aFontSize.getY(), double( aTextPos.X() ), double( aTextPos.Y() ) ) ); - aSeq[2] = Primitive2DReference( new TextSimplePortionPrimitive2D( + aSeq[2] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::TextSimplePortionPrimitive2D( aTextMatrix, String( m_sLabel ), 0, m_sLabel.getLength(), std::vector< double >( ), @@ -371,7 +368,7 @@ void SwHeaderFooterWin::Paint( const Rectangle& ) aSignColor = Color( COL_WHITE ).getBColor( ); aSeq.realloc( aSeq.getLength() + 1 ); - aSeq[ aSeq.getLength() - 1 ] = Primitive2DReference( new PolyPolygonColorPrimitive2D( + aSeq[ aSeq.getLength() - 1 ] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( B2DPolyPolygon( aSign ), aSignColor ) ); // Create the processor and process the primitives @@ -381,9 +378,9 @@ void SwHeaderFooterWin::Paint( const Rectangle& ) *this, aNewViewInfos ); // TODO Ghost it all if needed - Primitive2DSequence aGhostedSeq( 1 ); + drawinglayer::primitive2d::Primitive2DSequence aGhostedSeq( 1 ); double nFadeRate = double( m_nFadeRate ) / 100.0; - aGhostedSeq[0] = Primitive2DReference( new ModifiedColorPrimitive2D( + aGhostedSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D( aSeq, BColorModifier( Color( COL_WHITE ).getBColor(), 1.0 - nFadeRate, BCOLORMODIFYMODE_INTERPOLATE ) ) ); pProcessor->process( aGhostedSeq ); diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx index 56e42b47bc5e..f945467a3ff3 100644 --- a/sw/source/ui/docvw/PageBreakWin.cxx +++ b/sw/source/ui/docvw/PageBreakWin.cxx @@ -25,6 +25,7 @@ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable * instead of those above. */ + #include <globals.hrc> #include <popup.hrc> #include <utlui.hrc> @@ -53,18 +54,18 @@ #include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> +#include <drawinglayer/processor2d/processorfromoutputdevice.hxx> #include <editeng/brkitem.hxx> #include <sfx2/dispatch.hxx> -#include <drawinglayer/processor2d/processorfromoutputdevice.hxx> #include <vcl/svapp.hxx> + #define BUTTON_WIDTH 30 #define BUTTON_HEIGHT 19 #define ARROW_WIDTH 9 using namespace basegfx; using namespace basegfx::tools; -using namespace drawinglayer::primitive2d; namespace { @@ -163,15 +164,15 @@ void SwPageBreakWin::Paint( const Rectangle& ) bool bRtl = Application::GetSettings().GetLayoutRTL(); - Primitive2DSequence aSeq( 3 ); + drawinglayer::primitive2d::Primitive2DSequence aSeq( 3 ); B2DRectangle aBRect( double( aRect.Left() ), double( aRect.Top( ) ), double( aRect.Right() ), double( aRect.Bottom( ) ) ); B2DPolygon aPolygon = createPolygonFromRect( aBRect, 3.0 / BUTTON_WIDTH, 3.0 / BUTTON_HEIGHT ); // Create the polygon primitives - aSeq[0] = Primitive2DReference( new PolyPolygonColorPrimitive2D( + aSeq[0] = Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( B2DPolyPolygon( aPolygon ), aOtherColor ) ); - aSeq[1] = Primitive2DReference( new PolygonHairlinePrimitive2D( + aSeq[1] = Primitive2DReference( new drawinglayer::primitive2d::PolygonHairlinePrimitive2D( aPolygon, aColor ) ); // Create the primitive for the image @@ -179,7 +180,7 @@ void SwPageBreakWin::Paint( const Rectangle& ) double nImgOfstX = 3.0; if ( bRtl ) nImgOfstX = aRect.Right() - aImg.GetSizePixel().Width() - 3.0; - aSeq[2] = Primitive2DReference( new DiscreteBitmapPrimitive2D( + aSeq[2] = Primitive2DReference( new drawinglayer::primitive2d::DiscreteBitmapPrimitive2D( aImg.GetBitmapEx(), B2DPoint( nImgOfstX, 1.0 ) ) ); double nTop = double( aRect.getHeight() ) / 2.0; @@ -200,12 +201,12 @@ void SwPageBreakWin::Paint( const Rectangle& ) aTriangleColor = Color( COL_WHITE ).getBColor( ); aSeq.realloc( aSeq.getLength() + 1 ); - aSeq[ aSeq.getLength() - 1 ] = Primitive2DReference( new PolyPolygonColorPrimitive2D( + aSeq[ aSeq.getLength() - 1 ] = Primitive2DReference( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( B2DPolyPolygon( aTriangle ), aTriangleColor ) ); Primitive2DSequence aGhostedSeq( 1 ); double nFadeRate = double( m_nFadeRate ) / 100.0; - aGhostedSeq[0] = Primitive2DReference( new ModifiedColorPrimitive2D( + aGhostedSeq[0] = Primitive2DReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D( aSeq, BColorModifier( Color( COL_WHITE ).getBColor(), 1.0 - nFadeRate, BCOLORMODIFYMODE_INTERPOLATE ) ) ); // Create the processor and process the primitives diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index c82a782ea015..f0ee12ec4d33 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -572,7 +572,7 @@ void SwPostItMgr::LayoutPostIts() long mlPageBorder = 0; long mlPageEnd = 0; - for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++) + for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); ++i) { SwSidebarItem* pItem = (*i); SwSidebarWin* pPostIt = pItem->pPostIt; @@ -680,7 +680,7 @@ void SwPostItMgr::LayoutPostIts() - enlarge all notes till GetNextBorder(), as we resized to average value before */ //lets hide the ones which overlap the page - for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++) + for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i) { if (mPages[n]->lOffset != 0) (*i)->TranslateTopPosition(mPages[n]->lOffset); @@ -717,7 +717,7 @@ void SwPostItMgr::LayoutPostIts() } else { - for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++) + for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i) (*i)->SetPosAndSize(); bool bOldScrollbar = mPages[n]->bScrollbar; @@ -736,7 +736,7 @@ void SwPostItMgr::LayoutPostIts() if (!ShowNotes()) { // we do not want to see the notes anymore -> Options-Writer-View-Notes bool bRepair = false; - for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { SwSidebarItem* pItem = (*i); if ( !pItem->UseElement() ) @@ -801,7 +801,7 @@ void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage) const bool bOldUp = ArrowEnabled(KEY_PAGEUP,aPage); const bool bOldDown = ArrowEnabled(KEY_PAGEDOWN,aPage); const long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height(); - for(SwSidebarItem_iterator i = mPages[aPage-1]->mList->begin(); i!= mPages[aPage-1]->mList->end(); i++) + for(SwSidebarItem_iterator i = mPages[aPage-1]->mList->begin(); i!= mPages[aPage-1]->mList->end(); ++i) { SwSidebarWin* pPostIt = (*i)->pPostIt; // if this is an answer, we should take the normal position and not the real, slightly moved position @@ -872,7 +872,7 @@ void SwPostItMgr::MakeVisible(const SwSidebarWin* pPostIt,long aPage ) { if (mPages[n]->mList->size()>0) { - for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++) + for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); ++i) { if ((*i)->pPostIt==pPostIt) { @@ -950,12 +950,12 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons bScrollbars = true; lTopBorder += GetSidebarScrollerHeight() + 10; lBottomBorder -= (GetSidebarScrollerHeight() + 10); - for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++) + for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i) (*i)->SetSize(Size((*i)->VirtualSize().getWidth(),(*i)->GetMinimumSizeWithMeta())); } else { - for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++) + for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i) { if ( (*i)->VirtualSize().getHeight() > lAverageHeight) (*i)->SetSize(Size((*i)->VirtualSize().getWidth(),lAverageHeight)); @@ -973,7 +973,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons loop++; bDone = true; lSpaceUsed = lTopBorder + GetSpaceBetween(); - for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; i++) + for(SwSidebarWin_iterator i = aVisiblePostItList.begin(); i!= aVisiblePostItList.end() ; ++i) { SwSidebarWin_iterator aNextPostIt = i; ++aNextPostIt; @@ -1199,7 +1199,7 @@ void SwPostItMgr::Delete() } void SwPostItMgr::Hide( const String& rAuthor ) { - for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { if ( (*i)->pPostIt && ((*i)->pPostIt->GetAuthor() == rAuthor) ) { @@ -1213,7 +1213,7 @@ void SwPostItMgr::Hide( const String& rAuthor ) void SwPostItMgr::Hide() { - for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { (*i)->bShow = false; (*i)->pPostIt->HideNote(); @@ -1223,7 +1223,7 @@ void SwPostItMgr::Hide() void SwPostItMgr::Show() { - for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { (*i)->bShow = true; } @@ -1268,7 +1268,7 @@ SwSidebarWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection, { if (mvPostItFlds.size()>1) { - for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { if ( (*i)->pPostIt ==aPostIt) { @@ -1283,7 +1283,7 @@ SwSidebarWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection, } else { - iNextPostIt++; + ++iNextPostIt; if ( iNextPostIt==mvPostItFlds.end() ) { return NULL; @@ -1305,12 +1305,12 @@ long SwPostItMgr::GetNextBorder() { for (unsigned long n=0;n<mPages.size();n++) { - for(SwSidebarItem_iterator b = mPages[n]->mList->begin(); b!= mPages[n]->mList->end(); b++) + for(SwSidebarItem_iterator b = mPages[n]->mList->begin(); b!= mPages[n]->mList->end(); ++b) { if ((*b)->pPostIt == mpActivePostIt) { SwSidebarItem_iterator aNext = b; - aNext++; + ++aNext; bool bFollow = (aNext == mPages[n]->mList->end()) ? false : (*aNext)->pPostIt->IsFollow(); if ( mPages[n]->bScrollbar || bFollow ) { @@ -1498,7 +1498,7 @@ void SwPostItMgr::CorrectPositions() // find first valid note SwSidebarWin *pFirstPostIt = 0; - for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; i++) + for(SwSidebarItem_iterator i = mvPostItFlds.begin(); i!= mvPostItFlds.end() ; ++i) { pFirstPostIt = (*i)->pPostIt; if (pFirstPostIt) @@ -1523,7 +1523,7 @@ void SwPostItMgr::CorrectPositions() long aAnchorPosY = 0; for (unsigned long n=0;n<mPages.size();n++) { - for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); i++) + for(SwSidebarItem_iterator i = mPages[n]->mList->begin(); i!= mPages[n]->mList->end(); ++i) { // check, if anchor overlay object exists. if ( (*i)->bShow && (*i)->pPostIt && (*i)->pPostIt->Anchor() ) diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 77aadcf2d82d..99f315aa88f6 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -31,6 +31,7 @@ #include <hintids.hxx> #include <com/sun/star/accessibility/XAccessible.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <com/sun/star/i18n/XBreakIterator.hpp> #include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/i18n/InputSequenceCheckMode.hpp> @@ -316,7 +317,7 @@ struct QuickHelpData } // Fills internal structures with hopefully helpful information. - void FillStrArr( SwWrtShell& rSh, const String& rWord, sal_Bool bIgnoreCurrentPos ); + void FillStrArr( SwWrtShell& rSh, const String& rWord, bool bIgnoreCurrentPos ); void SortAndFilter(); }; @@ -1982,7 +1983,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } } if ( bCallNumOrNoNum && - rSh.NumOrNoNum( !bOnlyBackspaceKey, sal_True ) ) + rSh.NumOrNoNum( !bOnlyBackspaceKey, true ) ) { eKeyState = KS_NumOrNoNum; } @@ -2386,7 +2387,7 @@ KEYINPUT_CHECKTABLE_INSDEL: { // insert a blank ahead of the character. this ends up // between the expanded text and the new "non-word-seperator". - aInBuffer.Expand( aInBuffer.Len() + 1, ' ' ); + aInBuffer += ' '; } sal_Bool bIsAutoCorrectChar = SvxAutoCorrect::IsAutoCorrectChar( aCh ); @@ -2417,7 +2418,10 @@ KEYINPUT_CHECKTABLE_INSDEL: } else { - aInBuffer.Expand( aInBuffer.Len() + aKeyEvent.GetRepeat() + 1,aCh ); + rtl::OUStringBuffer aBuf(aInBuffer); + comphelper::string::padToLength(aBuf, + aInBuffer.Len() + aKeyEvent.GetRepeat() + 1, aCh); + aInBuffer = aBuf.makeStringAndClear(); bFlushCharBuffer = Application::AnyInput( VCL_INPUT_KEYBOARD ); bFlushBuffer = !bFlushCharBuffer; if( bFlushCharBuffer ) @@ -2473,11 +2477,11 @@ KEYINPUT_CHECKTABLE_INSDEL: break; case KS_NumDown: - rSh.NumUpDown( sal_True ); + rSh.NumUpDown( true ); nKS_NUMDOWN_Count = 2; break; case KS_NumUp: - rSh.NumUpDown( sal_False ); + rSh.NumUpDown( false ); break; case KS_NumIndentInc: @@ -4028,7 +4032,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) { if( aLastCallEvent.HasEvent() ) rSh.CallEvent( SFX_EVENT_MOUSEOUT_OBJECT, - aLastCallEvent, sal_True ); + aLastCallEvent, true ); // 0 says that the object doesn't have any table if( !rSh.CallEvent( SFX_EVENT_MOUSEOVER_OBJECT, aSaveCallEvent )) @@ -4039,7 +4043,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) { // cursor was on an object rSh.CallEvent( SFX_EVENT_MOUSEOUT_OBJECT, - aLastCallEvent, sal_True ); + aLastCallEvent, true ); } if( bTstShdwCrsr && bInsWin && !bIsDocReadOnly && @@ -4587,7 +4591,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) const SwFrmFmt* pFmt = rSh.GetFmtFromObj( aDocPt ); if(PTR_CAST(SwFlyFrmFmt, pFmt)) { - rSh.SetFrmFmt( pApplyTempl->aColl.pFrmFmt, sal_False, &aDocPt ); + rSh.SetFrmFmt( pApplyTempl->aColl.pFrmFmt, false, &aDocPt ); pApplyTempl->bUndo = sal_True; bCallBase = sal_False; if( pApplyTempl->aColl.pFrmFmt ) @@ -5179,7 +5183,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) rSh.GetPrevAutoCorrWord( *pACorr, sWord ) ) { // ... request for auto completion help to be shown. - ShowAutoTextCorrectQuickHelp(sWord, &rACfg, pACorr, sal_True); + ShowAutoTextCorrectQuickHelp(sWord, &rACfg, pACorr, true); } } } @@ -5700,7 +5704,7 @@ void QuickHelpData::Stop( SwWrtShell& rSh ) ClearCntnt(); } -void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord, sal_Bool bIgnoreCurrentPos ) +void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord, bool bIgnoreCurrentPos ) { enum Capitalization { CASE_LOWER, CASE_UPPER, CASE_SENTENCE, CASE_OTHER }; @@ -5827,7 +5831,7 @@ void QuickHelpData::SortAndFilter() void SwEditWin::ShowAutoTextCorrectQuickHelp( const String& rWord, SvxAutoCorrCfg* pACfg, SvxAutoCorrect* pACorr, - sal_Bool bFromIME ) + bool bFromIME ) { SwWrtShell& rSh = rView.GetWrtShell(); pQuickHlpData->ClearCntnt(); diff --git a/sw/source/ui/docvw/edtwin3.cxx b/sw/source/ui/docvw/edtwin3.cxx index b13cf663c0cd..577d3bfe15d4 100644 --- a/sw/source/ui/docvw/edtwin3.cxx +++ b/sw/source/ui/docvw/edtwin3.cxx @@ -156,12 +156,12 @@ void RepaintPagePreview( ViewShell* pVwSh, const SwRect& rRect ) ((SwPagePreView *)pSfxVwSh)->RepaintCoreRect( rRect ); } -sal_Bool JumpToSwMark( ViewShell* pVwSh, const rtl::OUString& rMark ) +bool JumpToSwMark( ViewShell* pVwSh, const rtl::OUString& rMark ) { SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell(); if( pSfxVwSh && pSfxVwSh->ISA( SwView ) ) return ((SwView *)pSfxVwSh)->JumpToSwMark( rMark ); - return sal_False; + return false; } void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt ) diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index e9d5e531bb43..4221967662db 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -606,7 +606,7 @@ void SwLabPage::Reset(const SfxItemSet& rSet) void SwVisitingCardPage::ClearUserData() { - SvLBoxEntry* pEntry = aAutoTextLB.First(); + SvTreeListEntry* pEntry = aAutoTextLB.First(); while(pEntry) { delete (String*)pEntry->GetUserData(); @@ -619,7 +619,7 @@ void SwVisitingCardPage::SetUserData( sal_uInt32 nCnt, { for( sal_uInt32 i = 0; i < nCnt; ++i ) { - SvLBoxEntry* pEntry = aAutoTextLB.InsertEntry( pNames[ i ] ); + SvTreeListEntry* pEntry = aAutoTextLB.InsertEntry( pNames[ i ] ); pEntry->SetUserData( new String( pValues[ i ] )); } } @@ -689,7 +689,7 @@ sal_Bool SwVisitingCardPage::FillItemSet(SfxItemSet& rSet) if(pGroup) aLabItem.sGlossaryGroup = *pGroup; - SvLBoxEntry* pSelEntry = aAutoTextLB.FirstSelected(); + SvTreeListEntry* pSelEntry = aAutoTextLB.FirstSelected(); if(pSelEntry) aLabItem.sGlossaryBlockName = *(String*)pSelEntry->GetUserData(); rSet.Put(aLabItem); @@ -698,7 +698,7 @@ sal_Bool SwVisitingCardPage::FillItemSet(SfxItemSet& rSet) static void lcl_SelectBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName) { - SvLBoxEntry* pEntry = rAutoTextLB.First(); + SvTreeListEntry* pEntry = rAutoTextLB.First(); while(pEntry) { if(*(String*)pEntry->GetUserData() == rBlockName) @@ -713,7 +713,7 @@ static void lcl_SelectBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName static sal_Bool lcl_FindBlock(SvTreeListBox& rAutoTextLB, const String& rBlockName) { - SvLBoxEntry* pEntry = rAutoTextLB.First(); + SvTreeListEntry* pEntry = rAutoTextLB.First(); while(pEntry) { if(*(String*)pEntry->GetUserData() == rBlockName) @@ -760,7 +760,7 @@ void SwVisitingCardPage::Reset(const SfxItemSet& rSet) } if(lcl_FindBlock(aAutoTextLB, aLabItem.sGlossaryBlockName)) { - SvLBoxEntry* pSelEntry = aAutoTextLB.FirstSelected(); + SvTreeListEntry* pSelEntry = aAutoTextLB.FirstSelected(); if( pSelEntry && *(String*)pSelEntry->GetUserData() != String(aLabItem.sGlossaryBlockName)) { diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx index 7e025963e129..b97a30eb8666 100644 --- a/sw/source/ui/envelp/labelexp.cxx +++ b/sw/source/ui/envelp/labelexp.cxx @@ -120,7 +120,7 @@ void SwVisitingCardPage::InitFrameControl() IMPL_LINK_NOARG(SwVisitingCardPage, FrameControlInitializedHdl) { - SvLBoxEntry* pSel = aAutoTextLB.FirstSelected(); + SvTreeListEntry* pSel = aAutoTextLB.FirstSelected(); String sEntry; if( pSel ) sEntry = *(String*)pSel->GetUserData(); diff --git a/sw/source/ui/envelp/labimp.hxx b/sw/source/ui/envelp/labimp.hxx index d4d98dc17fc8..ceff174e142b 100644 --- a/sw/source/ui/envelp/labimp.hxx +++ b/sw/source/ui/envelp/labimp.hxx @@ -91,7 +91,7 @@ class SwLabRec { public: - SwLabRec() {} + SwLabRec(): lHDist(0), lVDist(0), lWidth(0), lHeight(0), lLeft(0), lUpper(0), lPWidth(0), lPHeight(0), nCols(0), nRows(0), bCont(false) {} void SetFromItem( const SwLabItem& rItem ); void FillItem( SwLabItem& rItem ) const; diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 1367afc64f54..4b6040676d2a 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -51,7 +51,7 @@ #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> #include <comphelper/sequenceashashmap.hxx> -#include <com/sun/star/ui/dialogs/XFolderPicker.hpp> +#include <com/sun/star/ui/dialogs/FolderPicker.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbcx/XRowLocate.hpp> @@ -782,15 +782,8 @@ IMPL_LINK_NOARG(SwMailMergeDlg, InsertPathHdl) sPath = aPathOpt.GetWorkPath(); } - uno::Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); - uno::Reference < XFolderPicker > xFP; - if( xMgr.is() ) - { - xFP = uno::Reference< XFolderPicker >( - xMgr->createInstance( - C2U( "com.sun.star.ui.dialogs.FolderPicker" ) ), - UNO_QUERY ); - } + uno::Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + uno::Reference < XFolderPicker2 > xFP = FolderPicker::create(xContext); xFP->setDisplayDirectory(sPath); if( xFP->execute() == RET_OK ) { diff --git a/sw/source/ui/fldui/FldRefTreeListBox.cxx b/sw/source/ui/fldui/FldRefTreeListBox.cxx index 0a5ad8910e31..3b120faaa761 100644 --- a/sw/source/ui/fldui/FldRefTreeListBox.cxx +++ b/sw/source/ui/fldui/FldRefTreeListBox.cxx @@ -40,7 +40,7 @@ void SwFldRefTreeListBox::RequestHelp( const HelpEvent& rHEvt ) if ( rHEvt.GetMode() & HELPMODE_QUICK ) { Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); - SvLBoxEntry* pEntry = GetEntry( aPos ); + SvTreeListEntry* pEntry = GetEntry( aPos ); if( pEntry ) { String sEntry( GetEntryText( pEntry ) ); diff --git a/sw/source/ui/fldui/FldRefTreeListBox.hxx b/sw/source/ui/fldui/FldRefTreeListBox.hxx index 782f4571013d..b924f87c9dfb 100644 --- a/sw/source/ui/fldui/FldRefTreeListBox.hxx +++ b/sw/source/ui/fldui/FldRefTreeListBox.hxx @@ -30,7 +30,7 @@ public: SwFldRefTreeListBox(Window* pParent, const ResId& rResId); virtual ~SwFldRefTreeListBox(); -// virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* ); +// virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* ); }; #endif diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index 5c0e9c0a2523..4f7ad7736a57 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -131,8 +131,8 @@ void SwChangeDBDlg::FillDBPopup() size_t nCount = aDBNameList.size(); aUsedDBTLB.Clear(); - SvLBoxEntry *pFirst = 0; - SvLBoxEntry *pLast = 0; + SvTreeListEntry *pFirst = 0; + SvTreeListEntry *pLast = 0; for(size_t k = 0; k < nCount; k++) { @@ -151,13 +151,13 @@ void SwChangeDBDlg::FillDBPopup() } -SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName) +SvTreeListEntry* SwChangeDBDlg::Insert(const String& rDBName) { String sDBName(rDBName.GetToken(0, DB_DELIM)); String sTableName(rDBName.GetToken(1, DB_DELIM)); sal_IntPtr nCommandType = rDBName.GetToken(2, DB_DELIM).ToInt32(); - SvLBoxEntry* pParent; - SvLBoxEntry* pChild; + SvTreeListEntry* pParent; + SvTreeListEntry* pChild; sal_uInt16 nParent = 0; sal_uInt16 nChild = 0; @@ -175,14 +175,14 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName) if (sTableName == aUsedDBTLB.GetEntryText(pChild)) return pChild; } - SvLBoxEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent); + SvTreeListEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent); pRet->SetUserData((void*)nCommandType); return pRet; } } pParent = aUsedDBTLB.InsertEntry(sDBName, aDBImg, aDBImg); - SvLBoxEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent); + SvTreeListEntry* pRet = aUsedDBTLB.InsertEntry(sTableName, rToInsert, rToInsert, pParent); pRet->SetUserData((void*)nCommandType); return pRet; } @@ -207,7 +207,7 @@ void SwChangeDBDlg::UpdateFlds() { std::vector<String> aDBNames; aDBNames.reserve(aUsedDBTLB.GetSelectionCount()); - SvLBoxEntry* pEntry = aUsedDBTLB.FirstSelected(); + SvTreeListEntry* pEntry = aUsedDBTLB.FirstSelected(); while( pEntry ) { @@ -256,7 +256,7 @@ IMPL_LINK_NOARG(SwChangeDBDlg, TreeSelectHdl) { sal_Bool bEnable = sal_False; - SvLBoxEntry* pEntry = aAvailDBTLB.GetCurEntry(); + SvTreeListEntry* pEntry = aAvailDBTLB.GetCurEntry(); if (pEntry) { diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index e9f543140b6d..354b88708180 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -401,7 +401,7 @@ void SwFldDBPage::CheckInsert() sal_Bool bInsert = sal_True; sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); - SvLBoxEntry* pEntry = aDatabaseTLB.GetCurEntry(); + SvTreeListEntry* pEntry = aDatabaseTLB.GetCurEntry(); if (pEntry) { @@ -427,8 +427,8 @@ void SwFldDBPage::CheckInsert() IMPL_LINK( SwFldDBPage, TreeSelectHdl, SvTreeListBox *, pBox ) { - SvLBoxEntry* pColEntry; - SvLBoxEntry* pEntry = pColEntry = pBox->GetCurEntry(); + SvTreeListEntry* pColEntry; + SvTreeListEntry* pEntry = pColEntry = pBox->GetCurEntry(); if (pEntry) { sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 812b2e7fa690..d368c41f347b 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -103,9 +103,9 @@ void SwFldDokInfPage::Reset(const SfxItemSet& ) // display SubTypes in TypeLB sal_uInt16 nTypeId = TYP_DOCINFOFLD; - SvLBoxEntry* pEntry = 0; + SvTreeListEntry* pEntry = 0; - SvLBoxEntry* pInfo = 0; + SvTreeListEntry* pInfo = 0; sal_uInt16 nSubType = USHRT_MAX; if (IsFldEdit()) @@ -213,7 +213,7 @@ void SwFldDokInfPage::Reset(const SfxItemSet& ) IMPL_LINK_NOARG(SwFldDokInfPage, TypeHdl) { // save old ListBoxPos - SvLBoxEntry* pOldEntry = pSelEntry; + SvTreeListEntry* pOldEntry = pSelEntry; // current ListBoxPos pSelEntry = aTypeTLB.FirstSelected(); @@ -474,7 +474,7 @@ void SwFldDokInfPage::FillUserData() { String sData(rtl::OUString(USER_DATA_VERSION)); sData += ';'; - SvLBoxEntry* pEntry = aTypeTLB.FirstSelected(); + SvTreeListEntry* pEntry = aTypeTLB.FirstSelected(); sal_uInt16 nTypeSel = pEntry ? sal::static_int_cast< sal_uInt16 >(reinterpret_cast< sal_uIntPtr >(pEntry->GetUserData())) : USHRT_MAX; sData += String::CreateFromInt32( nTypeSel ); SetUserData(sData); diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx index 0ab9d75758c4..fa13ecf5fdd0 100644 --- a/sw/source/ui/fldui/flddinf.hxx +++ b/sw/source/ui/fldui/flddinf.hxx @@ -52,7 +52,7 @@ class SwFldDokInfPage : public SwFldPage NumFormatListBox aFormatLB; CheckBox aFixedCB; - SvLBoxEntry* pSelEntry; + SvTreeListEntry* pSelEntry; com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > xCustomPropertySet; String aInfoStr; diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index 3312a6a7b7bb..bd5df73d0ecf 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -39,7 +39,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdbc/XDataSource.hpp> -#include <com/sun/star/uri/XUriReferenceFactory.hpp> +#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarScriptUrl.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> @@ -1695,22 +1695,18 @@ void SwFldMgr::SetMacroPath(const String& rPath) // try to set sMacroName member variable by parsing the macro path // using the new URI parsing services - Reference< XMultiServiceFactory > xSMgr = - ::comphelper::getProcessServiceFactory(); + Reference< XComponentContext > xContext = + ::comphelper::getProcessComponentContext(); Reference< uri::XUriReferenceFactory > - xFactory( xSMgr->createInstance( - ::rtl::OUString( "com.sun.star.uri.UriReferenceFactory" ) ), UNO_QUERY ); + xFactory = uri::UriReferenceFactory::create( xContext ); - if ( xFactory.is() ) - { - Reference< uri::XVndSunStarScriptUrl > - xUrl( xFactory->parse( sMacroPath ), UNO_QUERY ); + Reference< uri::XVndSunStarScriptUrl > + xUrl( xFactory->parse( sMacroPath ), UNO_QUERY ); - if ( xUrl.is() ) - { - sMacroName = xUrl->getName(); - } + if ( xUrl.is() ) + { + sMacroName = xUrl->getName(); } } diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 19c52a6746e0..e00fb78d3546 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -112,15 +112,11 @@ void SwFldRefPage::SaveSelectedTxtNode() mnSavedSelectedPos = 0; if ( aSelectionToolTipLB.IsVisible() ) { - SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); + SvTreeListEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); if ( pEntry ) { const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel()); - SwWrtShell *pSh = GetWrtShell(); - if ( !pSh ) - { - pSh = ::GetActiveWrtShell(); - } + if ( nTypeId == REFFLDFLAG_HEADING ) { mnSavedSelectedPos = static_cast<sal_uInt16>(reinterpret_cast<sal_uLong>(pEntry->GetUserData())); @@ -493,7 +489,7 @@ void SwFldRefPage::UpdateSubType() IDocumentMarkAccess* const pMarkAccess = pSh->getIDocumentMarkAccess(); for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getBookmarksBegin(); ppMark != pMarkAccess->getBookmarksEnd(); - ppMark++) + ++ppMark) { const ::sw::mark::IMark* pBkmk = ppMark->get(); if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(*pBkmk)) @@ -536,7 +532,7 @@ void SwFldRefPage::UpdateSubType() const IDocumentOutlineNodes* pIDoc( pSh->getIDocumentOutlineNodesAccess() ); pIDoc->getOutlineNodes( maOutlineNodes ); bool bCertainTxtNodeSelected( false ); - SvLBoxEntry* pEntry = 0; + SvTreeListEntry* pEntry = 0; sal_uInt16 nOutlIdx = 0; for ( nOutlIdx = 0; nOutlIdx < maOutlineNodes.size(); ++nOutlIdx ) { @@ -566,7 +562,7 @@ void SwFldRefPage::UpdateSubType() const IDocumentListItems* pIDoc( pSh->getIDocumentListItemsAccess() ); pIDoc->getNumItems( maNumItems ); bool bCertainTxtNodeSelected( false ); - SvLBoxEntry* pEntry = 0; + SvTreeListEntry* pEntry = 0; sal_uInt16 nNumItemIdx = 0; for ( nNumItemIdx = 0; nNumItemIdx < maNumItems.size(); ++nNumItemIdx ) { @@ -877,7 +873,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) // #i83479# else if ( nTypeId == REFFLDFLAG_HEADING ) { - SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); + SvTreeListEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); OSL_ENSURE( pEntry, "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" ); if ( pEntry ) @@ -897,7 +893,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& ) } else if ( nTypeId == REFFLDFLAG_NUMITEM ) { - SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); + SvTreeListEntry* pEntry = aSelectionToolTipLB.GetCurEntry(); OSL_ENSURE( pEntry, "<SwFldRefPage::FillItemSet(..)> - no entry selected in selection tool tip listbox!" ); if ( pEntry ) diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc index 1e924271d2d3..9131ac586a2d 100644 --- a/sw/source/ui/inc/app.hrc +++ b/sw/source/ui/inc/app.hrc @@ -114,8 +114,11 @@ #define STR_NUMERIC (RC_APP_BEGIN + 126) #define STR_COL (RC_APP_BEGIN + 127) #define STR_ROW (RC_APP_BEGIN + 128) +#define STR_SIMPLE (RC_APP_BEGIN + 129) +#define STR_AUTHMRK_EDIT (RC_APP_BEGIN + 130) +#define STR_AUTHMRK_INSERT (RC_APP_BEGIN + 131) -#define APP_ACT_END STR_ROW +#define APP_ACT_END STR_AUTHMRK_INSERT #if APP_ACT_END > RC_APP_END #error Resource-Id Ueberlauf in #file, #line diff --git a/sw/source/ui/inc/changedb.hxx b/sw/source/ui/inc/changedb.hxx index c7f6042c6e47..3395075623a3 100644 --- a/sw/source/ui/inc/changedb.hxx +++ b/sw/source/ui/inc/changedb.hxx @@ -72,7 +72,7 @@ class SwChangeDBDlg: public SvxStandardDialog virtual void Apply(); void UpdateFlds(); void FillDBPopup(); - SvLBoxEntry* Insert(const String& rDBName); + SvTreeListEntry* Insert(const String& rDBName); void ShowDBName(const SwDBData& rDBData); public: diff --git a/sw/source/ui/inc/conttree.hxx b/sw/source/ui/inc/conttree.hxx index 5725a5df0826..3d2686322e16 100644 --- a/sw/source/ui/inc/conttree.hxx +++ b/sw/source/ui/inc/conttree.hxx @@ -110,7 +110,7 @@ class SwContentTree : public SvTreeListBox protected: virtual void RequestHelp( const HelpEvent& rHEvt ); - virtual void InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&,SvLBoxButtonKind); + virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind); virtual void DataChanged( const DataChangedEvent& rDCEvt ); SwNavigationPI* GetParentWindow(){return @@ -127,22 +127,22 @@ protected: sal_Bool HasContentChanged(); virtual DragDropMode NotifyStartDrag( TransferDataContainer& rData, - SvLBoxEntry* ); - virtual sal_Bool NotifyAcceptDrop( SvLBoxEntry* ); + SvTreeListEntry* ); + virtual sal_Bool NotifyAcceptDrop( SvTreeListEntry* ); - virtual sal_Bool NotifyMoving( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, + virtual sal_Bool NotifyMoving( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& rpNewParent, sal_uLong& rNewChildPos ); - virtual sal_Bool NotifyCopying( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, + virtual sal_Bool NotifyCopying( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& rpNewParent, sal_uLong& rNewChildPos ); virtual void MouseButtonDown( const MouseEvent& rMEvt ); - void EditEntry( SvLBoxEntry* pEntry, sal_uInt8 nMode ); + void EditEntry( SvTreeListEntry* pEntry, sal_uInt8 nMode ); void GotoContent(SwContent* pCnt); static void SetInDrag(sal_Bool bSet) {bIsInDrag = bSet;} @@ -179,9 +179,9 @@ public: sal_uInt8 GetOutlineLevel()const {return nOutlineLevel;} void SetOutlineLevel(sal_uInt8 nSet); - sal_Bool Expand( SvLBoxEntry* pParent ); + sal_Bool Expand( SvTreeListEntry* pParent ); - sal_Bool Collapse( SvLBoxEntry* pParent ); + sal_Bool Collapse( SvTreeListEntry* pParent ); void ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier); @@ -198,12 +198,12 @@ public: DECL_LINK( ContentDoubleClickHdl, void * ); DECL_LINK( TimerUpdate, void * ); - virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* ); - virtual void RequestingChildren( SvLBoxEntry* pParent ); + virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* ); + virtual void RequestingChildren( SvTreeListEntry* pParent ); virtual void GetFocus(); virtual void KeyInput(const KeyEvent& rKEvt); - virtual sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True ); + virtual sal_Bool Select( SvTreeListEntry* pEntry, sal_Bool bSelect=sal_True ); }; @@ -215,13 +215,13 @@ class SwLBoxString : public SvLBoxString { public: - SwLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, + SwLBoxString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr) { } virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, - SvLBoxEntry* pEntry); + SvTreeListEntry* pEntry); }; namespace sfx2 { class DocumentInserter; } @@ -236,8 +236,8 @@ private: ImageList aEntryImages; SwWrtShell* pActiveShell; // - SvLBoxEntry* pEmphasisEntry; // Drag'n Drop emphasis - SvLBoxEntry* pDDSource; // source for Drag'n Drop + SvTreeListEntry* pEmphasisEntry; // Drag'n Drop emphasis + SvTreeListEntry* pDDSource; // source for Drag'n Drop SwGlblDocContents* pSwGlblDocContents; // array with sorted content Window* pDefParentWin; @@ -269,30 +269,30 @@ protected: virtual void RequestHelp( const HelpEvent& rHEvt ); - virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* ); - virtual sal_Bool NotifyMoving( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, + virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* ); + virtual sal_Bool NotifyMoving( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& rpNewParent, sal_uLong& rNewChildPos ); - virtual sal_Bool NotifyCopying( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, + virtual sal_Bool NotifyCopying( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& rpNewParent, sal_uLong& rNewChildPos ); virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); virtual void DragFinished( sal_Int8 ); virtual DragDropMode NotifyStartDrag( TransferDataContainer& rData, - SvLBoxEntry* ); - virtual sal_Bool NotifyAcceptDrop( SvLBoxEntry* ); + SvTreeListEntry* ); + virtual sal_Bool NotifyAcceptDrop( SvTreeListEntry* ); virtual void MouseButtonDown( const MouseEvent& rMEvt ); virtual void KeyInput(const KeyEvent& rKEvt); virtual void GetFocus(); virtual void SelectHdl(); virtual void DeselectHdl(); - virtual void InitEntry(SvLBoxEntry*,const XubString&,const Image&,const Image&,SvLBoxButtonKind); + virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind); void Clear(); diff --git a/sw/source/ui/inc/dbtree.hxx b/sw/source/ui/inc/dbtree.hxx index fdcaf5368259..f4e060d13697 100644 --- a/sw/source/ui/inc/dbtree.hxx +++ b/sw/source/ui/inc/dbtree.hxx @@ -53,7 +53,7 @@ class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox SW_DLLPRIVATE DECL_LINK( DBCompare, SvSortData* ); SW_DLLPRIVATE void InitTreeList(); - SW_DLLPRIVATE virtual void RequestingChildren( SvLBoxEntry* pParent ); + SW_DLLPRIVATE virtual void RequestingChildren( SvTreeListEntry* pParent ); SW_DLLPRIVATE virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); SW_DLLPRIVATE virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx index 01f100aa9b78..2ff4e436638e 100644 --- a/sw/source/ui/inc/edtwin.hxx +++ b/sw/source/ui/inc/edtwin.hxx @@ -223,7 +223,7 @@ protected: virtual Selection GetSurroundingTextSelection() const; void ShowAutoTextCorrectQuickHelp( const String& rWord, SvxAutoCorrCfg* pACfg, - SvxAutoCorrect* pACorr, sal_Bool bFromIME = sal_False ); + SvxAutoCorrect* pACorr, bool bFromIME = false ); /// Returns true if in header/footer area, or in the header/footer control. bool IsInHeaderFooter( const Point &rDocPt, FrameControlType &rControl ) const; diff --git a/sw/source/ui/inc/gloshdl.hxx b/sw/source/ui/inc/gloshdl.hxx index 7368edacf7f3..ffa327852d2f 100644 --- a/sw/source/ui/inc/gloshdl.hxx +++ b/sw/source/ui/inc/gloshdl.hxx @@ -86,7 +86,7 @@ public: sal_Bool CopyToClipboard(SwWrtShell& rSh, const String& rShortName); sal_Bool ExpandGlossary(); - sal_Bool InsertGlossary(const String &rName); + bool InsertGlossary(const String &rName); void SetMacros(const String& rName, const SvxMacro* pStart, diff --git a/sw/source/ui/inc/glossary.hxx b/sw/source/ui/inc/glossary.hxx index c707f46e25e6..5a4b26284dff 100644 --- a/sw/source/ui/inc/glossary.hxx +++ b/sw/source/ui/inc/glossary.hxx @@ -63,20 +63,20 @@ class SwGlTreeListBox : public SvTreeListBox { const String sReadonly; - SvLBoxEntry* pDragEntry; + SvTreeListEntry* pDragEntry; virtual DragDropMode NotifyStartDrag( TransferDataContainer& rContainer, - SvLBoxEntry* ); - virtual sal_Bool NotifyAcceptDrop( SvLBoxEntry* ); + SvTreeListEntry* ); + virtual sal_Bool NotifyAcceptDrop( SvTreeListEntry* ); - virtual sal_Bool NotifyMoving( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, + virtual sal_Bool NotifyMoving( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& rpNewParent, sal_uLong& rNewChildPos ); - virtual sal_Bool NotifyCopying( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, + virtual sal_Bool NotifyCopying( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& rpNewParent, sal_uLong& rNewChildPos); public: SwGlTreeListBox(Window* pParent, const ResId& rResId); @@ -148,7 +148,7 @@ class SwGlossaryDlg : public SvxStandardDialog virtual void Apply(); void Init(); - SvLBoxEntry* DoesBlockExist(const String& sBlock, const String& rShort); + SvTreeListEntry* DoesBlockExist(const String& sBlock, const String& rShort); void ShowAutoText(const String& rGroup, const String& rShortName); void ResumeShowAutoText(); diff --git a/sw/source/ui/inc/insrule.hxx b/sw/source/ui/inc/insrule.hxx index 77a13c7eaaff..5d9f37e9eef3 100644 --- a/sw/source/ui/inc/insrule.hxx +++ b/sw/source/ui/inc/insrule.hxx @@ -28,33 +28,24 @@ class ValueSet; class SwInsertGrfRulerDlg : public SfxModalDialog { - FixedLine aSelectionFL; - OKButton aOkPB; - CancelButton aCancelPB; - HelpButton aHelpPB; + OKButton* m_pOkPB; + SwRulerValueSet* m_pExampleVS; - std::vector<String> aGrfNames; - String sSimple; - String sRulers; - sal_uInt16 nSelPos; - - SwRulerValueSet* pExampleVS; + std::vector<OUString> m_aGrfNames; + OUString m_sSimple; protected: - DECL_LINK(SelectHdl, ValueSet*); DECL_LINK(DoubleClickHdl, void *); public: - SwInsertGrfRulerDlg( Window* pParent ); + SwInsertGrfRulerDlg(Window* pParent); ~SwInsertGrfRulerDlg(); - String GetGraphicName(); - sal_Bool IsSimpleLine() {return nSelPos == 1;} - sal_Bool HasImages() const {return !aGrfNames.empty();} + OUString GetGraphicName() const; + bool IsSimpleLine() const; + bool HasImages() const {return !m_aGrfNames.empty();} }; #endif - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/misc.hrc b/sw/source/ui/inc/misc.hrc index 4bfbfe587c0f..ebaae1552d8a 100644 --- a/sw/source/ui/inc/misc.hrc +++ b/sw/source/ui/inc/misc.hrc @@ -31,7 +31,6 @@ #define DLG_NUM_NAMES (RC_MISC_BEGIN + 18) #define DLG_SORTING (RC_MISC_BEGIN + 19) #define DLG_RENAME_GLOS (RC_MISC_BEGIN + 25) -#define DLG_INSERT_RULER (RC_MISC_BEGIN + 28) #define DLG_REDLINE_ACCEPT (RC_MISC_BEGIN + 29) #define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 31) diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx index 908aa53b97ef..162bf6e95457 100644 --- a/sw/source/ui/inc/optload.hxx +++ b/sw/source/ui/inc/optload.hxx @@ -32,7 +32,7 @@ #include <caption.hxx> class SwFldMgr; -class SvLBoxEntry; +class SvTreeListEntry; class SwWrtShell; class SwLoadOptPage : public SfxTabPage @@ -171,7 +171,7 @@ private: void SetOptions( const sal_uInt16 nPos, const SwCapObjType eType, const SvGlobalName *pOleId = 0); - void SaveEntry( SvLBoxEntry* pEntry ); + void SaveEntry( SvTreeListEntry* pEntry ); void DrawSample(); public: diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx index 9cd0870a6746..0ccf30196f50 100644 --- a/sw/source/ui/inc/pview.hxx +++ b/sw/source/ui/inc/pview.hxx @@ -193,6 +193,8 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell // MDI control elements SwScrollbar *pHScrollbar; SwScrollbar *pVScrollbar; + bool mbHScrollbarEnabled; + bool mbVScrollbarEnabled; ImageButton *pPageUpBtn, *pPageDownBtn; // dummy window for filling the lower right edge when both scrollbars are active @@ -269,8 +271,9 @@ public: void ScrollViewSzChg(); void ScrollDocSzChg(); void ShowHScrollbar(sal_Bool bShow); - void ShowVScrollbar(sal_Bool bShow); + void EnableHScrollbar(bool bEnable); + void EnableVScrollbar(bool bEnable); sal_uInt16 GetPageCount() const { return mnPageCount; } sal_uInt16 GetSelectedPage() const {return aViewWin.SelectedPage();} diff --git a/sw/source/ui/inc/redlndlg.hxx b/sw/source/ui/inc/redlndlg.hxx index c90a0edf0e18..6a47e80053c7 100644 --- a/sw/source/ui/inc/redlndlg.hxx +++ b/sw/source/ui/inc/redlndlg.hxx @@ -47,14 +47,14 @@ struct SwRedlineDataChild { const SwRedlineData* pChild; // link to original stacked data const SwRedlineDataChild* pNext; // link to stacked data - SvLBoxEntry* pTLBChild; // corresponding TreeListBox entry + SvTreeListEntry* pTLBChild; // corresponding TreeListBox entry }; struct SwRedlineDataParent { const SwRedlineData* pData; // RedlineDataPtr const SwRedlineDataChild* pNext; // link to stacked data - SvLBoxEntry* pTLBParent; // corresponding TreeListBox entry + SvTreeListEntry* pTLBParent; // corresponding TreeListBox entry String sComment; // redline comment inline sal_Bool operator==( const SwRedlineDataParent& rObj ) const @@ -72,7 +72,7 @@ typedef SwRedlineDataChild* SwRedlineDataChildPtr; typedef boost::ptr_vector<SwRedlineDataChild> SwRedlineDataChildArr; -typedef SvLBoxEntry* SvLBoxEntryPtr; +typedef SvTreeListEntry* SvLBoxEntryPtr; typedef std::vector<SvLBoxEntryPtr> SvLBoxEntryArr; class SW_DLLPUBLIC SwRedlineAcceptDlg @@ -122,7 +122,7 @@ class SW_DLLPUBLIC SwRedlineAcceptDlg SW_DLLPRIVATE String GetRedlineText(const SwRedline& rRedln, DateTime &rDateTime, sal_uInt16 nStack = 0); SW_DLLPRIVATE const String& GetActionText(const SwRedline& rRedln, sal_uInt16 nStack = 0); - SW_DLLPRIVATE sal_uInt16 GetRedlinePos( const SvLBoxEntry& rEntry) const; + SW_DLLPRIVATE sal_uInt16 GetRedlinePos( const SvTreeListEntry& rEntry) const; public: SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt = sal_False); diff --git a/sw/source/ui/inc/regionsw.hxx b/sw/source/ui/inc/regionsw.hxx index 8fce92f63ed1..37193e4cda4f 100644 --- a/sw/source/ui/inc/regionsw.hxx +++ b/sw/source/ui/inc/regionsw.hxx @@ -119,7 +119,7 @@ class SwEditRegionDlg : public SfxModalDialog Image BuildBitmap(sal_Bool bProtect,sal_Bool bHidden); - void RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry); + void RecurseList( const SwSectionFmt* pFmt, SvTreeListEntry* pEntry); sal_uInt16 FindArrPos(const SwSectionFmt* pFmt); DECL_LINK( GetFirstEntryHdl, SvTreeListBox * ); diff --git a/sw/source/ui/inc/swtablerep.hxx b/sw/source/ui/inc/swtablerep.hxx index f73f50ea5943..996d0b26cc41 100644 --- a/sw/source/ui/inc/swtablerep.hxx +++ b/sw/source/ui/inc/swtablerep.hxx @@ -38,13 +38,13 @@ class SW_DLLPUBLIC SwTableRep sal_uInt16 nColCount; sal_uInt16 nAllCols; sal_uInt16 nWidthPercent; - sal_Bool bComplex : 1; + bool bComplex : 1; sal_Bool bLineSelected : 1; sal_Bool bWidthChanged : 1; sal_Bool bColsChanged : 1; public: - SwTableRep( const SwTabCols& rTabCol, sal_Bool bComplex ); + SwTableRep( const SwTabCols& rTabCol, bool bComplex ); ~SwTableRep(); sal_Bool FillTabCols( SwTabCols& rTabCol ) const; @@ -64,7 +64,6 @@ public: sal_uInt16 GetAlign() const {return nAlign;} void SetAlign(sal_uInt16 nSet) {nAlign = nSet;} - sal_Bool IsComplex() const {return bComplex;} sal_uInt16 GetColCount() const {return nColCount;} sal_uInt16 GetAllColCount() const {return nAllCols;} diff --git a/sw/source/ui/inc/swuiidxmrk.hxx b/sw/source/ui/inc/swuiidxmrk.hxx index 82125c9e2921..c62ef5f575fa 100644 --- a/sw/source/ui/inc/swuiidxmrk.hxx +++ b/sw/source/ui/inc/swuiidxmrk.hxx @@ -31,18 +31,16 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <sfx2/basedlgs.hxx> -#include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/combobox.hxx> #include <svx/stddlg.hxx> +#include <vcl/button.hxx> +#include <vcl/combobox.hxx> #include <vcl/field.hxx> - +#include <vcl/fixed.hxx> #include <vcl/group.hxx> +#include <vcl/layout.hxx> +#include <vcl/lstbox.hxx> -#include <vcl/button.hxx> - -#include <vcl/button.hxx> #include <sfx2/childwin.hxx> #include "toxe.hxx" #include <svtools/stdctrl.hxx> @@ -57,51 +55,49 @@ class SwTOXMark; class SwIndexMarkFloatDlg; class SwIndexMarkModalDlg; -class SwIndexMarkDlg : public Window +class SwIndexMarkPane { + Dialog& m_rDialog; + friend class SwIndexMarkFloatDlg; friend class SwIndexMarkModalDlg; - FixedLine aIndexFL; - FixedText aTypeFT; - ListBox aTypeDCB; - ImageButton aNewBT; - - FixedText aEntryFT; - Edit aEntryED; - FixedText aPhoneticFT0; - Edit aPhoneticED0; - - FixedText aKeyFT; - ComboBox aKeyDCB; - FixedText aPhoneticFT1; - Edit aPhoneticED1; - - FixedText aKey2FT; - ComboBox aKey2DCB; - FixedText aPhoneticFT2; - Edit aPhoneticED2; - - FixedText aLevelFT; - NumericField aLevelED; - CheckBox aMainEntryCB; - CheckBox aApplyToAllCB; - CheckBox aSearchCaseSensitiveCB; - CheckBox aSearchCaseWordOnlyCB; - - - OKButton aOKBT; - CancelButton aCancelBT; - HelpButton aHelpBT; - PushButton aDelBT; - //PushButton aNewBT; - - ImageButton aPrevSameBT; - ImageButton aNextSameBT; - ImageButton aPrevBT; - ImageButton aNextBT; + VclFrame* m_pFrame; + FixedText* m_pTypeFT; + ListBox* m_pTypeDCB; + PushButton* m_pNewBT; + + Edit* m_pEntryED; + FixedText* m_pPhoneticFT0; + Edit* m_pPhoneticED0; + + FixedText* m_pKey1FT; + ComboBox* m_pKey1DCB; + FixedText* m_pPhoneticFT1; + Edit* m_pPhoneticED1; + + FixedText* m_pKey2FT; + ComboBox* m_pKey2DCB; + FixedText* m_pPhoneticFT2; + Edit* m_pPhoneticED2; + + FixedText* m_pLevelFT; + NumericField* m_pLevelNF; + CheckBox* m_pMainEntryCB; + CheckBox* m_pApplyToAllCB; + CheckBox* m_pSearchCaseSensitiveCB; + CheckBox* m_pSearchCaseWordOnlyCB; + + + PushButton* m_pOKBT; + PushButton* m_pCloseBT; + PushButton* m_pDelBT; + + PushButton* m_pPrevSameBT; + PushButton* m_pNextSameBT; + PushButton* m_pPrevBT; + PushButton* m_pNextBT; String aOrgStr; - sal_Int32 nOptionsId; sal_Bool bDel; sal_Bool bNewMark; sal_Bool bSelected; @@ -146,27 +142,27 @@ class SwIndexMarkDlg : public Window void UpdateDialog(); void InsertUpdate(); - virtual void Activate(); + void Activate(); public: - SwIndexMarkDlg( Window *pParent, - sal_Bool bNewDlg, - const ResId& rResId, - sal_Int32 _nOptionsId, - SwWrtShell& rWrtShell ); + SwIndexMarkPane(Dialog &rDialog, + sal_Bool bNewDlg, + SwWrtShell& rWrtShell); + Dialog &GetDialog() { return m_rDialog; } - ~SwIndexMarkDlg(); + + ~SwIndexMarkPane(); void ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark = 0); sal_Bool IsTOXType(const String& rName) - {return LISTBOX_ENTRY_NOTFOUND != aTypeDCB.GetEntryPos(rName);} + {return LISTBOX_ENTRY_NOTFOUND != m_pTypeDCB->GetEntryPos(rName);} }; class SwIndexMarkFloatDlg : public SfxModelessDialog { - SwIndexMarkDlg aDlg; + SwIndexMarkPane m_aContent; virtual void Activate(); public: SwIndexMarkFloatDlg( SfxBindings* pBindings, @@ -179,7 +175,7 @@ class SwIndexMarkFloatDlg : public SfxModelessDialog class SwIndexMarkModalDlg : public SvxStandardDialog { - SwIndexMarkDlg aDlg; + SwIndexMarkPane m_aContent; public: SwIndexMarkModalDlg(Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark); @@ -189,34 +185,29 @@ public: class SwAuthMarkModalDlg; -class SwAuthMarkDlg : public Window +class SwAuthorMarkPane { + Dialog& m_rDialog; + static sal_Bool bIsFromComponent; friend class SwAuthMarkModalDlg; friend class SwAuthMarkFloatDlg; - RadioButton aFromComponentRB; - RadioButton aFromDocContentRB; - FixedText aAuthorFT; - FixedInfo aAuthorFI; - FixedText aTitleFT; - FixedInfo aTitleFI; - FixedText aEntryFT; - Edit aEntryED; - ListBox aEntryLB; + RadioButton* m_pFromComponentRB; + RadioButton* m_pFromDocContentRB; + FixedText* m_pAuthorFI; + FixedText* m_pTitleFI; + Edit* m_pEntryED; + ListBox* m_pEntryLB; - FixedLine aEntryFL; + PushButton* m_pActionBT; + PushButton* m_pCloseBT; + PushButton* m_pCreateEntryPB; + PushButton* m_pEditEntryPB; - OKButton aOKBT; - CancelButton aCancelBT; - HelpButton aHelpBT; - PushButton aCreateEntryPB; - PushButton aEditEntryPB; - - String sChangeST; - sal_Bool bNewEntry; - sal_Bool bBibAccessInitialized; + sal_Bool bNewEntry; + sal_Bool bBibAccessInitialized; SwWrtShell* pSh; @@ -236,20 +227,18 @@ class SwAuthMarkDlg : public Window DECL_LINK(EditModifyHdl, Edit*); void InitControls(); - virtual void Activate(); + void Activate(); public: - SwAuthMarkDlg( Window *pParent, - const ResId& rResId, + SwAuthorMarkPane( Dialog &rDialog, sal_Bool bNew=sal_True); - ~SwAuthMarkDlg(); void ReInitDlg(SwWrtShell& rWrtShell); }; class SwAuthMarkFloatDlg : public SfxModelessDialog { - SwAuthMarkDlg aDlg; + SwAuthorMarkPane m_aContent; virtual void Activate(); public: SwAuthMarkFloatDlg( SfxBindings* pBindings, @@ -262,7 +251,7 @@ class SwAuthMarkFloatDlg : public SfxModelessDialog class SwAuthMarkModalDlg : public SvxStandardDialog { - SwAuthMarkDlg aDlg; + SwAuthorMarkPane m_aContent; public: SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh); diff --git a/sw/source/ui/inc/swvset.hxx b/sw/source/ui/inc/swvset.hxx index f2c8725fbccc..6320472e9bfd 100644 --- a/sw/source/ui/inc/swvset.hxx +++ b/sw/source/ui/inc/swvset.hxx @@ -22,10 +22,9 @@ class SwRulerValueSet : public SvxBmpNumValueSet { - public: - SwRulerValueSet( Window* pParent, - const ResId& rResId ); - ~SwRulerValueSet(); +public: + SwRulerValueSet(Window* pParent, WinBits nWinStyle); + ~SwRulerValueSet(); virtual void UserDraw( const UserDrawEvent& rUDEvt ); }; #endif diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx index 2a5cc3a4165e..f32fcd937ed3 100644 --- a/sw/source/ui/inc/view.hxx +++ b/sw/source/ui/inc/view.hxx @@ -210,6 +210,9 @@ class SW_DLLPUBLIC SwView: public SfxViewShell SwScrollbar *pHScrollbar, // MDI control elements *pVScrollbar; + bool mbHScrollbarEnabled; + bool mbVScrollbarEnabled; + Window *pScrollFill; // dummy window for filling the lower right edge // when both scrollbars are active @@ -506,6 +509,9 @@ public: void ShowVScrollbar(sal_Bool bShow); sal_Bool IsVScrollbarVisible()const; + void EnableHScrollbar(bool bEnable); + void EnableVScrollbar(bool bEnable); + int CreateVLineal(); int KillVLineal(); int CreateTab(); @@ -606,7 +612,7 @@ public: sal_Bool IsCrsrAtTop() const { return bTopCrsr; } sal_Bool IsCrsrAtCenter() const { return bCenterCrsr; } - sal_Bool JumpToSwMark( const String& rMark ); + bool JumpToSwMark( const String& rMark ); long InsertDoc( sal_uInt16 nSlotId, const String& rFileName, const String& rFilterName, sal_Int16 nVersion = 0 ); diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 86b4b6e9a2eb..756ee84f5b86 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -428,7 +428,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)(); void ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 ); // call into the dark Basic/JavaScript sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent, - sal_Bool bCheckPtr = sal_False, SbxArray* pArgs = 0, + bool bCheckPtr = false, SbxArray* pArgs = 0, const Link* pCallBack = 0 ); // a click at the given field. the cursor is on it. @@ -469,14 +469,14 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)(); void addCurrentPosition(); sal_Bool GotoFly( const String& rName, FlyCntType eType = FLYCNTTYPE_ALL, sal_Bool bSelFrame = sal_True ); - sal_Bool GotoINetAttr( const SwTxtINetFmt& rAttr ); + bool GotoINetAttr( const SwTxtINetFmt& rAttr ); void GotoOutline( sal_uInt16 nIdx ); - sal_Bool GotoOutline( const String& rName ); - sal_Bool GotoRegion( const String& rName ); + bool GotoOutline( const String& rName ); + bool GotoRegion( const String& rName ); sal_Bool GotoRefMark( const String& rRefMark, sal_uInt16 nSubType = 0, sal_uInt16 nSeqNo = 0 ); sal_Bool GotoNextTOXBase( const String* pName = 0); - sal_Bool GotoTable( const String& rName ); + bool GotoTable( const String& rName ); sal_Bool GotoFld( const SwFmtFld& rFld ); const SwRedline* GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect = sal_False); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 5bf5fc9e1497..383a80515ddb 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -389,7 +389,7 @@ short SwMultiTOXTabDialog::Ok() { short nRet = SfxTabDialog::Ok(); SwTOXDescription& rDesc = GetTOXDescription(eCurrentTOXType); - SwTOXBase aNewDef(*rSh.GetDefaultTOXBase( eCurrentTOXType.eType, sal_True )); + SwTOXBase aNewDef(*rSh.GetDefaultTOXBase( eCurrentTOXType.eType, true )); sal_uInt16 nIndex = static_cast< sal_uInt16 >(eCurrentTOXType.eType); if(eCurrentTOXType.eType == TOX_USER && eCurrentTOXType.nIndex) @@ -590,11 +590,11 @@ public: SvTreeListBox(pWin, rResId), pHeaderBar(0){} virtual void KeyInput( const KeyEvent& rKEvt ); - virtual long GetTabPos( SvLBoxEntry*, SvLBoxTab* ); + virtual long GetTabPos( SvTreeListEntry*, SvLBoxTab* ); void SetHeaderBar(const HeaderBar* pHB) {pHeaderBar = pHB;} }; -long SwIndexTreeLB::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) +long SwIndexTreeLB::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab) { long nData = (long)pEntry->GetUserData(); if(nData != USHRT_MAX) @@ -610,7 +610,7 @@ long SwIndexTreeLB::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) void SwIndexTreeLB::KeyInput( const KeyEvent& rKEvt ) { - SvLBoxEntry* pEntry = FirstSelected(); + SvTreeListEntry* pEntry = FirstSelected(); KeyCode aCode = rKEvt.GetKeyCode(); sal_Bool bChanged = sal_False; if(pEntry) @@ -749,7 +749,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent, for(sal_uInt16 nToken = 0; nToken < comphelper::string::getTokenCount(sStyles, TOX_STYLE_DELIMITER); nToken++) { String sTmp(sStyles.GetToken(nToken, TOX_STYLE_DELIMITER)); - SvLBoxEntry* pEntry = rTLB.InsertEntry(sTmp); + SvTreeListEntry* pEntry = rTLB.InsertEntry(sTmp); pEntry->SetUserData(reinterpret_cast<void*>(i)); } } @@ -768,7 +768,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(Window* pParent, if(rName.Len() > 0) { - SvLBoxEntry* pEntry = rTLB.First(); + SvTreeListEntry* pEntry = rTLB.First(); sal_Bool bFound = sal_False; while(pEntry && !bFound) { @@ -795,7 +795,7 @@ IMPL_LINK_NOARG(SwAddStylesDlg_Impl, OkHdl) pStyleArr[i].Erase(); SwIndexTreeLB& rTLB = aHeaderTree.GetTreeListBox(); - SvLBoxEntry* pEntry = rTLB.First(); + SvTreeListEntry* pEntry = rTLB.First(); while(pEntry) { long nLevel = (long)pEntry->GetUserData(); @@ -823,7 +823,7 @@ IMPL_LINK_NOARG(SwAddStylesDlg_Impl, HeaderDragHdl) IMPL_LINK(SwAddStylesDlg_Impl, LeftRightHdl, PushButton*, pBtn) { sal_Bool bLeft = pBtn == &aLeftPB; - SvLBoxEntry* pEntry = aHeaderTree.GetTreeListBox().FirstSelected(); + SvTreeListEntry* pEntry = aHeaderTree.GetTreeListBox().FirstSelected(); if(pEntry) { long nLevel = (long)pEntry->GetUserData(); @@ -1802,7 +1802,7 @@ void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt ) if( rHEvt.GetMode() & HELPMODE_QUICK ) { Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); - SvLBoxEntry* pEntry = GetEntry( aPos ); + SvTreeListEntry* pEntry = GetEntry( aPos ); if( pEntry ) { sal_uInt16 nLevel = static_cast< sal_uInt16 >(GetModel()->GetAbsPos(pEntry)); diff --git a/sw/source/ui/index/idxmrk.cxx b/sw/source/ui/index/idxmrk.cxx index 2784c072c47f..463b2d2bb3fc 100644 --- a/sw/source/ui/index/idxmrk.cxx +++ b/sw/source/ui/index/idxmrk.cxx @@ -72,7 +72,7 @@ SwInsertIdxMarkWrapper::SwInsertIdxMarkWrapper( Window *pParentWindow, { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pAbstDlg = pFact->CreateIndexMarkFloatDlg( DLG_INSIDXMARK , pBindings, this, pParentWindow, pInfo ); + pAbstDlg = pFact->CreateIndexMarkFloatDlg(pBindings, this, pParentWindow, pInfo); OSL_ENSURE(pAbstDlg, "Dialogdiet fail!"); pWindow = pAbstDlg->GetWindow(); pWindow->Show(); // at this point,because before pSh has to be initialized in ReInitDlg() @@ -102,7 +102,7 @@ SwInsertAuthMarkWrapper::SwInsertAuthMarkWrapper( Window *pParentWindow, { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - pAbstDlg = pFact->CreateAuthMarkFloatDlg( DLG_INSAUTHMARK, pBindings, this, pParentWindow, pInfo ); + pAbstDlg = pFact->CreateAuthMarkFloatDlg(pBindings, this, pParentWindow, pInfo); OSL_ENSURE(pAbstDlg, "Dialogdiet fail!"); pWindow = pAbstDlg->GetWindow(); diff --git a/sw/source/ui/index/idxmrk.hrc b/sw/source/ui/index/idxmrk.hrc index cd00d01fc0c2..9b4d6fe16770 100644 --- a/sw/source/ui/index/idxmrk.hrc +++ b/sw/source/ui/index/idxmrk.hrc @@ -15,85 +15,10 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#define BT_OK 100 -#define BT_CANCEL 101 -#define BT_NXT 102 -#define BT_NXTSAME 103 -#define BT_PREV 104 -#define BT_PREVSAME 105 -#define BT_DEL 106 -#define BT_HELP 107 -#define LBL_INDEX 1 -#define DCB_INDEX 2 -#define LBL_ENTRY 3 -#define SL_ENTRY 4 -#define LBL_KEY 5 -#define DCB_KEY 6 -#define LBL_LEVEL 7 -#define SL_LEVEL 8 -#define FL_INDEX 10 -#define LBL_KEY2 11 -#define DCB_KEY2 12 -#define CB_APPLY_TO_ALL 13 -#define CB_MAIN_ENTRY 14 -#define FT_ENTRY 20 -#define ED_ENTRY 21 #define PB_OK 22 #define PB_CANCEL 23 #define PB_HELP 24 #define FL_ENTRIES 25 -#define PB_CREATEENTRY 26 -#define FL_ENTRY 27 -#define FT_TITLE 28 -#define FI_TITLE 29 -#define FT_AUTHOR 30 -#define FI_AUTHOR 31 -#define ST_CHANGE 32 -#define WIN_DLG 33 -#define BT_NEW 34 #define FL_NAME 37 #define FT_NAME 38 #define ED_NAME 39 -#define LB_ENTRY 40 -#define RB_FROMCOMPONENT 41 -#define RB_FROMDOCCONTENT 42 -#define PB_EDITENTRY 43 -#define CB_CASESENSITIVE 44 -#define CB_WORDONLY 45 -#define FT_PHONETIC_1 46 -#define FT_PHONETIC_2 47 -#define FT_PHONETIC_3 48 -#define ED_PHONETIC_1 48 -#define ED_PHONETIC_2 49 -#define ED_PHONETIC_3 50 - -//------------------------------------------------------ -// defines for positions and sizes for IDX_DIALOG_WINDOW - -#define IDX_COL1 12 -#define IDX_COL2 56 - -#define IDX_COL2_FULLEND 150 -#define IDX_NEWIMAGE_WIDTH 12 -#define IDX_NEWIMAGE_XPOS (IDX_COL2_FULLEND-1-IDX_NEWIMAGE_WIDTH) - -#define IDX_PHONETIC_EDIT_WIDTH 62 -#define IDX_PHONETIC_TEXT_WIDTH 62 - -#define IDX_COL_PHONETIC_TEXT (IDX_COL2+IDX_PHONETIC_EDIT_WIDTH+8) -#define IDX_COL_PHONETIC_EDIT (IDX_COL_PHONETIC_TEXT+IDX_PHONETIC_TEXT_WIDTH+1) - -#define IDX_COL_BUTTONS_NORMAL 162 -#define IDX_COL_BUTTONS_CJK (IDX_COL_PHONETIC_EDIT+IDX_PHONETIC_EDIT_WIDTH+14) - -#define IDX_WIN_WIDTH_NORMAL 218 -#define IDX_WIN_WIDTH_CJK (IDX_WIN_WIDTH_NORMAL+IDX_COL_BUTTONS_CJK-IDX_COL_BUTTONS_NORMAL) - -#define IDX_ROW_2_TEXT 31 -#define IDX_ROW_2_LIST (IDX_ROW_2_TEXT-2) -#define IDX_ROW_3_TEXT 46 -#define IDX_ROW_3_LIST (IDX_ROW_3_TEXT-2) -#define IDX_ROW_4_TEXT 62 -#define IDX_ROW_4_LIST (IDX_ROW_4_TEXT-2) - -//------------------------------------------------------ diff --git a/sw/source/ui/index/idxmrk.src b/sw/source/ui/index/idxmrk.src index 12577d50976f..e7add7c97aeb 100644 --- a/sw/source/ui/index/idxmrk.src +++ b/sw/source/ui/index/idxmrk.src @@ -31,357 +31,6 @@ #include "helpid.h" #include "cmdid.h" -#define IDX_PHONETIC_LISTBOX_DESCRIPTION \ -Text [ en-US ] = "Phonetic reading"; \ - -#define IDX_DIALOG_WINDOW \ - Window WIN_DLG \ - { \ - Pos = MAP_APPFONT ( 0 , 0 ) ; \ - Size = MAP_APPFONT ( IDX_WIN_WIDTH , WINDOW_HEIGHT ) ; \ - OKButton BT_OK \ - { \ - Pos = MAP_APPFONT ( COL_BUTTONS , 6 ) ; \ - Size = MAP_APPFONT ( 50 , RSC_CD_PUSHBUTTON_HEIGHT ) ; \ - TabStop = TRUE ; \ - DefButton = TRUE ; \ - Text [ en-US ] = "Insert";\ - }; \ - CancelButton BT_CANCEL \ - { \ - Pos = MAP_APPFONT ( COL_BUTTONS , 23 ) ; \ - Size = MAP_APPFONT ( 50 , RSC_CD_PUSHBUTTON_HEIGHT ) ; \ - Text [ en-US ] = "Close";\ - }; \ - HelpButton BT_HELP \ - { \ - Pos = MAP_APPFONT ( COL_BUTTONS , 43 ) ; \ - Size = MAP_APPFONT ( 50 , RSC_CD_PUSHBUTTON_HEIGHT ) ; \ - }; \ - PushButton BT_DEL \ - { \ - Pos = MAP_APPFONT ( COL_BUTTONS , 63 ) ; \ - Size = MAP_APPFONT ( 50 , RSC_CD_PUSHBUTTON_HEIGHT ) ; \ - Text [ en-US ] = "~Delete" ; \ - TabStop = TRUE ; \ - }; \ - ListBox DCB_INDEX \ - { \ - Pos = MAP_APPFONT ( IDX_COL2 , 14) ; \ - Size = MAP_APPFONT ( DCB_INDEX_WIDTH , 56 ) ; \ - TabStop = TRUE ; \ - DropDown = TRUE ; \ - }; \ - ImageButton BT_NEW \ - { \ - Pos = MAP_APPFONT ( IDX_NEWIMAGE_XPOS , 13 ) ; \ - Size = MAP_APPFONT ( IDX_NEWIMAGE_WIDTH , 15 ) ; \ - QuickHelpText [ en-US ] = "New User-defined Index";\ - }; \ - ImageButton BT_PREVSAME \ - { \ - Hide = TRUE ; \ - Pos = MAP_APPFONT ( COL_BUTTONS , 80 ) ; \ - Size = MAP_APPFONT ( 24 , 14 ) ; \ - TabStop = TRUE ; \ - SYMBOL = IMAGEBUTTON_FIRST ; \ - }; \ - ImageButton BT_PREV \ - { \ - Hide = TRUE ; \ - Pos = MAP_APPFONT ( COL_BUTTONS , 97 ) ; \ - Size = MAP_APPFONT ( 24 , 14 ) ; \ - TabStop = TRUE ; \ - SYMBOL = IMAGEBUTTON_PREV ; \ - }; \ - ImageButton BT_NXT \ - { \ - Hide = TRUE ; \ - Pos = MAP_APPFONT ( COL_BUTTONS_2 , 97 ) ; \ - Size = MAP_APPFONT ( 24 , 14 ) ; \ - TabStop = TRUE ; \ - SYMBOL = IMAGEBUTTON_NEXT ; \ - }; \ - ImageButton BT_NXTSAME \ - { \ - Hide = TRUE ; \ - Pos = MAP_APPFONT ( COL_BUTTONS_2 , 80 ) ; \ - Size = MAP_APPFONT ( 24 , 14 ) ; \ - TabStop = TRUE ; \ - SYMBOL = IMAGEBUTTON_LAST ; \ - }; \ - FixedLine FL_INDEX \ - { \ - Pos = MAP_APPFONT ( 6 , 3 ) ; \ - Size = MAP_APPFONT ( COL_BUTTONS-5-6 , RSC_CD_FIXEDLINE_HEIGHT ) ; \ - Text [ en-US ] = "Selection" ; \ - }; \ - FixedText LBL_INDEX \ - { \ - Pos = MAP_APPFONT ( IDX_COL1 , 16 ) ; \ - Size = MAP_APPFONT ( 40 , 10 ) ; \ - Text [ en-US ] = "~Index" ; \ - Left = TRUE ; \ - }; \ - Edit SL_ENTRY \ - { \ - Border = TRUE ; \ - Pos = MAP_APPFONT ( IDX_COL2 , IDX_ROW_2_LIST ) ; \ - Size = MAP_APPFONT ( LIST_WIDTH , 12 ) ; \ - TabStop = TRUE ; \ - Left = TRUE ; \ - }; \ - FixedText LBL_ENTRY \ - { \ - Pos = MAP_APPFONT ( IDX_COL1 , IDX_ROW_2_TEXT ) ; \ - Size = MAP_APPFONT ( 27 , RSC_CD_FIXEDTEXT_HEIGHT ) ; \ - Text [ en-US ] = "~Entry" ; \ - Left = TRUE ; \ - }; \ - FixedText LBL_KEY \ - { \ - Disable = TRUE ; \ - Pos = MAP_APPFONT ( IDX_COL1 , IDX_ROW_3_TEXT ) ; \ - Size = MAP_APPFONT ( 42 , RSC_CD_FIXEDTEXT_HEIGHT ) ; \ - Text [ en-US ] = "~1st key" ; \ - Left = TRUE ; \ - }; \ - ComboBox DCB_KEY \ - { \ - Disable = TRUE ; \ - Pos = MAP_APPFONT ( IDX_COL2 , IDX_ROW_3_LIST ) ; \ - Size = MAP_APPFONT ( LIST_WIDTH , 56 ) ; \ - TabStop = TRUE ; \ - DropDown = TRUE ; \ - }; \ - FixedText LBL_KEY2 \ - { \ - Disable = TRUE ; \ - Pos = MAP_APPFONT ( IDX_COL1 , IDX_ROW_4_TEXT ) ; \ - Size = MAP_APPFONT ( 42 , RSC_CD_FIXEDTEXT_HEIGHT ) ; \ - Text [ en-US ] = "~2nd key" ; \ - Left = TRUE ; \ - }; \ - ComboBox DCB_KEY2 \ - { \ - Disable = TRUE ; \ - Pos = MAP_APPFONT ( IDX_COL2 , IDX_ROW_4_LIST ) ; \ - Size = MAP_APPFONT ( LIST_WIDTH , 56 ) ; \ - TabStop = TRUE ; \ - DropDown = TRUE ; \ - }; \ - FixedText FT_PHONETIC_1 \ - { \ - Pos = MAP_APPFONT ( IDX_COL_PHONETIC_TEXT , IDX_ROW_2_TEXT ) ; \ - Size = MAP_APPFONT ( IDX_PHONETIC_TEXT_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT ) ; \ - Hide = PHONETIC_HIDDEN; \ - IDX_PHONETIC_LISTBOX_DESCRIPTION \ - }; \ - Edit ED_PHONETIC_1 \ - { \ - Border = TRUE ; \ - Pos = MAP_APPFONT ( IDX_COL_PHONETIC_EDIT , IDX_ROW_2_LIST ) ; \ - Size = MAP_APPFONT ( IDX_PHONETIC_EDIT_WIDTH , 12 ) ; \ - Hide = PHONETIC_HIDDEN; \ - TabStop = TRUE ; \ - Left = TRUE ; \ - }; \ - FixedText FT_PHONETIC_2 \ - { \ - Pos = MAP_APPFONT ( IDX_COL_PHONETIC_TEXT , IDX_ROW_3_TEXT ) ; \ - Size = MAP_APPFONT ( IDX_PHONETIC_TEXT_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT ) ; \ - Hide = PHONETIC_HIDDEN; \ - IDX_PHONETIC_LISTBOX_DESCRIPTION \ - }; \ - Edit ED_PHONETIC_2 \ - { \ - Border = TRUE ; \ - Pos = MAP_APPFONT ( IDX_COL_PHONETIC_EDIT , IDX_ROW_3_LIST ) ; \ - Size = MAP_APPFONT ( IDX_PHONETIC_EDIT_WIDTH , 12 ) ; \ - Hide = PHONETIC_HIDDEN; \ - TabStop = TRUE ; \ - Left = TRUE ; \ - }; \ - FixedText FT_PHONETIC_3 \ - { \ - Pos = MAP_APPFONT ( IDX_COL_PHONETIC_TEXT , IDX_ROW_4_TEXT ) ; \ - Size = MAP_APPFONT ( IDX_PHONETIC_TEXT_WIDTH , RSC_CD_FIXEDTEXT_HEIGHT ) ; \ - Hide = PHONETIC_HIDDEN; \ - IDX_PHONETIC_LISTBOX_DESCRIPTION \ - }; \ - Edit ED_PHONETIC_3 \ - { \ - Border = TRUE ; \ - Pos = MAP_APPFONT ( IDX_COL_PHONETIC_EDIT , IDX_ROW_4_LIST ) ; \ - Size = MAP_APPFONT ( IDX_PHONETIC_EDIT_WIDTH , 12 ) ; \ - Hide = PHONETIC_HIDDEN; \ - TabStop = TRUE ; \ - Left = TRUE ; \ - }; \ - FixedText LBL_LEVEL \ - { \ - Pos = MAP_APPFONT ( IDX_COL1 , 76 ) ; \ - Size = MAP_APPFONT ( 41 , RSC_CD_FIXEDTEXT_HEIGHT ) ; \ - Text [ en-US ] = "~Level" ; \ - Left = TRUE ; \ - }; \ - NumericField SL_LEVEL \ - { \ - Border = TRUE ; \ - Pos = MAP_APPFONT ( IDX_COL2 , 74 ) ; \ - Size = MAP_APPFONT ( 18 , 12 ) ; \ - TabStop = TRUE ; \ - Left = TRUE ; \ - Repeat = TRUE ; \ - Spin = TRUE ; \ - Minimum = 1 ; \ - Maximum = 10 ; \ - Value = 1 ; \ - Last = 10 ; \ - SpinSize = 1 ; \ - }; \ - CheckBox CB_MAIN_ENTRY \ - { \ - Pos = MAP_APPFONT ( IDX_COL1 , 76 ) ; \ - Size = MAP_APPFONT ( 100 , 8 ) ; \ - Text [ en-US ] = "~Main entry";\ - }; \ - CheckBox CB_APPLY_TO_ALL \ - { \ - Pos = MAP_APPFONT ( IDX_COL1 , 90 ) ; \ - Size = MAP_APPFONT ( 140 , 12 ) ; \ - Hide = TRUE; \ - Text [ en-US ] = "~Apply to all similar texts"; \ - }; \ - CheckBox CB_CASESENSITIVE \ - { \ - Pos = MAP_APPFONT ( 21 , 104 ) ; \ - Size = MAP_APPFONT ( 131 , 12 ) ; \ - Hide = TRUE;\ - Text [ en-US ] = "Ma~tch case";\ - }; \ - CheckBox CB_WORDONLY \ - { \ - Pos = MAP_APPFONT ( 21 , 118 ) ; \ - Size = MAP_APPFONT ( 131 , 12 ) ; \ - Hide = TRUE;\ - Text [ en-US ] = "~Whole words only";\ - }; \ - }; - -ModalDialog DLG_EDIT_IDXMARK -{ - OutputSize = TRUE ; - Moveable = TRUE ; - Closeable = TRUE; - Sizeable = FALSE ; - HelpId = CMD_FN_EDIT_IDX_ENTRY_DLG; - SVLook = TRUE ; - #define IDX_WIN_WIDTH IDX_WIN_WIDTH_NORMAL - Size = MAP_APPFONT ( IDX_WIN_WIDTH , 118 ) ; - #define GB_HEIGHT 109 - #define DCB_INDEX_WIDTH 94 - #define PHONETIC_HIDDEN TRUE - #define LIST_WIDTH 94 - #define COL_BUTTONS IDX_COL_BUTTONS_NORMAL - #define COL_BUTTONS_2 (COL_BUTTONS+26) - #define WINDOW_HEIGHT 118 - IDX_DIALOG_WINDOW - #undef IDX_WIN_WIDTH - #undef GB_HEIGHT - #undef DCB_INDEX_WIDTH - #undef PHONETIC_HIDDEN - #undef LIST_WIDTH - #undef COL_BUTTONS - #undef COL_BUTTONS_2 - #undef WINDOW_HEIGHT -}; -ModalDialog DLG_EDIT_IDXMARK_CJK -{ - OutputSize = TRUE ; - Moveable = TRUE ; - Closeable = TRUE; - Sizeable = FALSE ; - HelpId = CMD_FN_EDIT_IDX_ENTRY_DLG; - SVLook = TRUE ; - #define IDX_WIN_WIDTH IDX_WIN_WIDTH_CJK - Size = MAP_APPFONT ( IDX_WIN_WIDTH , 118 ) ; - #define GB_HEIGHT 109 - #define DCB_INDEX_WIDTH 94 - #define PHONETIC_HIDDEN FALSE - #define LIST_WIDTH IDX_PHONETIC_EDIT_WIDTH - #define COL_BUTTONS IDX_COL_BUTTONS_CJK - #define COL_BUTTONS_2 (COL_BUTTONS+26) - #define WINDOW_HEIGHT 118 - IDX_DIALOG_WINDOW - #undef IDX_WIN_WIDTH - #undef GB_HEIGHT - #undef DCB_INDEX_WIDTH - #undef PHONETIC_HIDDEN - #undef LIST_WIDTH - #undef COL_BUTTONS - #undef COL_BUTTONS_2 - #undef WINDOW_HEIGHT -}; -ModelessDialog DLG_INSIDXMARK -{ - OutputSize = TRUE ; - Moveable = TRUE ; - Closeable = TRUE; - Sizeable = FALSE ; - Hide = TRUE ; -// Zoomable = TRUE ; - HelpId = CMD_FN_INSERT_IDX_ENTRY_DLG; - SVLook = TRUE ; - #define IDX_WIN_WIDTH IDX_WIN_WIDTH_NORMAL - Size = MAP_APPFONT ( IDX_WIN_WIDTH , 138) ; -// Moveable = TRUE ; - #define GB_HEIGHT 129 - #define DCB_INDEX_WIDTH 79 - #define PHONETIC_HIDDEN TRUE - #define LIST_WIDTH 94 - #define COL_BUTTONS IDX_COL_BUTTONS_NORMAL - #define COL_BUTTONS_2 (COL_BUTTONS+26) - #define WINDOW_HEIGHT 138 - IDX_DIALOG_WINDOW - #undef IDX_WIN_WIDTH - #undef GB_HEIGHT - #undef DCB_INDEX_WIDTH - #undef PHONETIC_HIDDEN - #undef LIST_WIDTH - #undef COL_BUTTONS - #undef COL_BUTTONS_2 - #undef WINDOW_HEIGHT -}; -ModelessDialog DLG_INSIDXMARK_CJK -{ - OutputSize = TRUE ; - Moveable = TRUE ; - Closeable = TRUE; - Sizeable = FALSE ; -// Zoomable = TRUE ; - HelpId = CMD_FN_INSERT_IDX_ENTRY_DLG; - SVLook = TRUE ; - #define IDX_WIN_WIDTH IDX_WIN_WIDTH_CJK - Size = MAP_APPFONT ( IDX_WIN_WIDTH , 138) ; -// Moveable = TRUE ; - #define GB_HEIGHT 129 - #define DCB_INDEX_WIDTH 79 - #define PHONETIC_HIDDEN FALSE - #define LIST_WIDTH IDX_PHONETIC_EDIT_WIDTH - #define COL_BUTTONS IDX_COL_BUTTONS_CJK - #define COL_BUTTONS_2 (COL_BUTTONS+26) - #define WINDOW_HEIGHT 138 - IDX_DIALOG_WINDOW - #undef IDX_WIN_WIDTH - #undef GB_HEIGHT - #undef DCB_INDEX_WIDTH - #undef PHONETIC_HIDDEN - #undef LIST_WIDTH - #undef COL_BUTTONS - #undef COL_BUTTONS_2 - #undef WINDOW_HEIGHT -}; ModalDialog DLG_NEW_USER_IDX { OutputSize = TRUE ; @@ -438,145 +87,12 @@ String STR_IDXMRK_EDIT { Text [ en-US ] = "Edit Index Entry" ; }; + String STR_IDXMRK_INSERT { Text [ en-US ] = "Insert Index Entry" ; }; -#define AUTH_DIALOG_WINDOW \ - Window WIN_DLG \ - { \ - Pos = MAP_APPFONT ( 0 , 0 ) ; \ - Size = MAP_APPFONT ( 218 , 118 + RADIO_BUTTON_HEIGHT) ; \ - RadioButton RB_FROMCOMPONENT \ - { \ - Pos = MAP_APPFONT ( 12 , 14 ) ; \ - Size = MAP_APPFONT ( 147 , 12 ) ; \ - Text [ en-US ] = "From bibliography ~database";\ - }; \ - RadioButton RB_FROMDOCCONTENT \ - { \ - Pos = MAP_APPFONT ( 12, 29 ) ; \ - Size = MAP_APPFONT ( 147 , 12 ) ; \ - Text [ en-US ] = "~From document content";\ - }; \ - FixedText FT_AUTHOR \ - { \ - Pos = MAP_APPFONT ( 12 , 14 + RADIO_BUTTON_HEIGHT) ; \ - Size = MAP_APPFONT ( 60 , 8 ) ; \ - Text [ en-US ] = "Author";\ - }; \ - FixedText FI_AUTHOR \ - { \ - Pos = MAP_APPFONT ( 12 , 25 + RADIO_BUTTON_HEIGHT) ; \ - Size = MAP_APPFONT ( 140, 8 ) ; \ - WordBreak = TRUE; \ - }; \ - FixedText FT_TITLE \ - { \ - Pos = MAP_APPFONT ( 12 , 37 + RADIO_BUTTON_HEIGHT) ; \ - Size = MAP_APPFONT ( 60 , 8 ) ; \ - Text [ en-US ] = "Title";\ - }; \ - FixedText FI_TITLE \ - { \ - Pos = MAP_APPFONT ( 12 , 48 + RADIO_BUTTON_HEIGHT) ; \ - Size = MAP_APPFONT ( 140, 8 ) ; \ - WordBreak = TRUE; \ - }; \ - FixedText FT_ENTRY \ - { \ - Pos = MAP_APPFONT ( 12 , 62 + RADIO_BUTTON_HEIGHT) ; \ - Size = MAP_APPFONT ( 60 , 8 ) ; \ - Text [ en-US ] = "Short ~name";\ - }; \ - Edit ED_ENTRY \ - { \ - Border = TRUE ; \ - Pos = MAP_APPFONT ( 12 , 73 + RADIO_BUTTON_HEIGHT) ; \ - Size = MAP_APPFONT ( 140 , 12 ) ; \ - TabStop = TRUE ; \ - Left = TRUE ; \ - }; \ - ListBox LB_ENTRY \ - { \ - Border = TRUE ; \ - Pos = MAP_APPFONT ( 12 , 73 + RADIO_BUTTON_HEIGHT) ; \ - Size = MAP_APPFONT ( 140 , 50 ) ; \ - TabStop = TRUE ; \ - DropDown = TRUE ; \ - }; \ - FixedLine FL_ENTRY \ - { \ - Pos = MAP_APPFONT ( 6 , 3 ) ; \ - Size = MAP_APPFONT ( 146 , 8 ) ; \ - Text [ en-US ] = "Entry";\ - }; \ - OKButton PB_OK \ - { \ - Pos = MAP_APPFONT ( 162 , 6 ) ; \ - Size = MAP_APPFONT ( 50 , 14 ) ; \ - TabStop = TRUE ; \ - DefButton = TRUE ; \ - Text [ en-US ] = "Insert";\ - }; \ - CancelButton PB_CANCEL \ - { \ - Pos = MAP_APPFONT ( 162 , 23 ) ; \ - Size = MAP_APPFONT ( 50 , 14 ) ; \ - Text [ en-US ] = "Close";\ - }; \ - HelpButton PB_HELP \ - { \ - Pos = MAP_APPFONT ( 162 , 43 ) ; \ - Size = MAP_APPFONT ( 50 , 14 ) ; \ - }; \ - PushButton PB_CREATEENTRY \ - { \ - Pos = MAP_APPFONT ( 162 , 60 ) ; \ - Size = MAP_APPFONT ( 50 , 14 ) ; \ - Text [ en-US ] = "~New";\ - }; \ - PushButton PB_EDITENTRY \ - { \ - Pos = MAP_APPFONT ( 162 , 77 ) ; \ - Size = MAP_APPFONT ( 50 , 14 ) ; \ - Text [ en-US ] = "Edit";\ - }; \ - String ST_CHANGE \ - { \ - Text [ en-US ] = "Modify";\ - }; \ - }; - -ModalDialog DLG_EDIT_AUTHMARK -{ - OutputSize = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - Sizeable = FALSE ; - HelpId = CMD_FN_EDIT_AUTH_ENTRY_DLG; - SVLook = TRUE ; - Size = MAP_APPFONT ( 218 , 118 ) ; - #define RADIO_BUTTON_HEIGHT 0 - AUTH_DIALOG_WINDOW - #undef RADIO_BUTTON_HEIGHT -}; -ModelessDialog DLG_INSAUTHMARK -{ - OutputSize = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - Sizeable = FALSE ; -// Zoomable = TRUE ; - HelpId = CMD_FN_INSERT_AUTH_ENTRY_DLG; - SVLook = TRUE ; - #define RADIO_BUTTON_HEIGHT 30 - Size = MAP_APPFONT ( 218 , 118 + RADIO_BUTTON_HEIGHT) ; -// Moveable = TRUE ; - AUTH_DIALOG_WINDOW - #undef RADIO_BUTTON_HEIGHT -}; ModalDialog DLG_CREATE_AUTH_ENTRY { HelpId = HID_DLG_CREATE_AUTH_ENTRY; @@ -609,16 +125,7 @@ ModalDialog DLG_CREATE_AUTH_ENTRY }; Text [ en-US ] = "Define Bibliography Entry"; }; -String STR_AUTHMRK_EDIT -{ - - Text [ en-US ] = "Edit Bibliography Entry"; -}; -String STR_AUTHMRK_INSERT -{ - Text [ en-US ] = "Insert Bibliography Entry"; -}; QueryBox DLG_CHANGE_AUTH_ENTRY { BUTTONS = WB_YES_NO ; diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 92f3a8b71694..b754eac9d5d4 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -53,6 +53,7 @@ #include <multmrk.hxx> #include <swundo.hxx> // for Undo-Ids #include <cmdid.h> +#include <app.hrc> #include <index.hrc> #include <idxmrk.hrc> #include <swmodule.hxx> @@ -89,66 +90,50 @@ using namespace ::com::sun::star; /*-------------------------------------------------------------------- Description: dialog to insert a directory selection --------------------------------------------------------------------*/ -SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent, - sal_Bool bNewDlg, - const ResId& rResId, - sal_Int32 _nOptionsId, SwWrtShell& rWrtShell ) : - Window(pParent, rResId), - aIndexFL(this, SW_RES(FL_INDEX )), - aTypeFT (this, SW_RES(LBL_INDEX )), - aTypeDCB(this, SW_RES(DCB_INDEX )), - aNewBT(this, SW_RES(BT_NEW )), - - aEntryFT(this, SW_RES(LBL_ENTRY )), - aEntryED(this, SW_RES(SL_ENTRY )), - aPhoneticFT0(this, SW_RES(FT_PHONETIC_1 )), - aPhoneticED0(this, SW_RES(ED_PHONETIC_1 )), - - aKeyFT(this, SW_RES(LBL_KEY )), - aKeyDCB(this, SW_RES(DCB_KEY )), - aPhoneticFT1(this, SW_RES(FT_PHONETIC_2 )), - aPhoneticED1(this, SW_RES(ED_PHONETIC_2 )), - - aKey2FT(this, SW_RES(LBL_KEY2 )), - aKey2DCB(this, SW_RES(DCB_KEY2 )), - aPhoneticFT2(this, SW_RES(FT_PHONETIC_3 )), - aPhoneticED2(this, SW_RES(ED_PHONETIC_3 )), - - aLevelFT(this, SW_RES(LBL_LEVEL )), - aLevelED(this, SW_RES(SL_LEVEL )), - aMainEntryCB(this, SW_RES(CB_MAIN_ENTRY )), - aApplyToAllCB(this,SW_RES(CB_APPLY_TO_ALL)), - aSearchCaseSensitiveCB(this, SW_RES(CB_CASESENSITIVE )), - aSearchCaseWordOnlyCB(this, SW_RES(CB_WORDONLY )), - - - aOKBT(this, SW_RES(BT_OK )), - aCancelBT(this, SW_RES(BT_CANCEL )), - aHelpBT(this, SW_RES(BT_HELP )), - aDelBT(this, SW_RES(BT_DEL )), - - aPrevSameBT(this,SW_RES(BT_PREVSAME)), - aNextSameBT(this,SW_RES(BT_NXTSAME)), - aPrevBT(this, SW_RES(BT_PREV )), - aNextBT(this, SW_RES(BT_NXT )), - - nOptionsId( _nOptionsId ), - bDel(sal_False), - bNewMark(bNewDlg), - bSelected(sal_False), - - bPhoneticED0_ChangedByUser(sal_False), - bPhoneticED1_ChangedByUser(sal_False), - bPhoneticED2_ChangedByUser(sal_False), - nLangForPhoneticReading(2052), - bIsPhoneticReadingEnabled(sal_False), - xExtendedIndexEntrySupplier(NULL), - pTOXMgr(0), - pSh(&rWrtShell) +SwIndexMarkPane::SwIndexMarkPane(Dialog &rDialog, sal_Bool bNewDlg, + SwWrtShell& rWrtShell) + : m_rDialog(rDialog) + , bNewMark(bNewDlg) + , bSelected(sal_False) + , bPhoneticED0_ChangedByUser(sal_False) + , bPhoneticED1_ChangedByUser(sal_False) + , bPhoneticED2_ChangedByUser(sal_False) + , nLangForPhoneticReading(LANGUAGE_CHINESE_SIMPLIFIED) + , bIsPhoneticReadingEnabled(sal_False) + , xExtendedIndexEntrySupplier(NULL) + , pTOXMgr(0) + , pSh(&rWrtShell) { - aNewBT.SetAccessibleRelationMemberOf(&aIndexFL); - - if( SvtCJKOptions().IsCJKFontEnabled() ) + rDialog.get(m_pFrame, "frame"); + rDialog.get(m_pTypeFT, "typeft"); + rDialog.get(m_pTypeDCB, "typecb"); + rDialog.get(m_pNewBT, "new"); + m_pNewBT->SetAccessibleRelationMemberOf(m_pFrame->get_label_widget()); + rDialog.get(m_pEntryED, "entryed"); + rDialog.get(m_pPhoneticFT0, "phonetic0ft"); + rDialog.get(m_pPhoneticED0, "phonetic0ed"); + rDialog.get(m_pKey1FT, "key1ft"); + rDialog.get(m_pKey1DCB, "key1cb"); + rDialog.get(m_pPhoneticFT1, "phonetic1ft"); + rDialog.get(m_pPhoneticED1, "phonetic1ed"); + rDialog.get(m_pKey2FT, "key2ft"); + rDialog.get(m_pKey2DCB, "key2cb"); + rDialog.get(m_pPhoneticFT2, "phonetic2ft"); + rDialog.get(m_pPhoneticED2, "phonetic2ed"); + rDialog.get(m_pLevelFT, "levelft"); + rDialog.get(m_pLevelNF, "levelnf"); + rDialog.get(m_pMainEntryCB, "mainentrycb"); + rDialog.get(m_pApplyToAllCB, "applytoallcb"); + rDialog.get(m_pSearchCaseSensitiveCB, "searchcasesensitivecb"); + rDialog.get(m_pSearchCaseWordOnlyCB, "searchcasewordonlycb"); + rDialog.get(m_pCloseBT, "close"); + rDialog.get(m_pDelBT, "delete"); + rDialog.get(m_pPrevSameBT, "first"); + rDialog.get(m_pNextSameBT, "last"); + rDialog.get(m_pPrevBT, "previous"); + rDialog.get(m_pNextBT, "next"); + + if (SvtCJKOptions().IsCJKFontEnabled()) { uno::Reference< lang::XMultiServiceFactory > xMSF = getProcessServiceFactory(); @@ -156,106 +141,87 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent, uno::Reference< i18n::XExtendedIndexEntrySupplier > ( xMSF->createInstance( C2U("com.sun.star.i18n.IndexEntrySupplier") ), uno::UNO_QUERY ); + + m_pPhoneticFT0->Show(); + m_pPhoneticED0->Show(); + m_pPhoneticFT1->Show(); + m_pPhoneticED1->Show(); + m_pPhoneticFT2->Show(); + m_pPhoneticED2->Show(); } - SetStyle(GetStyle()|WB_DIALOGCONTROL); - FreeResource(); - aOKBT .SetHelpId(HID_INSERT_IDX_MRK_OK ); - aCancelBT .SetHelpId(HID_INSERT_IDX_MRK_CLOSE ); - aDelBT .SetHelpId(HID_INSERT_IDX_MRK_DELETE ); - aNewBT .SetHelpId(HID_INSERT_IDX_MRK_NEW ); - aPrevBT .SetHelpId(HID_INSERT_IDX_MRK_PREV ); - aPrevSameBT .SetHelpId(HID_INSERT_IDX_MRK_PREV_SAME ); - aNextBT .SetHelpId(HID_INSERT_IDX_MRK_NEXT ); - aNextSameBT .SetHelpId(HID_INSERT_IDX_MRK_NEXT_SAME ); - aTypeDCB .SetHelpId(HID_INSERT_IDX_MRK_TYPE ); - aEntryED .SetHelpId(HID_INSERT_IDX_MRK_ENTRY ); - aKeyDCB .SetHelpId(HID_INSERT_IDX_MRK_PRIM_KEY ); - aKey2DCB .SetHelpId(HID_INSERT_IDX_MRK_SEC_KEY ); - aLevelED .SetHelpId(HID_INSERT_IDX_MRK_LEVEL ); - aMainEntryCB .SetHelpId(HID_INSERT_IDX_MRK_MAIN_ENTRY); - aApplyToAllCB .SetHelpId(HID_INSERT_IDX_MRK_APPLY_ALL ); - aPhoneticED0 .SetHelpId(HID_INSERT_IDX_MRK_PHONETIC_READING ); - aPhoneticED1 .SetHelpId(HID_INSERT_IDX_MRK_PHONETIC_READING ); - aPhoneticED2 .SetHelpId(HID_INSERT_IDX_MRK_PHONETIC_READING ); - - aSearchCaseSensitiveCB.SetHelpId( HID_INSERT_IDX_MRK_SRCH_CASESENSITIVE ); - aSearchCaseWordOnlyCB.SetHelpId( HID_INSERT_IDX_MRK_SRCH_WORDONLY ); - - - GetParent()->SetText( SW_RESSTR( bNewMark ? STR_IDXMRK_INSERT : STR_IDXMRK_EDIT)); - - aDelBT.SetClickHdl(LINK(this,SwIndexMarkDlg, DelHdl)); - aPrevBT.SetClickHdl(LINK(this,SwIndexMarkDlg, PrevHdl)); - aPrevSameBT.SetClickHdl(LINK(this,SwIndexMarkDlg, PrevSameHdl)); - aNextBT.SetClickHdl(LINK(this,SwIndexMarkDlg, NextHdl)); - aNextSameBT.SetClickHdl(LINK(this,SwIndexMarkDlg, NextSameHdl)); - aTypeDCB.SetSelectHdl(LINK(this,SwIndexMarkDlg, ModifyHdl)); - aKeyDCB.SetModifyHdl(LINK(this,SwIndexMarkDlg, KeyDCBModifyHdl)); - aKey2DCB.SetModifyHdl(LINK(this,SwIndexMarkDlg, KeyDCBModifyHdl)); - aOKBT.SetClickHdl(LINK(this,SwIndexMarkDlg, InsertHdl)); - aCancelBT.SetClickHdl(LINK(this,SwIndexMarkDlg, CloseHdl)); - aEntryED.SetModifyHdl(LINK(this,SwIndexMarkDlg, ModifyHdl)); - aNewBT.SetClickHdl(LINK(this, SwIndexMarkDlg, NewUserIdxHdl)); - aApplyToAllCB.SetClickHdl(LINK(this, SwIndexMarkDlg, SearchTypeHdl)); - aPhoneticED0.SetModifyHdl(LINK(this,SwIndexMarkDlg, PhoneticEDModifyHdl)); - aPhoneticED1.SetModifyHdl(LINK(this,SwIndexMarkDlg, PhoneticEDModifyHdl)); - aPhoneticED2.SetModifyHdl(LINK(this,SwIndexMarkDlg, PhoneticEDModifyHdl)); + rDialog.SetText( SW_RESSTR( bNewMark ? STR_IDXMRK_INSERT : STR_IDXMRK_EDIT)); + + m_pDelBT->SetClickHdl(LINK(this,SwIndexMarkPane, DelHdl)); + m_pPrevBT->SetClickHdl(LINK(this,SwIndexMarkPane, PrevHdl)); + m_pPrevSameBT->SetClickHdl(LINK(this,SwIndexMarkPane, PrevSameHdl)); + m_pNextBT->SetClickHdl(LINK(this,SwIndexMarkPane, NextHdl)); + m_pNextSameBT->SetClickHdl(LINK(this,SwIndexMarkPane, NextSameHdl)); + m_pTypeDCB->SetSelectHdl(LINK(this,SwIndexMarkPane, ModifyHdl)); + m_pKey1DCB->SetModifyHdl(LINK(this,SwIndexMarkPane, KeyDCBModifyHdl)); + m_pKey2DCB->SetModifyHdl(LINK(this,SwIndexMarkPane, KeyDCBModifyHdl)); + m_pCloseBT->SetClickHdl(LINK(this,SwIndexMarkPane, CloseHdl)); + m_pEntryED->SetModifyHdl(LINK(this,SwIndexMarkPane, ModifyHdl)); + m_pNewBT->SetClickHdl(LINK(this, SwIndexMarkPane, NewUserIdxHdl)); + m_pApplyToAllCB->SetClickHdl(LINK(this, SwIndexMarkPane, SearchTypeHdl)); + m_pPhoneticED0->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl)); + m_pPhoneticED1->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl)); + m_pPhoneticED2->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl)); if(bNewMark) { - aDelBT.Hide(); - ImageList aTempList( SW_RES( IMG_NAVI_ENTRYBMP ) ); - aNewBT.SetModeImage( aTempList.GetImage( SID_SW_START + CONTENT_TYPE_INDEX ) ); + m_pDelBT->Hide(); + rDialog.get(m_pOKBT, "insert"); } else { - aNewBT.Hide(); - OKButton aTmp(this, WB_HIDE); - aOKBT.SetText( aTmp.GetText() ); + m_pNewBT->Hide(); + rDialog.get(m_pOKBT, "ok"); } + m_pOKBT->Show(); + m_pOKBT->SetClickHdl(LINK(this, SwIndexMarkPane, InsertHdl)); - aEntryED.GrabFocus(); + m_pEntryED->GrabFocus(); } /*-------------------------------------------------------------------- Description: Newly initialise controls with the new selection --------------------------------------------------------------------*/ -void SwIndexMarkDlg::InitControls() +void SwIndexMarkPane::InitControls() { OSL_ENSURE(pSh && pTOXMgr, "no shell?"); // contents index const SwTOXType* pType = pTOXMgr->GetTOXType(TOX_CONTENT, 0); OSL_ENSURE(pType, "Kein Verzeichnistyp !!"); String sTmpTypeSelection; - if(aTypeDCB.GetSelectEntryCount()) - sTmpTypeSelection = aTypeDCB.GetSelectEntry(); - aTypeDCB.Clear(); - aTypeDCB.InsertEntry(pType->GetTypeName()); + if(m_pTypeDCB->GetSelectEntryCount()) + sTmpTypeSelection = m_pTypeDCB->GetSelectEntry(); + m_pTypeDCB->Clear(); + m_pTypeDCB->InsertEntry(pType->GetTypeName()); // keyword index pType = pTOXMgr->GetTOXType(TOX_INDEX, 0); OSL_ENSURE(pType, "Kein Verzeichnistyp !!"); - aTypeDCB.InsertEntry(pType->GetTypeName()); + m_pTypeDCB->InsertEntry(pType->GetTypeName()); // user index sal_uInt16 nCount = pSh->GetTOXTypeCount(TOX_USER); sal_uInt16 i; for( i = 0; i < nCount; ++i ) - aTypeDCB.InsertEntry( pSh->GetTOXType(TOX_USER, i)->GetTypeName() ); + m_pTypeDCB->InsertEntry( pSh->GetTOXType(TOX_USER, i)->GetTypeName() ); // read keywords primary std::vector<String> aArr; nCount = pSh->GetTOIKeys( TOI_PRIMARY, aArr ); std::sort(aArr.begin(), aArr.end()); for (std::vector<String>::iterator it = aArr.begin(); it != aArr.end(); ++it) - aKeyDCB.InsertEntry( *it ); + m_pKey1DCB->InsertEntry( *it ); // read keywords secondary nCount = pSh->GetTOIKeys( TOI_SECONDARY, aArr ); std::sort(aArr.begin(), aArr.end()); for (std::vector<String>::iterator it = aArr.begin(); it != aArr.end(); ++it) - aKey2DCB.InsertEntry( *it ); + m_pKey2DCB->InsertEntry( *it ); UpdateLanguageDependenciesForPhoneticReading(); @@ -275,37 +241,37 @@ void SwIndexMarkDlg::InitControls() pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_PRV ); if( pMoveMark != pMark ) pSh->GotoTOXMark( *pMoveMark, TOX_NXT ), bShow = sal_True; - aPrevBT.Enable( pMoveMark != pMark ); + m_pPrevBT->Enable( pMoveMark != pMark ); pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_NXT ); if( pMoveMark != pMark ) pSh->GotoTOXMark( *pMoveMark, TOX_PRV ), bShow = sal_True; - aNextBT.Enable( pMoveMark != pMark ); + m_pNextBT->Enable( pMoveMark != pMark ); if( bShow ) { - aPrevBT.Show(); - aNextBT.Show(); + m_pPrevBT->Show(); + m_pNextBT->Show(); bShow = sal_False; } pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_PRV ); if( pMoveMark != pMark ) pSh->GotoTOXMark( *pMoveMark, TOX_SAME_NXT ), bShow = sal_True; - aPrevSameBT.Enable( pMoveMark != pMark ); + m_pPrevSameBT->Enable( pMoveMark != pMark ); pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_NXT ); if( pMoveMark != pMark ) pSh->GotoTOXMark( *pMoveMark, TOX_SAME_PRV ), bShow = sal_True; - aNextSameBT.Enable( pMoveMark != pMark ); + m_pNextSameBT->Enable( pMoveMark != pMark ); if( bShow ) { - aNextSameBT.Show(); - aPrevSameBT.Show(); + m_pNextSameBT->Show(); + m_pPrevSameBT->Show(); } pSh->EndCrsrMove(); - aTypeFT.Show(); + m_pTypeFT->Show(); - aTypeDCB.Enable(sal_False); - aTypeFT.Enable(sal_False); + m_pTypeDCB->Enable(sal_False); + m_pTypeFT->Enable(sal_False); UpdateDialog(); } @@ -316,30 +282,30 @@ void SwIndexMarkDlg::InitControls() { bSelected = !pSh->HasSelection(); aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False); - aEntryED.SetText(aOrgStr); + m_pEntryED->SetText(aOrgStr); //to include all equal entries may only be allowed in the body and even there //only when a simple selection exists const sal_uInt16 nFrmType = pSh->GetFrmType(0,sal_True); - aApplyToAllCB.Show(); - aSearchCaseSensitiveCB.Show(); - aSearchCaseWordOnlyCB.Show(); - aApplyToAllCB.Enable(0 != aOrgStr.Len() && + m_pApplyToAllCB->Show(); + m_pSearchCaseSensitiveCB->Show(); + m_pSearchCaseWordOnlyCB->Show(); + m_pApplyToAllCB->Enable(0 != aOrgStr.Len() && 0 == (nFrmType & ( FRMTYPE_HEADER | FRMTYPE_FOOTER | FRMTYPE_FLY_ANY ))); - SearchTypeHdl(&aApplyToAllCB); + SearchTypeHdl(m_pApplyToAllCB); } // index type is default if( sTmpTypeSelection.Len() && - LISTBOX_ENTRY_NOTFOUND != aTypeDCB.GetEntryPos( sTmpTypeSelection ) ) - aTypeDCB.SelectEntry(sTmpTypeSelection); + LISTBOX_ENTRY_NOTFOUND != m_pTypeDCB->GetEntryPos( sTmpTypeSelection ) ) + m_pTypeDCB->SelectEntry(sTmpTypeSelection); else - aTypeDCB.SelectEntry(aTypeDCB.GetEntry(nTypePos)); - ModifyHdl(&aTypeDCB); + m_pTypeDCB->SelectEntry(m_pTypeDCB->GetEntry(nTypePos)); + ModifyHdl(m_pTypeDCB); } } -void SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading() +void SwIndexMarkPane::UpdateLanguageDependenciesForPhoneticReading() { //no phonetic reading if no global cjk support if( !xExtendedIndexEntrySupplier.is() ) @@ -387,7 +353,7 @@ void SwIndexMarkDlg::UpdateLanguageDependenciesForPhoneticReading() } -String SwIndexMarkDlg::GetDefaultPhoneticReading( const String& rText ) +String SwIndexMarkPane::GetDefaultPhoneticReading( const String& rText ) { if( !bIsPhoneticReadingEnabled ) return aEmptyStr; @@ -397,9 +363,9 @@ String SwIndexMarkDlg::GetDefaultPhoneticReading( const String& rText ) } /* -------------------------------------------------- - Change the content of aEntryED if text is selected + Change the content of m_pEntryED if text is selected --------------------------------------------------*/ -void SwIndexMarkDlg::Activate() +void SwIndexMarkPane::Activate() { // display current selection (first element) ???? if(bNewMark) @@ -409,26 +375,26 @@ void SwIndexMarkDlg::Activate() { bSelected = !pSh->HasSelection(); aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False); - aEntryED.SetText(aOrgStr); + m_pEntryED->SetText(aOrgStr); //to include all equal entries may only be allowed in the body and even there //only when a simple selection exists const sal_uInt16 nFrmType = pSh->GetFrmType(0,sal_True); - aApplyToAllCB.Show(); - aSearchCaseSensitiveCB.Show(); - aSearchCaseWordOnlyCB.Show(); - aApplyToAllCB.Enable(0 != aOrgStr.Len() && + m_pApplyToAllCB->Show(); + m_pSearchCaseSensitiveCB->Show(); + m_pSearchCaseWordOnlyCB->Show(); + m_pApplyToAllCB->Enable(0 != aOrgStr.Len() && 0 == (nFrmType & ( FRMTYPE_HEADER | FRMTYPE_FOOTER | FRMTYPE_FLY_ANY ))); - SearchTypeHdl(&aApplyToAllCB); + SearchTypeHdl(m_pApplyToAllCB); } - ModifyHdl(&aTypeDCB); + ModifyHdl(m_pTypeDCB); } } /*-------------------------------------------------------------------- Description: evaluate Ok-Button --------------------------------------------------------------------*/ -void SwIndexMarkDlg::Apply() +void SwIndexMarkPane::Apply() { InsertUpdate(); if(bSelected) @@ -438,7 +404,7 @@ void SwIndexMarkDlg::Apply() /*-------------------------------------------------------------------- Description: apply changes --------------------------------------------------------------------*/ -void SwIndexMarkDlg::InsertUpdate() +void SwIndexMarkPane::InsertUpdate() { pSh->StartUndo(bDel ? UNDO_INDEX_ENTRY_DELETE : UNDO_INDEX_ENTRY_INSERT); pSh->StartAllAction(); @@ -467,11 +433,11 @@ void SwIndexMarkDlg::InsertUpdate() pSh->EndAllAction(); pSh->EndUndo(bDel ? UNDO_INDEX_ENTRY_DELETE : UNDO_INDEX_ENTRY_INSERT); - if((nTypePos = aTypeDCB.GetEntryPos(aTypeDCB.GetSelectEntry())) == LISTBOX_ENTRY_NOTFOUND) + if((nTypePos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry())) == LISTBOX_ENTRY_NOTFOUND) nTypePos = 0; - nKey1Pos = aKeyDCB.GetEntryPos(aKeyDCB.GetText()); - nKey2Pos = aKey2DCB.GetEntryPos(aKey2DCB.GetText()); + nKey1Pos = m_pKey1DCB->GetEntryPos(m_pKey1DCB->GetText()); + nKey2Pos = m_pKey2DCB->GetEntryPos(m_pKey2DCB->GetText()); } /*-------------------------------------------------------------------- @@ -501,42 +467,42 @@ static void lcl_SelectSameStrings(SwWrtShell& rSh, sal_Bool bWordOnly, sal_Bool } -void SwIndexMarkDlg::InsertMark() +void SwIndexMarkPane::InsertMark() { - sal_uInt16 nPos = aTypeDCB.GetEntryPos(aTypeDCB.GetSelectEntry()); + sal_uInt16 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry()); TOXTypes eType = nPos == POS_CONTENT ? TOX_CONTENT : nPos == POS_INDEX ? TOX_INDEX : TOX_USER; SwTOXMarkDescription aDesc(eType); - sal_uInt16 nLevel = (sal_uInt16)aLevelED.Denormalize(aLevelED.GetValue()); + sal_uInt16 nLevel = (sal_uInt16)m_pLevelNF->Denormalize(m_pLevelNF->GetValue()); switch(nPos) { case POS_CONTENT : break; case POS_INDEX: // keyword index mark { UpdateKeyBoxes(); - String aPrim(aKeyDCB.GetText()); - String aSec(aKey2DCB.GetText()); + String aPrim(m_pKey1DCB->GetText()); + String aSec(m_pKey2DCB->GetText()); aDesc.SetPrimKey(aPrim); aDesc.SetSecKey(aSec); - aDesc.SetMainEntry(aMainEntryCB.IsChecked()); - aDesc.SetPhoneticReadingOfAltStr(aPhoneticED0.GetText()); - aDesc.SetPhoneticReadingOfPrimKey(aPhoneticED1.GetText()); - aDesc.SetPhoneticReadingOfSecKey(aPhoneticED2.GetText()); + aDesc.SetMainEntry(m_pMainEntryCB->IsChecked()); + aDesc.SetPhoneticReadingOfAltStr(m_pPhoneticED0->GetText()); + aDesc.SetPhoneticReadingOfPrimKey(m_pPhoneticED1->GetText()); + aDesc.SetPhoneticReadingOfSecKey(m_pPhoneticED2->GetText()); } break; default: // Userdefined index mark { - String aName(aTypeDCB.GetSelectEntry()); + String aName(m_pTypeDCB->GetSelectEntry()); aDesc.SetTOUName(aName); } } - if (aOrgStr != aEntryED.GetText()) - aDesc.SetAltStr(aEntryED.GetText()); - sal_Bool bApplyAll = aApplyToAllCB.IsChecked(); - sal_Bool bWordOnly = aSearchCaseWordOnlyCB.IsChecked(); - sal_Bool bCaseSensitive = aSearchCaseSensitiveCB.IsChecked(); + if (aOrgStr != m_pEntryED->GetText()) + aDesc.SetAltStr(m_pEntryED->GetText()); + sal_Bool bApplyAll = m_pApplyToAllCB->IsChecked(); + sal_Bool bWordOnly = m_pSearchCaseWordOnlyCB->IsChecked(); + sal_Bool bCaseSensitive = m_pSearchCaseSensitiveCB->IsChecked(); pSh->StartAllAction(); // all equal strings have to be selected here so that the @@ -557,17 +523,17 @@ void SwIndexMarkDlg::InsertMark() /*-------------------------------------------------------------------- Description: update mark --------------------------------------------------------------------*/ -void SwIndexMarkDlg::UpdateMark() +void SwIndexMarkPane::UpdateMark() { - String aAltText(aEntryED.GetText()); - String* pAltText = aOrgStr != aEntryED.GetText() ? &aAltText : 0; + String aAltText(m_pEntryED->GetText()); + String* pAltText = aOrgStr != m_pEntryED->GetText() ? &aAltText : 0; //empty alternative texts are not allowed if(pAltText && !pAltText->Len()) return; UpdateKeyBoxes(); - sal_uInt16 nPos = aTypeDCB.GetEntryPos(aTypeDCB.GetSelectEntry()); + sal_uInt16 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry()); TOXTypes eType = TOX_USER; if(POS_CONTENT == nPos) eType = TOX_CONTENT; @@ -575,46 +541,46 @@ void SwIndexMarkDlg::UpdateMark() eType = TOX_INDEX; SwTOXMarkDescription aDesc(eType); - aDesc.SetLevel( static_cast< int >(aLevelED.GetValue()) ); + aDesc.SetLevel( static_cast< int >(m_pLevelNF->GetValue()) ); if(pAltText) aDesc.SetAltStr(*pAltText); - String aPrim(aKeyDCB.GetText()); + String aPrim(m_pKey1DCB->GetText()); if(aPrim.Len()) aDesc.SetPrimKey(aPrim); - String aSec(aKey2DCB.GetText()); + String aSec(m_pKey2DCB->GetText()); if(aSec.Len()) aDesc.SetSecKey(aSec); if(eType == TOX_INDEX) { - aDesc.SetPhoneticReadingOfAltStr(aPhoneticED0.GetText()); - aDesc.SetPhoneticReadingOfPrimKey(aPhoneticED1.GetText()); - aDesc.SetPhoneticReadingOfSecKey(aPhoneticED2.GetText()); + aDesc.SetPhoneticReadingOfAltStr(m_pPhoneticED0->GetText()); + aDesc.SetPhoneticReadingOfPrimKey(m_pPhoneticED1->GetText()); + aDesc.SetPhoneticReadingOfSecKey(m_pPhoneticED2->GetText()); } - aDesc.SetMainEntry(aMainEntryCB.IsVisible() && aMainEntryCB.IsChecked()); + aDesc.SetMainEntry(m_pMainEntryCB->IsVisible() && m_pMainEntryCB->IsChecked()); pTOXMgr->UpdateTOXMark(aDesc); } /*-------------------------------------------------------------------- Description: insert new keys --------------------------------------------------------------------*/ -void SwIndexMarkDlg::UpdateKeyBoxes() +void SwIndexMarkPane::UpdateKeyBoxes() { - String aKey(aKeyDCB.GetText()); - sal_uInt16 nPos = aKeyDCB.GetEntryPos(aKey); + String aKey(m_pKey1DCB->GetText()); + sal_uInt16 nPos = m_pKey1DCB->GetEntryPos(aKey); if(nPos == LISTBOX_ENTRY_NOTFOUND && aKey.Len() > 0) { // create new key - aKeyDCB.InsertEntry(aKey); + m_pKey1DCB->InsertEntry(aKey); } - aKey = aKey2DCB.GetText(); - nPos = aKey2DCB.GetEntryPos(aKey); + aKey = m_pKey2DCB->GetText(); + nPos = m_pKey2DCB->GetEntryPos(aKey); if(nPos == LISTBOX_ENTRY_NOTFOUND && aKey.Len() > 0) { // create new key - aKey2DCB.InsertEntry(aKey); + m_pKey2DCB->InsertEntry(aKey); } } @@ -627,20 +593,20 @@ class SwNewUserIdxDlg : public ModalDialog FixedText aNameFT; Edit aNameED; - SwIndexMarkDlg* pDlg; + SwIndexMarkPane* pDlg; DECL_LINK( ModifyHdl, Edit*); public: - SwNewUserIdxDlg(SwIndexMarkDlg* pParent) : - ModalDialog(pParent, SW_RES(DLG_NEW_USER_IDX)), + SwNewUserIdxDlg(SwIndexMarkPane* pPane) : + ModalDialog(&(pPane->GetDialog()), SW_RES(DLG_NEW_USER_IDX)), aOKPB(this, SW_RES( PB_OK )), aCancelPB(this, SW_RES( PB_CANCEL )), aHelpPB(this, SW_RES( PB_HELP )), aNameFL(this, SW_RES( FL_NAME )), aNameFT(this, SW_RES( FT_NAME )), aNameED(this, SW_RES( ED_NAME )), - pDlg(pParent) + pDlg(pPane) { FreeResource(); aNameED.SetModifyHdl(LINK(this, SwNewUserIdxDlg, ModifyHdl)); @@ -661,37 +627,37 @@ IMPL_LINK( SwNewUserIdxDlg, ModifyHdl, Edit*, pEdit) return 0; } -IMPL_LINK_NOARG(SwIndexMarkDlg, NewUserIdxHdl) +IMPL_LINK_NOARG(SwIndexMarkPane, NewUserIdxHdl) { SwNewUserIdxDlg* pDlg = new SwNewUserIdxDlg(this); if(RET_OK == pDlg->Execute()) { String sNewName(pDlg->GetName()); - aTypeDCB.InsertEntry(sNewName); - aTypeDCB.SelectEntry(sNewName); + m_pTypeDCB->InsertEntry(sNewName); + m_pTypeDCB->SelectEntry(sNewName); } delete pDlg; return 0; } -IMPL_LINK( SwIndexMarkDlg, SearchTypeHdl, CheckBox*, pBox) +IMPL_LINK( SwIndexMarkPane, SearchTypeHdl, CheckBox*, pBox) { sal_Bool bEnable = pBox->IsChecked() && pBox->IsEnabled(); - aSearchCaseWordOnlyCB.Enable(bEnable); - aSearchCaseSensitiveCB.Enable(bEnable); + m_pSearchCaseWordOnlyCB->Enable(bEnable); + m_pSearchCaseSensitiveCB->Enable(bEnable); return 0; } -IMPL_LINK( SwIndexMarkDlg, InsertHdl, Button *, pButton ) +IMPL_LINK( SwIndexMarkPane, InsertHdl, Button *, pButton ) { Apply(); //close the dialog if only one entry is available - if(!bNewMark && !aPrevBT.IsVisible() && !aNextBT.IsVisible()) + if(!bNewMark && !m_pPrevBT->IsVisible() && !m_pNextBT->IsVisible()) CloseHdl(pButton); return 0; } -IMPL_LINK_NOARG(SwIndexMarkDlg, CloseHdl) +IMPL_LINK_NOARG(SwIndexMarkPane, CloseHdl) { if(bNewMark) { @@ -701,7 +667,7 @@ IMPL_LINK_NOARG(SwIndexMarkDlg, CloseHdl) } else { - ((SwIndexMarkModalDlg*)GetParent())->EndDialog(RET_CANCEL); + m_rDialog.EndDialog(RET_CANCEL); } return 0; } @@ -709,12 +675,12 @@ IMPL_LINK_NOARG(SwIndexMarkDlg, CloseHdl) /*-------------------------------------------------------------------- Description: select index type only when inserting --------------------------------------------------------------------*/ -IMPL_LINK( SwIndexMarkDlg, ModifyHdl, ListBox *, pBox ) +IMPL_LINK( SwIndexMarkPane, ModifyHdl, ListBox *, pBox ) { - if(&aTypeDCB == pBox) + if (m_pTypeDCB == pBox) { // set index type - sal_uInt16 nPos = aTypeDCB.GetEntryPos(aTypeDCB.GetSelectEntry()); + sal_uInt16 nPos = m_pTypeDCB->GetEntryPos(m_pTypeDCB->GetSelectEntry()); sal_Bool bLevelEnable = sal_False, bKeyEnable = sal_False, bSetKey2 = sal_False, @@ -724,94 +690,94 @@ IMPL_LINK( SwIndexMarkDlg, ModifyHdl, ListBox *, pBox ) bKey2HasText = sal_False; if(nPos == POS_INDEX) { - if(aEntryED.GetText().Len()) + if(m_pEntryED->GetText().Len()) bEntryHasText = sal_True; - aPhoneticED0.SetText(GetDefaultPhoneticReading(aEntryED.GetText())); + m_pPhoneticED0->SetText(GetDefaultPhoneticReading(m_pEntryED->GetText())); bKeyEnable = sal_True; - aKeyDCB.SetText(aKeyDCB.GetEntry(nKey1Pos)); - aPhoneticED1.SetText(GetDefaultPhoneticReading(aKeyDCB.GetText())); - if(aKeyDCB.GetText().Len() > 0) + m_pKey1DCB->SetText(m_pKey1DCB->GetEntry(nKey1Pos)); + m_pPhoneticED1->SetText(GetDefaultPhoneticReading(m_pKey1DCB->GetText())); + if(m_pKey1DCB->GetText().Len() > 0) { bKey1HasText = bSetKey2 = bKey2Enable = sal_True; - aKey2DCB.SetText(aKey2DCB.GetEntry(nKey2Pos)); - aPhoneticED2.SetText(GetDefaultPhoneticReading(aKey2DCB.GetText())); - if(aKey2DCB.GetText().Len()) + m_pKey2DCB->SetText(m_pKey2DCB->GetEntry(nKey2Pos)); + m_pPhoneticED2->SetText(GetDefaultPhoneticReading(m_pKey2DCB->GetText())); + if(m_pKey2DCB->GetText().Len()) bKey2HasText = sal_True; } } else { bLevelEnable = sal_True; - aLevelED.SetMax(MAXLEVEL); - aLevelED.SetValue(aLevelED.Normalize(0)); + m_pLevelNF->SetMax(MAXLEVEL); + m_pLevelNF->SetValue(m_pLevelNF->Normalize(0)); bSetKey2 = sal_True; } - aLevelFT.Show(bLevelEnable); - aLevelED.Show(bLevelEnable); - aMainEntryCB.Show(nPos == POS_INDEX); + m_pLevelFT->Show(bLevelEnable); + m_pLevelNF->Show(bLevelEnable); + m_pMainEntryCB->Show(nPos == POS_INDEX); - aKeyFT.Enable(bKeyEnable); - aKeyDCB.Enable(bKeyEnable); + m_pKey1FT->Enable(bKeyEnable); + m_pKey1DCB->Enable(bKeyEnable); if ( bSetKey2 ) { - aKey2DCB.Enable(bKey2Enable); - aKey2FT.Enable(bKey2Enable); + m_pKey2DCB->Enable(bKey2Enable); + m_pKey2FT->Enable(bKey2Enable); } - aPhoneticFT0.Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled); - aPhoneticED0.Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled); - aPhoneticFT1.Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled); - aPhoneticED1.Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled); - aPhoneticFT2.Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled); - aPhoneticED2.Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled); + m_pPhoneticFT0->Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled); + m_pPhoneticED0->Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled); + m_pPhoneticFT1->Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled); + m_pPhoneticED1->Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled); + m_pPhoneticFT2->Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled); + m_pPhoneticED2->Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled); } - else //aEntryED !!aEntryED is not a ListBox but a Edit + else //m_pEntryED !!m_pEntryED is not a ListBox but a Edit { - sal_Bool bHasText = (aEntryED.GetText().Len()>0); + sal_Bool bHasText = (m_pEntryED->GetText().Len()>0); if(!bHasText) { - aPhoneticED0.SetText(aEmptyStr); + m_pPhoneticED0->SetText(aEmptyStr); bPhoneticED0_ChangedByUser = sal_False; } else if(!bPhoneticED0_ChangedByUser) - aPhoneticED0.SetText(GetDefaultPhoneticReading(aEntryED.GetText())); + m_pPhoneticED0->SetText(GetDefaultPhoneticReading(m_pEntryED->GetText())); - aPhoneticFT0.Enable(bHasText&&bIsPhoneticReadingEnabled); - aPhoneticED0.Enable(bHasText&&bIsPhoneticReadingEnabled); + m_pPhoneticFT0->Enable(bHasText&&bIsPhoneticReadingEnabled); + m_pPhoneticED0->Enable(bHasText&&bIsPhoneticReadingEnabled); } - aOKBT.Enable(!pSh->HasReadonlySel() && - (aEntryED.GetText().Len() || pSh->GetCrsrCnt(sal_False))); + m_pOKBT->Enable(!pSh->HasReadonlySel() && + (m_pEntryED->GetText().Len() || pSh->GetCrsrCnt(sal_False))); return 0; } -IMPL_LINK_NOARG_INLINE_START(SwIndexMarkDlg, NextHdl) +IMPL_LINK_NOARG_INLINE_START(SwIndexMarkPane, NextHdl) { InsertUpdate(); pTOXMgr->NextTOXMark(); UpdateDialog(); return 0; } -IMPL_LINK_NOARG_INLINE_END(SwIndexMarkDlg, NextHdl) +IMPL_LINK_NOARG_INLINE_END(SwIndexMarkPane, NextHdl) -IMPL_LINK_NOARG_INLINE_START(SwIndexMarkDlg, NextSameHdl) +IMPL_LINK_NOARG_INLINE_START(SwIndexMarkPane, NextSameHdl) { InsertUpdate(); pTOXMgr->NextTOXMark(sal_True); UpdateDialog(); return 0; } -IMPL_LINK_NOARG_INLINE_END(SwIndexMarkDlg, NextSameHdl) +IMPL_LINK_NOARG_INLINE_END(SwIndexMarkPane, NextSameHdl) -IMPL_LINK_NOARG_INLINE_START(SwIndexMarkDlg, PrevHdl) +IMPL_LINK_NOARG_INLINE_START(SwIndexMarkPane, PrevHdl) { InsertUpdate(); pTOXMgr->PrevTOXMark(); UpdateDialog(); return 0; } -IMPL_LINK_NOARG_INLINE_END(SwIndexMarkDlg, PrevHdl) +IMPL_LINK_NOARG_INLINE_END(SwIndexMarkPane, PrevHdl) -IMPL_LINK_NOARG_INLINE_START(SwIndexMarkDlg, PrevSameHdl) +IMPL_LINK_NOARG_INLINE_START(SwIndexMarkPane, PrevSameHdl) { InsertUpdate(); pTOXMgr->PrevTOXMark(sal_True); @@ -819,9 +785,9 @@ IMPL_LINK_NOARG_INLINE_START(SwIndexMarkDlg, PrevSameHdl) return 0; } -IMPL_LINK_NOARG_INLINE_END(SwIndexMarkDlg, PrevSameHdl) +IMPL_LINK_NOARG_INLINE_END(SwIndexMarkPane, PrevSameHdl) -IMPL_LINK_NOARG(SwIndexMarkDlg, DelHdl) +IMPL_LINK_NOARG(SwIndexMarkPane, DelHdl) { bDel = sal_True; InsertUpdate(); @@ -831,7 +797,7 @@ IMPL_LINK_NOARG(SwIndexMarkDlg, DelHdl) UpdateDialog(); else { - CloseHdl(&aCancelBT); + CloseHdl(m_pCloseBT); SfxViewFrame::Current()->GetBindings().Invalidate(FN_EDIT_IDX_ENTRY_DLG); } return 0; @@ -840,7 +806,7 @@ IMPL_LINK_NOARG(SwIndexMarkDlg, DelHdl) /*-------------------------------------------------------------------- Description: renew dialog view --------------------------------------------------------------------*/ -void SwIndexMarkDlg::UpdateDialog() +void SwIndexMarkPane::UpdateDialog() { OSL_ENSURE(pSh && pTOXMgr, "no shell?"); SwTOXMark* pMark = pTOXMgr->GetCurTOXMark(); @@ -848,10 +814,10 @@ void SwIndexMarkDlg::UpdateDialog() if(!pMark) return; - ViewShell::SetCareWin( GetParent() ); + ViewShell::SetCareWin(&m_rDialog); aOrgStr = pMark->GetText(); - aEntryED.SetText(aOrgStr); + m_pEntryED->SetText(aOrgStr); // set index type sal_Bool bLevelEnable = sal_True, @@ -869,70 +835,70 @@ void SwIndexMarkDlg::UpdateDialog() bKey1HasText = bKey2Enable = 0 != pMark->GetPrimaryKey().Len(); bKey2HasText = 0 != pMark->GetSecondaryKey().Len(); bEntryHasText = 0 != pMark->GetText().Len(); - aKeyDCB.SetText( pMark->GetPrimaryKey() ); - aKey2DCB.SetText( pMark->GetSecondaryKey() ); - aPhoneticED0.SetText( pMark->GetTextReading() ); - aPhoneticED1.SetText( pMark->GetPrimaryKeyReading() ); - aPhoneticED2.SetText( pMark->GetSecondaryKeyReading() ); - aMainEntryCB.Check(pMark->IsMainEntry()); + m_pKey1DCB->SetText( pMark->GetPrimaryKey() ); + m_pKey2DCB->SetText( pMark->GetSecondaryKey() ); + m_pPhoneticED0->SetText( pMark->GetTextReading() ); + m_pPhoneticED1->SetText( pMark->GetPrimaryKeyReading() ); + m_pPhoneticED2->SetText( pMark->GetSecondaryKeyReading() ); + m_pMainEntryCB->Check(pMark->IsMainEntry()); } else if(TOX_CONTENT == eCurType || TOX_USER == eCurType) { - aLevelED.SetValue(aLevelED.Normalize(pMark->GetLevel())); + m_pLevelNF->SetValue(m_pLevelNF->Normalize(pMark->GetLevel())); } - aKeyFT.Enable(bKeyEnable); - aKeyDCB.Enable(bKeyEnable); - aLevelED.SetMax(MAXLEVEL); - aLevelFT.Show(bLevelEnable); - aLevelED.Show(bLevelEnable); - aMainEntryCB.Show(!bLevelEnable); - aKey2FT.Enable(bKey2Enable); - aKey2DCB.Enable(bKey2Enable); + m_pKey1FT->Enable(bKeyEnable); + m_pKey1DCB->Enable(bKeyEnable); + m_pLevelNF->SetMax(MAXLEVEL); + m_pLevelFT->Show(bLevelEnable); + m_pLevelNF->Show(bLevelEnable); + m_pMainEntryCB->Show(!bLevelEnable); + m_pKey2FT->Enable(bKey2Enable); + m_pKey2DCB->Enable(bKey2Enable); UpdateLanguageDependenciesForPhoneticReading(); - aPhoneticFT0.Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled); - aPhoneticED0.Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled); - aPhoneticFT1.Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled); - aPhoneticED1.Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled); - aPhoneticFT2.Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled); - aPhoneticED2.Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled); + m_pPhoneticFT0->Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled); + m_pPhoneticED0->Enable(bKeyEnable&&bEntryHasText&&bIsPhoneticReadingEnabled); + m_pPhoneticFT1->Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled); + m_pPhoneticED1->Enable(bKeyEnable&&bKey1HasText&&bIsPhoneticReadingEnabled); + m_pPhoneticFT2->Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled); + m_pPhoneticED2->Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled); // set index type - aTypeDCB.SelectEntry(pMark->GetTOXType()->GetTypeName()); + m_pTypeDCB->SelectEntry(pMark->GetTOXType()->GetTypeName()); // set Next - Prev - Buttons pSh->SttCrsrMove(); - if( aPrevBT.IsVisible() ) + if( m_pPrevBT->IsVisible() ) { const SwTOXMark* pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_PRV ); if( pMoveMark != pMark ) pSh->GotoTOXMark( *pMoveMark, TOX_NXT ); - aPrevBT.Enable( pMoveMark != pMark ); + m_pPrevBT->Enable( pMoveMark != pMark ); pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_NXT ); if( pMoveMark != pMark ) pSh->GotoTOXMark( *pMoveMark, TOX_PRV ); - aNextBT.Enable( pMoveMark != pMark ); + m_pNextBT->Enable( pMoveMark != pMark ); } - if( aPrevSameBT.IsVisible() ) + if( m_pPrevSameBT->IsVisible() ) { const SwTOXMark* pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_PRV ); if( pMoveMark != pMark ) pSh->GotoTOXMark( *pMoveMark, TOX_SAME_NXT ); - aPrevSameBT.Enable( pMoveMark != pMark ); + m_pPrevSameBT->Enable( pMoveMark != pMark ); pMoveMark = &pSh->GotoTOXMark( *pMark, TOX_SAME_NXT ); if( pMoveMark != pMark ) pSh->GotoTOXMark( *pMoveMark, TOX_SAME_PRV ); - aNextSameBT.Enable( pMoveMark != pMark ); + m_pNextSameBT->Enable( pMoveMark != pMark ); } sal_Bool bEnable = !pSh->HasReadonlySel(); - aOKBT.Enable( bEnable ); - aDelBT.Enable( bEnable ); - aEntryED.SetReadOnly( !bEnable ); - aLevelED.SetReadOnly( !bEnable ); - aKeyDCB.SetReadOnly( !bEnable ); - aKey2DCB.SetReadOnly( !bEnable ); + m_pOKBT->Enable( bEnable ); + m_pDelBT->Enable( bEnable ); + m_pEntryED->SetReadOnly( !bEnable ); + m_pLevelNF->SetReadOnly( !bEnable ); + m_pKey1DCB->SetReadOnly( !bEnable ); + m_pKey2DCB->SetReadOnly( !bEnable ); pSh->SelectTxtAttr( RES_TXTATR_TOXMARK, pMark->GetTxtTOXMark() ); // we need the point at the start of the attribut @@ -944,17 +910,17 @@ void SwIndexMarkDlg::UpdateDialog() /*-------------------------------------------------------------------- Remind whether the edit boxes for Phonetic reading are changed manually --------------------------------------------------------------------*/ -IMPL_LINK( SwIndexMarkDlg, PhoneticEDModifyHdl, Edit *, pEdit ) +IMPL_LINK( SwIndexMarkPane, PhoneticEDModifyHdl, Edit *, pEdit ) { - if(&aPhoneticED0 == pEdit) + if (m_pPhoneticED0 == pEdit) { bPhoneticED0_ChangedByUser = pEdit->GetText().Len()>0; } - else if(&aPhoneticED1 == pEdit) + else if (m_pPhoneticED1 == pEdit) { bPhoneticED1_ChangedByUser = pEdit->GetText().Len()>0; } - else if(&aPhoneticED2 == pEdit) + else if (m_pPhoneticED2 == pEdit) { bPhoneticED2_ChangedByUser = pEdit->GetText().Len()>0; } @@ -964,16 +930,16 @@ IMPL_LINK( SwIndexMarkDlg, PhoneticEDModifyHdl, Edit *, pEdit ) /*-------------------------------------------------------------------- Description: Enable Disable of the 2nd key --------------------------------------------------------------------*/ -IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox ) +IMPL_LINK( SwIndexMarkPane, KeyDCBModifyHdl, ComboBox *, pBox ) { - if(&aKeyDCB == pBox) + if (m_pKey1DCB == pBox) { sal_Bool bEnable = pBox->GetText().Len() > 0; if(!bEnable) { - aKey2DCB.SetText(aEmptyStr); - aPhoneticED1.SetText(aEmptyStr); - aPhoneticED2.SetText(aEmptyStr); + m_pKey2DCB->SetText(aEmptyStr); + m_pPhoneticED1->SetText(aEmptyStr); + m_pPhoneticED2->SetText(aEmptyStr); bPhoneticED1_ChangedByUser = sal_False; bPhoneticED2_ChangedByUser = sal_False; } @@ -985,16 +951,16 @@ IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox ) bPhoneticED1_ChangedByUser = sal_False; } if(!bPhoneticED1_ChangedByUser) - aPhoneticED1.SetText(GetDefaultPhoneticReading(pBox->GetText())); + m_pPhoneticED1->SetText(GetDefaultPhoneticReading(pBox->GetText())); } - aKey2DCB.Enable(bEnable); - aKey2FT.Enable(bEnable); + m_pKey2DCB->Enable(bEnable); + m_pKey2FT->Enable(bEnable); } - else if(&aKey2DCB == pBox) + else if (m_pKey2DCB == pBox) { if(!(pBox->GetText().Len()>0)) { - aPhoneticED2.SetText(aEmptyStr); + m_pPhoneticED2->SetText(aEmptyStr); bPhoneticED2_ChangedByUser = sal_False; } else @@ -1005,16 +971,16 @@ IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox ) bPhoneticED2_ChangedByUser = sal_False; } if(!bPhoneticED2_ChangedByUser) - aPhoneticED2.SetText(GetDefaultPhoneticReading(pBox->GetText())); + m_pPhoneticED2->SetText(GetDefaultPhoneticReading(pBox->GetText())); } } - sal_Bool bKey1HasText = (0 != aKeyDCB.GetText().Len()); - sal_Bool bKey2HasText = (0 != aKey2DCB.GetText().Len()); + sal_Bool bKey1HasText = (0 != m_pKey1DCB->GetText().Len()); + sal_Bool bKey2HasText = (0 != m_pKey2DCB->GetText().Len()); - aPhoneticFT1.Enable(bKey1HasText&&bIsPhoneticReadingEnabled); - aPhoneticED1.Enable(bKey1HasText&bIsPhoneticReadingEnabled); - aPhoneticFT2.Enable(bKey2HasText&bIsPhoneticReadingEnabled); - aPhoneticED2.Enable(bKey2HasText&bIsPhoneticReadingEnabled); + m_pPhoneticFT1->Enable(bKey1HasText&&bIsPhoneticReadingEnabled); + m_pPhoneticED1->Enable(bKey1HasText&bIsPhoneticReadingEnabled); + m_pPhoneticFT2->Enable(bKey2HasText&bIsPhoneticReadingEnabled); + m_pPhoneticED2->Enable(bKey2HasText&bIsPhoneticReadingEnabled); return 0; } @@ -1022,13 +988,13 @@ IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox ) /*-------------------------------------------------- overload dtor --------------------------------------------------*/ -SwIndexMarkDlg::~SwIndexMarkDlg() +SwIndexMarkPane::~SwIndexMarkPane() { delete pTOXMgr; ViewShell::SetCareWin( 0 ); } -void SwIndexMarkDlg::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark) +void SwIndexMarkPane::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark) { pSh = &rWrtShell; delete pTOXMgr; @@ -1046,40 +1012,36 @@ void SwIndexMarkDlg::ReInitDlg(SwWrtShell& rWrtShell, SwTOXMark* pCurTOXMark) } SwIndexMarkFloatDlg::SwIndexMarkFloatDlg(SfxBindings* _pBindings, - SfxChildWindow* pChild, - Window *pParent, - SfxChildWinInfo* pInfo, - sal_Bool bNew) : -SfxModelessDialog(_pBindings, pChild, pParent, SvtCJKOptions().IsCJKFontEnabled()?SW_RES(DLG_INSIDXMARK_CJK):SW_RES(DLG_INSIDXMARK)), - aDlg(this, bNew, SW_RES(WIN_DLG), SvtCJKOptions().IsCJKFontEnabled()?DLG_INSIDXMARK_CJK:DLG_INSIDXMARK, *::GetActiveWrtShell()) + SfxChildWindow* pChild, Window *pParent, + SfxChildWinInfo* pInfo, sal_Bool bNew) + : SfxModelessDialog(_pBindings, pChild, pParent, "IndexEntryDialog", "modules/swriter/ui/indexentry.ui") + , m_aContent(*this, bNew, *::GetActiveWrtShell()) { - FreeResource(); - aDlg.ReInitDlg(*::GetActiveWrtShell()); + m_aContent.ReInitDlg(*::GetActiveWrtShell()); Initialize(pInfo); } -void SwIndexMarkFloatDlg::Activate() +void SwIndexMarkFloatDlg::Activate() { SfxModelessDialog::Activate(); - aDlg.Activate(); + m_aContent.Activate(); } void SwIndexMarkFloatDlg::ReInitDlg(SwWrtShell& rWrtShell) { - aDlg.ReInitDlg( rWrtShell ); + m_aContent.ReInitDlg( rWrtShell ); } -SwIndexMarkModalDlg::SwIndexMarkModalDlg(Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark) : -SvxStandardDialog(pParent, SvtCJKOptions().IsCJKFontEnabled()?SW_RES(DLG_EDIT_IDXMARK_CJK):SW_RES(DLG_EDIT_IDXMARK)), - aDlg(this, sal_False, SW_RES(WIN_DLG), SvtCJKOptions().IsCJKFontEnabled()?DLG_EDIT_IDXMARK_CJK:DLG_EDIT_IDXMARK, rSh) +SwIndexMarkModalDlg::SwIndexMarkModalDlg(Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark) + : SvxStandardDialog(pParent, "IndexEntryDialog", "modules/swriter/ui/indexentry.ui") + , m_aContent(*this, sal_False, rSh) { - FreeResource(); - aDlg.ReInitDlg(rSh, pCurTOXMark); + m_aContent.ReInitDlg(rSh, pCurTOXMark); } -void SwIndexMarkModalDlg::Apply() +void SwIndexMarkModalDlg::Apply() { - aDlg.Apply(); + m_aContent.Apply(); } class SwCreateAuthEntryDlg_Impl : public ModalDialog @@ -1161,89 +1123,58 @@ static const TextInfo aTextInfoArr[] = {AUTH_FIELD_CUSTOM5, HID_AUTH_FIELD_CUSTOM5 } }; -sal_Bool SwAuthMarkDlg::bIsFromComponent = sal_True; - -SwAuthMarkDlg::SwAuthMarkDlg( Window *pParent, - const ResId& rResId, - sal_Bool bNewDlg) : - Window(pParent, rResId), - aFromComponentRB( this, ResId(RB_FROMCOMPONENT, *rResId.GetResMgr() )), - aFromDocContentRB( this, ResId(RB_FROMDOCCONTENT, *rResId.GetResMgr() )), - - aAuthorFT( this, ResId(FT_AUTHOR, *rResId.GetResMgr() )), - aAuthorFI( this, ResId(FI_AUTHOR, *rResId.GetResMgr() )), - aTitleFT( this, ResId(FT_TITLE, *rResId.GetResMgr() )), - aTitleFI( this, ResId(FI_TITLE, *rResId.GetResMgr() )), - aEntryFT( this, ResId(FT_ENTRY, *rResId.GetResMgr() )), - aEntryED( this, ResId(ED_ENTRY, *rResId.GetResMgr() )), - aEntryLB( this, ResId(LB_ENTRY, *rResId.GetResMgr() )), - - aEntryFL( this, ResId(FL_ENTRY, *rResId.GetResMgr() )), - - aOKBT( this, ResId(PB_OK, *rResId.GetResMgr() )), - aCancelBT( this, ResId(PB_CANCEL, *rResId.GetResMgr() )), - aHelpBT( this, ResId(PB_HELP, *rResId.GetResMgr() )), - aCreateEntryPB(this,ResId(PB_CREATEENTRY, *rResId.GetResMgr())), - aEditEntryPB(this, ResId(PB_EDITENTRY, *rResId.GetResMgr())), - - sChangeST( ResId(ST_CHANGE, *rResId.GetResMgr())), - bNewEntry(bNewDlg), - bBibAccessInitialized(sal_False), +sal_Bool SwAuthorMarkPane::bIsFromComponent = sal_True; - pSh(0) +SwAuthorMarkPane::SwAuthorMarkPane(Dialog &rDialog, sal_Bool bNewDlg) + : m_rDialog(rDialog) + , bNewEntry(bNewDlg) + , bBibAccessInitialized(sal_False) + , pSh(0) { - SetStyle(GetStyle()|WB_DIALOGCONTROL); - FreeResource(); - - aFromComponentRB.SetHelpId(HID_AUTH_MARK_DLG_FROM_COMP_RB); - aFromDocContentRB.SetHelpId(HID_AUTH_MARK_DLG_FROM_DOC_RB ); - aEntryED.SetHelpId(HID_AUTH_MARK_DLG_ID_LISTBOX ); - aEntryLB.SetHelpId(HID_AUTH_MARK_DLG_ID_LISTBOX ); - - aFromComponentRB.Show(bNewEntry); - aFromDocContentRB.Show(bNewEntry); - aFromComponentRB.Check(bIsFromComponent); - aFromDocContentRB.Check(!bIsFromComponent); - - aOKBT .SetHelpId(HID_INSERT_AUTH_MRK_OK ); - aCancelBT .SetHelpId(HID_INSERT_AUTH_MRK_CLOSE); - aEntryED .SetHelpId(HID_INSERT_AUTH_MRK_ENTRY ); - aCreateEntryPB .SetHelpId(HID_INSERT_AUTH_MRK_CREATE_ENTRY ); - aEditEntryPB .SetHelpId(HID_INSERT_AUTH_MRK_EDIT_ENTRY ); - - aOKBT.SetClickHdl(LINK(this,SwAuthMarkDlg, InsertHdl)); - aCancelBT.SetClickHdl(LINK(this,SwAuthMarkDlg, CloseHdl)); - aCreateEntryPB.SetClickHdl(LINK(this,SwAuthMarkDlg, CreateEntryHdl)); - aEditEntryPB.SetClickHdl(LINK(this,SwAuthMarkDlg, CreateEntryHdl)); - aFromComponentRB.SetClickHdl(LINK(this,SwAuthMarkDlg, ChangeSourceHdl)); - aFromDocContentRB.SetClickHdl(LINK(this,SwAuthMarkDlg, ChangeSourceHdl)); - aEntryED.SetModifyHdl(LINK(this,SwAuthMarkDlg, EditModifyHdl)); - - GetParent()->SetText(String(SW_RES( - bNewEntry ? STR_AUTHMRK_INSERT : STR_AUTHMRK_EDIT))); - aEntryED.Show(!bNewEntry); - aEntryLB.Show(bNewEntry); - if(!bNewEntry) - { - aOKBT.SetText(sChangeST); - } - else + m_rDialog.get(m_pFromComponentRB, "frombibliography"); + m_rDialog.get(m_pFromDocContentRB, "fromdocument"); + m_rDialog.get(m_pAuthorFI, "author"); + m_rDialog.get(m_pTitleFI, "title"); + m_rDialog.get(m_pEntryED, "entryed"); + m_rDialog.get(m_pEntryLB, "entrylb"); + m_rDialog.get(m_pActionBT, + bNewEntry ? OString("insert") : OString("modify")); + m_pActionBT->Show(true); + m_rDialog.get(m_pCloseBT, "close"); + m_rDialog.get(m_pCreateEntryPB, "new"); + m_rDialog.get(m_pEditEntryPB, "edit"); + + m_pFromComponentRB->Show(bNewEntry); + m_pFromDocContentRB->Show(bNewEntry); + m_pFromComponentRB->Check(bIsFromComponent); + m_pFromDocContentRB->Check(!bIsFromComponent); + + m_pActionBT->SetClickHdl(LINK(this,SwAuthorMarkPane, InsertHdl)); + m_pCloseBT->SetClickHdl(LINK(this,SwAuthorMarkPane, CloseHdl)); + m_pCreateEntryPB->SetClickHdl(LINK(this,SwAuthorMarkPane, CreateEntryHdl)); + m_pEditEntryPB->SetClickHdl(LINK(this,SwAuthorMarkPane, CreateEntryHdl)); + m_pFromComponentRB->SetClickHdl(LINK(this,SwAuthorMarkPane, ChangeSourceHdl)); + m_pFromDocContentRB->SetClickHdl(LINK(this,SwAuthorMarkPane, ChangeSourceHdl)); + m_pEntryED->SetModifyHdl(LINK(this,SwAuthorMarkPane, EditModifyHdl)); + + m_rDialog.SetText(SW_RESSTR( + bNewEntry ? STR_AUTHMRK_INSERT : STR_AUTHMRK_EDIT)); + + m_pEntryED->Show(!bNewEntry); + m_pEntryLB->Show(bNewEntry); + if(bNewEntry) { - aEntryLB.SetSelectHdl(LINK(this, SwAuthMarkDlg, CompEntryHdl)); + m_pEntryLB->SetSelectHdl(LINK(this, SwAuthorMarkPane, CompEntryHdl)); } } -SwAuthMarkDlg::~SwAuthMarkDlg() -{ -} - -void SwAuthMarkDlg::ReInitDlg(SwWrtShell& rWrtShell) +void SwAuthorMarkPane::ReInitDlg(SwWrtShell& rWrtShell) { pSh = &rWrtShell; InitControls(); } -IMPL_LINK_NOARG(SwAuthMarkDlg, CloseHdl) +IMPL_LINK_NOARG(SwAuthorMarkPane, CloseHdl) { if(bNewEntry) { @@ -1253,7 +1184,7 @@ IMPL_LINK_NOARG(SwAuthMarkDlg, CloseHdl) } else { - ((SwAuthMarkModalDlg*)GetParent())->EndDialog(RET_CANCEL); + m_rDialog.EndDialog(RET_CANCEL); } return 0; } @@ -1275,7 +1206,7 @@ static String lcl_FindColumnEntry(const beans::PropertyValue* pFields, sal_Int32 return sRet; } -IMPL_LINK( SwAuthMarkDlg, CompEntryHdl, ListBox*, pBox) +IMPL_LINK( SwAuthorMarkPane, CompEntryHdl, ListBox*, pBox) { String sEntry(pBox->GetSelectEntry()); if(bIsFromComponent) @@ -1316,12 +1247,12 @@ IMPL_LINK( SwAuthMarkDlg, CompEntryHdl, ListBox*, pBox) for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) m_sFields[i] = aEmptyStr; } - aAuthorFI.SetText(m_sFields[AUTH_FIELD_AUTHOR]); - aTitleFI.SetText(m_sFields[AUTH_FIELD_TITLE]); + m_pAuthorFI->SetText(m_sFields[AUTH_FIELD_AUTHOR]); + m_pTitleFI->SetText(m_sFields[AUTH_FIELD_TITLE]); return 0; } -IMPL_LINK_NOARG(SwAuthMarkDlg, InsertHdl) +IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl) { //insert or update the SwAuthorityField... if(pSh) @@ -1341,7 +1272,7 @@ IMPL_LINK_NOARG(SwAuthMarkDlg, InsertHdl) bDifferent |= m_sFields[i] != pEntry->GetAuthorField((ToxAuthorityField)i); if(bDifferent) { - QueryBox aQuery(this, SW_RES(DLG_CHANGE_AUTH_ENTRY)); + QueryBox aQuery(&m_rDialog, SW_RES(DLG_CHANGE_AUTH_ENTRY)); if(RET_YES != aQuery.Execute()) return 0; } @@ -1376,9 +1307,9 @@ IMPL_LINK_NOARG(SwAuthMarkDlg, InsertHdl) return 0; } -IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton) +IMPL_LINK(SwAuthorMarkPane, CreateEntryHdl, PushButton*, pButton) { - sal_Bool bCreate = pButton == &aCreateEntryPB; + sal_Bool bCreate = pButton == m_pCreateEntryPB; String sOldId = m_sCreatedEntry[0]; for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) m_sCreatedEntry[i] = bCreate ? aEmptyStr : m_sFields[i]; @@ -1387,46 +1318,46 @@ IMPL_LINK(SwAuthMarkDlg, CreateEntryHdl, PushButton*, pButton) *pSh, bNewEntry, bCreate); if(bNewEntry) { - aDlg.SetCheckNameHdl(LINK(this, SwAuthMarkDlg, IsEntryAllowedHdl)); + aDlg.SetCheckNameHdl(LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl)); } if(RET_OK == aDlg.Execute()) { if(bCreate && sOldId.Len()) { - aEntryLB.RemoveEntry(sOldId); + m_pEntryLB->RemoveEntry(sOldId); } for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) { m_sFields[i] = aDlg.GetEntryText((ToxAuthorityField)i); m_sCreatedEntry[i] = m_sFields[i]; } - if(bNewEntry && !aFromDocContentRB.IsChecked()) + if(bNewEntry && !m_pFromDocContentRB->IsChecked()) { - aFromDocContentRB.Check(sal_True); - ChangeSourceHdl(&aFromDocContentRB); + m_pFromDocContentRB->Check(sal_True); + ChangeSourceHdl(m_pFromDocContentRB); } if(bCreate) { OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND == - aEntryLB.GetEntryPos(m_sFields[AUTH_FIELD_IDENTIFIER]), + m_pEntryLB->GetEntryPos(m_sFields[AUTH_FIELD_IDENTIFIER]), "entry exists!"); - aEntryLB.InsertEntry(m_sFields[AUTH_FIELD_IDENTIFIER]); - aEntryLB.SelectEntry(m_sFields[AUTH_FIELD_IDENTIFIER]); + m_pEntryLB->InsertEntry(m_sFields[AUTH_FIELD_IDENTIFIER]); + m_pEntryLB->SelectEntry(m_sFields[AUTH_FIELD_IDENTIFIER]); } - aEntryED.SetText(m_sFields[AUTH_FIELD_IDENTIFIER]); - aAuthorFI.SetText(m_sFields[AUTH_FIELD_AUTHOR]); - aTitleFI.SetText(m_sFields[AUTH_FIELD_TITLE]); - aOKBT.Enable(); + m_pEntryED->SetText(m_sFields[AUTH_FIELD_IDENTIFIER]); + m_pAuthorFI->SetText(m_sFields[AUTH_FIELD_AUTHOR]); + m_pTitleFI->SetText(m_sFields[AUTH_FIELD_TITLE]); + m_pActionBT->Enable(); } return 0; } -IMPL_LINK(SwAuthMarkDlg, ChangeSourceHdl, RadioButton*, pButton) +IMPL_LINK(SwAuthorMarkPane, ChangeSourceHdl, RadioButton*, pButton) { - sal_Bool bFromComp = (pButton == &aFromComponentRB); + sal_Bool bFromComp = (pButton == m_pFromComponentRB); bIsFromComponent = bFromComp; - aCreateEntryPB.Enable(!bIsFromComponent); - aEntryLB.Clear(); + m_pCreateEntryPB->Enable(!bIsFromComponent); + m_pEntryLB->Clear(); if(bIsFromComponent) { if(!bBibAccessInitialized) @@ -1462,7 +1393,7 @@ IMPL_LINK(SwAuthMarkDlg, ChangeSourceHdl, RadioButton*, pButton) const OUString* pNames = aIdentifiers.getConstArray(); for(sal_uInt16 i = 0; i < aIdentifiers.getLength(); i++) { - aEntryLB.InsertEntry(pNames[i]); + m_pEntryLB->InsertEntry(pNames[i]); } } } @@ -1475,21 +1406,21 @@ IMPL_LINK(SwAuthMarkDlg, ChangeSourceHdl, RadioButton*, pButton) std::vector<String> aIds; pFType->GetAllEntryIdentifiers( aIds ); for(size_t n = 0; n < aIds.size(); ++n) - aEntryLB.InsertEntry(aIds[n]); + m_pEntryLB->InsertEntry(aIds[n]); } if(m_sCreatedEntry[AUTH_FIELD_IDENTIFIER].Len()) - aEntryLB.InsertEntry(m_sCreatedEntry[AUTH_FIELD_IDENTIFIER]); + m_pEntryLB->InsertEntry(m_sCreatedEntry[AUTH_FIELD_IDENTIFIER]); } - aEntryLB.SelectEntryPos(0); - CompEntryHdl(&aEntryLB); + m_pEntryLB->SelectEntryPos(0); + CompEntryHdl(m_pEntryLB); return 0; } -IMPL_LINK(SwAuthMarkDlg, EditModifyHdl, Edit*, pEdit) +IMPL_LINK(SwAuthorMarkPane, EditModifyHdl, Edit*, pEdit) { - Link aAllowed = LINK(this, SwAuthMarkDlg, IsEntryAllowedHdl); + Link aAllowed = LINK(this, SwAuthorMarkPane, IsEntryAllowedHdl); long nResult = aAllowed.Call(pEdit); - aOKBT.Enable(nResult > 0); + m_pActionBT->Enable(nResult > 0); if(nResult) { String sEntry(pEdit->GetText()); @@ -1499,13 +1430,13 @@ IMPL_LINK(SwAuthMarkDlg, EditModifyHdl, Edit*, pEdit) return 0; }; -IMPL_LINK(SwAuthMarkDlg, IsEntryAllowedHdl, Edit*, pEdit) +IMPL_LINK(SwAuthorMarkPane, IsEntryAllowedHdl, Edit*, pEdit) { String sEntry = pEdit->GetText(); sal_Bool bAllowed = sal_False; if(sEntry.Len()) { - if(aEntryLB.GetEntryPos(sEntry) != LISTBOX_ENTRY_NOTFOUND) + if(m_pEntryLB->GetEntryPos(sEntry) != LISTBOX_ENTRY_NOTFOUND) return 0; else if(bIsFromComponent) { @@ -1521,16 +1452,16 @@ IMPL_LINK(SwAuthMarkDlg, IsEntryAllowedHdl, Edit*, pEdit) return bAllowed; } -void SwAuthMarkDlg::InitControls() +void SwAuthorMarkPane::InitControls() { OSL_ENSURE(pSh, "no shell?"); SwField* pField = pSh->GetCurFld(); OSL_ENSURE(bNewEntry || pField, "no current marker"); if(bNewEntry) { - ChangeSourceHdl(aFromComponentRB.IsChecked() ? &aFromComponentRB : &aFromDocContentRB); - aCreateEntryPB.Enable(!aFromComponentRB.IsChecked()); - if(!aFromComponentRB.IsChecked() && m_sCreatedEntry[0].Len()) + ChangeSourceHdl(m_pFromComponentRB->IsChecked() ? m_pFromComponentRB : m_pFromDocContentRB); + m_pCreateEntryPB->Enable(!m_pFromComponentRB->IsChecked()); + if(!m_pFromComponentRB->IsChecked() && m_sCreatedEntry[0].Len()) for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) m_sFields[i] = m_sCreatedEntry[i]; } @@ -1546,15 +1477,14 @@ void SwAuthMarkDlg::InitControls() for(sal_uInt16 i = 0; i < AUTH_FIELD_END; i++) m_sFields[i] = pEntry->GetAuthorField((ToxAuthorityField)i); - aEntryED.SetText(pEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER)); - aAuthorFI.SetText(pEntry->GetAuthorField(AUTH_FIELD_AUTHOR)); - aTitleFI.SetText(pEntry->GetAuthorField(AUTH_FIELD_TITLE)); + m_pEntryED->SetText(pEntry->GetAuthorField(AUTH_FIELD_IDENTIFIER)); + m_pAuthorFI->SetText(pEntry->GetAuthorField(AUTH_FIELD_AUTHOR)); + m_pTitleFI->SetText(pEntry->GetAuthorField(AUTH_FIELD_TITLE)); } -void SwAuthMarkDlg::Activate() +void SwAuthorMarkPane::Activate() { - aOKBT.Enable(!pSh->HasReadonlySel()); - Window::Activate(); + m_pActionBT->Enable(!pSh->HasReadonlySel()); } SwCreateAuthEntryDlg_Impl::SwCreateAuthEntryDlg_Impl(Window* pParent, @@ -1795,39 +1725,39 @@ SwAuthMarkFloatDlg::SwAuthMarkFloatDlg(SfxBindings* _pBindings, SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo, - sal_Bool bNew) : - SfxModelessDialog(_pBindings, pChild, pParent, SW_RES(DLG_INSAUTHMARK)), - aDlg(this, SW_RES(WIN_DLG), bNew) + sal_Bool bNew) + : SfxModelessDialog(_pBindings, pChild, pParent, + "BibliographyEntryDialog", "modules/swriter/ui/bibliographyentry.ui") + , m_aContent(*this, bNew) { - FreeResource(); Initialize(pInfo); SwWrtShell* pWrtShell = ::GetActiveWrtShell(); OSL_ENSURE(pWrtShell, "No shell?"); - aDlg.ReInitDlg(*pWrtShell); + m_aContent.ReInitDlg(*pWrtShell); } -void SwAuthMarkFloatDlg::Activate() +void SwAuthMarkFloatDlg::Activate() { SfxModelessDialog::Activate(); - aDlg.Activate(); + m_aContent.Activate(); } void SwAuthMarkFloatDlg::ReInitDlg(SwWrtShell& rWrtShell) { - aDlg.ReInitDlg( rWrtShell ); + m_aContent.ReInitDlg( rWrtShell ); } -SwAuthMarkModalDlg::SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh) : - SvxStandardDialog(pParent, SW_RES(DLG_EDIT_AUTHMARK)), - aDlg(this, SW_RES(WIN_DLG), sal_False) +SwAuthMarkModalDlg::SwAuthMarkModalDlg(Window *pParent, SwWrtShell& rSh) + : SvxStandardDialog(pParent, "BibliographyEntryDialog", + "modules/swriter/ui/bibliographyentry.ui") + , m_aContent(*this, sal_False) { - FreeResource(); - aDlg.ReInitDlg(rSh); + m_aContent.ReInitDlg(rSh); } -void SwAuthMarkModalDlg::Apply() +void SwAuthMarkModalDlg::Apply() { - aDlg.InsertHdl(0); + m_aContent.InsertHdl(0); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx index 5a34917d4e2c..015de0cfc62c 100644 --- a/sw/source/ui/lingu/hhcwrp.cxx +++ b/sw/source/ui/lingu/hhcwrp.cxx @@ -43,7 +43,6 @@ #include <sdrhhcwrap.hxx> #include <doc.hxx> #include <docsh.hxx> -#include <txatritr.hxx> #include <mdiexp.hxx> // Progress #include <edtwin.hxx> #include <crsskip.hxx> diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 9a139d052ca6..ea0ed334026c 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -156,7 +156,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRe sal_uInt16 nId = 0; for( IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin(); ppBookmark != pMarkAccess->getBookmarksEnd(); - ppBookmark++) + ++ppBookmark) { if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark)) aBookmarkBox.InsertEntry( SwBoxEntry( ppBookmark->get()->GetName(), nId++ ) ); diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index cb7597f0f20c..aa80d7f8a3c0 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -43,7 +43,6 @@ #include <swstyle.h> #include <helpid.h> #include <misc.hrc> -#include <docfnote.hrc> #include <frmui.hrc> #include <SwStyleNameMapper.hxx> @@ -87,58 +86,54 @@ IMPL_LINK( SwFootNoteOptionDlg, OkHdl, Button *, pBtn ) //---------------------------------------------------------------------- -SwEndNoteOptionPage::SwEndNoteOptionPage( Window *pParent, sal_Bool bEN, - const SfxItemSet &rSet ) : - SfxTabPage( pParent, SW_RES(bEN ? TP_ENDNOTEOPTION : TP_FOOTNOTEOPTION), rSet ), - aNumFL (this, SW_RES( FL_NUM )), - - aNumTypeFT (this, SW_RES( FT_NUMTYPE )), - aNumViewBox (this, SW_RES( LB_NUMVIEW ), INSERT_NUM_EXTENDED_TYPES), - aOffsetLbl (this, SW_RES( FT_OFFSET )), - aOffsetFld (this, SW_RES( FLD_OFFSET )), - aNumCountFT (this, SW_RES( FT_NUMCOUNT )), - aNumCountBox (this, SW_RES( LB_NUMCOUNT )), - aPrefixFT (this, SW_RES( FT_PREFIX )), - aPrefixED (this, SW_RES( ED_PREFIX )), - aSuffixFT (this, SW_RES( FT_SUFFIX )), - aSuffixED (this, SW_RES( ED_SUFFIX )), - aPosFT (this, SW_RES( FT_POS )), - aPosPageBox (this, SW_RES( RB_POS_PAGE )), - aPosChapterBox (this, SW_RES( RB_POS_CHAPTER)), - - aTemplFL (this, SW_RES( FL_TEMPL )), - aParaTemplLbl (this, SW_RES( FT_PARA_TEMPL)), - aParaTemplBox (this, SW_RES( LB_PARA_TEMPL)), - aPageTemplLbl (this, SW_RES( FT_PAGE_TEMPL)), - aPageTemplBox (this, SW_RES( LB_PAGE_TEMPL)), - - aCharTemplFL( this, SW_RES(FL_CHAR_TEMPL)), - aFtnCharAnchorTemplLbl( this, SW_RES( FT_ANCHR_CHARFMT)), - aFtnCharAnchorTemplBox( this, SW_RES( LB_ANCHR_CHARFMT)), - aFtnCharTextTemplLbl( this, SW_RES( FT_TEXT_CHARFMT)), - aFtnCharTextTemplBox( this, SW_RES( LB_TEXT_CHARFMT)), - - aContFL (this, SW_RES( FL_CONT )), - aContLbl (this, SW_RES( FT_CONT )), - aContEdit (this, SW_RES( ED_CONT )), - aContFromLbl (this, SW_RES( FT_CONT_FROM )), - aContFromEdit (this, SW_RES( ED_CONT_FROM )), - - aNumDoc(aNumCountBox.GetEntry(FTNNUM_DOC)), - aNumPage(aNumCountBox.GetEntry(FTNNUM_PAGE)), - aNumChapter(aNumCountBox.GetEntry(FTNNUM_CHAPTER)), - pSh( 0 ), - bPosDoc(sal_False), - bEndNote( bEN ) +SwEndNoteOptionPage::SwEndNoteOptionPage(Window *pParent, sal_Bool bEN, + const SfxItemSet &rSet) + : SfxTabPage(pParent, + bEN ? OString("EndnotePage") : OString("FootnotePage"), + bEN ? OUString("modules/swriter/ui/endnotepage.ui") : OUString("modules/swriter/ui/footnotepage.ui"), + rSet) + , pSh(0) + , bPosDoc(sal_False) + , bEndNote(bEN) { - FreeResource(); + get(m_pNumViewBox, "numberinglb"); + get(m_pOffsetLbl, "offset"); + get(m_pOffsetFld, "offsetnf"); + get(m_pPrefixED, "prefix"); + get(m_pSuffixED, "suffix"); - aPosPageBox.SetClickHdl(LINK(this, SwEndNoteOptionPage, PosPageHdl)); - aPosChapterBox.SetClickHdl(LINK(this, SwEndNoteOptionPage, PosChapterHdl)); - aNumCountBox.SetSelectHdl(LINK(this, SwEndNoteOptionPage, NumCountHdl)); + if (!bEndNote) + { + get(m_pNumCountBox, "countinglb"); + m_pNumCountBox->SetSelectHdl(LINK(this, SwEndNoteOptionPage, NumCountHdl)); + aNumDoc = m_pNumCountBox->GetEntry(FTNNUM_DOC); + aNumPage = m_pNumCountBox->GetEntry(FTNNUM_PAGE); + aNumChapter = m_pNumCountBox->GetEntry(FTNNUM_CHAPTER); + get(m_pPosPageBox, "pospagecb"); + m_pPosPageBox->SetClickHdl(LINK(this, SwEndNoteOptionPage, PosPageHdl)); + get(m_pPosChapterBox, "posdoccb"); + m_pPosChapterBox->SetClickHdl(LINK(this, SwEndNoteOptionPage, PosChapterHdl)); + get(m_pPosFT, "pos"); + m_pPosPageBox->SetAccessibleRelationMemberOf(m_pPosFT); + m_pPosChapterBox->SetAccessibleRelationMemberOf(m_pPosFT); + get(m_pContEdit, "conted"); + get(m_pContFromEdit, "contfromed"); + } - aPosPageBox.SetAccessibleRelationMemberOf(&aPosFT); - aPosChapterBox.SetAccessibleRelationMemberOf(&aPosFT); + get(m_pStylesContainer, "allstyles"); + get(m_pParaTemplBox, "parastylelb"); + get(m_pPageTemplLbl, "pagestyleft"); + get(m_pPageTemplBox, "pagestylelb"); + get(m_pFtnCharAnchorTemplBox, "charanchorstylelb"); + get(m_pFtnCharTextTemplBox, "charstylelb"); + + long nWidth = std::max(std::max( + m_pPrefixED->get_preferred_size().Width(), + m_pSuffixED->get_preferred_size().Width()), + m_pNumViewBox->get_preferred_size().Width()); + m_pPrefixED->set_width_request(nWidth); + m_pSuffixED->set_width_request(nWidth); + m_pNumViewBox->set_width_request(nWidth); } void SwEndNoteOptionPage::Reset( const SfxItemSet& ) @@ -148,29 +143,11 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) SfxObjectShell * pDocSh = SfxObjectShell::Current(); sal_uInt16 i; - if(PTR_CAST(SwWebDocShell, pDocSh)) - { - aParaTemplLbl .Hide(); - aParaTemplBox .Hide(); - aPageTemplLbl .Hide(); - aPageTemplBox .Hide(); - aFtnCharTextTemplLbl.Hide(); - aFtnCharTextTemplBox.Hide(); - aFtnCharAnchorTemplLbl.Hide(); - aFtnCharAnchorTemplBox.Hide(); - aCharTemplFL .Hide(); - aTemplFL .Hide(); - } + if (PTR_CAST(SwWebDocShell, pDocSh)) + m_pStylesContainer->Hide(); + if ( bEndNote ) { - aPosPageBox.Hide(); - aPosChapterBox.Hide(); - aNumCountBox.Hide(); - aContLbl.Hide(); - aContEdit.Hide(); - aContFromLbl.Hide(); - aContFromEdit.Hide(); - aContFL.Hide(); bPosDoc = sal_True; } else @@ -179,20 +156,20 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) // set position (page, chapter) if ( rInf.ePos == FTNPOS_PAGE ) { - aPosPageBox.Check(); - aPageTemplLbl.Enable(sal_False); - aPageTemplBox.Enable(sal_False); + m_pPosPageBox->Check(); + m_pPageTemplLbl->Enable(sal_False); + m_pPageTemplBox->Enable(sal_False); } else { - aPosChapterBox.Check(); - aNumCountBox.RemoveEntry(aNumPage); - aNumCountBox.RemoveEntry(aNumChapter); + m_pPosChapterBox->Check(); + m_pNumCountBox->RemoveEntry(aNumPage); + m_pNumCountBox->RemoveEntry(aNumChapter); bPosDoc = sal_True; } // reference tests - aContEdit.SetText(rInf.aQuoVadis); - aContFromEdit.SetText(rInf.aErgoSum); + m_pContEdit->SetText(rInf.aQuoVadis); + m_pContFromEdit->SetText(rInf.aErgoSum); // collected SelectNumbering(rInf.eNum); @@ -200,19 +177,19 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) // numbering // art - aNumViewBox.SelectNumberingType( pInf->aFmt.GetNumberingType()); - aOffsetFld.SetValue(pInf->nFtnOffset + 1); - aPrefixED.SetText(pInf->GetPrefix()); - aSuffixED.SetText(pInf->GetSuffix()); + m_pNumViewBox->SelectNumberingType( pInf->aFmt.GetNumberingType()); + m_pOffsetFld->SetValue(pInf->nFtnOffset + 1); + m_pPrefixED->SetText(pInf->GetPrefix()); + m_pSuffixED->SetText(pInf->GetSuffix()); const SwCharFmt* pCharFmt = pInf->GetCharFmt( *pSh->GetView().GetDocShell()->GetDoc()); - aFtnCharTextTemplBox.SelectEntry(pCharFmt->GetName()); - aFtnCharTextTemplBox.SaveValue(); + m_pFtnCharTextTemplBox->SelectEntry(pCharFmt->GetName()); + m_pFtnCharTextTemplBox->SaveValue(); pCharFmt = pInf->GetAnchorCharFmt( *pSh->GetDoc() ); - aFtnCharAnchorTemplBox.SelectEntry( pCharFmt->GetName() ); - aFtnCharAnchorTemplBox.SaveValue(); + m_pFtnCharAnchorTemplBox->SelectEntry( pCharFmt->GetName() ); + m_pFtnCharAnchorTemplBox->SaveValue(); // styles special regions // paragraph @@ -221,45 +198,45 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& ) SfxStyleSheetBase *pStyle = pStyleSheetPool->First(); while(pStyle) { - aParaTemplBox.InsertEntry(pStyle->GetName()); + m_pParaTemplBox->InsertEntry(pStyle->GetName()); pStyle = pStyleSheetPool->Next(); } String sStr; SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(bEndNote ? RES_POOLCOLL_ENDNOTE : RES_POOLCOLL_FOOTNOTE), sStr ); - if(LISTBOX_ENTRY_NOTFOUND == aParaTemplBox.GetEntryPos( sStr ) ) - aParaTemplBox.InsertEntry( sStr ); + if(LISTBOX_ENTRY_NOTFOUND == m_pParaTemplBox->GetEntryPos( sStr ) ) + m_pParaTemplBox->InsertEntry( sStr ); SwTxtFmtColl* pColl = pInf->GetFtnTxtColl(); if( !pColl ) - aParaTemplBox.SelectEntry( sStr ); // Default + m_pParaTemplBox->SelectEntry( sStr ); // Default else { OSL_ENSURE(!pColl->IsDefault(), "default style for footnotes is wrong"); - const sal_uInt16 nPos = aParaTemplBox.GetEntryPos(pColl->GetName()); + const sal_uInt16 nPos = m_pParaTemplBox->GetEntryPos(pColl->GetName()); if( LISTBOX_ENTRY_NOTFOUND != nPos ) - aParaTemplBox.SelectEntryPos( nPos ); + m_pParaTemplBox->SelectEntryPos( nPos ); else { - aParaTemplBox.InsertEntry(pColl->GetName()); - aParaTemplBox.SelectEntry(pColl->GetName()); + m_pParaTemplBox->InsertEntry(pColl->GetName()); + m_pParaTemplBox->SelectEntry(pColl->GetName()); } } // page for( i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i ) - aPageTemplBox.InsertEntry(SwStyleNameMapper::GetUIName( i, aEmptyStr )); + m_pPageTemplBox->InsertEntry(SwStyleNameMapper::GetUIName( i, aEmptyStr )); sal_uInt16 nCount = pSh->GetPageDescCnt(); for(i = 0; i < nCount; ++i) { const SwPageDesc &rPageDesc = pSh->GetPageDesc(i); - if(LISTBOX_ENTRY_NOTFOUND == aPageTemplBox.GetEntryPos(rPageDesc.GetName())) - aPageTemplBox.InsertEntry(rPageDesc.GetName()); + if(LISTBOX_ENTRY_NOTFOUND == m_pPageTemplBox->GetEntryPos(rPageDesc.GetName())) + m_pPageTemplBox->InsertEntry(rPageDesc.GetName()); } - aPageTemplBox.SelectEntry( pInf->GetPageDesc( *pSh->GetDoc() )->GetName()); + m_pPageTemplBox->SelectEntry( pInf->GetPageDesc( *pSh->GetDoc() )->GetName()); delete pInf; } @@ -296,15 +273,15 @@ void SwEndNoteOptionPage::SelectNumbering(int eNum) OSL_FAIL("Which numbering type?"); #endif } - aNumCountBox.SelectEntry(sSelect); - NumCountHdl( &aNumCountBox ); + m_pNumCountBox->SelectEntry(sSelect); + NumCountHdl(m_pNumCountBox); } int SwEndNoteOptionPage::GetNumbering() const { - const sal_uInt16 nPos = aNumCountBox.GetSelectEntryPos(); + const sal_uInt16 nPos = m_pNumCountBox->GetSelectEntryPos(); return (int) bPosDoc? nPos + 1: nPos; } @@ -312,12 +289,12 @@ void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell ) { pSh = &rShell; // collect character templates - aFtnCharTextTemplBox.Clear(); - aFtnCharAnchorTemplBox.Clear(); - ::FillCharStyleListBox(aFtnCharTextTemplBox, + m_pFtnCharTextTemplBox->Clear(); + m_pFtnCharAnchorTemplBox->Clear(); + ::FillCharStyleListBox(*m_pFtnCharTextTemplBox, pSh->GetView().GetDocShell()); - ::FillCharStyleListBox(aFtnCharAnchorTemplBox, + ::FillCharStyleListBox(*m_pFtnCharAnchorTemplBox, pSh->GetView().GetDocShell()); } @@ -331,14 +308,14 @@ IMPL_LINK_NOARG(SwEndNoteOptionPage, PosPageHdl) { const SwFtnNum eNum = (const SwFtnNum)GetNumbering(); bPosDoc = sal_False; - if(LISTBOX_ENTRY_NOTFOUND == aNumCountBox.GetEntryPos(aNumPage)) + if(LISTBOX_ENTRY_NOTFOUND == m_pNumCountBox->GetEntryPos(aNumPage)) { - aNumCountBox.InsertEntry(aNumPage, FTNNUM_PAGE); - aNumCountBox.InsertEntry(aNumChapter, FTNNUM_CHAPTER); + m_pNumCountBox->InsertEntry(aNumPage, FTNNUM_PAGE); + m_pNumCountBox->InsertEntry(aNumChapter, FTNNUM_CHAPTER); SelectNumbering(eNum); } - aPageTemplLbl.Enable(sal_False); - aPageTemplBox.Enable(sal_False); + m_pPageTemplLbl->Enable(sal_False); + m_pPageTemplBox->Enable(sal_False); return 0; } @@ -346,13 +323,13 @@ IMPL_LINK_NOARG(SwEndNoteOptionPage, PosPageHdl) IMPL_LINK_NOARG(SwEndNoteOptionPage, NumCountHdl) { sal_Bool bEnable = sal_True; - if( aNumCountBox.GetEntryCount() - 1 != aNumCountBox.GetSelectEntryPos() ) + if( m_pNumCountBox->GetEntryCount() - 1 != m_pNumCountBox->GetSelectEntryPos() ) { bEnable = sal_False; - aOffsetFld.SetValue(1); + m_pOffsetFld->SetValue(1); } - aOffsetLbl.Enable(bEnable); - aOffsetFld.Enable(bEnable); + m_pOffsetLbl->Enable(bEnable); + m_pOffsetFld->Enable(bEnable); return 0; } @@ -369,10 +346,10 @@ IMPL_LINK_NOARG_INLINE_START(SwEndNoteOptionPage, PosChapterHdl) SelectNumbering(FTNNUM_DOC); bPosDoc = sal_True; - aNumCountBox.RemoveEntry(aNumPage); - aNumCountBox.RemoveEntry(aNumChapter); - aPageTemplLbl.Enable(); - aPageTemplBox.Enable(); + m_pNumCountBox->RemoveEntry(aNumPage); + m_pNumCountBox->RemoveEntry(aNumChapter); + m_pPageTemplLbl->Enable(); + m_pPageTemplBox->Enable(); return 0; } IMPL_LINK_NOARG_INLINE_END(SwEndNoteOptionPage, PosChapterHdl) @@ -406,21 +383,21 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) { SwEndNoteInfo *pInf = bEndNote ? new SwEndNoteInfo() : new SwFtnInfo(); - pInf->nFtnOffset = static_cast< sal_uInt16 >(aOffsetFld.GetValue() -1); - pInf->aFmt.SetNumberingType(aNumViewBox.GetSelectedNumberingType() ); - pInf->SetPrefix(aPrefixED.GetText()); - pInf->SetSuffix(aSuffixED.GetText()); + pInf->nFtnOffset = static_cast< sal_uInt16 >(m_pOffsetFld->GetValue() -1); + pInf->aFmt.SetNumberingType(m_pNumViewBox->GetSelectedNumberingType() ); + pInf->SetPrefix(m_pPrefixED->GetText()); + pInf->SetSuffix(m_pSuffixED->GetText()); pInf->SetCharFmt( lcl_GetCharFormat( pSh, - aFtnCharTextTemplBox.GetSelectEntry() ) ); + m_pFtnCharTextTemplBox->GetSelectEntry() ) ); pInf->SetAnchorCharFmt( lcl_GetCharFormat( pSh, - aFtnCharAnchorTemplBox.GetSelectEntry() ) ); + m_pFtnCharAnchorTemplBox->GetSelectEntry() ) ); // paragraph template - sal_uInt16 nPos = aParaTemplBox.GetSelectEntryPos(); + sal_uInt16 nPos = m_pParaTemplBox->GetSelectEntryPos(); if(LISTBOX_ENTRY_NOTFOUND != nPos) { - const String aFmtName( aParaTemplBox.GetSelectEntry() ); + const String aFmtName( m_pParaTemplBox->GetSelectEntry() ); SwTxtFmtColl *pColl = pSh->GetParaStyle(aFmtName, SwWrtShell::GETSTYLE_CREATEANY); OSL_ENSURE(pColl, "paragraph style not found"); pInf->SetFtnTxtColl(*pColl); @@ -428,7 +405,7 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) // page template pInf->ChgPageDesc( pSh->FindPageDescByName( - aPageTemplBox.GetSelectEntry(), sal_True ) ); + m_pPageTemplBox->GetSelectEntry(), sal_True ) ); if ( bEndNote ) { @@ -438,10 +415,10 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & ) else { SwFtnInfo *pI = (SwFtnInfo*)pInf; - pI->ePos = aPosPageBox.IsChecked() ? FTNPOS_PAGE : FTNPOS_CHAPTER; + pI->ePos = m_pPosPageBox->IsChecked() ? FTNPOS_PAGE : FTNPOS_CHAPTER; pI->eNum = (SwFtnNum)GetNumbering(); - pI->aQuoVadis = aContEdit.GetText(); - pI->aErgoSum = aContFromEdit.GetText(); + pI->aQuoVadis = m_pContEdit->GetText(); + pI->aErgoSum = m_pContFromEdit->GetText(); if ( !(*pI == pSh->GetFtnInfo()) ) pSh->SetFtnInfo( *pI ); } diff --git a/sw/source/ui/misc/docfnote.hrc b/sw/source/ui/misc/docfnote.hrc deleted file mode 100644 index a54f1642d690..000000000000 --- a/sw/source/ui/misc/docfnote.hrc +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#define RB_POS_PAGE 1 -#define RB_POS_CHAPTER 2 -#define FT_POS 3 -#define FT_NUMTYPE 4 -#define FT_NUMCOUNT 5 - -#define LB_NUMVIEW 10 -#define LB_NUMCOUNT 11 -#define FLD_OFFSET 12 -#define FT_OFFSET 13 -#define FL_NUM 14 - -#define LB_PARA_TEMPL 30 -#define LB_PAGE_TEMPL 31 -#define FT_PARA_TEMPL 32 -#define FT_PAGE_TEMPL 33 -#define FL_TEMPL 34 - -#define FT_CONT 40 -#define ED_CONT 41 -#define FT_CONT_FROM 42 -#define ED_CONT_FROM 43 -#define FL_CONT 44 - -#define FT_PREFIX 45 -#define ED_PREFIX 46 -#define FT_SUFFIX 47 -#define ED_SUFFIX 48 -#define FT_TEXT_CHARFMT 49 -#define LB_TEXT_CHARFMT 50 -#define FT_ANCHR_CHARFMT 51 -#define FL_CHAR_TEMPL 52 -#define LB_ANCHR_CHARFMT 53 - diff --git a/sw/source/ui/misc/docfnote.src b/sw/source/ui/misc/docfnote.src index e9c77c6db247..99f5b08407d7 100644 --- a/sw/source/ui/misc/docfnote.src +++ b/sw/source/ui/misc/docfnote.src @@ -26,7 +26,6 @@ ************************************************************************/ #include "misc.hrc" -#include "docfnote.hrc" #include "helpid.h" #include "cmdid.h" #include "frmui.hrc" @@ -36,6 +35,7 @@ TabDialog DLG_DOC_FOOTNOTE SVLook = TRUE ; Text [ en-US ] = "Footnotes/Endnotes Settings" ; Moveable = TRUE ; + Sizeable = TRUE ; TabControl 1 { OutputSize = TRUE ; @@ -56,507 +56,3 @@ TabDialog DLG_DOC_FOOTNOTE }; }; }; -TabPage TP_FOOTNOTEOPTION -{ - SVLook = TRUE ; - Hide = TRUE; - HelpID = HID_FOOTNOTE_OPTIONS ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - FixedLine FL_NUM - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "AutoNumbering" ; - Group = TRUE ; - }; - FixedText FT_NUMTYPE - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 51 , 8 ) ; - Text [ en-US ] = "Num~bering"; - }; - ListBox LB_NUMVIEW - { - HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_NUMVIEW"; - Border = TRUE ; - Pos = MAP_APPFONT ( 65 , 14 ) ; - Size = MAP_APPFONT ( 59 , 72 ) ; - TabStop = TRUE ; - Group = TRUE ; - DropDown = TRUE ; - }; - FixedText FT_OFFSET - { - Pos = MAP_APPFONT ( 130 , 16 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Start at" ; - }; - NumericField FLD_OFFSET - { - HelpID = "sw:NumericField:TP_FOOTNOTEOPTION:FLD_OFFSET"; - Pos = MAP_APPFONT ( 189 , 14 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - Last = 9999 ; - Maximum = 9999 ; - TabStop = TRUE ; - Border = TRUE ; - }; - FixedText FT_NUMCOUNT - { - Pos = MAP_APPFONT ( 12 , 31 ) ; - Size = MAP_APPFONT ( 51 , 8 ) ; - Text [ en-US ] = "~Counting"; - }; - ListBox LB_NUMCOUNT - { - HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_NUMCOUNT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 65 , 29 ) ; - Size = MAP_APPFONT ( 59 , 50 ) ; - TabStop = TRUE ; - Group = TRUE ; - DropDown = TRUE ; - CurPos = 0 ; - StringList [ en-US ] = - { - < "Per page" ; > ; - < "Per chapter" ; > ; - < "Per document" ; > ; - }; - }; - FixedText FT_PREFIX - { - Pos = MAP_APPFONT ( 12 , 46 ) ; - Size = MAP_APPFONT ( 48 , 8 ) ; - Text [ en-US ] = "~Before" ; - Left = TRUE ; - }; - Edit ED_PREFIX - { - HelpID = "sw:Edit:TP_FOOTNOTEOPTION:ED_PREFIX"; - Border = TRUE ; - Pos = MAP_APPFONT ( 65 , 44 ) ; - Size = MAP_APPFONT ( 59 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; - FixedText FT_SUFFIX - { - Pos = MAP_APPFONT ( 130 , 46 ) ; - Size = MAP_APPFONT ( 48 , 8 ) ; - Text [ en-US ] = "~After" ; - Left = TRUE ; - }; - Edit ED_SUFFIX - { - HelpID = "sw:Edit:TP_FOOTNOTEOPTION:ED_SUFFIX"; - Border = TRUE ; - Pos = MAP_APPFONT ( 189 , 44 ) ; - Size = MAP_APPFONT ( 59 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; - FixedText FT_POS - { - Pos = MAP_APPFONT ( 12 , 63 ) ; - Size = MAP_APPFONT ( 36 , 8 ) ; - Text [ en-US ] = "Position" ; - }; - RadioButton RB_POS_PAGE - { - HelpID = "sw:RadioButton:TP_FOOTNOTEOPTION:RB_POS_PAGE"; - Pos = MAP_APPFONT ( 65 , 62 ) ; - Size = MAP_APPFONT ( 150 , 10 ) ; - Text [ en-US ] = "~End of page" ; - TabStop = TRUE ; - Group = TRUE ; - }; - RadioButton RB_POS_CHAPTER - { - HelpID = "sw:RadioButton:TP_FOOTNOTEOPTION:RB_POS_CHAPTER"; - Pos = MAP_APPFONT ( 65 , 75 ) ; - Size = MAP_APPFONT ( 150 , 10 ) ; - Text [ en-US ] = "En~d of document" ; - }; - FixedLine FL_TEMPL - { - Pos = MAP_APPFONT ( 6 , 89 ) ; - Size = MAP_APPFONT ( 103 , 8 ) ; - Text [ en-US ] = "Styles" ; - }; - FixedText FT_PARA_TEMPL - { - Pos = MAP_APPFONT ( 12 , 102 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "Pa~ragraph" ; - Left = TRUE ; - }; - ListBox LB_PARA_TEMPL - { - HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_PARA_TEMPL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 48 , 100 ) ; - Size = MAP_APPFONT ( 58 , 80 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - CurPos = 0 ; - Sort = TRUE ; - }; - FixedText FT_PAGE_TEMPL - { - Pos = MAP_APPFONT ( 12 , 118 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "~Page" ; - Left = TRUE ; - }; - ListBox LB_PAGE_TEMPL - { - HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_PAGE_TEMPL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 48 , 116) ; - Size = MAP_APPFONT ( 58 , 80 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedLine FL_CHAR_TEMPL - { - Pos = MAP_APPFONT ( 113 , 89 ) ; - Size = MAP_APPFONT ( 141 , 8 ) ; - - Text [ en-US ] = "Character Styles"; - }; - FixedText FT_ANCHR_CHARFMT - { - Pos = MAP_APPFONT ( 117 , 102 ) ; - Size = MAP_APPFONT ( 67 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "Te~xt area" ; - }; - ListBox LB_ANCHR_CHARFMT - { - HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_ANCHR_CHARFMT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 186 , 100 ) ; - Size = MAP_APPFONT ( 65 , 72 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - FixedText FT_TEXT_CHARFMT - { - Pos = MAP_APPFONT ( 117 , 118 ) ; - Size = MAP_APPFONT ( 67 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Footnote area" ; - }; - ListBox LB_TEXT_CHARFMT - { - HelpID = "sw:ListBox:TP_FOOTNOTEOPTION:LB_TEXT_CHARFMT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 186 , 116 ) ; - Size = MAP_APPFONT ( 65 , 72 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - FixedLine FL_CONT - { - Pos = MAP_APPFONT ( 6 , 134 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Continuation notice" ; - }; - FixedText FT_CONT - { - Pos = MAP_APPFONT ( 12 , 148 ) ; - Size = MAP_APPFONT ( 73 , 8 ) ; - Text [ en-US ] = "End ~of footnote" ; - Left = TRUE ; - }; - Edit ED_CONT - { - HelpID = "sw:Edit:TP_FOOTNOTEOPTION:ED_CONT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 88, 145 ) ; - Size = MAP_APPFONT ( 160 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 30 ; - }; - FixedText FT_CONT_FROM - { - Pos = MAP_APPFONT ( 12 , 163 ) ; - Size = MAP_APPFONT ( 73 , 8 ) ; - Text [ en-US ] = "Star~t of next page" ; - Left = TRUE ; - }; - Edit ED_CONT_FROM - { - HelpID = "sw:Edit:TP_FOOTNOTEOPTION:ED_CONT_FROM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 88 , 161 ) ; - Size = MAP_APPFONT ( 160 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 30 ; - }; -}; -TabPage TP_ENDNOTEOPTION -{ - SVLook = TRUE ; - Hide = TRUE; - HelpID = HID_ENDNOTE_OPTIONS ; - Pos = MAP_APPFONT ( 0 , 0 ) ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - FixedLine FL_NUM - { - Pos = MAP_APPFONT ( 6 , 2 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "AutoNumbering" ; - Group = TRUE ; - }; - FixedText FT_NUMTYPE - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 51 , 8 ) ; - Text [ en-US ] = "~Numbering"; - }; - ListBox LB_NUMVIEW - { - HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_NUMVIEW"; - Border = TRUE ; - Pos = MAP_APPFONT ( 65 , 14 ) ; - Size = MAP_APPFONT ( 59 , 72 ) ; - TabStop = TRUE ; - Group = TRUE ; - DropDown = TRUE ; - CurPos = 0 ; - StringList = - { - "A, B, C" ; - "a, b, c" ; - "I, II, III" ; - "i, ii, iii" ; - "1, 2, 3" ; - "A, .., AA, .., AAA" ; - "a, .., aa, .., aaa" ; - }; - }; - FixedText FT_OFFSET - { - Pos = MAP_APPFONT ( 130 , 16 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Start at" ; - }; - NumericField FLD_OFFSET - { - HelpID = "sw:NumericField:TP_ENDNOTEOPTION:FLD_OFFSET"; - Pos = MAP_APPFONT ( 189 , 14 ) ; - Size = MAP_APPFONT ( 30 , 12 ) ; - Spin = TRUE ; - Minimum = 1 ; - First = 1 ; - Last = 9999 ; - Maximum = 9999 ; - TabStop = TRUE ; - Border = TRUE ; - }; - FixedText FT_NUMCOUNT - { - Pos = MAP_APPFONT ( 82 , 14 ) ; - Size = MAP_APPFONT ( 36 , 8 ) ; - Hide = TRUE; - }; - ListBox LB_NUMCOUNT - { - HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_NUMCOUNT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 27 ) ; - Size = MAP_APPFONT ( 62 , 72 ) ; - Hide = TRUE; - }; - FixedText FT_PREFIX - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 48 , 8 ) ; - - Text [ en-US ] = "~Before" ; - Left = TRUE ; - }; - Edit ED_PREFIX - { - HelpID = "sw:Edit:TP_ENDNOTEOPTION:ED_PREFIX"; - Pos = MAP_APPFONT ( 65 , 30 ) ; - Size = MAP_APPFONT ( 59 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; - FixedText FT_SUFFIX - { - Pos = MAP_APPFONT ( 130 , 32 ) ; - Size = MAP_APPFONT ( 48 , 8 ) ; - Text [ en-US ] = "~After" ; - Left = TRUE ; - }; - Edit ED_SUFFIX - { - HelpID = "sw:Edit:TP_ENDNOTEOPTION:ED_SUFFIX"; - Pos = MAP_APPFONT ( 189 , 30 ) ; - Size = MAP_APPFONT ( 59 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 50 ; - }; - FixedText FT_POS - { - Pos = MAP_APPFONT ( 82 , 14 ) ; - Size = MAP_APPFONT ( 36 , 8 ) ; - Hide = TRUE; - }; - RadioButton RB_POS_PAGE - { - HelpID = "sw:RadioButton:TP_ENDNOTEOPTION:RB_POS_PAGE"; - Pos = MAP_APPFONT ( 12 , 104 ) ; - Size = MAP_APPFONT ( 60 , 10 ) ; - Text [ en-US ] = "End ~of page" ; - TabStop = TRUE ; - Group = TRUE ; - }; - RadioButton RB_POS_CHAPTER - { - HelpID = "sw:RadioButton:TP_ENDNOTEOPTION:RB_POS_CHAPTER"; - Pos = MAP_APPFONT ( 12 , 118 ) ; - Size = MAP_APPFONT ( 60 , 10 ) ; - Text [ en-US ] = "End of ~document" ; - }; - FixedLine FL_TEMPL - { - Pos = MAP_APPFONT ( 6 , 46 ) ; - Size = MAP_APPFONT ( 115 , 8 ) ; - Text [ en-US ] = "Styles" ; - }; - FixedText FT_PARA_TEMPL - { - Pos = MAP_APPFONT ( 12 , 58 ) ; - Size = MAP_APPFONT ( 38 , 8 ) ; - Text [ en-US ] = "Pa~ragraph" ; - Left = TRUE ; - }; - ListBox LB_PARA_TEMPL - { - HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_PARA_TEMPL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 51 , 56 ) ; - Size = MAP_APPFONT ( 67 , 72 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - CurPos = 0 ; - Sort = TRUE ; - }; - FixedText FT_PAGE_TEMPL - { - Pos = MAP_APPFONT ( 12 , 74 ) ; - Size = MAP_APPFONT ( 38 , 8 ) ; - Text [ en-US ] = "~Page" ; - Left = TRUE ; - }; - ListBox LB_PAGE_TEMPL - { - HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_PAGE_TEMPL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 51 , 72 ) ; - Size = MAP_APPFONT ( 67 , 72 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - FixedLine FL_CHAR_TEMPL - { - Pos = MAP_APPFONT ( 125 , 46 ) ; - Size = MAP_APPFONT ( 129 , 8 ) ; - Text [ en-US ] = "Character Styles"; - }; - FixedText FT_ANCHR_CHARFMT - { - Pos = MAP_APPFONT ( 129 , 58 ) ; - Size = MAP_APPFONT ( 55 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "Te~xt area" ; - }; - ListBox LB_ANCHR_CHARFMT - { - HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_ANCHR_CHARFMT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 186 , 56 ) ; - Size = MAP_APPFONT ( 65 , 72 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - FixedText FT_TEXT_CHARFMT - { - Pos = MAP_APPFONT ( 129 , 74 ) ; - Size = MAP_APPFONT ( 55 , 8 ) ; - Left = TRUE ; - Text [ en-US ] = "~Endnote area" ; - }; - ListBox LB_TEXT_CHARFMT - { - HelpID = "sw:ListBox:TP_ENDNOTEOPTION:LB_TEXT_CHARFMT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 186 , 72 ) ; - Size = MAP_APPFONT ( 65 , 72 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - FixedLine FL_CONT - { - Pos = MAP_APPFONT ( 80 , 91 ) ; - Size = MAP_APPFONT ( 174 , 8 ) ; - Text [ en-US ] = "Continuation notice" ; - }; - FixedText FT_CONT - { - Pos = MAP_APPFONT ( 86 , 103 ) ; - Size = MAP_APPFONT ( 38 , 8 ) ; - Text [ en-US ] = "~Following page" ; - Left = TRUE ; - }; - Edit ED_CONT - { - HelpID = "sw:Edit:TP_ENDNOTEOPTION:ED_CONT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 137 , 101 ) ; - Size = MAP_APPFONT ( 114 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 30 ; - }; - FixedText FT_CONT_FROM - { - Pos = MAP_APPFONT ( 86 , 118 ) ; - Size = MAP_APPFONT ( 38 , 8 ) ; - Text [ en-US ] = "~Start" ; - Left = TRUE ; - }; - Edit ED_CONT_FROM - { - HelpID = "sw:Edit:TP_ENDNOTEOPTION:ED_CONT_FROM"; - Border = TRUE ; - Pos = MAP_APPFONT ( 137 , 116 ) ; - Size = MAP_APPFONT ( 114 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - MaxTextLength = 30 ; - }; -}; diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index fce09987c2de..b0cb52534d0e 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -114,7 +114,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(Window * pParent, sTemp += '\t'; pData->sPath = aPathLB.GetEntry((sal_uInt16)sGroup.GetToken(1, GLOS_DELIM).ToInt32()); sTemp += pData->sPath; - SvLBoxEntry* pEntry = aGroupTLB.InsertEntry(sTemp); + SvTreeListEntry* pEntry = aGroupTLB.InsertEntry(sTemp); pEntry->SetUserData(pData); } @@ -142,7 +142,7 @@ void SwGlossaryGroupDlg::Apply() //when the current group is deleted, the current group has to be relocated if(aGroupTLB.GetEntryCount()) { - SvLBoxEntry* pFirst = aGroupTLB.First(); + SvTreeListEntry* pFirst = aGroupTLB.First(); GlosBibUserData* pUserData = (GlosBibUserData*)pFirst->GetUserData(); pGlosHdl->SetCurGroup(pUserData->sGroupName); } @@ -192,7 +192,7 @@ void SwGlossaryGroupDlg::Apply() IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG ) { aNewPB.Enable(sal_False); - SvLBoxEntry* pFirstEntry = aGroupTLB.FirstSelected(); + SvTreeListEntry* pFirstEntry = aGroupTLB.FirstSelected(); if(pFirstEntry) { GlosBibUserData* pUserData = (GlosBibUserData*)pFirstEntry->GetUserData(); @@ -202,7 +202,7 @@ IMPL_LINK( SwGlossaryGroupDlg, SelectHdl, SvTabListBox*, EMPTYARG ) sal_uLong nPos = aGroupTLB.GetEntryPos(sName, 0); if( 0xffffffff > nPos) { - SvLBoxEntry* pEntry = aGroupTLB.GetEntry(nPos); + SvTreeListEntry* pEntry = aGroupTLB.GetEntry(nPos); GlosBibUserData* pFoundData = (GlosBibUserData*)pEntry->GetUserData(); String sGroup = pFoundData->sGroupName; bExists = sGroup == sEntry; @@ -224,7 +224,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, NewHdl) String sTemp(aNameED.GetText()); sTemp += '\t'; sTemp += aPathLB.GetSelectEntry(); - SvLBoxEntry* pEntry = aGroupTLB.InsertEntry(sTemp); + SvTreeListEntry* pEntry = aGroupTLB.InsertEntry(sTemp); GlosBibUserData* pData = new GlosBibUserData; pData->sPath = aPathLB.GetSelectEntry(); pData->sGroupName = sGroup; @@ -239,7 +239,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, NewHdl) IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton ) { - SvLBoxEntry* pEntry = aGroupTLB.FirstSelected(); + SvTreeListEntry* pEntry = aGroupTLB.FirstSelected(); if(!pEntry) { pButton->Enable(sal_False); @@ -293,7 +293,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton ) IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl) { - SvLBoxEntry* pEntry = aGroupTLB.FirstSelected(); + SvTreeListEntry* pEntry = aGroupTLB.FirstSelected(); GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData(); String sEntryText(aGroupTLB.GetEntryText(pEntry)); String sEntry(pUserData->sGroupName); @@ -385,7 +385,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, ModifyHdl) aGroupTLB.MakeVisible(aGroupTLB.GetEntry( nPos )); } } - SvLBoxEntry* pEntry = aGroupTLB.FirstSelected(); + SvTreeListEntry* pEntry = aGroupTLB.FirstSelected(); if(pEntry) { GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData(); @@ -432,7 +432,7 @@ void FEdit::KeyInput( const KeyEvent& rKEvent ) void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt ) { Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); - SvLBoxEntry* pEntry = GetEntry( aPos ); + SvTreeListEntry* pEntry = GetEntry( aPos ); if(pEntry) { SvLBoxTab* pTab; diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 7448a13f09ed..e59447e5a603 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -299,10 +299,10 @@ SwGlossaryDlg::~SwGlossaryDlg() ------------------------------------------------------------------------*/ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox ) { - SvLBoxEntry* pEntry = pBox->FirstSelected(); + SvTreeListEntry* pEntry = pBox->FirstSelected(); if(!pEntry) return 0; - SvLBoxEntry* pParent = pBox->GetParent(pEntry) ? pBox->GetParent(pEntry) : pEntry; + SvTreeListEntry* pParent = pBox->GetParent(pEntry) ? pBox->GetParent(pEntry) : pEntry; GroupUserData* pGroupData = (GroupUserData*)pParent->GetUserData(); String *pGlosGroup = ::GetCurrGlosGroup(); (*pGlosGroup) = pGroupData->sGroupName; @@ -366,11 +366,11 @@ void SwGlossaryDlg::Apply() /* -------------------------------------------------- * does the title exist in the selected group? * --------------------------------------------------*/ -SvLBoxEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock, +SvTreeListEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock, const String& rShort) { // look for possible entry in TreeListBox - SvLBoxEntry* pEntry = aCategoryBox.FirstSelected(); + SvTreeListEntry* pEntry = aCategoryBox.FirstSelected(); if(pEntry) { if(aCategoryBox.GetParent(pEntry)) @@ -378,7 +378,7 @@ SvLBoxEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock, sal_uInt32 nChildCount = aCategoryBox.GetChildCount( pEntry ); for(sal_uInt32 i = 0; i < nChildCount; i++) { - SvLBoxEntry* pChild = aCategoryBox.GetEntry( pEntry, i ); + SvTreeListEntry* pChild = aCategoryBox.GetEntry( pEntry, i ); if(rBlock == aCategoryBox.GetEntryText(pChild) && (!rShort.Len() || rShort == *(String*)pChild->GetUserData())) { @@ -434,7 +434,7 @@ IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit ) IMPL_LINK_INLINE_START( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, pBox ) { - SvLBoxEntry* pEntry = pBox->FirstSelected(); + SvTreeListEntry* pEntry = pBox->FirstSelected(); if(pBox->GetParent(pEntry) && !bIsDocReadOnly) EndDialog( RET_OK ); return 0; @@ -443,7 +443,7 @@ IMPL_LINK_INLINE_END( SwGlossaryDlg, NameDoubleClick, SvTreeListBox*, pBox ) IMPL_LINK( SwGlossaryDlg, EnableHdl, Menu *, pMn ) { - SvLBoxEntry* pEntry = aCategoryBox.FirstSelected(); + SvTreeListEntry* pEntry = aCategoryBox.FirstSelected(); const String aEditText(aNameED.GetText()); const sal_Bool bHasEntry = aEditText.Len() && aShortNameEdit.GetText().Len(); @@ -492,11 +492,11 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) } if(pGlossaryHdl->NewGlossary(aStr, aShortName, sal_False, bNoAttr )) { - SvLBoxEntry* pEntry = aCategoryBox.FirstSelected(); + SvTreeListEntry* pEntry = aCategoryBox.FirstSelected(); if(aCategoryBox.GetParent(pEntry)) pEntry = aCategoryBox.GetParent(pEntry); - SvLBoxEntry* pChild = aCategoryBox.InsertEntry(aStr, pEntry); + SvTreeListEntry* pChild = aCategoryBox.InsertEntry(aStr, pEntry); pChild->SetUserData(new String(aShortName)); aNameED.SetText(aStr); aShortNameEdit.SetText(aShortName); @@ -534,8 +534,8 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) pNewNameDlg->GetNewShort(), pNewNameDlg->GetNewName())) { - SvLBoxEntry* pEntry = aCategoryBox.FirstSelected(); - SvLBoxEntry* pNewEntry = aCategoryBox.InsertEntry( + SvTreeListEntry* pEntry = aCategoryBox.FirstSelected(); + SvTreeListEntry* pNewEntry = aCategoryBox.InsertEntry( pNewNameDlg->GetNewName(), aCategoryBox.GetParent(pEntry)); pNewEntry->SetUserData(new String(pNewNameDlg->GetNewShort())); delete (String*)pEntry->GetUserData(); @@ -556,9 +556,9 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) const String aTitle(aNameED.GetText()); if(aTitle.Len() && pGlossaryHdl->DelGlossary(aShortName)) { - SvLBoxEntry* pChild = DoesBlockExist(aTitle, aShortName); + SvTreeListEntry* pChild = DoesBlockExist(aTitle, aShortName); OSL_ENSURE(pChild, "entry not found!"); - SvLBoxEntry* pParent = aCategoryBox.GetParent(pChild); + SvTreeListEntry* pParent = aCategoryBox.GetParent(pChild); aCategoryBox.Select(pParent); aCategoryBox.GetModel()->Remove(pChild); @@ -691,7 +691,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl) Init(); //if new groups were created - select one of them String sNewGroup = pDlg->GetCreatedGroupName(); - SvLBoxEntry* pEntry = aCategoryBox.First(); + SvTreeListEntry* pEntry = aCategoryBox.First(); while(sNewGroup.Len() && pEntry) { if(!aCategoryBox.GetParent(pEntry)) @@ -733,7 +733,7 @@ void SwGlossaryDlg::Init() aCategoryBox.Clear(); // display text block regions const sal_uInt16 nCnt = pGlossaryHdl->GetGroupCnt(); - SvLBoxEntry* pSelEntry = 0; + SvTreeListEntry* pSelEntry = 0; const String sSelStr(::GetCurrGlosGroup()->GetToken(0, GLOS_DELIM)); const sal_uInt16 nSelPath = static_cast< sal_uInt16 >(::GetCurrGlosGroup()->GetToken(1, GLOS_DELIM).ToInt32()); // #i66304# - "My AutoText" comes from mytexts.bau, but should be translated @@ -749,7 +749,7 @@ void SwGlossaryDlg::Init() sTitle = sGroupName.GetToken( 0, GLOS_DELIM ); if(sTitle == sMyAutoTextEnglish) sTitle = sMyAutoTextTranslated; - SvLBoxEntry* pEntry = aCategoryBox.InsertEntry( sTitle ); + SvTreeListEntry* pEntry = aCategoryBox.InsertEntry( sTitle ); sal_uInt16 nPath = static_cast< sal_uInt16 >(sGroupName.GetToken( 1, GLOS_DELIM ).ToInt32()); GroupUserData* pData = new GroupUserData; @@ -768,7 +768,7 @@ void SwGlossaryDlg::Init() for(sal_uInt16 i = 0; i < nCount; ++i) { String sGroupTitle(pGlossaryHdl->GetGlossaryName(i)); - SvLBoxEntry* pChild = aCategoryBox.InsertEntry( + SvTreeListEntry* pChild = aCategoryBox.InsertEntry( sGroupTitle, pEntry); pChild->SetUserData(new String(pGlossaryHdl->GetGlossaryShortName(i))); } @@ -778,7 +778,7 @@ void SwGlossaryDlg::Init() if(!pSelEntry) { //find a non-readonly group - SvLBoxEntry* pSearch = aCategoryBox.First(); + SvTreeListEntry* pSearch = aCategoryBox.First(); while(pSearch) { if(!aCategoryBox.GetParent(pSearch)) @@ -896,7 +896,7 @@ SwGlTreeListBox::SwGlTreeListBox(Window* pParent, const ResId& rResId) : void SwGlTreeListBox::Clear() { - SvLBoxEntry* pEntry = First(); + SvTreeListEntry* pEntry = First(); while(pEntry) { if(GetParent(pEntry)) @@ -911,7 +911,7 @@ void SwGlTreeListBox::Clear() void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt ) { Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); - SvLBoxEntry* pEntry = GetEntry( aPos ); + SvTreeListEntry* pEntry = GetEntry( aPos ); // there's only help for groups' names if(pEntry) { @@ -962,7 +962,7 @@ void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt ) DragDropMode SwGlTreeListBox::NotifyStartDrag( TransferDataContainer& /*rContainer*/, - SvLBoxEntry* pEntry ) + SvTreeListEntry* pEntry ) { DragDropMode eRet; pDragEntry = pEntry; @@ -971,7 +971,7 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag( else { SwGlossaryDlg* pDlg = (SwGlossaryDlg*)Window::GetParent(); - SvLBoxEntry* pParent = GetParent(pEntry); + SvTreeListEntry* pParent = GetParent(pEntry); GroupUserData* pGroupData = (GroupUserData*)pParent->GetUserData(); String sEntry(pGroupData->sGroupName); @@ -989,19 +989,19 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag( return eRet; } -sal_Bool SwGlTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry) +sal_Bool SwGlTreeListBox::NotifyAcceptDrop( SvTreeListEntry* pEntry) { // TODO: Readonly - check still missing! - SvLBoxEntry* pSrcParent = GetParent(pEntry) ? GetParent(pEntry) : pEntry; - SvLBoxEntry* pDestParent = + SvTreeListEntry* pSrcParent = GetParent(pEntry) ? GetParent(pEntry) : pEntry; + SvTreeListEntry* pDestParent = GetParent(pDragEntry ) ? GetParent(pDragEntry ) : pDragEntry ; return pDestParent != pSrcParent; } -sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& /*rpNewParent*/, +sal_Bool SwGlTreeListBox::NotifyMoving( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& /*rpNewParent*/, sal_uLong& /*rNewChildPos*/ ) { @@ -1012,8 +1012,8 @@ sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget, } // 1. move to different groups? // 2. allowed to write in both groups? - SvLBoxEntry* pSrcParent = GetParent(pEntry); - SvLBoxEntry* pDestParent = + SvTreeListEntry* pSrcParent = GetParent(pEntry); + SvTreeListEntry* pDestParent = GetParent(pTarget) ? GetParent(pTarget) : pTarget; sal_Bool bRet = sal_False; if(pDestParent != pSrcParent) @@ -1037,7 +1037,7 @@ sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget, sDestName, sTitle, sal_True ); if(bRet) { - SvLBoxEntry* pChild = InsertEntry(sTitle, pDestParent); + SvTreeListEntry* pChild = InsertEntry(sTitle, pDestParent); pChild->SetUserData(new String(sShortName)); GetModel()->Remove(pEntry); } @@ -1045,9 +1045,9 @@ sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget, return sal_False; // otherwise the entry is being set automatically } -sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, - SvLBoxEntry*& /*rpNewParent*/, +sal_Bool SwGlTreeListBox::NotifyCopying( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, + SvTreeListEntry*& /*rpNewParent*/, sal_uLong& /*rNewChildPos*/ ) { @@ -1058,8 +1058,8 @@ sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget, { pTarget = GetEntry(0); } - SvLBoxEntry* pSrcParent = GetParent(pEntry); - SvLBoxEntry* pDestParent = + SvTreeListEntry* pSrcParent = GetParent(pEntry); + SvTreeListEntry* pDestParent = GetParent(pTarget) ? GetParent(pTarget) : pTarget; sal_Bool bRet = sal_False; if(pDestParent != pSrcParent) @@ -1085,7 +1085,7 @@ sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget, sDestName, sTitle, sal_False ); if(bRet) { - SvLBoxEntry* pChild = InsertEntry(sTitle, pDestParent); + SvTreeListEntry* pChild = InsertEntry(sTitle, pDestParent); pChild->SetUserData(new String(sShortName)); } } @@ -1094,7 +1094,7 @@ sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget, String SwGlossaryDlg::GetCurrGrpName() const { - SvLBoxEntry* pEntry = aCategoryBox.FirstSelected(); + SvTreeListEntry* pEntry = aCategoryBox.FirstSelected(); String sRet; if(pEntry) { diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx index 8b6699f36e66..81bcdf435021 100644 --- a/sw/source/ui/misc/impfnote.hxx +++ b/sw/source/ui/misc/impfnote.hxx @@ -39,38 +39,27 @@ class SwWrtShell; class SwEndNoteOptionPage : public SfxTabPage { - FixedLine aNumFL; - FixedText aNumTypeFT; - SwNumberingTypeListBox aNumViewBox; - FixedText aOffsetLbl; - NumericField aOffsetFld; - FixedText aNumCountFT; - ListBox aNumCountBox; - FixedText aPrefixFT; - Edit aPrefixED; - FixedText aSuffixFT; - Edit aSuffixED; - FixedText aPosFT; - RadioButton aPosPageBox; - RadioButton aPosChapterBox; - - FixedLine aTemplFL; - FixedText aParaTemplLbl; - ListBox aParaTemplBox; - FixedText aPageTemplLbl; - ListBox aPageTemplBox; - - FixedLine aCharTemplFL; - FixedText aFtnCharAnchorTemplLbl; - ListBox aFtnCharAnchorTemplBox; - FixedText aFtnCharTextTemplLbl; - ListBox aFtnCharTextTemplBox; - - FixedLine aContFL; - FixedText aContLbl; - Edit aContEdit; - FixedText aContFromLbl; - Edit aContFromEdit; + SwNumberingTypeListBox* m_pNumViewBox; + FixedText* m_pOffsetLbl; + NumericField* m_pOffsetFld; + ListBox* m_pNumCountBox; + Edit* m_pPrefixED; + Edit* m_pSuffixED; + FixedText* m_pPosFT; + RadioButton* m_pPosPageBox; + RadioButton* m_pPosChapterBox; + + VclContainer *m_pStylesContainer; + + ListBox* m_pParaTemplBox; + FixedText* m_pPageTemplLbl; + ListBox* m_pPageTemplBox; + + ListBox* m_pFtnCharAnchorTemplBox; + ListBox* m_pFtnCharTextTemplBox; + + Edit* m_pContEdit; + Edit* m_pContFromEdit; String aNumDoc; String aNumPage; diff --git a/sw/source/ui/misc/insrule.cxx b/sw/source/ui/misc/insrule.cxx index 4d865e6cdd7b..20a7af373853 100644 --- a/sw/source/ui/misc/insrule.cxx +++ b/sw/source/ui/misc/insrule.cxx @@ -37,73 +37,69 @@ #include "docsh.hxx" #include "insrule.hxx" #include "swvset.hxx" -#include "insrule.hrc" +#include "app.hrc" #include "misc.hrc" #include "helpid.h" -SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) : - SfxModalDialog(pParent, SW_RES(DLG_INSERT_RULER)), - aSelectionFL(this, SW_RES(FL_SEL )), - aOkPB (this, SW_RES(PB_OK )), - aCancelPB (this, SW_RES(PB_CANCEL )), - aHelpPB (this, SW_RES(PB_HELP )), - - sSimple (SW_RES(ST_SIMPLE)), - nSelPos(USHRT_MAX), - pExampleVS (new SwRulerValueSet(this, SW_RES(VS_EXAMPLE ))) +SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) + : SfxModalDialog(pParent, "HorizontalRuleDialog", "modules/swriter/ui/horizontalrule.ui") + , m_sSimple(SW_RESSTR(STR_SIMPLE)) { - FreeResource(); - pExampleVS->SetLineCount(6); - pExampleVS->SetColCount(1); - pExampleVS->SetSelectHdl(LINK(this, SwInsertGrfRulerDlg, SelectHdl)); - pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl)); - pExampleVS->GrabFocus(); + get(m_pOkPB, "ok"); + get(m_pExampleVS, "rulers"); + + m_pExampleVS->SetLineCount(6); + m_pExampleVS->SetColCount(1); + m_pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl)); // determine graphic name GalleryExplorer::BeginLocking(GALLERY_THEME_RULERS); - GalleryExplorer::FillObjList( GALLERY_THEME_RULERS, aGrfNames ); - pExampleVS->SetHelpId(HID_VS_RULER); + GalleryExplorer::FillObjList(GALLERY_THEME_RULERS, m_aGrfNames); Color aColor(COL_WHITE); - pExampleVS->InsertItem( 1, 1); - pExampleVS->SetItemText( 1, sSimple); + m_pExampleVS->InsertItem(1, 1); + m_pExampleVS->SetItemText(1, m_sSimple); - for(sal_uInt16 i = 1; i <= aGrfNames.size(); i++) + for(sal_uInt16 i = 1; i <= m_aGrfNames.size(); ++i) { - pExampleVS->InsertItem( i + 1, i); - pExampleVS->SetItemText( i + 1, aGrfNames[i-1]); + m_pExampleVS->InsertItem( i + 1, i); + m_pExampleVS->SetItemText( i + 1, m_aGrfNames[i-1]); } - pExampleVS->Show(); + m_pExampleVS->SelectItem(1); } SwInsertGrfRulerDlg::~SwInsertGrfRulerDlg() { GalleryExplorer::EndLocking(GALLERY_THEME_RULERS); - delete pExampleVS; } -String SwInsertGrfRulerDlg::GetGraphicName() +bool SwInsertGrfRulerDlg::IsSimpleLine() const +{ + return m_pExampleVS->GetSelectItemId() == 1; +} + +OUString SwInsertGrfRulerDlg::GetGraphicName() const { - String sRet; + sal_uInt16 nSelPos = m_pExampleVS->GetSelectItemId(); + sal_uInt16 nSel = nSelPos - 2; //align selection position with ValueSet index - if(nSel < aGrfNames.size()) - sRet = URIHelper::SmartRel2Abs( - INetURLObject(), aGrfNames[nSel], + if(nSel < m_aGrfNames.size()) + { + return URIHelper::SmartRel2Abs(INetURLObject(), m_aGrfNames[nSel], URIHelper::GetMaybeFileHdl()); - return sRet; + } + return OUString(); } -IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS) +SwRulerValueSet::SwRulerValueSet(Window* pParent, WinBits nWinStyle) + : SvxBmpNumValueSet(pParent, nWinStyle) { - nSelPos = pVS->GetSelectItemId(); - aOkPB.Enable(); - return 0; + SetStyle(GetStyle() & ~WB_ITEMBORDER); } -SwRulerValueSet::SwRulerValueSet( Window* pParent, const ResId& rResId ) : - SvxBmpNumValueSet(pParent, rResId) +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwRulerValueSet(Window *pParent, VclBuilder::stringmap &) { - SetStyle( GetStyle() & ~WB_ITEMBORDER ); + return new SwRulerValueSet(pParent, WB_ITEMBORDER | WB_TABSTOP); } SwRulerValueSet::~SwRulerValueSet() diff --git a/sw/source/ui/misc/insrule.hrc b/sw/source/ui/misc/insrule.hrc deleted file mode 100644 index d9aaa3651081..000000000000 --- a/sw/source/ui/misc/insrule.hrc +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ - -#include "misc.hrc" - -#define FL_SEL 1 -#define VS_EXAMPLE 2 -#define PB_OK 3 -#define PB_CANCEL 4 -#define PB_HELP 5 -#define ST_SIMPLE 6 diff --git a/sw/source/ui/misc/insrule.src b/sw/source/ui/misc/insrule.src deleted file mode 100644 index e419907a8791..000000000000 --- a/sw/source/ui/misc/insrule.src +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ - -#include "insrule.hrc" -#include "helpid.h" -ModalDialog DLG_INSERT_RULER -{ - HelpID = HID_RULER_DIALOG ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 242 , 124 ) ; - Moveable = TRUE ; - FixedLine FL_SEL - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 174 , 8 ) ; - Text [ en-US ] = "Selection" ; - }; - Control VS_EXAMPLE - { - Pos = MAP_APPFONT ( 9 , 14 ) ; - Size = MAP_APPFONT ( 168 , 104 ) ; - Hide = TRUE ; - Border = TRUE ; - TabStop = TRUE ; - Group = TRUE ; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 186 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - Disable = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 186 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 186 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - String ST_SIMPLE - { - Text [ en-US ] = "Plain" ; - }; - Text [ en-US ] = "Insert Horizontal Rule" ; -}; diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx index c3e46aa4e52d..5ded9af6816a 100644 --- a/sw/source/ui/misc/numberingtypelistbox.cxx +++ b/sw/source/ui/misc/numberingtypelistbox.cxx @@ -80,7 +80,7 @@ bool SwNumberingTypeListBox::set_property(const rtl::OString &rKey, const rtl::O extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwNumberingTypeListBox(Window *pParent, VclBuilder::stringmap &) { SwNumberingTypeListBox *pListBox = new SwNumberingTypeListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK); - pListBox->SetBestDropDownLineCount(); + pListBox->EnableAutoSize(true); return pListBox; } diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index ebf8dea60323..466dc82fc19e 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -271,7 +271,7 @@ void SwRedlineAcceptDlg::Init(sal_uInt16 nStart) pTable->SetUpdateMode(sal_True); // #i69618# this moves the list box to the right position, visually - SvLBoxEntry* pSelEntry = pTable->FirstSelected(); + SvTreeListEntry* pSelEntry = pTable->FirstSelected(); if( pSelEntry ) pTable->MakeVisible( pSelEntry, sal_True ); //#i70937#, force the scroll } @@ -323,7 +323,7 @@ void SwRedlineAcceptDlg::InitAuthors() sal_Bool bEnable = pTable->GetEntryCount() != 0 && !pSh->getIDocumentRedlineAccess()->GetRedlinePassword().getLength(); sal_Bool bSel = pTable->FirstSelected() != 0; - SvLBoxEntry* pSelEntry = pTable->FirstSelected(); + SvTreeListEntry* pSelEntry = pTable->FirstSelected(); while (pSelEntry) { sal_uInt16 nPos = GetRedlinePos(*pSelEntry); @@ -628,7 +628,7 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRe pData->bDisabled = sal_True; sChild = GetRedlineText(rRedln, pData->aDateTime, nStack); - SvLBoxEntry* pChild = pTable->InsertEntry(sChild, pData, pParent->pTLBParent); + SvTreeListEntry* pChild = pTable->InsertEntry(sChild, pData, pParent->pTLBParent); pRedlineChild->pTLBChild = pChild; if (!bValidParent) @@ -668,7 +668,7 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd) // set the cursor after the last entry because otherwise performance problem in TLB. // TLB would otherwise reset the cursor at every Remove (expensive) sal_uInt16 nPos = Min((sal_uInt16)nCount, (sal_uInt16)aRedlineParents.size()); - SvLBoxEntry *pCurEntry = NULL; + SvTreeListEntry *pCurEntry = NULL; while( ( pCurEntry == NULL ) && ( nPos > 0 ) ) { --nPos; @@ -678,7 +678,7 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd) if (pCurEntry) pTable->SetCurEntry(pCurEntry); - SvLBoxTreeList* pModel = pTable->GetModel(); + SvTreeList* pModel = pTable->GetModel(); for (sal_uInt16 i = nStart; i <= nEnd; i++) { @@ -701,7 +701,7 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd) break; } } - SvLBoxEntry *pEntry = aRedlineParents[i].pTLBParent; + SvTreeListEntry *pEntry = aRedlineParents[i].pTLBParent; if (pEntry) { long nIdx = aLBoxArr.size() - 1L; @@ -740,7 +740,7 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd) return; // no redlines in the document RedlinData *pData; - SvLBoxEntry *pParent; + SvTreeListEntry *pParent; SwRedlineDataParent* pRedlineParent; const SwRedline* pCurrRedline; if( !nStart && !pTable->FirstSelected() ) @@ -792,10 +792,10 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd) void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept ) { SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr(); - SvLBoxEntry* pEntry = bSelect ? pTable->FirstSelected() : pTable->First(); + SvTreeListEntry* pEntry = bSelect ? pTable->FirstSelected() : pTable->First(); sal_uLong nPos = LONG_MAX; - typedef std::vector<SvLBoxEntry*> ListBoxEntries_t; + typedef std::vector<SvTreeListEntry*> ListBoxEntries_t; ListBoxEntries_t aRedlines; // don't activate @@ -888,7 +888,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept ) pTPView->EnableUndo(); } -sal_uInt16 SwRedlineAcceptDlg::GetRedlinePos( const SvLBoxEntry& rEntry ) const +sal_uInt16 SwRedlineAcceptDlg::GetRedlinePos( const SvTreeListEntry& rEntry ) const { SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr(); return pSh->FindRedlineOfData( *((SwRedlineDataParent*)((RedlinData *) @@ -973,14 +973,14 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, GotoHdl) //#107938# But not only ask pTable if it has the focus. To move // the selection to the selected redline any child of pParentDlg // may the focus. - SvLBoxEntry* pSelEntry = 0; + SvTreeListEntry* pSelEntry = 0; if (pParentDlg->HasChildPathFocus()) pSelEntry = pTable->FirstSelected(); if( pSelEntry ) { - SvLBoxEntry* pActEntry = pSelEntry; + SvTreeListEntry* pActEntry = pSelEntry; pSh->StartAction(); pSh->EnterStdMode(); pSh->SetCareWin(pParentDlg); @@ -1039,12 +1039,12 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl) case COMMAND_CONTEXTMENU: { SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr(); - SvLBoxEntry* pEntry = pTable->FirstSelected(); + SvTreeListEntry* pEntry = pTable->FirstSelected(); const SwRedline *pRed = 0; if (pEntry) { - SvLBoxEntry* pTopEntry = pEntry; + SvTreeListEntry* pTopEntry = pEntry; if (pTable->GetParent(pEntry)) pTopEntry = pTable->GetParent(pEntry); diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index 838089875998..ba66665db8b8 100644 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -429,8 +429,8 @@ void SwInputWindow::CancelFormula() } //================================================================== -const xub_Unicode CH_LRE = 0x202a; -const xub_Unicode CH_PDF = 0x202c; +const sal_Unicode CH_LRE = 0x202a; +const sal_Unicode CH_PDF = 0x202c; IMPL_LINK( SwInputWindow, SelTblCellsNotify, SwWrtShell *, pCaller ) { diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 27cf51430089..4464de851dbb 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -628,7 +628,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) if( !rSh.GetLinkManager().GetLinks().empty() ) { rSh.StartAllAction(); - rSh.GetLinkManager().UpdateAllLinks( sal_False, sal_True, sal_True ); + rSh.GetLinkManager().UpdateAllLinks( false, true, true ); rSh.EndAllAction(); } SfxDispatcher &rDis = *rTempView.GetViewFrame()->GetDispatcher(); @@ -1122,10 +1122,9 @@ void SwBaseShell::Execute(SfxRequest &rReq) { if( !rSh.GetLinkManager().GetLinks().empty() ) { - sal_Bool bUpdateGrf = sal_False, bCallErrHdl = sal_False; rSh.EnterStdMode(); rSh.StartAllAction(); - rSh.GetLinkManager().UpdateAllLinks( sal_False, bCallErrHdl, bUpdateGrf ); + rSh.GetLinkManager().UpdateAllLinks( false, false, false ); rSh.EndAllAction(); } } @@ -2136,9 +2135,9 @@ void SwBaseShell::GetTxtFontCtrlState( SfxItemSet& rSet ) aFont.SetCharSet(((const SvxFontItem*)pI)->GetCharSet()); } - sal_Bool bVertical = rSh.IsInVerticalText(); + bool bVertical = rSh.IsInVerticalText(); aFont.SetOrientation(bVertical ? 2700 : 0); - aFont.SetVertical(bVertical); + aFont.SetVertical(bVertical ? sal_True : sal_False); GetView().GetEditWin().SetInputContext( InputContext( aFont, INPUTCONTEXT_TEXT | INPUTCONTEXT_EXTTEXTINPUT ) ); } diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx index 69e7bed8b5fe..1db86541c8ca 100644 --- a/sw/source/ui/shells/drwbassh.cxx +++ b/sw/source/ui/shells/drwbassh.cxx @@ -282,7 +282,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if (bCaption) pSdrView->SetAttributes(*pOutSet); - sal_Bool bPosCorr = + bool bPosCorr = SFX_ITEM_SET != pOutSet->GetItemState( SID_ATTR_TRANSFORM_POS_X, sal_False ) && SFX_ITEM_SET != pOutSet->GetItemState( @@ -298,7 +298,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) { if(!bSingleSelection) pSh->ChgAnchor(((const SfxInt16Item*)pAnchorItem) - ->GetValue(), sal_False, bPosCorr ); + ->GetValue(), false, bPosCorr ); else { SwFmtAnchor aAnchor(pFrmFmt->GetAnchor()); diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index 321ce0aec7e4..37e0f49fbfac 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -166,8 +166,11 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) if (nSlot == SID_ATTR_CHAR_FONT) nScriptTypes = pOLV->GetSelectedScriptType(); - aSetItem.PutItemForScriptType( nScriptTypes, pNewAttrs->Get( nWhich ) ); - aNewAttr.Put( aSetItem.GetItemSet() ); + if (pNewAttrs) + { + aSetItem.PutItemForScriptType( nScriptTypes, pNewAttrs->Get( nWhich ) ); + aNewAttr.Put( aSetItem.GetItemSet() ); + } } break; diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 82c6bee50660..fd5eb1a656b0 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -837,7 +837,6 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) SwWrtShell &rSh = GetShell(); pSdrView = rSh.GetDrawView(); SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner(); - pOutliner = pSdrView->GetTextEditOutliner(); return &pOutliner->GetUndoManager(); } diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 20dd85f52a82..e9872370c616 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -1,30 +1,21 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* +/* + * This file is part of the LibreOffice project. * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * This file incorporates work covered by the following license notice: * - * 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. - * - ************************************************************************/ + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ #include <cmdid.h> #include <hintids.hxx> @@ -535,9 +526,6 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) rSh.GetCurAttr( aCoreSet ); sal_Bool bParentCntProt = 0 != rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ); sal_Bool bIsGrfCntnt = CNT_GRF == GetShell().GetCntType(); -// const GraphicObject* pGrfObj = ( bIsGrfCntnt ? rSh.GetGraphicObj() : NULL ); -// sal_Bool bIsRenderGraphicGrfCntnt = ( pGrfObj && pGrfObj->IsRenderGraphic() ); - SetGetStateSet( &rSet ); diff --git a/sw/source/ui/shells/listsh.cxx b/sw/source/ui/shells/listsh.cxx index 0c79f0213567..ca3e736b1269 100644 --- a/sw/source/ui/shells/listsh.cxx +++ b/sw/source/ui/shells/listsh.cxx @@ -158,9 +158,7 @@ void SwListShell::Execute(SfxRequest &rReq) SfxViewFrame * pFrame = GetView().GetViewFrame(); rReq.Done(); - rSh.NumUpDown( ( nSlot == FN_NUM_BULLET_DOWN ) - ? sal_True - : sal_False ); + rSh.NumUpDown( nSlot == FN_NUM_BULLET_DOWN ); pFrame->GetBindings().Invalidate( SID_TABLE_CELL ); // StatusZeile updaten! } break; @@ -189,7 +187,7 @@ void SwListShell::Execute(SfxRequest &rReq) if ( bOutline ) lcl_OutlineUpDownWithSubPoints( rSh, false, false ); else - rSh.MoveNumParas(sal_False, sal_False); + rSh.MoveNumParas(false, false); rReq.Done(); break; @@ -197,7 +195,7 @@ void SwListShell::Execute(SfxRequest &rReq) if ( bOutline ) lcl_OutlineUpDownWithSubPoints( rSh, true, false ); else - rSh.MoveNumParas(sal_True, sal_False); + rSh.MoveNumParas(true, false); rReq.Done(); break; @@ -205,7 +203,7 @@ void SwListShell::Execute(SfxRequest &rReq) if ( bOutline ) lcl_OutlineUpDownWithSubPoints( rSh, true, true ); else - rSh.MoveNumParas(sal_True, sal_True); + rSh.MoveNumParas(true, true); rReq.Done(); break; @@ -213,7 +211,7 @@ void SwListShell::Execute(SfxRequest &rReq) if ( bOutline ) lcl_OutlineUpDownWithSubPoints( rSh, false, true ); else - rSh.MoveNumParas(sal_False, sal_True); + rSh.MoveNumParas(false, true); rReq.Done(); break; diff --git a/sw/source/ui/shells/textglos.cxx b/sw/source/ui/shells/textglos.cxx index e2e5b8b630b7..09de6949d8c0 100644 --- a/sw/source/ui/shells/textglos.cxx +++ b/sw/source/ui/shells/textglos.cxx @@ -119,7 +119,7 @@ void SwTextShell::ExecGlossary(SfxRequest &rReq) if ( fnSetActGroup ) (*fnSetActGroup)( aGroup ); pGlosHdl->SetCurGroup(aGroup, sal_True); - rReq.SetReturnValue(SfxBoolItem(nSlot, pGlosHdl->InsertGlossary( aName ))); + rReq.SetReturnValue(SfxBoolItem(nSlot, pGlosHdl->InsertGlossary( aName ) ? sal_True : sal_False)); rReq.Done(); } } diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx index e45bffabe438..8d880716dfb5 100644 --- a/sw/source/ui/shells/textidx.cxx +++ b/sw/source/ui/shells/textidx.cxx @@ -106,7 +106,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - VclAbstractDialog* pDlg = pFact->CreateIndexMarkModalDlg( DLG_EDIT_IDXMARK, pMDI, GetShell(), aMgr.GetCurTOXMark() ); + VclAbstractDialog* pDlg = pFact->CreateIndexMarkModalDlg(pMDI, GetShell(), aMgr.GetCurTOXMark()); OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; @@ -167,7 +167,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) const SwTOXBase* pBase = rSh.GetCurTOX(); OSL_ENSURE(pBase, "no TOXBase to remove"); if( pBase ) - rSh.DeleteTOX(*pBase, sal_True); + rSh.DeleteTOX(*pBase, true); } break; default: diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 40d93fc79569..1fdaf20270e8 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -597,7 +597,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD, GetView().GetViewFrame(), &GetView().GetViewFrame()->GetWindow(), aSet, sal_True); OSL_ENSURE(pDlg, "Dialogdiet fail!"); - if(pDlg->Execute() && pDlg->GetOutputItemSet()) + if(pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet()) { //local variable necessary at least after call of .AutoCaption() because this could be deleted at this point SwWrtShell& rShell = GetShell(); @@ -660,8 +660,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg( DLG_INSERT_RULER, - pParent ); + AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg(pParent); OSL_ENSURE(pDlg, "Dialogdiet fail!"); // MessageBox fuer fehlende Grafiken if(!pDlg->HasImages()) diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index cb062a99adb2..067568930035 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -1444,7 +1444,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); nHtmlMode &= HTMLMODE_ON|HTMLMODE_SOME_STYLES; if( (nHtmlMode == HTMLMODE_ON) || !rSh.IsMoveLeftMargin( - SID_INC_INDENT == nWhich, sal_True )) + SID_INC_INDENT == nWhich, true )) rSet.DisableItem( nWhich ); } break; @@ -1456,7 +1456,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) nHtmlMode &= HTMLMODE_ON|HTMLMODE_SOME_STYLES; if( (nHtmlMode == HTMLMODE_ON) || !rSh.IsMoveLeftMargin( FN_INC_INDENT_OFFSET == nWhich, - sal_False )) + false )) rSet.DisableItem( nWhich ); } break; diff --git a/sw/source/ui/table/swtablerep.cxx b/sw/source/ui/table/swtablerep.cxx index e0733c36f031..d37f24ef6c28 100644 --- a/sw/source/ui/table/swtablerep.cxx +++ b/sw/source/ui/table/swtablerep.cxx @@ -64,7 +64,7 @@ #include "swtablerep.hxx" -SwTableRep::SwTableRep( const SwTabCols& rTabCol, sal_Bool bCplx ) +SwTableRep::SwTableRep( const SwTabCols& rTabCol, bool bCplx ) : nTblWidth(0), nSpace(0), diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 91df248269ce..cfcde7ec58bb 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -32,7 +32,7 @@ #include <vcl/svapp.hxx> #include <svl/zforlist.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/i18n/XBreakIterator.hpp> +#include <com/sun/star/i18n/BreakIterator.hpp> #include <comphelper/processfactory.hxx> #include <svtools/scriptedtext.hxx> #include <svtools/accessibilityoptions.hxx> @@ -559,10 +559,7 @@ AutoFmtPreview::AutoFmtPreview(Window* pParent) : OSL_ENSURE( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory"); if ( m_xMSF.is() ) { - m_xBreak = uno::Reference< i18n::XBreakIterator >( - m_xMSF->createInstance ( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) ), - uno::UNO_QUERY); + m_xBreak = i18n::BreakIterator::create(comphelper::getComponentContext(m_xMSF)); } pNumFmt = new SvNumberFormatter( m_xMSF, LANGUAGE_SYSTEM ); diff --git a/sw/source/ui/uiview/formatclipboard.cxx b/sw/source/ui/uiview/formatclipboard.cxx index dd6e65349ab7..f9077547aa44 100644 --- a/sw/source/ui/uiview/formatclipboard.cxx +++ b/sw/source/ui/uiview/formatclipboard.cxx @@ -160,7 +160,6 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh ) const SfxPoolItem* pItem = 0; sal_Bool bBorder = ( SFX_ITEM_SET == rSet.GetItemState( RES_BOX ) || SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_BORDER_INNER ) ); - pItem = 0; sal_Bool bBackground = SFX_ITEM_SET == rSet.GetItemState( RES_BACKGROUND, sal_False, &pItem ); const SfxPoolItem* pRowItem = 0, *pTableItem = 0; bBackground |= SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_BRUSH_ROW, sal_False, &pRowItem ); diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index f91e676d39b0..b06fc44a5861 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -1142,6 +1142,9 @@ void SwPagePreView::Init(const SwViewOption * pPrefs) if( !pPrefs ) pPrefs = SW_MOD()->GetUsrPref(sal_False); + mbHScrollbarEnabled = pPrefs->IsViewHScrollBar(); + mbVScrollbarEnabled = pPrefs->IsViewVScrollBar(); + // die Felder aktualisieren // ACHTUNG: hochcasten auf die EditShell, um die SS zu nutzen. // In den Methoden wird auf die akt. Shell abgefragt! @@ -1661,6 +1664,9 @@ void SwPagePreView::ScrollViewSzChg() bShowVScrollbar = true; } + if (!mbVScrollbarEnabled) + bShowVScrollbar = false; + ShowVScrollbar(bShowVScrollbar); pPageUpBtn->Show(bShowVScrollbar); pPageDownBtn->Show(bShowVScrollbar); @@ -1689,6 +1695,9 @@ void SwPagePreView::ScrollViewSzChg() pHScrollbar->SetPageSize( nVisWidth / 2 ); } + if (!mbHScrollbarEnabled) + bShowHScrollbar = false; + ShowHScrollbar(bShowHScrollbar); } pScrollFill->Show(bShowVScrollbar && bShowHScrollbar); @@ -1903,6 +1912,24 @@ void SwPagePreView::ShowVScrollbar(sal_Bool bShow) InvalidateBorder(); } +void SwPagePreView::EnableHScrollbar(bool bEnable) +{ + if (mbHScrollbarEnabled != bEnable) + { + mbHScrollbarEnabled = bEnable; + ScrollViewSzChg(); + } +} + +void SwPagePreView::EnableVScrollbar(bool bEnable) +{ + if (mbVScrollbarEnabled != bEnable) + { + mbVScrollbarEnabled = bEnable; + ScrollViewSzChg(); + } +} + void SwPagePreView::SetZoom(SvxZoomType eType, sal_uInt16 nFactor) { ViewShell& rSh = *GetViewShell(); diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index aad2acff97c4..9f0e4e61ba3b 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/util/SearchFlags.hpp> #include <com/sun/star/i18n/TransliterationModules.hpp> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> +#include <comphelper/string.hxx> #include <unotools/tempfile.hxx> #include <tools/urlobj.hxx> #include <vcl/print.hxx> @@ -205,10 +206,10 @@ static void lcl_ConvertTabsToSpaces( String& rLine ) if ( rLine.GetChar(nPos) == '\t' ) { // Nicht 4 Blanks, sondern an 4er TabPos: - String aBlanker; - aBlanker.Fill( ( 4 - ( nPos % 4 ) ), ' ' ); + rtl::OUStringBuffer aBlanker; + comphelper::string::padToLength(aBlanker, ( 4 - ( nPos % 4 ) ), ' '); rLine.Erase( nPos, 1 ); - rLine.Insert( aBlanker, nPos ); + rLine.Insert(aBlanker.makeStringAndClear(), nPos); nMax = rLine.Len(); } nPos++; // Nicht optimal, falls Tab, aber auch nicht verkehrt... diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index eae63ecfb110..2b01ba5abf93 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -956,8 +956,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) SetNewWindowAllowed(!bBrowse); // End of disabled multiple window - ShowVScrollbar(aUsrPref.IsViewVScrollBar()); - ShowHScrollbar(aUsrPref.IsViewHScrollBar()); + mbVScrollbarEnabled = aUsrPref.IsViewVScrollBar(); + mbHScrollbarEnabled = aUsrPref.IsViewHScrollBar(); pHScrollbar->SetAuto(bBrowse); if( aUsrPref.IsViewHRuler() ) CreateTab(); diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx index cde54d516ef4..fd2e384f09e6 100644 --- a/sw/source/ui/uiview/view0.cxx +++ b/sw/source/ui/uiview/view0.cxx @@ -561,7 +561,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq) //Die UsrPref muessen als Modified gekennzeichnet werden. //call for initialization pModule->GetUsrPref(bWebView); - pModule->CheckSpellChanges( pOpt->IsOnlineSpell(), sal_False, sal_False, sal_False ); + pModule->CheckSpellChanges( pOpt->IsOnlineSpell(), false, false, false ); } //OS: Modified wieder zuruecksetzen, weil Ansicht/Felder // das Doc modified setzt. diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 950a03db3f63..225d63d31a11 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -428,7 +428,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) if(!pFmt) pFmt = pDoc->MakeFrmFmt(sGraphicFormat, pDocShell->GetDoc()->GetDfltFrmFmt(), - sal_True, sal_False); + true, false); rSh.SetFrmFmt( pFmt ); } @@ -1054,7 +1054,7 @@ void SwView::Execute(SfxRequest &rReq) xGCIterator->resetIgnoreRules(); } // reset ignore lists - pDoc->SpellItAgainSam( sal_True, sal_False, sal_False ); + pDoc->SpellItAgainSam( true, false, false ); // clear ignore dictionary uno::Reference< linguistic2::XDictionary > xDictionary( SvxGetIgnoreAllList(), uno::UNO_QUERY ); if( xDictionary.is() ) @@ -1787,9 +1787,9 @@ void SwView::EditLinkDlg() } } -sal_Bool SwView::JumpToSwMark( const String& rMark ) +bool SwView::JumpToSwMark( const String& rMark ) { - sal_Bool bRet = sal_False; + bool bRet = false; if( rMark.Len() ) { // wir wollen den Bookmark aber am oberen Rand haben @@ -1863,11 +1863,11 @@ sal_Bool SwView::JumpToSwMark( const String& rMark ) if( pWrtShell->SearchPattern( aSearchOpt, bSearchInNotes, DOCPOS_START, DOCPOS_END )) { pWrtShell->EnterStdMode(); // Selektion wieder aufheben - bRet = sal_True; + bRet = true; } } else if( pMarkAccess->getMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)) ) - pWrtShell->GotoMark( ppMark->get(), sal_False, sal_True ), bRet = sal_True; + pWrtShell->GotoMark( ppMark->get(), sal_False, sal_True ), bRet = true; else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) { pWrtShell->addCurrentPosition(); bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() ); @@ -1876,7 +1876,7 @@ sal_Bool SwView::JumpToSwMark( const String& rMark ) // fuer alle Arten von Flys if( FLYCNTTYPE_ALL != eFlyType && pWrtShell->GotoFly( sName, eFlyType )) { - bRet = sal_True; + bRet = true; if( FLYCNTTYPE_FRM == eFlyType ) { // TextFrames: Cursor in den Frame setzen @@ -1891,7 +1891,7 @@ sal_Bool SwView::JumpToSwMark( const String& rMark ) } } else if( pMarkAccess->getMarksEnd() != (ppMark = pMarkAccess->findMark(sMark))) - pWrtShell->GotoMark( ppMark->get(), sal_False, sal_True ), bRet = sal_True; + pWrtShell->GotoMark( ppMark->get(), sal_False, sal_True ), bRet = true; else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() ); diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index 01522518664c..ee8c36418b1d 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -320,8 +320,6 @@ int SwView::_CreateScrollbar( sal_Bool bHori ) (*ppScrollbar)->EnableDrag( sal_True ); - (*ppScrollbar)->SetAuto( sal_True ); - if(GetWindow()) InvalidateBorder(); @@ -670,5 +668,22 @@ sal_Bool SwView::IsVScrollbarVisible()const return pVScrollbar->IsVisible( sal_False ); } +void SwView::EnableHScrollbar(bool bEnable) +{ + if (mbHScrollbarEnabled != bEnable) + { + mbHScrollbarEnabled = bEnable; + InvalidateBorder(); + } +} + +void SwView::EnableVScrollbar(bool bEnable) +{ + if (mbVScrollbarEnabled != bEnable) + { + mbVScrollbarEnabled = bEnable; + InvalidateBorder(); + } +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index e60273dcbeab..6b0b80668eac 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -1076,6 +1076,15 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) bShowV = pVOpt->IsViewVScrollBar(); } + if (!mbHScrollbarEnabled) + { + bHAuto = bShowH = false; + } + if (!mbVScrollbarEnabled) + { + bAuto = bShowV = false; + } + SwDocShell* pDocSh = GetDocShell(); sal_Bool bIsPreview = pDocSh->IsPreview(); if( bIsPreview ) diff --git a/sw/source/ui/uiview/viewprt.cxx b/sw/source/ui/uiview/viewprt.cxx index e55acc744be8..d68ee0af8dfd 100644 --- a/sw/source/ui/uiview/viewprt.cxx +++ b/sw/source/ui/uiview/viewprt.cxx @@ -237,7 +237,7 @@ void SwView::ExecutePrint(SfxRequest& rReq) //#i61455# if master documentes are printed silently without loaded links then update the links now if( bSilent && pSh->IsGlobalDoc() && !pSh->IsGlblDocSaveLinks() ) { - pSh->GetLinkManager().UpdateAllLinks( sal_False, sal_False, sal_False, 0 ); + pSh->GetLinkManager().UpdateAllLinks( false, false, false, 0 ); } SfxRequest aReq( rReq ); SfxBoolItem aBool(SID_SELECTION, bPrintSelection); diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index cbd2b17a1c6a..c0d1ce51ff74 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -265,7 +265,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) const sal_uInt16 nDescId = rSh.GetCurPageDesc(); const SwPageDesc& rDesc = rSh.GetPageDesc( nDescId ); - const sal_Bool bVerticalWriting = rSh.IsInVerticalText(); + const bool bVerticalWriting = rSh.IsInVerticalText(); const SwFmtHeader& rHeaderFmt = rDesc.GetMaster().GetHeader(); SwFrmFmt *pHeaderFmt = (SwFrmFmt*)rHeaderFmt.GetHeaderFmt(); @@ -294,7 +294,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SwFrmFmt* pFmt = ((SwFrmFmt*)rSh.GetFlyFrmFmt()); const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED); - sal_Bool bVerticalFrame(sal_False); + bool bVerticalFrame(false); { sal_Bool bRTL; sal_Bool bVertL2R; @@ -889,7 +889,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) rSh.GetMousePageDesc(aTabColFromDocPos) : rSh.GetCurPageDesc() ); const SvxFrameDirectionItem& rFrameDir = rDesc.GetMaster().GetFrmDir(); - const sal_Bool bVerticalWriting = rSh.IsInVerticalText(); + const bool bVerticalWriting = rSh.IsInVerticalText(); //enable tab stop display on the rulers depending on the writing direction WinBits nRulerStyle = pHRuler->GetStyle() & ~WB_EXTRAFIELD; @@ -1391,7 +1391,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) SvxColumnItem aColItem(nNum); const SwRect &rSizeRect = rSh.GetAnyCurRect(RECT_FLY_PRT_EMBEDDED, pPt); - sal_Bool bUseVertical = bFrameHasVerticalColumns || (!bFrmSelection && bVerticalWriting); + bool bUseVertical = bFrameHasVerticalColumns || (!bFrmSelection && bVerticalWriting); const long lWidth = bUseVertical ? rSizeRect.Height() : rSizeRect.Width(); const SwRect &rRect = rSh.GetAnyCurRect(RECT_FLY_EMBEDDED, pPt); long nDist2 = ((bUseVertical ? rRect.Height() : rRect.Width()) - lWidth) /2; diff --git a/sw/source/ui/uno/dlelstnr.cxx b/sw/source/ui/uno/dlelstnr.cxx index e790d96847b1..db158d811eec 100644 --- a/sw/source/ui/uno/dlelstnr.cxx +++ b/sw/source/ui/uno/dlelstnr.cxx @@ -29,7 +29,7 @@ #include <com/sun/star/linguistic2/DictionaryListEventFlags.hpp> #include <com/sun/star/linguistic2/XDictionaryList.hpp> -#include <com/sun/star/linguistic2/XLinguServiceManager.hpp> +#include <com/sun/star/linguistic2/LinguServiceManager.hpp> #include <com/sun/star/linguistic2/XLinguServiceEventBroadcaster.hpp> #include <com/sun/star/linguistic2/XProofreadingIterator.hpp> #include <com/sun/star/linguistic2/LinguServiceEventFlags.hpp> @@ -57,35 +57,31 @@ using namespace ::com::sun::star::linguistic2::LinguServiceEventFlags; SwLinguServiceEventListener::SwLinguServiceEventListener() { Reference< XMultiServiceFactory > xMgr( comphelper::getProcessServiceFactory() ); - if (xMgr.is()) + Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() ); + try { - try - { - OUString aSvcName( OUString( "com.sun.star.frame.Desktop" ) ); - xDesktop = Reference< frame::XDesktop >( - xMgr->createInstance( aSvcName ), UNO_QUERY ); - if (xDesktop.is()) - xDesktop->addTerminateListener( this ); - - aSvcName = OUString( "com.sun.star.linguistic2.LinguServiceManager" ); - xLngSvcMgr = Reference< XLinguServiceManager >( xMgr->createInstance( aSvcName ), UNO_QUERY ); - if (xLngSvcMgr.is()) - xLngSvcMgr->addLinguServiceManagerListener( (XLinguServiceEventListener *) this ); - - if (SvtLinguConfig().HasGrammarChecker()) - { - aSvcName = OUString( "com.sun.star.linguistic2.ProofreadingIterator" ); - xGCIterator = Reference< XProofreadingIterator >( xMgr->createInstance( aSvcName ), UNO_QUERY ); - Reference< XLinguServiceEventBroadcaster > xBC( xGCIterator, UNO_QUERY ); - if (xBC.is()) - xBC->addLinguServiceEventListener( (XLinguServiceEventListener *) this ); - } - } - catch (const uno::Exception&) + OUString aSvcName( OUString( "com.sun.star.frame.Desktop" ) ); + xDesktop = Reference< frame::XDesktop >( + xMgr->createInstance( aSvcName ), UNO_QUERY ); + if (xDesktop.is()) + xDesktop->addTerminateListener( this ); + + xLngSvcMgr = LinguServiceManager::create(xContext); + xLngSvcMgr->addLinguServiceManagerListener( (XLinguServiceEventListener *) this ); + + if (SvtLinguConfig().HasGrammarChecker()) { - OSL_FAIL("exception caught in SwLinguServiceEventListener c-tor" ); + aSvcName = OUString( "com.sun.star.linguistic2.ProofreadingIterator" ); + xGCIterator = Reference< XProofreadingIterator >( xMgr->createInstance( aSvcName ), UNO_QUERY ); + Reference< XLinguServiceEventBroadcaster > xBC( xGCIterator, UNO_QUERY ); + if (xBC.is()) + xBC->addLinguServiceEventListener( (XLinguServiceEventListener *) this ); } } + catch (const uno::Exception&) + { + OSL_FAIL("exception caught in SwLinguServiceEventListener c-tor" ); + } } SwLinguServiceEventListener::~SwLinguServiceEventListener() @@ -105,16 +101,16 @@ void SwLinguServiceEventListener::processDictionaryListEvent( DictionaryListEventFlags::DEL_NEG_ENTRY | DictionaryListEventFlags::ACTIVATE_POS_DIC | DictionaryListEventFlags::DEACTIVATE_NEG_DIC; - sal_Bool bIsSpellWrong = 0 != (nEvt & nSpellWrongFlags); + bool bIsSpellWrong = 0 != (nEvt & nSpellWrongFlags); sal_Int16 nSpellAllFlags = DictionaryListEventFlags::ADD_NEG_ENTRY | DictionaryListEventFlags::DEL_POS_ENTRY | DictionaryListEventFlags::ACTIVATE_NEG_DIC | DictionaryListEventFlags::DEACTIVATE_POS_DIC; - sal_Bool bIsSpellAll = 0 != (nEvt & nSpellAllFlags); + bool bIsSpellAll = 0 != (nEvt & nSpellAllFlags); if (bIsSpellWrong || bIsSpellAll) - SW_MOD()->CheckSpellChanges( sal_False, bIsSpellWrong, bIsSpellAll, sal_False ); + SW_MOD()->CheckSpellChanges( false, bIsSpellWrong, bIsSpellAll, false ); } void SAL_CALL SwLinguServiceEventListener::processLinguServiceEvent( @@ -123,13 +119,13 @@ void SAL_CALL SwLinguServiceEventListener::processLinguServiceEvent( { SolarMutexGuard aGuard; - sal_Bool bIsSpellWrong = 0 != (rLngSvcEvent.nEvent & SPELL_WRONG_WORDS_AGAIN); - sal_Bool bIsSpellAll = 0 != (rLngSvcEvent.nEvent & SPELL_CORRECT_WORDS_AGAIN); + bool bIsSpellWrong = 0 != (rLngSvcEvent.nEvent & SPELL_WRONG_WORDS_AGAIN); + bool bIsSpellAll = 0 != (rLngSvcEvent.nEvent & SPELL_CORRECT_WORDS_AGAIN); if (0 != (rLngSvcEvent.nEvent & PROOFREAD_AGAIN)) - bIsSpellWrong = bIsSpellAll = sal_True; // have all spelling and grammar checked... + bIsSpellWrong = bIsSpellAll = true; // have all spelling and grammar checked... if (bIsSpellWrong || bIsSpellAll) { - SW_MOD()->CheckSpellChanges( sal_False, bIsSpellWrong, bIsSpellAll, sal_False ); + SW_MOD()->CheckSpellChanges( false, bIsSpellWrong, bIsSpellAll, false ); } if (rLngSvcEvent.nEvent & HYPHENATE_AGAIN) { diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index addb0b0bff0a..72b464749227 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -2246,7 +2246,7 @@ void SwXTextDocument::updateLinks( ) throw(RuntimeException) if( !rLnkMan.GetLinks().empty() ) { UnoActionContext aAction(pDoc); - rLnkMan.UpdateAllLinks( sal_False, sal_False, sal_True ); + rLnkMan.UpdateAllLinks( false, false, true ); } } diff --git a/sw/source/ui/utlui/bookctrl.cxx b/sw/source/ui/utlui/bookctrl.cxx index 29bcb73c8a3e..651172d360f5 100644 --- a/sw/source/ui/utlui/bookctrl.cxx +++ b/sw/source/ui/utlui/bookctrl.cxx @@ -106,7 +106,7 @@ void SwBookmarkControl::Command( const CommandEvent& rCEvt ) ::std::map<sal_Int32, sal_uInt16> aBookmarkIdx; for(IDocumentMarkAccess::const_iterator_t ppBookmark = ppBookmarkStart; ppBookmark != pMarkAccess->getBookmarksEnd(); - ppBookmark++) + ++ppBookmark) { if(IDocumentMarkAccess::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark)) { diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index e07a695cc462..78a749db98f1 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -116,12 +116,12 @@ sal_Bool SwContentTree::bIsInDrag = sal_False; namespace { - static sal_Bool lcl_IsContent(SvLBoxEntry* pEntry) + static sal_Bool lcl_IsContent(SvTreeListEntry* pEntry) { return ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CNT; } - static sal_Bool lcl_IsContentType(SvLBoxEntry* pEntry) + static sal_Bool lcl_IsContentType(SvTreeListEntry* pEntry) { return ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CTT; } @@ -246,7 +246,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow) case CONTENT_TYPE_TABLE : sTypeToken = rtl::OUString::createFromAscii(pMarkToTable); - nMemberCount = pWrtShell->GetTblFrmFmtCount(sal_True); + nMemberCount = pWrtShell->GetTblFrmFmtCount(true); bEdit = sal_True; break; @@ -535,13 +535,13 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged) case CONTENT_TYPE_TABLE : { - OSL_ENSURE(nMemberCount == pWrtShell->GetTblFrmFmtCount(sal_True), + OSL_ENSURE(nMemberCount == pWrtShell->GetTblFrmFmtCount(true), "MemberCount differs"); Point aNullPt; - nMemberCount = pWrtShell->GetTblFrmFmtCount(sal_True); + nMemberCount = pWrtShell->GetTblFrmFmtCount(true); for(sal_uInt16 i = 0; i < nMemberCount; i++) { - const SwFrmFmt& rTblFmt = pWrtShell->GetTblFrmFmt(i, sal_True); + const SwFrmFmt& rTblFmt = pWrtShell->GetTblFrmFmt(i, true); String sTblName( rTblFmt.GetName() ); SwContent* pCnt = new SwContent(this, sTblName, @@ -607,7 +607,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged) IDocumentMarkAccess* const pMarkAccess = pWrtShell->getIDocumentMarkAccess(); for(IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin(); ppBookmark != pMarkAccess->getBookmarksEnd(); - ppBookmark++) + ++ppBookmark) { if(lcl_IsUiVisibleBookmark(*ppBookmark)) { @@ -941,7 +941,7 @@ static void* lcl_GetOutlineKey( SwContentTree* pTree, SwOutlineContent* pContent sal_Int8 SwContentTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) { - SvLBoxEntry* pEntry = pTargetEntry; + SvTreeListEntry* pEntry = pTargetEntry; if( pEntry && ( nRootType == CONTENT_TYPE_OUTLINE ) && lcl_IsContent( pEntry ) ) { SwOutlineContent* pOutlineContent = ( SwOutlineContent* )( pEntry->GetUserData() ); @@ -952,7 +952,7 @@ sal_Int8 SwContentTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) { while( pEntry->HasChildren() ) { - SvLBoxEntry* pChildEntry = FirstChild( pEntry ); + SvTreeListEntry* pChildEntry = FirstChild( pEntry ); while( pChildEntry ) { pEntry = pChildEntry; @@ -1030,7 +1030,7 @@ PopupMenu* SwContentTree::CreateContextMenu( void ) pPop->InsertItem(2, aContextStrings[ST_DRAGMODE - ST_CONTEXT_FIRST]); pPop->InsertItem(3, aContextStrings[ST_DISPLAY - ST_CONTEXT_FIRST]); //jetzt noch bearbeiten - SvLBoxEntry* pEntry = 0; + SvTreeListEntry* pEntry = 0; //Bearbeiten nur, wenn die angezeigten Inhalte aus der aktiven View kommen if((bIsActive || pActiveShell == pActiveView->GetWrtShellPtr()) && 0 != (pEntry = FirstSelected()) && lcl_IsContent(pEntry)) @@ -1137,7 +1137,7 @@ PopupMenu* SwContentTree::CreateContextMenu( void ) /*************************************************************************** Beschreibung: Einrueckung fuer outlines (und sections) ***************************************************************************/ -long SwContentTree::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) +long SwContentTree::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab) { sal_uInt16 nLevel = 0; if(lcl_IsContent(pEntry)) @@ -1160,7 +1160,7 @@ long SwContentTree::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab) /*************************************************************************** Beschreibung: Inhalte werden erst auf Anforderung in die Box eingefuegt ***************************************************************************/ -void SwContentTree::RequestingChildren( SvLBoxEntry* pParent ) +void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) { // ist es ein Inhaltstyp? if(lcl_IsContentType(pParent)) @@ -1176,7 +1176,7 @@ void SwContentTree::RequestingChildren( SvLBoxEntry* pParent ) ***************************************************************/ if(pCntType->GetType() == CONTENT_TYPE_OUTLINE) { - SvLBoxEntry* pChild = 0; + SvTreeListEntry* pChild = 0; for(sal_uInt16 i = 0; i < nCount; i++) { const SwContent* pCnt = pCntType->GetMember(i); @@ -1236,7 +1236,7 @@ void SwContentTree::RequestingChildren( SvLBoxEntry* pParent ) /*************************************************************************** Beschreibung: Expand - Zustand fuer Inhaltstypen merken ***************************************************************************/ -sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) +sal_Bool SwContentTree::Expand( SvTreeListEntry* pParent ) { if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) || (nRootType == CONTENT_TYPE_OUTLINE)) @@ -1258,7 +1258,7 @@ sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) SwWrtShell* pShell = GetWrtShell(); sal_Bool bBool = SvTreeListBox::Expand(pParent); - SvLBoxEntry* pChild = Next(pParent); + SvTreeListEntry* pChild = Next(pParent); while(pChild && lcl_IsContent(pChild) && pParent->HasChildren()) { if(pChild->HasChildren()) @@ -1294,7 +1294,7 @@ sal_Bool SwContentTree::Expand( SvLBoxEntry* pParent ) /*************************************************************************** Beschreibung: Collapse - Zustand fuer Inhaltstypen merken ***************************************************************************/ -sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent ) +sal_Bool SwContentTree::Collapse( SvTreeListEntry* pParent ) { sal_Bool bRet; if(!bIsRoot || (((SwContentType*)pParent->GetUserData())->GetType() == CONTENT_TYPE_OUTLINE) || @@ -1334,7 +1334,7 @@ sal_Bool SwContentTree::Collapse( SvLBoxEntry* pParent ) ***************************************************************************/ IMPL_LINK_NOARG(SwContentTree, ContentDoubleClickHdl) { - SvLBoxEntry* pEntry = GetCurEntry(); + SvTreeListEntry* pEntry = GetCurEntry(); // ist es ein Inhaltstyp? OSL_ENSURE(pEntry, "no current entry!"); if(pEntry) @@ -1370,7 +1370,7 @@ void SwContentTree::Display( sal_Bool bActive ) } // erst den selektierten Eintrag auslesen, um ihn spaeter evtl. wieder // zu selektieren -> die UserDaten sind hier nicht mehr gueltig! - SvLBoxEntry* pOldSelEntry = FirstSelected(); + SvTreeListEntry* pOldSelEntry = FirstSelected(); String sEntryName; // Name des Eintrags sal_uInt16 nEntryRelPos = 0; // rel. Pos zu seinem Parent sal_uInt32 nOldEntryCount = GetEntryCount(); @@ -1382,7 +1382,7 @@ void SwContentTree::Display( sal_Bool bActive ) nOldScrollPos = pVScroll->GetThumbPos(); sEntryName = GetEntryText(pOldSelEntry); - SvLBoxEntry* pParantEntry = pOldSelEntry; + SvTreeListEntry* pParantEntry = pOldSelEntry; while( GetParent(pParantEntry)) { pParantEntry = GetParent(pParantEntry); @@ -1412,7 +1412,7 @@ void SwContentTree::Display( sal_Bool bActive ) } if(pShell) { - SvLBoxEntry* pSelEntry = 0; + SvTreeListEntry* pSelEntry = 0; if(nRootType == USHRT_MAX) { for(sal_uInt16 nCntType = CONTENT_TYPE_OUTLINE; @@ -1425,7 +1425,7 @@ void SwContentTree::Display( sal_Bool bActive ) (*ppContentT) = new SwContentType(pShell, nCntType, nOutlineLevel ); String sEntry = (*ppContentT)->GetName(); - SvLBoxEntry* pEntry; + SvTreeListEntry* pEntry; const Image& rImage = aEntryImages.GetImage(SID_SW_START + nCntType); sal_Bool bChOnDemand = 0 != (*ppContentT)->GetMemberCount(); pEntry = InsertEntry(sEntry, rImage, rImage, @@ -1441,8 +1441,8 @@ void SwContentTree::Display( sal_Bool bActive ) if(nEntryRelPos && nCntType == nLastSelType) { // jetzt vielleicht noch ein Child selektieren - SvLBoxEntry* pChild = pEntry; - SvLBoxEntry* pTemp = 0; + SvTreeListEntry* pChild = pEntry; + SvTreeListEntry* pTemp = 0; sal_uInt16 nPos = 1; while(0 != (pChild = Next(pChild))) { @@ -1478,7 +1478,7 @@ void SwContentTree::Display( sal_Bool bActive ) if(!(*ppRootContentT)) (*ppRootContentT) = new SwContentType(pShell, nRootType, nOutlineLevel ); const Image& rImage = aEntryImages.GetImage(20000 + nRootType); - SvLBoxEntry* pParent = InsertEntry( + SvTreeListEntry* pParent = InsertEntry( (*ppRootContentT)->GetName(), rImage, rImage, 0, sal_False, LIST_APPEND, *ppRootContentT); @@ -1504,7 +1504,7 @@ void SwContentTree::Display( sal_Bool bActive ) { //feststellen, wo der Cursor steht const sal_uInt16 nActPos = pShell->GetOutlinePos(MAXLEVEL); - SvLBoxEntry* pEntry = First(); + SvTreeListEntry* pEntry = First(); while( 0 != (pEntry = Next(pEntry)) ) { @@ -1519,8 +1519,8 @@ void SwContentTree::Display( sal_Bool bActive ) else { // jetzt vielleicht noch ein Child selektieren - SvLBoxEntry* pChild = pParent; - SvLBoxEntry* pTemp = 0; + SvTreeListEntry* pChild = pParent; + SvTreeListEntry* pTemp = 0; sal_uInt16 nPos = 1; while(0 != (pChild = Next(pChild))) { @@ -1571,7 +1571,7 @@ sal_Bool SwContentTree::FillTransferData( TransferDataContainer& rTransfer, { SwWrtShell* pWrtShell = GetWrtShell(); OSL_ENSURE(pWrtShell, "no Shell!"); - SvLBoxEntry* pEntry = GetCurEntry(); + SvTreeListEntry* pEntry = GetCurEntry(); if(!pEntry || lcl_IsContentType(pEntry) || !pWrtShell) return sal_False; String sEntry; @@ -1713,7 +1713,7 @@ sal_Bool SwContentTree::ToggleToRoot() { if(!bIsRoot) { - SvLBoxEntry* pEntry = GetCurEntry(); + SvTreeListEntry* pEntry = GetCurEntry(); const SwContentType* pCntType; if(pEntry) { @@ -1770,7 +1770,7 @@ sal_Bool SwContentTree::HasContentChanged() else if(bIsRoot) { sal_Bool bOutline = sal_False; - SvLBoxEntry* pEntry = First(); + SvTreeListEntry* pEntry = First(); if(!pEntry) bRepaint = sal_True; else @@ -1784,7 +1784,7 @@ sal_Bool SwContentTree::HasContentChanged() { sal_uInt16 nSelLevel = USHRT_MAX; - SvLBoxEntry* pFirstSel; + SvTreeListEntry* pFirstSel; if(bOutline && 0 != ( pFirstSel = FirstSelected()) && lcl_IsContent(pFirstSel)) @@ -1824,7 +1824,7 @@ sal_Bool SwContentTree::HasContentChanged() { //feststellen, wo der Cursor steht const sal_uInt16 nActPos = GetWrtShell()->GetOutlinePos(MAXLEVEL); - SvLBoxEntry* pFirstEntry = First(); + SvTreeListEntry* pFirstEntry = First(); while( 0 != (pFirstEntry = Next(pFirstEntry)) ) { @@ -1843,7 +1843,7 @@ sal_Bool SwContentTree::HasContentChanged() } else { - SvLBoxEntry* pEntry = First(); + SvTreeListEntry* pEntry = First(); while ( pEntry ) { sal_Bool bNext = sal_True; // mindestens ein Next muss sein @@ -1906,7 +1906,7 @@ sal_Bool SwContentTree::HasContentChanged() } else { - SvLBoxEntry* pChild = FirstChild(pEntry); + SvTreeListEntry* pChild = FirstChild(pEntry); for(sal_uInt16 j = 0; j < nChildCount; j++) { const SwContent* pCnt = pArrType->GetMember(j); @@ -1920,8 +1920,8 @@ sal_Bool SwContentTree::HasContentChanged() } if(bRemoveChildren) { - SvLBoxEntry* pChild = FirstChild(pEntry); - SvLBoxEntry* pRemove = pChild; + SvTreeListEntry* pChild = FirstChild(pEntry); + SvTreeListEntry* pRemove = pChild; for(sal_uInt16 j = 0; j < nChildCount; j++) { pChild = Next(pRemove); @@ -1962,12 +1962,12 @@ sal_Bool SwContentTree::HasContentChanged() ***************************************************************************/ void SwContentTree::FindActiveTypeAndRemoveUserData() { - SvLBoxEntry* pEntry = FirstSelected(); + SvTreeListEntry* pEntry = FirstSelected(); if(pEntry) { // wird Clear ueber TimerUpdate gerufen, kann nur fuer die Root // die Gueltigkeit der UserData garantiert werden - SvLBoxEntry* pParent; + SvTreeListEntry* pParent; while(0 != (pParent = GetParent(pEntry))) pEntry = pParent; if(pEntry->GetUserData() && lcl_IsContentType(pEntry)) @@ -2071,7 +2071,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier) SwWrtShell* pShell = GetWrtShell(); sal_Int8 nActOutlineLevel = nOutlineLevel; sal_uInt16 nActPos = pShell->GetOutlinePos(nActOutlineLevel); - SvLBoxEntry* pFirstEntry = FirstSelected(); + SvTreeListEntry* pFirstEntry = FirstSelected(); if (pFirstEntry && lcl_IsContent(pFirstEntry)) { if ( (bIsRoot && nRootType == CONTENT_TYPE_OUTLINE) || @@ -2102,7 +2102,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier) else if(bModifier) { sal_uInt16 nActEndPos = nActPos; - SvLBoxEntry* pEntry = pFirstEntry; + SvTreeListEntry* pEntry = pFirstEntry; sal_uInt16 nActLevel = ((SwOutlineContent*) pFirstEntry->GetUserData())->GetOutlineLevel(); pEntry = Next(pEntry); @@ -2192,7 +2192,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, sal_Bool bModifier) if(!bIsRoot) { const sal_uInt16 nCurrPos = pShell->GetOutlinePos(MAXLEVEL); - SvLBoxEntry* pFirst = First(); + SvTreeListEntry* pFirst = First(); while( 0 != (pFirst = Next(pFirst)) && lcl_IsContent(pFirst)) { @@ -2265,7 +2265,7 @@ IMPL_LINK_NOARG(SwContentTree, TimerUpdate) DragDropMode SwContentTree::NotifyStartDrag( TransferDataContainer& rContainer, - SvLBoxEntry* pEntry ) + SvTreeListEntry* pEntry ) { DragDropMode eMode = (DragDropMode)0; if( bIsActive && nRootType == CONTENT_TYPE_OUTLINE && @@ -2286,8 +2286,8 @@ DragDropMode SwContentTree::NotifyStartDrag( Beschreibung : Nach dem Drag wird der aktuelle Absatz m i t Children verschoben ***************************************************************************/ -sal_Bool SwContentTree::NotifyMoving( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, SvLBoxEntry*& , sal_uLong& ) +sal_Bool SwContentTree::NotifyMoving( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, SvTreeListEntry*& , sal_uLong& ) { if(!bDocChgdInDragging) { @@ -2300,7 +2300,7 @@ sal_Bool SwContentTree::NotifyMoving( SvLBoxEntry* pTarget, if( MAXLEVEL > nOutlineLevel && // werden nicht alle Ebenen angezeigt nTargetPos != USHRT_MAX) { - SvLBoxEntry* pNext = Next(pTarget); + SvTreeListEntry* pNext = Next(pTarget); if(pNext) nTargetPos = (( SwOutlineContent* )pNext->GetUserData())->GetPos() -1; else @@ -2325,8 +2325,8 @@ sal_Bool SwContentTree::NotifyMoving( SvLBoxEntry* pTarget, Beschreibung : Nach dem Drag wird der aktuelle Absatz o h n e Children verschoben ***************************************************************************/ -sal_Bool SwContentTree::NotifyCopying( SvLBoxEntry* pTarget, - SvLBoxEntry* pEntry, SvLBoxEntry*& , sal_uLong& ) +sal_Bool SwContentTree::NotifyCopying( SvTreeListEntry* pTarget, + SvTreeListEntry* pEntry, SvTreeListEntry*& , sal_uLong& ) { if(!bDocChgdInDragging) { @@ -2340,7 +2340,7 @@ sal_Bool SwContentTree::NotifyCopying( SvLBoxEntry* pTarget, if( MAXLEVEL > nOutlineLevel && // werden nicht alle Ebenen angezeigt nTargetPos != USHRT_MAX) { - SvLBoxEntry* pNext = Next(pTarget); + SvTreeListEntry* pNext = Next(pTarget); if(pNext) nTargetPos = (( SwOutlineContent* )pNext->GetUserData())->GetPos() - 1; else @@ -2362,7 +2362,7 @@ sal_Bool SwContentTree::NotifyCopying( SvLBoxEntry* pTarget, /*************************************************************************** Beschreibung: Kein Drop vor den ersten Eintrag - es ist ein SwContentType ***************************************************************************/ -sal_Bool SwContentTree::NotifyAcceptDrop( SvLBoxEntry* pEntry) +sal_Bool SwContentTree::NotifyAcceptDrop( SvTreeListEntry* pEntry) { return pEntry != 0; } @@ -2374,7 +2374,7 @@ sal_Bool SwContentTree::NotifyAcceptDrop( SvLBoxEntry* pEntry) void SwContentTree::MouseButtonDown( const MouseEvent& rMEvt ) { Point aPos( rMEvt.GetPosPixel()); - SvLBoxEntry* pEntry = GetEntry( aPos, sal_True ); + SvTreeListEntry* pEntry = GetEntry( aPos, sal_True ); if( !pEntry && rMEvt.IsLeft() && rMEvt.IsMod1() && (rMEvt.GetClicks() % 2) == 0) Control::MouseButtonDown( rMEvt ); else @@ -2413,7 +2413,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent) const KeyCode aCode = rEvent.GetKeyCode(); if(aCode.GetCode() == KEY_RETURN) { - SvLBoxEntry* pEntry = FirstSelected(); + SvTreeListEntry* pEntry = FirstSelected(); if ( pEntry ) { switch(aCode.GetModifier()) @@ -2441,7 +2441,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent) } else if(aCode.GetCode() == KEY_DELETE && 0 == aCode.GetModifier()) { - SvLBoxEntry* pEntry = FirstSelected(); + SvTreeListEntry* pEntry = FirstSelected(); if(pEntry && lcl_IsContent(pEntry) && ((SwContent*)pEntry->GetUserData())->GetParent()->IsDeletable() && @@ -2465,7 +2465,7 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) if( rHEvt.GetMode() & HELPMODE_QUICK ) { Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); - SvLBoxEntry* pEntry = GetEntry( aPos ); + SvTreeListEntry* pEntry = GetEntry( aPos ); if( pEntry ) { sal_uInt16 nType; @@ -2576,7 +2576,7 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) void SwContentTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) { - SvLBoxEntry* pFirst = FirstSelected(); + SvTreeListEntry* pFirst = FirstSelected(); switch( nSelectedPopupEntry ) { //Outlinelevel @@ -2707,12 +2707,12 @@ void SwContentTree::ShowActualView() Beschreibung: Hier sollen die Buttons zum Verschieben von Outlines en-/disabled werden ***************************************************************************/ -sal_Bool SwContentTree::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) +sal_Bool SwContentTree::Select( SvTreeListEntry* pEntry, sal_Bool bSelect ) { if(!pEntry) return sal_False; sal_Bool bEnable = sal_False; - SvLBoxEntry* pParentEntry = GetParent(pEntry); + SvTreeListEntry* pParentEntry = GetParent(pEntry); while(pParentEntry && (!lcl_IsContentType(pParentEntry))) { pParentEntry = GetParent(pParentEntry); @@ -2747,7 +2747,7 @@ void SwContentType::RemoveNewline(String& rEntry) } } -void SwContentTree::EditEntry(SvLBoxEntry* pEntry, sal_uInt8 nMode) +void SwContentTree::EditEntry(SvTreeListEntry* pEntry, sal_uInt8 nMode) { SwContent* pCnt = (SwContent*)pEntry->GetUserData(); GotoContent(pCnt); @@ -3127,15 +3127,15 @@ sal_Bool NaviContentBookmark::Paste( TransferableDataHelper& rData ) class SwContentLBoxString : public SvLBoxString { public: - SwContentLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, + SwContentLBoxString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr) {} virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, - SvLBoxEntry* pEntry); + SvTreeListEntry* pEntry); }; -void SwContentTree::InitEntry(SvLBoxEntry* pEntry, - const XubString& rStr ,const Image& rImg1,const Image& rImg2, +void SwContentTree::InitEntry(SvTreeListEntry* pEntry, + const OUString& rStr ,const Image& rImg1,const Image& rImg2, SvLBoxButtonKind eButtonKind) { sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" @@ -3146,7 +3146,7 @@ void SwContentTree::InitEntry(SvLBoxEntry* pEntry, } void SwContentLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, - SvLBoxEntry* pEntry ) + SvTreeListEntry* pEntry ) { if(lcl_IsContent(pEntry) && ((SwContent *)pEntry->GetUserData())->IsInvisible()) diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx index f3d2929c7597..9985c4290127 100644 --- a/sw/source/ui/utlui/glbltree.cxx +++ b/sw/source/ui/utlui/glbltree.cxx @@ -194,7 +194,7 @@ SwGlobalTree::~SwGlobalTree() sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) { sal_Int8 nRet = DND_ACTION_NONE; - SvLBoxEntry* pLast = (SvLBoxEntry*)LastVisible(); + SvTreeListEntry* pLast = (SvTreeListEntry*)LastVisible(); if(pEmphasisEntry) { ImplShowTargetEmphasis( Prev(pEmphasisEntry), sal_False ); @@ -205,10 +205,10 @@ sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) ImplShowTargetEmphasis( pLast, sal_False); } - SvLBoxEntry* pDropEntry = bLastEntryEmphasis ? 0 : GetEntry(rEvt.maPosPixel); + SvTreeListEntry* pDropEntry = bLastEntryEmphasis ? 0 : GetEntry(rEvt.maPosPixel); if( bIsInternalDrag ) { - SvLBoxEntry* pDummy = 0; + SvTreeListEntry* pDummy = 0; sal_uLong nInsertionPos = LIST_APPEND; NotifyMoving( pDropEntry, pDDSource, pDummy, nInsertionPos ); } @@ -277,7 +277,7 @@ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt ) //initiate scrolling GetDropTarget( rEvt.maPosPixel ); - SvLBoxEntry* pLast = (SvLBoxEntry*)LastVisible(); + SvTreeListEntry* pLast = (SvTreeListEntry*)LastVisible(); if( rEvt.mbLeaving ) { if( pEmphasisEntry ) @@ -293,7 +293,7 @@ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt ) } else { - SvLBoxEntry* pDropEntry = GetEntry( rEvt.maPosPixel ); + SvTreeListEntry* pDropEntry = GetEntry( rEvt.maPosPixel ); if(bIsInternalDrag) { if( pDDSource != pDropEntry ) @@ -431,10 +431,10 @@ void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox) sal_uInt16 SwGlobalTree::GetEnableFlags() const { - SvLBoxEntry* pEntry = FirstSelected(); + SvTreeListEntry* pEntry = FirstSelected(); sal_uInt16 nSelCount = (sal_uInt16)GetSelectionCount(); sal_uInt16 nEntryCount = (sal_uInt16)GetEntryCount(); - SvLBoxEntry* pPrevEntry = pEntry ? Prev(pEntry) : 0; + SvTreeListEntry* pPrevEntry = pEntry ? Prev(pEntry) : 0; sal_uInt16 nRet = 0; if(nSelCount == 1 || !nEntryCount) @@ -467,7 +467,7 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) if( rHEvt.GetMode() & HELPMODE_QUICK ) { Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); - SvLBoxEntry* pEntry = GetEntry( aPos ); + SvTreeListEntry* pEntry = GetEntry( aPos ); const SwGlblDocContent* pCont = pEntry ? (const SwGlblDocContent*)pEntry->GetUserData() : 0; if( pCont && GLBLDOC_SECTION == pCont->GetType()) @@ -511,7 +511,7 @@ void SwGlobalTree::SelectHdl() { sal_uInt16 nSelCount = (sal_uInt16)GetSelectionCount(); - SvLBoxEntry* pSel = FirstSelected(); + SvTreeListEntry* pSel = FirstSelected(); sal_uInt16 nAbsPos = pSel ? (sal_uInt16)GetModel()->GetAbsPos(pSel) : 0; SwNavigationPI* pNavi = GetParentWindow(); sal_Bool bReadonly = !pActiveShell || @@ -532,21 +532,21 @@ void SwGlobalTree::DeselectHdl() } DragDropMode SwGlobalTree::NotifyStartDrag( TransferDataContainer& , - SvLBoxEntry* pEntry ) + SvTreeListEntry* pEntry ) { bIsInternalDrag = sal_True; pDDSource = pEntry; return SV_DRAGDROP_CTRL_MOVE; } -long SwGlobalTree::GetTabPos( SvLBoxEntry*, SvLBoxTab* pTab) +long SwGlobalTree::GetTabPos( SvTreeListEntry*, SvLBoxTab* pTab) { return pTab->GetPos() - GLBL_TABPOS_SUB; } -sal_Bool SwGlobalTree::NotifyMoving( SvLBoxEntry* pTarget, - SvLBoxEntry* pSource, - SvLBoxEntry*&, +sal_Bool SwGlobalTree::NotifyMoving( SvTreeListEntry* pTarget, + SvTreeListEntry* pSource, + SvTreeListEntry*&, sal_uLong& ) { @@ -561,16 +561,16 @@ sal_Bool SwGlobalTree::NotifyMoving( SvLBoxEntry* pTarget, return sal_False; } -sal_Bool SwGlobalTree::NotifyCopying( SvLBoxEntry* /*pTarget*/, - SvLBoxEntry* /*pEntry*/, - SvLBoxEntry*& /*rpNewParent*/, +sal_Bool SwGlobalTree::NotifyCopying( SvTreeListEntry* /*pTarget*/, + SvTreeListEntry* /*pEntry*/, + SvTreeListEntry*& /*rpNewParent*/, sal_uLong& /*rNewChildPos*/ ) { return sal_False; } -sal_Bool SwGlobalTree::NotifyAcceptDrop( SvLBoxEntry* pEntry) +sal_Bool SwGlobalTree::NotifyAcceptDrop( SvTreeListEntry* pEntry) { return pEntry != 0; } @@ -594,7 +594,7 @@ void SwGlobalTree::DragFinished( sal_Int8 nAction ) void SwGlobalTree::MouseButtonDown( const MouseEvent& rMEvt ) { Point aPos( rMEvt.GetPosPixel()); - SvLBoxEntry* pEntry = GetEntry( aPos, sal_True ); + SvTreeListEntry* pEntry = GetEntry( aPos, sal_True ); if( !pEntry && rMEvt.IsLeft() && rMEvt.IsMod1() && (rMEvt.GetClicks() % 2) == 0) Control::MouseButtonDown( rMEvt ); else @@ -641,7 +641,7 @@ void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData) sal_uInt16 nCount = pSwGlblDocContents->size(); if(bOnlyUpdateUserData && GetEntryCount() == pSwGlblDocContents->size()) { - SvLBoxEntry* pEntry = First(); + SvTreeListEntry* pEntry = First(); for( sal_uInt16 i = 0; i < nCount; i++) { SwGlblDocContent* pCont = (*pSwGlblDocContents)[i]; @@ -652,7 +652,7 @@ void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData) else { SetUpdateMode( sal_False ); - SvLBoxEntry* pOldSelEntry = FirstSelected(); + SvTreeListEntry* pOldSelEntry = FirstSelected(); String sEntryName; // Name des Eintrags sal_uInt16 nSelPos = USHRT_MAX; if(pOldSelEntry) @@ -664,7 +664,7 @@ void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData) if(!pSwGlblDocContents) Update( sal_False ); - SvLBoxEntry* pSelEntry = 0; + SvTreeListEntry* pSelEntry = 0; for( sal_uInt16 i = 0; i < nCount; i++) { SwGlblDocContent* pCont = (*pSwGlblDocContents)[i]; @@ -693,7 +693,7 @@ void SwGlobalTree::Display(sal_Bool bOnlyUpdateUserData) } break; } - SvLBoxEntry* pEntry = InsertEntry(sEntry, aImage, aImage, + SvTreeListEntry* pEntry = InsertEntry(sEntry, aImage, aImage, 0, sal_False, LIST_APPEND, pCont); if(sEntry == sEntryName) { @@ -780,7 +780,7 @@ IMPL_LINK( SwGlobalTree, PopupHdl, Menu* , pMenu) void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) { - SvLBoxEntry* pEntry = FirstSelected(); + SvTreeListEntry* pEntry = FirstSelected(); SwGlblDocContent* pCont = pEntry ? (SwGlblDocContent*)pEntry->GetUserData() : 0; // wird waehrend des Dialogs ein RequestHelp gerufen, // dann geht der Content verloren. Deshalb wird hier eine @@ -797,7 +797,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry { // zwei Durchlaeufe: zuerst die Bereiche, dann die Verzeichnisse // aktualisieren - SvLBoxEntry* pSelEntry = FirstSelected(); + SvTreeListEntry* pSelEntry = FirstSelected(); while( pSelEntry ) { SwGlblDocContent* pContent = (SwGlblDocContent*)pSelEntry->GetUserData(); @@ -828,7 +828,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry case CTX_UPDATE_LINK: case CTX_UPDATE_ALL: { - pActiveShell->GetLinkManager().UpdateAllLinks(sal_True); + pActiveShell->GetLinkManager().UpdateAllLinks(true); if(CTX_UPDATE_ALL == nSelectedPopupEntry) nSlot = FN_UPDATE_TOX; pCont = 0; @@ -853,7 +853,7 @@ void SwGlobalTree::ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry // sind mehrere Eintraege selektiert, dann muss nach jedem delete // das Array neu gefuellt werden. Damit man sich nichts merken muss, // beginnt das Loeschen am Ende - SvLBoxEntry* pSelEntry = LastSelected(); + SvTreeListEntry* pSelEntry = LastSelected(); SwGlblDocContents* pTempContents = 0; pActiveShell->StartAction(); while(pSelEntry) @@ -1052,7 +1052,7 @@ void SwGlobalTree::HideTree() void SwGlobalTree::ExecCommand(sal_uInt16 nCmd) { - SvLBoxEntry* pEntry = FirstSelected(); + SvTreeListEntry* pEntry = FirstSelected(); OSL_ENSURE(pEntry, "gleich knallt's"); if(FN_GLOBAL_EDIT == nCmd) { @@ -1129,7 +1129,7 @@ sal_Bool SwGlobalTree::Update(sal_Bool bHard) SwGlblDocContent* pLeft = (*pTempContents)[i]; SwGlblDocContent* pRight = (*pSwGlblDocContents)[i]; GlobalDocContentType eType = pLeft->GetType(); - SvLBoxEntry* pEntry = GetEntry(i); + SvTreeListEntry* pEntry = GetEntry(i); String sTemp = GetEntryText(pEntry); if ( eType != pRight->GetType() || @@ -1203,7 +1203,7 @@ void SwGlobalTree::OpenDoc(const SwGlblDocContent* pCont) IMPL_LINK_NOARG( SwGlobalTree, DoubleClickHdl) { - SvLBoxEntry* pEntry = GetCurEntry(); + SvTreeListEntry* pEntry = GetCurEntry(); SwGlblDocContent* pCont = (SwGlblDocContent*)pEntry->GetUserData(); if(pCont->GetType() == GLBLDOC_SECTION) OpenDoc(pCont); @@ -1223,8 +1223,8 @@ IMPL_STATIC_LINK_NOINSTANCE(SwGlobalTree, ShowFrameHdl, SwGlobalTree*, EMPTYARG) return 0; } -void SwGlobalTree::InitEntry(SvLBoxEntry* pEntry, - const XubString& rStr ,const Image& rImg1,const Image& rImg2, +void SwGlobalTree::InitEntry(SvTreeListEntry* pEntry, + const OUString& rStr ,const Image& rImg1,const Image& rImg2, SvLBoxButtonKind eButtonKind) { sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" @@ -1235,7 +1235,7 @@ void SwGlobalTree::InitEntry(SvLBoxEntry* pEntry, } void SwLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, - SvLBoxEntry* pEntry ) + SvTreeListEntry* pEntry ) { SwGlblDocContent* pCont = (SwGlblDocContent*)pEntry->GetUserData(); if(pCont->GetType() == GLBLDOC_SECTION && @@ -1272,7 +1272,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen sal_Bool bMove = sal_False; if ( !_pContent ) { - SvLBoxEntry* pLast = (SvLBoxEntry*)LastVisible(); + SvTreeListEntry* pLast = (SvTreeListEntry*)LastVisible(); _pContent = (SwGlblDocContent*)pLast->GetUserData(); bMove = sal_True; } diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx index 1786b13b6cf3..70acc3da63ce 100644 --- a/sw/source/ui/utlui/navipi.cxx +++ b/sw/source/ui/utlui/navipi.cxx @@ -551,7 +551,7 @@ void SwNavigationPI::MakeMark() ::std::vector< ::rtl::OUString > vNavMarkNames; for(IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->getMarksBegin(); ppMark != pMarkAccess->getMarksEnd(); - ppMark++) + ++ppMark) if( IDocumentMarkAccess::GetType(**ppMark) == IDocumentMarkAccess::NAVIGATOR_REMINDER ) vNavMarkNames.push_back(ppMark->get()->GetName()); ::std::sort(vNavMarkNames.begin(), vNavMarkNames.end()); @@ -601,7 +601,7 @@ void SwNavigationPI::_ZoomOut() aContentTree.ShowTree(); aDocListBox.Show(); } - SvLBoxEntry* pFirst = aContentTree.FirstSelected(); + SvTreeListEntry* pFirst = aContentTree.FirstSelected(); if(pFirst) aContentTree.Select(pFirst, sal_True); // toolbox enablen pConfig->SetSmall( sal_False ); @@ -628,7 +628,7 @@ void SwNavigationPI::_ZoomIn() ((SfxDockingWindow*)GetParent())->SetMinOutputSizePixel(Size( aMinOutSizePixel.Width(), aSz.Height())); pFloat->SetOutputSizePixel(aSz); - SvLBoxEntry* pFirst = aContentTree.FirstSelected(); + SvTreeListEntry* pFirst = aContentTree.FirstSelected(); if(pFirst) aContentTree.Select(pFirst, sal_True); // toolbox enablen pConfig->SetSmall( sal_True ); diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx index 6324bddd27a3..e762e720f77b 100644 --- a/sw/source/ui/utlui/unotools.cxx +++ b/sw/source/ui/utlui/unotools.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/style/XStyle.hpp> #include <com/sun/star/text/XTextDocument.hpp> +#include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/view/XViewSettingsSupplier.hpp> #include <com/sun/star/container/XNameContainer.hpp> @@ -123,50 +124,49 @@ void SwOneExampleFrame::CreateControl() return ; uno::Reference< lang::XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); + uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); uno::Reference< uno::XInterface > xInst = xMgr->createInstance( C2U("com.sun.star.frame.FrameControl") ); _xControl = uno::Reference< awt::XControl >(xInst, uno::UNO_QUERY); if(_xControl.is()) { uno::Reference< awt::XWindowPeer > xParent( rWindow.GetComponentInterface() ); - uno::Reference< awt::XToolkit > xToolkit( xMgr->createInstance( C2U("com.sun.star.awt.Toolkit") ), uno::UNO_QUERY ); - if(xToolkit.is()) - { - _xControl->createPeer( xToolkit, xParent ); - - uno::Reference< awt::XWindow > xWin( _xControl, uno::UNO_QUERY ); - xWin->setVisible( sal_False ); - Size aWinSize(rWindow.GetOutputSizePixel()); - xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE ); - - uno::Reference< beans::XPropertySet > xPrSet(xInst, uno::UNO_QUERY); - uno::Any aURL; - // create new doc - rtl::OUString sTempURL(cFactory); - if(sArgumentURL.Len()) - sTempURL = sArgumentURL; - aURL <<= sTempURL; - - uno::Sequence<beans::PropertyValue> aSeq(3); - beans::PropertyValue* pValues = aSeq.getArray(); - pValues[0].Name = C2U("ReadOnly"); - sal_Bool bTrue = sal_True; - pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType()); - pValues[1].Name = C2U("OpenFlags"); - pValues[1].Value <<= C2U("-RB"); - pValues[2].Name = C2U("Referer"); - pValues[2].Value <<= C2U("private:user"); - uno::Any aArgs; - aArgs.setValue(&aSeq, ::getCppuType((uno::Sequence<beans::PropertyValue>*)0)); - - xPrSet->setPropertyValue( C2U("LoaderArguments"), aArgs ); - //save and set readonly??? - - xPrSet->setPropertyValue(C2U("ComponentURL"), aURL); - - aLoadedTimer.Start(); - bServiceAvailable = sal_True; - } + uno::Reference< awt::XToolkit > xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW ); + + _xControl->createPeer( xToolkit, xParent ); + + uno::Reference< awt::XWindow > xWin( _xControl, uno::UNO_QUERY ); + xWin->setVisible( sal_False ); + Size aWinSize(rWindow.GetOutputSizePixel()); + xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE ); + + uno::Reference< beans::XPropertySet > xPrSet(xInst, uno::UNO_QUERY); + uno::Any aURL; + // create new doc + rtl::OUString sTempURL(cFactory); + if(sArgumentURL.Len()) + sTempURL = sArgumentURL; + aURL <<= sTempURL; + + uno::Sequence<beans::PropertyValue> aSeq(3); + beans::PropertyValue* pValues = aSeq.getArray(); + pValues[0].Name = C2U("ReadOnly"); + sal_Bool bTrue = sal_True; + pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType()); + pValues[1].Name = C2U("OpenFlags"); + pValues[1].Value <<= C2U("-RB"); + pValues[2].Name = C2U("Referer"); + pValues[2].Value <<= C2U("private:user"); + uno::Any aArgs; + aArgs.setValue(&aSeq, ::getCppuType((uno::Sequence<beans::PropertyValue>*)0)); + + xPrSet->setPropertyValue( C2U("LoaderArguments"), aArgs ); + //save and set readonly??? + + xPrSet->setPropertyValue(C2U("ComponentURL"), aURL); + + aLoadedTimer.Start(); + bServiceAvailable = sal_True; } } diff --git a/sw/source/ui/web/wview.cxx b/sw/source/ui/web/wview.cxx index d6541a2d605b..f9af40c483bd 100644 --- a/sw/source/ui/web/wview.cxx +++ b/sw/source/ui/web/wview.cxx @@ -197,7 +197,6 @@ void SwWebView::SelectShell() SetShell( new svx::ExtrusionBar( this ) ); rDispatcher.Push( *GetCurShell() ); - eShellMode = SHELL_MODE_DRAW; SetShell( new svx::FontworkBar( this ) ); rDispatcher.Push( *GetCurShell() ); diff --git a/sw/source/ui/wrtsh/move.cxx b/sw/source/ui/wrtsh/move.cxx index 9ee0f41b22a4..c08bb77df512 100644 --- a/sw/source/ui/wrtsh/move.cxx +++ b/sw/source/ui/wrtsh/move.cxx @@ -680,7 +680,7 @@ sal_Bool SwWrtShell::GotoFly( const String& rName, FlyCntType eType, sal_Bool bS return bRet; } -sal_Bool SwWrtShell::GotoINetAttr( const SwTxtINetFmt& rAttr ) +bool SwWrtShell::GotoINetAttr( const SwTxtINetFmt& rAttr ) { SwPosition aPos = *GetCrsr()->GetPoint(); bool bRet = SwCrsrShell::GotoINetAttr(rAttr); @@ -692,10 +692,10 @@ sal_Bool SwWrtShell::GotoINetAttr( const SwTxtINetFmt& rAttr ) void SwWrtShell::GotoOutline( sal_uInt16 nIdx ) { addCurrentPosition(); - return SwCrsrShell::GotoOutline (nIdx); + SwCrsrShell::GotoOutline (nIdx); } -sal_Bool SwWrtShell::GotoOutline( const String& rName ) +bool SwWrtShell::GotoOutline( const String& rName ) { SwPosition aPos = *GetCrsr()->GetPoint(); bool bRet = SwCrsrShell::GotoOutline (rName); @@ -704,7 +704,7 @@ sal_Bool SwWrtShell::GotoOutline( const String& rName ) return bRet; } -sal_Bool SwWrtShell::GotoRegion( const String& rName ) +bool SwWrtShell::GotoRegion( const String& rName ) { SwPosition aPos = *GetCrsr()->GetPoint(); bool bRet = SwCrsrShell::GotoRegion (rName); @@ -732,7 +732,7 @@ sal_Bool SwWrtShell::GotoNextTOXBase( const String* pName ) return bRet; } -sal_Bool SwWrtShell::GotoTable( const String& rName ) +bool SwWrtShell::GotoTable( const String& rName ) { SwPosition aPos = *GetCrsr()->GetPoint(); bool bRet = SwCrsrShell::GotoTable(rName); diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx index 17f2c8cc0668..ba020a2186a7 100644 --- a/sw/source/ui/wrtsh/wrtsh2.cxx +++ b/sw/source/ui/wrtsh/wrtsh2.cxx @@ -337,7 +337,7 @@ void SwWrtShell::ClickToINetAttr( const SwFmtINetFmt& rItem, sal_uInt16 nFilter { SwCallMouseEvent aCallEvent; aCallEvent.Set( &rItem ); - GetDoc()->CallEvent( SFX_EVENT_MOUSECLICK_OBJECT, aCallEvent, sal_False ); + GetDoc()->CallEvent( SFX_EVENT_MOUSECLICK_OBJECT, aCallEvent, false ); } // damit die Vorlagenumsetzung sofort angezeigt wird @@ -369,7 +369,7 @@ sal_Bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter ) { SwCallMouseEvent aCallEvent; aCallEvent.Set( EVENT_OBJECT_URLITEM, pFnd ); - GetDoc()->CallEvent( SFX_EVENT_MOUSECLICK_OBJECT, aCallEvent, sal_False ); + GetDoc()->CallEvent( SFX_EVENT_MOUSECLICK_OBJECT, aCallEvent, false ); } ::LoadURL(*this, sURL, nFilter, sTargetFrameName); diff --git a/sw/source/ui/wrtsh/wrtsh3.cxx b/sw/source/ui/wrtsh/wrtsh3.cxx index 699e2d399042..efa1cbabf766 100644 --- a/sw/source/ui/wrtsh/wrtsh3.cxx +++ b/sw/source/ui/wrtsh/wrtsh3.cxx @@ -173,7 +173,7 @@ void SwWrtShell::ExecMacro( const SvxMacro& rMacro, String* pRet, SbxArray* pArg sal_uInt16 SwWrtShell::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent, - sal_Bool bChkPtr, SbxArray* pArgs, + bool bChkPtr, SbxArray* pArgs, const Link* pCallBack ) { return GetDoc()->CallEvent( nEvent, rCallEvent, bChkPtr, pArgs, pCallBack ); diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml index d53da393a99a..95806e80ef73 100644 --- a/sw/uiconfig/sglobal/menubar/menubar.xml +++ b/sw/uiconfig/sglobal/menubar/menubar.xml @@ -13,6 +13,9 @@ <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveAsTemplate"/> <menu:menuitem menu:id=".uno:SaveAll"/> + <menu:menuitem menu:id=".uno:CheckOut"/> + <menu:menuitem menu:id=".uno:CancelCheckOut"/> + <menu:menuitem menu:id=".uno:CheckIn"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:Reload"/> <menu:menuitem menu:id=".uno:VersionDialog"/> diff --git a/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml b/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml index 040bb8cd8ae6..aa9017dd6b82 100644 --- a/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:InsertGraphic" toolbar:helpid="10241"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GraphicFilterToolbox" toolbar:helpid="10469"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GrafMode" toolbar:helpid="10871"/> @@ -15,4 +13,4 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/sglobal/toolbar/numobjectbar.xml b/sw/uiconfig/sglobal/toolbar/numobjectbar.xml index 50e28ac32f64..4d4b31c05f74 100644 --- a/sw/uiconfig/sglobal/toolbar/numobjectbar.xml +++ b/sw/uiconfig/sglobal/toolbar/numobjectbar.xml @@ -1,11 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:DefaultBullet" toolbar:helpid="20138"/> - <toolbar:toolbaritem xlink:href=".uno:DefaultNumbering" toolbar:helpid="20144"/> - <toolbar:toolbarseparator/> - <toolbar:toolbaritem xlink:href=".uno:RemoveBullets" toolbar:helpid="20137"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:IncrementLevel" toolbar:helpid="20131"/> <toolbar:toolbaritem xlink:href=".uno:DecrementLevel" toolbar:helpid="20130"/> <toolbar:toolbaritem xlink:href=".uno:IncrementSubLevels" toolbar:helpid="20140"/> @@ -20,4 +15,4 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:NumberingStart" toolbar:helpid="21738"/> <toolbar:toolbaritem xlink:href=".uno:BulletsAndNumberingDialog" toolbar:helpid="20121"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/sglobal/toolbar/tableobjectbar.xml b/sw/uiconfig/sglobal/toolbar/tableobjectbar.xml index 231431f56a73..dac219304764 100644 --- a/sw/uiconfig/sglobal/toolbar/tableobjectbar.xml +++ b/sw/uiconfig/sglobal/toolbar/tableobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar"> - <toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="helpid:20330" /> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:LineStyle" toolbar:helpid="helpid:10200" /> <toolbar:toolbaritem xlink:href=".uno:FrameLineColor" toolbar:helpid="helpid:10201" /> <toolbar:toolbarseparator/> diff --git a/sw/uiconfig/sw/ui/20872.ui b/sw/uiconfig/sw/ui/20872.ui index 879e210e8ee1..3e2d5efb3fbd 100644 --- a/sw/uiconfig/sw/ui/20872.ui +++ b/sw/uiconfig/sw/ui/20872.ui @@ -80,7 +80,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Level</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -110,12 +112,14 @@ <object class="GtkGrid" id="grid1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="row_spacing">10</property> <property name="column_spacing">10</property> <child> <object class="GtkLabel" id="17"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="hexpand">True</property> <property name="xalign">0</property> <property name="label" translatable="yes">Numbering followed by</property> </object> @@ -429,7 +433,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Position and spacing</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/sw/ui/20876.ui b/sw/uiconfig/sw/ui/20876.ui index 3959035ac31d..ca09c2b93b1e 100644 --- a/sw/uiconfig/sw/ui/20876.ui +++ b/sw/uiconfig/sw/ui/20876.ui @@ -35,7 +35,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Level</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -75,8 +77,8 @@ <object class="GtkLabel" id="20"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="hexpand">True</property> + <property name="xalign">0</property> <property name="label" translatable="yes">Paragraph Style</property> </object> <packing> @@ -327,7 +329,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Numbering</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml index 225355aac855..49d96f6603ad 100644 --- a/sw/uiconfig/sweb/menubar/menubar.xml +++ b/sw/uiconfig/sweb/menubar/menubar.xml @@ -13,6 +13,9 @@ <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveAsTemplate"/> <menu:menuitem menu:id=".uno:SaveAll"/> + <menu:menuitem menu:id=".uno:CheckOut"/> + <menu:menuitem menu:id=".uno:CancelCheckOut"/> + <menu:menuitem menu:id=".uno:CheckIn"/> <menu:menuitem menu:id=".uno:Reload"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:ExportTo"/> diff --git a/sw/uiconfig/sweb/toolbar/numobjectbar.xml b/sw/uiconfig/sweb/toolbar/numobjectbar.xml index 50e28ac32f64..4d4b31c05f74 100644 --- a/sw/uiconfig/sweb/toolbar/numobjectbar.xml +++ b/sw/uiconfig/sweb/toolbar/numobjectbar.xml @@ -1,11 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:DefaultBullet" toolbar:helpid="20138"/> - <toolbar:toolbaritem xlink:href=".uno:DefaultNumbering" toolbar:helpid="20144"/> - <toolbar:toolbarseparator/> - <toolbar:toolbaritem xlink:href=".uno:RemoveBullets" toolbar:helpid="20137"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:IncrementLevel" toolbar:helpid="20131"/> <toolbar:toolbaritem xlink:href=".uno:DecrementLevel" toolbar:helpid="20130"/> <toolbar:toolbaritem xlink:href=".uno:IncrementSubLevels" toolbar:helpid="20140"/> @@ -20,4 +15,4 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:NumberingStart" toolbar:helpid="21738"/> <toolbar:toolbaritem xlink:href=".uno:BulletsAndNumberingDialog" toolbar:helpid="20121"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/sweb/toolbar/tableobjectbar.xml b/sw/uiconfig/sweb/toolbar/tableobjectbar.xml index bce574f0d985..b6b5cfdf0af1 100644 --- a/sw/uiconfig/sweb/toolbar/tableobjectbar.xml +++ b/sw/uiconfig/sweb/toolbar/tableobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar"> - <toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="helpid:20330" /> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:LineStyle" toolbar:helpid="helpid:10200" /> <toolbar:toolbaritem xlink:href=".uno:FrameLineColor" toolbar:helpid="helpid:10201" /> <toolbar:toolbarseparator/> diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml index 8b65699831e9..2fbd4c3da861 100644 --- a/sw/uiconfig/swform/menubar/menubar.xml +++ b/sw/uiconfig/swform/menubar/menubar.xml @@ -13,6 +13,9 @@ <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveAsTemplate"/> <menu:menuitem menu:id=".uno:SaveAll"/> + <menu:menuitem menu:id=".uno:CheckOut"/> + <menu:menuitem menu:id=".uno:CancelCheckOut"/> + <menu:menuitem menu:id=".uno:CheckIn"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:Reload"/> <menu:menuitem menu:id=".uno:VersionDialog"/> diff --git a/sw/uiconfig/swform/toolbar/graphicobjectbar.xml b/sw/uiconfig/swform/toolbar/graphicobjectbar.xml index 040bb8cd8ae6..aa9017dd6b82 100644 --- a/sw/uiconfig/swform/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/swform/toolbar/graphicobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:InsertGraphic" toolbar:helpid="10241"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GraphicFilterToolbox" toolbar:helpid="10469"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GrafMode" toolbar:helpid="10871"/> @@ -15,4 +13,4 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/swform/toolbar/numobjectbar.xml b/sw/uiconfig/swform/toolbar/numobjectbar.xml index 50e28ac32f64..4d4b31c05f74 100644 --- a/sw/uiconfig/swform/toolbar/numobjectbar.xml +++ b/sw/uiconfig/swform/toolbar/numobjectbar.xml @@ -1,11 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:DefaultBullet" toolbar:helpid="20138"/> - <toolbar:toolbaritem xlink:href=".uno:DefaultNumbering" toolbar:helpid="20144"/> - <toolbar:toolbarseparator/> - <toolbar:toolbaritem xlink:href=".uno:RemoveBullets" toolbar:helpid="20137"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:IncrementLevel" toolbar:helpid="20131"/> <toolbar:toolbaritem xlink:href=".uno:DecrementLevel" toolbar:helpid="20130"/> <toolbar:toolbaritem xlink:href=".uno:IncrementSubLevels" toolbar:helpid="20140"/> @@ -20,4 +15,4 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:NumberingStart" toolbar:helpid="21738"/> <toolbar:toolbaritem xlink:href=".uno:BulletsAndNumberingDialog" toolbar:helpid="20121"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/swform/toolbar/tableobjectbar.xml b/sw/uiconfig/swform/toolbar/tableobjectbar.xml index d34267a6e1de..0d828f56a297 100644 --- a/sw/uiconfig/swform/toolbar/tableobjectbar.xml +++ b/sw/uiconfig/swform/toolbar/tableobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar"> - <toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="helpid:20330" /> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:LineStyle" toolbar:helpid="helpid:10200" /> <toolbar:toolbaritem xlink:href=".uno:FrameLineColor" toolbar:helpid="helpid:10201" /> <toolbar:toolbarseparator/> diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml index 251cbe4f1970..a1de857e5010 100644 --- a/sw/uiconfig/swreport/menubar/menubar.xml +++ b/sw/uiconfig/swreport/menubar/menubar.xml @@ -13,6 +13,9 @@ <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveAsTemplate"/> <menu:menuitem menu:id=".uno:SaveAll"/> + <menu:menuitem menu:id=".uno:CheckOut"/> + <menu:menuitem menu:id=".uno:CancelCheckOut"/> + <menu:menuitem menu:id=".uno:CheckIn"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:Reload"/> <menu:menuitem menu:id=".uno:VersionDialog"/> diff --git a/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml b/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml index 040bb8cd8ae6..aa9017dd6b82 100644 --- a/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:InsertGraphic" toolbar:helpid="10241"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GraphicFilterToolbox" toolbar:helpid="10469"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GrafMode" toolbar:helpid="10871"/> @@ -15,4 +13,4 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/swreport/toolbar/numobjectbar.xml b/sw/uiconfig/swreport/toolbar/numobjectbar.xml index 50e28ac32f64..4d4b31c05f74 100644 --- a/sw/uiconfig/swreport/toolbar/numobjectbar.xml +++ b/sw/uiconfig/swreport/toolbar/numobjectbar.xml @@ -1,11 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:DefaultBullet" toolbar:helpid="20138"/> - <toolbar:toolbaritem xlink:href=".uno:DefaultNumbering" toolbar:helpid="20144"/> - <toolbar:toolbarseparator/> - <toolbar:toolbaritem xlink:href=".uno:RemoveBullets" toolbar:helpid="20137"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:IncrementLevel" toolbar:helpid="20131"/> <toolbar:toolbaritem xlink:href=".uno:DecrementLevel" toolbar:helpid="20130"/> <toolbar:toolbaritem xlink:href=".uno:IncrementSubLevels" toolbar:helpid="20140"/> @@ -20,4 +15,4 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:NumberingStart" toolbar:helpid="21738"/> <toolbar:toolbaritem xlink:href=".uno:BulletsAndNumberingDialog" toolbar:helpid="20121"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/swreport/toolbar/tableobjectbar.xml b/sw/uiconfig/swreport/toolbar/tableobjectbar.xml index d34267a6e1de..0d828f56a297 100644 --- a/sw/uiconfig/swreport/toolbar/tableobjectbar.xml +++ b/sw/uiconfig/swreport/toolbar/tableobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar"> - <toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="helpid:20330" /> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:LineStyle" toolbar:helpid="helpid:10200" /> <toolbar:toolbaritem xlink:href=".uno:FrameLineColor" toolbar:helpid="helpid:10201" /> <toolbar:toolbarseparator/> diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index b71b33e17358..b1c5ac7891a4 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -13,6 +13,9 @@ <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveAsTemplate"/> <menu:menuitem menu:id=".uno:SaveAll"/> + <menu:menuitem menu:id=".uno:CheckOut"/> + <menu:menuitem menu:id=".uno:CancelCheckOut"/> + <menu:menuitem menu:id=".uno:CheckIn"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:Reload"/> <menu:menuitem menu:id=".uno:VersionDialog"/> diff --git a/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml b/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml index 040bb8cd8ae6..aa9017dd6b82 100644 --- a/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:InsertGraphic" toolbar:helpid="10241"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GraphicFilterToolbox" toolbar:helpid="10469"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GrafMode" toolbar:helpid="10871"/> @@ -15,4 +13,4 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/swriter/toolbar/numobjectbar.xml b/sw/uiconfig/swriter/toolbar/numobjectbar.xml index 50e28ac32f64..4d4b31c05f74 100644 --- a/sw/uiconfig/swriter/toolbar/numobjectbar.xml +++ b/sw/uiconfig/swriter/toolbar/numobjectbar.xml @@ -1,11 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:DefaultBullet" toolbar:helpid="20138"/> - <toolbar:toolbaritem xlink:href=".uno:DefaultNumbering" toolbar:helpid="20144"/> - <toolbar:toolbarseparator/> - <toolbar:toolbaritem xlink:href=".uno:RemoveBullets" toolbar:helpid="20137"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:IncrementLevel" toolbar:helpid="20131"/> <toolbar:toolbaritem xlink:href=".uno:DecrementLevel" toolbar:helpid="20130"/> <toolbar:toolbaritem xlink:href=".uno:IncrementSubLevels" toolbar:helpid="20140"/> @@ -20,4 +15,4 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:NumberingStart" toolbar:helpid="21738"/> <toolbar:toolbaritem xlink:href=".uno:BulletsAndNumberingDialog" toolbar:helpid="20121"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/swriter/toolbar/tableobjectbar.xml b/sw/uiconfig/swriter/toolbar/tableobjectbar.xml index d34267a6e1de..0d828f56a297 100644 --- a/sw/uiconfig/swriter/toolbar/tableobjectbar.xml +++ b/sw/uiconfig/swriter/toolbar/tableobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar"> - <toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="helpid:20330" /> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:LineStyle" toolbar:helpid="helpid:10200" /> <toolbar:toolbaritem xlink:href=".uno:FrameLineColor" toolbar:helpid="helpid:10201" /> <toolbar:toolbarseparator/> diff --git a/sw/uiconfig/swriter/ui/autoformattable.ui b/sw/uiconfig/swriter/ui/autoformattable.ui index b18238b9c6e4..bf3d8cc64287 100644 --- a/sw/uiconfig/swriter/ui/autoformattable.ui +++ b/sw/uiconfig/swriter/ui/autoformattable.ui @@ -185,7 +185,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Format</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -314,7 +316,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Formatting</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/bibliographyentry.ui b/sw/uiconfig/swriter/ui/bibliographyentry.ui new file mode 100644 index 000000000000..e6bb977e166f --- /dev/null +++ b/sw/uiconfig/swriter/ui/bibliographyentry.ui @@ -0,0 +1,306 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="BibliographyEntryDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Insert Bibliography Entry</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="insert"> + <property name="label">Insert</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="modify"> + <property name="label" translatable="yes">Modify</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="close"> + <property name="label">gtk-close</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="new"> + <property name="label">gtk-new</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkButton" id="edit"> + <property name="label">gtk-edit</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">5</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_top">12</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Author</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Title</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="author"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="width_chars">60</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Short name</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">6</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="title"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="entrylb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">7</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="frombibliography"> + <property name="label" translatable="yes">From bibliography database</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <property name="group">fromdocument</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="fromdocument"> + <property name="label" translatable="yes">From document content</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">frombibliography</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entryed"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">8</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Entry</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">insert</action-widget> + <action-widget response="0">modify</action-widget> + <action-widget response="0">close</action-widget> + <action-widget response="0">help</action-widget> + <action-widget response="0">new</action-widget> + <action-widget response="0">edit</action-widget> + </action-widgets> + </object> +</interface> diff --git a/sw/uiconfig/swriter/ui/charurlpage.ui b/sw/uiconfig/swriter/ui/charurlpage.ui index 794212a93bfd..bdd9742e4d84 100644 --- a/sw/uiconfig/swriter/ui/charurlpage.ui +++ b/sw/uiconfig/swriter/ui/charurlpage.ui @@ -86,6 +86,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="valign">center</property> <property name="use_action_appearance">False</property> </object> <packing> @@ -101,6 +102,7 @@ <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="invisible_char">●</property> + <property name="width_chars">32</property> <property name="invisible_char_set">True</property> </object> <packing> @@ -115,6 +117,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> + <property name="width_chars">32</property> <property name="invisible_char_set">True</property> </object> <packing> @@ -129,6 +132,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> + <property name="width_chars">32</property> <property name="invisible_char_set">True</property> </object> <packing> @@ -145,6 +149,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> + <property name="valign">center</property> <property name="use_action_appearance">False</property> </object> <packing> @@ -155,21 +160,6 @@ </packing> </child> <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> <object class="GtkComboBoxText" id="targetfrmlb"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -189,6 +179,21 @@ <property name="height">1</property> </packing> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> </object> @@ -198,7 +203,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Hyperlink</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -285,7 +292,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Character styles</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/columnwidth.ui b/sw/uiconfig/swriter/ui/columnwidth.ui index f5e9320d0f6d..d14a81b5045a 100644 --- a/sw/uiconfig/swriter/ui/columnwidth.ui +++ b/sw/uiconfig/swriter/ui/columnwidth.ui @@ -163,7 +163,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Width</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/converttexttable.ui b/sw/uiconfig/swriter/ui/converttexttable.ui index 1d310bae84b2..1b3e6b151e8f 100644 --- a/sw/uiconfig/swriter/ui/converttexttable.ui +++ b/sw/uiconfig/swriter/ui/converttexttable.ui @@ -232,7 +232,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Separate text at</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -416,7 +418,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Options</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/endnotepage.ui b/sw/uiconfig/swriter/ui/endnotepage.ui new file mode 100644 index 000000000000..5d5ddf93fda0 --- /dev/null +++ b/sw/uiconfig/swriter/ui/endnotepage.ui @@ -0,0 +1,366 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="lower">1</property> + <property name="upper">9999</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkBox" id="EndnotePage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkFrame" id="frame2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="label19"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Numbering</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label22"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Before</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="offset"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Start at</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label25"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">After</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="offsetnf"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="halign">start</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + <property name="adjustment">adjustment1</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="prefix"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="suffix"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="swlo:SwNumberingTypeListBox" id="numberinglb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="type">16</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label26"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Autonumbering</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="allstyles"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_homogeneous">True</property> + <child> + <object class="GtkFrame" id="frame6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="label20"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Paragraph</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="pagestyleft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Page</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="parastylelb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="pagestylelb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label23"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Styles</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="label27"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Text area</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label28"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Endnote area</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="charanchorstylelb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="charstylelb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label29"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Character Styles</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> +</interface> diff --git a/sw/uiconfig/swriter/ui/footnotepage.ui b/sw/uiconfig/swriter/ui/footnotepage.ui new file mode 100644 index 000000000000..32056a57a219 --- /dev/null +++ b/sw/uiconfig/swriter/ui/footnotepage.ui @@ -0,0 +1,582 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="lower">1</property> + <property name="upper">9999</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkBox" id="FootnotePage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">13</property> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Numbering</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Counting</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Before</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="pos"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Position</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="offset"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Start at</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">After</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="pospagecb"> + <property name="label" translatable="yes">End of page</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">posdoccb</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="posdoccb"> + <property name="label" translatable="yes">End of document</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">pospagecb</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">4</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="offsetnf"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="halign">start</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + <property name="adjustment">adjustment1</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="countinglb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="model">liststore1</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="prefix"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="suffix"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="swlo:SwNumberingTypeListBox" id="numberinglb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="type">16</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Autonumbering</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="allstyles"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_homogeneous">True</property> + <child> + <object class="GtkFrame" id="frame4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Paragraph</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="pagestyleft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Page</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="parastylelb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="pagestylelb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Styles</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Text area</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Footnote area</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="charanchorstylelb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="charstylelb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Character Styles</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">End of footnote</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label18"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Start of next page</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="contfromed"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="max_length">30</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="conted"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="max_length">30</property> + <property name="invisible_char">●</property> + <property name="invisible_char_set">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Continuation notice</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <object class="GtkListStore" id="liststore1"> + <columns> + <!-- column-name gchararray1 --> + <column type="gchararray"/> + </columns> + <data> + <row> + <col id="0" translatable="yes">Per page</col> + </row> + <row> + <col id="0" translatable="yes">Per chapter</col> + </row> + <row> + <col id="0" translatable="yes">Per document</col> + </row> + </data> + </object> +</interface> diff --git a/sw/uiconfig/swriter/ui/horizontalrule.ui b/sw/uiconfig/swriter/ui/horizontalrule.ui new file mode 100644 index 000000000000..43c9eb7d6275 --- /dev/null +++ b/sw/uiconfig/swriter/ui/horizontalrule.ui @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="HorizontalRuleDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Insert Horizontal Rule</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="button2"> + <property name="label">gtk-cancel</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="swuilo:SwRulerValueSet" id="rulers"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="width_request">400</property> + <property name="height_request">250</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Selection</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">button2</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> +</interface> diff --git a/sw/uiconfig/swriter/ui/indexentry.ui b/sw/uiconfig/swriter/ui/indexentry.ui new file mode 100644 index 000000000000..7dc618418675 --- /dev/null +++ b/sw/uiconfig/swriter/ui/indexentry.ui @@ -0,0 +1,651 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkAdjustment" id="adjustment1"> + <property name="lower">1</property> + <property name="upper">10</property> + <property name="value">1</property> + <property name="step_increment">1</property> + <property name="page_increment">10</property> + </object> + <object class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="stock">gtk-index</property> + </object> + <object class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-go-back</property> + </object> + <object class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-go-forward</property> + </object> + <object class="GtkImage" id="image4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-goto-first</property> + </object> + <object class="GtkImage" id="image5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="stock">gtk-goto-last</property> + </object> + <object class="GtkDialog" id="IndexEntryDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Insert Index Entry</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="insert"> + <property name="label">Insert</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="close"> + <property name="label">gtk-close</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkButton" id="delete"> + <property name="label">gtk-delete</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="row_spacing">6</property> + <property name="row_homogeneous">True</property> + <property name="column_homogeneous">True</property> + <child> + <object class="GtkButton" id="previous"> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="use_action_appearance">False</property> + <property name="image">image2</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="next"> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="use_action_appearance">False</property> + <property name="image">image3</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="first"> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="use_action_appearance">False</property> + <property name="image">image4</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="last"> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="no_show_all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="use_action_appearance">False</property> + <property name="image">image5</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">5</property> + <property name="secondary">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + <child> + <object class="GtkLabel" id="typeft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_right">12</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Index</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="typecb"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="new"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="tooltip_text" translatable="yes">New User-defined Index</property> + <property name="use_action_appearance">False</property> + <property name="image">image1</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_right">12</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Entry</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entryed"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="key1ft"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">False</property> + <property name="margin_right">12</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">1st key</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="key2ft"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">False</property> + <property name="margin_right">12</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">2nd key</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="levelft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_right">12</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Level</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="levelnf"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="halign">start</property> + <property name="invisible_char">●</property> + <property name="adjustment">adjustment1</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">4</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="mainentrycb"> + <property name="label" translatable="yes">Main entry</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="applytoallcb"> + <property name="label" translatable="yes">Apply to all similar texts</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">6</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="searchcasesensitivecb"> + <property name="label" translatable="yes">Match case</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="margin_left">12</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">7</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="searchcasewordonlycb"> + <property name="label" translatable="yes">Whole words only</property> + <property name="use_action_appearance">False</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="no_show_all">True</property> + <property name="margin_left">12</property> + <property name="use_action_appearance">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">8</property> + <property name="width">3</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="phonetic0ft"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="margin_right">12</property> + <property name="label" translatable="yes">Phonetic reading</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="phonetic1ft"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="margin_right">12</property> + <property name="label" translatable="yes">Phonetic reading</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="phonetic2ft"> + <property name="can_focus">False</property> + <property name="no_show_all">True</property> + <property name="margin_right">12</property> + <property name="label" translatable="yes">Phonetic reading</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="phonetic0ed"> + <property name="can_focus">True</property> + <property name="no_show_all">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="phonetic1ed"> + <property name="can_focus">True</property> + <property name="no_show_all">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="phonetic2ed"> + <property name="can_focus">True</property> + <property name="no_show_all">True</property> + <property name="invisible_char">●</property> + </object> + <packing> + <property name="left_attach">4</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="key1cb"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">False</property> + <property name="has_entry">True</property> + <property name="entry_text_column">0</property> + <property name="id_column">1</property> + <child internal-child="entry"> + <object class="GtkEntry" id="comboboxtext-entry"> + <property name="sensitive">False</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="key2cb"> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">False</property> + <property name="has_entry">True</property> + <property name="entry_text_column">0</property> + <property name="id_column">1</property> + <child internal-child="entry"> + <object class="GtkEntry" id="comboboxtext-entry2"> + <property name="sensitive">False</property> + <property name="can_focus">False</property> + <property name="invisible_char">●</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + <property name="width">2</property> + <property name="height">1</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Selection</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">insert</action-widget> + <action-widget response="0">ok</action-widget> + <action-widget response="0">close</action-widget> + <action-widget response="0">help</action-widget> + <action-widget response="0">delete</action-widget> + </action-widgets> + </object> +</interface> diff --git a/sw/uiconfig/swriter/ui/insertbreak.ui b/sw/uiconfig/swriter/ui/insertbreak.ui index 867e86a6e9fc..48c19de03a76 100644 --- a/sw/uiconfig/swriter/ui/insertbreak.ui +++ b/sw/uiconfig/swriter/ui/insertbreak.ui @@ -39,6 +39,8 @@ <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_action_appearance">False</property> <property name="use_stock">True</property> @@ -240,7 +242,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Type</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/inserttable.ui b/sw/uiconfig/swriter/ui/inserttable.ui index 80a3eeeeb3f5..d354318e04d2 100644 --- a/sw/uiconfig/swriter/ui/inserttable.ui +++ b/sw/uiconfig/swriter/ui/inserttable.ui @@ -116,6 +116,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Name</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -221,7 +224,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Size</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -390,7 +395,9 @@ <property name="can_focus">False</property> <property name="xalign">0.47999998927116394</property> <property name="label" translatable="yes">Options</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/linenumbering.ui b/sw/uiconfig/swriter/ui/linenumbering.ui index b1266df556e1..b7559e4b1c3d 100644 --- a/sw/uiconfig/swriter/ui/linenumbering.ui +++ b/sw/uiconfig/swriter/ui/linenumbering.ui @@ -302,7 +302,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">View</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -413,7 +415,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Separator</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -502,7 +506,9 @@ <property name="can_focus">False</property> <property name="ypad">1</property> <property name="label" translatable="yes">Count</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/printeroptions.ui b/sw/uiconfig/swriter/ui/printeroptions.ui index 802515566c51..63d14eec9d28 100644 --- a/sw/uiconfig/swriter/ui/printeroptions.ui +++ b/sw/uiconfig/swriter/ui/printeroptions.ui @@ -117,7 +117,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Contents</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -157,7 +159,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Color</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -197,7 +201,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Pages</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/sortdialog.ui b/sw/uiconfig/swriter/ui/sortdialog.ui index 4018d1e1fc04..20b07d795912 100644 --- a/sw/uiconfig/swriter/ui/sortdialog.ui +++ b/sw/uiconfig/swriter/ui/sortdialog.ui @@ -458,7 +458,9 @@ <property name="can_focus">False</property> <property name="xalign">0.56000000238418579</property> <property name="label" translatable="yes">Sort criteria</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -539,7 +541,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Direction</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -661,7 +665,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Separator</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -709,7 +715,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Language</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -750,7 +758,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Setting</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/splittable.ui b/sw/uiconfig/swriter/ui/splittable.ui index a17c0b33b090..22b468c30891 100644 --- a/sw/uiconfig/swriter/ui/splittable.ui +++ b/sw/uiconfig/swriter/ui/splittable.ui @@ -177,7 +177,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Mode</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/stringinput.ui b/sw/uiconfig/swriter/ui/stringinput.ui index c17202b0ed45..4138a88c53a8 100644 --- a/sw/uiconfig/swriter/ui/stringinput.ui +++ b/sw/uiconfig/swriter/ui/stringinput.ui @@ -72,6 +72,9 @@ <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">Name</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> <packing> <property name="left_attach">0</property> diff --git a/sw/uiconfig/swriter/ui/titlepage.ui b/sw/uiconfig/swriter/ui/titlepage.ui index 8715979ef196..70dcbb117d2f 100644 --- a/sw/uiconfig/swriter/ui/titlepage.ui +++ b/sw/uiconfig/swriter/ui/titlepage.ui @@ -269,7 +269,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Make Title Pages</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -415,7 +417,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Page Numbering</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> @@ -475,7 +479,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Edit Page Properties</property> - <property name="use_markup">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> diff --git a/sw/uiconfig/swriter/ui/wordcount.ui b/sw/uiconfig/swriter/ui/wordcount.ui index b91dae26ddaa..0274d994093d 100644 --- a/sw/uiconfig/swriter/ui/wordcount.ui +++ b/sw/uiconfig/swriter/ui/wordcount.ui @@ -5,6 +5,7 @@ <property name="can_focus">False</property> <property name="border_width">5</property> <property name="title" translatable="yes">Word Count</property> + <property name="destroy_with_parent">True</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> @@ -64,274 +65,210 @@ <property name="orientation">vertical</property> <property name="spacing">10</property> <child> - <object class="GtkFrame" id="frame1"> + <object class="GtkAlignment" id="alignment1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> + <property name="top_padding">7</property> + <property name="bottom_padding">5</property> + <property name="left_padding">5</property> <child> - <object class="GtkAlignment" id="alignment1"> + <object class="GtkGrid" id="grid1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="top_padding">7</property> - <property name="bottom_padding">5</property> - <property name="left_padding">5</property> + <property name="hexpand">True</property> + <property name="row_spacing">2</property> + <property name="column_spacing">10</property> <child> - <object class="GtkGrid" id="grid1"> + <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="xpad">10</property> + <property name="label" translatable="yes">Words</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="xpad">10</property> + <property name="label" translatable="yes">Characters including spaces</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="xpad">10</property> + <property name="label" translatable="yes">Characters excluding spaces</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="selectwords"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> <property name="hexpand">True</property> - <property name="row_spacing">2</property> - <property name="column_spacing">10</property> - <child> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="xpad">10</property> - <property name="label" translatable="yes">Words:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="xpad">10</property> - <property name="label" translatable="yes">Characters:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="xpad">10</property> - <property name="label" translatable="yes">Characters excluding spaces:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="selectwords"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="hexpand">True</property> - <property name="xalign">1</property> - <property name="label"> 0</property> - <property name="justify">right</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="selectchars"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="hexpand">True</property> - <property name="xalign">1</property> - <property name="label"> 0</property> - <property name="justify">right</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="selectcharsnospaces"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="hexpand">True</property> - <property name="xalign">1</property> - <property name="label"> 0</property> - <property name="justify">right</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> + <property name="xalign">1</property> + <property name="label"> 0</property> + <property name="justify">right</property> </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Current selection</property> - <property name="use_markup">True</property> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkFrame" id="frame2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <object class="GtkAlignment" id="alignment2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="top_padding">7</property> - <property name="bottom_padding">5</property> - <property name="left_padding">5</property> <child> - <object class="GtkGrid" id="grid2"> + <object class="GtkLabel" id="selectchars"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="halign">end</property> <property name="hexpand">True</property> - <property name="row_spacing">2</property> - <property name="column_spacing">10</property> - <child> - <object class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="xpad">10</property> - <property name="label" translatable="yes">Words:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label6"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="xpad">10</property> - <property name="label" translatable="yes">Characters:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="xpad">10</property> - <property name="label" translatable="yes">Characters excluding spaces:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="docwords"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="hexpand">True</property> - <property name="xalign">1</property> - <property name="label"> 0</property> - <property name="justify">right</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="docchars"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="hexpand">True</property> - <property name="xalign">1</property> - <property name="label"> 0</property> - <property name="justify">right</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="doccharsnospaces"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="hexpand">True</property> - <property name="xalign">1</property> - <property name="label"> 0</property> - <property name="justify">right</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> - </packing> - </child> + <property name="xalign">1</property> + <property name="label"> 0</property> + <property name="justify">right</property> </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="selectcharsnospaces"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="hexpand">True</property> + <property name="xalign">1</property> + <property name="label"> 0</property> + <property name="justify">right</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Selection</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Document</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="docwords"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="hexpand">True</property> + <property name="xalign">1</property> + <property name="label"> 0</property> + <property name="justify">right</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">1</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="docchars"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="hexpand">True</property> + <property name="xalign">1</property> + <property name="label"> 0</property> + <property name="justify">right</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">2</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="doccharsnospaces"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="hexpand">True</property> + <property name="xalign">1</property> + <property name="label"> 0</property> + <property name="justify">right</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">3</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + <child> + <placeholder/> </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label8"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Whole document</property> - <property name="use_markup">True</property> </object> </child> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="padding">1</property> - <property name="position">1</property> + <property name="position">0</property> </packing> </child> </object> diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml index 92a62fb6923a..7bf5e6b479fe 100644 --- a/sw/uiconfig/swxform/menubar/menubar.xml +++ b/sw/uiconfig/swxform/menubar/menubar.xml @@ -13,6 +13,9 @@ <menu:menuitem menu:id=".uno:SaveAs"/> <menu:menuitem menu:id=".uno:SaveAsTemplate"/> <menu:menuitem menu:id=".uno:SaveAll"/> + <menu:menuitem menu:id=".uno:CheckOut"/> + <menu:menuitem menu:id=".uno:CancelCheckOut"/> + <menu:menuitem menu:id=".uno:CheckIn"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:Reload"/> <menu:menuitem menu:id=".uno:VersionDialog"/> diff --git a/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml b/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml index 040bb8cd8ae6..aa9017dd6b82 100644 --- a/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:InsertGraphic" toolbar:helpid="10241"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GraphicFilterToolbox" toolbar:helpid="10469"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GrafMode" toolbar:helpid="10871"/> @@ -15,4 +13,4 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/swxform/toolbar/numobjectbar.xml b/sw/uiconfig/swxform/toolbar/numobjectbar.xml index 50e28ac32f64..4d4b31c05f74 100644 --- a/sw/uiconfig/swxform/toolbar/numobjectbar.xml +++ b/sw/uiconfig/swxform/toolbar/numobjectbar.xml @@ -1,11 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink"> - <toolbar:toolbaritem xlink:href=".uno:DefaultBullet" toolbar:helpid="20138"/> - <toolbar:toolbaritem xlink:href=".uno:DefaultNumbering" toolbar:helpid="20144"/> - <toolbar:toolbarseparator/> - <toolbar:toolbaritem xlink:href=".uno:RemoveBullets" toolbar:helpid="20137"/> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:IncrementLevel" toolbar:helpid="20131"/> <toolbar:toolbaritem xlink:href=".uno:DecrementLevel" toolbar:helpid="20130"/> <toolbar:toolbaritem xlink:href=".uno:IncrementSubLevels" toolbar:helpid="20140"/> @@ -20,4 +15,4 @@ <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:NumberingStart" toolbar:helpid="21738"/> <toolbar:toolbaritem xlink:href=".uno:BulletsAndNumberingDialog" toolbar:helpid="20121"/> -</toolbar:toolbar>
\ No newline at end of file +</toolbar:toolbar> diff --git a/sw/uiconfig/swxform/toolbar/tableobjectbar.xml b/sw/uiconfig/swxform/toolbar/tableobjectbar.xml index d34267a6e1de..0d828f56a297 100644 --- a/sw/uiconfig/swxform/toolbar/tableobjectbar.xml +++ b/sw/uiconfig/swxform/toolbar/tableobjectbar.xml @@ -1,8 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd"> <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink" toolbar:id="toolbar"> - <toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="helpid:20330" /> - <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:LineStyle" toolbar:helpid="helpid:10200" /> <toolbar:toolbaritem xlink:href=".uno:FrameLineColor" toolbar:helpid="helpid:10201" /> <toolbar:toolbarseparator/> |