shapeimport.cxx (63bba73c) | shapeimport.cxx (f3b8b509) |
---|---|
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 --- 1341 unchanged lines hidden (view full) --- 1350 the new glue point into the core. The saved mappings can be retrieved by getGluePointId() */ 1351void XMLShapeImportHelper::addGluePointMapping( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, 1352 sal_Int32 nSourceId, sal_Int32 nDestinnationId ) 1353{ 1354 if( mpPageContext ) 1355 mpPageContext->maShapeGluePointsMap[xShape][nSourceId] = nDestinnationId; 1356} 1357 | 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 --- 1341 unchanged lines hidden (view full) --- 1350 the new glue point into the core. The saved mappings can be retrieved by getGluePointId() */ 1351void XMLShapeImportHelper::addGluePointMapping( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, 1352 sal_Int32 nSourceId, sal_Int32 nDestinnationId ) 1353{ 1354 if( mpPageContext ) 1355 mpPageContext->maShapeGluePointsMap[xShape][nSourceId] = nDestinnationId; 1356} 1357 |
1358/** find mapping for given DestinationID. This allows to extract the original draw:id imported with a draw:glue-point */ 1359sal_Int32 XMLShapeImportHelper::findGluePointMapping( 1360 const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, 1361 sal_Int32 nDestinnationId ) const 1362{ 1363 if( mpPageContext ) 1364 { 1365 ShapeGluePointsMap::iterator aShapeIter( mpPageContext->maShapeGluePointsMap.find( xShape ) ); 1366 1367 if( aShapeIter != mpPageContext->maShapeGluePointsMap.end() ) 1368 { 1369 GluePointIdMap::iterator aShapeIdIter = (*aShapeIter).second.begin(); 1370 GluePointIdMap::iterator aShapeIdEnd = (*aShapeIter).second.end(); 1371 1372 while ( aShapeIdIter != aShapeIdEnd ) 1373 { 1374 if ( (*aShapeIdIter).second == nDestinnationId ) 1375 { 1376 return (*aShapeIdIter).first; 1377 } 1378 1379 aShapeIdIter++; 1380 } 1381 } 1382 } 1383 1384 return -1; 1385} 1386 |
|
1358/** moves all current DestinationId's by n */ 1359void XMLShapeImportHelper::moveGluePointMapping( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, const sal_Int32 n ) 1360{ 1361 if( mpPageContext ) 1362 { 1363 ShapeGluePointsMap::iterator aShapeIter( mpPageContext->maShapeGluePointsMap.find( xShape ) ); 1364 if( aShapeIter != mpPageContext->maShapeGluePointsMap.end() ) 1365 { --- 6 unchanged lines hidden (view full) --- 1372 aShapeIdIter++; 1373 } 1374 } 1375 } 1376} 1377 1378/** retrieves a mapping for a glue point identifier from the current xml file to the identifier created after 1379 inserting the new glue point into the core. The mapping must be initialized first with addGluePointMapping() */ | 1387/** moves all current DestinationId's by n */ 1388void XMLShapeImportHelper::moveGluePointMapping( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, const sal_Int32 n ) 1389{ 1390 if( mpPageContext ) 1391 { 1392 ShapeGluePointsMap::iterator aShapeIter( mpPageContext->maShapeGluePointsMap.find( xShape ) ); 1393 if( aShapeIter != mpPageContext->maShapeGluePointsMap.end() ) 1394 { --- 6 unchanged lines hidden (view full) --- 1401 aShapeIdIter++; 1402 } 1403 } 1404 } 1405} 1406 1407/** retrieves a mapping for a glue point identifier from the current xml file to the identifier created after 1408 inserting the new glue point into the core. The mapping must be initialized first with addGluePointMapping() */ |
1380sal_Int32 XMLShapeImportHelper::getGluePointId( com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, sal_Int32 nSourceId ) | 1409sal_Int32 XMLShapeImportHelper::getGluePointId( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, sal_Int32 nSourceId ) |
1381{ 1382 if( mpPageContext ) 1383 { 1384 ShapeGluePointsMap::iterator aShapeIter( mpPageContext->maShapeGluePointsMap.find( xShape ) ); 1385 if( aShapeIter != mpPageContext->maShapeGluePointsMap.end() ) 1386 { 1387 GluePointIdMap::iterator aIdIter = (*aShapeIter).second.find(nSourceId); 1388 if( aIdIter != (*aShapeIter).second.end() ) --- 68 unchanged lines hidden --- | 1410{ 1411 if( mpPageContext ) 1412 { 1413 ShapeGluePointsMap::iterator aShapeIter( mpPageContext->maShapeGluePointsMap.find( xShape ) ); 1414 if( aShapeIter != mpPageContext->maShapeGluePointsMap.end() ) 1415 { 1416 GluePointIdMap::iterator aIdIter = (*aShapeIter).second.find(nSourceId); 1417 if( aIdIter != (*aShapeIter).second.end() ) --- 68 unchanged lines hidden --- |