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 8b33d20757 Fixed typo (verion -> version) and some more
8b33d20757 is described below
commit 8b33d20757e07ac9aab7f43fc8912a001433f5ba
Author: mseidel <[email protected]>
AuthorDate: Fri Nov 18 19:09:55 2022 +0100
Fixed typo (verion -> version) and some more
---
.../sun/star/lib/loader/InstallationFinder.java | 168 ++++++++++-----------
main/tools/inc/bootstrp/mkcreate.hxx | 24 +--
main/vcl/source/gdi/region.cxx | 112 +++++++-------
3 files changed, 153 insertions(+), 151 deletions(-)
diff --git a/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java
b/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java
index da6c10f92d..6d7cb5158f 100644
--- a/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java
+++ b/main/odk/source/com/sun/star/lib/loader/InstallationFinder.java
@@ -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.
- *
+ *
*************************************************************/
@@ -47,10 +47,10 @@ import java.util.Vector;
* environment variable won't work with those Java versions.
* If no UNO installation is specified by the user, the default installation
* on the system will be returned.</p>
- *
+ *
* <p>On the Windows platform the default installation is read from the Windows
* Registry.</p>
- *
+ *
* <p>On the Unix/Linux platforms the default installation is found from the
* PATH environment variable. Note, that for Java 1.3.1 and Java 1.4 the
* default installation is found by using the 'which' command, because
@@ -68,19 +68,19 @@ final class InstallationFinder {
"com.sun.star.lib.loader.unopath";
private static final String ENVVAR_NAME = "UNO_PATH";
private static final String SOFFICE = "soffice"; // Unix/Linux only
-
+
private InstallationFinder() {} // do not instantiate
-
+
/**
* Gets the path of a UNO installation.
- *
+ *
* @return the installation path or <code>null</code>, if no installation
- * was specified or found, or if an error occurred
- */
+ * was specified or found, or if an error occurred
+ */
public static String getPath() {
-
+
String path = null;
-
+
// get the installation path from the Java system property
// com.sun.star.lib.loader.unopath
// (all platforms)
@@ -112,7 +112,7 @@ final class InstallationFinder {
// get the installation path from the 'which'
// command (Unix/Linux platforms only)
path = getPathFromWhich();
- if ( path == null ) {
+ if ( path == null ) {
// get the installation path from the
// .sversionrc file (Unix/Linux platforms only,
// for older versions than OOo 2.0)
@@ -123,10 +123,10 @@ final class InstallationFinder {
}
}
}
-
+
return path;
}
-
+
/**
* Gets the installation path from a Java system property.
*
@@ -134,97 +134,97 @@ final class InstallationFinder {
* The Java system property can be passed into the application by using
* the -D flag, e.g.
* java -D<property name>=<installation path> -jar application.jar.</p>
- *
+ *
* @return the installation path or <code>null</code>, if no installation
* was specified in the Java system property or if an error
occurred
- */
+ */
private static String getPathFromProperty( String prop ) {
String path = null;
-
+
try {
path = System.getProperty( prop );
} catch ( SecurityException e ) {
// if a SecurityException was thrown, return <code>null</code>
}
- return path;
+ return path;
}
/**
* Gets the installation path from an environment variable.
- *
+ *
* <p>This method is called on all platforms.
- * Note, that in Java 1.3.1 and Java 1.4 System.getenv() throws
- * java.lang.Error and therefore this method returns null for those
+ * Note, that in Java 1.3.1 and Java 1.4 System.getenv() throws
+ * java.lang.Error and therefore this method returns null for those
* Java versions.</p>
*
* @return the installation path or <code>null</code>, if no installation
* was specified in the environment variable or if an error
occurred
*/
- private static String getPathFromEnvVar( String var ) {
+ private static String getPathFromEnvVar( String var ) {
String path = null;
-
+
try {
- path = System.getenv( var );
+ path = System.getenv( var );
} catch ( SecurityException e ) {
// if a SecurityException was thrown, return <code>null</code>
} catch ( java.lang.Error err ) {
- // System.getenv() throws java.lang.Error in Java 1.3.1 and
+ // System.getenv() throws java.lang.Error in Java 1.3.1 and
// Java 1.4
}
-
+
return path;
}
-
+
/**
* Gets the installation path from the Windows Registry.
*
* <p>This method is called on the Windows platform only.</p>
- *
+ *
* @return the installation path or <code>null</code>, if no installation
- * was found or if an error occurred
- */
+ * was found or if an error occurred
+ */
private static String getPathFromWindowsRegistry() {
final String SUBKEYNAME = "Software\\OpenOffice\\UNO\\InstallPath";
final String SUBKEYNAME64 =
"Software\\Wow6432Node\\OpenOffice\\UNO\\InstallPath";
String path = null;
-
+
try {
// read the key's default value from HKEY_CURRENT_USER
WinRegKey key = new WinRegKey( "HKEY_CURRENT_USER", SUBKEYNAME );
- path = key.getStringValue( "" ); // default
+ path = key.getStringValue( "" ); // default
} catch ( WinRegKeyException e ) {
try {
// read the key's default value from HKEY_LOCAL_MACHINE
WinRegKey key = new WinRegKey( "HKEY_CURRENT_USER",
SUBKEYNAME64 );
- path = key.getStringValue( "" ); // default
+ path = key.getStringValue( "" ); // default
} catch ( WinRegKeyException e64 ) {
try {
// read the key's default value from HKEY_LOCAL_MACHINE
WinRegKey key = new WinRegKey( "HKEY_LOCAL_MACHINE",
SUBKEYNAME );
- path = key.getStringValue( "" ); // default
+ path = key.getStringValue( "" ); // default
} catch ( WinRegKeyException we ) {
try {
// read the key's default value from HKEY_LOCAL_MACHINE
WinRegKey key = new WinRegKey( "HKEY_LOCAL_MACHINE",
SUBKEYNAME64 );
- path = key.getStringValue( "" ); // default
+ path = key.getStringValue( "" ); // default
} catch ( WinRegKeyException we64 ) {
System.err.println( "com.sun.star.lib.loader." +
"InstallationFinder::getPathFromWindowsRegistry: " +
"reading key from Windows Registry
failed: " + we64 );
- }
- }
+ }
+ }
}
}
-
- return path;
+
+ return path;
}
/**
@@ -243,17 +243,17 @@ final class InstallationFinder {
private static String getPathFromPathEnvVar() {
final String PATH_ENVVAR_NAME = "PATH";
-
+
String path = null;
String str = null;
-
+
try {
str = System.getenv( PATH_ENVVAR_NAME );
} catch ( SecurityException e ) {
// if a SecurityException was thrown, return <code>null</code>
return null;
} catch ( java.lang.Error err ) {
- // System.getenv() throws java.lang.Error in Java 1.3.1 and
+ // System.getenv() throws java.lang.Error in Java 1.3.1 and
// Java 1.4
return null;
}
@@ -265,7 +265,7 @@ final class InstallationFinder {
File file = new File( tokens.nextToken(), SOFFICE );
try {
if ( file.exists() ) {
- try {
+ try {
// resolve symlink
path = file.getCanonicalFile().getParent();
if ( path != null )
@@ -276,7 +276,7 @@ final class InstallationFinder {
System.err.println( "com.sun.star.lib.loader." +
"InstallationFinder::getPathFromEnvVar: " +
"bad path: " + e );
- }
+ }
}
} catch ( SecurityException e ) {
// if a SecurityException was thrown, ignore this path
@@ -284,10 +284,10 @@ final class InstallationFinder {
}
}
}
-
+
return path;
}
-
+
/**
* Gets the installation path from the 'which' command on Unix/Linux
* platforms.
@@ -295,16 +295,16 @@ final class InstallationFinder {
* <p>This method is called on Unix/Linux platforms only.
* An installation is found, if the executable 'soffice' or a symbolic link
* is in one of the directories listed in the PATH environment
variable.</p>
- *
+ *
* @return the installation path or <code>null</code>, if no installation
* was found or if an error occurred
- */
+ */
private static String getPathFromWhich() {
final String WHICH = "which";
-
+
String path = null;
-
+
// start the which process
String[] cmdArray = new String[2];
cmdArray[0] = WHICH;
@@ -322,15 +322,15 @@ final class InstallationFinder {
"which command failed: " + e );
return null;
}
-
+
// empty standard error stream in a separate thread
StreamGobbler gobbler = new StreamGobbler( proc.getErrorStream() );
gobbler.start();
-
+
// read the which output from standard input stream
BufferedReader br = new BufferedReader(
new InputStreamReader( proc.getInputStream() ) );
- String line = null;
+ String line = null;
try {
while ( ( line = br.readLine() ) != null ) {
if ( path == null ) {
@@ -362,30 +362,30 @@ final class InstallationFinder {
return null;
} finally {
if ( br != null ) {
- try {
+ try {
br.close();
} catch ( IOException e ) {
// closing standard input stream failed, ignore
- }
+ }
}
- }
-
+ }
+
try {
// wait until the which process has terminated
proc.waitFor();
} catch ( InterruptedException e ) {
// the current thread was interrupted by another thread,
// kill the which process
- proc.destroy();
+ proc.destroy();
// set the interrupted status
- Thread.currentThread().interrupt();
+ Thread.currentThread().interrupt();
}
-
+
return path;
}
-
+
/**
- * Gets the installation path from the .sverionrc file in the user's home
+ * Gets the installation path from the .sversionrc file in the user's home
* directory.
*
* <p>This method is called on Unix/Linux platforms only.
@@ -393,16 +393,16 @@ final class InstallationFinder {
* OOo 2.0.</p>
*
* @return the installation path or <code>null</code>, if no installation
- * was found or if an error occurred
+ * was found or if an error occurred
*/
private static String getPathFromSVersionFile() {
final String SVERSION = ".sversionrc"; // Unix/Linux only
final String VERSIONS = "[Versions]";
-
+
String path = null;
-
- try {
+
+ try {
File fSVersion = new File(
System.getProperty( "user.home" ) ,SVERSION );
if ( fSVersion.exists() ) {
@@ -411,7 +411,7 @@ final class InstallationFinder {
try {
br = new BufferedReader( new InputStreamReader(
new FileInputStream( fSVersion ), "UTF-8" ) );
- String line = null;
+ String line = null;
while ( ( line = br.readLine() ) != null &&
( line.equals( VERSIONS ) ) != true ) {
// read lines until [Versions] is found
@@ -429,32 +429,32 @@ final class InstallationFinder {
"reading .sversionrc file failed: " + e );
} finally {
if ( br != null ) {
- try {
+ try {
br.close();
} catch ( IOException e ) {
// closing .sversionrc failed, ignore
- }
+ }
}
- }
+ }
for ( int i = lines.size() - 1; i >= 0; i-- ) {
StringTokenizer tokens = new StringTokenizer(
(String)lines.elementAt( i ), "=" );
if ( tokens.countTokens() != 2 )
- continue;
+ continue;
String key = tokens.nextToken();
String url = tokens.nextToken();
- path = getCanonicalPathFromFileURL( url );
+ path = getCanonicalPathFromFileURL( url );
if ( path != null )
- break;
- }
- }
+ break;
+ }
+ }
} catch ( SecurityException e ) {
return null;
- }
-
+ }
+
return path;
}
-
+
/**
* Translates an OOo-internal absolute file URL reference (encoded using
* UTF-8) into a Java canonical pathname.
@@ -467,14 +467,14 @@ final class InstallationFinder {
* <code>null</code> is returned
*/
private static String getCanonicalPathFromFileURL( String oooUrl ) {
-
+
String prefix = "file://";
if (oooUrl.length() < prefix.length()
|| !oooUrl.substring(0, prefix.length()).toLowerCase().equals(
prefix))
{
return null;
- }
+ }
StringBuffer buf = new StringBuffer(prefix);
int n = oooUrl.indexOf('/', prefix.length());
if (n < 0) {
@@ -557,12 +557,12 @@ final class InstallationFinder {
ret = file.getCanonicalFile().getParent();
} catch ( IOException e ) {
return null;
- }
+ }
}
} catch ( SecurityException e ) {
return null;
}
-
+
return ret;
}
diff --git a/main/tools/inc/bootstrp/mkcreate.hxx
b/main/tools/inc/bootstrp/mkcreate.hxx
index 3096cfb3bc..0aac4c5995 100644
--- a/main/tools/inc/bootstrp/mkcreate.hxx
+++ b/main/tools/inc/bootstrp/mkcreate.hxx
@@ -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.
- *
+ *
*************************************************************/
@@ -42,7 +42,7 @@ class SourceDirectoryList;
class CodedDependency : public ByteString
{
private:
- sal_uInt16 nOSType;
// operating systems where dependeny exists
+ sal_uInt16 nOSType;
// operating systems where dependency exists
public:
/* create a dependency instance with given coded directory name
@@ -91,7 +91,7 @@ public:
class Dependency : public ByteString
{
private:
- sal_uInt16 nOSType;
// operating systems where dependecy exists
+ sal_uInt16 nOSType;
// operating systems where dependency exists
public:
/* create a dependency instance with given directory name
@@ -127,8 +127,8 @@ private:
SByteStringList *pDependencies; // dependencies on
other directories in this depth
- SByteStringList *pCodedDependencies; // dependencies on other
directories in different depth
- SByteStringList *pCodedIdentifier; // symbolic identifier to
resolve dependencies
+ SByteStringList *pCodedDependencies; // dependencies on other
directories in different depth
+ SByteStringList *pCodedIdentifier; // symbolic identifier
to resolve dependencies
/* try to resolve a single dependency
*/
@@ -148,7 +148,7 @@ private:
public:
- /* create a directory instance with given parent and name, no parent means
this is the root
+ /* create a directory instance with given parent and name, no parent
means this is the root
* (not the file system root but the root of the source tree, e.g.
o:\569)
*/
SourceDirectory(
@@ -233,7 +233,7 @@ public:
return pCodedIdentifier;
}
- /* create dependencies on other directory, coded dependecies are used
+ /* create dependencies on other directory, coded dependencies are used
*/
void ResolveDependencies();
@@ -249,14 +249,14 @@ public:
*/
static SourceDirectory *CreateRootDirectory(
const ByteString &rRoot, // the root directory in file
system
- const ByteString &rVersion, // the solar verion (r.g.
SRC590, SRC591 etc.)
+ const ByteString &rVersion, // the solar version (r.g.
SRC590, SRC591 etc.)
sal_Bool bAll = sal_False // add all
directories or only buildable ones
);
/* create the makefile.rc in file system
*/
sal_Bool CreateRecursiveMakefile(
- sal_Bool bAllChilds = sal_False // create rcursive for
all sub directories
+ sal_Bool bAllChilds = sal_False // create recursive for
all sub directories
);
};
diff --git a/main/vcl/source/gdi/region.cxx b/main/vcl/source/gdi/region.cxx
index fda1ef9822..37cfb497a4 100644
--- a/main/vcl/source/gdi/region.cxx
+++ b/main/vcl/source/gdi/region.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,18 +7,20 @@
* 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
#include "precompiled_vcl.hxx"
@@ -43,9 +45,9 @@ DBG_NAMEEX( PolyPolygon )
//////////////////////////////////////////////////////////////////////////////
-namespace
+namespace
{
- /** Return <TRUE/> when the given polygon is rectiliner and oriented so
that
+ /** Return <TRUE/> when the given polygon is rectilinear and oriented so
that
all sides are either horizontal or vertical.
*/
bool ImplIsPolygonRectilinear (const PolyPolygon& rPolyPoly)
@@ -135,7 +137,7 @@ namespace
const long nTop (::std::min(aStart.Y(), aEnd.Y()));
const long nBottom (::std::max(aStart.Y(), aEnd.Y()));
const LineType eLineType (aStart.Y() > aEnd.Y() ?
LINE_DESCENDING : LINE_ASCENDING);
-
+
// Make sure that the current line is covered by bands.
pRegionBand->ImplAddMissingBands(nTop,nBottom);
@@ -198,7 +200,7 @@ namespace
// initialisation and creation of Bands
RegionBand* pRegionBand = new RegionBand();
pRegionBand->CreateBandRange(rPolygonBoundingBox.Top(),
rPolygonBoundingBox.Bottom());
-
+
// insert polygons
const sal_uInt16 nPolyCount = rPolyPoly.Count();
@@ -542,7 +544,7 @@ bool Region::Union( const Rectangle& rRect )
basegfx::B2DPolyPolygon aThisPolyPoly(GetAsB2DPolyPolygon());
aThisPolyPoly =
basegfx::tools::prepareForPolygonOperation(aThisPolyPoly);
-
+
if(!aThisPolyPoly.count())
{
// no local polygon, use the rectangle as new region
@@ -551,16 +553,16 @@ bool Region::Union( const Rectangle& rRect )
else
{
// get the other B2DPolyPolygon and use logical Or-Operation
- const basegfx::B2DPolygon aRectPoly(
- basegfx::tools::createPolygonFromRect(
+ const basegfx::B2DPolygon aRectPoly(
+ basegfx::tools::createPolygonFromRect(
basegfx::B2DRectangle(
- rRect.Left(),
- rRect.Top(),
- rRect.Right(),
+ rRect.Left(),
+ rRect.Top(),
+ rRect.Right(),
rRect.Bottom())));
const basegfx::B2DPolyPolygon aClip(
basegfx::tools::solvePolygonOperationOr(
- aThisPolyPoly,
+ aThisPolyPoly,
basegfx::B2DPolyPolygon(aRectPoly)));
*this = Region(aClip);
}
@@ -579,7 +581,7 @@ bool Region::Union( const Rectangle& rRect )
}
RegionBand* pNew = new RegionBand(*pCurrent);
-
+
// get justified rectangle
const long nLeft(std::min(rRect.Left(), rRect.Right()));
const long nTop(std::min(rRect.Top(), rRect.Bottom()));
@@ -633,12 +635,12 @@ bool Region::Intersect( const Rectangle& rRect )
const basegfx::B2DPolyPolygon aPoly(
basegfx::tools::clipPolyPolygonOnRange(
*getB2DPolyPolygon(),
- basegfx::B2DRange(
- rRect.Left(),
+ basegfx::B2DRange(
+ rRect.Left(),
rRect.Top(),
- rRect.Right() + 1,
+ rRect.Right() + 1,
rRect.Bottom() + 1),
- true,
+ true,
false));
mpB2DPolyPolygon.reset(aPoly.count() ? new
basegfx::B2DPolyPolygon(aPoly) : 0);
@@ -722,18 +724,18 @@ bool Region::Exclude( const Rectangle& rRect )
{
// get this B2DPolyPolygon
basegfx::B2DPolyPolygon aThisPolyPoly(GetAsB2DPolyPolygon());
-
+
aThisPolyPoly =
basegfx::tools::prepareForPolygonOperation(aThisPolyPoly);
-
+
if(!aThisPolyPoly.count())
{
// when local polygon is empty, nothing can be excluded
return true;
}
-
+
// get the other B2DPolyPolygon
- const basegfx::B2DPolygon aRectPoly(
- basegfx::tools::createPolygonFromRect(
+ const basegfx::B2DPolygon aRectPoly(
+ basegfx::tools::createPolygonFromRect(
basegfx::B2DRectangle(rRect.Left(), rRect.Top(),
rRect.Right(), rRect.Bottom())));
const basegfx::B2DPolyPolygon aOtherPolyPoly(aRectPoly);
const basegfx::B2DPolyPolygon aClip =
basegfx::tools::solvePolygonOperationDiff(aThisPolyPoly, aOtherPolyPoly);
@@ -806,17 +808,17 @@ bool Region::XOr( const Rectangle& rRect )
basegfx::B2DPolyPolygon aThisPolyPoly(GetAsB2DPolyPolygon());
aThisPolyPoly = basegfx::tools::prepareForPolygonOperation(
aThisPolyPoly );
-
+
if(!aThisPolyPoly.count())
{
// no local content, XOr will be equal to rectangle
*this = rRect;
return true;
}
-
+
// get the other B2DPolyPolygon
- const basegfx::B2DPolygon aRectPoly(
- basegfx::tools::createPolygonFromRect(
+ const basegfx::B2DPolygon aRectPoly(
+ basegfx::tools::createPolygonFromRect(
basegfx::B2DRectangle(rRect.Left(), rRect.Top(),
rRect.Right(), rRect.Bottom())));
const basegfx::B2DPolyPolygon aOtherPolyPoly(aRectPoly);
const basegfx::B2DPolyPolygon aClip =
basegfx::tools::solvePolygonOperationXor(aThisPolyPoly, aOtherPolyPoly);
@@ -896,7 +898,7 @@ bool Region::Union( const Region& rRegion )
basegfx::B2DPolyPolygon aThisPolyPoly(GetAsB2DPolyPolygon());
aThisPolyPoly =
basegfx::tools::prepareForPolygonOperation(aThisPolyPoly);
-
+
if(!aThisPolyPoly.count())
{
// when no local content, union will be equal to rRegion
@@ -910,7 +912,7 @@ bool Region::Union( const Region& rRegion )
// use logical OR operation
basegfx::B2DPolyPolygon
aClip(basegfx::tools::solvePolygonOperationOr(aThisPolyPoly, aOtherPolyPoly));
-
+
*this = Region( aClip );
return true;
}
@@ -990,7 +992,7 @@ bool Region::Intersect( const Region& rRegion )
if(IsEmpty())
{
- // local region is empty, cannot get more emty than that. Nothing to do
+ // local region is empty, cannot get more empty than that. Nothing to
do
return true;
}
@@ -1001,7 +1003,7 @@ bool Region::Intersect( const Region& rRegion )
if(!aThisPolyPoly.count())
{
- // local region is empty, cannot get more emty than that. Nothing
to do
+ // local region is empty, cannot get more empty than that. Nothing
to do
return true;
}
@@ -1016,10 +1018,10 @@ bool Region::Intersect( const Region& rRegion )
}
const basegfx::B2DPolyPolygon aClip(
- basegfx::tools::clipPolyPolygonOnPolyPolygon(
- aOtherPolyPoly,
- aThisPolyPoly,
- true,
+ basegfx::tools::clipPolyPolygonOnPolyPolygon(
+ aOtherPolyPoly,
+ aThisPolyPoly,
+ true,
false));
*this = Region( aClip );
return true;
@@ -1030,7 +1032,7 @@ bool Region::Intersect( const Region& rRegion )
if(!pCurrent)
{
- // local region is empty, cannot get more emty than that. Nothing to do
+ // local region is empty, cannot get more empty than that. Nothing to
do
return true;
}
@@ -1117,7 +1119,7 @@ bool Region::Exclude( const Region& rRegion )
// get the other B2DPolyPolygon
basegfx::B2DPolyPolygon aOtherPolyPoly(rRegion.GetAsB2DPolyPolygon());
aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation(
aOtherPolyPoly );
-
+
basegfx::B2DPolyPolygon aClip =
basegfx::tools::solvePolygonOperationDiff( aThisPolyPoly, aOtherPolyPoly );
*this = Region( aClip );
return true;
@@ -1205,7 +1207,7 @@ bool Region::XOr( const Region& rRegion )
// get the other B2DPolyPolygon
basegfx::B2DPolyPolygon aOtherPolyPoly(rRegion.GetAsB2DPolyPolygon());
aOtherPolyPoly = basegfx::tools::prepareForPolygonOperation(
aOtherPolyPoly );
-
+
basegfx::B2DPolyPolygon aClip =
basegfx::tools::solvePolygonOperationXor( aThisPolyPoly, aOtherPolyPoly );
*this = Region( aClip );
return true;
@@ -1258,7 +1260,7 @@ Rectangle Region::GetBoundRect() const
if(IsNull())
{
// error; null region has no BoundRect
- // OSL_ENSURE(false, "Region::GetBoundRect error: null region has
unlimitied bound rect, not representable (!)");
+ // OSL_ENSURE(false, "Region::GetBoundRect error: null region has
unlimited bound rect, not representable (!)");
return Rectangle();
}
@@ -1276,7 +1278,7 @@ Rectangle Region::GetBoundRect() const
{
// #122149# corrected rounding, no need for ceil() and floor() here
return Rectangle(
- basegfx::fround(aRange.getMinX()),
basegfx::fround(aRange.getMinY()),
+ basegfx::fround(aRange.getMinX()),
basegfx::fround(aRange.getMinY()),
basegfx::fround(aRange.getMaxX()),
basegfx::fround(aRange.getMaxY()));
}
}
@@ -1303,7 +1305,7 @@ const PolyPolygon Region::GetAsPolyPolygon() const
if(getB2DPolyPolygon())
{
- // the polygon needs to be converted, buffer the down converion
+ // the polygon needs to be converted, buffer the down conversion
const PolyPolygon aPolyPolgon(*getB2DPolyPolygon());
const_cast< Region* >(this)->mpPolyPolygon.reset(new
PolyPolygon(aPolyPolgon));
@@ -1312,7 +1314,7 @@ const PolyPolygon Region::GetAsPolyPolygon() const
if(getRegionBand())
{
- // the BandRegion needs to be converted, buffer the converion
+ // the BandRegion needs to be converted, buffer the conversion
const PolyPolygon aPolyPolgon(ImplCreatePolyPolygonFromRegionBand());
const_cast< Region* >(this)->mpPolyPolygon.reset(new
PolyPolygon(aPolyPolgon));
@@ -1340,7 +1342,7 @@ const basegfx::B2DPolyPolygon
Region::GetAsB2DPolyPolygon() const
if(getRegionBand())
{
- // the BandRegion needs to be converted, buffer the converion
+ // the BandRegion needs to be converted, buffer the conversion
const basegfx::B2DPolyPolygon
aB2DPolyPolygon(ImplCreateB2DPolyPolygonFromRegionBand());
const_cast< Region* >(this)->mpB2DPolyPolygon.reset(new
basegfx::B2DPolyPolygon(aB2DPolyPolygon));
@@ -1444,7 +1446,7 @@ bool Region::IsOver( const Rectangle& rRect ) const
return true;
}
- // Can we optimize this ??? - is used in StarDraw for brushes pointers
+ // Can we optimize this ??? - is used in Draw for brushes pointers
// Why we have no IsOver for Regions ???
// create region from rectangle and intersect own region
Region aRegion(rRect);
@@ -1675,7 +1677,7 @@ SvStream& operator<<( SvStream& rOStrm, const Region&
rRegion )
}
else
{
- // for compatibility, write an empty RegionBand (will only write
+ // for compatibility, write an empty RegionBand (will only write
// the end marker STREAMENTRY_END, but this *is* needed)
const RegionBand aRegionBand;
@@ -1730,31 +1732,31 @@ static inline bool ImplPolygonRectTest( const Polygon&
rPoly, Rectangle* pRectOu
if( pRectOut )
{
long nSwap;
-
+
if( nX2 < nX1 )
{
nSwap = nX2;
nX2 = nX1;
nX1 = nSwap;
}
-
+
if( nY2 < nY1 )
{
nSwap = nY2;
nY2 = nY1;
nY1 = nSwap;
}
-
+
if( nX2 != nX1 )
{
nX2--;
}
-
+
if( nY2 != nY1 )
{
nY2--;
}
-
+
pRectOut->Left() = nX1;
pRectOut->Right() = nX2;
pRectOut->Top() = nY1;
@@ -1769,13 +1771,13 @@ static inline bool ImplPolygonRectTest( const Polygon&
rPoly, Rectangle* pRectOu
Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
{
//return Region( rPolyPoly );
-
+
// check if it's worth extracting the XOr'ing the Rectangles
// empiricism shows that break even between XOr'ing rectangles separately
// and ImplCreateRegionBandFromPolyPolygon is at half rectangles/half
polygons
int nPolygonRects = 0, nPolygonPolygons = 0;
int nPolygons = rPolyPoly.Count();
-
+
for( sal_uInt16 i = 0; i < nPolygons; i++ )
{
const Polygon& rPoly = rPolyPoly[i];
@@ -1794,7 +1796,7 @@ Region Region::GetRegionFromPolyPolygon( const
PolyPolygon& rPolyPoly )
{
return Region( rPolyPoly );
}
-
+
Region aResult;
Rectangle aRect;