Kaydet (Commit) eeccf1be authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: fdo#88562 Nothing actually sets ID_FILETP_READONLY or ID_FILETP_TITLE

so docs cannot be toggled r/o r/w from properties page or the file name
changed. Unkink the logic a bit based on that and move now static widget
settings to .ui and remove unused checkbox

Change-Id: Ic55e41be8ffd02e214a233a2eb90736c070b5418
üst 7cb5b211
......@@ -184,7 +184,6 @@ private:
PushButton* m_pChangePassBtn;
SelectableFixedText* m_pShowTypeFT;
CheckBox* m_pReadOnlyCB;
FixedText* m_pFileValFt;
SelectableFixedText* m_pShowSizeFT;
......
......@@ -159,10 +159,6 @@
#define SID_EXPLORER_FILEPROPS_START (SID_SFX_START + 1390)
// SID_EXPLORER_FILEPROPS_END (SID_SFX_START + 1399)
#define ID_FILETP_START SID_EXPLORER_FILEPROPS_START
#define ID_FILETP_READONLY (ID_FILETP_START + 0)
#define ID_FILETP_TITLE (ID_FILETP_START + 1)
#define SID_ATTR_ZOOM (SID_SVX_START + 0)
#define SID_EXPLORER_PROPS_START (SID_SFX_START + 1410)
......
......@@ -751,11 +751,9 @@ SfxDocumentPage::SfxDocumentPage(vcl::Window* pParent, const SfxItemSet& rItemSe
{
get(m_pBmp, "icon");
get(m_pNameED, "nameed");
//FIXME m_pNameED->SetAccessibleName( SfxResId( EDIT_FILE_NAME ).toString() );
get(m_pChangePassBtn, "changepass");
get(m_pShowTypeFT, "showtype");
get(m_pReadOnlyCB, "readonlycb");
get(m_pFileValFt, "showlocation");
get(m_pShowSizeFT, "showsize");
m_aUnknownSize = m_pShowSizeFT->GetText();
......@@ -910,8 +908,6 @@ SfxTabPage* SfxDocumentPage::Create( vcl::Window* pParent, const SfxItemSet* rIt
return new SfxDocumentPage( pParent, *rItemSet );
}
void SfxDocumentPage::EnableUseUserData()
{
bEnableUseUserData = true;
......@@ -919,8 +915,6 @@ void SfxDocumentPage::EnableUseUserData()
m_pDeleteBtn->Show();
}
bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet )
{
bool bRet = false;
......@@ -963,23 +957,9 @@ bool SfxDocumentPage::FillItemSet( SfxItemSet* rSet )
}
}
if ( m_pNameED->IsModified() && !m_pNameED->GetText().isEmpty() )
{
rSet->Put( SfxStringItem( ID_FILETP_TITLE, m_pNameED->GetText() ) );
bRet = true;
}
if ( /* m_pReadOnlyCB->IsModified() */ true )
{
rSet->Put( SfxBoolItem( ID_FILETP_READONLY, m_pReadOnlyCB->IsChecked() ) );
bRet = true;
}
return bRet;
}
void SfxDocumentPage::Reset( const SfxItemSet* rSet )
{
// Determine the document information
......@@ -1006,33 +986,13 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
}
// determine name
OUString aName;
const SfxPoolItem* pItem = 0;
if ( SfxItemState::SET != rSet->GetItemState( ID_FILETP_TITLE, false, &pItem ) )
{
INetURLObject aURL(aFile);
aName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET );
if ( aName.isEmpty() || aURL.GetProtocol() == INET_PROT_PRIVATE )
aName = SfxResId( STR_NONAME ).toString();
m_pNameED->SetReadOnly( true );
}
else
{
DBG_ASSERT( pItem->IsA( TYPE( SfxStringItem ) ), "SfxDocumentPage:<SfxStringItem> expected" );
aName = static_cast<const SfxStringItem*>( pItem )->GetValue();
}
INetURLObject aURL(aFile);
OUString aName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET );
if ( aName.isEmpty() || aURL.GetProtocol() == INET_PROT_PRIVATE )
aName = SfxResId( STR_NONAME ).toString();
m_pNameED->SetText( aName );
m_pNameED->ClearModifyFlag();
// determine RO-Flag
if ( SfxItemState::UNKNOWN == rSet->GetItemState( ID_FILETP_READONLY, false, &pItem )
|| !pItem )
m_pReadOnlyCB->Hide();
else
m_pReadOnlyCB->Check( static_cast<const SfxBoolItem*>(pItem)->GetValue() );
// determine context symbol
INetURLObject aURL;
aURL.SetSmartProtocol( INET_PROT_FILE );
aURL.SetSmartURL( aFactory);
const OUString& rMainURL = aURL.GetMainURL( INetURLObject::NO_DECODE );
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkGrid" id="DocumentInfoPage">
......@@ -22,6 +22,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -36,6 +38,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -50,6 +54,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -64,6 +70,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -78,6 +86,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">10</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -92,6 +102,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">11</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -105,6 +117,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -118,6 +132,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -132,6 +148,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -145,6 +163,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">9</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -158,6 +178,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">10</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -171,6 +193,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">11</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -188,6 +212,7 @@
<property name="left_attach">0</property>
<property name="top_attach">12</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -202,6 +227,8 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">12</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -217,6 +244,8 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">8</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -231,6 +260,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -244,6 +275,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -258,6 +291,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -272,6 +307,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -287,6 +324,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -299,6 +338,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -314,22 +355,8 @@
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="readonlycb">
<property name="label" translatable="yes">_Read-only</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -344,6 +371,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -357,6 +386,8 @@
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -376,6 +407,8 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -384,11 +417,14 @@
<property name="can_focus">True</property>
<property name="valign">center</property>
<property name="hexpand">True</property>
<property name="editable">False</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
......@@ -396,6 +432,7 @@
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -407,6 +444,7 @@
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">3</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -433,5 +471,8 @@
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment