This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 1fd2197689 Cleanup
1fd2197689 is described below
commit 1fd2197689f65831e3077cf598951eb3a9ed169e
Author: mseidel <[email protected]>
AuthorDate: Sat May 10 14:11:24 2025 +0200
Cleanup
---
main/autodoc/source/tools/filecoll.cxx | 136 +++---
main/autodoc/source/tools/tkpchars.cxx | 90 ++--
main/basebmp/source/bitmapdevice.cxx | 525 ++++++++++-----------
.../basegfx/source/polygon/b3dpolypolygontools.cxx | 310 ++++++------
4 files changed, 527 insertions(+), 534 deletions(-)
diff --git a/main/autodoc/source/tools/filecoll.cxx
b/main/autodoc/source/tools/filecoll.cxx
index 2cd06849e5..282a7e7ac2 100644
--- a/main/autodoc/source/tools/filecoll.cxx
+++ b/main/autodoc/source/tools/filecoll.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,119 +7,119 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
#include <precomp.h>
#include <tools/filecoll.hxx>
-
// NOT FULLY DEFINED SERVICES
#include <cosv/ploc_dir.hxx>
#include <stdio.h>
-
FileCollector::FileCollector( uintt i_nRoughNrOfFiles )
- // : aFoundFiles
+ // : aFoundFiles
{
- if (i_nRoughNrOfFiles > 0)
- aFoundFiles.reserve(i_nRoughNrOfFiles);
+ if (i_nRoughNrOfFiles > 0)
+ aFoundFiles.reserve(i_nRoughNrOfFiles);
}
uintt
-FileCollector::AddFilesFrom( const char * i_sRootDir,
- const char *
i_sFilter,
- E_SearchMode i_eSearchMode )
+FileCollector::AddFilesFrom( const char *
i_sRootDir,
+ const char *
i_sFilter,
+ E_SearchMode
i_eSearchMode )
{
- uintt nSizeAtStart = aFoundFiles.size();
-
- if (csv::no_str(i_sFilter) OR csv::no_str(i_sRootDir))
- {
- Cout() << "Warning: The filter contains no files." << Endl();
- return 0;
- }
-
- csv::ploc::Directory aDir(i_sRootDir);
- if (NOT aDir.Exists())
- {
- Cerr() << "Warning: The path for the files to be parsed could not be
found:\n"
- << i_sRootDir
- << Endl();
- return 0;
- }
-
- Cout() << "." << Flush();
- aDir.GetContainedFiles(aFoundFiles, i_sFilter);
-
- if (i_eSearchMode == recursive)
- {
- StreamStr aPath(1020);
- aPath << i_sRootDir << csv::ploc::Delimiter();
- uintt nSubDirStart = aPath.tellp();
-
- StringVector aSubDirs;
- aDir.GetContainedDirectories(aSubDirs);
-
- for ( const_iterator iter = aSubDirs.begin();
- iter != aSubDirs.end();
- ++iter )
- {
- aPath.seekp(nSubDirStart);
- aPath << (*iter);
- AddFilesFrom( aPath.c_str(), i_sFilter, i_eSearchMode );
- }
- }
-
- return aFoundFiles.size() - nSizeAtStart;
+ uintt nSizeAtStart = aFoundFiles.size();
+
+ if (csv::no_str(i_sFilter) OR csv::no_str(i_sRootDir))
+ {
+ Cout() << "Warning: The filter contains no files." << Endl();
+ return 0;
+ }
+
+ csv::ploc::Directory aDir(i_sRootDir);
+ if (NOT aDir.Exists())
+ {
+ Cerr() << "Warning: The path for the files to be parsed could
not be found:\n"
+ << i_sRootDir
+ << Endl();
+ return 0;
+ }
+
+ Cout() << "." << Flush();
+ aDir.GetContainedFiles(aFoundFiles, i_sFilter);
+
+ if (i_eSearchMode == recursive)
+ {
+ StreamStr aPath(1020);
+ aPath << i_sRootDir << csv::ploc::Delimiter();
+ uintt nSubDirStart = aPath.tellp();
+
+ StringVector aSubDirs;
+ aDir.GetContainedDirectories(aSubDirs);
+
+ for ( const_iterator iter = aSubDirs.begin();
+ iter != aSubDirs.end();
+ ++iter )
+ {
+ aPath.seekp(nSubDirStart);
+ aPath << (*iter);
+ AddFilesFrom( aPath.c_str(), i_sFilter, i_eSearchMode );
+ }
+ }
+
+ return aFoundFiles.size() - nSizeAtStart;
}
uintt
FileCollector::AddFile( const char * i_sFilePath )
{
- FILE * pFile = fopen( i_sFilePath, "r" );
- if ( pFile == 0 )
- {
- Cerr() << "Warning: The path for the file to be parsed could not be
found:\n"
- << i_sFilePath
- << Endl();
- return 0;
- }
-
- fclose(pFile);
- aFoundFiles.push_back(i_sFilePath);
- return 1;
+ FILE * pFile = fopen( i_sFilePath, "r" );
+ if ( pFile == 0 )
+ {
+ Cerr() << "Warning: The path for the file to be parsed could
not be found:\n"
+ << i_sFilePath
+ << Endl();
+ return 0;
+ }
+
+ fclose(pFile);
+ aFoundFiles.push_back(i_sFilePath);
+ return 1;
}
void
FileCollector::EraseAll()
{
- csv::erase_container(aFoundFiles);
+ csv::erase_container(aFoundFiles);
}
FileCollector::const_iterator
FileCollector::Begin() const
{
- return aFoundFiles.begin();
+ return aFoundFiles.begin();
}
FileCollector::const_iterator
FileCollector::End() const
{
- return aFoundFiles.end();
+ return aFoundFiles.end();
}
uintt
FileCollector::Size() const
{
- return aFoundFiles.size();
+ return aFoundFiles.size();
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/autodoc/source/tools/tkpchars.cxx
b/main/autodoc/source/tools/tkpchars.cxx
index 48f240ba27..50c93caa01 100644
--- a/main/autodoc/source/tools/tkpchars.cxx
+++ b/main/autodoc/source/tools/tkpchars.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
#include <precomp.h>
@@ -26,8 +26,6 @@
#include <cosv/bstream.hxx>
#include <cosv/x.hxx>
-
-
CharacterSource::CharacterSource()
: dpSource(new char[2]),
nSourceSize(0),
@@ -58,34 +56,34 @@ CharacterSource::LoadText(csv::bstream & io_rSource)
dpSource = new char[nSourceSize+1];
intt nCount = (intt) io_rSource.read(dpSource,nSourceSize);
- if (nCount != nSourceSize)
- throw csv::X_Default("IO-Error: Could not load file completely.");
+ if (nCount != nSourceSize)
+ throw csv::X_Default("IO-Error: Could not load file
completely.");
dpSource[nSourceSize] = NULCH;
- BeginSource();
+ BeginSource();
}
-/// KORR_FUTURE: So far, this works only when tokens do not cross inserted
text boundaries.
+// KORR_FUTURE: So far, this works only when tokens do not cross inserted text
boundaries.
void
CharacterSource::InsertTextAtCurPos( const char * i_sText2Insert )
{
- if ( i_sText2Insert == 0 ? true : strlen(i_sText2Insert) == 0 )
- return;
+ if ( i_sText2Insert == 0 ? true : strlen(i_sText2Insert) == 0 )
+ return;
- aSourcesStack.push( S_SourceState(
- dpSource,
- nSourceSize,
- nCurPos,
- nLastCut,
- nLastTokenStart,
- cCharAtLastCut ) );
+ aSourcesStack.push( S_SourceState(
+ dpSource,
+ nSourceSize,
+ nCurPos,
+ nLastCut,
+ nLastTokenStart,
+ cCharAtLastCut ) );
nSourceSize = strlen(i_sText2Insert);
dpSource = new char[nSourceSize+1];
- strcpy( dpSource, i_sText2Insert); // SAFE STRCPY (#100211# -
checked)
+ strcpy( dpSource, i_sText2Insert); // SAFE STRCPY (#100211# - checked)
- BeginSource();
+ BeginSource();
}
const char *
@@ -110,43 +108,45 @@ CharacterSource::BeginSource()
dpSource[nLastCut] = NULCH;
}
-// KORR_FUTURE: So far, this works only when tokens do not cross inserted
text boundaries.
+// KORR_FUTURE: So far, this works only when tokens do not cross inserted text
boundaries.
char
CharacterSource::MoveOn_OverStack()
{
- while ( aSourcesStack.size() > 0 AND nCurPos >= nSourceSize-1 )
- {
- S_SourceState & aState = aSourcesStack.top();
- delete [] dpSource;
+ while ( aSourcesStack.size() > 0 AND nCurPos >= nSourceSize-1 )
+ {
+ S_SourceState & aState = aSourcesStack.top();
+ delete [] dpSource;
- dpSource = aState.dpSource;
- nSourceSize = aState.nSourceSize;
- nCurPos = aState.nCurPos;
- nLastCut = aState.nLastCut;
- nLastTokenStart = aState.nLastTokenStart;
- cCharAtLastCut = aState.cCharAtLastCut;
+ dpSource = aState.dpSource;
+ nSourceSize = aState.nSourceSize;
+ nCurPos = aState.nCurPos;
+ nLastCut = aState.nLastCut;
+ nLastTokenStart = aState.nLastTokenStart;
+ cCharAtLastCut = aState.cCharAtLastCut;
- aSourcesStack.pop();
- }
+ aSourcesStack.pop();
+ }
- if ( nLastCut < nCurPos )
- CutToken();
+ if ( nLastCut < nCurPos )
+ CutToken();
- return CurChar();
+ return CurChar();
}
CharacterSource::
S_SourceState::S_SourceState( DYN char * dpSource_,
- intt nSourceSize_,
- intt nCurPos_,
- intt nLastCut_,
- intt
nLastTokenStart_,
- char cCharAtLastCut_
)
- : dpSource(dpSource_),
- nSourceSize(nSourceSize_),
- nCurPos(nCurPos_),
+ intt
nSourceSize_,
+ intt
nCurPos_,
+ intt
nLastCut_,
+ intt
nLastTokenStart_,
+ char
cCharAtLastCut_ )
+ : dpSource(dpSource_),
+ nSourceSize(nSourceSize_),
+ nCurPos(nCurPos_),
nLastCut(nLastCut_),
nLastTokenStart(nLastTokenStart_),
cCharAtLastCut(cCharAtLastCut_)
{
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/basebmp/source/bitmapdevice.cxx
b/main/basebmp/source/bitmapdevice.cxx
index 9386072129..272c407dc8 100644
--- a/main/basebmp/source/bitmapdevice.cxx
+++ b/main/basebmp/source/bitmapdevice.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,20 +7,18 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
-
-
// FIXME: in vigra
#if defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x580)
#include <math.h> // needed for fabs, hypot
@@ -72,21 +70,20 @@
#include <vigra/copyimage.hxx>
#include <vigra/tuple.hxx>
-
namespace vigra
{
-/// componentwise xor of an RGBValue (missing from rgbvalue.hxx)
+// componentwise xor of an RGBValue (missing from rgbvalue.hxx)
template< class Value, unsigned int RedIndex, unsigned int BlueIndex, unsigned
int GreenIndex >
inline RGBValue<Value, RedIndex, GreenIndex, BlueIndex>
operator^( RGBValue<Value, RedIndex, GreenIndex, BlueIndex> const& lhs,
- RGBValue<Value, RedIndex, GreenIndex, BlueIndex> const& rhs )
+ RGBValue<Value, RedIndex, GreenIndex, BlueIndex> const& rhs )
{
- RGBValue<Value, RedIndex, GreenIndex, BlueIndex> res(
- lhs[0] ^ rhs[0],
- lhs[1] ^ rhs[1],
- lhs[2] ^ rhs[2]);
- return res;
+ RGBValue<Value, RedIndex, GreenIndex, BlueIndex> res(
+ lhs[0] ^ rhs[0],
+ lhs[1] ^ rhs[1],
+ lhs[2] ^ rhs[2]);
+ return res;
}
}
@@ -95,30 +92,30 @@ namespace basebmp
namespace
{
- /** Create the type for an accessor that takes the (mask,bitmap)
- input value generated from a JoinImageAccessorAdapter, and
- pipe that through a mask functor.
-
- @tpl DestAccessor
- Destination bitmap accessor
-
- @tpl JoinedAccessor
- Input accessor, is expected to generate a std::pair as the
- value type
-
- @tpl MaskFunctorMode
- Either FastMask or NoFastMask, depending on whether the mask
- is guaranteed to contain only 0s and 1s.
- */
- template< class DestAccessor,
- class JoinedAccessor,
- bool polarity,
+ /** Create the type for an accessor that takes the (mask,bitmap)
+ input value generated from a JoinImageAccessorAdapter, and
+ pipe that through a mask functor.
+
+ @tpl DestAccessor
+ Destination bitmap accessor
+
+ @tpl JoinedAccessor
+ Input accessor, is expected to generate a std::pair as the
+ value type
+
+ @tpl MaskFunctorMode
+ Either FastMask or NoFastMask, depending on whether the mask
+ is guaranteed to contain only 0s and 1s.
+ */
+ template< class DestAccessor,
+ class JoinedAccessor,
+ bool polarity,
typename MaskFunctorMode > struct masked_input_splitting_accessor
- {
- typedef BinarySetterFunctionAccessorAdapter<
+ {
+ typedef BinarySetterFunctionAccessorAdapter<
DestAccessor,
- BinaryFunctorSplittingWrapper<
- typename outputMaskFunctorSelector<
+ BinaryFunctorSplittingWrapper<
+ typename outputMaskFunctorSelector<
typename JoinedAccessor::value_type::first_type,
typename JoinedAccessor::value_type::second_type,
polarity,
@@ -151,10 +148,10 @@ namespace
alpha masks. With those mask formats, clipping and alpha
blending is handled natively.
*/
- template< class DestIterator,
- class RawAccessor,
+ template< class DestIterator,
+ class RawAccessor,
class AccessorSelector,
- class Masks > class BitmapRenderer :
+ class Masks > class BitmapRenderer :
public BitmapDevice
{
public:
@@ -170,13 +167,13 @@ namespace
typedef typename Masks::alphamask_format_traits::raw_accessor_type
alphamask_rawaccessor_type;
typedef typename Masks::alphamask_format_traits::accessor_selector
alphamask_accessorselector_type;
- typedef typename AccessorSelector::template wrap_accessor<
+ typedef typename AccessorSelector::template wrap_accessor<
raw_accessor_type >::type
dest_accessor_type;
typedef AccessorTraits< dest_accessor_type >
accessor_traits;
- typedef CompositeIterator2D< dest_iterator_type,
+ typedef CompositeIterator2D< dest_iterator_type,
mask_iterator_type >
composite_iterator_type;
- typedef CompositeIterator2D< vigra::Diff2D,
+ typedef CompositeIterator2D< vigra::Diff2D,
vigra::Diff2D >
generic_composite_iterator_type;
typedef BitmapRenderer<mask_iterator_type,
@@ -198,22 +195,22 @@ namespace
typedef typename raw_accessor_traits::xor_accessor
raw_xor_accessor_type;
typedef AccessorTraits<raw_xor_accessor_type>
raw_xor_accessor_traits;
- typedef typename accessor_selector::template wrap_accessor<
+ typedef typename accessor_selector::template wrap_accessor<
raw_xor_accessor_type >::type
xor_accessor_type;
typedef AccessorTraits<xor_accessor_type>
xor_accessor_traits;
// -------------------------------------------------------
- typedef typename raw_accessor_traits::template masked_accessor<
+ typedef typename raw_accessor_traits::template masked_accessor<
mask_rawaccessor_type,
dest_iterator_type,
mask_iterator_type,
Masks::clipmask_polarity>::type
raw_maskedaccessor_type;
- typedef typename accessor_selector::template wrap_accessor<
+ typedef typename accessor_selector::template wrap_accessor<
raw_maskedaccessor_type >::type
masked_accessor_type;
typedef typename AccessorTraits<
raw_maskedaccessor_type>::xor_accessor
raw_maskedxor_accessor_type;
- typedef typename accessor_selector::template wrap_accessor<
+ typedef typename accessor_selector::template wrap_accessor<
raw_maskedxor_accessor_type >::type
masked_xoraccessor_type;
// -------------------------------------------------------
@@ -221,24 +218,24 @@ namespace
// ((iter,mask),mask) special case (e.g. for clipped
// drawMaskedColor())
typedef AccessorTraits< raw_maskedaccessor_type >
raw_maskedaccessor_traits;
- typedef typename raw_maskedaccessor_traits::template masked_accessor<
+ typedef typename raw_maskedaccessor_traits::template masked_accessor<
mask_rawaccessor_type,
composite_iterator_type,
mask_iterator_type,
Masks::clipmask_polarity>::type
raw_maskedmask_accessor_type;
- typedef CompositeIterator2D<
+ typedef CompositeIterator2D<
composite_iterator_type,
mask_iterator_type>
composite_composite_mask_iterator_type;
-
+
// -------------------------------------------------------
- typedef ConstantColorBlendSetterAccessorAdapter<
+ typedef ConstantColorBlendSetterAccessorAdapter<
dest_accessor_type,
typename alphamask_rawaccessor_type::value_type,
Masks::alphamask_polarity>
colorblend_accessor_type;
typedef AccessorTraits<colorblend_accessor_type>
colorblend_accessor_traits;
- typedef typename colorblend_accessor_traits::template masked_accessor<
+ typedef typename colorblend_accessor_traits::template masked_accessor<
mask_rawaccessor_type,
dest_iterator_type,
mask_iterator_type,
@@ -246,12 +243,12 @@ namespace
// -------------------------------------------------------
- typedef ConstantColorBlendSetterAccessorAdapter<
+ typedef ConstantColorBlendSetterAccessorAdapter<
dest_accessor_type,
Color,
Masks::alphamask_polarity>
colorblend_generic_accessor_type;
typedef AccessorTraits<colorblend_generic_accessor_type>
colorblend_generic_accessor_traits;
- typedef typename colorblend_generic_accessor_traits::template
masked_accessor<
+ typedef typename colorblend_generic_accessor_traits::template
masked_accessor<
mask_rawaccessor_type,
dest_iterator_type,
mask_iterator_type,
@@ -268,7 +265,7 @@ namespace
dest_iterator_type maBegin;
typename accessor_traits::color_lookup maColorLookup;
- to_uint32_functor maToUInt32Converter;
+ to_uint32_functor maToUInt32Converter;
dest_accessor_type maAccessor;
colorblend_accessor_type maColorBlendAccessor;
colorblend_generic_accessor_type maGenericColorBlendAccessor;
@@ -289,12 +286,12 @@ namespace
sal_Int32 nScanlineFormat,
sal_Int32 nScanlineStride,
sal_uInt8* pFirstScanline,
- dest_iterator_type begin,
+ dest_iterator_type begin,
raw_accessor_type rawAccessor,
dest_accessor_type accessor,
const RawMemorySharedArray& rMem,
const PaletteMemorySharedVector& rPalette ) :
- BitmapDevice( rBounds, nScanlineFormat,
+ BitmapDevice( rBounds, nScanlineFormat,
nScanlineStride, pFirstScanline, rMem, rPalette ),
maBegin( begin ),
maColorLookup(),
@@ -364,30 +361,30 @@ namespace
{
fillImage(destIterRange(maBegin,
maRawAccessor,
- rBounds),
- maColorLookup(
+ rBounds),
+ maColorLookup(
maAccessor,
fillColor) );
}
- virtual void setPixel_i( const basegfx::B2IPoint& rPt,
- Color pixelColor,
+ virtual void setPixel_i( const basegfx::B2IPoint& rPt,
+ Color pixelColor,
DrawMode drawMode )
{
- const DestIterator pixel( maBegin +
+ const DestIterator pixel( maBegin +
vigra::Diff2D(rPt.getX(),
rPt.getY()) );
if( drawMode == DrawMode_XOR )
- maXorAccessor.set( pixelColor,
+ maXorAccessor.set( pixelColor,
pixel );
else
- maAccessor.set( pixelColor,
+ maAccessor.set( pixelColor,
pixel );
}
- virtual void setPixel_i( const basegfx::B2IPoint& rPt,
- Color pixelColor,
- DrawMode drawMode,
+ virtual void setPixel_i( const basegfx::B2IPoint& rPt,
+ Color pixelColor,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
boost::shared_ptr<mask_bitmap_type> pMask(
getCompatibleClipMask(rClip) );
@@ -396,7 +393,7 @@ namespace
const vigra::Diff2D offset(rPt.getX(),
rPt.getY());
- const composite_iterator_type aIter(
+ const composite_iterator_type aIter(
maBegin + offset,
pMask->maBegin + offset );
@@ -410,7 +407,7 @@ namespace
virtual Color getPixel_i(const basegfx::B2IPoint& rPt )
{
- const DestIterator pixel( maBegin +
+ const DestIterator pixel( maBegin +
vigra::Diff2D(rPt.getX(),
rPt.getY()) );
return maAccessor(pixel);
@@ -418,7 +415,7 @@ namespace
virtual sal_uInt32 getPixelData_i( const basegfx::B2IPoint& rPt )
{
- const DestIterator pixel( maBegin +
+ const DestIterator pixel( maBegin +
vigra::Diff2D(rPt.getX(),
rPt.getY()) );
return maToUInt32Converter(maRawAccessor(pixel));
@@ -432,7 +429,7 @@ namespace
const Iterator& begin,
const RawAcc& rawAcc )
{
- renderClippedLine( rPt1,
+ renderClippedLine( rPt1,
rPt2,
rBounds,
col,
@@ -455,15 +452,15 @@ namespace
begin,
rawAcc );
}
-
+
template< typename Iterator, typename RawAcc, typename XorAcc >
void implDrawLine( const basegfx::B2IPoint& rPt1,
const basegfx::B2IPoint& rPt2,
const basegfx::B2IRange& rBounds,
Color col,
- const Iterator& begin,
+ const Iterator& begin,
const RawAcc& rawAcc,
- const XorAcc& xorAcc,
+ const XorAcc& xorAcc,
DrawMode drawMode )
{
if( drawMode == DrawMode_XOR )
@@ -474,10 +471,10 @@ namespace
begin, maAccessor, rawAcc );
}
- virtual void drawLine_i(const basegfx::B2IPoint& rPt1,
- const basegfx::B2IPoint& rPt2,
+ virtual void drawLine_i(const basegfx::B2IPoint& rPt1,
+ const basegfx::B2IPoint& rPt2,
const basegfx::B2IRange& rBounds,
- Color lineColor,
+ Color lineColor,
DrawMode drawMode )
{
implDrawLine(rPt1,rPt2,rBounds,lineColor,
@@ -490,15 +487,15 @@ namespace
boost::shared_ptr<mask_bitmap_type> pMask(
getCompatibleClipMask(rClip) );
OSL_ASSERT( pMask );
- return composite_iterator_type( maBegin,
+ return composite_iterator_type( maBegin,
pMask->maBegin );
}
- virtual void drawLine_i(const basegfx::B2IPoint& rPt1,
- const basegfx::B2IPoint& rPt2,
+ virtual void drawLine_i(const basegfx::B2IPoint& rPt1,
+ const basegfx::B2IPoint& rPt2,
const basegfx::B2IRange& rBounds,
- Color lineColor,
- DrawMode drawMode,
+ Color lineColor,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
implDrawLine(rPt1,rPt2,rBounds,lineColor,
@@ -508,72 +505,72 @@ namespace
}
template< typename Iterator, typename RawAcc >
- void implDrawPolygon( const basegfx::B2DPolygon& rPoly,
+ void implDrawPolygon( const basegfx::B2DPolygon& rPoly,
const basegfx::B2IRange& rBounds,
Color col,
- const Iterator& begin,
+ const Iterator& begin,
const RawAcc& acc )
{
basegfx::B2DPolygon aPoly( rPoly );
if( rPoly.areControlPointsUsed() )
aPoly = basegfx::tools::adaptiveSubdivideByCount( rPoly );
- const typename dest_iterator_type::value_type colorIndex(
maColorLookup(
+ const typename dest_iterator_type::value_type colorIndex(
maColorLookup(
maAccessor,
col));
const sal_uInt32 nVertices(
aPoly.count() );
for( sal_uInt32 i=1; i<nVertices; ++i )
- implRenderLine2( basegfx::fround(aPoly.getB2DPoint(i-1)),
- basegfx::fround(aPoly.getB2DPoint(i)),
+ implRenderLine2( basegfx::fround(aPoly.getB2DPoint(i-1)),
+ basegfx::fround(aPoly.getB2DPoint(i)),
rBounds,
colorIndex,
begin,
acc );
if( nVertices > 1 && aPoly.isClosed() )
- implRenderLine2(
basegfx::fround(aPoly.getB2DPoint(nVertices-1)),
- basegfx::fround(aPoly.getB2DPoint(0)),
+ implRenderLine2(
basegfx::fround(aPoly.getB2DPoint(nVertices-1)),
+ basegfx::fround(aPoly.getB2DPoint(0)),
rBounds,
colorIndex,
begin,
acc );
}
- virtual void drawPolygon_i(const basegfx::B2DPolygon& rPoly,
+ virtual void drawPolygon_i(const basegfx::B2DPolygon& rPoly,
const basegfx::B2IRange& rBounds,
- Color lineColor,
+ Color lineColor,
DrawMode drawMode )
{
if( drawMode == DrawMode_XOR )
- implDrawPolygon( rPoly, rBounds, lineColor,
- maBegin,
+ implDrawPolygon( rPoly, rBounds, lineColor,
+ maBegin,
maRawXorAccessor );
else
- implDrawPolygon( rPoly, rBounds, lineColor,
- maBegin,
+ implDrawPolygon( rPoly, rBounds, lineColor,
+ maBegin,
maRawAccessor );
}
- virtual void drawPolygon_i(const basegfx::B2DPolygon& rPoly,
+ virtual void drawPolygon_i(const basegfx::B2DPolygon& rPoly,
const basegfx::B2IRange& rBounds,
- Color lineColor,
- DrawMode drawMode,
+ Color lineColor,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
if( drawMode == DrawMode_XOR )
- implDrawPolygon( rPoly, rBounds, lineColor,
+ implDrawPolygon( rPoly, rBounds, lineColor,
getMaskedIter(rClip),
maRawMaskedXorAccessor );
else
- implDrawPolygon( rPoly, rBounds, lineColor,
+ implDrawPolygon( rPoly, rBounds, lineColor,
getMaskedIter(rClip),
maRawMaskedAccessor );
}
template< typename Iterator, typename RawAcc >
- void implFillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
+ void implFillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
Color col,
- const Iterator& begin,
+ const Iterator& begin,
const RawAcc& acc,
const basegfx::B2IRange& rBounds )
{
@@ -581,7 +578,7 @@ namespace
if( rPoly.areControlPointsUsed() )
aPoly = basegfx::tools::adaptiveSubdivideByCount( rPoly );
- renderClippedPolyPolygon( begin,
+ renderClippedPolyPolygon( begin,
acc,
maColorLookup( maAccessor,
col),
@@ -590,36 +587,36 @@ namespace
basegfx::FillRule_EVEN_ODD );
}
- virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly,
- Color
fillColor,
+ virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly,
+ Color
fillColor,
DrawMode drawMode,
const basegfx::B2IRange& rBounds )
{
if( drawMode == DrawMode_XOR )
- implFillPolyPolygon( rPoly, fillColor,
+ implFillPolyPolygon( rPoly, fillColor,
maBegin,
maRawXorAccessor,
rBounds );
else
- implFillPolyPolygon( rPoly, fillColor,
+ implFillPolyPolygon( rPoly, fillColor,
maBegin,
maRawAccessor,
rBounds );
}
- virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly,
- Color
fillColor,
+ virtual void fillPolyPolygon_i(const basegfx::B2DPolyPolygon& rPoly,
+ Color
fillColor,
DrawMode drawMode,
- const basegfx::B2IRange& rBounds,
+ const basegfx::B2IRange& rBounds,
const BitmapDeviceSharedPtr& rClip )
{
if( drawMode == DrawMode_XOR )
- implFillPolyPolygon( rPoly, fillColor,
+ implFillPolyPolygon( rPoly, fillColor,
getMaskedIter(rClip),
maRawMaskedXorAccessor,
rBounds );
else
- implFillPolyPolygon( rPoly, fillColor,
+ implFillPolyPolygon( rPoly, fillColor,
getMaskedIter(rClip),
maRawMaskedAccessor,
rBounds );
@@ -653,7 +650,7 @@ namespace
const Acc& acc)
{
GenericColorImageAccessor aSrcAcc( rSrcBitmap );
-
+
scaleImage(
srcIterRange(vigra::Diff2D(),
aSrcAcc,
@@ -665,7 +662,7 @@ namespace
virtual void drawBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IRange& rDstRect,
+ const basegfx::B2IRange& rDstRect,
DrawMode drawMode )
{
if( isCompatibleBitmap( rSrcBitmap ) )
@@ -694,8 +691,8 @@ namespace
virtual void drawBitmap_i(const BitmapDeviceSharedPtr& rSrcBitmap,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IRange& rDstRect,
- DrawMode drawMode,
+ const basegfx::B2IRange& rDstRect,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
if( isCompatibleBitmap( rSrcBitmap ) )
@@ -747,12 +744,12 @@ namespace
maBegin + vigra::Diff2D(rDstPoint.getX(),
rDstPoint.getY()),
pMask->maBegin + topLeft(rSrcRect) );
-
+
fillImage(aBegin,
aBegin + vigra::Diff2D(rSrcRect.getWidth(),
- rSrcRect.getHeight()),
+ rSrcRect.getHeight()),
maRawMaskedAccessor,
- maColorLookup(
+ maColorLookup(
maAccessor,
aSrcColor) );
}
@@ -773,7 +770,7 @@ namespace
virtual void drawMaskedColor_i(Color aSrcColor,
const BitmapDeviceSharedPtr& rAlphaMask,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IPoint& rDstPoint,
+ const basegfx::B2IPoint& rDstPoint,
const BitmapDeviceSharedPtr& rClip )
{
boost::shared_ptr<mask_bitmap_type> pMask(
getCompatibleClipMask(rAlphaMask) );
@@ -782,7 +779,7 @@ namespace
if( pAlpha )
{
const composite_iterator_type aBegin( getMaskedIter(rClip) );
- maMaskedColorBlendAccessor.get1stWrappedAccessor().setColor(
+ maMaskedColorBlendAccessor.get1stWrappedAccessor().setColor(
aSrcColor );
vigra::copyImage( srcIterRange(pAlpha->maBegin,
@@ -807,12 +804,12 @@ namespace
pMask->maBegin + topLeft(rSrcRect)),
pClipMask->maBegin + vigra::Diff2D(rDstPoint.getX(),
rDstPoint.getY()) );
-
+
fillImage(aBegin,
aBegin + vigra::Diff2D(rSrcRect.getWidth(),
- rSrcRect.getHeight()),
+ rSrcRect.getHeight()),
maRawMaskedMaskAccessor,
- maColorLookup(
+ maColorLookup(
maAccessor,
aSrcColor) );
}
@@ -820,7 +817,7 @@ namespace
{
GenericColorImageAccessor aSrcAcc( rAlphaMask );
const composite_iterator_type aBegin( getMaskedIter(rClip) );
-
maGenericMaskedColorBlendAccessor.get1stWrappedAccessor().setColor(
+
maGenericMaskedColorBlendAccessor.get1stWrappedAccessor().setColor(
aSrcColor );
vigra::copyImage( srcIterRange(vigra::Diff2D(),
@@ -898,7 +895,7 @@ namespace
virtual void drawMaskedBitmap_i(const BitmapDeviceSharedPtr&
rSrcBitmap,
const BitmapDeviceSharedPtr& rMask,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IRange& rDstRect,
+ const basegfx::B2IRange& rDstRect,
DrawMode drawMode )
{
if( isCompatibleClipMask(rMask) &&
@@ -933,8 +930,8 @@ namespace
virtual void drawMaskedBitmap_i(const BitmapDeviceSharedPtr&
rSrcBitmap,
const BitmapDeviceSharedPtr& rMask,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IRange& rDstRect,
- DrawMode drawMode,
+ const basegfx::B2IRange& rDstRect,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
if( isCompatibleClipMask(rMask) &&
@@ -970,16 +967,16 @@ namespace
struct ImplBitmapDevice
{
- /** Bitmap memory plus deleter.
+ /** Bitmap memory plus deleter.
Always points to the start of the mem
*/
RawMemorySharedArray mpMem;
- /// Palette memory plus deleter (might be NULL)
+ // Palette memory plus deleter (might be NULL)
PaletteMemorySharedVector mpPalette;
- /** Bounds of the device.
+ /** Bounds of the device.
maBounds.getWidth()/getHeight() yield the true size of the
device (i.e. the rectangle given by maBounds covers the device
@@ -988,7 +985,7 @@ struct ImplBitmapDevice
*/
basegfx::B2IRange maBounds;
- /** Bounds of the device.
+ /** Bounds of the device.
maBounds.getWidth()/getHeight() yield the true size of the
device minus 1 (i.e. the rectangle given by maBounds covers
@@ -1000,13 +997,13 @@ struct ImplBitmapDevice
*/
basegfx::B2IRange maLineClipRect;
- /// Scanline format, as provided at the constructor
+ // Scanline format, as provided at the constructor
sal_Int32 mnScanlineFormat;
- /// Scanline stride. Negative for bottom-to-top formats
+ // Scanline stride. Negative for bottom-to-top formats
sal_Int32 mnScanlineStride;
-
- /// raw ptr to 0th scanline. used for cloning a generic renderer
+
+ // raw ptr to 0th scanline. used for cloning a generic renderer
sal_uInt8* mpFirstScanline;
/** (Optional) device sharing the same memory, and used for input
@@ -1046,7 +1043,7 @@ BitmapDevice::BitmapDevice( const basegfx::B2IRange&
rBounds,
mpImpl->mnScanlineStride = nScanlineStride;
mpImpl->mpFirstScanline = pFirstScanline;
}
-
+
BitmapDevice::~BitmapDevice()
{
// outline, because of internal ImplBitmapDevice
@@ -1054,7 +1051,7 @@ BitmapDevice::~BitmapDevice()
basegfx::B2IVector BitmapDevice::getSize() const
{
-
+
return basegfx::B2IVector(
mpImpl->maBounds.getMaxX() - mpImpl->maBounds.getMinX(),
mpImpl->maBounds.getMaxY() - mpImpl->maBounds.getMinY() );
@@ -1072,7 +1069,7 @@ sal_Int32 BitmapDevice::getScanlineFormat() const
sal_Int32 BitmapDevice::getScanlineStride() const
{
- return mpImpl->mnScanlineStride < 0 ?
+ return mpImpl->mnScanlineStride < 0 ?
-mpImpl->mnScanlineStride : mpImpl->mnScanlineStride;
}
@@ -1096,17 +1093,17 @@ void BitmapDevice::clear( Color fillColor )
clear_i( fillColor, mpImpl->maBounds );
}
-void BitmapDevice::setPixel( const basegfx::B2IPoint& rPt,
- Color lineColor,
+void BitmapDevice::setPixel( const basegfx::B2IPoint& rPt,
+ Color lineColor,
DrawMode drawMode )
{
if( mpImpl->maLineClipRect.isInside(rPt) )
setPixel_i(rPt,lineColor,drawMode);
}
-void BitmapDevice::setPixel( const basegfx::B2IPoint& rPt,
- Color lineColor,
- DrawMode drawMode,
+void BitmapDevice::setPixel( const basegfx::B2IPoint& rPt,
+ Color lineColor,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
if( !rClip )
@@ -1140,22 +1137,22 @@ sal_uInt32 BitmapDevice::getPixelData( const
basegfx::B2IPoint& rPt )
return 0;
}
-void BitmapDevice::drawLine( const basegfx::B2IPoint& rPt1,
- const basegfx::B2IPoint& rPt2,
- Color lineColor,
+void BitmapDevice::drawLine( const basegfx::B2IPoint& rPt1,
+ const basegfx::B2IPoint& rPt2,
+ Color lineColor,
DrawMode drawMode )
{
- drawLine_i( rPt1,
+ drawLine_i( rPt1,
rPt2,
mpImpl->maLineClipRect,
lineColor,
drawMode );
}
-void BitmapDevice::drawLine( const basegfx::B2IPoint& rPt1,
- const basegfx::B2IPoint& rPt2,
- Color lineColor,
- DrawMode drawMode,
+void BitmapDevice::drawLine( const basegfx::B2IPoint& rPt1,
+ const basegfx::B2IPoint& rPt2,
+ Color lineColor,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
if( !rClip )
@@ -1165,19 +1162,19 @@ void BitmapDevice::drawLine( const basegfx::B2IPoint&
rPt1,
}
if( isCompatibleClipMask( rClip ) )
- drawLine_i( rPt1,
+ drawLine_i( rPt1,
rPt2,
mpImpl->maLineClipRect,
lineColor,
drawMode,
rClip );
else
- getGenericRenderer()->drawLine( rPt1, rPt2, lineColor,
+ getGenericRenderer()->drawLine( rPt1, rPt2, lineColor,
drawMode, rClip );
}
-void BitmapDevice::drawPolygon( const basegfx::B2DPolygon& rPoly,
- Color lineColor,
+void BitmapDevice::drawPolygon( const basegfx::B2DPolygon& rPoly,
+ Color lineColor,
DrawMode drawMode )
{
const sal_uInt32 numVertices( rPoly.count() );
@@ -1187,9 +1184,9 @@ void BitmapDevice::drawPolygon( const
basegfx::B2DPolygon& rPoly,
lineColor, drawMode );
}
-void BitmapDevice::drawPolygon( const basegfx::B2DPolygon& rPoly,
- Color lineColor,
- DrawMode drawMode,
+void BitmapDevice::drawPolygon( const basegfx::B2DPolygon& rPoly,
+ Color lineColor,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
if( !rClip )
@@ -1206,21 +1203,21 @@ void BitmapDevice::drawPolygon( const
basegfx::B2DPolygon& rPoly,
mpImpl->maLineClipRect,
lineColor, drawMode, rClip );
else
- getGenericRenderer()->drawPolygon( rPoly, lineColor,
+ getGenericRenderer()->drawPolygon( rPoly, lineColor,
drawMode, rClip );
}
}
-void BitmapDevice::fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
- Color fillColor,
+void BitmapDevice::fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
+ Color fillColor,
DrawMode drawMode )
{
fillPolyPolygon_i( rPoly, fillColor, drawMode, mpImpl->maBounds );
}
-void BitmapDevice::fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
- Color fillColor,
- DrawMode drawMode,
+void BitmapDevice::fillPolyPolygon( const basegfx::B2DPolyPolygon& rPoly,
+ Color fillColor,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
if( !rClip )
@@ -1232,7 +1229,7 @@ void BitmapDevice::fillPolyPolygon( const
basegfx::B2DPolyPolygon& rPoly,
if( isCompatibleClipMask( rClip ) )
fillPolyPolygon_i( rPoly, fillColor, drawMode, mpImpl->maBounds, rClip
);
else
- getGenericRenderer()->fillPolyPolygon( rPoly, fillColor,
+ getGenericRenderer()->fillPolyPolygon( rPoly, fillColor,
drawMode, rClip );
}
@@ -1266,7 +1263,7 @@ namespace
const ::basegfx::B2IRange& rSourceBounds,
const ::basegfx::B2IRange& rDestBounds )
{
- const ::basegfx::B2IPoint aSourceTopLeft(
+ const ::basegfx::B2IPoint aSourceTopLeft(
io_rSourceArea.getMinimum() );
::basegfx::B2IRange aLocalSourceArea( io_rSourceArea );
@@ -1276,28 +1273,28 @@ namespace
if( aLocalSourceArea.isEmpty() )
return false;
-
+
// calc relative new source area points (relative to orig
// source area)
- const ::basegfx::B2IVector aUpperLeftOffset(
+ const ::basegfx::B2IVector aUpperLeftOffset(
aLocalSourceArea.getMinimum()-aSourceTopLeft );
- const ::basegfx::B2IVector aLowerRightOffset(
+ const ::basegfx::B2IVector aLowerRightOffset(
aLocalSourceArea.getMaximum()-aSourceTopLeft );
::basegfx::B2IRange aLocalDestArea( io_rDestPoint + aUpperLeftOffset,
io_rDestPoint + aLowerRightOffset
);
-
+
// clip dest area (which must be inside rDestBounds)
aLocalDestArea.intersect( rDestBounds );
-
+
if( aLocalDestArea.isEmpty() )
return false;
// calc relative new dest area points (relative to orig
// source area)
- const ::basegfx::B2IVector aDestUpperLeftOffset(
+ const ::basegfx::B2IVector aDestUpperLeftOffset(
aLocalDestArea.getMinimum()-io_rDestPoint );
- const ::basegfx::B2IVector aDestLowerRightOffset(
+ const ::basegfx::B2IVector aDestLowerRightOffset(
aLocalDestArea.getMaximum()-io_rDestPoint );
io_rSourceArea = ::basegfx::B2IRange( aSourceTopLeft +
aDestUpperLeftOffset,
@@ -1319,9 +1316,9 @@ namespace
const double nScaleY( io_rDestArea.getHeight() /
(double)io_rSourceArea.getHeight() );
// extract range origins
- const basegfx::B2IPoint aDestTopLeft(
+ const basegfx::B2IPoint aDestTopLeft(
io_rDestArea.getMinimum() );
- const ::basegfx::B2IPoint aSourceTopLeft(
+ const ::basegfx::B2IPoint aSourceTopLeft(
io_rSourceArea.getMinimum() );
::basegfx::B2IRange aLocalSourceArea( io_rSourceArea );
@@ -1331,30 +1328,30 @@ namespace
if( aLocalSourceArea.isEmpty() )
return false;
-
+
// calc relative new source area points (relative to orig
// source area)
- const ::basegfx::B2IVector aUpperLeftOffset(
+ const ::basegfx::B2IVector aUpperLeftOffset(
aLocalSourceArea.getMinimum()-aSourceTopLeft );
- const ::basegfx::B2IVector aLowerRightOffset(
+ const ::basegfx::B2IVector aLowerRightOffset(
aLocalSourceArea.getMaximum()-aSourceTopLeft );
::basegfx::B2IRange aLocalDestArea(
basegfx::fround(aDestTopLeft.getX() + nScaleX*aUpperLeftOffset.getX()),
basegfx::fround(aDestTopLeft.getY() + nScaleY*aUpperLeftOffset.getY()),
basegfx::fround(aDestTopLeft.getX() + nScaleX*aLowerRightOffset.getX()),
basegfx::fround(aDestTopLeft.getY() + nScaleY*aLowerRightOffset.getY()) );
-
+
// clip dest area (which must be inside rDestBounds)
aLocalDestArea.intersect( rDestBounds );
-
+
if( aLocalDestArea.isEmpty() )
return false;
// calc relative new dest area points (relative to orig
// source area)
- const ::basegfx::B2IVector aDestUpperLeftOffset(
+ const ::basegfx::B2IVector aDestUpperLeftOffset(
aLocalDestArea.getMinimum()-aDestTopLeft );
- const ::basegfx::B2IVector aDestLowerRightOffset(
+ const ::basegfx::B2IVector aDestLowerRightOffset(
aLocalDestArea.getMaximum()-aDestTopLeft );
io_rSourceArea = ::basegfx::B2IRange(
basegfx::fround(aSourceTopLeft.getX() + aDestUpperLeftOffset.getX()/nScaleX),
@@ -1365,7 +1362,7 @@ namespace
// final source area clip (chopping round-offs)
io_rSourceArea.intersect( rSourceBounds );
-
+
if( io_rSourceArea.isEmpty() )
return false;
@@ -1376,7 +1373,7 @@ namespace
void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IRange& rDstRect,
+ const basegfx::B2IRange& rDstRect,
DrawMode drawMode )
{
const basegfx::B2IVector& rSrcSize( rSrcBitmap->getSize() );
@@ -1398,8 +1395,8 @@ void BitmapDevice::drawBitmap( const
BitmapDeviceSharedPtr& rSrcBitmap,
void BitmapDevice::drawBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IRange& rDstRect,
- DrawMode drawMode,
+ const basegfx::B2IRange& rDstRect,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
if( !rClip )
@@ -1427,7 +1424,7 @@ void BitmapDevice::drawBitmap( const
BitmapDeviceSharedPtr& rSrcBitmap,
}
else
{
- getGenericRenderer()->drawBitmap( rSrcBitmap, rSrcRect,
+ getGenericRenderer()->drawBitmap( rSrcBitmap, rSrcRect,
rDstRect, drawMode, rClip );
}
}
@@ -1458,7 +1455,7 @@ void BitmapDevice::drawMaskedColor( Color
aSrcColor,
const basegfx::B2ITuple aSize( aSrcRange.getWidth(),
aSrcRange.getHeight() );
- BitmapDeviceSharedPtr pAlphaCopy(
+ BitmapDeviceSharedPtr pAlphaCopy(
cloneBitmapDevice( aSize,
shared_from_this()) );
basegfx::B2ITuple aGcc3WorkaroundTemporary;
@@ -1480,7 +1477,7 @@ void BitmapDevice::drawMaskedColor( Color
aSrcColor,
void BitmapDevice::drawMaskedColor( Color aSrcColor,
const BitmapDeviceSharedPtr& rAlphaMask,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IPoint& rDstPoint,
+ const basegfx::B2IPoint& rDstPoint,
const BitmapDeviceSharedPtr& rClip )
{
if( !rClip )
@@ -1511,7 +1508,7 @@ void BitmapDevice::drawMaskedColor( Color
aSrcColor,
const basegfx::B2ITuple aSize( aSrcRange.getWidth(),
aSrcRange.getHeight() );
- BitmapDeviceSharedPtr pAlphaCopy(
+ BitmapDeviceSharedPtr pAlphaCopy(
cloneBitmapDevice( aSize,
shared_from_this()) );
basegfx::B2ITuple aGcc3WorkaroundTemporary;
@@ -1539,7 +1536,7 @@ void BitmapDevice::drawMaskedColor( Color
aSrcColor,
void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
const BitmapDeviceSharedPtr& rMask,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IRange& rDstRect,
+ const basegfx::B2IRange& rDstRect,
DrawMode drawMode )
{
OSL_ASSERT( rMask->getSize() == rSrcBitmap->getSize() );
@@ -1564,8 +1561,8 @@ void BitmapDevice::drawMaskedBitmap( const
BitmapDeviceSharedPtr& rSrcBitmap,
void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
const BitmapDeviceSharedPtr& rMask,
const basegfx::B2IRange& rSrcRect,
- const basegfx::B2IRange& rDstRect,
- DrawMode drawMode,
+ const basegfx::B2IRange& rDstRect,
+ DrawMode drawMode,
const BitmapDeviceSharedPtr& rClip )
{
if( !rClip )
@@ -1595,7 +1592,7 @@ void BitmapDevice::drawMaskedBitmap( const
BitmapDeviceSharedPtr& rSrcBitmap,
}
else
{
- getGenericRenderer()->drawMaskedBitmap( rSrcBitmap, rMask,
rSrcRect,
+ getGenericRenderer()->drawMaskedBitmap( rSrcBitmap, rMask,
rSrcRect,
rDstRect, drawMode, rClip
);
}
}
@@ -1611,10 +1608,10 @@ struct StdMasks
typedef PixelFormatTraits_GREY1_MSB clipmask_format_traits;
typedef PixelFormatTraits_GREY8 alphamask_format_traits;
- /// Clipmask: 0 means opaque
+ // Clipmask: 0 means opaque
static const bool clipmask_polarity = false;
- /// Alpha mask: 0 means fully transparent
+ // Alpha mask: 0 means fully transparent
static const bool alphamask_polarity = true;
};
@@ -1636,7 +1633,7 @@ struct MaskTraitsGeneric
// then.
#ifndef BASEBMP_NO_NESTED_TEMPLATE_PARAMETER
-/// Produces a specialized renderer for the given pixel format
+// Produces a specialized renderer for the given pixel format
template< class FormatTraits, class MaskTraits >
BitmapDeviceSharedPtr createRenderer(
const basegfx::B2IRange& rBounds,
@@ -1670,7 +1667,7 @@ BitmapDeviceSharedPtr createRenderer(
typename FormatTraits::accessor_selector,
MaskTraits > Renderer;
- return BitmapDeviceSharedPtr(
+ return BitmapDeviceSharedPtr(
new Renderer( rBounds,
nScanlineFormat,
nScanlineStride,
@@ -1685,8 +1682,8 @@ BitmapDeviceSharedPtr createRenderer(
pPal ));
}
-/// Create standard grey level palette
-PaletteMemorySharedVector createStandardPalette(
+// Create standard gray level palette
+PaletteMemorySharedVector createStandardPalette(
const PaletteMemorySharedVector& pPal,
sal_Int32 nNumEntries )
{
@@ -1695,14 +1692,14 @@ PaletteMemorySharedVector createStandardPalette(
boost::shared_ptr< std::vector<Color> > pLocalPal(
new std::vector<Color>(nNumEntries) );
-
+
const sal_Int32 nIncrement( 0x00FFFFFF/nNumEntries );
--nNumEntries;
for( sal_Int32 i=0, c=0; i<nNumEntries; ++i,c+=nIncrement )
pLocalPal->at(i) = Color(0xFF000000 | c);
-
+
pLocalPal->at(nNumEntries) = Color(0xFFFFFFFF);
-
+
return pLocalPal;
}
@@ -1748,7 +1745,7 @@ BitmapDeviceSharedPtr createRenderer(
nScanlineStride,
pFirstScanline,
typename
FormatTraits::raw_accessor_type(),
- typename
FormatTraits::accessor_selector::template
+ typename
FormatTraits::accessor_selector::template
wrap_accessor<
typename
FormatTraits::raw_accessor_type>::type(
&pPal->at(0),
@@ -1792,27 +1789,27 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const
basegfx::B2IVector& r
PaletteMemorySharedVector
pPal,
const basegfx::B2IRange*
pSubset )
{
- if( nScanlineFormat <= Format::NONE ||
+ if( nScanlineFormat <= Format::NONE ||
nScanlineFormat > Format::MAX )
return BitmapDeviceSharedPtr();
- static const sal_uInt8 bitsPerPixel[] =
+ static const sal_uInt8 bitsPerPixel[] =
{
- 0, // NONE
- 1, // ONE_BIT_MSB_GREY
- 1, // ONE_BIT_LSB_GREY
- 1, // ONE_BIT_MSB_PAL
- 1, // ONE_BIT_LSB_PAL
- 4, // FOUR_BIT_MSB_GREY
- 4, // FOUR_BIT_LSB_GREY
- 4, // FOUR_BIT_MSB_PAL
- 4, // FOUR_BIT_LSB_PAL
- 8, // EIGHT_BIT_PAL
- 8, // EIGHT_BIT_GREY
- 16, // SIXTEEN_BIT_LSB_TC_MASK
- 16, // SIXTEEN_BIT_MSB_TC_MASK
- 24, // TWENTYFOUR_BIT_TC_MASK
- 32, // THIRTYTWO_BIT_TC_MASK
+ 0, // NONE
+ 1, // ONE_BIT_MSB_GREY
+ 1, // ONE_BIT_LSB_GREY
+ 1, // ONE_BIT_MSB_PAL
+ 1, // ONE_BIT_LSB_PAL
+ 4, // FOUR_BIT_MSB_GREY
+ 4, // FOUR_BIT_LSB_GREY
+ 4, // FOUR_BIT_MSB_PAL
+ 4, // FOUR_BIT_LSB_PAL
+ 8, // EIGHT_BIT_PAL
+ 8, // EIGHT_BIT_GREY
+ 16, // SIXTEEN_BIT_LSB_TC_MASK
+ 16, // SIXTEEN_BIT_MSB_TC_MASK
+ 24, // TWENTYFOUR_BIT_TC_MASK
+ 32, // THIRTYTWO_BIT_TC_MASK
32, // THIRTYTWO_BIT_TC_MASK_ARGB
};
@@ -1831,7 +1828,7 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const
basegfx::B2IVector& r
// factor in bottom-up scanline order case
nScanlineStride *= bTopDown ? 1 : -1;
- const std::size_t nMemSize(
+ const std::size_t nMemSize(
(nScanlineStride < 0 ? -nScanlineStride :
nScanlineStride)*rSize.getY() );
if( !pMem )
@@ -1842,7 +1839,7 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const
basegfx::B2IVector& r
rtl_zeroMemory(pMem.get(),nMemSize);
}
- sal_uInt8* pFirstScanline = nScanlineStride < 0 ?
+ sal_uInt8* pFirstScanline = nScanlineStride < 0 ?
pMem.get() + nMemSize + nScanlineStride : pMem.get();
// shrink render area to given subset, if given
@@ -1904,8 +1901,8 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const
basegfx::B2IVector& r
bitsPerPixel[nScanlineFormat] );
- //
----------------------------------------------------------------------
- // eight bit formats
+ //
----------------------------------------------------------------------
+ // eight bit formats
case Format::EIGHT_BIT_GREY:
return createRenderer<PixelFormatTraits_GREY8,StdMasks>(
@@ -1941,22 +1938,22 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const
basegfx::B2IVector& r
pFirstScanline, pMem, pPal );
- //
----------------------------------------------------------------------
- // thirtytwo bit formats
+ //
----------------------------------------------------------------------
+ // thirtytwo bit formats
- case Format::THIRTYTWO_BIT_TC_MASK:
- return createRenderer<PixelFormatTraits_RGB32_888,StdMasks>(
- aBounds, nScanlineFormat, nScanlineStride,
- pFirstScanline, pMem, pPal );
+ case Format::THIRTYTWO_BIT_TC_MASK:
+ return
createRenderer<PixelFormatTraits_RGB32_888,StdMasks>(
+ aBounds, nScanlineFormat, nScanlineStride,
+ pFirstScanline, pMem, pPal );
- case Format::THIRTYTWO_BIT_TC_MASK_ARGB:
- return createRenderer<PixelFormatTraits_BGR32_888,StdMasks>(
- aBounds, nScanlineFormat, nScanlineStride,
- pFirstScanline, pMem, pPal );
- }
+ case Format::THIRTYTWO_BIT_TC_MASK_ARGB:
+ return
createRenderer<PixelFormatTraits_BGR32_888,StdMasks>(
+ aBounds, nScanlineFormat, nScanlineStride,
+ pFirstScanline, pMem, pPal );
+ }
- // TODO(F3): other formats not yet implemented
- return BitmapDeviceSharedPtr();
+ // TODO(F3): other formats not yet implemented
+ return BitmapDeviceSharedPtr();
}
} // namespace
@@ -1965,9 +1962,9 @@ BitmapDeviceSharedPtr createBitmapDevice( const
basegfx::B2IVector& rSize,
bool bTopDown,
sal_Int32
nScanlineFormat )
{
- return createBitmapDeviceImpl( rSize,
- bTopDown,
- nScanlineFormat,
+ return createBitmapDeviceImpl( rSize,
+ bTopDown,
+ nScanlineFormat,
boost::shared_array< sal_uInt8 >(),
PaletteMemorySharedVector(),
NULL );
@@ -1978,9 +1975,9 @@ BitmapDeviceSharedPtr createBitmapDevice( const
basegfx::B2IVector& rSize
sal_Int32
nScanlineFormat,
const PaletteMemorySharedVector&
rPalette )
{
- return createBitmapDeviceImpl( rSize,
- bTopDown,
- nScanlineFormat,
+ return createBitmapDeviceImpl( rSize,
+ bTopDown,
+ nScanlineFormat,
boost::shared_array< sal_uInt8 >(),
rPalette,
NULL );
@@ -1992,9 +1989,9 @@ BitmapDeviceSharedPtr createBitmapDevice( const
basegfx::B2IVector& rSize
const RawMemorySharedArray&
rMem,
const PaletteMemorySharedVector&
rPalette )
{
- return createBitmapDeviceImpl( rSize,
- bTopDown,
- nScanlineFormat,
+ return createBitmapDeviceImpl( rSize,
+ bTopDown,
+ nScanlineFormat,
rMem,
rPalette,
NULL );
@@ -2004,8 +2001,8 @@ BitmapDeviceSharedPtr subsetBitmapDevice( const
BitmapDeviceSharedPtr& rProt
const basegfx::B2IRange&
rSubset )
{
return createBitmapDeviceImpl( rProto->getSize(),
- rProto->isTopDown(),
- rProto->getScanlineFormat(),
+ rProto->isTopDown(),
+ rProto->getScanlineFormat(),
rProto->getBuffer(),
rProto->getPalette(),
&rSubset );
@@ -2014,9 +2011,9 @@ BitmapDeviceSharedPtr subsetBitmapDevice( const
BitmapDeviceSharedPtr& rProt
BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector&
rSize,
const BitmapDeviceSharedPtr&
rProto )
{
- return createBitmapDeviceImpl( rSize,
- rProto->isTopDown(),
- rProto->getScanlineFormat(),
+ return createBitmapDeviceImpl( rSize,
+ rProto->isTopDown(),
+ rProto->getScanlineFormat(),
boost::shared_array< sal_uInt8 >(),
rProto->getPalette(),
NULL );
@@ -2024,7 +2021,7 @@ BitmapDeviceSharedPtr cloneBitmapDevice( const
basegfx::B2IVector& rSize,
//----------------------------------------------------------------------------------
-/// Clone our device, with GenericImageAccessor to handle all formats
+// Clone our device, with GenericImageAccessor to handle all formats
BitmapDeviceSharedPtr BitmapDevice::getGenericRenderer() const
{
#if 0
@@ -2032,16 +2029,16 @@ BitmapDeviceSharedPtr
BitmapDevice::getGenericRenderer() const
typedef BitmapRenderer< PixelFormatTraits_GenericInteger::iterator_type,
PixelFormatTraits_GenericInteger::raw_accessor_type,
PixelFormatTraits_GenericInteger::accessor_selector,
- MaskTraitsGeneric >
+ MaskTraitsGeneric >
Renderer;
- if( !mpImpl->mpGenericRenderer )
- {
- mpImpl->mpGenericRenderer.reset(
+ if( !mpImpl->mpGenericRenderer )
+ {
+ mpImpl->mpGenericRenderer.reset(
new Renderer(
- mpImpl->maBounds,
- isTopDown(),
- getScanlineFormat(),
+ mpImpl->maBounds,
+ isTopDown(),
+ getScanlineFormat(),
getScanlineStride(),
mpImpl->mpFirstScanline,
PixelFormatTraits_GenericInteger::iterator_type(),
@@ -2049,12 +2046,14 @@ BitmapDeviceSharedPtr
BitmapDevice::getGenericRenderer() const
const_cast<BitmapDevice*>(this)->shared_from_this()),
GenericIntegerImageAccessor<Color>(
const_cast<BitmapDevice*>(this)->shared_from_this()),
- getBuffer(),
+ getBuffer(),
getPalette() ));
- }
+ }
#endif
- return mpImpl->mpGenericRenderer;
+ return mpImpl->mpGenericRenderer;
}
} // namespace basebmp
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/basegfx/source/polygon/b3dpolypolygontools.cxx
b/main/basegfx/source/polygon/b3dpolypolygontools.cxx
index 7a5b75d47b..4ae930b471 100644
--- a/main/basegfx/source/polygon/b3dpolypolygontools.cxx
+++ b/main/basegfx/source/polygon/b3dpolypolygontools.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
@@ -31,15 +31,12 @@
#include <basegfx/matrix/b3dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <osl/mutex.hxx>
-#include <com/sun/star/drawing/DoubleSequence.hpp>
+#include <com/sun/star/drawing/DoubleSequence.hpp>
-//////////////////////////////////////////////////////////////////////////////
// predefines
#define nMinSegments sal_uInt32(1)
#define nMaxSegments sal_uInt32(512)
-//////////////////////////////////////////////////////////////////////////////
-
namespace basegfx
{
namespace tools
@@ -70,16 +67,16 @@ namespace basegfx
if(rCandidate.count() && fFullDashDotLen > 0.0)
{
B3DPolyPolygon aLineTarget, aGapTarget;
-
+
for(sal_uInt32 a(0L); a < rCandidate.count();
a++)
{
const B3DPolygon
aCandidate(rCandidate.getB3DPolygon(a));
-
+
applyLineDashing(
- aCandidate,
- rDotDashArray,
- pLineTarget ? &aLineTarget : 0,
- pGapTarget ? &aGapTarget : 0,
+ aCandidate,
+ rDotDashArray,
+ pLineTarget ? &aLineTarget : 0,
+ pGapTarget ? &aGapTarget : 0,
fFullDashDotLen);
if(pLineTarget)
@@ -98,7 +95,7 @@ namespace basegfx
B3DPolyPolygon createUnitCubePolyPolygon()
{
static B3DPolyPolygon aRetval;
- ::osl::Mutex m_mutex;
+ ::osl::Mutex m_mutex;
if(!aRetval.count())
{
@@ -145,7 +142,7 @@ namespace basegfx
B3DPolyPolygon createUnitCubeFillPolyPolygon()
{
static B3DPolyPolygon aRetval;
- ::osl::Mutex m_mutex;
+ ::osl::Mutex m_mutex;
if(!aRetval.count())
{
@@ -252,7 +249,7 @@ namespace basegfx
return aRetval;
}
- // helper for getting the 3D Point from given cartesian
coordiantes. fVer is defined from
+ // helper for getting the 3D Point from given cartesian
coordinates. fVer is defined from
// [F_PI2 .. -F_PI2], fHor from [0.0 .. F_2PI]
inline B3DPoint getPointFromCartesian(double fVer, double fHor)
{
@@ -273,16 +270,16 @@ namespace basegfx
nHorSeg = fround(fabs(fHorStop - fHorStart) /
(F_2PI / 24.0));
}
- // min/max limitations
- nHorSeg = ::std::min(nMaxSegments, ::std::max(nMinSegments,
nHorSeg));
+ // min/max limitations
+ nHorSeg = ::std::min(nMaxSegments,
::std::max(nMinSegments, nHorSeg));
if(!nVerSeg)
{
nVerSeg = fround(fabs(fVerStop - fVerStart) /
(F_2PI / 24.0));
}
- // min/max limitations
- nVerSeg = ::std::min(nMaxSegments, ::std::max(nMinSegments,
nVerSeg));
+ // min/max limitations
+ nVerSeg = ::std::min(nMaxSegments,
::std::max(nMinSegments, nVerSeg));
// create constants
const double fVerDiffPerStep((fVerStop - fVerStart) /
(double)nVerSeg);
@@ -338,8 +335,8 @@ namespace basegfx
return aRetval;
}
-
- B3DPolyPolygon createSpherePolyPolygonFromB3DRange( const
B3DRange& rRange,
+
+ B3DPolyPolygon createSpherePolyPolygonFromB3DRange( const
B3DRange& rRange,
sal_uInt32 nHorSeg, sal_uInt32 nVerSeg,
double fVerStart, double fVerStop,
double fHorStart, double fHorStop)
@@ -372,16 +369,16 @@ namespace basegfx
nHorSeg = fround(fabs(fHorStop - fHorStart) /
(F_2PI / 24.0));
}
- // min/max limitations
- nHorSeg = ::std::min(nMaxSegments, ::std::max(nMinSegments,
nHorSeg));
+ // min/max limitations
+ nHorSeg = ::std::min(nMaxSegments,
::std::max(nMinSegments, nHorSeg));
if(!nVerSeg)
{
nVerSeg = fround(fabs(fVerStop - fVerStart) /
(F_2PI / 24.0));
}
- // min/max limitations
- nVerSeg = ::std::min(nMaxSegments, ::std::max(nMinSegments,
nVerSeg));
+ // min/max limitations
+ nVerSeg = ::std::min(nMaxSegments,
::std::max(nMinSegments, nVerSeg));
// vertical loop
for(sal_uInt32 a(0L); a < nVerSeg; a++)
@@ -416,8 +413,8 @@ namespace basegfx
return aRetval;
}
-
- B3DPolyPolygon createSphereFillPolyPolygonFromB3DRange( const
B3DRange& rRange,
+
+ B3DPolyPolygon createSphereFillPolyPolygonFromB3DRange( const
B3DRange& rRange,
sal_uInt32 nHorSeg, sal_uInt32 nVerSeg,
bool bNormals,
double fVerStart, double fVerStop,
@@ -513,7 +510,6 @@ namespace basegfx
}
}
-
//////////////////////////////////////////////////////////////////////
// comparators with tolerance for 3D PolyPolygons
bool equal(const B3DPolyPolygon& rCandidateA, const
B3DPolyPolygon& rCandidateB, const double& rfSmallValue)
@@ -541,133 +537,131 @@ namespace basegfx
return equal(rCandidateA, rCandidateB, fSmallValue);
}
-/// converters for com::sun::star::drawing::PolyPolygonShape3D
- B3DPolyPolygon UnoPolyPolygonShape3DToB3DPolyPolygon(
- const com::sun::star::drawing::PolyPolygonShape3D&
rPolyPolygonShape3DSource,
- bool bCheckClosed)
- {
- B3DPolyPolygon aRetval;
- const sal_Int32
nOuterSequenceCount(rPolyPolygonShape3DSource.SequenceX.getLength());
-
- if(nOuterSequenceCount)
- {
- OSL_ENSURE(nOuterSequenceCount ==
rPolyPolygonShape3DSource.SequenceY.getLength()
- && nOuterSequenceCount ==
rPolyPolygonShape3DSource.SequenceZ.getLength(),
- "UnoPolyPolygonShape3DToB3DPolygon: Not all double
sequences have the same length (!)");
-
- const com::sun::star::drawing::DoubleSequence* pInnerSequenceX
= rPolyPolygonShape3DSource.SequenceX.getConstArray();
- const com::sun::star::drawing::DoubleSequence* pInnerSequenceY
= rPolyPolygonShape3DSource.SequenceY.getConstArray();
- const com::sun::star::drawing::DoubleSequence* pInnerSequenceZ
= rPolyPolygonShape3DSource.SequenceZ.getConstArray();
-
- for(sal_Int32 a(0); a < nOuterSequenceCount; a++)
- {
- basegfx::B3DPolygon aNewPolygon;
- const sal_Int32
nInnerSequenceCount(pInnerSequenceX->getLength());
- OSL_ENSURE(nInnerSequenceCount ==
pInnerSequenceY->getLength()
- && nInnerSequenceCount == pInnerSequenceZ->getLength(),
- "UnoPolyPolygonShape3DToB3DPolygon: Not all double
sequences have the same length (!)");
-
- const double* pArrayX = pInnerSequenceX->getConstArray();
- const double* pArrayY = pInnerSequenceY->getConstArray();
- const double* pArrayZ = pInnerSequenceZ->getConstArray();
-
- for(sal_Int32 b(0); b < nInnerSequenceCount; b++)
- {
-
aNewPolygon.append(basegfx::B3DPoint(*pArrayX++,*pArrayY++,*pArrayZ++));
- }
-
- pInnerSequenceX++;
- pInnerSequenceY++;
- pInnerSequenceZ++;
-
- // #i101520# correction is needed for imported polygons of
old format,
- // see callers
- if(bCheckClosed)
- {
- basegfx::tools::checkClosed(aNewPolygon);
- }
-
- aRetval.append(aNewPolygon);
- }
- }
-
- return aRetval;
- }
-
- void B3DPolyPolygonToUnoPolyPolygonShape3D(
- const B3DPolyPolygon& rPolyPolygonSource,
- com::sun::star::drawing::PolyPolygonShape3D&
rPolyPolygonShape3DRetval)
- {
- const sal_uInt32 nPolygonCount(rPolyPolygonSource.count());
-
- if(nPolygonCount)
- {
- rPolyPolygonShape3DRetval.SequenceX.realloc(nPolygonCount);
- rPolyPolygonShape3DRetval.SequenceY.realloc(nPolygonCount);
- rPolyPolygonShape3DRetval.SequenceZ.realloc(nPolygonCount);
-
- com::sun::star::drawing::DoubleSequence* pOuterSequenceX =
rPolyPolygonShape3DRetval.SequenceX.getArray();
- com::sun::star::drawing::DoubleSequence* pOuterSequenceY =
rPolyPolygonShape3DRetval.SequenceY.getArray();
- com::sun::star::drawing::DoubleSequence* pOuterSequenceZ =
rPolyPolygonShape3DRetval.SequenceZ.getArray();
-
- for(sal_uInt32 a(0); a < nPolygonCount; a++)
- {
- const basegfx::B3DPolygon
aPoly(rPolyPolygonSource.getB3DPolygon(a));
- const sal_uInt32 nPointCount(aPoly.count());
-
- if(nPointCount)
- {
- const bool bIsClosed(aPoly.isClosed());
- const sal_uInt32 nTargetCount(bIsClosed ? nPointCount
+ 1 : nPointCount);
- pOuterSequenceX->realloc(nTargetCount);
- pOuterSequenceY->realloc(nTargetCount);
- pOuterSequenceZ->realloc(nTargetCount);
-
- double* pInnerSequenceX = pOuterSequenceX->getArray();
- double* pInnerSequenceY = pOuterSequenceY->getArray();
- double* pInnerSequenceZ = pOuterSequenceZ->getArray();
-
- for(sal_uInt32 b(0); b < nPointCount; b++)
- {
- const basegfx::B3DPoint
aPoint(aPoly.getB3DPoint(b));
-
- *pInnerSequenceX++ = aPoint.getX();
- *pInnerSequenceY++ = aPoint.getY();
- *pInnerSequenceZ++ = aPoint.getZ();
- }
-
- if(bIsClosed)
- {
- const basegfx::B3DPoint
aPoint(aPoly.getB3DPoint(0));
-
- *pInnerSequenceX++ = aPoint.getX();
- *pInnerSequenceY++ = aPoint.getY();
- *pInnerSequenceZ++ = aPoint.getZ();
- }
- }
- else
- {
- pOuterSequenceX->realloc(0);
- pOuterSequenceY->realloc(0);
- pOuterSequenceZ->realloc(0);
- }
-
- pOuterSequenceX++;
- pOuterSequenceY++;
- pOuterSequenceZ++;
- }
- }
- else
- {
- rPolyPolygonShape3DRetval.SequenceX.realloc(0);
- rPolyPolygonShape3DRetval.SequenceY.realloc(0);
- rPolyPolygonShape3DRetval.SequenceZ.realloc(0);
- }
- }
-
- } // end of namespace tools
-} // end of namespace basegfx
+// converters for com::sun::star::drawing::PolyPolygonShape3D
+ B3DPolyPolygon UnoPolyPolygonShape3DToB3DPolyPolygon(
+ const com::sun::star::drawing::PolyPolygonShape3D&
rPolyPolygonShape3DSource,
+ bool bCheckClosed)
+ {
+ B3DPolyPolygon aRetval;
+ const sal_Int32
nOuterSequenceCount(rPolyPolygonShape3DSource.SequenceX.getLength());
+
+ if(nOuterSequenceCount)
+ {
+ OSL_ENSURE(nOuterSequenceCount ==
rPolyPolygonShape3DSource.SequenceY.getLength()
+ && nOuterSequenceCount ==
rPolyPolygonShape3DSource.SequenceZ.getLength(),
+ "UnoPolyPolygonShape3DToB3DPolygon: Not
all double sequences have the same length (!)");
+
+ const com::sun::star::drawing::DoubleSequence*
pInnerSequenceX = rPolyPolygonShape3DSource.SequenceX.getConstArray();
+ const com::sun::star::drawing::DoubleSequence*
pInnerSequenceY = rPolyPolygonShape3DSource.SequenceY.getConstArray();
+ const com::sun::star::drawing::DoubleSequence*
pInnerSequenceZ = rPolyPolygonShape3DSource.SequenceZ.getConstArray();
+
+ for(sal_Int32 a(0); a < nOuterSequenceCount;
a++)
+ {
+ basegfx::B3DPolygon aNewPolygon;
+ const sal_Int32
nInnerSequenceCount(pInnerSequenceX->getLength());
+ OSL_ENSURE(nInnerSequenceCount ==
pInnerSequenceY->getLength()
+ && nInnerSequenceCount ==
pInnerSequenceZ->getLength(),
+
"UnoPolyPolygonShape3DToB3DPolygon: Not all double sequences have the same
length (!)");
+
+ const double* pArrayX =
pInnerSequenceX->getConstArray();
+ const double* pArrayY =
pInnerSequenceY->getConstArray();
+ const double* pArrayZ =
pInnerSequenceZ->getConstArray();
+
+ for(sal_Int32 b(0); b <
nInnerSequenceCount; b++)
+ {
+
aNewPolygon.append(basegfx::B3DPoint(*pArrayX++,*pArrayY++,*pArrayZ++));
+ }
+
+ pInnerSequenceX++;
+ pInnerSequenceY++;
+ pInnerSequenceZ++;
+
+ // #i101520# correction is needed for
imported polygons of old format,
+ // see callers
+ if(bCheckClosed)
+ {
+
basegfx::tools::checkClosed(aNewPolygon);
+ }
+
+ aRetval.append(aNewPolygon);
+ }
+ }
+
+ return aRetval;
+ }
+
+ void B3DPolyPolygonToUnoPolyPolygonShape3D(
+ const B3DPolyPolygon& rPolyPolygonSource,
+ com::sun::star::drawing::PolyPolygonShape3D&
rPolyPolygonShape3DRetval)
+ {
+ const sal_uInt32
nPolygonCount(rPolyPolygonSource.count());
-//////////////////////////////////////////////////////////////////////////////
+ if(nPolygonCount)
+ {
+
rPolyPolygonShape3DRetval.SequenceX.realloc(nPolygonCount);
+
rPolyPolygonShape3DRetval.SequenceY.realloc(nPolygonCount);
+
rPolyPolygonShape3DRetval.SequenceZ.realloc(nPolygonCount);
+
+ com::sun::star::drawing::DoubleSequence*
pOuterSequenceX = rPolyPolygonShape3DRetval.SequenceX.getArray();
+ com::sun::star::drawing::DoubleSequence*
pOuterSequenceY = rPolyPolygonShape3DRetval.SequenceY.getArray();
+ com::sun::star::drawing::DoubleSequence*
pOuterSequenceZ = rPolyPolygonShape3DRetval.SequenceZ.getArray();
+
+ for(sal_uInt32 a(0); a < nPolygonCount; a++)
+ {
+ const basegfx::B3DPolygon
aPoly(rPolyPolygonSource.getB3DPolygon(a));
+ const sal_uInt32
nPointCount(aPoly.count());
+
+ if(nPointCount)
+ {
+ const bool
bIsClosed(aPoly.isClosed());
+ const sal_uInt32
nTargetCount(bIsClosed ? nPointCount + 1 : nPointCount);
+
pOuterSequenceX->realloc(nTargetCount);
+
pOuterSequenceY->realloc(nTargetCount);
+
pOuterSequenceZ->realloc(nTargetCount);
+
+ double* pInnerSequenceX =
pOuterSequenceX->getArray();
+ double* pInnerSequenceY =
pOuterSequenceY->getArray();
+ double* pInnerSequenceZ =
pOuterSequenceZ->getArray();
+
+ for(sal_uInt32 b(0); b <
nPointCount; b++)
+ {
+ const basegfx::B3DPoint
aPoint(aPoly.getB3DPoint(b));
+
+ *pInnerSequenceX++ =
aPoint.getX();
+ *pInnerSequenceY++ =
aPoint.getY();
+ *pInnerSequenceZ++ =
aPoint.getZ();
+ }
+
+ if(bIsClosed)
+ {
+ const basegfx::B3DPoint
aPoint(aPoly.getB3DPoint(0));
+
+ *pInnerSequenceX++ =
aPoint.getX();
+ *pInnerSequenceY++ =
aPoint.getY();
+ *pInnerSequenceZ++ =
aPoint.getZ();
+ }
+ }
+ else
+ {
+ pOuterSequenceX->realloc(0);
+ pOuterSequenceY->realloc(0);
+ pOuterSequenceZ->realloc(0);
+ }
+
+ pOuterSequenceX++;
+ pOuterSequenceY++;
+ pOuterSequenceZ++;
+ }
+ }
+ else
+ {
+ rPolyPolygonShape3DRetval.SequenceX.realloc(0);
+ rPolyPolygonShape3DRetval.SequenceY.realloc(0);
+ rPolyPolygonShape3DRetval.SequenceZ.realloc(0);
+ }
+ }
+
+ } // end of namespace tools
+} // end of namespace basegfx
-// eof
+/* vim: set noet sw=4 ts=4: */