update credits
[LibreOffice.git] / sw / source / core / doc / sortopt.cxx
blobe27c2696deaa464e6e56f1066d936a38c5a42bb8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <i18nlangtag/lang.h>
22 #include <sortopt.hxx>
23 #include <boost/foreach.hpp>
25 SwSortKey::SwSortKey() :
26 eSortOrder( SRT_ASCENDING ),
27 nColumnId( 0 ),
28 bIsNumeric( true )
32 SwSortKey::SwSortKey(sal_uInt16 nId, const String& rSrtType, SwSortOrder eOrder) :
33 sSortType( rSrtType ),
34 eSortOrder( eOrder ),
35 nColumnId( nId ),
36 bIsNumeric( 0 == rSrtType.Len() )
40 SwSortKey::SwSortKey(const SwSortKey& rOld) :
41 sSortType( rOld.sSortType ),
42 eSortOrder( rOld.eSortOrder ),
43 nColumnId( rOld.nColumnId ),
44 bIsNumeric( rOld.bIsNumeric )
48 SwSortOptions::SwSortOptions()
49 : eDirection( SRT_ROWS ),
50 cDeli( 9 ),
51 nLanguage( LANGUAGE_SYSTEM ),
52 bTable( false ),
53 bIgnoreCase( false )
57 SwSortOptions::SwSortOptions(const SwSortOptions& rOpt) :
58 eDirection( rOpt.eDirection ),
59 cDeli( rOpt.cDeli ),
60 nLanguage( rOpt.nLanguage ),
61 bTable( rOpt.bTable ),
62 bIgnoreCase( rOpt.bIgnoreCase )
64 for( sal_uInt16 i=0; i < rOpt.aKeys.size(); ++i )
66 SwSortKey* pNew = new SwSortKey(*rOpt.aKeys[i]);
67 aKeys.push_back( pNew );
71 SwSortOptions::~SwSortOptions()
73 BOOST_FOREACH(SwSortKey *pKey, aKeys)
74 delete pKey;
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */