print.cxx (d9b868a3) print.cxx (635e0213)
1/**************************************************************
1/**************************************************************
2 *
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
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 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
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.
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 *
19 *
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_vcl.hxx"
26
27#define ENABLE_BYTESTRING_STREAM_OPERATORS

--- 1259 unchanged lines hidden (view full) ---

1287 mpInfoPrinter->InitPaperFormats( maJobSetup.ImplGetConstData() );
1288 return mpInfoPrinter->m_aPaperFormats.size();
1289}
1290
1291// -----------------------------------------------------------------------
1292
1293rtl::OUString Printer::GetPaperName( Paper ePaper )
1294{
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_vcl.hxx"
26
27#define ENABLE_BYTESTRING_STREAM_OPERATORS

--- 1259 unchanged lines hidden (view full) ---

1287 mpInfoPrinter->InitPaperFormats( maJobSetup.ImplGetConstData() );
1288 return mpInfoPrinter->m_aPaperFormats.size();
1289}
1290
1291// -----------------------------------------------------------------------
1292
1293rtl::OUString Printer::GetPaperName( Paper ePaper )
1294{
1295 ImplSVData* pSVData = ImplGetSVData();
1296 if( ! pSVData->mpPaperNames )
1297 {
1298 pSVData->mpPaperNames = new std::hash_map< int, rtl::OUString >();
1299 if( ImplGetResMgr() )
1300 {
1301 ResStringArray aPaperStrings( VclResId( RID_STR_PAPERNAMES ) );
1302 static const int PaperIndex[] =
1303 {
1304 PAPER_A0, PAPER_A1, PAPER_A2, PAPER_A3, PAPER_A4, PAPER_A5,
1305 PAPER_B4_ISO, PAPER_B5_ISO, PAPER_LETTER, PAPER_LEGAL, PAPER_TABLOID,
1306 PAPER_USER, PAPER_B6_ISO, PAPER_ENV_C4, PAPER_ENV_C5, PAPER_ENV_C6, PAPER_ENV_C65,
1307 PAPER_ENV_DL, PAPER_SLIDE_DIA, PAPER_SCREEN, PAPER_C, PAPER_D, PAPER_E,
1308 PAPER_EXECUTIVE, PAPER_FANFOLD_LEGAL_DE, PAPER_ENV_MONARCH, PAPER_ENV_PERSONAL,
1309 PAPER_ENV_9, PAPER_ENV_10, PAPER_ENV_11, PAPER_ENV_12, PAPER_KAI16,
1310 PAPER_KAI32, PAPER_KAI32BIG, PAPER_B4_JIS, PAPER_B5_JIS, PAPER_B6_JIS
1311 };
1312 OSL_ENSURE( sal_uInt32(sizeof(PaperIndex)/sizeof(PaperIndex[0])) == aPaperStrings.Count(), "localized paper name count wrong" );
1313 for( int i = 0; i < int(sizeof(PaperIndex)/sizeof(PaperIndex[0])); i++ )
1314 (*pSVData->mpPaperNames)[PaperIndex[i]] = aPaperStrings.GetString(i);
1315 }
1316 }
1295 ImplSVData* pSVData = ImplGetSVData();
1296 if( ! pSVData->mpPaperNames )
1297 {
1298 pSVData->mpPaperNames = new std::hash_map< int, rtl::OUString >();
1299 if( ImplGetResMgr() )
1300 {
1301 ResStringArray aPaperStrings( VclResId( RID_STR_PAPERNAMES ) );
1302 static const int PaperIndex[] =
1303 {
1304 PAPER_A0, PAPER_A1, PAPER_A2, PAPER_A3, PAPER_A4, PAPER_A5,
1305 PAPER_B4_ISO, PAPER_B5_ISO, PAPER_LETTER, PAPER_LEGAL, PAPER_TABLOID,
1306 PAPER_USER, PAPER_B6_ISO, PAPER_ENV_C4, PAPER_ENV_C5, PAPER_ENV_C6, PAPER_ENV_C65,
1307 PAPER_ENV_DL, PAPER_SLIDE_DIA, PAPER_SCREEN_4_BY_3, PAPER_SCREEN_16_BY_9, PAPER_SCREEN_16_BY_10,
1308 PAPER_C, PAPER_D, PAPER_E, PAPER_EXECUTIVE, PAPER_FANFOLD_LEGAL_DE, PAPER_ENV_MONARCH,
1309 PAPER_ENV_PERSONAL, PAPER_ENV_9, PAPER_ENV_10, PAPER_ENV_11, PAPER_ENV_12, PAPER_KAI16,
1310 PAPER_KAI32, PAPER_KAI32BIG, PAPER_B4_JIS, PAPER_B5_JIS, PAPER_B6_JIS
1311 };
1312 OSL_ENSURE( sal_uInt32(sizeof(PaperIndex)/sizeof(PaperIndex[0])) == aPaperStrings.Count(), "localized paper name count wrong" );
1313 for( int i = 0; i < int(sizeof(PaperIndex)/sizeof(PaperIndex[0])); i++ )
1314 (*pSVData->mpPaperNames)[PaperIndex[i]] = aPaperStrings.GetString(i);
1315 }
1316 }
1317
1317
1318 std::hash_map<int,rtl::OUString>::const_iterator it = pSVData->mpPaperNames->find( (int)ePaper );
1319 return (it != pSVData->mpPaperNames->end()) ? it->second : rtl::OUString();
1318 std::hash_map<int,rtl::OUString>::const_iterator it = pSVData->mpPaperNames->find( (int)ePaper );
1319 return (it != pSVData->mpPaperNames->end()) ? it->second : rtl::OUString();
1320}
1321
1322// -----------------------------------------------------------------------
1323
1324rtl::OUString Printer::GetPaperName( bool i_bPaperUser ) const
1325{
1326 Size aPageSize = PixelToLogic( GetPaperSizePixel(), MAP_100TH_MM );
1327 Paper ePaper = ImplGetPaperFormat( aPageSize.Width(), aPageSize.Height() );

--- 311 unchanged lines hidden ---
1320}
1321
1322// -----------------------------------------------------------------------
1323
1324rtl::OUString Printer::GetPaperName( bool i_bPaperUser ) const
1325{
1326 Size aPageSize = PixelToLogic( GetPaperSizePixel(), MAP_100TH_MM );
1327 Paper ePaper = ImplGetPaperFormat( aPageSize.Width(), aPageSize.Height() );

--- 311 unchanged lines hidden ---