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_svx.hxx"
26 #include <svx/swframeposstrings.hxx>
27 #include <tools/rc.hxx>
28 #include <tools/debug.hxx>
29 #include <svx/dialmgr.hxx>
30 #include <svx/dialogs.hrc>
31 
32 class SvxSwFramePosString_Impl : public Resource
33 {
34     friend class SvxSwFramePosString;
35     String aStrings[SvxSwFramePosString::STR_MAX];
36 public:
37     SvxSwFramePosString_Impl();
38 };
SvxSwFramePosString_Impl()39 SvxSwFramePosString_Impl::SvxSwFramePosString_Impl() :
40     Resource(SVX_RES(RID_SVXSW_FRAMEPOSITIONS))
41 {
42     for(sal_uInt16 i = 0; i < SvxSwFramePosString::STR_MAX; i++)
43     {
44         //string ids have to start at 1
45         aStrings[i] = String(SVX_RES(i + 1));
46     }
47     FreeResource();
48 }
49 /*-- 04.03.2004 13:14:48---------------------------------------------------
50 
51   -----------------------------------------------------------------------*/
SvxSwFramePosString()52 SvxSwFramePosString::SvxSwFramePosString() :
53     pImpl(new SvxSwFramePosString_Impl)
54 {
55 }
56 /*-- 04.03.2004 13:14:48---------------------------------------------------
57 
58   -----------------------------------------------------------------------*/
~SvxSwFramePosString()59 SvxSwFramePosString::~SvxSwFramePosString()
60 {
61     delete pImpl;
62 }
63 /*-- 04.03.2004 13:14:48---------------------------------------------------
64 
65   -----------------------------------------------------------------------*/
GetString(StringId eId)66 const String& SvxSwFramePosString::GetString(StringId eId)
67 {
68     DBG_ASSERT(eId >= 0 && eId < STR_MAX, "invalid StringId");
69     if(!(eId >= 0 && eId < STR_MAX))
70         eId = LEFT;
71     return pImpl->aStrings[eId];
72 }
73