2010-10-12 15:59:03 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-07-09 10:56:41 +00:00
|
|
|
#include "GroupExchange.hxx"
|
|
|
|
#include <sot/formats.hxx>
|
|
|
|
#include <sot/storage.hxx>
|
|
|
|
|
|
|
|
namespace rptui
|
|
|
|
{
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
|
2015-03-12 14:53:28 +02:00
|
|
|
SotClipboardFormatId OGroupExchange::getReportGroupId()
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2015-03-12 14:53:28 +02:00
|
|
|
static SotClipboardFormatId s_nReportFormat = static_cast<SotClipboardFormatId>(-1);
|
|
|
|
if ( static_cast<SotClipboardFormatId>(-1) == s_nReportFormat )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2015-11-06 09:36:37 +01:00
|
|
|
s_nReportFormat = SotExchange::RegisterFormatName("application/x-openoffice;windows_formatname=\"reportdesign.GroupFormat\"");
|
2015-03-12 14:53:28 +02:00
|
|
|
OSL_ENSURE(static_cast<SotClipboardFormatId>(-1) != s_nReportFormat, "Bad exchange id!");
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
|
|
|
return s_nReportFormat;
|
|
|
|
}
|
|
|
|
OGroupExchange::OGroupExchange(const uno::Sequence< uno::Any >& _aGroupRow)
|
|
|
|
: m_aGroupRow(_aGroupRow)
|
|
|
|
{
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2007-07-09 10:56:41 +00:00
|
|
|
void OGroupExchange::AddSupportedFormats()
|
|
|
|
{
|
2019-05-03 22:11:02 +03:00
|
|
|
if ( m_aGroupRow.hasElements() )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
|
|
|
AddFormat(OGroupExchange::getReportGroupId());
|
|
|
|
}
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-06-13 11:12:50 -04:00
|
|
|
bool OGroupExchange::GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& /*rDestDoc*/ )
|
2007-07-09 10:56:41 +00:00
|
|
|
{
|
2015-03-12 14:53:28 +02:00
|
|
|
SotClipboardFormatId nFormat = SotExchange::GetFormat(rFlavor);
|
2007-07-09 10:56:41 +00:00
|
|
|
if(nFormat == OGroupExchange::getReportGroupId() )
|
|
|
|
{
|
2017-05-03 15:06:07 +02:00
|
|
|
return SetAny(uno::makeAny(m_aGroupRow));
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
2014-03-25 11:01:20 +02:00
|
|
|
return false;
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2007-07-09 10:56:41 +00:00
|
|
|
void OGroupExchange::ObjectReleased()
|
|
|
|
{
|
|
|
|
m_aGroupRow.realloc(0);
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2007-07-09 10:56:41 +00:00
|
|
|
}
|
2010-10-12 15:59:03 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|