tdf#123936 Formatting files in module forms with clang-format

Change-Id: I230375bd002147642db37728fa0287b6a554e330
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105670
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Philipp Hofer
2020-11-12 12:57:37 +01:00
committed by Christian Lohmaier
parent 32b57a159e
commit 951764106e
14 changed files with 75 additions and 113 deletions

View File

@@ -22,17 +22,12 @@
#include <sal/types.h>
namespace frm
{
const sal_uInt16 ENTRY_NOT_FOUND = 0xFFFF;
const sal_uInt16 BOUNDCOLUMN = 0x0001;
}
#endif // INCLUDED_FORMS_SOURCE_COMPONENT_BASELISTBOX_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -24,13 +24,9 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <sal/types.h>
namespace detail {
sal_Int32 findPos(
const OUString& aStr,
const css::uno::Sequence< OUString >& rList);
namespace detail
{
sal_Int32 findPos(const OUString& aStr, const css::uno::Sequence<OUString>& rList);
}
#endif

View File

@@ -17,34 +17,29 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "boolexpression.hxx"
namespace xforms
{
/** BoolExpression represents a computed XPath expression that returns
* a bool value and caches the results.
*
* As this class has no virtual methods, it should never be used
* polymorphically. */
BoolExpression::BoolExpression() : ComputedExpression()
BoolExpression::BoolExpression()
: ComputedExpression()
{
}
BoolExpression::~BoolExpression()
{
}
BoolExpression::~BoolExpression() {}
void BoolExpression::setExpression( const OUString& rExpression )
void BoolExpression::setExpression(const OUString& rExpression)
{
ComputedExpression::setExpression( rExpression );
mbIsSimple = _checkExpression( " *(true)|(false) *\\( *\\) *" );
ComputedExpression::setExpression(rExpression);
mbIsSimple = _checkExpression(" *(true)|(false) *\\( *\\) *");
}
} // namespace xforms
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "enumeration.hxx"
#include <osl/diagnose.h>
@@ -32,17 +31,16 @@ using com::sun::star::container::XIndexAccess;
using com::sun::star::uno::Any;
using com::sun::star::uno::RuntimeException;
Enumeration::Enumeration( XIndexAccess* pContainer )
: mxContainer( pContainer ),
mnIndex( 0 )
Enumeration::Enumeration(XIndexAccess* pContainer)
: mxContainer(pContainer)
, mnIndex(0)
{
OSL_ENSURE( mxContainer.is(), "no container?" );
OSL_ENSURE(mxContainer.is(), "no container?");
}
sal_Bool Enumeration::hasMoreElements()
{
if( ! mxContainer.is() )
if (!mxContainer.is())
throw RuntimeException();
return mnIndex < mxContainer->getCount();
@@ -50,12 +48,12 @@ sal_Bool Enumeration::hasMoreElements()
Any Enumeration::nextElement()
{
if( ! mxContainer.is() )
if (!mxContainer.is())
throw RuntimeException();
if( mnIndex >= mxContainer->getCount() )
if (mnIndex >= mxContainer->getCount())
throw NoSuchElementException();
return mxContainer->getByIndex( mnIndex++ );
return mxContainer->getByIndex(mnIndex++);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -24,7 +24,6 @@
namespace xforms
{
/** represents the XForms *m*odel *i*tem *p*roperties (MIPs) for a
* given XNode in the instance data at a given point in time. The
* values will not be updated; for updated values new MIP objects have
@@ -54,51 +53,49 @@ public:
MIP();
/// inherit from upper-level MIPs
void inherit( const MIP& );
void inherit(const MIP&);
/// join with same-level MIPs
void join( const MIP& );
void join(const MIP&);
// - type (static; default: xsd:string)
// (currently default implemented as empty string)
const OUString& getTypeName() const { return msTypeName; }
void setTypeName( const OUString& );
void setTypeName(const OUString&);
void resetTypeName();
// - readonly (computed XPath; default: false; true if calculate exists)
bool isReadonly() const;
void setReadonly( bool );
void setReadonly(bool);
void resetReadonly();
// - required (computed XPath; default: false)
bool isRequired() const { return mbRequired; }
void setRequired( bool );
void setRequired(bool);
void resetRequired();
// - relevant (computed XPath; default: true)
bool isRelevant() const { return mbRelevant; }
void setRelevant( bool );
void setRelevant(bool);
void resetRelevant();
// - constraint (computed XPath; default: true)
bool isConstraint() const { return mbConstraint; }
void setConstraint( bool );
void setConstraint(bool);
void resetConstraint();
// explain _why_ a constraint failed
void setConstraintExplanation( const OUString& );
void setConstraintExplanation(const OUString&);
const OUString& getConstraintExplanation() const { return msConstraintExplanation; }
// - calculate (computed XPath; default: has none (false))
// (for calculate, we only store whether a calculate MIP is present;
// the actual calculate value is handled my changing the instance
// directly)
void setHasCalculate( bool );
void setHasCalculate(bool);
// - minOccurs/maxOccurs (computed XPath; default: 0/inf)
// - p3ptype (static; no default)
};
} // namespace xforms

View File

@@ -27,19 +27,20 @@
// forward declaractions
namespace com::sun::star::xml::dom
{
class XNodeList;
namespace events { class XEventListener; }
class XNodeList;
namespace events
{
class XEventListener;
}
}
namespace xforms
{
/** PathExpression represents an XPath Expression and caches results */
class PathExpression final : public ComputedExpression
{
public:
typedef std::vector<css::uno::Reference<css::xml::dom::XNode> > NodeVector_t;
typedef std::vector<css::uno::Reference<css::xml::dom::XNode>> NodeVector_t;
private:
/// the node-list result from the last bind (cached from mxResult)
@@ -48,7 +49,6 @@ private:
/// get expression for evaluation
OUString _getExpressionForEvaluation() const;
public:
PathExpression();
~PathExpression();
@@ -56,18 +56,15 @@ public:
/// set the expression string
/// (overridden to do remove old listeners)
/// (also defines simple expressions)
void setExpression( const OUString& rExpression );
void setExpression(const OUString& rExpression);
/// evaluate the expression relative to the content node.
void evaluate( const xforms::EvaluationContext& rContext );
void evaluate(const xforms::EvaluationContext& rContext);
// get the result of this expression as node/node list/...
css::uno::Reference<css::xml::dom::XNode> getNode() const;
const NodeVector_t& getNodeList() const { return maNodes;}
const NodeVector_t& getNodeList() const { return maNodes; }
css::uno::Reference<css::xml::dom::XNodeList> getXNodeList() const;
};
} // namespace xforms

View File

@@ -31,7 +31,7 @@ Serialize an XObject
class CSerialization
{
protected:
css::uno::Reference< css::xml::dom::XDocumentFragment > m_aFragment;
css::uno::Reference<css::xml::dom::XDocumentFragment> m_aFragment;
public:
virtual ~CSerialization() {}
@@ -39,7 +39,7 @@ public:
/**
sets the XObject that is to serialized
*/
void setSource(const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment)
void setSource(const css::uno::Reference<css::xml::dom::XDocumentFragment>& aFragment)
{
m_aFragment = aFragment;
}
@@ -47,7 +47,7 @@ public:
/**
start the serialization process
*/
virtual void serialize()=0;
virtual void serialize() = 0;
/**
get the serialized bytes.
@@ -55,8 +55,7 @@ public:
bytes read.
returns -1 on error
*/
virtual css::uno::Reference< css::io::XInputStream > getInputStream() = 0;
virtual css::uno::Reference<css::io::XInputStream> getInputStream() = 0;
};
#endif

View File

@@ -27,15 +27,15 @@
class CSerializationAppXML : public CSerialization
{
private:
css::uno::Reference< css::io::XPipe > m_xBuffer;
css::uno::Reference<css::io::XPipe> m_xBuffer;
void serialize_node(const css::uno::Reference< css::xml::dom::XNode >& aNode);
void serialize_node(const css::uno::Reference<css::xml::dom::XNode>& aNode);
public:
CSerializationAppXML();
virtual void serialize() override;
virtual css::uno::Reference< css::io::XInputStream > getInputStream() override;
virtual css::uno::Reference<css::io::XInputStream> getInputStream() override;
};
#endif

View File

@@ -29,16 +29,16 @@
class CSerializationURLEncoded : public CSerialization
{
private:
css::uno::Reference< css::io::XPipe > m_aPipe;
css::uno::Reference<css::io::XPipe> m_aPipe;
static bool is_unreserved(char);
static void encode_and_append(const OUString& aString, OStringBuffer& aBuffer);
void serialize_node(const css::uno::Reference< css::xml::dom::XNode >& aNode);
void serialize_node(const css::uno::Reference<css::xml::dom::XNode>& aNode);
public:
CSerializationURLEncoded();
virtual void serialize() override;
virtual css::uno::Reference< css::io::XInputStream > getInputStream() override;
virtual css::uno::Reference<css::io::XInputStream> getInputStream() override;
};
#endif

View File

@@ -25,9 +25,10 @@
class CSubmissionGet : public CSubmission
{
public:
CSubmissionGet(const OUString& aURL, const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment);
virtual SubmissionResult submit(const css::uno::Reference< css::task::XInteractionHandler >& aInteractionHandler) override;
CSubmissionGet(const OUString& aURL,
const css::uno::Reference<css::xml::dom::XDocumentFragment>& aFragment);
virtual SubmissionResult
submit(const css::uno::Reference<css::task::XInteractionHandler>& aInteractionHandler) override;
};
#endif

View File

@@ -25,9 +25,10 @@
class CSubmissionPut : public CSubmission
{
public:
CSubmissionPut(const OUString& aURL, const css::uno::Reference< css::xml::dom::XDocumentFragment >& aFragment);
virtual SubmissionResult submit(const css::uno::Reference< css::task::XInteractionHandler >& aInteractionHandler) override;
CSubmissionPut(const OUString& aURL,
const css::uno::Reference<css::xml::dom::XDocumentFragment>& aFragment);
virtual SubmissionResult
submit(const css::uno::Reference<css::task::XInteractionHandler>& aInteractionHandler) override;
};
#endif

View File

@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "unohelper.hxx"
#include <osl/diagnose.h>
@@ -30,7 +29,6 @@
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
using com::sun::star::uno::Reference;
using com::sun::star::uno::Sequence;
using com::sun::star::uno::Exception;
@@ -39,34 +37,31 @@ using com::sun::star::beans::XPropertySet;
using com::sun::star::beans::XPropertySetInfo;
using com::sun::star::beans::PropertyAttribute::READONLY;
void xforms::copy( const Reference<XPropertySet>& xFrom,
Reference<XPropertySet> const & xTo )
void xforms::copy(const Reference<XPropertySet>& xFrom, Reference<XPropertySet> const& xTo)
{
OSL_ENSURE( xFrom.is(), "no source" );
OSL_ENSURE( xTo.is(), "no target" );
OSL_ENSURE(xFrom.is(), "no source");
OSL_ENSURE(xTo.is(), "no target");
// get property names & infos, and iterate over target properties
Sequence<Property> aProperties =
xTo->getPropertySetInfo()->getProperties();
Sequence<Property> aProperties = xTo->getPropertySetInfo()->getProperties();
sal_Int32 nProperties = aProperties.getLength();
const Property* pProperties = aProperties.getConstArray();
Reference<XPropertySetInfo> xFromInfo = xFrom->getPropertySetInfo();
for( sal_Int32 n = 0; n < nProperties; n++ )
for (sal_Int32 n = 0; n < nProperties; n++)
{
const OUString& rName = pProperties[n].Name;
// if both set have the property, copy the value
// (catch and ignore exceptions, if any)
if( xFromInfo->hasPropertyByName( rName ) )
if (xFromInfo->hasPropertyByName(rName))
{
try
{
Property aProperty = xFromInfo->getPropertyByName( rName );
if ( ( aProperty.Attributes & READONLY ) == 0 )
xTo->setPropertyValue(rName, xFrom->getPropertyValue( rName ));
Property aProperty = xFromInfo->getPropertyByName(rName);
if ((aProperty.Attributes & READONLY) == 0)
xTo->setPropertyValue(rName, xFrom->getPropertyValue(rName));
}
catch( const Exception& )
catch (const Exception&)
{
// ignore any errors; we'll copy as good as we can
}

View File

@@ -30,23 +30,24 @@
#include <com/sun/star/xforms/XModel.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
class CLibxml2XFormsExtension : public cppu::WeakImplHelper<
css::xml::xpath::XXPathExtension, css::lang::XInitialization>
class CLibxml2XFormsExtension
: public cppu::WeakImplHelper<css::xml::xpath::XXPathExtension, css::lang::XInitialization>
{
private:
css::uno::Reference <css::xforms::XModel> m_aModel;
css::uno::Reference <css::xml::dom::XNode> m_aContextNode;
css::uno::Reference<css::xforms::XModel> m_aModel;
css::uno::Reference<css::xml::dom::XNode> m_aContextNode;
public:
CLibxml2XFormsExtension() {}
const css::uno::Reference< css::xforms::XModel >& getModel() const { return m_aModel;}
const css::uno::Reference< css::xml::dom::XNode >& getContextNode() const { return m_aContextNode;}
const css::uno::Reference<css::xforms::XModel>& getModel() const { return m_aModel; }
const css::uno::Reference<css::xml::dom::XNode>& getContextNode() const
{
return m_aContextNode;
}
virtual css::xml::xpath::Libxml2ExtensionHandle SAL_CALL getLibxml2ExtensionHandle() override;
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any >& aSequence) override;
virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& aSequence) override;
};
#endif // INCLUDED_FORMS_SOURCE_XFORMS_XPATHLIB_EXTENSION_HXX

View File

@@ -4252,7 +4252,6 @@ filter/source/xsltfilter/LibXSLTTransformer.hxx
filter/source/xsltfilter/OleHandler.cxx
filter/source/xsltfilter/OleHandler.hxx
filter/source/xsltfilter/XSLTFilter.cxx
forms/source/component/BaseListBox.hxx
forms/source/component/Button.cxx
forms/source/component/Button.hxx
forms/source/component/CheckBox.cxx
@@ -4318,7 +4317,6 @@ forms/source/component/entrylisthelper.hxx
forms/source/component/errorbroadcaster.cxx
forms/source/component/errorbroadcaster.hxx
forms/source/component/findpos.cxx
forms/source/component/findpos.hxx
forms/source/component/formcontrolfont.cxx
forms/source/component/imgprod.cxx
forms/source/component/imgprod.hxx
@@ -4400,7 +4398,6 @@ forms/source/solar/inc/navtoolbar.hxx
forms/source/xforms/NameContainer.hxx
forms/source/xforms/binding.cxx
forms/source/xforms/binding.hxx
forms/source/xforms/boolexpression.cxx
forms/source/xforms/collection.hxx
forms/source/xforms/computedexpression.cxx
forms/source/xforms/computedexpression.hxx
@@ -4410,18 +4407,15 @@ forms/source/xforms/datatyperepository.cxx
forms/source/xforms/datatyperepository.hxx
forms/source/xforms/datatypes.cxx
forms/source/xforms/datatypes.hxx
forms/source/xforms/enumeration.cxx
forms/source/xforms/enumeration.hxx
forms/source/xforms/evaluationcontext.hxx
forms/source/xforms/mip.cxx
forms/source/xforms/mip.hxx
forms/source/xforms/model.cxx
forms/source/xforms/model.hxx
forms/source/xforms/model_helper.hxx
forms/source/xforms/model_ui.cxx
forms/source/xforms/namedcollection.hxx
forms/source/xforms/pathexpression.cxx
forms/source/xforms/pathexpression.hxx
forms/source/xforms/propertysetbase.cxx
forms/source/xforms/propertysetbase.hxx
forms/source/xforms/resourcehelper.cxx
@@ -4429,19 +4423,13 @@ forms/source/xforms/resourcehelper.hxx
forms/source/xforms/submission.cxx
forms/source/xforms/submission.hxx
forms/source/xforms/submission/replace.cxx
forms/source/xforms/submission/serialization.hxx
forms/source/xforms/submission/serialization_app_xml.cxx
forms/source/xforms/submission/serialization_app_xml.hxx
forms/source/xforms/submission/serialization_urlencoded.cxx
forms/source/xforms/submission/serialization_urlencoded.hxx
forms/source/xforms/submission/submission.hxx
forms/source/xforms/submission/submission_get.cxx
forms/source/xforms/submission/submission_get.hxx
forms/source/xforms/submission/submission_post.cxx
forms/source/xforms/submission/submission_post.hxx
forms/source/xforms/submission/submission_put.cxx
forms/source/xforms/submission/submission_put.hxx
forms/source/xforms/unohelper.cxx
forms/source/xforms/unohelper.hxx
forms/source/xforms/xforms_services.cxx
forms/source/xforms/xformsevent.cxx
@@ -4449,7 +4437,6 @@ forms/source/xforms/xformsevent.hxx
forms/source/xforms/xmlhelper.cxx
forms/source/xforms/xmlhelper.hxx
forms/source/xforms/xpathlib/extension.cxx
forms/source/xforms/xpathlib/extension.hxx
forms/source/xforms/xpathlib/xpathlib.cxx
forms/source/xforms/xpathlib/xpathlib.hxx
formula/source/core/api/FormulaCompiler.cxx