You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by or...@apache.org on 2012/08/20 13:46:47 UTC
svn commit: r1374979 [24/29] - in /incubator/ooo/branches/writer001: ./
ext_libraries/apr-util/ ext_libraries/apr-util/prj/ ext_libraries/apr/
ext_libraries/coinmp/ ext_libraries/hunspell/ ext_libraries/serf/
ext_libraries/serf/prj/ ext_sources/ extras...
Modified: incubator/ooo/branches/writer001/main/scripting/source/pyprov/pythonscript.py
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/scripting/source/pyprov/pythonscript.py?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/scripting/source/pyprov/pythonscript.py (original)
+++ incubator/ooo/branches/writer001/main/scripting/source/pyprov/pythonscript.py Mon Aug 20 11:46:19 2012
@@ -26,7 +26,7 @@ import sys
import os
import imp
import time
-import compiler
+import ast
class LogLevel:
NONE = 0
@@ -72,18 +72,18 @@ def getLogTarget():
except Exception,e:
print "Exception during creation of pythonscript logfile: "+ lastException2String() + "\n, delagating log to stdout\n"
return ret
-
+
class Logger(LogLevel):
def __init__(self , target ):
self.target = target
def isDebugLevel( self ):
return self.use >= self.DEBUG
-
+
def debug( self, msg ):
if self.isDebugLevel():
self.log( self.DEBUG, msg )
-
+
def isErrorLevel( self ):
return self.use >= self.ERROR
@@ -145,9 +145,9 @@ def readTextFromStream( inputStream ):
read,out = inputStream.readBytes( None , BLOCK_SIZE )
code = code + out
if read < BLOCK_SIZE:
- break
+ break
return code.value
-
+
def toIniName( str ):
# TODO: what is the official way to get to know whether i am on the windows platform ?
if( hasattr(sys , "dllhandle") ):
@@ -165,7 +165,7 @@ class MyUriHelper:
{ "share" : "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + toIniName( "bootstrap") + "::BaseInstallation}/share/Scripts/python" , \
"share:uno_packages" : "vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages", \
"user" : "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + toIniName( "bootstrap") + "::UserInstallation}/user/Scripts/python" , \
- "user:uno_packages" : "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages" }
+ "user:uno_packages" : "vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages" }
self.m_uriRefFac = ctx.ServiceManager.createInstanceWithContext("com.sun.star.uri.UriReferenceFactory",ctx)
if location.startswith( "vnd.sun.star.tdoc" ):
self.m_baseUri = location + "/Scripts/python"
@@ -173,11 +173,11 @@ class MyUriHelper:
else:
self.m_baseUri = expandUri( self.s_UriMap[location] )
self.m_scriptUriLocation = location
- log.isDebugLevel() and log.debug( "initialized urihelper with baseUri="+self.m_baseUri + ",m_scriptUriLocation="+self.m_scriptUriLocation )
-
+ log.debug( "initialized urihelper with baseUri="+self.m_baseUri + ",m_scriptUriLocation="+self.m_scriptUriLocation )
+
def getRootStorageURI( self ):
return self.m_baseUri
-
+
def getStorageURI( self, scriptURI ):
return self.scriptURI2StorageUri(scriptURI)
@@ -187,20 +187,20 @@ class MyUriHelper:
def storageURI2ScriptUri( self, storageURI ):
if not storageURI.startswith( self.m_baseUri ):
message = "pythonscript: storage uri '" + storageURI + "' not in base uri '" + self.m_baseUri + "'"
- log.isDebugLevel() and log.debug( message )
+ log.debug( message )
raise RuntimeException( message )
ret = "vnd.sun.star.script:" + \
storageURI[len(self.m_baseUri)+1:].replace("/","|") + \
"?language=" + LANGUAGENAME + "&location=" + self.m_scriptUriLocation
- log.isDebugLevel() and log.debug( "converting storageURI="+storageURI + " to scriptURI=" + ret )
+ log.debug( "converting storageURI="+storageURI + " to scriptURI=" + ret )
return ret
-
+
def scriptURI2StorageUri( self, scriptURI ):
try:
myUri = self.m_uriRefFac.parse(scriptURI)
ret = self.m_baseUri + "/" + myUri.getName().replace( "|", "/" )
- log.isDebugLevel() and log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + ret )
+ log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + ret )
return ret
except UnoException, e:
log.error( "error during converting scriptURI="+scriptURI + ": " + e.Message)
@@ -208,7 +208,7 @@ class MyUriHelper:
except Exception, e:
log.error( "error during converting scriptURI="+scriptURI + ": " + str(e))
raise RuntimeException( "pythonscript:scriptURI2StorageUri: " + str(e), None )
-
+
class ModuleEntry:
def __init__( self, lastRead, module ):
@@ -244,14 +244,14 @@ def checkForPythonPathBesideScript( url
if 1 == os.access( encfile(path), os.F_OK) and not path in sys.path:
log.log( LogLevel.DEBUG, "adding " + path + " to sys.path" )
sys.path.append( path )
-
-
+
+
class ScriptContext(unohelper.Base):
def __init__( self, ctx, doc, inv ):
self.ctx = ctx
self.doc = doc
self.inv = inv
-
+
# XScriptContext
def getDocument(self):
if self.doc:
@@ -281,22 +281,22 @@ class ScriptContext(unohelper.Base):
# lastRead = sfa.getDateTimeModified( url )
# if entry:
# if hasChanged( entry.lastRead, lastRead ):
-# log.isDebugLevel() and log.debug("file " + url + " has changed, reloading")
+# log.debug("file " + url + " has changed, reloading")
# else:
# load = False
-#
+#
# if load:
-# log.isDebugLevel() and log.debug( "opening >" + url + "<" )
+# log.debug( "opening >" + url + "<" )
#
# code = readTextFromStream( sfa.openFileRead( url ) )
-
+
# execute the module
# entry = ModuleEntry( lastRead, imp.new_module("ooo_script_framework") )
# entry.module.__dict__[GLOBAL_SCRIPTCONTEXT_NAME] = g_scriptContext
# entry.module.__file__ = url
# exec code in entry.module.__dict__
# g_modules[ url ] = entry
-# log.isDebugLevel() and log.debug( "mapped " + url + " to " + str( entry.module ) )
+# log.debug( "mapped " + url + " to " + str( entry.module ) )
# return entry.module
class ProviderContext:
@@ -312,13 +312,13 @@ class ProviderContext:
def getTransientPartFromUrl( self, url ):
rest = url.replace( self.rootUrl , "",1 ).replace( "/","",1)
return rest[0:rest.find("/")]
-
+
def getPackageNameFromUrl( self, url ):
rest = url.replace( self.rootUrl , "",1 ).replace( "/","",1)
start = rest.find("/") +1
return rest[start:rest.find("/",start)]
-
-
+
+
def removePackageByUrl( self, url ):
items = self.mapPackageName2Path.items()
for i in items:
@@ -329,34 +329,34 @@ class ProviderContext:
def addPackageByUrl( self, url ):
packageName = self.getPackageNameFromUrl( url )
transientPart = self.getTransientPartFromUrl( url )
- log.isDebugLevel() and log.debug( "addPackageByUrl : " + packageName + ", " + transientPart + "("+url+")" + ", rootUrl="+self.rootUrl )
+ log.debug( "addPackageByUrl : " + packageName + ", " + transientPart + "("+url+")" + ", rootUrl="+self.rootUrl )
if self.mapPackageName2Path.has_key( packageName ):
package = self.mapPackageName2Path[ packageName ]
package.pathes = package.pathes + (url, )
else:
package = Package( (url,), transientPart)
self.mapPackageName2Path[ packageName ] = package
-
+
def isUrlInPackage( self, url ):
values = self.mapPackageName2Path.values()
for i in values:
-# print "checking " + url + " in " + str(i.pathes)
+# print "checking " + url + " in " + str(i.pathes)
if url in i.pathes:
- return True
+ return True
# print "false"
return False
-
+
def setPackageAttributes( self, mapPackageName2Path, rootUrl ):
self.mapPackageName2Path = mapPackageName2Path
self.rootUrl = rootUrl
-
+
def getPersistentUrlFromStorageUrl( self, url ):
# package name is the second directory
ret = url
if self.rootUrl:
pos = len( self.rootUrl) +1
ret = url[0:pos]+url[url.find("/",pos)+1:len(url)]
- log.isDebugLevel() and log.debug( "getPersistentUrlFromStorageUrl " + url + " -> "+ ret)
+ log.debug( "getPersistentUrlFromStorageUrl " + url + " -> "+ ret)
return ret
def getStorageUrlFromPersistentUrl( self, url):
@@ -366,7 +366,7 @@ class ProviderContext:
packageName = url[pos:url.find("/",pos+1)]
package = self.mapPackageName2Path[ packageName ]
ret = url[0:pos]+ package.transientPathElement + "/" + url[pos:len(url)]
- log.isDebugLevel() and log.debug( "getStorageUrlFromPersistentUrl " + url + " -> "+ ret)
+ log.debug( "getStorageUrlFromPersistentUrl " + url + " -> "+ ret)
return ret
def getFuncsByUrl( self, url ):
@@ -374,44 +374,55 @@ class ProviderContext:
checkForPythonPathBesideScript( url[0:url.rfind('/')] )
src = ensureSourceState( src )
- code = compiler.parse( src )
-
allFuncs = []
-
- if code == None:
- return allFuncs
-
g_exportedScripts = []
- for node in code.node.nodes:
- if node.__class__.__name__ == 'Function':
- allFuncs.append(node.name)
- elif node.__class__.__name__ == 'Assign':
- for assignee in node.nodes:
- if assignee.name == 'g_exportedScripts':
- for item in node.expr:
- if item.__class__.__name__ == 'Name':
- g_exportedScripts.append(item.name)
- return g_exportedScripts
+ a = ast.parse(src, url)
+
+ if isinstance(a, ast.Module):
+ for node in a.body:
+ if isinstance(node, ast.FunctionDef):
+ allFuncs.append(node.name)
+ elif isinstance(node, ast.Assign):
+ is_exported = False
+ for subnode in node.targets:
+ if isinstance(subnode, ast.Name) and \
+ subnode.id == "g_exportedScripts":
+ is_exported = True
+ break
+ if is_exported:
+ value_node = node.value
+ if isinstance(value_node, ast.List) or \
+ isinstance(value_node, ast.Tuple):
+ for elt in value_node.elts:
+ if isinstance(elt, ast.Str):
+ g_exportedScripts.append(elt.s)
+ elif isinstance(elt, ast.Name):
+ g_exportedScripts.append(elt.id)
+ elif isinstance(value_node, ast.Str):
+ g_exportedScripts.append(value_node.s)
+ elif isinstance(value_node, ast.Name):
+ g_exportedScripts.append(value_node.id)
+ return g_exportedScripts
return allFuncs
-
+
def getModuleByUrl( self, url ):
entry = self.modules.get(url)
load = True
lastRead = self.sfa.getDateTimeModified( url )
if entry:
if hasChanged( entry.lastRead, lastRead ):
- log.isDebugLevel() and log.debug( "file " + url + " has changed, reloading" )
+ log.debug( "file " + url + " has changed, reloading" )
else:
load = False
-
+
if load:
- log.isDebugLevel() and log.debug( "opening >" + url + "<" )
-
+ log.debug( "opening >" + url + "<" )
+
src = readTextFromStream( self.sfa.openFileRead( url ) )
checkForPythonPathBesideScript( url[0:url.rfind('/')] )
- src = ensureSourceState( src )
-
+ src = ensureSourceState( src )
+
# execute the module
entry = ModuleEntry( lastRead, imp.new_module("ooo_script_framework") )
entry.module.__dict__[GLOBAL_SCRIPTCONTEXT_NAME] = self.scriptContext
@@ -424,16 +435,16 @@ class ProviderContext:
exec code in entry.module.__dict__
entry.module.__file__ = url
self.modules[ url ] = entry
- log.isDebugLevel() and log.debug( "mapped " + url + " to " + str( entry.module ) )
+ log.debug( "mapped " + url + " to " + str( entry.module ) )
return entry.module
-
+
#--------------------------------------------------
def isScript( candidate ):
ret = False
if isinstance( candidate, type(isScript) ):
ret = True
return ret
-
+
#-------------------------------------------------------
class ScriptBrowseNode( unohelper.Base, XBrowseNode , XPropertySet, XInvocation, XActionListener ):
def __init__( self, provCtx, uri, fileName, funcName ):
@@ -441,7 +452,7 @@ class ScriptBrowseNode( unohelper.Base,
self.funcName = funcName
self.provCtx = provCtx
self.uri = uri
-
+
def getName( self ):
return self.funcName
@@ -450,7 +461,7 @@ class ScriptBrowseNode( unohelper.Base,
def hasChildNodes(self):
return False
-
+
def getType( self):
return SCRIPT
@@ -462,19 +473,19 @@ class ScriptBrowseNode( unohelper.Base,
self.provCtx.getPersistentUrlFromStorageUrl( self.uri + "$" + self.funcName ) )
elif name == "Editable" and ENABLE_EDIT_DIALOG:
ret = not self.provCtx.sfa.isReadOnly( self.uri )
-
- log.isDebugLevel() and log.debug( "ScriptBrowseNode.getPropertyValue called for " + name + ", returning " + str(ret) )
+
+ log.debug( "ScriptBrowseNode.getPropertyValue called for " + name + ", returning " + str(ret) )
except Exception,e:
log.error( "ScriptBrowseNode.getPropertyValue error " + lastException2String())
raise
-
+
return ret
def setPropertyValue( self, name, value ):
- log.isDebugLevel() and log.debug( "ScriptBrowseNode.setPropertyValue called " + name + "=" +str(value ) )
+ log.debug( "ScriptBrowseNode.setPropertyValue called " + name + "=" +str(value ) )
def getPropertySetInfo( self ):
- log.isDebugLevel() and log.debug( "ScriptBrowseNode.getPropertySetInfo called " )
+ log.debug( "ScriptBrowseNode.getPropertySetInfo called " )
return None
-
+
def getIntrospection( self ):
return None
@@ -513,12 +524,12 @@ class ScriptBrowseNode( unohelper.Base,
values = mod.__dict__.get( CALLABLE_CONTAINER_NAME , None )
if not values:
values = mod.__dict__.values()
-
+
for i in values:
if isScript( i ):
i()
break
-
+
elif event.ActionCommand == "Save":
toWrite = uno.ByteSequence(
str(
@@ -530,13 +541,13 @@ class ScriptBrowseNode( unohelper.Base,
out.writeBytes( toWrite )
out.close()
self.provCtx.sfa.kill( copyUrl )
-# log.isDebugLevel() and log.debug("Save is not implemented yet")
+# log.debug("Save is not implemented yet")
# text = self.editor.getControl("EditorTextField").getText()
-# log.isDebugLevel() and log.debug("Would save: " + text)
+# log.debug("Would save: " + text)
except Exception,e:
# TODO: add an error box here !
log.error( lastException2String() )
-
+
def setValue( self, name, value ):
return None
@@ -550,7 +561,7 @@ class ScriptBrowseNode( unohelper.Base,
def hasProperty( self, name ):
return False
-
+
#-------------------------------------------------------
class FileBrowseNode( unohelper.Base, XBrowseNode ):
def __init__( self, provCtx, uri , name ):
@@ -558,22 +569,22 @@ class FileBrowseNode( unohelper.Base, XB
self.uri = uri
self.name = name
self.funcnames = None
-
+
def getName( self ):
return self.name
-
+
def getChildNodes(self):
ret = ()
try:
self.funcnames = self.provCtx.getFuncsByUrl( self.uri )
-
+
scriptNodeList = []
for i in self.funcnames:
scriptNodeList.append(
ScriptBrowseNode(
self.provCtx, self.uri, self.name, i ))
ret = tuple( scriptNodeList )
- log.isDebugLevel() and log.debug( "returning " +str(len(ret)) + " ScriptChildNodes on " + self.uri )
+ log.debug( "returning " +str(len(ret)) + " ScriptChildNodes on " + self.uri )
except Exception, e:
text = lastException2String()
log.error( "Error while evaluating " + self.uri + ":" + text )
@@ -585,11 +596,11 @@ class FileBrowseNode( unohelper.Base, XB
return len(self.getChildNodes()) > 0
except Exception, e:
return False
-
+
def getType( self):
return CONTAINER
-
+
class DirBrowseNode( unohelper.Base, XBrowseNode ):
def __init__( self, provCtx, name, rootUrl ):
@@ -602,16 +613,16 @@ class DirBrowseNode( unohelper.Base, XBr
def getChildNodes( self ):
try:
- log.isDebugLevel() and log.debug( "DirBrowseNode.getChildNodes called for " + self.rootUrl )
+ log.debug( "DirBrowseNode.getChildNodes called for " + self.rootUrl )
contents = self.provCtx.sfa.getFolderContents( self.rootUrl, True )
browseNodeList = []
for i in contents:
if i.endswith( ".py" ):
- log.isDebugLevel() and log.debug( "adding filenode " + i )
+ log.debug( "adding filenode " + i )
browseNodeList.append(
FileBrowseNode( self.provCtx, i, i[i.rfind("/")+1:len(i)-3] ) )
elif self.provCtx.sfa.isFolder( i ) and not i.endswith("/pythonpath"):
- log.isDebugLevel() and log.debug( "adding DirBrowseNode " + i )
+ log.debug( "adding DirBrowseNode " + i )
browseNodeList.append( DirBrowseNode( self.provCtx, i[i.rfind("/")+1:len(i)],i))
return tuple( browseNodeList )
except Exception, e:
@@ -634,13 +645,13 @@ class DirBrowseNode( unohelper.Base, XBr
class ManifestHandler( XDocumentHandler, unohelper.Base ):
def __init__( self, rootUrl ):
self.rootUrl = rootUrl
-
+
def startDocument( self ):
self.urlList = []
-
+
def endDocument( self ):
pass
-
+
def startElement( self , name, attlist):
if name == "manifest:file-entry":
if attlist.getValueByName( "manifest:media-type" ) == "application/vnd.sun.star.framework-script":
@@ -672,11 +683,11 @@ def isPyFileInPath( sfa, path ):
break
return ret
-# extracts META-INF directory from
+# extracts META-INF directory from
def getPathesFromPackage( rootUrl, sfa ):
ret = ()
try:
- fileUrl = rootUrl + "/META-INF/manifest.xml"
+ fileUrl = rootUrl + "/META-INF/manifest.xml"
inputStream = sfa.openFileRead( fileUrl )
parser = uno.getComponentContext().ServiceManager.createInstance( "com.sun.star.xml.sax.Parser" )
handler = ManifestHandler( rootUrl )
@@ -691,7 +702,7 @@ def getPathesFromPackage( rootUrl, sfa )
log.debug( "getPathesFromPackage " + fileUrl + " Exception: " +text )
pass
return ret
-
+
class Package:
def __init__( self, pathes, transientPathElement ):
@@ -702,18 +713,18 @@ class DummyInteractionHandler( unohelper
def __init__( self ):
pass
def handle( self, event):
- log.isDebugLevel() and log.debug( "pythonscript: DummyInteractionHandler.handle " + str( event ) )
+ log.debug( "pythonscript: DummyInteractionHandler.handle " + str( event ) )
class DummyProgressHandler( unohelper.Base, XProgressHandler ):
def __init__( self ):
pass
-
- def push( self,status ):
- log.isDebugLevel() and log.debug( "pythonscript: DummyProgressHandler.push " + str( status ) )
- def update( self,status ):
- log.isDebugLevel() and log.debug( "pythonscript: DummyProgressHandler.update " + str( status ) )
- def pop( self ):
- log.isDebugLevel() and log.debug( "pythonscript: DummyProgressHandler.push " + str( event ) )
+
+ def push( self,status ):
+ log.debug( "pythonscript: DummyProgressHandler.push " + str( status ) )
+ def update( self,status ):
+ log.debug( "pythonscript: DummyProgressHandler.update " + str( status ) )
+ def pop( self ):
+ log.debug( "pythonscript: DummyProgressHandler.push " + str( event ) )
class CommandEnvironment(unohelper.Base, XCommandEnvironment):
def __init__( self ):
@@ -729,9 +740,9 @@ class CommandEnvironment(unohelper.Base,
# def __init__( self ):
# pass
# def modified( self, event ):
-# log.isDebugLevel() and log.debug( "pythonscript: ModifyListener.modified " + str( event ) )
+# log.debug( "pythonscript: ModifyListener.modified " + str( event ) )
# def disposing( self, event ):
-# log.isDebugLevel() and log.debug( "pythonscript: ModifyListener.disposing " + str( event ) )
+# log.debug( "pythonscript: ModifyListener.disposing " + str( event ) )
def getModelFromDocUrl(ctx, url):
"""Get document model from document url."""
@@ -744,12 +755,12 @@ def getModelFromDocUrl(ctx, url):
p = Property()
p.Name = "DocumentModel"
p.Handle = -1
-
+
c = Command()
c.Handle = -1
c.Name = "getPropertyValues"
c.Argument = uno.Any("[]com.sun.star.beans.Property", (p,))
-
+
env = CommandEnvironment()
try:
ret = content.execute(c, 0, env)
@@ -773,13 +784,13 @@ def getPackageName2PathMap( sfa, storage
packageManager = packageManagerFactory.getPackageManager(
mapStorageType2PackageContext(storageType))
# packageManager.addModifyListener( ModifyListener() )
- log.isDebugLevel() and log.debug( "pythonscript: getPackageName2PathMap start getDeployedPackages" )
+ log.debug( "pythonscript: getPackageName2PathMap start getDeployedPackages" )
packages = packageManager.getDeployedPackages(
packageManager.createAbortChannel(), CommandEnvironment( ) )
- log.isDebugLevel() and log.debug( "pythonscript: getPackageName2PathMap end getDeployedPackages (" + str(len(packages))+")" )
+ log.debug( "pythonscript: getPackageName2PathMap end getDeployedPackages (" + str(len(packages))+")" )
for i in packages:
- log.isDebugLevel() and log.debug( "inspecting package " + i.Name + "("+i.Identifier.Value+")" )
+ log.debug( "inspecting package " + i.Name + "("+i.Identifier.Value+")" )
transientPathElement = penultimateElement( i.URL )
j = expandUri( i.URL )
pathes = getPathesFromPackage( j, sfa )
@@ -837,7 +848,7 @@ class PythonScript( unohelper.Base, XScr
self.func = func
self.mod = mod
def invoke(self, args, out, outindex ):
- log.isDebugLevel() and log.debug( "PythonScript.invoke " + str( args ) )
+ log.debug( "PythonScript.invoke " + str( args ) )
try:
ret = self.func( *args )
except UnoException,e:
@@ -846,11 +857,11 @@ class PythonScript( unohelper.Base, XScr
complete = "Error during invoking function " + \
str(self.func.__name__) + " in module " + \
self.mod.__file__ + " (" + text + ")"
- log.isDebugLevel() and log.debug( complete )
+ log.debug( complete )
# some people may beat me up for modifying the exception text,
# but otherwise office just shows
# the type name and message text with no more information,
- # this is really bad for most users.
+ # this is really bad for most users.
e.Message = e.Message + " (" + complete + ")"
raise
except Exception,e:
@@ -859,9 +870,9 @@ class PythonScript( unohelper.Base, XScr
complete = "Error during invoking function " + \
str(self.func.__name__) + " in module " + \
self.mod.__file__ + " (" + text + ")"
- log.isDebugLevel() and log.debug( complete )
+ log.debug( complete )
raise RuntimeException( complete , self )
- log.isDebugLevel() and log.debug( "PythonScript.invoke ret = " + str( ret ) )
+ log.debug( "PythonScript.invoke ret = " + str( ret ) )
return ret, (), ()
def expandUri( uri ):
@@ -872,7 +883,7 @@ def expandUri( uri ):
if uri.startswith( "file:" ):
uri = uno.absolutize("",uri) # necessary to get rid of .. in uri
return uri
-
+
#--------------------------------------------------------------
class PythonScriptProvider( unohelper.Base, XBrowseNode, XScriptProvider, XNameContainer):
def __init__( self, ctx, *args ):
@@ -897,7 +908,7 @@ class PythonScriptProvider( unohelper.Ba
try:
doc = inv.ScriptContainer
content = ctx.getServiceManager().createInstanceWithContext(
- "com.sun.star.frame.TransientDocumentsDocumentContentFactory",
+ "com.sun.star.frame.TransientDocumentsDocumentContentFactory",
ctx).createDocumentContent(doc)
storageType = content.getIdentifier().getContentIdentifier()
except Exception, e:
@@ -910,10 +921,10 @@ class PythonScriptProvider( unohelper.Ba
# urlHelper = ctx.ServiceManager.createInstanceWithArgumentsAndContext(
# "com.sun.star.script.provider.ScriptURIHelper", (LANGUAGENAME, storageType), ctx)
urlHelper = MyUriHelper( ctx, storageType )
- log.isDebugLevel() and log.debug( "got urlHelper " + str( urlHelper ) )
-
+ log.debug( "got urlHelper " + str( urlHelper ) )
+
rootUrl = expandUri( urlHelper.getRootStorageURI() )
- log.isDebugLevel() and log.debug( storageType + " transformed to " + rootUrl )
+ log.debug( storageType + " transformed to " + rootUrl )
ucbService = "com.sun.star.ucb.SimpleFileAccess"
sfa = ctx.ServiceManager.createInstanceWithContext( ucbService, ctx )
@@ -929,7 +940,7 @@ class PythonScriptProvider( unohelper.Ba
self.dirBrowseNode = PackageBrowseNode( self.provCtx, LANGUAGENAME, rootUrl )
else:
self.dirBrowseNode = DirBrowseNode( self.provCtx, LANGUAGENAME, rootUrl )
-
+
except Exception, e:
text = lastException2String()
log.debug( "PythonScriptProvider could not be instantiated because of : " + text )
@@ -939,7 +950,7 @@ class PythonScriptProvider( unohelper.Ba
return self.dirBrowseNode.getName()
def getChildNodes( self ):
- return self.dirBrowseNode.getChildNodes()
+ return self.dirBrowseNode.getChildNodes()
def hasChildNodes( self ):
return self.dirBrowseNode.hasChildNodes()
@@ -949,31 +960,31 @@ class PythonScriptProvider( unohelper.Ba
def getScript( self, uri ):
log.debug( "DirBrowseNode getScript " + uri + " invoked" )
-
+
raise IllegalArgumentException( "DirBrowseNode couldn't instantiate script " + uri , self , 0 )
def getScript( self, scriptUri ):
try:
- log.isDebugLevel() and log.debug( "getScript " + scriptUri + " invoked")
-
+ log.debug( "getScript " + scriptUri + " invoked")
+
storageUri = self.provCtx.getStorageUrlFromPersistentUrl(
self.provCtx.uriHelper.getStorageURI(scriptUri) );
- log.isDebugLevel() and log.debug( "getScript: storageUri = " + storageUri)
+ log.debug( "getScript: storageUri = " + storageUri)
fileUri = storageUri[0:storageUri.find( "$" )]
- funcName = storageUri[storageUri.find( "$" )+1:len(storageUri)]
-
+ funcName = storageUri[storageUri.find( "$" )+1:len(storageUri)]
+
mod = self.provCtx.getModuleByUrl( fileUri )
- log.isDebugLevel() and log.debug( " got mod " + str(mod) )
-
+ log.debug( " got mod " + str(mod) )
+
func = mod.__dict__[ funcName ]
- log.isDebugLevel() and log.debug( "got func " + str( func ) )
+ log.debug( "got func " + str( func ) )
return PythonScript( func, mod )
except Exception, e:
text = lastException2String()
log.error( text )
raise ScriptFrameworkErrorException( text, self, scriptUri, LANGUAGENAME, 0 )
-
+
# XServiceInfo
def getSupportedServices( self ):
@@ -989,11 +1000,11 @@ class PythonScriptProvider( unohelper.Ba
log.debug( "getByName called" + str( name ))
return None
-
+
def getElementNames( self ):
log.debug( "getElementNames called")
return ()
-
+
def hasByName( self, name ):
try:
log.debug( "hasByName called " + str( name ))
@@ -1015,7 +1026,7 @@ class PythonScriptProvider( unohelper.Ba
log.debug( "removeByName unknown uri " + str( name ) + ", ignoring" )
raise NoSuchElementException( uri + "is not in package" , self )
log.debug( "removeByName called" + str( uri ) + " successful" )
-
+
def insertByName( self, name, value ):
log.debug( "insertByName called " + str( name ) + " " + str( value ))
uri = expandUri( name )
@@ -1036,16 +1047,15 @@ class PythonScriptProvider( unohelper.Ba
def getElementType( self ):
log.debug( "getElementType called" )
return uno.getTypeByName( "void" )
-
+
def hasElements( self ):
log.debug( "hasElements got called")
return False
-
+
g_ImplementationHelper.addImplementation( \
- PythonScriptProvider,g_implName, \
+ PythonScriptProvider,g_implName, \
("com.sun.star.script.provider.LanguageScriptProvider",
"com.sun.star.script.provider.ScriptProviderFor"+ LANGUAGENAME,),)
log.debug( "pythonscript finished intializing" )
-
Modified: incubator/ooo/branches/writer001/main/sd/inc/undo/undomanager.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/inc/undo/undomanager.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/inc/undo/undomanager.hxx (original)
+++ incubator/ooo/branches/writer001/main/sd/inc/undo/undomanager.hxx Mon Aug 20 11:46:19 2012
@@ -24,13 +24,13 @@
#ifndef _SD_UNDOMANAGER_HXX
#define _SD_UNDOMANAGER_HXX
-#include "misc/scopelock.hxx"
-#include <svl/undo.hxx>
+#include <misc/scopelock.hxx>
+#include <svx/sdrundomanager.hxx>
namespace sd
{
-class UndoManager : public SfxUndoManager
+class UndoManager : public SdrUndoManager
{
public:
UndoManager( sal_uInt16 nMaxUndoActionCount = 20 );
@@ -44,8 +44,8 @@ public:
void SetLinkedUndoManager (::svl::IUndoManager* pLinkedUndoManager);
private:
- using SfxUndoManager::Undo;
- using SfxUndoManager::Redo;
+ using SdrUndoManager::Undo;
+ using SdrUndoManager::Redo;
/** Used when the outline view is visible as a last resort to
synchronize the undo managers.
Modified: incubator/ooo/branches/writer001/main/sd/source/core/sdpage.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/core/sdpage.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/core/sdpage.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/core/sdpage.cxx Mon Aug 20 11:46:19 2012
@@ -793,13 +793,19 @@ void SdPage::CreateTitleAndLayout(sal_Bo
// handout template
// delete all available handout presentation objects
- SdrObject* pObj;
+ SdrObject *pObj=NULL;
while( (pObj = pMasterPage->GetPresObj(PRESOBJ_HANDOUT)) != 0 )
{
+ pMasterPage->RemoveObject(pObj->GetOrdNum());
+
if( bUndo )
+ {
pUndoManager->AddUndoAction(pModel->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
-
- pMasterPage->RemoveObject(pObj->GetOrdNum());
+ }
+ else
+ {
+ SdrObject::Free( pObj ); // memory leak i120050
+ }
}
std::vector< Rectangle > aAreas;
@@ -1395,7 +1401,7 @@ void findAutoLayoutShapesImpl( SdPage& r
bool bMissing = false;
// for each entry in the layoutdescriptor, arrange a presentation shape
- for( i = 0; (i < PRESOBJ_MAX) && (rDescriptor.meKind[i] != PRESOBJ_NONE); i++ )
+ for (i = 0; (i < MAX_PRESOBJS) && (rDescriptor.meKind[i] != PRESOBJ_NONE); i++)
{
PresObjKind eKind = rDescriptor.meKind[i];
SdrObject* pObj = 0;
@@ -1417,7 +1423,7 @@ void findAutoLayoutShapesImpl( SdPage& r
if( bMissing && bInit )
{
// for each entry in the layoutdescriptor, look for an alternative shape
- for( i = 0; (i < PRESOBJ_MAX) && (rDescriptor.meKind[i] != PRESOBJ_NONE); i++ )
+ for (i = 0; (i < MAX_PRESOBJS) && (rDescriptor.meKind[i] != PRESOBJ_NONE); i++)
{
if( rShapes[i] )
continue;
@@ -1577,7 +1583,7 @@ void SdPage::SetAutoLayout(AutoLayout eL
int i;
// for each entry in the layoutdescriptor, arrange a presentation shape
- for( i = 0; (i < PRESOBJ_MAX) && (aDescriptor.meKind[i] != PRESOBJ_NONE); i++ )
+ for (i = 0; (i < MAX_PRESOBJS) && (aDescriptor.meKind[i] != PRESOBJ_NONE); i++)
{
PresObjKind eKind = aDescriptor.meKind[i];
SdrObject* pObj = InsertAutoLayoutShape( aLayoutShapes[i], eKind, aDescriptor.mbVertical[i], aRectangle[i], bInit );
Modified: incubator/ooo/branches/writer001/main/sd/source/core/undo/undomanager.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/core/undo/undomanager.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/core/undo/undomanager.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/core/undo/undomanager.cxx Mon Aug 20 11:46:19 2012
@@ -23,13 +23,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
+
#include <tools/debug.hxx>
-#include "undo/undomanager.hxx"
+#include <undo/undomanager.hxx>
using namespace sd;
UndoManager::UndoManager( sal_uInt16 nMaxUndoActionCount /* = 20 */ )
-: SfxUndoManager( nMaxUndoActionCount )
+: SdrUndoManager( nMaxUndoActionCount )
, mpLinkedUndoManager(NULL)
{
}
@@ -39,7 +40,7 @@ void UndoManager::EnterListAction(const
if( !IsDoing() )
{
ClearLinkedRedoActions();
- SfxUndoManager::EnterListAction( rComment, rRepeatComment, nId );
+ SdrUndoManager::EnterListAction( rComment, rRepeatComment, nId );
}
}
@@ -48,7 +49,7 @@ void UndoManager::AddUndoAction( SfxUndo
if( !IsDoing() )
{
ClearLinkedRedoActions();
- SfxUndoManager::AddUndoAction( pAction, bTryMerg );
+ SdrUndoManager::AddUndoAction( pAction, bTryMerg );
}
else
{
Modified: incubator/ooo/branches/writer001/main/sd/source/filter/eppt/epptso.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/filter/eppt/epptso.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/filter/eppt/epptso.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/filter/eppt/epptso.cxx Mon Aug 20 11:46:19 2012
@@ -1406,6 +1406,13 @@ void PPTWriter::ImplWriteParagraphs( SvS
nPropertyFlags |= 1; // turn off bullet explicit
nBulletFlags = 0;
}
+
+ // Write nTextOfs and nBullets
+ if ( mpStyleSheet->IsHardAttribute( nInstance, nDepth, ParaAttr_TextOfs, pPara->nTextOfs ) )
+ nPropertyFlags |= 0x100;
+ if ( mpStyleSheet->IsHardAttribute( nInstance, nDepth, ParaAttr_BulletOfs, pPara->nBulletOfs ))
+ nPropertyFlags |= 0x400;
+
FontCollectionEntry aFontDescEntry( pPara->aFontDesc.Name, pPara->aFontDesc.Family, pPara->aFontDesc.Pitch, pPara->aFontDesc.CharSet );
sal_uInt16 nFontId = (sal_uInt16)maFontCollection.GetId( aFontDescEntry );
@@ -1444,6 +1451,10 @@ void PPTWriter::ImplWriteParagraphs( SvS
rOut << (sal_uInt16)( pPara->mnLineSpacingTop );
if ( nPropertyFlags & 0x00004000 )
rOut << (sal_uInt16)( pPara->mnLineSpacingBottom );
+ if ( nPropertyFlags & 0x100 )
+ rOut << (sal_uInt16)(pPara->nTextOfs);
+ if ( nPropertyFlags & 0x400 )
+ rOut << (sal_uInt16)(pPara->nBulletOfs);
if ( nPropertyFlags & 0x000e0000 )
{
sal_uInt16 nAsianSettings = 0;
@@ -4132,7 +4143,7 @@ sal_Bool PPTWriter::ImplCreatePresentati
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 );
aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
aPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
sal_uInt32 nLineFlags = 0x90001;
if ( aPropOpt.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
nLineFlags |= 0x10001; // draw dashed line if no line
@@ -4191,14 +4202,17 @@ void PPTWriter::ImplCreateTextShape( Esc
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_TextBox, 0xa00, rSolver );
if ( bFill )
- rPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ rPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
if ( ImplGetText() )
rPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
}
void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& aSolverContainer, PageType ePageType, sal_Bool bMasterPage, int nPageNumber )
{
- sal_uInt32 nInstance, nGroups, nShapes, nShapeCount, nPer, nLastPer, nIndices, nGroupLevel = 0, nOlePictureId;
+ // #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // sal_uInt32 nGroupLevel = 0;
+
+ sal_uInt32 nInstance, nGroups, nShapes, nShapeCount, nPer, nLastPer, nIndices, nOlePictureId;
sal_uInt16 nEffectCount;
::com::sun::star::awt::Point aTextRefPoint;
@@ -4350,7 +4364,7 @@ void PPTWriter::ImplWritePage( const PHL
{
ImplCreateShape( eShapeType, nMirrorFlags | 0xa00, aSolverContainer );
aPropOpt.CreateCustomShapeProperties( eShapeType, mXShape );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape);
if ( ImplGetText() )
{
if ( !aPropOpt.IsFontWork() )
@@ -4384,7 +4398,7 @@ void PPTWriter::ImplWritePage( const PHL
{
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
}
- aPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
if ( ImplGetText() )
aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
}
@@ -4422,7 +4436,7 @@ void PPTWriter::ImplWritePage( const PHL
{
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_Ellipse, 0xa00, aSolverContainer ); // Flags: Connector | HasSpt
- aPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
if ( ImplGetText() )
aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_False );
}
@@ -4456,8 +4470,9 @@ void PPTWriter::ImplWritePage( const PHL
aPolygon.Rotate( aRect.TopLeft(), (sal_uInt16)( mnAngle / 10 ) );
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bNeedText = sal_False;
bAdditionalText = sal_True;
mnTextSize = 0;
@@ -4473,7 +4488,7 @@ void PPTWriter::ImplWritePage( const PHL
case POLY_CHORD :
{
if ( aPropOpt.CreatePolygonProperties( mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, &aPolygon ) )
- aPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, sal_True , mXShape );
}
break;
@@ -4654,7 +4669,8 @@ void PPTWriter::ImplWritePage( const PHL
aTextRefPoint = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
mnTextSize = 0;
bAdditionalText = sal_True;
- mpPptEscherEx->EnterGroup( &maRect,0 );
+ // #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( &maRect,0 );
}
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
sal_uInt32 nFlags = 0xa00; // Flags: Connector | HasSpt
@@ -4672,8 +4688,9 @@ void PPTWriter::ImplWritePage( const PHL
{
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bAdditionalText = sal_True;
mnTextSize = 0;
}
@@ -4684,15 +4701,16 @@ void PPTWriter::ImplWritePage( const PHL
maRect = ImplMapRectangle( aNewRect );
maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, sal_True , mXShape );
mnAngle = 0;
}
else if ( bPolyLine )
{
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bAdditionalText = sal_True;
mnTextSize = 0;
}
@@ -4710,8 +4728,9 @@ void PPTWriter::ImplWritePage( const PHL
{
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bAdditionalText = sal_True;
mnTextSize = 0;
}
@@ -4729,8 +4748,9 @@ void PPTWriter::ImplWritePage( const PHL
{
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bAdditionalText = sal_True;
mnTextSize = 0;
}
@@ -4741,7 +4761,7 @@ void PPTWriter::ImplWritePage( const PHL
maRect = ImplMapRectangle( aNewRect );
maPosition = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
maSize = ::com::sun::star::awt::Size( maRect.GetWidth(), maRect.GetHeight() );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, sal_True , mXShape );
mnAngle = 0;
}
else if ( ( mType == "drawing.GraphicObject" ) || ( mType == "presentation.GraphicObject" ) )
@@ -4787,8 +4807,22 @@ void PPTWriter::ImplWritePage( const PHL
else
{
ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
+ const Rectangle aOldRect100thmm(aRect100thmm);
+
if ( aPropOpt.CreateGraphicProperties( mXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "GraphicURL" ) ), sal_False, sal_True ) )
+ {
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
+
+ if(aOldRect100thmm != aRect100thmm)
+ {
+ // #119536# graphic has been adapted (rotated) so that it can be saved without angle,
+ // adapt local values as needed
+ maPosition = ImplMapPoint( ::com::sun::star::awt::Point( aRect100thmm.Left(), aRect100thmm.Top() ) );
+ maSize = ImplMapSize( ::com::sun::star::awt::Size ( aRect100thmm.GetWidth(), aRect100thmm.GetHeight() ) );
+ maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
+ mnAngle = 0;
+ }
+ }
}
}
}
@@ -4840,7 +4874,7 @@ void PPTWriter::ImplWritePage( const PHL
aPropertyOptions.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x110001 );
aPropertyOptions.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
aPropertyOptions.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
- aPropertyOptions.CreateFillProperties( mXPropSet, sal_True );
+ aPropertyOptions.CreateFillProperties( mXPropSet, sal_True, mXShape );
sal_uInt32 nLineFlags = 0x90001;
if ( aPropertyOptions.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
nLineFlags |= 0x10001; // draw dashed line if no line
@@ -4885,7 +4919,7 @@ void PPTWriter::ImplWritePage( const PHL
nPlaceHolderAtom = rLayout.nTypeOfTitle;
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterTitle );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
if ( mbEmptyPresObj )
@@ -4934,7 +4968,7 @@ void PPTWriter::ImplWritePage( const PHL
aPropOpt2.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
aPropOpt2.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90001 );
aPropOpt2.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
- aPropOpt2.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt2.CreateFillProperties( mXPropSet, sal_True, mXShape );
sal_uInt32 nLineFlags = 0x90001;
if ( aPropOpt2.GetOpt( ESCHER_Prop_fNoLineDrawDash, nLineFlags ) )
nLineFlags |= 0x10001; // draw dashed line if no line
@@ -4946,14 +4980,18 @@ void PPTWriter::ImplWritePage( const PHL
*mpStrm << (sal_Int16)maRect.Top() << (sal_Int16)maRect.Left() << (sal_Int16)maRect.Right() << (sal_Int16)maRect.Bottom(); // oben, links, rechts, unten ????
mpPptEscherEx->OpenContainer( ESCHER_ClientData );
mpPptEscherEx->AddAtom( 8, EPP_OEPlaceholderAtom );
+ sal_uInt8 PlaceHolderID = ( mType == "presentation.Subtitle") ? EPP_PLACEHOLDER_MASTERSUBTITLE:EPP_PLACEHOLDER_MASTERBODY;
*mpStrm << (sal_uInt32)1 // PlacementID
- << (sal_uInt8)EPP_PLACEHOLDER_MASTERBODY // PlaceHolderID
+ << PlaceHolderID/*(sal_uInt8)EPP_PLACEHOLDER_MASTERBODY */ // PlaceHolderID
<< (sal_uInt8)0 // Size of PlaceHolder ( 0 = FULL, 1 = HALF, 2 = QUARTER )
<< (sal_uInt16)0; // padword
mpPptEscherEx->CloseContainer(); // ESCHER_ClientData
mpPptEscherEx->OpenContainer( ESCHER_ClientTextbox ); // printf
mpPptEscherEx->AddAtom( 4, EPP_TextHeaderAtom );
- *mpStrm << (sal_uInt32)EPP_TEXTTYPE_Body;
+ if ( mType == "presentation.Subtitle")
+ *mpStrm << (sal_uInt32)EPP_TEXTTYPE_CenterBody;
+ else
+ *mpStrm << (sal_uInt32)EPP_TEXTTYPE_Body;
mnTextSize = aTextObj.Count();
aTextObj.Write( mpStrm );
mpPptEscherEx->BeginAtom();
@@ -4983,7 +5021,7 @@ void PPTWriter::ImplWritePage( const PHL
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0x220, aSolverContainer ); // Flags: HaveAnchor | HaveMaster
aPropOpt.AddOpt( ESCHER_Prop_hspMaster, mnShapeMasterBody );
- aPropOpt.CreateFillProperties( mXPropSet, sal_True );
+ aPropOpt.CreateFillProperties( mXPropSet, sal_True, mXShape );
aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
ImplAdjustFirstLineLineSpacing( aTextObj, aPropOpt );
if ( mbEmptyPresObj )
@@ -5462,8 +5500,10 @@ void PPTWriter::ImplWritePage( const PHL
mnAngle += 0x8000;
mnAngle &=~0xffff; // nAngle auf volle Gradzahl runden
aPropOpt.AddOpt( ESCHER_Prop_Rotation, mnAngle );
- mpPptEscherEx->SetGroupSnapRect( nGroupLevel, maRect );
- mpPptEscherEx->SetGroupLogicRect( nGroupLevel, maRect );
+
+ // #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->SetGroupSnapRect( nGroupLevel, maRect );
+ // mpPptEscherEx->SetGroupLogicRect( nGroupLevel, maRect );
}
if ( !pClientTextBox )
pClientTextBox = new SvMemoryStream( 0x200, 0x200 );
@@ -5485,7 +5525,9 @@ void PPTWriter::ImplWritePage( const PHL
delete pClientTextBox, pClientTextBox = NULL;
mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
- mpPptEscherEx->LeaveGroup();
+
+ // #119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->LeaveGroup();
}
}
ClearGroupTable(); // gruppierungen wegschreiben, sofern noch irgendwelche offen sind, was eigendlich nicht sein sollte
@@ -5706,25 +5748,37 @@ void PPTWriter::ImplCreateTable( uno::Re
ImplCreateShape( ESCHER_ShpInst_Rectangle, 0xa02, aSolverContainer ); // Flags: Connector | HasSpt | Child
aPropOptSp.CreateFillProperties( mXPropSet, sal_True );
aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x90000 );
- aPropOptSp.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
+ aPropOptSp.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
aPropOptSp.AddOpt( ESCHER_Prop_WrapText, ESCHER_WrapSquare );
- SvMemoryStream aClientTextBox( 0x200, 0x200 );
- SvMemoryStream aExtBu( 0x200, 0x200 );
+ SvMemoryStream aClientTextBox( 0x200, 0x200 );
+ SvMemoryStream aExtBu( 0x200, 0x200 );
+
+ ImplWriteTextStyleAtom( aClientTextBox, EPP_TEXTTYPE_Other, 0, NULL, aExtBu, &aPropOptSp );
- ImplWriteTextStyleAtom( aClientTextBox, EPP_TEXTTYPE_Other, 0, NULL, aExtBu, &aPropOptSp );
+ // need write client data for extend bullet
+ if ( aExtBu.Tell() )
+ {
+ SvMemoryStream* pClientData = new SvMemoryStream( 0x200, 0x200 );
+ ImplProgTagContainer( pClientData, &aExtBu );
+ *mpStrm << (sal_uInt32)( ( ESCHER_ClientData << 16 ) | 0xf )
+ << (sal_uInt32)pClientData->Tell();
+
+ mpStrm->Write( pClientData->GetData(), pClientData->Tell() );
+ delete pClientData, pClientData = NULL;
+ }
- aPropOptSp.Commit( *mpStrm );
- mpPptEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
- *mpStrm << nLeft
- << nTop
- << nRight
- << nBottom;
+ aPropOptSp.Commit( *mpStrm );
+ mpPptEscherEx->AddAtom( 16, ESCHER_ChildAnchor );
+ *mpStrm << nLeft
+ << nTop
+ << nRight
+ << nBottom;
- *mpStrm << (sal_uInt32)( ( ESCHER_ClientTextbox << 16 ) | 0xf )
- << (sal_uInt32)aClientTextBox.Tell();
+ *mpStrm << (sal_uInt32)( ( ESCHER_ClientTextbox << 16 ) | 0xf )
+ << (sal_uInt32)aClientTextBox.Tell();
- mpStrm->Write( aClientTextBox.GetData(), aClientTextBox.Tell() );
+ mpStrm->Write( aClientTextBox.GetData(), aClientTextBox.Tell() );
mpPptEscherEx->CloseContainer();
}
}
Modified: incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptanimations.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptanimations.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptanimations.hxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptanimations.hxx Mon Aug 20 11:46:19 2012
@@ -118,7 +118,7 @@ namespace ppt
#define DFF_ANIM_GROUP_ID 19
#define DFF_ANIM_NODE_TYPE 20
#define DFF_ANIM_VOLUME 22
-#define DFF_ANIM_PROPERTY_ID_COUNT DFF_ANIM_VOLUME
+#define DFF_ANIM_PROPERTY_ID_COUNT (DFF_ANIM_VOLUME + 1)
Modified: incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptin.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptin.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptin.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/filter/ppt/pptin.cxx Mon Aug 20 11:46:19 2012
@@ -643,12 +643,13 @@ sal_Bool ImplSdPPTImport::Import()
{
sal_uInt32 nTitleInstance = TSS_TYPE_PAGETITLE;
sal_uInt32 nOutlinerInstance = TSS_TYPE_BODY;
-// sal_Bool bSwapStyleSheet = pSlideLayout->eLayout == PPT_LAYOUT_TITLEMASTERSLIDE;
-// if ( bSwapStyleSheet )
-// {
-// nTitleInstance = TSS_TYPE_TITLE;
-// nOutlinerInstance = TSS_TYPE_SUBTITLE;
-// }
+ const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom();
+ sal_Bool bSwapStyleSheet = pSlideLayout->eLayout == PPT_LAYOUT_TITLEMASTERSLIDE;
+ if ( bSwapStyleSheet )
+ {
+ nTitleInstance = TSS_TYPE_TITLE;
+ nOutlinerInstance = TSS_TYPE_SUBTITLE;
+ }
/////////////////////
// titelstylesheet //
/////////////////////
@@ -2316,7 +2317,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj
{
if ( eAktPageKind == PPT_MASTERPAGE )
{
- sal_Bool bCreatePlaceHolder = ( pTextObj->GetInstance() != TSS_TYPE_SUBTITLE ) && ( pTextObj->GetInstance() != TSS_TYPE_UNUSED );
+ sal_Bool bCreatePlaceHolder = ( pTextObj->GetInstance() != TSS_TYPE_UNUSED );
sal_Bool bIsHeaderFooter = ( ePresKind == PRESOBJ_HEADER) || (ePresKind == PRESOBJ_FOOTER)
|| (ePresKind == PRESOBJ_DATETIME) || (ePresKind == PRESOBJ_SLIDENUMBER);
if ( bCreatePlaceHolder && ( pTextObj->GetInstance() == TSS_TYPE_TEXT_IN_SHAPE ) )
@@ -2348,6 +2349,11 @@ SdrObject* ImplSdPPTImport::ApplyTextObj
rItemSet.Put( (SdrTextLowerDistItem&)pText->GetMergedItem( SDRATTR_TEXT_LOWERDIST ) );
rItemSet.Put( (SdrTextVertAdjustItem&)pText->GetMergedItem( SDRATTR_TEXT_VERTADJUST ) );
rItemSet.Put( (SdrTextHorzAdjustItem&)pText->GetMergedItem( SDRATTR_TEXT_HORZADJUST ) );
+ if ( pTextObj->GetInstance() == TSS_TYPE_TITLE
+ || pTextObj->GetInstance() == TSS_TYPE_SUBTITLE)
+ {
+ rItemSet.Put( pText->GetMergedItemSet() );
+ }
}
pText->NbcSetStyleSheet( pSheet2, sal_False );
}
@@ -2386,7 +2392,10 @@ SdrObject* ImplSdPPTImport::ApplyTextObj
sal_Bool bVertical = sal_False;
if ( ( pTextObj->GetShapeType() == mso_sptRectangle ) || ( pTextObj->GetShapeType() == mso_sptTextBox ) )
{
- if ( pTextObj->Count() )
+ //if a placeholder with some custom attribute,the pTextObj will keep those attr,whose text size is zero,
+ //so sdPage should renew a PresObj to process placeholder.
+ if ( pTextObj->Count() > 1 ||
+ ( pTextObj->Count() == 1 &&(pTextObj->First()) && pTextObj->First()->GetTextSize()>0 ))
bEmptyPresObj = sal_False;
switch ( nPlaceholderId )
{
@@ -2444,8 +2453,20 @@ SdrObject* ImplSdPPTImport::ApplyTextObj
SdrObject* pPresObj = pPage->CreatePresObj( ePresObjKind, bVertical, pText->GetLogicRect(), sal_True );
pPresObj->SetUserCall( pPage );
- SfxItemSet aSet( pSdrModel->GetItemPool() );
- ApplyAttributes( rStCtrl, aSet );
+ SfxItemSet aSet( pSdrModel->GetItemPool() );
+ ApplyAttributes( rStCtrl, aSet );
+ pPresObj->SetLogicRect(pText->GetLogicRect());
+ ApplyTextAnchorAttributes( *pTextObj, aSet );
+ //set custom font attribute of the placeholder
+ if ( pTextObj->Count() == 1 )
+ {
+ PPTParagraphObj* pPara = pTextObj->First();
+ PPTPortionObj* pPor = NULL;
+ if ( pPara && pPara->GetTextSize() == 0 && (pPor = pPara->First()))
+ {
+ pPor->ApplyTo(aSet, (SdrPowerPointImport&)*this, pTextObj->GetDestinationInstance());
+ }
+ }
pPresObj->SetMergedItemSet(aSet);
if ( ( eAktPageKind != PPT_NOTEPAGE ) && ( pSlideLayout->aPlacementId[ i ] != (sal_uLong)-1 ) )
Modified: incubator/ooo/branches/writer001/main/sd/source/ui/docshell/docshel4.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/docshell/docshel4.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/docshell/docshel4.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/docshell/docshel4.cxx Mon Aug 20 11:46:19 2012
@@ -946,8 +946,17 @@ sal_Bool DrawDocShell::SaveAsOwnFormat(
if( aLayoutName.Len() )
{
- String aOldPageLayoutName = mpDoc->GetSdPage(0, PK_STANDARD)->GetLayoutName();
- mpDoc->RenameLayoutTemplate(aOldPageLayoutName, aLayoutName);
+ sal_uInt32 nCount = mpDoc->GetMasterSdPageCount(PK_STANDARD);
+ for(sal_uInt32 i = 0; i < nCount; i++)
+ {
+ String aOldPageLayoutName = mpDoc->GetMasterSdPage(i, PK_STANDARD)->GetLayoutName();
+ String aNewLayoutName = aLayoutName;
+ // Don't add suffix for the first master page
+ if( i > 0 )
+ aNewLayoutName += String::CreateFromInt32(i);
+
+ mpDoc->RenameLayoutTemplate(aOldPageLayoutName, aNewLayoutName);
+ }
}
}
Modified: incubator/ooo/branches/writer001/main/sd/source/ui/slideshow/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/slideshow/makefile.mk?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/slideshow/makefile.mk (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/slideshow/makefile.mk Mon Aug 20 11:46:19 2012
@@ -35,10 +35,6 @@ AUTOSEG=true
.INCLUDE : settings.mk
.INCLUDE : $(PRJ)$/util$/makefile.pmk
-.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES"
-ENABLE_PRESENTER_EXTRA_UI is not used anymore
-.ENDIF
-
# --- Files --------------------------------------------------------
Modified: incubator/ooo/branches/writer001/main/sd/source/ui/slideshow/slideshow.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/slideshow/slideshow.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/slideshow/slideshow.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/slideshow/slideshow.cxx Mon Aug 20 11:46:19 2012
@@ -731,6 +731,13 @@ void SAL_CALL SlideShow::end() throw(Run
ViewShellBase* pFullScreenViewShellBase = mpFullScreenViewShellBase;
mpFullScreenViewShellBase = 0;
+ // Dispose the controller before calling StartPresentation()
+ // on the work window to prevent a crash that is triggered
+ // only by the cairo canvas: the work window is shutting down
+ // presentation mode. Find details in issue When later asked for information the
+ // gtk system functions report an error and we crash.
+ xController->dispose();
+
if( pFullScreenViewShellBase )
{
PresentationViewShell* pShell = dynamic_cast<PresentationViewShell*>(pFullScreenViewShellBase->GetMainViewShell().get());
@@ -745,8 +752,6 @@ void SAL_CALL SlideShow::end() throw(Run
}
}
- xController->dispose();
-
if( pFullScreenViewShellBase )
{
PresentationViewShell* pShell = NULL;
Modified: incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/inc/view/SlsPageObjectPainter.hxx Mon Aug 20 11:46:19 2012
@@ -129,6 +129,12 @@ private:
const BitmapEx& rOverlay,
const OutputDevice* pReferenceDevice) const;
void InvalidateBitmaps (void);
+
+ /** Update the local pointer to the page object layouter to the
+ one owned by the general layouter.
+ Return <TRUE/> when after the call we have a valid page object layouter.
+ */
+ bool UpdatePageObjectLayouter (void);
};
} } } // end of namespace sd::slidesorter::view
Modified: incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx Mon Aug 20 11:46:19 2012
@@ -135,27 +135,38 @@ void PageObjectPainter::PaintPageObject
OutputDevice& rDevice,
const model::SharedPageDescriptor& rpDescriptor)
{
+ if (UpdatePageObjectLayouter())
+ {
+ // Turn off antialiasing to avoid the bitmaps from being
+ // shifted by fractions of a pixel and thus show blurry edges.
+ const sal_uInt16 nSavedAntialiasingMode (rDevice.GetAntialiasing());
+ rDevice.SetAntialiasing(nSavedAntialiasingMode & ~ANTIALIASING_ENABLE_B2DDRAW);
+
+ PaintBackground(rDevice, rpDescriptor);
+ PaintPreview(rDevice, rpDescriptor);
+ PaintPageNumber(rDevice, rpDescriptor);
+ PaintTransitionEffect(rDevice, rpDescriptor);
+ mrButtonBar.Paint(rDevice, rpDescriptor);
+
+ rDevice.SetAntialiasing(nSavedAntialiasingMode);
+ }
+}
+
+
+
+
+bool PageObjectPainter::UpdatePageObjectLayouter (void)
+{
// The page object layouter is quite volatile. It may have been replaced
// since the last call. Update it now.
mpPageObjectLayouter = mrLayouter.GetPageObjectLayouter();
if ( ! mpPageObjectLayouter)
{
OSL_ASSERT(mpPageObjectLayouter);
- return;
+ return false;
}
-
- // Turn off antialiasing to avoid the bitmaps from being shifted by
- // fractions of a pixel and thus show blurry edges.
- const sal_uInt16 nSavedAntialiasingMode (rDevice.GetAntialiasing());
- rDevice.SetAntialiasing(nSavedAntialiasingMode & ~ANTIALIASING_ENABLE_B2DDRAW);
-
- PaintBackground(rDevice, rpDescriptor);
- PaintPreview(rDevice, rpDescriptor);
- PaintPageNumber(rDevice, rpDescriptor);
- PaintTransitionEffect(rDevice, rpDescriptor);
- mrButtonBar.Paint(rDevice, rpDescriptor);
-
- rDevice.SetAntialiasing(nSavedAntialiasingMode);
+ else
+ return true;
}
@@ -165,7 +176,7 @@ void PageObjectPainter::NotifyResize (co
{
if (bForce || ! mpPageObjectLayouter)
InvalidateBitmaps();
- else
+ else if (UpdatePageObjectLayouter())
{
const Size aSize (mpPageObjectLayouter->GetSize(
PageObjectLayouter::FocusIndicator,
Modified: incubator/ooo/branches/writer001/main/sd/source/ui/view/drawview.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/view/drawview.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/view/drawview.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/view/drawview.cxx Mon Aug 20 11:46:19 2012
@@ -623,7 +623,14 @@ void DrawView::DeleteMarked()
Rectangle aRect( pObj->GetLogicRect() );
SdrObject* pNewObj = pPage->InsertAutoLayoutShape( 0, ePresObjKind, bVertical, aRect, true );
- pPage->SetObjectOrdNum( pNewObj->GetOrdNum(), pObj->GetOrdNum() );
+ // Move the new PresObj to the position before the
+ // object it will replace.
+ pUndoManager->AddUndoAction(
+ mpDoc->GetSdrUndoFactory().CreateUndoObjectOrdNum(
+ *pNewObj,
+ pNewObj->GetOrdNum(),
+ pObj->GetOrdNum()));
+ pPage->SetObjectOrdNum( pNewObj->GetOrdNum(), pObj->GetOrdNum() );
bResetLayout = true;
Modified: incubator/ooo/branches/writer001/main/sd/source/ui/view/drviews2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/view/drviews2.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/view/drviews2.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/view/drviews2.cxx Mon Aug 20 11:46:19 2012
@@ -155,8 +155,8 @@ void DrawViewShell::FuTemporary(SfxReque
SdrObject* pObj = NULL;
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
sal_uLong nCount = rMarkList.GetMarkCount();
-
- sal_Int32 nNewLineWidth = ((const XLineWidthItem&)rReq.GetArgs()->Get(XATTR_LINEWIDTH)).GetValue();
+ const sal_Int32 nNewLineWidth(((const XLineWidthItem&)rReq.GetArgs()->Get(XATTR_LINEWIDTH)).GetValue());
+ const bool bUndo(mpDrawView->IsUndoEnabled());
for (sal_uLong i=0; i<nCount; i++)
{
@@ -193,9 +193,28 @@ void DrawViewShell::FuTemporary(SfxReque
}
if(bSetItemSet)
- pObj->SetMergedItemSet(aAttr);
+ {
+ if(bUndo)
+ {
+ if(!bMergeUndo)
+ {
+ pUndoManager->EnterListAction( String(), String() );
+ mpDrawView->BegUndo();
+ bMergeUndo = sal_True;
+ }
+
+ mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
+ }
+
+ pObj->SetMergedItemSet(aAttr);
+ }
}
}
+
+ if(bMergeUndo)
+ {
+ mpDrawView->EndUndo();
+ }
}
if (nSId == SID_ATTR_FILL_SHADOW)
@@ -204,7 +223,6 @@ void DrawViewShell::FuTemporary(SfxReque
SdrObject* pObj = NULL;
const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
sal_uLong nCount = rMarkList.GetMarkCount();
-
const bool bUndo = mpDrawView->IsUndoEnabled();
for (sal_uLong i=0; i<nCount; i++)
@@ -217,10 +235,10 @@ void DrawViewShell::FuTemporary(SfxReque
{
aAttr.Put(pObj->GetMergedItemSet());
- const XFillStyleItem& rFillStyle =
- (const XFillStyleItem&) aAttr.Get(XATTR_FILLSTYLE);
+ const XFillStyleItem& rFillStyle = (const XFillStyleItem&) aAttr.Get(XATTR_FILLSTYLE);
+ const XLineStyleItem& rLineStyle = (const XLineStyleItem&) aAttr.Get(XATTR_LINESTYLE);
- if (rFillStyle.GetValue() == XFILL_NONE)
+ if(XFILL_NONE == rFillStyle.GetValue() && XLINE_NONE == rLineStyle.GetValue())
{
if( bUndo )
{
Modified: incubator/ooo/branches/writer001/main/sd/source/ui/view/drviewse.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sd/source/ui/view/drviewse.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sd/source/ui/view/drviewse.cxx (original)
+++ incubator/ooo/branches/writer001/main/sd/source/ui/view/drviewse.cxx Mon Aug 20 11:46:19 2012
@@ -639,10 +639,6 @@ void DrawViewShell::FuPermanent(SfxReque
}
}
-//////////////////////////////////////////////////////////////////////////////
-// service routine for Undo/Redo implementation
-extern SfxUndoManager* ImpGetUndoManagerFromViewShell(DrawViewShell& rDViewShell);
-
/*************************************************************************
|*
|* SfxRequests fuer Support-Funktionen
Modified: incubator/ooo/branches/writer001/main/set_soenv.in
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/set_soenv.in?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/set_soenv.in (original)
+++ incubator/ooo/branches/writer001/main/set_soenv.in Mon Aug 20 11:46:19 2012
@@ -1688,7 +1688,6 @@ ToFile( "ENABLE_CAIRO", "@ENABLE_CA
ToFile( "ENABLE_CAIRO_CANVAS", "@ENABLE_CAIRO_CANVAS@", "e" );
ToFile( "ENABLE_OPENGL", "@ENABLE_OPENGL@", "e" );
ToFile( "ENABLE_PDFIMPORT", "@ENABLE_PDFIMPORT@", "e" );
-ToFile( "ENABLE_PRESENTER_EXTRA_UI","@ENABLE_PRESENTER_EXTRA_UI@","e" );
ToFile( "ENABLE_MINIMIZER", "@ENABLE_MINIMIZER@","e" );
ToFile( "ENABLE_PRESENTER_SCREEN","@ENABLE_PRESENTER_SCREEN@","e" );
ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" );
@@ -1985,7 +1984,19 @@ ToFile( "SYSTEM_SAXON", "@SYSTEM_SA
ToFile( "SAXON_JAR", "@SAXON_JAR@", "e" );
ToFile( "DISABLE_SAXON", "@DISABLE_SAXON@", "e" );
ToFile( "ENABLE_JAVASCRIPT", "@ENABLE_JAVASCRIPT@","e" );
+ToFile( "SYSTEM_APR", "@SYSTEM_APR@", "e" );
+ToFile( "APR_CFLAGS", "@APR_CFLAGS@", "e" );
+ToFile( "APR_LIBS", "@APR_LIBS@", "e" );
+ToFile( "SYSTEM_APR_UTIL", "@SYSTEM_APR_UTIL@", "e" );
+ToFile( "APR_UTIL_CFLAGS", "@APR_UTIL_CFLAGS@", "e" );
+ToFile( "APR_UTIL_LIBS", "@APR_UTIL_LIBS@", "e" );
+ToFile( "SYSTEM_SERF", "@SYSTEM_SERF@", "e" );
+ToFile( "SERF_CFLAGS", "@SERF_CFLAGS@", "e" );
+ToFile( "SERF_LIBS", "@SERF_LIBS@", "e" );
+ToFile( "SYSTEM_COINMP", "@SYSTEM_COINMP@", "e" );
ToFile( "ENABLE_COINMP", "@ENABLE_COINMP@", "e" );
+ToFile( "COINMP_CFLAGS", "@COINMP_CFLAGS@", "e" );
+ToFile( "COINMP_LIBS", "@COINMP_LIBS@", "e" );
ToFile( "SYSTEM_ODBC_HEADERS","@SYSTEM_ODBC_HEADERS@","e" );
ToFile( "SYSTEM_LIBXSLT", "@SYSTEM_LIBXSLT@", "e" );
ToFile( "LIBXSLT_CFLAGS", "@LIBXSLT_CFLAGS@", "e" );
Modified: incubator/ooo/branches/writer001/main/sfx2/source/appl/appserv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/appl/appserv.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/appl/appserv.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/appl/appserv.cxx Mon Aug 20 11:46:19 2012
@@ -338,15 +338,20 @@ void SfxApplication::MiscExec_Impl( SfxR
if ( rReq.GetSlot() == SID_HELP_SUPPORTPAGE )
{
// show Support page with new URL
- String sHelpURL = SfxHelp::CreateHelpURL( String::CreateFromAscii(".uno:HelpSupport"), String() );
- String sParams = sHelpURL.Copy( sHelpURL.Search( '?' ) );
- sHelpURL = String::CreateFromAscii("vnd.sun.star.help://shared/text/shared/05/00000001.xhp");
- sHelpURL += sParams;
- sHelpURL += String::CreateFromAscii("&UseDB=no");
- pHelp->Start( sHelpURL, NULL );
+ // Create a dummy Help URL to get the Language and System
+ // but don't use a real command, otherwise we may get an anchor
+ rtl::OUString sEmpty;
+ rtl::OUString sTmp( SfxHelp::CreateHelpURL( sEmpty, sEmpty ) );
+
+ rtl::OUStringBuffer aBuff;
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( "vnd.sun.star.help://shared/text/shared/05/00000001.xhp" ) );
+ aBuff.append( sTmp.copy( sTmp.indexOf( sal_Unicode( '?' ) ) ) );
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( "&UseDB=no" ) );
+
+ pHelp->Start( aBuff.makeStringAndClear(), NULL );
}
else
- pHelp->Start( String::CreateFromAscii(".uno:HelpIndex"), NULL ); // show start page
+ pHelp->Start( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:HelpIndex")), NULL ); // show start page
bDone = sal_True;
}
break;
Modified: incubator/ooo/branches/writer001/main/sfx2/source/appl/newhelp.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/appl/newhelp.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/appl/newhelp.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/appl/newhelp.cxx Mon Aug 20 11:46:19 2012
@@ -3173,7 +3173,7 @@ void SfxHelpWindow_Impl::openDone(const
Reference < XPropertySet > xViewProps = xSettings->getViewSettings();
Reference< XPropertySetInfo > xInfo = xViewProps->getPropertySetInfo();
Any aBoolAny = makeAny( sal_Bool( sal_True ) );
- xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("PreventHelpTips"), aBoolAny );
+ xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowContentTips"), makeAny( sal_Bool( sal_False ) ) );
xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowGraphics"), aBoolAny );
xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowTables"), aBoolAny );
xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("HelpURL"), makeAny( DEFINE_CONST_OUSTRING("HID:SFX2_HID_HELP_ONHELP") ) );
Modified: incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdownicon.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdownicon.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdownicon.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdownicon.cxx Mon Aug 20 11:46:19 2012
@@ -190,6 +190,15 @@ bool ShutdownIcon::LoadModule( osl::Modu
return true;
}
+
+struct AsyncDesktopTerminationData
+{
+ Reference< XDesktop > mxDesktop;
+ AsyncDesktopTerminationData( const Reference< XDesktop > &xDesktop )
+ : mxDesktop( xDesktop ) {}
+};
+
+
class IdleUnloader : Timer
{
::osl::Module *m_pModule;
@@ -584,10 +593,11 @@ void ShutdownIcon::terminateDesktop()
if ( xSupplier.is() )
{
Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
- if( xTasks.is() )
+ if( xTasks.is() && xTasks->getCount() < 1 )
{
- if( xTasks->getCount() < 1 )
- xDesktop->terminate();
+ AsyncDesktopTerminationData * pData = new AsyncDesktopTerminationData( xDesktop );
+ if ( !Application::PostUserEvent( STATIC_LINK( 0, ShutdownIcon, AsyncDesktopTermination ), pData ) )
+ delete pData;
}
}
@@ -595,6 +605,17 @@ void ShutdownIcon::terminateDesktop()
ShutdownIcon::pShutdownIcon = 0;
}
+
+IMPL_STATIC_LINK_NOINSTANCE( ShutdownIcon, AsyncDesktopTermination, AsyncDesktopTerminationData*, pData )
+{
+ if ( pData && pData->mxDesktop.is() )
+ pData->mxDesktop->terminate();
+ delete pData;
+ return 0;
+}
+
+
+
// ---------------------------------------------------------------------------
ShutdownIcon* ShutdownIcon::getInstance()
Modified: incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdownicon.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdownicon.hxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdownicon.hxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdownicon.hxx Mon Aug 20 11:46:19 2012
@@ -44,7 +44,9 @@
#include <sfx2/sfxuno.hxx>
#include <cppuhelper/compbase4.hxx>
#include <sfx2/dllapi.h>
+#include <tools/link.hxx>
+struct AsyncDesktopTerminationData;
class ResMgr;
namespace sfx2
{
@@ -102,6 +104,8 @@ class SFX2_DLLPUBLIC ShutdownIcon : publ
virtual ~ShutdownIcon();
+ DECL_STATIC_LINK( ShutdownIcon, AsyncDesktopTermination, AsyncDesktopTerminationData* );
+
SFX_DECL_XSERVICEINFO
static ShutdownIcon* getInstance();
Modified: incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdowniconOs2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdowniconOs2.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdowniconOs2.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdowniconOs2.cxx Mon Aug 20 11:46:19 2012
@@ -45,7 +45,7 @@ using namespace ::osl;
//
// This ObjectID must match the one created in WarpIN scripts!!
//
-#define QUICKSTART_OBJID "OO2_QUICKSTART"
+#define QUICKSTART_OBJID "AOO_QUICKSTART"
bool ShutdownIcon::IsQuickstarterInstalled()
{
Modified: incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdowniconunx.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdowniconunx.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdowniconunx.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/appl/shutdowniconunx.cxx Mon Aug 20 11:46:19 2012
@@ -87,8 +87,8 @@ static void systray_disable_cb()
static void exit_quickstarter_cb( GtkWidget * )
{
- ShutdownIcon::getInstance()->terminateDesktop();
plugin_shutdown_sys_tray();
+ ShutdownIcon::getInstance()->terminateDesktop();
}
static void menu_deactivate_cb( GtkWidget *pMenu )
Modified: incubator/ooo/branches/writer001/main/sfx2/source/doc/docvor.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/doc/docvor.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/doc/docvor.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/doc/docvor.cxx Mon Aug 20 11:46:19 2012
@@ -746,7 +746,7 @@ sal_Bool SfxOrganizeListBox_Impl::MoveOr
pChildIter = NextSibling(pChildIter);
// gfs Fuellen bei Items onDemand
++i;
- if(p[i+1] != INDEX_IGNORE &&
+ if((i < 2) && p[i+1] != INDEX_IGNORE &&
pChildIter->HasChildsOnDemand() &&
!GetModel()->HasChilds(pChildIter))
RequestingChilds(pChildIter);
Modified: incubator/ooo/branches/writer001/main/sfx2/source/doc/new.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/doc/new.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/doc/new.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/doc/new.cxx Mon Aug 20 11:46:19 2012
@@ -450,8 +450,8 @@ IMPL_LINK( SfxNewFileDialog_Impl, Templa
if ( !MORE_BTN(GetState()) )
// Dialog nicht aufgeklappt
return 0;
-
- aPrevTimer.Start();
+ if ( aPreviewBtn.IsChecked() )
+ aPrevTimer.Start();
return 0;
}
@@ -628,6 +628,7 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_
MORE_BTN(AddWindow(&aPreviewBtn));
MORE_BTN(AddWindow(&aPreviewWin));
aPreviewBtn.SetClickHdl(LINK(this, SfxNewFileDialog_Impl, PreviewClick));
+ aTemplateLb.SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, TemplateSelect));
}
else
{
Modified: incubator/ooo/branches/writer001/main/sfx2/source/doc/objcont.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/doc/objcont.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/doc/objcont.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/doc/objcont.cxx Mon Aug 20 11:46:19 2012
@@ -759,8 +759,7 @@ sal_Bool SfxObjectShell::Print
{
SfxStyleSheetBasePool *pStylePool = GetStyleSheetPool();
SetOrganizerSearchMask(pStylePool);
- SfxStyleSheetIterator* pIter = pStylePool->CreateIterator(
- pStylePool->GetSearchFamily(), pStylePool->GetSearchMask() );
+ SfxStyleSheetIteratorPtr pIter = pStylePool->CreateIterator( pStylePool->GetSearchFamily(), pStylePool->GetSearchMask() );
sal_uInt16 nStyles = pIter->Count();
SfxStyleSheetBase *pStyle = pIter->First();
if ( !pStyle )
@@ -869,7 +868,6 @@ sal_Bool SfxObjectShell::Print
Printer::PrintJob( pController, rPrt.GetJobSetup() );
- delete pIter;
break;
}
default:
Modified: incubator/ooo/branches/writer001/main/sfx2/source/doc/objstor.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/writer001/main/sfx2/source/doc/objstor.cxx?rev=1374979&r1=1374978&r2=1374979&view=diff
==============================================================================
--- incubator/ooo/branches/writer001/main/sfx2/source/doc/objstor.cxx (original)
+++ incubator/ooo/branches/writer001/main/sfx2/source/doc/objstor.cxx Mon Aug 20 11:46:19 2012
@@ -2919,6 +2919,9 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Imp
// in "SaveAs" title and password will be cleared ( maybe the new itemset contains new values, otherwise they will be empty )
pMergedParams->ClearItem( SID_PASSWORD );
+ // 119366 - As the SID_ENCRYPTIONDATA and SID_PASSWORD are using for setting passward together, we need to clear them both.
+ // Also, ( maybe the new itemset contains new values, otherwise they will be empty )
+ pMergedParams->ClearItem( SID_ENCRYPTIONDATA );
pMergedParams->ClearItem( SID_DOCINFO_TITLE );
pMergedParams->ClearItem( SID_INPUTSTREAM );