This commit is contained in:
Kathy Ruffing 2009-05-05 13:31:29 +00:00
parent 16f3af2b37
commit 8b2435c876

View File

@ -27,8 +27,8 @@ namespace Volian.Controls.Library
LoadTree();
}
}
private string _CurROLink;
public string CurROLink
private RoUsageInfo _CurROLink;
public RoUsageInfo CurROLink
{
get { return _CurROLink; }
set
@ -51,7 +51,7 @@ namespace Volian.Controls.Library
}
}
}
private string _SavCurROLink;
private RoUsageInfo _SavCurROLink;
private StepRTB _MyRTB;
public StepRTB MyRTB
{
@ -66,7 +66,7 @@ namespace Volian.Controls.Library
_MyRTB.LinkChanged += new StepRTBLinkEvent(_MyRTB_LinkChanged);
if (_MyRTB.MyLinkText == null)
{
CurROLink = null; //_CurROLink
CurROLink = null;
_SavCurROLink = null;
}
}
@ -78,7 +78,7 @@ namespace Volian.Controls.Library
CurROLink = null;
else
{
CurROLink = args.MyLinkText.RoUsageid;
CurROLink = args.MyLinkText.MyRoUsageInfo;
}
}
@ -145,9 +145,9 @@ namespace Volian.Controls.Library
selectedChld = chld;
if (chld.value != null)
{
string SavROLink = "";
RoUsageInfo SavROLink = null;
if (_SavCurROLink != null)
SavROLink = _SavCurROLink.Substring(_SavCurROLink.IndexOf(' ') + 1, 12);
SavROLink = _SavCurROLink; ;
lbROId.Text = chld.appid;
btnSaveRO.Enabled = ((_SavCurROLink == null) || !(chld.roid.Equals(SavROLink)));
btnCancelRO.Enabled = ((_SavCurROLink != null) && !(chld.roid.Equals(SavROLink)));
@ -295,10 +295,10 @@ namespace Volian.Controls.Library
{
// walk down from root of tree, expanding values in the string
// that represents the ro link.
string tmpstr = _CurROLink;
int sp = tmpstr.IndexOf(" "); // because parse of ro info is wrong!!
int rousageid = System.Convert.ToInt32(tmpstr.Substring(0, sp));
string roid = tmpstr.Substring(sp + 1, tmpstr.Length - sp - 1);
//string tmpstr = _CurROLink;
//int sp = tmpstr.IndexOf(" "); // because parse of ro info is wrong!!
//int rousageid = System.Convert.ToInt32(tmpstr.Substring(0, sp));
string roid = _CurROLink.ROID; // tmpstr.Substring(sp + 1, tmpstr.Length - sp - 1);
string db = roid.Substring(0, 4);
bool multValSel = false;
if (roid.Length == 16)
@ -386,22 +386,10 @@ namespace Volian.Controls.Library
_MyRTB.inRoAdd = true;
if (CheckROSelection(roch))
{
string ROID = roch.roid;
using (RODb rodb = RODb.Get(_MyROFST.MyRODb.RODbID))
{
// saving of selstart & end is a work around - the Makerousage updates contentinfo object
// which caused the selection in _MyRTB to be changed. This inserted the ro at an incorrect
// location in the string.
int selstart = _MyRTB.SelectionStart;
int sellen = _MyRTB.SelectionLength;
RoUsage ro = RoUsage.MakeRoUsage(MyRTB.MyItemInfo.MyContent.Get(), ROID, null, rodb);
string linktxt = string.Format(@"#Link:ReferencedObject:{0} {1} {2}", ro.ROUsageID, ROID, rodb.RODbID);
string linktxt = string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", roch.roid, _MyROFST.MyRODb.RODbID);
// Resolve symbols and scientific notation in the RO return value
_MyRTB.SelectionStart = selstart;
_MyRTB.SelectionLength = sellen;
_MyRTB.InsertRO(ConvertSymbolsAndStuff(tbROValue.Text), linktxt);
}
}
_MyRTB.inRoAdd = false;
}
else // we're in an Word attachment