xref: /aoo42x/main/sw/source/core/doc/sortopt.cxx (revision efeef26f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 
28 #include <tools/debug.hxx>
29 #include <i18npool/lang.h>
30 #include <sortopt.hxx>
31 
32 
SV_IMPL_PTRARR(SwSortKeys,SwSortKey *)33 SV_IMPL_PTRARR(SwSortKeys, SwSortKey*)
34 
35 /*--------------------------------------------------------------------
36 	Beschreibung:	Sortier-Schluessel
37  --------------------------------------------------------------------*/
38 
39 SwSortKey::SwSortKey() :
40 	eSortOrder( SRT_ASCENDING ),
41 	nColumnId( 0 ),
42 	bIsNumeric( sal_True )
43 {
44 }
45 
SwSortKey(sal_uInt16 nId,const String & rSrtType,SwSortOrder eOrder)46 SwSortKey::SwSortKey(sal_uInt16 nId, const String& rSrtType, SwSortOrder eOrder) :
47 	sSortType( rSrtType ),
48 	eSortOrder( eOrder ),
49 	nColumnId( nId ),
50 	bIsNumeric( 0 == rSrtType.Len() )
51 {
52 }
53 
54 
SwSortKey(const SwSortKey & rOld)55 SwSortKey::SwSortKey(const SwSortKey& rOld) :
56 	sSortType( rOld.sSortType ),
57 	eSortOrder( rOld.eSortOrder ),
58 	nColumnId( rOld.nColumnId ),
59 	bIsNumeric( rOld.bIsNumeric )
60 {
61 }
62 
63 /*--------------------------------------------------------------------
64 	Beschreibung: Sortieroptionen fuers Sortieren
65  --------------------------------------------------------------------*/
66 
67 
SwSortOptions()68 SwSortOptions::SwSortOptions()
69 	: eDirection( SRT_ROWS ),
70 	cDeli( 9 ),
71 	nLanguage( LANGUAGE_SYSTEM ),
72 	bTable( sal_False ),
73 	bIgnoreCase( sal_False )
74 {
75 }
76 
77 
SwSortOptions(const SwSortOptions & rOpt)78 SwSortOptions::SwSortOptions(const SwSortOptions& rOpt) :
79 	eDirection( rOpt.eDirection ),
80 	cDeli( rOpt.cDeli ),
81 	nLanguage( rOpt.nLanguage ),
82 	bTable( rOpt.bTable ),
83 	bIgnoreCase( rOpt.bIgnoreCase )
84 {
85 	for( sal_uInt16 i=0; i < rOpt.aKeys.Count(); ++i )
86 	{
87 		SwSortKey* pNew = new SwSortKey(*rOpt.aKeys[i]);
88 		aKeys.C40_INSERT( SwSortKey, pNew, aKeys.Count());
89 	}
90 }
91 
92 
~SwSortOptions()93 SwSortOptions::~SwSortOptions()
94 {
95 	aKeys.DeleteAndDestroy(0, aKeys.Count());
96 }
97 
98 
99 
100