1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
),
32 SwSortKey::SwSortKey(sal_uInt16 nId
, const String
& rSrtType
, SwSortOrder eOrder
) :
33 sSortType( rSrtType
),
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
),
51 nLanguage( LANGUAGE_SYSTEM
),
57 SwSortOptions::SwSortOptions(const SwSortOptions
& rOpt
) :
58 eDirection( rOpt
.eDirection
),
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
)
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */