doctemplates.cxx (d119d52d) doctemplates.cxx (940681c7)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

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

996 sal_Bool bPropertySet = sal_False;
997
998 // Store the property
999 try
1000 {
1001 Any aPropValue( rPropValue );
1002 uno::Reference< XPropertySetInfo > aPropInfo = rContent.getProperties();
1003
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

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

996 sal_Bool bPropertySet = sal_False;
997
998 // Store the property
999 try
1000 {
1001 Any aPropValue( rPropValue );
1002 uno::Reference< XPropertySetInfo > aPropInfo = rContent.getProperties();
1003
1004 // check, wether or not the property exists, create it, when not
1004 // check, whether or not the property exists, create it, when not
1005 if ( !aPropInfo.is() || !aPropInfo->hasPropertyByName( rPropName ) )
1006 {
1007 uno::Reference< XPropertyContainer > xProperties( rContent.get(), UNO_QUERY );
1008 if ( xProperties.is() )
1009 {
1010 try
1011 {
1012 xProperties->addProperty( rPropName, PropertyAttribute::MAYBEVOID, rPropValue );

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

1063{
1064 sal_Bool bGotProperty = sal_False;
1065
1066 // Get the property
1067 try
1068 {
1069 uno::Reference< XPropertySetInfo > aPropInfo = rContent.getProperties();
1070
1005 if ( !aPropInfo.is() || !aPropInfo->hasPropertyByName( rPropName ) )
1006 {
1007 uno::Reference< XPropertyContainer > xProperties( rContent.get(), UNO_QUERY );
1008 if ( xProperties.is() )
1009 {
1010 try
1011 {
1012 xProperties->addProperty( rPropName, PropertyAttribute::MAYBEVOID, rPropValue );

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

1063{
1064 sal_Bool bGotProperty = sal_False;
1065
1066 // Get the property
1067 try
1068 {
1069 uno::Reference< XPropertySetInfo > aPropInfo = rContent.getProperties();
1070
1071 // check, wether or not the property exists
1071 // check, whether or not the property exists
1072 if ( !aPropInfo.is() || !aPropInfo->hasPropertyByName( rPropName ) )
1073 {
1074 return sal_False;
1075 }
1076
1077 // now get the property
1078
1079 rPropValue = rContent.getPropertyValue( rPropName );

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

1467 return aResultURL;
1468}
1469
1470//-----------------------------------------------------------------------------
1471sal_Bool SfxDocTplService_Impl::addGroup( const OUString& rGroupName )
1472{
1473 ::osl::MutexGuard aGuard( maMutex );
1474
1072 if ( !aPropInfo.is() || !aPropInfo->hasPropertyByName( rPropName ) )
1073 {
1074 return sal_False;
1075 }
1076
1077 // now get the property
1078
1079 rPropValue = rContent.getPropertyValue( rPropName );

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

1467 return aResultURL;
1468}
1469
1470//-----------------------------------------------------------------------------
1471sal_Bool SfxDocTplService_Impl::addGroup( const OUString& rGroupName )
1472{
1473 ::osl::MutexGuard aGuard( maMutex );
1474
1475 // Check, wether or not there is a group with this name
1475 // Check, whether or not there is a group with this name
1476 Content aNewGroup;
1477 OUString aNewGroupURL;
1478 INetURLObject aNewGroupObj( maRootURL );
1479
1480 aNewGroupObj.insertName( rGroupName, false,
1481 INetURLObject::LAST_SEGMENT, true,
1482 INetURLObject::ENCODE_ALL );
1483

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

1761
1762//-----------------------------------------------------------------------------
1763sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
1764 const OUString& rTemplateName,
1765 const uno::Reference< XSTORABLE >& rStorable )
1766{
1767 ::osl::MutexGuard aGuard( maMutex );
1768
1476 Content aNewGroup;
1477 OUString aNewGroupURL;
1478 INetURLObject aNewGroupObj( maRootURL );
1479
1480 aNewGroupObj.insertName( rGroupName, false,
1481 INetURLObject::LAST_SEGMENT, true,
1482 INetURLObject::ENCODE_ALL );
1483

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

1761
1762//-----------------------------------------------------------------------------
1763sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
1764 const OUString& rTemplateName,
1765 const uno::Reference< XSTORABLE >& rStorable )
1766{
1767 ::osl::MutexGuard aGuard( maMutex );
1768
1769 // Check, wether or not there is a group with this name
1769 // Check, whether or not there is a group with this name
1770 // Return false, if there is no group with the given name
1771 Content aGroup, aTemplate, aTargetGroup, aTemplateToRemove;
1772 OUString aGroupURL, aTemplateURL, aTemplateToRemoveTargetURL;
1773 INetURLObject aGroupObj( maRootURL );
1774 sal_Bool bRemoveOldTemplateContent = sal_False;
1775 ::rtl::OUString sDocServiceName;
1776
1777 aGroupObj.insertName( rGroupName, false,

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

1953
1954//-----------------------------------------------------------------------------
1955sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
1956 const OUString& rTemplateName,
1957 const OUString& rSourceURL )
1958{
1959 ::osl::MutexGuard aGuard( maMutex );
1960
1770 // Return false, if there is no group with the given name
1771 Content aGroup, aTemplate, aTargetGroup, aTemplateToRemove;
1772 OUString aGroupURL, aTemplateURL, aTemplateToRemoveTargetURL;
1773 INetURLObject aGroupObj( maRootURL );
1774 sal_Bool bRemoveOldTemplateContent = sal_False;
1775 ::rtl::OUString sDocServiceName;
1776
1777 aGroupObj.insertName( rGroupName, false,

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

1953
1954//-----------------------------------------------------------------------------
1955sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
1956 const OUString& rTemplateName,
1957 const OUString& rSourceURL )
1958{
1959 ::osl::MutexGuard aGuard( maMutex );
1960
1961 // Check, wether or not there is a group with this name
1961 // Check, whether or not there is a group with this name
1962 // Return false, if there is no group with the given name
1963 Content aGroup, aTemplate, aTargetGroup;
1964 OUString aGroupURL, aTemplateURL;
1965 INetURLObject aGroupObj( maRootURL );
1966
1967 aGroupObj.insertName( rGroupName, false,
1968 INetURLObject::LAST_SEGMENT, true,
1969 INetURLObject::ENCODE_ALL );

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

2105}
2106
2107//-----------------------------------------------------------------------------
2108sal_Bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName,
2109 const OUString& rTemplateName )
2110{
2111 ::osl::MutexGuard aGuard( maMutex );
2112
1962 // Return false, if there is no group with the given name
1963 Content aGroup, aTemplate, aTargetGroup;
1964 OUString aGroupURL, aTemplateURL;
1965 INetURLObject aGroupObj( maRootURL );
1966
1967 aGroupObj.insertName( rGroupName, false,
1968 INetURLObject::LAST_SEGMENT, true,
1969 INetURLObject::ENCODE_ALL );

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

2105}
2106
2107//-----------------------------------------------------------------------------
2108sal_Bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName,
2109 const OUString& rTemplateName )
2110{
2111 ::osl::MutexGuard aGuard( maMutex );
2112
2113 // Check, wether or not there is a group with this name
2113 // Check, whether or not there is a group with this name
2114 // Return false, if there is no group with the given name
2115 Content aGroup, aTemplate;
2116 OUString aGroupURL, aTemplateURL;
2117 INetURLObject aGroupObj( maRootURL );
2118
2119 aGroupObj.insertName( rGroupName, false,
2120 INetURLObject::LAST_SEGMENT, true,
2121 INetURLObject::ENCODE_ALL );

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

2158
2159//-----------------------------------------------------------------------------
2160sal_Bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName,
2161 const OUString& rOldName,
2162 const OUString& rNewName )
2163{
2164 ::osl::MutexGuard aGuard( maMutex );
2165
2114 // Return false, if there is no group with the given name
2115 Content aGroup, aTemplate;
2116 OUString aGroupURL, aTemplateURL;
2117 INetURLObject aGroupObj( maRootURL );
2118
2119 aGroupObj.insertName( rGroupName, false,
2120 INetURLObject::LAST_SEGMENT, true,
2121 INetURLObject::ENCODE_ALL );

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

2158
2159//-----------------------------------------------------------------------------
2160sal_Bool SfxDocTplService_Impl::renameTemplate( const OUString& rGroupName,
2161 const OUString& rOldName,
2162 const OUString& rNewName )
2163{
2164 ::osl::MutexGuard aGuard( maMutex );
2165
2166 // Check, wether or not there is a group with this name
2166 // Check, whether or not there is a group with this name
2167 // Return false, if there is no group with the given name
2168 Content aGroup, aTemplate;
2169 OUString aGroupURL, aTemplateURL;
2170 INetURLObject aGroupObj( maRootURL );
2171
2172 aGroupObj.insertName( rGroupName, false,
2173 INetURLObject::LAST_SEGMENT, true,
2174 INetURLObject::ENCODE_ALL );

--- 746 unchanged lines hidden ---
2167 // Return false, if there is no group with the given name
2168 Content aGroup, aTemplate;
2169 OUString aGroupURL, aTemplateURL;
2170 INetURLObject aGroupObj( maRootURL );
2171
2172 aGroupObj.insertName( rGroupName, false,
2173 INetURLObject::LAST_SEGMENT, true,
2174 INetURLObject::ENCODE_ALL );

--- 746 unchanged lines hidden ---